feat: reviewer class - adversarial | advisory | none, the review-cost dial (2.5.54) - #718
Conversation
leandrodamascena
left a comment
There was a problem hiding this comment.
Deep review @ ad9bee7f
The review-class model is directionally sound, but five behavioral blockers remain. I reproduced the first four against the real packaged CLIs.
P1: --review none makes reviewer-bearing stages impossible to complete
buildRunStageDirective correctly omits the reviewer when the effective class is none (aidlc-orchestrate.ts:1589-1607). Completion still checks the stage's static reviewer declaration and unconditionally requires a fresh REVIEW_COMPLETED (aidlc-state.ts:1272-1291, called by all four completion paths).
Reproduction: a requirements-analysis directive under Review Override: none contains no reviewer, but finalize requirements-analysis refuses because no reviewer receipt exists. There is no valid route to produce that receipt because the reviewer was intentionally disabled.
The completion precondition must use the effective class while preserving the autonomous-swarm exemption.
P1: the iteration ceiling trusts the caller's label instead of enforcing a count
aidlc-log.ts:539-574 checks only whether the supplied --iteration exceeds the budget. It never counts prior REVIEW_REQUESTED rows.
These requests can therefore continue indefinitely:
--iteration 1
--iteration 1
--iteration 1
Both repeated iteration-1 requests succeeded in the packaged CLI. Omitting --iteration, or supplying zero, negative, fractional, or nonnumeric values, also bypasses enforcement; t266 explicitly preserves the no-iteration exemption.
This does not close the stated failure mode of a conductor losing count. The tool should own the sequence/count, require a valid positive integer, and reject duplicates or out-of-order requests.
P1: rebase, re-bump, and reconcile the event taxonomy
Current v2 already owns 2.5.41 through #677. GitHub reports this PR as CONFLICTING/DIRTY.
Both branches independently add the 77th event. Their combination must become 78 events, retain the current 20 categories, resolve the taxonomy/count-test conflicts, select a new version, regenerate distributions, and rerun checks.
P2: --unit is treated as proof of an autonomous swarm
The ceiling ignores scope caps and run overrides whenever flags.unit is present (aidlc-log.ts:533-558). However, ordinary gated inline Construction stages also review per unit (aidlc-orchestrate.ts:3008-3022).
I reproduced iteration 2 being accepted for inline functional-design --unit unit-alpha under a configuration whose effective class is advisory/none. An arbitrary fake --unit also restores the declared budget on a non-unit stage.
The exemption must be based on actual autonomous Bolt/swarm execution, not user-controlled --unit presence. The current t266 case codifies the over-broad behavior.
P2: scope and birth routes silently discard --review
During an in-flight scope change, the emitted command forwards --depth and --test-strategy, but not --review (aidlc-orchestrate.ts:2367-2387).
Reproduction:
next --scope feature --review none
emits only:
scope-change --scope feature
When the supplied scope is already active, neither mutation branch applies the review override. Fresh-workflow birth similarly forwards depth and test strategy but omits review (aidlc-orchestrate.ts:494-510).
Please thread --review through scope-change and intent-birth, or reject unsupported combinations rather than silently ignoring user input.
P3: documentation counts are stale
CHANGELOG.md:11says "75-event taxonomy," while this branch declares 77.audit-format.md:65says "Navigation Events (6 events)" but lists seven.- After rebasing #677, the combined registry should be 78 events and 20 categories.
Verification
- New focused suites: 18/18 passed.
- Independent CLI probes reproduced the four behavioral findings above.
git diff --check: passed.- Current remote CI is green, but it ran on the pre-rebase conflicting head.
Verdict: CHANGES_REQUESTED.
ad9bee7 to
abe3c73
Compare
|
Addressed the requested changes and force-pushed the rebased branch at Resolved:
Verification:
|
074fb59 to
8aedd10
Compare
|
Fixed at Root cause: Changes:
Verification:
|
8aedd10 to
8edde45
Compare
8edde45 to
974e6cc
Compare
leandrodamascena
left a comment
There was a problem hiding this comment.
The previous findings are substantially addressed, but one authority bypass and three recovery/edge-path regressions still block approval.
[P1] Reserve review receipts from the public audit CLI
CLI_RESERVED_EVENT_TYPES does not include REVIEW_REQUESTED or REVIEW_COMPLETED. I reproduced aidlc-audit append REVIEW_REQUESTED ... --iteration 99 succeeding and writing the row, bypassing reviewer identity, budget, sequencing, and locking enforced by aidlc-log. A forged pending request can then be paired with a completion without a legitimate reviewer dispatch.
[P1] Allow recovery when reviewer dispatch fails
REVIEW_REQUESTED is recorded before dispatch. If the reviewer invocation fails or the session terminates, iteration 1 remains consumed. Retrying iteration 1 is rejected as a duplicate, while iteration 2 exceeds the advisory budget, leaving no documented path to obtain the required terminal receipt.
[P2] Preserve --review during flat-layout migration
The migration branch in aidlc-utility.ts returns before applying the parsed review override. intent-birth --review none can therefore succeed during migration while silently leaving the migrated workflow review behavior unchanged.
[P2] Honor the declared advisory class inside autonomous swarms
The swarm directive preserves review_class: advisory, but the review logger uses reviewer_max_iterations ?? 2 for autonomous attempts. A plugin-defined advisory swarm stage therefore receives two passes, violating the advisory single-pass contract. The exemption should ignore scope/run caps while retaining the stage declaration.
The five earlier findings are otherwise corrected. Focused baseline validation passed: 111 tests and 514 assertions. Remote CI and git diff --check are green; the added public-CLI authority probe failed as described.
|
Fixed at Resolved:
Verification:
GitHub has not registered new check runs for this head yet. |
leandrodamascena
left a comment
There was a problem hiding this comment.
The latest corrective commit resolves the previously blocking review-authority, retry-recovery, migration, and autonomous-swarm issues. Focused unit/integration suites, package parity, typecheck, lint, and audit count/version checks pass.
Approving with non-blocking follow-ups:
- Reject a bare
--reviewflag instead of silently continuing under the prior review policy. - Add
review_classto the authoritative stage-definition contract andreview_capto the scope-authoring guides. - Update
t111’s stale 77-event commentary and mirrored list to includeREVIEW_CLASS_CHANGED.
The branch still needs rebasing onto current v2 2.5.53, resolving the version/changelog conflicts, regenerating distributions, and rerunning CI before merge.
… dial (2.5.40) Stage reviews now run under a review class resolved by the engine from three inputs (low-wins): the stage's declared class, the active scope's review_cap, and a per-run --review override. The 7 human-gated ideation/inception prose stages default to a single advisory pass whose findings are quoted verbatim at the approval gate; the 5 Construction design/build stages keep the full adversarial refute-fix-re-review loop. Live A/B runs against the real harness measured the adversarial loop at 12+ minutes of review choreography per inception stage (2.4x the no-reviewer stage baseline) with the two-pass cycle occurring even on clean artifacts; advisory single-pass surfaced the same finding classes at roughly a quarter of the wall-clock. - review_class stage frontmatter (schema-validated, requires reviewer; compile defaults adversarial) rides through stage-graph.json onto the run-stage directive; a none resolution omits the reviewer block. - Scope review_cap (bugfix/poc/workshop ship advisory) + per-run /aidlc --review via config-change; Review Override state field, REVIEW_CLASS_CHANGED audit event (75-event taxonomy), config get/list. - Engine-enforced iteration ceiling: aidlc-log review refuses a REVIEW_REQUESTED beyond the effective budget (advisory 1, adversarial reviewer_max_iterations, none 0); refusal text teaches the terminal path; REVIEW_COMPLETED receipts never refused; fail-open on resolution errors; per-unit (--unit) requests use the declared class (swarm exemption - inside a Bolt the reviewer is the only pre-merge check). - stage-protocol 12a + all 5 harness SKILL.md reviewer steps carry the class branch; reviewer personas gain the Advisory Dispatch stance. - balanced tier (the reviewer tier) pins medium effort on Claude, Codex, and opencode: live A/B showed medium reviews at ~half the xhigh wall-clock with no finding-quality loss. - t265 (schema/graph/resolution/prose pins) + t266 (iteration ceiling via the real CLI); count pins bumped (t28/t81/t216/t220/t231/t239, coverage registry); docs swept (guide 06/10/12, reference 04/12/15, event-count mentions, onboarding fills).
…signer-export golden t65's parse->emit->parse round-trip dropped review_class (the emitter's FIELD_ORDER did not know the new key), and t66's designer-export golden predates the field. Verified the golden diff is exactly the 12 review_class rows (7 advisory + 5 adversarial), nothing else.
Union-merges with the two reviewer-adjacent PRs that merged mid-gate: - #702 (review freeze + terminal receipts): §12a step 3 now carries BOTH the terminal-receipt discipline and the advisory/adversarial class branch; the freeze prose applies to any receipt no further pass follows. - #703 (summary confirmation): schema/graph/lib field rosters carry review_class AND summary_confirmation. Event taxonomy re-based 76 -> 77 (REVIEW_CLASS_CHANGED); README/docs/count pins re-swept; coverage registry regenerated; export golden regenerated.
b804d4d to
bbe3933
Compare
feat: reviewer class - adversarial | advisory | none, the review-cost dial (2.5.41)
Why
Customer feedback: requirements analysis + user stories took 3 hours in a workshop, with "the reviewer agent running multiple iterations" visibly dominating the wait (30+ minutes per stage after the questions were answered). Live A/B runs against the real harness (TUI-driven, shipped settings, audit-ledger timings) reproduced and quantified it:
The adversarial refute-fix-re-review loop spends 2.4x the reviewless stage baseline on review choreography, and its first pass is NOT-READY by design (the persona hunts until it fails to refute), so the two-pass cycle is the common case even on clean artifacts. On human-gated prose stages that cost buys little: the human at the gate is already the authority, and re-review of a fixed artifact kept surfacing NEW findings (3/3 live re-reviews stayed NOT-READY) - prose has unbounded findable issues, so the loop does not converge; it exhausts its budget and presents findings to the human anyway.
The reviewer itself earns its keep: 5/5 independent review passes (adversarial AND neutral framing) caught a genuine Critical a gate-fatigued human would plausibly approve past. The fix is not removing review - it is right-sizing the loop per stage.
What
Review class - a fourth instance of the existing knob pattern (judgment tiers, depth, test strategy):
review_class: adversarial | advisorystage frontmatter (schema-validated, requiresreviewer, compile defaultsadversarial). The 7 human-gated ideation/inception prose stages shipadvisory; the 5 Construction design/build stages stayadversarial.review_cap: adversarial | advisory | nonescope frontmatter; shippedbugfix,poc, andworkshop(the default first-run scope) cap toadvisory./aidlc --review <class>->config-change --review->Review Overridestate field +REVIEW_CLASS_CHANGEDaudit event (77-event taxonomy). Low-wins resolution (resolveReviewClassin aidlc-lib.ts): stage declaration, lowered by scope cap, lowered by override - nothing can raise a class or conjure an undeclared reviewer.aidlc-log.ts reviewrefuses aREVIEW_REQUESTEDwhose--iterationexceeds the effective budget (advisory 1, adversarialreviewer_max_iterations, none 0). The refusal text teaches the terminal path instead of re-triggering a loop.REVIEW_COMPLETEDreceipts are never refused; resolution failures fail open.balancedtier (product-lead + architecture-reviewer, the only balanced agents) pinsmediumeffort on Claude/Codex/opencode. Live A/B: medium review passes at ~half the xhigh wall-clock (2m00s-2m39s vs 4m42s-5m53s) with no verdict/finding-quality loss.Evidence
11 headless reviewer runs (persona A/B + convergence) + 7 live TUI-driven end-to-end runs of the real v2 harness across 6 configurations, same seed, audit-ledger timings. Full data, per-run sandboxes, and REPORT.md retained locally; summary available on request.
Surfaces
Test evidence
Full 7-slice pre-merge gate ran (slice 8, Kiro IDE, is an unmet gate on the Linux CI box - needs macOS + Kiro.app). No red implicates this branch:
Versioning
2.5.41 + README badge + CHANGELOG entry. Originally slotted 2.5.40; re-bumped after #673 merged as 2.5.40 mid-gate (branch is rebased onto that HEAD, 9608d72, absorbing #702 + #703 with union-merged §12a + schema rosters). t265/t266 free (t263/t264 in #702, t267 renamed by #673, #705 pending re-bump).