@agent-plan/core 0.2.19-next.2 → 0.2.19-next.21

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
@@ -133,6 +133,10 @@ export declare const ResumeFocusSchema: z.ZodObject<{
133
133
  currentPhaseId: z.ZodDefault<z.ZodString>;
134
134
  inProgressTaskIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
135
135
  nextSteps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
136
+ /** When `nextSteps` last changed (free-text can go stale; the recap surfaces
137
+ * this so staleness is visible). Preserved across refreshResume (which keeps
138
+ * existing nextSteps); bumped only when saveResume receives new nextSteps. */
139
+ nextStepsUpdatedAt: z.ZodDefault<z.ZodString>;
136
140
  blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
137
141
  notes: z.ZodDefault<z.ZodString>;
138
142
  lastSessionSummary: z.ZodDefault<z.ZodString>;
@@ -142,6 +146,7 @@ export declare const ResumeFocusSchema: z.ZodObject<{
142
146
  currentPhaseId: string;
143
147
  inProgressTaskIds: string[];
144
148
  nextSteps: string[];
149
+ nextStepsUpdatedAt: string;
145
150
  blockers: string[];
146
151
  notes: string;
147
152
  lastSessionSummary: string;
@@ -151,6 +156,7 @@ export declare const ResumeFocusSchema: z.ZodObject<{
151
156
  currentPhaseId?: string | undefined;
152
157
  inProgressTaskIds?: string[] | undefined;
153
158
  nextSteps?: string[] | undefined;
159
+ nextStepsUpdatedAt?: string | undefined;
154
160
  blockers?: string[] | undefined;
155
161
  notes?: string | undefined;
156
162
  lastSessionSummary?: string | undefined;
@@ -266,6 +272,46 @@ export declare const AcceptedDecisionSchema: z.ZodObject<{
266
272
  rationale?: string | undefined;
267
273
  implementationNotes?: string | undefined;
268
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
+ }>;
269
315
  export declare const ProjectSchema: z.ZodObject<{
270
316
  name: z.ZodString;
271
317
  goal: z.ZodDefault<z.ZodString>;
@@ -314,6 +360,51 @@ export declare const ProjectSchema: z.ZodObject<{
314
360
  rationale?: string | undefined;
315
361
  implementationNotes?: string | undefined;
316
362
  }>, "many">>;
363
+ /** Monotonic global sequence counters — assigned at creation, never reused (gaps on delete). */
364
+ nextFeatureNumber: z.ZodDefault<z.ZodNumber>;
365
+ nextPhaseNumber: z.ZodDefault<z.ZodNumber>;
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">>;
317
408
  }, "strip", z.ZodTypeAny, {
318
409
  name: string;
319
410
  goal: string;
@@ -340,6 +431,22 @@ export declare const ProjectSchema: z.ZodObject<{
340
431
  implementationNotes: string;
341
432
  acceptedAt: string;
342
433
  }[];
434
+ nextFeatureNumber: number;
435
+ nextPhaseNumber: number;
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
+ }[];
343
450
  }, {
344
451
  name: string;
345
452
  workflowRules: {
@@ -366,6 +473,22 @@ export declare const ProjectSchema: z.ZodObject<{
366
473
  rationale?: string | undefined;
367
474
  implementationNotes?: string | undefined;
368
475
  }[] | undefined;
476
+ nextFeatureNumber?: number | undefined;
477
+ nextPhaseNumber?: number | undefined;
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;
369
492
  }>;
370
493
  export declare const SubtaskStatusSchema: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
371
494
  export declare const TaskStatusSchema: z.ZodEnum<["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"]>;
@@ -380,14 +503,14 @@ export declare const SubtaskSchema: z.ZodObject<{
380
503
  createdAt: z.ZodString;
381
504
  updatedAt: z.ZodString;
382
505
  }, "strip", z.ZodTypeAny, {
383
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
506
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
384
507
  updatedAt: string;
385
508
  id: string;
386
509
  createdAt: string;
387
510
  title: string;
388
511
  description: string;
389
512
  }, {
390
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
513
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
391
514
  updatedAt: string;
392
515
  id: string;
393
516
  createdAt: string;
@@ -396,15 +519,21 @@ export declare const SubtaskSchema: z.ZodObject<{
396
519
  }>;
397
520
  export declare const ChecklistItemSchema: z.ZodObject<{
398
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>;
399
526
  title: z.ZodString;
400
527
  checked: z.ZodDefault<z.ZodBoolean>;
401
528
  }, "strip", z.ZodTypeAny, {
529
+ number: number;
402
530
  id: string;
403
531
  title: string;
404
532
  checked: boolean;
405
533
  }, {
406
534
  id: string;
407
535
  title: string;
536
+ number?: number | undefined;
408
537
  checked?: boolean | undefined;
409
538
  }>;
410
539
  /** Status transitions that require a motivation note from the agent. */
@@ -428,19 +557,46 @@ export declare const StatusLogEntrySchema: z.ZodObject<{
428
557
  date: string;
429
558
  title: string;
430
559
  description: string;
431
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
432
- 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";
562
+ }, {
563
+ id: string;
564
+ date: string;
565
+ title: string;
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";
433
586
  }, {
434
587
  id: string;
435
588
  date: string;
436
589
  title: string;
437
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
438
- toStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
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";
439
592
  description?: string | undefined;
440
593
  }>;
441
594
  export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
442
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. */
443
598
  phaseId: z.ZodString;
599
+ /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
444
600
  number: z.ZodDefault<z.ZodNumber>;
445
601
  shortId: z.ZodDefault<z.ZodString>;
446
602
  priority: z.ZodDefault<z.ZodNumber>;
@@ -461,14 +617,14 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
461
617
  date: string;
462
618
  title: string;
463
619
  description: string;
464
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
465
- 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";
466
622
  }, {
467
623
  id: string;
468
624
  date: string;
469
625
  title: string;
470
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
471
- 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";
472
628
  description?: string | undefined;
473
629
  }>, "many">>;
474
630
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -496,15 +652,21 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
496
652
  }>, "many">>;
497
653
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
498
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>;
499
659
  title: z.ZodString;
500
660
  checked: z.ZodDefault<z.ZodBoolean>;
501
661
  }, "strip", z.ZodTypeAny, {
662
+ number: number;
502
663
  id: string;
503
664
  title: string;
504
665
  checked: boolean;
505
666
  }, {
506
667
  id: string;
507
668
  title: string;
669
+ number?: number | undefined;
508
670
  checked?: boolean | undefined;
509
671
  }>]>, "many">>;
510
672
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -515,14 +677,14 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
515
677
  createdAt: z.ZodString;
516
678
  updatedAt: z.ZodString;
517
679
  }, "strip", z.ZodTypeAny, {
518
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
680
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
519
681
  updatedAt: string;
520
682
  id: string;
521
683
  createdAt: string;
522
684
  title: string;
523
685
  description: string;
524
686
  }, {
525
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
687
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
526
688
  updatedAt: string;
527
689
  id: string;
528
690
  createdAt: string;
@@ -536,7 +698,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
536
698
  updatedAt: z.ZodString;
537
699
  }, "strip", z.ZodTypeAny, {
538
700
  number: number;
539
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
701
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
540
702
  updatedAt: string;
541
703
  notes: string;
542
704
  id: string;
@@ -561,16 +723,17 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
561
723
  date: string;
562
724
  title: string;
563
725
  description: string;
564
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
565
- 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";
566
728
  }[];
567
729
  checklist: (string | {
730
+ number: number;
568
731
  id: string;
569
732
  title: string;
570
733
  checked: boolean;
571
734
  })[];
572
735
  subtasks: {
573
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
736
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
574
737
  updatedAt: string;
575
738
  id: string;
576
739
  createdAt: string;
@@ -581,7 +744,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
581
744
  startedAt: string;
582
745
  completedAt: string;
583
746
  }, {
584
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
747
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
585
748
  updatedAt: string;
586
749
  id: string;
587
750
  createdAt: string;
@@ -606,17 +769,18 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
606
769
  id: string;
607
770
  date: string;
608
771
  title: string;
609
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
610
- 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";
611
774
  description?: string | undefined;
612
775
  }[] | undefined;
613
776
  checklist?: (string | {
614
777
  id: string;
615
778
  title: string;
779
+ number?: number | undefined;
616
780
  checked?: boolean | undefined;
617
781
  })[] | undefined;
618
782
  subtasks?: {
619
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
783
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
620
784
  updatedAt: string;
621
785
  id: string;
622
786
  createdAt: string;
@@ -629,11 +793,12 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
629
793
  }>, {
630
794
  checklist: {
631
795
  id: string;
796
+ number: number;
632
797
  title: string;
633
798
  checked: boolean;
634
799
  }[];
635
800
  number: number;
636
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
801
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
637
802
  updatedAt: string;
638
803
  notes: string;
639
804
  id: string;
@@ -658,11 +823,11 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
658
823
  date: string;
659
824
  title: string;
660
825
  description: string;
661
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
662
- 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";
663
828
  }[];
664
829
  subtasks: {
665
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
830
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
666
831
  updatedAt: string;
667
832
  id: string;
668
833
  createdAt: string;
@@ -673,7 +838,7 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
673
838
  startedAt: string;
674
839
  completedAt: string;
675
840
  }, {
676
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
841
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
677
842
  updatedAt: string;
678
843
  id: string;
679
844
  createdAt: string;
@@ -698,17 +863,18 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
698
863
  id: string;
699
864
  date: string;
700
865
  title: string;
701
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
702
- 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";
703
868
  description?: string | undefined;
704
869
  }[] | undefined;
705
870
  checklist?: (string | {
706
871
  id: string;
707
872
  title: string;
873
+ number?: number | undefined;
708
874
  checked?: boolean | undefined;
709
875
  })[] | undefined;
710
876
  subtasks?: {
711
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
877
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
712
878
  updatedAt: string;
713
879
  id: string;
714
880
  createdAt: string;
@@ -719,9 +885,28 @@ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
719
885
  startedAt?: string | undefined;
720
886
  completedAt?: string | undefined;
721
887
  }>;
888
+ export declare const HandoffHistoryEntrySchema: z.ZodObject<{
889
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
890
+ file: z.ZodDefault<z.ZodString>;
891
+ clearedAt: z.ZodString;
892
+ /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
893
+ reason: z.ZodDefault<z.ZodString>;
894
+ }, "strip", z.ZodTypeAny, {
895
+ file: string;
896
+ reason: string;
897
+ clearedAt: string;
898
+ }, {
899
+ clearedAt: string;
900
+ file?: string | undefined;
901
+ reason?: string | undefined;
902
+ }>;
722
903
  export declare const PhaseSchema: z.ZodObject<{
723
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. */
724
908
  featureId: z.ZodOptional<z.ZodString>;
909
+ /** Global project-wide phase sequence (assigned once at creation from project.nextPhaseNumber; stable, gaps on delete). Bare P00x is unambiguous. */
725
910
  number: z.ZodNumber;
726
911
  shortId: z.ZodDefault<z.ZodString>;
727
912
  priority: z.ZodDefault<z.ZodNumber>;
@@ -766,7 +951,10 @@ export declare const PhaseSchema: z.ZodObject<{
766
951
  taskIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
767
952
  tasks: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
768
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. */
769
956
  phaseId: z.ZodString;
957
+ /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
770
958
  number: z.ZodDefault<z.ZodNumber>;
771
959
  shortId: z.ZodDefault<z.ZodString>;
772
960
  priority: z.ZodDefault<z.ZodNumber>;
@@ -787,14 +975,14 @@ export declare const PhaseSchema: z.ZodObject<{
787
975
  date: string;
788
976
  title: string;
789
977
  description: string;
790
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
791
- 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";
792
980
  }, {
793
981
  id: string;
794
982
  date: string;
795
983
  title: string;
796
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
797
- 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";
798
986
  description?: string | undefined;
799
987
  }>, "many">>;
800
988
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -822,15 +1010,21 @@ export declare const PhaseSchema: z.ZodObject<{
822
1010
  }>, "many">>;
823
1011
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
824
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>;
825
1017
  title: z.ZodString;
826
1018
  checked: z.ZodDefault<z.ZodBoolean>;
827
1019
  }, "strip", z.ZodTypeAny, {
1020
+ number: number;
828
1021
  id: string;
829
1022
  title: string;
830
1023
  checked: boolean;
831
1024
  }, {
832
1025
  id: string;
833
1026
  title: string;
1027
+ number?: number | undefined;
834
1028
  checked?: boolean | undefined;
835
1029
  }>]>, "many">>;
836
1030
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -841,14 +1035,14 @@ export declare const PhaseSchema: z.ZodObject<{
841
1035
  createdAt: z.ZodString;
842
1036
  updatedAt: z.ZodString;
843
1037
  }, "strip", z.ZodTypeAny, {
844
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1038
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
845
1039
  updatedAt: string;
846
1040
  id: string;
847
1041
  createdAt: string;
848
1042
  title: string;
849
1043
  description: string;
850
1044
  }, {
851
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1045
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
852
1046
  updatedAt: string;
853
1047
  id: string;
854
1048
  createdAt: string;
@@ -862,7 +1056,7 @@ export declare const PhaseSchema: z.ZodObject<{
862
1056
  updatedAt: z.ZodString;
863
1057
  }, "strip", z.ZodTypeAny, {
864
1058
  number: number;
865
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1059
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
866
1060
  updatedAt: string;
867
1061
  notes: string;
868
1062
  id: string;
@@ -887,16 +1081,17 @@ export declare const PhaseSchema: z.ZodObject<{
887
1081
  date: string;
888
1082
  title: string;
889
1083
  description: string;
890
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
891
- 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";
892
1086
  }[];
893
1087
  checklist: (string | {
1088
+ number: number;
894
1089
  id: string;
895
1090
  title: string;
896
1091
  checked: boolean;
897
1092
  })[];
898
1093
  subtasks: {
899
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1094
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
900
1095
  updatedAt: string;
901
1096
  id: string;
902
1097
  createdAt: string;
@@ -907,7 +1102,7 @@ export declare const PhaseSchema: z.ZodObject<{
907
1102
  startedAt: string;
908
1103
  completedAt: string;
909
1104
  }, {
910
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1105
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
911
1106
  updatedAt: string;
912
1107
  id: string;
913
1108
  createdAt: string;
@@ -932,17 +1127,18 @@ export declare const PhaseSchema: z.ZodObject<{
932
1127
  id: string;
933
1128
  date: string;
934
1129
  title: string;
935
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
936
- 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";
937
1132
  description?: string | undefined;
938
1133
  }[] | undefined;
939
1134
  checklist?: (string | {
940
1135
  id: string;
941
1136
  title: string;
1137
+ number?: number | undefined;
942
1138
  checked?: boolean | undefined;
943
1139
  })[] | undefined;
944
1140
  subtasks?: {
945
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1141
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
946
1142
  updatedAt: string;
947
1143
  id: string;
948
1144
  createdAt: string;
@@ -955,11 +1151,12 @@ export declare const PhaseSchema: z.ZodObject<{
955
1151
  }>, {
956
1152
  checklist: {
957
1153
  id: string;
1154
+ number: number;
958
1155
  title: string;
959
1156
  checked: boolean;
960
1157
  }[];
961
1158
  number: number;
962
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1159
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
963
1160
  updatedAt: string;
964
1161
  notes: string;
965
1162
  id: string;
@@ -984,11 +1181,11 @@ export declare const PhaseSchema: z.ZodObject<{
984
1181
  date: string;
985
1182
  title: string;
986
1183
  description: string;
987
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
988
- 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";
989
1186
  }[];
990
1187
  subtasks: {
991
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1188
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
992
1189
  updatedAt: string;
993
1190
  id: string;
994
1191
  createdAt: string;
@@ -999,7 +1196,7 @@ export declare const PhaseSchema: z.ZodObject<{
999
1196
  startedAt: string;
1000
1197
  completedAt: string;
1001
1198
  }, {
1002
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1199
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1003
1200
  updatedAt: string;
1004
1201
  id: string;
1005
1202
  createdAt: string;
@@ -1024,17 +1221,18 @@ export declare const PhaseSchema: z.ZodObject<{
1024
1221
  id: string;
1025
1222
  date: string;
1026
1223
  title: string;
1027
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1028
- 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";
1029
1226
  description?: string | undefined;
1030
1227
  }[] | undefined;
1031
1228
  checklist?: (string | {
1032
1229
  id: string;
1033
1230
  title: string;
1231
+ number?: number | undefined;
1034
1232
  checked?: boolean | undefined;
1035
1233
  })[] | undefined;
1036
1234
  subtasks?: {
1037
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1235
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1038
1236
  updatedAt: string;
1039
1237
  id: string;
1040
1238
  createdAt: string;
@@ -1049,6 +1247,53 @@ export declare const PhaseSchema: z.ZodObject<{
1049
1247
  updatedAt: z.ZodString;
1050
1248
  handoff: z.ZodDefault<z.ZodString>;
1051
1249
  handoffUpdatedAt: z.ZodDefault<z.ZodString>;
1250
+ /** When the handoff was last read/acknowledged on recap (ISO). Non-empty means
1251
+ * the agent has seen it; the recap won't re-prompt every turn. The handoff
1252
+ * content is KEPT until a task in the phase starts (auto-clear) or the phase
1253
+ * completes — so a restart between read and resume does not lose context. */
1254
+ handoffReadAt: z.ZodDefault<z.ZodString>;
1255
+ /** Metadata for recently-cleared handoffs (newest-first, capped at 5). The
1256
+ * full content lives as .md files in .planner/.local/handoff-archive/ (gitignored);
1257
+ * this array only holds the pointer + clear reason + timestamp, so the phase
1258
+ * JSON stays lean and the archive is recoverable. */
1259
+ handoffHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
1260
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
1261
+ file: z.ZodDefault<z.ZodString>;
1262
+ clearedAt: z.ZodString;
1263
+ /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
1264
+ reason: z.ZodDefault<z.ZodString>;
1265
+ }, "strip", z.ZodTypeAny, {
1266
+ file: string;
1267
+ reason: string;
1268
+ clearedAt: string;
1269
+ }, {
1270
+ clearedAt: string;
1271
+ file?: string | undefined;
1272
+ reason?: string | undefined;
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">>;
1052
1297
  }, "strip", z.ZodTypeAny, {
1053
1298
  number: number;
1054
1299
  dependencies: string[];
@@ -1070,6 +1315,14 @@ export declare const PhaseSchema: z.ZodObject<{
1070
1315
  }[];
1071
1316
  shortId: string;
1072
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
+ }[];
1073
1326
  dependsOn: string[];
1074
1327
  slug: string;
1075
1328
  discussedAt: string;
@@ -1084,11 +1337,12 @@ export declare const PhaseSchema: z.ZodObject<{
1084
1337
  tasks: {
1085
1338
  checklist: {
1086
1339
  id: string;
1340
+ number: number;
1087
1341
  title: string;
1088
1342
  checked: boolean;
1089
1343
  }[];
1090
1344
  number: number;
1091
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1345
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1092
1346
  updatedAt: string;
1093
1347
  notes: string;
1094
1348
  id: string;
@@ -1113,11 +1367,11 @@ export declare const PhaseSchema: z.ZodObject<{
1113
1367
  date: string;
1114
1368
  title: string;
1115
1369
  description: string;
1116
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1117
- 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";
1118
1372
  }[];
1119
1373
  subtasks: {
1120
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1374
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1121
1375
  updatedAt: string;
1122
1376
  id: string;
1123
1377
  createdAt: string;
@@ -1130,6 +1384,12 @@ export declare const PhaseSchema: z.ZodObject<{
1130
1384
  }[];
1131
1385
  handoff: string;
1132
1386
  handoffUpdatedAt: string;
1387
+ handoffReadAt: string;
1388
+ handoffHistory: {
1389
+ file: string;
1390
+ reason: string;
1391
+ clearedAt: string;
1392
+ }[];
1133
1393
  featureId?: string | undefined;
1134
1394
  }, {
1135
1395
  number: number;
@@ -1153,6 +1413,14 @@ export declare const PhaseSchema: z.ZodObject<{
1153
1413
  }[] | undefined;
1154
1414
  shortId?: string | undefined;
1155
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;
1156
1424
  dependsOn?: string[] | undefined;
1157
1425
  featureId?: string | undefined;
1158
1426
  discussedAt?: string | undefined;
@@ -1165,7 +1433,7 @@ export declare const PhaseSchema: z.ZodObject<{
1165
1433
  completionCriteria?: string[] | undefined;
1166
1434
  taskIds?: string[] | undefined;
1167
1435
  tasks?: {
1168
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1436
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1169
1437
  updatedAt: string;
1170
1438
  id: string;
1171
1439
  createdAt: string;
@@ -1190,17 +1458,18 @@ export declare const PhaseSchema: z.ZodObject<{
1190
1458
  id: string;
1191
1459
  date: string;
1192
1460
  title: string;
1193
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1194
- 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";
1195
1463
  description?: string | undefined;
1196
1464
  }[] | undefined;
1197
1465
  checklist?: (string | {
1198
1466
  id: string;
1199
1467
  title: string;
1468
+ number?: number | undefined;
1200
1469
  checked?: boolean | undefined;
1201
1470
  })[] | undefined;
1202
1471
  subtasks?: {
1203
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1472
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1204
1473
  updatedAt: string;
1205
1474
  id: string;
1206
1475
  createdAt: string;
@@ -1213,9 +1482,16 @@ export declare const PhaseSchema: z.ZodObject<{
1213
1482
  }[] | undefined;
1214
1483
  handoff?: string | undefined;
1215
1484
  handoffUpdatedAt?: string | undefined;
1485
+ handoffReadAt?: string | undefined;
1486
+ handoffHistory?: {
1487
+ clearedAt: string;
1488
+ file?: string | undefined;
1489
+ reason?: string | undefined;
1490
+ }[] | undefined;
1216
1491
  }>;
1217
1492
  export declare const FeatureSchema: z.ZodObject<{
1218
1493
  id: z.ZodString;
1494
+ /** Global project-wide feature sequence (assigned once at creation from project.nextFeatureNumber; stable, gaps on delete). */
1219
1495
  number: z.ZodDefault<z.ZodNumber>;
1220
1496
  shortId: z.ZodDefault<z.ZodString>;
1221
1497
  priority: z.ZodDefault<z.ZodNumber>;
@@ -1252,6 +1528,29 @@ export declare const FeatureSchema: z.ZodObject<{
1252
1528
  }>, "many">>;
1253
1529
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1254
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">>;
1255
1554
  createdAt: z.ZodString;
1256
1555
  updatedAt: z.ZodString;
1257
1556
  }, "strip", z.ZodTypeAny, {
@@ -1271,6 +1570,14 @@ export declare const FeatureSchema: z.ZodObject<{
1271
1570
  }[];
1272
1571
  shortId: string;
1273
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
+ }[];
1274
1581
  dependsOn: string[];
1275
1582
  discussedAt: string;
1276
1583
  contextReady: boolean;
@@ -1297,6 +1604,14 @@ export declare const FeatureSchema: z.ZodObject<{
1297
1604
  }[] | undefined;
1298
1605
  shortId?: string | undefined;
1299
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;
1300
1615
  dependsOn?: string[] | undefined;
1301
1616
  discussedAt?: string | undefined;
1302
1617
  contextReady?: boolean | undefined;
@@ -1310,6 +1625,7 @@ export declare const FeatureSchema: z.ZodObject<{
1310
1625
  export declare const FeaturesDocumentSchema: z.ZodObject<{
1311
1626
  features: z.ZodArray<z.ZodObject<{
1312
1627
  id: z.ZodString;
1628
+ /** Global project-wide feature sequence (assigned once at creation from project.nextFeatureNumber; stable, gaps on delete). */
1313
1629
  number: z.ZodDefault<z.ZodNumber>;
1314
1630
  shortId: z.ZodDefault<z.ZodString>;
1315
1631
  priority: z.ZodDefault<z.ZodNumber>;
@@ -1346,6 +1662,29 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1346
1662
  }>, "many">>;
1347
1663
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1348
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">>;
1349
1688
  createdAt: z.ZodString;
1350
1689
  updatedAt: z.ZodString;
1351
1690
  }, "strip", z.ZodTypeAny, {
@@ -1365,6 +1704,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1365
1704
  }[];
1366
1705
  shortId: string;
1367
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
+ }[];
1368
1715
  dependsOn: string[];
1369
1716
  discussedAt: string;
1370
1717
  contextReady: boolean;
@@ -1391,6 +1738,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1391
1738
  }[] | undefined;
1392
1739
  shortId?: string | undefined;
1393
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;
1394
1749
  dependsOn?: string[] | undefined;
1395
1750
  discussedAt?: string | undefined;
1396
1751
  contextReady?: boolean | undefined;
@@ -1419,6 +1774,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1419
1774
  }[];
1420
1775
  shortId: string;
1421
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
+ }[];
1422
1785
  dependsOn: string[];
1423
1786
  discussedAt: string;
1424
1787
  contextReady: boolean;
@@ -1447,6 +1810,14 @@ export declare const FeaturesDocumentSchema: z.ZodObject<{
1447
1810
  }[] | undefined;
1448
1811
  shortId?: string | undefined;
1449
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;
1450
1821
  dependsOn?: string[] | undefined;
1451
1822
  discussedAt?: string | undefined;
1452
1823
  contextReady?: boolean | undefined;
@@ -1466,14 +1837,14 @@ export declare const MacroTaskSchema: z.ZodObject<{
1466
1837
  createdAt: z.ZodString;
1467
1838
  updatedAt: z.ZodString;
1468
1839
  }, "strip", z.ZodTypeAny, {
1469
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1840
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1470
1841
  updatedAt: string;
1471
1842
  id: string;
1472
1843
  createdAt: string;
1473
1844
  title: string;
1474
1845
  description: string;
1475
1846
  }, {
1476
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1847
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1477
1848
  updatedAt: string;
1478
1849
  id: string;
1479
1850
  createdAt: string;
@@ -1493,14 +1864,14 @@ export declare const RequirementSchema: z.ZodObject<{
1493
1864
  createdAt: z.ZodString;
1494
1865
  updatedAt: z.ZodString;
1495
1866
  }, "strip", z.ZodTypeAny, {
1496
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1867
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1497
1868
  updatedAt: string;
1498
1869
  id: string;
1499
1870
  createdAt: string;
1500
1871
  title: string;
1501
1872
  description: string;
1502
1873
  }, {
1503
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1874
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1504
1875
  updatedAt: string;
1505
1876
  id: string;
1506
1877
  createdAt: string;
@@ -1511,14 +1882,14 @@ export declare const RequirementSchema: z.ZodObject<{
1511
1882
  createdAt: z.ZodString;
1512
1883
  updatedAt: z.ZodString;
1513
1884
  }, "strip", z.ZodTypeAny, {
1514
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1885
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1515
1886
  updatedAt: string;
1516
1887
  id: string;
1517
1888
  createdAt: string;
1518
1889
  title: string;
1519
1890
  description: string;
1520
1891
  macroTasks: {
1521
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1892
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1522
1893
  updatedAt: string;
1523
1894
  id: string;
1524
1895
  createdAt: string;
@@ -1527,14 +1898,14 @@ export declare const RequirementSchema: z.ZodObject<{
1527
1898
  }[];
1528
1899
  linkedPhaseIds: string[];
1529
1900
  }, {
1530
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1901
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1531
1902
  updatedAt: string;
1532
1903
  id: string;
1533
1904
  createdAt: string;
1534
1905
  title: string;
1535
1906
  description?: string | undefined;
1536
1907
  macroTasks?: {
1537
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1908
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1538
1909
  updatedAt: string;
1539
1910
  id: string;
1540
1911
  createdAt: string;
@@ -1557,14 +1928,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1557
1928
  createdAt: z.ZodString;
1558
1929
  updatedAt: z.ZodString;
1559
1930
  }, "strip", z.ZodTypeAny, {
1560
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1931
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1561
1932
  updatedAt: string;
1562
1933
  id: string;
1563
1934
  createdAt: string;
1564
1935
  title: string;
1565
1936
  description: string;
1566
1937
  }, {
1567
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1938
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1568
1939
  updatedAt: string;
1569
1940
  id: string;
1570
1941
  createdAt: string;
@@ -1575,14 +1946,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1575
1946
  createdAt: z.ZodString;
1576
1947
  updatedAt: z.ZodString;
1577
1948
  }, "strip", z.ZodTypeAny, {
1578
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1949
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1579
1950
  updatedAt: string;
1580
1951
  id: string;
1581
1952
  createdAt: string;
1582
1953
  title: string;
1583
1954
  description: string;
1584
1955
  macroTasks: {
1585
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1956
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1586
1957
  updatedAt: string;
1587
1958
  id: string;
1588
1959
  createdAt: string;
@@ -1591,14 +1962,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1591
1962
  }[];
1592
1963
  linkedPhaseIds: string[];
1593
1964
  }, {
1594
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1965
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1595
1966
  updatedAt: string;
1596
1967
  id: string;
1597
1968
  createdAt: string;
1598
1969
  title: string;
1599
1970
  description?: string | undefined;
1600
1971
  macroTasks?: {
1601
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1972
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1602
1973
  updatedAt: string;
1603
1974
  id: string;
1604
1975
  createdAt: string;
@@ -1609,14 +1980,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1609
1980
  }>, "many">;
1610
1981
  }, "strip", z.ZodTypeAny, {
1611
1982
  requirements: {
1612
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1983
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1613
1984
  updatedAt: string;
1614
1985
  id: string;
1615
1986
  createdAt: string;
1616
1987
  title: string;
1617
1988
  description: string;
1618
1989
  macroTasks: {
1619
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
1990
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1620
1991
  updatedAt: string;
1621
1992
  id: string;
1622
1993
  createdAt: string;
@@ -1627,14 +1998,14 @@ export declare const RequirementsDocumentSchema: z.ZodObject<{
1627
1998
  }[];
1628
1999
  }, {
1629
2000
  requirements: {
1630
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2001
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1631
2002
  updatedAt: string;
1632
2003
  id: string;
1633
2004
  createdAt: string;
1634
2005
  title: string;
1635
2006
  description?: string | undefined;
1636
2007
  macroTasks?: {
1637
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2008
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1638
2009
  updatedAt: string;
1639
2010
  id: string;
1640
2011
  createdAt: string;
@@ -1712,6 +2083,51 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1712
2083
  rationale?: string | undefined;
1713
2084
  implementationNotes?: string | undefined;
1714
2085
  }>, "many">>;
2086
+ /** Monotonic global sequence counters — assigned at creation, never reused (gaps on delete). */
2087
+ nextFeatureNumber: z.ZodDefault<z.ZodNumber>;
2088
+ nextPhaseNumber: z.ZodDefault<z.ZodNumber>;
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">>;
1715
2131
  }, "strip", z.ZodTypeAny, {
1716
2132
  name: string;
1717
2133
  goal: string;
@@ -1738,6 +2154,22 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1738
2154
  implementationNotes: string;
1739
2155
  acceptedAt: string;
1740
2156
  }[];
2157
+ nextFeatureNumber: number;
2158
+ nextPhaseNumber: number;
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
+ }[];
1741
2173
  }, {
1742
2174
  name: string;
1743
2175
  workflowRules: {
@@ -1764,10 +2196,27 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1764
2196
  rationale?: string | undefined;
1765
2197
  implementationNotes?: string | undefined;
1766
2198
  }[] | undefined;
2199
+ nextFeatureNumber?: number | undefined;
2200
+ nextPhaseNumber?: number | undefined;
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;
1767
2215
  }>;
1768
2216
  features: z.ZodObject<{
1769
2217
  features: z.ZodArray<z.ZodObject<{
1770
2218
  id: z.ZodString;
2219
+ /** Global project-wide feature sequence (assigned once at creation from project.nextFeatureNumber; stable, gaps on delete). */
1771
2220
  number: z.ZodDefault<z.ZodNumber>;
1772
2221
  shortId: z.ZodDefault<z.ZodString>;
1773
2222
  priority: z.ZodDefault<z.ZodNumber>;
@@ -1804,6 +2253,29 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1804
2253
  }>, "many">>;
1805
2254
  phaseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1806
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">>;
1807
2279
  createdAt: z.ZodString;
1808
2280
  updatedAt: z.ZodString;
1809
2281
  }, "strip", z.ZodTypeAny, {
@@ -1823,6 +2295,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1823
2295
  }[];
1824
2296
  shortId: string;
1825
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
+ }[];
1826
2306
  dependsOn: string[];
1827
2307
  discussedAt: string;
1828
2308
  contextReady: boolean;
@@ -1849,6 +2329,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1849
2329
  }[] | undefined;
1850
2330
  shortId?: string | undefined;
1851
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;
1852
2340
  dependsOn?: string[] | undefined;
1853
2341
  discussedAt?: string | undefined;
1854
2342
  contextReady?: boolean | undefined;
@@ -1877,6 +2365,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1877
2365
  }[];
1878
2366
  shortId: string;
1879
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
+ }[];
1880
2376
  dependsOn: string[];
1881
2377
  discussedAt: string;
1882
2378
  contextReady: boolean;
@@ -1905,6 +2401,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1905
2401
  }[] | undefined;
1906
2402
  shortId?: string | undefined;
1907
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;
1908
2412
  dependsOn?: string[] | undefined;
1909
2413
  discussedAt?: string | undefined;
1910
2414
  contextReady?: boolean | undefined;
@@ -1930,14 +2434,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1930
2434
  createdAt: z.ZodString;
1931
2435
  updatedAt: z.ZodString;
1932
2436
  }, "strip", z.ZodTypeAny, {
1933
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2437
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1934
2438
  updatedAt: string;
1935
2439
  id: string;
1936
2440
  createdAt: string;
1937
2441
  title: string;
1938
2442
  description: string;
1939
2443
  }, {
1940
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2444
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1941
2445
  updatedAt: string;
1942
2446
  id: string;
1943
2447
  createdAt: string;
@@ -1948,14 +2452,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1948
2452
  createdAt: z.ZodString;
1949
2453
  updatedAt: z.ZodString;
1950
2454
  }, "strip", z.ZodTypeAny, {
1951
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2455
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1952
2456
  updatedAt: string;
1953
2457
  id: string;
1954
2458
  createdAt: string;
1955
2459
  title: string;
1956
2460
  description: string;
1957
2461
  macroTasks: {
1958
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2462
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1959
2463
  updatedAt: string;
1960
2464
  id: string;
1961
2465
  createdAt: string;
@@ -1964,14 +2468,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1964
2468
  }[];
1965
2469
  linkedPhaseIds: string[];
1966
2470
  }, {
1967
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2471
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1968
2472
  updatedAt: string;
1969
2473
  id: string;
1970
2474
  createdAt: string;
1971
2475
  title: string;
1972
2476
  description?: string | undefined;
1973
2477
  macroTasks?: {
1974
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2478
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1975
2479
  updatedAt: string;
1976
2480
  id: string;
1977
2481
  createdAt: string;
@@ -1982,14 +2486,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
1982
2486
  }>, "many">;
1983
2487
  }, "strip", z.ZodTypeAny, {
1984
2488
  requirements: {
1985
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2489
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1986
2490
  updatedAt: string;
1987
2491
  id: string;
1988
2492
  createdAt: string;
1989
2493
  title: string;
1990
2494
  description: string;
1991
2495
  macroTasks: {
1992
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2496
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
1993
2497
  updatedAt: string;
1994
2498
  id: string;
1995
2499
  createdAt: string;
@@ -2000,14 +2504,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2000
2504
  }[];
2001
2505
  }, {
2002
2506
  requirements: {
2003
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2507
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2004
2508
  updatedAt: string;
2005
2509
  id: string;
2006
2510
  createdAt: string;
2007
2511
  title: string;
2008
2512
  description?: string | undefined;
2009
2513
  macroTasks?: {
2010
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2514
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2011
2515
  updatedAt: string;
2012
2516
  id: string;
2013
2517
  createdAt: string;
@@ -2019,7 +2523,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2019
2523
  }>;
2020
2524
  phases: z.ZodArray<z.ZodObject<{
2021
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. */
2022
2529
  featureId: z.ZodOptional<z.ZodString>;
2530
+ /** Global project-wide phase sequence (assigned once at creation from project.nextPhaseNumber; stable, gaps on delete). Bare P00x is unambiguous. */
2023
2531
  number: z.ZodNumber;
2024
2532
  shortId: z.ZodDefault<z.ZodString>;
2025
2533
  priority: z.ZodDefault<z.ZodNumber>;
@@ -2064,7 +2572,10 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2064
2572
  taskIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2065
2573
  tasks: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
2066
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. */
2067
2577
  phaseId: z.ZodString;
2578
+ /** Global project-wide task sequence (assigned once at creation from project.nextTaskNumber; stable, gaps on delete). Bare T00x is unambiguous. */
2068
2579
  number: z.ZodDefault<z.ZodNumber>;
2069
2580
  shortId: z.ZodDefault<z.ZodString>;
2070
2581
  priority: z.ZodDefault<z.ZodNumber>;
@@ -2085,14 +2596,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2085
2596
  date: string;
2086
2597
  title: string;
2087
2598
  description: string;
2088
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2089
- 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";
2090
2601
  }, {
2091
2602
  id: string;
2092
2603
  date: string;
2093
2604
  title: string;
2094
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2095
- 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";
2096
2607
  description?: string | undefined;
2097
2608
  }>, "many">>;
2098
2609
  decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -2120,15 +2631,21 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2120
2631
  }>, "many">>;
2121
2632
  checklist: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
2122
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>;
2123
2638
  title: z.ZodString;
2124
2639
  checked: z.ZodDefault<z.ZodBoolean>;
2125
2640
  }, "strip", z.ZodTypeAny, {
2641
+ number: number;
2126
2642
  id: string;
2127
2643
  title: string;
2128
2644
  checked: boolean;
2129
2645
  }, {
2130
2646
  id: string;
2131
2647
  title: string;
2648
+ number?: number | undefined;
2132
2649
  checked?: boolean | undefined;
2133
2650
  }>]>, "many">>;
2134
2651
  subtasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -2139,14 +2656,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2139
2656
  createdAt: z.ZodString;
2140
2657
  updatedAt: z.ZodString;
2141
2658
  }, "strip", z.ZodTypeAny, {
2142
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2659
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2143
2660
  updatedAt: string;
2144
2661
  id: string;
2145
2662
  createdAt: string;
2146
2663
  title: string;
2147
2664
  description: string;
2148
2665
  }, {
2149
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2666
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2150
2667
  updatedAt: string;
2151
2668
  id: string;
2152
2669
  createdAt: string;
@@ -2160,7 +2677,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2160
2677
  updatedAt: z.ZodString;
2161
2678
  }, "strip", z.ZodTypeAny, {
2162
2679
  number: number;
2163
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2680
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2164
2681
  updatedAt: string;
2165
2682
  notes: string;
2166
2683
  id: string;
@@ -2185,16 +2702,17 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2185
2702
  date: string;
2186
2703
  title: string;
2187
2704
  description: string;
2188
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2189
- 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";
2190
2707
  }[];
2191
2708
  checklist: (string | {
2709
+ number: number;
2192
2710
  id: string;
2193
2711
  title: string;
2194
2712
  checked: boolean;
2195
2713
  })[];
2196
2714
  subtasks: {
2197
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2715
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2198
2716
  updatedAt: string;
2199
2717
  id: string;
2200
2718
  createdAt: string;
@@ -2205,7 +2723,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2205
2723
  startedAt: string;
2206
2724
  completedAt: string;
2207
2725
  }, {
2208
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2726
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2209
2727
  updatedAt: string;
2210
2728
  id: string;
2211
2729
  createdAt: string;
@@ -2230,17 +2748,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2230
2748
  id: string;
2231
2749
  date: string;
2232
2750
  title: string;
2233
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2234
- 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";
2235
2753
  description?: string | undefined;
2236
2754
  }[] | undefined;
2237
2755
  checklist?: (string | {
2238
2756
  id: string;
2239
2757
  title: string;
2758
+ number?: number | undefined;
2240
2759
  checked?: boolean | undefined;
2241
2760
  })[] | undefined;
2242
2761
  subtasks?: {
2243
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2762
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2244
2763
  updatedAt: string;
2245
2764
  id: string;
2246
2765
  createdAt: string;
@@ -2253,11 +2772,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2253
2772
  }>, {
2254
2773
  checklist: {
2255
2774
  id: string;
2775
+ number: number;
2256
2776
  title: string;
2257
2777
  checked: boolean;
2258
2778
  }[];
2259
2779
  number: number;
2260
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2780
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2261
2781
  updatedAt: string;
2262
2782
  notes: string;
2263
2783
  id: string;
@@ -2282,11 +2802,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2282
2802
  date: string;
2283
2803
  title: string;
2284
2804
  description: string;
2285
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2286
- 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";
2287
2807
  }[];
2288
2808
  subtasks: {
2289
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2809
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2290
2810
  updatedAt: string;
2291
2811
  id: string;
2292
2812
  createdAt: string;
@@ -2297,7 +2817,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2297
2817
  startedAt: string;
2298
2818
  completedAt: string;
2299
2819
  }, {
2300
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2820
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2301
2821
  updatedAt: string;
2302
2822
  id: string;
2303
2823
  createdAt: string;
@@ -2322,17 +2842,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2322
2842
  id: string;
2323
2843
  date: string;
2324
2844
  title: string;
2325
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2326
- 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";
2327
2847
  description?: string | undefined;
2328
2848
  }[] | undefined;
2329
2849
  checklist?: (string | {
2330
2850
  id: string;
2331
2851
  title: string;
2852
+ number?: number | undefined;
2332
2853
  checked?: boolean | undefined;
2333
2854
  })[] | undefined;
2334
2855
  subtasks?: {
2335
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2856
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2336
2857
  updatedAt: string;
2337
2858
  id: string;
2338
2859
  createdAt: string;
@@ -2347,6 +2868,53 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2347
2868
  updatedAt: z.ZodString;
2348
2869
  handoff: z.ZodDefault<z.ZodString>;
2349
2870
  handoffUpdatedAt: z.ZodDefault<z.ZodString>;
2871
+ /** When the handoff was last read/acknowledged on recap (ISO). Non-empty means
2872
+ * the agent has seen it; the recap won't re-prompt every turn. The handoff
2873
+ * content is KEPT until a task in the phase starts (auto-clear) or the phase
2874
+ * completes — so a restart between read and resume does not lose context. */
2875
+ handoffReadAt: z.ZodDefault<z.ZodString>;
2876
+ /** Metadata for recently-cleared handoffs (newest-first, capped at 5). The
2877
+ * full content lives as .md files in .planner/.local/handoff-archive/ (gitignored);
2878
+ * this array only holds the pointer + clear reason + timestamp, so the phase
2879
+ * JSON stays lean and the archive is recoverable. */
2880
+ handoffHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
2881
+ /** Relative path under .planner/.local/handoff-archive/ (e.g. <phaseId>-<ISO>.md). */
2882
+ file: z.ZodDefault<z.ZodString>;
2883
+ clearedAt: z.ZodString;
2884
+ /** Why the handoff was cleared: "task-started" | "phase-done" | "manual" | "superseded" | "imported". */
2885
+ reason: z.ZodDefault<z.ZodString>;
2886
+ }, "strip", z.ZodTypeAny, {
2887
+ file: string;
2888
+ reason: string;
2889
+ clearedAt: string;
2890
+ }, {
2891
+ clearedAt: string;
2892
+ file?: string | undefined;
2893
+ reason?: string | undefined;
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">>;
2350
2918
  }, "strip", z.ZodTypeAny, {
2351
2919
  number: number;
2352
2920
  dependencies: string[];
@@ -2368,6 +2936,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2368
2936
  }[];
2369
2937
  shortId: string;
2370
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
+ }[];
2371
2947
  dependsOn: string[];
2372
2948
  slug: string;
2373
2949
  discussedAt: string;
@@ -2382,11 +2958,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2382
2958
  tasks: {
2383
2959
  checklist: {
2384
2960
  id: string;
2961
+ number: number;
2385
2962
  title: string;
2386
2963
  checked: boolean;
2387
2964
  }[];
2388
2965
  number: number;
2389
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2966
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2390
2967
  updatedAt: string;
2391
2968
  notes: string;
2392
2969
  id: string;
@@ -2411,11 +2988,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2411
2988
  date: string;
2412
2989
  title: string;
2413
2990
  description: string;
2414
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2415
- 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";
2416
2993
  }[];
2417
2994
  subtasks: {
2418
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2995
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2419
2996
  updatedAt: string;
2420
2997
  id: string;
2421
2998
  createdAt: string;
@@ -2428,6 +3005,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2428
3005
  }[];
2429
3006
  handoff: string;
2430
3007
  handoffUpdatedAt: string;
3008
+ handoffReadAt: string;
3009
+ handoffHistory: {
3010
+ file: string;
3011
+ reason: string;
3012
+ clearedAt: string;
3013
+ }[];
2431
3014
  featureId?: string | undefined;
2432
3015
  }, {
2433
3016
  number: number;
@@ -2451,6 +3034,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2451
3034
  }[] | undefined;
2452
3035
  shortId?: string | undefined;
2453
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;
2454
3045
  dependsOn?: string[] | undefined;
2455
3046
  featureId?: string | undefined;
2456
3047
  discussedAt?: string | undefined;
@@ -2463,7 +3054,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2463
3054
  completionCriteria?: string[] | undefined;
2464
3055
  taskIds?: string[] | undefined;
2465
3056
  tasks?: {
2466
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3057
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2467
3058
  updatedAt: string;
2468
3059
  id: string;
2469
3060
  createdAt: string;
@@ -2488,17 +3079,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2488
3079
  id: string;
2489
3080
  date: string;
2490
3081
  title: string;
2491
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2492
- 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";
2493
3084
  description?: string | undefined;
2494
3085
  }[] | undefined;
2495
3086
  checklist?: (string | {
2496
3087
  id: string;
2497
3088
  title: string;
3089
+ number?: number | undefined;
2498
3090
  checked?: boolean | undefined;
2499
3091
  })[] | undefined;
2500
3092
  subtasks?: {
2501
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3093
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2502
3094
  updatedAt: string;
2503
3095
  id: string;
2504
3096
  createdAt: string;
@@ -2511,6 +3103,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2511
3103
  }[] | undefined;
2512
3104
  handoff?: string | undefined;
2513
3105
  handoffUpdatedAt?: string | undefined;
3106
+ handoffReadAt?: string | undefined;
3107
+ handoffHistory?: {
3108
+ clearedAt: string;
3109
+ file?: string | undefined;
3110
+ reason?: string | undefined;
3111
+ }[] | undefined;
2514
3112
  }>, "many">;
2515
3113
  }, "strip", z.ZodTypeAny, {
2516
3114
  features: {
@@ -2531,6 +3129,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2531
3129
  }[];
2532
3130
  shortId: string;
2533
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
+ }[];
2534
3140
  dependsOn: string[];
2535
3141
  discussedAt: string;
2536
3142
  contextReady: boolean;
@@ -2544,14 +3150,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2544
3150
  };
2545
3151
  requirements: {
2546
3152
  requirements: {
2547
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3153
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2548
3154
  updatedAt: string;
2549
3155
  id: string;
2550
3156
  createdAt: string;
2551
3157
  title: string;
2552
3158
  description: string;
2553
3159
  macroTasks: {
2554
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3160
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2555
3161
  updatedAt: string;
2556
3162
  id: string;
2557
3163
  createdAt: string;
@@ -2594,6 +3200,22 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2594
3200
  implementationNotes: string;
2595
3201
  acceptedAt: string;
2596
3202
  }[];
3203
+ nextFeatureNumber: number;
3204
+ nextPhaseNumber: number;
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
+ }[];
2597
3219
  };
2598
3220
  phases: {
2599
3221
  number: number;
@@ -2616,6 +3238,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2616
3238
  }[];
2617
3239
  shortId: string;
2618
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
+ }[];
2619
3249
  dependsOn: string[];
2620
3250
  slug: string;
2621
3251
  discussedAt: string;
@@ -2630,11 +3260,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2630
3260
  tasks: {
2631
3261
  checklist: {
2632
3262
  id: string;
3263
+ number: number;
2633
3264
  title: string;
2634
3265
  checked: boolean;
2635
3266
  }[];
2636
3267
  number: number;
2637
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3268
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2638
3269
  updatedAt: string;
2639
3270
  notes: string;
2640
3271
  id: string;
@@ -2659,11 +3290,11 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2659
3290
  date: string;
2660
3291
  title: string;
2661
3292
  description: string;
2662
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2663
- 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";
2664
3295
  }[];
2665
3296
  subtasks: {
2666
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3297
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2667
3298
  updatedAt: string;
2668
3299
  id: string;
2669
3300
  createdAt: string;
@@ -2676,6 +3307,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2676
3307
  }[];
2677
3308
  handoff: string;
2678
3309
  handoffUpdatedAt: string;
3310
+ handoffReadAt: string;
3311
+ handoffHistory: {
3312
+ file: string;
3313
+ reason: string;
3314
+ clearedAt: string;
3315
+ }[];
2679
3316
  featureId?: string | undefined;
2680
3317
  }[];
2681
3318
  }, {
@@ -2697,6 +3334,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2697
3334
  }[] | undefined;
2698
3335
  shortId?: string | undefined;
2699
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;
2700
3345
  dependsOn?: string[] | undefined;
2701
3346
  discussedAt?: string | undefined;
2702
3347
  contextReady?: boolean | undefined;
@@ -2710,14 +3355,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2710
3355
  };
2711
3356
  requirements: {
2712
3357
  requirements: {
2713
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3358
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2714
3359
  updatedAt: string;
2715
3360
  id: string;
2716
3361
  createdAt: string;
2717
3362
  title: string;
2718
3363
  description?: string | undefined;
2719
3364
  macroTasks?: {
2720
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3365
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2721
3366
  updatedAt: string;
2722
3367
  id: string;
2723
3368
  createdAt: string;
@@ -2760,6 +3405,22 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2760
3405
  rationale?: string | undefined;
2761
3406
  implementationNotes?: string | undefined;
2762
3407
  }[] | undefined;
3408
+ nextFeatureNumber?: number | undefined;
3409
+ nextPhaseNumber?: number | undefined;
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;
2763
3424
  };
2764
3425
  phases: {
2765
3426
  number: number;
@@ -2783,6 +3444,14 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2783
3444
  }[] | undefined;
2784
3445
  shortId?: string | undefined;
2785
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;
2786
3455
  dependsOn?: string[] | undefined;
2787
3456
  featureId?: string | undefined;
2788
3457
  discussedAt?: string | undefined;
@@ -2795,7 +3464,7 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2795
3464
  completionCriteria?: string[] | undefined;
2796
3465
  taskIds?: string[] | undefined;
2797
3466
  tasks?: {
2798
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3467
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2799
3468
  updatedAt: string;
2800
3469
  id: string;
2801
3470
  createdAt: string;
@@ -2820,17 +3489,18 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2820
3489
  id: string;
2821
3490
  date: string;
2822
3491
  title: string;
2823
- fromStatus: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
2824
- 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";
2825
3494
  description?: string | undefined;
2826
3495
  }[] | undefined;
2827
3496
  checklist?: (string | {
2828
3497
  id: string;
2829
3498
  title: string;
3499
+ number?: number | undefined;
2830
3500
  checked?: boolean | undefined;
2831
3501
  })[] | undefined;
2832
3502
  subtasks?: {
2833
- status: "planned" | "in-progress" | "done" | "blocked" | "canceled" | "rejected" | "deferred" | "waiting";
3503
+ status: "canceled" | "planned" | "in-progress" | "done" | "blocked" | "rejected" | "deferred" | "waiting";
2834
3504
  updatedAt: string;
2835
3505
  id: string;
2836
3506
  createdAt: string;
@@ -2843,6 +3513,12 @@ export declare const PlanWorkspaceSchema: z.ZodObject<{
2843
3513
  }[] | undefined;
2844
3514
  handoff?: string | undefined;
2845
3515
  handoffUpdatedAt?: string | undefined;
3516
+ handoffReadAt?: string | undefined;
3517
+ handoffHistory?: {
3518
+ clearedAt: string;
3519
+ file?: string | undefined;
3520
+ reason?: string | undefined;
3521
+ }[] | undefined;
2846
3522
  }[];
2847
3523
  }>;
2848
3524
  export type Timestamp = z.infer<typeof TimestampSchema>;
@@ -2867,9 +3543,11 @@ export type Manifest = z.infer<typeof ManifestSchema>;
2867
3543
  export type WorkflowRules = z.infer<typeof WorkflowRulesSchema>;
2868
3544
  export type AcceptedDecision = z.infer<typeof AcceptedDecisionSchema>;
2869
3545
  export type Project = z.infer<typeof ProjectSchema>;
3546
+ export type WorkDeviation = z.infer<typeof WorkDeviationSchema>;
2870
3547
  export type Subtask = z.infer<typeof SubtaskSchema>;
2871
3548
  export type ChecklistItem = z.infer<typeof ChecklistItemSchema>;
2872
3549
  export type StatusLogEntry = z.infer<typeof StatusLogEntrySchema>;
3550
+ export type PhaseStatusLogEntry = z.infer<typeof PhaseStatusLogEntrySchema>;
2873
3551
  export type Task = z.infer<typeof TaskSchema>;
2874
3552
  export type Phase = z.infer<typeof PhaseSchema> & {
2875
3553
  status: PhaseStatus;