codex-workflow-v2 2.0.0-beta.2 → 2.0.0-beta.4

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 (128) hide show
  1. package/README.md +35 -2
  2. package/dist/src/alpha6/adoption.js +13 -3
  3. package/dist/src/alpha6/adoption.js.map +1 -1
  4. package/dist/src/alpha6/handoff.d.ts +21 -0
  5. package/dist/src/alpha6/handoff.js +100 -19
  6. package/dist/src/alpha6/handoff.js.map +1 -1
  7. package/dist/src/alpha6/milestone.d.ts +2 -0
  8. package/dist/src/alpha6/milestone.js +15 -0
  9. package/dist/src/alpha6/milestone.js.map +1 -1
  10. package/dist/src/alpha6/plan-risk.d.ts +1 -0
  11. package/dist/src/alpha6/plan-risk.js +6 -0
  12. package/dist/src/alpha6/plan-risk.js.map +1 -1
  13. package/dist/src/cli.js +188 -65
  14. package/dist/src/cli.js.map +1 -1
  15. package/dist/src/contracts.d.ts +111 -5
  16. package/dist/src/contracts.js +1 -1
  17. package/dist/src/credential-output.d.ts +10 -0
  18. package/dist/src/credential-output.js +73 -0
  19. package/dist/src/credential-output.js.map +1 -0
  20. package/dist/src/errors.d.ts +1 -1
  21. package/dist/src/errors.js.map +1 -1
  22. package/dist/src/index.d.ts +1 -1
  23. package/dist/src/index.js +1 -1
  24. package/dist/src/index.js.map +1 -1
  25. package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
  26. package/dist/src/lifecycle/canonical-hash.js +24 -0
  27. package/dist/src/lifecycle/canonical-hash.js.map +1 -0
  28. package/dist/src/lifecycle/catalog.d.ts +26 -0
  29. package/dist/src/lifecycle/catalog.js +208 -0
  30. package/dist/src/lifecycle/catalog.js.map +1 -0
  31. package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
  32. package/dist/src/lifecycle/compiler-inspection.js +29 -0
  33. package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
  34. package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
  35. package/dist/src/lifecycle/core-static-readiness.js +130 -0
  36. package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
  37. package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
  38. package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
  39. package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
  40. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
  41. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
  42. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
  43. package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
  44. package/dist/src/lifecycle/corrective-replan-credential-core.js +534 -0
  45. package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
  46. package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
  47. package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
  48. package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
  49. package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
  50. package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
  51. package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
  52. package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
  53. package/dist/src/lifecycle/corrective-replan.js +548 -0
  54. package/dist/src/lifecycle/corrective-replan.js.map +1 -0
  55. package/dist/src/lifecycle/evaluator.d.ts +2 -0
  56. package/dist/src/lifecycle/evaluator.js +35 -0
  57. package/dist/src/lifecycle/evaluator.js.map +1 -0
  58. package/dist/src/lifecycle/fingerprint.d.ts +31 -0
  59. package/dist/src/lifecycle/fingerprint.js +388 -0
  60. package/dist/src/lifecycle/fingerprint.js.map +1 -0
  61. package/dist/src/lifecycle/immutable.d.ts +1 -0
  62. package/dist/src/lifecycle/immutable.js +10 -0
  63. package/dist/src/lifecycle/immutable.js.map +1 -0
  64. package/dist/src/lifecycle/implementation-table.d.ts +29 -0
  65. package/dist/src/lifecycle/implementation-table.js +87 -0
  66. package/dist/src/lifecycle/implementation-table.js.map +1 -0
  67. package/dist/src/lifecycle/index.d.ts +4 -0
  68. package/dist/src/lifecycle/index.js +5 -0
  69. package/dist/src/lifecycle/index.js.map +1 -0
  70. package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
  71. package/dist/src/lifecycle/schema-artifact.js +214 -0
  72. package/dist/src/lifecycle/schema-artifact.js.map +1 -0
  73. package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
  74. package/dist/src/lifecycle/semantic-registry.js +489 -0
  75. package/dist/src/lifecycle/semantic-registry.js.map +1 -0
  76. package/dist/src/lifecycle/types.d.ts +718 -0
  77. package/dist/src/lifecycle/types.js +4 -0
  78. package/dist/src/lifecycle/types.js.map +1 -0
  79. package/dist/src/observation.d.ts +20 -0
  80. package/dist/src/observation.js +171 -0
  81. package/dist/src/observation.js.map +1 -0
  82. package/dist/src/state/corrective-replan-executor.d.ts +64 -0
  83. package/dist/src/state/corrective-replan-executor.js +598 -0
  84. package/dist/src/state/corrective-replan-executor.js.map +1 -0
  85. package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
  86. package/dist/src/state/corrective-replan-public-schema.js +43 -0
  87. package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
  88. package/dist/src/state/corrective-replan-public.d.ts +95 -0
  89. package/dist/src/state/corrective-replan-public.js +618 -0
  90. package/dist/src/state/corrective-replan-public.js.map +1 -0
  91. package/dist/src/state/corrective-replan-transaction.d.ts +158 -0
  92. package/dist/src/state/corrective-replan-transaction.js +723 -0
  93. package/dist/src/state/corrective-replan-transaction.js.map +1 -0
  94. package/dist/src/state/corrective-yield-executor.d.ts +31 -0
  95. package/dist/src/state/corrective-yield-executor.js +236 -0
  96. package/dist/src/state/corrective-yield-executor.js.map +1 -0
  97. package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
  98. package/dist/src/state/corrective-yield-transaction.js +591 -0
  99. package/dist/src/state/corrective-yield-transaction.js.map +1 -0
  100. package/dist/src/state/lock.d.ts +75 -3
  101. package/dist/src/state/lock.js +582 -30
  102. package/dist/src/state/lock.js.map +1 -1
  103. package/dist/src/state/store.d.ts +3 -0
  104. package/dist/src/state/store.js +65 -12
  105. package/dist/src/state/store.js.map +1 -1
  106. package/dist/src/transition-core.d.ts +67 -0
  107. package/dist/src/transition-core.js +318 -0
  108. package/dist/src/transition-core.js.map +1 -0
  109. package/dist/src/version.d.ts +1 -1
  110. package/dist/src/version.js +1 -1
  111. package/dist/src/workflow.d.ts +34 -22
  112. package/dist/src/workflow.js +486 -141
  113. package/dist/src/workflow.js.map +1 -1
  114. package/docs/lifecycle/state-machine-stabilization.md +641 -0
  115. package/docs/release.md +4 -2
  116. package/docs/updating-existing-project.md +9 -0
  117. package/package.json +4 -1
  118. package/schemas/adoption-posture-event.schema.json +1 -1
  119. package/schemas/context-envelope.schema.json +1 -1
  120. package/schemas/corrective-replan-credentials.private.schema.json +98 -0
  121. package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
  122. package/schemas/corrective-replan-public.schema.json +142 -0
  123. package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
  124. package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
  125. package/schemas/remediation-event.schema.json +11 -1
  126. package/schemas/task-handoff-event.schema.json +1 -1
  127. package/schemas/transition-definition.schema.json +2609 -0
  128. package/schemas/transition-payloads.schema.json +140 -0
@@ -0,0 +1,140 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codex-workflow.local/schemas/transition-payloads.schema.json",
4
+ "$defs": {
5
+ "taskId": { "type": "string", "minLength": 1 },
6
+ "expectedRevision": { "type": "integer", "minimum": 0 },
7
+ "nonEmptyString": { "type": "string", "minLength": 1 },
8
+ "stringArray": { "type": "array", "items": { "type": "string" } },
9
+ "taskPlanInput": {
10
+ "type": "object",
11
+ "required": ["objective", "requirements", "acceptance", "risks", "knowledgeImpact", "knowledgeImpactReason", "knowledgeTargets", "knowledgeMapRevision", "knowledgeMapHash", "graphUse", "steps"],
12
+ "properties": {
13
+ "objective": { "$ref": "#/$defs/nonEmptyString" },
14
+ "requirements": { "$ref": "#/$defs/stringArray" },
15
+ "acceptance": { "$ref": "#/$defs/stringArray" },
16
+ "risks": { "$ref": "#/$defs/stringArray" },
17
+ "knowledgeImpact": { "enum": ["none", "update", "create", "retire"] },
18
+ "knowledgeImpactReason": { "type": "string" },
19
+ "knowledgeTargets": { "type": "array", "items": { "$ref": "#/$defs/knowledgeTarget" } },
20
+ "knowledgeMapRevision": { "type": "integer", "minimum": 0 },
21
+ "knowledgeMapHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
22
+ "graphUse": { "enum": ["code-aware", "not-applicable"] },
23
+ "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/planStep" } }
24
+ },
25
+ "additionalProperties": false
26
+ },
27
+ "knowledgeTarget": {
28
+ "type": "object",
29
+ "required": ["category", "path", "reason", "requirementIds"],
30
+ "properties": {
31
+ "category": { "enum": ["agent-guidance", "onboarding", "architecture", "decisions", "commands", "ownership", "testing", "operations", "domain"] },
32
+ "path": { "$ref": "#/$defs/nonEmptyString" },
33
+ "reason": { "$ref": "#/$defs/nonEmptyString" },
34
+ "requirementIds": { "$ref": "#/$defs/stringArray" }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "planStep": {
39
+ "type": "object",
40
+ "required": ["id", "title", "objective", "requirements", "dependencies", "expectedOutputs", "allowedWrites", "forbiddenScope", "checks"],
41
+ "properties": {
42
+ "id": { "$ref": "#/$defs/nonEmptyString" },
43
+ "title": { "$ref": "#/$defs/nonEmptyString" },
44
+ "objective": { "$ref": "#/$defs/nonEmptyString" },
45
+ "requirements": { "$ref": "#/$defs/stringArray" },
46
+ "dependencies": { "$ref": "#/$defs/stringArray" },
47
+ "expectedOutputs": { "$ref": "#/$defs/stringArray" },
48
+ "allowedWrites": { "$ref": "#/$defs/stringArray" },
49
+ "forbiddenScope": { "$ref": "#/$defs/stringArray" },
50
+ "checks": { "$ref": "#/$defs/stringArray" }
51
+ },
52
+ "additionalProperties": false
53
+ },
54
+ "planRiskAuditInput": {
55
+ "type": "object",
56
+ "required": ["summary", "decision", "splitRationale", "stepClassifications"],
57
+ "properties": {
58
+ "summary": { "$ref": "#/$defs/nonEmptyString" },
59
+ "decision": { "enum": ["approved", "approved-with-rationale", "split-required", "stop-escalate"] },
60
+ "splitRationale": { "type": ["string", "null"] },
61
+ "stepClassifications": { "type": "array", "items": { "$ref": "#/$defs/riskStepClassification" } }
62
+ },
63
+ "additionalProperties": false
64
+ },
65
+ "riskStepClassification": {
66
+ "type": "object",
67
+ "required": ["stepId", "categories", "reviewRequired", "failureModes", "requiredEvidence"],
68
+ "properties": {
69
+ "stepId": { "$ref": "#/$defs/nonEmptyString" },
70
+ "categories": { "type": "array", "uniqueItems": true, "items": { "enum": ["migration", "concurrency", "restart-replay", "crash-window", "external-provider", "runtime-composition", "security-boundary", "auth-secrets", "irreversible-execution"] } },
71
+ "reviewRequired": { "type": "boolean" },
72
+ "failureModes": { "$ref": "#/$defs/stringArray" },
73
+ "requiredEvidence": { "$ref": "#/$defs/stringArray" },
74
+ "proofObligations": { "type": "array", "items": { "$ref": "#/$defs/riskProofObligation" } }
75
+ },
76
+ "additionalProperties": false
77
+ },
78
+ "riskProofObligation": {
79
+ "type": "object",
80
+ "required": ["failureMode", "counterexample", "expectedResult", "evidence"],
81
+ "properties": {
82
+ "failureMode": { "$ref": "#/$defs/nonEmptyString" },
83
+ "counterexample": { "$ref": "#/$defs/nonEmptyString" },
84
+ "expectedResult": { "$ref": "#/$defs/nonEmptyString" },
85
+ "evidence": { "$ref": "#/$defs/nonEmptyString" }
86
+ },
87
+ "additionalProperties": false
88
+ },
89
+ "correctiveReplanSnapshot": {
90
+ "type": "object",
91
+ "required": ["taskId", "taskRevision", "taskStatus", "currentPlanHash", "stepId", "stepStatus", "inProgressStepIds", "remediationAttemptCount", "correctivePosture", "correctiveDecision", "candidatePlanHash", "candidateStepIds", "actorRoleEligible", "c1ClaimAbsent", "writerLeaseAbsent", "planValidationPassed", "receiptValid", "riskAuditPassed"],
92
+ "properties": {
93
+ "taskId": { "$ref": "#/$defs/taskId" },
94
+ "taskRevision": { "$ref": "#/$defs/expectedRevision" },
95
+ "taskStatus": { "type": "string" },
96
+ "currentPlanHash": { "type": ["string", "null"] },
97
+ "stepId": { "type": "string", "minLength": 1 },
98
+ "stepStatus": { "type": ["string", "null"] },
99
+ "inProgressStepIds": { "type": "array", "items": { "type": "string" } },
100
+ "remediationAttemptCount": { "type": "integer", "minimum": 0 },
101
+ "correctivePosture": { "type": "string" },
102
+ "correctiveDecision": { "type": ["object", "null"] },
103
+ "candidatePlanHash": { "type": ["string", "null"] },
104
+ "candidateStepIds": { "type": ["array", "null"], "items": { "type": "string" } }
105
+ ,"actorRoleEligible": { "type": "boolean" }
106
+ ,"c1ClaimAbsent": { "type": "boolean" }
107
+ ,"writerLeaseAbsent": { "type": "boolean" }
108
+ ,"planValidationPassed": { "type": "boolean" }
109
+ ,"receiptValid": { "type": "boolean" }
110
+ ,"riskAuditPassed": { "type": "boolean" }
111
+ },
112
+ "additionalProperties": false
113
+ },
114
+ "correctiveReplanBindings": {
115
+ "type": "object",
116
+ "required": ["taskId", "expectedRevision", "currentPlanHash", "stepId", "correctiveDecisionEventId"],
117
+ "properties": {
118
+ "taskId": { "$ref": "#/$defs/taskId" },
119
+ "expectedRevision": { "$ref": "#/$defs/expectedRevision" },
120
+ "currentPlanHash": { "type": "string", "minLength": 1 },
121
+ "stepId": { "type": "string", "minLength": 1 },
122
+ "correctiveDecisionEventId": { "type": "string", "minLength": 1 },
123
+ "candidatePlanHash": { "type": "string", "minLength": 1 },
124
+ "candidateStepIds": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
125
+ },
126
+ "additionalProperties": false
127
+ },
128
+ "taskStateReadback": {
129
+ "type": "object",
130
+ "required": ["id", "revision", "status", "planHash"],
131
+ "properties": {
132
+ "id": { "$ref": "#/$defs/taskId" },
133
+ "revision": { "$ref": "#/$defs/expectedRevision" },
134
+ "status": { "type": "string" },
135
+ "planHash": { "type": ["string", "null"] }
136
+ },
137
+ "additionalProperties": true
138
+ }
139
+ }
140
+ }