Skip to content

MCP tests: allow trailing diagnostic snapshots after approval clears - #1456

Open
bcgalvin wants to merge 3 commits into
repoprompt:mainfrom
bcgalvin:fix/1452-mcp-approval-snapshot
Open

bcgalvin wants to merge 3 commits into
repoprompt:mainfrom
bcgalvin:fix/1452-mcp-approval-snapshot

Conversation

@bcgalvin

Copy link
Copy Markdown
Contributor

Fixes #1452

Summary

The two-window approval test required exactly five state snapshots. The controller posts denial diagnostics from an unawaited task, and diagnostic updates can add a full snapshot before unsubscription.

Check the exact five-snapshot approval prefix, then require fully cleared approval fields and non-default diagnostics on every trailing snapshot. Await a diagnostic marker before unsubscribing so the trailing case is always exercised. In this fixture, an extra clear before diagnostic publication would still fail.

Test-only; production publication is unchanged. The distinct-generation and decision assertions remain. The fixture has no process principal, so nil-path checks cover clearing, not non-nil propagation. The controlled red demonstrates the brittle count assertion, not the historical publisher.

Validation

Candidate: 1585ce45b858b24ebafd6166ccf5249288ecf573.

  • Controlled red on ab84d47e plus the awaited marker (recorded later as 0560ab84): 1 test, 1 failure at the old equality, observing [nil, 1, nil, 2, nil, nil] instead of five entries.
  • Focused filter RepoPromptTests.MCPConnectionAdmissionTests/testTwoWindowServiceResponsesCannotResolveSuccessorGeneration: 1 test, 0 failures. Executed source is byte-identical to the candidate.
  • Formatting, strict lint and safety preflight passed.
  • Full local pr-ready failed: 6,598 tests executed, 8 skipped, 1 failure in AgentTranscriptPaneSnapshotPublicationTests/testTargetReplacementDropsOutgoingRowsFromPublishedSnapshot at AgentTranscriptRestorationPresentationTests.swift:2628 (XCTAssertFalse failed - precondition: outgoing rows), the exact signature tracked in Flaky test: testTargetReplacementDropsOutgoingRowsFromPublishedSnapshot fails when run more than once in a test process #1428. This branch does not touch that test or its fixture; its relationship to this change remains unproven. The MCP approval test rejects an extra cleared-state snapshot #1452 test passed in that run. No isolated retry was run.
  • No live app/UI/provider validation; this changes an in-process test assertion.

Stage-2 reproduction for repoprompt#1452. Await a fixed diagnostic publication before unsubscribing and assert approval identity remains correct. Intentionally retain the original failing exact-count assertion; no production or semantic-oracle fix is included.
Preserve the ordered approval identity prefix and exact decisions while checking every trailing snapshot remains fully cleared. Require the controlled diagnostic marker within that suffix. Fixes repoprompt#1452.
Require non-default diagnostics on trailing cleared snapshots so an extra clear cannot masquerade as a legitimate diagnostic publication. Keep the ordered identity prefix, marker and exact decisions unchanged.

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the PR diff; no actionable defects found.

This branch has not been deployed

No deployments
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.

MCP approval test rejects an extra cleared-state snapshot

2 participants