Skip to content

feat: scaffold-agents subsystem — detect ADR-128 agent gaps, delegate to upstream fix when available - #132

Merged
pacphi merged 1 commit into
mainfrom
feat/scaffold-agents-detect-delegate
Aug 12, 2026
Merged

feat: scaffold-agents subsystem — detect ADR-128 agent gaps, delegate to upstream fix when available#132
pacphi merged 1 commit into
mainfrom
feat/scaffold-agents-detect-delegate

Conversation

@pacphi

@pacphi pacphi commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What

New scaffold-agents subsystem: 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 to ruflo migrate fix --agents (ruflo#2985PR #2986) the moment the installed CLI ships it.

  • src/lib/scaffold.mjs — spawn-free gap detection mirroring upstream's migrate-agent-detection.ts semantics exactly (basename anywhere under .claude/agents + owning-plugin coverage from ~/.claude/plugins/installed_plugins.json); capability detection probes the installed dist for commands/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) · info advisory when gaps exist but the CLI predates the fix (never enters sync's plan) · warn with 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 pass
  • pnpm run check (typecheck + lint + markdownlint + build + full test suite): exit 0
  • Live on this machine: this repo shows ✓ 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

… 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.
@pacphi
pacphi merged commit ce0fb78 into main Aug 12, 2026
14 checks passed
@pacphi
pacphi deleted the feat/scaffold-agents-detect-delegate branch August 12, 2026 15:22
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