demo: productize Layer 2 — two real agents drive the multi-agent scenario (live.sh)#21
Merged
Conversation
…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>
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.
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, andsynthesize(the invariant block). Both drivers callsynthesizeonce — the rigor can't drift between them.verify.sh— refactored to sourcelib.sh; its unique in-process concurrent spawn is unchanged. Behavior preserved (still VERIFIED), now including the new freshness invariant.live.sh—setup [--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-writtenworld.env.Guards added from the adversarial design review
synthrequires both agent branches to descend from THIS run's baseline;setuprefuses a non-empty world without--resetand holds an atomic setup lock.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.resolve_bindefaults to the guarded repo build (prints resolved BIN + version);AGENTIC_GIT_BINis an advanced override. (Fixesverify.shpreviously preferring a possibly-unguarded installed release.)Verification
shellcheckclean on all four scripts.verify.sh(Layer 1) → VERIFIED.live.sh setup+ two concurrent launchers +synth→ VERIFIED.binding.jsonforge cannot redirect the worktree source (still VERIFIED); synth-before-agents → FAIL; setup refuses a non-empty world.rc=1, guards fired).🤖 Generated with Claude Code