Repository navigation
fix(daemon): mark failed rich status refreshes stale - #5621
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: 5cdb9c7f32
ℹ️ 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".
5cdb9c7 to
89fd444
Compare
- expect an unavailable snapshot when no rich observation exists (#5621); - let the converger test double accept derivation_barrier (#5664); - expect the request model's normalized mark payload; - measure a steady-state chunk: the first chunk after seeding also prunes the seeding's raw-existence journal, one trigger per row (#5657); - inject the thread-insight failure at the ArchiveStore the route reads. 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]>
|
Closing out open Codex review threads on this PR (evidence checked against master at 0914f89):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
Failed rich daemon-status collection now reports unavailable when there is no prior rich snapshot, or stale while retaining the last coherent rich payload and its original capture time. HTTP status metadata, EvidenceValue freshness, and metrics use the same classification. A successful refresh clears the failure.
Problem
An exception from
daemon_status_payload()on an unchanged archive frame replaced the rich payload with minimal failure data but still reportedstatus_snapshot.state=fresh. The browser monitor treated that observation as connected.Solution
Keep prior coherent evidence advisory on refresh failure, retain the failure reason, and classify each snapshot through one function shared by the HTTP and metrics projections. A neutral sequence test covers first failure, prior-good failure, and recovery.
Verification
devtools test tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_daemon_events_endpoint.py -k 'status_snapshot or status_etag': 16 passed, 147 deselected (receipt20260927T101210Z-focused-test-2560209-7884f86b, tested pre-rebase commit842a2ff84).devtools verify --quick: passed (receipt20260927T101435Z-quick-2576444-9c3ccbc1, tested pre-rebase commit842a2ff84).devtools schema closure polylogue/daemon/status_snapshot.py: out.No full or affected suite was run. The commit was rebased onto master without conflict; the hosted candidate gate will check the final PR head.