fix(agent-org): converge durable task finality - #1309
Open
ShiboSheng wants to merge 1 commit into
Open
Conversation
Centralize task execution authority, terminal delivery settlement, scope-removal receipts, coordinator revision rechecks, and restart reconciliation. Allow the initial Coordinator Turn to inspect an empty task board before the no-progress gate applies. Verification: - git diff --check (passed) - changed Rust files: rustfmt --check (passed) - pnpm typecheck (passed) - pnpm lint (passed) - pnpm check:circular (passed; 6426 modules) - pnpm test -- src/engines/ChatPanel/InputArea/components/AgentOrgTaskPanel.test.ts (26 passed) - cargo check --workspace --all-targets (passed) - cargo clippy --workspace --all-targets -- -D warnings (passed) - cargo test -p agent_core (3454 passed; 3 ignored) Pre-commit hook ran. Total eslint: 0, 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's durable Task ledger could fail to converge even when the visible work looked finished:
runninginstead of reaching a terminal state;task_listagainst a revision-0 empty board could be mistaken for a repeated no-progress read and end the Turn before any Task existed.This is PR 1 from the Agent Org consolidation plan (P0-1, P0-2, P0-3, P0-4, and P0-9), stacked directly on the current head of #1224.
Solution
agent_org_finalitypersistence owner with companion tables for execution authority, terminal delivery settlement, Coordinator recheck receipts, scope-removal receipts, and idempotent legacy-state reconciliation.waiting_for_org_event; the existing repeat-read guard remains unchanged after work is materialized.No existing runtime table is rewritten. The new finality schema is additive and initialized in the existing database transaction. No polling, per-Team timer, or unbounded in-memory registry is introduced.
Potential risks
task_listcalls in the same untouched initial Turn can still read the empty board until the model creates work. Later Turns, nonzero revisions, existing Tasks, and certified Runs do not receive the exception.Verification
git diff --check— passed.rustfmt --edition 2021 --check— passed.pnpm typecheck— passed.pnpm lint— passed with zero warnings.pnpm check:circular— passed; no circular dependencies across 6,426 modules.pnpm test -- src/engines/ChatPanel/InputArea/components/AgentOrgTaskPanel.test.ts— 26 passed.cd src-tauri && cargo check --workspace --all-targets— passed.cd src-tauri && cargo clippy --workspace --all-targets -- -D warnings— passed.cd src-tauri && cargo test -p agent_core— 3,454 passed, 0 failed, 3 explicitly ignored stress tests.cd src-tauri && cargo fmt --all -- --check— repository-wide check remains blocked by pre-existing formatting differences in untouched crates; the changed Rust files pass the focused check above, and no unrelated formatting was applied.codexharryGPT-5.6 Luna account — one clean end-to-end natural-language run inspected the empty Task board, created work, advanced the revision, completed the work, and issued the final certificate without a user nudge.list_dir → task_list(empty) → task_createand proved the targeted initial-board path; its later browser portion is excluded from product evidence because an older test instance still owned port 4173 and all app instances shared the globalorgiibrowser session.Architecture and performance review