Skip to content

fix: close worker-13 MCP, surface and excision review findings - #5779

Merged
Sinity merged 3 commits into
masterfrom
fix/codex-debt-w13-surfaces
Sep 29, 2026
Merged

Sinity merged 3 commits into
masterfrom
fix/codex-debt-w13-surfaces

Conversation

@Sinity

@Sinity Sinity commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

This lands the worker-13 batch on current master. The batch covers beads polylogue-1tyq5.77, .110, .63, .53, .54 and .88. I checked each of the worker's 24 proposed fixes against master and kept 22. CTX-07 was dropped because #5778 already fixed it, and SURF-03 was dropped after master merged #5793, which fixes it the same way. Of the 74 findings, 22 are fixed here, 39 were already fixed on master, and 13 were not reached.

Problem

All 22 kept defects still reproduce on master (re-checked after merging master at 1beb2e5):

  • MCP search resumed from a continuation alone reported query: "" and lost sort. It also sent the default limit, which the continuation guard refuses as widening.
  • Personal-state pages that exceeded the response budget came back with no continuation.
  • Reference pipelines, list read views and completions ignored offset.
  • read(view="messages") for a missing session returned internal_error.
  • Discovery did not advertise the messages view, the precompact intent, the clear_corrections confirmation or the single-candidate evidence digest.
  • Compaction had three defects:
    • it invented a text-only hash when the archive gave none;
    • pack_ref hashed only the kept anchor refs;
    • the Markdown rendering showed only the aggregate drop counts.
  • Read overrides used bool("false"), so "false" meant true. JSON-only views also defaulted to Markdown.
  • Windows working-directory paths were not shortened on POSIX hosts.
  • Envelopes built from domain sessions had no relative time.
  • Orchestration children could point at nodes removed by topology truncation.
  • Excision had three defects:
    • marker tombstones used an excision-marker: ref, which fails ObjectRef validation;
    • excising a watch baseline left its watch enabled;
    • INSERT OR IGNORE hid ledger CHECK failures, and the content was deleted anyway.

Solution

The worker's commit is cherry-picked, with these corrections:

  • The compaction identity is moved into fix: close Codex review findings from the #5727 landing #5758's fixed-point budget loop. A fixed-width placeholder means filling in pack_ref does not change the measured size.
  • message_transcript_window already raises the typed SessionNotFoundError on master (fix: Codex P2 review debt: polylogue/daemon part 5 (6 findings) #5728), so read(view="messages") maps it to not_found. The now-dead string-matching translation in get_messages_paginated is removed.
  • The query-excision ledger keeps only ON CONFLICT(ledger_id) DO NOTHING. The schema CHECKs already refuse bad rows, so the worker's extra checks before and after the insert are removed.
  • Repo basenames now split on both path separators, the same as working directories.
  • A list view's outcome now counts the whole collection, not only the returned page.
  • After fix(query): stream orchestration evidence; scope event ranking #5793 made orchestration children a streamed section, the truncation filter narrows children.rows, and its test uses the new builder signature.
  • The worker's tests are corrected:
    • the relative-time and tombstone tests could not pass as written and are fixed;
    • the test file is renamed;
    • tests that only checked prose are narrowed.

Verification

After merging master at 1beb2e5 (merge commit 88afebc):

  • agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w13 (job 2474): verify: PASSED exit=0 ... head=88afebc6e16e.
  • agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w13 -- tests/unit/mcp/test_capability_pointer_routes.py tests/unit/mcp/test_privileged_tools.py tests/unit/mcp/test_session_orchestration.py tests/unit/mcp/test_session_projection_table.py tests/unit/mcp/test_tool_discovery_contracts.py tests/unit/security/test_excision.py tests/unit/security/test_query_excision_scope.py tests/unit/surfaces/test_compaction.py tests/unit/surfaces/test_read_contract.py tests/unit/surfaces/test_session_envelope_derivation.py tests/unit/operations/test_read_view_compact.py tests/unit/agent_integration (job 2475): after the isolated rerun, 1 failed, 7 passed. The one failure, test_published_examples_use_live_operation_vocabularies_and_preconditions, fails the same way on origin/master 1beb2e5 (job 2530: 1 failed).

Before the merge, on 967e01e:

  • verify_quick (job 2071) passed; pytest_focused (job 2070) had 4 failures that also failed on the base (job 2056).
  • Anti-vacuity (job 2028): with every production file in this PR reverted to the base and the new tests kept, 36 failed. Every new test case failed without its fix. The merge changes only the orchestration filter's target (children.rows), and that test still checks the same condition.

Self-review

  • Sibling sites: the repo basename had the same separator bug as the working directory and is fixed too. The MCP not_found relies on the typed error master's transcript-window owner now raises (fix: Codex P2 review debt: polylogue/daemon part 5 (6 findings) #5728). The get list projections are still unpaged, but no finding covers them.
  • Cancellation and loops: no new loops. In the compaction loop, only the identity assigned at return changes.
  • Unbounded reads: list views, reference members and completions now page. The facade calls behind them still load whole lists (see Residuals).
  • Fail-open: boolean overrides with an unknown spelling are refused, and a ledger CHECK failure now raises before any deletion.
  • Compatibility shims: none added. The ValueError string-match translation is removed.
  • Removed symbols: _PERSONAL_STATE_PROJECTIONS moved to query_contracts.PERSONAL_STATE_PROJECTIONS, with every reference updated. session_list_projection_names is still used elsewhere.
  • Production route: the MCP tests call the registered tools, and the excision and compaction tests call the real functions.

Findings

key disposition evidence test
MCP-01 / #4580:polylogue/mcp/archive_support.py:436 fixed-already polylogue/mcp/archive_support.py:439-483 —
MCP-02 / #4353:polylogue/mcp/declarations/registry.py:178 fixed-already polylogue/mcp/declarations/registry.py:208-233 —
MCP-03 / #4698:polylogue/mcp/declarations/registry.py:236 fixed-already polylogue/mcp/declarations/registry.py:270-285; polylogue/agent_integration/spec.py:683-710 —
MCP-04 / #4786:polylogue/mcp/query_contracts.py:154 fixed-already polylogue/mcp/server_cutover.py:325-391 —
MCP-05 / #5480:polylogue/mcp/server_cutover.py:87 fixed-already polylogue/mcp/server_cutover.py:90-92 —
MCP-06 / #5480:polylogue/mcp/server_cutover.py:95 fixed-already polylogue/mcp/server_cutover.py:100-108 —
MCP-07 / #4996:polylogue/mcp/server_cutover.py:326 fixed this PR tests/unit/mcp/test_privileged_tools.py::test_search_continuation_preserves_query_sort_and_omitted_limit
MCP-08 / #4410:polylogue/mcp/server_cutover.py:583 not reached polylogue/mcp/server_cutover.py:839-979 —
MCP-09 / #4295:polylogue/mcp/server_cutover.py:770 fixed this PR tests/unit/mcp/test_tool_discovery_contracts.py::test_personal_state_byte_budget_continuation_advances_from_nonzero_offset
MCP-10 / #4777:polylogue/mcp/server_cutover.py:830 fixed this PR tests/unit/mcp/test_privileged_tools.py::test_reference_relation_query_advances_requested_offset
MCP-11 / #4297:polylogue/mcp/server_cutover.py:856 not reached polylogue/mcp/server_cutover.py:1402-1404 —
MCP-12 / #4424:polylogue/mcp/server_cutover.py:879 fixed this PR tests/unit/mcp/test_capability_pointer_routes.py::test_capability_discovery_includes_messages
MCP-13 / #4424:polylogue/mcp/server_cutover.py:885 fixed-already polylogue/mcp/server_cutover.py:1317-1390 —
MCP-14 / #4424:polylogue/mcp/server_cutover.py:885 fixed this PR tests/unit/mcp/test_privileged_tools.py::test_missing_messages_session_is_not_found
MCP-15 / #4190:polylogue/mcp/server_cutover.py:926 fixed-already polylogue/agent_integration/spec.py:453-475 —
MCP-16 / #4190:polylogue/mcp/server_cutover.py:959 not reached polylogue/mcp/server_cutover.py:1585 —
MCP-17 / #4190:polylogue/mcp/server_cutover.py:959 not reached polylogue/mcp/server_cutover.py:1585 —
MCP-18 / #4256:polylogue/mcp/server_cutover.py:1035 fixed this PR tests/unit/mcp/test_tool_discovery_contracts.py::test_precompact_is_in_the_published_context_contract
MCP-19 / #4256:polylogue/mcp/server_cutover.py:1036 fixed-already polylogue/mcp/server_cutover.py:1680; polylogue/mcp/server_cutover.py:1007 —
MCP-20 / #4419:polylogue/mcp/server_cutover.py:1119 not reached polylogue/mcp/server_cutover.py:1702-1711 —
MCP-21 / #4362:polylogue/mcp/server_cutover.py:1251 not reached polylogue/mcp/server_cutover.py:1830-1867; polylogue/config.py:79-175 —
MCP-22 / #5248:polylogue/mcp/server_cutover.py:1273 fixed this PR tests/unit/mcp/test_session_projection_table.py::test_read_list_views_honor_limit_offset_and_next_page
MCP-23 / #5355:polylogue/mcp/server_cutover.py:1467 fixed this PR tests/unit/mcp/test_capability_pointer_routes.py::test_completions_page_against_shared_owner
MCP-24 / #4213:polylogue/mcp/server_cutover.py:2219 fixed this PR tests/unit/mcp/test_tool_discovery_contracts.py::test_clear_corrections_confirmation_is_discoverable_and_enforced
MCP-25 / #5311:polylogue/mcp/server_cutover.py:2811 fixed this PR tests/unit/mcp/test_privileged_tools.py::TestJudgeTool::test_single_candidate_shorthand_builds_a_one_item_bulk_call
SURF-01 / #4539:polylogue/surfaces/authority.py:65 not reached polylogue/surfaces/authority.py:65; polylogue/mcp/server_cutover.py:1382-1385 —
SURF-02 / #4197:polylogue/surfaces/compaction.py:150 fixed this PR tests/unit/surfaces/test_compaction.py::test_compaction_does_not_invent_canonical_content_hashes
SURF-03 / #4197:polylogue/surfaces/compaction.py:223 fixed-already #5793 (d1abc18): polylogue/surfaces/compaction.py:273-275; covered by tests/unit/operations/test_read_view_compact.py —
SURF-04 / #4197:polylogue/surfaces/compaction.py:263 not reached polylogue/surfaces/compaction.py:271-331 —
SURF-05 / #4197:polylogue/surfaces/compaction.py:276 not reached polylogue/surfaces/compaction.py:276-299 —
SURF-06 / #4197:polylogue/surfaces/compaction.py:292 fixed this PR tests/unit/surfaces/test_compaction.py::test_compaction_identity_commits_to_content_projection_and_provenance
SURF-07 / #4197:polylogue/surfaces/compaction.py:331 fixed this PR tests/unit/surfaces/test_compaction.py::test_compaction_markdown_preserves_fidelity_manifest_and_omission_anchors
SURF-08 / #4201:polylogue/surfaces/payloads.py:1064 not reached polylogue/surfaces/payloads.py:1172-1176 —
SURF-09 / #4201:polylogue/surfaces/payloads.py:1196 fixed this PR tests/unit/surfaces/test_session_envelope_derivation.py::test_domain_session_rows_keep_relative_time
SURF-10 / #4539:polylogue/surfaces/payloads.py:3947 fixed-already polylogue/daemon/http.py:4805-4807 —
SURF-11 / #4201:polylogue/surfaces/query_rows.py:106 fixed this PR tests/unit/surfaces/test_session_envelope_derivation.py::test_session_row_shortens_windows_and_posix_working_directories
SURF-12 / #4321:polylogue/surfaces/read_contract.py:65 fixed this PR tests/unit/surfaces/test_read_contract.py::test_read_boolean_false_overrides_are_not_truthy_strings
SURF-13 / #5515:polylogue/surfaces/read_contract.py:78 fixed this PR tests/unit/surfaces/test_read_contract.py::test_read_github_correlation_false_stays_disabled
SURF-14 / #4321:polylogue/surfaces/read_contract.py:100 fixed this PR tests/unit/surfaces/test_read_contract.py::test_default_read_formats_belong_to_their_profile
SURF-15 / #4321:polylogue/surfaces/read_contract.py:156 not reached polylogue/surfaces/read_contract.py:100-117; polylogue/surfaces/read_contract.py:159-170 —
CTX-01 / #4329:polylogue/context/compiler.py:263 fixed-already polylogue/context/compiler.py:265-284 —
CTX-02 / #4329:polylogue/context/compiler.py:272 fixed-already polylogue/context/compiler.py:292-295 —
CTX-03 / #4385:polylogue/context/configuration_evidence.py:84 fixed-already polylogue/context/configuration_evidence.py:94-96 —
CTX-04 / #4385:polylogue/context/configuration_evidence.py:132 fixed-already polylogue/context/configuration_evidence.py:137 —
CTX-05 / #4385:polylogue/context/configuration_evidence.py:141 fixed-already polylogue/context/configuration_evidence.py:144-176 —
CTX-06 / #4385:polylogue/context/configuration_evidence.py:159 fixed-already polylogue/context/configuration_evidence.py:171 —
CTX-07 / #4385:polylogue/context/configuration_evidence.py:180 fixed-already #5778 (3e9ec3d): declared-name mapping with own-name fallback; worker change dropped —
CTX-08 / #4385:polylogue/context/configuration_evidence.py:204 fixed-already polylogue/context/configuration_evidence.py:216-266 —
CTX-09 / #4385:polylogue/context/configuration_evidence.py:234 fixed-already polylogue/context/configuration_evidence.py:248-261 —
CTX-10 / #4256:polylogue/context/preamble.py:80 fixed-already polylogue/context/preamble.py:74-87; polylogue/api/archive.py:3429-3441 —
CTX-11 / #4634:polylogue/context/preamble.py:83 fixed-already polylogue/operations/facade_writers.py:415-427 —
CTX-12 / #4799:polylogue/context/preamble.py:371 fixed-already polylogue/context/preamble.py:588-601 —
CTX-13 / #4256:polylogue/context/scheduler.py:240 fixed-already polylogue/context/scheduler.py:349 —
CTX-14 / #4256:polylogue/context/scheduler.py:289 fixed-already polylogue/context/scheduler.py:425-437 —
AGENT-01 / #4266:polylogue/agent_integration/data/tool-contracts.json:132 fixed-already polylogue/agent_integration/spec.py:378-392 —
AGENT-02 / #4266:polylogue/agent_integration/data/tool-contracts.json:189 fixed-already polylogue/agent_integration/spec.py:416-421 —
AGENT-03 / #4266:polylogue/agent_integration/data/tool-contracts.json:288 fixed-already polylogue/agent_integration/spec.py:453-475 —
AGENT-04 / #4266:polylogue/agent_integration/data/tool-contracts.json:382 fixed-already polylogue/agent_integration/spec.py:511-516 —
AGENT-05 / #4266:polylogue/agent_integration/data/tool-contracts.json:502 fixed-already polylogue/agent_integration/data/tool-contracts.json —
AGENT-06 / #4266:polylogue/agent_integration/data/tool-contracts.json:631 fixed-already polylogue/agent_integration/spec.py:663-675 —
AGENT-07 / #5449:polylogue/agent_integration/spec.py:411 fixed-already polylogue/agent_integration/spec.py:410 —
AGENT-08 / #5449:polylogue/agent_integration/spec.py:411 fixed-already polylogue/agent_integration/spec.py:410 —
ANALYSIS-01 / #5314:polylogue/analysis/archive_models.py:109 fixed-already polylogue/analysis/archive_models.py:12 —
ANALYSIS-02 / #5608:polylogue/analysis/delegation_work_evidence_materializer.py:48 fixed-already polylogue/analysis/delegation_work_evidence_materializer.py:79-90 —
ANALYSIS-03 / #5608:polylogue/analysis/delegation_work_evidence_materializer.py:106 fixed-already polylogue/analysis/delegation_work_evidence_materializer.py:97-114 —
ANALYSIS-04 / #4678:polylogue/analysis/export_bundles.py:77 fixed-already polylogue/analysis/export_bundles.py:28 —
ANALYSIS-05 / #4864:polylogue/analysis/orchestration_evidence.py:362 fixed this PR tests/unit/mcp/test_session_orchestration.py::test_truncated_orchestration_children_belong_to_retained_topology
ANALYSIS-06 / #4985:polylogue/analysis/pathology.py:192 fixed-already polylogue/analysis/pathology.py:51 —
ANALYSIS-07 / #4678:polylogue/analysis/readiness.py:45 fixed-already polylogue/analysis/readiness.py:43 —
SEC-01 / #4320:polylogue/security/excision.py:574 not reached polylogue/security/excision.py:1091-1092; polylogue/security/excision.py:1382-1426 —
SEC-02 / #5452:polylogue/security/excision.py:1281 fixed this PR tests/unit/security/test_excision.py::TestApplySessionExcision::test_apply_tombstones_marker_assertions_without_retaining_content
SEC-03 / #4200:polylogue/security/query_excision.py:170 fixed this PR tests/unit/security/test_query_excision_scope.py::test_relation_excision_disables_only_watches_whose_baseline_was_removed
SEC-04 / #4200:polylogue/security/query_excision.py:176 not reached polylogue/security/query_excision.py:227-235 —
SEC-05 / #4200:polylogue/security/query_excision.py:176 fixed this PR tests/unit/security/test_query_excision_scope.py::test_a_refused_tombstone_aborts_before_any_deletion

Derived-identity closure

devtools schema closure (scratch job 1963) reports three changed files inside the closure:

  • polylogue/security/query_excision.py
  • polylogue/surfaces/payloads.py
  • polylogue/surfaces/query_rows.py

All other changed production files are outside it. Land this before the next rebuild starts.

Residuals

  • 13 findings were not reached: MCP-08, 11, 16, 17, 20, 21; SURF-01, 04, 05, 08, 15; SEC-01, 04.
  • Compaction pack_ref values change.
  • The facade list methods behind the paged MCP views still load the full list before slicing it.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

Sinity and others added 2 commits September 29, 2026 04:55
Salvage of the unverified worker-13 batch onto current master, reviewed
and corrected: page MCP list reads, completions and reference pipelines;
keep search metadata and limits across continuations; carry personal-state
budget continuations; report missing message sessions as not_found (typed
at the transcript-window owner); advertise precompact, messages and the
single-candidate evidence digest; commit compaction identity to the whole
pack and render its full manifest; parse read booleans and per-view
formats; keep Windows paths compact; keep orchestration children inside
retained topology; tombstone excision markers with a valid ref; disable
watches whose baseline is excised; and stop ledger CHECK failures from
turning into silent deletions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity
Sinity force-pushed the fix/codex-debt-w13-surfaces branch from ea91563 to 967e01e Compare September 29, 2026 03:13
@Sinity Sinity changed the title fix: address worker 13 MCP and surface review debt fix: close worker-13 MCP, surface and excision review findings Sep 29, 2026
@Sinity
Sinity marked this pull request as ready for review September 29, 2026 03:27
@Sinity
Sinity enabled auto-merge (squash) September 29, 2026 03:27
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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
🔒 Security Review ✅ Completed 2026-09-29T03:32:37.473818Z 967e01e Draft marked ready
ℹ️ 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.

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

Search now returns its hits together with the lanes that actually ran,
and the API, daemon, CLI and MCP envelopes all project that one result.
The actions lane no longer needs embeddings. Hybrid fuses the text,
action and vector legs, and when the vector leg is unavailable it
degrades to the lexical legs under the `hybrid` lane. Semantic search
refuses with a typed error instead of leaking provider exceptions or
reporting an empty success. Separately, the hook carrier census now
reads each directory as a stream.

This salvages ChatGPT fleet worker 3's unverified patch for beads
polylogue-1tyq5.35 and polylogue-1tyq5.21. The patch was reviewed,
corrected and verified here.

## Problem

These are Codex findings on PR #4180 and PR #5447. Each was checked
against master before its fix was kept.

- F871: `archive_search_hits` treated `retrieval_lane="actions"` as a
semantic lane. Without a vector backend it raised
`EmbeddingRetrievalNotReadyError` instead of returning action evidence.
- F872: `provider.query()` had no handler around it. When the vector
service failed, hybrid lost its lexical hits and pure semantic search
leaked the provider exception.
- F873: CLI `format_search_envelope`, `session_search_result_payload`
and MCP `archive_search_payload` never passed `execution`. A degraded
hybrid therefore looked healthy on those surfaces.
- F874: the API envelope counted hybrid results through `spec.count()`,
which counts only the semantic leg. The result was `total=0` next to a
full page, and that suppressed continuation.
- F877: a degraded hybrid labelled its hits `dialogue`, so the next
page's hybrid request rejected the cursor this route had minted. This
happened on both the API route and the daemon route.
- F878: sqlite-vec with an empty or wholly stale store returned `[]` as
a successful empty search.
- F879: a degraded hybrid returned text FTS only and dropped the action
leg.
- F141: #5727 already made the compact receipt a fixed-size count. The
census still sorted each carrier directory into a list first, though,
and a day directory holds one carrier per hook process.

## Solution

- `archive_search_hits` returns `ArchiveSearchResult(hits,
retrieval_lane, execution)`, and `project_search_hits` projects it
without rebuilding the lane story.
- Action-block FTS reads through
`ArchiveStore.iter_search_summaries(actions_only=True)`
(`tool_use`/`tool_result` blocks). It streams over one cursor until it
has the requested number of distinct sessions.
- Handling of the vector leg:
  - Cancellation, timeout, work-budget and read-frame errors propagate.
  - `EmbeddingRetrievalNotReadyError` makes the lane unavailable.
  - Any other provider exception makes the lane `execution_failed`.
- The archive's own `semantic_summaries` read is outside that handler,
so an index fault is never relabelled as a vector failure.
- Non-hybrid lanes refuse with a typed error. The session-seed route
keeps its typed refusal when no backend is available.
- `SqliteVecProvider.query` refuses with `readiness_status="empty"`
before buying a query embedding when no `message_embeddings_meta` row
matches the current message and recipe projection. That table is the
writer's own authority for whether a vector exists.
- On the API and MCP routes, hybrid, actions and vector totals are
`null`, which the daemon route already reports. The daemon envelope
`offset` follows the cursor page.
- MCP search routes through the shared ranked read. Two things are
removed:
- `archive_search_payload`'s `retrieval_lane` parameter, which was
ignored because the spec already carries the lane;
  - `archive_search_hit_payload`, which no longer has callers.
- `docs/search.md` describes hybrid degradation, null totals and
semantic readiness.
- The hook census walks one live `scandir` iterator per depth and closes
every iterator.

## Verification

- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/salvage-w3 --wait`, job 2136 on 9e3e005: `verify:
PASSED exit=0`. All 12 gates pass, including mypy, layering and
schema-closure.
- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/salvage-w3 --wait -- <21 files>`, job 2145 on
9e3e005: 358 passed, 3 failed. The selection covers:
  - the new tests;
  - `tests/unit/sources/test_hook_carriers.py`;
  - MCP query, envelope and miss-predicate contracts;
  - daemon reads;
  - the search envelope contract;
  - archive search runtime, near-session and search-hit tests;
  - the API envelope builder;
  - daemon golden parity;
  - the vec and embedding suites;
  - the similarity endpoint;
  - query verbs;
  - `test_query_ordering_authority`.

The 3 failures are in `tests/unit/storage/test_embedding_dedup.py`
(`status 'error' != 'embedded'`). They also fail on the unmodified base
dc21dd4 in job 2133, so they predate this change.
- Negative control: job 2065 ran the new tests on the unmodified base
f7ad8d8. Every fix test failed there:
- F141: the instrumented iterator saw entries collected before any was
inspected.
  - F878: the query embedding was purchased.
  - F874: `total` was 0 instead of None.
- F877: the cursor lane was `dialogue` instead of `hybrid`, and the
daemon rejected its own cursor.
  - F871: `EmbeddingRetrievalNotReadyError` was raised.
  - F872: the `RuntimeError` leaked.
- F873 and F879 failed on the old tuple return shape,
`project_search_hits` arity and missing `.hits`. These are API-shape
failures; their behavioural assertions are covered by the post-fix run.
- The cancellation and archive-fault tests guard the new handler, so
they pass on base by design.

## Self-review

- **Sibling sites.** Every caller of `archive_search_hits` and
`project_search_hits` moved to the new result: API, daemon, the MCP list
and search paths, and tests. `format_search_envelope` and
`session_search_result_payload` have no production callers, but both now
accept and forward execution. The session-seed branch needed a sibling
fix to keep its typed refusal.
- **Cancellation and loops.** Cancellation, deadline, work-budget and
read-frame errors are re-raised ahead of the broad handler. The
lane-candidate loop is one streamed SQL cursor, and it stops once enough
distinct sessions have been read. The worker's version re-issued an
OFFSET query per page, which is quadratic when one session has many
hits.
- **Unbounded reads.** Candidate pools stay at `(offset + limit) * 3`.
The census never holds a directory listing.
- **Fail-open fallbacks.** The broad `except Exception` covers only
`provider.query()`, and it records `execution_failed` as a named
degraded outcome. Non-hybrid lanes refuse with a typed error.
- **Compatibility shims.** None were added. The ignored MCP
`retrieval_lane` parameter and the dead hit-payload helper were deleted
rather than kept.
- **Removed symbols.** A search for `archive_search_hit_payload` finds
only docstring mentions. The monkeypatch targets for
`archive_search_hits` in the MCP tests were updated to the new return
type.
- **Tests on the production route.** The lane tests use real seeded
archives through `open_operation_read`, `Polylogue`,
`execute_read_operation` and the MCP builder; only the external vector
service is substituted. The readiness test exercises
`SqliteVecProvider.query` on a snapshot connection, with vec-extension
loading stubbed out.

## Findings

| key | disposition | evidence | test |
| --- | --- | --- | --- |
| F871 | fixed | master `archive_execution.py` sent `actions` down the
vector path |
`test_actions_without_embeddings_return_only_action_evidence` |
| F872 | fixed | master had no handler around `vector_provider.query` |
`test_vector_execution_failure_degrades_hybrid_and_refuses_semantic`,
`test_vector_read_cancellation_is_not_a_successful_hybrid_degradation`,
`test_archive_read_failure_is_not_relabelled_as_a_degraded_vector_lane`
|
| F873 | fixed | master CLI and MCP `build_search_envelope` calls had no
`execution` |
`test_cli_and_both_mcp_builders_preserve_degraded_execution` |
| F874 | fixed | master `search_envelope_builder.py` used `total = await
spec.count(...)` |
`test_hybrid_api_does_not_publish_semantic_only_total` |
| F877 | fixed | master's degraded hybrid returned `"dialogue"` |
`test_degraded_hybrid_api_cursor_keeps_request_lane`,
`test_degraded_hybrid_daemon_cursor_keeps_request_lane` |
| F878 | fixed | master's `_query_unlocked` bought an embedding with no
readiness check | `tests/unit/storage/test_vector_query_readiness.py` |
| F879 | fixed | master's degraded hybrid returned lexical-only hits |
`test_degraded_hybrid_fuses_action_rank_contributions` |
| F141 | fixed (residual) | master `_carrier_scope_summary` still called
`sorted(entries)` |
`test_compact_carrier_census_streams_wide_directories` |
| F139 | fixed-already | #5727 (ee567d0); `hook_producer.py:282`:
producers never wait for the drain | - |
| F675 F683 F684 F781 F890 F891 F892 (1tyq5.21); F786 F815 F823 F830
(.8); F248 F446 F447 F448 (.11); F417 F797 F893 (.13); F696 F708 (.17);
F605 F672 F674 (.26); F035 F103 F722 F723 (.32) | not reached | - | - |

## Derived-identity closure

`devtools schema closure` reports these changed files as IN:

- `polylogue/archive/query/archive_execution.py`
- `polylogue/archive/query/search_contract.py`
- `polylogue/archive/query/search_hits.py`
- `polylogue/sources/hook_producer.py`
- `polylogue/storage/search_providers/sqlite_vec_queries.py`
- `polylogue/storage/sqlite/archive_tiers/archive.py`

Every other changed file is out. The edits are semantic, so the
candidate identity may move; land this before a rebuild starts.

## Residuals

- MCP search hits are now built by
`SessionSearchHitPayload.from_search_hit`, so they gain `matched_terms`
and a domain-shaped session summary. The focused MCP and parity suites
pass with this.
- On a wholly stale store, the readiness probe runs one primary-key
lookup per current message.
-
`tests/unit/sources/test_hook_carriers.py::test_compact_and_materialize_ten_thousand_events`
is a timing test. It failed twice under host load (758 and 1018 events/s
against a threshold of 2000) and passed in the final run. Its timed
window, `materialize_hook_carriers`, does not include the changed
census.
- `polylogue/mcp/server_cutover.py` loses one line, and #5779 also edits
that file, in other hunks.

🤖 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]>
Resolve by intent:
- transcript_window.py: take master (#5728). It already raises the typed
  SessionNotFoundError, which supersedes this branch's change there.
- api/archive.py: keep the removal of the dead ValueError string-match
  translation and pass master's content_projection through.
- compaction.py: take master's integer tool-flag fix (#5793); SURF-03 is
  now fixed on master and its duplicate test is dropped (master's
  test_read_view_compact covers it).
- server_cutover.py: advertise mcp_read_view_names() beside master's
  read_view_profile_ids (#5783).
- orchestration_evidence.py: #5793 made children a streamed _Section, so
  the truncation filter now narrows children.rows; the test calls the new
  build_session_orchestration(session_id, topology) signature.
- Test files: keep both sides' added tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity
Sinity merged commit e768517 into master Sep 29, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the fix/codex-debt-w13-surfaces branch September 29, 2026 07:51
Sinity added a commit that referenced this pull request Sep 29, 2026
…#5811)

## Summary

Resumed transcript windows now read the selection and page size the
continuation was minted for, on both the typed session-owner route and
the generic `session.read` operation. Two stale `prose_with_refs`
compiler tests are realigned with the contracts that changed under them.
Tracking: beads polylogue-zeolc and polylogue-6bhuy (the compiler and
transcript-window items).

## Problem

At origin/master 1beb2e5 (agentctl job 2441), four tests failed:

-
`test_session_owner_operations.py::test_search_read_timeline_and_mcp_use_owner`:
MCP `query(projection="sessions")` sent the default page size with a
continuation, and the owner refused that as widening the window. #5779
has since landed the same fix on master. This PR adds narrowing and
widening assertions for that route.
-
`test_transcript_window_route.py::test_continuation_can_narrow_final_window_without_losing_snapshot_binding`
("dialect mismatch"): the test hand-built a token whose result identity
did not match its request, and `frame_request` reported that as a
dialect mismatch. Reading the code turned up a real bug underneath. On
narrowing, `frame_request` returned the new request, whose default
offset and filters replaced the token's. #5778 fixed the same bug in
`session_reads._transaction` but not here.
- `test_compiler.py`, both `prose_with_refs` tests: #5722 changed the
contracts these tests assert (details under Solution).

Checking the other surfaces that resume a continuation found three more
places where the resumed request's defaults win over the token:

- `message_transcript_window` filtered with the caller's request. A
token-only `sessions.read` resume of a `message_role=("user",)` window
served unfiltered rows at the filtered offset.
- The generic `session.read` (transcript and messages kinds) dropped an
explicit `limit` beside a continuation. The CLI's narrowed resume from
#5785 (remaining bound, `result_too_large` halving) therefore read the
token's full page in production. #5785's tests mock the dispatch, so
they could not catch this.
- The messages kind checked for filters on its own payload, not on the
framed token, so it would resume a filtered owner token and serve
unfiltered rows.

## Solution

- `frame_request`: separate the dialect check from the result-identity
check. On narrowing, keep the token's request and change only `limit`.
- `message_transcript_window`: frame the request once to get the
effective selection, then pass the submitted request to the bound route
so epoch validation is unchanged.
- `daemon_reads._session_window_request`: one builder for both kinds.
With a continuation, a stated `limit` narrows the page (`frame_request`
refuses a larger one) and a stated nonzero `offset` is conflict-checked.
The messages kind checks filters on the framed selection.
- `SessionReadRequest.limit` is now `int | None = None`. The operation
transport forwards every declared field, so the old `limit=200` default
would have read as a request to widen every token-only resume. That was
the cause of the four failures in the first focused run (job 2563).
Handlers still use the declared 200-row window for a fresh read.
- Compiler tests: #5722 added an action `ObjectRef` assertion that
contradicts `ObjectRef.parse`, which has read an action's trailing block
index as a qualifier since #4329. The test is fixed; production is
right. #5722 also made the budget a hard cap, so `max_tokens=80` now
omits every row. The recap test now uses a budget where recapping, not
omission, makes the page fit, and asserts the estimate stays within the
prose budget.
- `docs/session-operations.md` states the resume page-size and filter
rules.

None of the changed production files is in the derived-identity closure
(`devtools schema closure`: all `out`).

## Verification

- `agentctl job start polylogue pytest_focused --workspace … --
tests/unit/mcp/test_session_owner_operations.py
tests/unit/operations/test_transcript_window_route.py
tests/unit/context/test_compiler.py
tests/unit/archive/query/test_continuation_surface_parity.py
tests/unit/cli/test_session_window_continuation_bounds.py
tests/integration/test_transcript_window_differential.py
tests/unit/operations/test_transcript_window_resume_selection.py
tests/unit/operations/test_daemon_reads.py
tests/unit/operations/test_session_read_parity.py
tests/unit/operations/test_session_owner_route_equivalence.py
tests/unit/operations/test_http_session_reads.py
tests/unit/cli/test_read_view_execution_routes.py
tests/unit/operations/test_daemon_protocol.py`, job 2608: `passed 143,
failed 0` (2 flaky on first attempt, below).
- `agentctl job start polylogue verify_quick`, job 2609: succeeded.

New regression tests in
`tests/unit/operations/test_transcript_window_resume_selection.py`:
- A token-only owner resume reads under the token's filters.
- The generic messages kind refuses a filtered owner token.
- Narrowing works identically on the owner route and both generic kinds;
a token-only resume keeps the token's page size through the transport's
declared request; widening is refused.

## Self-review

- **Sibling sites.** Every `QueryContinuation.decode` and
`frame_request` caller was checked. The evidence windows
(`frame_evidence_window`) ignore `limit` on a continuation, and their
only CLI caller sends none, so no wrong rows are served (residual
below). `window_request`, used by the API, MCP `read` and HTTP messages
routes, drops `limit` beside a continuation. The window is then fully
decided by the token. No wrong rows, but an explicit narrowing is
ignored there (residual).
- **Contract change.** `SessionReadRequest.limit` is read only through
`_non_negative_int(..., default=_SESSION_READ_WINDOW)`, which maps
`None` to the 200-row default. No checked-in schema snapshot names it.
- **Double framing.** `frame_request` is pure; calling it twice cannot
diverge, and the bound route still validates the epoch.
- **Compatibility and fail-open.** No shim; a larger limit is refused,
not clamped.
- **Tests on the production route.** The generic reads go through
`SessionReadRequest` validation exactly as the transport does, which is
what exposed the default-limit problem.

## Residuals

- Evidence windows and the `window_request` routes silently ignore an
explicit `limit` beside a continuation. They serve correct rows, but do
not narrow.
- The two first-attempt flakes in job 2608 were daemon start-up timeouts
(`TimeoutError`, `DaemonWriterOwnerLoopStopped`) under host load. They
are unrelated to window framing, and both passed on rerun.

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

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

---------

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

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

## Problem

The kept findings reproduce on current master:

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

## Solution

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

Worker changes not landed:

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

## Verification

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

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

## Self-review

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

## Derived-identity closure

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

## Per-finding dispositions

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

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

## Residuals

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

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

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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