Repository navigation
fix(reads): page post-filter and cost-status scopes instead of refusing - #5703
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6181a1c00b
ℹ️ 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".
97ede4a to
86ecbf4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86ecbf4305
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
polylogue/polylogue/api/archive.py
Lines 915 to 921 in 3d39e6c
For an unfiltered facets request over a multi-million-session archive, paging the summaries no longer caps the scope, but every session ID is still retained in both seen_session_ids and session_ids until aggregation finishes. Resident memory therefore grows with the entire corpus and can terminate the request instead of returning the promised complete facets; for the global scope the ID list is not even passed to the SQL aggregation. Count global rows without retaining IDs, and aggregate scoped deferred families incrementally by page.
AGENTS.md reference: AGENTS.md:L163-L164
ℹ️ 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".
…ng them A content-dependent exclusion and a cost status filter now scan their candidate scope in SQL pages and stop once the requested page is full, instead of refusing scopes above 20,000 sessions. The delete preview no longer refuses selections above 10,000 ids; it already splits them into bounded preview chunks. Session links in the HTTP session detail and a delegation's annotation refs are no longer silently cut at 20. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
The facet aggregation read at most 1,000,000 sessions and reported the rest as a truncated gap. It now reads the whole matched scope in pages, so the denominator is always the full scope. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Post-filter candidate paging drops `sample` and a random sort so offsets are stable; randomization applies to the survivors. The facet scope walk ignores sample and sort for the same reason. The public session-cost route scans enriched pages until a status/model-filtered page is full. Delete preview, authorize, cancel, and execute requests no longer count ids or chunk refs; max_body_bytes bounds the transport. The evidence summary drops its stale lineage_limit field. Tests: the facet stub accepts offset, and the lineage-unreadable test patches the module the handler imports archive_read_context from. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
Every delete phase shares the preview's 64 MiB body bound, since authorize, cancel, and execute carry one ref per preview chunk. A post-filtered facet scope is one survivor pass instead of a restart per facet page. Random and sampled post-filter windows use reservoir sampling, and offsets on post-filter and cost-status pages are skipped with islice instead of being retained. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
… refs _iter_facet_scope's non-exclude_text_terms branch still paged with a growing OFFSET, redoing O(N) of prior-page work per page over an ordered/grouped scan; it now drives archive.iter_summaries/ iter_search_summaries with limit=None, one cursor for the whole scope, matching the exclude_text_terms branch already fixed. The delegation card's assertion-ref lookup had no page bound at all; it is now capped at 50 refs with a declared annotation_refs_truncated flag threaded through ArchiveDelegationCard and DelegationCardPayload. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
3d39e6c to
dee4a1e
Compare
There was a problem hiding this comment.
💡 Codex Review
polylogue/polylogue/api/archive.py
Lines 912 to 918 in dee4a1e
For a facets request matching millions of sessions, the supposedly streamed scope still retains every unique ID twice—once in session_ids and once in seen_session_ids—before deferred aggregation begins, so memory grows with the entire archive and the request can be OOM-killed instead of returning complete buckets. Fresh evidence at this head is that the single-cursor follow-up removed the SQL paging overhead but left this full-scope materialization intact; aggregate membership incrementally or through a temporary relation rather than accumulating it in Python.
AGENTS.md reference: AGENTS.md:L105-L108
ℹ️ 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".
…lacements quick-gate failed on the previous push: FACET_SCOPE_PAGE, COST_STATUS_FILTER_PAGE and SESSION_COST_FILTER_PAGE no longer exist after single-pass streaming replaced offset paging, and one facade fake still implemented list_summaries/list_session_cost_insights where the production code now calls iter_summaries/ iter_session_cost_insights. Retarget the tests at the surviving SUMMARY_FETCH_BATCH/COST_INSIGHT_FETCH_BATCH constants and the streaming methods. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
polylogue/polylogue/api/archive.py
Lines 915 to 918 in aae5a91
For an unfiltered facets request over a multi-million-session archive, this loop now retains every ID twice—once in session_ids and once in seen_session_ids—after the former one-million-row cap was removed. Although the summary cursor itself streams, the request can still consume hundreds of megabytes or be killed before returning any buckets; keep only running totals for the global scope and use a streamed or temporary membership relation for scoped deferred families.
AGENTS.md reference: AGENTS.md:L105-L108
ℹ️ 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".
A delete preview echoed every canonical session id, so an accepted selection above the operation result bound was durably prepared but undeliverable. The result now carries session_count and the first DELETE_PREVIEW_SAMPLE_IDS ids; the full selection stays in the durable preview chunks its refs name. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db32999f30
ℹ️ 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".
Post-filter candidates read through iter_summaries/iter_search_summaries in one pass instead of re-walking an OFFSET per page. Facet aggregation keeps no session list: scoped SQL families are summed per bounded chunk, the global route aggregates without ids, and search-scope duplicates are tracked on scratch disk. Tests retarget the retired paging constants. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4ab3da3db
ℹ️ 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".
# Conflicts: # polylogue/api/archive.py # polylogue/api/insights.py
Update the three production-route delete stubs to session_count and session_ids_sample, drop type-ignores the typed search/list filters made unused, and prune the cli-nonzero-click-exit baseline entry master fixed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5742d9f28b
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66d9f46a13
ℹ️ 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".
The constant returns to mutation_transaction so audit's derived-identity closure does not grow; the protocol validates the leading slice and the CLI checks the sample is non-empty, unique and no larger than the count. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
## Summary Second pass over P1 Codex review findings left open on PRs merged 2026-08-20..09-27 (tracked in polylogue-1tyq5). It fixes 17 findings that still cite live code at `e20f6f5a3`. ## Problem Several read and exit paths decided their outcome from the wrong facts: - a search page reported `ok` over zero returned rows because it used the query total; - `stats` reported complete totals while the archive was still converging; - facets and judge listings exited 0 on empty or degraded outcomes; - a missing daemon exited with an ad hoc 2, which is the `empty` code. Other findings covered stale connection reuse, swallowed failures, and a rate-limit misclassification: - FTS bulk repair skipped unchanged sessions that were missing FTS rows. - Thread-title reads treated any SQLite error as an absent table. - Deferred insight invalidation reused a cached connection after the index path was repointed. - An unreadable ops ledger fell back to a legacy index answer. - The browser extension treated a shared provider cooldown as a transport failure. ## Solution - **Search:** outcome from `len(hits)`; filter-only structured specs list sessions; fallback ranks are absolute across offsets. - **Stats:** outcome is `degraded` (`archive_not_converged`) while the convergence warning applies. - **Exits:** stats, facets, judge listings (including interactive) and daemon-absence exit through `OUTCOME_EXIT_CODES` / `FAILED_READ_EXIT_CODE`. Machine errors may carry an `outcome` document; the schema is regenerated. - **FTS repair:** targets changed sessions plus sessions missing FTS. - **Thread titles:** absence is a table-presence check; every read error propagates. - **Insight invalidation:** opens a fresh connection on each delivery. - **Preamble:** writer-ownership refusal is treated as unavailable context. - **Cursor lag:** an unreadable ops ledger is reported as unavailable. - **Hook producer:** the carrier lock is an explicit `fcntl.flock` pair. - **Browser extension:** a shared cooldown takes the rate-limit route. A resolved rate-limited failure records the cooldown, using the default delay when there is no Retry-After. ## Disposition summary (second pass, 748 findings) | Class | Count | |---|---| | BEAD | 347 | | ROUTED | 248 | | OBSOLETE | 92 | | FIXED-LATER | 36 | | FIXED | 17 | | INVALID | 5 | | OBSOLETE-FRESHV1 | 3 | - **BEAD:** filed as 39 grouped child beads, `polylogue-1tyq5.1`–`.39`, each listing its findings. - **ROUTED:** the open PR that owns those lines. ## Verification - Final head `dc8f0c84d` (rebased on master): `devtools test` over the 17 changed or affected test files → `devtools test: PASSED exit=0` with 348 passed and no reruns. The files are the FTS repair, thread state, search builder/contract/cursor, write effects, machine main, exit codes, judge, display label, output schemas, cursor lag, embedding progress, hook producer, terminal outcomes, operation audit, and JSON output tests. - After the last review round (typed outcome, seeded-search exclusion, receipt withdrawal): `devtools test` over output schemas, search builder, machine main, embedding progress, operation audit and terminal outcomes → `devtools test: PASSED exit=0`. - Browser extension (vitest): background, backfill and browser_action → 180 passed. The new bare-429 test fails when the old null-delay guard is restored. - `mypy` on the changed production and test files: no issues. - Two tests are red from before this PR and not fixed here: - `test_convergence_surface_contract.py::test_converging_archive_surfaces_share_materialization_counts` fails with `KeyError: 'raw_materialization'` at its `status` step. - `test_preamble.py::test_declared_claim_survives_judgment_preamble_and_reboot_ref` now needs a daemon for `judge_assertion_candidate`. The embedding config stub was missing `sinex_mode`; that is fixed forward here. ## Residuals - F090 (failed embedding backfill replays as `indeterminate`): the partial fix was withdrawn after review. A truthful failed receipt needs the result contract, the lifecycle outcome and a bounded error changed together, and is recorded on polylogue-1tyq5.15. - Hosted quick gate: every gate reports `ok`, but the run is voided with `checkout_moved_during_run` in CI. This also happens on #5704, another PR that touches `browser-extension/`, while #5703 without extension changes passes. It is inherited and not caused by this diff. - Schema-identity closure: `surfaces/payloads.py`, `archive/write_effects.py`, `storage/sqlite/agent_thread_state.py` and `sources/hook_producer.py` are IN the derived closure (`devtools schema closure`). Landing this moves the derived identity, so it must land before a fresh rebuild starts, not during one. - Two inherited red tests above are not fixed here. - 347 findings remain as beads, not fixes. Six P1 groups carry high-severity items: work events, ingest integrity, parsers, single-writer residue, destructive operations, and raw authority. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
… args A search post-filter scan yields each session once, a negative post-filter offset or limit reads as the SQL route does, and the cost-insight read receipt names its status and model filters. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2365b05dfc
ℹ️ 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".
Preview, authorization and execution batches are accepted under one durable request per phase, appended in pages of the continuity bound: the first page accepts the request (staged kind <kind>-pages, lifecycle running), the final page completes it, and a retry after a restart resumes from the pages already accepted. This removes the 40-part (10,240-session) ceiling, and the CLI follows each phase to completion through the operation await route within a 300 s budget (polylogue-zxbbl). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85b29632ce
ℹ️ 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".
… together Cancellation is paged like the other phases; the accepted-reference model no longer caps part counts; every page of a preview shares one expiry measured from the request's durable acceptance; and startup fences a paged request its dead daemon left half-accepted, so a follower reaches a terminal interrupted outcome and resubmits. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f5ac596bb
ℹ️ 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".
…rows A later page failing stops its staged request so it reads terminal; the preview result is counted and sampled from the durable rows instead of rebuilding the target list; cancellation has the paged phases' budget. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4707718d4d
ℹ️ 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".
…thorizations Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7ae74c6d1
ℹ️ 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".
…dlines Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80f80c34d1
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21951148b3
ℹ️ 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".
## Summary Realigns 11 tests that fail on master. Each encodes a contract that a merged PR changed on purpose. Production code is unchanged. ## Problem These tests failed at master 1beb2e5 (baseline agentctl job 2441, `devtools test --on-default-branch`). Beads: polylogue-cp3z5 (lineage validation) and polylogue-bn8gg (facade `record_context_ledger`). The other items are in polylogue-6bhuy, which also lists items owned by sibling PRs. | Test | Contract change | | --- | --- | | `tests/unit/devtools/test_lineage_validation.py` (all 21) | The hand-built index lacks `messages.fields_digest` and the derived schema identity stamp. Every reader refuses an unstamped derived tier as `SchemaSkew` ("expected <digest>, found None"). | | `test_facade_contracts.py::test_no_undiscovered_async_methods` | `record_context_ledger` (#5722) and `get_session_summaries` are in no contract set. | | `test_facade_contracts.py::test_archive_facet_buckets_count_unique_sessions_for_duplicate_hits` | #5703 moved deduplication into the search-scope walk. The unscoped path yields each session once by construction, so the duplicate case is a search hit. | | `test_preamble.py::test_precompact_uses_scheduler_and_records_real_boundary_context` | The precompact path awaits `record_context_ledger` (#5722). The mock was a plain `MagicMock` attribute, and the other test in the file set it twice. | | `test_manual_contract.py::test_published_examples_use_live_operation_vocabularies_and_preconditions` | `read`'s `view` is now `Literal[...] \| None`. `typing.get_args` on the union yields the Literal and `NoneType`, not the members. | | `test_write_effects.py::test_deferred_insight_invalidation_follows_a_repointed_index` | #5727 moved profile invalidation into the admitted transaction, so no deferred reopen by path is left to follow. | | `test_mutation_actuators.py::...::test_production_tag_and_metadata_writes_use_user_overlay_policy` | #5727 made tag writes that change a row invalidate the search cache. | | `tests/unit/cli/test_status.py::...::test_sinex_status_reads_the_active_archive_file_set` | #5722: publication mode comes from the loaded config, and the file set from `resolve_runtime_config()`. | | `tests/unit/cli/commands/test_status.py::...::test_configured_override_url_is_not_refused` | #5722: a non-built-in daemon URL is read over HTTP `GET /api/status`. | ## Solution Each test now exercises the current contract and keeps its anti-vacuity condition: - **Lineage validation.** The fixture declares `fields_digest` and stamps the current identity with the production `stamp_derived_schema_identity`. - **Facade.** Both methods are classified. `get_session_summaries` gains coverage in `test_archive_tiers_api_reads_native_sessions`: requested ids key the result, and an unresolved id is omitted. The facet test drives two hits for one session through the search scope. - **Manual contract.** The vocabulary is read through unions, and the test asserts `"messages"` is in it, so an empty read cannot pass. - **Write effects.** The test now proves the invalidation commits and rolls back with the caller's transaction. An effect that opened its own connection would survive the rollback. - **Tag overlay.** Expects exactly one invalidation per changed tag write, and none for metadata writes or the no-op re-add. - **Status.** The URL-override test runs a real local HTTP server and asserts only `/api/status` was requested. ## Verification - `agentctl job start polylogue pytest_focused --workspace <wt> -- tests/unit/devtools/test_lineage_validation.py tests/unit/api/test_facade_contracts.py tests/unit/context/test_preamble.py tests/unit/agent_integration/test_manual_contract.py tests/unit/archive/test_write_effects.py tests/unit/operations/test_mutation_actuators.py tests/unit/cli/test_status.py tests/unit/cli/commands/test_status.py`: job 2632, `devtools test: PASSED exit=0`, 582 passed. Five tests passed only on rerun. Each failed first with `DaemonWriterOwnerLoopStopped ... daemon.operation_journals.startup` or a 5 s bridge `TimeoutError` in the test daemon stack; that race is fixed in #5810. - `agentctl job start polylogue verify_quick --workspace <wt>`: job 2633, succeeded. ## Self-review - **Production route.** Each rewritten test calls the production function (`stamp_derived_schema_identity`, `_invalidate_insights_effect` on a real connection, `_status_operation_result` against a real HTTP listener, `ArchiveStore` tag writes). None asserts a mock's own behaviour. - **Loosening.** No assertion was dropped. The facet and write-effects tests change input shape to match the current route, and each keeps a condition that fails if the named behaviour regresses. - **Scope.** Test-only; no derived-identity closure file changes. ## Residuals None known for these tests. The daemon-stack startup race behind the five reruns is addressed in #5810. 🤖 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]>
Summary
Removes three fixed scope caps that refused valid read and delete requests, and two silent
LIMIT 20truncations (bead polylogue-2q2lm).Problem
exclude_textpost-filtering refused any scope over 20,000 candidate sessions (POST_FILTER_HYDRATION_CAP,PostFilterScopeTooLargeError); facets degraded to an empty scoped bucket set with a gap.list_session_cost_insights(status=...)refused scopes over 20,000 sessions (COST_STATUS_FILTER_CANDIDATE_CAP,PostFilterAfterLimitError).Solution
POST_FILTER_CANDIDATE_PAGE, a pacing bound) into the existing chunked hydration, which stops once the requested page is full. The refusal type and the facet gap plumbing that only it fed are removed.offset + limitmatches are found.LIMIT 20clauses are removed; these per-session relations are returned whole.Verification
devtools test tests/unit/cli/test_query_route_differential.py tests/unit/api/test_facade_contracts.py::test_cost_insight_filters_refuse_or_precede_the_limit tests/unit/daemon/test_http_write_coordination.py tests/unit/operations/test_mutation_actuators.py→ 121 passed, 1 failed. The failure (test_prepare_and_apply_expose_marker_carrier_terminal_evidence:raw_existence_changeshas no declared excision reach) comes from the frontier journal tables on master, not this change.Residuals
FACET_SCOPE_SESSION_CAPstill truncates facet denominators, visibly as a named gap; not changed here.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4