@namewta/speculo 0.7.2 → 0.7.3

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.
Files changed (53) hide show
  1. package/dist/src/migrations.js +604 -23
  2. package/dist/src/migrations.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +171 -455
  5. package/template/canonical/canonical-specdev-goal-plan.md +686 -1117
  6. package/template/canonical/canonical-specdev-grill-with-docs.md +172 -456
  7. package/template/canonical/canonical-specdev-spec.md +199 -493
  8. package/template/canonical/canonical-specdev-tickets.md +378 -597
  9. package/template/canonical/canonical-specdev-wayfinder.md +170 -454
  10. package/template/skills/migrate-runtime-state/SKILL.md +6 -6
  11. package/template/skills/migrate-runtime-state/references/migration-contract.md +9 -3
  12. package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +322 -33
  13. package/template/workflows/specdev/I-implement/I-implement.md +97 -143
  14. package/template/workflows/specdev/I-implement/evidence-template.md +60 -48
  15. package/template/workflows/specdev/I-implement/execution-preflight.md +29 -21
  16. package/template/workflows/specdev/I-implement/merge-conflict-protocol.md +12 -12
  17. package/template/workflows/specdev/I-init-setup/I-init-setup.md +4 -5
  18. package/template/workflows/specdev/I-init-setup/change-status-template.json +14 -1
  19. package/template/workflows/specdev/I-init-setup/config-template.json +3 -5
  20. package/template/workflows/specdev/I-init-setup/status-template.json +1 -1
  21. package/template/workflows/specdev/INDEX.md +11 -8
  22. package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +76 -102
  23. package/template/workflows/specdev/P-goal-plan/completion-control.md +26 -44
  24. package/template/workflows/specdev/P-goal-plan/goal-plan-template.md +40 -37
  25. package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +34 -0
  26. package/template/workflows/specdev/P-goal-plan/orchestration-protocol.md +31 -46
  27. package/template/workflows/specdev/P-goal-plan/planning-modes.md +42 -76
  28. package/template/workflows/specdev/T-tickets/T-tickets.md +6 -3
  29. package/template/workflows/specdev/T-tickets/ticket-readiness.md +5 -3
  30. package/template/workflows/specdev/T-tickets/ticket-template.md +8 -1
  31. package/template/workflows/specdev/T-tickets/tickets-map-template.md +5 -4
  32. package/template/workflows/specdev/_state/status.json +1 -1
  33. package/template/workflows/specdev/common/README.md +2 -2
  34. package/template/workflows/specdev/common/rules/change-completion.md +17 -20
  35. package/template/workflows/specdev/common/rules/deviation-control.md +1 -1
  36. package/template/workflows/specdev/common/rules/evidence-and-verification.md +27 -37
  37. package/template/workflows/specdev/common/rules/path-ownership.md +21 -23
  38. package/template/workflows/specdev/common/rules/readiness-and-depth.md +1 -1
  39. package/template/workflows/specdev/common/schemas/change-status.schema.json +136 -373
  40. package/template/workflows/specdev/common/schemas/config.schema.json +9 -11
  41. package/template/workflows/specdev/common/schemas/goal-plan.schema.json +24 -16
  42. package/template/workflows/specdev/common/schemas/status.schema.json +7 -63
  43. package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +42 -21
  44. package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +36 -21
  45. package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +46 -18
  46. package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +34 -31
  47. package/template/workflows/specdev/common/skills/subagent-delivery/references/external-web-subagent.md +10 -23
  48. package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md +15 -25
  49. package/template/workflows/specdev/common/tools/validate-specdev.mjs +386 -209
  50. package/template/workflows/specdev/I-implement/delegated-evidence-template.md +0 -12
  51. package/template/workflows/specdev/P-goal-plan/delegated-execution-template.md +0 -35
  52. package/template/workflows/specdev/P-goal-plan/delegated-execution.md +0 -59
  53. package/template/workflows/specdev/P-goal-plan/workspace-execution-template.md +0 -24
@@ -324,16 +324,14 @@ resolution: answered
324
324
 
325
325
  ```json
326
326
  {
327
- "schema_version": 3,
327
+ "schema_version": 4,
328
328
  "interaction_language": "zh-CN",
329
329
  "artifact_language": "zh-CN",
330
330
  "git": {
331
- "auto_commit": false,
332
- "default_branch": null,
333
- "worktree_for_parallel": true
331
+ "default_branch": null
334
332
  },
335
333
  "execution": {
336
- "max_parallel": 3,
334
+ "max_implementation_agents": 3,
337
335
  "deep_ticket_human_approval": true,
338
336
  "shared_path_owner": "explicit"
339
337
  },
@@ -358,33 +356,31 @@ resolution: answered
358
356
  ```json
359
357
  {
360
358
  "$schema": "https://json-schema.org/draft/2020-12/schema",
361
- "$id": "urn:speculo:specdev:config:v3",
359
+ "$id": "urn:speculo:specdev:config:v4",
362
360
  "title": "SpecDev Configuration",
363
361
  "type": "object",
364
362
  "required": ["schema_version", "interaction_language", "artifact_language", "git", "execution", "verification", "planning"],
365
363
  "properties": {
366
- "schema_version": {"const": 3},
364
+ "schema_version": {"const": 4},
367
365
  "interaction_language": {"type": "string", "minLength": 1},
368
366
  "artifact_language": {"type": "string", "minLength": 1},
369
367
  "git": {
370
368
  "type": "object",
371
- "required": ["auto_commit", "default_branch", "worktree_for_parallel"],
369
+ "required": ["default_branch"],
372
370
  "properties": {
373
- "auto_commit": {"type": "boolean"},
374
- "default_branch": {"type": ["string", "null"]},
375
- "worktree_for_parallel": {"type": "boolean"}
371
+ "default_branch": {"type": ["string", "null"]}
376
372
  },
377
- "additionalProperties": true
373
+ "additionalProperties": false
378
374
  },
379
375
  "execution": {
380
376
  "type": "object",
381
- "required": ["max_parallel", "deep_ticket_human_approval", "shared_path_owner"],
377
+ "required": ["max_implementation_agents", "deep_ticket_human_approval", "shared_path_owner"],
382
378
  "properties": {
383
- "max_parallel": {"type": "integer", "minimum": 1},
379
+ "max_implementation_agents": {"type": "integer", "minimum": 1, "maximum": 3},
384
380
  "deep_ticket_human_approval": {"type": "boolean"},
385
381
  "shared_path_owner": {"type": "string", "minLength": 1}
386
382
  },
387
- "additionalProperties": true
383
+ "additionalProperties": false
388
384
  },
389
385
  "verification": {
390
386
  "type": "object",
@@ -408,7 +404,7 @@ resolution: answered
408
404
  "additionalProperties": true
409
405
  }
410
406
  },
411
- "additionalProperties": true
407
+ "additionalProperties": false
412
408
  }
413
409
  ```
414
410
 
@@ -418,7 +414,7 @@ resolution: answered
418
414
 
419
415
  ```json
420
416
  {
421
- "schema_version": 4,
417
+ "schema_version": 5,
422
418
  "workflow": "specdev",
423
419
  "active": [],
424
420
  "archived": []
@@ -432,83 +428,27 @@ resolution: answered
432
428
  ```json
433
429
  {
434
430
  "$schema": "https://json-schema.org/draft/2020-12/schema",
435
- "$id": "urn:speculo:specdev:status:v4",
431
+ "$id": "urn:speculo:specdev:status:v5",
436
432
  "title": "SpecDev Global Status",
437
433
  "type": "object",
438
- "required": [
439
- "schema_version",
440
- "workflow",
441
- "active",
442
- "archived"
443
- ],
434
+ "required": ["schema_version", "workflow", "active", "archived"],
444
435
  "properties": {
445
- "schema_version": {
446
- "const": 4
447
- },
448
- "workflow": {
449
- "const": "specdev"
450
- },
436
+ "schema_version": {"const": 5},
437
+ "workflow": {"const": "specdev"},
451
438
  "active": {
452
439
  "type": "array",
453
440
  "items": {
454
441
  "type": "object",
455
- "required": [
456
- "change",
457
- "current_work",
458
- "works_run"
459
- ],
442
+ "required": ["change"],
460
443
  "properties": {
461
444
  "change": {
462
445
  "type": "string",
463
446
  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
464
- },
465
- "current_work": {
466
- "type": [
467
- "string",
468
- "null"
469
- ],
470
- "pattern": "^specdev/"
471
- },
472
- "works_run": {
473
- "type": "array",
474
- "items": {
475
- "type": "string",
476
- "pattern": "^specdev/"
477
- },
478
- "uniqueItems": true
479
- },
480
- "claimed_investigations": {
481
- "type": "array",
482
- "items": {
483
- "type": "object",
484
- "required": [
485
- "id",
486
- "owner",
487
- "claimed_at"
488
- ],
489
- "properties": {
490
- "id": {
491
- "type": "string"
492
- },
493
- "owner": {
494
- "type": "string"
495
- },
496
- "session": {
497
- "type": [
498
- "string",
499
- "null"
500
- ]
501
- },
502
- "claimed_at": {
503
- "type": "string"
504
- }
505
- },
506
- "additionalProperties": false
507
- }
508
447
  }
509
448
  },
510
449
  "additionalProperties": false
511
- }
450
+ },
451
+ "uniqueItems": true
512
452
  },
513
453
  "archived": {
514
454
  "type": "array",
@@ -529,11 +469,24 @@ resolution: answered
529
469
 
530
470
  ```json
531
471
  {
532
- "schema_version": 3,
472
+ "schema_version": 5,
533
473
  "artifact": "change-status",
534
474
  "change": "<YYYY-MM-DD-topic>",
535
475
  "change_status": "active",
536
476
  "current_work": null,
477
+ "works_run": [],
478
+ "claimed_investigations": [],
479
+ "execution_authorization": {
480
+ "implementation_commit": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Ticket source commits"},
481
+ "local_candidate_integration": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Lead-owned local parent candidate integration and parent update"},
482
+ "source_cleanup": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Source worktree and branch cleanup"}
483
+ },
484
+ "leadership": {
485
+ "current": "<owner-or-session-locator>",
486
+ "epoch": 1,
487
+ "assigned_at": "<ISO-8601>",
488
+ "history": []
489
+ },
537
490
  "created_at": "<ISO-8601>",
538
491
  "updated_at": "<ISO-8601>",
539
492
  "completed_at": null,
@@ -552,394 +505,157 @@ resolution: answered
552
505
  ```json
553
506
  {
554
507
  "$schema": "https://json-schema.org/draft/2020-12/schema",
555
- "$id": "urn:speculo:specdev:change-status:v3",
508
+ "$id": "urn:speculo:specdev:change-status:v5",
556
509
  "title": "SpecDev Change Status",
557
510
  "type": "object",
558
511
  "required": [
559
- "schema_version",
560
- "artifact",
561
- "change",
562
- "change_status",
563
- "current_work",
564
- "created_at",
565
- "updated_at",
566
- "completed_at",
567
- "archived",
568
- "archive_path",
569
- "blockers",
570
- "deviations"
512
+ "schema_version", "artifact", "change", "change_status", "current_work", "works_run",
513
+ "claimed_investigations", "execution_authorization", "leadership", "created_at", "updated_at",
514
+ "completed_at", "archived", "archive_path", "blockers", "deviations", "worktrees"
571
515
  ],
572
516
  "properties": {
573
- "schema_version": {
574
- "const": 3
575
- },
576
- "artifact": {
577
- "const": "change-status"
578
- },
579
- "change": {
580
- "type": "string",
581
- "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
582
- },
583
- "change_status": {
584
- "enum": [
585
- "active",
586
- "blocked",
587
- "completed",
588
- "archived"
589
- ]
590
- },
591
- "current_work": {
592
- "type": [
593
- "string",
594
- "null"
595
- ]
596
- },
597
- "created_at": {
598
- "type": "string",
599
- "minLength": 1
600
- },
601
- "updated_at": {
602
- "type": "string",
603
- "minLength": 1
517
+ "schema_version": {"const": 5},
518
+ "artifact": {"const": "change-status"},
519
+ "change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
520
+ "change_status": {"enum": ["active", "blocked", "completed", "archived"]},
521
+ "current_work": {"type": ["string", "null"], "pattern": "^specdev/"},
522
+ "works_run": {"type": "array", "items": {"type": "string", "pattern": "^specdev/"}, "uniqueItems": true},
523
+ "claimed_investigations": {"type": "array", "items": {"$ref": "#/$defs/claim"}},
524
+ "execution_authorization": {"$ref": "#/$defs/authorization"},
525
+ "leadership": {"$ref": "#/$defs/leadership"},
526
+ "created_at": {"type": "string", "minLength": 1},
527
+ "updated_at": {"type": "string", "minLength": 1},
528
+ "completed_at": {"type": ["string", "null"]},
529
+ "archived": {"type": "boolean"},
530
+ "archive_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}]},
531
+ "blockers": {"type": "array", "items": {"type": "string"}},
532
+ "deviations": {"type": "array", "items": {"type": "string"}},
533
+ "worktrees": {"type": "array", "items": {"$ref": "#/$defs/worktree"}}
534
+ },
535
+ "$defs": {
536
+ "claim": {
537
+ "type": "object",
538
+ "required": ["id", "owner", "session", "claimed_at"],
539
+ "properties": {
540
+ "id": {"type": "string", "minLength": 1},
541
+ "owner": {"type": "string", "minLength": 1},
542
+ "session": {"type": ["string", "null"]},
543
+ "claimed_at": {"type": "string", "minLength": 1}
544
+ },
545
+ "additionalProperties": false
604
546
  },
605
- "completed_at": {
606
- "type": [
607
- "string",
608
- "null"
609
- ]
547
+ "authorization-entry": {
548
+ "type": "object",
549
+ "required": ["status", "source", "granted_at", "scope"],
550
+ "properties": {
551
+ "status": {"enum": ["authorized", "not-authorized", "revoked"]},
552
+ "source": {"type": ["string", "null"]},
553
+ "granted_at": {"type": ["string", "null"]},
554
+ "scope": {"type": "string", "minLength": 1}
555
+ },
556
+ "allOf": [{
557
+ "if": {"properties": {"status": {"const": "authorized"}}, "required": ["status"]},
558
+ "then": {"properties": {"source": {"type": "string", "minLength": 1}, "granted_at": {"type": "string", "minLength": 1}}}
559
+ }],
560
+ "additionalProperties": false
610
561
  },
611
- "archived": {
612
- "type": "boolean"
562
+ "authorization": {
563
+ "type": "object",
564
+ "required": ["implementation_commit", "local_candidate_integration", "source_cleanup"],
565
+ "properties": {
566
+ "implementation_commit": {"$ref": "#/$defs/authorization-entry"},
567
+ "local_candidate_integration": {"$ref": "#/$defs/authorization-entry"},
568
+ "source_cleanup": {"$ref": "#/$defs/authorization-entry"}
569
+ },
570
+ "additionalProperties": false
613
571
  },
614
- "archive_path": {
615
- "anyOf": [
616
- {
617
- "type": "null"
618
- },
619
- {
620
- "type": "string",
621
- "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
622
- }
623
- ]
572
+ "leadership-history": {
573
+ "type": "object",
574
+ "required": ["owner", "epoch", "assigned_at", "ended_at"],
575
+ "properties": {
576
+ "owner": {"type": "string", "minLength": 1},
577
+ "epoch": {"type": "integer", "minimum": 1},
578
+ "assigned_at": {"type": "string", "minLength": 1},
579
+ "ended_at": {"type": "string", "minLength": 1}
580
+ },
581
+ "additionalProperties": false
624
582
  },
625
- "blockers": {
626
- "type": "array",
627
- "items": {
628
- "type": "string"
629
- }
583
+ "leadership": {
584
+ "type": "object",
585
+ "required": ["current", "epoch", "assigned_at", "history"],
586
+ "properties": {
587
+ "current": {"type": "string", "minLength": 1},
588
+ "epoch": {"type": "integer", "minimum": 1},
589
+ "assigned_at": {"type": "string", "minLength": 1},
590
+ "history": {"type": "array", "items": {"$ref": "#/$defs/leadership-history"}}
591
+ },
592
+ "additionalProperties": false
630
593
  },
631
- "deviations": {
632
- "type": "array",
633
- "items": {
634
- "type": "string"
635
- }
594
+ "full-suite": {
595
+ "type": "object",
596
+ "required": ["required", "status", "reason", "evidence"],
597
+ "properties": {
598
+ "required": {"type": "boolean"},
599
+ "status": {"enum": ["not-required", "pending", "passed", "failed"]},
600
+ "reason": {"type": ["string", "null"]},
601
+ "evidence": {"type": ["string", "null"]}
602
+ },
603
+ "allOf": [{
604
+ "if": {"properties": {"required": {"const": false}}, "required": ["required"]},
605
+ "then": {"properties": {"status": {"const": "not-required"}, "reason": {"type": "string", "minLength": 1}}}
606
+ }],
607
+ "additionalProperties": false
636
608
  },
637
- "worktrees": {
638
- "type": "array",
639
- "items": {
640
- "type": "object",
641
- "required": [
642
- "ticket_id",
643
- "owner",
644
- "provider",
645
- "base_sha",
646
- "branch",
647
- "workspace_ref",
648
- "status",
649
- "updated_at"
650
- ],
651
- "properties": {
652
- "ticket_id": {
653
- "type": "string",
654
- "pattern": "^T-[0-9]{2,}$"
655
- },
656
- "owner": {
657
- "type": "string",
658
- "minLength": 1
659
- },
660
- "integration_owner": {
661
- "type": "string",
662
- "minLength": 1
663
- },
664
- "provider": {
665
- "enum": [
666
- "native",
667
- "git",
668
- "external"
669
- ]
670
- },
671
- "base_sha": {
672
- "type": "string",
673
- "minLength": 1
674
- },
675
- "parent_branch": {
676
- "type": "string",
677
- "minLength": 1
678
- },
679
- "branch": {
680
- "type": "string",
681
- "minLength": 1
682
- },
683
- "workspace_ref": {
684
- "type": "string",
685
- "minLength": 1,
686
- "pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
687
- },
688
- "terminal_action": {
689
- "enum": [
690
- "integrate",
691
- "retain"
692
- ]
693
- },
694
- "source_checkpoint": {
695
- "type": [
696
- "string",
697
- "null"
698
- ]
699
- },
700
- "integration": {
701
- "type": "object",
702
- "required": [
703
- "status",
704
- "parent_before_sha",
705
- "source_sha",
706
- "result_sha",
707
- "method",
708
- "conflict_paths",
709
- "verification",
710
- "evidence",
711
- "attempts"
712
- ],
713
- "properties": {
714
- "status": {
715
- "enum": [
716
- "pending",
717
- "running",
718
- "passed",
719
- "blocked"
720
- ]
721
- },
722
- "parent_before_sha": {
723
- "type": ["string", "null"]
724
- },
725
- "source_sha": {
726
- "type": ["string", "null"]
727
- },
728
- "result_sha": {
729
- "type": ["string", "null"]
730
- },
731
- "method": {
732
- "enum": [null, "fast-forward", "merge-commit"]
733
- },
734
- "conflict_paths": {
735
- "type": "array",
736
- "items": {"type": "string"}
737
- },
738
- "verification": {
739
- "enum": ["pending", "passed", "failed"]
740
- },
741
- "evidence": {
742
- "type": "string",
743
- "pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"
744
- },
745
- "attempts": {
746
- "type": "integer",
747
- "minimum": 0
748
- }
749
- },
750
- "additionalProperties": true
751
- },
752
- "status": {
753
- "enum": [
754
- "planned",
755
- "active",
756
- "review",
757
- "integrating",
758
- "integrated",
759
- "removed",
760
- "blocked"
761
- ]
762
- },
763
- "updated_at": {
764
- "type": "string",
765
- "minLength": 1
766
- }
767
- },
768
- "dependentRequired": {
769
- "terminal_action": [
770
- "integration_owner",
771
- "parent_branch",
772
- "source_checkpoint",
773
- "integration"
774
- ]
775
- },
776
- "allOf": [
777
- {
778
- "if": {
779
- "properties": {
780
- "status": {"const": "integrating"}
781
- },
782
- "required": ["status"]
783
- },
784
- "then": {
785
- "required": [
786
- "terminal_action",
787
- "integration_owner",
788
- "parent_branch",
789
- "source_checkpoint",
790
- "integration"
791
- ],
792
- "properties": {
793
- "terminal_action": {"const": "integrate"}
794
- }
795
- }
796
- },
797
- {
798
- "if": {
799
- "properties": {
800
- "status": {"enum": ["integrating", "integrated"]},
801
- "terminal_action": {"const": "integrate"}
802
- },
803
- "required": ["status", "terminal_action"]
804
- },
805
- "then": {
806
- "properties": {
807
- "source_checkpoint": {"type": "string", "minLength": 1},
808
- "integration": {
809
- "properties": {
810
- "parent_before_sha": {"type": "string", "minLength": 1},
811
- "source_sha": {"type": "string", "minLength": 1},
812
- "attempts": {"type": "integer", "minimum": 1}
813
- }
814
- }
815
- }
816
- }
817
- },
818
- {
819
- "if": {
820
- "properties": {
821
- "status": {"const": "integrating"},
822
- "terminal_action": {"const": "integrate"}
823
- },
824
- "required": ["status", "terminal_action"]
825
- },
826
- "then": {
827
- "properties": {
828
- "integration": {
829
- "properties": {
830
- "status": {"const": "running"}
831
- }
832
- }
833
- }
834
- }
835
- },
836
- {
837
- "if": {
838
- "properties": {
839
- "status": {"const": "integrated"},
840
- "terminal_action": {"const": "integrate"}
841
- },
842
- "required": ["status", "terminal_action"]
843
- },
844
- "then": {
845
- "properties": {
846
- "integration": {
847
- "properties": {
848
- "status": {"const": "passed"},
849
- "result_sha": {"type": "string", "minLength": 1},
850
- "method": {"enum": ["fast-forward", "merge-commit"]},
851
- "verification": {"const": "passed"}
852
- }
853
- }
854
- }
855
- }
856
- },
857
- {
858
- "if": {
859
- "properties": {
860
- "terminal_action": {"const": "retain"}
861
- },
862
- "required": ["terminal_action"]
863
- },
864
- "then": {
865
- "properties": {
866
- "status": {
867
- "not": {"enum": ["integrating", "integrated"]}
868
- }
869
- }
870
- }
871
- }
872
- ],
873
- "additionalProperties": true
874
- }
875
- }
876
- },
877
- "allOf": [
878
- {
879
- "if": {
880
- "properties": {
881
- "worktrees": {
882
- "contains": {
883
- "properties": {
884
- "provider": {
885
- "const": "git"
886
- }
887
- },
888
- "required": [
889
- "provider"
890
- ]
891
- }
892
- }
893
- }
609
+ "worktree": {
610
+ "type": "object",
611
+ "required": ["ticket_id", "owner", "implementation_owner", "integration_owner", "provider", "base_sha", "parent_branch", "branch", "workspace_ref", "source_checkpoint", "integration", "status", "updated_at"],
612
+ "properties": {
613
+ "ticket_id": {"type": "string", "pattern": "^T-[0-9]{2,}$"},
614
+ "owner": {"type": "string", "minLength": 1},
615
+ "implementation_owner": {"type": "string", "minLength": 1},
616
+ "integration_owner": {"type": "string", "minLength": 1},
617
+ "provider": {"const": "git"},
618
+ "base_sha": {"type": "string", "minLength": 1},
619
+ "parent_branch": {"type": "string", "minLength": 1},
620
+ "branch": {"type": "string", "minLength": 1},
621
+ "workspace_ref": {"type": "string", "pattern": "^specdev-worktree/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"},
622
+ "source_checkpoint": {"type": ["string", "null"]},
623
+ "integration": {"$ref": "#/$defs/integration"},
624
+ "status": {"enum": ["planned", "active", "review", "integrating", "integrated", "removed", "blocked"]},
625
+ "updated_at": {"type": "string", "minLength": 1}
894
626
  },
895
- "then": {
896
- "properties": {
897
- "worktrees": {
898
- "items": {
899
- "if": {
900
- "properties": {
901
- "provider": {
902
- "const": "git"
903
- }
904
- },
905
- "required": [
906
- "provider"
907
- ]
908
- },
909
- "then": {
910
- "properties": {
911
- "workspace_ref": {
912
- "pattern": "^specdev-worktree/T-[0-9]{2,}$"
913
- }
914
- }
915
- }
916
- }
917
- }
918
- }
919
- }
627
+ "additionalProperties": false
920
628
  },
921
- {
922
- "if": {
923
- "properties": {
924
- "change_status": {
925
- "const": "archived"
926
- }
927
- }
629
+ "integration": {
630
+ "type": "object",
631
+ "required": ["status", "parent_ref", "parent_before_sha", "source_sha", "candidate_sha", "candidate_tree_sha", "candidate_branch", "candidate_workspace_ref", "result_sha", "method", "conflict_paths", "verification", "full_suite", "e2e", "evidence", "attempts", "promotion_status"],
632
+ "properties": {
633
+ "status": {"enum": ["pending", "candidate", "passed", "failed", "stale"]},
634
+ "parent_ref": {"type": ["string", "null"]},
635
+ "parent_before_sha": {"type": ["string", "null"]},
636
+ "source_sha": {"type": ["string", "null"]},
637
+ "candidate_sha": {"type": ["string", "null"]},
638
+ "candidate_tree_sha": {"type": ["string", "null"]},
639
+ "candidate_branch": {"type": ["string", "null"]},
640
+ "candidate_workspace_ref": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev-worktree/\\.integration/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"}]},
641
+ "result_sha": {"type": ["string", "null"]},
642
+ "method": {"enum": [null, "fast-forward", "merge-commit"]},
643
+ "conflict_paths": {"type": "array", "items": {"type": "string"}},
644
+ "verification": {"enum": ["pending", "passed", "failed"]},
645
+ "full_suite": {"$ref": "#/$defs/full-suite"},
646
+ "e2e": {"$ref": "#/$defs/full-suite"},
647
+ "evidence": {"type": "string", "pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"},
648
+ "attempts": {"type": "integer", "minimum": 0},
649
+ "promotion_status": {"enum": ["pending", "applying", "applied", "failed", "stale"]}
928
650
  },
929
- "then": {
930
- "properties": {
931
- "archived": {
932
- "const": true
933
- },
934
- "archive_path": {
935
- "type": "string",
936
- "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
937
- }
938
- }
939
- }
651
+ "additionalProperties": false
940
652
  }
941
- ],
942
- "additionalProperties": true
653
+ },
654
+ "allOf": [{
655
+ "if": {"properties": {"change_status": {"const": "archived"}}, "required": ["change_status"]},
656
+ "then": {"properties": {"archived": {"const": true}, "archive_path": {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}}}
657
+ }],
658
+ "additionalProperties": false
943
659
  }
944
660
  ```
945
661