Commit Graph

5 Commits

Author SHA1 Message Date
ruvnet e332689b8c fix(release): harden hooks, statusline, security, and plugin MCP integration 2026-07-16 23:06:29 -04:00
ruv b5cb847b70 darwin-plugins iter 3 — ruflo-testgen: smoke step 2 covers new tdd-repair skill 2026-06-26 20:29:59 -04:00
ruv 1b336e9ced feat(testgen): Test-Driven Repair via headless claude -p (ADR-175-inspired)
Adds a new ruflo-testgen surface that closes the loop the existing TDD
plugins didn't — we generate tests, this fixes the code to satisfy them.
Inspired by agent-harness-generator/packages/darwin-mode ADR-175 Test-
Driven Repair mode, but implemented via headless `claude -p` instead of
wrapping `metaharness-darwin evolve`. Rationale:

  1. `claude -p` already in our stack (no new optional dep)
  2. Bounded cost via --max-budget-usd (first-class flag)
  3. Capability-restricted via --allowedTools Read,Edit,Bash
  4. Test exit code IS the fitness function (no LLM-as-judge)
  5. Resumable via --session-id

Surface:
  - plugins/ruflo-testgen/scripts/tdd-repair/tdd-repair.mjs (script)
  - plugins/ruflo-testgen/skills/tdd-repair/SKILL.md       (skill)
  - v3/@claude-flow/cli/src/mcp-tools/testgen-tools.ts     (MCP tool:
                                                             testgen_tdd_repair)

Pipeline (Test-Driven mode):
  1. Pre-flight: run the test command. Refuse if already passing.
  2. Spawn `claude -p` with focused prompt (read failing test, fix
     source, don't touch test, verify by running it).
  3. Re-run test to verify the fix; emit per-attempt receipts incl.
     usage.cost_usd from claude's --output-format json.
  4. If green: success. If red after --max-attempts: emit failure
     receipts; workspace left as-modified for review.

Safety (mirrors ADR-153 conventions):
  - --confirm REQUIRED (dry-run otherwise)
  - --max-budget-usd hard cap (default $5, divided across attempts)
  - --allowedTools restricts spawned claude to Read/Edit/Bash
  - --permission-mode acceptEdits (auto-accept within the allowed set)
  - 15 min hard timeout
  - Pre-flight catches --test-command typos before any spend

Conformant mode (--no-test-oracle, agent writes own repro via MCTS)
is scoped for a follow-up ADR — current --no-test-oracle returns
config error with a clear hint.

Smoke verification (docs/benchmarks/tdd-repair/SMOKE-2026-06-22.md):
  Built minimal failing-test fixture: add(a,b) returns a-b instead of
  a+b. Pre-repair: 2/2 tests fail. After `tdd-repair --confirm`:
  source patched to a+b, 2/2 tests pass. Verified by re-running.

Version bump 3.13.3 → 3.14.0 (MINOR per semver — backward-compatible
new MCP tool + new skill). Published with all three dist-tags (latest,
alpha, v3alpha) for @claude-flow/cli, claude-flow, ruflo.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-22 17:15:32 -04:00
ruv 6198abfab7 fix(plugins): reconcile stale smoke contract assertions across 23 plugins
full-system-test surfaced 23/32 plugin smoke contracts failing on a
single drifted assertion: the smoke gate greps ADR-0001 for
`status: Proposed`, but those ADRs were long since promoted to
`Accepted` without updating the gate. Flip the assertion (label, grep,
message) Proposed -> Accepted only where the ADR is genuinely Accepted.

ruflo-core additionally had a stale version assertion (0.2.0 -> 0.2.2).

Left untouched: ruflo-adr, ruflo-browser, ruflo-intelligence — their
ADR-0001 is genuinely Proposed, so their smokes correctly assert it.
No plugin source or ADR changed — only the drifted test assertions.

All 32 plugin smoke contracts now pass; full-system-test is 4/4 green.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-29 15:00:34 -04:00
Reuven f457b39185 feat(ruflo-testgen): v0.2.0 — adopt plugin contract + SPARC Refinement-phase ownership (ADR-0001)
Plugin already had 1 agent + 2 skills + 1 command at v0.1.0. The
contract pieces were missing.

Notable cross-references:
- testgaps worker (consumed) → ruflo-loop-workers ADR-0001 (canonical
  definition of the 12 background workers)
- SPARC Refinement phase (owned) → ruflo-sparc ADR-0001 §"Phase-to-plugin
  alignment". This plugin is the canonical handoff for the Refinement
  phase, paired with ruflo-jujutsu for diff-aware refactor.
- 3 coverage CLI commands surfaced: hooks coverage-gaps, coverage-route,
  coverage-suggest

- ADR-0001 (Proposed) at docs/adrs/0001-testgen-contract.md
- README adds Compatibility (pin v3.6), testgaps worker + 3 coverage
  CLI command surface table, SPARC Refinement-phase ownership block,
  Namespace coordination (claims test-gaps; defers to ruflo-agentdb
  ADR-0001), Verification + Architecture Decisions
- plugin.json bumps 0.1.0 → 0.2.0; description names the testgaps
  worker + SPARC ownership; keywords add mcp, tdd-london-school,
  coverage-routing
- scripts/smoke.sh — 10 structural checks: version + keywords, both
  skills + agent + command present, hooks_worker-dispatch + testgaps
  trigger, 3 coverage CLI commands referenced, v3.6 pin, namespace
  coordination, test-gaps claimed, SPARC Refinement cross-reference,
  ADR Proposed, no wildcard tools

Verification: bash plugins/ruflo-testgen/scripts/smoke.sh → 10/10

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 20:45:33 -04:00