Skip to content

test(mcp): assert snapshot-import and unknown-receipt facts instead of guidance prose - #11004

Merged
morluto merged 1 commit into
mainfrom
test/mcp-wording
Nov 15, 2026
Merged

morluto merged 1 commit into
mainfrom
test/mcp-wording

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #10508 (Phase 6.1, first MCP slice). Two MCP boundary test files matched guidance sentences for facts the error already carries as structured fields: details.reason, retryable and reported_limits.committed_unknown. They now assert those fields, plus tool and parameter names where no field exists. Production code is unchanged.

Problem and expected behavior

  • workflowSnapshotReplayMcp.test.ts: the snapshot-import helper checked five fragments of one guidance sentence, including "loads and updates" and "not been validated". A second test checked "not been validated" again. The structured details: { operation: "read", reason: "wrong-kind" } was not asserted.
  • serverUnknownsMcp.test.ts: checked "cannot reconcile" next to code: "evidence_integrity_mismatch", "do not repeat record_unknown" next to retryable: false and details.reason: "already-exists", and "Do not repeat the completed mutation" and "may be too large" next to reported_limits.committed_unknown and evidence_reference.

Change and scope

  • Snapshot import: asserts code plus details.operation and details.reason. The remediation keeps only the restore route names, open_binary, snapshot_path and --snapshot, and the snapshot-shaped case asserts snapshot_path. No structured field says "the input is an analysis snapshot", so those parameter names are what tells snapshot guidance apart from other wrong-kind refusals.
  • Unknown receipts: the four prose fragments are removed. The structured fields above were already asserted beside them, and export_evidence_bundle (a tool name) stays.
  • Kept, no structured field yet: not.toContain("or page list_unknowns") (whether paging is offered), and the overflow list guidance "same connection" / "smaller limit" / not "CLI JSON". The retry route has no structured next_operation (see [Design] Assert structured remediation facts instead of guidance prose #10508).

Not included: other MCP files. largeToolResult.test.ts already compares against the producer functions (stdioResponseBudgetRecovery, nodeStringCeilingRecovery) rather than literal prose.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: tests only; owners read: EvidenceBundleFiles (snapshot refusal), unknown registry receipts
  • Contribution scope fit and linked maintainer decision: not applicable (test-only, Phase 6.1 tracker [Design] Assert structured remediation facts instead of guidance prose #10508)
  • CLI and MCP/tool-catalog contract: none
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests updated: the two files above; test count unchanged (9 + 8).
  • Mutation (run locally, then reverted): with the resemblesAnalysisSnapshot branch in src/application/EvidenceBundleFiles.ts disabled, snapshot-shaped input falls through to the integrity error. Four tests fail, including "does not authenticate snapshot-shaped or unrelated malformed bundle input", on the code/details match.
  • User-visible CLI/MCP output: none
  • Remaining proof gaps: a removed safety sentence ("snapshot content has not been validated") is no longer pinned; no field carries that fact.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/mcp/workflowSnapshotReplayMcp.test.ts: 9 passed (5.4 s)
  • npm run test:focused -- tests/boundary/mcp/serverUnknownsMcp.test.ts: 8 passed (15.1 s)
  • the mutation above: 4 failed as described, then reverted
  • npx oxfmt --check on both files: clean

Compatibility, safety, and release

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: macOS only
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T09:56:45.817239Z 9ffee5f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

This test-only PR replaces guidance-sentence checks with structured error facts. Production code is unchanged.

  • Snapshot-import tests check the structured wrong-kind reason.
  • Unknown-operation tests stop requiring exact guidance wording.

Reviews (2) · Last reviewed commit: "test(mcp): assert snapshot-import and un..." · Reviewed by Greptile

@morluto
morluto merged commit 4a13082 into main Nov 15, 2026
7 checks passed
@morluto
morluto deleted the test/mcp-wording branch November 15, 2026 09:58
@morluto morluto added the area: mcp MCP server, transport, and tool registration label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant