Repository navigation
feat: Complete bounded intake and daemon-owned surfaces - #5550
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
Important Review skippedToo many files! This PR contains 272 files, which is 172 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (272)
You can disable this status message by setting the 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. Comment |
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. |
## Summary Fixes the tests that fail on clean master, and the two product defects behind the biggest groups of them. ## Problem On clean master (checked at `2da021c54`), 11 tests in the web reader, MCP raw-session operations, thread profiles and browser capture failed, 35 in `test_privileged_tools.py` and `test_facade_mutation_census.py`, 5 in `test_session_insight_refresh.py`, and 4 more elsewhere. Two of the causes are product defects: - **API-owned mutations were refused through the daemon.** The daemon labels every machine-protocol principal as surface `cli`. `user.*` overlay operations and `mutation.facade.*` products have no CLI route, and their actuators allow only `mcp`/`api`/`facade`. So a web-reader saved-view save, or an annotation or saved-view delete, answered 409 `SurfaceDeniedError`. Every Python-API or MCP facade write through a running daemon also failed; for example, `add_tag` returned "did not complete: failed". - **The async insight rebuild never cleared profile demand.** `rebuild_session_insights_async` replaced profiles but left the `session_profile_demand` row they satisfied. The profile therefore read `stale` forever, although its binding matched. The sync twin already acknowledges the captured revision. The remaining failures were stale tests, each against a deliberate change: - The index version counter restarted at 1, so `user_version = 1` no longer mismatches. - Raw coverage rows follow configured source order since #5632. - `session_events.summary` was retired in #5446. - Markers are consumed from source-owned accepted inputs since #5493. - #5550 deleted `_execute_facade_mutation`, which the census measured. - `add_raw` gained `prepared_artifact`. - The census wrapper gained a phase commit in #5550. - Retained preparation runs in a spawned worker since #5565, so a 3 s completion bound times out on a loaded host. - `CliRunner.output` interleaves stderr, where `--allow-no-auth` writes its warning. ## Solution - `MutationPrincipal.on_surface(...)`. The user-overlay handler and the facade product handlers now execute as the `api` surface, the public surface that owns them, whichever transport delivered the request. - The facade client lowers tuple arguments to JSON arrays before the strict request models validate them. `bulk_tag_sessions` and `post_blackboard_note` were refused before any daemon call. - The saved-view HTTP route validates its query spec strictly, so a bad field is a 400 with `field`, not a 409 failed operation. - The async rebuild deletes the exact captured demand revision for each rebuilt session. The derived-sweep census declares it and is regenerated; the regeneration also reorders the stale `daemon_ingest.py` entry. - The MCP write, run and confirm-gate tests now run against the real resident operation stack (`running_daemon_operations`). The executor spies and failure-propagation proofs therefore observe the daemon's executor. - `test_facade_mutation_census.py` is deleted. Its own retirement condition fired: the helper is gone and every facade mutation submits a declared operation. - Each stale test is realigned with the contract it tests; see the commit messages. ## Verification - `devtools test` over the 11 affected test files plus the three `test_revision_backfill.py` ids and `test_raw_observation_owner.py`: `707 passed` (receipt `20260927T193036Z-focused-test-1998248-bb6cdb4a`, pre-rebase; the rebase onto `917fcaa17` applied cleanly and touched none of these files except an unrelated appended web-reader test). - `devtools verify --quick` passed before the last two test-only edits; the hosted quick gate covers the pushed head. - Derived-sweep census round-trip re-checked on the rebased tree: identical. - `devtools schema closure`: `mutation_transaction.py` and `derived/session/rebuild.py` are IN, so this lands before a rebuild. The other changed production files are OUT. ## Residuals - The route-family declarations carry placeholder examples (`default`/`route`) that no handler accepts, for example `/api/import/explain` and `/api/webui/freshness` return 400. The example replay now covers the kernel-bound routes only; `polylogue-otmpm` tracks making the family examples real. - A pre-reset archive (index `user_version` 67) is now classified `upgrade_runtime`, because the counter restarted at 1. The old archive is inert salvage and is never opened, so this was not changed. 🤖 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]>
A daemon rejection reached MCP callers as 'internal error (DaemonOperationRejectedError)', dropping the typed code and detail the daemon returned, for example why a saved view cannot be watched. MCP now relays both, as the CLI does. Public archive writes are daemon-owned since #5550, so MCP tests that write now run against the real operation stack through a shared tests/infra/mcp.py helper. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
## Summary Fixes one product defect and realigns daemon and MCP tests that fail on master because they encode superseded contracts. ## Problem A per-directory run of `tests/unit/daemon` and `tests/unit/mcp` on clean master (`03c543dfe`) failed 28 and 11 tests. This PR covers the clusters below. Other failures belong to named owners or need a decision; see Residuals. - **Product defect: MCP hides daemon rejections.** When the resident daemon refused a write before durable acceptance, MCP callers saw `write: internal error (DaemonOperationRejectedError)`. The daemon's typed code and detail were lost, for example why a saved view cannot be watched. - **MCP tests that write with no daemon.** Public archive writes are daemon-owned since #5550. Nine MCP tests plus three standing-query tests still wrote with no daemon and got `FacadeDaemonRequiredError`. - **Stale daemon expectations:** - Since #5621 a snapshot with no rich observation is `unavailable`, not `stale`. - #5664 passes `derivation_barrier` to the converger, which the test double did not accept. - The mark-delete route test compared against the raw payload rather than the request model's normalized one. - The chunk-cost test measured the first chunk after seeding. Since #5657, that chunk also prunes the seeding's raw-existence journal, one trigger firing per row, so its cost grew with archive size once. - The insights failure injection patched the facade the route no longer reads. ## Solution - `_exception_to_error_json` relays `DaemonOperationRejectedError` with the daemon's code and detail, as the CLI does. - New `tests/infra/mcp.py::daemon_served_runtime_services` runs the real operation stack on the archive's socket for MCP write tests. The load-evidence test seeds its deliveries under the daemon and measures reads without it. - Each stale expectation is realigned; the chunk-cost test converges one warm-up chunk and measures a steady-state chunk. ## Verification `devtools test` over the affected daemon and MCP tests plus the MCP error-translation tests: `165 passed, 1 failed` (receipt `20260928T000820Z-focused-test-736375-35660df1`, pre-rebase). The one failure is `test_working_dir_demand_withholds_profile_readiness`, tracked in polylogue-6remh. The rebase kept master's own fix to `test_convergence_debt_alert.py` and dropped this branch's change to that file. No other conflicts. Review follow-up (`f189af7`): `WatchDefinitionError` declares `invalid_watch_definition`. MCP reports an undeclared (prose) rejection code as `rejected`. `DaemonClient` keeps a pre-dispatch refusal's public detail. `devtools test tests/unit/mcp/test_tool_error_isolation.py …::test_skewed_write_refusal_is_pre_dispatch_not_an_indeterminate_mutation tests/unit/daemon/test_standing_queries_default_evaluator.py` passed (receipt `20260928T003051Z-focused-test-966381-9c978486`). `devtools schema closure`: `archive/query/watch_definition.py` is IN, so this lands before a rebuild. ## Residuals - polylogue-6remh (filed): since #5570, periodic profile ticks run the startup audit before demanded work. This starves demand and contradicts #5540's idle-tick contract. It leaves `test_two_accepted_revisions_survive_one_periodic_profile_pass`, `test_working_dir_demand_withholds_profile_readiness` and likely `test_real_factory_defers_hot_target_without_losing_the_no_hint_cursor` red. - Not covered here: - master-fix-owned clusters: the read-authorizer `not authorized` regression, `selected_session_parts` and `raw_observation_derivation`; - daemon failures still to diagnose: schema preflight behind the #5657 frontier gate, status baseline `ok`, evidence-summary lineage authority, stale archive storage, Drive asserted-authority growth, the watcher-hint timeout, and status component metadata. 🤖 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]>
…ent routes The periodic retry drains through _drain_convergence_debt_backlog (#5692), so patching the single-page helper let the real drain run. Status is served by the daemon (#5550); with none running it reports unavailable rather than materialization counts, which the find/analyze/readiness surfaces still compute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ent routes The periodic retry drains through _drain_convergence_debt_backlog (#5692), so patching the single-page helper let the real drain run. Status is served by the daemon (#5550); with none running it reports unavailable rather than materialization counts, which the find/analyze/readiness surfaces still compute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
- fail the evidence-summary lineage read where the route imports archive_read_context now (#5550); - keep the structural-error preflight test's stub cursor outside the archive root, which the #5657 source-selection gate would block; - give the healthy raw-materialization fixture a denominator, since an empty archive is unmeasured, never ready (#5491); - expect the component metadata's completed_at and collection_duration_s fields. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
## Summary A degraded live batch now returns before it touches the archive, and five stale daemon test expectations match current contracts. ## Problem These failures are from a clean-master run of `tests/unit/daemon` (base `03c543dfe`), outside the clusters that PR #5705 and the master-fix owner cover. - **Product: degraded ingest still hit the archive.** `_ingest_files` ran `require_cursor_authority()` before its `is_fully_degraded()` short-circuit. That gate reads the archive's existence journals on every call. Under an event burst, a degraded daemon therefore did the per-file archive access the short-circuit exists to prevent (#1003). On unreadable tiers it raised `CursorAuthorityBlockedError` instead of skipping (`test_ingest_files_short_circuits_under_burst_after_degraded`). - **Stale tests:** - The evidence-summary test patched `http.archive_read_context`, but the route (moved in #5550) imports it from `archive.query.transaction` at call time, so the injected lineage failure never fired. - The structural-error preflight test placed a stub `index.db` in the archive root without a source tier. The #5657 source-selection gate correctly blocks that archive before the full parse the test drives. - The "healthy" raw-materialization fixture had zero raw artifacts, which #5491 classifies as unmeasured, never ready. - The component-metadata test predates the `completed_at` and `collection_duration_s` fields. ## Solution - The degraded check now runs first. The authority gate and refused-path filtering follow in their original order, so a non-degraded batch behaves as before. - Each stale test is realigned as described in the commit messages. ## Verification - `devtools test tests/unit/daemon/test_status_unmeasured.py tests/unit/daemon/test_status_observations.py tests/unit/daemon/test_schema_preflight.py tests/unit/daemon/test_daemon_http.py`: `64 passed, 1 failed` (receipt `20260928T002626Z-focused-test-923898-aafe19be`). The one failure, `test_daemon_status_names_every_halted_unit_and_is_not_ok`, is left as it is on master; see Residuals. - `devtools schema closure polylogue/sources/live/batch.py`: IN, so this must land before a rebuild. ## Residuals Still red on master, and not addressed here: - `test_daemon_status_names_every_halted_unit_and_is_not_ok`: an initialized empty archive has never had a green `ok` baseline since #5491. Pinning collectors healthy was not enough, so this needs its own diagnosis. - `test_drive_phased_matches_ordinary_document_growth`: no asserted-authority revision with a predecessor. - `test_daemon_watcher_hints_wake_fair_intake_and_canonical_derivation`: intake discovers no source carrier. - polylogue-6remh: periodic profile ticks starve demand. 🤖 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]>
The embedded-facade durable writers moved to operations/facade_writers.py and check require_archive_write_authority before opening a tier, but no test drove that refusal, and api/archive.py kept an unused wrapper of the check. Add a test that runs three writers against an archive whose pidfile lock is held by another process, and delete the dead wrapper. The OpenAPI renderer overwrote every declaration's security with the auth-policy default, which erased the explicit cookie requirement on DELETE /api/web-auth/session (broken by #5550). #5720 special-cased that one route; keep any explicitly documented security instead. The rendered document is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
## Summary Integrates orphaned branch `w10/s2` and cleans up an inherited red on master. Three separate changes: 1. Adds a test that the embedded-facade writers refuse an archive whose daemon is resident. Deletes the unused `_require_archive_write_authority` wrapper in `api/archive.py`. 2. The OpenAPI renderer keeps security that an operation documents explicitly, instead of special-casing one route. 3. Pre-acquisition intake reports a retryable read as a typed `RetryableSourceReadError`, so the batch no longer adds an `except sqlite3` degradation site. The `batch.py` anchor that #5727 admitted is removed from the degradation baseline. It also adds the missing `otel-genai` row (tightness 95) to the detector table in `docs/atlas/sources-parsers.md`. ## Problem - `w10/s2` (70ee4e97c4) added lease checks to seven API mutation routes. Master already runs the equivalent `require_archive_write_authority` check in each of those writers, now in `operations/facade_writers.py`. No test drives that refusal, and the old wrapper in `api/archive.py` has no callers. - `test_openapi_publishes_typed_first_party_credential_contract` broke at #5550 (da5346d). The renderer began overwriting every declaration's `security` with the auth-policy default, which cleared the explicit `webCredentialCookie` requirement on `DELETE /api/web-auth/session`. #5720 (960d0ec) fixed it by hard-coding that one method and path. - #5729 added an `except (OSError, sqlite3.Error)` handler that degrades to retry in `batch.py`, and #5727 admitted it to the degradation baseline. ## Solution - `tests/unit/operations/test_facade_writer_authority.py` holds the daemon's `flock` on `daemon.pid` from a separate process, which is the same token `polylogued run` holds. It then drives the manual-continuation, context-ledger and comparative-judgment writers. Each writer must raise `ArchiveWriterOwnershipError` naming the PID, and must leave no `*.db` in the archive root. - `render_openapi` uses `operation.setdefault("security", ...)`. I compared every operation's security before and after, and the rendered document is identical. - `classify_pre_acquisition` converts a retryable OS or SQLite read fault, including one from the readability probe, into `RetryableSourceReadError(path, cause)`. Non-retryable errors propagate unchanged, and a probe failure on bytes that are not a database leaves the exclusion standing. `batch.py` catches the typed error, and `production_baseline.py` records it as `revision_io_unavailable`. New test: `test_pre_acquisition_reports_a_retryable_read_as_its_typed_fault`. - `batch.py`, `batch_support.py` and `production_baseline.py` are in the derived schema closure. No rebuild has started (`polylogue-reindex-2026.1` is open). ## Verification - `devtools test tests/unit/sources/test_live_batch_support.py tests/unit/sources/test_production_baseline.py tests/unit/sources/test_cold_build_generation.py tests/unit/operations/test_facade_writer_authority.py tests/unit/devtools/test_render_openapi.py`: `PASSED exit=0` - Hosted `ci/circleci: quick-gate` on the head. ## Residuals - The facade test covers three of the eight writers. The others need a seeded `user.db` to reach their check. 🤖 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 Realigns the master tests whose failures are stale tests rather than code defects: 16 test ids, 12 from the coordinator's list plus the pinned read-only store test. Each one asserted a contract that a later PR changed on purpose. The fixes below are grouped by the PR that broke them. ## Problem and fix, by breaking PR | Breaking PR | Tests | Why they fail | Fix | | --- | --- | --- | --- | | #5564 (0723a95) | `test_pinned_read_only_store_blocks_all_archive_tier_mutations`, `test_convergence_one_shot_readers_cannot_mutate` | The read profile's authorizer rejects writes at prepare time with `DatabaseError: not authorized`, before SQLite's own `OperationalError: readonly` is reached. | Expect `sqlite3.DatabaseError` matching `not authorized\|readonly`. The existing checks that nothing changed stay. | | #5550 (da5346d) | Seven `test_store_ops` tag tests | Facade writes now belong to the daemon: `add_tag` and `remove_tag` raise `FacadeDaemonRequiredError` when no daemon is running. | The three parametrized tests run the resident writer on the archive's own socket, through a new `tests/infra/daemon_operations.daemon_serving_archive`; the MCP helper now reuses it. The Hypothesis tag law calls `ArchiveStore.add_user_tags`, the primitive the daemon's actuator applies. It clears `open_connection`'s per-path cache between examples, because otherwise each new example archive keeps about 11 descriptors and trips the fd-leak guard. | | #5700 (f2562c3) | `test_daemon_required_envelope_preserves_resolved_archive_root` | #5700 made a daemon-absent machine refusal exit with `FAILED_READ_EXIT_CODE` (1). The test, added in #5722, asserted 2. | Assert `FAILED_READ_EXIT_CODE`. | | #5727 (ee567d0) | `test_recent_attempts_report_the_file_count_not_the_session_count` | Read-only opens now check derived schema identity, so a hand-built `ops.db` is refused and the probe returns no attempts. | Seed a real ops tier with `initialize_archive_database` and a valid status. | | #5727 | `test_compare_reports_archive_derived_readiness_deltas` | `compare` is now not ok when either side's convergence-debt ledger is unavailable, and a missing `ops.db` counts as unavailable. | Initialize `ops.db`. | | #5727 | `test_unavailable_debt_is_rendered_unknown_and_cli_fails_closed` | The test was added in #5727 and never passed: `"0 failed" not in output` also matched the attempt-count line (`0 running, 0 failed`), which has existed since #4010. | Check only the convergence-debt line. | | #5551 (aa19052) | `test_daemon_workload_probe_does_not_claim_derived_ready_on_schema_mismatch` | Under the fresh format every tier starts at `user_version = 1`, so writing 1 no longer produces a mismatch. | Set `user_version = 2`. | Not in this PR: - `test_raw_existence_journal_is_declared_as_content_free_bookkeeping` was a real duplicate declaration and is fixed in #5767. - polylogue-njwky (sqlite-vec on async attaches) was confirmed real and is fixed in #5765. ## Verification - `devtools test tests/unit/security/test_excision_carrier_reach.py tests/unit/security/test_excision.py tests/unit/storage/test_archive_tiers_archive.py tests/unit/daemon/test_maintenance_read_profiles.py tests/unit/cli/test_machine_main.py tests/unit/sources/test_refused_state_is_reported.py tests/unit/operations/test_daemon_workload_probe.py tests/unit/storage/test_store_ops.py tests/unit/mcp/test_mcp_writer_boundary.py`: `PASSED exit=0` (run with #5767's change applied) 🤖 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 Fixes the still-real parser findings from bead polylogue-1tyq5.27 (unhandled Codex P1 review threads on merged PRs). ## Problem - Admission accounting was fail-open: the production Claude Code multi-session stream, Codex streams and undecorated lowered routes produced sessions with no outer-record ledger (F695, F779), and a record without an unknown-type sentinel was counted as materialized even when the parser skipped it, e.g. a scalar record in a JSONL stream (F780). - OTel GenAI: every span re-emitted the full input history, duplicating earlier messages (F075); usage was kept only for `chat` operations (F077); unnamed resources collapsed onto one id and merged unrelated sessions (F079); ordinary HTTP/DB traces in a GenAI export became zero-message sessions (F080). - Drive: one event carried the whole citation list, so an appended citation changed that event's identity and revision membership read ordinary growth as ambiguous (F507). - Preflight refused a verified Antigravity trajectory schema whose steps produced no messages, so its typed empty/unsupported evidence could never be acquired (F350). ## Solution - `base_support.AdmissionObserver`: one classifier per session's outer records (materialized / typed unknown / typed refusal for non-object records). `parser_admission` uses it; the Claude Code stream keeps one observer per session group; the Codex stream route and `_parse_lowered_spec` apply it to single-session results that lack a parser ledger. - `otel_genai`: history-overlap suppression per conversation transcript, usage fallback for any operation, resource ids derived from the resource attribute set when `service.name` is absent, and a filter keeping only traces that contain a GenAI span. - `drive`: one `gemini_citation` event per citation with its ordinal. - `import_preflight`: a verified schema with trajectory rows is admissible, with caveats for no-message and degraded steps. Other findings in the group were already fixed on master or belong to other work: F319 (#4966/#4972), F351 (#5403), F419 (#5550), F505 (#4861), F647 (#4587), F850 (#4236); F029 is routed to the intake enrichment work (#5643). ## Verification - `devtools test` over the OTel, Drive contract, preflight, admission, Codex event-stream and `tests/unit/sources/parsers` selections: 1 failure in a new test (a missing `messages=[]`), fixed; that test passes alone. - New tests: history dedup, distinct unnamed resources, non-GenAI trace exclusion, non-chat usage, grown citation list, verified trajectory without messages, Claude Code stream admission, scalar-record refusal. ## Residuals - Hermes multi-session ATIF streams still lack per-session admission; noted on the bead. - `base_support.py` overlaps #5682's in-place event handling; a small rebase conflict is expected. - Schema closure: the parser files are in the derived identity closure, so this must land before the fresh build. ## Self-review I reviewed the whole diff at the final head, not only the last round. The findings are grouped by the invariant each one protects. **Admission conservation (every emitted session carries a closed proof)** - `admit_parsed_sessions` proves every session that lacks its parser's own ledger. The document is observed once and the closed proof is shared (`AdmissionObserver._closed_proof`), so an N-session document costs one scan. - Every origin's scanner reads only discriminators: - Claude: record `type` and block `type`. - Codex: envelope and payload `type`. - Hermes: `type`/`kind`/`record_type` and step kinds. - OTel: span `kind`, registered under the provider token the route passes (`opentelemetry`). - The default scan used by the other undecorated routes never descends into `arguments`/`input`/`output`/`result`/`attributes`, so a tool argument `{"type": "unknown"}` is data, not a wire type. - The streamed Hermes ATIF carrier that master added in #5776 now gets the same proof as the dispatch route over the same bytes. Each step's `type`/`kind` is observed as the parser consumes it, so no second decode is needed and a future step kind beyond the classifier's 64-step witness is still recorded as a typed unknown (`test_streamed_atif_trajectory_carries_the_dispatch_admission_proof`). I checked the other #5776 streaming routes. The Claude AI, AI Studio/Drive chunked and ChatGPT routes reach decorated parsers, and Grok admits through `grok.parse_conversation`. - Admission events are appended in place to a disk-backed sink, and any other non-list sequence is copied into a list first. This keeps master's #5643 contract through the merge. - A record the parser skips is a typed refusal, never `MATERIALIZED`: - a non-object; - a Claude record with no string type (`recognized=False`); - a known-kind ATOF record that `looks_like_atof_payload` rejects (`malformed=True`). **Identity stability (an export revision updates, never duplicates, a session)** - OTel resource ids depend only on the resource's own stable attributes. They exclude instance, version and cardinality, so adding a second resource keeps the first one's sessions. - Copies of one span coordinate that disagree on `gen_ai.conversation.id` choose none (trace-keyed). - A shared ancestor belongs to the conversation whose descendant started first, so it cannot move when a sibling conversation is appended. - Trace membership and parent links work across resources within a trace. A span keeps its own resource (`resource_id` in its evidence), and spans with equal ids under different resources stay distinct. - Antigravity: rowids are never identity. Several trajectories with no id are refused (`LogicalExportError`), and one anonymous trajectory keeps the path fallback. **Complexity**: the history overlap is a KMP pass, linear in both lengths. **Checked and left as is**: Drive chunk/citation handling after the master merge (a conflict was resolved by combining master's `event_rows`/`chunk_records()` with this PR's `_citation_events`), and the Claude event ordering (`order_session_events`). **Verification** (final head 85329da): - `devtools test tests/unit/sources/parsers/test_otel_genai.py tests/unit/sources/test_admission_payload.py tests/unit/sources/parsers/test_antigravity.py tests/unit/sources/test_prepared_hermes_atif_object.py tests/unit/sources/test_prepared_claude_ai_object.py tests/unit/sources/test_prepared_drive_chunked_object.py tests/unit/sources/parsers/test_hermes_spans.py tests/unit/sources/test_parsers_base.py tests/unit/sources/test_parser_admission_packet.py tests/unit/sources/test_prepared_jsonl.py tests/unit/sources/test_first_future_type_duplicate_keys.py`: 352 passed, 0 failed. - `agentctl job start polylogue verify_quick`: succeeded (job 2117). **Residuals**: - polylogue-hlghl: ParseAccounting compresses unknown outcomes (pre-existing). - A Hermes duplicate event key is still counted as materialized: its evidence is carried by the first copy. 🤖 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]>
## Summary Four intake tests failed on master at 1beb2e5. Each encoded a route or contract that an earlier PR had changed. None is a production bug, so this PR changes tests only. One sibling guard that could never fire is tightened too. ## Problem (evidence) I reproduced the failures in one focused job over the four files (agentctl job 2555) and diagnosed them with probe tests that were not committed (including jobs 2635 and 2660). All four failures are deterministic, not load-related. - `test_page_admission_runs_lease_free_owners_outside_the_writer_gate`: `admit_page` returned `RETRYABLE` with `CursorAuthorityBlockedError: ... global raw existence is unproven: required source or index tier is unavailable`. The fixture created only `index.db`. The cursor-authority gate added in #5657 fails closed when one tier exists without the other, which is the intended behavior. - `test_watcher_queues_behind_daemon_maintenance_writer`: the test paused `LiveParseStage.warm`. The batch has called only `warm_paths` since #5550, so the pause never happened and `parser_started.wait(5.0)` timed out. - `test_dispatcher_page_compaction_cost_is_one_scoped_hold_at_archive_scale`: each page traced 4 SELECTs instead of 3. The fourth is `SELECT identity FROM schema_identity WHERE tier = 'index'`, which every validated read-only open has run since #5727. The three authority reads are unchanged. - `test_flag_on_prefetch_and_flag_off_produce_identical_archive_content`: the snapshots differ in `raw_sessions`, `raw_revision_heads` and `raw_authority_parser_census`. - The prefetch arm writes `full`/`byte_proven` raws with byte heads. - The production arm (`converge_raw_observations`, which uses the retained preparation from #5643) writes `unknown`/`quarantined` raws with semantic heads. - The prefetch arm drives `DaemonParseStage` and `backfill(prefetch_cache=...)`. No production module has constructed `DaemonParseStage` since #5002, and `RawObservationDerivation.compute` always builds `RawObservationReplacement(payload=None)`. So production archive content never goes through the route that differs. ## Solution - Lease-free owners test: bootstrap a whole archive with `initialize_active_archive_root`, and put the source under its own root. - Maintenance-queueing test: pause `warm_paths`, the method the batch calls in `_ingest_full_paths`. Replace the 5 s and 1 s wall-clock waits with waits on the events themselves: an `asyncio.Event` set with `call_soon_threadsafe`, plus the maintenance-entered event. A `finally` releases the parked thread. pytest-timeout bounds a hang. - Compaction-cost test: separate the per-open identity read. Assert there is exactly one, which means the page used one connection, then keep the three-authority-read assertions. Raise the hang guard to 600 s, the same as its sibling measurement test: in one probe run under host load (average about 22), the 120 s default fired during seeding. - Delete the prefetch equivalence test and the helpers only it used. polylogue-fhlo1 tracks deleting or rewiring the dead `DaemonParseStage` and `LiveParseStage.warm` routes. - Sibling: `test_page_admission_acquires_source_without_reading_unavailable_index` forbade `warm`, which production never calls. The batch also swallows prewarm exceptions, so a raising stub would have passed anyway. The test now records calls to `warm_paths` and asserts there were none. No production file changes, so the derived-identity closure is untouched. ## Verification - `agentctl job start polylogue pytest_focused --workspace /realm/worktrees/polylogue-mh-intake --wait -- tests/unit/sources/test_live_batch_convergence.py tests/unit/sources/test_live_watcher_locking.py tests/unit/daemon/test_dispatcher_intake_measurement.py tests/unit/daemon/test_raw_materialization_parse_stage_equivalence.py tests/unit/sources/test_live_watcher.py::test_page_admission_acquires_source_without_reading_unavailable_index` (job 2688, head d81534d): `devtools test: PASSED exit=0 diagnosis=pytest_passed`, 21/21. - `agentctl job start polylogue verify_quick --workspace /realm/worktrees/polylogue-mh-intake --wait` (job 2696, head d81534d): `verify: PASSED exit=0`. ## Self-review - **Siblings.** I searched `tests/` for patches of the unused `warm`. One other guard patched it; it is fixed here. The remaining `stage.warm(...)` calls in `test_parse_prefetch.py` and `test_live_watcher_parse_stage_equivalence.py` test the dead classes directly and belong to polylogue-fhlo1. - **Fix itself.** The identity filter matches only `from schema_identity`, and it asserts exactly one match, so an extra connection per page still fails the test. The authority-read assertions are unchanged. - **Anti-vacuity.** - Maintenance queueing: wrapping the page in `coordinator.run` blocks maintenance, so `maintenance_entered` never sets and pytest-timeout fails the test. - Lease-free owners: the owner-outside-gate assertions are unchanged. - Derived-only guard: removing the `_source_tier_acquisition_required()` gate records a call. - **Interruption.** The parked parse thread is released on every exit from the wait block, so a failing run does not leave a thread blocking executor shutdown. - **Waits.** The only wall-clock bounds left in the changed tests are `coordinator.shutdown(timeout=1.0)` after all tasks finish, which was already there, and the pytest-timeout marks. - **Public boundary.** Synthetic fixtures only. - **Docs.** `docs/design/convergence-simplification-inventory.md` still cites the deleted equivalence test. That design note describes the dead route as a whole, so it is left to polylogue-fhlo1. ## Residuals - In one repro job under load, the deleted test's seeding hung for 120 s in `BlobPublicationReservationStore.reserve_many` at `conn.close()`. Sibling tests in that file use the same seeding and passed. I did not reproduce it again. - `tests/unit/daemon/test_daemon_cli.py` load-sensitivity did not show up in my runs, so it is not addressed 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]>
Summary
Complete bounded daemon intake and move remaining CLI, API, and browser paths onto declared operations. Large JSONL files now prepare sealed SQLite artifacts outside writer transactions; the publisher validates their source and index dependencies before applying them. Retryable unattempted files return to fair discovery, and cold builds finish their file pages before raw materialization resumes.
Problem
Workers previously returned whole parsed session trees to the parent. A file deferred by a batch time budget could retain its full admission charge, preventing the next discovery pass from reaching it. Several read views and mutations still used local routes, while the browser and logging/harness paths lacked a common production boundary.
Solution
uias terminal/theme owner andrenderingas format adapters.Verification
devtools verify --quick— passed on cleanf915c354; all blocking gates passed (consumer-reachability reported 12 static false positives from dynamic routes, relative imports, and scratch-table readers; report-only).devtools test tests/integration/test_daemon_resilience.py::test_sigkill_recovery— 1 passed; all 33 sessions recovered after SIGKILL.f915c354; earlier focused logging, harness, and continuity selections passed during integration.npm test -- src/lib/api.test.ts src/islands/archive-overview.test.tsx src/islands/observability.test.tsx— 3 files, 7 tests passed.ci/circleci: quick-gate— passed onf915c354before squash mergeda5346d.Residuals
The 419 MB and 1.6 GB ordinary-daemon qualifications, old-archive custody/cutover, and complete-suite measurements occur after this build-affecting source is merged. The operator selected focused checks only; no affected or full pytest suite was run.