okstra 0.172.0 → 0.173.0

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 (83) hide show
  1. package/README.md +8 -6
  2. package/docs/architecture/storage-model.md +11 -0
  3. package/docs/architecture.md +16 -14
  4. package/docs/cli.md +36 -5
  5. package/docs/performance-improvement-plan-v2.md +6 -5
  6. package/docs/project-structure-overview.md +21 -13
  7. package/docs/task-process/README.md +5 -3
  8. package/docs/task-process/error-analysis.md +2 -2
  9. package/docs/task-process/final-verification.md +2 -2
  10. package/docs/task-process/implementation-option-selection.md +70 -0
  11. package/docs/task-process/implementation-planning.md +23 -15
  12. package/docs/task-process/requirements-discovery.md +2 -2
  13. package/package.json +1 -1
  14. package/runtime/BUILD.json +2 -2
  15. package/runtime/agents/workers/report-writer-worker.md +30 -6
  16. package/runtime/bin/lib/okstra/cli.sh +5 -1
  17. package/runtime/bin/lib/okstra/globals.sh +1 -0
  18. package/runtime/bin/lib/okstra/usage.sh +3 -0
  19. package/runtime/bin/okstra.sh +2 -0
  20. package/runtime/prompts/duties/direction-selection-worker.md +44 -0
  21. package/runtime/prompts/duties/planning-worker.md +12 -4
  22. package/runtime/prompts/lead/context-loader.md +1 -1
  23. package/runtime/prompts/lead/convergence.md +5 -5
  24. package/runtime/prompts/lead/okstra-lead-contract.md +6 -5
  25. package/runtime/prompts/lead/plan-body-verification.md +20 -3
  26. package/runtime/prompts/lead/report-writer.md +27 -5
  27. package/runtime/prompts/profiles/_common-contract.md +1 -1
  28. package/runtime/prompts/profiles/_implementation-deliverable.md +2 -2
  29. package/runtime/prompts/profiles/error-analysis.md +3 -3
  30. package/runtime/prompts/profiles/final-verification.md +3 -3
  31. package/runtime/prompts/profiles/forbidden-actions.json +7 -0
  32. package/runtime/prompts/profiles/implementation-option-selection.md +35 -0
  33. package/runtime/prompts/profiles/implementation-planning.md +50 -38
  34. package/runtime/prompts/profiles/implementation.md +2 -1
  35. package/runtime/prompts/profiles/improvement-discovery.md +1 -1
  36. package/runtime/prompts/profiles/requirements-discovery.md +3 -3
  37. package/runtime/prompts/wizard/prompts.ko.json +9 -1
  38. package/runtime/python/okstra_ctl/agent_invocation.py +1 -0
  39. package/runtime/python/okstra_ctl/analysis_packet.py +6 -0
  40. package/runtime/python/okstra_ctl/exact_coverage.py +128 -0
  41. package/runtime/python/okstra_ctl/fix_cycles.py +3 -1
  42. package/runtime/python/okstra_ctl/implementation_direction.py +836 -0
  43. package/runtime/python/okstra_ctl/implementation_options.py +479 -0
  44. package/runtime/python/okstra_ctl/plan_items.py +51 -3
  45. package/runtime/python/okstra_ctl/render.py +1 -0
  46. package/runtime/python/okstra_ctl/render_final_report.py +1 -0
  47. package/runtime/python/okstra_ctl/report_contract.py +45 -13
  48. package/runtime/python/okstra_ctl/report_html/render.py +4 -2
  49. package/runtime/python/okstra_ctl/report_html/router.py +4 -0
  50. package/runtime/python/okstra_ctl/report_html/view_models/implementation_option_selection.py +32 -0
  51. package/runtime/python/okstra_ctl/report_html/view_models/implementation_planning.py +25 -10
  52. package/runtime/python/okstra_ctl/report_views.py +148 -12
  53. package/runtime/python/okstra_ctl/run.py +350 -2
  54. package/runtime/python/okstra_ctl/scope_provenance.py +15 -9
  55. package/runtime/python/okstra_ctl/user_response.py +75 -0
  56. package/runtime/python/okstra_ctl/wizard.py +144 -0
  57. package/runtime/python/okstra_ctl/worker_prompt_policy.py +2 -0
  58. package/runtime/python/okstra_ctl/workflow.py +29 -7
  59. package/runtime/schemas/final-report-v2.0.schema.json +1428 -137
  60. package/runtime/templates/reports/final-report-v2.template.md +4 -0
  61. package/runtime/templates/reports/final-verification-input.template.md +1 -1
  62. package/runtime/templates/reports/html/base.template.html +3 -2
  63. package/runtime/templates/reports/html/i18n/en.json +21 -1
  64. package/runtime/templates/reports/html/i18n/ko.json +21 -1
  65. package/runtime/templates/reports/html/macros/forms.html +21 -2
  66. package/runtime/templates/reports/html/tasks/implementation-option-selection.template.html +49 -0
  67. package/runtime/templates/reports/html/tasks/implementation-planning.template.html +36 -2
  68. package/runtime/templates/reports/i18n/en.json +13 -0
  69. package/runtime/templates/reports/implementation-input.template.md +4 -2
  70. package/runtime/templates/reports/implementation-planning-input.template.md +18 -4
  71. package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
  72. package/runtime/templates/reports/md/tasks/implementation-option-selection.template.md +13 -0
  73. package/runtime/templates/reports/md/tasks/implementation-planning.template.md +17 -0
  74. package/runtime/templates/reports/report.js +111 -4
  75. package/runtime/templates/reports/task-brief.template.md +9 -3
  76. package/runtime/templates/reports/user-response.template.md +25 -4
  77. package/runtime/templates/worker-prompt-preamble.md +8 -0
  78. package/runtime/validators/validate-implementation-plan-stages.py +106 -1
  79. package/runtime/validators/validate-report-views.py +2 -2
  80. package/runtime/validators/validate-run.py +135 -25
  81. package/runtime/validators/validate_improvement_report.py +5 -1
  82. package/src/commands/execute/codex-run.mjs +1 -0
  83. package/src/commands/execute/render-bundle.mjs +1 -0
@@ -124,6 +124,11 @@
124
124
  "implementationOption": {
125
125
  "type": "string",
126
126
  "description": "유저가 implementation-planning final-report 에서 고른 Option Candidate 이름. report-writer 는 항상 빈 문자열로 발행하고, 사용자가 `--implementation-option <name>` 또는 직접 편집으로 채웁니다. `implementation` task-type 이 이 값으로 진행하며, 비어 있으면 plan 의 `Recommended Option` 으로 폴백합니다. 다른 task-type 에서는 의미 없이 빈 값으로 유지됩니다."
127
+ },
128
+ "selectedDirectionRef": {
129
+ "type": "string",
130
+ "minLength": 1,
131
+ "description": "selected-direction implementation-planning reports only: project-relative path to instruction-set/selected-direction.json."
127
132
  }
128
133
  }
129
134
  },
@@ -565,28 +570,154 @@
565
570
  "changeImpactAnalysis": {
566
571
  "$ref": "#/$defs/ChangeImpactAnalysis"
567
572
  },
573
+ "implementationOptionSelection": {
574
+ "$ref": "#/$defs/ImplementationOptionSelection"
575
+ },
568
576
  "implementationPlanning": {
569
577
  "type": "object",
570
578
  "description": "RENDER_IF taskType == implementation-planning. §5.5 deliverables.",
571
- "required": [
572
- "optionCandidates",
573
- "tradeoffMatrix",
574
- "recommendedOption",
575
- "stageMap",
576
- "stages",
577
- "dependencyMigrationRisk",
578
- "validationChecklist",
579
- "rollbackStrategy",
580
- "requirementCoverage",
581
- "planBodyVerification",
582
- "crossProjectDependencies",
583
- "decisionDrafts",
584
- "skippedAdrCandidates",
585
- "variationPointAnalysis",
586
- "userNarrative"
587
- ],
588
579
  "additionalProperties": false,
580
+ "oneOf": [
581
+ {
582
+ "description": "Legacy implementation-option planning contract.",
583
+ "required": [
584
+ "optionCandidates",
585
+ "tradeoffMatrix",
586
+ "recommendedOption",
587
+ "stageMap",
588
+ "stages",
589
+ "dependencyMigrationRisk",
590
+ "validationChecklist",
591
+ "rollbackStrategy",
592
+ "requirementCoverage",
593
+ "planBodyVerification",
594
+ "crossProjectDependencies",
595
+ "decisionDrafts",
596
+ "skippedAdrCandidates",
597
+ "variationPointAnalysis",
598
+ "userNarrative"
599
+ ],
600
+ "properties": {
601
+ "requirementCoverage": {
602
+ "type": "array",
603
+ "minItems": 1,
604
+ "items": {
605
+ "$ref": "#/$defs/ImplementationRequirementCoverageRow"
606
+ }
607
+ }
608
+ },
609
+ "allOf": [
610
+ {"not": {"required": ["planningContract"]}},
611
+ {"not": {"required": ["outcome"]}},
612
+ {"not": {"required": ["selectedDirectionRef"]}},
613
+ {"not": {"required": ["directionRealization"]}},
614
+ {"not": {"required": ["directionInvalidation"]}},
615
+ {"not": {"required": ["routing"]}},
616
+ {"not": {"required": ["coverageSummary"]}}
617
+ ]
618
+ },
619
+ {
620
+ "description": "A detailed plan for one direction selected by implementation-option-selection.",
621
+ "required": [
622
+ "planningContract",
623
+ "outcome",
624
+ "selectedDirectionRef"
625
+ ],
626
+ "properties": {
627
+ "planningContract": {"const": "selected-direction"}
628
+ },
629
+ "allOf": [
630
+ {"not": {"required": ["optionCandidates"]}},
631
+ {"not": {"required": ["tradeoffMatrix"]}},
632
+ {"not": {"required": ["recommendedOption"]}}
633
+ ],
634
+ "oneOf": [
635
+ {
636
+ "description": "The selected direction is fully realized as an executable plan.",
637
+ "required": [
638
+ "directionRealization",
639
+ "stageMap",
640
+ "stages",
641
+ "designPreparation",
642
+ "dependencyMigrationRisk",
643
+ "validationChecklist",
644
+ "rollbackStrategy",
645
+ "requirementCoverage",
646
+ "coverageSummary",
647
+ "variationPointAnalysis",
648
+ "planBodyVerification"
649
+ ],
650
+ "properties": {
651
+ "outcome": {"const": "plan-ready"},
652
+ "requirementCoverage": {
653
+ "type": "array",
654
+ "minItems": 1,
655
+ "items": {
656
+ "$ref": "#/$defs/SelectedDirectionRequirementCoverage"
657
+ }
658
+ }
659
+ },
660
+ "allOf": [
661
+ {"not": {"required": ["directionInvalidation"]}},
662
+ {"not": {"required": ["routing"]}}
663
+ ]
664
+ },
665
+ {
666
+ "description": "Planning evidence invalidated the selected direction and routes back to option selection.",
667
+ "required": [
668
+ "directionInvalidation",
669
+ "routing"
670
+ ],
671
+ "properties": {
672
+ "outcome": {"const": "direction-invalidated"},
673
+ "routing": {"const": "implementation-option-selection"}
674
+ },
675
+ "allOf": [
676
+ {"not": {"required": ["directionRealization"]}},
677
+ {"not": {"required": ["stageMap"]}},
678
+ {"not": {"required": ["stages"]}},
679
+ {"not": {"required": ["designPreparation"]}},
680
+ {"not": {"required": ["dependencyMigrationRisk"]}},
681
+ {"not": {"required": ["validationChecklist"]}},
682
+ {"not": {"required": ["rollbackStrategy"]}},
683
+ {"not": {"required": ["requirementCoverage"]}},
684
+ {"not": {"required": ["coverageSummary"]}},
685
+ {"not": {"required": ["variationPointAnalysis"]}},
686
+ {"not": {"required": ["planBodyVerification"]}},
687
+ {"not": {"required": ["stepwiseExecution"]}},
688
+ {"not": {"required": ["supersessionLedger"]}},
689
+ {"not": {"required": ["crossProjectDependencies"]}},
690
+ {"not": {"required": ["decisionDrafts"]}},
691
+ {"not": {"required": ["skippedAdrCandidates"]}},
692
+ {"not": {"required": ["incrementalDecision"]}},
693
+ {"not": {"required": ["userNarrative"]}}
694
+ ]
695
+ }
696
+ ]
697
+ }
698
+ ],
589
699
  "properties": {
700
+ "planningContract": {
701
+ "const": "selected-direction"
702
+ },
703
+ "outcome": {
704
+ "enum": [
705
+ "plan-ready",
706
+ "direction-invalidated"
707
+ ]
708
+ },
709
+ "selectedDirectionRef": {
710
+ "$ref": "#/$defs/SelectedDirectionRef"
711
+ },
712
+ "directionRealization": {
713
+ "$ref": "#/$defs/DirectionRealization"
714
+ },
715
+ "directionInvalidation": {
716
+ "$ref": "#/$defs/DirectionInvalidation"
717
+ },
718
+ "routing": {
719
+ "const": "implementation-option-selection"
720
+ },
590
721
  "optionCandidates": {
591
722
  "type": "array",
592
723
  "minItems": 2,
@@ -656,11 +787,10 @@
656
787
  }
657
788
  },
658
789
  "requirementCoverage": {
659
- "type": "array",
660
- "minItems": 1,
661
- "items": {
662
- "$ref": "#/$defs/ImplementationRequirementCoverageRow"
663
- }
790
+ "type": "array"
791
+ },
792
+ "coverageSummary": {
793
+ "$ref": "#/$defs/SelectedDirectionCoverageSummary"
664
794
  },
665
795
  "planBodyVerification": {
666
796
  "$ref": "#/$defs/PlanBodyVerification"
@@ -1374,7 +1504,8 @@
1374
1504
  },
1375
1505
  "routingRecommendation": {
1376
1506
  "type": "string",
1377
- "minLength": 1
1507
+ "minLength": 1,
1508
+ "pattern": "(^|[^A-Za-z-])(release-handoff\\(stage-group\\)|release-handoff|done|implementation|error-analysis|implementation-option-selection|implementation-planning)([^A-Za-z-]|$)"
1378
1509
  },
1379
1510
  "userNarrative": {
1380
1511
  "$ref": "#/$defs/FinalVerificationUserNarrative"
@@ -1446,6 +1577,54 @@
1446
1577
  }
1447
1578
  },
1448
1579
  "allOf": [
1580
+ {
1581
+ "description": "Frontmatter approval input matches the implementation-planning contract.",
1582
+ "if": {
1583
+ "properties": {
1584
+ "implementationPlanning": {
1585
+ "properties": {
1586
+ "planningContract": {
1587
+ "const": "selected-direction"
1588
+ }
1589
+ },
1590
+ "required": [
1591
+ "planningContract"
1592
+ ]
1593
+ }
1594
+ },
1595
+ "required": [
1596
+ "implementationPlanning"
1597
+ ]
1598
+ },
1599
+ "then": {
1600
+ "properties": {
1601
+ "frontmatter": {
1602
+ "required": [
1603
+ "selectedDirectionRef"
1604
+ ],
1605
+ "not": {
1606
+ "required": [
1607
+ "implementationOption"
1608
+ ]
1609
+ }
1610
+ }
1611
+ }
1612
+ },
1613
+ "else": {
1614
+ "properties": {
1615
+ "frontmatter": {
1616
+ "required": [
1617
+ "implementationOption"
1618
+ ],
1619
+ "not": {
1620
+ "required": [
1621
+ "selectedDirectionRef"
1622
+ ]
1623
+ }
1624
+ }
1625
+ }
1626
+ }
1627
+ },
1449
1628
  {
1450
1629
  "description": "requirements-discovery requires a structured requirements block.",
1451
1630
  "if": {
@@ -1629,6 +1808,28 @@
1629
1808
  ]
1630
1809
  }
1631
1810
  },
1811
+ {
1812
+ "description": "implementation-option-selection requires its structured comparison block.",
1813
+ "if": {
1814
+ "properties": {
1815
+ "header": {
1816
+ "properties": {
1817
+ "taskType": {
1818
+ "const": "implementation-option-selection"
1819
+ }
1820
+ }
1821
+ }
1822
+ },
1823
+ "required": [
1824
+ "header"
1825
+ ]
1826
+ },
1827
+ "then": {
1828
+ "required": [
1829
+ "implementationOptionSelection"
1830
+ ]
1831
+ }
1832
+ },
1632
1833
  {
1633
1834
  "description": "implementation-planning task-type requires §5.5 block.",
1634
1835
  "if": {
@@ -1729,6 +1930,7 @@
1729
1930
  "project-analysis",
1730
1931
  "feature-analysis",
1731
1932
  "change-impact-analysis",
1933
+ "implementation-option-selection",
1732
1934
  "implementation-planning",
1733
1935
  "error-analysis",
1734
1936
  "implementation",
@@ -1859,6 +2061,7 @@
1859
2061
  "enum": [
1860
2062
  "requirements-discovery",
1861
2063
  "error-analysis",
2064
+ "implementation-option-selection",
1862
2065
  "implementation-planning",
1863
2066
  "implementation",
1864
2067
  "release-handoff",
@@ -1888,6 +2091,28 @@
1888
2091
  }
1889
2092
  }
1890
2093
  }
2094
+ },
2095
+ {
2096
+ "description": "The implementation-option-selection block is mutually exclusive with every other task deliverable.",
2097
+ "if": {
2098
+ "required": [
2099
+ "implementationOptionSelection"
2100
+ ]
2101
+ },
2102
+ "then": {
2103
+ "allOf": [
2104
+ {"not": {"required": ["requirementsDiscovery"]}},
2105
+ {"not": {"required": ["improvementDiscovery"]}},
2106
+ {"not": {"required": ["errorAnalysis"]}},
2107
+ {"not": {"required": ["projectAnalysis"]}},
2108
+ {"not": {"required": ["featureAnalysis"]}},
2109
+ {"not": {"required": ["changeImpactAnalysis"]}},
2110
+ {"not": {"required": ["implementationPlanning"]}},
2111
+ {"not": {"required": ["implementation"]}},
2112
+ {"not": {"required": ["finalVerification"]}},
2113
+ {"not": {"required": ["releaseHandoff"]}}
2114
+ ]
2115
+ }
1891
2116
  }
1892
2117
  ],
1893
2118
  "oneOf": [
@@ -2311,6 +2536,23 @@
2311
2536
  }
2312
2537
  ]
2313
2538
  },
2539
+ {
2540
+ "required": [
2541
+ "implementationOptionSelection"
2542
+ ],
2543
+ "allOf": [
2544
+ {"not": {"required": ["requirementsDiscovery"]}},
2545
+ {"not": {"required": ["improvementDiscovery"]}},
2546
+ {"not": {"required": ["errorAnalysis"]}},
2547
+ {"not": {"required": ["projectAnalysis"]}},
2548
+ {"not": {"required": ["featureAnalysis"]}},
2549
+ {"not": {"required": ["changeImpactAnalysis"]}},
2550
+ {"not": {"required": ["implementationPlanning"]}},
2551
+ {"not": {"required": ["implementation"]}},
2552
+ {"not": {"required": ["finalVerification"]}},
2553
+ {"not": {"required": ["releaseHandoff"]}}
2554
+ ]
2555
+ },
2314
2556
  {
2315
2557
  "required": [
2316
2558
  "implementationPlanning"
@@ -2519,177 +2761,1221 @@
2519
2761
  ]
2520
2762
  }
2521
2763
  }
2522
- ]
2764
+ ]
2765
+ },
2766
+ {
2767
+ "required": [
2768
+ "releaseHandoff"
2769
+ ],
2770
+ "allOf": [
2771
+ {
2772
+ "not": {
2773
+ "required": [
2774
+ "requirementsDiscovery"
2775
+ ]
2776
+ }
2777
+ },
2778
+ {
2779
+ "not": {
2780
+ "required": [
2781
+ "improvementDiscovery"
2782
+ ]
2783
+ }
2784
+ },
2785
+ {
2786
+ "not": {
2787
+ "required": [
2788
+ "errorAnalysis"
2789
+ ]
2790
+ }
2791
+ },
2792
+ {
2793
+ "not": {
2794
+ "required": [
2795
+ "projectAnalysis"
2796
+ ]
2797
+ }
2798
+ },
2799
+ {
2800
+ "not": {
2801
+ "required": [
2802
+ "featureAnalysis"
2803
+ ]
2804
+ }
2805
+ },
2806
+ {
2807
+ "not": {
2808
+ "required": [
2809
+ "changeImpactAnalysis"
2810
+ ]
2811
+ }
2812
+ },
2813
+ {
2814
+ "not": {
2815
+ "required": [
2816
+ "implementationPlanning"
2817
+ ]
2818
+ }
2819
+ },
2820
+ {
2821
+ "not": {
2822
+ "required": [
2823
+ "implementation"
2824
+ ]
2825
+ }
2826
+ },
2827
+ {
2828
+ "not": {
2829
+ "required": [
2830
+ "finalVerification"
2831
+ ]
2832
+ }
2833
+ }
2834
+ ]
2835
+ }
2836
+ ],
2837
+ "$defs": {
2838
+ "ActivityCommand": {
2839
+ "type": "object",
2840
+ "required": [
2841
+ "command",
2842
+ "cwd",
2843
+ "exitCode",
2844
+ "outputSummary"
2845
+ ],
2846
+ "additionalProperties": false,
2847
+ "properties": {
2848
+ "command": {
2849
+ "type": "string"
2850
+ },
2851
+ "cwd": {
2852
+ "type": "string"
2853
+ },
2854
+ "exitCode": {
2855
+ "type": "integer"
2856
+ },
2857
+ "outputSummary": {
2858
+ "type": "string"
2859
+ }
2860
+ }
2861
+ },
2862
+ "AgentActivityRow": {
2863
+ "type": "object",
2864
+ "required": [
2865
+ "activityId",
2866
+ "kind",
2867
+ "agent",
2868
+ "summary",
2869
+ "planItemIds",
2870
+ "resultPath",
2871
+ "commands",
2872
+ "evidenceRefs",
2873
+ "outcome"
2874
+ ],
2875
+ "additionalProperties": false,
2876
+ "properties": {
2877
+ "activityId": {
2878
+ "type": "string",
2879
+ "pattern": "^A-\\d{3,}$"
2880
+ },
2881
+ "kind": {
2882
+ "type": "string",
2883
+ "enum": [
2884
+ "worker-dispatched",
2885
+ "worker-completed",
2886
+ "verification-round-completed",
2887
+ "self-fix-applied",
2888
+ "user-decision-required",
2889
+ "user-decision-evaluated"
2890
+ ]
2891
+ },
2892
+ "agent": {
2893
+ "type": "string",
2894
+ "minLength": 1
2895
+ },
2896
+ "summary": {
2897
+ "type": "string",
2898
+ "minLength": 1
2899
+ },
2900
+ "planItemIds": {
2901
+ "type": "array",
2902
+ "items": {
2903
+ "type": "string",
2904
+ "minLength": 1
2905
+ }
2906
+ },
2907
+ "resultPath": {
2908
+ "type": "string"
2909
+ },
2910
+ "commands": {
2911
+ "type": "array",
2912
+ "items": {
2913
+ "$ref": "#/$defs/ActivityCommand"
2914
+ }
2915
+ },
2916
+ "evidenceRefs": {
2917
+ "type": "array",
2918
+ "items": {
2919
+ "type": "string",
2920
+ "minLength": 1
2921
+ }
2922
+ },
2923
+ "outcome": {
2924
+ "type": "string",
2925
+ "enum": [
2926
+ "pending",
2927
+ "completed",
2928
+ "failed",
2929
+ "blocked",
2930
+ "resolved"
2931
+ ]
2932
+ }
2933
+ }
2934
+ },
2935
+ "ImplementationOptionSelection": {
2936
+ "type": "object",
2937
+ "description": "Read-only comparison or validation of implementation directions before detailed planning.",
2938
+ "required": [
2939
+ "mode",
2940
+ "decisionContext",
2941
+ "evaluationCriteria",
2942
+ "candidateAudit",
2943
+ "rankedOptions",
2944
+ "recommendedOptionId",
2945
+ "preselectedDirection",
2946
+ "routing",
2947
+ "userNarrative"
2948
+ ],
2949
+ "additionalProperties": false,
2950
+ "properties": {
2951
+ "mode": {
2952
+ "enum": [
2953
+ "candidate-comparison",
2954
+ "preselected-validation"
2955
+ ]
2956
+ },
2957
+ "decisionContext": {
2958
+ "$ref": "#/$defs/ImplementationOptionDecisionContext"
2959
+ },
2960
+ "evaluationCriteria": {
2961
+ "type": "array",
2962
+ "items": {
2963
+ "$ref": "#/$defs/ImplementationOptionEvaluationCriterion"
2964
+ }
2965
+ },
2966
+ "candidateAudit": {
2967
+ "type": "array",
2968
+ "items": {
2969
+ "$ref": "#/$defs/ImplementationOptionCandidateAudit"
2970
+ }
2971
+ },
2972
+ "rankedOptions": {
2973
+ "type": "array",
2974
+ "maxItems": 3,
2975
+ "items": {
2976
+ "$ref": "#/$defs/ImplementationRankedOption"
2977
+ }
2978
+ },
2979
+ "recommendedOptionId": {
2980
+ "type": [
2981
+ "string",
2982
+ "null"
2983
+ ],
2984
+ "pattern": "^IO-[0-9]{3}$"
2985
+ },
2986
+ "preselectedDirection": {
2987
+ "oneOf": [
2988
+ {
2989
+ "type": "null"
2990
+ },
2991
+ {
2992
+ "$ref": "#/$defs/ImplementationOptionPreselectedDirection"
2993
+ }
2994
+ ]
2995
+ },
2996
+ "routing": {
2997
+ "enum": [
2998
+ "pending-direction-selection",
2999
+ "implementation-planning",
3000
+ "blocked"
3001
+ ]
3002
+ },
3003
+ "userNarrative": {
3004
+ "$ref": "#/$defs/ImplementationOptionSelectionUserNarrative"
3005
+ }
3006
+ }
3007
+ },
3008
+ "ImplementationOptionDecisionContext": {
3009
+ "type": "object",
3010
+ "required": [
3011
+ "originalRequirementIds",
3012
+ "leadingCauseRefs",
3013
+ "upstreamDecisionRefs"
3014
+ ],
3015
+ "additionalProperties": false,
3016
+ "properties": {
3017
+ "originalRequirementIds": {
3018
+ "type": "array",
3019
+ "minItems": 1,
3020
+ "uniqueItems": true,
3021
+ "items": {
3022
+ "type": "string",
3023
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
3024
+ }
3025
+ },
3026
+ "leadingCauseRefs": {
3027
+ "type": "array",
3028
+ "uniqueItems": true,
3029
+ "items": {
3030
+ "type": "string",
3031
+ "minLength": 1
3032
+ }
3033
+ },
3034
+ "upstreamDecisionRefs": {
3035
+ "type": "array",
3036
+ "uniqueItems": true,
3037
+ "items": {
3038
+ "type": "string",
3039
+ "minLength": 1
3040
+ }
3041
+ }
3042
+ }
3043
+ },
3044
+ "ImplementationOptionEvaluationCriterion": {
3045
+ "type": "object",
3046
+ "required": [
3047
+ "criterion",
3048
+ "weight",
3049
+ "rationale"
3050
+ ],
3051
+ "additionalProperties": false,
3052
+ "properties": {
3053
+ "criterion": {
3054
+ "$ref": "#/$defs/ImplementationOptionCriterion"
3055
+ },
3056
+ "weight": {
3057
+ "type": "integer",
3058
+ "minimum": 1,
3059
+ "maximum": 5
3060
+ },
3061
+ "rationale": {
3062
+ "type": "string",
3063
+ "minLength": 1
3064
+ }
3065
+ }
3066
+ },
3067
+ "ImplementationOptionCandidateAudit": {
3068
+ "type": "object",
3069
+ "required": [
3070
+ "id",
3071
+ "name",
3072
+ "proposedBy",
3073
+ "goal",
3074
+ "coreMechanism",
3075
+ "architectureBoundaries",
3076
+ "expectedChangeAreas",
3077
+ "disposition",
3078
+ "mergedInto",
3079
+ "reason",
3080
+ "evidence",
3081
+ "requirementCoverage",
3082
+ "scopeCommitments",
3083
+ "coverageSummary",
3084
+ "criterionScores",
3085
+ "weightedScore",
3086
+ "feasibilityVotes",
3087
+ "safetyBlockers",
3088
+ "unresolvedFeasibilityFacts"
3089
+ ],
3090
+ "additionalProperties": false,
3091
+ "properties": {
3092
+ "id": {
3093
+ "$ref": "#/$defs/ImplementationOptionId"
3094
+ },
3095
+ "name": {
3096
+ "type": "string",
3097
+ "minLength": 1
3098
+ },
3099
+ "proposedBy": {
3100
+ "type": "string",
3101
+ "minLength": 1
3102
+ },
3103
+ "goal": {
3104
+ "type": "string",
3105
+ "minLength": 1
3106
+ },
3107
+ "coreMechanism": {
3108
+ "type": "string",
3109
+ "minLength": 1
3110
+ },
3111
+ "architectureBoundaries": {
3112
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
3113
+ },
3114
+ "expectedChangeAreas": {
3115
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
3116
+ },
3117
+ "disposition": {
3118
+ "enum": [
3119
+ "merged",
3120
+ "rejected"
3121
+ ]
3122
+ },
3123
+ "mergedInto": {
3124
+ "type": [
3125
+ "string",
3126
+ "null"
3127
+ ],
3128
+ "pattern": "^IO-[0-9]{3}$"
3129
+ },
3130
+ "reason": {
3131
+ "type": "string",
3132
+ "minLength": 1
3133
+ },
3134
+ "evidence": {
3135
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3136
+ },
3137
+ "requirementCoverage": {
3138
+ "type": "array",
3139
+ "minItems": 1,
3140
+ "items": {
3141
+ "$ref": "#/$defs/ImplementationOptionRequirementCoverage"
3142
+ }
3143
+ },
3144
+ "scopeCommitments": {
3145
+ "type": "array",
3146
+ "minItems": 1,
3147
+ "items": {
3148
+ "$ref": "#/$defs/ImplementationOptionScopeCommitment"
3149
+ }
3150
+ },
3151
+ "coverageSummary": {
3152
+ "$ref": "#/$defs/ImplementationOptionCoverageSummary"
3153
+ },
3154
+ "criterionScores": {
3155
+ "type": "array",
3156
+ "minItems": 1,
3157
+ "items": {
3158
+ "$ref": "#/$defs/ImplementationOptionCriterionScore"
3159
+ }
3160
+ },
3161
+ "weightedScore": {
3162
+ "type": "number",
3163
+ "minimum": 1,
3164
+ "maximum": 5
3165
+ },
3166
+ "feasibilityVotes": {
3167
+ "type": "array",
3168
+ "minItems": 1,
3169
+ "items": {
3170
+ "$ref": "#/$defs/ImplementationOptionFeasibilityVote"
3171
+ }
3172
+ },
3173
+ "safetyBlockers": {
3174
+ "type": "array",
3175
+ "items": {
3176
+ "$ref": "#/$defs/ImplementationOptionSafetyBlocker"
3177
+ }
3178
+ },
3179
+ "unresolvedFeasibilityFacts": {
3180
+ "type": "array",
3181
+ "items": {
3182
+ "$ref": "#/$defs/ImplementationOptionUnresolvedFact"
3183
+ }
3184
+ }
3185
+ }
3186
+ },
3187
+ "ImplementationRankedOption": {
3188
+ "type": "object",
3189
+ "required": [
3190
+ "id",
3191
+ "name",
3192
+ "proposedBy",
3193
+ "goal",
3194
+ "coreMechanism",
3195
+ "architectureBoundaries",
3196
+ "expectedChangeAreas",
3197
+ "codeEvidence",
3198
+ "requirementCoverage",
3199
+ "scopeCommitments",
3200
+ "coverageSummary",
3201
+ "criterionScores",
3202
+ "weightedScore",
3203
+ "feasibilityVotes",
3204
+ "safetyBlockers",
3205
+ "unresolvedFeasibilityFacts",
3206
+ "planningInvariants"
3207
+ ],
3208
+ "additionalProperties": false,
3209
+ "properties": {
3210
+ "id": {
3211
+ "$ref": "#/$defs/ImplementationOptionId"
3212
+ },
3213
+ "name": {
3214
+ "type": "string",
3215
+ "minLength": 1,
3216
+ "pattern": "^(?![\\s\\S]*[\\r\\n])(?=[\\s\\S]*[^\\u0009\\u000a\\u000b\\u000c\\u000d\\u001c\\u001d\\u001e\\u001f\\u0020\\u0085\\u00a0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff])[\\s\\S]+$"
3217
+ },
3218
+ "proposedBy": {
3219
+ "type": "string",
3220
+ "minLength": 1
3221
+ },
3222
+ "goal": {
3223
+ "type": "string",
3224
+ "minLength": 1
3225
+ },
3226
+ "coreMechanism": {
3227
+ "type": "string",
3228
+ "minLength": 1
3229
+ },
3230
+ "architectureBoundaries": {
3231
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
3232
+ },
3233
+ "expectedChangeAreas": {
3234
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
3235
+ },
3236
+ "codeEvidence": {
3237
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3238
+ },
3239
+ "requirementCoverage": {
3240
+ "type": "array",
3241
+ "minItems": 1,
3242
+ "items": {
3243
+ "$ref": "#/$defs/ImplementationOptionRequirementCoverage"
3244
+ }
3245
+ },
3246
+ "scopeCommitments": {
3247
+ "type": "array",
3248
+ "minItems": 1,
3249
+ "items": {
3250
+ "$ref": "#/$defs/ImplementationOptionScopeCommitment"
3251
+ }
3252
+ },
3253
+ "coverageSummary": {
3254
+ "$ref": "#/$defs/ImplementationOptionExactCoverageSummary"
3255
+ },
3256
+ "criterionScores": {
3257
+ "type": "array",
3258
+ "minItems": 1,
3259
+ "items": {
3260
+ "$ref": "#/$defs/ImplementationOptionCriterionScore"
3261
+ }
3262
+ },
3263
+ "weightedScore": {
3264
+ "type": "number",
3265
+ "minimum": 1,
3266
+ "maximum": 5
3267
+ },
3268
+ "feasibilityVotes": {
3269
+ "type": "array",
3270
+ "minItems": 1,
3271
+ "items": {
3272
+ "$ref": "#/$defs/ImplementationOptionFeasibilityVote"
3273
+ }
3274
+ },
3275
+ "safetyBlockers": {
3276
+ "type": "array",
3277
+ "items": {
3278
+ "$ref": "#/$defs/ImplementationOptionSafetyBlocker"
3279
+ }
3280
+ },
3281
+ "unresolvedFeasibilityFacts": {
3282
+ "type": "array",
3283
+ "items": {
3284
+ "$ref": "#/$defs/ImplementationOptionUnresolvedFact"
3285
+ }
3286
+ },
3287
+ "planningInvariants": {
3288
+ "type": "array",
3289
+ "items": {
3290
+ "$ref": "#/$defs/ImplementationOptionPlanningInvariant"
3291
+ }
3292
+ }
3293
+ }
3294
+ },
3295
+ "ImplementationOptionRequirementCoverage": {
3296
+ "type": "object",
3297
+ "required": [
3298
+ "requirementId",
3299
+ "satisfaction",
3300
+ "evidence",
3301
+ "expectedVerification",
3302
+ "status"
3303
+ ],
3304
+ "additionalProperties": false,
3305
+ "properties": {
3306
+ "requirementId": {
3307
+ "type": "string",
3308
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
3309
+ },
3310
+ "satisfaction": {
3311
+ "type": "string",
3312
+ "minLength": 1
3313
+ },
3314
+ "evidence": {
3315
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3316
+ },
3317
+ "expectedVerification": {
3318
+ "type": "string",
3319
+ "minLength": 1
3320
+ },
3321
+ "status": {
3322
+ "enum": [
3323
+ "covered",
3324
+ "not-covered",
3325
+ "contradicted"
3326
+ ]
3327
+ }
3328
+ }
3329
+ },
3330
+ "ImplementationOptionScopeCommitment": {
3331
+ "type": "object",
3332
+ "required": [
3333
+ "id",
3334
+ "commitment",
3335
+ "kind",
3336
+ "requirementIds",
3337
+ "evidence"
3338
+ ],
3339
+ "additionalProperties": false,
3340
+ "properties": {
3341
+ "id": {
3342
+ "type": "string",
3343
+ "pattern": "^IC-[0-9]{3}$"
3344
+ },
3345
+ "commitment": {
3346
+ "type": "string",
3347
+ "minLength": 1
3348
+ },
3349
+ "kind": {
3350
+ "enum": [
3351
+ "user-behavior",
3352
+ "code-change",
3353
+ "migration",
3354
+ "operational-change",
3355
+ "preserved-behavior",
3356
+ "derived-work"
3357
+ ]
3358
+ },
3359
+ "requirementIds": {
3360
+ "type": "array",
3361
+ "minItems": 1,
3362
+ "uniqueItems": true,
3363
+ "items": {
3364
+ "type": "string",
3365
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
3366
+ }
3367
+ },
3368
+ "evidence": {
3369
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3370
+ }
3371
+ }
3372
+ },
3373
+ "ImplementationOptionCoverageSummary": {
3374
+ "type": "object",
3375
+ "required": [
3376
+ "coveragePercent",
3377
+ "scopePrecisionPercent",
3378
+ "coveredCount",
3379
+ "totalCount",
3380
+ "unmappedCommitments",
3381
+ "contradictedRequirements",
3382
+ "coverageVerdict"
3383
+ ],
3384
+ "additionalProperties": false,
3385
+ "properties": {
3386
+ "coveragePercent": {
3387
+ "type": "number",
3388
+ "minimum": 0,
3389
+ "maximum": 100
3390
+ },
3391
+ "scopePrecisionPercent": {
3392
+ "type": "number",
3393
+ "minimum": 0,
3394
+ "maximum": 100
3395
+ },
3396
+ "coveredCount": {
3397
+ "type": "integer",
3398
+ "minimum": 0
3399
+ },
3400
+ "totalCount": {
3401
+ "type": "integer",
3402
+ "minimum": 1
3403
+ },
3404
+ "unmappedCommitments": {
3405
+ "type": "array",
3406
+ "uniqueItems": true,
3407
+ "items": {
3408
+ "type": "string",
3409
+ "pattern": "^IC-[0-9]{3}$"
3410
+ }
3411
+ },
3412
+ "contradictedRequirements": {
3413
+ "type": "array",
3414
+ "uniqueItems": true,
3415
+ "items": {
3416
+ "type": "string",
3417
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
3418
+ }
3419
+ },
3420
+ "coverageVerdict": {
3421
+ "enum": [
3422
+ "exact",
3423
+ "under",
3424
+ "over",
3425
+ "contradicted"
3426
+ ]
3427
+ }
3428
+ }
3429
+ },
3430
+ "ImplementationOptionExactCoverageSummary": {
3431
+ "type": "object",
3432
+ "required": [
3433
+ "coveragePercent",
3434
+ "scopePrecisionPercent",
3435
+ "coveredCount",
3436
+ "totalCount",
3437
+ "unmappedCommitments",
3438
+ "contradictedRequirements",
3439
+ "coverageVerdict"
3440
+ ],
3441
+ "additionalProperties": false,
3442
+ "properties": {
3443
+ "coveragePercent": {
3444
+ "const": 100
3445
+ },
3446
+ "scopePrecisionPercent": {
3447
+ "const": 100
3448
+ },
3449
+ "coveredCount": {
3450
+ "type": "integer",
3451
+ "minimum": 1
3452
+ },
3453
+ "totalCount": {
3454
+ "type": "integer",
3455
+ "minimum": 1
3456
+ },
3457
+ "unmappedCommitments": {
3458
+ "type": "array",
3459
+ "maxItems": 0
3460
+ },
3461
+ "contradictedRequirements": {
3462
+ "type": "array",
3463
+ "maxItems": 0
3464
+ },
3465
+ "coverageVerdict": {
3466
+ "const": "exact"
3467
+ }
3468
+ }
3469
+ },
3470
+ "ImplementationOptionCriterionScore": {
3471
+ "type": "object",
3472
+ "required": [
3473
+ "criterion",
3474
+ "score",
3475
+ "rationale"
3476
+ ],
3477
+ "additionalProperties": false,
3478
+ "properties": {
3479
+ "criterion": {
3480
+ "$ref": "#/$defs/ImplementationOptionCriterion"
3481
+ },
3482
+ "score": {
3483
+ "type": "integer",
3484
+ "minimum": 1,
3485
+ "maximum": 5
3486
+ },
3487
+ "rationale": {
3488
+ "type": "string",
3489
+ "minLength": 1
3490
+ }
3491
+ }
3492
+ },
3493
+ "ImplementationOptionFeasibilityVote": {
3494
+ "type": "object",
3495
+ "required": [
3496
+ "worker",
3497
+ "verdict",
3498
+ "rationale",
3499
+ "counterevidence",
3500
+ "evidence"
3501
+ ],
3502
+ "additionalProperties": false,
3503
+ "properties": {
3504
+ "worker": {
3505
+ "type": "string",
3506
+ "minLength": 1
3507
+ },
3508
+ "verdict": {
3509
+ "enum": [
3510
+ "feasible",
3511
+ "not-feasible",
3512
+ "uncertain"
3513
+ ]
3514
+ },
3515
+ "rationale": {
3516
+ "type": "string",
3517
+ "minLength": 1
3518
+ },
3519
+ "counterevidence": {
3520
+ "type": "string",
3521
+ "minLength": 1
3522
+ },
3523
+ "evidence": {
3524
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3525
+ }
3526
+ }
3527
+ },
3528
+ "ImplementationOptionSafetyBlocker": {
3529
+ "type": "object",
3530
+ "required": [
3531
+ "category",
3532
+ "statement",
3533
+ "evidence"
3534
+ ],
3535
+ "additionalProperties": false,
3536
+ "properties": {
3537
+ "category": {
3538
+ "enum": [
3539
+ "data-loss",
3540
+ "security-violation",
3541
+ "irreversible-migration"
3542
+ ]
3543
+ },
3544
+ "statement": {
3545
+ "type": "string",
3546
+ "minLength": 1
3547
+ },
3548
+ "evidence": {
3549
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3550
+ }
3551
+ }
3552
+ },
3553
+ "ImplementationOptionUnresolvedFact": {
3554
+ "type": "object",
3555
+ "required": [
3556
+ "fact",
3557
+ "whyItMatters",
3558
+ "evidence"
3559
+ ],
3560
+ "additionalProperties": false,
3561
+ "properties": {
3562
+ "fact": {
3563
+ "type": "string",
3564
+ "minLength": 1
3565
+ },
3566
+ "whyItMatters": {
3567
+ "type": "string",
3568
+ "minLength": 1
3569
+ },
3570
+ "evidence": {
3571
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3572
+ }
3573
+ }
3574
+ },
3575
+ "ImplementationOptionPlanningInvariant": {
3576
+ "type": "object",
3577
+ "required": [
3578
+ "id",
3579
+ "statement",
3580
+ "requirementIds",
3581
+ "evidence"
3582
+ ],
3583
+ "additionalProperties": false,
3584
+ "properties": {
3585
+ "id": {
3586
+ "type": "string",
3587
+ "pattern": "^PI-[0-9]{3}$"
3588
+ },
3589
+ "statement": {
3590
+ "type": "string",
3591
+ "minLength": 1
3592
+ },
3593
+ "requirementIds": {
3594
+ "type": "array",
3595
+ "minItems": 1,
3596
+ "uniqueItems": true,
3597
+ "items": {
3598
+ "type": "string",
3599
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
3600
+ }
3601
+ },
3602
+ "evidence": {
3603
+ "$ref": "#/$defs/ImplementationOptionEvidenceRefs"
3604
+ }
3605
+ }
3606
+ },
3607
+ "ImplementationOptionPreselectedDirection": {
3608
+ "type": "object",
3609
+ "required": [
3610
+ "optionId",
3611
+ "direction",
3612
+ "confirmationEvidence",
3613
+ "citation"
3614
+ ],
3615
+ "additionalProperties": false,
3616
+ "properties": {
3617
+ "optionId": {
3618
+ "$ref": "#/$defs/ImplementationOptionId"
3619
+ },
3620
+ "direction": {
3621
+ "type": "string",
3622
+ "minLength": 1
3623
+ },
3624
+ "confirmationEvidence": {
3625
+ "type": "string",
3626
+ "minLength": 1
3627
+ },
3628
+ "citation": {
3629
+ "type": "string",
3630
+ "minLength": 1
3631
+ }
3632
+ }
3633
+ },
3634
+ "ImplementationOptionSelectionUserNarrative": {
3635
+ "type": "object",
3636
+ "required": [
3637
+ "comparisonOverview",
3638
+ "rankingExplanation",
3639
+ "selectionGuidance"
3640
+ ],
3641
+ "additionalProperties": false,
3642
+ "properties": {
3643
+ "comparisonOverview": {
3644
+ "$ref": "#/$defs/HumanNarrative"
3645
+ },
3646
+ "rankingExplanation": {
3647
+ "$ref": "#/$defs/HumanNarrative"
3648
+ },
3649
+ "selectionGuidance": {
3650
+ "$ref": "#/$defs/HumanNarrative"
3651
+ }
3652
+ }
3653
+ },
3654
+ "ImplementationOptionId": {
3655
+ "type": "string",
3656
+ "pattern": "^IO-[0-9]{3}$"
3657
+ },
3658
+ "ImplementationOptionCriterion": {
3659
+ "enum": [
3660
+ "requirement-fit",
3661
+ "architecture-fit",
3662
+ "change-locality",
3663
+ "implementation-complexity",
3664
+ "correctness-risk",
3665
+ "reversibility",
3666
+ "verification-cost",
3667
+ "rollout-cost"
3668
+ ]
3669
+ },
3670
+ "ImplementationOptionEvidenceRefs": {
3671
+ "type": "array",
3672
+ "minItems": 1,
3673
+ "items": {
3674
+ "type": "string",
3675
+ "minLength": 1
3676
+ }
3677
+ },
3678
+ "ImplementationOptionNonEmptyStrings": {
3679
+ "type": "array",
3680
+ "minItems": 1,
3681
+ "items": {
3682
+ "type": "string",
3683
+ "minLength": 1
3684
+ }
3685
+ },
3686
+ "SelectedDirectionRef": {
3687
+ "type": "object",
3688
+ "required": [
3689
+ "sourceReport",
3690
+ "sourceDataSha256",
3691
+ "optionId",
3692
+ "snapshotPath",
3693
+ "snapshotSha256"
3694
+ ],
3695
+ "additionalProperties": false,
3696
+ "properties": {
3697
+ "sourceReport": {
3698
+ "type": "string",
3699
+ "minLength": 1
3700
+ },
3701
+ "sourceDataSha256": {
3702
+ "type": "string",
3703
+ "pattern": "^[0-9a-f]{64}$"
3704
+ },
3705
+ "optionId": {
3706
+ "$ref": "#/$defs/ImplementationOptionId"
3707
+ },
3708
+ "snapshotPath": {
3709
+ "type": "string",
3710
+ "minLength": 1
3711
+ },
3712
+ "snapshotSha256": {
3713
+ "type": "string",
3714
+ "pattern": "^[0-9a-f]{64}$"
3715
+ }
3716
+ }
2523
3717
  },
2524
- {
3718
+ "DirectionRealization": {
3719
+ "type": "object",
2525
3720
  "required": [
2526
- "releaseHandoff"
3721
+ "goal",
3722
+ "coreMechanism",
3723
+ "architectureBoundaries",
3724
+ "expectedChangeAreas",
3725
+ "fileStructure",
3726
+ "interfaces",
3727
+ "blastRadius",
3728
+ "testSeams",
3729
+ "assumptions",
3730
+ "planningInvariants",
3731
+ "userConstraints"
2527
3732
  ],
2528
- "allOf": [
2529
- {
2530
- "not": {
2531
- "required": [
2532
- "requirementsDiscovery"
2533
- ]
2534
- }
3733
+ "additionalProperties": false,
3734
+ "properties": {
3735
+ "goal": {
3736
+ "type": "string",
3737
+ "minLength": 1
2535
3738
  },
2536
- {
2537
- "not": {
2538
- "required": [
2539
- "improvementDiscovery"
2540
- ]
2541
- }
3739
+ "coreMechanism": {
3740
+ "type": "string",
3741
+ "minLength": 1
2542
3742
  },
2543
- {
2544
- "not": {
2545
- "required": [
2546
- "errorAnalysis"
2547
- ]
2548
- }
3743
+ "architectureBoundaries": {
3744
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
2549
3745
  },
2550
- {
2551
- "not": {
2552
- "required": [
2553
- "projectAnalysis"
2554
- ]
2555
- }
3746
+ "expectedChangeAreas": {
3747
+ "$ref": "#/$defs/ImplementationOptionNonEmptyStrings"
2556
3748
  },
2557
- {
2558
- "not": {
2559
- "required": [
2560
- "featureAnalysis"
2561
- ]
3749
+ "fileStructure": {
3750
+ "type": "array",
3751
+ "minItems": 1,
3752
+ "items": {
3753
+ "$ref": "#/$defs/SelectedDirectionFileChange"
2562
3754
  }
2563
3755
  },
2564
- {
2565
- "not": {
2566
- "required": [
2567
- "changeImpactAnalysis"
2568
- ]
3756
+ "interfaces": {
3757
+ "type": "string",
3758
+ "minLength": 1
3759
+ },
3760
+ "blastRadius": {
3761
+ "type": "string",
3762
+ "minLength": 1
3763
+ },
3764
+ "testSeams": {
3765
+ "type": "array",
3766
+ "items": {
3767
+ "$ref": "#/$defs/SelectedDirectionTestSeam"
2569
3768
  }
2570
3769
  },
2571
- {
2572
- "not": {
2573
- "required": [
2574
- "implementationPlanning"
2575
- ]
3770
+ "assumptions": {
3771
+ "type": "array",
3772
+ "items": {
3773
+ "type": "string",
3774
+ "minLength": 1
2576
3775
  }
2577
3776
  },
2578
- {
2579
- "not": {
2580
- "required": [
2581
- "implementation"
2582
- ]
3777
+ "planningInvariants": {
3778
+ "type": "array",
3779
+ "items": {
3780
+ "$ref": "#/$defs/ImplementationOptionPlanningInvariant"
2583
3781
  }
2584
3782
  },
2585
- {
2586
- "not": {
2587
- "required": [
2588
- "finalVerification"
2589
- ]
3783
+ "userConstraints": {
3784
+ "type": "array",
3785
+ "items": {
3786
+ "type": "string",
3787
+ "minLength": 1
2590
3788
  }
2591
3789
  }
2592
- ]
2593
- }
2594
- ],
2595
- "$defs": {
2596
- "ActivityCommand": {
3790
+ }
3791
+ },
3792
+ "SelectedDirectionFileChange": {
2597
3793
  "type": "object",
2598
3794
  "required": [
2599
- "command",
2600
- "cwd",
2601
- "exitCode",
2602
- "outputSummary"
3795
+ "id",
3796
+ "ticketId",
3797
+ "action",
3798
+ "path",
3799
+ "summary"
2603
3800
  ],
2604
3801
  "additionalProperties": false,
2605
3802
  "properties": {
2606
- "command": {
2607
- "type": "string"
3803
+ "id": {
3804
+ "type": "string",
3805
+ "pattern": "^OF-\\d{3,}$"
2608
3806
  },
2609
- "cwd": {
2610
- "type": "string"
3807
+ "ticketId": {
3808
+ "$ref": "#/$defs/TicketId"
2611
3809
  },
2612
- "exitCode": {
2613
- "type": "integer"
3810
+ "action": {
3811
+ "enum": [
3812
+ "Create",
3813
+ "Modify",
3814
+ "Delete"
3815
+ ]
2614
3816
  },
2615
- "outputSummary": {
2616
- "type": "string"
3817
+ "path": {
3818
+ "type": "string",
3819
+ "minLength": 1
3820
+ },
3821
+ "summary": {
3822
+ "type": "string",
3823
+ "minLength": 1,
3824
+ "maxLength": 120
3825
+ },
3826
+ "details": {
3827
+ "type": "string",
3828
+ "minLength": 1
2617
3829
  }
2618
3830
  }
2619
3831
  },
2620
- "AgentActivityRow": {
3832
+ "SelectedDirectionTestSeam": {
2621
3833
  "type": "object",
2622
3834
  "required": [
2623
- "activityId",
2624
- "kind",
2625
- "agent",
2626
- "summary",
2627
- "planItemIds",
2628
- "resultPath",
2629
- "commands",
2630
- "evidenceRefs",
2631
- "outcome"
3835
+ "boundary",
3836
+ "injectedAs",
3837
+ "replacedInTest"
2632
3838
  ],
2633
3839
  "additionalProperties": false,
2634
3840
  "properties": {
2635
- "activityId": {
2636
- "type": "string",
2637
- "pattern": "^A-\\d{3,}$"
2638
- },
2639
- "kind": {
3841
+ "boundary": {
2640
3842
  "type": "string",
2641
- "enum": [
2642
- "worker-dispatched",
2643
- "worker-completed",
2644
- "verification-round-completed",
2645
- "self-fix-applied",
2646
- "user-decision-required",
2647
- "user-decision-evaluated"
2648
- ]
3843
+ "minLength": 1
2649
3844
  },
2650
- "agent": {
3845
+ "injectedAs": {
2651
3846
  "type": "string",
2652
3847
  "minLength": 1
2653
3848
  },
2654
- "summary": {
3849
+ "replacedInTest": {
2655
3850
  "type": "string",
2656
3851
  "minLength": 1
3852
+ }
3853
+ }
3854
+ },
3855
+ "SelectedDirectionRequirementCoverage": {
3856
+ "type": "object",
3857
+ "required": [
3858
+ "originalRequirementId",
3859
+ "stageRefs",
3860
+ "stepRefs",
3861
+ "validationRefs",
3862
+ "fileRefs",
3863
+ "status"
3864
+ ],
3865
+ "additionalProperties": false,
3866
+ "properties": {
3867
+ "originalRequirementId": {
3868
+ "type": "string",
3869
+ "pattern": "^(EB|PB|EO)-[0-9]{3}$"
2657
3870
  },
2658
- "planItemIds": {
3871
+ "stageRefs": {
3872
+ "type": "array",
3873
+ "minItems": 1,
3874
+ "uniqueItems": true,
3875
+ "items": {
3876
+ "type": "integer",
3877
+ "minimum": 1
3878
+ }
3879
+ },
3880
+ "stepRefs": {
2659
3881
  "type": "array",
3882
+ "minItems": 1,
3883
+ "uniqueItems": true,
2660
3884
  "items": {
2661
3885
  "type": "string",
2662
3886
  "minLength": 1
2663
3887
  }
2664
3888
  },
2665
- "resultPath": {
2666
- "type": "string"
2667
- },
2668
- "commands": {
3889
+ "validationRefs": {
2669
3890
  "type": "array",
3891
+ "minItems": 1,
3892
+ "uniqueItems": true,
2670
3893
  "items": {
2671
- "$ref": "#/$defs/ActivityCommand"
3894
+ "type": "string",
3895
+ "minLength": 1
2672
3896
  }
2673
3897
  },
2674
- "evidenceRefs": {
3898
+ "fileRefs": {
2675
3899
  "type": "array",
3900
+ "minItems": 1,
3901
+ "uniqueItems": true,
2676
3902
  "items": {
2677
3903
  "type": "string",
2678
3904
  "minLength": 1
2679
3905
  }
2680
3906
  },
2681
- "outcome": {
2682
- "type": "string",
3907
+ "status": {
2683
3908
  "enum": [
2684
- "pending",
2685
- "completed",
2686
- "failed",
2687
- "blocked",
2688
- "resolved"
3909
+ "covered",
3910
+ "not-covered"
2689
3911
  ]
2690
3912
  }
2691
3913
  }
2692
3914
  },
3915
+ "SelectedDirectionCoverageSummary": {
3916
+ "type": "object",
3917
+ "required": [
3918
+ "coveragePercent",
3919
+ "scopePrecisionPercent",
3920
+ "coverageVerdict",
3921
+ "unmappedStages",
3922
+ "unmappedFileChanges"
3923
+ ],
3924
+ "additionalProperties": false,
3925
+ "properties": {
3926
+ "coveragePercent": {
3927
+ "const": 100
3928
+ },
3929
+ "scopePrecisionPercent": {
3930
+ "const": 100
3931
+ },
3932
+ "coverageVerdict": {
3933
+ "const": "exact"
3934
+ },
3935
+ "unmappedStages": {
3936
+ "type": "array",
3937
+ "maxItems": 0,
3938
+ "items": {
3939
+ "type": "integer",
3940
+ "minimum": 1
3941
+ }
3942
+ },
3943
+ "unmappedFileChanges": {
3944
+ "type": "array",
3945
+ "maxItems": 0,
3946
+ "items": {
3947
+ "type": "string",
3948
+ "minLength": 1
3949
+ }
3950
+ }
3951
+ }
3952
+ },
3953
+ "DirectionInvalidation": {
3954
+ "type": "object",
3955
+ "required": [
3956
+ "reasons",
3957
+ "codeEvidence"
3958
+ ],
3959
+ "additionalProperties": false,
3960
+ "properties": {
3961
+ "reasons": {
3962
+ "type": "array",
3963
+ "minItems": 1,
3964
+ "items": {
3965
+ "type": "string",
3966
+ "minLength": 1
3967
+ }
3968
+ },
3969
+ "codeEvidence": {
3970
+ "type": "array",
3971
+ "minItems": 1,
3972
+ "items": {
3973
+ "type": "string",
3974
+ "minLength": 1
3975
+ }
3976
+ }
3977
+ }
3978
+ },
2693
3979
  "TaskType": {
2694
3980
  "enum": [
2695
3981
  "requirements-discovery",
@@ -2698,6 +3984,7 @@
2698
3984
  "project-analysis",
2699
3985
  "feature-analysis",
2700
3986
  "change-impact-analysis",
3987
+ "implementation-option-selection",
2701
3988
  "implementation-planning",
2702
3989
  "implementation",
2703
3990
  "final-verification",
@@ -3205,7 +4492,7 @@
3205
4492
  "nextTaskType": {
3206
4493
  "enum": [
3207
4494
  "error-analysis",
3208
- "implementation-planning"
4495
+ "implementation-option-selection"
3209
4496
  ]
3210
4497
  },
3211
4498
  "readyWhen": {
@@ -3334,7 +4621,7 @@
3334
4621
  "recommendedNextPhase": {
3335
4622
  "enum": [
3336
4623
  "requirements-discovery",
3337
- "implementation-planning",
4624
+ "implementation-option-selection",
3338
4625
  "error-analysis"
3339
4626
  ]
3340
4627
  },
@@ -3428,6 +4715,7 @@
3428
4715
  "Direction": {
3429
4716
  "enum": [
3430
4717
  "continue-investigation",
4718
+ "begin-option-selection",
3431
4719
  "begin-planning",
3432
4720
  "begin-implementation",
3433
4721
  "approve",
@@ -3576,7 +4864,7 @@
3576
4864
  "nextTaskType": {
3577
4865
  "enum": [
3578
4866
  "error-analysis",
3579
- "implementation-planning"
4867
+ "implementation-option-selection"
3580
4868
  ]
3581
4869
  },
3582
4870
  "leadingCauseId": {
@@ -8256,8 +9544,11 @@
8256
9544
  "minLength": 1
8257
9545
  },
8258
9546
  "followUpPhase": {
8259
- "type": "string",
8260
- "minLength": 1
9547
+ "enum": [
9548
+ "error-analysis",
9549
+ "implementation-option-selection",
9550
+ "implementation-planning"
9551
+ ]
8261
9552
  }
8262
9553
  }
8263
9554
  },