Repository navigation
chore: Gate repair-shaped declarations against the routes that exist - #5061
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (14)
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 |
…ty (#5065) ## Summary `devtools gate patterns` is **red on master**, blocking every PR opened since, including ones that touch neither implicated file. This restores it and makes the baselines honest. ## Problem Two PRs, each green on its own, red once both had landed: - **#5056** (error paths) added `logger = logging.getLogger(__name__)` to `polylogue/sources/retained_acquisition.py` for the ZIP-member-skip warning. - **#5059** (structured logging) recorded the `legacy-stdlib-logger` ratchet baseline at 23 entries. Neither PR's CI ever saw the other's change. After both merged, master scanned 24 matches against a 23-entry baseline, so the gate reported a new match and set `blocking: true`. PRs #5061, #5062, #5063 and #5064 all failed for this inherited reason. Separately, the baselines carried **22 stale entries** whose sites no longer exist — several naming `polylogue/storage/repair.py`, a file deleted some time ago. ## Solution Convert the one blocking site to a structured event, `source.zip.members_refused`. No new allowlist field was needed: `path` and `skipped` are already registered, and the refused-member list rides in `error_detail`, the single existing quarantined field. Prune the 22 stale entries. Pruning **shrinks** the ratchet, which is the permitted direction; adding an entry to silence the gate is the forbidden one. ## Verification ``` devtools gate patterns -> blocking: false, new_matches: 0, stale_matches: 0 ``` Baselines now match the scan exactly in both directions. Before this change the same command reported 1 new match and 22 stale entries. No test asserts on the old warning text, so no test changes were required. ## Note for the ratchet's owner — not addressed here A structural gap surfaced while fixing this. `legacy-stdlib-logger` matches `logging.getLogger(...)`, but the form most of the tree actually uses is the `polylogue.logging.get_logger` wrapper, which the rule does not match. A concurrent conversion of 90 prose sites across `daemon/cli.py` and `daemon/http.py` therefore eliminated **zero** baseline entries — the gate meant to enforce "no legacy logging" is blind to the dominant legacy form. Widening the existing rule would grow its baseline by roughly 140 modules, which the ratchet forbids. The coherent route is a second rule with its own baseline at the true remaining count: a new ratchet may start wherever reality is, while an existing one may only shrink. That is a deliberate decision and belongs in its own change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
`polylogue ops doctor` is a read-only report; `--repair`, `--cleanup` and `--target` were removed from it, but three declared CLI surface families still compiled those flags and a unit test asserted the exact argument vectors. Nothing resolved the declarations against the real Click app, so the dead repair product survived as a certified surface. Delete the three families and replace the assertions with a test that resolves every declared `ops doctor` family through the production Click app and rejects any option the command does not declare. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
…rella The generated agent manual described the privileged `maintenance` tool as a generic "preview, authorize, execute, inspect, and reconcile administrative maintenance" product with ten arguments the live handler never accepted (targets, dry_run, session_ids, origin, source_family, source_root, since, until, failure_kind, parser_version) and a typed `operation="preview"` example the tool rejects. The real tool takes one of rebuild_insights, recovery_status or recovery_adjudicate. The only signature comparison lived in a lane gated behind --require-live, so the drift was never checked. Promote that comparison into an always-run contract test; it also caught two unrelated live-but-undocumented arguments, `query.session_operation` and `context.offset`, now documented. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
The locked-database diagnostic told operators to run `polylogue ops doctor --repair`, and the doctor command's short help promised it ran "health checks and repairs". Both options were deleted; the command is a read-only report, so the advice fails on paste and the generic repair product survived as operator-facing text. Add a test that resolves every literal `next_action` recommendation through the production Click app and rejects options the resolved command does not declare. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
Three operation specs still declared a `repair` surface (and one described itself as repairing FTS rows) after the generic repair product was deleted. Nothing consumes `OperationSpec.surfaces` beyond serialization, so the token survived only as a catalog claim that Polylogue has a repair surface. Note: polylogue/operations/specs.py is IN the derived-schema closure (`devtools schema closure`), so this moves the derived schema identity and must land before a fresh rebuild starts, never during one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
c5f51a7 to
6f16efc
Compare
Summary
The repair-as-product implementation program was already complete at master. What remained was declarative residue, and every instance shared one root cause: a declaration describing a route the code no longer has, with no gate resolving the declaration against the real route. This removes the residue and adds the missing gates.
Problem
storage/repair.py(7,534 lines) is gone,FtsSurfaceRepairResult/repair_fts_surfacehave no definitions anywhere in the tree, and the raw census scanner was retired through successor3sd53. The bead's own 2026-09-13 note reclassifies it as a verification-only gate.But the declarations outlived the code:
ops doctor --repair [--cleanup] [--target ...]. Those flags were deleted fromcheck_options.py. The declarations were reachable only from their own unit test — which asserted the exact dead argument vectors, so the test proved the declarations matched themselves.maintenancetool contract advertised a generic "preview, authorize, execute, reconcile administrative maintenance" umbrella with ten phantom arguments, and a typedoperation="preview", targets=["index"]example that the live 5-argument, 3-operation handler rejects.status_diagnostics.pytold an operator facing a locked database to runpolylogue ops doctor --repair, which fails on paste.doctor's short help promised "health checks and repairs" for a read-only report.OperationSpecs declared arepairsurface token nothing consumes.Solution
Delete the dead declarations, align the tool contract to the live signature, and add four gates so the class cannot recur:
ops doctorsurface families resolved through the production Click app.--require-live, which is exactly why the manual rotted; it now runs unconditionally. It immediately caught two unrelated pre-existing drifts —query.session_operationandcontext.offsetwere live but undocumented. Both are now documented.next_actionrecommendations resolved through the Click app.repairsurface.Verification
Each gate confirmed red by reintroducing the exact defect and then restoring: reinstating the
--repairfamily, adding phantomtargets/dry_run, restoring the--repairrecommendation, re-adding the surface token.render agent-manualandrender cli-referenceregenerated and committed.Landing order
polylogue/operations/specs.pyis IN the derived-schema closure, so that commit moves the identity and must land before a fresh rebuild starts, never during one. It is deliberately isolated in its own commit so it can be dropped if a rebuild has already begun. The other five changed files areout.Deliberately kept
maintenance/raw_authority.pyplusraw_convergence.py/raw_reconciler.py(5,533 lines) are typed, named, campaign-scoped historical incident actuators —apply_frontierrefuses without the daemon writer lease. They arepolylogue-6kur.4's scope, not this one's, and need a named deletion trigger tied to source sealing.The FTS
repair_message_fts_*andlineage_startup.repair_stale_prefix_branch_pointsroutes are already canonical derivations running through write-effects and daemon startup. Renaming them is pure vocabulary across storage internals that are IN the schema closure — identity movement for zero behavioral value, and a partial rename is worse than none.Residuals
devtools gate atlasfails — identically at the base commit, on inherited staleness indocs/atlas/storage.mdoverblob_gc.py,blob_liveness.py,bootstrap.pyandarchive_tiers_specs.py, none of which this branch touches. Reported rather than masked.6kur.3's remaining acceptance criteria are integration acceptance, not implementation: broad verification, replay/incremental equivalence, restart/fault evidence, and an archive-scale workload. Those need the full suite and a managed archive-scale run, and are not claimed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK