ai-foreman 1.7.28 → 2.0.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 (144) hide show
  1. package/README.md +1 -1
  2. package/dist/adapters/claude.d.ts +23 -12
  3. package/dist/adapters/claude.js +228 -24
  4. package/dist/adapters/codex.d.ts +17 -7
  5. package/dist/adapters/codex.js +195 -17
  6. package/dist/adapters/recovering.d.ts +2 -0
  7. package/dist/adapters/recovering.js +5 -1
  8. package/dist/adapters/structured.d.ts +71 -0
  9. package/dist/adapters/structured.js +213 -0
  10. package/dist/adapters/types.d.ts +86 -9
  11. package/dist/agentRun.d.ts +2 -0
  12. package/dist/agentRun.js +2 -1
  13. package/dist/boundedTurnEvidence.d.ts +18 -0
  14. package/dist/boundedTurnEvidence.js +76 -0
  15. package/dist/branch/currentGuard.d.ts +2 -0
  16. package/dist/branch/currentGuard.js +2 -0
  17. package/dist/branch/planner.js +1 -4
  18. package/dist/branch/runner.d.ts +2 -1
  19. package/dist/branch/runner.js +10 -7
  20. package/dist/buildAdmission.js +4 -0
  21. package/dist/buildApproval.d.ts +30 -0
  22. package/dist/buildApproval.js +68 -0
  23. package/dist/buildAssignment.d.ts +1 -0
  24. package/dist/buildAssignment.js +82 -23
  25. package/dist/buildInterventions.d.ts +2 -2
  26. package/dist/buildInterventions.js +11 -4
  27. package/dist/buildLaunchGate.js +3 -2
  28. package/dist/builderGuidanceFollowup.js +17 -6
  29. package/dist/cli/manager.js +22 -20
  30. package/dist/cli/start.js +32 -24
  31. package/dist/cli/tickets.js +40 -24
  32. package/dist/continuity.d.ts +10 -14
  33. package/dist/continuity.js +198 -179
  34. package/dist/continuityOrigin.d.ts +13 -0
  35. package/dist/continuityOrigin.js +91 -0
  36. package/dist/foreman.d.ts +20 -5
  37. package/dist/foreman.js +57 -187
  38. package/dist/graph/boundary.d.ts +1 -1
  39. package/dist/graph/boundary.js +1 -1
  40. package/dist/graph/host.js +8 -19
  41. package/dist/graph/manager.d.ts +1 -1
  42. package/dist/graph/manager.js +1 -1
  43. package/dist/graph/preparation.d.ts +38 -0
  44. package/dist/graph/preparation.js +7 -6
  45. package/dist/graph/semantic.d.ts +1 -0
  46. package/dist/graph/semantic.js +4 -1
  47. package/dist/graph/session.js +7 -2
  48. package/dist/graph/turn.d.ts +2 -3
  49. package/dist/graph/turn.js +28 -40
  50. package/dist/handoffProtocol.js +2 -2
  51. package/dist/handoffs.d.ts +3 -1
  52. package/dist/handoffs.js +90 -59
  53. package/dist/hostGraphApplicability.d.ts +46 -0
  54. package/dist/hostGraphApplicability.js +97 -0
  55. package/dist/hostQaAugmentation.d.ts +18 -0
  56. package/dist/hostQaAugmentation.js +81 -0
  57. package/dist/hostQaComparison.d.ts +21 -2
  58. package/dist/hostQaComparison.js +43 -28
  59. package/dist/hostSourcePreservation.d.ts +38 -0
  60. package/dist/hostSourcePreservation.js +72 -0
  61. package/dist/interviews.d.ts +7 -0
  62. package/dist/interviews.js +18 -1
  63. package/dist/legacyCommunicationDisplay.d.ts +2 -0
  64. package/dist/legacyCommunicationDisplay.js +2 -0
  65. package/dist/managerPacket.js +3 -3
  66. package/dist/markers.d.ts +4 -3
  67. package/dist/markers.js +4 -20
  68. package/dist/probeIpc.d.ts +14 -0
  69. package/dist/probeIpc.js +29 -0
  70. package/dist/qaBuildGate.d.ts +21 -0
  71. package/dist/qaBuildGate.js +48 -12
  72. package/dist/qaBuilderCoverage.js +22 -13
  73. package/dist/qaBuilderEvidence.d.ts +16 -1
  74. package/dist/qaBuilderEvidence.js +48 -8
  75. package/dist/qaContractCoverage.d.ts +2 -2
  76. package/dist/qaContractCoverage.js +11 -7
  77. package/dist/qaContractDelivery.js +34 -20
  78. package/dist/qaCoverageAssembly.d.ts +22 -0
  79. package/dist/qaCoverageAssembly.js +16 -0
  80. package/dist/qaDeliveryJournal.d.ts +2 -0
  81. package/dist/qaDeliveryJournal.js +19 -0
  82. package/dist/qaEffectiveConfig.d.ts +1 -0
  83. package/dist/qaEffectiveConfig.js +6 -1
  84. package/dist/qaFailureDelivery.js +97 -85
  85. package/dist/qaHostTransformation.d.ts +26 -0
  86. package/dist/qaHostTransformation.js +100 -0
  87. package/dist/qaPreparation.d.ts +8 -20
  88. package/dist/qaPreparation.js +133 -229
  89. package/dist/qaPreparationInputs.js +19 -0
  90. package/dist/qaPreparationStore.js +34 -6
  91. package/dist/qaPrerequisites.d.ts +2 -1
  92. package/dist/qaPrerequisites.js +21 -1
  93. package/dist/qaProtocolV2.d.ts +15 -0
  94. package/dist/qaRecovery.js +21 -4
  95. package/dist/qaReview.js +232 -394
  96. package/dist/qaReviewEvidence.d.ts +7 -3
  97. package/dist/qaReviewEvidence.js +15 -4
  98. package/dist/qaRuntime.js +1 -1
  99. package/dist/qaSnapshot.js +71 -21
  100. package/dist/qaStructuredResponse.d.ts +10 -0
  101. package/dist/qaStructuredResponse.js +57 -0
  102. package/dist/qaTimeline.js +5 -3
  103. package/dist/qaToolRecovery.d.ts +12 -0
  104. package/dist/qaToolRecovery.js +44 -0
  105. package/dist/qaVerificationContract.d.ts +3 -2
  106. package/dist/qaVerificationContract.js +58 -34
  107. package/dist/readinessGate.js +5 -4
  108. package/dist/runtimeReadiness.js +23 -15
  109. package/dist/statusReporter.d.ts +2 -0
  110. package/dist/statusReporter.js +2 -0
  111. package/dist/structuredCutover.d.ts +31 -0
  112. package/dist/structuredCutover.js +510 -0
  113. package/dist/structuredCutoverFiles.d.ts +10 -0
  114. package/dist/structuredCutoverFiles.js +181 -0
  115. package/dist/structuredDispatchAuthority.d.ts +22 -0
  116. package/dist/structuredDispatchAuthority.js +110 -0
  117. package/dist/structuredDispatchRecord.d.ts +29 -0
  118. package/dist/structuredDispatchRecord.js +36 -0
  119. package/dist/structuredLiveBudget.d.ts +2 -0
  120. package/dist/structuredLiveBudget.js +23 -0
  121. package/dist/structuredOperation.d.ts +18 -0
  122. package/dist/structuredOperation.js +257 -0
  123. package/dist/supervisedStart.d.ts +1 -1
  124. package/dist/supervisedStart.js +78 -31
  125. package/dist/supervisor.d.ts +18 -2
  126. package/dist/supervisor.js +74 -17
  127. package/dist/ticketPlanning.d.ts +1 -373
  128. package/dist/ticketPlanning.js +2 -26
  129. package/dist/ticketPopulation.d.ts +0 -3
  130. package/dist/ticketPopulation.js +4 -21
  131. package/dist/ticketPopulationPageAuthority.d.ts +13 -0
  132. package/dist/ticketPopulationPageAuthority.js +30 -0
  133. package/dist/ticketPopulationPaging.d.ts +27 -0
  134. package/dist/ticketPopulationPaging.js +105 -0
  135. package/dist/tickets/renderMarkdown.d.ts +14 -0
  136. package/dist/tickets/renderMarkdown.js +39 -5
  137. package/dist/tickets/ticketLoader.js +10 -0
  138. package/dist/tickets/ticketSchema.d.ts +107 -0
  139. package/dist/tickets/ticketSchema.js +4 -1
  140. package/dist/workflowDb.d.ts +100 -2
  141. package/dist/workflowDb.js +781 -35
  142. package/dist/workflowReader.d.ts +1 -0
  143. package/dist/workflowReader.js +9 -0
  144. package/package.json +15 -7
@@ -135,6 +135,7 @@ export declare class WorkflowReader {
135
135
  preparationSuccessor(runId: string): string;
136
136
  pendingBuildLaunches(runId: string): import("./buildAdmission.js").BuildLaunch[];
137
137
  buildAdmission(): import("./buildAdmission.js").BuildAdmission | undefined;
138
+ private verifyContinuityHeads;
138
139
  continuityHeads(runId: string): Array<{
139
140
  role: string;
140
141
  state: string;
@@ -1,8 +1,10 @@
1
+ import { verifyContinuityHeads } from "./continuityOrigin.js";
1
2
  import { bytesDigest } from "./graph/util.js";
2
3
  import { measureQaPreparation } from "./qaPreparationMetrics.js";
3
4
  import { graphDerivedAllowed } from "./graph/derived.js";
4
5
  import { readGraphRecord } from "./graph/storage.js";
5
6
  import { checkBuildOwnershipSchema, canonicalProject } from "./buildAdmission.js";
7
+ import { assertStructuredCutoverComplete } from "./structuredCutover.js";
6
8
  import { existsSync } from "node:fs";
7
9
  import { join, resolve } from "node:path";
8
10
  import Database from "better-sqlite3";
@@ -20,6 +22,7 @@ export class WorkflowReader {
20
22
  this.db = new Database(path, { readonly: true, fileMustExist: true });
21
23
  this.db.pragma("query_only = ON");
22
24
  try {
25
+ assertStructuredCutoverComplete(this.db);
23
26
  checkBuildOwnershipSchema(this.db);
24
27
  }
25
28
  catch (error) {
@@ -214,9 +217,15 @@ export class WorkflowReader {
214
217
  return undefined;
215
218
  }
216
219
  }
220
+ verifyContinuityHeads(runId) {
221
+ if (!this.db)
222
+ return;
223
+ verifyContinuityHeads(this.db, this.projectDir, runId);
224
+ }
217
225
  continuityHeads(runId) {
218
226
  if (!this.db)
219
227
  return [];
228
+ this.verifyContinuityHeads(runId);
220
229
  try {
221
230
  return this.db.prepare("SELECT * FROM continuity_heads WHERE run_id=? ORDER BY role").all(runId).map(row => ({ role: String(row.role), state: String(row.state), sequence: Number(row.event_sequence), digest: String(row.digest), updatedAt: String(row.updated_at) }));
222
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-foreman",
3
- "version": "1.7.28",
3
+ "version": "2.0.0",
4
4
  "description": "An orchestrator that keeps Codex CLI / Claude Code builders moving through their step list unattended. Part of Rafi.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -93,6 +93,14 @@
93
93
  "types": "./dist/workflowReader.d.ts",
94
94
  "default": "./dist/workflowReader.js"
95
95
  },
96
+ "./process-identity.js": {
97
+ "types": "./dist/processIdentity.d.ts",
98
+ "default": "./dist/processIdentity.js"
99
+ },
100
+ "./tickets/reset.js": {
101
+ "types": "./dist/tickets/reset.d.ts",
102
+ "default": "./dist/tickets/reset.js"
103
+ },
96
104
  "./ticket-history-reader.js": {
97
105
  "types": "./dist/ticketHistoryReader.d.ts",
98
106
  "default": "./dist/ticketHistoryReader.js"
@@ -281,7 +289,7 @@
281
289
  "dev": "tsx src/index.ts",
282
290
  "test": "node scripts/test-offline.mjs",
283
291
  "typecheck": "tsc --noEmit",
284
- "test:live-providers": "RAFI_LIVE_PROVIDER_SESSIONS=1 tsx --test test/providerSmoke.test.ts",
292
+ "test:live-providers": "RAFI_LIVE_PROVIDER_SESSIONS=1 node --import tsx --test test/providerSmoke.test.ts",
285
293
  "prepublishOnly": "tsc -p ../spec/tsconfig.build.json && pnpm build && pnpm --filter ai-foreman test && tsc --noEmit"
286
294
  },
287
295
  "keywords": [
@@ -295,7 +303,7 @@
295
303
  "cli"
296
304
  ],
297
305
  "engines": {
298
- "node": ">=20"
306
+ "node": "24.x"
299
307
  },
300
308
  "packageManager": "pnpm@10.2.1",
301
309
  "optionalDependencies": {
@@ -305,21 +313,21 @@
305
313
  "@clack/prompts": "^1.4.0",
306
314
  "ajv": "^8.20.0",
307
315
  "ajv-formats": "^3.0.1",
308
- "better-sqlite3": "^12.10.0",
316
+ "better-sqlite3": "^13.0.3",
309
317
  "commander": "^12.1.0",
310
318
  "ignore": "7.0.5",
311
319
  "luxon": "^3.7.2",
312
320
  "parse5": "7.2.1",
313
321
  "pdfjs-dist": "4.10.38",
314
- "rafi-spec": "0.8.17",
315
- "special-agents": "0.8.17",
322
+ "rafi-spec": "0.9.0",
323
+ "special-agents": "0.9.0",
316
324
  "yaml": "^2.5.1",
317
325
  "zod": "4.4.3"
318
326
  },
319
327
  "devDependencies": {
320
328
  "@types/better-sqlite3": "^7.6.13",
321
329
  "@types/luxon": "^3.7.1",
322
- "@types/node": "^20.14.0",
330
+ "@types/node": "^24.0.0",
323
331
  "tsx": "^4.19.0",
324
332
  "typescript": "^5.6.0"
325
333
  }