Repository navigation
fix(intake): prepare retained non-JSON raws without size cap - #5565
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (24)
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]>
Summary
Prepare retained non-JSON raws in an isolated process worker without the old payload-size refusal.
Problem
A retained raw beyond the old size cap could remain outside ordinary materialization even when its parser supported it. The first worker patch opened archive tiers directly from the source layer, bypassing the declared read boundary.
Solution
Route non-JSON retained preparation through the same sealed artifact publication path and inject an operations-owned worker that pins the archive through
open_operation_read. The worker revalidates its descriptor, blob and enrichment dependencies before publishing; worker exit and stale input remain retryable. Content-aware routing keeps logical SQLite/Hermes exports named.jsonon their proper parser route. The separate 419 MB and 1.6 GB completed-convergence qualifications remain under58bwo, and the broader one-route work remains under9m93s.Verification
devtools testwith the seven exact selectors for non-JSON over-limit replay, text/JSON parity, SQLite page and logical-export replay, worker death, canonical daemon raw admission and discovery costs: 9 selected, 9 passed on the frozen refactor content; receipt20260926T221843Z-focused-test-4118482-81995384.devtools gate controlled-read: zero violations;devtools gate schema-closure: 565 observed/565 baseline;devtools verify --quick: passed, receipt20260926T222117Z-quick-4130603-b8e512a5on that content.dddac2422after feat(intake): stream whole JSON preparation into sealed shards #5562. The same seven exact selectors passed 9/9 on clean published headd50005095, receipt20260926T225042Z-focused-test-48131-03662e2f. The hosted quick gate checks that head. An independent read-only review found no concrete wrong output or missing production caller.A wider three-file test selection was cancelled after it reached an unrelated 4,096-row bound test and occupied the managed pytest slot for 11 minutes. It is not acceptance evidence. The isolated worker still materializes a non-JSON parser's complete session tree; this PR removes the size refusal and makes that failure retryable, while bounded representation for supported large JSON is handled separately.