Skip to content

feat(context,insights): reboot handoff refs and delegation work evidence - #4329

Merged
Sinity merged 3 commits into
masterfrom
integration/batch-12a
Aug 27, 2026
Merged

Sinity merged 3 commits into
masterfrom
integration/batch-12a

Conversation

@Sinity

@Sinity Sinity commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

Integration batch: two lanes with disjoint file sets, merged onto one branch and verified together.

lane change
polylogue-37t.3 reboot handoff refs — claude_session_start_payload takes reboot_from, and a prose_with_refs context segment renders authored prose verbatim with tools as independently resolvable refs
polylogue-1vpm.6 delegation work-evidence materializer plus its convergence stage

Problem

Both lanes finished but never published; per-lane PRs are the wrong unit here, since the landing discipline is one PR per coherent batch.

polylogue-1vpm.6 was held back in an earlier batch for adding a 135-line materializer with no test of its own. It now ships tests/unit/insights/test_delegation_work_evidence_materializer.py (138 lines), so that objection is resolved rather than waived.

Solution

Merged onto integration/batch-12a, rebased onto current master. No repair was needed — the gate was green once the two viable lanes were isolated.

Verification

devtools verify --quick → green (exit 0).
devtools test tests/unit/context/test_compiler.py → 9 passed.
devtools test tests/unit/insights/test_delegation_work_evidence_materializer.py → 2 passed.
Red-flag scan: one flag, production lines removed, read and benign — the three removed lines are a widened claude_session_start_payload signature and the asset read moving into a local variable that still includes it.

Residual risk

tests/unit/daemon/test_convergence_stages.py reports 2 failed, 47 passed here, identically on clean master (test_archive_insights_execute_ids_deduplicates_session_ids, ..._rebuilds_quiet_subset_when_some_sessions_are_hot). Inherited, not introduced by this batch.

Four lanes were dropped from the batch and remain unintegrated: ofry, 82rm5, nrlsl, and three that conflict (9l5.6, 3utv.1, bj5h). Reasons recorded on their beads.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

@coderabbitai

coderabbitai Bot commented Aug 27, 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bd56c428-ae6a-4074-b409-00e0e9a024f4


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 b78a25c into master Aug 27, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the integration/batch-12a branch August 27, 2026 08:11

@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: a4d180d5c7

ℹ️ 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/api/archive.py Resolved
Comment thread polylogue/api/archive.py Resolved
Comment thread polylogue/context/compiler.py Resolved
Comment thread polylogue/api/archive.py Resolved
Comment thread polylogue/context/compiler.py Resolved
Comment thread polylogue/daemon/convergence_stages.py Resolved
Sinity added a commit that referenced this pull request Aug 27, 2026
…nce (#4329)

## Summary
Integration batch: two lanes with disjoint file sets, merged onto one
branch and verified together.

| lane | change |
| --- | --- |
| polylogue-37t.3 | reboot handoff refs — `claude_session_start_payload`
takes `reboot_from`, and a `prose_with_refs` context segment renders
authored prose verbatim with tools as independently resolvable refs |
| polylogue-1vpm.6 | delegation work-evidence materializer plus its
convergence stage |

## Problem
Both lanes finished but never published; per-lane PRs are the wrong unit
here, since the landing discipline is one PR per coherent batch.

`polylogue-1vpm.6` was held back in an earlier batch for adding a
135-line materializer with no test of its own. It now ships
`tests/unit/insights/test_delegation_work_evidence_materializer.py` (138
lines), so that objection is resolved rather than waived.

## Solution
Merged onto `integration/batch-12a`, rebased onto current master. No
repair was needed — the gate was green once the two viable lanes were
isolated.

## Verification
`devtools verify --quick` → green (exit 0).
`devtools test tests/unit/context/test_compiler.py` → `9 passed`.
`devtools test
tests/unit/insights/test_delegation_work_evidence_materializer.py` → `2
passed`.
Red-flag scan: one flag, `production lines removed`, read and benign —
the three removed lines are a widened `claude_session_start_payload`
signature and the asset read moving into a local variable that still
includes it.

## Residual risk
`tests/unit/daemon/test_convergence_stages.py` reports `2 failed, 47
passed` here, identically on clean master
(`test_archive_insights_execute_ids_deduplicates_session_ids`,
`..._rebuilds_quiet_subset_when_some_sessions_are_hot`). Inherited, not
introduced by this batch.

Four lanes were dropped from the batch and remain unintegrated: `ofry`,
`82rm5`, `nrlsl`, and three that conflict (`9l5.6`, `3utv.1`, `bj5h`).
Reasons recorded on their beads.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Sinity added a commit that referenced this pull request Aug 27, 2026
…nce (#4329)

## Summary
Integration batch: two lanes with disjoint file sets, merged onto one
branch and verified together.

| lane | change |
| --- | --- |
| polylogue-37t.3 | reboot handoff refs — `claude_session_start_payload`
takes `reboot_from`, and a `prose_with_refs` context segment renders
authored prose verbatim with tools as independently resolvable refs |
| polylogue-1vpm.6 | delegation work-evidence materializer plus its
convergence stage |

## Problem
Both lanes finished but never published; per-lane PRs are the wrong unit
here, since the landing discipline is one PR per coherent batch.

`polylogue-1vpm.6` was held back in an earlier batch for adding a
135-line materializer with no test of its own. It now ships
`tests/unit/insights/test_delegation_work_evidence_materializer.py` (138
lines), so that objection is resolved rather than waived.

## Solution
Merged onto `integration/batch-12a`, rebased onto current master. No
repair was needed — the gate was green once the two viable lanes were
isolated.

## Verification
`devtools verify --quick` → green (exit 0).
`devtools test tests/unit/context/test_compiler.py` → `9 passed`.
`devtools test
tests/unit/insights/test_delegation_work_evidence_materializer.py` → `2
passed`.
Red-flag scan: one flag, `production lines removed`, read and benign —
the three removed lines are a widened `claude_session_start_payload`
signature and the asset read moving into a local variable that still
includes it.

## Residual risk
`tests/unit/daemon/test_convergence_stages.py` reports `2 failed, 47
passed` here, identically on clean master
(`test_archive_insights_execute_ids_deduplicates_session_ids`,
`..._rebuilds_quiet_subset_when_some_sessions_are_hot`). Inherited, not
introduced by this batch.

Four lanes were dropped from the batch and remain unintegrated: `ofry`,
`82rm5`, `nrlsl`, and three that conflict (`9l5.6`, `3utv.1`, `bj5h`).
Reasons recorded on their beads.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Sinity added a commit that referenced this pull request Aug 28, 2026
…nce (#4329)

## Summary
Integration batch: two lanes with disjoint file sets, merged onto one
branch and verified together.

| lane | change |
| --- | --- |
| polylogue-37t.3 | reboot handoff refs — `claude_session_start_payload`
takes `reboot_from`, and a `prose_with_refs` context segment renders
authored prose verbatim with tools as independently resolvable refs |
| polylogue-1vpm.6 | delegation work-evidence materializer plus its
convergence stage |

## Problem
Both lanes finished but never published; per-lane PRs are the wrong unit
here, since the landing discipline is one PR per coherent batch.

`polylogue-1vpm.6` was held back in an earlier batch for adding a
135-line materializer with no test of its own. It now ships
`tests/unit/insights/test_delegation_work_evidence_materializer.py` (138
lines), so that objection is resolved rather than waived.

## Solution
Merged onto `integration/batch-12a`, rebased onto current master. No
repair was needed — the gate was green once the two viable lanes were
isolated.

## Verification
`devtools verify --quick` → green (exit 0).
`devtools test tests/unit/context/test_compiler.py` → `9 passed`.
`devtools test
tests/unit/insights/test_delegation_work_evidence_materializer.py` → `2
passed`.
Red-flag scan: one flag, `production lines removed`, read and benign —
the three removed lines are a widened `claude_session_start_payload`
signature and the asset read moving into a local variable that still
includes it.

## Residual risk
`tests/unit/daemon/test_convergence_stages.py` reports `2 failed, 47
passed` here, identically on clean master
(`test_archive_insights_execute_ids_deduplicates_session_ids`,
`..._rebuilds_quiet_subset_when_some_sessions_are_hot`). Inherited, not
introduced by this batch.

Four lanes were dropped from the batch and remain unintegrated: `ofry`,
`82rm5`, `nrlsl`, and three that conflict (`9l5.6`, `3utv.1`, `bj5h`).
Reasons recorded on their beads.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Sinity added a commit that referenced this pull request Sep 1, 2026
…nce (#4329)

## Summary
Integration batch: two lanes with disjoint file sets, merged onto one
branch and verified together.

| lane | change |
| --- | --- |
| polylogue-37t.3 | reboot handoff refs — `claude_session_start_payload`
takes `reboot_from`, and a `prose_with_refs` context segment renders
authored prose verbatim with tools as independently resolvable refs |
| polylogue-1vpm.6 | delegation work-evidence materializer plus its
convergence stage |

## Problem
Both lanes finished but never published; per-lane PRs are the wrong unit
here, since the landing discipline is one PR per coherent batch.

`polylogue-1vpm.6` was held back in an earlier batch for adding a
135-line materializer with no test of its own. It now ships
`tests/unit/insights/test_delegation_work_evidence_materializer.py` (138
lines), so that objection is resolved rather than waived.

## Solution
Merged onto `integration/batch-12a`, rebased onto current master. No
repair was needed — the gate was green once the two viable lanes were
isolated.

## Verification
`devtools verify --quick` → green (exit 0).
`devtools test tests/unit/context/test_compiler.py` → `9 passed`.
`devtools test
tests/unit/insights/test_delegation_work_evidence_materializer.py` → `2
passed`.
Red-flag scan: one flag, `production lines removed`, read and benign —
the three removed lines are a widened `claude_session_start_payload`
signature and the asset read moving into a local variable that still
includes it.

## Residual risk
`tests/unit/daemon/test_convergence_stages.py` reports `2 failed, 47
passed` here, identically on clean master
(`test_archive_insights_execute_ids_deduplicates_session_ids`,
`..._rebuilds_quiet_subset_when_some_sessions_are_hot`). Inherited, not
introduced by this batch.

Four lanes were dropped from the batch and remain unintegrated: `ofry`,
`82rm5`, `nrlsl`, and three that conflict (`9l5.6`, `3utv.1`, `bj5h`).
Reasons recorded on their beads.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Sinity added a commit that referenced this pull request Sep 29, 2026
## 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 #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 (#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 #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 (#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.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
…#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

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

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

Resolving the fixed, stale and refuted threads; tracked threads stay open.

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

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

  • P1 polylogue/api/archive.py:3753: Fixed on master (checked at f88b4a6): The manual-continuation insert omits status entirely, leaving resolvedness to resolved_dst_session_id (polylogue/operations/facade_writers.py:349-353).

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

@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

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

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

@Sinity

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 c950478):

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

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 62.F061 / P1: fixed-already at the checked revision: The daemon atlas now explicitly lists delegation evidence alongside Claude workflow and the other surviving generic responsibilities at docs/atlas/daemon.md:49. The missing delegation-stage inventory entry described by the finding has been added.

Only the rows listed above are dispositioned. Held findings remain open.

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