loopforge 3.9.2 → 4.0.7

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 (285) hide show
  1. package/README.md +236 -112
  2. package/dist/audit.d.ts +73 -15
  3. package/dist/audit.d.ts.map +1 -1
  4. package/dist/audit.js +131 -61
  5. package/dist/audit.js.map +1 -1
  6. package/dist/canonical-state.d.ts +152 -40
  7. package/dist/canonical-state.d.ts.map +1 -1
  8. package/dist/canonical-state.js +382 -206
  9. package/dist/canonical-state.js.map +1 -1
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/cli.js +41 -12
  12. package/dist/cli.js.map +1 -1
  13. package/dist/cognitive-governance.d.ts +0 -2
  14. package/dist/cognitive-governance.d.ts.map +1 -1
  15. package/dist/cognitive-governance.js +0 -4
  16. package/dist/cognitive-governance.js.map +1 -1
  17. package/dist/committed-round.d.ts +105 -141
  18. package/dist/committed-round.d.ts.map +1 -1
  19. package/dist/committed-round.js +249 -372
  20. package/dist/committed-round.js.map +1 -1
  21. package/dist/constraint-lifecycle.d.ts +73 -0
  22. package/dist/constraint-lifecycle.d.ts.map +1 -0
  23. package/dist/constraint-lifecycle.js +174 -0
  24. package/dist/constraint-lifecycle.js.map +1 -0
  25. package/dist/context-boundary.d.ts +83 -0
  26. package/dist/context-boundary.d.ts.map +1 -0
  27. package/dist/context-boundary.js +101 -0
  28. package/dist/context-boundary.js.map +1 -0
  29. package/dist/contract-items.d.ts +12 -8
  30. package/dist/contract-items.d.ts.map +1 -1
  31. package/dist/contract-items.js +31 -26
  32. package/dist/contract-items.js.map +1 -1
  33. package/dist/contract-requirement.d.ts +47 -0
  34. package/dist/contract-requirement.d.ts.map +1 -0
  35. package/dist/contract-requirement.js +51 -0
  36. package/dist/contract-requirement.js.map +1 -0
  37. package/dist/criterion-status.d.ts +35 -0
  38. package/dist/criterion-status.d.ts.map +1 -0
  39. package/dist/criterion-status.js +89 -0
  40. package/dist/criterion-status.js.map +1 -0
  41. package/dist/enforcement-gate.d.ts +32 -67
  42. package/dist/enforcement-gate.d.ts.map +1 -1
  43. package/dist/enforcement-gate.js +203 -439
  44. package/dist/enforcement-gate.js.map +1 -1
  45. package/dist/engine.d.ts +9 -103
  46. package/dist/engine.d.ts.map +1 -1
  47. package/dist/engine.js +28 -887
  48. package/dist/engine.js.map +1 -1
  49. package/dist/errors.d.ts +41 -0
  50. package/dist/errors.d.ts.map +1 -0
  51. package/dist/errors.js +69 -0
  52. package/dist/errors.js.map +1 -0
  53. package/dist/evidence-claims.d.ts +33 -31
  54. package/dist/evidence-claims.d.ts.map +1 -1
  55. package/dist/evidence-claims.js +58 -72
  56. package/dist/evidence-claims.js.map +1 -1
  57. package/dist/evidence-posture-view.d.ts +19 -0
  58. package/dist/evidence-posture-view.d.ts.map +1 -0
  59. package/dist/evidence-posture-view.js +116 -0
  60. package/dist/evidence-posture-view.js.map +1 -0
  61. package/dist/evidence-posture.d.ts +73 -0
  62. package/dist/evidence-posture.d.ts.map +1 -0
  63. package/dist/evidence-posture.js +281 -0
  64. package/dist/evidence-posture.js.map +1 -0
  65. package/dist/evidence-provider.d.ts +55 -37
  66. package/dist/evidence-provider.d.ts.map +1 -1
  67. package/dist/evidence-provider.js +182 -332
  68. package/dist/evidence-provider.js.map +1 -1
  69. package/dist/explain.d.ts +167 -27
  70. package/dist/explain.d.ts.map +1 -1
  71. package/dist/explain.js +373 -58
  72. package/dist/explain.js.map +1 -1
  73. package/dist/field-accounting.d.ts.map +1 -1
  74. package/dist/field-accounting.js +3 -22
  75. package/dist/field-accounting.js.map +1 -1
  76. package/dist/generate-schema.js +13 -8
  77. package/dist/generate-schema.js.map +1 -1
  78. package/dist/git-boundary.d.ts +128 -0
  79. package/dist/git-boundary.d.ts.map +1 -0
  80. package/dist/git-boundary.js +625 -0
  81. package/dist/git-boundary.js.map +1 -0
  82. package/dist/git-facts.d.ts +22 -0
  83. package/dist/git-facts.d.ts.map +1 -0
  84. package/dist/git-facts.js +29 -0
  85. package/dist/git-facts.js.map +1 -0
  86. package/dist/git-motion.d.ts +37 -0
  87. package/dist/git-motion.d.ts.map +1 -0
  88. package/dist/git-motion.js +59 -0
  89. package/dist/git-motion.js.map +1 -0
  90. package/dist/history.d.ts +44 -0
  91. package/dist/history.d.ts.map +1 -0
  92. package/dist/history.js +77 -0
  93. package/dist/history.js.map +1 -0
  94. package/dist/index.d.ts +19 -9
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +12 -4
  97. package/dist/index.js.map +1 -1
  98. package/dist/init.d.ts +16 -0
  99. package/dist/init.d.ts.map +1 -1
  100. package/dist/init.js +80 -14
  101. package/dist/init.js.map +1 -1
  102. package/dist/loop-compiler.d.ts +51 -19
  103. package/dist/loop-compiler.d.ts.map +1 -1
  104. package/dist/loop-compiler.js +423 -507
  105. package/dist/loop-compiler.js.map +1 -1
  106. package/dist/loop-store.d.ts +6 -5
  107. package/dist/loop-store.d.ts.map +1 -1
  108. package/dist/loop-store.js +153 -35
  109. package/dist/loop-store.js.map +1 -1
  110. package/dist/mcp/round-lifecycle.d.ts +285 -81
  111. package/dist/mcp/round-lifecycle.d.ts.map +1 -1
  112. package/dist/mcp/round-lifecycle.js +1629 -574
  113. package/dist/mcp/round-lifecycle.js.map +1 -1
  114. package/dist/mcp/server.d.ts +5 -0
  115. package/dist/mcp/server.d.ts.map +1 -1
  116. package/dist/mcp/server.js +61 -19
  117. package/dist/mcp/server.js.map +1 -1
  118. package/dist/mcp/session.d.ts +81 -39
  119. package/dist/mcp/session.d.ts.map +1 -1
  120. package/dist/mcp/session.js +963 -271
  121. package/dist/mcp/session.js.map +1 -1
  122. package/dist/mcp/submission-boundary.d.ts +23 -31
  123. package/dist/mcp/submission-boundary.d.ts.map +1 -1
  124. package/dist/mcp/submission-boundary.js +242 -82
  125. package/dist/mcp/submission-boundary.js.map +1 -1
  126. package/dist/mcp/submission-handle.d.ts +66 -0
  127. package/dist/mcp/submission-handle.d.ts.map +1 -0
  128. package/dist/mcp/submission-handle.js +173 -0
  129. package/dist/mcp/submission-handle.js.map +1 -0
  130. package/dist/mcp/tools.d.ts +17 -7
  131. package/dist/mcp/tools.d.ts.map +1 -1
  132. package/dist/mcp/tools.js +763 -244
  133. package/dist/mcp/tools.js.map +1 -1
  134. package/dist/open-question.d.ts +7 -0
  135. package/dist/open-question.d.ts.map +1 -0
  136. package/dist/open-question.js +14 -0
  137. package/dist/open-question.js.map +1 -0
  138. package/dist/policy-metrics.d.ts +31 -21
  139. package/dist/policy-metrics.d.ts.map +1 -1
  140. package/dist/policy-metrics.js +117 -64
  141. package/dist/policy-metrics.js.map +1 -1
  142. package/dist/policy.d.ts +15 -40
  143. package/dist/policy.d.ts.map +1 -1
  144. package/dist/policy.js +13 -13
  145. package/dist/policy.js.map +1 -1
  146. package/dist/progress.d.ts +45 -0
  147. package/dist/progress.d.ts.map +1 -0
  148. package/dist/progress.js +136 -0
  149. package/dist/progress.js.map +1 -0
  150. package/dist/prompt-assembler.d.ts +28 -9
  151. package/dist/prompt-assembler.d.ts.map +1 -1
  152. package/dist/prompt-assembler.js +592 -603
  153. package/dist/prompt-assembler.js.map +1 -1
  154. package/dist/prompt-coverage.d.ts +39 -0
  155. package/dist/prompt-coverage.d.ts.map +1 -0
  156. package/dist/prompt-coverage.js +80 -0
  157. package/dist/prompt-coverage.js.map +1 -0
  158. package/dist/prompt-freshness.d.ts +25 -0
  159. package/dist/prompt-freshness.d.ts.map +1 -0
  160. package/dist/prompt-freshness.js +88 -0
  161. package/dist/prompt-freshness.js.map +1 -0
  162. package/dist/prompt-policy.d.ts +14 -4
  163. package/dist/prompt-policy.d.ts.map +1 -1
  164. package/dist/prompt-policy.js +29 -10
  165. package/dist/prompt-policy.js.map +1 -1
  166. package/dist/protocol.d.ts +875 -419
  167. package/dist/protocol.d.ts.map +1 -1
  168. package/dist/protocol.js +73 -99
  169. package/dist/protocol.js.map +1 -1
  170. package/dist/recovery-guidance.d.ts +13 -0
  171. package/dist/recovery-guidance.d.ts.map +1 -0
  172. package/dist/recovery-guidance.js +15 -0
  173. package/dist/recovery-guidance.js.map +1 -0
  174. package/dist/recovery.d.ts +68 -0
  175. package/dist/recovery.d.ts.map +1 -0
  176. package/dist/recovery.js +234 -0
  177. package/dist/recovery.js.map +1 -0
  178. package/dist/replay.d.ts +42 -8
  179. package/dist/replay.d.ts.map +1 -1
  180. package/dist/replay.js +311 -84
  181. package/dist/replay.js.map +1 -1
  182. package/dist/result-facts.d.ts +45 -0
  183. package/dist/result-facts.d.ts.map +1 -0
  184. package/dist/result-facts.js +86 -0
  185. package/dist/result-facts.js.map +1 -0
  186. package/dist/round-contract.d.ts +38 -8
  187. package/dist/round-contract.d.ts.map +1 -1
  188. package/dist/round-contract.js +71 -31
  189. package/dist/round-contract.js.map +1 -1
  190. package/dist/round-coordinator.d.ts +45 -91
  191. package/dist/round-coordinator.d.ts.map +1 -1
  192. package/dist/round-coordinator.js +254 -271
  193. package/dist/round-coordinator.js.map +1 -1
  194. package/dist/round-driver.d.ts +56 -16
  195. package/dist/round-driver.d.ts.map +1 -1
  196. package/dist/round-driver.js +225 -39
  197. package/dist/round-driver.js.map +1 -1
  198. package/dist/round-facts.d.ts +33 -52
  199. package/dist/round-facts.d.ts.map +1 -1
  200. package/dist/round-facts.js +54 -157
  201. package/dist/round-facts.js.map +1 -1
  202. package/dist/round-guidance.d.ts +56 -0
  203. package/dist/round-guidance.d.ts.map +1 -0
  204. package/dist/round-guidance.js +161 -0
  205. package/dist/round-guidance.js.map +1 -0
  206. package/dist/round-outcome.d.ts +21 -0
  207. package/dist/round-outcome.d.ts.map +1 -0
  208. package/dist/round-outcome.js +31 -0
  209. package/dist/round-outcome.js.map +1 -0
  210. package/dist/round-transaction.d.ts +168 -21
  211. package/dist/round-transaction.d.ts.map +1 -1
  212. package/dist/round-transaction.js +856 -39
  213. package/dist/round-transaction.js.map +1 -1
  214. package/dist/self-eval.d.ts +40 -60
  215. package/dist/self-eval.d.ts.map +1 -1
  216. package/dist/self-eval.js +455 -384
  217. package/dist/self-eval.js.map +1 -1
  218. package/dist/storage.d.ts +16 -0
  219. package/dist/storage.d.ts.map +1 -1
  220. package/dist/storage.js +54 -4
  221. package/dist/storage.js.map +1 -1
  222. package/dist/subgoal-state.d.ts +2 -3
  223. package/dist/subgoal-state.d.ts.map +1 -1
  224. package/dist/subgoal-state.js +2 -3
  225. package/dist/subgoal-state.js.map +1 -1
  226. package/dist/submission-guidance.d.ts +43 -21
  227. package/dist/submission-guidance.d.ts.map +1 -1
  228. package/dist/submission-guidance.js +368 -262
  229. package/dist/submission-guidance.js.map +1 -1
  230. package/dist/submission-receipt.d.ts +16 -8
  231. package/dist/submission-receipt.d.ts.map +1 -1
  232. package/dist/submission-receipt.js +146 -51
  233. package/dist/submission-receipt.js.map +1 -1
  234. package/dist/token-utils.d.ts +47 -7
  235. package/dist/token-utils.d.ts.map +1 -1
  236. package/dist/token-utils.js +66 -15
  237. package/dist/token-utils.js.map +1 -1
  238. package/dist/transaction-identity.d.ts +9 -0
  239. package/dist/transaction-identity.d.ts.map +1 -0
  240. package/dist/transaction-identity.js +69 -0
  241. package/dist/transaction-identity.js.map +1 -0
  242. package/dist/verification-actions.d.ts +13 -0
  243. package/dist/verification-actions.d.ts.map +1 -0
  244. package/dist/verification-actions.js +44 -0
  245. package/dist/verification-actions.js.map +1 -0
  246. package/dist/verification-gate.d.ts +26 -46
  247. package/dist/verification-gate.d.ts.map +1 -1
  248. package/dist/verification-gate.js +218 -427
  249. package/dist/verification-gate.js.map +1 -1
  250. package/dist/version.d.ts +1 -1
  251. package/dist/version.js +1 -1
  252. package/dist/working-memory.d.ts +187 -0
  253. package/dist/working-memory.d.ts.map +1 -0
  254. package/dist/working-memory.js +767 -0
  255. package/dist/working-memory.js.map +1 -0
  256. package/dist/workspace-checkpoint.d.ts +88 -0
  257. package/dist/workspace-checkpoint.d.ts.map +1 -0
  258. package/dist/workspace-checkpoint.js +326 -0
  259. package/dist/workspace-checkpoint.js.map +1 -0
  260. package/dist/workspace-restore.d.ts +68 -0
  261. package/dist/workspace-restore.d.ts.map +1 -0
  262. package/dist/workspace-restore.js +604 -0
  263. package/dist/workspace-restore.js.map +1 -0
  264. package/dist/workspace.d.ts +0 -9
  265. package/dist/workspace.d.ts.map +1 -1
  266. package/dist/workspace.js +0 -17
  267. package/dist/workspace.js.map +1 -1
  268. package/loop_policy.json +5 -19
  269. package/package.json +2 -2
  270. package/skills/forge/SKILL.md +212 -0
  271. package/skills/forge/references/evidence-and-contracts.md +204 -0
  272. package/skills/forge/references/recovery-and-views.md +188 -0
  273. package/dist/cognitive-facts.d.ts +0 -30
  274. package/dist/cognitive-facts.d.ts.map +0 -1
  275. package/dist/cognitive-facts.js +0 -113
  276. package/dist/cognitive-facts.js.map +0 -1
  277. package/dist/loop-extras-parser.d.ts +0 -81
  278. package/dist/loop-extras-parser.d.ts.map +0 -1
  279. package/dist/loop-extras-parser.js +0 -213
  280. package/dist/loop-extras-parser.js.map +0 -1
  281. package/dist/loop-projection.d.ts +0 -6
  282. package/dist/loop-projection.d.ts.map +0 -1
  283. package/dist/loop-projection.js +0 -28
  284. package/dist/loop-projection.js.map +0 -1
  285. package/skills/perception/SKILL.md +0 -370
@@ -8,6 +8,7 @@
8
8
  * the current observations, and policy.
9
9
  */
10
10
  import { gitDeltaState } from "./evidence-provider.js";
11
+ import { declaresBlocked } from "./round-outcome.js";
11
12
  const EMPTY_VIEW = {
12
13
  contractId: "",
13
14
  closure: "open",
@@ -20,8 +21,8 @@ const EMPTY_VIEW = {
20
21
  function itemClaims(item, slices) {
21
22
  const claims = [];
22
23
  for (const slice of slices) {
23
- for (const claim of slice.report?.contract_item_claims ?? []) {
24
- if (claim.item_id === item.id)
24
+ for (const claim of slice.report?.claims ?? []) {
25
+ if (claim.id === item.id)
25
26
  claims.push({ round: slice.round, outcome: claim.outcome });
26
27
  }
27
28
  }
@@ -34,12 +35,11 @@ function metClaimRound(claims) {
34
35
  return last && last.outcome === "met" ? last.round : null;
35
36
  }
36
37
  function evaluateCommand(commandId, declaredHash, slices, fromRound, configured) {
37
- if (!configured) {
38
- return {
39
- verdict: "insufficient",
40
- reason: `command "${commandId}" is no longer configured/enabled — cannot observe it`,
41
- };
42
- }
38
+ // v4.0.3: observations come FIRST. A command that was disabled after the
39
+ // round that observed it passing does not rewrite that historical result;
40
+ // the missing configuration only matters when there is no observation to
41
+ // judge. A reconfigured command (configHash mismatch) is still insufficient.
42
+ //
43
43
  // v3.8.1: the LATEST observation at or after the claim decides, so the
44
44
  // closing round's evidence is the one consulted. Scanning forward let an
45
45
  // early pass outlive a later failure: the item stayed `verified`, its
@@ -101,7 +101,9 @@ function evaluateCommand(commandId, declaredHash, slices, fromRound, configured)
101
101
  }
102
102
  return {
103
103
  verdict: "insufficient",
104
- reason: `command "${commandId}" produced no after-phase observation since round ${fromRound}`,
104
+ reason: configured
105
+ ? `command "${commandId}" produced no after-phase observation since round ${fromRound}`
106
+ : `command "${commandId}" is no longer configured/enabled and produced no after-phase observation since round ${fromRound} — cannot observe it`,
105
107
  };
106
108
  }
107
109
  /** v3.8: Derive every item's status plus the contract's closure. */
@@ -114,13 +116,17 @@ export function deriveContractItemStatuses(input) {
114
116
  round: round.round,
115
117
  report: round.executionReport,
116
118
  deltas: round.observationDelta,
117
- outcome: round.outcome,
119
+ blocked: round.evaluation
120
+ ? declaresBlocked(round.evaluation)
121
+ : round.agentOutcome === "blocked",
122
+ redirect: round.contractRedirect,
118
123
  })),
119
124
  {
120
125
  round: input.currentRound,
121
126
  report: input.currentReport,
122
127
  deltas: input.currentDeltas,
123
- outcome: input.currentOutcome ?? null,
128
+ blocked: input.currentBlocked === true,
129
+ redirect: input.currentRedirect ?? null,
124
130
  },
125
131
  ].filter((slice) => slice.round < input.currentRound || slice.round === input.currentRound);
126
132
  const enabledCommands = new Set(input.commands.filter((command) => command.enabled).map((command) => command.name));
@@ -162,9 +168,21 @@ export function deriveContractItemStatuses(input) {
162
168
  const contradictedCount = items.filter((item) => item.status === "contradicted").length;
163
169
  const insufficientCount = items.filter((item) => item.status === "insufficient").length;
164
170
  const committingRound = slices[slices.length - 1];
165
- const blocked = committingRound?.outcome === "blocked";
171
+ const blocked = committingRound?.blocked === true;
166
172
  const allVerified = items.length > 0 && verifiedCount === items.length;
167
- const closure = allVerified ? "verified" : blocked ? "blocked" : "open";
173
+ // v3.9.9/v4.0.6 closure priority: blocked > superseded > verified > open.
174
+ // A blocked declaration is the Agent's protocol action and closes the
175
+ // contract first. A redirect supersedes only when its target is THIS
176
+ // contract; an inert/abnormal target is ignored rather than closing a
177
+ // contract the Agent never named.
178
+ const superseded = !blocked &&
179
+ committingRound?.redirect !== null &&
180
+ committingRound?.redirect !== undefined &&
181
+ committingRound.redirect.contract_id === contract.id;
182
+ const closure = blocked ? "blocked"
183
+ : superseded ? "superseded"
184
+ : allVerified ? "verified"
185
+ : "open";
168
186
  return {
169
187
  contractId: contract.id,
170
188
  closure,
@@ -175,17 +193,4 @@ export function deriveContractItemStatuses(input) {
175
193
  insufficientCount,
176
194
  };
177
195
  }
178
- /** v3.8: The round-level verification posture. */
179
- export function roundVerificationStatus(view, report) {
180
- if (view.contradictedCount > 0)
181
- return "contradicted";
182
- if (view.insufficientCount > 0)
183
- return "insufficient";
184
- // A success claim with no machine-backed item at all is insufficient too.
185
- const claims = report?.contract_item_claims ?? [];
186
- if (claims.some((claim) => claim.outcome === "met") && view.verifiedCount === 0) {
187
- return "insufficient";
188
- }
189
- return "trusted";
190
- }
191
196
  //# sourceMappingURL=contract-items.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract-items.js","sourceRoot":"","sources":["../src/contract-items.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAoDvD,MAAM,UAAU,GAA2B;IACzC,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,MAAM;IACf,eAAe,EAAE,IAAI;IACrB,KAAK,EAAE,EAAE;IACT,aAAa,EAAE,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AC,UAAU;gBAC1B,CAAC,CAAC,MAAM,CAAC;IAEb,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,EAAE;QACvB,OAAO;QACP,eAAe,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,KAAK,IAAI,IAAI;QAC3E,KAAK;QACL,aAAa;QACb,iBAAiB;QACjB,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ /** v4.0.6: contract coverage — the ONE shared requirement derivation.
2
+ *
3
+ * A round that continues with contract capability must leave an ACTIVE
4
+ * contract for the next round. This module answers only that structural
5
+ * question: does the next round have a contract, and where does the current
6
+ * proposal leave it? It never judges whether the slice is a real
7
+ * deliverable, whether an item is a good acceptance condition, or whether a
8
+ * command is the right test.
9
+ *
10
+ * It is a PURE function of facts the caller already derived — it reads no
11
+ * store, no session and no policy global. The compile-time caller, the
12
+ * pre-advance submission boundary and the post-evidence coordinator all pass
13
+ * the same facts through this one rule, so they cannot disagree about
14
+ * whether a contract was required.
15
+ *
16
+ * The active contract is the one derived from committed rounds
17
+ * (`ActiveContractView`); `closure` is the item reducer's verdict for the
18
+ * round being decided (or `"open"` before evidence exists).
19
+ */
20
+ import type { ContractItemStatusView } from "./contract-items.js";
21
+ import type { ActiveContractView } from "./round-contract.js";
22
+ export type ContractRequirementReason = "not_continuing" | "blocked" | "no_successor_round" | "no_contract_capability" | "no_active_contract" | "active_contract_continues" | "active_contract_closed" | "satisfied_by_proposal" | "satisfied_by_successor";
23
+ export interface ContractRequirement {
24
+ /** The next round must have an active contract when this round commits. */
25
+ required: boolean;
26
+ reason: ContractRequirementReason;
27
+ activeContractId: string | null;
28
+ }
29
+ export interface ContractRequirementInput {
30
+ shouldContinue: boolean;
31
+ /** The round declares `outcome: "blocked"`. Defensive: blocked normally
32
+ * also means `shouldContinue === false`. */
33
+ blocked: boolean;
34
+ /** `round_contract` is present in this submission. */
35
+ proposalPresent: boolean;
36
+ activeContract: ActiveContractView | null;
37
+ /** The active contract's closure for the round being decided. */
38
+ closure: ContractItemStatusView["closure"];
39
+ /** At least one enabled, after-capable evidence command exists. Without it
40
+ * no contract can ever be machine-verified, so no contract is required. */
41
+ contractCapability: boolean;
42
+ /** Whether the state machine permits another round after this submission.
43
+ * A terminal max-round boundary has no consumer for a proposal. */
44
+ successorRoundAvailable?: boolean;
45
+ }
46
+ export declare function deriveContractRequirement(input: ContractRequirementInput): ContractRequirement;
47
+ //# sourceMappingURL=contract-requirement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-requirement.d.ts","sourceRoot":"","sources":["../src/contract-requirement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,yBAAyB,GACjC,gBAAgB,GAChB,SAAS,GACT,oBAAoB,GACpB,wBAAwB,GACxB,oBAAoB,GACpB,2BAA2B,GAC3B,wBAAwB,GACxB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,yBAAyB,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,OAAO,CAAC;IACxB;iDAC6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,iEAAiE;IACjE,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC3C;gFAC4E;IAC5E,kBAAkB,EAAE,OAAO,CAAC;IAC5B;wEACoE;IACpE,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,wBAAwB,GAC9B,mBAAmB,CA8BrB"}
@@ -0,0 +1,51 @@
1
+ /** v4.0.6: contract coverage — the ONE shared requirement derivation.
2
+ *
3
+ * A round that continues with contract capability must leave an ACTIVE
4
+ * contract for the next round. This module answers only that structural
5
+ * question: does the next round have a contract, and where does the current
6
+ * proposal leave it? It never judges whether the slice is a real
7
+ * deliverable, whether an item is a good acceptance condition, or whether a
8
+ * command is the right test.
9
+ *
10
+ * It is a PURE function of facts the caller already derived — it reads no
11
+ * store, no session and no policy global. The compile-time caller, the
12
+ * pre-advance submission boundary and the post-evidence coordinator all pass
13
+ * the same facts through this one rule, so they cannot disagree about
14
+ * whether a contract was required.
15
+ *
16
+ * The active contract is the one derived from committed rounds
17
+ * (`ActiveContractView`); `closure` is the item reducer's verdict for the
18
+ * round being decided (or `"open"` before evidence exists).
19
+ */
20
+ export function deriveContractRequirement(input) {
21
+ const activeContractId = input.activeContract?.id ?? null;
22
+ if (!input.shouldContinue) {
23
+ return { required: false, reason: "not_continuing", activeContractId };
24
+ }
25
+ if (input.blocked) {
26
+ return { required: false, reason: "blocked", activeContractId };
27
+ }
28
+ if (!input.contractCapability) {
29
+ return { required: false, reason: "no_contract_capability", activeContractId };
30
+ }
31
+ if (input.successorRoundAvailable === false) {
32
+ return { required: false, reason: "no_successor_round", activeContractId };
33
+ }
34
+ if (!input.activeContract) {
35
+ return input.proposalPresent
36
+ ? { required: false, reason: "satisfied_by_proposal", activeContractId }
37
+ : { required: true, reason: "no_active_contract", activeContractId };
38
+ }
39
+ if (input.closure === "open") {
40
+ // Omitting the proposal continues the same contract. A different proposal
41
+ // is a separate structural question (`contract_premature`); coverage
42
+ // itself is already satisfied by the continuing contract.
43
+ return { required: false, reason: "active_contract_continues", activeContractId };
44
+ }
45
+ // verified / superseded / blocked: the current contract will not govern the
46
+ // next round, so a successor proposal must be present.
47
+ return input.proposalPresent
48
+ ? { required: false, reason: "satisfied_by_successor", activeContractId }
49
+ : { required: true, reason: "active_contract_closed", activeContractId };
50
+ }
51
+ //# sourceMappingURL=contract-requirement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-requirement.js","sourceRoot":"","sources":["../src/contract-requirement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAyCH,MAAM,UAAU,yBAAyB,CACvC,KAA+B;IAE/B,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,IAAI,CAAC;IAC1D,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACzE,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAClE,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC9B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,CAAC;IACjF,CAAC;IACD,IAAI,KAAK,CAAC,uBAAuB,KAAK,KAAK,EAAE,CAAC;QAC5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;IAC7E,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,eAAe;YAC1B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,gBAAgB,EAAE;YACxE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;IACzE,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC7B,0EAA0E;QAC1E,qEAAqE;QACrE,0DAA0D;QAC1D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,CAAC;IACpF,CAAC;IACD,4EAA4E;IAC5E,uDAAuD;IACvD,OAAO,KAAK,CAAC,eAAe;QAC1B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,gBAAgB,EAAE;QACzE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** The ONE criterion-status derivation over committed history.
2
+ *
3
+ * The compiler and the submission boundary/guidance used to reach this fact
4
+ * through different inputs: the compiler re-read the caller's compile
5
+ * context, while `submission-guidance` read `criterion_statuses` off the
6
+ * session's cached compile response. That cache does not survive a restart
7
+ * and could disagree with the Vault after a replay. This module takes
8
+ * committed round views only, so both surfaces derive the same rows.
9
+ *
10
+ * It deliberately lives outside `loop-compiler.ts`: `loop-compiler.ts` imports
11
+ * `submission-guidance.ts`, so the reverse import would be a cycle. */
12
+ import type { CriterionStatus } from "./protocol.js";
13
+ import type { CriterionMachineFact } from "./round-facts.js";
14
+ import type { CommittedRoundView } from "./committed-round.js";
15
+ export interface CriterionStatusInput {
16
+ /** Committed rounds below `currentRound`. */
17
+ rounds: ReadonlyArray<CommittedRoundView>;
18
+ currentRound: number;
19
+ /** Only `success_criteria` is read; the rest of the objective is not a
20
+ * criterion fact. */
21
+ objective: {
22
+ success_criteria: ReadonlyArray<string>;
23
+ } | null;
24
+ criterionFacts?: ReadonlyArray<CriterionMachineFact>;
25
+ }
26
+ /** v3.2/v4.0.3: Derive per-criterion status — the "goal → criteria →
27
+ * evidence" vertical view.
28
+ *
29
+ * Without a machine fact the LATEST claim wins (a criterion claimed met in
30
+ * R2 and reported remaining in R4 is `remaining`), and the row records that
31
+ * claim round with `status_source: "agent"`. A machine fact from a verified
32
+ * contract item outranks every claim and records its own round/source. Zero
33
+ * persistence — re-derived from committed facts every time. */
34
+ export declare function deriveCriterionStatuses(input: CriterionStatusInput): CriterionStatus[];
35
+ //# sourceMappingURL=criterion-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criterion-status.d.ts","sourceRoot":"","sources":["../src/criterion-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;wEAUwE;AAExE,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAgB/D,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,MAAM,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB;0BACsB;IACtB,SAAS,EAAE;QAAE,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,cAAc,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACtD;AAED;;;;;;;gEAOgE;AAChE,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,oBAAoB,GAC1B,eAAe,EAAE,CA+DnB"}
@@ -0,0 +1,89 @@
1
+ /** The ONE criterion-status derivation over committed history.
2
+ *
3
+ * The compiler and the submission boundary/guidance used to reach this fact
4
+ * through different inputs: the compiler re-read the caller's compile
5
+ * context, while `submission-guidance` read `criterion_statuses` off the
6
+ * session's cached compile response. That cache does not survive a restart
7
+ * and could disagree with the Vault after a replay. This module takes
8
+ * committed round views only, so both surfaces derive the same rows.
9
+ *
10
+ * It deliberately lives outside `loop-compiler.ts`: `loop-compiler.ts` imports
11
+ * `submission-guidance.ts`, so the reverse import would be a cycle. */
12
+ import { criterionRefMatches, deriveCriterionId, } from "./token-utils.js";
13
+ function claimsFor(view, text) {
14
+ return (view.executionReport?.claims ?? [])
15
+ .filter((claim) => claim.id.startsWith("cr-") && criterionRefMatches(claim.id, text))
16
+ .map((claim) => claim.outcome);
17
+ }
18
+ /** v3.2/v4.0.3: Derive per-criterion status — the "goal → criteria →
19
+ * evidence" vertical view.
20
+ *
21
+ * Without a machine fact the LATEST claim wins (a criterion claimed met in
22
+ * R2 and reported remaining in R4 is `remaining`), and the row records that
23
+ * claim round with `status_source: "agent"`. A machine fact from a verified
24
+ * contract item outranks every claim and records its own round/source. Zero
25
+ * persistence — re-derived from committed facts every time. */
26
+ export function deriveCriterionStatuses(input) {
27
+ const objectiveCriteria = input.objective?.success_criteria ?? [];
28
+ if (objectiveCriteria.length === 0)
29
+ return [];
30
+ const rounds = input.rounds
31
+ .filter((round) => round.round >= 1 && round.round < input.currentRound)
32
+ .sort((a, b) => a.round - b.round);
33
+ const factsByCriterion = new Map((input.criterionFacts ?? []).map((fact) => [fact.criterion_id, fact]));
34
+ // v3.9.4: one row per derived id. The objective is authored text; a case or
35
+ // whitespace variant derives the same cr-* and must not produce a second
36
+ // row (nor a second contract reference space).
37
+ const seenIds = new Set();
38
+ const statuses = [];
39
+ for (const text of objectiveCriteria) {
40
+ const id = deriveCriterionId(text);
41
+ if (seenIds.has(id))
42
+ continue;
43
+ seenIds.add(id);
44
+ // Latest-claim wins: scan ascending and keep the last claim seen.
45
+ let latestOutcome = null;
46
+ let latestClaimRound = null;
47
+ for (const round of rounds) {
48
+ const claims = claimsFor(round, text);
49
+ if (claims.length === 0)
50
+ continue;
51
+ const outcome = claims[claims.length - 1];
52
+ if (outcome !== latestOutcome) {
53
+ latestOutcome = outcome;
54
+ latestClaimRound = round.round;
55
+ }
56
+ else {
57
+ // A repeated same-direction claim still advances the claim round.
58
+ latestClaimRound = round.round;
59
+ }
60
+ }
61
+ const fact = factsByCriterion.get(id);
62
+ if (fact?.status) {
63
+ statuses.push({
64
+ id,
65
+ text,
66
+ status: fact.status,
67
+ ...(fact.status_at_round !== undefined
68
+ ? { status_at_round: fact.status_at_round }
69
+ : {}),
70
+ status_source: "machine",
71
+ });
72
+ continue;
73
+ }
74
+ statuses.push({
75
+ id,
76
+ text,
77
+ status: latestOutcome === "met"
78
+ ? "claimed"
79
+ : latestOutcome === "remaining"
80
+ ? "remaining"
81
+ : "unknown",
82
+ ...(latestOutcome !== null && latestClaimRound !== null
83
+ ? { status_at_round: latestClaimRound, status_source: "agent" }
84
+ : {}),
85
+ });
86
+ }
87
+ return statuses;
88
+ }
89
+ //# sourceMappingURL=criterion-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criterion-status.js","sourceRoot":"","sources":["../src/criterion-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;wEAUwE;AAOxE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,SAAS,SAAS,CAChB,IAAwB,EACxB,IAAY;IAEZ,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,IAAI,EAAE,CAAC;SACxC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAChB,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;SACnE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAYD;;;;;;;gEAOgE;AAChE,MAAM,UAAU,uBAAuB,CACrC,KAA2B;IAE3B,MAAM,iBAAiB,GAAG,KAAK,CAAC,SAAS,EAAE,gBAAgB,IAAI,EAAE,CAAC;IAClE,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,MAA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AG,KAAK,CAAC,KAAK,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,kEAAkE;gBAClE,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC;YACjC,CAAC;QACH,CAAC;QAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;YACjB,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE;gBACF,IAAI;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS;oBACpC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE;oBAC3C,CAAC,CAAC,EAAE,CAAC;gBACP,aAAa,EAAE,SAAS;aACzB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC;YACZ,EAAE;YACF,IAAI;YACJ,MAAM,EAAE,aAAa,KAAK,KAAK;gBAC7B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,aAAa,KAAK,WAAW;oBAC7B,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,SAAS;YACf,GAAG,CAAC,aAAa,KAAK,IAAI,IAAI,gBAAgB,KAAK,IAAI;gBACrD,CAAC,CAAC,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAgB,EAAE;gBACxE,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -18,70 +18,44 @@
18
18
  */
19
19
  import type { VaultEntry } from "./loop-store.js";
20
20
  import type { EnforcementResult, SelfEvaluation, VerificationFlag, VerificationResult } from "./protocol.js";
21
+ import { type RoundProgress } from "./progress.js";
21
22
  /** Scan backwards from currentRound to find the most recent clean round.
22
23
  * Collects discovered_constraints from skipped rounds along the way.
23
24
  * Returns null when no clean round is found within maxDepth. */
24
- export declare function findSafeRestorePoint(currentRound: number, vaultEntries: VaultEntry[], maxDepth: number): {
25
+ export declare function findSafeRestorePoint(currentRound: number, vaultEntries: VaultEntry[], maxDepth: number,
26
+ /** v3.9.7: a candidate must have a materialized restore checkpoint. */
27
+ isEligible?: (round: number) => boolean): {
25
28
  round: number;
26
29
  skippedDiscoveries: string[];
27
30
  } | null;
28
- /** v2.12: The restore point's machine snapshot. `head` is the commit the
29
- * workspace must return to; `dirtyFiles` is what was ALREADY dirty there —
30
- * the baseline a restored workspace is compared against, so unrelated work
31
- * in progress is never mistaken for a failed restore. Read from the restore
32
- * round's committed transaction snapshot (after evidence preferred, before
33
- * evidence as fallback). Returns null when the round has no git snapshot or
34
- * no committed feedback entry. */
35
- export interface BacktrackTargetSnapshot {
36
- head: string;
37
- dirtyFiles: string[];
38
- }
39
- export declare function findBacktrackTargetSnapshot(restoreRound: number, vaultEntries: VaultEntry[]): BacktrackTargetSnapshot | null;
40
- /** Build the backtrack prompt injected at the top of the restored round.
41
- *
42
- * v2.13: Includes concrete workspace restore instructions with affected
43
- * file lists from skipped rounds. The agent must restore the working tree
44
- * to the clean round's state before proceeding. */
45
- export interface BacktrackRecoveryFacts {
46
- /** v3.7.1: Rolled-back rounds (restore point + 1 … trigger round). */
47
- failedRounds: number[];
48
- /** v3.7.1: One approach per failed round — what must NOT be repeated. */
49
- approaches: string[];
50
- /** v3.7.1: Falsified assumptions collected from the failed rounds. */
51
- wrongAssumptions: string[];
52
- }
53
31
  /** v3.8.1: the ONE Recovery Brief renderer.
54
32
  *
55
- * The rollback prompt and the state file's Recent tier used to carry two
56
- * hand-written copies of these lines — differing in punctuation
57
- * ("the redo is round N" vs "redo round N") and in whether an approach
58
- * overflow count was shown at all. Two renderers over one rollback meant the
59
- * two surfaces could describe the same event differently while both claiming
60
- * to be derived facts. The facts are supplied by the caller: the coordinator
61
- * from its live walk, the compile path from `decodeBacktrackRecord` on the
33
+ * v3.9.4: it is the shared fact renderer for the prompt's protected
34
+ * `recovery` section and the state file's Recent tier. The post-compile
35
+ * backtrack prompt (and its action advice) is gone: `committedBacktrackBrief`
36
+ * appends the restore HEAD/file set and the artifact is the delivered prompt.
37
+ * The facts are supplied by the caller from `decodeBacktrackRecord` on the
62
38
  * committed decision. */
63
39
  export declare function recoveryBriefLines(input: {
64
- target: number;
40
+ /** v3.9.7: the first round of the child branch. The workspace was restored
41
+ * to the selected checkpoint BEFORE this prompt was compiled. */
42
+ redoRound: number;
43
+ checkpointId?: string;
44
+ restoreVerified?: boolean;
65
45
  triggerRule: string;
46
+ origin?: "agent" | "machine";
47
+ /** Agent reason (agent origin) or machine failure reason. */
48
+ reason?: string;
49
+ /** v3.9.4: the enforcement gate's own sentence for WHY it rolled back. */
50
+ failureReason?: string;
66
51
  failedRounds: string[] | number[];
67
52
  approaches: string[];
68
53
  wrongAssumptions: string[];
54
+ preservedDiscoveries?: string[];
69
55
  recoveryRoundId?: string;
70
56
  maxApproaches?: number;
71
57
  maxAssumptions?: number;
72
58
  }): string[];
73
- export declare function buildBacktrackPrompt(fromRound: number, toRound: number, triggerRule: string, skippedDiscoveries: string[],
74
- /** v2.13: Files changed in the skipped rounds (from evidence snapshots).
75
- * Used to show the agent exactly what needs to be reverted. */
76
- skippedFiles?: string[],
77
- /** v2.12: Git HEAD commit hash at the backtrack point (current HEAD).
78
- * The agent must discard work back to the clean round's state. */
79
- gitHead?: string,
80
- /** v3.7.1: The redo submission's roundId (loop:<id>:round:<toRound+1>). */
81
- recoveryRoundId?: string,
82
- /** v3.7.1: Derived Recovery Brief facts — committed facts + the
83
- * in-flight attempt only; never rejected payloads. */
84
- recovery?: BacktrackRecoveryFacts): string;
85
59
  export declare function enforceRound(selfEval: SelfEvaluation, verifyResult: VerificationResult, currentRound: number, vaultEntries: VaultEntry[], consecutiveRejections?: number,
86
60
  /** L4 (v3.7.x): which check rejected the PREVIOUS round. The coordinator
87
61
  * resets consecutiveRejections to 1 whenever the check changes, so the
@@ -89,29 +63,20 @@ export declare function enforceRound(selfEval: SelfEvaluation, verifyResult: Ver
89
63
  * check and lets uniform rows escalate on THEIR OWN streak instead of
90
64
  * inheriting an unrelated history. */
91
65
  lastRejectionCheck?: string,
92
- /** v3.8.3: the coordinator has verified that this round declares itself
93
- * blocked AND that its new contract proposal's scope covers every file the
94
- * round changed outside the active contract's scope. Computed there, not
95
- * here: neither the observations nor the active contract reach this
96
- * function. See `enforceScopeDrift`. */
97
- scopeDriftWaiver?: boolean,
98
- /** v3.9: the submitted round's own Git motion — see `inFlightGitMotion`.
99
- * null when no Git observation was made. */
100
- inFlightMotion?: boolean | null): EnforcementResult;
101
- /** Build a rejection prompt for the agent.
102
- *
103
- * The prompt clearly states the round was rejected, why, what the agent
104
- * must fix, and that the agent must redo the SAME round (not advance).
66
+ /** v3.9.7: the submitted round's provider-neutral progress. */
67
+ inFlightProgress?: RoundProgress): EnforcementResult;
68
+ /** Build the protected retry notice for the agent.
105
69
  *
106
- * v2.7: Accepts verificationFlags to render a diagnostic "Evidence Gap"
107
- * section. Each error/warn flag becomes a concrete claim-vs-evidence
108
- * mismatch statement so the agent knows exactly what to correct rather
109
- * than retrying blindly.
70
+ * v3.9.7: this is a protocol fact, not a second task narrative. It carries
71
+ * the enforcement reason, the required fix and the same-round instruction.
72
+ * Findings are rendered exactly once by the mandatory Verification Gate; the
73
+ * original task/contract is rendered by Objective/Current Task. The notice
74
+ * never promises that an explanation will re-evaluate a machine fact.
110
75
  *
111
76
  * @param currentRound The round number that was rejected (NOT incremented).
112
- * @param task The original loop task description.
77
+ * @param _task Kept for the public signature; not rendered here.
113
78
  * @param enforceResult The enforcement decision with reason and fix instructions.
114
- * @param verificationFlags The verification gate's findings for this round.
115
- * Used to build the Evidence Gap section. */
116
- export declare function buildRejectionPrompt(currentRound: number, task: string, enforceResult: EnforcementResult, verificationFlags?: VerificationFlag[]): string;
79
+ * @param _verificationFlags Kept for the public signature; findings render in
80
+ * the mandatory Verification Gate. */
81
+ export declare function buildRejectionPrompt(currentRound: number, _task: string, enforceResult: EnforcementResult, _verificationFlags?: VerificationFlag[]): string;
117
82
  //# sourceMappingURL=enforcement-gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enforcement-gate.d.ts","sourceRoot":"","sources":["../src/enforcement-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAwDvB;;iEAEiE;AACjE,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,UAAU,EAAE,EAC1B,QAAQ,EAAE,MAAM,GACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAgCxD;AAED;;;;;;mCAMmC;AACnC,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,UAAU,EAAE,GACzB,uBAAuB,GAAG,IAAI,CAgBhC;AAED;;;;oDAIoD;AACpD,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,yEAAyE;IACzE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;;;;;0BAS0B;AAC1B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC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