Repository navigation
feat(cli): unify session row rendering contracts - #4201
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
…logue-x7d # Conflicts: # devtools/patterns/baselines/sqlite-error-default.txt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 953063b520
ℹ️ 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".
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 36608462 | Triggered | Generic High Entropy Secret | fa5fdfb | polylogue/surfaces/compaction.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa5fdfb427
ℹ️ 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".
## Summary Corpus run 4 fix lane (surfaces/storage/daemon cluster): 3 real regressions fixed, 5 stale expectations updated, from the 18-failure residual set against frozen master `34ddfe09d`. ## Problem (evidence) - #4201's shared row projection dropped `terminal_state`/`total_cost_usd`/`relative_time` from the daemon list payload, breaking direct/daemon JSON parity and the summary display label (2 tests). - #4149 regressed `_repair_superseded_raw_snapshots` to open the index tier read-write even when absent — a destructive cleanup consulting a just-created empty authority instead of failing closed (1 test). - Stale expectations (5): synthetic-wire transport representation (#4184), readiness fixtures pinned at index v72 (now v74), protocol-message expectations (#4173), topic-caveat fixture (#4173). ## Solution - Daemon summary payload routes through the shared `session_row` projection; `display_label` joins the title fallback chain. - Destructive raw cleanup requires a readable existing index tier; otherwise returns a typed skipped-unsuccessful result naming the missing authority. ## Verification - The 9 target tests: 9 passed; full containing files: 335 passed. - `devtools verify --quick` + pre-push quick baseline: green. ## Residuals - `test_clock_guard` (in the corpus-18 set) passed at this lane's baseline and was left untouched; it fails under some collection orders and is being diagnosed separately by the overseer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
## Summary Fixes the two serial-lane corpus failures exposed when corpus run 7 reached step 19 for the first time, and production-shapes the codex-804 fixture's cursor surgery (first half of that storage-scale failure). ## Problem (evidence) Corpus runs abort at the first failed step, so `pytest-native-serial-all` (step 19) and `storage-scale` (step 20) had not executed in any recent run; run 7 (`c53460c8`) was the first to reach them after the parallel parts went green. Serial failures: - `test_archive_facets_expose_provider_role_and_material_origin_split`: runtime-protocol material now carries message type `protocol` (#4173 vocabulary); the test pinned `message == 3`. Its protective core — the authoredness split — is unchanged. - `test_select_returns_fzf_choice_in_json_in_a_real_pty`: the enriched row JSON (#4201: `cost_usd`, `outcome`, `relative_time`) outgrew the 200-column PTY, hard-wrapping mid-token so the JSON parse hit the wrap control character. PTY widened to 400 columns; expected payload updated with the three fields. - Storage-scale `test_sanitized_codex_804_revision_recovery_proof` (long-red: fails at least back to #4146, invisible for the same never-reached-step reason): the fixture's rewind cursor passed `source_revision` for a JSONL file, routing it down the SQLite-snapshot branch where the NFC content hash was recorded as the byte-prefix authority — unmatchable by `plan_append`'s sha256-of-bytes proof. Dropping it restores the JSONL branch, which derives the prefix authority from the rewound on-disk bytes; the planner now plans all 16 fragments. ## Verification - `devtools test` on both serial tests → 2 passed; full serial marker suite locally: 25→27 passed for the fixed pair. - codex-804: planner phase now completes; the test still fails downstream (append revision-application decisions missing for deferred appends) — dispatched to a dedicated fix lane, tracked for corpus closure. - `devtools verify --quick` → all 15 gates ok. ## Residuals - codex-804's remaining ledger gap is the sole known corpus-red; lane in flight. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
## Summary This lands the worker-13 batch on current master. The batch covers beads polylogue-1tyq5.77, .110, .63, .53, .54 and .88. I checked each of the worker's 24 proposed fixes against master and kept 22. CTX-07 was dropped because #5778 already fixed it, and SURF-03 was dropped after master merged #5793, which fixes it the same way. Of the 74 findings, 22 are fixed here, 39 were already fixed on master, and 13 were not reached. ## Problem All 22 kept defects still reproduce on master (re-checked after merging master at 1beb2e5): - MCP search resumed from a continuation alone reported `query: ""` and lost `sort`. It also sent the default limit, which the continuation guard refuses as widening. - Personal-state pages that exceeded the response budget came back with no continuation. - Reference pipelines, list read views and completions ignored `offset`. - `read(view="messages")` for a missing session returned `internal_error`. - Discovery did not advertise the `messages` view, the `precompact` intent, the `clear_corrections` confirmation or the single-candidate evidence digest. - Compaction had three defects: - it invented a text-only hash when the archive gave none; - `pack_ref` hashed only the kept anchor refs; - the Markdown rendering showed only the aggregate drop counts. - Read overrides used `bool("false")`, so `"false"` meant true. JSON-only views also defaulted to Markdown. - Windows working-directory paths were not shortened on POSIX hosts. - Envelopes built from domain sessions had no relative time. - Orchestration `children` could point at nodes removed by topology truncation. - Excision had three defects: - marker tombstones used an `excision-marker:` ref, which fails ObjectRef validation; - excising a watch baseline left its watch enabled; - `INSERT OR IGNORE` hid ledger CHECK failures, and the content was deleted anyway. ## Solution The worker's commit is cherry-picked, with these corrections: - The compaction identity is moved into #5758's fixed-point budget loop. A fixed-width placeholder means filling in `pack_ref` does not change the measured size. - `message_transcript_window` already raises the typed `SessionNotFoundError` on master (#5728), so `read(view="messages")` maps it to `not_found`. The now-dead string-matching translation in `get_messages_paginated` is removed. - The query-excision ledger keeps only `ON CONFLICT(ledger_id) DO NOTHING`. The schema CHECKs already refuse bad rows, so the worker's extra checks before and after the insert are removed. - Repo basenames now split on both path separators, the same as working directories. - A list view's outcome now counts the whole collection, not only the returned page. - After #5793 made orchestration children a streamed section, the truncation filter narrows `children.rows`, and its test uses the new builder signature. - The worker's tests are corrected: - the relative-time and tombstone tests could not pass as written and are fixed; - the test file is renamed; - tests that only checked prose are narrowed. ## Verification After merging master at 1beb2e5 (merge commit 88afebc): - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w13` (job 2474): `verify: PASSED exit=0 ... head=88afebc6e16e`. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w13 -- tests/unit/mcp/test_capability_pointer_routes.py tests/unit/mcp/test_privileged_tools.py tests/unit/mcp/test_session_orchestration.py tests/unit/mcp/test_session_projection_table.py tests/unit/mcp/test_tool_discovery_contracts.py tests/unit/security/test_excision.py tests/unit/security/test_query_excision_scope.py tests/unit/surfaces/test_compaction.py tests/unit/surfaces/test_read_contract.py tests/unit/surfaces/test_session_envelope_derivation.py tests/unit/operations/test_read_view_compact.py tests/unit/agent_integration` (job 2475): after the isolated rerun, `1 failed, 7 passed`. The one failure, `test_published_examples_use_live_operation_vocabularies_and_preconditions`, fails the same way on origin/master 1beb2e5 (job 2530: `1 failed`). Before the merge, on 967e01e: - verify_quick (job 2071) passed; pytest_focused (job 2070) had 4 failures that also failed on the base (job 2056). - Anti-vacuity (job 2028): with every production file in this PR reverted to the base and the new tests kept, `36 failed`. Every new test case failed without its fix. The merge changes only the orchestration filter's target (`children.rows`), and that test still checks the same condition. ## Self-review - **Sibling sites:** the repo basename had the same separator bug as the working directory and is fixed too. The MCP `not_found` relies on the typed error master's transcript-window owner now raises (#5728). The `get` list projections are still unpaged, but no finding covers them. - **Cancellation and loops:** no new loops. In the compaction loop, only the identity assigned at return changes. - **Unbounded reads:** list views, reference members and completions now page. The facade calls behind them still load whole lists (see Residuals). - **Fail-open:** boolean overrides with an unknown spelling are refused, and a ledger CHECK failure now raises before any deletion. - **Compatibility shims:** none added. The `ValueError` string-match translation is removed. - **Removed symbols:** `_PERSONAL_STATE_PROJECTIONS` moved to `query_contracts.PERSONAL_STATE_PROJECTIONS`, with every reference updated. `session_list_projection_names` is still used elsewhere. - **Production route:** the MCP tests call the registered tools, and the excision and compaction tests call the real functions. ## Findings | key | disposition | evidence | test | |---|---|---|---| | MCP-01 / #4580:polylogue/mcp/archive_support.py:436 | fixed-already | polylogue/mcp/archive_support.py:439-483 | — | | MCP-02 / #4353:polylogue/mcp/declarations/registry.py:178 | fixed-already | polylogue/mcp/declarations/registry.py:208-233 | — | | MCP-03 / #4698:polylogue/mcp/declarations/registry.py:236 | fixed-already | polylogue/mcp/declarations/registry.py:270-285; polylogue/agent_integration/spec.py:683-710 | — | | MCP-04 / #4786:polylogue/mcp/query_contracts.py:154 | fixed-already | polylogue/mcp/server_cutover.py:325-391 | — | | MCP-05 / #5480:polylogue/mcp/server_cutover.py:87 | fixed-already | polylogue/mcp/server_cutover.py:90-92 | — | | MCP-06 / #5480:polylogue/mcp/server_cutover.py:95 | fixed-already | polylogue/mcp/server_cutover.py:100-108 | — | | MCP-07 / #4996:polylogue/mcp/server_cutover.py:326 | fixed | this PR | `tests/unit/mcp/test_privileged_tools.py::test_search_continuation_preserves_query_sort_and_omitted_limit` | | MCP-08 / #4410:polylogue/mcp/server_cutover.py:583 | not reached | polylogue/mcp/server_cutover.py:839-979 | — | | MCP-09 / #4295:polylogue/mcp/server_cutover.py:770 | fixed | this PR | `tests/unit/mcp/test_tool_discovery_contracts.py::test_personal_state_byte_budget_continuation_advances_from_nonzero_offset` | | MCP-10 / #4777:polylogue/mcp/server_cutover.py:830 | fixed | this PR | `tests/unit/mcp/test_privileged_tools.py::test_reference_relation_query_advances_requested_offset` | | MCP-11 / #4297:polylogue/mcp/server_cutover.py:856 | not reached | polylogue/mcp/server_cutover.py:1402-1404 | — | | MCP-12 / #4424:polylogue/mcp/server_cutover.py:879 | fixed | this PR | `tests/unit/mcp/test_capability_pointer_routes.py::test_capability_discovery_includes_messages` | | MCP-13 / #4424:polylogue/mcp/server_cutover.py:885 | fixed-already | polylogue/mcp/server_cutover.py:1317-1390 | — | | MCP-14 / #4424:polylogue/mcp/server_cutover.py:885 | fixed | this PR | `tests/unit/mcp/test_privileged_tools.py::test_missing_messages_session_is_not_found` | | MCP-15 / #4190:polylogue/mcp/server_cutover.py:926 | fixed-already | polylogue/agent_integration/spec.py:453-475 | — | | MCP-16 / #4190:polylogue/mcp/server_cutover.py:959 | not reached | polylogue/mcp/server_cutover.py:1585 | — | | MCP-17 / #4190:polylogue/mcp/server_cutover.py:959 | not reached | polylogue/mcp/server_cutover.py:1585 | — | | MCP-18 / #4256:polylogue/mcp/server_cutover.py:1035 | fixed | this PR | `tests/unit/mcp/test_tool_discovery_contracts.py::test_precompact_is_in_the_published_context_contract` | | MCP-19 / #4256:polylogue/mcp/server_cutover.py:1036 | fixed-already | polylogue/mcp/server_cutover.py:1680; polylogue/mcp/server_cutover.py:1007 | — | | MCP-20 / #4419:polylogue/mcp/server_cutover.py:1119 | not reached | polylogue/mcp/server_cutover.py:1702-1711 | — | | MCP-21 / #4362:polylogue/mcp/server_cutover.py:1251 | not reached | polylogue/mcp/server_cutover.py:1830-1867; polylogue/config.py:79-175 | — | | MCP-22 / #5248:polylogue/mcp/server_cutover.py:1273 | fixed | this PR | `tests/unit/mcp/test_session_projection_table.py::test_read_list_views_honor_limit_offset_and_next_page` | | MCP-23 / #5355:polylogue/mcp/server_cutover.py:1467 | fixed | this PR | `tests/unit/mcp/test_capability_pointer_routes.py::test_completions_page_against_shared_owner` | | MCP-24 / #4213:polylogue/mcp/server_cutover.py:2219 | fixed | this PR | `tests/unit/mcp/test_tool_discovery_contracts.py::test_clear_corrections_confirmation_is_discoverable_and_enforced` | | MCP-25 / #5311:polylogue/mcp/server_cutover.py:2811 | fixed | this PR | `tests/unit/mcp/test_privileged_tools.py::TestJudgeTool::test_single_candidate_shorthand_builds_a_one_item_bulk_call` | | SURF-01 / #4539:polylogue/surfaces/authority.py:65 | not reached | polylogue/surfaces/authority.py:65; polylogue/mcp/server_cutover.py:1382-1385 | — | | SURF-02 / #4197:polylogue/surfaces/compaction.py:150 | fixed | this PR | `tests/unit/surfaces/test_compaction.py::test_compaction_does_not_invent_canonical_content_hashes` | | SURF-03 / #4197:polylogue/surfaces/compaction.py:223 | fixed-already | #5793 (d1abc18): polylogue/surfaces/compaction.py:273-275; covered by tests/unit/operations/test_read_view_compact.py | — | | SURF-04 / #4197:polylogue/surfaces/compaction.py:263 | not reached | polylogue/surfaces/compaction.py:271-331 | — | | SURF-05 / #4197:polylogue/surfaces/compaction.py:276 | not reached | polylogue/surfaces/compaction.py:276-299 | — | | SURF-06 / #4197:polylogue/surfaces/compaction.py:292 | fixed | this PR | `tests/unit/surfaces/test_compaction.py::test_compaction_identity_commits_to_content_projection_and_provenance` | | SURF-07 / #4197:polylogue/surfaces/compaction.py:331 | fixed | this PR | `tests/unit/surfaces/test_compaction.py::test_compaction_markdown_preserves_fidelity_manifest_and_omission_anchors` | | SURF-08 / #4201:polylogue/surfaces/payloads.py:1064 | not reached | polylogue/surfaces/payloads.py:1172-1176 | — | | SURF-09 / #4201:polylogue/surfaces/payloads.py:1196 | fixed | this PR | `tests/unit/surfaces/test_session_envelope_derivation.py::test_domain_session_rows_keep_relative_time` | | SURF-10 / #4539:polylogue/surfaces/payloads.py:3947 | fixed-already | polylogue/daemon/http.py:4805-4807 | — | | SURF-11 / #4201:polylogue/surfaces/query_rows.py:106 | fixed | this PR | `tests/unit/surfaces/test_session_envelope_derivation.py::test_session_row_shortens_windows_and_posix_working_directories` | | SURF-12 / #4321:polylogue/surfaces/read_contract.py:65 | fixed | this PR | `tests/unit/surfaces/test_read_contract.py::test_read_boolean_false_overrides_are_not_truthy_strings` | | SURF-13 / #5515:polylogue/surfaces/read_contract.py:78 | fixed | this PR | `tests/unit/surfaces/test_read_contract.py::test_read_github_correlation_false_stays_disabled` | | SURF-14 / #4321:polylogue/surfaces/read_contract.py:100 | fixed | this PR | `tests/unit/surfaces/test_read_contract.py::test_default_read_formats_belong_to_their_profile` | | SURF-15 / #4321:polylogue/surfaces/read_contract.py:156 | not reached | polylogue/surfaces/read_contract.py:100-117; polylogue/surfaces/read_contract.py:159-170 | — | | CTX-01 / #4329:polylogue/context/compiler.py:263 | fixed-already | polylogue/context/compiler.py:265-284 | — | | CTX-02 / #4329:polylogue/context/compiler.py:272 | fixed-already | polylogue/context/compiler.py:292-295 | — | | CTX-03 / #4385:polylogue/context/configuration_evidence.py:84 | fixed-already | polylogue/context/configuration_evidence.py:94-96 | — | | CTX-04 / #4385:polylogue/context/configuration_evidence.py:132 | fixed-already | polylogue/context/configuration_evidence.py:137 | — | | CTX-05 / #4385:polylogue/context/configuration_evidence.py:141 | fixed-already | polylogue/context/configuration_evidence.py:144-176 | — | | CTX-06 / #4385:polylogue/context/configuration_evidence.py:159 | fixed-already | polylogue/context/configuration_evidence.py:171 | — | | CTX-07 / #4385:polylogue/context/configuration_evidence.py:180 | fixed-already | #5778 (3e9ec3d): declared-name mapping with own-name fallback; worker change dropped | — | | CTX-08 / #4385:polylogue/context/configuration_evidence.py:204 | fixed-already | polylogue/context/configuration_evidence.py:216-266 | — | | CTX-09 / #4385:polylogue/context/configuration_evidence.py:234 | fixed-already | polylogue/context/configuration_evidence.py:248-261 | — | | CTX-10 / #4256:polylogue/context/preamble.py:80 | fixed-already | polylogue/context/preamble.py:74-87; polylogue/api/archive.py:3429-3441 | — | | CTX-11 / #4634:polylogue/context/preamble.py:83 | fixed-already | polylogue/operations/facade_writers.py:415-427 | — | | CTX-12 / #4799:polylogue/context/preamble.py:371 | fixed-already | polylogue/context/preamble.py:588-601 | — | | CTX-13 / #4256:polylogue/context/scheduler.py:240 | fixed-already | polylogue/context/scheduler.py:349 | — | | CTX-14 / #4256:polylogue/context/scheduler.py:289 | fixed-already | polylogue/context/scheduler.py:425-437 | — | | AGENT-01 / #4266:polylogue/agent_integration/data/tool-contracts.json:132 | fixed-already | polylogue/agent_integration/spec.py:378-392 | — | | AGENT-02 / #4266:polylogue/agent_integration/data/tool-contracts.json:189 | fixed-already | polylogue/agent_integration/spec.py:416-421 | — | | AGENT-03 / #4266:polylogue/agent_integration/data/tool-contracts.json:288 | fixed-already | polylogue/agent_integration/spec.py:453-475 | — | | AGENT-04 / #4266:polylogue/agent_integration/data/tool-contracts.json:382 | fixed-already | polylogue/agent_integration/spec.py:511-516 | — | | AGENT-05 / #4266:polylogue/agent_integration/data/tool-contracts.json:502 | fixed-already | polylogue/agent_integration/data/tool-contracts.json | — | | AGENT-06 / #4266:polylogue/agent_integration/data/tool-contracts.json:631 | fixed-already | polylogue/agent_integration/spec.py:663-675 | — | | AGENT-07 / #5449:polylogue/agent_integration/spec.py:411 | fixed-already | polylogue/agent_integration/spec.py:410 | — | | AGENT-08 / #5449:polylogue/agent_integration/spec.py:411 | fixed-already | polylogue/agent_integration/spec.py:410 | — | | ANALYSIS-01 / #5314:polylogue/analysis/archive_models.py:109 | fixed-already | polylogue/analysis/archive_models.py:12 | — | | ANALYSIS-02 / #5608:polylogue/analysis/delegation_work_evidence_materializer.py:48 | fixed-already | polylogue/analysis/delegation_work_evidence_materializer.py:79-90 | — | | ANALYSIS-03 / #5608:polylogue/analysis/delegation_work_evidence_materializer.py:106 | fixed-already | polylogue/analysis/delegation_work_evidence_materializer.py:97-114 | — | | ANALYSIS-04 / #4678:polylogue/analysis/export_bundles.py:77 | fixed-already | polylogue/analysis/export_bundles.py:28 | — | | ANALYSIS-05 / #4864:polylogue/analysis/orchestration_evidence.py:362 | fixed | this PR | `tests/unit/mcp/test_session_orchestration.py::test_truncated_orchestration_children_belong_to_retained_topology` | | ANALYSIS-06 / #4985:polylogue/analysis/pathology.py:192 | fixed-already | polylogue/analysis/pathology.py:51 | — | | ANALYSIS-07 / #4678:polylogue/analysis/readiness.py:45 | fixed-already | polylogue/analysis/readiness.py:43 | — | | SEC-01 / #4320:polylogue/security/excision.py:574 | not reached | polylogue/security/excision.py:1091-1092; polylogue/security/excision.py:1382-1426 | — | | SEC-02 / #5452:polylogue/security/excision.py:1281 | fixed | this PR | `tests/unit/security/test_excision.py::TestApplySessionExcision::test_apply_tombstones_marker_assertions_without_retaining_content` | | SEC-03 / #4200:polylogue/security/query_excision.py:170 | fixed | this PR | `tests/unit/security/test_query_excision_scope.py::test_relation_excision_disables_only_watches_whose_baseline_was_removed` | | SEC-04 / #4200:polylogue/security/query_excision.py:176 | not reached | polylogue/security/query_excision.py:227-235 | — | | SEC-05 / #4200:polylogue/security/query_excision.py:176 | fixed | this PR | `tests/unit/security/test_query_excision_scope.py::test_a_refused_tombstone_aborts_before_any_deletion` | ## Derived-identity closure `devtools schema closure` (scratch job 1963) reports three changed files inside the closure: - `polylogue/security/query_excision.py` - `polylogue/surfaces/payloads.py` - `polylogue/surfaces/query_rows.py` All other changed production files are outside it. Land this before the next rebuild starts. ## Residuals - 13 findings were not reached: MCP-08, 11, 16, 17, 20, 21; SURF-01, 04, 05, 08, 15; SEC-01, 04. - Compaction `pack_ref` values change. - The facade list methods behind the paged MCP views still load the full list before slicing it. 🤖 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]>
## Summary Lands 24 verified storage fixes from the worker-6 Codex-debt batch (beads polylogue-1tyq5.101, .102, .103). Each fix was rechecked against current master and has a regression test on its production route. One worker fix was dropped because it contradicts documented policy (103-09). The other 50 findings are recorded below as fixed-already, stale, refuted or not reached. ## Problem The worker could not run tests. Its draft (ca8dbff) was based on e1a2f75, and master has moved on since then. Each "fixed" claim therefore had to be checked again on current master. The defects that remain on master: - **Material admission** (`storage/materials.py`) - A valid JSON document larger than 2 MB was marked `malformed`. - Multi-record NDJSON was marked `malformed` too, because it is not a single JSON value. - ZIP entry names were copied without a bound into durable manifest metadata. - Readmitting a material returned the caller's arguments rather than the stored row. - An idempotent retry matched its own row and was rewritten as `duplicate`. - A malformed URL raised out of the API before any durable claim was recorded. - A material linked twice to one evidence ref was listed twice. - A chunked response carrying a stale `Content-Length` was stored as `partial`. - A redirected HTTP failure did not record which hop failed. - A relative file path raised in `Path.as_uri`. - **Raw frontier** (`storage/raw_retention.py`) - The integrity projection and the selected-frontier admission helpers opened `source.db` with `validate_schema=False`. A source tier at an unadmitted schema version could then report healthy frontier evidence. - A pinned operation read with no ops handle fell back to opening the live `ops.db` path. - **Index tier and reads** - Trigger-maintained action pairs copied the stale outcome cached on the tool_use block. Pair outcomes now come from the paired result block. - A work-event payload could override the validated `event_id`/`summary`. - Reviving or re-deleting a displaced saved view cleared another view's watch. - A NaN or infinite metadata value was accepted on first write, after which the key could not be changed. - An empty aggregate page reported `total_groups=0`. - Session timestamps dropped their milliseconds. - The observed-tool rollup and the observed-event relation, including its status pushdown, reinterpreted a retained exit code 0 as success even when the canonical outcome was a deliberate `unknown`. - Changing an attachment ref's target or position did not invalidate the profile binding. - `list_embedding_catchup_runs` rejected the `completed_with_failures` status that its writer accepts. - **Bootstrap** (`archive_tiers/bootstrap.py`) - The OPS same-digest shortcut returned without enabling foreign keys. - A failure after `.bootstrap` was published, but before the format marker, left an archive that could not be recovered. ## Solution Most fixes are the worker's patch, with these changes: - **101-02:** JSON documents are validated as a stream with `ijson.basic_parse`, so a large material is never loaded as Python objects. NDJSON is parsed line by line. - **101-04:** readmission returns the persisted row and does not overwrite stored filename, media type, privacy or supersession metadata. The worker's version replaced them with the new call's arguments, including `None`. - **101-05:** the extra "never mark malformed as duplicate" condition is dropped. Only the self-match is fixed. - **101-21:** the siblings are fixed too: `raw_frontier_blocked_raw_ids`, `_raw_frontier_blocked_selected_paths` and `raw_frontier_blocked_source_paths` open `source.db` with schema admission and report `SchemaSkew` as unavailable. - **101-23:** the ops-unavailable branch is typed and explicit. - **103-15:** the finding's cited route (evidence summary) already reads `result_state` on master. The same defect is fixed in the two remaining readers: the rollup and `run_projection_relations` (projection and pushdown). - **103-09 dropped:** see the table. ## Verification - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w6 -- <28 files>` (job 2539): 631 passed, 12 failed, 1 error. The same 9 failures and 1 error occur on base (job 2601: `test_user_state_contracts` FacadeDaemonRequiredError x7, `test_session_partition_convergence` x2, `test_frontier_admission::test_changed_keys_beyond_one_batch_are_all_checked` timeout). The other 3 were test defects in the new file (DSL `AND`, source-tier raw lookup), fixed and rerun in job 2603: 43 passed, 1 failed (the same base timeout). - Revert proof: the production files restored from origin/master, with the new tests kept (job 2540): 35 failed. Every new test fails, each on the defect it names (for example `ValueError: relative paths can't be expressed as file URIs`, `DID NOT RAISE`, `KeyError: 'uncompressed_bytes'`, and assertion failures). - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w6` (job 2639): `verify: PASSED exit=0` at 2fcacb6 (the first run, job 2559, failed on a moved sqlite-degradation anchor; the anchor was updated in the baseline). ## Self-review **Sibling sites.** Each defect class was searched across the codebase. - Unchecked durable-tier opens: three sibling source opens in `raw_retention.py` were fixed. The two `ops.db` opens keep `validate_schema=False`, because OPS is a disposable tier whose identity converges in place. - Exit-code success reinterpretation: the rollup and both observed-event sites were fixed. `archive.py` still has error-count columns that count error signals; they make no success claim, so they were left unchanged. `archive/actions/parsing.py` and `rendering/semantic_cards.py` are presentation-layer and out of scope. - The watch-clearing fix covers both `save_view` and `delete_view`. **Cancellation and shutdown.** No loops or long-running work were added. **Unbounded reads.** JSON validation now streams rather than materializing a whole document. The ZIP manifest no longer copies names. `admit_material_file` still reads the whole file (103-13, not reached). **Fail-open fallbacks.** Removed rather than added: the pinned read no longer falls back to the live ops path. Schema skew now blocks admission instead of passing silently. **Compatibility shims.** None added. **Removed symbols.** The unused `require_operation_lifecycle_status` import is gone. No monkeypatch targets or fakes reference anything removed. **Tests prove the production route.** Every test goes through `admit_material`/`acquire_material`, `ArchiveStore`, `initialize_active_archive_root`, the trigger DDL, or the query route (`query_unit_counts`). The revert run shows they fail on master's code. ## Per-finding table | key | disposition | evidence | test | |---|---|---|---| | 101-01 #5249 `polylogue/storage/index_generation.py:1599` | fixed-already | `polylogue/daemon/cli.py:3376`: Shutdown discard is submitted through write_coordinator.run_sync before coordinator drain. | — | | 101-02 #4241 `polylogue/storage/materials.py:73` | fixed | Validates the whole document as a stream (ijson) and NDJSON record by record; trailing garbage stays malformed. | test_material_json_admission_validates_the_complete_document, test_material_ndjson_admission_parses_each_record. | | 101-03 #4241 `polylogue/storage/materials.py:80` | fixed | Manifest keeps entry_count and uncompressed_bytes only; names stay in the retained CAS bytes. | test_material_zip_manifest_does_not_copy_entry_names. | | 101-04 #4241 `polylogue/storage/materials.py:139` | fixed | admit_material returns the persisted row (get_material) instead of its arguments; stored filename/media/privacy/creation time are not overwritten on readmission. | test_material_readmission_returns_the_persisted_row. | | 101-05 #4320 `polylogue/storage/materials.py:150` | fixed | Duplicate detection excludes the admitted material_id. | test_material_readmission_does_not_duplicate_itself (a distinct observation of the same bytes is still 'duplicate'). | | 101-06 #4320 `polylogue/storage/materials.py:236` | fixed-already | `polylogue/storage/materials.py:662-674; polylogue/storage/materials.py:715-720`: List extracts IDs from tuple rows or sqlite3.Row; get_material maps cursor.description for tuples. | — | | 101-07 #4623 `polylogue/storage/materials.py:240` | fixed | URL parsing and InvalidURL/ValueError from connection construction become a durable non-retryable 'malformed' claim. | test_material_invalid_url_is_a_durable_malformed_claim, test_material_invalid_http_target_is_a_durable_claim. | | 101-08 #4241 `polylogue/storage/materials.py:240` | fixed | Evidence filter uses EXISTS, one row per material. | test_material_evidence_listing_returns_one_observation_per_identity. | | 101-09 #5408 `polylogue/storage/materials.py:262` | fixed | Content-Length is ignored when Transfer-Encoding frames the response. | test_material_chunked_response_ignores_stale_content_length. | | 101-10 #4623 `polylogue/storage/materials.py:315` | fixed | HTTP failure diagnostic carries the failing hop URL when it differs from source_uri. | test_material_http_error_retains_redirect_destination. | | 101-11 #4623 `polylogue/storage/materials.py:345` | fixed | admit_material_file uses Path.absolute() before as_uri(). | test_material_relative_file_admission_retains_success_or_absence. | | 101-12 #4623 `polylogue/storage/materials.py:345` | fixed | Same fix as the sibling comment on this line (Path.absolute()). | test_material_relative_file_admission_retains_success_or_absence. | | 101-13 #4623 `polylogue/storage/materials.py:347` | not reached | `polylogue/storage/materials.py:591-594`: Local material admission reads the entire file into memory. | — | | 101-14 #5626 `polylogue/storage/materials.py:741` | not reached | `polylogue/storage/materials.py:739-752`: Timestamp/hash keyset cursor can miss subsequent inserts sorting before the cursor at the same timestamp. | — | | 101-15 #4039 `polylogue/storage/raw_authority_verdict_projection.py:103` | not reached | `polylogue/storage/raw_authority_verdict_projection.py:86-148`: Projection promotes every byte-proven append leaf independently of accepted-chain ambiguity. | — | | 101-16 #4556 `polylogue/storage/raw_failure_lifecycle.py:111` | fixed-already | `polylogue/storage/raw_failure_lifecycle.py:124-139`: Ordinary source open performs admission and reports SchemaSkewError as unavailable. | — | | 101-17 #5301 `polylogue/storage/raw_reconciler.py:213` | not reached | `polylogue/storage/raw_reconciler.py:108-127`: Renamed pass_id payload still advertises the previous census.v1 schema. | — | | 101-18 #5350 `polylogue/storage/raw_reconciler.py:324` | refuted | `polylogue/storage/raw_reconciler.py:314-381`: Explicitly requires an archive predating the raw-ID change; current assignment is fresh v1 with no carry-forward of that state. | — | | 101-19 #5350 `polylogue/storage/raw_reconciler.py:549` | refuted | `polylogue/storage/raw_reconciler.py:564-615`: Requests migration of durable candidate assertions from a deleted framework; outside the fresh-v1/no-carry-forward contract. | — | | 101-20 #5301 `polylogue/storage/raw_reconciler.py:1049` | not reached | `polylogue/storage/raw_reconciler.py:394-473`: Blocker ID selection only searches its proposed ID; a unique open plan conflict can suppress the insert while returning a nonexistent ID. | — | | 101-21 #4556 `polylogue/storage/raw_retention.py:1231` | fixed | Frontier projection opens source.db with schema admission and reports SchemaSkew as unavailable; the selected-frontier admission helpers (raw_frontier_blocked_raw_ids, _raw_frontier_blocked_selected_paths, raw_frontier_blocked_source_paths) do the same. | test_frontier_projection_refuses_a_source_from_a_newer_schema. | | 101-22 #4683 `polylogue/storage/raw_retention.py:1302` | not reached | `polylogue/storage/raw_retention.py:1387-1420`: Admission attributes a sampled million-row projection without refusing truncated populations. | — | | 101-23 #5020 `polylogue/storage/raw_retention.py:1688` | fixed | With ops_conn=None the pinned snapshot reports cursor status 'unknown' and never opens ops_db_path. | test_pinned_frontier_does_not_substitute_a_live_ops_file_for_missing_reader. | | 101-24 #5371 `polylogue/storage/raw_retention.py:2350` | not reached | `polylogue/storage/raw_retention.py:2478-2491`: Residual test uses post-filter candidate count, which cannot prove the SQL selection was exhausted. | — | | 101-25 #4538 `polylogue/storage/search_providers/sqlite_vec_runtime.py:98` | fixed-already | `polylogue/storage/search_providers/sqlite_vec_runtime.py:239-249`: Managed provider rejects missing active index before attempting attachment; pinned snapshot uses read-only attachment at 120-133. | — | | 102-01 #4538 `polylogue/storage/search_providers/sqlite_vec_runtime.py:115` | not reached | `polylogue/storage/search_providers/sqlite_vec_runtime.py:34-108;251-256`: Managed connections rebuild and hash the complete eligible-message TEMP projection on each acquisition. | — | | 102-02 #5274 `polylogue/storage/source_generation_receipts.py:252` | not reached | `polylogue/operations/daemon_ingest.py:881-999`: Historical receipt serializes raw identities/completeness but not source-item blockers and member dispositions. | — | | 102-03 #4719 `polylogue/storage/sqlite/action_pairs.py:44` | fixed | Action pairs take the outcome from the paired result block, 'no_result' when absent, matching _reconcile_tool_use_outcomes. | test_action_pairs_follow_paired_result_updates_and_deletes. | | 102-04 #5275 `polylogue/storage/sqlite/archive_tiers/__init__.py:43` | fixed-already | `polylogue/storage/sqlite/archive_tiers/__init__.py:21-26;42-49`: Exported durable tier constants and ARCHIVE_VERSION_BY_TIER all use version one. | — | | 102-05 #4201 `polylogue/storage/sqlite/archive_tiers/archive.py:416` | fixed-already | `polylogue/mcp/archive_support.py:165-179; polylogue/surfaces/payloads.py:1311-1315`: MCP delegates to canonical hydration and the shared summary envelope explicitly supplies terminal_state, total_cost_usd, cost_provenance and relative_time. | — | | 102-06 #4353 `polylogue/storage/sqlite/archive_tiers/archive.py:1085` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:1622-1629`: Work-event append reverses public Origin into guessed Provider. | — | | 102-07 #4353 `polylogue/storage/sqlite/archive_tiers/archive.py:1086` | fixed | Validated event_id and summary are merged after the caller payload. | test_work_event_payload_cannot_override_validated_identity. | | 102-08 #4816 `polylogue/storage/sqlite/archive_tiers/archive.py:2459` | stale | `polylogue/storage/sqlite/archive_tiers/archive.py:4492-4513`: Named list_session_work_event_insights LIKE implementation is gone; current insight dispatch is elsewhere. No claim of testing successor search. | — | | 102-09 #4225 `polylogue/storage/sqlite/archive_tiers/archive.py:2542` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:3168; polylogue/storage/sqlite/archive_tiers/archive.py:3952`: Full catalog coverage sets cost_is_estimated=0, confusing completeness with monetary authority. | — | | 102-10 #4293 `polylogue/storage/sqlite/archive_tiers/archive.py:2681` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:3351-3360;3400-3419`: Outer cohort dedup count is reused for raw-model breakdown and status classification. | — | | 102-11 #4395 `polylogue/storage/sqlite/archive_tiers/archive.py:2957` | fixed-already | `polylogue/storage/sqlite/archive_tiers/archive.py:3280;3311;3351`: Session populations use json_group_array and lossless _decode_session_id_set instead of comma splitting. | — | | 102-12 #4692 `polylogue/storage/sqlite/archive_tiers/archive.py:3380` | fixed-already | `polylogue/storage/sqlite/archive_tiers/archive.py:3971;8398`: Profile SELECT and domain mapper both carry input_content_hash. | — | | 102-13 #5408 `polylogue/storage/sqlite/archive_tiers/archive.py:5215` | fixed | save_view clears the previous name's watch only when this view still owns that name. | test_resurrected_view_rename_does_not_clear_another_views_watch. | | 102-14 #5408 `polylogue/storage/sqlite/archive_tiers/archive.py:5284` | fixed | delete_view clears the watch only on a successful delete of the name's active owner. | test_redeleting_view_does_not_clear_reassigned_name_watch. | | 102-15 #5307 `polylogue/storage/sqlite/archive_tiers/archive.py:6193` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:6222-6229`: Provider usage readiness takes archive-global status counters, not the requested origin/time scope. | — | | 102-16 #5307 `polylogue/storage/sqlite/archive_tiers/archive.py:6195` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:6222-6229`: Provider usage readiness hardcodes stale count zero and only compares row coverage. | — | | 102-17 #4238 `polylogue/storage/sqlite/archive_tiers/archive.py:6730` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:7688-7699`: Display duration subtracts normalized session endpoints, including synthesized endpoints. | — | | 102-18 #4649 `polylogue/storage/sqlite/archive_tiers/archive.py:7271` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:8140-8146`: Missing persisted provenance is labeled with current materializer version. | — | | 102-19 #5362 `polylogue/storage/sqlite/archive_tiers/archive.py:7408` | not reached | `polylogue/storage/sqlite/archive_tiers/archive.py:7672-7679`: All heuristic titles are suppressed, not only prompt echoes. | — | | 102-20 #4221 `polylogue/storage/sqlite/archive_tiers/archive.py:7539` | stale | `polylogue/storage/sqlite/archive_tiers/archive.py:8454-8504`: Former profile-cost fallback was removed; current cost insight uses canonical usage authority and reports no_tokens explicitly rather than labeling fallback as catalog-priced. | — | | 102-21 #4804 `polylogue/storage/sqlite/archive_tiers/archive.py:7839` | fixed | set_user_metadata canonicalizes every value before the first write, so NaN/inf are refused inside the transaction. | test_metadata_first_write_refuses_nonfinite_json_atomically. | | 102-22 #5275 `polylogue/storage/sqlite/archive_tiers/archive_plan.py:189` | fixed-already | `polylogue/storage/sqlite/archive_tiers/archive_plan.py:181-213`: Schema fingerprint and version readers now use canonical open_readonly_connection URI construction. | — | | 102-23 #5275 `polylogue/storage/sqlite/archive_tiers/archive_plan.py:261` | stale | `polylogue/storage/sqlite/archive_tiers/archive_plan.py:181-223;bootstrap.py:877-924`: initialize_archive_tier_files_from_plan is deleted; ordinary fresh root bootstrap now records and admits pending intent. | — | | 102-24 #5356 `polylogue/storage/sqlite/archive_tiers/archive_query_reads.py:3424` | fixed | The aggregate page selects a count row over all groups joined to the requested page, so an empty page keeps total_groups. | test_empty_aggregate_page_preserves_total_group_count. | | 102-25 #5514 `polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:48` | fixed-already | `polylogue/storage/sqlite/archive_tiers/vocabulary_inventory.py:138-153`: core_types is scanned before consumer re-exports, retaining declaration ownership. | — | | 103-01 #5521 `polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:49` | not reached | `docs/atlas/00-core.md:59-67;docs/atlas/storage.md:35-40`: Identity anchors no longer point at their generated-key declarations. | — | | 103-02 #4678 `polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:729` | fixed | Session created_at/updated_at project strftime('%Y-%m-%dT%H:%M:%fZ', ms/1000.0). | test_session_record_reads_preserve_milliseconds. | | 103-03 #4177 `polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:885` | not reached | `polylogue/maintenance/archive_verification.py:1443-1467`: Lineage sanity checks message existence but not branch-point content address agreement. | — | | 103-04 #5476 `polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py:1217` | not reached | `docs/atlas/storage.md:79-87`: Session-link/branch-point explanation anchors shifted away from their declarations. | — | | 103-05 #4302 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:249` | not reached | `polylogue/storage/sqlite/archive_tiers/bootstrap.py:435-451;501-561`: OPS sentinel fast path neither recreates nor refuses missing canonical objects. | — | | 103-06 #4302 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:249` | fixed | _materialize_archive_tier enables foreign keys before the OPS same-digest shortcut. | test_cached_ops_initialization_enables_connection_foreign_keys. | | 103-07 #4560 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:254` | fixed-already | `polylogue/storage/sqlite/archive_tiers/bootstrap.py:407-417`: Derived identity stamp is followed by conn.commit(). | — | | 103-08 #4560 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:845` | fixed-already | `polylogue/storage/sqlite/archive_tiers/bootstrap.py:1159-1178`: Stored user_version is admitted before materialization; skew raises SchemaSkew. | — | | 103-09 #4560 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:846` | dropped (not a defect) | ops.db identity converges in place by documented policy (`initialize_archive_database`); worker's refusal reverted | — | | 103-10 #5275 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:848` | fixed-already | `polylogue/storage/sqlite/archive_tiers/bootstrap.py:877-905`: Pending fresh bootstrap intent is validated and exempts incomplete first creation from completed-marker admission. | — | | 103-11 #5275 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:883` | fixed-already | `polylogue/storage/sqlite/archive_tiers/bootstrap.py:888-920`: Marker admission and fresh-bootstrap classification are keyed to durable tier files, not replaceable-only tiers. | — | | 103-12 #5275 `polylogue/storage/sqlite/archive_tiers/bootstrap.py:959` | fixed | Fresh bootstrap publishes (or validates an already published) format marker before the completed bootstrap marker, so the pending intent survives until both exist. | test_fresh_bootstrap_format_publication_failure_is_resumable. | | 103-13 #4323 `polylogue/storage/sqlite/archive_tiers/embeddings.py:20` | refuted | `polylogue/storage/sqlite/archive_tiers/embeddings.py:7;26-31`: Finding requires opening the pre-v1 version-five vector table; this assignment starts fresh with embeddings version one and canonical model column, no prior archives. | — | | 103-14 #4719 `polylogue/storage/sqlite/archive_tiers/index.py:868` | not reached | `polylogue/storage/sqlite/archive_tiers/archive_query_reads.py:121-143;1066-1088`: Public action row and selected column list omit canonical unknown-outcome reason. | — | | 103-15 #4719 `polylogue/storage/sqlite/archive_tiers/index.py:877` | fixed | The cited evidence-summary route already reads result_state on master (operations/http_read_models.py read_session_evidence). The same exit-code reinterpretation remained in list_tool_observed_event_count_rows and the observed-event relation and its status pushdown (run_projection_relations.py); all three now map only the canonical tool_outcome. | test_observed_tool_rollup_respects_canonical_outcome_over_exit_code. | | 103-16 #4630 `polylogue/storage/sqlite/archive_tiers/index.py:1090` | not reached | `polylogue/storage/sqlite/archive_tiers/index.py:1319-1320`: Thread search projection only includes thread ID, repo and session IDs; evidence-kind/support terms are absent. | — | | 103-17 #5312 `polylogue/storage/sqlite/archive_tiers/index.py:1257` | fixed-already | `tests/infra/reindex_differential.py:95-98`: session_usage_rollup_bindings now has an explicit exact deterministic census classification. | — | | 103-18 #5410 `polylogue/storage/sqlite/archive_tiers/index.py:1499` | fixed | session_profile_binding_refs_au now fires on attachment_id and position updates. | test_attachment_reference_identity_and_order_invalidate_profile_binding. | | 103-19 #4630 `polylogue/storage/sqlite/archive_tiers/index.py:1786` | not reached | `polylogue/storage/sqlite/archive_tiers/index.py:2150-2158`: Child monetary amount may use provider evidence while its estimated flag is derived from catalog coverage. | — | | 103-20 #4630 `polylogue/storage/sqlite/archive_tiers/index.py:1919` | not reached | `polylogue/storage/sqlite/archive_tiers/index.py:2289`: Tag-rollup materialized_at is literal query-time rather than an ISO timestamp or missing value. | — | | 103-21 #5373 `polylogue/storage/sqlite/archive_tiers/ops.py:209` | refuted | `polylogue/storage/sqlite/archive_tiers/ops.py:1-220;bootstrap.py:888-909`: Finding asks to carry and drop objects in archives from the prior OPS schema. Fresh-v1/no-prior-state assignment excludes that upgrade. | — | | 103-22 #5521 `polylogue/storage/sqlite/archive_tiers/ops_write.py:1237` | fixed | list_embedding_catchup_runs validates the filter with OperationRunStatus, the writer's vocabulary. | test_embedding_catchup_filter_accepts_completed_with_failures. | | 103-23 #4324 `polylogue/storage/sqlite/archive_tiers/read_insights.py:28` | fixed-already | `polylogue/storage/sqlite/archive_tiers/read_insights.py:27-36`: Date-window parser delegates to shared parse_query_date. | — | | 103-24 #4354 `polylogue/storage/sqlite/archive_tiers/read_insights.py:82` | not reached | `polylogue/storage/sqlite/archive_tiers/read_insights.py:123-145`: Episode context scans only physical session messages and misses composed inherited prefix. | — | | 103-25 #4354 `polylogue/storage/sqlite/archive_tiers/read_insights.py:83` | fixed-already | `polylogue/storage/sqlite/archive_tiers/read_insights.py:115-136`: LIMIT 3 is inside the row-producing subqueries consumed by GROUP_CONCAT. | — | ## Derived-identity closure All ten changed production files are members of the checked-in `docs/plans/schema-closure-baseline.json`: `storage/materials.py`, `storage/raw_retention.py`, `storage/sqlite/action_pairs.py`, `storage/sqlite/run_projection_relations.py`, and in `storage/sqlite/archive_tiers/`: `archive.py`, `archive_query_reads.py`, `archive_tiers_specs.py`, `bootstrap.py`, `index.py`, `ops_write.py`. The index trigger DDL, the session timestamp projection and the action-pair lowering all change, so the derived identity moves. This must land before the fresh rebuild. `devtools schema closure` could not run in this checkout because its environment is not provisioned, so membership was read from the committed baseline. ## Residuals - 26 findings are not reached, and they stay open in their beads. Among them are 101-13 (local file admission reads the whole file into memory) and 101-14 (keyset cursor). - Session `created_at`/`updated_at` strings change format from `YYYY-MM-DD HH:MM:SS` to ISO-8601 `...T...sssZ`. No reader in this repository parses the old format; `annotations/join.py` slices the first 10 characters, which is unaffected. 🤖 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. |
|
Closing out open Codex review threads on this PR (evidence checked against master at f88b4a6):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
Closing out open Codex review threads on this PR (evidence checked against master at c950478):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
Closing out open Codex review threads on this PR (evidence checked against master at 8e6234c):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
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
Implements polylogue-x7d: one shared bounded/informative session-row projection across CLI query, archive query, and select — structural outcome (from the canonical derived SessionProfile, not Session), cost via SessionSummary.total_cost_usd with cost_provenance, relative time, repo/CWD basenames, message counts; unknown/null semantics preserved when evidence is absent.
Verification
64 focused tests + mypy clean + quick gate green (fix lane resolved two interface mismatches: invalid reported_cost_usd field, terminal_state read from the wrong model).
🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA