Repository navigation
feat: replay all continuity scenarios over real MCP stdio transport - #3060
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 448cbb8f8b
ℹ️ 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".
| async def _provider_usage(self, step: ContinuityRouteStep) -> ContinuityRouteObservation: | ||
| report = await self._archive.provider_usage_report( | ||
| origin=step.origin, | ||
| limit=step.page_size, | ||
| detail=step.detail, | ||
| ) |
There was a problem hiding this comment.
Scope the cost route to the target run
In any audited archive containing other token-bearing Claude Code sessions, this call aggregates their usage as well: Polylogue.provider_usage_report only accepts origin, limit, and detail, with no repository or session filter. The scenario nevertheless compares that aggregate with facts for one planted continuity run, so a healthy live archive will fail the cost scenario whenever it contains unrelated usage from the same origin. Execute this scenario against an isolated corpus or use a route that can scope usage to the target session.
Useful? React with 👍 / 👎.
Problem polylogue-t8t needs a durable black-box spec for seven operator continuity jobs plus the parallel-Claude incident replay, graded by an independent oracle rather than a caller-supplied observation. PR #3060 (GPT-Pro lin-02 r01) rewrote the scaffold to run through the real Polylogue API facade, but never proved the MCP transport, exact-count completeness, or the original incident curriculum grading (AC 3-5 partial/remaining per the bead's own AC matrix). PR #3064 separately added one MCP-stdio scenario ("mcp-query-transaction") on top of the old dataclass scaffold, incrementally, without adopting the ScenarioSpec-based rewrite. Solution Reconciles GPT-Pro lin-02 revision r02 (a full replacement package, not a patch on r01) against current master, which had drifted from both packages' common base commit via #3064's incremental scenario: - polylogue/product/continuity_scenarios.py: ContinuityScenarioSpec now subclasses the existing scenarios.NamedScenarioSource seam. All eight jobs (seven operator jobs + parallel-Claude incident) declare typed discovery requirements, coverage inventories, accepted plan signatures, exact item-identity paths, stop conditions, and call/page/aggregate/elapsed/cancellation-grace budgets. - devtools/continuity_replay.py: default replay path launches the production read-role MCP server as a child process and drives it over the official MCP SDK/stdio JSON-RPC, recording discovery receipts before executing any scenario. Every aggregate-capable terminal unit gets a separate `| count` probe cross-checked against enumerated identities, rejecting page-local/wrapper-rewritten totals. - The parallel incident now carries a six-case sanitized curriculum (candidate-list, operator-phrase, lexical-proxy, hidden-grammar, and two correctly-formulated-but-failed-execution cases) planted separately from its expected grades, plus six executable mutation families (lost continuation state, capped pseudo-total, identical- call topology replay, hidden discovery, missing coverage, unreasonable-query classification). - polylogue/mcp/server_prompts.py: fixes two shipped prompt recipes that advertised parser-invalid `query_units` expressions (`unacknowledged_failures` embedded `since` inside an action predicate; `sessions_touching_file` used a bare `repo:` file predicate instead of `session.repo:`). tests/unit/mcp/ test_prompt_query_parity.py parses every shipped recipe against the production parser and discovered tool schema so this can't regress. - tests/infra/continuity.py / continuity_mutations.py / tests/data/ continuity/catalog.json: schema-v2 corpus/oracle separation — `seed_continuity_archive()` builds real archive tiers from planted corpus facts only; the oracle section is never derived from a production route. Reconciliation performed by hand: r02's PATCH.diff (generated against the same pre-#3064 base commit as r01) applied cleanly to continuity_scenarios.py by context-matching around #3064's inserted "mcp-query-transaction" scenario block, stranding it as a dead old-signature `_scenario(...)` call incompatible with the new constructor (7 positional args against a 3-positional/keyword-only signature) — this is removed here since r02's all-scenario MCP-stdio replay, exact-count probes, and mutation matrix supersede what that single incremental scenario proved. devtools/continuity_replay.py and the two continuity test files conflicted directly against #3064's additions during a 3-way apply; resolved by taking r02's full replacement content, since both r01 and r02 replace this architecture wholesale and #3064 built incrementally on the version being replaced. This does not close polylogue-t8t. AC 6 (z9gh.7 live-archive/cold-model terminal gate) remains open; the catalog is corpus-parameterized and ready for a live oracle but no live archive was accessed. Verification - devtools test tests/unit/product/test_continuity_scenarios.py tests/unit/mcp/test_prompt_query_parity.py tests/integration/test_continuity_replay.py -> 20 passed - devtools test tests/unit/mcp/test_server_surfaces.py -> 83 passed (no MCP tool-surface regression from the prompt-recipe fix) - ruff format --check / ruff check / mypy --strict on all 9 changed/added files -> clean - devtools render all --check -> exit 0, no modules added, no topology-projection regen needed Ref polylogue-t8t
448cbb8 to
1963ef8
Compare
…02-continuity-r02
Problem A repeated logical query_units row on a later continuation page could survive fact and evidence reducers even when the server advanced its offset. What changed Preserve stable identities from returned unit rows across pages and report the duplicate page and identity. Exercise the real registered FastMCP query_units route for both a distinct six-page enumeration and a repeated row with offsets advancing from 0 to 17 to 34. Ref polylogue-t8t Co-Authored-By: Codex <[email protected]>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Revision r02 of the
polylogue-t8tcontinuity replay slice (supersedes the r01 content previously on this branch). Replaces the survivingContinuityScenarioSpecdataclass draft and the caller-supplied-observation-onlydevtools/continuity_replay.pywith an executable declaration catalog that drives the real production MCP server over stdio JSON-RPC for all eight scenarios (the sevenpolylogue-t8toperator jobs plus the parallel-Claude incident), with exact-count pagination proofs, a six-case incident curriculum, and six executable mutation families.Problem
r01 (the version previously on this branch) executed scenarios through the
PolylogueAPI facade directly, not through MCP — it proved query/parser/storage behavior but not MCP discovery, transport, or response-budget behavior, and left AC items 3-5 (transcript/receipt classification, original-incident curriculum grading, and the full mutation-family set) partial. Separately, PR #3064 (test: replay MCP continuity transactions, merged) added one incremental MCP-stdio scenario (mcp-query-transaction) directly onto the still-live dataclass scaffold — narrower in scope (one scenario, not the full catalog) and architecturally incompatible with the ScenarioSpec-based rewrite both r01 and r02 make.Solution
polylogue/product/continuity_scenarios.py:ContinuityScenarioSpecsubclasses the existingscenarios.NamedScenarioSourceseam. Eight declarations carry typed discovery requirements, coverage inventories, accepted plan signatures, exact item-identity paths, stop conditions, and call/page/aggregate/elapsed/cancellation-grace budgets.devtools/continuity_replay.py: default replay path launches the production read-role MCP server as a child process via the official MCP SDK/stdio JSON-RPC, records discovery receipts (protocol version, tool/resource schemas) before running any scenario, and cross-checks a separate| countprobe against enumerated item identities for every aggregate-capable terminal unit — rejecting page-local or wrapper-rewritten totals.polylogue/mcp/server_prompts.py: fixes two shipped prompt recipes that advertised parser-invalidquery_unitsexpressions —unacknowledged_failuresembeddedsinceinside an action predicate instead of as the top-level argument;sessions_touching_fileused a barerepo:file predicate instead of session-scopedsession.repo:. Newtests/unit/mcp/test_prompt_query_parity.pyparses every shippedquery_unitsrecipe against the production parser and discovered tool schema so this can't regress silently.tests/infra/continuity.py/continuity_mutations.py/tests/data/continuity/catalog.json: schema-v2 corpus/oracle separation.seed_continuity_archive()builds real archive tiers from planted corpus facts only;validate_continuity_population()does a direct SQLite census with no query/MCP/replay involvement; the independent oracle section is never derived from a production route.Reconciliation performed by hand
Both r01 and r02 packets target base commit
536a53e(fix(repair): harden raw authority convergence #3046), pre-dating #3064. Applying r02's patch to current master (git apply --3way) appliedcontinuity_scenarios.py"cleanly" by context-matching around #3064's insertedmcp-query-transactionscenario block — but that left the block behind as a dead call to the old 7-positional-argument_scenario()helper, incompatible with the rewritten 3-positional/keyword-only signature (TypeError: _scenario() takes 3 positional arguments but 7 were givenat import time). Removed that stranded block: r02's all-scenario MCP-stdio replay, exact-count probes, and mutation matrix supersede what that single incremental scenario proved (an MCP transaction surviving one client-side pause/resume).devtools/continuity_replay.pyand the two continuity test files conflicted directly against #3064's additions during the 3-way apply; resolved by taking r02's full replacement content in each case, since both revisions replace this architecture wholesale and #3064 built incrementally on the version being replaced.tests/data/continuity/incident.json(the pre-existing, now fully unreferenced legacy fixture, including the row #3064 added to it) is left in place unchanged, matching both packets' own decision not to delete it without separate certification.polylogue-t8tAC matrix (bead's own numbering)z9gh.7consumes this catalog as sole terminal gatepolylogue-z9gh.7scope.This PR does not close
polylogue-t8t; item 6 remainspolylogue-z9gh.7's scope.Verification
devtools test tests/unit/product/test_continuity_scenarios.py tests/unit/mcp/test_prompt_query_parity.py tests/integration/test_continuity_replay.py→ 20 passed.devtools test tests/unit/mcp/test_server_surfaces.py→ 83 passed (no MCP tool-surface regression from the prompt-recipe fix).ruff format --check,ruff check,mypy --stricton all 9 changed/added files → clean.devtools render all --check→ exit 0 (no newpolylogue/module; no topology-projection regen needed).Ref polylogue-t8t