codex-workflow-v2 2.0.0-beta.12.8 → 2.0.0-beta.13

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 (124) hide show
  1. package/README.md +60 -16
  2. package/dist/reviewer-runtime-build.json +1092 -0
  3. package/dist/src/alpha6/check-support-anchor.d.ts +24 -0
  4. package/dist/src/alpha6/check-support-anchor.js +102 -0
  5. package/dist/src/alpha6/check-support-anchor.js.map +1 -0
  6. package/dist/src/alpha6/component-owner.d.ts +28 -0
  7. package/dist/src/alpha6/component-owner.js +95 -0
  8. package/dist/src/alpha6/component-owner.js.map +1 -0
  9. package/dist/src/alpha6/downstream-proof.js +4 -2
  10. package/dist/src/alpha6/downstream-proof.js.map +1 -1
  11. package/dist/src/alpha6/mechanical-feasibility.js +42 -12
  12. package/dist/src/alpha6/mechanical-feasibility.js.map +1 -1
  13. package/dist/src/alpha6/milestone.d.ts +6 -2
  14. package/dist/src/alpha6/milestone.js +164 -10
  15. package/dist/src/alpha6/milestone.js.map +1 -1
  16. package/dist/src/alpha6/npm-check-contract.d.ts +11 -0
  17. package/dist/src/alpha6/npm-check-contract.js +36 -0
  18. package/dist/src/alpha6/npm-check-contract.js.map +1 -0
  19. package/dist/src/alpha6/plan-integrity.js +157 -27
  20. package/dist/src/alpha6/plan-integrity.js.map +1 -1
  21. package/dist/src/alpha6/plan-risk.js +3 -1
  22. package/dist/src/alpha6/plan-risk.js.map +1 -1
  23. package/dist/src/alpha6/remediation-cause.d.ts +13 -0
  24. package/dist/src/alpha6/remediation-cause.js +77 -0
  25. package/dist/src/alpha6/remediation-cause.js.map +1 -0
  26. package/dist/src/alpha6/remediation.d.ts +15 -4
  27. package/dist/src/alpha6/remediation.js +430 -67
  28. package/dist/src/alpha6/remediation.js.map +1 -1
  29. package/dist/src/alpha6/review.d.ts +6 -0
  30. package/dist/src/alpha6/review.js +46 -4
  31. package/dist/src/alpha6/review.js.map +1 -1
  32. package/dist/src/artifacts.js +6 -0
  33. package/dist/src/artifacts.js.map +1 -1
  34. package/dist/src/cli-actions.d.ts +25 -0
  35. package/dist/src/cli-actions.js +109 -0
  36. package/dist/src/cli-actions.js.map +1 -0
  37. package/dist/src/cli.js +244 -253
  38. package/dist/src/cli.js.map +1 -1
  39. package/dist/src/contracts.d.ts +202 -5
  40. package/dist/src/credential-transport.d.ts +38 -0
  41. package/dist/src/credential-transport.js +156 -0
  42. package/dist/src/credential-transport.js.map +1 -0
  43. package/dist/src/dependency-provenance.d.ts +23 -2
  44. package/dist/src/dependency-provenance.js +239 -36
  45. package/dist/src/dependency-provenance.js.map +1 -1
  46. package/dist/src/domain/completed-step-carryover.d.ts +13 -0
  47. package/dist/src/domain/completed-step-carryover.js +71 -0
  48. package/dist/src/domain/completed-step-carryover.js.map +1 -0
  49. package/dist/src/domain/validation.d.ts +9 -1
  50. package/dist/src/domain/validation.js +86 -0
  51. package/dist/src/domain/validation.js.map +1 -1
  52. package/dist/src/gateway-handshake.d.ts +11 -0
  53. package/dist/src/gateway-handshake.js +92 -0
  54. package/dist/src/gateway-handshake.js.map +1 -0
  55. package/dist/src/git.js +1 -0
  56. package/dist/src/git.js.map +1 -1
  57. package/dist/src/historical-step-provenance.d.ts +20 -0
  58. package/dist/src/historical-step-provenance.js +111 -0
  59. package/dist/src/historical-step-provenance.js.map +1 -0
  60. package/dist/src/index.d.ts +2 -0
  61. package/dist/src/index.js +2 -0
  62. package/dist/src/index.js.map +1 -1
  63. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +5 -0
  64. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +9 -0
  65. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -1
  66. package/dist/src/lifecycle/corrective-replan.js +1 -1
  67. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  68. package/dist/src/lifecycle/semantic-registry.js +1 -1
  69. package/dist/src/observation.js +1 -2
  70. package/dist/src/observation.js.map +1 -1
  71. package/dist/src/observed-routes.d.ts +114 -0
  72. package/dist/src/observed-routes.js +545 -0
  73. package/dist/src/observed-routes.js.map +1 -0
  74. package/dist/src/operational-contract.d.ts +26 -0
  75. package/dist/src/operational-contract.js +94 -0
  76. package/dist/src/operational-contract.js.map +1 -0
  77. package/dist/src/reviewer.d.ts +218 -8
  78. package/dist/src/reviewer.js +927 -25
  79. package/dist/src/reviewer.js.map +1 -1
  80. package/dist/src/state/corrective-replan-executor.js +23 -15
  81. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  82. package/dist/src/state/corrective-replan-public.js +35 -10
  83. package/dist/src/state/corrective-replan-public.js.map +1 -1
  84. package/dist/src/state/corrective-replan-transaction.js +12 -4
  85. package/dist/src/state/corrective-replan-transaction.js.map +1 -1
  86. package/dist/src/state/corrective-yield-transaction.js +11 -2
  87. package/dist/src/state/corrective-yield-transaction.js.map +1 -1
  88. package/dist/src/state/lock.d.ts +1 -0
  89. package/dist/src/state/lock.js +24 -0
  90. package/dist/src/state/lock.js.map +1 -1
  91. package/dist/src/version.d.ts +1 -1
  92. package/dist/src/version.js +1 -1
  93. package/dist/src/version.js.map +1 -1
  94. package/dist/src/workflow.d.ts +70 -4
  95. package/dist/src/workflow.js +1888 -152
  96. package/dist/src/workflow.js.map +1 -1
  97. package/docs/autonomy-guardrails.md +41 -14
  98. package/docs/delegated-approval.md +6 -1
  99. package/docs/development-flow.md +42 -12
  100. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  101. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  102. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  103. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +191 -22
  104. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +163 -45
  105. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +346 -52
  106. package/docs/problem-briefs/01-pre-implementation-integrity.md +11 -7
  107. package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +13 -6
  108. package/docs/problem-briefs/README.md +11 -11
  109. package/docs/release.md +89 -9
  110. package/docs/updating-existing-project.md +235 -0
  111. package/docs/validation-report.md +156 -98
  112. package/package.json +12 -3
  113. package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +1 -1
  114. package/plugins/codex-workflow-gateway/references/protocol.md +9 -0
  115. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +67 -1
  116. package/schemas/authorization-event.schema.json +10 -3
  117. package/schemas/corrective-decision-event.schema.json +164 -9
  118. package/schemas/corrective-replan-credentials.private.schema.json +4 -2
  119. package/schemas/milestone-scope-change-event.schema.json +25 -1
  120. package/schemas/remediation-event.schema.json +17 -1
  121. package/schemas/review-result.schema.json +1 -0
  122. package/schemas/step-review-event.schema.json +15 -0
  123. package/schemas/task.schema.json +104 -1
  124. package/schemas/transition-definition.schema.json +8 -0
@@ -0,0 +1,94 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { changedFiles, runGit } from './repository.js';
3
+ const HEX_64 = /^[a-f0-9]{64}$/;
4
+ export function watchdogPreflight(input) {
5
+ const valid = HEX_64.test(input.currentRouteFingerprint)
6
+ && (input.previousRouteFingerprint === null || HEX_64.test(input.previousRouteFingerprint));
7
+ return {
8
+ ...appOwnedBase(),
9
+ eligible: valid,
10
+ routeChanged: input.previousRouteFingerprint !== input.currentRouteFingerprint,
11
+ schedulingPerformed: false,
12
+ checkpoint: {
13
+ lastSuccessfulPollAt: input.lastSuccessfulPollAt,
14
+ lastSignificantObservationAt: input.lastSignificantObservationAt,
15
+ },
16
+ blockers: valid ? [] : ['Route fingerprints must be exact SHA-256 values.'],
17
+ };
18
+ }
19
+ export function coordinatorReplacementPreflight(input) {
20
+ const supervisors = [...new Set(input.activeSupervisorIds)];
21
+ const eligible = input.previousCoordinatorTerminal
22
+ && input.replacementCoordinatorId.trim().length > 0
23
+ && supervisors.length === 1
24
+ && supervisors[0] === input.replacementCoordinatorId
25
+ && HEX_64.test(input.coreReadbackFingerprint);
26
+ return {
27
+ ...appOwnedBase(),
28
+ eligibleToRequestReplacement: eligible,
29
+ replacementPerformed: false,
30
+ activeSupervisorIds: supervisors,
31
+ blockers: eligible
32
+ ? []
33
+ : ['Terminal predecessor, one replacement supervisor, and exact Core readback are required.'],
34
+ };
35
+ }
36
+ export function appConsentPreflight(input) {
37
+ const receiptStructurallyValid = input.presentedTaskId === input.requestedTaskId
38
+ && Number.isInteger(input.presentedTaskRevision)
39
+ && (input.presentedTaskRevision ?? -1) >= 0
40
+ && typeof input.consentReceiptHash === 'string'
41
+ && HEX_64.test(input.consentReceiptHash);
42
+ return {
43
+ ...appOwnedBase(),
44
+ receiptStructurallyValid,
45
+ consentGrantedByPackage: false,
46
+ semanticAuthorityEstablished: false,
47
+ requiredAppReadback: receiptStructurallyValid ? 'verify-consent-with-host' : 'obtain-current-consent-receipt',
48
+ };
49
+ }
50
+ export function worktreeObservationPreflight(repositoryRoot, limit = 32) {
51
+ const boundedLimit = Number.isInteger(limit) && limit > 0 ? Math.min(limit, 32) : 32;
52
+ const blocks = runGit(repositoryRoot, ['worktree', 'list', '--porcelain'])
53
+ .split(/\n\n+/)
54
+ .filter(Boolean);
55
+ const records = blocks.slice(0, boundedLimit).map((block) => {
56
+ const fields = new Map();
57
+ for (const line of block.split('\n')) {
58
+ const separator = line.indexOf(' ');
59
+ if (separator > 0)
60
+ fields.set(line.slice(0, separator), line.slice(separator + 1));
61
+ }
62
+ const worktree = fields.get('worktree') ?? '';
63
+ const dirty = changedFiles(worktree).sort();
64
+ return {
65
+ worktree,
66
+ head: fields.get('HEAD') ?? null,
67
+ branch: fields.get('branch')?.replace(/^refs\/heads\//, '') ?? null,
68
+ dirtyCount: dirty.length,
69
+ dirtyFingerprint: sha256(dirty.join('\n')),
70
+ };
71
+ });
72
+ return {
73
+ ...appOwnedBase(),
74
+ bounded: true,
75
+ limit: boundedLimit,
76
+ truncated: blocks.length > boundedLimit,
77
+ records,
78
+ observationFingerprint: sha256(JSON.stringify(records)),
79
+ worktreeSelectionPerformed: false,
80
+ };
81
+ }
82
+ function appOwnedBase() {
83
+ return {
84
+ contract: 'codex-workflow-app-owned-preflight-v1',
85
+ authority: 'diagnostic-only',
86
+ owner: 'codex-app',
87
+ packageMutatesAppState: false,
88
+ atomicAppEffectClaimed: false,
89
+ };
90
+ }
91
+ function sha256(value) {
92
+ return createHash('sha256').update(value).digest('hex');
93
+ }
94
+ //# sourceMappingURL=operational-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operational-contract.js","sourceRoot":"","sources":["../../src/operational-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAUhC,MAAM,UAAU,iBAAiB,CAAC,KAKjC;IACC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC;WACnD,CAAC,KAAK,CAAC,wBAAwB,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,YAAY,EAAE;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK,CAAC,wBAAwB,KAAK,KAAK,CAAC,uBAAuB;QAC9E,mBAAmB,EAAE,KAAK;QAC1B,UAAU,EAAE;YACV,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;YAChD,4BAA4B,EAAE,KAAK,CAAC,4BAA4B;SACjE;QACD,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,kDAAkD,CAAC;KAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,KAK/C;IACC,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,C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AAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,GAAG,YAAY,EAAE;QACjB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,YAAY;QACvC,OAAO;QACP,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvD,0BAA0B,EAAE,KAAK;KAClC,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO;QACL,QAAQ,EAAE,uCAAuC;QACjD,SAAS,EAAE,iBAAiB;QAC5B,KAAK,EAAE,WAAW;QAClB,sBAAsB,EAAE,KAAK;QAC7B,sBAAsB,EAAE,KAAK;KAC9B,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,4 +1,107 @@
1
- import type { ContextEnvelope, ReviewInput, StepEvidence, TaskState } from './contracts.js';
1
+ import { type ContextEnvelope, type ReviewInput, type StepEvidence, type TaskState } from './contracts.js';
2
+ export type ReviewMode = 'ordinary' | 'security';
3
+ export interface ReviewerRuntimePreflight {
4
+ protocol: 'codex-workflow-reviewer-runtime-preflight-v1';
5
+ prepared: boolean;
6
+ node: {
7
+ executable: string;
8
+ version: string;
9
+ requiredMajor: number;
10
+ supported: boolean;
11
+ };
12
+ workflowPackage: {
13
+ name: string;
14
+ version: string;
15
+ runtimeModulePath: string;
16
+ runtimeModuleSha256: string;
17
+ installedPackageRoot: string;
18
+ installedPackageManifestPath: string;
19
+ installedPackageManifestSha256: string | null;
20
+ declaredVersion: string | null;
21
+ lockedVersion: string | null;
22
+ installedVersion: string | null;
23
+ exactRepositoryLocal: boolean;
24
+ };
25
+ buildReadiness: {
26
+ state: 'ready' | 'missing' | 'stale';
27
+ manifestPath: string;
28
+ manifestSha256: string | null;
29
+ manifestFingerprint: string | null;
30
+ verifiedFileCount: number;
31
+ expectedFileCount: number;
32
+ cliEntrypointPath: string;
33
+ cliEntrypointSha256: string | null;
34
+ runningCliMatchesInstalledBuild: boolean;
35
+ reviewerModulePath: string;
36
+ reviewerModuleSha256: string | null;
37
+ runningModuleMatchesInstalledBuild: boolean;
38
+ gatewayModulePath: string;
39
+ gatewayModuleSha256: string | null;
40
+ runningGatewayMatchesInstalledBuild: boolean;
41
+ workflowModulePath: string;
42
+ workflowModuleSha256: string | null;
43
+ runningWorkflowMatchesInstalledBuild: boolean;
44
+ evidenceSha256: string;
45
+ };
46
+ runtimeDependencyReadiness: {
47
+ state: 'ready' | 'missing' | 'stale' | 'not-run';
48
+ expectedPackageCount: number;
49
+ verifiedPackageCount: number;
50
+ expectedFileCount: number;
51
+ verifiedFileCount: number;
52
+ packages: Array<{
53
+ name: string;
54
+ version: string;
55
+ packageRoot: string;
56
+ packageManifestPath: string;
57
+ packageManifestSha256: string | null;
58
+ expectedFileCount: number;
59
+ verifiedFileCount: number;
60
+ state: 'ready' | 'missing' | 'stale';
61
+ }>;
62
+ evidenceSha256: string;
63
+ };
64
+ runtimeCheck: {
65
+ kind: 'repository-local-gateway-load';
66
+ state: 'passed' | 'failed' | 'not-run';
67
+ loader: 'node:createRequire';
68
+ executable: string;
69
+ gatewayEntrypointPath: string;
70
+ gatewayEntrypointSha256: string | null;
71
+ reviewerEntrypointPath: string;
72
+ reviewerEntrypointSha256: string | null;
73
+ workflowEntrypointPath: string;
74
+ workflowEntrypointSha256: string | null;
75
+ dependencyClosureEvidenceSha256: string;
76
+ observedPackageName: string | null;
77
+ observedPackageVersion: string | null;
78
+ observedProtocolVersion: number | null;
79
+ observedStateSchemaVersion: number | null;
80
+ resultSha256: string | null;
81
+ failureKind: 'module-load-failed' | 'contract-mismatch' | null;
82
+ evidenceSha256: string;
83
+ sealedCheckoutMutationAllowed: false;
84
+ };
85
+ repositoryDependencyReadiness: {
86
+ packageManifestPath: string | null;
87
+ packageManifestSha256: string | null;
88
+ packageLockPath: string | null;
89
+ packageLockSha256: string | null;
90
+ nodeModulesPath: string;
91
+ nodeModulesPresent: boolean;
92
+ state: 'ready' | 'not-installed' | 'not-applicable' | 'version-mismatch' | 'build-missing' | 'build-stale' | 'runtime-dependency-missing' | 'runtime-dependency-stale' | 'runtime-check-failed';
93
+ installAttempted: false;
94
+ installCommand: null;
95
+ };
96
+ ephemeralCache: {
97
+ path: string;
98
+ writable: boolean;
99
+ outsideSealedCheckout: boolean;
100
+ lifecycle: 'os-temporary';
101
+ };
102
+ sealedCheckoutMutationAllowed: false;
103
+ blockers: string[];
104
+ }
2
105
  export interface ReviewerProcessResult {
3
106
  status: number | null;
4
107
  stdout: string;
@@ -41,12 +144,15 @@ export interface ExternalStrictStepReviewPacket {
41
144
  packetHash: string;
42
145
  repositorySeal: RepositorySeal;
43
146
  repositorySealHash: string;
147
+ reviewMode: ReviewMode;
148
+ reviewerRuntime: ReviewerRuntimePreflight;
44
149
  }
45
150
  export interface ExternalStrictStepReviewInput {
46
151
  protocol: 'codex-workflow-external-strict-step-review-v1';
47
152
  packetHash: string;
48
153
  repositorySealHash: string;
49
154
  reviewerThreadId: string;
155
+ reviewMode: ReviewMode;
50
156
  review: ReviewInput;
51
157
  }
52
158
  export interface ExternalStrictTaskReviewPacket {
@@ -57,16 +163,24 @@ export interface ExternalStrictTaskReviewPacket {
57
163
  packetHash: string;
58
164
  repositorySeal: RepositorySeal;
59
165
  repositorySealHash: string;
166
+ reviewMode: ReviewMode;
167
+ reviewerRuntime: ReviewerRuntimePreflight;
60
168
  }
61
169
  export interface ExternalStrictTaskReviewInput {
62
170
  protocol: 'codex-workflow-external-strict-task-review-v1';
63
171
  packetHash: string;
64
172
  repositorySealHash: string;
65
173
  reviewerThreadId: string;
174
+ reviewMode: ReviewMode;
66
175
  review: ReviewInput;
67
176
  }
177
+ export interface ReviewScopeAugmentation {
178
+ stepId: string;
179
+ paths: string[];
180
+ authority: 'machine-derived-check-support';
181
+ }
68
182
  export declare const STRICT_REVIEWER_TIMEOUT_MS = 180000;
69
- declare const REVIEW_SCHEMA: {
183
+ export declare const STRICT_REVIEW_OUTPUT_SCHEMA: {
70
184
  readonly type: "object";
71
185
  readonly additionalProperties: false;
72
186
  readonly required: readonly ["status", "reviewer", "summary", "findings", "isolationProbe"];
@@ -90,7 +204,7 @@ declare const REVIEW_SCHEMA: {
90
204
  readonly items: {
91
205
  readonly type: "object";
92
206
  readonly additionalProperties: false;
93
- readonly required: readonly ["id", "severity", "requirement", "summary", "evidence", "requiredAction"];
207
+ readonly required: readonly ["id", "severity", "requirement", "summary", "evidence", "requiredAction", "causeId", "route", "planConflict"];
94
208
  readonly properties: {
95
209
  readonly id: {
96
210
  readonly type: "string";
@@ -114,6 +228,102 @@ declare const REVIEW_SCHEMA: {
114
228
  readonly type: "string";
115
229
  readonly minLength: 1;
116
230
  };
231
+ readonly causeId: {
232
+ readonly anyOf: readonly [{
233
+ readonly type: "string";
234
+ readonly pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$";
235
+ }, {
236
+ readonly type: "null";
237
+ }];
238
+ };
239
+ readonly route: {
240
+ readonly enum: readonly ["fix", "replan"];
241
+ };
242
+ readonly planConflict: {
243
+ readonly anyOf: readonly [{
244
+ readonly type: "null";
245
+ }, {
246
+ readonly type: "object";
247
+ readonly additionalProperties: false;
248
+ readonly required: readonly ["planClause", "whyFixCannotFit", "minimalPlanChange"];
249
+ readonly properties: {
250
+ readonly planClause: {
251
+ readonly type: "string";
252
+ readonly minLength: 1;
253
+ };
254
+ readonly whyFixCannotFit: {
255
+ readonly type: "string";
256
+ readonly minLength: 1;
257
+ };
258
+ readonly minimalPlanChange: {
259
+ readonly type: "string";
260
+ readonly minLength: 1;
261
+ };
262
+ };
263
+ }];
264
+ };
265
+ };
266
+ };
267
+ };
268
+ };
269
+ };
270
+ /** @deprecated Use STRICT_REVIEW_OUTPUT_SCHEMA. Retained for direct-module compatibility. */
271
+ export declare const REVIEW_SCHEMA: {
272
+ readonly type: "object";
273
+ readonly additionalProperties: false;
274
+ readonly required: readonly ["status", "reviewer", "summary", "findings", "isolationProbe"];
275
+ readonly properties: {
276
+ readonly status: {
277
+ readonly enum: readonly ["passed", "failed", "unverified"];
278
+ };
279
+ readonly reviewer: {
280
+ readonly type: "string";
281
+ readonly minLength: 1;
282
+ };
283
+ readonly summary: {
284
+ readonly type: "string";
285
+ readonly minLength: 1;
286
+ };
287
+ readonly isolationProbe: {
288
+ readonly enum: readonly ["denied", "written", "not-attempted"];
289
+ };
290
+ readonly findings: {
291
+ readonly type: "array";
292
+ readonly items: {
293
+ readonly type: "object";
294
+ readonly additionalProperties: false;
295
+ readonly required: readonly ["id", "severity", "requirement", "summary", "evidence", "requiredAction", "causeId", "route", "planConflict"];
296
+ readonly properties: {
297
+ readonly id: {
298
+ readonly type: "string";
299
+ readonly minLength: 1;
300
+ };
301
+ readonly severity: {
302
+ readonly enum: readonly ["critical", "major", "minor"];
303
+ };
304
+ readonly requirement: {
305
+ readonly type: readonly ["string", "null"];
306
+ };
307
+ readonly summary: {
308
+ readonly type: "string";
309
+ readonly minLength: 1;
310
+ };
311
+ readonly evidence: {
312
+ readonly type: "string";
313
+ readonly minLength: 1;
314
+ };
315
+ readonly requiredAction: {
316
+ readonly type: "string";
317
+ readonly minLength: 1;
318
+ };
319
+ readonly causeId: {
320
+ readonly anyOf: readonly [{
321
+ readonly type: "string";
322
+ readonly pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$";
323
+ }, {
324
+ readonly type: "null";
325
+ }];
326
+ };
117
327
  readonly route: {
118
328
  readonly enum: readonly ["fix", "replan"];
119
329
  };
@@ -145,11 +355,11 @@ declare const REVIEW_SCHEMA: {
145
355
  };
146
356
  };
147
357
  };
148
- export declare function launchStrictReviewer(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, runner?: ReviewerCommandRunner): StrictReviewerLaunchResult;
149
- export declare function launchStrictStepReviewer(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, stepId: string, currentEvidence: StepEvidence, runner?: ReviewerCommandRunner): StrictStepReviewerLaunchResult;
150
- export declare function prepareExternalStrictStepReviewPacket(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, stepId: string, currentEvidence: StepEvidence): ExternalStrictStepReviewPacket;
151
- export declare function prepareExternalStrictTaskReviewPacket(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope): ExternalStrictTaskReviewPacket;
358
+ export declare function launchStrictReviewer(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, runner?: ReviewerCommandRunner, scopeAugmentations?: readonly ReviewScopeAugmentation[]): StrictReviewerLaunchResult;
359
+ export declare function launchStrictStepReviewer(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, stepId: string, currentEvidence: StepEvidence, runner?: ReviewerCommandRunner, scopeAugmentations?: readonly ReviewScopeAugmentation[]): StrictStepReviewerLaunchResult;
360
+ export declare function prepareExternalStrictStepReviewPacket(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, stepId: string, currentEvidence: StepEvidence, scopeAugmentations?: readonly ReviewScopeAugmentation[], reviewMode?: ReviewMode): ExternalStrictStepReviewPacket;
361
+ export declare function prepareExternalStrictTaskReviewPacket(repositoryRoot: string, task: TaskState, taskRoot: string, envelope: ContextEnvelope, scopeAugmentations?: readonly ReviewScopeAugmentation[], reviewMode?: ReviewMode): ExternalStrictTaskReviewPacket;
152
362
  export declare function validateExternalStrictStepReviewInput(value: unknown, expected: ExternalStrictStepReviewPacket): ReviewInput;
153
363
  export declare function validateExternalStrictTaskReviewInput(value: unknown, expected: ExternalStrictTaskReviewPacket): ReviewInput;
154
364
  export declare function strictReviewInputHash(review: ReviewInput): string;
155
- export { REVIEW_SCHEMA };
365
+ export declare function prepareReviewerRuntimePreflight(repositoryRoot: string, binding: string): ReviewerRuntimePreflight;