wogiflow 2.24.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -304,6 +304,46 @@ In `config.json`:
304
304
  }
305
305
  ```
306
306
 
307
+ ## Rule-Creation Adversary (v2.25.0+ — OPTIONAL but recommended for ambiguous rules)
308
+
309
+ When creating a non-trivial rule (anything beyond pure preference-setting like "always use semicolons"), spawn an adversary on a different model (default `sonnet` via `config.researchReasoningGate.tier3.adversaryModel`) to stress-test the proposed rule BEFORE it lands in `decisions.md`.
310
+
311
+ ```
312
+ Spawn Agent (subagent_type: general-purpose, model: <adversaryModel>):
313
+
314
+ Input:
315
+ Proposed rule title: <title>
316
+ Proposed rule body: <body>
317
+ User's original phrasing: <literal request>
318
+
319
+ Prompt:
320
+ You are the rule-creation adversary.
321
+ 1. Edge cases: name 3 situations where following this rule would produce
322
+ worse outcomes than NOT following it.
323
+ 2. Interpretation: are there 2+ reasonable interpretations? If yes, list
324
+ them and pick the one the user most likely meant.
325
+ 3. Scope creep: could this rule be over-applied to situations the user
326
+ didn't intend? Suggest scope qualifiers.
327
+ 4. Verdict:
328
+ - ACCEPT — ship as-is
329
+ - CLARIFY — multiple interpretations; ask user
330
+ - NARROW — over-application risk; add scope qualifiers
331
+ - REJECT — edge cases dominate; more harm than good
332
+
333
+ Output JSON: {
334
+ "verdict", "edge_cases", "interpretations",
335
+ "scope_qualifiers", "suggested_revision"
336
+ }
337
+ ```
338
+
339
+ Process:
340
+ - **ACCEPT** → proceed with rule creation
341
+ - **CLARIFY** → ask user to pick interpretation
342
+ - **NARROW** → show scope qualifier; ask user to approve
343
+ - **REJECT** → surface edge cases; require explicit override
344
+
345
+ Fail-open: adversary unavailable → proceed with standard flow. User confirmation is still present.
346
+
307
347
  ## Files
308
348
 
309
349
  | Action | File |
@@ -1209,3 +1209,32 @@ Say "show me the rules" or "what patterns are we using?" anytime.
1209
1209
  ### If user cancels mid-wizard
1210
1210
  - Save progress to `.workflow/state/setup-progress.json`
1211
1211
  - Next run can offer to resume
1212
+
1213
+ ## v2.25.0+ — Modern Config Scaffolding (MANDATORY)
1214
+
1215
+ New projects MUST be initialized with the following modern-stack config blocks explicitly written to `.workflow/config.json` so users can see + tune them (defaults-only inheritance is fine for behavior, but visibility matters for learning):
1216
+
1217
+ ```json
1218
+ {
1219
+ "intentGroundedReasoning": { "enabled": true },
1220
+ "taskBoundaryReset": {
1221
+ "enabled": true,
1222
+ "maxRestartsPerSession": 50
1223
+ },
1224
+ "storyFlow": {
1225
+ "consumerImpactAnalysis": { "enabled": true, "breakingThreshold": 5 },
1226
+ "scopeConfidenceAudit": { "enabled": true },
1227
+ "itemReconciliation": { "enabled": true, "minItems": 3 }
1228
+ },
1229
+ "longInputGate": { "enabled": true, "lineThreshold": 40 },
1230
+ "researchReasoningGate": {
1231
+ "enabled": true,
1232
+ "tier2": { "enabled": true },
1233
+ "tier3": { "enabled": true, "adversaryModel": "sonnet" }
1234
+ }
1235
+ }
1236
+ ```
1237
+
1238
+ These capabilities (IGR, task-boundary restart, P0 story gates, long-input routing, research reasoning gate) have proven out in 2.22+ releases. New users should NOT have to manually enable them via `flow migrate-igr` or equivalent — they are active from the first session.
1239
+
1240
+ If onboarding a workspace (multi-repo), also ensure `workspace.autoPickupChannelDispatches: true` and the 2.22.x restart-handoff settings are present.
@@ -275,6 +275,52 @@ In `config.json`:
275
275
  }
276
276
  ```
277
277
 
278
+ ## Promotion Adversary (v2.25.0+ — MANDATORY)
279
+
280
+ Before promoting a pattern from `feedback-patterns.md` to `decisions.md`, run a **Promotion Adversary** on a different model. Rationale: same-model self-critique rubber-stamps. The adversary checks whether the N events that triggered promotion share an actual root cause (genuine recurrence) vs. superficial similarity with different underlying causes (false recurrence — common when the pattern detector just matched keywords).
281
+
282
+ ```
283
+ Spawn Agent (subagent_type: general-purpose,
284
+ model: config.researchReasoningGate.tier3.adversaryModel, default 'sonnet'):
285
+
286
+ Input:
287
+ Proposed rule: <title + body>
288
+ Triggering events: [
289
+ { date, request, correction },
290
+ { date, request, correction },
291
+ { date, request, correction }
292
+ ]
293
+
294
+ Prompt:
295
+ You are the rule-promotion adversary.
296
+ Do these N events actually share a root cause, or are they superficially
297
+ similar events with different underlying issues?
298
+
299
+ 1. For each event: describe the root cause in your own words.
300
+ 2. List what's common to all N root causes.
301
+ 3. List what's different between them.
302
+ 4. Verdict:
303
+ - SAME_PATTERN — genuine recurrence; rule is well-founded
304
+ - MIXED — N-1 match but one event has a different root cause
305
+ - DIFFERENT — surface-similar only; no unifying pattern
306
+
307
+ Output JSON:
308
+ {
309
+ "verdict": "SAME_PATTERN" | "MIXED" | "DIFFERENT",
310
+ "root_causes": [...],
311
+ "commonalities": [...],
312
+ "differences": [...],
313
+ "suggested_rule_scope": "as_proposed" | "narrower" | "split_into_N"
314
+ }
315
+ ```
316
+
317
+ Process the verdict:
318
+ - **SAME_PATTERN** → proceed with promotion as-is
319
+ - **MIXED** → ask the user: "Adversary flags event #X as different root cause. Promote rule anyway, narrow scope, or split into multiple rules?"
320
+ - **DIFFERENT** → DO NOT auto-promote. Surface adversary output; require explicit user confirmation.
321
+
322
+ Fail-open: if adversary cannot be spawned (missing API key, network), proceed with standard promotion and log a warning. The threshold check + user confirmation still apply.
323
+
278
324
  ## Files
279
325
 
280
326
  | Action | File |
@@ -1077,3 +1077,29 @@ AskUserQuestion({
1077
1077
  }]
1078
1078
  });
1079
1079
  ```
1080
+
1081
+ ## v2.25.0+ — Modern Config Scaffolding (MANDATORY)
1082
+
1083
+ When generating `.workflow/config.json` for a fresh project, include these 2.22+ capability blocks so new users inherit the current-best defaults:
1084
+
1085
+ ```json
1086
+ {
1087
+ "intentGroundedReasoning": { "enabled": true },
1088
+ "taskBoundaryReset": { "enabled": true, "maxRestartsPerSession": 50 },
1089
+ "storyFlow": {
1090
+ "consumerImpactAnalysis": { "enabled": true, "breakingThreshold": 5 },
1091
+ "scopeConfidenceAudit": { "enabled": true },
1092
+ "itemReconciliation": { "enabled": true, "minItems": 3 }
1093
+ },
1094
+ "longInputGate": { "enabled": true, "lineThreshold": 40 },
1095
+ "researchReasoningGate": {
1096
+ "enabled": true,
1097
+ "tier2": { "enabled": true },
1098
+ "tier3": { "enabled": true, "adversaryModel": "sonnet" }
1099
+ }
1100
+ }
1101
+ ```
1102
+
1103
+ These drive IGR (Architect + Adversary + Truth Gate), task-boundary context reset via the `wogi-claude` wrapper, `/wogi-story` P0 spec gates, auto-routing of long inputs to `/wogi-extract-review`, and the research reasoning gate's assumption-surfacing + cross-model adversary. All have proven out across the 2.22.x release series; new users should not have to discover them one at a time.
1104
+
1105
+ For multi-repo workspaces, also scaffold `workspace.autoPickupChannelDispatches: true` and leave the other `workspace.*` defaults intact — they include the 2.22.2 restart-handoff protocol.
@@ -356,3 +356,44 @@ Each finding is displayed using these fields from `last-review.json`:
356
356
  | File | `finding.file` + `finding.line` | "src/api.ts:45" |
357
357
  | Issue | `finding.issue` | "Raw JSON.parse without try-catch" |
358
358
  | Recommendation | `finding.recommendation` | "Use safeJsonParse from flow-utils.js" |
359
+
360
+ ## Anti-Deferral Enforcement (v2.25.0+ — MANDATORY)
361
+
362
+ The **Review-Findings Anti-Deferral Rule** (`.workflow/state/decisions.md`, 2026-04-15) extends to `/wogi-triage` mechanically in v2.25.0+. Prevents the rubber-stamp pattern where the AI silently drops findings from "fix all" requests.
363
+
364
+ **Enforcement rules**:
365
+
366
+ 1. **"Defer" / "skip" requires explicit user confirmation with a reason.** When the AI or user proposes to defer a finding, the triage flow MUST prompt:
367
+ ```
368
+ Defer finding wf-review-XXXX?
369
+ Severity: HIGH
370
+ Reason required: [user input]
371
+ [Confirm defer] [Cancel — fix now]
372
+ ```
373
+ Auto-defer without reason is FORBIDDEN.
374
+
375
+ 2. **"Fix all" / "Option 1" / equivalent means fix ALL.** If the user requests bulk processing:
376
+ - Ship a fix for every finding with evidence-tier ≥ 1
377
+ - If any finding is too large, STOP and ask: "Finding X requires ~Y minutes of work. Ship now, split to its own release, or defer (needs reason)?"
378
+ - Never silently convert a finding to "deferred" in commit messages or release notes
379
+
380
+ 3. **Commit/release consistency check.** Before finalizing, scan the commit message / release notes against the findings list. If the message claims "fixes F1, F2, F3, M1" but M1 isn't in the diff, BLOCK with:
381
+ ```
382
+ Commit message claims M1 is fixed, but M1 does not appear in the diff.
383
+ Options: [Fix M1 now] [Remove M1 from message] [Acknowledge + proceed]
384
+ ```
385
+
386
+ 4. **Triage output includes a Deferral Audit Trail**:
387
+ ```
388
+ ━━━ TRIAGE SUMMARY ━━━
389
+ Fixed: 12
390
+ Deferred (with reasons): 2
391
+ • M3 — "requires restructure, tracked as wf-XXXXXXXX" (user-confirmed)
392
+ • L5 — "out of scope for current release" (user-confirmed)
393
+ Silently dropped: 0 ← MUST be 0
394
+ ━━━━━━━━━━━━━━━━━━━━━━
395
+ ```
396
+
397
+ Historical incident (v2.17.4 release, 2026-04-15): commit message claimed "fix all findings" but M1 and M3 were silently dropped. The v2.25.0+ mechanical enforcement makes that failure mode architecturally impossible — the flow stops and asks rather than letting the AI make an autonomous defer decision.
398
+
399
+ Skip only if `config.triage.antiDeferralEnforcement.enabled` is explicitly `false` (default: true).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wogiflow",
3
- "version": "2.24.0",
3
+ "version": "2.25.0",
4
4
  "description": "AI-powered development workflow management system with multi-model support",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "scripts": {
12
12
  "flow": "./scripts/flow",
13
- "test": "NODE_ENV=test node --test tests/auto-compact-prompt.test.js tests/flow-paths.test.js tests/flow-io.test.js tests/flow-config-loader.test.js tests/flow-damage-control.test.js tests/flow-output.test.js tests/flow-constants.test.js tests/flow-session-state.test.js tests/flow-hooks-integration.test.js tests/flow-utils.test.js tests/flow-security.test.js tests/flow-memory-db.test.js tests/flow-durable-session.test.js tests/flow-skill-matcher.test.js tests/flow-bridge.test.js tests/flow-proactive-compact.test.js tests/flow-cascade-completion.test.js tests/flow-capture-gate.test.js tests/flow-correction-detector-hybrid.test.js tests/flow-promote.test.js tests/flow-archive-runs.test.js tests/flow-memory.test.js tests/flow-hooks-pre-tool-helpers.test.js tests/flow-hooks-bugfix-scope-gate.test.js tests/flow-hooks-routing-gate.test.js tests/flow-hooks-phase-read-gate.test.js tests/flow-hooks-commit-log-gate.test.js tests/flow-hooks-deploy-gate.test.js tests/flow-hooks-todowrite-gate.test.js tests/flow-hooks-git-safety-gate.test.js tests/flow-hooks-scope-mutation-gate.test.js tests/flow-hooks-strike-gate.test.js tests/flow-hooks-component-check.test.js tests/flow-hooks-scope-gate.test.js tests/flow-hooks-implementation-gate.test.js tests/flow-hooks-research-gate.test.js tests/flow-hooks-loop-check.test.js tests/flow-hooks-manager-boundary-gate.test.js tests/flow-hooks-phase-gate.test.js tests/flow-hooks-pre-tool-orchestrator.test.js tests/flow-hooks-observation-capture.test.js tests/flow-hooks-task-gate.test.js tests/flow-durable-session-suspension.test.js tests/flow-health-mcp-scopes.test.js tests/flow-lean-config.test.js tests/flow-workspace-autopickup.test.js tests/flow-worker-boundary-gate.test.js tests/flow-worker-question-classifier.test.js tests/flow-completion-truth-gate-contradictions.test.js tests/flow-structure-sensor.test.js tests/flow-workspace-dispatch-tracking.test.js tests/flow-story-gates.test.js tests/flow-workspace-restart-handoff.test.js tests/flow-wogi-claude-wrapper.test.js tests/flow-wave1-integrations.test.js tests/flow-wave2-integrations.test.js && NODE_ENV=test node tests/run-quality-gates.test.js",
13
+ "test": "NODE_ENV=test node --test tests/auto-compact-prompt.test.js tests/flow-paths.test.js tests/flow-io.test.js tests/flow-config-loader.test.js tests/flow-damage-control.test.js tests/flow-output.test.js tests/flow-constants.test.js tests/flow-session-state.test.js tests/flow-hooks-integration.test.js tests/flow-utils.test.js tests/flow-security.test.js tests/flow-memory-db.test.js tests/flow-durable-session.test.js tests/flow-skill-matcher.test.js tests/flow-bridge.test.js tests/flow-proactive-compact.test.js tests/flow-cascade-completion.test.js tests/flow-capture-gate.test.js tests/flow-correction-detector-hybrid.test.js tests/flow-promote.test.js tests/flow-archive-runs.test.js tests/flow-memory.test.js tests/flow-hooks-pre-tool-helpers.test.js tests/flow-hooks-bugfix-scope-gate.test.js tests/flow-hooks-routing-gate.test.js tests/flow-hooks-phase-read-gate.test.js tests/flow-hooks-commit-log-gate.test.js tests/flow-hooks-deploy-gate.test.js tests/flow-hooks-todowrite-gate.test.js tests/flow-hooks-git-safety-gate.test.js tests/flow-hooks-scope-mutation-gate.test.js tests/flow-hooks-strike-gate.test.js tests/flow-hooks-component-check.test.js tests/flow-hooks-scope-gate.test.js tests/flow-hooks-implementation-gate.test.js tests/flow-hooks-research-gate.test.js tests/flow-hooks-loop-check.test.js tests/flow-hooks-manager-boundary-gate.test.js tests/flow-hooks-phase-gate.test.js tests/flow-hooks-pre-tool-orchestrator.test.js tests/flow-hooks-observation-capture.test.js tests/flow-hooks-task-gate.test.js tests/flow-durable-session-suspension.test.js tests/flow-health-mcp-scopes.test.js tests/flow-lean-config.test.js tests/flow-workspace-autopickup.test.js tests/flow-worker-boundary-gate.test.js tests/flow-worker-question-classifier.test.js tests/flow-completion-truth-gate-contradictions.test.js tests/flow-structure-sensor.test.js tests/flow-workspace-dispatch-tracking.test.js tests/flow-story-gates.test.js tests/flow-workspace-restart-handoff.test.js tests/flow-wogi-claude-wrapper.test.js tests/flow-wave1-integrations.test.js tests/flow-wave2-integrations.test.js tests/flow-wave3-integrations.test.js && NODE_ENV=test node tests/run-quality-gates.test.js",
14
14
  "test:syntax": "find scripts/ lib/ -name '*.js' -not -path '*/node_modules/*' -exec node --check {} +",
15
15
  "lint": "eslint scripts/ lib/ tests/",
16
16
  "lint:ci": "eslint scripts/ lib/ tests/ --max-warnings 0",