feat(skills): add 3-way adversarial plan-challenge phase to reflection orchestrators

After a plan/reflection is elaborated and before it executes, three fresh blind
sub-agents (correctness / robustness / simplicity) attack it on the big model;
the main loop RE-THINKS every aspect a BLOCKER lands (a named plan change, or
[deferred]) and re-challenges once if the plan materially changed. Advisory into
each skill's existing human gate — the human stays the decider.

- lib/challenge-plan.md — reusable phase: fail-safe (never fail open),
  severity-driven (any single-lens BLOCKER = must-address), RE-THINK loop
- agents/plan-challenger.md — challenger role (read-only, big-model per BDR-066)
- lib/tests/plan-challenger.test.sh — 41-assertion structure lock
- wired into 11 orchestrators: ship-feature/init-project/feat/bugfix (build-plan),
  onboard/audit-delta/code-clean (proposals), seo/geo/harden/web-validate (fix-bundle)

Hardened by dogfooding: 3 blind challengers reviewed this feature's own v1 plan
and caught 4 BLOCKERs (fail-open, consensus-buries-lone-finding, wrong model
tier vs BDR-066, false on-disk-plan premise) — all fixed here.
This commit is contained in:
Bastien Chanot
2026-07-17 22:51:50 +02:00
parent 23c8c290d7
commit 6bfc0543e5
15 changed files with 443 additions and 1 deletions
+21
View File
@@ -166,10 +166,31 @@ Append to `.claude/audits/AUDIT-DELTA.md` (create if absent), append-only:
Then show the user the same compact table inline.
### 3b-bis. CHALLENGE THE PROPOSALS (before the gate)
This axis' findings + proposed fixes are a proposal set worth attacking before
the human gate. Persist THIS axis' finding list (not the whole append-only
report) to `.claude/tasks/plans/<date>-<axis>-<HHMM>.md`, then run
`$HOME/.claude/lib/challenge-plan.md` with `PLAN` = that file, `KIND` =
`proposals`, `SCOPE` = this axis' STEP 1 audit set, `CONSTRAINTS` = the axis
spec + the project CLAUDE.md norms already loaded. Three blind challengers ask
whether these are the RIGHT findings/priorities and what the audit under-rated;
the main loop RE-THINKS every aspect a BLOCKER lands (a named change to the
finding set, or `[deferred <date>]`) and re-challenges once if it materially
changed. Feed the REVISED findings + a CHALLENGE SUMMARY into 3c.
### 3c. APPROVAL GATE ★ MANDATORY STOP
Show the CHALLENGE SUMMARY (from 3b-bis) with the 3b findings table, then
AskUserQuestion: **fix all / pick which / none**.
```
CHALLENGE SUMMARY (3b-bis — 3 lenses):
BLOCKERs addressed : <n> — <finding → the named finding-set change that closes it>
Deferred (human-ack): <list | none>
Lenses returned : correctness / robustness / simplicity (NAME any that failed to return)
```
- "Fix what you find" said **in the invocation** does NOT skip this gate:
nobody can approve findings that did not exist yet. The gate is about
*these specific findings*.