Repository navigation
feat(daemon): stabilize evidence read API routes (#1847) - #2169
Conversation
Problem: /api/assertions and /api/sessions/:id/recovery already return shared DTOs and power the web workbench, but route metadata and generated API docs still marked them as shell-only. That left the #1847 local API boundary partly implicit. What changed: promote both routes to stable route contracts, publish their RecoveryReadPayload and AssertionClaimListPayload schemas in generated OpenAPI, and update daemon/workbench docs plus route/OpenAPI tests. Verification: - devtools test tests/unit/daemon/test_route_contracts.py tests/unit/devtools/test_render_openapi.py (83 passed) - devtools test tests/unit/daemon/test_web_reader.py -k 'RecoveryEndpoint or AssertionEndpoint or shared_surface_dtos' (16 passed) - devtools verify --quick (exit_code 0, run 20260619T152613Z-quick-1454498-b524cb34) Ref #1847
|
Warning Review limit reached
More reviews will be available in 18 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b66c0d5685
ℹ️ 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".
| "in": "query", | ||
| "description": "Maximum claims returned.", | ||
| "required": False, | ||
| "schema": {"type": "integer", "minimum": 1, "default": 50}, |
There was a problem hiding this comment.
Align assertion limit default with handler
When clients omit limit, the published OpenAPI contract says /api/assertions defaults to 50 rows, but the handler actually calls clamp_query_limit(self._get_int(params, "limit", 20), default=20) and returns limit: 20. Since this route is being promoted as a stable generated API surface, generated clients and docs will overstate the default page size for unbounded assertion reads unless the schema is changed to 20 or the handler default is raised.
Useful? React with 👍 / 👎.
## Summary Bounds the verification harness paths that were still capable of turning broad pytest-testmon selections into multi-GiB, single-process runs. Selection artifacts now preserve exact selected/deselected counts while sampling node IDs, default affected-test verification runs through a bounded xdist pool, run metadata records managed basetemp cleanup, and resource summary parsing streams the resource log instead of loading it wholesale. ## Problem Local verify evidence showed two distinct failure shapes: - `devtools verify --seed-testmon --skip-slow` selected about 11.5k tests with `-n 4`, peaked around 3.1 GiB PSS, and wrote about 3.0 GiB of pytest basetemp data. - A default `devtools verify` selected about 11.3k tests with `-n 0`, kept one Python process around 2.8 GiB PSS, and hit the 45-minute supervisor timeout. Focused `devtools test ...` runs stayed around 100-140 MiB RSS, so the implicated surface was broad/default harness behavior, not the ordinary inner loop. A fresh `ps` sample of the installed `polylogued` during this work was about 216 MiB RSS after 6h25m, so this PR does not claim a daemon retention fix. ## Solution - `devtools.pytest_progress_plugin` now samples selected/deselected node IDs (`POLYLOGUE_PYTEST_SELECTION_NODEID_LIMIT`, default 500) while retaining exact counts and omitted-count metadata. - `devtools verify` now defaults the affected pytest-testmon lane to `-n 4`, matching seed/full broad lanes, while focused `devtools test` remains single-process by default. - Pytest step metadata now records `basetemp_cleanup`, making post-run temp-tree reclamation visible in verify history. - Resource-summary projection streams `resources.jsonl` rather than materializing all samples in memory. - `polylogue ops status` facade-route catalog was updated for `neighbor_candidate_payloads` and `session_correlation_payload`; the broad verify run found this real drift after #2169. - Testing docs and generated `AGENTS.md` describe the new worker and selection-artifact behavior. ## Verification - `devtools test tests/unit/cli/test_status.py::test_archive_facade_route_catalog_covers_public_async_facade tests/unit/cli/test_plain_cli_snapshots.py::test_json_status_snapshot tests/unit/devtools/test_pytest_progress_plugin.py tests/unit/devtools/test_verify.py tests/unit/devtools/test_run_tests.py` -> 74 passed. - `devtools verify --quick` -> exit 0, run `20260619T162135Z-quick-1620666-9bbe9eae`. - Initial broad-path proof: `devtools verify` selected 11,544 tests with `-n 4`, completed in 36:03 instead of timing out, recorded `basetemp_cleanup`, and peaked at 4.38 GiB PSS; it failed one status route-catalog test, which this PR fixes. - Final `devtools verify` after the catalog/snapshot fix -> exit 0, run `20260619T162202Z-testmon-1622183-8c640aa0`; pytest step selected 10, ran 1 affected test, passed, and recorded `basetemp_cleanup` plus peak PSS 553.1 MiB. Closes #2170
Summary
Promotes the assertion and recovery evidence helper routes to stable local API routes, publishes them in generated OpenAPI, and updates the daemon/workbench docs around the stable read surface.
Problem
/api/assertionsand/api/sessions/:id/recoveryalready returned shared DTOs and powered the web workbench, but the route contract still classified them as shell-only and generated OpenAPI omitted them. That left part of #1847's local API boundary implicit even though the implementation was already reusable.Solution
/api/assertionsand/api/sessions/:id/recoveryas stable route contracts with typed response payloadsRecoveryReadPayloadandAssertionClaimListPayloadthrough the generated OpenAPI documentdocs/daemon.mdVerification
devtools test tests/unit/daemon/test_route_contracts.py tests/unit/devtools/test_render_openapi.py(83 passed)devtools test tests/unit/daemon/test_web_reader.py -k 'RecoveryEndpoint or AssertionEndpoint or shared_surface_dtos'(16 passed)devtools verify --quick(exit_code 0, run20260619T152613Z-quick-1454498-b524cb34)devtools verify --quick(exit_code 0, run20260619T152829Z-quick-1464809-c8cf66d9)Ref #1847