deepflow 0.1.45 → 0.1.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",
@@ -137,8 +137,10 @@ experiment_file: ".deepflow/experiments/upload--streaming--failed.md"
137
137
  }
138
138
  ```
139
139
 
140
+ Note: `completed_tasks` is kept for backward compatibility but is now derivable from PLAN.md `[x]` entries. The native task system (TaskList) is the primary source for runtime task status.
141
+
140
142
  **On checkpoint:** Complete wave → update PLAN.md → save to worktree → exit.
141
- **Resume:** `--continue` loads checkpoint, verifies worktree, skips completed tasks.
143
+ **Resume:** `--continue` loads checkpoint, verifies worktree, skips completed tasks. Native tasks are re-registered for remaining `[ ]` items only.
142
144
 
143
145
  ## Behavior
144
146
 
@@ -188,6 +190,30 @@ Load: PLAN.md (required), specs/doing-*.md, .deepflow/config.yaml
188
190
  If missing: "No PLAN.md found. Run /df:plan first."
189
191
  ```
190
192
 
193
+ ### 2.5. REGISTER NATIVE TASKS
194
+
195
+ Parse PLAN.md and create native tasks for tracking, dependency management, and UI spinners.
196
+
197
+ **For each uncompleted task (`[ ]`) in PLAN.md:**
198
+
199
+ ```
200
+ 1. TaskCreate:
201
+ - subject: "{task_id}: {description}" (e.g. "T1: Create upload endpoint")
202
+ - description: Full task block from PLAN.md (files, blocked by, type, etc.)
203
+ - activeForm: "{gerund form of description}" (e.g. "Creating upload endpoint")
204
+
205
+ 2. Store mapping: PLAN.md task_id (T1) → native task ID
206
+ ```
207
+
208
+ **After all tasks created, set up dependencies:**
209
+
210
+ ```
211
+ For each task with "Blocked by: T{n}, T{m}":
212
+ TaskUpdate(taskId: native_id, addBlockedBy: [native_id_of_Tn, native_id_of_Tm])
213
+ ```
214
+
215
+ **On `--continue`:** Only create tasks for remaining `[ ]` items (skip `[x]` completed).
216
+
191
217
  ### 3. CHECK FOR UNPLANNED SPECS
192
218
 
193
219
  Warn if `specs/*.md` (excluding doing-/done-) exist. Non-blocking.
@@ -244,12 +270,30 @@ Topic extraction:
244
270
 
245
271
  ### 5. IDENTIFY READY TASKS
246
272
 
247
- Ready = `[ ]` + all `blocked_by` complete + experiment validated (if applicable) + not in checkpoint.
273
+ Use TaskList to find ready tasks (replaces manual PLAN.md parsing):
274
+
275
+ ```
276
+ Ready = TaskList results where:
277
+ - status: "pending"
278
+ - blockedBy: empty (auto-unblocked by native dependency system)
279
+ ```
280
+
281
+ **Cross-check with experiment validation** (for spike-blocked tasks):
282
+ - If task depends on spike AND experiment not `--passed.md` → still blocked
283
+ - TaskUpdate to add spike as blocker if not already set
284
+
285
+ Ready = TaskList pending + empty blockedBy + experiment validated (if applicable).
248
286
 
249
287
  ### 6. SPAWN AGENTS
250
288
 
251
289
  Context ≥50%: checkpoint and exit.
252
290
 
291
+ **Before spawning each agent**, mark its native task as in_progress:
292
+ ```
293
+ TaskUpdate(taskId: native_id, status: "in_progress")
294
+ ```
295
+ This activates the UI spinner showing the task's activeForm (e.g. "Creating upload endpoint").
296
+
253
297
  **CRITICAL: Spawn ALL ready tasks in a SINGLE response with MULTIPLE Task tool calls.**
254
298
 
255
299
  DO NOT spawn one task, wait, then spawn another. Instead, call Task tool multiple times in the SAME message block. This enables true parallelism.
@@ -319,8 +363,15 @@ Then rename experiment:
319
363
 
320
364
  **Gate:**
321
365
  ```
322
- VERIFIED_PASS → Unblock, log "✓ Spike {task_id} verified"
323
- VERIFIED_FAIL → Block, log "✗ Spike {task_id} failed verification"
366
+ VERIFIED_PASS →
367
+ TaskUpdate(taskId: spike_native_id, status: "completed")
368
+ # Native system auto-unblocks dependent tasks
369
+ Log "✓ Spike {task_id} verified"
370
+
371
+ VERIFIED_FAIL →
372
+ # Spike task stays as pending, dependents remain blocked
373
+ # No TaskUpdate needed — native system keeps them blocked
374
+ Log "✗ Spike {task_id} failed verification"
324
375
  If override: log "⚠ Agent incorrectly marked as passed"
325
376
  ```
326
377
 
@@ -390,6 +441,12 @@ Rules:
390
441
 
391
442
  When a task fails and cannot be auto-fixed:
392
443
 
444
+ **Native task update:**
445
+ ```
446
+ TaskUpdate(taskId: native_id, status: "pending") # Reset to pending, not deleted
447
+ ```
448
+ This keeps the task visible for retry. Dependent tasks remain blocked.
449
+
393
450
  **Behavior:**
394
451
  1. Leave worktree intact at `{worktree_path}`
395
452
  2. Keep checkpoint.json for potential resume
@@ -434,9 +491,11 @@ After spawning wave agents, your turn ENDS. Completion notifications drive the l
434
491
 
435
492
  **Per notification:**
436
493
  1. Read result file for the completed agent
437
- 2. Report ONE line: " Tx: status (commit)"
438
- 3. If NOT all wave agents done end turn, wait
439
- 4. If ALL wave agents done check context, update PLAN.md, spawn next wave or finish
494
+ 2. TaskUpdate(taskId: native_id, status: "completed") auto-unblocks dependent tasks
495
+ 3. Update PLAN.md: `[ ]` `[x]` + commit hash (as before)
496
+ 4. Report ONE line: "✓ Tx: status (commit)"
497
+ 5. If NOT all wave agents done → end turn, wait
498
+ 6. If ALL wave agents done → use TaskList to find newly unblocked tasks, check context, spawn next wave or finish
440
499
 
441
500
  **Between waves:** Check context %. If ≥50%, checkpoint and exit.
442
501
 
@@ -456,18 +515,41 @@ After spawning wave agents, your turn ENDS. Completion notifications drive the l
456
515
 
457
516
  ```
458
517
  /df:execute (context: 12%)
459
- Spawning Wave 1: T1, T2, T3 parallel...
518
+
519
+ Loading PLAN.md...
520
+ T1: Create upload endpoint (ready)
521
+ T2: Add S3 service (blocked by T1)
522
+ T3: Add auth guard (blocked by T1)
523
+
524
+ Registering native tasks...
525
+ TaskCreate → T1 (native: task-001)
526
+ TaskCreate → T2 (native: task-002)
527
+ TaskCreate → T3 (native: task-003)
528
+ TaskUpdate(task-002, addBlockedBy: [task-001])
529
+ TaskUpdate(task-003, addBlockedBy: [task-001])
530
+
531
+ Spawning Wave 1: T1
532
+ TaskUpdate(task-001, status: "in_progress") ← spinner: "Creating upload endpoint"
460
533
 
461
534
  [Agent "T1" completed]
462
- T1: success (abc1234)
535
+ TaskUpdate(task-001, status: "completed") ← auto-unblocks task-002, task-003
536
+ ✓ T1: success (abc1234)
537
+
538
+ TaskList → task-002, task-003 now ready (blockedBy empty)
539
+
540
+ Spawning Wave 2: T2, T3 parallel
541
+ TaskUpdate(task-002, status: "in_progress")
542
+ TaskUpdate(task-003, status: "in_progress")
463
543
 
464
544
  [Agent "T2" completed]
465
- T2: success (def5678)
545
+ TaskUpdate(task-002, status: "completed")
546
+ ✓ T2: success (def5678)
466
547
 
467
548
  [Agent "T3" completed]
468
- T3: success (ghi9012)
549
+ TaskUpdate(task-003, status: "completed")
550
+ ✓ T3: success (ghi9012)
469
551
 
470
- Wave 1 complete (3/3). Context: 35%
552
+ Wave 2 complete (2/2). Context: 35%
471
553
 
472
554
  ✓ doing-upload → done-upload
473
555
  ✓ Complete: 3/3 tasks
@@ -480,27 +562,43 @@ Next: Run /df:verify to verify specs and merge to main
480
562
  ```
481
563
  /df:execute (context: 10%)
482
564
 
565
+ Loading PLAN.md...
566
+ Registering native tasks...
567
+ TaskCreate → T1 [SPIKE] (native: task-001)
568
+ TaskCreate → T2 (native: task-002)
569
+ TaskCreate → T3 (native: task-003)
570
+ TaskUpdate(task-002, addBlockedBy: [task-001])
571
+ TaskUpdate(task-003, addBlockedBy: [task-001])
572
+
483
573
  Checking experiment status...
484
574
  T1 [SPIKE]: No experiment yet, spike executable
485
575
  T2: Blocked by T1 (spike not validated)
486
576
  T3: Blocked by T1 (spike not validated)
487
577
 
488
- Spawning Wave 1: T1 [SPIKE]...
578
+ Spawning Wave 1: T1 [SPIKE]
579
+ TaskUpdate(task-001, status: "in_progress")
489
580
 
490
581
  [Agent "T1 SPIKE" completed]
491
582
  ✓ T1: complete, verifying...
492
583
 
493
584
  Verifying T1...
494
585
  ✓ Spike T1 verified (throughput 8500 >= 7000)
586
+ TaskUpdate(task-001, status: "completed") ← auto-unblocks task-002, task-003
495
587
  → upload--streaming--passed.md
496
588
 
497
- Spawning Wave 2: T2, T3 parallel...
589
+ TaskList task-002, task-003 now ready
590
+
591
+ Spawning Wave 2: T2, T3 parallel
592
+ TaskUpdate(task-002, status: "in_progress")
593
+ TaskUpdate(task-003, status: "in_progress")
498
594
 
499
595
  [Agent "T2" completed]
500
- T2: success (def5678)
596
+ TaskUpdate(task-002, status: "completed")
597
+ ✓ T2: success (def5678)
501
598
 
502
599
  [Agent "T3" completed]
503
- T3: success (ghi9012)
600
+ TaskUpdate(task-003, status: "completed")
601
+ ✓ T3: success (ghi9012)
504
602
 
505
603
  Wave 2 complete (2/2). Context: 40%
506
604
 
@@ -515,11 +613,16 @@ Next: Run /df:verify to verify specs and merge to main
515
613
  ```
516
614
  /df:execute (context: 10%)
517
615
 
616
+ Registering native tasks...
617
+ TaskCreate → T1 [SPIKE], T2, T3 (with dependencies)
618
+
518
619
  Wave 1: T1 [SPIKE] (context: 15%)
620
+ TaskUpdate(task-001, status: "in_progress")
519
621
  T1: complete, verifying...
520
622
 
521
623
  Verifying T1...
522
624
  ✗ Spike T1 failed verification (throughput 1500 < 7000)
625
+ # Spike stays pending — dependents remain blocked
523
626
  → upload--streaming--failed.md
524
627
 
525
628
  ⚠ Spike T1 invalidated hypothesis
@@ -533,12 +636,17 @@ Next: Run /df:plan to generate new hypothesis spike
533
636
  ```
534
637
  /df:execute (context: 10%)
535
638
 
639
+ Registering native tasks...
640
+ TaskCreate → T1 [SPIKE], T2, T3 (with dependencies)
641
+
536
642
  Wave 1: T1 [SPIKE] (context: 15%)
643
+ TaskUpdate(task-001, status: "in_progress")
537
644
  T1: complete (agent said: success), verifying...
538
645
 
539
646
  Verifying T1...
540
647
  ✗ Spike T1 failed verification (throughput 1500 < 7000)
541
648
  ⚠ Agent incorrectly marked as passed — overriding to FAILED
649
+ TaskUpdate(task-001, status: "pending") ← reset, dependents stay blocked
542
650
  → upload--streaming--failed.md
543
651
 
544
652
  ⚠ Spike T1 invalidated hypothesis
@@ -51,13 +51,20 @@ Report per spec: requirements count, acceptance count, quality issues.
51
51
 
52
52
  **If all pass:** Proceed to Post-Verification merge.
53
53
 
54
- **If issues found:** Add fix tasks to PLAN.md in the worktree and loop back to execute:
54
+ **If issues found:** Add fix tasks to PLAN.md in the worktree and register as native tasks, then loop back to execute:
55
55
 
56
56
  1. Discover worktree (same logic as Post-Verification step 1)
57
57
  2. Write new fix tasks to `{worktree_path}/PLAN.md` under the existing spec section
58
58
  - Task IDs continue from last (e.g. if T9 was last, fixes start at T10)
59
59
  - Format: `- [ ] **T10**: Fix {description}` with `Files:` and details
60
- 3. Output report + next step:
60
+ 3. Register fix tasks as native tasks for immediate tracking:
61
+ ```
62
+ For each fix task added:
63
+ TaskCreate(subject: "T10: Fix {description}", description: "...", activeForm: "Fixing {description}")
64
+ TaskUpdate(addBlockedBy: [...]) if dependencies exist
65
+ ```
66
+ This allows `/df:execute --continue` to find fix tasks via TaskList immediately.
67
+ 4. Output report + next step:
61
68
 
62
69
  ```
63
70
  done-upload.md: 4/4 reqs ✓, 3/5 acceptance ✗, 1 quality issue