Repository navigation
fix(cli): Close eighteen live August findings across fourteen areas - #5422
Conversation
`analyze cost-outlook`, `analyze postmortem` and `analyze portfolio` all died with `TypeError: analyze_verb() got multiple values for argument 'count_only'` before rendering anything: `_invoke_analyze_projection` called `analyze_verb.callback(parent, **kwargs)`, and that callback is Click's `@pass_context` wrapper, which injects the current context as the first positional and therefore bound `parent` to `count_only`. `Context.invoke` pushes `parent` for the duration of the call, so the wrapper injects the context the projection means and the keywords stay keywords. `analyze facets` separately ignored the root output contract: its local `--format` default fell back to `text` instead of the format retained in the `RootModeRequest`, so `polylogue --format json find ... then analyze facets` emitted human text where `analyze --facets` emits JSON. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
Three defects in `read --all` for a non-bulk view:
* `temporal` and `chronicle` declare `accepts_query_set`, but the adapter
routed every view outside {summary, transcript, dialogue} through the
per-session helper. That narrowed the request to one `conv_id` per
invocation, turning a single cross-session chronology into an array of
unrelated per-session projections and repeating the query work once per
match. A query-set-capable handler now runs once over the original
selection.
* `--format ndjson` invoked each handler in JSON mode and serialized the
results as one pretty-printed array, so line-oriented consumers got both
the wrong framing and the wrong record grain. The messages handler owns a
per-record NDJSON stream and keeps it; every other view emits one
self-contained document per selected session, which is the same framing
contract at that view's own grain.
* The adapter built handler options from the projection limits only and
never received the view-specific Click values, so
`read --all --view messages --full` left `ReadViewMessageOptions.full`
false and the handler truncated every session at its page fallback.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
`configured_read_operation` resolves the file set through `operation_archive_root`, so a `--db` split-root pin decides which archive a query and its confirmation ran against. `configured_mutation_operation` and `configured_accepted_operation` addressed `config.archive_root` instead, so a confirmed `delete` was sent to whichever daemon served the *configured* root and deleted the resolved session ids from a different archive. Both routes now resolve the same way the read route does, and both declare that resolved root on the wire. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
`SessionProfile.terminal_state` is decided in the closed `TerminalState`
vocabulary (`tool_left`, `error_left`, `question_left`, `refused`,
`truncated`, `unknown`). `surfaces/query_rows.session_row` admitted its own
private set -- `{completed, failed, abandoned, unknown}` -- which is disjoint
from the canonical one except for `unknown`, so every informative outcome
collapsed to `unknown` in CLI list/search/select rows and in the published
`terminal_state` of every session-list row
(`operations.daemon_reads._session_list_row` reads its value from here).
Membership is still checked, so a value outside the vocabulary stays
`unknown` rather than being echoed through.
`polylogue/surfaces/query_rows.py` is IN the derived-schema identity closure;
the index tier identity moves 5274c9cc… -> 9ca50c30… (ops unchanged).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
…ence
Three ways an unusable node still produced a `supported` verdict, whose
`supported` property authorizes context injection and a public claim:
* A `quarantined` descendant recorded a witness that no branch of the status
ladder read, so a valid sibling leaf carried the graph to
`PARTIALLY_SUPPORTED`. The non-`ok` ref states are now a partition over
`EvidenceRefState`, asserted total at import, so a new member cannot fall
through the same way.
* `authority` defaults to `unknown`, so an adapter that omits the optional
field produced `{"unknown"}` -- which is not a subset of
`{agent, assertion}` and therefore skipped the laundering guard entirely.
An unknown authority establishes nothing independent and is now
`UNRESOLVED`.
* Only the two privacy spellings of `review_state` were checked, so a
`pending` or `rejected` leaf recorded no witness, joined `supported_paths`
and produced a fully `SUPPORTED` verdict. Approval is now required
explicitly and every other value is `NOT_SUPPORTED`; the privacy spellings
keep their own higher-precedence `HELD_PRIVATE` verdict.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
Four defects in the promoted-query excision lifecycle, all on irreplaceable user-tier state: * A `result-set:` target is a relation-only excision that deliberately preserves the owning query, but the planner scanned the owning query's refs too, so every assertion targeting or citing that surviving query was marked deleted and had its content cleared. Its query names, edges, retained runs and evaluation receipts were also reported as removed while the applier left them in place. A relation-only plan now enumerates only what it removes. * The assertion scrub cleared `value_json` and `body_text` only, leaving operator content readable in `key`, `scope_ref`, `staleness_json`, `supersedes_json`, `evidence_refs_json` and `context_policy_json` behind a receipt that reported a successful excision. `author_ref`/`author_kind` are deliberately retained as the accountability record. * `holdout_access_receipts.result_set_id` references `result_set_holdout_policies` `ON DELETE RESTRICT`, so an accessed holdout raised `sqlite3.IntegrityError` *after* the ledger insert and the assertion scrub had run in the caller's transaction. The planner now reports those receipts and the apply holds before mutating anything; whether a contamination receipt may be destroyed with its relation stays an operator decision. * The apply trusted a plan resolved in an earlier transaction. Durable state changes between the two calls -- the standing-query writer adds a citing finding, a new result set attaches -- left query-derived content behind under an `applied` receipt, or failed a foreign key after earlier mutations had run. The graph is re-resolved under the apply and a drift is held, naming the exact refs that moved. `polylogue/security/query_excision.py` is IN the derived-schema identity closure; the index tier identity moves 9ca50c30… -> a6634e6c… on this branch (ops unchanged). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
Two sentinels are not cardinalities: `-1` means a relation does not exist and `UNKNOWN_TABLE_COUNT` (`-2`) means the count could not be taken. `_coerce_int_map` accepted both as ordinary integers, so every table-count delta subtracted them and reported arithmetic like `100 -> -2 (Δ -102)` -- in exactly the convergence experiments exact snapshots are collected for. An unmeasured side is now reported as `None`, its delta is refused rather than invented, and `measured` says which it is. `_convergence_debt` reports `available: false` with zero counts when `ops.db` is unreadable, missing or malformed, but `_automatic_convergence_backlog`, `compare` and the plaintext renderer never inspected the flag. They respectively published "no retry debt", a clean `0 -> 0 (Δ +0)` and a successful exit for a ledger nobody could read. Availability is now carried through all three, so an unknown authoritative ledger reads as unknown. `REPORT_VERSION` 22 -> 23: `automatic_convergence_backlog.counts .retry_debt_unresolved` becomes nullable and the section gains `retry_debt_available`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
`ArchiveStore.search_summaries` selects FTS *block* rows with no DISTINCT over `session_id`, so several matching blocks in one session are several hits. `total` is deliberately session-grain -- it is what `total_unit` labels and what `_archive_count_sessions_for_spec` counts -- so comparing `offset + len(hits)` against it is a unit error. Four matching blocks in one session fill a four-row page while a second session's hit waits at offset four, and a session total of two makes that page look final: the client's walk ends and the remaining hits are never returned. There is no hit-grain denominator to compare against, so continuation is decided by `page_next_offset`'s own no-total rule -- a page that filled its bound continues, a short page terminates -- instead of by a denominator in the wrong unit. `total` and `total_unit` keep reporting the session cardinality they name. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
An unavailable cost estimate carries `total_usd = None`, and JSON and HTTP
emit `null` for it. The session-cost insight declared its plaintext field as
`_nested("estimate", "total_usd", "0")`, so the same row rendered `usd=0` --
a measured zero dollars -- beside its own `status=unavailable`. That is the
exact false zero the nullable-cost contract exists to remove, preserved on
the one surface an operator reads by default. `confidence` carried the same
`"0"` default.
Both now fall back to `-`, this renderer's own unknown marker.
`polylogue/analysis/registry.py` is IN the derived-schema identity closure;
the index tier identity moves a6634e6c… -> a976e12c… on this branch (ops
unchanged).
Scope expansion: the finding was filed against
`polylogue/archive/semantic/pricing.py`, but the rendering site named in it
moved to `polylogue/analysis/registry.py`.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
The crash that operation-recovery exists to close can leave a prepared but uncommitted audit continuity command behind. Adjudication is itself an audit mutation, so both the CLI `maintenance operation-recovery --confirm` route and MCP `maintenance(operation="recovery_adjudicate")` failed with "another audit continuity mutation is already pending" -- refusing to recover exactly the operation the operator came there to close. Both surfaces now reconcile first, after the offline guard, so the durable repair runs only where mutation authority is already established. A bare inspection deliberately stays a read: reporting the committed state is not wrong, and a read must not perform a durable repair. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
`ContextImage.token_estimate` is the number a caller budgets against, and it took `admission.token_cost` -- the scheduler's own charge. A budget-degraded admission charges the minimum-viable-segment floor rather than the segment it admitted, so a `max_tokens=1` image reported 1 token while returning 14 tokens of markdown, and a `max_tokens=5` image reported 1 for the same 14 (measured on the seeded two-session fixture). Each segment's own `token_estimate` was already honest, so the image's is now their sum. It may exceed `spec.max_tokens`: that is the floor being visible rather than hidden. The scheduler's ledger still records the charge it decided; whether a declared floor may be admitted *above* the remaining budget, and be receipted as such, is a scheduler-contract question this does not settle. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
A native-messaging manifest's `path` is what the browser execs, and Chrome and Firefox both require it to be absolute on Linux and macOS. The installer wrote its `--executable` value verbatim, and that option's own default is the bare console-script name `polylogue-browser-capture-native-host`, so `polylogued browser-capture native-host install --extension-id ...` reported `Installed <path>` while writing a manifest the browser cannot launch. A relative name is now resolved on `PATH`, and an unresolvable one is refused with a typed error naming `--executable` instead of being written. Scope expansion: the finding was filed against `polylogue/daemon/browser_capture.py` (the CLI option default); the manifest is written in `polylogue/browser_capture/native_host.py`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
`test_confirmed_delete_routes_to_explicit_split_root_daemon` set up a genuine
`--db` split-root pin and then asserted that the mutation addressed the
*configured* root, contradicting both its own name and its own comment ("the
operation carries the selected archive identity"). It codified the behaviour
97be44d corrects.
Its safety argument was that a daemon serving a different root refuses the
request -- which only holds when no daemon serves the configured root. When
one does, it accepts, and the confirmed session ids are deleted from the
wrong archive.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedNext included review available in 14 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 (26)
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: c81dac5e2e
ℹ️ 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".
…#5785) ## Summary This PR salvages ChatGPT fleet worker 12's Codex-debt batch (beads `polylogue-1tyq5.55`, `.56`, `.60`, `.62`; 72 findings) and turns it into verified changes. Five fixes land with regression tests that fail on master. The worker's sixth fix (a negative completion cache) was dropped, and its health-check fix was replaced with a stricter version. ## Problem - **55.05** `health_check()` raises `SchemaSkew` when a tier is on another version. The tier probe opened the file with schema admission but caught only `sqlite3.Error`, so the probe crashed instead of reporting an error check. - **55.10** `list_assertion_candidate_reviews(limit=10)` computed `total` with a second, unbounded review read. That read ran the per-candidate judgment lookup (N+1) across the whole candidate history. - **60.01** `--stream --limit N` followed continuations with no limit. The final page could therefore fetch rows past N, and the resulting `result_too_large` refusal was re-raised for continuations instead of narrowing the page. - **60.20** `raw-authority-frontier` printed the all-state `plan_count` as `obligations=`, including terminal `superseded` plans. - **62.01** Named `analyze postmortem|portfolio|cost-outlook` computed the inherited root format but rendered from the local `None` format, so they printed text when JSON was requested. ## Solution - `_archive_tier_readiness_check` keeps admission, passes `tier=`, and reports any `SchemaRefusalError` as an ERROR check. The worker's `validate_schema=False` version was replaced because it compared only `user_version`, so a derived tier with a stale identity at the right version was reported OK. `test_health_check_reports_derived_identity_skew` fails on the worker's version. - `_archive_list_assertion_candidate_reviews` returns `(page, count)` from one read transaction. The count comes from `count_assertion_claims`, which now accepts `target_ref` and `statuses=None`. The count includes expired claims, matching the review read model. - `_read_session_windows` sends the remaining bound with every continuation. An oversized resumed page halves in place, and later pages keep the narrowed bound, because `session.read` refuses a continuation that widens its window. - The plain frontier line says `plans=` (the neutral label the finding offered). - `analyze_verb` renders every branch from the effective format: the local format if given, otherwise the root format, normalized with `normalize_output_dialect`. An explicit local `--format` still wins. - **62.16 dropped.** The deleted-candidate case was already fixed on master in 8cb1133 (#5722): each successful answer, empty or not, removes the cached matches for the refreshed prefix. The worker added a cache of empty answers that offline completion would treat as authoritative. Nothing invalidated it except a later contradicting daemon answer or the 24h TTL, and an offline reader cannot tell whether the archive changed without opening it. The cold-cache message on a miss is displayed rather than inserted, and it is accurate. - Two stale tests in `test_archive_query.py` expected `_emit_stats` to exit 0 over a converging archive. #5700 made that outcome degraded with a nonzero exit, so the tests now expect that. They failed on master before this PR. ## Verification - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w12 --wait` → job 2374: `verify: PASSED exit=0` (head 331a204ddd, pre-rebase; the rebase onto 4501f13 touched none of these files). Earlier job 2368 failed on format and mypy in the worker's commit; commit 3561647 fixes both. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w12 --wait -- tests/unit/api/test_archive_health_tier_skew.py tests/unit/api/test_assertion_candidate_review_count.py tests/unit/cli/test_analyze_named_projection_format.py tests/unit/cli/test_raw_authority_frontier_output.py tests/unit/cli/test_session_window_continuation_bounds.py tests/unit/cli/test_analyze_projections.py tests/unit/cli/test_archive_query.py tests/unit/cli/test_completion_daemon_boundary.py tests/unit/api/test_assertion_candidate_queue_health.py` → job 2405 at head 3561647: `devtools test: PASSED exit=0 diagnosis=pytest_passed`, 168 passed. - Anti-vacuity: the new tests were run on an origin/master checkout (job 2351). Every fix test failed there (11 failures, plus the 2 stale stats tests). The one exception is `test_named_analysis_local_format_overrides_inherited_json`, a precedence guard that should pass on both. Job 2355 ran the health tests against the worker's `validate_schema=False` variant, and the derived-identity case failed (status OK instead of ERROR). - Inherited, not addressed here: `tests/unit/api/test_facade_contracts.py::test_archive_facet_buckets_count_unique_sessions_for_duplicate_hits` and `::test_no_undiscovered_async_methods` fail identically on master 4501f13 (job 2401). ## Self-review - **Sibling sites.** The review count had one caller, and `judge.py` consumes the facade's `total`. The daemon health endpoint has its own tier checks and is out of scope. The other `validate_schema=False` opens are reset, paths and export tools, not health reporting. - **Cancellation and loops.** The window retry loop is bounded by halving to 1 and then re-raising. No new loop reads without a bound. - **Unbounded reads.** This PR removes one, the unbounded review read, and adds none. - **Fail-open fallbacks.** The health probe now reports refusals instead of hiding them. The dropped completion change would have turned a cache miss into an authoritative empty answer. - **Compatibility shims.** None. `count_assertion_claims` gained optional parameters, and its existing `annotations/join.py` callers are unchanged. - **Removed symbols.** No production symbol was removed. The `test_codex_debt_w12.py` files were renamed by behaviour. - **Production route.** The API tests go through `Polylogue.health_check` and `list_assertion_candidate_reviews` on bootstrapped archives. The CLI tests go through `cli` or the real command with a mocked transport (`dispatch_read`) and the real `lower_session_read`. ## Derived-identity closure `polylogue/storage/sqlite/archive_tiers/user_write.py` is a member of `docs/plans/schema-closure-baseline.json`, so this PR moves the candidate derived identity. Closure membership does not grow (the `schema-closure` gate passed). No other changed production file is a member. ## Per-finding dispositions Counts: 5 fixed, 60 fixed-already, 2 stale, 1 refuted, 4 not reached. The not-reached findings (55.18, 55.22, 60.12, 62.08) stay open on their beads. | key | disposition | evidence | test | | --- | --- | --- | --- | | 55.01 #4326 `polylogue/api/__init__.py:51` | refuted | `polylogue/api/parity.py:472–491`: The explicit context-pack exclusion includes topic_pack; composed builders do not own a separate operation identity under this contract. | — | | 55.02 #5381 `polylogue/api/archive.py:410` | fixed-already | `polylogue/api/archive.py::_read_session_transcript_page`: The normalized offset is used for both the read and returned page coordinates. | — | | 55.03 #4287 `polylogue/api/archive.py:818` | fixed-already | `polylogue/api/archive.py::_archive_list_summaries_with_post_filters`: Effective specification pagination is restored after content filtering. | — | | 55.04 #4295 `polylogue/api/archive.py:871` | fixed-already | `polylogue/api/archive.py::_archive_aggregate_facet_families / keyed`: Repeated facet bucket counts are added across chunks rather than overwritten. | — | | 55.05 #4871 `polylogue/api/archive.py:1114` | fixed | `_archive_tier_readiness_check` keeps admission and reports `SchemaRefusalError` as ERROR | `api/test_archive_health_tier_skew.py` | | 55.06 #4192 `polylogue/api/archive.py:1152` | fixed-already | `polylogue/api/archive.py::_archive_list_assertion_claims`: Uses _readable_user_tier rather than an index-backed query runner. | — | | 55.07 #4794 `polylogue/api/archive.py:1546` | fixed-already | `polylogue/storage/sqlite/connection_profile.py::_install_progress_handler`: Read frames install an expiry/cancellation-aware SQLite progress handler, including work using the bound connection. | — | | 55.08 #4552 `polylogue/api/archive.py:1691` | fixed-already | `polylogue/api/archive.py::_archive_list_assertion_candidates`: Calls the canonical actionable queue reader rather than the expiry-retaining review reader. | — | | 55.09 #4295 `polylogue/api/archive.py:3066` | fixed-already | `polylogue/api/archive.py::pathology_report`: replace(spec, limit=None, offset=0) removes query pagination from the scope denominator. | — | | 55.10 #4295 `polylogue/api/archive.py:3448` | fixed | one read transaction; scalar `count_assertion_claims` replaces the second unbounded review read | `api/test_assertion_candidate_review_count.py` | | 55.11 #4552 `polylogue/api/archive.py:3453` | fixed-already | `polylogue/api/archive.py::_readable_user_tier`: Missing/non-file and unreadable durable-tier failures retain typed unavailability rather than returning an empty list. | — | | 55.12 #4295 `polylogue/api/archive.py:3503` | fixed-already | `polylogue/cli/commands/judge.py::judge_command`: Preserves authoritative review totals; additional client-side time filtering reads the complete selection before recounting. | — | | 55.13 #5302 `polylogue/api/archive.py:4021` | fixed-already | `polylogue/operations/facade_writers.py::record_manual_continuation_product`: Invokes _resolve_session_graph before committing the manual link, refreshing topology projections. | — | | 55.14 #5302 `polylogue/api/archive.py:4021` | fixed-already | `polylogue/operations/facade_writers.py::record_manual_continuation_product`: Invokes the canonical cycle/quarantine pass instead of leaving the direct insert unchecked. | — | | 55.15 #4180 `polylogue/api/archive.py:5081` | fixed-already | `polylogue/api/archive.py::search_session_hits`: Passes unresolved spec.to_plan() to failure-classifying search_hits_for_plan. | — | | 55.16 #4180 `polylogue/api/archive.py:5512` | fixed-already | `polylogue/api/archive.py::filter`: Constructs SessionFilter without vector-provider initialization. | — | | 55.17 #5362 `polylogue/api/archive.py:5557` | fixed-already | `polylogue/api/archive.py::query_sessions`: Includes title_is_synthesized from display_label_source. | — | | 55.18 #5370 `polylogue/api/archive.py:5561` | not reached | `polylogue/api/archive.py::read_transcript_window`: Anchor lookup and transcript-window reading still have separate read lifetimes. Single-snapshot implementation remains necessary; no fix written. | — | | 55.19 #5370 `polylogue/api/archive.py:5563` | fixed-already | `polylogue/api/archive.py::read_transcript_window`: Explicitly rejects around combined with transcript filters. | — | | 55.20 #4357 `polylogue/api/archive.py:6330` | fixed-already | `polylogue/api/archive.py::get_effective_context`: Canonical ID resolution plus read_summary replaces full transcript hydration for the existence check. | — | | 55.21 #4261 `polylogue/api/insights.py:753` | fixed-already | `polylogue/api/insights.py::cost_outlook`: Restricts the cost query to the selected cycle's since/until rather than the whole archive. | — | | 55.22 #5007 `polylogue/api/insights.py:916` | not reached | `polylogue/api/insights.py::get_ancestors/get_descendants/get_siblings/get_thread/get_logical_session`: Exhaustive relationship helpers still consume the default topology page without exhaustion. No implementation written. | — | | 55.23 #5007 `polylogue/api/insights.py:927` | fixed-already | `polylogue/api/insights.py::_resolve_for_topology`: Uses canonical archive resolve_session_id, preserving native-ID resolution. | — | | 55.24 #4799 `polylogue/api/insights.py:1030` | fixed-already | `polylogue/api/insights.py::compact_lineage`: Both public page defaults use DEFAULT_LINEAGE_PAGE_LIMIT. | — | | 55.25 #4539 `polylogue/api/search_envelope_builder.py:138` | fixed-already | `polylogue/api/search_envelope_builder.py::build_search_envelope_for_spec; polylogue/operations/authority.py::authority_for_config`: The envelope delegates authority resolution to the owner that resolves the active archive root. | — | | 56.01 #4603 `polylogue/api/search_envelope_builder.py:148` | fixed-already | `polylogue/api/search_envelope_builder.py::build_search_envelope_for_spec`: Reports matched=total and analyzed=len(hits). | — | | 60.01 #5337 `polylogue/cli/archive_query.py:360` | fixed | continuations carry the remaining bound; resumed pages halve in place, never widen | `cli/test_session_window_continuation_bounds.py` | | 60.02 #4402 `polylogue/cli/archive_query.py:390` | fixed-already | `polylogue/surfaces/cursor_identity.py::search_cursor_request_identity`: Presentation-only parameters are excluded from cursor identity. | — | | 60.03 #4987 `polylogue/cli/archive_query.py:1913` | fixed-already | `polylogue/cli/render/rows.py::project_payload`: Outcome is preserved independently of selected result fields. | — | | 60.04 #5249 `polylogue/cli/click_app.py:479` | fixed-already | `polylogue/cli/query_contracts.py::QueryOutputSpec.from_params`: Explicit file destination and path retain typed FILE identity even for reserved-looking filenames. | — | | 60.05 #4337 `polylogue/cli/click_app.py:554` | fixed-already | `polylogue/cli/query_group.py::_asks_for_query_workflow_help`: The advertised find help route is handled while respecting option arity. | — | | 60.06 #4340 `polylogue/cli/click_app.py:628` | fixed-already | `polylogue/cli/click_app.py::main`: Runtime checks run inside guarded_entry passed to run_machine_entry. | — | | 60.07 #4651 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py`: The existing root group exposes only Fable, not the entire operational group. No alias is introduced by this batch. | — | | 60.08 #4580 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py`: The existing narrow route preserves the promised Fable-packet command. No alias is introduced by this batch. | — | | 60.09 #4550 `polylogue/cli/click_command_registration.py:192` | fixed-already | `polylogue/cli/commands/insights_alias.py::_register_fable_packet`: Registers only the intended Fable command rather than the entire operational group. | — | | 60.10 #4698 `polylogue/cli/commands/check.py:41` | fixed-already | `polylogue/scenarios/operational_surfaces.py`: Authored doctor scenarios use current routes without the retired repair flags. | — | | 60.11 #5349 `polylogue/cli/commands/diagnostics.py:992` | fixed-already | `polylogue/cli/commands/diagnostics.py::latency_command`: The empty-bucket branch still renders incomplete-drop accounting. | — | | 60.12 #5639 `polylogue/cli/commands/import_command.py:117` | not reached | `polylogue/cli/commands/import_command.py::_wait_for_demo_ingest`: Owner completion accounting improved, but a degraded receipt still causes immediate failure instead of waiting through the remaining convergence budget. No implementation written. | — | | 60.13 #5314 `polylogue/cli/commands/insights.py:147` | fixed-already | `polylogue/scenarios/insight_surfaces.py; tests/unit/cli/test_stdout_stderr_split.py`: Inventories use current rather than retired commands. | — | | 60.14 #4678 `polylogue/cli/commands/insights.py:224` | fixed-already | `polylogue/cli/commands/insights.py::_render_status_plain`: Plain output includes degraded counts and fallback reasons. | — | | 60.15 #4292 `polylogue/cli/commands/insights.py:450` | fixed-already | `polylogue/cli/commands/insights.py::_packet_json_document`: Dataclass tuples are lowered to JSON-native arrays. | — | | 60.16 #5311 `polylogue/cli/commands/judge.py:417` | fixed-already | `polylogue/cli/commands/judge.py::judge_command`: Interactive approval forwards the evidence digest and checks failed counts before printing success. | — | | 60.17 #4133 `polylogue/cli/commands/maintenance/_blob_gc.py:81` | fixed-already | `polylogue/cli/commands/maintenance/_blob_gc.py::blob_gc_command`: Blocked previews set ok=false and exit nonzero in both formats. | — | | 60.18 #4955 `polylogue/cli/commands/maintenance/_blob_gc.py:211` | stale | `polylogue/cli/commands/maintenance/_blob_gc.py`: gc_recover_command is gone; the remaining command is preview-only. | — | | 60.19 #5345 `polylogue/cli/commands/maintenance/_blob_integrity.py:52` | stale | `polylogue/cli/commands/maintenance/_blob_integrity.py`: _submit_replace_from_source and its cited relative-output forwarding route are gone. | — | | 60.20 #5350 `polylogue/cli/commands/maintenance/_raw_identity.py:47` | fixed | plain line labels the all-state count `plans=` | `cli/test_raw_authority_frontier_output.py` | | 60.21 #5301 `polylogue/cli/commands/maintenance/_raw_identity.py:59` | fixed-already | `polylogue/cli/commands/maintenance/_raw_identity.py::raw_authority_blockers_command`: Paginated public blocker inspection exposes expected/observed evidence. | — | | 60.22 #4955 `polylogue/cli/commands/maintenance/_raw_identity.py:247` | fixed-already | `polylogue/cli/commands/maintenance/_raw_identity.py::raw_authority_blocker_resolve_command`: Checks the affected count rather than presenting no-op resolution as an applied mutation. | — | | 60.23 #4824 `polylogue/cli/commands/maintenance/_verify_archive.py:85` | fixed-already | `polylogue/cli/commands/maintenance/_verify_archive.py::verify_archive_command`: Source-frontier construction is conditional on selected source-conservation work. | — | | 60.24 #5491 `polylogue/cli/commands/paths.py:75` | fixed-already | `polylogue/cli/commands/paths.py::_raw_materialization_readiness`: Propagates the selected index path through archive_debt_list(index_db_path=...). | — | | 60.25 #5353 `polylogue/cli/commands/status.py:342` | fixed-already | `polylogue/operations/daemon_status.py::produce_operation_status`: Merges runtime collection metadata into pinned readiness components. | — | | 62.01 #5422 `polylogue/cli/query_verbs.py:2434` | fixed | `analyze_verb` renders from the effective (normalized, inherited) format | `cli/test_analyze_named_projection_format.py` | | 62.02 #5007 `polylogue/cli/read_views/lineage.py:78` | fixed-already | `polylogue/cli/read_views/lineage.py`: The replacement operation-backed route uses the resolved target; the old _run path is gone. | — | | 62.03 #5407 `polylogue/cli/read_views/messages.py:226` | fixed-already | `polylogue/cli/read_views/messages.py::_write_messages_file`: Resolves symlink output before choosing the staging sibling. | — | | 62.04 #5407 `polylogue/cli/read_views/messages.py:227` | fixed-already | `polylogue/cli/read_views/messages.py::_write_messages_file`: Flushes and fsyncs the staged descriptor before replacement and synchronizes the directory. | — | | 62.05 #4291 `polylogue/cli/read_views/query_set.py:196` | fixed-already | `polylogue/cli/read_views/correlation.py::run_read_correlation`: Renders a string and delivers it through deliver_content instead of an uncaptured console-only renderer. | — | | 62.06 #5374 `polylogue/cli/read_views/session_evidence.py:180` | fixed-already | `polylogue/cli/read_views/session_evidence.py::_read_evidence_window`: Projection body coordinates take precedence before operation lowering. | — | | 62.07 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/query_output.py::deliver_query_output`: File delivery retains secret-candidate scanning. | — | | 62.08 #5520 `polylogue/cli/read_views/standard.py:99` | not reached | `polylogue/cli/read_views/standard.py::run_read_summary_or_transcript; polylogue/cli/archive_query.py::_read_session_windows`: The standard file path still accumulates the transcript and buffers its rendered document. End-to-end operation-backed streaming is not implemented. | — | | 62.09 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/read_views/standard.py::run_read_summary_or_transcript`: Forwards a typed FILE QueryDeliveryTarget, preserving reserved-looking filenames. | — | | 62.10 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/operations/daemon_reads.py::_session_identity_projection; polylogue/cli/archive_query.py::_session_message_text`: The operation preserves tool_input; rendering includes structured tool input and omits reasoning blocks. | — | | 62.11 #5520 `polylogue/cli/read_views/standard.py:99` | fixed-already | `polylogue/cli/archive_query.py::_read_session_windows`: Initial oversized pages already halve their bound at the inspected base. This batch additionally fixes resumed-page narrowing under 60.01. | — | | 62.12 #5266 `polylogue/cli/session_rows.py:141` | fixed-already | `polylogue/cli/session_rows.py::_query_page_with_authority`: Synthetic missing-session selections explicitly include next_offset=None. | — | | 62.13 #5426 `polylogue/cli/shared/machine_errors.py:233` | fixed-already | `polylogue/cli/shared/machine_errors.py::error_archive_writer_ownership`: Undecidable ownership has a separate remedy that does not assert an observed resident daemon. | — | | 62.14 #5426 `polylogue/cli/shared/machine_errors.py:285` | fixed-already | `polylogue/cli/shared/machine_errors.py::extract_command`: Recognizes --output-format as a value-bearing option. | — | | 62.15 #5545 `polylogue/cli/shell_completion_values.py:117` | fixed-already | `polylogue/cli/shell_completion_values.py::_cached_value_matches`: Session IDs match native-ID and title substrings. | — | | 62.16 #5545 `polylogue/cli/shell_completion_values.py:135` | fixed-already | deleted-candidate case fixed by 8cb1133 (#5722): every successful answer prunes the refreshed prefix; negative-answer cache declined (see Solution) | — | | 62.17 #5545 `polylogue/cli/shell_completion_values.py:145` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: A per-archive map retains more than the most recent archive. | — | | 62.18 #5545 `polylogue/cli/shell_completion_values.py:157` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: Removes an existing value before reinsertion at the retention tail. | — | | 62.19 #5545 `polylogue/cli/shell_completion_values.py:178` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: Global serialized-byte eviction precedes publication. This batch includes new empty observations in that accounting. | — | | 62.20 #5545 `polylogue/cli/shell_completion_values.py:181` | fixed-already | `polylogue/cli/shell_completion_values.py::_remember_completion_values`: flock serializes the full cache read-modify-write sequence. | — | | 62.21 #5382 `polylogue/cli/write_authority.py:104` | fixed-already | `polylogue/storage/sqlite/write_lease.py::arm_write_lease_enforcement`: Locked process-wide user/suppressor counts make arming overlap-safe. | — | ## Residuals - The four not-reached findings remain open. - Changing `user_write.py` moves the derived identity, so this PR has to land before a rebuild starts. - The two `test_facade_contracts.py` failures are inherited from master. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
|
Closing out open Codex review threads on this PR (evidence checked against master at ef10e59):
Resolving the fixed, stale and refuted threads; tracked threads stay open. |
Summary
Eighteen live P1 findings closed across fourteen areas — cli, archive, daemon, api, surfaces, core, mcp, security, operations, maintenance and four small config areas — from a triage of all 86 August-tranche findings in those briefs.
22 LIVE-and-fixed (18 distinct defects), 57 STALE (66%), 6 LIVE-declined, 1 collision.
Defects worth naming
analyze postmortemcrashed outright. Reproduced by running it:TypeError: analyze_verb() got multiple values for argument 'count_only'. The named-projection subcommands bypassed thepass_contextwrapper. The same commit fixesanalyze facetsignoring the root--format.unknown.OUTCOME_VALUES = {completed, failed, abandoned, unknown}andTERMINAL_STATE_VALUES = {tool_left, error_left, question_left, refused, truncated, unknown}are disjoint exceptunknown, so the projection erased the state in theterminal_statefield of every session-list row.quarantinedwas the onlyEvidenceRefStatewith no ladder branch, so a quarantined leaf beside a valid one gavePARTIALLY_SUPPORTEDwhose.supportedis True.authoritydefaults tounknown, and{'unknown'} <= {'agent','assertion'}is False, so the laundering guard was skipped and the verdict wasSUPPORTED. And only{private, held_private}were checked, sopending/rejectedrecorded no witness and producedSUPPORTED.value_json/body_textwere cleared, leavingkey,scope_ref,staleness_json,supersedes_json,evidence_refs_json,context_policy_json. It also deleted a policy under anON DELETE RESTRICTFK, trusted a plan resolved in an earlier transaction, and marked every assertion on a surviving query deleted when excising a relation it owned.{'before': 100, 'after': -2, 'delta': -102, 'measured': True}.totalcounted sessions while the page counted FTS block rows:assert None == 4on a 4-hit page over 2 sessions.usd=0where JSON printednull—_nested("estimate","total_usd","0").The filter fails in both directions
66% stale, above the 35–60% predicted. Whole families died to single refactors: all 3
.circlecifindings to a config rewrite, all 5mcp, all 3demo, all 4maintenanceto the canonical-logical-key work.But the more useful finding is the opposite failure. Four live defects had moved: two to entirely different modules (
cli/archive_query.py→operations/daemon_reads.py;insights/registry.py→analysis/registry.py) and two within their package. A pure line-anchor check would have called all four stale. The symbol is the durable identity; the path is not.A test that pinned the defect instead of the intent
test_confirmed_delete_routes_to_explicit_split_root_daemonset up a split-root pin, named itself after the correct behaviour, carried a comment saying "the operation carries the selected archive identity" — and then asserted the configured root. Green while contradicting itself. Updated with the reasoning in its own commit.Declined with measurements
Six live findings declined rather than patched. The two worth reading:
Vector-lane degradation (2 findings) —
resolve_vector_providerclassifies only construction failure, andvector_provider.query()is unguarded at three call sites, so a provider that constructs but fails at query time raises pastproject_search_hits; separately, an emptyembeddings.dbyields a confident empty page instead ofEmbeddingRetrievalNotReadyError. Declined together because the fix spans three call sites plus a newLaneFailurekind plus the daemon read path — a cohesive unit, not a partial patch under time pressure.API bulk delete self-issues its own
bound_tokenand opens a second write-capableArchiveStorebeside a live daemon. Declined because CLAUDE.md records exactly this class: "Process-local write-lease enforcement alone does not exclude external CLI/API writers… Remaining bypasses are completion work, not an alternate write policy."The handed-off compaction finding: declined with three measurements
I asked this lane to check whether
surfaces/compaction.py:_tool_outcomereading only the legacy compatibility fields is live. It is not, and the reasoning is better than the fix I proposed:compact_sessions,build_compaction_packandcompile_corpus_compactionhave no production caller anywhere in the tree.tool_outcome='error'with both legacy fields NULL yields(None, None), and the caller's drop guard requiresis_error is False, so an error is never dropped as spam. The failure mode is over-retention of a canonicalok— wasted budget, nothing lost.derive_tool_outcomeswritesis_error = None if outcome is UNKNOWN else outcome is ERRORon every persisted tool_result block, invoked from the archive write path itself. The one disagreeing shape (tool_outcome='error'+is_error=False) is refused at the write boundary:ValueError: tool outcome derivation refused … conflicting result evidence for tool_id='t1'.I verified claims 1 and 3 independently. The residual is a retirement question — an uncalled entry point reading a compatibility field — not a defect.
Verification
devtools verify --quickat basedevtools verify --quickat rebased HEADdevtools render all --checkout of synccount 0devtools gate mypydevtools gate consumer-reachabilityInherited red, attributed: 8
test_plain_cli_snapshots.pynodeids fail identically at base and on the branch (title_is_synthesized,unbound_sessions,wallclock_span_ms, session-id ordering). Not absorbed, not fixed.Every fix carries an executed anti-vacuity mutation and an opposite-direction test that stayed green. Two mutations were rebuilt after a full revert produced an
AttributeErrorat symbol level rather than the behavioural failure being pinned.Schema closure — reconvergence required
IN:
surfaces/query_rows.py,security/query_excision.py,analysis/registry.py. out: ten others.DerivedTier.index:5274c9cc…→a976e12c024efed0b374f922ee7a4d59511a2c708a3bb0a4e09c1319980e9b52DerivedTier.ops: unchangedMust land before a fresh rebuild starts, never during one. Re-measure after rebase; several concurrent PRs move the same value.
REPORT_VERSIONfor the workload probe moves 22 → 23 becauseretry_debt_unresolvedbecame nullable and the section gainedretry_debt_available.compare()refuses mismatched versions by design, so older snapshots are refused loudly rather than diffed wrongly.Collision
Topic-pack citations can never report a hash.
BLOCKS_SPECcolumncontent_hashhasdomain_name=None, sodomain_kwargsomits it and_citationalways finds nothing — production topic packs reportcontent_hash_citations: 0. The focused test passes only because its fake store injects a non-production block shape. Fix site isstorage/hydrators.py(liftcontent_hashasmedia_typealready is), which is another lane's scope.Residuals, highest value first
security/excision.py:581— retry detection cannot distinguish an old completed excision from an interrupted current one; needs a source-revision binding on the stored receipt.daemon/backup.py:1790— a verified-backup receipt stays admissible when the blobs it subtracted are provable only by replaying an external acquisition file that may since have changed./serves header links to/costand/observabilitywithout bootstrapping the first-party credential, which is minted only on load-more.product/workflows.py— vector hits enterTopicPackResult.sessionsas fully hydratedSessionobjects while every other lane stores a summary; andget_session_topologyis walked per selected summary with no node bound and no dedupe by lineage root.🤖 Generated with Claude Code
https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy