feat(agent-org): flatten Team definitions and freeze capabilities - #835
Draft
ShiboSheng wants to merge 3 commits into
Draft
feat(agent-org): flatten Team definitions and freeze capabilities#835ShiboSheng wants to merge 3 commits into
ShiboSheng wants to merge 3 commits into
Conversation
Replace recursive Agent Org hierarchies with stable flat Member rosters and persist additional Writer grants independently from canonical undirected Member communication links. Freeze the roster and both capability sets into immutable launch snapshots while keeping PR7 Writer authority and PR9 peer messaging fail closed. Replace the communication matrix with per-Member connection summaries and a right-side peer panel backed by one canonical draft pair set. Preserve trusted full-replace validation, atomic persistence, stable Member identities, locale parity, and the PR1 lifecycle contracts. Verification: - cargo test -p agent_core agent_org -- --nocapture (227 passed) - npm test -- --run src/scaffold/WizardSystem/variants/AgentOrg/MemberCommunicationPanel.test.ts src/scaffold/WizardSystem/variants/AgentOrg/orgTree.test.ts src/api/tauri/rpc/schemas/agentOrgs.test.ts (16 passed) - cargo check -p agent_core --all-targets && cargo check -p org2 --all-targets - cargo clippy -p agent_core -p org2 --all-targets -- -D warnings - npm run lint - npm run check:circular - ORGII_AGENT_ORG_REDESIGN=1 npm run tauri:build:fast
Reset only the exact published legacy Agent Org run schema while preserving ordinary sessions and unknown layouts. Keep retained Team member sessions out of standalone SDE pagination so orphan coordinators cannot consume page capacity or trigger Retry. Verification: - cargo test -p agent_core core::session::persistence -- --nocapture (34 passed) - cargo test -p org2 agent_sessions::session_directory::aggregation::tests -- --nocapture (13 passed) - npm test -- --run src/store/session/sessionAtom/__tests__/sidebarLoaders.test.ts src/api/tauri/rpc/__tests__/sessionAggregateSchemas.test.ts (28 passed) - cargo check -p agent_core --all-targets && cargo check -p org2 --all-targets - cargo clippy -p agent_core -p org2 --all-targets -- -D warnings - npm run lint - npm run check:circular - ORGII_AGENT_ORG_REDESIGN=1 npm run tauri:build:fast - Packaged real-data SDE pagination exhausted 10 -> 20 -> 21 without Retry Pre-commit hook ran. Total eslint: 0, total circular: 0
This was referenced Aug 18, 2026
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
Replaces #825.
Fixes #757.
Agent Org Team definitions still used the recursive hierarchy contract while the long-lived runtime introduced by the PR1 stack needs a stable, flat launch contract. Writer grants and Member communication policy were not represented as independent, validated capabilities, the legacy Agent Org runtime schema could prevent upgraded installations from starting a new Team, and cached workstation tabs could retain a pre-flat Team snapshot after an upgrade.
Solution
This PR is stacked directly on #834 (
codex/issue-756-pr1-selected-rebuild) and contains exactly three adapted commits.Coordinator + flat Members, assign stable Member IDs, persist independent additional TaskGraphWriter grants and canonical undirected Member communication links, and freeze roster/grants/links into the immutable launch snapshot.Writer grants and communication links are stored and frozen but remain inactive until their later feature slices.
Potential risks
agent_org_runsfingerprint causes the four Agent Org runtime envelope tables to be rebuilt. Old Team runs are intentionally abandoned and cannot be recovered by reverting; ordinary Rust/CLI Sessions remain outside the reset scope.Architecture and performance audit
Reviewed ownership, flat types, lifecycle integration, persistence, RPC schema compatibility, initialization parity, resolver symmetry, naming, and removed recursive surfaces. No new polling loop, timer, subscription, worker, or cache was added. Team payloads remain bounded at 50 Members and 1,225 canonical edges, and the communication panel renders at most 49 peers.
The local UI-consistency pass found design-system Buttons, explicit dialog labeling, icon-only labels, and no newly added arbitrary pixel Tailwind values. The repository's declared
frontend-ui-auditskill file is unavailable, so no skill-format audit report was generated.Verification
Passed on this PR tip:
cargo check -p agent_core -p org2 -p session_persistence --all-targetscargo test -p agent_core agent_org -- --nocapture— 227 passed.cargo test -p org2 orphan_org_members_do_not_break_standalone_cursor_or_has_more -- --nocapture— 1 passed.pnpm run typechecknode --checkon the three changed Agent Org E2E/support files.git diff --check codex/issue-756-pr1-selected-rebuild...HEADThe complete stacked tip was also verified after PR3 was added; those results are recorded in #836.
cargo fmt --all -- --checkreports formatting differences already present onorigin/developin untouched files. No changed hunk in this PR contributes to that output.Commit provenance
b0ceb1df39bc05f4818802585b94a2d80d3dca5a710ee9b59433f48ae9a1eed6afc3507848a25d0cba47fe237d2b0d71d4c0bd2c00566274aacff972a73d12d7b86782c5e0e8cb5459ce4a825a3c965c34e7e973a4de33042e6ae244c1376e8b2ef13c2ec28004e1b7a9f5c460dd670fefdff987291110d9Rollback
The branch can be reverted as a unit before merge. After an exact legacy runtime reset has committed, reverting cannot reconstruct discarded old Team run envelopes; recovery is to continue with newly created Team runs. Ordinary Session data is outside the reset scope.