Repository navigation
Integration: local review journal with authenticated durable-task route - #2613
groupthinking merged 23 commits into
Conversation
…ay-review-journal.yml
…on-review-journal.d.mts
…on-review-journal.mjs
…y-local-review.mjs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🔍 PR Validation
|
|
Please add a See governance: #898 |
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
There was a problem hiding this comment.
🟡 Changes recommended
Cookie-authenticated previews bypass origin and JSON checks, enabling forged plan writes, while artifact recovery can record completion without ensuring durable storage.
5 open issues
What changed in this PR
Integrates PR #2470’s local review journal with PR #2472’s authenticated workflow-task route in UVAI’s internal runtime. Local review artifacts remain separate from confirmed task execution. The feature is off by default and does not authorize live execution or deployment.
Changes:
- Adds a SQLite journal with exact-byte verification, hash-linked history, bounded retries, and crash recovery.
- Adds opt-in preview persistence requiring trusted identity, while blocking execution and suppressing confirmation tokens.
- Adds Python, Node, and Vitest regression coverage, focused CI, and local usage documentation.
| File | Description |
|---|---|
tests/test_relay_local_harness.py |
Covers integrity, denial, retries, and recovery. |
tests/relay-review-route.test.mjs |
Exercises the integrated route and local journal. |
tests/relay-local-review.test.mjs |
Tests bridge persistence and tamper detection. |
scripts/relay_harness/core.py |
Implements the SQLite journal and artifact verification. |
scripts/relay_harness/adapter.py |
Validates and preserves pending review plans. |
scripts/relay_harness/__main__.py |
Adds the offline journal command-line interface. |
scripts/relay_harness/__init__.py |
Exports the harness and contract error. |
docs/relay-durable-review-journal.md |
Documents configuration, verification, and operating boundaries. |
apps/web/vitest.config.ts |
Isolates tests from ambient journal configuration. |
apps/web/src/lib/relay-local-review.mjs |
Bridges Node review requests to Python. |
apps/web/src/lib/action-review-journal.mjs |
Resolves host policy and identity-scoped journal keys. |
apps/web/src/lib/action-review-journal.d.mts |
Defines journal and local receipt types. |
apps/web/src/app/api/agents/actions/route.ts |
Integrates review-only persistence and execution guards. |
apps/web/src/app/api/__tests__/actions-route-journal-integration.test.ts |
Covers route persistence and review-only boundaries. |
.github/workflows/relay-review-journal.yml |
Runs focused Python and Node regressions. |
Review effort: Max
…her same-site origin can persist attacker-selected plans under the victim’s identity because preview writes lack an origin check. This commit fixes the issue reported at apps/web/src/app/api/agents/actions/route.ts:196-199 ### Trigger and impact A page on another localhost port (or a same-site sibling origin) can send a credentialed `text/plain` POST containing JSON. The route accepts that body, resolves the victim’s ambient cookie identity, and persists the generated plan without checking `Origin`. This allows unsolicited durable journal entries attributed to the victim. The proxy checks authentication and rate limits, but not request origin; the execute branch already explicitly protects against this same-site case. [MDN documents](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) that simple `text/plain` POST requests do not require preflight and CORS response restrictions do not prevent their side effects. [SameSite=Lax](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie) still permits cookies on same-site requests. ### Fix and validation The suggested patch applies the existing task-write origin policy before local-journal identity resolution/model work, retaining the cookie-free bearer exception and leaving disabled mode unchanged. A regression using the actual route, bridge and SQLite journal returned 200 before the fix and 403 afterward. All 6 focused Node tests and 26 Python tests pass with the patch. Authentication and provider calls are stubbed in these tests; no browser end-to-end test or full web type-check was run because web dependencies are absent. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: groupthinking <garveyht@gmail.com>
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
…xed event history
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
✅ E2E Test Results: ALL TESTS PASSED
Test Output |


Fixes #2469 (integration of the existing review journal; original implementation remains in PR #2470).
Integration branch based on PR #2472 (
40dbc6c6) carrying PR #2470's verified local journal implementation and exact-plan tests. The shared actions route now fails closed in local-review-only mode, refuses execute, persists the exact preview before success, and suppresses executable confirmation tokens. When disabled, PR #2472's signed owner-scoped preview and task persistence behavior remains unchanged. Includes Python journal tests, Node-to-Python SQLite bridge tests, combined-route Node smoke tests, and Vitest route boundary tests. Draft until post-push CI, security review, and runtime acceptance. No production deployment, merge, or live execution.