wogiflow 2.23.0 → 2.24.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.
@@ -165,6 +165,18 @@ You MAY:
165
165
 
166
166
  **If the user provides 9 items, the epic MUST contain 9 stories (or items grouped into stories where every item appears as an acceptance criterion). Verify this with a reconciliation count before proceeding.**
167
167
 
168
+ ## P0 Specification-Quality Gates (v2.24.0+)
169
+
170
+ Before finalizing an epic, run the same P0 gates `/wogi-story` uses (`scripts/flow-story-gates.js`):
171
+
172
+ 1. **Long Input Gate** — ≥40 lines or ≥5 items → route to `/wogi-extract-review`
173
+ 2. **Item Reconciliation** — already enforced via Anti-Deferral above; use `gates.reconcileItems()` to generate the manifest mechanically
174
+ 3. **Consumer Impact** — if epic description contains refactor/rename/migrate/etc. → grep consumers, list breaking count, recommend phased migration at ≥5
175
+ 4. **Scope-Confidence** — extract "new X"/"existing Y" assumptions → classify against codebase → surface CONTRADICTED/UNVERIFIED as Pending Clarifications
176
+ 5. **Intent Bootstrap Coordination** — schedule IGR bootstrap if missing; respects existing session-state flag
177
+
178
+ All fail-open. Call `require('wogiflow/scripts/flow-story-gates')` directly in the epic-creation flow.
179
+
168
180
  ## Tips
169
181
 
170
182
  - **Start with epics for major features** - Break down into stories before implementation
@@ -182,6 +182,31 @@ Contradictions are resolved automatically using temporal ordering:
182
182
 
183
183
  The superseded statement is marked and excluded from story generation.
184
184
 
185
+ ## Item Manifest Export (v2.24.0+)
186
+
187
+ After review is complete, the confirmed items can be exported as an **Item Manifest** in the format `/wogi-story`'s P0 item-reconciliation gate consumes directly. This closes the re-extraction loop — when `/wogi-start` routes a long input to `/wogi-extract-review`, the resulting manifest is handed to `/wogi-story` with `bypassLongInput: true` so story creation doesn't re-route back to extraction.
188
+
189
+ ```bash
190
+ flow extract-zero-loss manifest # JSON: { items, count, bypassLongInput, sourceSessionId, intentBootstrapScheduled }
191
+ ```
192
+
193
+ AI flow:
194
+ ```
195
+ User pastes large input
196
+
197
+ /wogi-start detects line/item threshold → routes to /wogi-extract-review
198
+
199
+ Extract → review → confirm completeness
200
+
201
+ flow extract-zero-loss manifest → JSON
202
+
203
+ /wogi-story --full-input=<manifest.items.join('\n')> --bypass-long-input
204
+
205
+ Item Reconciliation gate sees bypassLongInput, skips Gate 1, runs Gates 2-5 normally
206
+ ```
207
+
208
+ The manifest also carries an `intentBootstrapScheduled` flag so `/wogi-story` won't re-prompt the user if /wogi-extract-review already scheduled IGR bootstrap.
209
+
185
210
  ## Files
186
211
 
187
212
  | File | Location |
@@ -145,6 +145,41 @@ node node_modules/wogiflow/scripts/flow-feature.js progress ft-a1b2c3d4
145
145
  | → | In Progress (1-99%) |
146
146
  | ✓ | Completed (100%) |
147
147
 
148
+ ## Anti-Deferral Rule (MANDATORY — v2.24.0+)
149
+
150
+ **When creating a feature from user input, EVERY item the user provided MUST become a tracked story within the feature.**
151
+
152
+ You must NEVER:
153
+ - Create stories for items 1-3 and silently skip items 4-6 because you judged them as "enhancements"
154
+ - Label items as "deferred" or "long-term" and exclude them from the feature
155
+ - Apply your own priority filter to decide which items deserve stories
156
+
157
+ You MAY:
158
+ - Assign different priorities (P0/P1/P2/P3) — but ALL items get stories
159
+ - Suggest an execution order — but ALL items are tracked in the feature
160
+ - Ask the user "Should I defer items 4-6?" — explicit user consent is the ONLY valid reason to exclude items
161
+
162
+ **If the user provides 5 items, the feature MUST contain 5 stories (or items grouped into stories where every item appears as an acceptance criterion).** Verify with a reconciliation count before proceeding.
163
+
164
+ ## P0 Specification-Quality Gates (v2.24.0+)
165
+
166
+ When creating a feature from user input, apply the same P0 gates `/wogi-story` uses (from `scripts/flow-story-gates.js`):
167
+
168
+ 1. **Long Input Gate** — ≥40 lines or ≥5 items → route to `/wogi-extract-review` first
169
+ 2. **Item Reconciliation** — ≥3 items → enumerate items as a manifest + verify every item maps to at least one story
170
+ 3. **Consumer Impact Analysis** — if the feature title/description contains refactor/rename/migrate/replace/consolidate/split/extract/move keywords → run `git grep` on seeded filenames, list likely consumers, recommend phased migration if ≥5 breaking consumers
171
+ 4. **Scope-Confidence Audit** — extract "new X"/"existing Y"/"the Z service" assumptions from the description, classify against codebase (VERIFIED/CONTRADICTED/UNVERIFIED), write to a Pending Clarifications section on the feature
172
+ 5. **Intent Bootstrap Coordination** — if IGR is enabled and artifacts missing, schedule bootstrap via session-state flag (do NOT duplicate-prompt)
173
+
174
+ All gates fail-open. Use `flow-story-gates.js` directly:
175
+
176
+ ```javascript
177
+ const gates = require('wogiflow/scripts/flow-story-gates');
178
+ gates.reconcileItems(userInput);
179
+ gates.analyzeConsumerImpact(title + ' ' + description);
180
+ gates.auditScopeConfidence(description);
181
+ ```
182
+
148
183
  ## Tips
149
184
 
150
185
  - **Features represent user-facing capabilities** - Not technical components
@@ -182,6 +182,34 @@ When `/wogi-plan` is invoked with a description argument, it should:
182
182
  1. Create the plan structure in `.workflow/plans/`
183
183
  2. Enter Claude Code plan mode with the description: `EnterPlanMode` with the plan context
184
184
 
185
+ ## Anti-Deferral Rule (MANDATORY — v2.24.0+)
186
+
187
+ **When creating a plan from user input, EVERY item the user provided MUST become a tracked epic or feature within the plan.**
188
+
189
+ You must NEVER:
190
+ - Create epics for items 1-3 and silently skip items 4-7 because you judged them as "enhancements" or "long-term"
191
+ - Label items as "deferred" and exclude them from the plan
192
+ - Apply your own filter to decide which items deserve tracking
193
+
194
+ You MAY:
195
+ - Assign different priorities (P0/P1/P2/P3) — but ALL items get epics/features
196
+ - Suggest an execution order — but ALL items are tracked in the plan
197
+ - Ask the user "Should I defer items 4-7?" — explicit user consent is the ONLY valid reason to exclude items
198
+
199
+ **If the user provides 7 items, the plan MUST contain 7 tracked sub-items (epics or features, possibly grouped where every item appears as a criterion).** Verify with a reconciliation count before proceeding.
200
+
201
+ ## P0 Specification-Quality Gates (v2.24.0+)
202
+
203
+ When creating a plan from user input, apply the same P0 gates `/wogi-story` uses (`scripts/flow-story-gates.js`):
204
+
205
+ 1. **Long Input Gate** — ≥40 lines or ≥5 items → route to `/wogi-extract-review`
206
+ 2. **Item Reconciliation** — ≥3 items → enumerate manifest + verify every item maps
207
+ 3. **Consumer Impact** — refactor keywords trigger a grep; ≥5 breaking consumers → recommend phased migration
208
+ 4. **Scope-Confidence** — extract "new X"/"existing Y"/"the Z service" claims; classify against codebase; surface contradictions as Pending Clarifications
209
+ 5. **Intent Bootstrap Coordination** — schedule IGR bootstrap if missing (don't re-prompt)
210
+
211
+ All fail-open.
212
+
185
213
  ## Tips
186
214
 
187
215
  - **Plans are for strategic visibility** - Track high-level progress
@@ -328,3 +328,14 @@ Controlled by `.workflow/config.json`:
328
328
  - **WebMCP assertions**: ~100 tokens per step (tool call + JSON assertion)
329
329
  - **Savings**: ~95% token reduction for a 10-step test flow
330
330
  - **Bonus**: Deterministic results (no visual diff ambiguity)
331
+
332
+ ## Evidence Tier (v2.24.0+)
333
+
334
+ A successful `/wogi-test-browser` run emits **Evidence Tier 4 (SHIPPED)** — the highest tier on the Completion Truth Gate scale. Browser-driven WebMCP tests exercise real DOM interactions with real event listeners, network calls, and state transitions.
335
+
336
+ When reporting results:
337
+ ```json
338
+ { "evidenceTier": 4, "evidenceTierLabel": "SHIPPED" }
339
+ ```
340
+
341
+ See `/wogi-test` for the full tier scale. L0/L1 tasks touching UI should reach Tier 4 before closing; Truth Gate (Step 3.9) will downgrade "done" claims that don't.
@@ -99,4 +99,15 @@ During `/wogi-start` Step 3, verify:
99
99
  - Run generated tests AFTER implementing → they should all pass
100
100
  - If any test passes before implementation → WARNING: test may be trivial
101
101
 
102
+ ## Evidence Tier (v2.24.0+)
103
+
104
+ Generated tests that only assert structural properties (class exists, function has signature) emit **Evidence Tier 1 (STATIC)**. Tests that exercise actual behavior emit **Evidence Tier 2 (COMPILED)** once they pass. To reach Tier 3+ (interactive / shipped), tests must make real network or DOM calls — see `/wogi-test` (API/UI) and `/wogi-test-browser` for those.
105
+
106
+ When recording test results in `.workflow/verifications/`, include:
107
+ ```json
108
+ { "evidenceTier": 1|2, "evidenceTierLabel": "STATIC"|"COMPILED" }
109
+ ```
110
+
111
+ The Completion Truth Gate reads these labels to decide whether "tests pass" is sufficient to accept a "done" claim. L0/L1 tasks cannot close on Tier 1 alone.
112
+
102
113
  ARGUMENTS: {args}
@@ -285,6 +285,31 @@ Include results in the summary:
285
285
  Generated Tests: [passed]/[total] passed
286
286
  ```
287
287
 
288
+ ## Evidence Tiers (v2.24.0+)
289
+
290
+ Every test invocation should emit an **evidence tier** label that the Completion Truth Gate (Step 3.9 in `/wogi-start`) uses to accept or downgrade "done" claims. A task that claims completion without sufficient tier evidence gets surfaced as "implemented (unverified)" rather than rubber-stamped as done.
291
+
292
+ | Tier | Label | What it means | Source |
293
+ |------|-------|---------------|--------|
294
+ | 0 | NONE | No test ran or all tests silently skipped | N/A |
295
+ | 1 | STATIC | Code parses / type-checks cleanly | `flow lint`, `flow typecheck` |
296
+ | 2 | COMPILED | Unit tests pass | `flow-test-integrity.js` generated/unit tests |
297
+ | 3 | INTERACTIVE | API calls succeed end-to-end (HTTP round-trips, DB reads) | `flow-test-api.js`, `flow-test-ui.js` backend hits |
298
+ | 4 | SHIPPED | UI interaction succeeds in a real browser (click, submit, see result) | `flow-test-ui.js` browser E2E |
299
+
300
+ Output format (JSON mode):
301
+ ```json
302
+ {
303
+ "passed": true,
304
+ "results": [...],
305
+ "evidenceTier": 3,
306
+ "evidenceTierLabel": "INTERACTIVE",
307
+ "gates": { "static": true, "unit": true, "api": true, "ui": false }
308
+ }
309
+ ```
310
+
311
+ Any `/wogi-start` task closing with `evidenceTier < 3` for features that touch UI or a service boundary will be flagged by the Truth Gate. L3 tasks (refactor/chore) accept tier 1–2. L0/L1 tasks require tier 3+.
312
+
288
313
  ## Important Notes
289
314
 
290
315
  - Testing is **disabled by default** — zero overhead for projects that don't use it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wogiflow",
3
- "version": "2.23.0",
3
+ "version": "2.24.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 && 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 && 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",
@@ -390,6 +390,46 @@ function getConfirmedTasks() {
390
390
  }));
391
391
  }
392
392
 
393
+ /**
394
+ * v2.24.0 — Export confirmed items as an "Item Manifest" compatible with
395
+ * /wogi-story's item-reconciliation gate (wf-63c0f4cc). Downstream callers
396
+ * (/wogi-story, /wogi-epics, /wogi-feature, /wogi-plan) can pass this to
397
+ * their P0 gates as `fullInput` and mark `bypassLongInput: true` so the
398
+ * re-extraction loop is skipped.
399
+ *
400
+ * @returns {{items: Array<string>, count: number, bypassLongInput: true, sourceSessionId: string, intentBootstrapScheduled: boolean}}
401
+ */
402
+ function exportAsItemManifest() {
403
+ const session = loadReviewSession();
404
+ if (!session) throw new Error('No review session active');
405
+ if (!session.completeness_confirmed) {
406
+ throw new Error('Cannot export manifest: review not yet confirmed as complete');
407
+ }
408
+
409
+ const items = session.items
410
+ .filter(i => i.review_status === 'confirmed')
411
+ .map(i => (i.text || '').trim())
412
+ .filter(Boolean);
413
+
414
+ // Coordinate with Intent Bootstrap (see flow-story-gates.coordinateIntentBootstrap)
415
+ // so /wogi-start doesn't re-prompt if the user already scheduled bootstrap via
416
+ // /wogi-story during this session.
417
+ let intentBootstrapScheduled = false;
418
+ try {
419
+ const gates = require('./flow-story-gates');
420
+ const result = gates.coordinateIntentBootstrap();
421
+ intentBootstrapScheduled = !!(result && result.scheduled);
422
+ } catch (_err) { /* non-critical */ }
423
+
424
+ return {
425
+ items,
426
+ count: items.length,
427
+ bypassLongInput: true,
428
+ sourceSessionId: session.id || null,
429
+ intentBootstrapScheduled
430
+ };
431
+ }
432
+
393
433
  // =============================================================================
394
434
  // DISPLAY HELPERS
395
435
  // =============================================================================
@@ -779,6 +819,7 @@ module.exports = {
779
819
 
780
820
  // Get results
781
821
  getConfirmedTasks,
822
+ exportAsItemManifest, // v2.24.0 — Wave 2 alignment with /wogi-story P0 gates
782
823
 
783
824
  // Display
784
825
  formatReviewStatus,
@@ -858,6 +899,16 @@ if (require.main === module) {
858
899
  }
859
900
  break;
860
901
 
902
+ case 'manifest':
903
+ // v2.24.0 — export Item Manifest for downstream /wogi-story coordination
904
+ try {
905
+ const manifest = exportAsItemManifest();
906
+ console.log(JSON.stringify(manifest, null, 2));
907
+ } catch (err) {
908
+ console.error(`${c.red}✗ ${err.message}${c.reset}`);
909
+ }
910
+ break;
911
+
861
912
  default:
862
913
  console.log('Extraction Review Module');
863
914
  console.log('Commands:');