@agent-plan/core 0.2.19-next.8 → 0.2.19

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/dist/schema.d.ts CHANGED
@@ -272,6 +272,46 @@ export declare const AcceptedDecisionSchema: z.ZodObject<{
272
272
  rationale?: string | undefined;
273
273
  implementationNotes?: string | undefined;
274
274
  }>;
275
+ export declare const WorkDeviationSchema: z.ZodObject<{
276
+ id: z.ZodString;
277
+ /** Task the priority selector recommended when the deviation was approved. */
278
+ recommendedTaskId: z.ZodString;
279
+ /** Task intentionally chosen instead of the recommendation. */
280
+ temporaryTaskId: z.ZodString;
281
+ /** Task to surface explicitly after the temporary work is resolved. */
282
+ resumeTaskId: z.ZodString;
283
+ reason: z.ZodDefault<z.ZodString>;
284
+ requestedBy: z.ZodDefault<z.ZodEnum<["agent", "user"]>>;
285
+ approvedBy: z.ZodDefault<z.ZodString>;
286
+ state: z.ZodDefault<z.ZodEnum<["approved", "active", "resolved", "canceled"]>>;
287
+ createdAt: z.ZodString;
288
+ activatedAt: z.ZodDefault<z.ZodString>;
289
+ resolvedAt: z.ZodDefault<z.ZodString>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ id: string;
292
+ createdAt: string;
293
+ recommendedTaskId: string;
294
+ temporaryTaskId: string;
295
+ resumeTaskId: string;
296
+ reason: string;
297
+ requestedBy: "agent" | "user";
298
+ approvedBy: string;
299
+ state: "approved" | "active" | "resolved" | "canceled";
300
+ activatedAt: string;
301
+ resolvedAt: string;
302
+ }, {
303
+ id: string;
304
+ createdAt: string;
305
+ recommendedTaskId: string;
306
+ temporaryTaskId: string;
307
+ resumeTaskId: string;
308
+ reason?: string | undefined;
309
+ requestedBy?: "agent" | "user" | undefined;
310
+ approvedBy?: string | undefined;
311
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
312
+ activatedAt?: string | undefined;
313
+ resolvedAt?: string | undefined;
314
+ }>;
275
315
  export declare const ProjectSchema: z.ZodObject<{
276
316
  name: z.ZodString;
277
317
  goal: z.ZodDefault<z.ZodString>;
@@ -324,6 +364,47 @@ export declare const ProjectSchema: z.ZodObject<{
324
364
  nextFeatureNumber: z.ZodDefault<z.ZodNumber>;
325
365
  nextPhaseNumber: z.ZodDefault<z.ZodNumber>;
326
366
  nextTaskNumber: z.ZodDefault<z.ZodNumber>;
367
+ /** Ordered history of approved temporary work deviations; active entries form a resumable stack. */
368
+ workDeviations: z.ZodDefault<z.ZodArray<z.ZodObject<{
369
+ id: z.ZodString;
370
+ /** Task the priority selector recommended when the deviation was approved. */
371
+ recommendedTaskId: z.ZodString;
372
+ /** Task intentionally chosen instead of the recommendation. */
373
+ temporaryTaskId: z.ZodString;
374
+ /** Task to surface explicitly after the temporary work is resolved. */
375
+ resumeTaskId: z.ZodString;
376
+ reason: z.ZodDefault<z.ZodString>;
377
+ requestedBy: z.ZodDefault<z.ZodEnum<["agent", "user"]>>;
378
+ approvedBy: z.ZodDefault<z.ZodString>;
379
+ state: z.ZodDefault<z.ZodEnum<["approved", "active", "resolved", "canceled"]>>;
380
+ createdAt: z.ZodString;
381
+ activatedAt: z.ZodDefault<z.ZodString>;
382
+ resolvedAt: z.ZodDefault<z.ZodString>;
383
+ }, "strip", z.ZodTypeAny, {
384
+ id: string;
385
+ createdAt: string;
386
+ recommendedTaskId: string;
387
+ temporaryTaskId: string;
388
+ resumeTaskId: string;
389
+ reason: string;
390
+ requestedBy: "agent" | "user";
391
+ approvedBy: string;
392
+ state: "approved" | "active" | "resolved" | "canceled";
393
+ activatedAt: string;
394
+ resolvedAt: string;
395
+ }, {
396
+ id: string;
397
+ createdAt: string;
398
+ recommendedTaskId: string;
399
+ temporaryTaskId: string;
400
+ resumeTaskId: string;
401
+ reason?: string | undefined;
402
+ requestedBy?: "agent" | "user" | undefined;
403
+ approvedBy?: string | undefined;
404
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
405
+ activatedAt?: string | undefined;
406
+ resolvedAt?: string | undefined;
407
+ }>, "many">>;
327
408
  }, "strip", z.ZodTypeAny, {
328
409
  name: string;
329
410
  goal: string;
@@ -353,6 +434,19 @@ export declare const ProjectSchema: z.ZodObject<{
353
434
  nextFeatureNumber: number;
354
435
  nextPhaseNumber: number;
355
436
  nextTaskNumber: number;
437
+ workDeviations: {
438
+ id: string;
439
+ createdAt: string;
440
+ recommendedTaskId: string;
441
+ temporaryTaskId: string;
442
+ resumeTaskId: string;
443
+ reason: string;
444
+ requestedBy: "agent" | "user";
445
+ approvedBy: string;
446
+ state: "approved" | "active" | "resolved" | "canceled";
447
+ activatedAt: string;
448
+ resolvedAt: string;
449
+ }[];
356
450
  }, {
357
451
  name: string;
358
452
  workflowRules: {
@@ -382,6 +476,19 @@ export declare const ProjectSchema: z.ZodObject<{
382
476
  nextFeatureNumber?: number | undefined;
383
477
  nextPhaseNumber?: number | undefined;
384
478
  nextTaskNumber?: number | undefined;
479
+ workDeviations?: {
480
+ id: string;
481
+ createdAt: string;
482
+ recommendedTaskId: string;
483
+ temporaryTaskId: string;
484
+ resumeTaskId: string;
485
+ reason?: string | undefined;
486
+ requestedBy?: "agent" | "user" | undefined;
487
+ approvedBy?: string | undefined;
488
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
489
+ activatedAt?: string | undefined;
490
+ resolvedAt?: string | undefined;
491
+ }[] | undefined;
385
492
  }>;
386
493
  export declare const SubtaskStatusSchema: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
387
494
  export declare const TaskStatusSchema: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
@@ -396,14 +503,14 @@ export declare const SubtaskSchema: z.ZodObject<{
396
503
  createdAt: z.ZodString;
397
504
  updatedAt: z.ZodString;
398
505
  }, "strip", z.ZodTypeAny, {
399
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
506
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
400
507
  updatedAt: string;
401
508
  id: string;
402
509
  createdAt: string;
403
510
  title: string;
404
511
  description: string;
405
512
  }, {
406
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
513
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
407
514
  updatedAt: string;
408
515
  id: string;
409
516
  createdAt: string;
@@ -412,15 +519,21 @@ export declare const SubtaskSchema: z.ZodObject<{
412
519
  }>;
413
520
  export declare const ChecklistItemSchema: z.ZodObject<{
414
521
  id: z.ZodString;
522
+ /** Per-task 1-based position, displayed as C{number} (C1, C2, ...). Default 0
523
+ * so legacy on-disk items without a number still parse; the TaskSchema
524
+ * transform overwrites it with the real index+1. */
525
+ number: z.ZodDefault<z.ZodNumber>;
415
526
  title: z.ZodString;
416
527
  checked: z.ZodDefault<z.ZodBoolean>;
417
528
  }, "strip", z.ZodTypeAny, {
529
+ number: number;
418
530
  id: string;
419
531
  title: string;
420
532
  checked: boolean;
421
533
  }, {
422
534
  id: string;
423
535
  title: string;
536
+ number?: number | undefined;
424
537
  checked?: boolean | undefined;
425
538
  }>;
426
539
  /** Status transitions that require a motivation note from the agent. */
@@ -444,18 +557,44 @@ export declare const StatusLogEntrySchema: z.ZodObject<{
444
557
  date: string;
445
558
  title: string;
446
559
  description: string;
447
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
448
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
560
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
561
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
449
562
  }, {
450
563
  id: string;
451
564
  date: string;
452
565
  title: string;
453
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
454
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
566
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
567
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
568
+ description?: string | undefined;
569
+ }>;
570
+ /** Like StatusLogEntrySchema but for the DERIVED PHASE status, which includes
571
+ * the "draft" and "discovery" lifecycle states absent from TaskStatus. */
572
+ export declare const PhaseStatusLogEntrySchema: z.ZodObject<{
573
+ id: z.ZodString;
574
+ date: z.ZodString;
575
+ fromStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
576
+ toStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
577
+ title: z.ZodString;
578
+ description: z.ZodDefault<z.ZodString>;
579
+ }, "strip", z.ZodTypeAny, {
580
+ id: string;
581
+ date: string;
582
+ title: string;
583
+ description: string;
584
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
585
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
586
+ }, {
587
+ id: string;
588
+ date: string;
589
+ title: string;
590
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
591
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
455
592
  description?: string | undefined;
456
593
  }>;
457
594
  export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
458
595
  id: z.ZodString;
596
+ /** MUST be a phase UUID (not a ref like "P003"). Validated at the schema
597
+ * layer so no adapter can persist an unresolved ref string. */
459
598
  phaseId: z.ZodString;
460
599
  /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
461
600
  number: z.ZodDefault<z.ZodNumber>;
@@ -478,14 +617,14 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
478
617
  date: string;
479
618
  title: string;
480
619
  description: string;
481
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
482
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
620
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
621
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
483
622
  }, {
484
623
  id: string;
485
624
  date: string;
486
625
  title: string;
487
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
488
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
626
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
627
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
489
628
  description?: string | undefined;
490
629
  }>, "many">>;
491
630
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -513,15 +652,21 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
513
652
  }>, "many">>;
514
653
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
515
654
  id: z.ZodString;
655
+ /** Per-task 1-based position, displayed as C{number} (C1, C2, ...). Default 0
656
+ * so legacy on-disk items without a number still parse; the TaskSchema
657
+ * transform overwrites it with the real index+1. */
658
+ number: z.ZodDefault<z.ZodNumber>;
516
659
  title: z.ZodString;
517
660
  checked: z.ZodDefault<z.ZodBoolean>;
518
661
  }, "strip", z.ZodTypeAny, {
662
+ number: number;
519
663
  id: string;
520
664
  title: string;
521
665
  checked: boolean;
522
666
  }, {
523
667
  id: string;
524
668
  title: string;
669
+ number?: number | undefined;
525
670
  checked?: boolean | undefined;
526
671
  }>]>, "many">>;
527
672
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -532,14 +677,14 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
532
677
  createdAt: z.ZodString;
533
678
  updatedAt: z.ZodString;
534
679
  }, "strip", z.ZodTypeAny, {
535
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
680
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
536
681
  updatedAt: string;
537
682
  id: string;
538
683
  createdAt: string;
539
684
  title: string;
540
685
  description: string;
541
686
  }, {
542
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
687
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
543
688
  updatedAt: string;
544
689
  id: string;
545
690
  createdAt: string;
@@ -553,7 +698,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
553
698
  updatedAt: z.ZodString;
554
699
  }, "strip", z.ZodTypeAny, {
555
700
  number: number;
556
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
701
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
557
702
  updatedAt: string;
558
703
  notes: string;
559
704
  id: string;
@@ -578,16 +723,17 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
578
723
  date: string;
579
724
  title: string;
580
725
  description: string;
581
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
582
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
726
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
727
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
583
728
  }[];
584
729
  checklist: (string | {
730
+ number: number;
585
731
  id: string;
586
732
  title: string;
587
733
  checked: boolean;
588
734
  })[];
589
735
  subtasks: {
590
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
736
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
591
737
  updatedAt: string;
592
738
  id: string;
593
739
  createdAt: string;
@@ -598,7 +744,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
598
744
  startedAt: string;
599
745
  completedAt: string;
600
746
  }, {
601
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
747
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
602
748
  updatedAt: string;
603
749
  id: string;
604
750
  createdAt: string;
@@ -623,17 +769,18 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
623
769
  id: string;
624
770
  date: string;
625
771
  title: string;
626
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
627
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
772
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
773
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
628
774
  description?: string | undefined;
629
775
  }[] | undefined;
630
776
  checklist?: (string | {
631
777
  id: string;
632
778
  title: string;
779
+ number?: number | undefined;
633
780
  checked?: boolean | undefined;
634
781
  })[] | undefined;
635
782
  subtasks?: {
636
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
783
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
637
784
  updatedAt: string;
638
785
  id: string;
639
786
  createdAt: string;
@@ -646,11 +793,12 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
646
793
  }>, {
647
794
  checklist: {
648
795
  id: string;
796
+ number: number;
649
797
  title: string;
650
798
  checked: boolean;
651
799
  }[];
652
800
  number: number;
653
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
801
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
654
802
  updatedAt: string;
655
803
  notes: string;
656
804
  id: string;
@@ -675,11 +823,11 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
675
823
  date: string;
676
824
  title: string;
677
825
  description: string;
678
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
679
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
826
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
827
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
680
828
  }[];
681
829
  subtasks: {
682
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
830
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
683
831
  updatedAt: string;
684
832
  id: string;
685
833
  createdAt: string;
@@ -690,7 +838,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
690
838
  startedAt: string;
691
839
  completedAt: string;
692
840
  }, {
693
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
841
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
694
842
  updatedAt: string;
695
843
  id: string;
696
844
  createdAt: string;
@@ -715,17 +863,18 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
715
863
  id: string;
716
864
  date: string;
717
865
  title: string;
718
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
719
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
866
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
867
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
720
868
  description?: string | undefined;
721
869
  }[] | undefined;
722
870
  checklist?: (string | {
723
871
  id: string;
724
872
  title: string;
873
+ number?: number | undefined;
725
874
  checked?: boolean | undefined;
726
875
  })[] | undefined;
727
876
  subtasks?: {
728
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
877
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
729
878
  updatedAt: string;
730
879
  id: string;
731
880
  createdAt: string;
@@ -737,15 +886,15 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
737
886
  completedAt?: string | undefined;
738
887
  }>;
739
888
  export declare const HandoffHistoryEntrySchema: z.ZodObject<{
740
- /** Relative path under .planner/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
889
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
741
890
  file: z.ZodDefault<z.ZodString>;
742
891
  clearedAt: z.ZodString;
743
892
  /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
744
893
  reason: z.ZodDefault<z.ZodString>;
745
894
  }, "strip", z.ZodTypeAny, {
746
895
  file: string;
747
- clearedAt: string;
748
896
  reason: string;
897
+ clearedAt: string;
749
898
  }, {
750
899
  clearedAt: string;
751
900
  file?: string | undefined;
@@ -753,6 +902,9 @@ export declare const HandoffHistoryEntrySchema: z.ZodObject<{
753
902
  }>;
754
903
  export declare const PhaseSchema: z.ZodObject<{
755
904
  id: z.ZodString;
905
+ /** MUST be a feature UUID (not a ref like "F005"). Validated at the schema
906
+ * layer so no adapter can persist an unresolved ref string. Optional only
907
+ * for legacy pre-feature phases. */
756
908
  featureId: z.ZodOptional<z.ZodString>;
757
909
  /** Global project-wide phase sequence (assigned once at creation from project.nextPhaseNumber; stable, gaps on delete). Bare P00x is unambiguous. */
758
910
  number: z.ZodNumber;
@@ -799,6 +951,8 @@ export declare const PhaseSchema: z.ZodObject<{
799
951
  taskIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
800
952
  tasks: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
801
953
  id: z.ZodString;
954
+ /** MUST be a phase UUID (not a ref like "P003"). Validated at the schema
955
+ * layer so no adapter can persist an unresolved ref string. */
802
956
  phaseId: z.ZodString;
803
957
  /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
804
958
  number: z.ZodDefault<z.ZodNumber>;
@@ -821,14 +975,14 @@ export declare const PhaseSchema: z.ZodObject<{
821
975
  date: string;
822
976
  title: string;
823
977
  description: string;
824
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
825
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
978
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
979
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
826
980
  }, {
827
981
  id: string;
828
982
  date: string;
829
983
  title: string;
830
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
831
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
984
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
985
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
832
986
  description?: string | undefined;
833
987
  }>, "many">>;
834
988
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -856,15 +1010,21 @@ export declare const PhaseSchema: z.ZodObject<{
856
1010
  }>, "many">>;
857
1011
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
858
1012
  id: z.ZodString;
1013
+ /** Per-task 1-based position, displayed as C{number} (C1, C2, ...). Default 0
1014
+ * so legacy on-disk items without a number still parse; the TaskSchema
1015
+ * transform overwrites it with the real index+1. */
1016
+ number: z.ZodDefault<z.ZodNumber>;
859
1017
  title: z.ZodString;
860
1018
  checked: z.ZodDefault<z.ZodBoolean>;
861
1019
  }, "strip", z.ZodTypeAny, {
1020
+ number: number;
862
1021
  id: string;
863
1022
  title: string;
864
1023
  checked: boolean;
865
1024
  }, {
866
1025
  id: string;
867
1026
  title: string;
1027
+ number?: number | undefined;
868
1028
  checked?: boolean | undefined;
869
1029
  }>]>, "many">>;
870
1030
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -875,14 +1035,14 @@ export declare const PhaseSchema: z.ZodObject<{
875
1035
  createdAt: z.ZodString;
876
1036
  updatedAt: z.ZodString;
877
1037
  }, "strip", z.ZodTypeAny, {
878
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1038
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
879
1039
  updatedAt: string;
880
1040
  id: string;
881
1041
  createdAt: string;
882
1042
  title: string;
883
1043
  description: string;
884
1044
  }, {
885
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1045
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
886
1046
  updatedAt: string;
887
1047
  id: string;
888
1048
  createdAt: string;
@@ -896,7 +1056,7 @@ export declare const PhaseSchema: z.ZodObject<{
896
1056
  updatedAt: z.ZodString;
897
1057
  }, "strip", z.ZodTypeAny, {
898
1058
  number: number;
899
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1059
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
900
1060
  updatedAt: string;
901
1061
  notes: string;
902
1062
  id: string;
@@ -921,16 +1081,17 @@ export declare const PhaseSchema: z.ZodObject<{
921
1081
  date: string;
922
1082
  title: string;
923
1083
  description: string;
924
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
925
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1084
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1085
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
926
1086
  }[];
927
1087
  checklist: (string | {
1088
+ number: number;
928
1089
  id: string;
929
1090
  title: string;
930
1091
  checked: boolean;
931
1092
  })[];
932
1093
  subtasks: {
933
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1094
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
934
1095
  updatedAt: string;
935
1096
  id: string;
936
1097
  createdAt: string;
@@ -941,7 +1102,7 @@ export declare const PhaseSchema: z.ZodObject<{
941
1102
  startedAt: string;
942
1103
  completedAt: string;
943
1104
  }, {
944
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1105
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
945
1106
  updatedAt: string;
946
1107
  id: string;
947
1108
  createdAt: string;
@@ -966,17 +1127,18 @@ export declare const PhaseSchema: z.ZodObject<{
966
1127
  id: string;
967
1128
  date: string;
968
1129
  title: string;
969
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
970
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1130
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1131
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
971
1132
  description?: string | undefined;
972
1133
  }[] | undefined;
973
1134
  checklist?: (string | {
974
1135
  id: string;
975
1136
  title: string;
1137
+ number?: number | undefined;
976
1138
  checked?: boolean | undefined;
977
1139
  })[] | undefined;
978
1140
  subtasks?: {
979
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1141
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
980
1142
  updatedAt: string;
981
1143
  id: string;
982
1144
  createdAt: string;
@@ -989,11 +1151,12 @@ export declare const PhaseSchema: z.ZodObject<{
989
1151
  }>, {
990
1152
  checklist: {
991
1153
  id: string;
1154
+ number: number;
992
1155
  title: string;
993
1156
  checked: boolean;
994
1157
  }[];
995
1158
  number: number;
996
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1159
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
997
1160
  updatedAt: string;
998
1161
  notes: string;
999
1162
  id: string;
@@ -1018,11 +1181,11 @@ export declare const PhaseSchema: z.ZodObject<{
1018
1181
  date: string;
1019
1182
  title: string;
1020
1183
  description: string;
1021
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1022
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1184
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1185
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1023
1186
  }[];
1024
1187
  subtasks: {
1025
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1188
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1026
1189
  updatedAt: string;
1027
1190
  id: string;
1028
1191
  createdAt: string;
@@ -1033,7 +1196,7 @@ export declare const PhaseSchema: z.ZodObject<{
1033
1196
  startedAt: string;
1034
1197
  completedAt: string;
1035
1198
  }, {
1036
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1199
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1037
1200
  updatedAt: string;
1038
1201
  id: string;
1039
1202
  createdAt: string;
@@ -1058,17 +1221,18 @@ export declare const PhaseSchema: z.ZodObject<{
1058
1221
  id: string;
1059
1222
  date: string;
1060
1223
  title: string;
1061
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1062
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1224
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1225
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1063
1226
  description?: string | undefined;
1064
1227
  }[] | undefined;
1065
1228
  checklist?: (string | {
1066
1229
  id: string;
1067
1230
  title: string;
1231
+ number?: number | undefined;
1068
1232
  checked?: boolean | undefined;
1069
1233
  })[] | undefined;
1070
1234
  subtasks?: {
1071
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1235
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1072
1236
  updatedAt: string;
1073
1237
  id: string;
1074
1238
  createdAt: string;
@@ -1084,29 +1248,52 @@ export declare const PhaseSchema: z.ZodObject<{
1084
1248
  handoff: z.ZodDefault<z.ZodString>;
1085
1249
  handoffUpdatedAt: z.ZodDefault<z.ZodString>;
1086
1250
  /** When the handoff was last read/acknowledged on recap (ISO). Non-empty means
1087
- * the agent has seen it; the recap won't re-prompt every turn. The handoff
1088
- * content is KEPT until a task in the phase starts (auto-clear) or the phase
1089
- * completes so a restart between read and resume does not lose context. */
1251
+ * the agent has seen it; the recap won't re-prompt every turn. Reading is
1252
+ * non-mutating: content remains until every task is done/canceled, a later
1253
+ * handoff supersedes it, or the user explicitly clears it. */
1090
1254
  handoffReadAt: z.ZodDefault<z.ZodString>;
1091
1255
  /** Metadata for recently-cleared handoffs (newest-first, capped at 5). The
1092
- * full content lives as .md files in .planner/handoff-archive/ (gitignored);
1256
+ * full content lives as .md files in .planner/.local/handoff-archive/ (gitignored);
1093
1257
  * this array only holds the pointer + clear reason + timestamp, so the phase
1094
1258
  * JSON stays lean and the archive is recoverable. */
1095
1259
  handoffHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
1096
- /** Relative path under .planner/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
1260
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
1097
1261
  file: z.ZodDefault<z.ZodString>;
1098
1262
  clearedAt: z.ZodString;
1099
1263
  /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
1100
1264
  reason: z.ZodDefault<z.ZodString>;
1101
1265
  }, "strip", z.ZodTypeAny, {
1102
1266
  file: string;
1103
- clearedAt: string;
1104
1267
  reason: string;
1268
+ clearedAt: string;
1105
1269
  }, {
1106
1270
  clearedAt: string;
1107
1271
  file?: string | undefined;
1108
1272
  reason?: string | undefined;
1109
1273
  }>, "many">>;
1274
+ /** Chronological audit trail of the DERIVED status (planned/in-progress/blocked/done/...). Appended ONLY when the derived status changes during a rollup; `status` itself is NOT persisted (still computed from child tasks at read time). Empty = no transition recorded yet (treated as "planned"). */
1275
+ statusLog: z.ZodDefault<z.ZodArray<z.ZodObject<{
1276
+ id: z.ZodString;
1277
+ date: z.ZodString;
1278
+ fromStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1279
+ toStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1280
+ title: z.ZodString;
1281
+ description: z.ZodDefault<z.ZodString>;
1282
+ }, "strip", z.ZodTypeAny, {
1283
+ id: string;
1284
+ date: string;
1285
+ title: string;
1286
+ description: string;
1287
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1288
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1289
+ }, {
1290
+ id: string;
1291
+ date: string;
1292
+ title: string;
1293
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1294
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1295
+ description?: string | undefined;
1296
+ }>, "many">>;
1110
1297
  }, "strip", z.ZodTypeAny, {
1111
1298
  number: number;
1112
1299
  dependencies: string[];
@@ -1128,6 +1315,14 @@ export declare const PhaseSchema: z.ZodObject<{
1128
1315
  }[];
1129
1316
  shortId: string;
1130
1317
  priority: number;
1318
+ statusLog: {
1319
+ id: string;
1320
+ date: string;
1321
+ title: string;
1322
+ description: string;
1323
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1324
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1325
+ }[];
1131
1326
  dependsOn: string[];
1132
1327
  slug: string;
1133
1328
  discussedAt: string;
@@ -1142,11 +1337,12 @@ export declare const PhaseSchema: z.ZodObject<{
1142
1337
  tasks: {
1143
1338
  checklist: {
1144
1339
  id: string;
1340
+ number: number;
1145
1341
  title: string;
1146
1342
  checked: boolean;
1147
1343
  }[];
1148
1344
  number: number;
1149
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1345
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1150
1346
  updatedAt: string;
1151
1347
  notes: string;
1152
1348
  id: string;
@@ -1171,11 +1367,11 @@ export declare const PhaseSchema: z.ZodObject<{
1171
1367
  date: string;
1172
1368
  title: string;
1173
1369
  description: string;
1174
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1175
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1370
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1371
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1176
1372
  }[];
1177
1373
  subtasks: {
1178
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1374
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1179
1375
  updatedAt: string;
1180
1376
  id: string;
1181
1377
  createdAt: string;
@@ -1191,8 +1387,8 @@ export declare const PhaseSchema: z.ZodObject<{
1191
1387
  handoffReadAt: string;
1192
1388
  handoffHistory: {
1193
1389
  file: string;
1194
- clearedAt: string;
1195
1390
  reason: string;
1391
+ clearedAt: string;
1196
1392
  }[];
1197
1393
  featureId?: string | undefined;
1198
1394
  }, {
@@ -1217,6 +1413,14 @@ export declare const PhaseSchema: z.ZodObject<{
1217
1413
  }[] | undefined;
1218
1414
  shortId?: string | undefined;
1219
1415
  priority?: number | undefined;
1416
+ statusLog?: {
1417
+ id: string;
1418
+ date: string;
1419
+ title: string;
1420
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1421
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
1422
+ description?: string | undefined;
1423
+ }[] | undefined;
1220
1424
  dependsOn?: string[] | undefined;
1221
1425
  featureId?: string | undefined;
1222
1426
  discussedAt?: string | undefined;
@@ -1229,7 +1433,7 @@ export declare const PhaseSchema: z.ZodObject<{
1229
1433
  completionCriteria?: string[] | undefined;
1230
1434
  taskIds?: string[] | undefined;
1231
1435
  tasks?: {
1232
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1436
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1233
1437
  updatedAt: string;
1234
1438
  id: string;
1235
1439
  createdAt: string;
@@ -1254,17 +1458,18 @@ export declare const PhaseSchema: z.ZodObject<{
1254
1458
  id: string;
1255
1459
  date: string;
1256
1460
  title: string;
1257
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1258
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1461
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1462
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1259
1463
  description?: string | undefined;
1260
1464
  }[] | undefined;
1261
1465
  checklist?: (string | {
1262
1466
  id: string;
1263
1467
  title: string;
1468
+ number?: number | undefined;
1264
1469
  checked?: boolean | undefined;
1265
1470
  })[] | undefined;
1266
1471
  subtasks?: {
1267
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1472
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1268
1473
  updatedAt: string;
1269
1474
  id: string;
1270
1475
  createdAt: string;
@@ -1323,6 +1528,29 @@ export declare const FeatureSchema: z.ZodObject<{
1323
1528
  }>, "many">>;
1324
1529
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1325
1530
  dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1531
+ /** Chronological audit trail of the DERIVED status (computed from child phases at read time). Appended ONLY when the derived status changes during a rollup; `status` itself is NOT persisted. Empty = no transition recorded yet (treated as "planned"). */
1532
+ statusLog: z.ZodDefault<z.ZodArray<z.ZodObject<{
1533
+ id: z.ZodString;
1534
+ date: z.ZodString;
1535
+ fromStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1536
+ toStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1537
+ title: z.ZodString;
1538
+ description: z.ZodDefault<z.ZodString>;
1539
+ }, "strip", z.ZodTypeAny, {
1540
+ id: string;
1541
+ date: string;
1542
+ title: string;
1543
+ description: string;
1544
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1545
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1546
+ }, {
1547
+ id: string;
1548
+ date: string;
1549
+ title: string;
1550
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1551
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1552
+ description?: string | undefined;
1553
+ }>, "many">>;
1326
1554
  createdAt: z.ZodString;
1327
1555
  updatedAt: z.ZodString;
1328
1556
  }, "strip", z.ZodTypeAny, {
@@ -1342,6 +1570,14 @@ export declare const FeatureSchema: z.ZodObject<{
1342
1570
  }[];
1343
1571
  shortId: string;
1344
1572
  priority: number;
1573
+ statusLog: {
1574
+ id: string;
1575
+ date: string;
1576
+ title: string;
1577
+ description: string;
1578
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1579
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1580
+ }[];
1345
1581
  dependsOn: string[];
1346
1582
  discussedAt: string;
1347
1583
  contextReady: boolean;
@@ -1368,6 +1604,14 @@ export declare const FeatureSchema: z.ZodObject<{
1368
1604
  }[] | undefined;
1369
1605
  shortId?: string | undefined;
1370
1606
  priority?: number | undefined;
1607
+ statusLog?: {
1608
+ id: string;
1609
+ date: string;
1610
+ title: string;
1611
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1612
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1613
+ description?: string | undefined;
1614
+ }[] | undefined;
1371
1615
  dependsOn?: string[] | undefined;
1372
1616
  discussedAt?: string | undefined;
1373
1617
  contextReady?: boolean | undefined;
@@ -1418,6 +1662,29 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1418
1662
  }>, "many">>;
1419
1663
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1420
1664
  dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1665
+ /** Chronological audit trail of the DERIVED status (computed from child phases at read time). Appended ONLY when the derived status changes during a rollup; `status` itself is NOT persisted. Empty = no transition recorded yet (treated as "planned"). */
1666
+ statusLog: z.ZodDefault<z.ZodArray<z.ZodObject<{
1667
+ id: z.ZodString;
1668
+ date: z.ZodString;
1669
+ fromStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1670
+ toStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
1671
+ title: z.ZodString;
1672
+ description: z.ZodDefault<z.ZodString>;
1673
+ }, "strip", z.ZodTypeAny, {
1674
+ id: string;
1675
+ date: string;
1676
+ title: string;
1677
+ description: string;
1678
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1679
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1680
+ }, {
1681
+ id: string;
1682
+ date: string;
1683
+ title: string;
1684
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1685
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1686
+ description?: string | undefined;
1687
+ }>, "many">>;
1421
1688
  createdAt: z.ZodString;
1422
1689
  updatedAt: z.ZodString;
1423
1690
  }, "strip", z.ZodTypeAny, {
@@ -1437,6 +1704,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1437
1704
  }[];
1438
1705
  shortId: string;
1439
1706
  priority: number;
1707
+ statusLog: {
1708
+ id: string;
1709
+ date: string;
1710
+ title: string;
1711
+ description: string;
1712
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1713
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1714
+ }[];
1440
1715
  dependsOn: string[];
1441
1716
  discussedAt: string;
1442
1717
  contextReady: boolean;
@@ -1463,6 +1738,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1463
1738
  }[] | undefined;
1464
1739
  shortId?: string | undefined;
1465
1740
  priority?: number | undefined;
1741
+ statusLog?: {
1742
+ id: string;
1743
+ date: string;
1744
+ title: string;
1745
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1746
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1747
+ description?: string | undefined;
1748
+ }[] | undefined;
1466
1749
  dependsOn?: string[] | undefined;
1467
1750
  discussedAt?: string | undefined;
1468
1751
  contextReady?: boolean | undefined;
@@ -1491,6 +1774,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1491
1774
  }[];
1492
1775
  shortId: string;
1493
1776
  priority: number;
1777
+ statusLog: {
1778
+ id: string;
1779
+ date: string;
1780
+ title: string;
1781
+ description: string;
1782
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1783
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1784
+ }[];
1494
1785
  dependsOn: string[];
1495
1786
  discussedAt: string;
1496
1787
  contextReady: boolean;
@@ -1519,6 +1810,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1519
1810
  }[] | undefined;
1520
1811
  shortId?: string | undefined;
1521
1812
  priority?: number | undefined;
1813
+ statusLog?: {
1814
+ id: string;
1815
+ date: string;
1816
+ title: string;
1817
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1818
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1819
+ description?: string | undefined;
1820
+ }[] | undefined;
1522
1821
  dependsOn?: string[] | undefined;
1523
1822
  discussedAt?: string | undefined;
1524
1823
  contextReady?: boolean | undefined;
@@ -1538,14 +1837,14 @@ export declare const MacroTaskSchema: z.ZodObject<{
1538
1837
  createdAt: z.ZodString;
1539
1838
  updatedAt: z.ZodString;
1540
1839
  }, "strip", z.ZodTypeAny, {
1541
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1840
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1542
1841
  updatedAt: string;
1543
1842
  id: string;
1544
1843
  createdAt: string;
1545
1844
  title: string;
1546
1845
  description: string;
1547
1846
  }, {
1548
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1847
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1549
1848
  updatedAt: string;
1550
1849
  id: string;
1551
1850
  createdAt: string;
@@ -1565,14 +1864,14 @@ export declare const RequirementSchema: z.ZodObject<{
1565
1864
  createdAt: z.ZodString;
1566
1865
  updatedAt: z.ZodString;
1567
1866
  }, "strip", z.ZodTypeAny, {
1568
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1867
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1569
1868
  updatedAt: string;
1570
1869
  id: string;
1571
1870
  createdAt: string;
1572
1871
  title: string;
1573
1872
  description: string;
1574
1873
  }, {
1575
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1874
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1576
1875
  updatedAt: string;
1577
1876
  id: string;
1578
1877
  createdAt: string;
@@ -1583,14 +1882,14 @@ export declare const RequirementSchema: z.ZodObject<{
1583
1882
  createdAt: z.ZodString;
1584
1883
  updatedAt: z.ZodString;
1585
1884
  }, "strip", z.ZodTypeAny, {
1586
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1885
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1587
1886
  updatedAt: string;
1588
1887
  id: string;
1589
1888
  createdAt: string;
1590
1889
  title: string;
1591
1890
  description: string;
1592
1891
  macroTasks: {
1593
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1892
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1594
1893
  updatedAt: string;
1595
1894
  id: string;
1596
1895
  createdAt: string;
@@ -1599,14 +1898,14 @@ export declare const RequirementSchema: z.ZodObject<{
1599
1898
  }[];
1600
1899
  linkedPhaseIds: string[];
1601
1900
  }, {
1602
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1901
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1603
1902
  updatedAt: string;
1604
1903
  id: string;
1605
1904
  createdAt: string;
1606
1905
  title: string;
1607
1906
  description?: string | undefined;
1608
1907
  macroTasks?: {
1609
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1908
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1610
1909
  updatedAt: string;
1611
1910
  id: string;
1612
1911
  createdAt: string;
@@ -1629,14 +1928,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1629
1928
  createdAt: z.ZodString;
1630
1929
  updatedAt: z.ZodString;
1631
1930
  }, "strip", z.ZodTypeAny, {
1632
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1931
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1633
1932
  updatedAt: string;
1634
1933
  id: string;
1635
1934
  createdAt: string;
1636
1935
  title: string;
1637
1936
  description: string;
1638
1937
  }, {
1639
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1938
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1640
1939
  updatedAt: string;
1641
1940
  id: string;
1642
1941
  createdAt: string;
@@ -1647,14 +1946,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1647
1946
  createdAt: z.ZodString;
1648
1947
  updatedAt: z.ZodString;
1649
1948
  }, "strip", z.ZodTypeAny, {
1650
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1949
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1651
1950
  updatedAt: string;
1652
1951
  id: string;
1653
1952
  createdAt: string;
1654
1953
  title: string;
1655
1954
  description: string;
1656
1955
  macroTasks: {
1657
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1956
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1658
1957
  updatedAt: string;
1659
1958
  id: string;
1660
1959
  createdAt: string;
@@ -1663,14 +1962,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1663
1962
  }[];
1664
1963
  linkedPhaseIds: string[];
1665
1964
  }, {
1666
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1965
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1667
1966
  updatedAt: string;
1668
1967
  id: string;
1669
1968
  createdAt: string;
1670
1969
  title: string;
1671
1970
  description?: string | undefined;
1672
1971
  macroTasks?: {
1673
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1972
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1674
1973
  updatedAt: string;
1675
1974
  id: string;
1676
1975
  createdAt: string;
@@ -1681,14 +1980,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1681
1980
  }>, "many">;
1682
1981
  }, "strip", z.ZodTypeAny, {
1683
1982
  requirements: {
1684
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1983
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1685
1984
  updatedAt: string;
1686
1985
  id: string;
1687
1986
  createdAt: string;
1688
1987
  title: string;
1689
1988
  description: string;
1690
1989
  macroTasks: {
1691
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1990
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1692
1991
  updatedAt: string;
1693
1992
  id: string;
1694
1993
  createdAt: string;
@@ -1699,14 +1998,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1699
1998
  }[];
1700
1999
  }, {
1701
2000
  requirements: {
1702
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2001
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1703
2002
  updatedAt: string;
1704
2003
  id: string;
1705
2004
  createdAt: string;
1706
2005
  title: string;
1707
2006
  description?: string | undefined;
1708
2007
  macroTasks?: {
1709
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2008
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1710
2009
  updatedAt: string;
1711
2010
  id: string;
1712
2011
  createdAt: string;
@@ -1788,6 +2087,47 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1788
2087
  nextFeatureNumber: z.ZodDefault<z.ZodNumber>;
1789
2088
  nextPhaseNumber: z.ZodDefault<z.ZodNumber>;
1790
2089
  nextTaskNumber: z.ZodDefault<z.ZodNumber>;
2090
+ /** Ordered history of approved temporary work deviations; active entries form a resumable stack. */
2091
+ workDeviations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2092
+ id: z.ZodString;
2093
+ /** Task the priority selector recommended when the deviation was approved. */
2094
+ recommendedTaskId: z.ZodString;
2095
+ /** Task intentionally chosen instead of the recommendation. */
2096
+ temporaryTaskId: z.ZodString;
2097
+ /** Task to surface explicitly after the temporary work is resolved. */
2098
+ resumeTaskId: z.ZodString;
2099
+ reason: z.ZodDefault<z.ZodString>;
2100
+ requestedBy: z.ZodDefault<z.ZodEnum<["agent", "user"]>>;
2101
+ approvedBy: z.ZodDefault<z.ZodString>;
2102
+ state: z.ZodDefault<z.ZodEnum<["approved", "active", "resolved", "canceled"]>>;
2103
+ createdAt: z.ZodString;
2104
+ activatedAt: z.ZodDefault<z.ZodString>;
2105
+ resolvedAt: z.ZodDefault<z.ZodString>;
2106
+ }, "strip", z.ZodTypeAny, {
2107
+ id: string;
2108
+ createdAt: string;
2109
+ recommendedTaskId: string;
2110
+ temporaryTaskId: string;
2111
+ resumeTaskId: string;
2112
+ reason: string;
2113
+ requestedBy: "agent" | "user";
2114
+ approvedBy: string;
2115
+ state: "approved" | "active" | "resolved" | "canceled";
2116
+ activatedAt: string;
2117
+ resolvedAt: string;
2118
+ }, {
2119
+ id: string;
2120
+ createdAt: string;
2121
+ recommendedTaskId: string;
2122
+ temporaryTaskId: string;
2123
+ resumeTaskId: string;
2124
+ reason?: string | undefined;
2125
+ requestedBy?: "agent" | "user" | undefined;
2126
+ approvedBy?: string | undefined;
2127
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
2128
+ activatedAt?: string | undefined;
2129
+ resolvedAt?: string | undefined;
2130
+ }>, "many">>;
1791
2131
  }, "strip", z.ZodTypeAny, {
1792
2132
  name: string;
1793
2133
  goal: string;
@@ -1817,6 +2157,19 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1817
2157
  nextFeatureNumber: number;
1818
2158
  nextPhaseNumber: number;
1819
2159
  nextTaskNumber: number;
2160
+ workDeviations: {
2161
+ id: string;
2162
+ createdAt: string;
2163
+ recommendedTaskId: string;
2164
+ temporaryTaskId: string;
2165
+ resumeTaskId: string;
2166
+ reason: string;
2167
+ requestedBy: "agent" | "user";
2168
+ approvedBy: string;
2169
+ state: "approved" | "active" | "resolved" | "canceled";
2170
+ activatedAt: string;
2171
+ resolvedAt: string;
2172
+ }[];
1820
2173
  }, {
1821
2174
  name: string;
1822
2175
  workflowRules: {
@@ -1846,6 +2199,19 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1846
2199
  nextFeatureNumber?: number | undefined;
1847
2200
  nextPhaseNumber?: number | undefined;
1848
2201
  nextTaskNumber?: number | undefined;
2202
+ workDeviations?: {
2203
+ id: string;
2204
+ createdAt: string;
2205
+ recommendedTaskId: string;
2206
+ temporaryTaskId: string;
2207
+ resumeTaskId: string;
2208
+ reason?: string | undefined;
2209
+ requestedBy?: "agent" | "user" | undefined;
2210
+ approvedBy?: string | undefined;
2211
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
2212
+ activatedAt?: string | undefined;
2213
+ resolvedAt?: string | undefined;
2214
+ }[] | undefined;
1849
2215
  }>;
1850
2216
  features: z.ZodObject<{
1851
2217
  features: z.ZodArray<z.ZodObject<{
@@ -1887,6 +2253,29 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1887
2253
  }>, "many">>;
1888
2254
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1889
2255
  dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2256
+ /** Chronological audit trail of the DERIVED status (computed from child phases at read time). Appended ONLY when the derived status changes during a rollup; `status` itself is NOT persisted. Empty = no transition recorded yet (treated as "planned"). */
2257
+ statusLog: z.ZodDefault<z.ZodArray<z.ZodObject<{
2258
+ id: z.ZodString;
2259
+ date: z.ZodString;
2260
+ fromStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
2261
+ toStatus: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
2262
+ title: z.ZodString;
2263
+ description: z.ZodDefault<z.ZodString>;
2264
+ }, "strip", z.ZodTypeAny, {
2265
+ id: string;
2266
+ date: string;
2267
+ title: string;
2268
+ description: string;
2269
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2270
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2271
+ }, {
2272
+ id: string;
2273
+ date: string;
2274
+ title: string;
2275
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2276
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2277
+ description?: string | undefined;
2278
+ }>, "many">>;
1890
2279
  createdAt: z.ZodString;
1891
2280
  updatedAt: z.ZodString;
1892
2281
  }, "strip", z.ZodTypeAny, {
@@ -1906,6 +2295,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1906
2295
  }[];
1907
2296
  shortId: string;
1908
2297
  priority: number;
2298
+ statusLog: {
2299
+ id: string;
2300
+ date: string;
2301
+ title: string;
2302
+ description: string;
2303
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2304
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2305
+ }[];
1909
2306
  dependsOn: string[];
1910
2307
  discussedAt: string;
1911
2308
  contextReady: boolean;
@@ -1932,6 +2329,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1932
2329
  }[] | undefined;
1933
2330
  shortId?: string | undefined;
1934
2331
  priority?: number | undefined;
2332
+ statusLog?: {
2333
+ id: string;
2334
+ date: string;
2335
+ title: string;
2336
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2337
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2338
+ description?: string | undefined;
2339
+ }[] | undefined;
1935
2340
  dependsOn?: string[] | undefined;
1936
2341
  discussedAt?: string | undefined;
1937
2342
  contextReady?: boolean | undefined;
@@ -1960,6 +2365,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1960
2365
  }[];
1961
2366
  shortId: string;
1962
2367
  priority: number;
2368
+ statusLog: {
2369
+ id: string;
2370
+ date: string;
2371
+ title: string;
2372
+ description: string;
2373
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2374
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2375
+ }[];
1963
2376
  dependsOn: string[];
1964
2377
  discussedAt: string;
1965
2378
  contextReady: boolean;
@@ -1988,6 +2401,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1988
2401
  }[] | undefined;
1989
2402
  shortId?: string | undefined;
1990
2403
  priority?: number | undefined;
2404
+ statusLog?: {
2405
+ id: string;
2406
+ date: string;
2407
+ title: string;
2408
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2409
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2410
+ description?: string | undefined;
2411
+ }[] | undefined;
1991
2412
  dependsOn?: string[] | undefined;
1992
2413
  discussedAt?: string | undefined;
1993
2414
  contextReady?: boolean | undefined;
@@ -2013,14 +2434,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2013
2434
  createdAt: z.ZodString;
2014
2435
  updatedAt: z.ZodString;
2015
2436
  }, "strip", z.ZodTypeAny, {
2016
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2437
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2017
2438
  updatedAt: string;
2018
2439
  id: string;
2019
2440
  createdAt: string;
2020
2441
  title: string;
2021
2442
  description: string;
2022
2443
  }, {
2023
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2444
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2024
2445
  updatedAt: string;
2025
2446
  id: string;
2026
2447
  createdAt: string;
@@ -2031,14 +2452,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2031
2452
  createdAt: z.ZodString;
2032
2453
  updatedAt: z.ZodString;
2033
2454
  }, "strip", z.ZodTypeAny, {
2034
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2455
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2035
2456
  updatedAt: string;
2036
2457
  id: string;
2037
2458
  createdAt: string;
2038
2459
  title: string;
2039
2460
  description: string;
2040
2461
  macroTasks: {
2041
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2462
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2042
2463
  updatedAt: string;
2043
2464
  id: string;
2044
2465
  createdAt: string;
@@ -2047,14 +2468,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2047
2468
  }[];
2048
2469
  linkedPhaseIds: string[];
2049
2470
  }, {
2050
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2471
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2051
2472
  updatedAt: string;
2052
2473
  id: string;
2053
2474
  createdAt: string;
2054
2475
  title: string;
2055
2476
  description?: string | undefined;
2056
2477
  macroTasks?: {
2057
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2478
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2058
2479
  updatedAt: string;
2059
2480
  id: string;
2060
2481
  createdAt: string;
@@ -2065,14 +2486,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2065
2486
  }>, "many">;
2066
2487
  }, "strip", z.ZodTypeAny, {
2067
2488
  requirements: {
2068
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2489
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2069
2490
  updatedAt: string;
2070
2491
  id: string;
2071
2492
  createdAt: string;
2072
2493
  title: string;
2073
2494
  description: string;
2074
2495
  macroTasks: {
2075
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2496
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2076
2497
  updatedAt: string;
2077
2498
  id: string;
2078
2499
  createdAt: string;
@@ -2083,14 +2504,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2083
2504
  }[];
2084
2505
  }, {
2085
2506
  requirements: {
2086
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2507
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2087
2508
  updatedAt: string;
2088
2509
  id: string;
2089
2510
  createdAt: string;
2090
2511
  title: string;
2091
2512
  description?: string | undefined;
2092
2513
  macroTasks?: {
2093
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2514
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2094
2515
  updatedAt: string;
2095
2516
  id: string;
2096
2517
  createdAt: string;
@@ -2102,6 +2523,9 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2102
2523
  }>;
2103
2524
  phases: z.ZodArray<z.ZodObject<{
2104
2525
  id: z.ZodString;
2526
+ /** MUST be a feature UUID (not a ref like "F005"). Validated at the schema
2527
+ * layer so no adapter can persist an unresolved ref string. Optional only
2528
+ * for legacy pre-feature phases. */
2105
2529
  featureId: z.ZodOptional<z.ZodString>;
2106
2530
  /** Global project-wide phase sequence (assigned once at creation from project.nextPhaseNumber; stable, gaps on delete). Bare P00x is unambiguous. */
2107
2531
  number: z.ZodNumber;
@@ -2148,6 +2572,8 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2148
2572
  taskIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2149
2573
  tasks: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
2150
2574
  id: z.ZodString;
2575
+ /** MUST be a phase UUID (not a ref like "P003"). Validated at the schema
2576
+ * layer so no adapter can persist an unresolved ref string. */
2151
2577
  phaseId: z.ZodString;
2152
2578
  /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
2153
2579
  number: z.ZodDefault<z.ZodNumber>;
@@ -2170,14 +2596,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2170
2596
  date: string;
2171
2597
  title: string;
2172
2598
  description: string;
2173
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2174
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2599
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2600
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2175
2601
  }, {
2176
2602
  id: string;
2177
2603
  date: string;
2178
2604
  title: string;
2179
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2180
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2605
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2606
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2181
2607
  description?: string | undefined;
2182
2608
  }>, "many">>;
2183
2609
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -2205,15 +2631,21 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2205
2631
  }>, "many">>;
2206
2632
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
2207
2633
  id: z.ZodString;
2634
+ /** Per-task 1-based position, displayed as C{number} (C1, C2, ...). Default 0
2635
+ * so legacy on-disk items without a number still parse; the TaskSchema
2636
+ * transform overwrites it with the real index+1. */
2637
+ number: z.ZodDefault<z.ZodNumber>;
2208
2638
  title: z.ZodString;
2209
2639
  checked: z.ZodDefault<z.ZodBoolean>;
2210
2640
  }, "strip", z.ZodTypeAny, {
2641
+ number: number;
2211
2642
  id: string;
2212
2643
  title: string;
2213
2644
  checked: boolean;
2214
2645
  }, {
2215
2646
  id: string;
2216
2647
  title: string;
2648
+ number?: number | undefined;
2217
2649
  checked?: boolean | undefined;
2218
2650
  }>]>, "many">>;
2219
2651
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -2224,14 +2656,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2224
2656
  createdAt: z.ZodString;
2225
2657
  updatedAt: z.ZodString;
2226
2658
  }, "strip", z.ZodTypeAny, {
2227
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2659
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2228
2660
  updatedAt: string;
2229
2661
  id: string;
2230
2662
  createdAt: string;
2231
2663
  title: string;
2232
2664
  description: string;
2233
2665
  }, {
2234
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2666
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2235
2667
  updatedAt: string;
2236
2668
  id: string;
2237
2669
  createdAt: string;
@@ -2245,7 +2677,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2245
2677
  updatedAt: z.ZodString;
2246
2678
  }, "strip", z.ZodTypeAny, {
2247
2679
  number: number;
2248
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2680
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2249
2681
  updatedAt: string;
2250
2682
  notes: string;
2251
2683
  id: string;
@@ -2270,16 +2702,17 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2270
2702
  date: string;
2271
2703
  title: string;
2272
2704
  description: string;
2273
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2274
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2705
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2706
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2275
2707
  }[];
2276
2708
  checklist: (string | {
2709
+ number: number;
2277
2710
  id: string;
2278
2711
  title: string;
2279
2712
  checked: boolean;
2280
2713
  })[];
2281
2714
  subtasks: {
2282
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2715
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2283
2716
  updatedAt: string;
2284
2717
  id: string;
2285
2718
  createdAt: string;
@@ -2290,7 +2723,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2290
2723
  startedAt: string;
2291
2724
  completedAt: string;
2292
2725
  }, {
2293
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2726
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2294
2727
  updatedAt: string;
2295
2728
  id: string;
2296
2729
  createdAt: string;
@@ -2315,17 +2748,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2315
2748
  id: string;
2316
2749
  date: string;
2317
2750
  title: string;
2318
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2319
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2751
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2752
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2320
2753
  description?: string | undefined;
2321
2754
  }[] | undefined;
2322
2755
  checklist?: (string | {
2323
2756
  id: string;
2324
2757
  title: string;
2758
+ number?: number | undefined;
2325
2759
  checked?: boolean | undefined;
2326
2760
  })[] | undefined;
2327
2761
  subtasks?: {
2328
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2762
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2329
2763
  updatedAt: string;
2330
2764
  id: string;
2331
2765
  createdAt: string;
@@ -2338,11 +2772,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2338
2772
  }>, {
2339
2773
  checklist: {
2340
2774
  id: string;
2775
+ number: number;
2341
2776
  title: string;
2342
2777
  checked: boolean;
2343
2778
  }[];
2344
2779
  number: number;
2345
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2780
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2346
2781
  updatedAt: string;
2347
2782
  notes: string;
2348
2783
  id: string;
@@ -2367,11 +2802,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2367
2802
  date: string;
2368
2803
  title: string;
2369
2804
  description: string;
2370
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2371
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2805
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2806
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2372
2807
  }[];
2373
2808
  subtasks: {
2374
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2809
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2375
2810
  updatedAt: string;
2376
2811
  id: string;
2377
2812
  createdAt: string;
@@ -2382,7 +2817,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2382
2817
  startedAt: string;
2383
2818
  completedAt: string;
2384
2819
  }, {
2385
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2820
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2386
2821
  updatedAt: string;
2387
2822
  id: string;
2388
2823
  createdAt: string;
@@ -2407,17 +2842,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2407
2842
  id: string;
2408
2843
  date: string;
2409
2844
  title: string;
2410
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2411
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2845
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2846
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2412
2847
  description?: string | undefined;
2413
2848
  }[] | undefined;
2414
2849
  checklist?: (string | {
2415
2850
  id: string;
2416
2851
  title: string;
2852
+ number?: number | undefined;
2417
2853
  checked?: boolean | undefined;
2418
2854
  })[] | undefined;
2419
2855
  subtasks?: {
2420
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2856
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2421
2857
  updatedAt: string;
2422
2858
  id: string;
2423
2859
  createdAt: string;
@@ -2433,29 +2869,52 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2433
2869
  handoff: z.ZodDefault<z.ZodString>;
2434
2870
  handoffUpdatedAt: z.ZodDefault<z.ZodString>;
2435
2871
  /** When the handoff was last read/acknowledged on recap (ISO). Non-empty means
2436
- * the agent has seen it; the recap won't re-prompt every turn. The handoff
2437
- * content is KEPT until a task in the phase starts (auto-clear) or the phase
2438
- * completes so a restart between read and resume does not lose context. */
2872
+ * the agent has seen it; the recap won't re-prompt every turn. Reading is
2873
+ * non-mutating: content remains until every task is done/canceled, a later
2874
+ * handoff supersedes it, or the user explicitly clears it. */
2439
2875
  handoffReadAt: z.ZodDefault<z.ZodString>;
2440
2876
  /** Metadata for recently-cleared handoffs (newest-first, capped at 5). The
2441
- * full content lives as .md files in .planner/handoff-archive/ (gitignored);
2877
+ * full content lives as .md files in .planner/.local/handoff-archive/ (gitignored);
2442
2878
  * this array only holds the pointer + clear reason + timestamp, so the phase
2443
2879
  * JSON stays lean and the archive is recoverable. */
2444
2880
  handoffHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
2445
- /** Relative path under .planner/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
2881
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
2446
2882
  file: z.ZodDefault<z.ZodString>;
2447
2883
  clearedAt: z.ZodString;
2448
2884
  /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
2449
2885
  reason: z.ZodDefault<z.ZodString>;
2450
2886
  }, "strip", z.ZodTypeAny, {
2451
2887
  file: string;
2452
- clearedAt: string;
2453
2888
  reason: string;
2889
+ clearedAt: string;
2454
2890
  }, {
2455
2891
  clearedAt: string;
2456
2892
  file?: string | undefined;
2457
2893
  reason?: string | undefined;
2458
2894
  }>, "many">>;
2895
+ /** Chronological audit trail of the DERIVED status (planned/in-progress/blocked/done/...). Appended ONLY when the derived status changes during a rollup; `status` itself is NOT persisted (still computed from child tasks at read time). Empty = no transition recorded yet (treated as "planned"). */
2896
+ statusLog: z.ZodDefault<z.ZodArray<z.ZodObject<{
2897
+ id: z.ZodString;
2898
+ date: z.ZodString;
2899
+ fromStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
2900
+ toStatus: z.ZodEnum<["draft", "discovery", "planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
2901
+ title: z.ZodString;
2902
+ description: z.ZodDefault<z.ZodString>;
2903
+ }, "strip", z.ZodTypeAny, {
2904
+ id: string;
2905
+ date: string;
2906
+ title: string;
2907
+ description: string;
2908
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2909
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2910
+ }, {
2911
+ id: string;
2912
+ date: string;
2913
+ title: string;
2914
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2915
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2916
+ description?: string | undefined;
2917
+ }>, "many">>;
2459
2918
  }, "strip", z.ZodTypeAny, {
2460
2919
  number: number;
2461
2920
  dependencies: string[];
@@ -2477,6 +2936,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2477
2936
  }[];
2478
2937
  shortId: string;
2479
2938
  priority: number;
2939
+ statusLog: {
2940
+ id: string;
2941
+ date: string;
2942
+ title: string;
2943
+ description: string;
2944
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2945
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
2946
+ }[];
2480
2947
  dependsOn: string[];
2481
2948
  slug: string;
2482
2949
  discussedAt: string;
@@ -2491,11 +2958,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2491
2958
  tasks: {
2492
2959
  checklist: {
2493
2960
  id: string;
2961
+ number: number;
2494
2962
  title: string;
2495
2963
  checked: boolean;
2496
2964
  }[];
2497
2965
  number: number;
2498
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2966
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2499
2967
  updatedAt: string;
2500
2968
  notes: string;
2501
2969
  id: string;
@@ -2520,11 +2988,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2520
2988
  date: string;
2521
2989
  title: string;
2522
2990
  description: string;
2523
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2524
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2991
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2992
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2525
2993
  }[];
2526
2994
  subtasks: {
2527
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2995
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2528
2996
  updatedAt: string;
2529
2997
  id: string;
2530
2998
  createdAt: string;
@@ -2540,8 +3008,8 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2540
3008
  handoffReadAt: string;
2541
3009
  handoffHistory: {
2542
3010
  file: string;
2543
- clearedAt: string;
2544
3011
  reason: string;
3012
+ clearedAt: string;
2545
3013
  }[];
2546
3014
  featureId?: string | undefined;
2547
3015
  }, {
@@ -2566,6 +3034,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2566
3034
  }[] | undefined;
2567
3035
  shortId?: string | undefined;
2568
3036
  priority?: number | undefined;
3037
+ statusLog?: {
3038
+ id: string;
3039
+ date: string;
3040
+ title: string;
3041
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3042
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3043
+ description?: string | undefined;
3044
+ }[] | undefined;
2569
3045
  dependsOn?: string[] | undefined;
2570
3046
  featureId?: string | undefined;
2571
3047
  discussedAt?: string | undefined;
@@ -2578,7 +3054,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2578
3054
  completionCriteria?: string[] | undefined;
2579
3055
  taskIds?: string[] | undefined;
2580
3056
  tasks?: {
2581
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3057
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2582
3058
  updatedAt: string;
2583
3059
  id: string;
2584
3060
  createdAt: string;
@@ -2603,17 +3079,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2603
3079
  id: string;
2604
3080
  date: string;
2605
3081
  title: string;
2606
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2607
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3082
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3083
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2608
3084
  description?: string | undefined;
2609
3085
  }[] | undefined;
2610
3086
  checklist?: (string | {
2611
3087
  id: string;
2612
3088
  title: string;
3089
+ number?: number | undefined;
2613
3090
  checked?: boolean | undefined;
2614
3091
  })[] | undefined;
2615
3092
  subtasks?: {
2616
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3093
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2617
3094
  updatedAt: string;
2618
3095
  id: string;
2619
3096
  createdAt: string;
@@ -2652,6 +3129,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2652
3129
  }[];
2653
3130
  shortId: string;
2654
3131
  priority: number;
3132
+ statusLog: {
3133
+ id: string;
3134
+ date: string;
3135
+ title: string;
3136
+ description: string;
3137
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3138
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3139
+ }[];
2655
3140
  dependsOn: string[];
2656
3141
  discussedAt: string;
2657
3142
  contextReady: boolean;
@@ -2665,14 +3150,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2665
3150
  };
2666
3151
  requirements: {
2667
3152
  requirements: {
2668
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3153
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2669
3154
  updatedAt: string;
2670
3155
  id: string;
2671
3156
  createdAt: string;
2672
3157
  title: string;
2673
3158
  description: string;
2674
3159
  macroTasks: {
2675
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3160
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2676
3161
  updatedAt: string;
2677
3162
  id: string;
2678
3163
  createdAt: string;
@@ -2718,6 +3203,19 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2718
3203
  nextFeatureNumber: number;
2719
3204
  nextPhaseNumber: number;
2720
3205
  nextTaskNumber: number;
3206
+ workDeviations: {
3207
+ id: string;
3208
+ createdAt: string;
3209
+ recommendedTaskId: string;
3210
+ temporaryTaskId: string;
3211
+ resumeTaskId: string;
3212
+ reason: string;
3213
+ requestedBy: "agent" | "user";
3214
+ approvedBy: string;
3215
+ state: "approved" | "active" | "resolved" | "canceled";
3216
+ activatedAt: string;
3217
+ resolvedAt: string;
3218
+ }[];
2721
3219
  };
2722
3220
  phases: {
2723
3221
  number: number;
@@ -2740,6 +3238,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2740
3238
  }[];
2741
3239
  shortId: string;
2742
3240
  priority: number;
3241
+ statusLog: {
3242
+ id: string;
3243
+ date: string;
3244
+ title: string;
3245
+ description: string;
3246
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3247
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3248
+ }[];
2743
3249
  dependsOn: string[];
2744
3250
  slug: string;
2745
3251
  discussedAt: string;
@@ -2754,11 +3260,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2754
3260
  tasks: {
2755
3261
  checklist: {
2756
3262
  id: string;
3263
+ number: number;
2757
3264
  title: string;
2758
3265
  checked: boolean;
2759
3266
  }[];
2760
3267
  number: number;
2761
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3268
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2762
3269
  updatedAt: string;
2763
3270
  notes: string;
2764
3271
  id: string;
@@ -2783,11 +3290,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2783
3290
  date: string;
2784
3291
  title: string;
2785
3292
  description: string;
2786
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2787
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3293
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3294
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2788
3295
  }[];
2789
3296
  subtasks: {
2790
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3297
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2791
3298
  updatedAt: string;
2792
3299
  id: string;
2793
3300
  createdAt: string;
@@ -2803,8 +3310,8 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2803
3310
  handoffReadAt: string;
2804
3311
  handoffHistory: {
2805
3312
  file: string;
2806
- clearedAt: string;
2807
3313
  reason: string;
3314
+ clearedAt: string;
2808
3315
  }[];
2809
3316
  featureId?: string | undefined;
2810
3317
  }[];
@@ -2827,6 +3334,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2827
3334
  }[] | undefined;
2828
3335
  shortId?: string | undefined;
2829
3336
  priority?: number | undefined;
3337
+ statusLog?: {
3338
+ id: string;
3339
+ date: string;
3340
+ title: string;
3341
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3342
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3343
+ description?: string | undefined;
3344
+ }[] | undefined;
2830
3345
  dependsOn?: string[] | undefined;
2831
3346
  discussedAt?: string | undefined;
2832
3347
  contextReady?: boolean | undefined;
@@ -2840,14 +3355,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2840
3355
  };
2841
3356
  requirements: {
2842
3357
  requirements: {
2843
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3358
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2844
3359
  updatedAt: string;
2845
3360
  id: string;
2846
3361
  createdAt: string;
2847
3362
  title: string;
2848
3363
  description?: string | undefined;
2849
3364
  macroTasks?: {
2850
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3365
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2851
3366
  updatedAt: string;
2852
3367
  id: string;
2853
3368
  createdAt: string;
@@ -2893,6 +3408,19 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2893
3408
  nextFeatureNumber?: number | undefined;
2894
3409
  nextPhaseNumber?: number | undefined;
2895
3410
  nextTaskNumber?: number | undefined;
3411
+ workDeviations?: {
3412
+ id: string;
3413
+ createdAt: string;
3414
+ recommendedTaskId: string;
3415
+ temporaryTaskId: string;
3416
+ resumeTaskId: string;
3417
+ reason?: string | undefined;
3418
+ requestedBy?: "agent" | "user" | undefined;
3419
+ approvedBy?: string | undefined;
3420
+ state?: "approved" | "active" | "resolved" | "canceled" | undefined;
3421
+ activatedAt?: string | undefined;
3422
+ resolvedAt?: string | undefined;
3423
+ }[] | undefined;
2896
3424
  };
2897
3425
  phases: {
2898
3426
  number: number;
@@ -2916,6 +3444,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2916
3444
  }[] | undefined;
2917
3445
  shortId?: string | undefined;
2918
3446
  priority?: number | undefined;
3447
+ statusLog?: {
3448
+ id: string;
3449
+ date: string;
3450
+ title: string;
3451
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3452
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting" | "draft" | "discovery";
3453
+ description?: string | undefined;
3454
+ }[] | undefined;
2919
3455
  dependsOn?: string[] | undefined;
2920
3456
  featureId?: string | undefined;
2921
3457
  discussedAt?: string | undefined;
@@ -2928,7 +3464,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2928
3464
  completionCriteria?: string[] | undefined;
2929
3465
  taskIds?: string[] | undefined;
2930
3466
  tasks?: {
2931
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3467
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2932
3468
  updatedAt: string;
2933
3469
  id: string;
2934
3470
  createdAt: string;
@@ -2953,17 +3489,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2953
3489
  id: string;
2954
3490
  date: string;
2955
3491
  title: string;
2956
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2957
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3492
+ fromStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
3493
+ toStatus: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2958
3494
  description?: string | undefined;
2959
3495
  }[] | undefined;
2960
3496
  checklist?: (string | {
2961
3497
  id: string;
2962
3498
  title: string;
3499
+ number?: number | undefined;
2963
3500
  checked?: boolean | undefined;
2964
3501
  })[] | undefined;
2965
3502
  subtasks?: {
2966
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3503
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2967
3504
  updatedAt: string;
2968
3505
  id: string;
2969
3506
  createdAt: string;
@@ -3006,9 +3543,11 @@ export type Manifest = z.infer<typeof ManifestSchema>;
3006
3543
  export type WorkflowRules = z.infer<typeof WorkflowRulesSchema>;
3007
3544
  export type AcceptedDecision = z.infer<typeof AcceptedDecisionSchema>;
3008
3545
  export type Project = z.infer<typeof ProjectSchema>;
3546
+ export type WorkDeviation = z.infer<typeof WorkDeviationSchema>;
3009
3547
  export type Subtask = z.infer<typeof SubtaskSchema>;
3010
3548
  export type ChecklistItem = z.infer<typeof ChecklistItemSchema>;
3011
3549
  export type StatusLogEntry = z.infer<typeof StatusLogEntrySchema>;
3550
+ export type PhaseStatusLogEntry = z.infer<typeof PhaseStatusLogEntrySchema>;
3012
3551
  export type Task = z.infer<typeof TaskSchema>;
3013
3552
  export type Phase = z.infer<typeof PhaseSchema> & {
3014
3553
  status: PhaseStatus;