Skip to content

feat(api): bootstrap contract inventory and fail-closed compatibility gates - #424

Draft
VPRamon wants to merge 2 commits into
mainfrom
codex/api-contract-hardening
Draft

VPRamon wants to merge 2 commits into
mainfrom
codex/api-contract-hardening

Conversation

@VPRamon

@VPRamon VPRamon commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Independent releases currently lack trustworthy producer/consumer evidence. This draft adds exact artifact contract bundles and a deployment-plan gate that checks frontend and MCP independently against Server or Cloud, including unchanged historical consumers. Missing artifacts, mismatched versions/source SHAs/digests, unsupported changed constraints, and incompatible contracts fail with structured diagnostics.

Related to #423. This does not complete the P0 prerequisite and must remain draft.

Implemented

  • Inventory of all 245 compiled API operations (241 Server, 245 Cloud), separating origin-root OAuth discovery/protocol routes and excluding the Node MCP transport.
  • Explicit schemas for 39 operations: metadata/provider discovery, current user, MCP principal, Cloud account flows, OAuth discovery, and all 25 use-case operations. The remaining 206 operations are explicitly marked unverified; no guessed success schemas are presented as proof.
  • Reproducible TypeScript wire models adopted for metadata/principal and selected use-case consumers, generated route expectations, and source-review drift detection.
  • Version-controlled MCP compatibility metadata retained in images; unchanged runtime CompatibilityBanner behavior.
  • Offline artifact-bundle compatibility command, immutable deployment-plan inputs, PR baseline checks, and reusable CI. Every existing image publisher depends on the checks. The candidate bundle is checked against the exact tagged source, and unchanged artifact bundles are never substituted with main.
  • Isolated PostgreSQL integration plus a live Rocket process exercised by the actual frontend transport and MCP client. Recorded traffic excludes credentials.

Validation

  • 39 Python positive/negative checks pass, including independent-version fixtures, missing historical artifacts, altered required fields/enums/types/authentication, candidate identity, and genuine process exit codes.
  • Compiled Server/Cloud route inventory test passes.
  • Real backend smoke passes: 15 audited exchanges, 33 explicitly inventory-only exchanges; corrupted copies of real traffic reject a removed guaranteed response property, wrong response type, and wrong MCP request type.
  • Rust workspace tests: 2,061 passed, one ignored; Clippy and rustfmt pass. Default workspace feature unification uses test helpers; the separate isolated production-path run supplies real database/HTTP evidence.
  • Frontend: build and 704-test coverage run pass (70.36% lines). One earlier report-builder failure passed in isolation and the full coverage rerun.
  • MCP: build and all 51 tests pass. Legacy JS: 411 passed, seven skipped. Stylelint passes; unused-CSS check exits 0 with existing warnings.
  • Frontend production npm audit passes. Existing MCP lockfile audit fails with one high/three moderate advisories. Existing Rust advisory audit fails on RUSTSEC-2026-0384, RUSTSEC-2026-0385 and RUSTSEC-2026-0387. No audit gate was relaxed.
  • The release completeness check intentionally exits 1 for the remaining 206 operations. Source-bound bundle export was verified after committing.

Merge/release blockers and remaining work

Merging this draft as-is blocks all image publication. Complete the remaining 206 wire audits, per-consumer operation selection and request/response type adoption, broader Cloud/session/OAuth integration coverage, and retention/audit of real historical release contracts. Resolve the existing security failures before release readiness. The current conservative bundles require the entire backend surface and can reject unrelated changes.

The architecture assessment, policy, update procedure, exact changed-file list, commands/results, exclusions and remaining risks are in the HTTP contract report and release documentation. The component-tag architecture is retained; global release migration and deployment remain in #423. Production/VPS configuration was not changed.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Frontend Code Coverage

Frontend SPA coverage (by module)

Module Line Rate Branch Rate Function Rate Health
api 89.1% (311 / 349) 82.7% 86.0% ✔
components 74.1% (2234 / 3015) 62.6% 70.5% ➖
components/graph 100.0% (9 / 9) 66.7% 100.0% ✔
components/reports 86.1% (87 / 101) 70.6% 74.1% ✔
components/table 100.0% (7 / 7) 80.0% 100.0% ✔
context 77.8% (56 / 72) 40.0% 69.6% ➖
hooks 72.3% (146 / 202) 71.1% 70.0% ➖
lib 100.0% (18 / 18) 100.0% 100.0% ✔
pages 68.8% (2332 / 3392) 55.5% 61.1% ➖
pages/catalog 34.8% (162 / 465) 24.5% 18.3% ❌
pages/groups 0.0% (0 / 219) 0.0% 0.0% ❌
src (root) 33.3% (8 / 24) 38.1% 60.0% ❌
types 100.0% (0 / 0) 100.0% 100.0% ✔
utils 97.2% (620 / 638) 89.1% 98.8% ✔
Summary 70.4% (5990 / 8511) 59.1% 65.1% ➖

Generated from Vitest @vitest/coverage-v8 (frontend/src).

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
marreq-core.src.use_case_document 94% 0 ✔
marreq-server.src 57% 0 ➖
marreq-core.src.services 93% 0 ✔
marreq-core.src.models 80% 0 ✔
marreq-core.src.auth 90% 0 ✔
marreq-cloud.src.fairings 100% 0 ✔
marreq-cloud.src.api 78% 0 ✔
marreq-core.src.fairings 90% 0 ✔
marreq-core.src.diff 100% 0 ✔
marreq-core.src.helper_functions 95% 0 ✔
marreq-cloud.src 71% 0 ➖
marreq-core.src.api 83% 0 ✔
marreq-core.src.auth.rate_limiter 73% 0 ➖
marreq-core.src 80% 0 ✔
marreq-core.src.importers 74% 0 ➖
marreq-core.src.repository.cache 100% 0 ✔
marreq-core.src.repository.diesel_repo 5% 0 ❌
marreq-core.src.auth.guards 57% 0 ➖
marreq-core.src.generators 90% 0 ✔
marreq-core.src.routes 61% 0 ➖
marreq-core.src.reports 95% 0 ✔
marreq-core.src.services.semantic_search 75% 0 ➖
marreq-core.src.storage 93% 0 ✔
marreq-core.src.deployment 84% 0 ✔
marreq-core.src.reqif 97% 0 ✔
marreq-cloud.src.services 91% 0 ✔
marreq-core.src.validation 96% 0 ✔
marreq-core.src.repository 88% 0 ✔
Summary 81% (45266 / 56209) 0 ✔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant