Skip to content

fix: harden evidence lifecycle and MCP contracts - #461

Merged
morluto merged 9 commits into
mainfrom
agent/comprehensive-repository-audit
Aug 3, 2026
Merged

fix: harden evidence lifecycle and MCP contracts#461
morluto merged 9 commits into
mainfrom
agent/comprehensive-repository-audit

Conversation

@morluto

@morluto morluto commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR closes the main developer-experience bottlenecks found in the repository audit.

  • Makes retained evidence bundles explicitly session-scoped, releasable, permission-checked, snapshot-observable, and URI-invalidating.
  • Fixes evidence import accounting, malformed bookmark facet handling, navigation capability-mode reporting, and observer failure containment.
  • Publishes fail-closed MCP JSON Schema constraints for cross-field pairs, sensitive-data approvals, Evidence-source alternatives, export-shape links, and the complete readiness-stage set.
  • Separates MCP boundary tests into a dedicated threaded Vitest project while preserving the existing two-worker cap and routing all standard scripts through the new project.
  • Refreshes generated catalogs, documentation facts, package metadata, completion evidence, and contributor-facing test guidance.
  • Removes the remaining Oxlint debt by extracting contract helpers and session schemas, decomposing MCP server/session registration, and reducing complexity in provenance and process-tree reconstruction.

Related: #18

Root causes addressed

Runtime refinements were stronger than the advertised MCP schemas, so clients could be told that invalid inputs were valid. Retained evidence deletion bypassed the session’s mutation/notification/authorization boundaries. The MCP suite shared the slower fork-based boundary execution path, which increased process overhead and made the intended test ownership unclear. These changes move the constraints and lifecycle rules to their canonical boundaries instead of adding caller-specific workarounds.

The review follow-up corrected seven gaps: readiness-stage cardinality is nested under properties.stages without closing partial compositional schemas; passive and scenario capture inputs are mutually exclusive; bundle analysis inherits all relevant console/JSON/WebSocket/source-map approvals; source comparison requires exactly one application source; navigation preserves the most specific unavailable-mode reason instead of collapsing unsupported hosts to provider_missing; and releasing a retained evidence bundle notifies subscribers for the exact invalidated URI.

The CI documentation failure had a separate generated-artifact root cause: the committed managed-conformance manifest had been generated under Node 22 while CI uses the repository’s Node 24 runtime. The manifest was regenerated under Node 24.18.0 and validated with docs:check.

Validation

  • npm run test:fast — passed: 305 files, 1,522 tests.
  • npm run test:integration — passed: 184 files, 957 tests.
  • npm run verify:test-temp-hygiene — passed: 324 files, 1,641 tests; no owned temporary residues.
  • npm run check:ci — passed.
  • npm run docs:check — passed under Node 24.18.0.
  • Focused MCP boundary regressions for schema advertisement and evidence release — passed.
  • npm run format:check, npm run typecheck, and npm run lint — passed; Oxlint reports 0 warnings and 0 errors.
  • Fresh PR CI at head 918faa9f — all checks passed, including all four test shards, coverage/timing, package E2Es, Windows Ghidra, Docs Generation, static checks, real browser, and real replay.
  • TypeDoc still emits 196 existing non-fatal “referenced but not included in documentation” warnings during docs:check; the generated-document check passes.

Real Hopper and managed-tool verifiers were not run in this Linux checkout because their external provider prerequisites were unavailable. The CI real browser, replay, and Windows Ghidra lanes passed.

Review notes

All seven actionable review threads were addressed and marked resolved. The final tree was checked with focused behavioral tests, deterministic suites, static gates, generated-document checks, fresh CI, and exact-diff inspection.

@morluto
morluto marked this pull request as ready for review August 3, 2026 17:38
@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8657af4e46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/contracts/toolSchemaJsonOverrides.ts
Comment thread src/application/CapabilityInventory.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b069e770d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/contracts/toolSchemaJsonOverrides.ts Outdated
Comment thread src/contracts/toolSchemaJsonOverrides.ts
Comment thread src/contracts/toolSchemaJsonOverrides.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e60bf8b7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server/registerSessionRecordTools.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 926cef35fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/contracts/toolSchemaJsonOverrides.ts Outdated
@morluto
morluto merged commit 5155924 into main Aug 3, 2026
17 checks passed
@morluto
morluto deleted the agent/comprehensive-repository-audit branch August 3, 2026 19:00
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