feat: scaffold-agents subsystem — detect ADR-128 agent gaps, delegate to upstream fix when available - #132
Merged
Conversation
… to upstream fix when available Projects scaffolded by ruflo init before 3.38.x are silently missing up to 9 plugin-canonical agents (ADR-128 Phase 2 deletions: coder, researcher, reviewer, tester, ...) and nothing upstream revisits an existing scaffold. ruflo#2985 / PR #2986 add 'ruflo migrate fix --agents' upstream; this subsystem makes ak the bridge: - src/lib/scaffold.mjs: spawn-free gap detection mirroring upstream's migrate-agent-detection.ts semantics (basename anywhere under .claude/agents + owning-plugin coverage from installed_plugins.json); capability detection probes the installed dist for migrate-agent-restore.js (dist-derived truth, same discipline as the MCP deny rules — never a version-string guess); delegation runner with a convergence re-check. - status: scaffold-agents row — ok / advisory-info (CLI lacks the fix; ruflo#2986 pending) / warn-with-fix, which auto-enters sync's plan. - sync: delegates to 'ruflo migrate fix --agents' when planned. Deliberately never a kit-side restore — that would fork content ADR-128 made plugin-canonical. One-pass-behind when the same sync's upgrade delivers the capability (documented inline). 8 tests (isolated tmp home/project, injected runner/dist), pnpm run check green, both reachable modes live-verified on-machine.
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
New
scaffold-agentssubsystem: ak now detects when a project is missing the 9 agents ADR-128 Phase 2 deleted from ruflo init's template (coder,researcher,reviewer,tester, …), and delegates toruflo migrate fix --agents(ruflo#2985 → PR #2986) the moment the installed CLI ships it.src/lib/scaffold.mjs— spawn-free gap detection mirroring upstream'smigrate-agent-detection.tssemantics exactly (basename anywhere under.claude/agents+ owning-plugin coverage from~/.claude/plugins/installed_plugins.json); capability detection probes the installed dist forcommands/migrate-agent-restore.js(dist-derived truth, same discipline as the MCP deny rules — a backport or fork build is detected identically to a release); delegation runner with a post-run convergence re-check.ak status— one row, three states:ok(present/covered) ·infoadvisory when gaps exist but the CLI predates the fix (never enters sync's plan) ·warnwith a fix when gaps exist and the CLI has the command — which auto-enters sync's plan via the existing row-with-fix contract.ak sync— runs the delegation step. Deliberately never a kit-side restore: that would fork content ADR-128 made plugin-canonical. If this sync's own upgrade step delivers the capability, the pre-upgrade plan won't include it; the next status/sync picks it up (one-pass-behind, documented inline).Why
Upstream's 3.38.0 remediation (ADR-382) fixed the init template, but nothing upstream revisits an already-scaffolded project — and until #2986 merges, the fix command doesn't exist anywhere. This gives ak eyes on the gap today and hands the fix to upstream the day it lands, with zero further kit changes.
Proof
tests/kit/scaffold.test.mjs— 8 tests, isolated tmp home/project, injected runner/dist probes: 8/8 passpnpm run check(typecheck + lint + markdownlint + build + full test suite): exit 0✓ scaffold-agents ADR-128-removed agents present or plugin-covered; a fabricated gap project shows the advisory· 9 ADR-128-removed agent(s) missing … (ruflo#2986 pending). The warn→delegate mode is covered by tests and arms automatically post-merge/upgrade.🤖 Generated with Claude Code