Skip to content

demo: productize Layer 2 — two real agents drive the multi-agent scenario (live.sh)#21

Merged
suzuke merged 2 commits into
mainfrom
demo/multi-agent-live
Jul 6, 2026
Merged

demo: productize Layer 2 — two real agents drive the multi-agent scenario (live.sh)#21
suzuke merged 2 commits into
mainfrom
demo/multi-agent-live

Conversation

@suzuke

@suzuke suzuke commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What

Productizes Layer 2 of the multi-agent verification scenario: the same scenario as verify.sh, but the two guarded sessions are driven by two real agents (or just two shells) instead of spawned in-process. The supervisor is still the verifier.

  • lib.sh — the SINGLE source of truth: scrub_hostile_env, resolve_real_git/sanitized_path, resolve_bin, build_world, and synthesize (the invariant block). Both drivers call synthesize once — the rigor can't drift between them.
  • verify.sh — refactored to source lib.sh; its unique in-process concurrent spawn is unchanged. Behavior preserved (still VERIFIED), now including the new freshness invariant.
  • live.shsetup [--world DIR] [--reset] builds a persistent world + drops the launcher + prints the two commands; synth <world> re-derives the verdict.
  • agent-launch.sh — committed self-contained launcher an agent runs (sh agent-launch.sh a|b); scrubs its own env, resolves real git, reads only the supervisor-written world.env.

Guards added from the adversarial design review

  1. Freshness — persistent worlds can't pass on stale state: run-unique baseline; synth requires both agent branches to descend from THIS run's baseline; setup refuses a non-empty world without --reset and holds an atomic setup lock.
  2. Hostile-env scrub — unset the GIT_DIR/GIT_CONFIG_* family + every agentic/agend bypass knob before touching git, so a foreign session can't aim git at another repo despite -C.
  3. BINresolve_bin defaults to the guarded repo build (prints resolved BIN + version); AGENTIC_GIT_BIN is an advanced override. (Fixes verify.sh previously preferring a possibly-unguarded installed release.)

Verification

  • shellcheck clean on all four scripts.
  • verify.sh (Layer 1) → VERIFIED.
  • live.sh setup + two concurrent launchers + synthVERIFIED.
  • Adversarial matrix — canonical move / real feat/b clobber+forged PASS / stale-baseline-tips → FAIL; HOME binding.json forge cannot redirect the worktree source (still VERIFIED); synth-before-agents → FAIL; setup refuses a non-empty world.
  • Driven end-to-end by two real fleet LLM agents (claude + codex)VERIFIED (all 8 deny-steps rc=1, guards fired).

🤖 Generated with Claude Code

suzuke and others added 2 commits July 6, 2026 17:10
…ario (live.sh)

Extract build_world + synthesize into demo/multi-agent/lib.sh as the SINGLE
source of truth; verify.sh (Layer 1, in-process spawn) and the new live.sh
(Layer 2, two real agents each drive one guarded session) both call it, so the
synthesis can't drift between the two drivers.

live.sh setup builds a PERSISTENT shared world and drops a self-contained
agent-launch.sh; live.sh synth re-derives the verdict from state the supervisor
owns. New guards from the adversarial design review:

- freshness: a run-unique baseline + synth requires BOTH agent branches to
  descend from THIS run's baseline; setup refuses a non-empty world without
  --reset and holds an atomic setup lock — a prior run's stale tips can never
  masquerade as a fresh pass.
- hostile-env scrub: unset the GIT_DIR/GIT_CONFIG_* family + every agentic/agend
  bypass knob before resolving git, in lib.sh AND inlined in the launcher, so a
  foreign session can't aim git at another repo despite -C.
- resolve_bin defaults to the guarded repo build (prints resolved BIN+version);
  AGENTIC_GIT_BIN is an advanced override. Fixes verify.sh preferring a possibly
  unguarded installed release.

Verified: shellcheck clean (all 4); verify.sh still VERIFIED; live.sh
setup + 2 concurrent launchers + synth VERIFIED; adversarial matrix — canonical
move / real clobber+forged PASS / stale-baseline all FAIL, HOME-forge cannot
redirect the worktree source, synth-before-agents FAILs, setup refuses a
non-empty world. Also driven end-to-end by two real fleet LLM agents
(claude + codex) → VERIFIED.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o, rev-parse diagnostic)

Addresses fugu's diff review of PR #21:

1. AGENTIC_GIT_BIN override was dead — scrub_hostile_env ran before resolve_bin
   and blanket-unset every AGENTIC_GIT_*, including AGENTIC_GIT_BIN. Exclude it
   from the scrub (lib.sh + the agent-launch.sh mirror): it's a deliberate
   binary override, not a hostile knob.
2. shellcheck now clean from ANY cwd — add `# shellcheck source-path=SCRIPTDIR`
   to verify.sh/live.sh, and make build_world publish its output vars as globals
   so the drivers no longer dynamically source world.env (which shellcheck can't
   follow → SC1091/SC2154/SC2034 when run from repo root).
3. synthesize I2 used `git rev-parse feat/a`, which echoes the token on a
   missing ref — so the distinct-tips ✓ printed spuriously before agents ran
   (verdict was always correctly FAILED via I0/provenance; only diagnostics were
   wrong). Use `rev-parse --verify -q` so a missing ref yields empty.

Verified: shellcheck clean from repo root (all 4); AGENTIC_GIT_BIN override
honored (fake bin path printed); verify.sh VERIFIED; live.sh full flow VERIFIED;
adversarial matrix 8/8; synth-before-agents now shows I2 as failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@suzuke suzuke merged commit dd3202b into main Jul 6, 2026
4 checks passed
@suzuke suzuke deleted the demo/multi-agent-live branch July 6, 2026 09:27
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