chore(harness): reconcile orchestrator plugin to 0.3.0 after machine migration - #173
Merged
Merged
Conversation
…migration Migrating this repo to a new machine surfaced a pile of unrelated breakage that all landed at once. The plugin install itself was fine (orchestrator@recode 0.3.0, commit 2adf6d7, enabled); everything below was repo state or machine env. Plugin reconciliation (/orchestrator:sync): - Restamp managed files: pr-loop.service v1->v2 (ExecStart now resolves loop-daemon.sh from the plugin cache when no repo-local copy exists, issue #134), claude-rc.service v5->v6 (Type=simple + inline tmux supervisor so a dead planner no longer hides behind a permanently-"active" unit, issue #124). - arm-loop.sh taken at v7 from the plugin's scripts/ copy rather than v6 from its setup template: the two disagree upstream, and v7 is what pairs with the v7 loop-tick.sh that resolves from the plugin cache (--stop-after-days / loop-arming.json, issue #95). Fix + regression guard sent upstream as robercano/reCode#223; sync now reports this file as "kept (newer)". - Delete .claude/agents/: stale pre-#134 vendored copies that shadowed the plugin's own, which is where agents resolve from now. - Trim .claude/scripts/ from 17 files to the 8 that must genuinely be repo-local, each refreshed byte-identical from plugin 0.3.0. Nothing here was ever custom — it was a stale mirror, missing ~25 scripts 0.3.0 ships. Kept: gate.sh + resolve-roots.sh (CI runners have no plugin cache and the plugin's own gates.yml/action.yml templates hardcode this path), prepare-pr.sh (.claude/commands/test-pr.md hardcodes it), arm-loop.sh (MANIFEST-managed), worktree.sh (newly required, see below), bot-gh.sh, merge-ready.sh, notify-poll.sh. Dropped the loop-* internals: pr-loop.service v2 resolves those from the plugin cache by design. Upstream inconsistency filed as robercano/reCode#225. Worktree bootstrap (this was silently broken): - gates.json gained a "worktree" key. Implementers run in isolated worktrees, which have no node_modules and no contracts/lib, and the bootstrap hook was unconfigured — so in-worktree gates failed for missing deps and looked like real defects. setup now mirrors the install gate. worktree.sh itself had never existed in this repo: nothing ever copied it and, post-#134, no mechanism would have. Hooks (every gate was running twice per turn): - Drop the PostToolUse/Stop hooks from .claude/settings.json. The plugin registers both itself via hooks/hooks.json, so both fired — two concurrent `pnpm -r build` into the same dist/, surfacing as a racy "Stop hook error: No stderr output". Filed upstream as robercano/reCode#224; a _hooks note in settings.json records why they must not come back. - gates.test_affected is now loop-only. It is the gate the Stop hook fires, so unguarded it ran the whole monorepo build+test after every assistant turn -- including pure planning turns in `claude remote-control`, which loads these same hooks via WorkingDirectory=<repo>. Detection keys off an env var the loop daemon exports into every `claude -p` it spawns. Fail-open is bounded: CI remains the authoritative merge gate and test_affected is not in its matrix, and the skip prints rather than passing silently. pnpm 10.x: - Move onlyBuiltDependencies to pnpm-workspace.yaml. pnpm 10.33 stopped reading the "pnpm" field in package.json and had been ignoring it, so esbuild's build script was no longer allowlisted. Not in this commit: ~/.foundry/bin was exported below the non-interactive guard in ~/.bashrc, so hooks, subagents and systemd units never saw `forge` (fixed on the machine, outside the repo), and contracts/lib had never been fetched here (fixed by running the install gate). Gates: install, build, lint, typecheck, test, coverage all pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Regenerated by the build gate now that contracts/lib is actually populated. The previously committed manifest was produced in an environment where the OpenZeppelin libs were not fully resolvable, so inheritance chains were truncated: AccessControl-derived contracts were missing ERC165/IERC165/Context, and Ownable-derived ones were missing Context. Pure regeneration — no hand edits, no source change. Reproduce with: bash .claude/scripts/gate.sh install && bash .claude/scripts/gate.sh build Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gate.sh's node_modules-vs-pnpm-lock.yaml staleness preflight (added for issue #129) ran unconditionally, including for the 'install' gate itself. On a fresh checkout there is no node_modules yet, so the preflight always fired and aborted before 'pnpm install' — the exact command the abort message points at as the remedy — ever got to run. Every other gate calls 'install' first via .github/actions/setup/action.yml, so this single bug cascaded into every CI job failing with "node_modules is out of sync" on PR #173. Skip the preflight when key == "install"; every other gate keeps the check unchanged, since only a gate that's about to actually execute against node_modules needs it fresh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
Author
|
Pushed a fix for the CI failure: |
Collaborator
Author
|
chore(harness): reconcile orchestrator plugin to 0.3.0 after machine migration (not yet reviewed) |
robercano
approved these changes
Aug 6, 2026
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.
Reconciles this repo with orchestrator plugin 0.3.0 after the machine migration, and fixes the environment problems the migration exposed.
The plugin install itself was never broken —
orchestrator@recode0.3.0, commit2adf6d7, enabled, marketplace registered. Everything below was repo state or machine env.Commits
chore(harness)— plugin reconciliation, worktree bootstrap, hook de-duplication, pnpm 10.x fixchore(studio)— pure regeneration ofcontracts.generated.jsonnow that Foundry deps resolveHighlights
Managed files re-stamped.
pr-loop.servicev1→v2 (#134 ExecStart resolver),claude-rc.servicev5→v6 (#124 —Type=simple+ inline tmux supervisor, so a dead planner no longer hides behind a permanently-activeunit).arm-loop.shtaken at v7, not v6. The plugin disagrees with itself:scripts/arm-loop.shis v7 while its setup template is v6, andsync.shstamps from the template. v7 is what pairs with the v7loop-tick.shthat resolves from the plugin cache (--stop-after-days/loop-arming.json, #95). Fix + regression guard sent upstream as robercano/reCode#223;syncnow reports this file askept (newer)..claude/scripts/trimmed 17 → 8. Nothing here was ever custom — it was a stale mirror missing ~25 scripts 0.3.0 ships. Kept only what must be repo-local:gate.sh+resolve-roots.sh(CI runners have no plugin cache, and the plugin's owngates.yml/action.ymltemplates hardcode this path),prepare-pr.sh(test-pr.mdhardcodes it),arm-loop.sh(MANIFEST-managed),worktree.sh,bot-gh.sh,merge-ready.sh,notify-poll.sh..claude/agents/deleted — stale pre-#134 copies shadowing the plugin's own.Worktree bootstrap was silently broken.
gates.jsonhad noworktreekey, so implementers — which run in isolated worktrees with nonode_modulesand nocontracts/lib— got no bootstrap, and their gates failed for missing deps rather than real defects.worktree.shhad never existed in this repo at all: nothing ever copied it, and post-#134 nothing would have. Filed upstream as robercano/reCode#225.Every gate was running twice per turn.
.claude/settings.jsondeclaredPostToolUse/Stophooks that the plugin also registers viahooks/hooks.json— two concurrentpnpm -r buildinto the samedist/, surfacing as a racyStop hook error: No stderr output. Dropped ours; a_hooksnote records why they must not come back. Filed upstream as robercano/reCode#224.test_affectedis now loop-only. It is the gate theStophook fires, so unguarded it ran the whole monorepo build+test after every assistant turn — including pure planning turns inclaude remote-control, which loads these same hooks viaWorkingDirectory=<repo>. Detection keys off an env var the loop daemon exports into everyclaude -pit spawns;REDEPLOY_LOOP=1forces it. Fail-open is bounded — CI stays the authoritative merge gate,test_affectedis not in its matrix, and the skip prints rather than passing silently.pnpm 10.x.
onlyBuiltDependenciesmoved topnpm-workspace.yaml; pnpm 10.33 stopped reading thepnpmfield inpackage.jsonand had been ignoring it, so esbuild's build script was no longer allowlisted.Fixed outside the repo (context, not in this PR)
~/.foundry/binwas exported below the non-interactive guard in~/.bashrc, so hooks, subagents and systemd units never sawforge. Moved above the guard.contracts/lib/had never been fetched on this machine. Ran theinstallgate.Gates
All green, verified end to end after the two fixes above:
Service Unavailableat the "Prepare all required actions" step, before the workflow is even read. Re-run once it recovers.🤖 Generated with Claude Code