Skip to content

feat: stabilize source replay and add OTel GenAI import - #5530

Merged
Sinity merged 24 commits into
masterfrom
feat/reindex-source-integration
Sep 25, 2026
Merged

Sinity merged 24 commits into
masterfrom
feat/reindex-source-integration

Conversation

@Sinity

@Sinity Sinity commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Keep source revision caches tied to exact accepted inputs and invalidate them when source evidence changes.
  • Admit OTel GenAI traces, preserve Claude artifact ownership at the source boundary, and distinguish absent usage from explicit zero.
  • Make replay counters and differential fixtures reflect the production route; synchronize public Origin surfaces.

Problem

The stopped reindex campaign left accepted-source and replay fixes split across unfinished work. In particular, source cache reuse could survive a changed revision, Claude artifact observations were repaired downstream of ingestion, and OTel usage-only spans or tool children could be lost or misgrouped.

Solution

The batch integrates the source-side changes and their focused regression coverage. OTel spans are grouped by conversation, tool children retain their parent, usage-only spans remain admitted, and token totals avoid double counting. The new source observation and OTel parser enter the derived schema identity closure; the baseline records that growth from 559 to 561. Land this before the fresh archive reconvergence.

Verification

  • devtools verify --quick — passed, AgentCTL job 1791 at the pre-rebase candidate (all static gates, no pytest).
  • devtools test tests/integration/test_claude_workflow_admission.py — 3 passed, receipt 20260925T160558Z-focused-test-2090244-2e55251c.
  • Batched focused source regression selection: 418 passed and four finished-build differential tests failed because the newly merged profile PR added two index tables; after explicitly classifying those tables, devtools test tests/unit/sources/test_finished_build_equivalence.py passed all six, receipt 20260925T163401Z-focused-test-2207242-f2b3151c.
  • devtools test tests/unit/sources/parsers/test_otel_genai.py — 10 passed after deterministic duplicate-span handling, receipt 20260925T163236Z-focused-test-2201869-35663012.
  • devtools verify --quick — passed on final rebased head f1e911c9d, AgentCTL job 1813, receipt 20260925T165002Z-quick-2279655-13c0d337 (all static gates, no pytest).

Residual

This changes derived identity and requires a fresh reconvergence after all closure edits land. The live archive has not been rebuilt by this PR.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 92c165c6-ed4b-43d3-aef0-568bd2d42fe5

📥 Commits

Reviewing files that changed from the base of the PR and between 9d33b52 and f1e911c.

⛔ Files ignored due to path filters (3)
  • webui/src/generated/contracts.ts is excluded by !**/generated/**
  • webui/src/generated/contrast-report.json is excluded by !**/generated/**
  • webui/src/generated/tokens.css is excluded by !**/generated/**
📒 Files selected for processing (52)
  • devtools/render_webui_design_system.py
  • docs/agent-integration-reference.md
  • docs/agent-manual.md
  • docs/atlas/sources-parsers.md
  • docs/plans/durable-write-census.yaml
  • docs/plans/schema-closure-baseline.json
  • docs/provider-origin-identity.md
  • polylogue/agent_integration/data/deep-reference.md
  • polylogue/agent_integration/data/integration-spec.json
  • polylogue/agent_integration/data/standing-manual.md
  • polylogue/agent_integration/data/tool-contracts.json
  • polylogue/analysis/claude_workflow_materializer.py
  • polylogue/core/enums.py
  • polylogue/core/provider_identity.py
  • polylogue/core/sources.py
  • polylogue/pipeline/services/archive_ingest.py
  • polylogue/pipeline/services/ingest_batch/_core.py
  • polylogue/schemas/source_recipe.py
  • polylogue/sources/artifact_observations.py
  • polylogue/sources/dispatch.py
  • polylogue/sources/live/append_ingest.py
  • polylogue/sources/live/batch.py
  • polylogue/sources/origin_specs.py
  • polylogue/sources/parsers/claude/code_parser.py
  • polylogue/sources/parsers/hermes_state.py
  • polylogue/sources/parsers/local_agent.py
  • polylogue/sources/parsers/otel_genai.py
  • polylogue/sources/revision_backfill.py
  • polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py
  • polylogue/storage/sqlite/archive_tiers/write.py
  • polylogue/storage/usage.py
  • polylogue/ui/theme.py
  • tests/data/origin_capability_matrix.json
  • tests/fixtures/otel-genai/trace.json
  • tests/infra/reindex_differential.py
  • tests/infra/workload_artifacts.py
  • tests/integration/test_claude_workflow_admission.py
  • tests/unit/infra/test_workload_artifacts.py
  • tests/unit/pipeline/test_archive_ingest_commit_batching.py
  • tests/unit/schemas/test_source_cache_reuse.py
  • tests/unit/sources/parsers/test_otel_genai.py
  • tests/unit/sources/test_finished_build_equivalence.py
  • tests/unit/sources/test_origin_capability_matrix.py
  • tests/unit/sources/test_origin_specs.py
  • tests/unit/sources/test_parsers_local_agent.py
  • tests/unit/sources/test_reviewed_acquisition_defects.py
  • tests/unit/storage/test_archive_tiers_write.py
  • tests/unit/storage/test_derived_schema_identity.py
  • tests/unit/storage/test_origin_usage_report.py
  • tests/unit/storage/test_provider_usage_event_evidence.py
  • tests/unit/storage/test_usage_projection.py
  • webui/DESIGN_SYSTEM.md

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T16:59:08.561890Z f1e911c New commits
🔒 Security Review ✅ Completed 2026-09-25T16:33:23.758979Z 1c8f2d3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c8f2d3ac9

ℹ️ 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".

Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2a2e57b1e

ℹ️ 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".

Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/live/append_ingest.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved
@Sinity
Sinity force-pushed the feat/reindex-source-integration branch from d2a2e57 to f1e911c Compare September 25, 2026 16:49
@Sinity
Sinity enabled auto-merge (squash) September 25, 2026 16:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1e911c9d1

ℹ️ 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".

Comment thread polylogue/sources/parsers/otel_genai.py Resolved
Comment thread polylogue/sources/parsers/otel_genai.py Resolved

_ = total_reasoning
return bool(total_input or total_output or total_cache_read or total_cache_write)
return any(value is not None for value in (total_input, total_output, total_cache_read, total_cache_write))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve unreported lanes in partial cumulative usage

When a token_count event reports only one cumulative lane—for example, a Hermes row with explicit input_tokens: 0 but no output counter while its assistant messages already carry measured output tokens—this predicate treats that partial report as a complete authoritative cumulative total. The aggregation below converts every absent lane to zero and overwrites session_model_usage, erasing the measured output tokens and their cost. Require a complete cumulative lane set or update only the lanes the provider actually reported.

Useful? React with 👍 / 👎.

@Sinity
Sinity merged commit 904b2f8 into master Sep 25, 2026
3 checks passed
@Sinity
Sinity deleted the feat/reindex-source-integration branch September 25, 2026 17:00
Sinity added a commit that referenced this pull request Sep 27, 2026
## Summary
Fixes four P1 review findings that were left unhandled on merged PRs and
still reproduce on master.

## Problem
A survey of merged PRs from the last six weeks found Codex review
threads with no reply or resolution. These four still produce a wrong
outcome at current master:
- An uppercase `first.ZIP` export falls back to directory scope, so
retained attachment maps can bind across sibling exports (#4853).
- A message-less Hermes compression continuation is dropped while a
later child still names it as parent, so the child's lineage edge can't
resolve (#5363).
- Claude project knowledge documents count as human-authored, inflating
authored-user words with third-party text (#4721).
- OTel GenAI token-bearing outputs carry no model, so their usage never
reaches the model rollup (#5530).

## Solution
- `retained_assembly.chatgpt_export_scope` finds the archive separator
case-insensitively and keeps the path's own spelling.
- `hermes_state.parse_state_db` keeps an empty session when a kept
session descends from it.
- `ai_parser.parse_project` marks documents as
`CONTEXT`/`RUNTIME_CONTEXT`. `UNKNOWN` isn't enough, because the
chat-export user channel upgrades unknown user messages to
human-authored.
- `otel_genai` sets `model_name` from the response or request model on
assistant outputs.

## Verification
- `devtools test tests/unit/sources/parsers/test_otel_genai.py
tests/unit/sources/test_assembly_chatgpt.py
tests/unit/sources/test_parsers_claude_ai_catalog.py
tests/unit/sources/test_parsers_local_agent.py` → 121 passed, 2 failed
on the first run. Both failures were in the new or updated tests, and
both are fixed. Re-running the two affected files gave 74 passed.
- `devtools verify --quick` → PASSED.
- `devtools schema closure`: all four production files are IN, so this
moves the derived schema identity and must land before the fresh
rebuild.

## Residuals
The remaining unhandled findings are filed as area-grouped bug beads to
verify and fix, not fixed here.

🤖 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]>
Sinity added a commit that referenced this pull request Sep 28, 2026
## Summary

Ports the still-relevant tests from the orphaned custody branch
`wip/reindex-readiness-only-20260927` (bead polylogue-gtqzv). Each test
was adapted to run against master's current production route. Porting
the MCP judge test exposed one defect, fixed here: a daemon-required
refusal reached MCP clients under the generic `polylogue_error` code.

## Problem

- Master's OTel GenAI parser (#5530, #5537, #5654) has no tests for live
acquisition from a configured root, replay-stable identity, duplicate
and conflicting span copies, one span id reused across traces, trace-id
fallback, explicit-empty attributes over compatibility events, late
parents, schema-url status, or redacted/truncated/missing fidelity.
- The MCP declaration inventory had no test that makes a new privileged
capability fail until someone reviews it.
- The MCP `judge` route now writes through the daemon. Without a running
daemon it raises `FacadeDaemonRequiredError`, whose code is
`daemon_required`, but `mcp_error_payload` reported it as
`polylogue_error`.

## Solution

- `tests/unit/sources/parsers/test_otel_genai_contract.py`: the nine
branch contracts. All pass against master's parser as written. The only
changes are fixture typing.
- `tests/unit/mcp/test_mcp_writer_boundary.py`: the capability inventory
test, plus a judge test on the current route. The real MCP `judge`
handler must refuse with `daemon_required` and leave `user.db`
byte-identical, with the candidate still unjudged.
- `polylogue/mcp/server_support.py`: maps `FacadeDaemonRequiredError` to
its own code.

Dropped as obsolete, with a reason recorded on the bead:
- The requested-fields tests.
`test_query_units_selects_message_fields_without_materializing_full_rows`
already covers the same route through the facade.
- The SLO failed-benchmark test. Master's
`test_failed_benchmark_with_valid_json_is_not_scored_and_keeps_diagnostics`
covers it.
- The Claude artifact observation at raw admission.
`archive/artifact_taxonomy/runtime.py` classifies these now.

## Verification

- `devtools test tests/unit/sources/parsers/test_otel_genai_contract.py
tests/unit/sources/parsers/test_otel_genai.py
tests/unit/mcp/test_mcp_writer_boundary.py
tests/unit/mcp/test_tool_error_isolation.py`: `PASSED exit=0`
- `devtools gate layering`: passed. mypy passes on the changed files.

🤖 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]>
Sinity added a commit that referenced this pull request Sep 29, 2026
)

## Summary

Lands the verified part of ChatGPT worker 9's pass over Codex review
findings in `polylogue/sources` (beads polylogue-1tyq5.90, .91, .92; 75
findings). 13 fixes are kept, each with a regression test that fails on
master. The other 62 are recorded below as fixed-already, stale, refuted
or not reached.

## Problem

The findings are Codex P2 review threads on earlier PRs. The kept ones
reproduce on current master:

- ChatGPT extracted-export asset acquisition follows leaf symlinks, so
it archives bytes from outside the export.
- Replay's bounded probe drops the Claude project keys, so a retained
UNKNOWN project whose keys sit past the 8 KiB prefix stays UNKNOWN and
is refused.
- Drive-like lowering drops `source_path` when it reclassifies a Gemini
CLI document, so a matching sidecar is skipped.
- The Drive cache rejects valid `null` JSONL records and large integers,
and leaks its temporary file when a write or close fails.
- Import preflight reports SUPPORTED even when it records a degradation
caveat.
- A lost best-effort `cursor_update` leaves a completed attempt with
`materialized_count=0`.
- Source-only (acquire-only) intake still requires the Antigravity
language server before it keeps `.pb` bytes.
- The JSONL blank-line regex matches every newline-terminated payload,
so the `bytes.count` fast path never runs.
- The ops checkpoint holder looks for `-shm` beside a symlinked `ops.db`
rather than beside its target.
- A sealed, complete cold-build count loses its zero ETA once it stops
advancing.
- Hook paste enrichment checks the write lease against the
index-generation directory instead of the archive root.

## Solution

- `sources/assembly_chatgpt.py`: the walk admits only lstat-regular
files. Each asset is opened with `O_NOFOLLOW|O_NONBLOCK`, checked with
fstat, then streamed with `write_from_fileobj`. Asset refusals are
emitted as one structured event, `sources.chatgpt.asset_refused`.
- `sources/revision_backfill.py`: `docs`, `prompt_template` and
`is_starter_project` added to the probe's retained root keys.
- `sources/dispatch.py`: `_lower_drive_like_payload` forwards
`source_path` through both recursive branches and the Gemini CLI spec.
- `sources/drive/__init__.py`: a successful decode is enough to validate
a cache, and ijson runs in its lossless number mode. One cleanup path
covers temporary creation, write, close and replace.
- `sources/import_preflight.py`: any caveat now reports DEGRADED, which
is still admissible. The bounded-trajectory test expectation changes to
match.
- `sources/live/batch.py`: the completed progress update carries
`materialized_count`. Source-only intake skips the language-server
cohort, so `.pb` files take the ordinary raw snapshot.
- `sources/live/batch_support.py`: the regex no longer treats the empty
line after a final newline as blank.
- `sources/live/cold_build.py`: the holder resolves `ops.db` before
deriving `-shm`. A sealed count at or above its denominator returns ETA
0.
- `sources/live/hook_paste_enrichment.py`: the lease check uses the
configured archive root.

Worker changes not landed:

- `census_parse_stage.py` idle-wait fix: the module has no production
instance and polylogue-rykzt retires it. The live `LiveParseStage` has
no such event pair.
- `parse_prefetch.py` cohort scoping: already on master through #5691
(`_prepare_existing_session_writes(paths=...)`).
- Source-only ZIP provider stamp (92-01): it does not fix the reported
case. The OTel GenAI spec declares a catch-all `.*\.json$` rule, so
`declared_artifact_provider` returns None for every `.json` member,
`tool-results/dump.json` included.
- The worker's `docs(review)` commit: per-finding records belong in this
body, not in tracked files.

## Verification

- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/salvage-w9 --wait` → job 2346: `verify: PASSED exit=0
... head=edfab65f2749`
- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/salvage-w9 --wait --
tests/unit/sources/test_codex_debt_w9_regressions.py
tests/unit/sources/test_import_preflight.py
tests/unit/sources/test_drive_source_client.py
tests/unit/sources/test_live_batch_support.py
tests/unit/sources/test_cold_build_generation.py
tests/unit/sources/test_cold_build_durability_policy.py
tests/unit/sources/test_revision_backfill.py
tests/unit/sources/test_dispatch_payloads.py` → job 2347: `passed 470,
failed 1, total 471` at head edfab65. The one failure,
`test_import_preflight.py::test_unidentified_trajectory_rows_keep_distinct_identities`
(a `LogicalExportError` from `parse_trajectory_db`), fails the same way
on unmodified master (jobs 2284 and 2348).
- Proof that the tests fail without the fixes: the final
`test_codex_debt_w9_regressions.py` was copied into a worktree at
unmodified master and run as job 2348, with 17 failures (`17 failed in
21.74s`). That covers every kept finding's test. The 92-13 ETA test
fails only on its complete-count case; its two control cases pass on
both heads, as intended.

## Self-review

- **Sibling sites.** The other asset reader is the ZIP branch, which
reads members, not filesystem paths. `_lower_drive_like_payload` has one
caller and `_enrich_archive_paste_from_hooks` has one. The
cache-validator change covers both Drive routes (byte and streamed).
Other `-shm`/`-wal` derivations elsewhere in the daemon are outside this
finding and are listed as a residual. The 92-01 gap is shared by the
ordinary live ZIP route and `retained_acquisition.py`, which is why the
one-route stamp was dropped rather than landed.
- **Cancellation and shutdown in loops.** No loop or wait was added. The
asset loop keeps its per-file `continue` on `OSError`.
- **Unbounded reads.** Assets still stream through `write_from_fileobj`
under the existing `MAX_UNCOMPRESSED_SIZE` check. The Drive validators
keep their streaming form.
- **Fail-open fallbacks and compatibility shims.** None added.
Source-only `.pb` intake retains raw bytes without parsing, and parsing
still needs the language server once derived tiers return. There is no
alias or dual path.
- **Removed symbols.** None removed. Tests patch `local_agent`,
`tempfile` and `time` directly rather than through attributes the source
modules do not export.
- **Tests prove the production route.** The tests drive `parse_payload`,
`iter_drive_raw_data`, `preflight_import_source`,
`LiveBatchProcessor.ingest_files` / `_ingest_full_paths_sync`,
`jsonl_complete_prefix`, `_hold_ops_checkpoints`,
`enrich_paste_from_hooks` and the retained-UNKNOWN detector
`_detect_unknown_retained_provider`, which is the same private entry
point `test_revision_backfill.py` already uses. The ETA test calls the
`accepted_progress` property on a hand-set generation.

## Per-finding dispositions

Counts: 13 fixed, 0 dropped as not real, 22 fixed-already, 3 stale, 2
refuted, 35 not reached.
Per bead: .90 6 fixed / 6 fixed-already / 2 stale / 1 refuted / 10 not
reached. .91 3 / 5 / 1 / 1 / 15. .92 4 / 11 / 0 / 0 / 10.

| key | disposition | evidence | test |
|---|---|---|---|
| 90-01 (#4803) | fixed | `sources/assembly_chatgpt.py`: Regular-file
lstat admission and no-follow/nonblocking opened-file validation prevent
leaf-symlink and FIFO substitution from being acqu... |
`test_w9_asset_acquisition_rejects_symlink_leaves` |
| 90-02 (#4234) | stale | dead `census_parse_stage.py`, retired by
polylogue-rykzt; live `LiveParseStage` has no such event pair | — |
| 90-03 (#4928) | refuted | `sources/codex_state_evidence.py`: The
requested reconciliation depends on upgrading an earlier archive. This
batch explicitly targets fresh v1 and forbids migrations/... | — |
| 90-04 (#4889) | not reached | `sources/codex_state_evidence.py`:
Same-ID admission still needs an acquisition-state preservation proof;
leave replay/storage reconciliation to follow-up. | — |
| 90-05 (#4229) | stale | `sources/codex_state_evidence.py`:
event_identity and its hook-event emission are gone; Codex thread state
is now projected through codex_state_projection instead. | — |
| 90-06 (#5626) | not reached | `sources/codex_state_evidence.py`: State
snapshot chunks are processed within the same writer ownership; no
bounded writer-handoff implementation supplied. | — |
| 90-07 (#4622) | not reached | `sources/codex_state_evidence.py`:
Backlog is fetched as a whole and consumed in one retained-receipt pass;
replacing this needs end-to-end paging, not a cap. | — |
| 90-08 (#5626) | not reached | `sources/codex_state_evidence.py`:
Replaying a shorter logical state value does not reconcile removed
trailing chunk observations. | — |
| 90-09 (#5581) | not reached | `sources/codex_state_evidence.py`: The
frame consumer still needs explicit cancelled/expired-read propagation
instead of interpreting an empty projection as current. | — |
| 90-10 (#4174) | not reached | `sources/cursor.py`: ZIP skip accounting
counts every physical member, unlike the declaration-aware acquisition
population. | — |
| 90-11 (#4661) | fixed-already | `sources/decoder_zip.py`: Explicit
suffix/predicate callers disable inferred declaration-path widening. | —
|
| 90-12 (#4661) | fixed-already | `sources/decoder_zip.py`: Only strong
artifact declarations widen the inferred member admission route. | — |
| 90-13 (#4661) | fixed-already | `sources/decoder_zip.py`:
Unknown-inbox admission now uses cross-provider strong declarations;
ordinary live ZIP acquisition retains their sidecars. | — |
| 90-14 (#4661) | fixed-already | `sources/decoder_zip.py`: Source-only
ZIP admission supplies is_declared_artifact_path, so declared non-JSON
sidecars are retained. Provider stamping is a separate fin... | — |
| 90-15 (#4721) | fixed | `sources/dispatch.py`: The bounded streaming
document probe retains the three Claude project shape keys, without
retaining their unbounded values. |
`test_w9_retained_unknown_project_is_detected_beyond_prefix` |
| 90-16 (#4720) | fixed | `sources/dispatch.py`: Drive lowering forwards
source_path through recursive wrappers and the Gemini CLI document
specification; all internal callers updated. |
`test_w9_drive_lowering_preserves_gemini_source_path` |
| 90-17 (#4184) | not reached | `sources/dispatch.py`: Current master
adds chatgpt_rejected_mapping_candidates; consumer-to-durable-accounting
trace remains incomplete, so no resolution claimed. | — |
| 90-18 (#4652) | fixed-already | `sources/dispatch.py`:
lower_chatgpt_documents now lowers shared decode records inside specs as
well as the direct top-level case. | — |
| 90-19 (#4188) | not reached | `sources/dispatch.py`: Codex-task
conservation exclusion still needs population-level treatment, not
simply returning an empty document list. | — |
| 90-20 (#5584) | fixed-already | `sources/dispatch.py`: The production
streamed generic caller normalizes ijson numbers before
parse_generic_messages_stream; no additional dispatcher normalization is
... | — |
| 90-21 (#4654) | not reached | `sources/dispatch.py`: Shared-decode
conservation and parser identity precedence require a joint
production-route fix. | — |
| 90-22 (#4188) | not reached | `sources/dispatch.py`: DOM capture
fallback IDs still require the same normalization as the production
parser; old supported input is not automatically exempted by the... | —
|
| 90-23 (#4174) | fixed | `sources/drive/__init__.py`: Both
cache-reading and streamed revision-proof routes accept syntactically
valid null JSONL records. | `test_w9_drive_cache_accepts_null_jsonl` |
| 90-24 (#4174) | fixed | `sources/drive/__init__.py`: The finally
cleanup covers tempfile write and close failures as well as rename
failure, preserving the previous destination. |
`test_w9_drive_failed_cache_publication_removes_temporary` |
| 90-25 (#5421) | fixed | `sources/drive/__init__.py`: Lossless ijson
number parsing prevents repeated downloads of Python-JSON-readable large
integers. |
`test_w9_drive_unchanged_large_integer_cache_does_not_download` |
| 91-01 (#5447) | not reached | `sources/hook_producer.py`:
Alternate-producer/compaction quiescence needs a complete
writer-protocol trace; no fix or dismissal claimed. | — |
| 91-02 (#4269) | not reached | `sources/hooks.py`: Legacy-root source
identifiers remain positional; no interface replacement/consumer update
supplied. | — |
| 91-03 (#4932) | fixed | `sources/import_preflight.py`: Supported
inputs with degradation caveats report DEGRADED. The existing
bounded-trajectory test expectation is updated to the same hones... |
`test_w9_trajectory_preflight_reports_degraded_steps` |
| 91-04 (#4275) | stale | `sources/live/admission.py`: The unreachable
terminal branch cited by the review has been removed; current policy
reacquires non-accepted receipts. | — |
| 91-05 (#5263) | not reached | `sources/live/append_ingest.py`:
Asserted hook-carrier baseline versus byte-proven resynthesis needs a
coordinated authority-proof change. | — |
| 91-06 (#5530) | not reached | `sources/live/append_ingest.py`: Success
artifact observation still precedes single-session/chain-authority
acceptance. | — |
| 91-07 (#4683) | not reached | `sources/live/batch.py`: Offered/default
queued population is computed after blocking filters. | — |
| 91-08 (#5403) | not reached | `sources/live/batch.py`: Re-resolving
historical blocked spellings can implicate a retargeted symlink
destination; needs durable-identity handling. | — |
| 91-09 (#4587) | not reached | `sources/live/batch.py`: Direct deferred
resynthesis is preserved, but deferred flush still re-reads an absent
ops cursor; full deferred-plan regression not supplied. | — |
| 91-10 (#5015) | not reached | `sources/live/batch.py`: Deferred
catch-up convergence still needs its own canonical receipt or duration
attribution to the originating attempt. | — |
| 91-11 (#4809) | fixed-already | `sources/live/batch.py`: ingest_files
catches escaped failures and finalizes the attempt, including
writer-hold budget failures. | — |
| 91-12 (#4713) | not reached | `sources/live/batch.py`: Current byte
accounting labels unattempted bytes, but that does not establish a
per-file deferred/excluded disposition for an outer-loop time-... | — |
| 91-13 (#4730) | not reached | `sources/live/batch.py`: A structural
halt still marks subsequent unattempted source groups as failed rather
than refused/unattempted. | — |
| 91-14 (#4874) | not reached | `sources/live/batch.py`: Materialized
sessions versus successfully parsed file units still needs all
reader/telemetry consumers reviewed together. | — |
| 91-15 (#4874) | fixed | `sources/live/batch.py`: The completed
progress event repeats the already-computed unique materialized-session
count after best-effort cursor_update loss. |
`test_w9_completed_ingest_repeats_materialized_count` |
| 91-16 (#5300) | not reached | `sources/live/batch.py`: Live metrics
now expose deferred_file_count, but typed catch-up receipt/CLI
propagation is not fully established here. | — |
| 91-17 (#4330) | fixed | `sources/live/batch.py`: Source-only
acquisition bypasses Antigravity language-server protobuf conversion and
retains original bytes. |
`test_w9_source_only_protobuf_does_not_invoke_converter` |
| 91-18 (#5526) | refuted | `sources/live/batch.py`: This asks to
migrate debts stored under predecessor subjects. Prior archive state is
explicitly out of scope for fresh v1; current code emits ... | — |
| 91-19 (#4175) | fixed-already | `sources/live/batch.py`: Full
file-backed JSONL acquisition computes and carries complete_prefix_size
rather than requiring an in-memory raw payload. | — |
| 91-20 (#4229) | fixed-already | `sources/live/batch.py`: Boundary
determination now checks the tail; an interior malformed line does not
truncate the cursor before later accepted records. | — |
| 91-21 (#4883) | not reached | `sources/live/batch.py`: Snapshot scope
selection for a renamed Antigravity SQLite store needs further current
policy tracing; no fix or refutation claimed. | — |
| 91-22 (#5263) | not reached | `sources/live/batch.py`: Full
hook-carrier raw bytes/frontier authority with a partial tail still
needs coordinated baseline treatment. | — |
| 91-23 (#4661) | fixed-already | `sources/live/batch.py`: ZIP safety
admission now precedes provider sniffing on the ordinary live route. | —
|
| 91-24 (#4661) | fixed-already | `sources/live/batch.py`:
Declaration-owned sidecars are excluded from ordinary ZIP provider
sniffing. | — |
| 91-25 (#4661) | not reached | `sources/live/batch.py`: --explain still
sniffs the whole infolist and retains provider_hint when constructing
member classification; route equivalence remains open. | — |
| 92-01 (#4661) | not reached | worker fix dropped: OTel `.*\.json$`
rule makes `declared_artifact_provider` ambiguous for every `.json`
member | — |
| 92-02 (#4549) | fixed-already | `sources/live/batch.py`: Legacy
promotion is now a deferred thunk, not an eager write during initial
reconstruction. No legacy upgrade code added. | — |
| 92-03 (#4587) | not reached | `sources/live/batch.py`: Full-head
reconstruction still requires the old full-file digest before composing
a mutable-header Claude semantic frontier. | — |
| 92-04 (#5568) | not reached | `sources/live/batch.py`: Equal-metadata
measurement-only update handling needs an accepted-change regression; no
new fix supplied. | — |
| 92-05 (#4587) | not reached | worker refutation rejected: promotion
thunk is live; no proof v1 never writes frontier-less appends | — |
| 92-06 (#4660) | fixed-already | `sources/live/batch.py`: Cursor
publication compares the post-proof file observation with the pre-proof
observation. | — |
| 92-07 (#4660) | fixed-already | `sources/live/batch.py`: Non-frontier
prefix hashing charges cursor hash-read bytes. | — |
| 92-08 (#4660) | fixed-already | `sources/live/batch.py`: Publication
rebases the accepted body end against the current Claude header length.
| — |
| 92-09 (#4662) | fixed-already | `sources/live/batch.py`: The rebased
publication_end is used for the cursor offset and corresponding
file-length guard. | — |
| 92-10 (#4662) | fixed-already | `sources/live/batch.py`: Claude
frontier read bytes are charged before rejecting an unavailable/invalid
proof. | — |
| 92-11 (#5258) | fixed | `sources/live/batch_support.py`: The regex no
longer treats the virtual empty EOF after a delimiter as a physical
blank line; actual blank lines retain their existing ... |
`test_w9_jsonl_boundary_keeps_newline_fast_path` |
| 92-12 (#5389) | fixed | `sources/live/cold_build.py`:
Checkpoint-holder attachment checks the SHM file beside the resolved
physical SQLite filename. |
`test_w9_ops_holder_accepts_symlinked_database` |
| 92-13 (#5609) | fixed | `sources/live/cold_build.py`: A valid sealed
complete count reports zero ETA after the advancement freshness window;
incomplete and unsealed stale counts still report ... |
`test_w9_completed_cold_build_eta_does_not_expire` |
| 92-14 (#5609) | not reached | `sources/live/cold_build.py`: Projection
refresh time, not receipt acceptance time, still renews the advancement
clock. | — |
| 92-15 (#5619) | fixed-already | `sources/live/cold_build.py`:
refresh_faulted_baseline calls _reset_accepted_progress(merged), then
refresh_accepted_progress; the denominator and weights no longer re... |
— |
| 92-16 (#4185) | not reached | `sources/live/cursor.py`:
Completed-with-failures reader/metric label propagation needs all public
consumers updated together. | — |
| 92-17 (#4730) | not reached | `sources/live/dedup.py`: Structural
failure installs a per-source halt; the test autouse fixture only clears
the global degraded flag. | — |
| 92-18 (#4795) | fixed | `sources/live/hook_paste_enrichment.py`: The
enrichment route carries the configured archive root into its
write-lease check instead of treating a generation index dir... |
`test_w9_hook_paste_uses_archive_lease_for_generation_index` |
| 92-19 (#4713) | fixed-already | `sources/live/metrics.py`:
LiveBatchMetrics.to_payload serializes both excluded_file_count and
excluded_reasons. | — |
| 92-20 (#5546) | not reached | `sources/live/parse_prefetch.py`:
Attempt cleanup exists, but retention of every unconsumed
candidate/shard across warm cohorts is not fully resolved here. | — |
| 92-21 (#5546) | not reached | `sources/live/parse_prefetch.py`:
Hashless worker errors remain reusable across changed source content;
freshness/deferred disposition needs a full route fix. | — |
| 92-22 (#5568) | fixed-already | #5691:
`_prepare_existing_session_writes(paths=...)` scoped to current
candidates | — |
| 92-23 (#5634) | not reached | `sources/live/parse_prefetch.py`:
Per-path reconciliation opens concurrent read frames without
establishing independent scan admission in this function. | — |
| 92-24 (#5542) | fixed-already | `sources/live/production_baseline.py`:
Baseline.verify delegates to
unretained_source_decisions/open_readonly_connection; the manually
interpolated SQLite URI is gone. | — |
| 92-25 (#5640) | fixed-already | `sources/live/production_baseline.py`:
Baseline emits its hashing phase before archive-member expansion and
decomposition. | — |

## Derived-identity closure

These changed files are members of
`docs/plans/schema-closure-baseline.json`, so the derived schema
identity moves: `sources/assembly_chatgpt.py`, `sources/dispatch.py`,
`sources/drive/__init__.py`, `sources/live/batch.py`,
`sources/live/batch_support.py`, `sources/live/cold_build.py`,
`sources/live/hook_paste_enrichment.py`, `sources/revision_backfill.py`.
`sources/import_preflight.py` is not a member. Membership was read from
the committed baseline, not recomputed, because the bulk pool that runs
`devtools schema closure` jobs was paused. No module was added to the
closure.

## Residuals

- 92-01 stays open: declaration lookup needs to prefer a unique
raw-only/fact rule over broad session patterns, applied on all three ZIP
routes.
- 92-05: the worker's fresh-v1 refutation was rejected, because the
legacy-append promotion thunk is live code and `ops.db` is disposable.
The finding stays open.
- Other `-shm`/`-wal` path derivations (`daemon/status.py`,
`daemon/health.py`, `daemon/backup.py`, among others) do not resolve
symlinks and were not reviewed here.
- Preflight now reports DEGRADED for a bounded trajectory probe or a
truncated directory walk, not only for parser flags.
- `test_unidentified_trajectory_rows_keep_distinct_identities` already
fails on master.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 29, 2026
…#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]>
Sinity added a commit that referenced this pull request Sep 29, 2026
…#5809)

## Summary

Realigns three tests in
`tests/unit/storage/test_lineage_normalization.py` that fail on master
(polylogue-ezvw3). Each one encodes a contract that a named PR changed
deliberately. No production code changes.

## Problem

At master 1beb2e5 (AgentCTL job 2441), these fail:

-
`test_prefix_sharing_child_provider_usage_keeps_its_own_reported_totals`
(line 352). The child's `total_tokens`-only event (272 000) stores NULL
input, cached and output totals, but the test expects 0. #5530
(904b2f8) replaced `_payload_int` with `_payload_optional_int` in
`_provider_usage_event_row`, so an unreported lane now stays NULL.
- `test_child_before_parent_reextracts_provider_usage_tail` (line 1730).
The child rollup reads 0 instead of 130. The test put an all-zero
cumulative tick after the child's 160/30/25 cumulative. #5530 also
changed `_provider_usage_row_has_lane_totals` from "any non-zero" to
"any present", and added
`test_explicit_zero_cumulative_supersedes_prior_positive`. An explicit
zero cumulative is now a measurement, and the latest one wins.
- `test_late_parent_resolution_invalidates_child_derived_products` (line
873). The child is non-valid right after the test seeds a fresh profile.
#5525 (ca25740) added trigger-captured `session_profile_demand`, and
`_classify_partition_with_demand` reports a demanded session as stale
until publication consumes the demand. The test's seed never consumed
it.

None of the suspects named on the bead (#5803, #5792, #5764, #5691) is
the cause. #5803's PR body already lists these three as pre-existing
failures.

## Solution

- Prefix-sharing test: the `total_tokens`-only row now expects NULL
input, cached and output totals. The docstring cites #5530. The rollup
assertion (130/25/30) is unchanged, which proves the NULL row does not
displace the latest lane totals.
- Child-before-parent test: the same measured-zero tick, unchanged, now
comes before the child's latest cumulative. The rollup stays exactly
130/25/30 before and after the parent arrives. The re-extraction
assertion keeps both `cy` rows, including the tick's `request_id`, in
their new order. A stale comment about the evidence predicate is
corrected.
- Late-parent test: `_seed_fresh_session_products` deletes the session's
`session_profile_demand` row, as
`publish_prepared_session_insight_partition` does. The docstring now
says the retained-row assertion carries the anti-vacuity, because
re-captured demand alone would also mark the child stale.

Schema classification: none. No production file changes, so nothing
enters the derived-identity closure.

## Verification

- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/polylogue-mh-lineage --
tests/unit/storage/test_lineage_normalization.py` → job 2573: `devtools
test: PASSED exit=0` (`105 passed` of 105, head 2d1d0a4).
- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/polylogue-mh-lineage` → job 2584: `verify: PASSED
exit=0` (head 2d1d0a4).

## Self-review

- **Contract, not bug.** For each failure I found the commit that
changed the behavior and checked that it was intended. #5530's summary
says "distinguish absent usage from explicit zero", and it added a test
asserting that a zero cumulative supersedes a prior positive one. #5525
added the demand table, its triggers and the demand-aware classifier on
purpose. No assertion was loosened. Every expected value is still exact.
- **Anti-vacuity.** Test 1 would fail if re-extraction kept the `c1`
row, dropped a `cy` row, or rebased the child against the parent. Test
2's NULL expectation fails if absent lanes are coerced to 0 again. Test
3's retained-row assertion fails if `_reextract_prefix_tail_db` stops
deleting profiles.
- **Siblings.** `_seed_fresh_session_products` has one caller. No other
test in this file seeds profiles or reads partition status.
- **Public boundary.** Test-only diff with synthetic fixtures.

## Residuals

- Under #5530, a zero cumulative that follows a positive one within a
session sets the rollup to 0. That is the declared contract. Whether a
real provider emits such a reset, and whether billing should then take
the maximum, is a product question this PR does not reopen.

polylogue-ezvw3

🤖 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]>
Sinity added a commit that referenced this pull request Sep 29, 2026
## Summary

Lands the verified part of ChatGPT worker 11's pass over Codex review
findings in `polylogue/sources` (parts 7-8) and `polylogue/schemas`
(beads polylogue-1tyq5.96, .97, .86, .87; 71 findings). 22 fixes are
kept, each with a regression test that fails on master. The other 49 are
recorded below as fixed-already, stale or not reached.

## Problem

The kept findings reproduce on current master:

- OTel GenAI: a structured, numeric or boolean `gen_ai.tool.call.result`
becomes an empty result block, and span fields outside the projected set
(end time, links, trace state, flags, dropped counts) are missing from
`otel_span_evidence`.
- Revision backfill: the frozen-shard lookup hand-formats
`origin:native_id` without the identity helper's strip, so a padded
native id raises `ShardRefusedError`. The owned-generation emptiness
probe validates the final index layout, so a generation with deferred
secondary indexes reports schema skew instead of the nonempty-generation
refusal.
- Source cut: staging can be created inside a bound source root. Two
SQLite ids sharing a stem (`state.first`, `state.second`) both map to
`state.jsonl`. Any sibling directory with the request prefix is deleted
as orphaned staging. Archive-member items are checked against the whole
ZIP's size and digest, so every intact archive cut is reported as
mutated.
- Source census: a directly configured file counts as zero candidates,
symlinks and FIFOs drop out of the denominator, `inspection_bytes`
claims read I/O it never measured, and an lstat fault silently drops a
candidate from the production walk.
- Schemas: the audit's package exemption misses provider aliases (`XAI`,
`GROK`). A content-bearing property name beside an existing dynamic map
is kept as a literal property, and the annotation audit skips named
fields retained beside a collapsed map. `SchemaCommitPrivacyError` and
`SchemaArchiveEvidenceError` escape the devtools `ValueError` boundaries
as tracebacks. The module schema CLI resolves the archive from the
generation directory. Relation annotations are cached by object id, so
an in-place edit is ignored. The drift walk drops an allOf base's union
branch, loses the dynamic-keys marker across unannotated conjuncts, and
discards `$ref` sibling declarations.

## Solution

- `sources/parsers/otel_genai.py`: a non-string result is serialized as
sorted JSON (absent stays absent); evidence carries
`unprojected_span_fields`.
- `sources/revision_backfill.py`: the lookup uses
`identity_law.session_id`; the probe opens with
`validate_index_layout=False`.
- `sources/source_snapshot.py`: `execute_source_cut` refuses a
destination overlapping a bound directory root (resolved paths). The
SQLite export name appends `.jsonl`. Staging carries an owner marker
naming the request; reclamation deletes only marked, non-symlink
directories, and the marker is removed before publication.
`reacquire_candidate` hashes each archive member by name from the copied
ZIP, opening each ZIP once.
- `sources/source_walk.py`: the census resolves file-or-directory like
`_resolve_source_paths`, takes supported-name entries before the
regular-file filter, records walk errors, and reports `candidate_bytes`
(renamed and documented as entry size). `_walk_source_paths` keeps a
supported-name candidate whose lstat fails, so the per-file read records
the failure on the cursor instead of the scan reporting it as absent;
unsupported names are filtered before any lstat.
- `schemas/audit/workflow.py`: canonicalizes the provider before the
subject lookup. `schemas/audit/checks.py`: counts named fields beside a
collapsed map.
- `schemas/generation/dynamic_keys.py`: beside an existing map only
individually dynamic names fold into it.
- `schemas/operator/commit.py`, `schemas/sampling_db.py`: both refusal
types derive from `ValueError`.
- `schemas/operator/schema_inference.py`: passes the configured
`ArchiveLocation`.
- `schemas/synthetic/relation_solver_runtime.py`: the cache key is a
SHA-256 of the canonical JSON, parsed from that snapshot.
- `schemas/validator.py`: the allOf base selects its union branch first,
a dynamic-keys marker on any conjunct survives the merge, and `$ref`
siblings join the resolved node.

Worker changes not landed:

- 96.02 (OTel parent edges): master now declares OTel `message_parent`
as a derived topology capability in `_otel_genai_spec`, the finding's
second option, so removing the parent mapping would contradict the
declared contract. Recorded as fixed-already.
- The worker's lstat fix propagated the error out of
`_walk_source_paths`, so one vanished or unreadable entry (even an
unsupported temp file) aborted the whole source scan. Replaced by
keeping the candidate for the per-file failure route.
- The worker's `reacquire_candidate` refused duplicate ZIP member names,
which the cut itself publishes; it now reads by name as the cut does.

## Verification

- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/salvage-w11` → job 2600 at head 152a132: `verify:
PASSED exit=0`.
- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/salvage-w11 -- <24 test files>` → job 2602 at head
152a132: `805 passed, 3 failed`. The 3 failures
(`test_common_live_batch_retries_a_failed_vendor_conversion`,
`test_dynamic_key_maps_do_not_emit_drift_warnings`,
`test_antigravity_brain_metadata_sidecar_is_rejected_from_live_and_schema_routes`)
fail the same way on unmodified master (job 2551). The earlier head
649039f gave `807 passed, 3 failed` (job 2550); 152a132 merges
#5798, #5779 and #5704, which overlap this diff only in `source_walk.py`
(#5798's directory-link cycle guard, compatible with the lstat change),
`revision_backfill.py` and `commit.py` (disjoint hunks).
- Proof that the tests fail without the fixes: the branch's test files
copied onto unmodified master 1beb2e5 and run with the same selection
as job 2551: `29 failed, 781 passed`: all 26 new or changed regression
cases for the kept findings plus the 3 master failures above. The two
control parameters (`padded_native_id=False`, `deferred_indexes=False`)
pass on both heads, as intended.

Selection: `tests/unit/core/test_synthetic_relations.py
tests/unit/devtools/test_schema_commit_command.py
tests/unit/devtools/test_schema_lab_commands.py
tests/unit/schemas/test_audit_declared_packages.py
tests/unit/schemas/test_drift_walk_resolution.py
tests/unit/schemas/test_promotion_monotonicity.py
tests/unit/sources/parsers/test_otel_genai.py
tests/unit/sources/parsers/test_otel_genai_contract.py
tests/unit/sources/test_origin_specs.py
tests/unit/sources/test_revision_backfill.py
tests/unit/sources/test_source_snapshot.py
tests/unit/core/test_schema_validation.py tests/unit/core/test_audit.py
tests/unit/core/test_schema_laws.py
tests/unit/schemas/test_historical_payload_resolution.py
tests/unit/schemas/test_source_structure_witnesses.py
tests/unit/sources/test_agent_memory_documents.py
tests/unit/sources/test_antigravity_source_acquisition.py
tests/unit/sources/test_artifact_taxonomy.py
tests/unit/sources/test_source_laws.py
tests/unit/sources/test_source_root_admission.py
tests/unit/daemon/test_antigravity_conversation_acquisition.py
tests/unit/pipeline/test_resilience.py
tests/unit/pipeline/test_ingest_outcomes.py`

## Self-review

- **Sibling sites.** `with_suffix` on a source id occurs once in
`source_snapshot.py`; the other export branch already appends. Staging
reclamation has one caller. The session-id format in
`_required_shard_prepared_rows` was the only hand-built
`origin:native_id` on the shard path. Both devtools schema boundaries
catch `ValueError`, so rebasing the two refusal types covers `schema
commit`, `schema generate` and every other caller; no intermediate
`except ValueError` on the sampling or commit path swallows them (the
drift check catches `Exception` and reports WARNING, unchanged).
`SourceInferenceError` and `SchemaFrontierError` are other
`RuntimeError` refusals; they belong to not-reached findings and are
left as residuals.
- **Cancellation and shutdown in loops.** No new loop waits or sleeps.
`reacquire_candidate` holds its ZIP handles in an `ExitStack`, so an
exception closes them.
- **Unbounded reads.** Member verification streams in 1 MiB chunks
rather than `archive.read`. The relation cache serializes the annotation
list it already held in memory.
- **Fail-open fallbacks and compatibility shims.** None added.
`inspection_bytes` is renamed, not aliased; it had no production reader.
A crashed staging directory without a marker is kept rather than deleted
(fail closed). The overlap guard refuses rather than relocating staging.
- **Removed symbols.** `SourceRootCensus.inspection_bytes` is gone; its
only reader was a test, updated here. No monkeypatch target was removed.
- **Tests prove the production route.** The tests drive `parse_payload`,
`backfill_historical_revision_evidence`,
`execute_source_cut`/`reacquire_candidate`, `census_source_root`,
`_resolve_source_paths`, `audit_provider`,
`merge_observed_structure_schemas`/`check_annotation_coverage`, the
`schema_commit`/`schema_generate`/`schema_inference` entry points,
`_RelationConstraintSolver` and `SchemaValidator.validate`.
`census_source_root`, `reacquire_candidate` and `cut_source_inputs` have
no production caller yet (unfinished code, not obsolete); the tests
exercise them directly.

## Derived-identity closure

These changed files are in `docs/plans/schema-closure-baseline.json`, so
the derived identity moves and this must land before the fresh rebuild:
`polylogue/schemas/generation/dynamic_keys.py`,
`polylogue/schemas/sampling_db.py`, `polylogue/schemas/validator.py`,
`polylogue/sources/parsers/otel_genai.py`,
`polylogue/sources/revision_backfill.py`,
`polylogue/sources/source_snapshot.py`,
`polylogue/sources/source_walk.py`. The OTel result-block text and
evidence payload are hashed parser output, so OTel sessions re-derive.

## Per-finding dispositions

Counts: 22 fixed, 0 dropped as not real, 21 fixed-already, 2 stale, 0
refuted, 26 not reached.
Per bead: .96 4 fixed / 7 fixed-already / 1 stale / 13 not reached. .97
8 / 0 / 1 / 4. .86 7 / 12 / 0 / 6. .87 3 / 2 / 0 / 3.

| key | disposition | evidence | test |
|---|---|---|---|
| 96.01 #4724 `polylogue/sources/parsers/local_agent.py:236` |
fixed-already | polylogue/sources/parsers/local_agent.py:564-565
(displayContent is extracted before the empty-message guard.) | - |
| 96.02 #5530 `polylogue/sources/parsers/otel_genai.py:250` |
fixed-already | worker fix rejected: `_otel_genai_spec` in
polylogue/sources/origin_specs.py now declares `message_parent` as a
derived topology capability (span.parentSpanId -> parent span output:0),
the finding's second option; the parent mapping and the capability
contract agree | - |
| 96.03 #5530 `polylogue/sources/parsers/otel_genai.py:297` | fixed |
polylogue/sources/parsers/otel_genai.py `_messages_for_span`: a
non-string decoded result is serialized as sorted JSON; an absent
attribute stays absent |
tests/unit/sources/parsers/test_otel_genai.py::test_dispatch_preserves_structured_tool_results
|
| 96.04 #5530 `polylogue/sources/parsers/otel_genai.py:389` | fixed |
polylogue/sources/parsers/otel_genai.py `_span_evidence_event`: every
span field outside the projected set is kept under
`unprojected_span_fields` |
tests/unit/sources/parsers/test_otel_genai.py::test_dispatch_retains_unprojected_span_fields_in_evidence
|
| 96.05 #5584 `polylogue/sources/prepared_jsonl.py:556` | not reached |
polylogue/sources/prepared_jsonl.py:734 (Numeric native IDs remain
excluded from metadata capture. The f95 carrier file differs from the
upload; no partial metadata edit is supplied.) | - |
| 96.06 #5610 `polylogue/sources/prepared_jsonl.py:649` | not reached |
polylogue/sources/prepared_jsonl.py:650 (Per-Grok-session scratch rows
still allocate pages in the shared sealed preparation database. A real
scratch-lifetime/store separation remains, not a VACUUM workaround.) | -
|
| 96.07 #5610 `polylogue/sources/prepared_message_sink.py:539` | not
reached | polylogue/sources/prepared_message_sink.py:1205-1209 (The
streaming ChatGPT mapping reader still presents a leading UTF-8 BOM to
ijson. No reader/fixture change is supplied.) | - |
| 96.08 #4969 `polylogue/sources/retained_assembly.py:236` | not reached
| polylogue/sources/retained_assembly.py:230-236 (Windows sidecar
coordinates still use host-dependent Path handling. Cross-platform
coordinate parsing remains.) | - |
| 96.09 #5548 `polylogue/sources/revision_backfill.py:905` | not reached
| polylogue/sources/revision_backfill.py:4442-4551 (Retryable
preparation/infrastructure exceptions are still converted into semantic
census failure text. The complete worker-to-controller failure route is
not changed.) | - |
| 96.10 #5548 `polylogue/sources/revision_backfill.py:941` | not reached
| polylogue/sources/revision_backfill.py:1332-1357 (Prepared authority
promotion still needs the coherent membership-outcome update, including
previously observed authority. No half-update is supplied.) | - |
| 96.11 #4993 `polylogue/sources/revision_backfill.py:1626` | not
reached | polylogue/sources/revision_backfill.py:2326-2414;3396-3408
(Frozen evidence still constructs prepared-session shards inline on the
controller path. Worker preparation/transport ownership remains.) | - |
| 96.12 #4993 `polylogue/sources/revision_backfill.py:1626` | not
reached | polylogue/sources/revision_backfill.py:2326-2414;3396-3408
(Duplicate cited coordinate, distinct storage/lifetime obligation:
unused historical prepared shards are still materialized. No
cleanup/lifetime fix is supplied.) | - |
| 96.13 #5585 `polylogue/sources/revision_backfill.py:2352` |
fixed-already |
polylogue/sources/revision_backfill.py:2427-2465;2819-2880 (Census uses
raw-ID pages and resumes/rebinds expiring source frames.) | - |
| 96.14 #4993 `polylogue/sources/revision_backfill.py:2402` | fixed |
polylogue/sources/revision_backfill.py `_required_shard_prepared_rows`:
keys the lookup through `identity_law.session_id`, the helper
`prepare_session_shard` uses |
tests/unit/sources/test_revision_backfill.py::test_frozen_inactive_generation_replays_through_sealed_session_shards[padded_native_id=True]
|
| 96.15 #5435 `polylogue/sources/revision_backfill.py:2530` | fixed |
polylogue/sources/revision_backfill.py `_owned_generation_is_empty`: the
read-only probe opens with `validate_index_layout=False` |
tests/unit/sources/test_revision_backfill.py::test_owned_nonempty_generation_refuses_cold_build_deferral[deferred_indexes=True]
|
| 96.16 #5594 `polylogue/sources/revision_backfill.py:2752` | not
reached | polylogue/sources/revision_backfill.py:2490-2542;2828 (The
raw-ID page bound does not bound membership-join fanout. Paging the
joined result without losing logical-source memberships remains.) | - |
| 96.17 #4993 `polylogue/sources/revision_backfill.py:2842` |
fixed-already |
polylogue/sources/revision_backfill.py:4135-4165;4345-4374
(Required-shard refusal for lineage slicing has an explicit
canonical-write degradation; the strict prepared-carrier path remains
retryable.) | - |
| 96.18 #4982 `polylogue/sources/revision_backfill.py:2921` | not
reached | polylogue/sources/revision_backfill.py:4411-4415 (The terminal
global FTS corruption condition can still fail a selected replay unit
because of unrelated existing corruption. No narrower verification-scope
change is supplied.) | - |
| 96.19 #4382 `polylogue/sources/revision_backfill.py:3028` |
fixed-already | polylogue/sources/revision_backfill.py:6335-6343 (Spill
reparse passes the archive source connection to replay-safe enrichment.)
| - |
| 96.20 #4941 `polylogue/sources/revision_backfill.py:3279` |
fixed-already |
polylogue/sources/revision_backfill.py:6310-6319;6335-6343 (Both spill
routes recover the original source path and pass it into enrichment.) |
- |
| 96.21 #5432 `polylogue/sources/revision_backfill.py:3710` |
fixed-already | polylogue/sources/revision_backfill.py:4927-4955
(Prefetch hits are removed before representative selection and executor
dispatch.) | - |
| 96.22 #4275 `polylogue/sources/source_acquisition_components.py:370` |
not reached | polylogue/sources/source_acquisition_components.py:447
(Plain-file admission evidence is not yet carried across every sibling
acquisition route. ZIP/Drive provenance closure remains.) | - |
| 96.23 #4174 `polylogue/sources/source_acquisition_components.py:516` |
not reached | polylogue/sources/source_acquisition_components.py:623-689
(ZIP split-payload indexing still needs correction for grouped inline
documents. No acquisition-file edit is supplied.) | - |
| 96.24 #4634 `polylogue/sources/source_parsing.py:49` | not reached |
polylogue/sources/source_parsing.py:38-49 (Decoded positive session
evidence can still be overridden by the pathname classification. No
admission-policy edit is supplied.) | - |
| 96.25 #4883 `polylogue/sources/source_parsing.py:303` | stale |
polylogue/pipeline/services/archive_ingest.py and
`parse_sources_archive` were removed by #5787 (mutations route through
the daemon); no API sequential writer assigns a generic raw ID | - |
| 97.01 #4452 `polylogue/sources/source_parsing.py:452` | not reached |
polylogue/sources/source_parsing.py:469 (Antigravity vendor prepass and
saved JSON exports can still yield competing copies. Precedence and
retained provenance must be solved together.) | - |
| 97.02 #4452 `polylogue/sources/source_parsing.py:455` | not reached |
polylogue/sources/parsers/antigravity/census.py;polylogue/sources/source_parsing.py:408
(Antigravity source census still lacks the saved export-document role.
The role and its consumers are not changed.) | - |
| 97.03 #4452 `polylogue/sources/source_parsing.py:455` | stale | the
sequential API writer (`parse_sources_archive`) that skipped the
evidence gate was removed by #5787 | - |
| 97.04 #4732 `polylogue/sources/source_root_admission.py:58` | not
reached | polylogue/sources/source_root_admission.py:48 (Ancestor-only
refusal does not exclude a foreign archive nested below a selected
directory. Discovery pruning plus explicit refusal accounting remains.)
| - |
| 97.05 #4441 `polylogue/sources/source_snapshot.py:866` | fixed |
polylogue/sources/source_snapshot.py `execute_source_cut`: refuses a
destination whose staging parent is inside, or which contains, a bound
directory root (resolved, so aliases count) |
tests/unit/sources/test_source_snapshot.py::test_cut_refuses_staging_inside_source_before_mutating_it
|
| 97.06 #4945 `polylogue/sources/source_snapshot.py:917` | fixed |
polylogue/sources/source_snapshot.py `execute_source_cut`: appends
`.jsonl` to the full source id instead of replacing its suffix |
tests/unit/sources/test_source_snapshot.py::test_sqlite_cut_keeps_dotted_source_ids_distinct
|
| 97.07 #4441 `polylogue/sources/source_snapshot.py:969` | fixed |
polylogue/sources/source_snapshot.py: staging carries an owner marker
naming the request; `_reclaim_orphaned_staging` deletes only marked,
non-symlink directories; the marker is removed before publication |
tests/unit/sources/test_source_snapshot.py::test_cut_reclaims_only_staging_it_owns
|
| 97.08 #4441 `polylogue/sources/source_snapshot.py:992` | fixed |
polylogue/sources/source_snapshot.py `reacquire_candidate`:
archive-member items are verified against the member bytes read by name
from the copied ZIP |
tests/unit/sources/test_source_snapshot.py::test_archive_cut_reacquires_member_bytes_and_detects_member_mutation
|
| 97.09 #4432 `polylogue/sources/source_walk.py:54` | fixed |
polylogue/sources/source_walk.py `census_source_root`: a directly
configured file is the one candidate, as in `_resolve_source_paths` |
tests/unit/sources/test_origin_specs.py::test_root_census_includes_a_directly_selected_file
|
| 97.10 #4432 `polylogue/sources/source_walk.py:60` | fixed |
polylogue/sources/source_walk.py: the metric is renamed
`candidate_bytes` and documented as candidate entry size, not read I/O
(the finding's second option) |
tests/unit/sources/test_origin_specs.py::test_root_census_includes_a_directly_selected_file
|
| 97.11 #4788 `polylogue/sources/source_walk.py:149` | fixed |
polylogue/sources/source_walk.py `census_source_root`: supported-name
entries are taken before the regular-file filter; links and FIFOs count
as unsupported |
tests/unit/sources/test_origin_specs.py::test_root_census_accounts_for_rejected_nonregular_candidates
|
| 97.12 #4788 `polylogue/sources/source_walk.py:151` | fixed |
polylogue/sources/source_walk.py `_walk_source_paths`: an uninspectable
supported-name candidate stays in the walk so its per-file read records
the failure on the cursor; the census records it as unexplained |
tests/unit/sources/test_origin_specs.py::test_source_walk_keeps_uninspectable_candidate_and_census_records_it
|
| 97.13 #4879 `polylogue/sources/sqlite_snapshot.py:344` | not reached |
polylogue/sources/sqlite_snapshot.py:406;polylogue/sources/live/watcher.py:1286
(Physical watcher tokens can remain stale when acquisition itself
establishes an idle WAL. Snapshot/watcher cursor rebasing must be
changed together.) | - |
| 86.01 #5411 `polylogue/schemas/audit/workflow.py:59` | fixed |
polylogue/schemas/audit/workflow.py `_package_not_required_reason`:
canonicalizes the provider token before the subject lookup |
tests/unit/schemas/test_audit_declared_packages.py::test_audit_aliases_preserve_declared_package_exemptions
|
| 86.02 #4835 `polylogue/schemas/generation/dynamic_keys.py:27` |
fixed-already | polylogue/schemas/generation/dynamic_keys.py:35-71
(Required arrays are recursively canonicalized before structure
hashing.) | - |
| 86.03 #5277 `polylogue/schemas/generation/dynamic_keys.py:194` | fixed
| polylogue/schemas/generation/dynamic_keys.py
`_merge_observed_structure_pair`: beside an existing map only
individually dynamic names fold into it; static names stay |
tests/unit/schemas/test_promotion_monotonicity.py::test_observed_merge_rehomes_content_keys_beside_an_existing_dynamic_map
|
| 86.04 #5277 `polylogue/schemas/generation/dynamic_keys.py:195` | fixed
| polylogue/schemas/audit/checks.py `check_annotation_coverage`: named
fields retained beside a collapsed map are still counted |
tests/unit/schemas/test_promotion_monotonicity.py::test_collapsed_object_keeps_retained_fields_visible_to_annotation_audit
|
| 86.05 #4828 `polylogue/schemas/generation/workflow.py:119` |
fixed-already | polylogue/schemas/generation/workflow.py:99-105
(Provider and input provider tokens are canonicalized before selection.)
| - |
| 86.06 #4836 `polylogue/schemas/generation/workflow.py:185` |
fixed-already | polylogue/schemas/generation/workflow.py:175-193 (Source
witness overflow is propagated to the schema extension and manifest
lower bound.) | - |
| 86.07 #4835 `polylogue/schemas/generation/workflow.py:185` |
fixed-already | polylogue/schemas/generation/workflow.py:165-178 (Reused
versions retain prior exact structure witnesses.) | - |
| 86.08 #5444 `polylogue/schemas/operator/commit.py:62` | fixed |
polylogue/schemas/operator/commit.py: `SchemaCommitPrivacyError` derives
from `ValueError`, the command boundary's refusal type |
tests/unit/devtools/test_schema_commit_command.py::test_schema_commit_renders_typed_refusals_as_json[privacy]
|
| 86.09 #4828 `polylogue/schemas/package_publication.py:46` |
fixed-already | polylogue/schemas/package_publication.py:36-46 (The
publication snapshot enumerates all retained files, not JSON alone.) | -
|
| 86.10 #4837 `polylogue/schemas/packages.py:106` | fixed-already |
polylogue/schemas/packages.py:105-111 (The requested historical-key read
is already present. No migration or compatibility code is added by this
batch.) | - |
| 86.11 #4837 `polylogue/schemas/runtime_registry.py:764` |
fixed-already | polylogue/schemas/runtime_registry.py:762-790 (Refresh
takes maxima across prior manifest, prior schema, and incoming coverage
counters.) | - |
| 86.12 #4836 `polylogue/schemas/runtime_registry.py:776` |
fixed-already | polylogue/schemas/generation/dynamic_keys.py:74-127 (The
capped source-witness partition excludes shorter archive structure IDs;
archive IDs are retained without this cap.) | - |
| 86.13 #4838 `polylogue/schemas/runtime_registry.py:816` |
fixed-already | polylogue/schemas/runtime_registry.py:909-919 (Retained
historical packages pass through witness/counter synchronization before
publication. No migration is added.) | - |
| 86.14 #4854 `polylogue/schemas/sampling_db.py:66` | fixed |
polylogue/schemas/operator/schema_inference.py `cli_main`: passes
`ArchiveLocation.resolve(config.archive_root)` |
tests/unit/devtools/test_schema_lab_commands.py::test_schema_module_cli_preserves_configured_archive_location
|
| 86.15 #4854 `polylogue/schemas/sampling_db.py:318` | fixed |
polylogue/schemas/sampling_db.py: `SchemaArchiveEvidenceError` derives
from `ValueError` |
tests/unit/devtools/test_schema_commit_command.py::test_schema_commit_renders_typed_refusals_as_json[archive_evidence];
tests/unit/devtools/test_schema_lab_commands.py::test_schema_generate_handles_missing_archive_evidence
|
| 86.16 #4828 `polylogue/schemas/source_inference.py:559` |
fixed-already | polylogue/schemas/source_inference.py:569-591 (An
explicitly selected file is resolved before non-following file-type
inspection.) | - |
| 86.17 #4847 `polylogue/schemas/source_inference.py:612` |
fixed-already | polylogue/schemas/source_inference.py:643-689
(Unrecognized logical-export filenames are bound using the export header
member.) | - |
| 86.18 #4899 `polylogue/schemas/source_inference.py:640` | not reached
| polylogue/schemas/source_inference.py:679 (A recognized basename can
still win over an authoritative logical-export header. Header-first
acquisition identity remains.) | - |
| 86.19 #4936 `polylogue/schemas/source_inference.py:763` | not reached
| polylogue/schemas/source_inference.py:1549 (ZIP sidecars still enter
unconditional export-array expansion, unlike equivalent plain structured
documents. No ZIP strategy change is supplied.) | - |
| 86.20 #4936 `polylogue/schemas/source_inference.py:1267` | not reached
| polylogue/schemas/source_inference.py:SourceEvidenceRecipe (The
source-evidence recipe still permits reuse of pre-envelope-preservation
cache output. Must change with the actual observation semantics, not
silently accept the old cache.) | - |
| 86.21 #4847 `polylogue/schemas/source_inference.py:1273` |
fixed-already | polylogue/schemas/source_inference.py:1384-1406
(Logical-export DDL is reconstructed for declared not-null and
primary-key column metadata.) | - |
| 86.22 #4923 `polylogue/schemas/source_inference.py:1298` | not reached
| polylogue/schemas/source_inference.py:1373 (Live SQLite table/column
observations still lack one explicit read transaction covering the
complete observation.) | - |
| 86.23 #4923 `polylogue/schemas/source_inference.py:1301` | not reached
| polylogue/schemas/source_inference.py:1373 (Read-only WAL input
without SHM still needs a writable, WAL-preserving temporary snapshot
adapter. Immutable main-image fallback would lose evidence and is not
added.) | - |
| 86.24 #4847 `polylogue/schemas/source_inference.py:1334` | not reached
|
polylogue/schemas/source_inference.py:_collect_database_schema_candidate
(Identical database reacquisitions still retain path-derived
logical-source identities and double-count evidence. No guessed native
identity or broad deduplication is added.) | - |
| 86.25 #4634
`polylogue/schemas/synthetic/relation_solver_runtime.py:80` | fixed |
polylogue/schemas/synthetic/relation_solver_runtime.py
`_parsed_annotations`: keyed by a SHA-256 of the canonical JSON and
parsed from that snapshot |
tests/unit/core/test_synthetic_relations.py::test_relation_solver_honors_in_place_annotation_changes_between_generations
|
| 87.01 #4912 `polylogue/schemas/validator.py:110` | fixed |
polylogue/schemas/validator.py `_schema_branch_for_value`: the allOf
base selects its own union branch before merging |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_selects_a_sibling_union_before_allof_observation
|
| 87.02 #4912 `polylogue/schemas/validator.py:114` | fixed |
polylogue/schemas/validator.py `_schema_branch_for_value`: an explicit
dynamic-keys marker on any conjunct survives the allOf merge |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_preserves_dynamic_annotation_across_unannotated_conjuncts
|
| 87.03 #4912 `polylogue/schemas/validator.py:116` | not reached |
polylogue/schemas/validator.py:309 (The observation-only allOf merge is
still reused by empty-array normalization and can lose type constraints.
The three drift-walk edits do not claim to solve this.) | - |
| 87.04 #5413 `polylogue/schemas/validator.py:125` | fixed |
polylogue/schemas/validator.py `_resolve_local_ref`: `$ref` sibling
declarations join the resolved observation node |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_keeps_local_ref_sibling_declarations
|
| 87.05 #4829 `polylogue/schemas/validator.py:307` | fixed-already |
polylogue/schemas/validator.py:514-609;polylogue/pipeline/services/validation_runtime.py:57-66
(PayloadValidation retains the chosen probe samples/results and
consumers use them without another full validation.) | - |
| 87.06 #4830 `polylogue/schemas/validator.py:344` | fixed-already |
polylogue/schemas/validator.py:528-565 (Rejected candidates stop on the
first invalid record; only the initial fallback candidate is completed
if no candidate accepts.) | - |
| 87.07 #4830 `polylogue/schemas/validator.py:368` | not reached |
polylogue/schemas/validator.py:587-597 (Accepted historical schema
selection still preserves package_default as its reason and can cause
false unseen_shape classification.) | - |
| 87.08 #4830 `polylogue/schemas/validator.py:368` | not reached |
polylogue/schemas/validator.py:587-597 (Duplicate cited coordinate,
separate review comment: accepted historical resolution still needs
distinct truthful classification. No reason-enum/interface change is
supplied.) | - |

## Residuals

- 26 findings stay not reached and open in their beads (listed above).
- 86.10 is fixed-already, but the fix it asked for is a dual read of the
old key `omitted_current_structure_witness_count` in
`schemas/packages.py`. Whether committed packages still need that read
is a separate cleanup.
- The source-cut and census functions are exercised only by tests until
an acquisition owner calls them.
- Three focused tests fail identically on master (see Verification);
they are not touched 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]>
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

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.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 0914f89):

Resolving every thread listed; confirmed defects are fixed under the named bead.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 749f608):

Resolving every thread listed; confirmed defects are fixed under the named bead.

Sinity added a commit that referenced this pull request Sep 29, 2026
## Summary

Fix all 25 confirmed Codex P1 findings of polylogue-ez5b9 (sources-live
and sources-parsers) in one change. This PR now carries the
coordinator's seven fixes plus everything from AgentCTL batch run
`polylogue-20260929-115511-f46562fd` (workers ez5b9.1
parsers/artifacts/rendering, ez5b9.2 prepared acquisition, ez5b9.3
baseline/watcher). That run was abandoned once its content was carried
here, so this is the only vehicle. The branch is rebased onto current
`master`.

## Problem

The findings (threads linked in the table) share one theme: intake
decided an outcome from evidence other than the bytes it published.
Examples: a vendor conversion was published against later protobuf
bytes; provider detection sampled a different revision than the one
sealed; a cursor was authorized from source evidence read before another
writer ran. Others: whole cohorts ran past the writer budget; a torn
JSONL record was skipped on the way to the frontier; growth hid behind
the cursor; the baseline could not recognise retained growth or staged
SQLite coordinates. Several parser shapes were also lost or mis-keyed
before storage: project documents, ID-less tool steps, argument-less
commands, relocated cwds, bare usage records, OTel identity.

## Solution

| Finding | Thread | Fix | Production-route regression |
| --- | --- | --- | --- |
| 11.F006 |
[#4330](#4330 (comment))
| The converter's verified SHA-256 is carried to capture
(`AntigravityExportOutcome.source_sha256`). A capture that hashes
differently is released and refused with
`source_changed_after_conversion`. |
`test_antigravity_conversation_acquisition.py::test_vendor_conversion_cannot_publish_a_later_protobuf_revision`
|
| 11.F007 |
[#4330](#4330 (comment))
| One `admit_acquisition` item boundary covers ordinary files and each
vendor conversion (`admit_path`). The vendor server starts only for an
admitted item. |
`::test_vendor_cohort_checks_the_pass_budget_between_conversations`,
`::test_vendor_admission_refusal_happens_before_server_start` |
| 11.F023 |
[#4809](#4809 (comment))
| The same per-item checkpoint raises a typed `WriteHoldBudgetError`
between conversions without poisoning items. |
`::test_vendor_cohort_propagates_writer_budget_refusal_without_poisoning_items`
|
| 11.F016 |
[#4663](#4663 (comment))
| The append cursor's observed size is bounded by the plan, including
Claude's mutable-header delta, so unprobed growth stays visible. |
`test_live_batch_support.py::test_append_publication_does_not_hide_growth_after_planning[codex,claude-code]`
|
| 11.F019 |
[#4694](#4694 (comment))
| Hook publication queues `hook_paste_enrichment` debt for the affected
old sessions before the hook rows are written, under the same lease.
Re-matching is idempotent. |
`test_hook_paste_enrichment.py::test_late_hook_publication_schedules_its_old_session_not_the_next_batch[debt_write_fails]`,
`::test_replaying_paste_evidence_does_not_move_it_to_a_nearby_prompt` |
| 11.F021 |
[#4809](#4809 (comment))
| Append ingest checks the write-hold budget at start, per plan, parse,
replay, materialize and completion. The typed refusal propagates, and
the retained raw stays retryable. |
`test_live_batch_support.py::test_append_budget_refusal_retains_retryable_raw_without_poisoning_source`
|
| 11.F030 |
[#5428](#5428 (comment))
| Pinned source-tier evidence is read inside the cursor writer
admission, not across the preceding await. |
`test_live_sidecar_evidence_cost.py::test_cursor_evidence_is_pinned_after_writer_admission`
|
| 11.F033, 11.F036 |
[#5546](#5546 (comment)),
[#5557](#5557 (comment))
| The carrier names its decode failure (`DecodeFailure`). The writer
re-raises `PreparedDecodeError`, and `classify_decode_failure` is the
single classifier; `_is_json_stream_decode_error` is deleted. |
`test_live_watcher_parse_stage_equivalence.py::test_path_worker_decode_failure_reaches_terminal_unknown_evidence`
|
| 11.F035 |
[#5546](#5546 (comment))
| `source_snapshot` copies the source once. Sampling, frontier, parse
and seal read that copy, and the seal carries its digest. |
`::test_path_worker_binds_provider_parse_and_seal_to_one_snapshot` |
| 11.F037 |
[#5557](#5557 (comment))
| A stage-owned JSON document without a carrier for its captured bytes
is released and deferred (`live.ingest.json_capture_deferred`). It is
never decoded under the writer hold, even when preparation raised. |
`::test_changed_json_after_preparation_defers_without_writer_decode[both]`,
`::test_preparation_exception_does_not_restore_whole_json_writer_decode[discovery,preparation]`
|
| 11.F039 |
[#5250](#5250 (comment))
| Live full intake (writer, prewarm, path worker) and append decode
JSONL strictly for every provider. A malformed complete record is
`terminal_corrupt_input`, with the raw retained. |
`::test_known_provider_jsonl_with_a_malformed_middle_record_is_terminal[in-writer,worker]`,
`test_live_batch_support.py::test_append_refuses_a_malformed_middle_record`
|
| 11.F051 |
[#5546](#5546 (comment))
| A `BrokenProcessPool` at submit collects finished futures, replaces an
idle broken pool once, and retries the submission. A second break leaves
the path deferred. |
`::test_a_pool_broken_while_idle_is_replaced_at_the_next_submission[pending_completion]`
|
| 11.F053 |
[#5542](#5542 (comment))
| Every baseline decision uses `_retained_source_path`, which is the
provenance sidecar's original path for a staged SQLite snapshot, the
same coordinate acquisition retains. |
`test_production_baseline.py::test_a_staged_sqlite_import_is_baselined_at_the_path_acquisition_retains`
|
| 11.F055 |
[#5542](#5542 (comment))
| Retention of a grown file is proven by streaming and hashing the
baselined prefix of a larger full capture, or of a byte-proven
contiguous append chain rooted at one. A blob read fault is retryable. |
`::test_a_revision_that_grew_before_intake_is_proven_by_the_larger_retained_capture`,
`::test_baselined_and_earlier_accepted_revisions_are_proven_through_an_ordered_append_chain`,
`::test_a_chain_that_does_not_reproduce_the_revision_leaves_it_unretained[5
defects]`,
`::test_a_retained_blob_read_fault_is_retryable_not_unretained` |
| 11.F065 |
[#4801](#4801 (comment))
| Cursor reconciliation takes the newest of the newest materialized and
the newest decided-unresolved raw, ordered by `(acquired_at_ms,
raw_id)`. |
`test_live_watcher.py::test_cursor_reconciliation_restores_the_newest_archived_outcome[3
cases]` |
| 11.F069 |
[#5020](#5020 (comment))
| `WatchSource.path_artifact_kinds` replaces
`allow_path_scoped_artifacts`. `codex-state` admits exactly its
`session_index` and `prompt_history_log` sidecars. |
`test_production_baseline.py::test_the_default_codex_state_source_baselines_only_its_declared_jsonl_sidecars`,
`test_ingest_worker_assembly.py::test_codex_retained_root_sidecar_titles_survive_without_a_live_tree`
(now via `default_sources()`) |
| 12.F001 |
[#4883](#4883 (comment))
| An ID-less trajectory call gets the step-keyed id `<message id>:tool`.
An ID-less result pairs only with a sole adjacent ID-less call whose
declared name agrees. |
`tests/unit/sources/parsers/test_antigravity.py::test_trajectory_id_less_tool_steps_persist_their_pairing_and_file_edit`,
`::test_trajectory_id_less_result_pairs_only_an_unambiguous_adjacent_call[5]`
|
| 12.F011 |
[#4803](#4803 (comment))
| An assistant text node with `metadata.command` and empty or absent
args is a `TOOL_USE` with input `{}`. Its non-JSON text stays on the
block. |
`test_parsers_chatgpt.py::test_chatgpt_zero_argument_command_is_a_tool_call_its_result_pairs_with[empty,absent]`
|
| 12.F012 |
[#4721](#4721 (comment))
| The project filename is stored as `metadata["name"]`, projected to the
derived column `blocks.name`. Markdown, HTML and plaintext media
renderers render the carried body (fenced or escaped). |
`test_parsers_claude_ai_catalog.py::test_claude_project_documents_render_body_and_file_name_after_persistence`
|
| 12.F013 |
[#4721](#4721 (comment))
| `looks_like_session_document` admits the parser's own project and
account-memory detectors. |
`test_ingest_shape_admission.py::test_claude_project_export_reaches_parse_project_through_ingest`,
`::test_claude_account_memory_export_reaches_its_parser_through_ingest`
|
| 12.F014 |
[#4717](#4717 (comment))
| Relocated cwds lead `working_directories`, latest first. Chunk merge
applies the same rule from relocation events. |
`test_claude_code_sidecar_evidence.py::test_resume_route_opens_the_relocated_cwd_after_persistence`,
`::test_chunk_merge_keeps_the_relocated_cwd_first_across_revisions` |
| 12.F018 |
[#4870](#4870 (comment))
| An event counts as a replacement only when neither its message link
nor a same-session message with its native id exists. The provider id is
compared byte for byte. The evidence key is renamed
`replacement_events`. |
`test_corpus_fidelity.py::test_revision_gate_counts_only_events_that_replace_a_missing_message[4]`
|
| 12.F020 |
[#4886](#4886 (comment))
| A bare `token_usage_record` stating a known counter joins either
stream shape without marking it. |
`test_ingest_shape_admission.py::test_codex_rollout_with_bare_token_usage_record_ingests_its_usage`,
`::test_codex_bare_token_usage_record_needs_a_known_counter` |
| 12.F026 |
[#5530](#5530 (comment))
| Each OTel identity component escapes `%` and `:` before the join. |
`test_otel_genai.py::test_session_identity_components_cannot_run_into_each_other`
|

The parser and membership changes alter values derived from bytes
already observed, so both manual invalidation tokens are bumped:
`_PARSER_FINGERPRINT` goes to `live-batched-v4` and
`RAW_AUTHORITY_PARSER_FINGERPRINT` to `revision-membership-v5`.

**Derived-identity closure.** `devtools schema closure` puts these
changed files inside the closure:
`archive/artifact_taxonomy/support.py`, `archive/hydration.py`,
`archive/revision_authority.py`, `sources/dispatch.py`,
`sources/live/{append_ingest,batch,hook_paste_enrichment,parse_prefetch,production_baseline,watcher}.py`,
`sources/parsers/{antigravity,codex,otel_genai}.py`,
`sources/parsers/claude/{ai_parser,code_parser}.py`,
`sources/prepared_jsonl.py`, `sources/source_parsing.py`,
`storage/runtime/archive/records.py`,
`storage/sqlite/archive_tiers/{archive_tiers_specs,write}.py` and
`storage/sqlite/queries/attachment_blocks.py`. This PR must land before
a rebuild starts. The only schema change is additive-derived: the
`blocks.name` index.db column. It has no durable-tier migration.

## Verification

Candidate `4313bff197b1b0420ede997247d9843195c81e69`, on `master`
5d56c3a.

- `agentctl job start polylogue pytest_focused --workspace <worktree> --
<64 affected files>` (the selection is every test file the diff touches,
plus the route and sibling suites): job 3396: `8 failed, 2569 passed`.
All 8 failures are inherited (listed below). An earlier attempt, job
3387, was OOM-killed by systemd-oomd under host memory pressure and was
retried unchanged.
- `agentctl job start polylogue verify_quick --workspace <worktree>`:
job 3388: succeeded, all 12 gates passed.
- Inherited failures, classified on a detached `master` worktree with
`--on-default-branch` (jobs 3335 and 3356 on 749f608, job 3384 on
c950478, job 3401 on 5d56c3a), fail identically on master. They
are filed as polylogue-ouv5f:
-
`test_import_preflight.py::test_unidentified_trajectory_rows_keep_distinct_identities`
-
`test_retained_tool_output_convergence.py::test_gemini_full_tool_output_survives_the_loss_of_its_source_tree`
-
`test_artifact_taxonomy.py::test_antigravity_brain_metadata_sidecar_is_rejected_from_live_and_schema_routes`
  - `test_tool_result_unknown_reason_contract.py` (3 Antigravity cases)
-
`test_source_laws.py::test_parse_payload_dispatches_claude_code_messages_and_single_records`
-
`test_revision_replay.py::test_chain_replay_supersedes_equal_frontier_quarantined_membership_head`
- All fixtures are synthetic. No operator archive was read or mutated.

## Self-review

Checklists re-read: `docs/review/codex-review-guide.md` (including "Do
not flag" and the `polylogue/sources/AGENTS.md` review rules) and the
generic list in `orchestrate/references/worker-contract.md`. It took
four passes over `git diff origin/master...HEAD`:
- Pass 1 found the two manual invalidation tokens left unbumped, which
the guide names as a finding. They are now bumped.
- Pass 1 also found retained routes that still decoded JSONL leniently.
Making them strict was tried; pass 2 showed it livelocked the parser
census, so it was reverted and filed as polylogue-3p8p7. Pass 2 also
found the canonical-ingest vendor stub missing master's `excised`
keyword; it now accepts it.
- Pass 3 was driven by a focused run, where
`test_live_route_interpretation.py::test_a_later_index_revision_re_derives_the_titled_session`
failed on the branch but passed on master. A per-file bisection in probe
worktrees traced it to `revision_backfill.py`, which had been restored
from a newer master than the branch base. Restoring it to the base fixed
the failure; the file is now unchanged against master.
- Pass 4, on the rebased head, found nothing new.

Final pass:

1. ✓ **Siblings and owners.** The ordinary-file and vendor acquisition
routes share one item-admission closure (`admit_acquisition`).
`classify_decode_failure` is the only decode classifier: grep for
`_is_json_stream_decode_error` finds 0 hits. Strict decode covers all
four writer sites, both prewarm sites, the path worker and append. The
retained replay sites stay lenient on purpose (see Residuals and
polylogue-3p8p7), and the ingest-worker validation-mode contract (#1745)
is unchanged. Relocated-cwd order has one owner,
`order_working_directories`, which serves both the parser and chunk
merge. Baseline coordinates have one owner, `_retained_source_path`,
which delegates to acquisition's `original_sqlite_source_path`.
2. ✓ **The fix itself.** The new `AntigravitySourceMutationError` is
caught per item in `iter_antigravity_language_server_sessions` and
becomes a failed path. `WriteHoldBudgetError` is re-raised ahead of the
broad `except Exception` in the append and vendor paths.
`PreparedDecodeError` subclasses `ValueError`, so existing `ValueError`
handlers keep working. The census livelock that strict replay would have
introduced is not shipped.
3. ✓ **Memory and limits.** `source_snapshot` and `_prefix_digest`
stream in 1 MiB chunks. The baseline prefix proof reads one path's raw
rows only for revisions with no exact match. No cap or truncation was
added.
4. ✓ **Cost per unit.** Pinned cursor evidence is still one batched read
per page. Chain roots are memoized, and identical blob sequences are
hashed once. Hook debt targets only the sessions in the carrier.
5. ✓ **Interruption.** Write-hold checkpoints cover every append stage
and each vendor item. Paste debt commits before the hook rows under one
lease. A refused capture is released and the raw stays retryable, as the
budget-refusal tests show.
6. ✓ **Ordering and races.** The protobuf is bound by digest from
conversion to capture, and the JSON carrier is bound to one snapshot's
digest. Cursor evidence is read under the admitting writer. A growth
test grows the file after planning.
7. ✓ **Failure classification.** Blob read faults in the baseline proof
raise `ProductionBaselineReadUnavailableError`, which is retryable.
Mutation after conversion is a retryable item failure. A deterministic
append decode failure goes through `_record_failed_cursor` and its
5-failure exclusion cap, not an unbounded retry.
8. ✓ **Silent outcomes.** Unattempted vendor items carry
`REFUSED_UNATTEMPTED_TIME_BUDGET`. A deferred JSON capture emits
`live.ingest.json_capture_deferred` and records deferral debt. A
malformed live record gets terminal raw evidence instead of a silent
skip.
9. ✓ **Cleanup on failure.** A mismatched capture calls
`release_refused_capture`. A deferred JSON capture calls
`discard_pending_receipt` and discards its carrier. Budget exhaustion
calls `blob_store.discard_pending()`. The snapshot directory is removed
in `finally`.
10. ✓ **Identity and keys.** OTel components are escaped injectively,
and plain spellings are unchanged. The ID-less Antigravity tool id is
step-keyed (`<message id>:tool`), not positional. The corpus-fidelity
anti-join compares raw provider ids byte for byte (the whitespace case
is tested). The `pipeline/ids.py` hash partition is untouched.
11. ✓ **Lossless transforms.** Chunk merge keeps relocation order across
revisions. Re-matching paste evidence does not move it to another
prompt. The ChatGPT call block keeps its non-JSON text.
12. ✓ **Degenerate inputs.** An empty or fully refused vendor cohort
starts no server. A bare usage record without a counter stays refused. A
document without a body renders its header alone.
13. ✓ **Consumers.** `allow_path_scoped_artifacts`, `indexed_events` and
`_is_json_stream_decode_error` have 0 remaining references (`grep -rn`
across `polylogue`, `devtools`, `tests` and `docs`). Every stub of
`iter_antigravity_language_server_sessions` and
`_antigravity_raw_snapshot` matches the new signatures. `docs/daemon.md`
and `docs/maintenance.md` describe the new behaviour. The layering
baseline digest for `production_baseline.py` is re-anchored, with an
unchanged site count.
14. ✓ **Tests and stubs.** Each finding has a test on its production
route (table above), driving `LiveBatchProcessor`,
`ingest_append_plans`, `ingest_record`, archive persistence and
read-back, or the watcher reconciliation, not a helper. Removing the
named fix turns the listed test red: for example, drop `admit_path` and
the pass-budget test converts all three items. Clock-driven tests use
`frozen_clock`. Stubs follow the changed signatures (item 13).
15. ✓ **Trust boundaries.** No secrets or operator data. The pre-commit
secret-scan candidates are pre-existing spans in `revision_backfill.py`
and `test_live_batch_support.py`, not lines of this diff.

Generic list: (1) every criterion is met on the production path, per the
table; (2) siblings are covered in item 1; (3) consumers are covered in
item 13; (4) failures are typed, per items 7 and 8; (5) each new test
fails without its fix (item 14); (6) the diff carries no private data.

## Residuals

- Retained replay still decodes known-provider JSONL leniently, so a
rebuild can publish a session without a malformed record that live
intake refused. Strict replay decoding was tried in this branch and
reverted: the parser census records the parse exception as a `failed`
receipt, re-selects it on every pass, and replay planning then never
completes. Filed as polylogue-3p8p7, which needs a typed terminal census
outcome.
- A JSONL record over SQLite's value bound fails as
`terminal_corrupt_input`, not under a size-specific reason.
- A stage-level preparation exception now defers the page's JSON
documents instead of decoding them under the writer (F037). A prefetch
that failed deterministically would keep them deferred, with visible
debt.
- `canonical_archive_ingest` builds its `WatchSource`s with every path
rule admitted, as before this change. The `codex-state` sidecar boundary
is a daemon-default property.
- The Codex hosted review is usage-limited on this PR (its gate reports
"not required"), so no hosted code review covered this head.

🤖 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]>
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant