feat(agent-org): enforce coordinator safety and certified delivery - #1020
Draft
ShiboSheng wants to merge 2 commits into
Draft
feat(agent-org): enforce coordinator safety and certified delivery#1020ShiboSheng wants to merge 2 commits into
ShiboSheng wants to merge 2 commits into
Conversation
Restrict Coordinator turns to orchestration-only tools, make waiting event-driven, fence Task handoffs until the old execution releases, and gate Delivered on backend completion certificates. Project completion readiness into the atomic Coordinator snapshot so completed Teams call org_run_complete without a same-revision task-list deadlock. Verification: - cargo test -p agent_core --lib --no-fail-fast -- --test-threads=1 (3308 passed, 0 failed, 2 ignored) - cargo test --lib --no-fail-fast -- --test-threads=1 (passed) - pnpm typecheck and changed-file lint (passed) - focused Vitest (34 passed) and packaged WDIO completion regression (1 passed) - packaged Tauri Computer Use with orlando / GPT 5.6 Luna (4/4 Tasks, exactly one delivered certificate) Pre-commit hook ran. Total eslint: 5, total circular: 0
Require TaskExecution members to bind actionable Coordinator messages to their exact task and a closed purpose enum. Keep routine progress in Task state and completion in TaskOutput, with body-free metrics and owning-boundary regression coverage. Pre-commit hook ran. Total eslint: 5, total circular: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Agent Org Coordinator turns inherited ordinary SDE work tools, could reread the same work revision instead of waiting for durable events, and could overlap old and replacement Task executions during cancellation or reassignment. Run completion was also inferred from text/quiescence rather than an authoritative evidence certificate, allowing either false success or a permanent Needs Attention state. During real-provider testing, TaskExecution members additionally used ordinary messages for routine progress narration; each accepted message could create an unnecessary Coordinator trigger and Provider turn.
This PR implements PR8S for #995 on the exact PR #991 head
b96bd8b196e2c7fed6bcbcd05fd7261e3bf5e706.Solution
waiting_for_org_event.RunCompletionCertificatebefore typed assistant publication, Turn terminal state, and Idle.org_run_completedirectly instead of deadlocking on a same-revisiontask_listrefresh.blocker,decision_required,material_change,risk, orrequested_reply. Routine progress stays in Task state and completion stays in TaskOutput. The Store validates only objective Task/Turn/Owner/run facts and never classifies message prose.No second runtime/dispatcher, new Task status, polling timer, Inbox schema, body classifier, or database migration is introduced. The rollout gate remains disabled by default.
Potential risks
purposefield, but TaskExecution Member-to-Coordinator plain messages now require it and an exactrelated_task_id. Other message directions and persisted Inbox payloads remain compatible.orlando / GPT 5.6 Lunachatter journey hit external HTTP 429/503, repeated model/file-edit errors, and one packaged-process exit. It was restored from durable state and Paused through the real UI; this run is not claimed as Delivered. A separate natural real-provider journey on the same final PR8S implementation already produced one delivered certificate with the required ordering.ORGII_AGENT_ORG_REDESIGNor revert this branch. There is no data migration to reverse.Verification
Final automated checks:
cd src-tauri && cargo test -p agent_core --lib --no-fail-fast -- --test-threads=1— 3,313 passed, 0 failed, 2 ignored.cd src-tauri && cargo test -p session_persistence --lib --no-fail-fast— 46 passed, 0 failed.cd src-tauri && cargo clippy -p agent_core --all-targets -- -D warnings— passed.cd src-tauri && cargo fmt -p agent_core -- --check— passed.pnpm typecheck— passed.git diff --check— passed.cd tests/e2e && pnpm test -- --spec './specs/core/agent-org-group-chat-ui.spec.mjs' --mochaOpts.grep 'certifies completed work from the atomic snapshot without a task_list refresh'— 1 passed.No TS/TSX file changed in the final Member-coordination commit, so changed-file TypeScript lint was not applicable to that supplement.
Packaged app and real Provider
Final chatter-regression artifact:
ORG2 Instance 92.app, executable SHA-256ec2c9e747e634039b605d094e8039d0f1bb53b5ba1bab81a16d062a2723a23bc, rollout gate enabled only for the isolated test home.Computer Use drove model selection, workspace selection, Send, Overview, Session switching, Pause, Resume, and final Pause in the real packaged App using
orlando / GPT 5.6 Luna. Visible Implementer narration produced zero successful Implementerorg_send_messagereceipts and zero Implementer plain Inbox rows. Two Reviewermaterial_changemessages bound to the exact review Task were written/read exactly twice and immediately processed by the Coordinator. Four invalid plain calls remained rejected and did not become accepted coordination messages.The earlier final certificate journey used the same requested Provider and a clean packaged App: four formal Tasks and TaskOutputs completed; the last Coordinator turn called
org_run_completeonce without a completion-stagetask_list; one delivered certificate was created before typed assistant publication binding, Coordinator Turn terminal, and Run Idle.Scope and size
Final diff against the exact base is 12,230 review lines across 141 substantive files plus 13 locale files. This remains below the 12,250 early re-estimation gate and the 145-substantive-file P90 gate.
The PR is intentionally Draft while reviewers evaluate the PR8S safety boundary and the recorded external-provider limitations.