Skip to content

Fix six corpus red classes: stale-index reads, degraded FTS, superseded fixtures - #4579

Merged
Sinity merged 6 commits into
masterfrom
fix/corpus-reds-2
Sep 3, 2026
Merged

Sinity merged 6 commits into
masterfrom
fix/corpus-reds-2

Conversation

@Sinity

@Sinity Sinity commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

Six red classes from the 2026-09-03 corpus run, each its own commit. Four
are product defects the tests were reporting correctly; two are fixtures
pinned to shapes the runtime has moved past.

Problem and solution, per class

The rebuild preflight refuses a non-current index (19 tests)

validate_schema_inference_receipt opens the active index to project the
live blob universe, under the runtime schema check. A rebuild is the route
that carries a non-current index forward, so the check refused the
archives the rebuild exists for:

RebuildDerivedStateProvenanceError: index schema skew: expected 85, found 43

That read now opens at the index's own version. #4563 removed the
canary fixture's PRAGMA user_version = 43 as an incidental literal; it
is load-bearing — an expected difference approves a canary only when the
compared generations cross the delta that authorizes it, and delta 44
owns sessions.title_ref/title_confidence. Restored, with the reason
written down.

A missing message FTS surface closed every read (1 + 1 tests)

messages_fts is contentless, trigger-maintained, and rebuildable from
blocks. The read-path manifest check refused the whole index when it was
absent, so a search index that had not converged made the archive
unreadable and /api/sessions?query= answered 503. A read now admits a
manifest diff confined to that surface and the search route reports the
degraded route state it already models. Any other diff still refuses; the
write path is unchanged. Fixes
test_degraded_search_index_returns_route_state_not_zero_results and
restores the degraded-search evidence in the reader visual smoke.

The fast-forward replay could not open a pre-forward archive (24 tests)

_replay_sample opens the archive to parse retained raws — source-tier
evidence — and that open validated the index layout. The index beside it
is the one the run exists to carry forward, so every prepare_forward
raised SchemaVersionMismatchError. ArchiveStore.open_existing gains a
read-only validate_index_layout=False; the actuator is its one caller.

The suite's two-version world now anchors at the live index version and
forwards to a synthetic successor, so the archive on disk is one the
runtime can open and no shipped delta pair has to stay fast-forwardable.

Reader assertions the typed WebUI superseded (8 tests)

/ and /s/{id} serve the typed WebUI, whose SSR shell carries a bundled
module instead of the interpolated reader's inline markup and JavaScript.
Assertions naming that markup describe the legacy shell, which now answers
only on /w/ and the paste routes and keeps its coverage there. The
endpoint evidence in each test is unchanged. The search-shell DOM test is
deleted outright: its whole subject was the interpolated shell at /.

The small-workload swap was left half-done (4 tests)

#4558 pointed the artifact tests at a two-session workload. Three sites
kept the default workload's identity: the two spawned probes name a module
constant a python -c program cannot see (NameError: _SMALL_SPECS), and
the GC lease test authenticates the small artifact against the c03 key.
Probes now build the specs from an importable factory; the real-pipeline
publication test builds the default workload again, since its subject is
that workload's facts rather than the cache protocol.

git finds a repository by walking upward (1 test)

test_git_commit_adapter_raises_explicitly_for_non_repository passed in
the main checkout and failed in a worktree, where tmp_path sits inside
one. It caps the walk with GIT_CEILING_DIRECTORIES.

Verification

devtools test <file> -n 2:

file before after
tests/unit/devtools/test_index_fast_forward.py 24 failed 26 passed
tests/unit/cli/test_reindex_canary_cli.py 19 failed 31 passed
tests/visual/test_reader_dom_smoke.py 8 failed 10 passed
tests/unit/infra/test_workload_artifacts.py 4 failed 90 passed
tests/unit/storage/test_schema_policy_contracts.py 19 passed 20 passed
tests/unit/insights/test_work_effects.py 1 failed 19 passed
tests/unit/daemon/test_web_reader.py -k degraded_search_index 1 failed 1 passed

devtools verify --quick green at this head.

Residual risk

ArchiveStore.open_existing(validate_index_layout=False) is a new way to
open an archive whose index is not at the runtime's shape. It is refused
for writers and has one caller.

The degraded-search admission is scoped by object-name prefix
(messages_fts), so a future non-FTS object sharing that prefix would
be admitted with it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

Sinity and others added 6 commits September 3, 2026 05:51
The rebuild provenance preflight opens the active index to project the
live blob universe, and opened it under the runtime schema check. A
rebuild is the route that carries a non-current index forward, so that
check refused the very archives the rebuild exists for, and with it every
canary whose compared generations actually cross a delta.

Restores the v43 stamp on the canary CLI fixture: the compared
generations must cross delta 44 for its reviewed title backfill to be
approvable authority, so the version literal is load-bearing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
The root and /s/ routes serve the typed WebUI, whose SSR shell carries a
bundled module rather than the interpolated reader's inline markup and
JavaScript. Assertions naming that markup describe the legacy shell,
which now answers only on /w/ and the paste routes and keeps its own
coverage there. The endpoint evidence in each test is unchanged.

Deletes the search-shell DOM test outright: its whole subject was the
interpolated shell at the root route.

Deletes the degraded-search half of the empty-archive test with its
fixture. Dropping the FTS objects no longer yields a degraded search
result -- the index fails its semantic manifest and the archive refuses
to open -- so the fixture cannot reach the state the test names.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
#4558 pointed the artifact tests at a two-session workload. Three sites
kept the default workload's identity: the spawned reuse and fresh-process
probes name a module constant a `python -c` program cannot see, and the
GC lease test authenticates the small artifact against the c03 key.

The probes now build the specs from an importable factory. The
real-pipeline publication test builds the default workload again -- its
subject is that workload's facts, not the cache protocol the small specs
exist to exercise quickly.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
git finds a repository by walking upward, so a temporary directory inside
a checkout is one. The test caps the walk at its own temporary root, and
so tests the directory rather than where basetemp lives.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
…g reads

messages_fts is contentless, trigger-maintained, and rebuildable from
blocks -- a derived read model inside the derived index. The read-path
manifest check refused the whole index when it was absent, so a search
index that had not converged closed every read of the archive. A read now
admits a manifest diff confined to that surface; the search route reports
it as the degraded route state it already models. Any other diff still
refuses, and the write path is unchanged.

Restores the degraded-search evidence in the reader visual smoke, which
this refusal had made unreachable.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
The source-replay proof opens the archive to parse retained raws, and
that open validated the index layout. The index it opens beside is the
one the run exists to carry forward, so the check refused every prepare.
Read-only opens can now waive index-layout validation, and the actuator
is the one caller that does.

The suite's two-version world is anchored at the live index version and
forwards to a synthetic successor, so the archive on disk is one the
runtime can open and no shipped delta pair has to stay fast-forwardable
for the tests to hold.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 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-03T04:03:28.640278Z 483cd56 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.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 813bfe10-a512-48cb-9bee-f5500014bd8e


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.

@Sinity
Sinity merged commit 0d6ad8c into master Sep 3, 2026
1 of 3 checks passed
@Sinity
Sinity deleted the fix/corpus-reds-2 branch September 3, 2026 03:56

@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: 483cd56595

ℹ️ 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/storage/sqlite/schema.py Resolved
Sinity added a commit that referenced this pull request Sep 3, 2026
The root and /s/ routes serve the typed WebUI. The interpolated reader
shell these tests pin answers on the workspace routes, so they read it
there. This restores the search-shell DOM evidence #4579 deleted: the
shell it tests is still served, just not at the root.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
Sinity added a commit that referenced this pull request Sep 3, 2026
The root and /s/ routes serve the typed WebUI. The interpolated reader
shell these tests pin answers on the workspace routes, so they read it
there. This restores the search-shell DOM evidence #4579 deleted: the
shell it tests is still served, just not at the root.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
Sinity added a commit that referenced this pull request Sep 3, 2026
…ping, wire-receipt cost (#4591)

## Summary

Five red classes from the 2026-09-03 corpus run, each its own commit.
Two
are product defects; three are fixtures pinned to shapes the runtime has
moved past.

## Problem and solution, per class

### The relink route never derived attachment provenance (6 tests)

`attachment_refs.direction` is `NOT NULL`, and only the main write route
derived it from the owning turn. Blob-reference closure relinked
attachments straight from the parsed record:

```
sqlite3.IntegrityError: NOT NULL constraint failed: attachment_refs.direction
```

The relink path now goes through the same shared derivation, reading the
owning turn from the index when the append payload's own message map
does
not carry it — an append whose owning message is already materialized.

Two of the six failed inside the main route instead, on a model-output
attachment whose turn carried no provider id; `#4587` fixed that while
this branch was open, and this commit builds on it.

### One session total on two model rows (1 test)

`sessions.reported_cost_usd` is one exact dollar total for a session,
written onto a single `session_model_usage` row. A merge-append that
switched models left the superseded row holding the previous total, so
every sum over the session counted it twice.

The direction-refusal test alongside it named a user turn, whose
direction
the derivation supplies; only a role outside the user/model pair leaves
the
column underivable, so that is what it names now.

### Hand-built index fixtures without a tier version (12 tests)

`#4485`'s open-time tier check refuses a database named for an archive
tier whose `user_version` is 0:

```
SchemaSkewError: index schema skew: expected 85, found 0
```

- The deployment-smoke browser-capture probe fixtures declare the
version
  the read profile expects, read from the tier table.
- The embed-backfill fixtures build the tier through the production
  bootstrap rather than touching a bare SQLite file.
- The WAL/journal pragma probes name their scratch databases for what
they
are. They test the pragmas the connection factories apply; the tier
check
  fired only because the files were called `index.db` and `ops.db`.

### Hand-built `blocks` tables without `tool_outcome` (6 tests)

The insight-status and readiness queries read `blocks.tool_outcome`, the
canonical structural outcome since `#4539`. Two fixtures predate it.

### A killed waiter left its pytest slot task queued (host defect)

The waiter blocks on a task it queued through pueue, and the task
outlives
it. The slot's parallelism is one, so a task left with no waiter starves
every other checkout on the host until someone reads the queue and kills
it
by hand -- which is what happened during this branch's own runs. The
waiter
now reaps the task it added when it is signalled or unwound: kill, then
remove, then drop the launch file, which carries a resolved environment
and
must not survive either.

### Full-catalog wire receipts on single-provider assertions

`build_wire_support_receipt` runs the synthetic corpus and the
production
parser for every catalogued package element. Profiled: 27 s per
full-catalog call in a quiet process, and the file's heaviest tests
measured 106-110 s of call time under `-n 2` -- inside a 120 s timeout
with
no margin, which is what the corpus run recorded as nine timeouts.
`#4412`
added two providers and the margin went. Tests that assert about one
provider's entry, or that a receipt *changed*, now name the providers
they
read; three catalog-wide tests still build the whole catalog.

Memoizing the schema-annotation parsing the profile flagged was tried
and
reverted: 26.5 s against 27.4 s, which does not buy an identity-keyed
cache
in production code.

### Reader assertions pointed at the wrong route

The interpolated shell answers on `/w/` and the paste routes; the root
and
`/s/` serve the typed WebUI. Eight reads across the visual suites and
`test_web_shell_reader.py` now fetch `/w/stack`. This also restores
`test_reader_search_shell_dom_evidence`, which `#4579` deleted -- the
shell
it tests is still served, just not at the root, so repointing it was the
right move and deleting it was not.

## Verification

`devtools test <file> -n 2`:

| file | before | after |
| --- | --- | --- |
| `tests/unit/storage/test_archive_tiers_write.py` | 2 failed | **107
passed** |
| `tests/unit/maintenance/test_blob_reference_closure.py` | 6 failed |
**13 passed** |
| `tests/unit/cli/test_embed_activation.py` | 7 failed | **35 passed** |
| `tests/unit/devtools/test_deployment_smoke.py` | 7 failed | **24
passed** |
| `tests/unit/storage/test_wal_journal_size_limit.py` | 5 failed | **8
passed** |
| `tests/unit/storage/test_session_insight_status_descriptors.py` | 5
failed | **13 passed** |
| `tests/unit/core/test_insight_readiness.py` | 1 failed | **passed** |
| `tests/unit/devtools/test_pytest_slot.py` | 7 passed | **8 passed** |
| `tests/unit/storage/test_session_profile_model_usage_consistency.py` +
`tests/unit/insights` | — | **730 passed** (cost regression check) |

`devtools verify --quick` green at this head.

The attachment and cost measurements above predate the rebase onto
`#4587`, which rewrote `_attachment_provenance` under this commit; the
storage suites are re-running against the merged shape.

The slot-reaping test drives a real SIGTERM into a child waiter with a
fake
`pueue` on PATH. Anti-vacuity: dropping the `_reaping` context leaves
the
recorded calls at `add`/`wait`, the starvation shape itself.

The visual and wire-receipt commits are still queued behind the host's
pytest slot at the time of writing; they are committed, not yet
measured.

## Residual risk

The provider-scoped wire receipts trade catalog breadth for time in
tests
that assert about one provider. If a future provider's route breaks only
in
a receipt those tests build, three catalog-wide tests still catch it,
one
test later.

`tests/unit/infra/test_pathology_zoo.py` was red in the corpus run and
is
green at this head with no change here.

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

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sinity added a commit that referenced this pull request Sep 29, 2026
)

## Summary

Lands worker 8's review-debt fixes for `polylogue-1tyq5.107`, `.108` and
`.109` (storage reads, usage, query objects, connection profile),
rebased onto current master and reviewed. Of 52 findings: 24 fixed with
regression tests, 9 already fixed on master, 19 not reached.

## Problem

The worker's commit could not be run by its author. On review, several
fixes were right in intent but wrong in shape:
- the writer refusal of unprovisioned tiers also removed the index
version-zero exemption and changed attached-sibling and reader checks;
- `ReadFrame.resume` rebound on every external commit, which resets
`data_version` and would hide a mixed source census from
`_require_current_source_census_frame`;
- the effective-context fix changed the API route only, leaving the
pinned `read.effective_context` operation reading own rows with the old
boundary rule;
- the profile snapshot fix covered only the batch read;
- the attachment-library order used `attachment_refs.position`, an
identity coordinate rather than a display ordinal;
- the subscription conversion reported $0 for an unrated model or an
undeclared tier.

## Solution

- Worker commit, rebased unchanged.
- Follow-up commit: writers refuse a never-provisioned tier only when
they open it directly; every reader path keeps master's absent-tier
answer. `resume` rebinds only for a held read transaction and refuses
while a stream pins the snapshot. `effective_context_window` plus one
boundary query is now the single owner for both effective-context
routes, and both compose the lineage transcript. Single, batch and list
profile reads hold one snapshot. Library pages order by attachment ID
within a message, matching the session read. Checkpoint blockers stay
named when the checkpoint failed. The cumulative lane uses the same
counter-evidence rule as the request lane. Subscription equivalents are
`None` when the rate or tier is unknown. `put_query` raises instead of
asserting.

No Origin to Provider reversal is added. `coverage.provider` was already
present and is unchanged.

## Verification

- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/salvage-w8 --wait` → job 2311 `succeeded` (head
65a248e762, same tree as 02c3d8c).
- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/salvage-w8 --wait -- <30 test files>` → job 2314: `790
passed, 4 failed`. All four failures are inherited: job 2294 reproduces
them with every production file reset to `origin/master`:
-
`test_diagnostics.py::test_latency_plain_zero_rows_reports_unknown_drop_accounting`
-
`test_facade_contracts.py::test_archive_facet_buckets_count_unique_sessions_for_duplicate_hits`
  - `test_facade_contracts.py::test_no_undiscovered_async_methods`
-
`test_mapped_bytes_budget.py::test_async_attached_tier_profiles_map_main_only[configure_read_connection]`
- Anti-vacuity: in a worktree with every changed production file reset
to `origin/master`, the new regression tests fail on their assertions
(job 2262: `40 failed`; job 2315: `3 failed`, covering the revised
attachment test, the updated budget test and the cumulative-lane test).

## Self-review

- **Siblings and owners.** Effective context had two deciders, the API
route and `operations/read_view_extras.py`. Both now call
`effective_context_window`. The one-snapshot fix covers all three
profile reads. Reportedness now uses the same counter-evidence rule for
the request and cumulative lanes. The schema refusal applies only where
a writer opens a tier. Reader, sibling, sealed-staging and
`assert_tier_schema_supported` callers keep master behaviour.
- **The fix itself.** Rebinding on any stale `revalidate()` would have
defeated the census end check, so it was dropped.
`ReadFrameExpiredError` from `resume` during a stream is an existing
typed error, and the census never resumes mid-stream. The `assert` in
`put_query` became a raise.
- **Memory and limits.** Session-cost IDs page at the connection's
physical bind limit, with no new cap. Both effective-context routes
still compose the whole transcript, as `get_messages` already did. See
residuals.
- **Cost per unit.** Attachment-library paging still uses the existing
OFFSET. The new `LEFT JOIN messages` is on the primary key.
- **Interruption.** The added read transactions roll back in `finally`.
`ReadFrame.close` retires stream cursors before closing the connection.
- **Ordering and races.** Messages, boundary and blocks are read in one
snapshot, as are profile rows and usage. `resume` never proves an anchor
on a held snapshot.
- **Failure classification.** A canonical-DDL build failure is
`upgrade_runtime`, separate from `retry` and drift. Checkpoint blockers
are kept on error.
- **Silent outcomes.** A lane without counter evidence is `unavailable`,
and a lane with an explicit zero is `reported`. An unknown subscription
rate or tier is `None`, not $0.
- **Cleanup on failure.** Every added `BEGIN DEFERRED` ends with
`ROLLBACK` in `finally`.
- **Identity and keys.** No hash or ID changes.
- **Lossless transforms.** Not applicable.
- **Degenerate inputs.** NaN and infinite snapshot bounds are refused.
Negative or reversed boundary ranges fall back to the plain prefix. An
empty ID list returns early.
- **Consumers.** The CLI renderer uses the lane fields.
`test_mapped_bytes_budget` was updated to three writers.
`read_view_extras` uses the new owner.
- **Tests and stubs.** The monkeypatch targets (`_own_messages`,
`read_model_usage_batch_async`, `_resolve_subscription_tier_setting`)
exist and are called on the production route. Each test states its
anti-vacuity condition.
- **Trust boundaries.** No change.

## Per-finding dispositions

| key | disposition | evidence | test |
|---|---|---|---|
| 107-01 (#4642) | not reached | still real: Invalidation returns
children, not the former parent cohorts; only the current session
receives an explicit delegation refresh. | — |
| 107-02 (#4690) | not reached | still real: LIKE requires an immediate
subagents basename and the parent check uses parts[-3]. | — |
| 107-03 (#4642) | not reached | still real: Retired-alias invalidation
selects only resolved links to the withdrawing claimant; graph inbound
lookup only addresses the written session. | — |
| 107-04 (#4690) | not reached | still real: Unresolved multi-name
observations are skipped and sidecars can bind the known sibling; no
full parent cohort revisit on a second child arrival. | — |
| 107-05 (#4056) | not reached | still real: Every controller submits to
one four-worker adapter, regardless of its capacity. | — |
| 107-06 (#4606) | fixed-already |
`polylogue/storage/sqlite/connection_profile.py:900-910; :1193-1206`
holds on current master | — |
| 107-07 (#4610) | fixed-already |
`polylogue/storage/sqlite/connection_profile.py:932-945` holds on
current master | — |
| 107-08 (#4611) | fixed-already |
`polylogue/storage/sqlite/connection_profile.py:932-945` holds on
current master | — |
| 107-09 (#4687) | fixed | `_assert_schema_supported` keeps the
empty-tier exemption for read-only opens only;
`open_connection`/`open_daemon_connection` on a never-provisioned tier
now raise `SchemaSkew` before any SQL. Attached siblings keep the
absent-tier read answer. |
`test_writers_refuse_an_uninitialized_durable_tier` |
| 107-10 (#5248) | fixed | `mapped_bytes_budget` and
`MappedBytesBudgetCheck.concurrent_profile_budget_bytes` count three
ordinary writer profiles (index, source, publication reservation). |
`test_memory_budget_includes_source_and_reservation_writers` |
| 107-11 (#4794) | not reached | still real: A pathname stat after
opening can stamp the connection with a replacement inode. | — |
| 107-12 (#4794) | fixed | `ReadFrame.resume` rebinds a live frame whose
connection holds a read transaction before proving the anchor, and
refuses with `ReadFrameExpiredError` while a stream pins the snapshot. |
`test_resume_releases_a_held_snapshot_before_proving_the_anchor,
::test_resume_refuses_while_a_stream_pins_the_snapshot` |
| 107-13 (#5401) | not reached | still real: Cancel interrupts a running
statement but leaves a cursor suspended at yield open. | — |
| 107-14 (#5401) | fixed | `ReadFrame.close` closes registered stream
cursors before the connection, so later generator cleanup has nothing to
do. | `test_stream_can_be_closed_after_its_frame` |
| 107-15 (#5401) | fixed | `read_frame` and `ReadFrame.__init__` refuse
NaN and infinite snapshot bounds. |
`test_read_frame_rejects_nonfinite_snapshot_bounds` |
| 107-16 (#4183) | fixed | `format_session_markdown` uses the recorded
`source_url` when an attachment has no local path. |
`test_markdown_uses_remote_attachment_urls_without_a_local_path` |
| 107-17 (#5454) | not reached | still real: The session filter selects
physical attachment refs only, excluding a composed parent prefix. | — |
| 107-18 (#5454) | fixed | The attachment library orders by session sort
key (newest first), then message position/variant, then attachment ID
within a message (as the session read does), before LIMIT/OFFSET. |
`test_attachment_library_pages_keep_session_and_transcript_order` |
| 107-19 (#5420) | fixed-already |
`polylogue/analysis/archive_models.py:79;
polylogue/storage/derived/session/profiles.py:248;
polylogue/storage/sqlite/queries/mappers_insight_profiles.py:54-56`
holds on current master | — |
| 107-20 (#4985) | fixed | `effective_context_window` (the single owner,
used by both the API and the pinned `read.effective_context` operation)
falls back to the plain prefix unless 0 <= start <= end. |
`test_effective_context_rejects_invalid_ranges` |
| 107-21 (#4985) | fixed | The boundary query selects the newest
compaction first; an incomplete newest row yields the plain prefix
instead of an older summary. |
`test_newest_incomplete_compaction_does_not_reuse_an_older_summary` |
| 107-22 (#4357) | fixed | Both effective-context routes now compose the
lineage transcript before applying the local boundary. |
`test_effective_context_includes_a_forks_inherited_prefix,
::test_pinned_operation_and_api_share_one_effective_context_decision` |
| 107-23 (#4357) | fixed | Messages and the boundary are read in one
deferred read transaction. |
`test_effective_context_reads_boundary_in_the_message_snapshot` |
| 107-24 (#4577) | fixed | Single, batch and list profile reads hold one
read snapshot across the profile rows and the usage overlay. |
`test_profile_rows_and_usage_overlay_share_one_snapshot` |
| 107-25 (#4630) | not reached | still real: LIMIT is applied to thread
ids before hydration drops roots without profiles. | — |
| 108-01 (#4200) | fixed | `put_query` returns the persisted row
(including promotion metadata) after the idempotent insert. |
`test_put_query_returns_existing_promotion_contract` |
| 108-02 (#4200) | not reached | still real: The tombstone predicate
checks only the caller-provided result_set_id. | — |
| 108-03 (#4357) | fixed | `get_effective_context` hydrates blocks and
derived text inside the same snapshot as the messages. |
`test_effective_context_hydrates_structured_tool_blocks` |
| 108-04 (#4799) | fixed | Compaction context snapshots take `event
position + 1`, leaving position 0 to the session-start snapshot. |
`test_context_snapshot_start_precedes_the_first_compaction` |
| 108-05 (#4546) | fixed-already |
`polylogue/storage/sqlite/schema_manifest.py:92-129` holds on current
master | — |
| 108-06 (#4546) | fixed | A failure to build the canonical index
manifest is classified `upgrade_runtime`, separately from archive read
failures (`retry`) and drift. |
`test_canonical_ddl_runtime_failure_requests_runtime_upgrade` |
| 108-07 (#4579) | fixed-already |
`polylogue/storage/sqlite/archive_tiers/archive.py:6694-6697;
:8603-8616; polylogue/storage/sqlite/queries/sessions_search.py:25-27;
polylogue/mcp/server_support.py:546-555` holds on current master | — |
| 108-08 (#4637) | fixed-already |
`polylogue/storage/sqlite/schema.py:113-128;
polylogue/storage/sqlite/schema_bootstrap.py:87-101` holds on current
master | — |
| 108-09 (#4637) | not reached | still real: An installed read-only
source tree cannot host the persistent memo, so short-lived processes
recompute source closures. | — |
| 108-10 (#4601) | not reached | still real: The existing async
identity-adoption helper inserts without a commit. A compliant fix must
remove unsupported legacy adoption rather than perpetuate it. | — |
| 108-11 (#5401) | fixed | Read frames are named as checkpoint blockers
only when the checkpoint left busy pages or undrained log, or failed. |
`test_successful_checkpoint_does_not_label_current_snapshot_as_a_blocker`
|
| 108-12 (#4317) | not reached | still real: Cumulative input always
subtracts cache; origin is explicitly discarded. | — |
| 108-13 (#4317) | not reached | still real: Duplicate non-Codex
disjoint-input report, retained separately. | — |
| 108-14 (#4317) | not reached | still real: The exported canonical
projection has no production caller; writer paths still fold usage
separately. | — |
| 108-15 (#4317) | not reached | still real: Each cumulative session
rebuilds the entire grouped dictionary. | — |
| 108-16 (#4317) | not reached | still real: Default tuple ordering
compares nullable model names against strings in projection and rollup.
| — |
| 108-17 (#4317) | fixed-already | `polylogue/storage/usage.py:237-247`
holds on current master | — |
| 108-18 (#4317) | not reached | still real: Reasoning-only or
total-only evidence can become a complete zero-cost projection. | — |
| 108-19 (#4317) | not reached | still real: Costs are rounded to six
decimal places before further aggregation. | — |
| 108-20 (#4927) | fixed-already | `polylogue/storage/usage.py:589-595`
holds on current master | — |
| 108-21 (#4927) | fixed | The plaintext usage report renders
`provider_request_lanes`/`provider_cumulative_lanes` and prints
`unavailable` for an unreported lane. |
`test_usage_cli_renders_disjoint_lanes_and_unavailable_requests` |
| 108-22 (#4927) | fixed | Request-lane reportedness counts events that
carry a last/request counter (`request_counter_event_count`), in both
the SQL and streaming stats paths. The cumulative lane follows the same
counter-evidence rule. |
`test_request_lane_reportedness_requires_request_counter_evidence` |
| 108-23 (#4927) | fixed | Same change: cumulative-only events stay
`unavailable`; an explicit request zero stays `reported`. |
`test_request_lane_reportedness_requires_request_counter_evidence` |
| 108-24 (#4293) | fixed | The cache-rate coverage check runs before a
stored priced cost is reused. |
`test_stored_price_does_not_hide_a_missing_cache_rate` |
| 108-25 (#4217) | fixed | `session_usage_costs_for_connection` batches
IDs at the connection's `SQLITE_LIMIT_VARIABLE_NUMBER`. |
`test_session_cost_lookup_pages_at_the_connection_bind_limit` |
| 109-01 (#4217) | fixed | Model names are normalized before the credit
lookup; a token-bearing row whose model still has no credit rate makes
the session's subscription amount unknown (None), not $0. |
`test_session_subscription_fallback_normalizes_provider_qualified_models,
::test_session_subscription_amount_is_unknown_without_a_rate_or_tier` |
| 109-02 (#4217) | fixed | Credits pass through `credits_to_usd` with
the archive's configured tier (default `pro`); a tier the catalog no
longer declares yields None. |
`test_session_subscription_amount_is_dollars_not_raw_credits` |

Worker claims narrowed rather than rejected: 107-09, 107-12, 107-18,
107-22 and 107-24 (see Problem), and 109-01/109-02 (fail closed). No
worker `fixed` claim was dropped as not real.

## Derived-identity closure

`devtools schema closure` on the changed files. IN:
`storage/sqlite/connection_profile.py`, `queries/attachment_records.py`,
`queries/message_query_reads.py`, `query_objects.py`,
`query_store_archive.py`, `run_projection_relations.py`, `schema.py`,
`wal_checkpoint.py`, `storage/usage.py`. Out:
`cli/commands/diagnostics.py`, `operations/read_view_extras.py`,
`rendering/core_markdown.py`,
`queries/session_insight_profile_reads.py`. Land this before a rebuild
starts.

## Residuals

- 19 findings remain not reached, and their beads stay open.
- The pinned `read.effective_context` operation returns messages without
hydrated blocks. The API route hydrates them. This predates the PR.
- Both effective-context routes compose the full transcript in memory,
as `get_messages` does.
- `_attach_sibling_tiers` still admits an empty sibling tier on a writer
connection. Only direct writer opens refuse.
- Four inherited test failures on master are listed above.

🤖 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 5d56c3a):

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