feat(team): add 'team auto-create' and 'team apply --agent' #237
Conversation
team auto-create <name>: bootstrap a two-agent claude+codex team in one shot — creates <name>-claude (agent-claude) and <name>-codex (agent-codex) envs, creates the team, and enrolls both with their runtimes. team apply --agent <id>: pick a team agent's latest submission directly, skipping verify/finalize. As an explicit human override it bypasses the verifier-verdict gate (no --force needed). Conflicts with --winner.
Extract the apply-by-agent and auto-create-roster logic out of the CLI handlers into testable team.rs core fns (apply_agent, latest_submission_for, auto_create_roster), and add unit tests: - apply_agent applies an agent's latest submission with no verify/finalize (verdict is None) and lands it on HEAD - apply_agent errors for an unknown agent and for an agent that hasn't submitted yet - auto_create_roster derives per-team env slugs (claude/codex) so teams never collide on env names
MANUAL.md: add the auto-create command row, extend the apply row with --agent (skip verify/finalize via explicit agent pick), and a shortcut block in the worked example. man/h5i.1: matching entries for team auto-create and team apply --agent.
🪙 50% AI-authored · 7 files · prompt 40/100
Important 🎯 Goal: implement h5i team auto-create that creates claude+codex agent envs and wires them into a new team
💬 The ask
📍 What shipped
Note 🪴 Prompt maturity: 40/100 · developing · 5 prompts scored (83% of AI commits) 📊 heuristic breakdown
Readability (display-only): Flesch 73 · FK grade 7.5 · Gunning Fog 10.3 Offline classical-NLP score — no LLM. Higher = more specific, bounded, and grounded prompting. Tip ✅ Security scan cleanNo credentials leaked in this branch's diff. h5i scanned every added line against the secret rule pack and found nothing to rotate. Note Duplicate-code scan clean — no copy-paste blocks introduced. 🧠 Reasoning by file — 10633 nodes across 6 lanes, latest 24 only%%{init: {"flowchart": {"nodeSpacing": 42, "rankSpacing": 48, "diagramPadding": 14}, "themeVariables": {"fontSize": "18px"}} }%%
flowchart TB
subgraph lane_0["💭 Reasoning · 5 steps"]
direction LR
n_lane_0_0["THINK · Let me examine `discuss()` fully and how influence/independence tracking…"]:::t
n_lane_0_1["THINK · Let me find the enclosing function's signature to confirm `h5i_root` is …"]:::t
n_lane_0_2["THINK · both new ones). Let me run the env ingest tests (the changed call site) …"]:::t
n_lane_0_3["NOTE · DEFERRAL (~/Dev/h5i/man/man1/h5i.1): rence* the review rather than copy …"]:::n
n_lane_0_4["NOTE · DEFERRAL (~/Dev/h5i/src/team.rs): ecord the workflow lesson so I run the…"]:::n
n_lane_0_0 --> n_lane_0_1
n_lane_0_1 --> n_lane_0_2
n_lane_0_2 --> n_lane_0_3
n_lane_0_3 --> n_lane_0_4
end
subgraph lane_1["📄 src/team.rs · 5 ops"]
direction LR
n_lane_1_0["EDIT × 2"]:::a
n_lane_1_1["READ"]:::o
n_lane_1_2["EDIT × 2"]:::a
n_lane_1_0 --> n_lane_1_1
n_lane_1_1 --> n_lane_1_2
end
subgraph lane_2["📄 src/main.rs · 5 ops"]
direction LR
n_lane_2_0["READ"]:::o
n_lane_2_1["EDIT"]:::a
n_lane_2_2["READ × 3"]:::o
n_lane_2_0 --> n_lane_2_1
n_lane_2_1 --> n_lane_2_2
end
subgraph lane_3["📄 MANUAL.md · 3 ops"]
direction LR
n_lane_3_0["EDIT"]:::a
n_lane_3_1["READ"]:::o
n_lane_3_2["EDIT"]:::a
n_lane_3_0 --> n_lane_3_1
n_lane_3_1 --> n_lane_3_2
end
subgraph lane_4["📄 man/man1/h5i.1 · 2 ops"]
direction LR
n_lane_4_0["READ"]:::o
n_lane_4_1["EDIT"]:::a
n_lane_4_0 --> n_lane_4_1
end
subgraph lane_5["🗂 Other · 4 nodes"]
direction LR
n_lane_5_0["READ · read MEMORY.md"]:::o
n_lane_5_1["EDIT · edited MEMORY.md"]:::a
n_lane_5_2["EDIT · edited src/env.rs"]:::a
n_lane_5_3["EDIT · wrote clippy-all-targets-for-tests.md"]:::a
n_lane_5_0 --> n_lane_5_1
n_lane_5_1 --> n_lane_5_2
n_lane_5_2 --> n_lane_5_3
end
classDef o fill:#dbeafe,stroke:#1e3a8a,color:#0b1c4a;
classDef t fill:#fef3c7,stroke:#92400e,color:#3f2d05;
classDef a fill:#dcfce7,stroke:#166534,color:#0a2e16;
classDef n fill:#ede9fe,stroke:#5b21b6,color:#221251;
classDef m fill:#e5e7eb,stroke:#374151,color:#0b0f17;
Note 🪙 Token reduction — 8 captured tool outputs kept out of context: 17049 → 7064 tokens (58% saved, 9985 tokens). Full output is recoverable with 📜 Per-commit provenance — 6 AI-authored commits
|
Manual 'team add-env' gives each member a generated persona id (vega, hana, …) distinct from its runtime; auto-create was hardcoding the roster agent_id to 'claude'/'codex', conflating persona with runtime. Now it generates persona keys via gen_agent_id() (runtime still recorded separately) and prints the persona → runtime → env mapping so the keys are discoverable for 'team apply --agent <persona>'. - team.rs: drop agent_key from AutoMember (the env-slug/profile/runtime plan stays pure); generate the id in the handler, accumulating assigned ids so the two never clash - tests: roster test no longer asserts a fixed key; add a test that generated keys are distinct and never a runtime label - docs: MANUAL.md + man page note the generated persona ids and fix the 'apply --agent' example (was '--agent claude', now a persona key)
Previously 'team review submit' only recorded the review into the host-owned event log, so a confined target never received a peer's critique of its own work through its inbox (only the raw-git-read path exposed it). Now submit_review routes delivery through discuss(): post freeze it fans the review body into the target's per-env inbox AND records a discussion_msg, so the target's next revision is correctly marked non-independent (influenced by the review). Before freeze the review is still recorded for audit but not delivered, preserving the independence-first invariant (no cross-agent influence until first attempts are sealed). - submit_review gains an h5i_root param (needed for inbox fan-out); updated both host-side call sites (CLI + box-spool ingest) - tests: post-freeze delivery lands in the target inbox + marks influence; open-round review records but does not deliver - docs: MANUAL.md + man page note the new delivery + influence behavior
CI runs clippy with --all-targets --all-features; the test-only gen_agent_id(&[first.clone()]) tripped clippy::cloned_ref_to_slice_refs (my earlier --bin h5i clippy didn't cover test targets). Use std::slice::from_ref(&first).
No description provided.