Repository navigation
feat(operations): blocker-resolution operator surface + annotation family through MutationTransaction (polylogue-t46.9 phase 3) - #3258
Conversation
Problem: resolve_raw_authority_blocker requires an exact blocker_id, but there was no way to discover an unresolved blocker_id short of page-walking raw-authority-census/-detail or writing an ad hoc script against the live archive (found live 2026-07-21/22). What changed: add describe_raw_authority_blocker (zero-mutation single lookup, used by the phase-3 BlockerResolveActuator's PREPARE) and list_unresolved_raw_authority_blockers (bounded inventory) to storage/raw_authority.py, plus product/raw_authority.list_blockers as the CLI-facing wrapper. Both classify each blocker's `kind` as stale_plan or frontier_judgment by reading the plan's authority_witness_json schema, matching resolve_raw_authority_blocker's own classification logic. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…hrough the executor Problem: polylogue-t46.9 phase 3 continues migrating declared-not-routed mutation families onto MutationTransaction/OperationExecutor. The annotation family (save_annotation/delete_annotation) was still a bare ArchiveStore call with no shared authorization path, and resolve_raw_authority_blocker -- a durable, replanning-reopening mutation -- had no OperationSpec/census entry at all (an unclassified operation, not merely an un-migrated one). What changed: - AnnotationSaveActuator/AnnotationDeleteActuator wrap ArchiveStore.save_annotation/delete_annotation (reversible class, role_only confirmation, matching the mark family's phase-2 pattern: undo is the paired actuator through the same primitive). - BlockerResolveActuator wraps raw_authority.resolve_raw_authority_blocker (reset class, confirm_flag confirmation -- not reversible since a blocker cannot be un-resolved, not delete/excise since no archive content is removed). Frontier-judgment assertion-id/disposition enforcement stays inside the primitive; the executor's job is confirmation strength and TOCTOU staleness detection via the standard fresh-PREPARE-before-EXECUTE revalidation. - Three new OperationSpec entries (mutate-save-annotation, mutate-delete-annotation, mutate-resolve-raw-authority-blocker), all executor-routed, plus matching mutation-census.yaml rows. - Fixed a pre-existing test_specs.py gap (mutate-add-mark/ mutate-remove-mark, added in the phase-2 PR, were never added to test_runtime_operation_catalog_covers_the_current_runtime_paths' expected set) while touching this file for the three new specs. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…xecutor Wires PolylogueArchiveMixin.save_annotation/delete_annotation to the new AnnotationSaveActuator/AnnotationDeleteActuator instead of calling ArchiveStore.save_annotation/delete_annotation directly, mirroring add_mark/remove_mark's phase-2 pattern: async target resolution stays in the facade (may consult insight-derived indexes), then the actuator sees an already-resolved target_type/target_id through PREPARE->AUTHORIZE->EXECUTE. MCP's write(operation='save_annotation'/ 'delete_annotation') already calls these facade methods, so no MCP surface change is needed. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…ough executor Problem (found live 2026-07-21/22): raw-authority blocker resolution had a working CLI command (raw-authority-blocker-resolve, with its own --yes gate) but no way to discover an unresolved blocker_id short of page-walking raw-authority-census/-detail or writing an ad hoc script against the live archive, and its authorization was independent of every other destructive route. What changed: - New `polylogue ops maintenance raw-authority-blockers` (read-only): lists unresolved blockers via product.raw_authority.list_blockers, classifying each as stale_plan or frontier_judgment. - `raw-authority-blocker-resolve` now drives BlockerResolveActuator through OperationExecutor (PREPARE previews the exact blocker target, EXECUTE requires confirm_flag-strength authorization bound to that plan's hash, and refuses PlanStaleError if the blocker was resolved concurrently between preview and confirm) instead of calling raw_authority.resolve_blocker directly. The --yes gate and error handling are unchanged from the operator's perspective. - docs/maintenance.md: document the new list command and the executor-routing behavior of resolve. - docs/plans/docs-coverage-baseline.yaml: drop the stale 'ops maintenance rebuild-index' entry (now documented; the docs-coverage lint reported it as removable while checking this PR's new surface). Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…tuators Real-dependency tests (real seeded source.db/user.db, real SQL, no mocks of the primitives under test): - TestAnnotationActuators: save-then-update-then-delete round-trip through user.db assertions (kind='annotation'), proving created-vs- updated receipt honesty and AC4 role_only confirmation. - TestBlockerResolveActuator: PREPARE finds/doesn't-find a real unresolved blocker row, EXECUTE genuinely resolves it and reopens replanning, a concurrent out-of-band resolve between PREPARE and EXECUTE raises PlanStaleError (TOCTOU), role_only is refused (contrast with the reversible-class actuators), and frontier_judgment vs stale_plan classification is proven from a real authority_witness_json schema. - CLI: rewrote the blocker-resolve confirmation test against a real seeded blocker (the previous version mocked raw_authority.resolve_raw_authority_blocker directly, which the new PREPARE step's real existence check would have made vacuous -- the mock would never be reached without a real row). Added an unknown-blocker-id anti-vacuity test and CLI-level coverage for the new raw-authority-blockers list command (kind classification, and that resolving one blocker removes it from the unresolved listing). Also regenerates docs/test-quality-workflows.md (devtools render quality-reference) to reflect the three new OperationSpec entries in its uncovered-runtime-operations snapshot. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 3 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 (14)
✨ 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: 8ca8a55d03
ℹ️ 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".
…sting Two Codex-bot P2 review comments on PR #3258 (both against polylogue/storage/raw_authority.py), triaged and fixed: 1. "Reserve frontier_judgment for actual judgment blockers": frontier plans cover four obligation states (missing bytes, conflicting authority needing judgment, unresolved provenance, corrupt -- raw_reconciler._OBLIGATION_STATES), but _reconcile_frontier_obligations only writes a judgment_assertion_id into observed_json for CONFLICTING_AUTHORITY_NEEDS_JUDGMENT. resolve_raw_authority_blocker itself only demands an accepted assertion + disposition when that key is present. Classifying every frontier-schema blocker as frontier_judgment therefore told operators an accepted assertion was required even when the resolver enforces none. Fixed: kind is now derived from the presence of judgment_assertion_id in observed_json (the same signal the resolver itself checks), not merely "is this a frontier-schema plan". Other frontier obligation states now classify as the new frontier_obligation kind. Verified against raw_reconciler.py's _reconcile_frontier_ obligations and _OBLIGATION_STATES. 2. "Paginate the blocker inventory past the hard limit": --limit capped at 500 with no offset/continuation, so an archive with >500 unresolved blockers could never expose rows past the first page. Fixed: list_unresolved_raw_authority_blockers now takes an `offset` and returns a paginated envelope (blockers, offset, limit, returned_count, total_count, truncated, next_offset) instead of a bare list; the CLI gained a matching --offset flag and prints a "Truncated: pass --offset N" notice in plain-mode output when more rows remain. Both fixes are covered by new real-dependency tests (real seeded source.db, no mocks): TestListUnresolvedRawAuthorityBlockersPagination and test_raw_authority_blockers_cli_paginates_past_the_limit prove a 3-row inventory queried with --limit 2 exposes all 3 rows across two pages; test_frontier_obligation_without_judgment_assertion_is_not_ misclassified proves a frontier blocker without a judgment assertion classifies frontier_obligation (not frontier_judgment) and resolves without one, exactly as resolve_raw_authority_blocker allows. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…gh MutationTransaction (phase 4) Problem: docs/plans/mutation-census.yaml carried save_saved_view/ delete_saved_view, save_recall_pack/delete_recall_pack, and save_workspace/delete_workspace as declared-not-routed debt since phase 2 (t46.9/kwsb.2) -- each pair still enforced authorization independently of every other destructive route, with jn40's confirm boolean the only interim mitigation for the destructive members. What changed: six new actuators (SavedViewSaveActuator/ SavedViewDeleteActuator, RecallPackSaveActuator/RecallPackDeleteActuator, WorkspaceSaveActuator/WorkspaceDeleteActuator) wrap the existing ArchiveStore.save_view/delete_view, save_recall_pack/delete_recall_pack, save_workspace/delete_workspace primitives -- all reversible class, role_only confirmation (AC4), matching the phase-2/phase-3 pattern exactly: each pair's primitive is a create-or-update upsert paired with a soft-delete (mark_assertion_status ... "deleted"), so undo is always the paired actuator through the same primitive. Six new OperationSpec entries (mutate-save-saved-view, mutate-delete-saved-view, mutate-save-recall-pack, mutate-delete-recall-pack, mutate-save-workspace, mutate-delete-workspace), all executor-routed. api/archive.py's save_view/delete_view, create_recall_pack/ delete_recall_pack, save_workspace/delete_workspace now drive their actuators through OperationExecutor instead of calling ArchiveStore directly -- async validation/item-resolution (which may consult insight-derived indexes for recall-pack/workspace targets) stays in the facade and runs once before the actuator sees already-normalized JSON payloads, mirroring AnnotationSaveActuator's pattern. MCP's write(operation='save_saved_view'/'delete_saved_view'/ 'save_recall_pack'/'delete_recall_pack'/'save_workspace'/ 'delete_workspace') already calls these facade methods, so no MCP tool signature change is needed. Also fixed a pre-existing test_specs.py gap on this branch (mirrors the one fixed on the phase-3 branch, #3258): mutate-add-mark/ mutate-remove-mark, added in the phase-2 PR (#3253, already on master), were never added to test_runtime_operation_catalog_covers_the_current_runtime_paths' expected set -- fixed while touching this file for the six new specs. Anti-vacuity: TestSavedViewActuators/TestRecallPackActuators/ TestWorkspaceActuators in tests/unit/operations/test_mutation_actuators.py drive each actuator against a real seeded user.db (real schema, real SQL) -- they fail if e.g. SavedViewSaveActuator.apply stops calling ArchiveStore.save_view, or if the delete actuators stop marking their assertion rows deleted. Existing facade-contract tests for save_view/ create_recall_pack/save_workspace (tests/unit/api/test_facade_contracts.py) pass unchanged, confirming the executor routing preserves the existing public behavior. Note: this branch is cut from master before phase 3's own PR (#3258, annotation family + raw-authority blocker resolution) merges, so that PR's census rows are not present here; docs/plans/mutation-census.yaml's header explains the ordering. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…gh MutationTransaction (phase 4) Problem: docs/plans/mutation-census.yaml carried save_saved_view/ delete_saved_view, save_recall_pack/delete_recall_pack, and save_workspace/delete_workspace as declared-not-routed debt since phase 2 (t46.9/kwsb.2) -- each pair still enforced authorization independently of every other destructive route, with jn40's confirm boolean the only interim mitigation for the destructive members. What changed: six new actuators (SavedViewSaveActuator/ SavedViewDeleteActuator, RecallPackSaveActuator/RecallPackDeleteActuator, WorkspaceSaveActuator/WorkspaceDeleteActuator) wrap the existing ArchiveStore.save_view/delete_view, save_recall_pack/delete_recall_pack, save_workspace/delete_workspace primitives -- all reversible class, role_only confirmation (AC4), matching the phase-2/phase-3 pattern exactly: each pair's primitive is a create-or-update upsert paired with a soft-delete (mark_assertion_status ... "deleted"), so undo is always the paired actuator through the same primitive. Six new OperationSpec entries (mutate-save-saved-view, mutate-delete-saved-view, mutate-save-recall-pack, mutate-delete-recall-pack, mutate-save-workspace, mutate-delete-workspace), all executor-routed. api/archive.py's save_view/delete_view, create_recall_pack/ delete_recall_pack, save_workspace/delete_workspace now drive their actuators through OperationExecutor instead of calling ArchiveStore directly -- async validation/item-resolution (which may consult insight-derived indexes for recall-pack/workspace targets) stays in the facade and runs once before the actuator sees already-normalized JSON payloads, mirroring AnnotationSaveActuator's pattern. MCP's write(operation='save_saved_view'/'delete_saved_view'/ 'save_recall_pack'/'delete_recall_pack'/'save_workspace'/ 'delete_workspace') already calls these facade methods, so no MCP tool signature change is needed. Also fixed a pre-existing test_specs.py gap on this branch (mirrors the one fixed on the phase-3 branch, #3258): mutate-add-mark/ mutate-remove-mark, added in the phase-2 PR (#3253, already on master), were never added to test_runtime_operation_catalog_covers_the_current_runtime_paths' expected set -- fixed while touching this file for the six new specs. Anti-vacuity: TestSavedViewActuators/TestRecallPackActuators/ TestWorkspaceActuators in tests/unit/operations/test_mutation_actuators.py drive each actuator against a real seeded user.db (real schema, real SQL) -- they fail if e.g. SavedViewSaveActuator.apply stops calling ArchiveStore.save_view, or if the delete actuators stop marking their assertion rows deleted. Existing facade-contract tests for save_view/ create_recall_pack/save_workspace (tests/unit/api/test_facade_contracts.py) pass unchanged, confirming the executor routing preserves the existing public behavior. Note: this branch is cut from master before phase 3's own PR (#3258, annotation family + raw-authority blocker resolution) merges, so that PR's census rows are not present here; docs/plans/mutation-census.yaml's header explains the ordering. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]>
…ationTransaction (#3262) ## Summary Phase 4 of polylogue-t46.9/polylogue-kwsb.2 (make `OperationSpec` the executable mutation authority): migrates the saved-view/recall-pack/workspace family onto `OperationExecutor`, the next coherent slice of `declared-not-routed` debt named in the phase-2 receipt. ## Problem `docs/plans/mutation-census.yaml` carried three MCP write-operation pairs as `declared-not-routed` since phase 2: - `save_saved_view` / `delete_saved_view` - `save_recall_pack` / `delete_recall_pack` - `save_workspace` / `delete_workspace` Each pair still enforced authorization independently of every other destructive route, with jn40's interim confirm-boolean sweep the only mitigation for the destructive members (`delete_saved_view`, `delete_recall_pack`, `delete_workspace`). All six operations share the exact same shape already proven safe for the tag/metadata/mark/annotation families: an `ArchiveStore` primitive that is a create-or-update upsert (`save_view`/`save_recall_pack`/`save_workspace`) paired with a soft-delete (`delete_view`/`delete_recall_pack`/`delete_workspace`, each calling `mark_assertion_status(..., "deleted")`). ## Solution - **`polylogue/operations/mutation_actuators.py`**: six new actuators (`SavedViewSaveActuator`/`SavedViewDeleteActuator`, `RecallPackSaveActuator`/`RecallPackDeleteActuator`, `WorkspaceSaveActuator`/`WorkspaceDeleteActuator`), all **reversible** class, `role_only` confirmation (AC4) -- undo is always the paired actuator through the same primitive. - **`polylogue/operations/specs.py`**: six new executor-routed `OperationSpec` entries. - **`polylogue/api/archive.py`**: `save_view`/`delete_view`, `create_recall_pack`/`delete_recall_pack`, `save_workspace`/`delete_workspace` now drive their actuators through `OperationExecutor` instead of calling `ArchiveStore` directly. Async validation and item resolution (recall-pack/workspace targets may consult insight-derived indexes) stays in the facade and runs once before the actuator sees already-normalized JSON payloads -- mirroring `AnnotationSaveActuator`'s pattern from phase 3. MCP's `write(operation='save_saved_view'/.../'delete_workspace')` already calls these facade methods, so **no MCP tool signature change is needed**. - **Drive-by fix**: `tests/unit/operations/test_specs.py`'s `test_runtime_operation_catalog_covers_the_current_runtime_paths` was missing `mutate-add-mark`/`mutate-remove-mark` (added in the already-merged phase-2 PR #3253) from its expected set -- fixed while touching this file for the six new specs. (The same pre-existing gap was independently found and fixed on the phase-3 branch for PR #3258.) ### Routing matrix | Operation | Class | Confirmation | Surfaces | Status | | --- | --- | --- | --- | --- | | `mutate-save-saved-view` | reversible | role_only | mcp, api | executor-routed (new) | | `mutate-delete-saved-view` | reversible | role_only | mcp, api | executor-routed (new) | | `mutate-save-recall-pack` | reversible | role_only | mcp, api | executor-routed (new) | | `mutate-delete-recall-pack` | reversible | role_only | mcp, api | executor-routed (new) | | `mutate-save-workspace` | reversible | role_only | mcp, api | executor-routed (new) | | `mutate-delete-workspace` | reversible | role_only | mcp, api | executor-routed (new) | ### Census delta (`docs/plans/mutation-census.yaml`) - `save_saved_view / delete_saved_view` (combined `declared-not-routed` row) -> split into `mutate-save-saved-view` + `mutate-delete-saved-view`, both `executor-routed`. - `save_recall_pack / delete_recall_pack` (combined `declared-not-routed` row) -> split into `mutate-save-recall-pack` + `mutate-delete-recall-pack`, both `executor-routed`. - `save_workspace / delete_workspace` (combined `declared-not-routed` row) -> split into `mutate-save-workspace` + `mutate-delete-workspace`, both `executor-routed`. **Branch-cut note:** this branch is cut from `origin/master` before phase 3's own PR (#3258 -- annotation family + raw-authority blocker resolution) merges, so phase 3's census rows are not present in this diff; the census file's header comment explains the ordering. No conflict is expected on merge since the two PRs touch disjoint rows/regions of the file, but whichever merges second will need a routine rebase. ## Verification ``` devtools test tests/unit/operations/test_mutation_actuators.py tests/unit/operations/test_specs.py \ tests/unit/operations/test_mutation_census.py tests/unit/api/test_facade_contracts.py # 316 passed in 8.56s devtools verify --quick # exit_code: 0 (ruff format/check, mypy --strict, render all --check, topology, layering, # closure-matrix, schema roundtrip, manifests, ci-workflows, doc-commands, docs-coverage, # test-infra-currency, test-clock-hygiene, pytest-timeout-overrides, degrade-loudly) ``` Anti-vacuity: `TestSavedViewActuators`/`TestRecallPackActuators`/`TestWorkspaceActuators` in `tests/unit/operations/test_mutation_actuators.py` drive each actuator against a real seeded `user.db` (real schema, real SQL) -- they fail if e.g. `SavedViewSaveActuator.apply` stops calling `ArchiveStore.save_view`, or if a delete actuator stops marking its assertion row deleted. Existing facade-contract tests for `save_view`/`create_recall_pack`/`save_workspace` (`tests/unit/api/test_facade_contracts.py`) pass unchanged, confirming the executor routing preserves existing public behavior (creation/update/deletion semantics, return values). Not run: full `devtools verify --all` (reserved for harness/dependency changes or a final pre-merge diagnostic; the touched surface is fully covered by the focused runs above). ## Remaining polylogue-t46.9 / polylogue-kwsb.2 scope Explicitly deferred, not silently dropped (see updated `docs/plans/mutation-census.yaml`): - `record_correction / clear_corrections` -- still `declared-not-routed` (low blast radius / single-target overwrite, per existing census reason). - `capture_assertion_candidate`, `blackboard_post`, `import_annotation_batch` -- still `declared-not-routed` (additive, not destructive). - `rebuild_index / update_index / rebuild_insights` (maintenance_execute family) -- still `declared-not-routed`. - `ops reset --database/--index/--blob/--assets/--cache/--auth` (file-tier deletions) -- still `declared-not-routed`; whether to extend `MutationPlan`'s target-ref vocabulary to file-tier targets or keep this a permanent typed exemption is an open decision. - `bound_token` confirmation strength adoption (currently no actuator requires it; all destructive-class actuators use `confirm_flag`). - Durable audit-row persistence for `MutationReceipt`s. - Crash/partial-failure resume semantics for multi-target operations. Ref polylogue-t46.9 Ref polylogue-kwsb.2 Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
#3294) ## Summary Migrates the `record_correction` / `delete_correction` / `clear_corrections` learning-corrections family from `declared-not-routed` to `executor-routed` in the t46.9/kwsb.2 mutation-authority migration — phase 5 in the sequence started by #3249/#3253/#3258/#3262. ## Problem `docs/plans/mutation-census.yaml`'s `record_correction / clear_corrections` row was the next `declared-not-routed` family after phase 4 (#3262, saved-view/recall-pack/workspace) landed. These three operations independently mutated `user.db` without going through `OperationExecutor`'s PREPARE -> AUTHORIZE -> EXECUTE protocol, so they had no shared plan-hash staleness check or confirmation-strength floor — the same class of gap kwsb.2's design doc calls a security boundary (one adapter bypassing the proof required by another). ## Solution - `polylogue/operations/mutation_actuators.py`: new `CorrectionRecordActuator`, `CorrectionDeleteActuator`, `CorrectionsClearActuator` — all `reversible` class / `role_only` confirmation (AC4: reversible writes don't need interactive confirmation), following the exact same actuator shape as the annotation and workspace families. `CorrectionsClearActuator.prepare` resolves the *exact live set* of correction kinds for the session at plan time (mirroring `SessionDeleteActuator`'s re-resolve-against-live-state pattern), so a concurrent `record_correction` between AUTHORIZE and EXECUTE changes the plan hash and forces `PlanStaleError` instead of silently clearing a kind the caller never previewed. - `polylogue/operations/specs.py`: `mutate-record-correction`, `mutate-delete-correction`, `mutate-clear-corrections` `OperationSpec` entries, `executor_status="executor-routed"`. - `polylogue/api/archive.py`: `record_correction`/`delete_correction`/`clear_corrections` now build actuator args and drive `OperationExecutor.prepare/authorize/execute` instead of calling `ArchiveStore` directly. Behavior/return types are unchanged (same `LearningCorrection`/`bool`/`int` signatures). - `docs/plans/mutation-census.yaml`: replaced the single `declared-not-routed` row with three `executor-routed` rows citing their specs/actuators/adapters. - `docs/test-quality-workflows.md`: regenerated (the uncovered-runtime-operations list picked up the three new spec names, matching the existing pattern for e.g. `mutate-save-annotation`). Only this one family was migrated — per repo convention, the remaining `declared-not-routed` rows (`capture_assertion_candidate`, `blackboard_post`, `import_annotation_batch`, the `maintenance_execute` family, and the file-tier `ops reset` family) are untouched debt for later phases. ## Verification - `python -m pytest tests/unit/operations/{test_mutation_actuators,test_mutation_census,test_specs}.py -q` -> 56 passed - `devtools test tests/unit/operations/` -> 146 passed - `devtools test tests/unit/mcp/test_query_gap_projections.py tests/unit/api/test_facade_contracts.py` -> 295 passed (these two files exercise `record_correction`/`clear_corrections` through the MCP/API layers) - `python -m mypy polylogue/operations/mutation_actuators.py polylogue/operations/specs.py polylogue/api/archive.py tests/unit/operations/test_mutation_actuators.py` -> `Success: no issues found in 4 source files` - `ruff check` / `ruff format --check` on all changed `.py` files -> clean - `devtools render all --check` -> no `out of sync` surfaces (after regenerating `docs/test-quality-workflows.md`) - `devtools verify --quick` -> exit 0 (ran automatically on push via the pre-push hook too) New test: `tests/unit/operations/test_mutation_actuators.py::TestCorrectionActuators` — 5 cases including the anti-vacuity case `test_concurrent_record_between_authorize_and_execute_makes_clear_plan_stale`, which authorizes a clear-plan, records a new correction kind through a second actuator in between AUTHORIZE and EXECUTE, and asserts the held authorization is refused with `PlanStaleError` before any row is deleted — proving authorization is actually enforced, not just "it still works." Ref polylogue-kwsb.2 Ref polylogue-t46.9 Co-Authored-By: Claude <[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
Phase 3 of polylogue-t46.9/polylogue-kwsb.2 (make
OperationSpecthe executable mutation authority): migrates the annotation family ontoOperationExecutor, and closes a concrete operator gap found live 2026-07-21/22 -- raw-authority blocker resolution had no discovery surface and no census/authorization entry at all.Problem
Two independent, evidence-backed gaps:
resolve_raw_authority_blockerrequires an exact--blocker-id, but the only way to find an unresolved one was page-walkingraw-authority-census/raw-authority-detailor writing an ad hoc script against the live archive -- which the operator had to do tonight to unblock a stale-plan blocker.raw-authority-blocker-resolve(CLI) already existed with its own--yesgate, but had noOperationSpec/docs/plans/mutation-census.yamlentry at all -- not merely un-migrated debt, but an unclassified destructive route the census was silently missing.save_annotation/delete_annotationwere declared-not-routed debt from phase 2's mark-family migration.Solution
polylogue/storage/raw_authority.py:describe_raw_authority_blocker(zero-mutation single lookup) andlist_unresolved_raw_authority_blockers(bounded inventory), both classifyingkindasstale_planvsfrontier_judgmentfrom the plan'sauthority_witness_jsonschema -- same classificationresolve_raw_authority_blockeralready used internally.product/raw_authority.list_blockersis the CLI-facing wrapper.polylogue/operations/mutation_actuators.py: three new actuators.AnnotationSaveActuator/AnnotationDeleteActuatorwrapArchiveStore.save_annotation/delete_annotation-- reversible class,role_onlyconfirmation (undo is the paired actuator through the same primitive, matching the phase-2 mark family).BlockerResolveActuatorwrapsresolve_raw_authority_blocker-- reset class,confirm_flagconfirmation (not reversible: a blocker cannot be un-resolved; not delete/excise: no archive content is removed, only the blocked state is tombstoned). Frontier-judgment assertion-id/disposition enforcement stays inside the primitive (domain-owned); the executor's job is confirmation strength plus TOCTOU staleness detection via the standard fresh-PREPARE-before-EXECUTE revalidation.polylogue/operations/specs.py: three new executor-routedOperationSpecentries (mutate-save-annotation,mutate-delete-annotation,mutate-resolve-raw-authority-blocker).polylogue/api/archive.py:save_annotation/delete_annotationnow drive their actuators throughOperationExecutorinstead of callingArchiveStoredirectly (mirrorsadd_mark/remove_mark's phase-2 pattern). MCP'swrite(operation='save_annotation'/'delete_annotation')already calls these facade methods -- no MCP tool signature change needed.polylogue ops maintenance raw-authority-blockers [--limit] [--output-format]lists unresolved blockers withkind.raw-authority-blocker-resolvenow drivesBlockerResolveActuatorthroughOperationExecutorinstead of callingraw_authority.resolve_blockerdirectly -- operator-visible behavior (the--yesgate, error text) is unchanged, but resolution now shares the same PREPARE/AUTHORIZE/EXECUTE proof every other destructive route uses, and refuses withPlanStaleErrorif the blocker is concurrently resolved between preview and confirm.docs/maintenance.mddocuments the new list command and resolve's executor routing;docs/plans/docs-coverage-baseline.yamldrops a staleops maintenance rebuild-indexentry the docs-coverage lint flagged as removable while checking this PR's new surface;docs/test-quality-workflows.mdregenerated.tests/unit/operations/test_specs.py'stest_runtime_operation_catalog_covers_the_current_runtime_pathswas missingmutate-add-mark/mutate-remove-markin its expected set (a pre-existing gap from the phase-2 PR, confirmed failing on master before this change) -- fixed while touching this file for the three new specs.Routing matrix
mutate-save-annotationmutate-delete-annotationmutate-resolve-raw-authority-blockerCensus delta (
docs/plans/mutation-census.yaml)save_annotation / delete_annotation(one combineddeclared-not-routedrow) -> split intomutate-save-annotation+mutate-delete-annotation, bothexecutor-routed.mutate-resolve-raw-authority-blockerrow,executor-routed(previously absent from the census entirely).raw-authority-blockers(the new list command) is read-only and intentionally has no census row (the census classifies mutating operations).Verification
Anti-vacuity:
TestAnnotationActuators/TestBlockerResolveActuatorintests/unit/operations/test_mutation_actuators.pydrive the actuators against real seededsource.db/user.db(real schema, real SQL) -- they fail ifAnnotationSaveActuator.applystops callingArchiveStore.save_annotation, ifAnnotationDeleteActuator.applystops marking the assertion deleted, or ifBlockerResolveActuator.applystops callingresolve_raw_authority_blocker. A dedicated test proves TOCTOU: a blocker resolved out-of-band betweenPREPAREandEXECUTEraisesPlanStaleErrorrather than double-applying. The CLI blocker-resolve test was rewritten from a mock of the underlying storage function (which the new real PREPARE existence-check would have made vacuous) to a real seeded blocker row, plus a new unknown-blocker-id test proving the resolve command fails rather than silently succeeding.Not run: full
devtools verify --all(reserved for harness/dependency changes or final pre-merge diagnostic per repo convention; the touched surface is fully covered by the focused runs above).Remaining polylogue-t46.9 / polylogue-kwsb.2 scope
Explicitly deferred, not silently dropped (see updated
docs/plans/mutation-census.yaml):save_saved_view / delete_saved_view,save_recall_pack / delete_recall_pack,save_workspace / delete_workspace-- stilldeclared-not-routed, jn40 confirm-gated interim mitigation only.record_correction / clear_corrections,capture_assertion_candidate,blackboard_post,import_annotation_batch-- stilldeclared-not-routed(low blast radius / additive, per existing census reasons).rebuild_index / update_index / rebuild_insights(maintenance_execute family) -- stilldeclared-not-routed.ops reset --database/--index/--blob/--assets/--cache/--auth(file-tier deletions) -- stilldeclared-not-routed; whether to extendMutationPlan's target-ref vocabulary to file-tier targets or keep this a permanent typed exemption is an open Phase-4 decision.bound_tokenconfirmation strength adoption (currently no actuator requires it; all destructive-class actuators useconfirm_flag).MutationReceipts (currently receipts are returned, not persisted to a dedicated audit table).Ref polylogue-t46.9
Ref polylogue-kwsb.2
Co-Authored-By: Claude [email protected]