Skip to content

fix: Keep the evidence the archive already holds - #5300

Merged
Sinity merged 4 commits into
masterfrom
fix/writer-evidence-fidelity
Sep 20, 2026
Merged

Sinity merged 4 commits into
masterfrom
fix/writer-evidence-fidelity

Conversation

@Sinity

@Sinity Sinity commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

Four write-path defects where evidence the source actually supplied vanished into a default, plus one adjacent bug found while implementing. Closes the polylogue-qgyuj residuals, all four polylogue-1pzmq paths, and the remaining polylogue-3r36h halves.

qgyuj residuals

Zero-coercion on the public model. archive/message/models.py typed the four token counters int | None but defaulted them to 0. Now defaults to None; generated CLI output schemas re-rendered ("default": 0 → "default": null).

The ORDER BY COALESCE — decided, not retained. Concrete wrong outcome at head: sort=tokens --reverse answered "which sessions used the fewest tokens" with sessions whose provider reports no per-message usage at all. A leading NOT EXISTS key now holds unmeasured sessions out of the ranked band in both directions, mirroring the existing s.sort_key_ms IS NULL precedent in the date sort. The inner COALESCE stays so a partially-measured message still contributes its known lanes. Measured before/after on real rows: old ASC [unknown, measured-zero, measured-ten] → new [measured-zero, measured-ten, unknown].

Counter-less parsers (chatgpt, antigravity, grok, browser_capture) now covered — one synthetic payload each, asserting all four counters stay None.

The deliberate session-grain NOT NULL DEFAULT 0 was not touched, and is re-asserted explicitly in test_pricing.py with its reason.

1pzmq — four paths

  • Non-token evidence. Evidence is now decided over facts the row can hold: a non-zero token lane, the provider request_id, or the terminal signal (finish_reason, a new column). model deliberately does not count — it names the subject, not an observation — preserving polylogue-664l's landed decision that a billing-only payload writes no row.
  • Unresolved provider message IDs. Admission no longer gates on source_message_id is not None. New source_message_provider_id and source_message_resolution (resolved|session|ambiguous|unresolved) make an unattributable observation identifiable as unattributable instead of dropped.
  • Future timestamps. A 7-day tolerance: a stored updated_at_ms beyond now+tolerance stops deciding the comparison and the write proceeds. Nothing is rewritten or clamped. An untrusted incoming timestamp still replaces, so a bad export cannot block its own re-ingest.
  • Offline checkouts. session_commits now written with repo_id NULL plus branch and verbatim cwds. No synthetic repos row is invented — keying one on the commit hash would collide across repositories sharing that commit, which the bead named. The test asserts SELECT repo_id FROM repos stays empty.

Adjacent bug found while implementing: _PROVIDER_USAGE_EVENT_COLUMNS is both the capture SELECT and the restore INSERT, and the restore DELETEs first — request_id was absent, so the first carry-forward nulled a column the event writer had populated. The list now carries it, and the capture query uses the one list instead of a hand-copied second.

3r36h

Four of the five sites were already correct at head — verified, no change manufactured. Delivered: the size > cursor.byte_offset stat-match branch now gets the same age-gated escalation its sibling has had since polylogue-2qrx, so it is no longer invisible to list_retry_records; and deferrals stop being added into failed_file_count (which daemon/status.py shows the operator as failed files) — they ride their own deferred_file_count.

Verification

devtools verify --quick — all 22 gates ok, exit 0.
devtools render all --check — exit 0, out of sync count 0.
Focused run across 17 files: 696 passed, 1 failed — the single failure proven inherited below.

Every new test names its anti-vacuity mutation in its docstring.

Residuals

  • CLOSURE / LANDING ORDER. All nine production files are IN the derived schema closure, and this adds three columns to a derived-tier table (session_provider_usage_events). Classification: additive-derived — no migration, no durable DDL, no vocabulary added to a durable CHECK. Must land before any fresh rebuild and never during one; the archive must reconverge.
  • One inherited red left open: test_incomplete_full_jsonl_capture_retries_without_losing_split_record fails identically at 454808b25 and at 21c315cf3, so it predates the nullable-usage wave. The raw is retained and classified correctly; only complete-prefix materialization is missing. Deciding whether 0 or 1 is correct is a real diagnosis outside these three beads. Head-check receipts preserved.
  • Two other inherited reds were proven at pristine master and fixed forward here (test_the_partition_input_columns_are_projected_or_declared_excluded, test_disjoint_input_cache_lanes_survive_parse_write_and_pricing).
  • Measured zero is still not representable at usage-event grain. Parsers coerce unreported counters to 0 before the writer sees them and those columns are NOT NULL DEFAULT 0, so a zero cannot be told from an absence there. A bare zero was deliberately not admitted as evidence (it wrote hollow rows and contradicted 664l). Fixing it properly is the qgyuj change repeated at event grain — worth its own bead.
  • Payload facts with no column are still lost for redundant event types (service_tier, inference_geo, ttft_ms, stop_sequence, …). Pre-existing, same family as the request_id/finish_reason columns added one at a time.

🤖 Generated with Claude Code

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

Sinity and others added 4 commits September 20, 2026 20:17
polylogue-qgyuj's parser/storage/read chain already carried NULL usage
end to end, but the public ``Message`` model still DEFAULTED the four
token counters to 0, so any message built without explicit usage -- every
message from a parser that carries no per-message counters -- reported a
measured zero it never observed.

- ``Message.input_tokens``/``output_tokens``/``cache_read_tokens``/
  ``cache_write_tokens`` default to ``None``; the generated CLI output
  schemas follow (``default: 0`` -> ``default: null``).
- ``_summary_order_by``'s ``tokens`` branch no longer ranks a session with
  no measured usage alongside one measured at zero: a leading
  ``NOT EXISTS`` key holds unmeasured sessions out of the ranked band in
  both directions, as ``sort_key_ms IS NULL`` already does for the date
  sort. ``sort=tokens --reverse`` previously answered "fewest tokens" with
  the sessions whose provider reports no usage at all.
- Tests pin the counter-less parsers (chatgpt, grok, browser_capture,
  antigravity) and the model default itself.

Both edited production files are IN the derived schema closure.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
polylogue-1pzmq, two of its four paths.

Provider usage events with non-token evidence were dropped: the admission
test was "some token field is a non-zero int", so a Drive chunk reporting
only ``finishReason``, and a Claude turn reporting ``stop_reason`` beside
an all-zero ``usage``, wrote no row at all -- and ``token_count`` /
``message_usage`` are in ``_SESSION_EVENTS_REDUNDANT_TYPES``, so that row
is their only landing place. ``session_provider_usage_events`` grows a
``finish_reason`` column and the predicate admits a stated finish/stop
reason or ``request_id`` on its own.

Unresolved provider message ids discarded the whole event: a provider id
duplicated within a session is deliberately excluded from the writer's
native-id map (those messages take content-derived ids), so every usage
event naming one vanished. The row is now written with the declared
``source_message_provider_id`` and a typed ``source_message_resolution``
(resolved / session / ambiguous / unresolved), so an unattributable
observation is identifiable AS unattributable.

Also: ``_PROVIDER_USAGE_EVENT_COLUMNS`` is both the carry-forward capture
SELECT and its restore INSERT, and the restore deletes the session's rows
first -- ``request_id`` was missing from it, so the first reconciliation
nulled a column the writer had populated. The capture query now shares the
one list instead of hand-copying it.

Inherited reds fixed forward (both verified failing at origin/master
454808b, receipt .cache/verify/runs/20260920T183058Z-focused-test-
1664521-00469d18):

- ``test_the_partition_input_columns_are_projected_or_declared_excluded``
  -- ``request_id`` (landed in #5224) was never classified in
  ``SESSION_PROVIDER_USAGE_EVENT_EXCLUDED_COLUMNS``; it and the three new
  columns are now declared with reasons.
- ``test_disjoint_input_cache_lanes_survive_parse_write_and_pricing`` --
  asserted ``messages.cache_write_tokens == 0`` for a Codex payload that
  reports no cache-write counter; a9d2ffb made that NULL.

All three edited production files are IN the derived schema closure, and
this adds columns to a derived tier: the archive must reconverge.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
polylogue-1pzmq, its remaining two paths.

Untrusted future timestamps pinned a session body: ``should_skip_stale_
replace`` compared parser-supplied freshness (for ChatGPT, ``update_time``
copied straight out of the export) against the stored ``updated_at_ms``
with no plausibility bound, so one malformed or crafted export could win
that comparison permanently and block every later genuine replay. A stored
timestamp more than ``UNTRUSTED_FUTURE_FRESHNESS_TOLERANCE_MS`` (7 days)
past the local clock no longer decides the comparison. It is a tolerance,
not a clamp: honest skew -- an unsynchronized provider clock, a timezone
error, a laptop a day out -- keeps its authority, and nothing is rewritten.
An untrusted incoming timestamp still replaces, exactly as unknown
freshness already does, so one bad export cannot block its own re-ingest.

Explicit commit evidence was dropped for offline checkouts: ``_write_repo_
edges`` returned before its ``session_commits`` insert whenever no raw cwd
resolved to a git root and no remote was known -- the documented Codex
shape on a checkout this machine no longer has. The commit now lands with
a NULL ``repo_id`` (the column is nullable for exactly this) and the
declared cwds and branch in ``evidence_json``. No synthetic repository is
invented: keying one on the commit hash alone would collide across
repositories sharing that commit.

Both edited production files are IN the derived schema closure.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
…failures

polylogue-3r36h's two remaining ingest sites (the rest landed in #5224,
squash d7d3dda).

``_needs_work``'s ``size > cursor.byte_offset`` branch returned False on a
stat match with no age escalation and no ``mark_failed``, so a cursor whose
recorded ``byte_size`` lagged the file parked forever and never appeared in
``list_retry_records``. Its sibling (``size == cursor.byte_size``) has aged
that state out since polylogue-2qrx; this branch now does the same --
unbounded tail probe past ``_STUCK_DEFERRED_APPEND_AGE_S``, then either a
real append or a durable failure record.

A deferral was reported to the operator as a failure: the ingest-attempt
receipt folded ``len(deferred_paths)`` into ``failed_file_count`` (which
daemon status and catch-up status read) while ``LiveBatchMetrics.to_payload``
reported deferral nowhere, so a deferred pass looked like neither. The
receipt now carries ``deferred_file_count`` in its stage payload and the
metrics event exposes the same count. Retry projection and the
``live_ingest_deferred`` convergence-debt rows are unchanged.

Inherited red fixed forward (verified failing at origin/master 454808b,
receipt .cache/verify/runs/20260920T185212Z-focused-test-1720123-c75afdde):
``test_ingest_files_emits_observable_batch_metrics`` pinned
``stage_timings_s`` to an exact two-entry dict and the batch now also times
its post-commit raw compaction.

All three edited production files are IN the derived schema closure.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 28 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: 6aabcb41-de99-4f78-b46e-86d04d1f4ff5

📥 Commits

Reviewing files that changed from the base of the PR and between 0d02434 and 37add90.

📒 Files selected for processing (18)
  • docs/schemas/cli-output/session-message-row.schema.json
  • docs/schemas/cli-output/session-messages-response.schema.json
  • polylogue/archive/message/models.py
  • polylogue/sources/live/batch.py
  • polylogue/sources/live/metrics.py
  • polylogue/sources/live/watcher.py
  • polylogue/storage/derived/session/input_binding.py
  • polylogue/storage/sqlite/archive_tiers/archive.py
  • polylogue/storage/sqlite/archive_tiers/archive_tiers_specs.py
  • polylogue/storage/sqlite/archive_tiers/ingest_precedence.py
  • polylogue/storage/sqlite/archive_tiers/write.py
  • tests/unit/core/test_pricing.py
  • tests/unit/sources/test_live_batch_support.py
  • tests/unit/sources/test_live_watcher.py
  • tests/unit/sources/test_nullable_message_usage.py
  • tests/unit/storage/test_provider_usage_event_evidence.py
  • tests/unit/storage/test_token_sort_unknown_usage.py
  • tests/unit/storage/test_write_precedence_and_repo_evidence.py

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 20, 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-20T19:23:10.882636Z 37add90 PR opened
🔒 Security Review ✅ Completed 2026-09-20T19:24:57.980790Z 37add90 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: 37add90fbe

ℹ️ 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/live/batch.py Resolved
@Sinity
Sinity merged commit 316bbca into master Sep 20, 2026
3 checks passed
@Sinity
Sinity deleted the fix/writer-evidence-fidelity branch September 20, 2026 20:06
Sinity added a commit that referenced this pull request Sep 20, 2026
## Summary

Three beads: `polylogue-uohdp` (new mechanism, measured),
`polylogue-r2lud` and `polylogue-olw5e` (already landed at head —
residual tests plus one route).

**Cold consumer-reachability gate: 25.6s → 12.3s**, with byte-identical
output proven by a differential harness. All six touched files are
**OUT** of the derived schema closure.

## The measurement, taken as a same-head pair

An earlier pair straddled #5299/#5300/#5301 and was discarded. Both arms
below are the **same tree at the same head**; the base arm reverts this
commit's three files from `origin/master`.

| | total wall | consumer-reachability |
|---|---|---|
| base | 239.42s | **25.6s** |
| head | 224.19s | **12.3s** |

Gate alone, cache cleared before each: base `25.12 / 24.34 / 24.58`,
head `12.50 / 12.67 / 12.42`. Warm is unchanged at 0.26s both ways — the
existing content-digest cache already served it; only the cold path
moved.

Total-wall delta (−15.2s) exceeds the gate delta (−13.3s) purely because
`test-collection` varied between runs. **The gate-level number is the
evidence.**

## The bead's diagnosis was partly wrong

It attributed the cost to re-parsing every source file with no caching.
A fresh partition of the cold path (1,295 modules, 16,286 nodes)
measured: `ast.parse` **3.0s**, call-graph edge indexing **9.9s**,
reachability traversal **6.7s**, a second full parse for the
module-import closure **3.7s**. Parsing was 6.7s of 23.5s. A
cross-process content-digest cache also already existed.

So the fix is four equivalence-preserving changes, **no new cache and no
new cached verdict**: reuse the modules the call graph already parsed;
walk the union of entrypoints in one BFS (the tuple names
`polylogue.cli` twice and most entries reach the same component);
collect a function's imports and calls in one body scan instead of two
structurally identical visitors; hoist per-function rebuilds to module
level.

**AC2–AC5 asked for a per-file content-hash fact cache. I did not build
it**, and this is a decision with a measurement rather than a silent
omission: parsing is 3.0s of 23.5s, and the dominant edge indexing
depends on the global node set so it is not per-file cacheable. If that
judgment is wrong the bead should stay open with this measurement
attached — **it should not be closed silently on this commit.**

The bead's historical 101s-of-214s figure no longer describes this gate.
The quick set's dominant cost today is `test-collection` at 88–98s.

## Equivalence proof

Both implementations loaded in one process over the same live tree:
reachable symbols **18,662**, reachable modules **1,180**, graph nodes
**16,286**, and the **full edge map** all identical. Compute 24.12s →
11.79s (2.05x). `reachable_from` matched for 40 randomly sampled roots.

## r2lud and olw5e — already landed

`mypy_gate.py` already takes an exclusive `flock` on a shared cache; the
prior tests faked `_git_common_dir` and `subprocess.run`, so nothing
exercised contention. Added a test with a real checkout plus a linked
worktree and a stub checker claiming exclusive entry.

Four concurrent lanes against the warm shared cache all exit 0,
completing at +0.75 / +1.28 / +1.84 / +2.37s versus 0.78s single-lane —
a ~0.55s stagger, the signature of strict serialization. Cold-cache
variant **not measured**: clearing the shared cache would have disrupted
live sibling workers.

`olw5e`'s AC3 premise was wrong — `verify_population_coverage.py` walks
no denominator, so there was no re-walk to replace. The real gap was
that the coverage route could not see the real source population at all
without a live archive. `census_constructs()` now classifies through the
**same** classifiers the `source.db` inventory uses (extracted so the
two evidence sources cannot drift into two coverage policies), and
`resolve_census()` **raises** for an absent, unreadable, foreign or
bounded census rather than producing an empty construct list that would
read as full coverage.

## Verification

`devtools verify --quick` exit 0, all 22 gates. `devtools render all
--check` exit 0, `out of sync` count 0. `devtools test
tests/unit/devtools`: **1121 passed, 5 failed**.

Four anti-vacuity mutations run and reverted, each proven red.

## Inherited failures — all five reproduce on clean master

Proven on a detached `origin/master` worktree with its own venv: three
`test_cli_acceptance.py` reflow-ratchet failures (root-help and
read-help exceed recorded baselines at widths 40/60/80), one
`test_verify_provider_completeness.py` (`grok-export/export-json@v1` is
*partial*, schema_package missing), and one intermittent
`test_pytest_slot.py` telemetry-sidecar flake that asserts `peak pss_kib
> 0` for a child exiting immediately against a 0.5s sampler.

## Environment note

`uv sync --extra dev --frozen` **prunes the audit group and removes
grimp**, making `devtools gate layering` fail with `grimp_unavailable`.
The correct incantation is `uv sync --extra dev --group audit --frozen`
(audit is a `[dependency-groups]` entry, not an extra). Every number
above was measured with grimp present and layering green.

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

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 20, 2026
…red attachments a source owner (#5308)

## Summary

Six beads delivered from the storage/daemon core cluster; thirteen
reported unattempted with a stated reason rather than half-done.
**Seventeen production files are IN the derived schema closure — this
must land before any rebuild starts, never mid-run.**

## nv356 — the trigram index is gone, and the open question is answered

`blocks_command_trigram`, its three write triggers, and its
rebuild/repair machinery are absent from a freshly opened index tier.
Index schema **v101**; an existing tier stamped at the old identity now
raises `SchemaSkew`.

**The premise is confirmed, not refuted.** Repo-wide grep at head found
the name only in its own DDL and triggers, its rebuild helpers, one
FTS-parity gap check, and comments. Its one historical consumer
(`devtools/affordance_usage.py::_cli_action_rows`) was deleted
2026-08-25 with no product-surface replacement. The open question
recorded at `index.py:365-369` is now answered: **no query consumer
exists.** `polylogue-xul7` should close against this rather than
re-investigating.

Scope necessarily exceeded the bead's declared `write_scope`: the table
had five writer call sites in `write.py`, a readiness rebuild and a
trigger-guard fallback in `archive.py`, a cold-replay rebuild in
`revision_backfill.py`, an FTS-parity check, same-version trigger
variants in `schema_manifest.py`, and the `blocks.tool_detail_text`
generated column whose only consumer was the trigram table. Leaving any
would have left a compatibility surface, which AC1 forbids.

## dhkuu — the non-termination, fixed at its actual root

The watcher's stale-tail probe read the whole tail and repeated forever.
The loop was not the read size: `except OSError: return True` returned
**without** calling `record_deferred_append_cursor`, so the cursor kept
its old observation and the identical probe re-ran every pass. Now
catches `(OSError, MemoryError)` and falls through to the deferral
record, and scans 1 MiB chunks stopping at the first newline.

Content-identity re-read gains `STRUCTURAL_IDENTITY_MAX_BYTES` (256
MiB); above it the payload is not read and the streaming SHA-256 is
reused. **The skip is never silent** — a structured event plus a
recorded reason on the record, because a byte digest and a structural
identity are not interchangeable. The ceiling sits far above any member
of the measured 6,966-blob corpus.

## 8v4rm — the preservation-critical edit

`source_attachments` added to `BLOB_OWNERS`. The direction is provably
safe: `_direct_surfaces` **appends**, so adding an owner can only move a
hash from unreferenced to live — no path can make a currently reachable
hash collectable. It pins exactly the hashes a row claims were stored,
so it does not blanket-pin and does not hide a genuine orphan.

`record_source_attachments` no longer uses `ON CONFLICT DO NOTHING`:
identical replay is a no-op, `pending → terminal` is the one declared
progress transition, and anything else raises a typed conflict naming
field, stored and offered values.

## xvwpi and 3sic0

`combine_outcomes` filtered on `and entry.reason`, so an error or
degraded part with a blank reason **contributed no gap and composed to
`ok`** — and nesting kept only a composite's first gap. Now
`UNNAMED_GAP` labels it and every subordinate gap carries forward.

All four `GROUP_CONCAT(DISTINCT session_id)` sites emit
`json_group_array` instead; the three comma-splitting readers go through
one helper. Re-verified on SQLite 3.51.2 that `group_concat(DISTINCT x,
<sep>)` is refused.

## Reported unattempted, with reasons

Thirteen beads. The ones worth knowing: **`irtix` sub-item A must not be
started without explicit reconvergence authorization** — length-prefix
framing changes every stored `content_identity`, and the bead says so
itself. `20d.17` deletes `daemon/status.py` (3,565 lines) and depends on
unlanded `bp12n.1`. `9m93s` names `i07pw` as its predecessor and has an
AC withdrawn by a later ruling while the recorded text still demands it.
`fzbzk` stays deferred.

**`q54dt` AC2/AC3 need a decision:** the declared bounded route has no
message-grain paste predicate. `query_units` accepts `has_paste`, but it
lowers to `sessions.paste_count > 0` (`filter_builder.py:111`), while
the handler deliberately reads message-grain `msg.has_paste`. Adding one
touches five query modules plus CLI/API/MCP parity and moves the schema
identity — far outside this bead's scope. AC3 explicitly rejects the
cheaper alternative, so nothing partial was manufactured.

## Verification

`devtools verify --quick` exit 0, all 22 gates. `devtools render all
--check` exit 0, zero `out of sync`. Two anti-vacuity mutations executed
and red as expected.

Three inherited reds proven against pristine baselines rather than
assumed — including `test_blob_gc_durable_intent.py`, which sits in the
8v4rm blast radius and was baselined deliberately for that reason. One
**correction**:
`test_live_watcher.py::test_ingest_files_emits_observable_batch_metrics`
was red at the old base and is green at `9d0fdac8b` — #5300 fixed it.

## Interaction to record

`STRUCTURAL_IDENTITY_MAX_BYTES` is a deliberate, recorded exception to
`wzgpf`'s "structural content identity is the authority" rule. The
corpus reclassification work must account for it.

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

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 21, 2026
…5367)

## Summary

Clears four inherited-red defects that every lane has had to prove "not
mine".
**14 failed / 408 passed → 0 failed / 419 passed**, proven at the rebase
base by
reverting all eight changed files in place rather than inferred from
bead text.

Two were product defects, two were stale tests. **No test was relaxed to
make it
green.**

## polylogue-w4hfb — product defect, and the tempting fix is provably
wrong

`analysis/orchestration_evidence.py` built `positive_tokens` with
`if (value := getattr(message, key)) > 0` over four lanes that became
`int | None = None` in #5300. Guarded rather than coerced: `positive` is
`value is not None and value > 0`, and `value is None` gets its **own
bucket**
plus a `message_token_lanes_unmeasured` gap token. **A measured 0 is
excluded from
the unmeasured bucket, because it is a measurement.**

The forbidden fix was executed to prove it is caught: `getattr(message,
key) or 0`
leaves 6 of 7 green and reddens exactly the distinction test —
`assert usage['messages_with_unmeasured_token_lanes'] == 1` → `assert 0
== 1`.

Sibling sweep found no other consumer applying an ordering operator to
these four
columns: `cost_compute.py` tests `is not None`, `material_adapter.py`
guards the
same way, `pricing.py` orders a coerced payload carrying a separate
`unmeasured_lanes` tuple, and storage readers use `IS NOT
NULL`/`COALESCE`.

## polylogue-njcms — the test's intent survives the census-ledger
retirement

**Ruling**: the retired frontier census row carried **two separable
questions** —
*"is there unresolved frontier debt?"*, which durable blocker rows now
answer
directly and which was correctly retired, and *"was this domain measured
at all?"*,
which nothing answered afterwards. **Retiring the ledger retired the
row, not the
second question.**

The defect is in the product, not a revert. `raw_materialization_ready`
returns
True when all twelve blocking counters are zero — so **on an archive
with zero raw
artifacts every counter is trivially zero and the projection certifies
convergence
off an inspection that examined no rows.** Probed live on the fixture:
`classification='not_run'`, `raw_artifact_count=0`, yet
`claim_guard.converged = {value: true, determinate: true, reason:
'ready'}`.

The successor precondition is **a zero denominator** — exactly the shape
`search_unmeasured_reason` already refuses for FTS coverage (*"fts
coverage is
undefined at a zero denominator, not complete"*). Unlike the old
census-row
condition, which a code comment says *"marked every production archive
permanently
indeterminate"*, this leaves every populated archive determinate. Only
an explicit
integer zero is classified; an **absent** count keeps its own verdict,
so a real
refutation is never masked into "unknown" — a mutation widening it to
`if not raw_artifact_count:` reddens that assertion.

Routed through `readiness/claim_guard.py` (closure **out**);
`readiness/capability.py`
(closure **IN**) untouched. Both status producers already share the one
function.

**The collateral was repaired, not accommodated.** Nine daemon-status
tests asserted
`converged=True` on a mocked empty archive. Their subject is debt-ledger
*isolation*
from the convergence claim — their helper is literally named
`_complete_raw_materialization_readiness` ("the complete source evidence
required to
isolate claim signals") while supplying only `available=True` and a
census stub. The
helper was made **actually complete**, preserving their subject exactly.

## polylogue-2i96t — both causes were the test

**`input_tokens`**: `MessageRenderEnvelope` is generated from the
canonical `Message`
model, so its lanes are `int | None` with default `None` — verified at
runtime, and
`models.py:61-70` states the ruling: defaulting to 0 on a public output
model
*"reintroduced, on the public output model, exactly the false
measured-zero the
storage/read path stopped writing."* The assertions pinned the pre-#5300
default.
Repaired to pin `None` for an omitted lane **and** `0` for an explicitly
measured
one — including on the wire, where unmeasured drops under `exclude_none`
and a
measured zero does not.

**`total_unit`**: the field is legitimate and the roster was stale.
Established by
`git log -S`: it entered in #5224 for polylogue-1c6j precisely so the
emitted
document could satisfy the published `additionalProperties: false`
schema, and that
PR regenerated the OpenAPI and CLI-output schemas without touching this
test.

The roster was **extended, not derived** — deliberately: a field-set
contract is
meant to force a human decision when the envelope grows. **That is its
anti-vacuity property**, unlike `pxzms` below where the roster mirrored
a derived
fact.

## polylogue-pxzms — derived, plus a stronger property

Confirmed: `write_coordinator.py` measures `out` and is absent from the
baseline, so
the hand-written roster was the stale side. Three property tests replace
two
parametrized rosters and a pinned directional test — including one that
proves the
**anti-prefix** property over **all 1296 files** under `polylogue/`
rather than one
hand-picked sibling pair (57 directories currently hold members beside
non-members),
and one deriving real members and real non-members and requiring the
command's JSON
verdict to equal the library predicate **in both directions**.

**Both anti-vacuity directions executed.** Stubbing the command to
report `True` for
everything reddens it; stubbing `False` reddens it. And the
must-**not**-redden
direction was measured too: a real closure change **555 → 933** that
pulled
`write_coordinator.py` back IN left all three replacement tests
**green** — the exact
class of change that broke the old roster. (The two tests that did
redden are the
ones that should: the baseline ratchet and CLI identity-neutrality.)

One rejected mutation is reported for honesty: emptying
`_REPLAY_ROUTING_FINGERPRINT_PATHS` did **not** change the closure — the
graph is too
connected for any single entry-path removal to matter — so the
import-edge mutation
was used instead.

## Verification

`devtools verify --quick` **exit 0** (26 gates) · `render all --check`
exit 0,
zero `out of sync` · focused 9-file selection **419/419 passed**,
`git_dirty false`
· the same selection with all eight files reverted in place → **14
failed**.

**Closure: all eight touched files `out`; the identity does not move** —
proven by
computing `derived_schema_identity` with both production files replaced
by their
base content (index and ops identical). **This branch can land during a
rebuild.**

Both candidate fix sites that are closure **IN** —
`surfaces/payloads.py` for
`2i96t` and `readiness/capability.py` for `njcms` — were left untouched,
because in
each case the defect was on the other side.

## Residuals

- **`raw_materialization_ready()` still returns True at a zero
denominator.** Only
the *claim* layer was fixed, because `storage/archive_readiness.py` is
closure **IN**
and `claim_guard.py` exists precisely so claim classification stays
outside it.
Non-claim consumers (`convergence_feedback.py:31`,
`commands/paths.py:76`,
`readiness/__init__.py:97`, `daemon/status.py:3067`) still read a
pristine archive
as materialization-ready. That is a rebuild-boundary edit, deliberately
not taken.
- `orchestration_evidence.py:311` still appends a
`message_usage_missing_and_zero_indistinguishable` gap whenever
`message_tokens` is
non-empty. Now that the lanes are nullable end to end and this
projection separates
them, that claim is **stale prose** — it over-reports uncertainty rather
than
over-claiming measurement, so it is safe, but it should be re-derived by
whoever
  owns that vocabulary.
- Still red and **not** cleared here, proven inherited:
`test_runtime_operations_are_well_formed` on the missing
`explicit_dry_run_evidence`
  guard.
- Evidence boundary: focused selections plus the static quick gate, not
an affected or
  full corpus run.

The shared known-red file was updated — four rows removed, with the 14 →
0
measurement and the per-defect ruling recorded in their place.

Closes polylogue-w4hfb, polylogue-njcms, polylogue-2i96t,
polylogue-pxzms.

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

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

---------

Co-authored-by: Claude Opus 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

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 64a9bd0):

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 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