feat(agent-org): flatten team capabilities - #786
Open
ShiboSheng wants to merge 2 commits into
Open
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
ShiboSheng
force-pushed
the
fix/issue-757-flat-team-capabilities
branch
from
August 12, 2026 17:11
7f90f99 to
8aa187a
Compare
ShiboSheng
marked this pull request as ready for review
August 12, 2026 17:13
Collaborator
Author
|
orgii://cloud/session/ref?v=1&org=bfa7b134-2486-45fa-81ad-a369441fafb4&owner=776dbd69-ac1d-4f72-a0d4-69cb4f2667dd&session=codexapp-rollout-2026-08-12T00-30-58-019ff1a9-b497-7f60-9e6e-2086cceb7a6d |
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
Fixes #757.
PR1 establishes the authoritative long-lived Team lifecycle, but the persisted Team definition still models a recursive hierarchy and does not provide trusted, independently configurable Writer grants and Member communication links. Later TaskGraphWriter and peer-messaging work needs stable flat Member identities and immutable launch-time capability facts; it must not infer authority from role, hierarchy, UI state, or a mutable template.
The rollout also exposed two upgrade-boundary failures that prevented the PR1+PR2 product from being exercised safely on existing installations:
agent_org_runsschema cannot serve the new lifecycle columns;org_member_idand could consume standalone SDE page capacity, producing an empty filtered page withhasMore=trueand a visible Retry state.Solution
This stacked PR targets
fix/issue-756-authoritative-team-lifecycleand delivers the PR2 definition/capability boundary:1..=50flat Members carrying stablemember_idvalues.roleis display/expertise only.AgentOrgLaunchSnapshot; runtime capability indexes compile toHashSetmembership checks. Running Teams never reread mutable templates.For the upgrade boundary, schema initialization recognizes only the exact published 15-column legacy run fingerprint. A match resets exactly
agent_org_initial_inputs,agent_org_member_materializations,agent_org_run_progress, andagent_org_runsin one transaction, then recreates the single canonical schema. Current schemas remain idempotent; unknown or locally modified layouts fail closed and are never destructively reset. Ordinary Rust/CLI Sessions and other data are untouched.Standalone SDE pagination now excludes any Session with
org_member_idin SQL beforeLIMIT. This preserves page capacity and keyset cursor semantics without deleting or modifying retained historical Sessions; valid current Team roots continue to use the Agent Org stream.Potential risks
developonly after PR1 lands and the resulting diff is reverified.ORGII_AGENT_ORG_REDESIGN=1; enabling the incomplete stack early exposes configured/frozen Writer and communication facts but intentionally does not activate PR7 graph-write or PR9 peer-send behavior.Verification
cargo test -p agent_core agent_org -- --nocapture— 227 passed.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/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.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— passed.cargo clippy -p agent_core -p org2 --all-targets -- -D warnings— passed.npm run lint— passed.npm run check:circular— no circular dependencies across 6,350 modules.cargo fmt --all -- --checkandgit diff --check— passed.ORGII_AGENT_ORG_REDESIGN=1 npm run tauri:build:fast— passed; produced the packagedORG2.appfrom this worktree.~/.orgii: the standalone SDE stream advanced 10 -> 20 -> 21 rows, then exhausted normally with no Retry, empty page, cursor stall, or new pagination/schema error in the log. No historical Session was deleted or modified by the pagination fix.Architecture review covered compilation, structure/dead code, naming, semantic ownership, default branches, domain leakage, developer clarity, wire shape, initialization parity, and resolver symmetry. No new wire or duplicate lifecycle owner was introduced by the follow-up.
Performance verdict: pass. Pagination remains one bounded keyset query using the existing ordered sidebar and root-membership indexes; no polling, cache, retained state, dependency, or frontend retry path was added.
frontend-ui-auditcould not be rerun during final handoff because its referencedSKILL.mdis absent from both the workspace and user skill directories. Existing UI unit/rendered specs and packaged manual acceptance are recorded above; the PR remains Draft for review evidence completion.