Skip to content

feat(team): add 'team auto-create' and 'team apply --agent' #237

Merged
Koukyosyumei merged 12 commits into
mainfrom
auto-commands
Jun 28, 2026
Merged

feat(team): add 'team auto-create' and 'team apply --agent' #237
Koukyosyumei merged 12 commits into
mainfrom
auto-commands

Conversation

@Koukyosyumei

Copy link
Copy Markdown
Collaborator

No description provided.

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.
@Koukyosyumei Koukyosyumei changed the title Auto commands feat(team): add 'team auto-create' and 'team apply --agent' Jun 28, 2026
@Koukyosyumei

Koukyosyumei commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator Author

🪙 50% AI-authored · 7 files · prompt 40/100

6 AI commits · 🚩 1 flagged

Important

🎯 Goal: implement h5i team auto-create that creates claude+codex agent envs and wires them into a new team

6 / 1271 : 1.41 / 6
AI commitsfiles touchedREAD : EDITTHINKs / ops

💬 The ask

"Can we implement h5i team auto-create <team-name> that runs h5i env create claude-env-1 --profile agent-claude, h5i env create codex-env-1 --profile agent-codex, h5i team create <team-name> --base HEAD, `h5i team add-env <team-name…"

📍 What shipped

  • ✓ bump to v0.2.5
  • ✓ upadte
  • ✓ rewrite serve
  • ✓ fix the order
  • ✓ fix the format

Note

🪴 Prompt maturity: 40/100 · developing · 5 prompts scored (83% of AI commits)
🔧 Recurring weak spots: weak context, no acceptance criteria, too short.
Heuristic signal of prompt craft — not a developer rating.

📊 heuristic breakdown
Dimension Signal
Specificity ████████░░ 0.82
Control / acceptance ░░░░░░░░░░ 0.05
Context grounding ██░░░░░░░░ 0.21
Structure ██░░░░░░░░ 0.18
Lexical diversity ███████░░░ 0.67
Clarity (readability band) █████████░ 0.93
Length adequacy █████████░ 0.89

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 clean

No 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;
Loading

Note

🪙 Token reduction — 8 captured tool outputs kept out of context: 17049 → 7064 tokens (58% saved, 9985 tokens). Full output is recoverable with h5i recall object.

📜 Per-commit provenance — 6 AI-authored commits

27ccfa85 fix(team): satisfy cloned_ref_to_slice_refs clippy lint in test

  • promptso, do we now need team discuss? Hmmm, if we have team discuss, our previous change (immediate send) was not necessary? Let's fix "45s Run cargo clippy --all-targets --all-features -- -D warnings Updating crates.io index Compiling h5i-core v0.2.4 (/home/runner/work/h…
    • 🌿 prompt maturity 50/100 proficient — no acceptance criteria, weak context
  • model claude-opus-4-8 · agent claude-code

c86eda20 feat(team): deliver peer reviews to the reviewed agent on submit

  • promptalso, can agent in a sandbox see the review submitted by the other agent? oh, is team discuss is invoked in auto-peer-review? ok, let's add team discuss to auto-peer-review pipeline
    • 🪴 prompt maturity 35/100 developing — weak context, no acceptance criteria
  • model claude-opus-4-8 · agent claude-code

55e0fcd5 fix(team): auto-create assigns generated persona keys, not the runtime

  • promptwhy the names of agents created by auto-create alwasy claude and codex? If we manually add team members, it's usually something like vega.
    • 🪴 prompt maturity 33/100 developing — weak context, no acceptance criteria
  • model claude-opus-4-8 · agent claude-code

c5eab259 docs: document 'team auto-create' and 'team apply --agent'

  • promptalso update MANUAL.md and man
    • 🌱 prompt maturity 16/100 nascent — too short, weak context
  • model claude-opus-4-8 · agent claude-code

68e12596 test(team): cover apply --agent and auto-create roster

  • prompt — __
  • model claude-opus-4-8 · agent claude-code
  • 🚩 review signals — score 0.35: AI_NO_PROMPT, SCOPE_EXPANSION
    • shape signals (informational): LARGE_DIFF

f71259b0 feat(team): add 'team auto-create' and 'team apply --agent'

  • promptCan we implement h5i team auto-create <team-name> that runs h5i env create claude-env-1 --profile agent-claude, h5i env create codex-env-1 --profile agent-codex, h5i team create <team-name> --base HEAD, `h5i team add-env env/human/claude-env-1 --runtime claud…
    • 🪴 prompt maturity 36/100 developing — no acceptance criteria, weak context
  • model claude-opus-4-8 · agent claude-code

Generated by h5i · re-run h5i share pr post to refresh.

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).
@Koukyosyumei Koukyosyumei merged commit 260e1d2 into main Jun 28, 2026
5 checks passed
@Koukyosyumei Koukyosyumei deleted the auto-commands branch June 28, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant