Repository navigation
fix: Converge Claude and Gemini tool outputs from retained sidecars - #4850
Conversation
Claude Code and Gemini CLI overflow a large tool result to a sibling file and leave only a preview in the transcript. Both joins enumerated that sibling directory on the original filesystem while deriving, so the same retained transcript produced the full output or only its preview depending on whether the original tree still existed (retained-inputs decision D3, scenarios S8/S9). Both joins now read a RetainedSidecarScope instead of a path. Acquisition resolves that scope from the source tree (FilesystemSidecarResolver); every derivation route that carries an archive root resolves it from source.db plus the blob store (RetainedSidecarResolver), so a reparse reproduces the same full text, outcome and ownership after the tree is gone. The gemini-cli OriginSpec now declares its tool-outputs/ family as a tool_result_sidecar artifact, which is what makes those bytes retained evidence at all. A preview naming a persisted output the scope does not hold records an explicit expected_sidecar_not_retained outcome instead of staying silently truncated. Derived-schema classification: semantic-reparse. Every changed module is inside the derived schema closure (devtools schema closure), so the identity moves and the archive reconverges. Co-Authored-By: Claude Opus 5 <[email protected]>
The new resolver opened source.db with its own sqlite3.connect and three `except sqlite3.Error` handlers, each deciding at its own call site that an unavailable store looks like a scope holding no retained sidecars. That is the improvised degradation `devtools gate layering` ratchets down, and it failed the candidate quick gate (sqlite_degradation_sites_grew: observed 3, baseline 0). Acquire the tier through open_tier_reader(ArchiveTier.SOURCE, ...) instead, which classifies absence, schema skew and an unopenable file once against the tier probe. A TierRefusal yields an unresolved scope with the reason named; a query that fails after the seam admitted the tier now propagates, because reporting a corrupt store as zero retained sidecars is exactly the silent truncation this bead removes. The baseline is unchanged. Verification: devtools gate layering -> "violations":[],"count":0 (exit 0). Co-Authored-By: Claude Opus 5 <[email protected]>
…l' into batch/polylogue-20260911-012434-0dfd7d27/integration
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. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa0b47e02f
ℹ️ 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".
…#5682) ## Summary Second intake pass (stacked on #5643). - Every ChatGPT mapping node now goes through the scratch carrier. That includes tool chains, multimodal parts, reasoning timings, code-interpreter runs and authorship evidence, not only text nodes. - A decoded value too large for one SQLite cell is refused as a counted conservation gap, never truncated. - Live, retained-replay and cold-build publication of one raw now produce identical rows. - Remaining SQLite connections are closed, and intake readers are migrated onto the profiled factories. - Seven old, unanswered Codex P1 findings from earlier PRs are fixed here or dismissed with evidence. ## Problem - **ChatGPT collecting fallback:** any node outside a narrow text-only shape sent the whole mapping back through the collecting parser. Normalized messages, attachments and events then grew with the conversation. - **Oversized values:** nothing bounded a single giant scalar, and the ChatGPT parser capped sandbox-link attachments at 512 per message, dropping the rest. - **Route characterization:** the route test pinned a "delta" that was an artefact of acquiring the retained raw without the revision identity live intake assigns. - **Connection leaks:** spool connections used `with sqlite3.connect(...)`, which commits but never closes. - **Stale test fixtures:** three tests failed on master against stale fixtures: - one patched a helper that no longer exists; - one used a fake with an out-of-date signature; - one expected pre-fresh-v1 migration behaviour. ## Solution - **One ChatGPT normalization, two stores.** `chatgpt.parse(..., spill=)` collects messages into a `MessageEntries` store. It is a list for the collecting parser and scratch for preparation. Ordering, parent resolution, the active leaf and generation-timing ownership are written once and read through the store. Declared sibling order is answered from the spilled `children` rows. The old text-only fast path is deleted. - **Physical value limit.** `polylogue.sources.value_bounds` reads `SQLITE_LIMIT_LENGTH` from the linked SQLite. - The ijson member normalizer, bundle records and ChatGPT keys refuse any value whose UTF-8 encoding exceeds it, with `ValueBoundRefusedError`. - Source conservation types that refusal as `value_bound_refused`, a counted warning. - The sandbox attachment cap and the Gemini sidecar size caps are removed; attachments spill to scratch instead. - **Route equality.** The characterization test acquires the retained raw under live's revision identity and asserts identical source and index rows across all three routes. - **Connections.** A `spool_connection` context closes spool databases. The live batch, watcher, batch observability and raw-retention readers use `open_readonly_connection`, and sibling tiers use `attach_readonly_database`. - **Old P1 findings:** - #5610: a browser-capture envelope that also carries a mapping keeps the capture route. - #4720: a Gemini sidecar that is still being written, or is shorter than the inline envelope, becomes debt and does not replace the envelope. Claude Code also leaves the path-independent parse cache, for the same sidecar reason as Gemini CLI. - #4850: the sibling tool-id index composes the full revision plus its appended tails. - #5603: interrupted attempts stay `running` until the rewind read has succeeded. - #5630: a resumed completed ingest decodes the nested `historical_receipt`. - #5250 and #5630 (abandoned manifests): already fixed on master. Evidence is in the review thread replies. - #5557: deferred to the location-binding change in daemon config. ## Verification - `devtools test` over 14 files (prepared JSONL, the ChatGPT parser, source conservation, route characterization, live watcher/append/batch, raw retention, daemon ingest idempotency, Gemini sidecars, cursor recovery, machine receipts, reviewed defects, route interpretation): 741 passed, 1 failed. The one failure is the Gemini oversize-sidecar expectation that changed with the cap removal. It is fixed and its rerun is below. - `devtools gate mypy`, `layering`, `patterns` and `schema-closure` pass locally; the cursor-recovery test file was rerun on the final head. - Hosted quick gate on this head. ## Schema closure This moves the derived schema identity, so it must land before the rebuild. `decoder_json.py`, `prepared_jsonl.py`, `prepared_message_sink.py`, the live batch/watcher/observability modules and `raw_retention.py` are in the closure. The baseline grows by one module, `polylogue/sources/value_bounds.py`, because the decoder now imports the storable-value limit from it. ## Residuals - behu4 shapes that still load whole objects, all code-ready with no decision pending: - Claude AI `chat_messages` (the evidence graph in `normalize_chat_messages`); - Drive and chunked prompts; - Hermes ATIF and OTel; - the Grok fallback. - The Claude Code tool-result sidecar join keeps its 64 MiB-per-file and 256 MiB-aggregate caps. - Storing values above SQLite's cell limit is an undecided future question, not committed work. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…#5798) ## Summary Lands the verified part of the ChatGPT fleet worker-10 output for the Codex P2 review debt in `polylogue-1tyq5.93`, `.94` and `.95` (polylogue/sources parts 4-6, 75 findings). The worker could not run anything; every kept fix here was re-read against the landing head, and every kept fix has a regression test that fails on the base. Per finding: 32 fixed, 9 fixed-already, 1 refuted, 1 dropped as not a defect, 32 not reached. Of the worker's 35 `fixed` claims, 32 land (two of them reworked and one narrowed); 2 are rejected, and 94-18 was withdrawn when this branch merged master (see below). Of its 10 `fixed-already` claims, 1 is rejected as still real. ## Problem The findings are Codex review comments on merged PRs. Each one names an input and a wrong outcome in parser, admission, discovery or derived-identity code. Examples: an Antigravity step with `occurred_at_ms` lost its time; a list-valued ChatGPT `aggregate_result` for a failed run was archived as a success; a directory symlink to an ancestor made `census_source()` loop forever; a Codex `usage` counter of `null` was stored as a measured zero; a source edited between signing and parsing could leave a fingerprint memo describing different code. The table below cites each finding and its evidence. ## Solution - **Antigravity trajectories.** `occurred_at_ms` is read as epoch milliseconds. Tool outcomes read the row's `exit_code`, treat a non-empty string, mapping or list `error` as a failure, and report `not_reported` when no outcome field is present (the origin spec declares that reason). camelCase edit fields are read. Unwrapping `payload` keeps the envelope's role and time. A step that fails typed validation becomes a MALFORMED refusal for that step only. Parent references resolve through the trajectory/cascade alias map before the ambiguity check. - **ChatGPT.** A list-valued `aggregate_result` decides the outcome (any failure fails, all success succeeds, otherwise unknown), and each run emits its own event with `output` and `exit_code`. Citation URLs of the `/g/g-p-…/c/<id>` form keep the conversation id. A non-string `content_type` is typed unknown at the message, media-part and part-accounting sites. A transcription that carries text is not marked `unavailable`. - **Browser capture and Claude web.** Typed `extracted_content` wins over `provider_meta`. A `claude-file:<uuid>` projection reconciles with the native row of that uuid without a byte witness. A cached cross-route match is re-validated before reuse. A conversation-level Claude attachment whose bytes conflict with its descriptor match stays a separate file. - **Counters and references.** Claude Code and Codex usage counters stay unknown unless they are non-negative integers. Codex `local_images` references go through the data-URL sanitizer. Codex state chunk coordinates drop the physical rowid. - **Admission.** `ParseAccounting.assert_conserved` refuses ordinals outside `[0, expected)`. A `tool_use` part with no name, id or input is refused as MALFORMED. Material origin is classified from the same TEXT projection as message type. - **Discovery, walk and identity.** Live discovery sorts entries before a linked directory claims its target. The source walk still follows directory links, but a link to a directory already entered is recorded as a non-regular entry and not entered. `_fingerprint_sources_compute` refuses (`FingerprintSourceChangedError`) when the bytes differ from their signature. Python call operands are no longer SQL-normalized (fingerprint algorithm 4 -> 5). `in_derived_identity_closure` and `devtools schema closure` resolve paths from the caller's directory and refuse missing ones. The Hermes streaming envelope keeps a container-valued marker. Observation contracts are emitted for every provider wire. The synthetic Codex oracle classifies through `classify_message_type`. Rejected worker changes: - 93-01: the empty-retained-scope change is not landed. It would make every Claude Code transcript build a disk-backed tool-result index and read its sibling subagent blobs, and it would still disagree with the acquisition-time resolver. The finding stays open. - 94-16: nested future-type detection was not removed, because it is the tested admission contract. - 93-25 is reworked: the worker's version stopped following directory links. - 94-18 is withdrawn. Master's `AdmissionObserver` (#5711, merged after this branch was cut) deliberately keeps one pending unknown-input event per wire type so memory stays bounded, and `test_admission_payload.py::test_repeated_unknown_records_keep_one_pending_event_per_type` holds that contract. A per-occurrence event list contradicts it, so the merge takes master's observer and drops this branch's version and its test. The finding stays open for a bounded fix. - 95-05 is completed: the worker's version left the accounting set lookup that the finding names unguarded. - 95-09 is narrowed: requiring equal bytes or a shared URL would drop the bytes of the documented metadata-only repeat. ## Merge with master (head `6fc0e31bf8`) Merge commit `6fc0e31bf8` brings in master `1beb2e516a` (including #5711, #5723, #5787 and #5804). No force-push. Conflicts were resolved by intent: - `base_support.py`: master's `AdmissionObserver` is kept as is. The branch's per-occurrence unknown-input events (94-18) are dropped with their test and fixture. See the 94-18 row. - `browser_capture.py`: `_claude_attachment_cross_route_match` compares inline bytes first, then master's content hashes, and only then takes the exact `claude-file:<uuid>` identity (94-24) when neither side has a byte witness. Conflicting hashes still refuse the match. - `antigravity.py`: both the alias-claimant map (94-13) and master's summary-key reservation are kept. They touch disjoint names. The other 32 kept fixes were re-read against master: each hunk is still absent there, and every helper they call (`_iter_mapping_items`, `iso_from_epoch_ms`, `unknown_reason`) exists on master. No kept fix became redundant. ## Verification Every check ran as an agentctl job. After the merge (head `6fc0e31bf8`): - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w10 --wait` (job 2471): `phase: succeeded`, `result: Success`. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w10 --wait -- <the same 28 modules>` (job 2470): 943 passed, 12 failed. Ten of them are the inherited failures listed below. The other two are also inherited: job 2543 ran them on a master checkout, and both failed there too. They are `test_antigravity_conversation_acquisition.py::test_common_live_batch_retries_a_failed_vendor_conversion` and `test_artifact_taxonomy.py::test_antigravity_brain_metadata_sidecar_is_rejected_from_live_and_schema_routes`. Before the merge: - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w10 --wait` (job 2228, head `d768577f0b`): `verify: PASSED exit=0`. All static gates are ok, including mypy, lint, layering, schema-closure and schema-manifest. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w10 --wait -- <28 test modules>` (job 2168, head `e8191c523f`, the parent of the rename-only follow-up commit): 908 passed, 10 failed. All 10 failures are inherited. Jobs 2166 and 2229 ran them on the base `915a1f357d` (this branch with every production file reset to the base), and all 10 failed there with the same errors (pre-merge, head `e8191c523f`): - `test_schema_closure.py::…::test_the_checked_in_baseline_matches_the_live_closure`: the baseline lists `polylogue/operations/durable_change_train.py`, which the live closure no longer contains. - `test_discovery_progress.py::test_cold_build_preparation_is_visible_before_the_first_intake_page`: `preparation_revision_count` is 0, expected 2. - `test_codex_state_bounds_and_excision.py::test_large_goal_export_last_row_is_reachable`: pytest-timeout (300s) inside `os.fsync` of the blob directory. - 7 tests in `test_browser_capture.py`: `IngestDaemonRequiredError`, because the API ingest route requires a running daemon. - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w10 --wait -- tests/unit/sources/test_antigravity_trajectory_steps.py tests/unit/sources/test_antigravity_source_acquisition.py` (job 2232, head `d768577f0b`): `devtools test: PASSED exit=0`, 22 passed. - Anti-vacuity: job 2097 ran the five new test modules on a checkout of this branch with every production file reset to the base: 82 of 93 failed. The 11 that passed are the positive controls and the parameters that already held on the base: real zero counters, `None` counters for Claude, `unknown_outcome`, the ambiguous-parent case, and the equal/absent byte relations. The 28 modules run in job 2168: `tests/unit/sources/`: test_antigravity_trajectory_steps, test_counter_and_coordinate_contracts, test_parser_admission_contracts, test_source_walk_and_fingerprint_contracts, test_web_parser_attachments_and_runs, test_admission_payload, test_admission, test_parser_admission_packet, test_antigravity_source_acquisition, test_browser_capture, test_parsers_chatgpt, test_claude_ai_conversation_level_attachments, test_codex_state_bounds_and_excision, test_origin_specs, test_prepared_claude_ai_object, test_prepared_drive_chunked_object, test_parsers_codex, test_nullable_message_usage, test_claude_code_unread_wire_fields, test_live_page_selection, test_source_root_admission, test_artifact_taxonomy, test_parsers_local_agent, test_agent_memory_documents; plus `tests/unit/devtools/test_schema_closure.py`, `tests/unit/core/test_synthetic_semantics.py`, `tests/unit/daemon/test_discovery_progress.py` and `tests/unit/daemon/test_antigravity_conversation_acquisition.py`. ## Self-review I read the full `git diff origin/master...HEAD` against the checklist in `docs/review/codex-review-guide.md`. 1. **Siblings and owners.** The same content_type guard now covers the message-level discriminator, the media-part branch and the part-accounting predicate. Live discovery and the source walk now pick a linked alias by the same name-order rule. Antigravity has one `_tool_outcome`, so the reason change has one site. Remaining divergence: the live walk refuses a link that escapes the root and the source walk follows it. That predates this change and is recorded under residuals. 2. **The fix itself.** `FingerprintSourceChangedError` is new and propagates uncaught. It fires only when a source changes between signing and parsing, and a refusal is safer than writing a wrong memo. The antigravity `ValidationError` catch wraps only the typed construction of one step. 3. **Memory and limits.** Discovery holds one directory's `DirEntry` list to sort it, which is no more than the children list it already builds. The walk's visited set is one entry per directory. No caps were added. 4. **Cost per unit.** Nothing new per row. The admission wrapper builds its per-type counter only when an unknown was observed. 5. **Interruption.** No new loops, waits or multi-step state. 6. **Ordering and races.** The fingerprint now hashes and parses the same bytes. That was the race the finding named. 7. **Failure classification.** A walk `stat` error keeps the directory in the descent, so `os.walk` reports it through `onerror` and it is not silently pruned. 8. **Silent outcomes.** A pruned directory link is still recorded as a non-regular census entry. A refused step or part carries a typed MALFORMED outcome and an event. 9. **Cleanup on failure.** Nothing is acquired before a refusal. 10. **Identity and keys.** Codex state chunk coordinates drop the physical rowid (see residuals for the durable effect). Attachment identity is unchanged. The fingerprint algorithm version moves because the normalization changed. 11. **Lossless transforms.** Unwrapping an Antigravity payload now keeps the envelope fields. Per-run ChatGPT events keep every field the single-run event kept. 12. **Degenerate inputs.** Covered: an empty list `aggregate_result` counts as absent; NaN, negative, bool and fractional counters are unknown; a missing closure path is refused; a missing walk base still walks nothing. 13. **Consumers.** `in_derived_identity_closure` has no production caller; the command and its tests follow it. `artifact_observation_contracts` has no consumer beyond its export. The existing packet test's expected message was updated for the earlier range check. 14. **Tests and stubs.** Every new test drives the production parser, walker, fingerprint or command, and job 2097 shows each one fails on the base. The worker's `ordered_scandir` helper returned a generator context manager that production cannot iterate; it now mimics `os.scandir`. The worker's large-file Hermes test called an API that no longer exists; it now drives `hermes_snapshot_envelope` against `looks_like_hermes`. 15. **Trust boundaries.** Data URLs in Codex references are now sanitized before they reach event payloads. No new secrets or files. 16. **Merge resolution.** The only new logic is the order in the cross-route match. Bytes and then hashes decide before the file-id shortcut, so a projection whose content contradicts the native row is never merged on identity alone. Dropping 94-18 removes a test, a fixture and the now-unused `parse_code` import. No other code referenced them. ## Per-finding dispositions Key `NN-MM` is bead `polylogue-1tyq5.NN`, finding MM. Tests are under `tests/unit/sources/`. "Not reached" rows keep the worker's triage evidence (in the handoff); they were not re-checked here. | key | disposition | evidence | test | |---|---|---|---| | 93-01 #4850 `sources/live/sidecar_resolution.py:141` | not reached (worker fix dropped) | Still real. The worker's fix (an available empty scope when the retained query returns no rows) was not landed: it gives every Claude Code transcript an available scope, so each streamed parse builds a disk-backed tool-result index and, for root transcripts, reads every sibling subagent blob, and it diverges from the acquisition-time resolver, which still reports a missing directory as unresolved. The fix needs both resolvers to agree and a cheap path when the transcript names no persisted output. Left open. | — | | 93-02 #4587 `sources/live/watcher.py:76` | not reached | worker triage; not re-checked | — | | 93-03 #4191 `sources/live/watcher.py:220` | not reached (worker 'fixed-already' rejected) | Still real at the landing head: `run_daemon_services` still runs `src.root.mkdir(parents=True, exist_ok=True)` for every configured source (`polylogue/daemon/cli.py:2395` on master `1beb2e516a`), and `default_watch_sources` includes the legacy-read-only hook carrier sources from `hook_carrier_watch_sources`. The watcher lines the worker cited do not cover daemon startup. Left open. | — | | 93-04 #4791 `sources/live/watcher.py:255` | fixed | Directory entries are sorted by name before a linked directory claims its target, so the retained alias does not depend on scandir order. | test_source_walk_and_fingerprint_contracts.py::test_alias_enumeration_has_one_stable_order | | 93-05 #5265 `sources/live/watcher.py:1215` | not reached | worker triage; not re-checked | — | | 93-06 #4730 `sources/live/watcher.py:1926` | not reached | worker triage; not re-checked | — | | 93-07 #4798 `sources/live/watcher.py:2143` | not reached | worker triage; not re-checked | — | | 93-08 #4587 `sources/origin_specs.py:194` | fixed | `_fingerprint_sources_compute` hashes the exact bytes it parses and refuses (`FingerprintSourceChangedError`) when they differ from the signature that keys the memo, so no memo is written for another implementation. | test_source_walk_and_fingerprint_contracts.py::test_changed_source_cannot_poison_fingerprint_memo | | 93-09 #4856 `sources/origin_specs.py:216` | fixed | String operands inside a Python call are no longer SQL-normalized; the fingerprint algorithm version moves 4 -> 5. | test_source_walk_and_fingerprint_contracts.py::test_sql_replacement_operands_move_fingerprint | | 93-10 #4729 `sources/origin_specs.py:250` | refuted | The closure memo holds a member's import graph fixed for the process lifetime by design: production sources cannot change under a running process, and source-mutating tools call `_invalidate_source_signatures` (polylogue/sources/origin_specs.py `_semantic_source_paths` docstring). | — | | 93-11 #4558 `sources/origin_specs.py:251` | fixed-already | `_source_signature` keys every source by its SHA-256 content digest, not stat metadata (polylogue/sources/origin_specs.py `_source_signature`). | — | | 93-12 #4936 `sources/origin_specs.py:470` | not reached | worker triage; not re-checked | — | | 93-13 #5627 `sources/origin_specs.py:823` | not reached | worker triage; not re-checked | — | | 93-14 #5627 `sources/origin_specs.py:823` | fixed | `hermes_snapshot_envelope` keeps an empty container witness for a container-valued root field, so the streaming recognizer used by prepared intake and provider detection agrees with `looks_like_hermes`. The size-gated probe this finding cited is gone (`recognize_source_class` now streams at every size), but the envelope still decides admission on those routes. | test_source_walk_and_fingerprint_contracts.py::test_streaming_hermes_envelope_keeps_container_presence | | 93-15 #5627 `sources/origin_specs.py:823` | not reached | worker triage; not re-checked | — | | 93-16 #4715 `sources/origin_specs.py:877` | fixed | `in_derived_identity_closure` and `devtools schema closure` resolve relative paths from the caller's directory and refuse a missing path instead of reporting it outside. | test_source_walk_and_fingerprint_contracts.py::test_closure_paths_are_relative_to_callers_cwd | | 93-17 #4661 `sources/origin_specs.py:1129` | not reached | worker triage; not re-checked | — | | 93-18 #4853 `sources/origin_specs.py:1457` | not reached | worker triage; not re-checked | — | | 93-19 #4406 `sources/origin_specs.py:1518` | fixed-already | docs/provider-origin-identity.md no longer carries a hand-maintained Origin token list; it points to the `Origin` enum and the generated table (lines 75-80). | — | | 93-20 #4705 `sources/origin_specs.py:1764` | fixed-already | `parse_sources_archive` hands local sources to `ingest_sources_archive`, the canonical acquisition owner; `_admit_non_session_origin_artifacts` no longer exists, and #5787 deleted `polylogue/pipeline/services/archive_ingest.py`. | — | | 93-21 #4969 `sources/origin_specs.py:2054` | not reached | worker triage; not re-checked | — | | 93-22 #4969 `sources/origin_specs.py:2055` | not reached | worker triage; not re-checked | — | | 93-23 #4914 `sources/origin_specs.py:2286` | fixed | `_tool_outcome` reports `not_reported` when no outcome field is present and `unsupported_construct` only for a present but unmapped one, and the Antigravity spec declares both. | test_antigravity_trajectory_steps.py::test_absent_outcome_is_not_reported | | 93-24 #4936 `sources/origin_specs.py:3370` | fixed | `artifact_observation_contracts` emits rows for every declared provider wire. | test_source_walk_and_fingerprint_contracts.py::test_observation_contracts_cover_every_provider_wire | | 93-25 #4448 `sources/parsers/antigravity.py:182` | fixed (reworked) | The source walk still follows directory links but records a link to an already-entered directory (an ancestor, or a tree a sorted-earlier link reached) as a non-regular entry instead of entering it. The worker's version stopped following links at all, which would have dropped linked export trees. | test_source_walk_and_fingerprint_contracts.py::test_census_records_directory_link_without_following_cycle<br>::test_source_walk_follows_a_linked_tree_and_stops_at_a_cycle | | 94-01 #4883 `sources/parsers/antigravity.py:513` | fixed | `occurred_at_ms` is converted as epoch milliseconds. | test_antigravity_trajectory_steps.py::test_millisecond_step_timestamp | | 94-02 #4883 `sources/parsers/antigravity.py:523` | fixed | The row's `exit_code`/`exitCode` column is read when the payload has none. | test_antigravity_trajectory_steps.py::test_structural_row_exit_code | | 94-03 #4883 `sources/parsers/antigravity.py:530` | fixed | A non-empty string, mapping or list `error` is a failure. | test_antigravity_trajectory_steps.py::test_nonempty_error_is_failure | | 94-04 #4883 `sources/parsers/antigravity.py:563` | fixed | Unwrapping `payload` merges the envelope fields under the nested ones. | test_antigravity_trajectory_steps.py::test_nested_payload_keeps_outer_role_and_clock | | 94-05 #4914 `sources/parsers/antigravity.py:579` | fixed | A step whose typed construction fails validation becomes a per-step MALFORMED refusal plus an `antigravity_unsupported_step` event; siblings still parse. | test_antigravity_trajectory_steps.py::test_bad_patch_refuses_only_its_step | | 94-06 #4914 `sources/parsers/antigravity.py:584` | fixed | camelCase edit fields gate and populate the file edit. | test_antigravity_trajectory_steps.py::test_camel_case_edit_evidence | | 94-07 #4914 `sources/parsers/antigravity.py:653` | not reached | worker triage; not re-checked | — | | 94-08 #4883 `sources/parsers/antigravity.py:655` | fixed-already | `parse_trajectory_db` refuses a step outside `_TRAJECTORY_SUPPORTED_STEP_TYPES`/`_FORMATS` as a typed unknown with an event before any text fallback. | — | | 94-09 #4883 `sources/parsers/antigravity.py:663` | fixed-already | Tool-result steps are already typed TOOL_RESULT at the landing base: `_trajectory_message(step_type="tool_result")` returns `MessageType.TOOL_RESULT` on origin/master 915a1f3 (probed), and tool-call steps are TOOL_USE. | — | | 94-10 #4883 `sources/parsers/antigravity.py:828` | fixed-already | The summary lookup tries both cascade_id and trajectory_id (`summary_key = next(...)` in `parse_trajectory_db`). | — | | 94-11 #4883 `sources/parsers/antigravity.py:844` | fixed-already | A single resolved parent reference populates `parent_session_provider_id` on the parsed session. | — | | 94-12 #4932 `sources/parsers/antigravity.py:855` | not reached | worker triage; not re-checked | — | | 94-13 #5403 `sources/parsers/antigravity.py:1043` | fixed | Parent references resolve through the trajectory/cascade alias map before the ambiguity check; two aliases of one parent are one parent, two parents stay ambiguous. | test_antigravity_trajectory_steps.py::test_parent_aliases_canonicalize_before_ambiguity | | 94-14 #4184 `sources/parsers/base_models.py:100` | fixed | `ParseAccounting.assert_conserved` refuses ranges and outcomes outside `[0, expected)`, so equal counts over the wrong ordinals no longer pass. | test_parser_admission_contracts.py::test_writer_refuses_out_of_denominator_ordinal | | 94-15 #4229 `sources/parsers/base_models.py:320` | fixed | Material origin is classified from the same TEXT-block projection as message type. | test_parser_admission_contracts.py::test_capture_thinking_is_not_runtime_context | | 94-16 #4271 `sources/parsers/base_support.py:112` | dropped: not a defect | Detecting a future-shaped discriminator anywhere in an outer record is the deliberate admission contract: `tests/unit/sources/test_prepared_claude_ai_object.py::test_claude_ai_object_future_wire_type_keeps_parser_admission` and the Drive chunked-prompt test assert that nested `metadata.kind`/chunk `type` values raise `<provider>_unknown_input`, and the streaming envelopes compute the same first future type over nested frames. Removing the recursion (the worker's fix) broke that parity. | — | | 94-17 #4184 `sources/parsers/base_support.py:125` | not reached | worker triage; not re-checked | — | | 94-18 #4271 `sources/parsers/base_support.py:149` | not reached (fix withdrawn) | The cited code was replaced by `AdmissionObserver` (#5711), which keeps one pending event per unknown wire type by design (bounded memory; `test_admission_payload.py::test_repeated_unknown_records_keep_one_pending_event_per_type`). Every occurrence has its own UNKNOWN ledger outcome, but the ledger is only asserted, not persisted. This branch's per-occurrence events contradicted the bounded contract and were dropped in the merge. Open for a bounded fix (e.g. an occurrence count on the per-type event). | — | | 94-19 #4271 `sources/parsers/base_support.py:159` | not reached | worker triage; not re-checked | — | | 94-20 #4184 `sources/parsers/base_support.py:278` | fixed | A `tool_use` part with no name, id or input is a MALFORMED refusal, not a materialized part that yields no block. | test_parser_admission_contracts.py::test_empty_tool_part_is_refused_beside_valid_content | | 94-21 #4802 `sources/parsers/base_support.py:720` | fixed-already | `attachment_identity_hash` (polylogue/pipeline/ids.py) keys attachment identity on message, name and MIME type only; size and bytes are excluded. | — | | 94-22 #4802 `sources/parsers/browser_capture.py:228` | fixed-already | `_merge_envelope_attachments` selects `candidate.inline_bytes if candidate.inline_bytes is not None else existing.inline_bytes`. | — | | 94-23 #4802 `sources/parsers/browser_capture.py:257` | fixed | Typed `extracted_content` is read before `provider_meta.extracted_content`. | test_web_parser_attachments_and_runs.py::test_typed_extracted_content_precedes_provider_metadata | | 94-24 #4986 `sources/parsers/browser_capture.py:318` | fixed | A `claude-file:<uuid>` projection whose uuid equals the native attachment id reconciles without a byte witness. | test_web_parser_attachments_and_runs.py::test_claude_file_projection_reconciles_without_bytes | | 94-25 #4999 `sources/parsers/browser_capture.py:379` | fixed | A cached cross-route match is reused only if it still passes `_claude_attachment_cross_route_match`. | test_web_parser_attachments_and_runs.py::test_projection_id_collision_revalidates_native_target | | 95-01 #4999 `sources/parsers/browser_capture.py:393` | not reached | worker triage; not re-checked | — | | 95-02 #4812 `sources/parsers/chatgpt.py:315` | fixed | List-valued `aggregate_result` is normalized before the outcome mapping: any failed run is an error, all successful is success, otherwise unknown. | test_web_parser_attachments_and_runs.py::test_list_aggregate_result_overrides_delivery_status | | 95-03 #4812 `sources/parsers/chatgpt.py:537` | fixed | The citation URL pattern accepts the `/g/g-p-<project>/c/<id>` form. | test_web_parser_attachments_and_runs.py::test_project_scoped_conversation_citation_keeps_native_identity | | 95-04 #4812 `sources/parsers/chatgpt.py:708` | fixed | Run events are emitted per run (list or single) and retain `output` and `exit_code`. | test_web_parser_attachments_and_runs.py::test_direct_run_outputs_are_retained | | 95-05 #4184 `sources/parsers/chatgpt.py:1066` | fixed (completed) | A non-string discriminator is typed unknown at the message level, the media-part branch and the part-accounting predicate the finding cited; the worker's version left that accounting set lookup unguarded. | test_web_parser_attachments_and_runs.py::test_unhashable_content_type_keeps_valid_message | | 95-06 #4886 `sources/parsers/chatgpt.py:1688` | not reached | worker triage; not re-checked | — | | 95-07 #4873 `sources/parsers/chatgpt.py:1690` | not reached | worker triage; not re-checked | — | | 95-08 #4940 `sources/parsers/chatgpt.py:1758` | fixed | A text-bearing `audio_transcription` construct is not marked unavailable. | test_web_parser_attachments_and_runs.py::test_text_only_audio_transcription_is_available | | 95-09 #4776 `sources/parsers/claude/ai_parser.py:805` | fixed in part | Two records whose bytes are both present and differ are no longer merged under one message identity. The descriptor-only case remains: the worker's stronger rule (require equal bytes or a shared source URL) would drop the bytes of the real export shape this function exists for, a metadata-only message record repeated at conversation level with extracted content (`tests/unit/sources/test_claude_ai_conversation_level_attachments.py`). | test_claude_ai_conversation_level_attachments.py<br>test_web_parser_attachments_and_runs.py::test_conflicting_bytes_keep_a_top_level_file_distinct | | 95-10 #4717 `sources/parsers/claude/code_parser.py:627` | not reached | worker triage; not re-checked | — | | 95-11 #5530 `sources/parsers/claude/code_parser.py:1314` | fixed | `_optional_safe_int` accepts only non-negative integral numbers; null, bool, NaN, negative, fractional and non-numeric values are unknown. | test_counter_and_coordinate_contracts.py::test_claude_invalid_counter_is_not_measured_zero<br>::test_claude_numeric_zero_remains_measured | | 95-12 #4674 `sources/parsers/claude/code_parser.py:1860` | not reached | worker triage; not re-checked | — | | 95-13 #4642 `sources/parsers/claude/code_parser.py:2002` | not reached | worker triage; not re-checked | — | | 95-14 #4808 `sources/parsers/claude/code_parser.py:2598` | not reached | worker triage; not re-checked | — | | 95-15 #5293 `sources/parsers/codex.py:524` | fixed | `_optional_int_field` keeps null and invalid counters unknown and preserves a real zero. | test_counter_and_coordinate_contracts.py::test_codex_sparse_counter_remains_unknown<br>::test_codex_numeric_zero_remains_measured | | 95-16 #4870 `sources/parsers/codex.py:576` | fixed | String and mapping `local_images` references pass through `_sanitize_codex_data_url`. | test_counter_and_coordinate_contracts.py::test_local_image_reference_cannot_copy_inline_bytes_to_events | | 95-17 #4870 `sources/parsers/codex.py:690` | not reached | worker triage; not re-checked | — | | 95-18 #4173 `sources/parsers/codex.py:2276` | fixed | The synthetic oracle classifies Codex nodes through `classify_message_type`, as production does. | test_counter_and_coordinate_contracts.py::test_codex_semantic_oracle_uses_protocol_precedence | | 95-19 #4184 `sources/parsers/codex.py:2828` | not reached | worker triage; not re-checked | — | | 95-20 #4236 `sources/parsers/codex.py:2831` | not reached | worker triage; not re-checked | — | | 95-21 #4184 `sources/parsers/codex.py:2896` | not reached | worker triage; not re-checked | — | | 95-22 #4933 `sources/parsers/codex.py:3558` | not reached | worker triage; not re-checked | — | | 95-23 #4933 `sources/parsers/codex.py:3563` | not reached | worker triage; not re-checked | — | | 95-24 #5626 `sources/parsers/codex_state.py:539` | not reached | worker triage; not re-checked | — | | 95-25 #5626 `sources/parsers/codex_state.py:582` | fixed | Codex state chunk coordinates are `item:field:offset`, without the physical rowid. | test_counter_and_coordinate_contracts.py::test_state_chunk_coordinates_ignore_physical_rowid | ## Derived-identity closure The checked-in baseline (`docs/plans/schema-closure-baseline.json`) lists these changed files: `polylogue/sources/decoder_json.py`, `polylogue/sources/live/discovery.py`, `polylogue/sources/origin_specs.py`, `polylogue/sources/parsers/antigravity.py`, `polylogue/sources/parsers/base_models.py`, `polylogue/sources/parsers/base_support.py`, `polylogue/sources/parsers/claude/ai_parser.py`, `polylogue/sources/parsers/claude/code_parser.py`, `polylogue/sources/parsers/codex.py` and `polylogue/sources/source_walk.py`. `_FINGERPRINT_ALGORITHM_VERSION` also moves (4 -> 5). This PR moves the derived schema identity and must not land during a rebuild. These changed files are outside the baseline: `browser_capture.py`, `chatgpt.py`, `codex_state.py`, `schemas/synthetic/wire_formats.py` and `devtools/schema_closure.py`. The `schema-closure` gate passed in job 2228. ## Residuals - **Codex state materials.** Chunk `source_uri`s change for chunked Codex goals and memories (`codex://state/<kind>-text/<thread>/<item:field:offset>`). This cannot duplicate sessions or messages. These materials are written only by `sources/codex_state_evidence.py` into `source.db` `material_observations`. Nothing lowers them into `index.db`. Their only readers are the `storage/materials.py` helpers (`list_materials`, `list_materials_page`, `get_material`), which no API, MCP, CLI or materializer calls, plus excision and blob liveness, which key on referrer and blob. The live archive holds no rows from the old coordinate: `SELECT count(*) FROM material_observations WHERE source_uri LIKE 'codex://state/%'` returns 0 on `/realm/state/polylogue/source.db` (fresh v1). No change or cleanup is needed. - **Still open from this bead set:** 93-01 (empty retained sidecar scope), 93-03 (daemon startup still runs `mkdir` on legacy-read-only roots), 94-18 (repeated unknown occurrences, withdrawn at the merge), 95-09's descriptor-only case, and the 28 other findings the worker did not reach. - **Fingerprint refusal.** `FingerprintSourceChangedError` repeats until the signature cache is invalidated or the process restarts. That is deliberate, but a long-lived dev process on an edited checkout will keep refusing. - **Link policy.** The source walk follows a directory link that escapes the root; the live walk refuses it. This predates this PR. - **Inherited failures.** The 10 inherited failures listed under Verification are not addressed here. 🤖 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 bf68918):
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 bf68918):
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 5ebcfe5):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
## Summary Resolves the 23 confirmed Codex P1 findings tracked in polylogue-rs02d: 20 are fixed here, 10.F016 was already fixed on master, and 10.F013 and 10.F017 move to polylogue-g4w5d: acquisition, backup, browser capture, Codex lineage, MCP, mutations, query origins, retained assembly, revision backfill, schemas, and live sources. The lanes of the previous owner were integrated onto current master; this PR adds the missing pieces and the fixes that the integration review found. ## Problem Each row below is a Codex review thread confirmed against master 64a9bd0 by triage run `r4-other-sources`. The reproductions are in the bead and in each linked thread. ## Solution | Finding | Thread | Disposition | Regression test | |---|---|---|---| | 10.F039 Stream preserved ZIP payload proofs | [#4439](#4439 (comment)) | Fixed: backup replay goes through the streamed unit replay; a candidate holds digests and a reopener, and backup recovery plus raw derivation's blob restoration (#5846) stream the unit's bytes (`operations/zip_acquisition_replay.py`, `operations/archive_backup.py`, `storage/derived/raw.py`) | `tests/unit/sources/test_export_member_addressing.py`, `tests/unit/storage/test_blob_integrity.py` | | 08.F016 Authenticate the loopback receiver before releasing its token | [#4208](#4208 (comment)) | Fixed: the native host challenges `POST /v1/receiver/attest` and releases the bearer only for the bearer-keyed HMAC over a fresh challenge | `tests/unit/browser_capture/test_native_host.py` | | 08.F015 Bound native credential refresh to one retry | [#4208](#4208 (comment)) | Fixed: one native refresh per health check; a second 401 reports `unauthorized` | `browser-extension/tests/background.test.js` | | 10.F006 Preserve fallback identity for ID-less ChatGPT fragments | [#4188](#4188 (comment)) | Fixed: the census keys a document by the id `chatgpt.parse` gives it, fallback included | `tests/unit/sources/test_parsers_chatgpt.py` | | 10.F001 Scope parent lookup to the rollout's Codex root | [#4941](#4941 (comment)) | Fixed: the writer reads the parent in the install root of the raw's retained source path; unscoped reads answer only where every root agrees | `tests/unit/storage/test_agent_thread_state_graph.py`, `tests/unit/storage/test_topology_hook_authority_conflict.py` | | 10.F003 Rebuild retained rows before rejecting older exports | [#4941](#4941 (comment)) | Fixed: an older export folds the objects it names in as superseded rows ranked by durable receipt order | `tests/unit/storage/test_agent_thread_state_graph.py`, `tests/unit/sources/test_codex_state_live_ingest.py` | | 08.F045 Preserve indeterminate daemon submissions | [#5480](#5480 (comment)) | Fixed: MCP no longer swallows `DaemonMutationIndeterminateError`; the shared serializer returns `code="indeterminate"`, `retryable=false` and the request id. Sibling: MCP also refused no non-completed envelope (`cancelled`, `timed-out`, `degraded`, `disconnected-before-acceptance`) and returned it as a result; it now refuses them as the CLI kernel does, and both read one `DAEMON_INDETERMINATE_OUTCOMES` | `tests/unit/mcp/test_rs02d_outcomes.py` | | 08.F043 Cover postmortem and pathology MCP projections | [#4810](#4810 (comment)) | Fixed: `postmortem_outcome` and `pathology_outcome` in `analysis/postmortem.py` decide the outcome from coverage receipts; MCP attaches it. The CLI analyze routes carry the same pre-existing gap and are filed as polylogue-t4115 | `tests/unit/mcp/test_rs02d_outcomes.py` | | 08.F022 Require callers to present the delete preview token | [#4249](#4249 (comment)) | Fixed: the facade delete authorizes only the caller's own `mutation.session.delete.preview`; API gains `prepare_delete_session`; MCP `write` gains `prepare_delete_session` and requires `fields.preview_ref`; `POST /api/reset` requires `preview_ref`; the self-authorizing `delete_session_product` is removed | `tests/unit/api/test_facade_contracts.py`, `tests/unit/operations/test_mutations.py`, `tests/unit/daemon/test_daemon_http.py`, `tests/unit/mcp/test_rs02d_outcomes.py` | | 10.F009 Keep unknown-export available as a public origin filter | [#4060](#4060 (comment)) | Fixed: the unknown-export spec is a public filter origin | `tests/unit/sources/test_origin_specs.py`, `tests/unit/daemon/test_http_origin_validation.py` | | 10.F023 Preserve ZIP member order when selecting retained sidecars | [#4853](#4853 (comment)) | Fixed in three parts. (1) Selection ranks the lowest member ordinal within one acquisition time. (2) The source-walk stream stamps one acquisition time per ZIP pass. (3) Retained lookup names a ZIP member by its own basename: it had taken `PurePosixPath("<zip>:library_files.json").name`, so replay recognized no zipped asset index or asset id at all | `tests/unit/pipeline/test_ingest_worker_assembly.py` | | 10.F030 Move the exact FTS audit outside the component loop | [#4982](#4982 (comment)) | Fixed: raw-derivation publications pass `exact_fts_audit=False`; the `fts_readiness_binding` stage runs the one archive-wide inspection after block writes retire the binding | `tests/unit/storage/test_raw_observation_derivation.py` | | 10.F034 Restore constant-time raw-to-key lookups | [#5395](#5395 (comment)) | Fixed: census keeps a raw-to-key reverse map | `tests/unit/sources/test_revision_backfill.py` | | 10.F035 Validate enrichment with the resolved retained provider | [#5557](#5557 (comment)) | Fixed: publication validates under `artifact.resolved_provider` | `tests/unit/pipeline/test_codex_retained_state_title_production_route.py` | | 08.F049 Include WAL state in the observation revision | [#4923](#4923 (comment)) | Fixed: a live SQLite member's revision is the digest of its logical export, and its structure comes from that export's header in the same read transaction | `tests/unit/schemas/test_source_inference.py` | | 10.F015 Skip opaque JSON attachments before ZIP observation | [#4936](#4936 (comment)) | Fixed: `opaque-non-applicable` members are skipped by the ZIP walk and refused by schema-unit extraction | `tests/unit/schemas/test_observation_runtime.py`, `tests/unit/schemas/test_source_inference.py` | | 08.F050 Preserve annotated Claude Code block content | [#4951](#4951 (comment)) | Fixed: conservation plants annotated `content` unless it repeats the typed body | `tests/unit/core/test_wire_conservation.py` | | 10.F010 Route `.jsonl.txt` through JSONL recognition | [#4365](#4365 (comment)) | Fixed: recognition uses the shared `is_jsonl_source_path`. `_PARSER_FINGERPRINT` moves to `live-batched-v5` so cursors excluded as unsupported under v4 are retried | `tests/unit/sources/test_origin_specs.py` | | 10.F038 Persist terminal admission receipts before discarding state | [#4275](#4275 (comment)) | Fixed by removal: the `AdmissionState` machine had no production caller and persisted nothing; the durable accepted outcome is the raw row plus its `raw_payload` receipt. `sources/live/admission.py` and its tests are deleted | `tests/unit/pipeline/test_acquisition_persist_failure_cursor.py`, `tests/unit/architecture/test_one_intake_route.py` | | 10.F040 Detect the ZIP provider before preserving raw-only members | [#4853](#4853 (comment)) | Fixed: `zip_member_admission` sniffs the provider before admission; the source walk, retained acquisition, production baseline and the daemon ZIP route all use it | `tests/unit/sources/test_assembly_chatgpt.py`, `tests/unit/sources/test_live_batch_support.py` | | 10.F013 Reparse owners when a late sidecar is retained | [#4850](#4850 (comment)) | **Not fixed here; tracked in polylogue-g4w5d.** The lane's owner reparse failed its own production-route test (the owner reparses with the sidecar visible, but the published block keeps the preview), so it was withdrawn | none (the failing test moves to the successor) | | 10.F016 Parse the same immutable snapshot that is hashed | [#5546](#5546 (comment)) | Already fixed on master by #5823 (`633ec18ffc`): `parse_prefetch` detects, bounds and parses one `source_snapshot` and seals its `source_sha256`. The lane's copy-based version was dropped in favour of it | master's #5823 regressions | | 10.F017 Fence sidecar inputs with the prepared transcript | [#5546](#5546 (comment)) | **Not fixed here; tracked in polylogue-g4w5d.** The lane's fenced resolver sealed a digest, but a carrier prepared with an absent or older sidecar still published stale text in its own test, so it was withdrawn | none (moves to the successor) | Derived-identity closure members changed (land before a rebuild starts): `browser_capture/models.py`, `schemas/observation.py`, `schemas/observation_runtime.py`, `schemas/source_inference.py`, `sources/codex_state_projection.py`, `sources/dispatch.py`, `sources/live/batch.py`, `sources/live/production_baseline.py`, `sources/live/watcher.py`, `sources/origin_specs.py`, `sources/retained_assembly.py`, `sources/revision_backfill.py`, `sources/source_acquisition_components.py`, `storage/sqlite/agent_thread_state.py`, `storage/sqlite/archive_tiers/revision_governance.py`, `storage/sqlite/archive_tiers/write.py`, `surfaces/payloads.py` (all under `polylogue/`). `sources/live/admission.py` leaves the closure. Manual token: `_PARSER_FINGERPRINT` moves to `live-batched-v5` (master took v4 in #5823). ## Verification All runs used AgentCTL declared operations. Final head `c2335d6116`, on master `633ec18ffc`. - `verify_quick` (job 3433 at `9e7b3aa4a7`, plus the pre-push gate at `c2335d6116`): `verify: PASSED exit=0`. The hosted `ci/circleci: quick-gate` passes. - `pytest_focused -- -n 4 <184 affected test files>` (job 3434 at `9e7b3aa4a7`) stopped at the operation's 2 h limit after 5053 passed and 52 failed; the pool ran it on one xdist worker. The 40 files it did not reach ran in job 3556: 745 passed, 24 failed. The fixture change since then was run in job 3566. - Every failure in those runs is inherited or load-dependent: - They fail identically on master in a detached worktree (`pytest_focused -- <ids> --on-default-branch`): jobs 3383, 3402, 3411 at `5d56c3a26f`, and jobs 3517, 3555, 3560, 3569 at `b384edcec9`. Examples: `test_repository_lifecycle_laws`, `test_marks_identity_preserving`, `test_browser_capture` (daemon-required facade route), `test_query_composition_laws`, `test_raw_observation_derivation` SQLite cases, `test_archive_ingest_shared_raw`, `test_observation_runtime::test_structured_raw_only_sidecar_is_observed_by_normal_source_inference`, `test_synthetic_wire_support`, `test_enums::test_origin_values_match_archive_issue_contract`, `test_tutorial`, `test_write_path_state_machine::test_cascade_excision_removes_rawless_inherited_child`. - Or they pass alone on this branch: `test_daemon_status` FTS readiness (job 3530) and `test_daemon_cli::test_daemon_watcher_hints_wake_fair_intake_and_canonical_derivation` (job 3558). - Failures this branch caused were fixed here: the MCP delete test, the ZIP whole-blob-detection law, the F023 and F034 lane tests, the `zip_reacquisition_payload` rename, and the Codex contradiction fixture (`test_parent_session_accounting`, 7 passed in job 3566). **After rebasing onto master `5ebcfe59d2`** (head `2707271fa5`): #5842 moved currency to receipt order and #5846 moved backup and blob restoration, so the rebase merged those by hand and extended 10.F039 to raw derivation's ZIP blob restoration. - `verify_quick` job 3655 and the pre-push gate: `verify: PASSED exit=0`. - `pytest_focused -- -n 4 <24 files covering backup, blob restoration, retained assembly, and Codex lineage>` (job 3656): 703 passed, 11 failed. All 11 are inherited or load-dependent. The five `test_live_batch_support` cases and `test_daemon_operation_route::test_cancelled_long_delete_retains_writer_until_blocked_apply_releases` hit 120 s timeouts under the loaded pool and pass alone on this branch (jobs 3849, 3890) and on master (jobs 3774, 3889). `test_archive_maintenance::test_bench_blob_gc_dry_run_candidate_scan` fails on master too (job 3889). The rest were classified above. ## Self-review Checklists re-read: `docs/review/codex-review-guide.md` and the orchestrate worker contract. Four passes. Findings from passes 1 and 2 (including those the full test run surfaced) were fixed or withdrawn in this PR; the final pass over the rebased diff found nothing new. **Pass 1 findings (fixed):** (a) 10.F023 was incomplete: the source-walk stream stamped each record with its own `now()`, so the ordinal rule never applied off the daemon route (`acquisition_streams.py`). (b) The daemon ZIP route kept its own copy of the provider sniff (`live/batch.py`). (c) MCP returned `cancelled`, `timed-out`, `degraded`, and `disconnected-before-acceptance` envelopes as results, and the CLI kernel and MCP each held their own literal indeterminate set. (d) MCP classified postmortem/pathology gaps inline instead of in one owner. (e) The WIP outcome tests asserted message wording. (f) `agent_thread_state._write_rows` executed caller-supplied SQL that the census cannot see. (g) `_PARSER_FINGERPRINT` was not bumped although excluded `.jsonl.txt` cursors could never revive. **Pass 2 findings (fixed):** (h) Running the lane tests showed that 10.F013 and 10.F017 never passed, on the lane or here. They were withdrawn to polylogue-g4w5d rather than shipped. 10.F016 had meanwhile landed on master (#5823). (i) The rebase onto master's backup `recover` needed exact bytes, which the digest-only unit lacked; recovery now streams through `open_replayed_zip_unit`. (j) Master added a test on the removed `zip_reacquisition_payload`. (k) Retained ZIP member names were wrong (10.F023, above). (l) Two tests encoded the old contracts: the MCP delete without a preview, and a whole-blob-detection law that forbade the bounded sniff. (m) The F034 test counted the prefetcher's one per-phase snapshot as a per-member scan. 1. ✓ **Siblings and owners.** ZIP admission: `grep -rn "sniff_zip_provider(" polylogue` shows the single call inside `zip_member_admission`; the source walk, retained acquisition, production baseline, and daemon ZIP route all use it. The source-only ZIP route deliberately interprets no bytes and keeps declared-path admission. Indeterminate outcomes: one `DAEMON_INDETERMINATE_OUTCOMES`, read by `cli/operation_kernel.py` and `mcp/server_cutover.py`. Insight outcomes: `postmortem_outcome`/`pathology_outcome` own the decision; the CLI analyze routes carry the same pre-existing gap, filed as polylogue-t4115. Delete consent: every `delete_session_safe(` caller passes `preview_ref` (grep: daemon/http.py, api/archive.py, mcp/server_cutover.py, tests). 2. ✓ **The fix itself.** The new MCP refusal path returns typed `error_json` with the daemon's code; `DaemonMutationIndeterminateError` reaches `_exception_to_error_json`, which serializes it (`test_shared_exception_boundary_preserves_identity_without_internal_paths`). The opener's `LookupError`, `OSError`, `BadZipFile`, and `ContentIdentityRefusal` are caught at the one `recover` call and recorded as an unproven `error:<type>`, not an escape. 3. ✓ **Memory and limits.** A container candidate holds digests and an opener, never bytes; recovery streams into `stage_exact_blob` (`test_full_evidence_backup_streams_a_recovered_whole_zip_member` refuses any unbounded `ZipExtFile.read`). No new cap or timeout on valid input; the native host's 5 s idle bound is per socket step, and a slow receiver is retried on the next health check. 4. ✓ **Cost per unit.** 10.F034 replaces the per-member linear key scan with a dict. 10.F030 moves the archive-wide FTS audit out of the per-component loop. Residual: `read_spawn_parents` scans a scope's invoked edges twice per export write (scoped and unscoped); this is proportional to graph size, per export rather than per session, as before. 5. ✓ **Interruption.** MCP cancellation still cancels the submitted request id; `_daemon_operation`'s cancel loop is unchanged. The late-sidecar reparse (10.F013) is withdrawn, so this PR adds no new multi-step live state. 6. ✓ **Ordering and races.** The acquisition time is one value per ZIP pass. 10.F016's single-snapshot parse is master's (#5823). The 10.F017 sidecar race stays open in polylogue-g4w5d. 7. ✓ **Failure classification.** A live SQLite export fault maps to `decode_failed unreadable_source`, the same classification an unreadable file already had. Receiver attestation separates `receiver_unreachable` (retry) from `receiver_authentication_failed`. 8. ✓ **Silent outcomes.** Postmortem/pathology now carry `empty`/`degraded` with named gaps (`match_cap_exceeded`, `session_profile_unavailable`, `session_digest_unavailable`, `longest_tool_gap_unavailable`). An opaque ZIP attachment reports `intentionally_excluded` rather than vanishing. 9. ✓ **Cleanup on failure.** The live snapshot scratch directory is removed in `finally`; the backup package staging root is removed as before; the ZIP opener closes its `ZipFile` on every exit. 10. ✓ **Identity and keys.** The ChatGPT census key is the parser's own id rule (`chatgpt.py:3104,3133`). `MemberCandidate.open_payload` is `compare=False`, so candidate identity stays its digests. Codex parents are read in the rollout's install root; unscoped reads answer only where every root agrees. 11. ✓ **Lossless transforms.** The older-export fold keeps the current export's rows and adds only superseded rows it names; ranking is by durable receipt order. 12. ✓ **Degenerate inputs.** Absent and empty `tool-results/` digest to the same population, which is also what the retained tier records. A ZIP with only opaque members is `intentionally_excluded`. A zero-finding complete pathology scope is `empty`. 13. ✓ **Consumers.** Removed or renamed: `replay_zip_entry_acquisition_payloads`, `zip_reacquisition_payload`, `delete_session_product`, `sources/live/admission.py`, `_write_rows`; grep count 0 for each in polylogue/tests/devtools/docs. `docs/api-parity.md` was regenerated; the closure baseline dropped `admission.py`; `docs/atlas/mcp.md`, `docs/daemon.md`, and `docs/browser-capture.md` describe the new contracts. 14. ✓ **Tests and stubs.** Monkeypatch targets follow the moved sniff (`test_live_batch_support.py` now patches `source_acquisition_components.sniff_zip_provider`). Each new test names the change that turns it red in its docstring (e.g. per-record clock in `test_source_walk_stamps_one_acquisition_time_per_zip_pass`, whole-member `read()` in the backup streaming test). 15. ✓ **Trust boundaries.** The bearer never crosses the socket before the receiver proves possession (HMAC with a domain separator). The MCP indeterminate payload exposes only the request id, not the internal path (`test_shared_exception_boundary_preserves_identity_without_internal_paths`). Generic list: 1. ✓ Each of the 20 fixed findings has a named production-route regression in the table; 10.F038 is resolved by removing the unwired state machine, since its durable owner is the raw row plus the `raw_payload` receipt. 10.F016 cites master's #5823. 10.F013 and 10.F017 are unmet here and stay open in polylogue-g4w5d, with the evidence from the withdrawn attempt. 2. ✓ Sibling search, by grep: `sniff_zip_provider(`, one call site; `DAEMON_INDETERMINATE_OUTCOMES`, two readers; `delete_session_safe(`, three production callers, all passing `preview_ref`. 3. ✓ Predecessors are deleted with their tests (`tests/unit/sources/test_admission.py` is removed). 4. ✓ Failures are typed and visible: MCP errors carry codes; backup recovery records `error:<type>`/`inexact_payload`; outcomes carry named gaps. 5. ✓ Each new test fails when its behavior is removed, as stated in its docstring. 6. ✓ No secrets or private data: fixtures are synthetic (`synthetic-*` ids, tmp paths). ## Residuals - 10.F013 and 10.F017 are not fixed. They are tracked in polylogue-g4w5d with the withdrawn attempt's evidence (bundle and patch in the finisher scratch, and the failing regression tests). - CLI `analyze --postmortem/--portfolio` still emit no terminal outcome (pre-existing): polylogue-t4115. - `read_spawn_parents` scans a scope's invoked edges twice per Codex export write. The cost is proportional to graph size, per export rather than per session. - `sniff_zip_provider` inspects at most `_ZIP_SNIFF_MEMBER_LIMIT` members. The limit is pre-existing, and the inbox routes now share it. - `_PARSER_FINGERPRINT` moves to `live-batched-v5`, so the next watcher pass re-examines every live file whose cursor carries v4. - Many tests in the affected selection fail identically on master (listed under Verification); they are outside this PR's scope and not fixed here. 🤖 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]>
|
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. |
Batch
polylogue-20260911-012434-0dfd7d27on baseda315a9794bf.polylogue-cq1ql Converge Claude and Gemini tool outputs from retained sidecars