deepflow 0.1.53 → 0.1.55

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.
package/README.md CHANGED
@@ -75,25 +75,40 @@ claude
75
75
  You write the specs, then walk away. The AI runs the full pipeline — hypothesis generation, parallel spikes, implementation, adversarial self-selection, verification — without any human intervention.
76
76
 
77
77
  ```bash
78
- # You define WHAT (the specs already exist as doing-*)
79
- # The AI figures out HOW, overnight
78
+ # You define WHAT (the specs), the AI figures out HOW, overnight
80
79
 
81
- deepflow auto # process all doing-* specs
80
+ deepflow auto # process all specs in specs/
82
81
  deepflow auto --parallel=3 # 3 approaches in parallel
83
82
  deepflow auto --hypotheses=4 # 4 hypotheses per cycle
84
83
  deepflow auto --max-cycles=5 # cap retry cycles
85
84
  ```
86
85
 
87
86
  **What the AI does alone:**
88
- 1. Reads each `doing-*` spec
89
- 2. Generates N hypotheses for how to implement it
87
+ 1. Discovers specs (auto-promotes plain specs to `doing-*`)
88
+ 2. Generates N hypotheses for how to implement each spec
90
89
  3. Runs parallel spikes in isolated worktrees (one per hypothesis)
91
90
  4. Implements the passing approaches
92
91
  5. Adversarial selection: a fresh AI context compares approaches by artifacts only (never reads code), picks the best or rejects all
93
92
  6. If rejected: generates new hypotheses, retries (up to max-cycles)
94
93
  7. On convergence: verifies, merges to main
95
94
 
96
- **What you do:** Write specs (via interactive mode or manually), run `deepflow auto`, read the morning report at `.deepflow/auto-report.md`.
95
+ **What you do:** Write specs (via interactive mode or manually) in `specs/`, run `deepflow auto`, read the morning report at `.deepflow/auto-report.md`. No need to run `/df:plan` first — auto mode promotes plain specs to `doing-*` automatically.
96
+
97
+ **How to use:**
98
+ ```bash
99
+ # In Claude Code — create and approve a spec
100
+ $ claude
101
+ > /df:discover auth
102
+ > /df:spec auth # creates specs/auth.md
103
+ > /exit
104
+
105
+ # In your terminal — run auto mode and walk away
106
+ $ deepflow auto
107
+
108
+ # Next morning — check what happened
109
+ $ cat .deepflow/auto-report.md
110
+ $ git log --oneline
111
+ ```
97
112
 
98
113
  **Safety:** Never pushes to remote. Failed approaches recorded in `.deepflow/experiments/` and never repeated. Specs validated before processing (malformed specs are skipped).
99
114
 
@@ -109,7 +124,7 @@ deepflow auto --max-cycles=5 # cap retry cycles
109
124
  Merge or retry
110
125
  Read morning report
111
126
  ───────────────────────────────── ──────────────────────────────────
112
- specs/doing-*.md is the handoff point
127
+ specs/*.md is the handoff point
113
128
  ```
114
129
 
115
130
  ## The Flow (Interactive)
@@ -150,6 +165,7 @@ deepflow auto --max-cycles=5 # cap retry cycles
150
165
 
151
166
  ```
152
167
  deepflow auto
168
+ | Discover specs (auto-promote plain specs to doing-*)
153
169
  | For each doing-* spec:
154
170
  |
155
171
  | Validate spec (malformed? skip)
@@ -114,14 +114,30 @@ discover_specs() {
114
114
  exit 1
115
115
  fi
116
116
 
117
- # Collect doing-*.md files (read-only — we never modify these)
117
+ # Collect doing-*.md files
118
118
  for f in "${specs_dir}"/doing-*.md; do
119
119
  [[ -e "$f" ]] || continue
120
120
  found+=("$f")
121
121
  done
122
122
 
123
+ # Auto-promote plain specs (not doing-*, done-*, or .debate-*) to doing-*
124
+ for f in "${specs_dir}"/*.md; do
125
+ [[ -e "$f" ]] || continue
126
+ local base
127
+ base="$(basename "$f")"
128
+ # Skip already-prefixed and auxiliary files
129
+ case "$base" in
130
+ doing-*|done-*|.debate-*|.*) continue ;;
131
+ esac
132
+ local new_path="${specs_dir}/doing-${base}"
133
+ mv "$f" "$new_path"
134
+ auto_log "Auto-promoted spec: ${base} -> doing-${base}"
135
+ echo "Promoted: ${base} -> doing-${base}" >&2
136
+ found+=("$new_path")
137
+ done
138
+
123
139
  if [[ ${#found[@]} -eq 0 ]]; then
124
- echo "Error: no specs/doing-*.md files found in ${specs_dir}" >&2
140
+ echo "Error: no specs found in ${specs_dir}" >&2
125
141
  exit 1
126
142
  fi
127
143
 
@@ -420,6 +436,7 @@ run_single_spike() {
420
436
  local slug="$2"
421
437
  local hypothesis="$3"
422
438
  local method="$4"
439
+ local spec_file="$5"
423
440
 
424
441
  local worktree_path="${PROJECT_ROOT}/.deepflow/worktrees/${spec_name}-${slug}"
425
442
  local branch_name="df/${spec_name}-${slug}"
@@ -439,6 +456,12 @@ run_single_spike() {
439
456
  }
440
457
  fi
441
458
 
459
+ # Extract acceptance criteria from spec (the human's judgment proxy)
460
+ local acceptance_criteria=""
461
+ if [[ -f "$spec_file" ]]; then
462
+ acceptance_criteria="$(sed -n '/^## Acceptance Criteria/,/^## /{ /^## Acceptance Criteria/d; /^## /d; p; }' "$spec_file")"
463
+ fi
464
+
442
465
  # Build spike prompt
443
466
  local spike_prompt
444
467
  spike_prompt="You are running a spike experiment to validate a hypothesis for spec '${spec_name}'.
@@ -449,13 +472,19 @@ Hypothesis: ${hypothesis}
449
472
  Method: ${method}
450
473
  --- END HYPOTHESIS ---
451
474
 
475
+ --- ACCEPTANCE CRITERIA (from spec — the human's judgment proxy) ---
476
+ ${acceptance_criteria}
477
+ --- END ACCEPTANCE CRITERIA ---
478
+
452
479
  Your tasks:
453
480
  1. Validate this hypothesis by implementing the minimum necessary to prove or disprove it.
481
+ The spike must demonstrate that the approach can satisfy the acceptance criteria above.
454
482
  2. Write an experiment file at: .deepflow/experiments/${spec_name}--${slug}--active.md
455
483
  The experiment file should contain:
456
484
  - ## Hypothesis: restate the hypothesis
457
485
  - ## Method: what you did to validate
458
486
  - ## Results: what you observed
487
+ - ## Criteria Check: for each acceptance criterion, can this approach satisfy it? (yes/no/unclear)
459
488
  - ## Conclusion: PASSED or FAILED with reasoning
460
489
  3. Write a result YAML file at: .deepflow/results/spike-${slug}.yaml
461
490
  The YAML must contain:
@@ -557,7 +586,7 @@ run_spikes() {
557
586
  auto_log "Spawning spike for ${slug} (hypothesis ${i}/${count})"
558
587
  echo "Spawning spike: ${slug}"
559
588
 
560
- run_single_spike "$spec_name" "$slug" "$hypothesis" "$method" &
589
+ run_single_spike "$spec_name" "$slug" "$hypothesis" "$method" "$spec_file" &
561
590
  pids+=($!)
562
591
  done
563
592
 
@@ -859,6 +888,13 @@ $(cat "$experiment_file")
859
888
  # -----------------------------------------------------------------------
860
889
  # 2. Build selection prompt
861
890
  # -----------------------------------------------------------------------
891
+
892
+ # Extract acceptance criteria from spec (the human's judgment proxy)
893
+ local acceptance_criteria=""
894
+ if [[ -f "$spec_file" ]]; then
895
+ acceptance_criteria="$(sed -n '/^## Acceptance Criteria/,/^## /{ /^## Acceptance Criteria/d; /^## /d; p; }' "$spec_file")"
896
+ fi
897
+
862
898
  local selection_prompt
863
899
  selection_prompt="You are an adversarial quality judge in an autonomous development workflow.
864
900
  Your job is to compare implementation approaches for spec '${spec_name}' and select the best one — or reject all if quality is insufficient.
@@ -867,6 +903,11 @@ IMPORTANT:
867
903
  - This selection phase ALWAYS runs, even with only 1 approach. With a single approach you act as a quality gate.
868
904
  - You CAN and SHOULD reject all approaches if the quality is insufficient. Do not rubber-stamp poor work.
869
905
  - Base your judgment ONLY on the artifacts provided below. Do NOT read code files.
906
+ - Judge each approach against the ACCEPTANCE CRITERIA below — these represent the human's intent.
907
+
908
+ --- ACCEPTANCE CRITERIA (from spec) ---
909
+ ${acceptance_criteria}
910
+ --- END ACCEPTANCE CRITERIA ---
870
911
 
871
912
  There are ${#approach_slugs[@]} approach(es) to evaluate:
872
913
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",