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
@@ -1 +0,0 @@
1
- {"version":3,"file":"loop-extras-parser.js","sourceRoot":"","sources":["../src/loop-extras-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,8EAA8E;AAE9E,MAAM,OAAO,iBAAiB;IAC5B;;iFAE6E;IACpE,MAAM,GAAiB,EAAE,CAAC;IAElB,MAAM,CAA0B;IAEjD,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,0EAA0E;IAE1E;2DACuD;IACvD,MAAM,CAAC,GAAW,EAAE,QAAQ,GAAG,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,GAAG,KAAK,SAAS,IAA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B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACpB,OAAQ,IAAgC,CAAC,QAAQ,KAAK,QAAQ;YAC9D,OAAQ,IAAgC,CAAC,KAAK,KAAK,QAAQ;YAC3D,OAAQ,IAAgC,CAAC,KAAK,KAAK,QAAQ;YAC3D,OAAQ,IAAgC,CAAC,MAAM,KAAK,QAAQ,EAC5D,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,IAAmC,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;gBACd,KAAK,EAAE,sBAAsB,CAAC,GAAG;gBACjC,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,6 +0,0 @@
1
- /** Typed adapter over cognitive facts. It performs no vault traversal or
2
- * independent state derivation. */
3
- import type { DerivedCognitiveFacts } from "./cognitive-facts.js";
4
- import type { LoopProjection } from "./protocol.js";
5
- export declare function buildLoopProjection(facts: DerivedCognitiveFacts): LoopProjection | null;
6
- //# sourceMappingURL=loop-projection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loop-projection.d.ts","sourceRoot":"","sources":["../src/loop-projection.ts"],"names":[],"mappings":"AAAA;mCACmC;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,qBAAqB,GAC3B,cAAc,GAAG,IAAI,CAuBvB"}
@@ -1,28 +0,0 @@
1
- /** Typed adapter over cognitive facts. It performs no vault traversal or
2
- * independent state derivation. */
3
- import { makeLoopProjection } from "./protocol.js";
4
- export function buildLoopProjection(facts) {
5
- const projection = makeLoopProjection({
6
- focus: facts.focus,
7
- todo: [...facts.todo],
8
- phase: facts.phase,
9
- delegation: {
10
- pending: facts.delegation.pending,
11
- last_results: [...facts.delegation.last_results],
12
- },
13
- handoff: {
14
- summary: facts.handoff.summary,
15
- verified: [...facts.handoff.verified],
16
- open_risks: [...facts.handoff.open_risks],
17
- },
18
- verified_subgoals: [...facts.verified_subgoals],
19
- });
20
- const empty = projection.focus === null && projection.todo.length === 0 &&
21
- projection.phase === null && projection.delegation.last_results.length === 0 &&
22
- projection.handoff.summary.length === 0 &&
23
- projection.handoff.verified.length === 0 &&
24
- projection.handoff.open_risks.length === 0 &&
25
- projection.verified_subgoals.length === 0;
26
- return empty ? null : projection;
27
- }
28
- //# sourceMappingURL=loop-projection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loop-projection.js","sourceRoot":"","sources":["../src/loop-projection.ts"],"names":[],"mappings":"AAAA;mCACmC;AAInC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CACjC,KAA4B;IAE5B,MAAM,UAAU,GAAG,kBAAkB,CAAC;QACpC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;QACrB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE;YACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO;YACjC,YAAY,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;SACjD;QACD,OAAO,EAAE;YACP,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;YAC9B,QAAQ,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YACrC,UAAU,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;SAC1C;QACD,iBAAiB,EAAE,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC;KAChD,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,KAAK,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QACrE,UAAU,CAAC,KAAK,KAAK,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC5E,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QACvC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAC1C,UAAU,CAAC,iBAAiB,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;AACnC,CAAC"}
@@ -1,370 +0,0 @@
1
- ---
2
- name: perception
3
- description: Drive multi-round coding tasks through LoopForge MCP so objectives, constraints, evidence, and decisions survive context loss and restarts. The external Agent remains responsible for planning, file changes, tools, and execution.
4
- ---
5
-
6
- # Perception
7
-
8
- Use LoopForge when a task spans several meaningful work slices, must survive a
9
- restart or context loss, or needs an auditable distinction between Agent claims
10
- and machine-verified facts.
11
-
12
- LoopForge has one factual source, committed typed round documents in the Vault,
13
- and one cognitive source, Canonical State compiled from those documents. The
14
- Agent still decides what to do and how to reason.
15
-
16
- ## Start
17
-
18
- Call `loopforge_status` with `view: "all"` before starting. Reuse an existing
19
- session for the same objective instead of opening a second loop.
20
-
21
- Call `loopforge_start` with:
22
-
23
- - `task`: the complete user objective;
24
- - `constraints`: hard boundaries that must survive every round;
25
- - optional `maxRounds`, `domain`, `loopId`, and `planSource`.
26
-
27
- Keep the returned `sessionId`, `roundId`, prompt, and level. Pass the latest
28
- `roundId` to every `loopforge_next`; it anchors the submission to the exact
29
- round being reported.
30
-
31
- ## What is a round?
32
-
33
- A round is one coherent work slice that can be described, checked, and
34
- disposed of at the next boundary. It is not a fixed number of files, tokens,
35
- commits, or minutes. A capable Agent may complete a large change in one round
36
- when the change shares one objective, one evidence story, and one recovery
37
- path. Split it when those boundaries diverge.
38
-
39
- Before choosing the slice, ask:
40
-
41
- 1. **Coherence:** does the work serve one immediate objective rather than
42
- several unrelated goals?
43
- 2. **Verifiability:** can the result and its hard constraints be checked with
44
- the available tests, commands, or other machine observations?
45
- 3. **Disposition:** will the boundary produce a clear continuation, stop,
46
- blocker, rejection, or recovery decision?
47
- 4. **Recovery:** can the slice be safely retried or rolled back without
48
- invalidating unrelated work?
49
-
50
- Make a round larger when changes are tightly coupled and can be verified
51
- together. Make it smaller when uncertainty, external effects, evidence gaps,
52
- or rollback risk is high. Do not combine independent objectives merely because
53
- the Agent can edit them in one context. Do not split a single atomic change
54
- only to create more round records.
55
-
56
- At the end of a round, inspect the actual diff, relevant tests, hard
57
- constraints, and remaining work. A completed slice is not the same as a
58
- completed task.
59
-
60
- ## Plan the next slice
61
-
62
- For work that spans rounds, submit `round_contract` as a proposal for the next
63
- slice. Size the slice by what one machine-checkable outcome covers — a
64
- requirements list is not a round list, and coupled changes that share one
65
- objective, one evidence story, and one recovery path belong in the same round.
66
- Bind each item to a configured evidence command with `verify_with`, and limit
67
- `scope` to files or directories that slice may touch. The proposal becomes
68
- active only after its declaring round commits.
69
- While it is open, you do **not** need to restate it: omitting `round_contract`
70
- continues the active contract. A different proposal is ignored as
71
- `contract_premature`. If this round closes the contract and another slice
72
- follows, declare the successor in this same submission. If the slice is
73
- blocked, report `outcome: "blocked"` with a concrete `blocker` instead of
74
- silently replacing the active contract.
75
-
76
- This is a planning aid, not a second gate. LoopForge learns the plan only from
77
- committed evaluation fields, contract proposals, observations, and changes.
78
-
79
- ## Execute a round
80
-
81
- 1. Execute the returned prompt and do the repository work.
82
- 2. Use the tools and reasoning approach that fit the slice.
83
- 3. Check actual evidence before claiming success.
84
- 4. Submit exactly one structured evaluation with `loopforge_next`.
85
-
86
- After the strict boundary accepts the payload, LoopForge collects before/after
87
- evidence, runs the **verification gate**, then runs the **enforcement gate**.
88
- The verification gate checks evaluation consistency, evidence integrity, plan
89
- and contract conformance, and progress and recovery. The enforcement gate
90
- turns those findings into one disposition: accept, reject, backtrack, or
91
- terminate.
92
-
93
- The four core evaluation fields are strict:
94
-
95
- | Field | Requirement |
96
- | --- | --- |
97
- | `success` | Boolean. `true` only when the whole objective and hard constraints are satisfied. |
98
- | `output_summary` | String describing what changed and what was verified. |
99
- | `constraint_violations` | Array of real violations, preferably using `c-XXXXXXXX` IDs. |
100
- | `should_continue` | Boolean. `false` only when the whole task is complete. |
101
-
102
- Before submitting, check whether any of these events actually happened. Fill the
103
- matching field only when it did; omit it otherwise.
104
-
105
- | Event | Field | What LoopForge does with it |
106
- | --- | --- | --- |
107
- | The round changed files or ran tests | `execution_report.files_changed`, `execution_report.tests_reported` | Compares the report with machine observations; test counts stay self-reported |
108
- | You found a constraint later rounds must respect | `discovered_constraints` | The compiler merges it into the active set |
109
- | Evidence falsified an earlier assumption | `wrong_assumptions` | Feeds corrected-assumption state and recovery facts |
110
- | A sub-problem surfaced | `emerged_subtasks` | The only sub-goal creation channel |
111
- | An active sub-goal moved status | `subgoal_updates` | Applies an explicit transition |
112
- | You delegated work | `worker_results` | Saves the report and delegation journal entry; does **not** promote worker discoveries |
113
- | You are planning the next slice | `round_contract` | Becomes active only after this round commits |
114
- | A contract item progressed | `execution_report.contract_item_claims` | Starts machine evaluation; the item is verified only when its bound commands pass |
115
- | A success criterion moved | `execution_report.criterion_claims` | Advisory; cite the real `cr-` id/text from the prompt. Unknown references are dropped with a diagnostic; machine evidence still decides |
116
- | You need context emphasized | `prompt_requests` | Exact-match reorder or confusion alerts in the next prompt; never long-term knowledge |
117
- | You reached a meaningful boundary | `compression_checkpoint`, `checkpoint_label` | Creates a recoverable milestone |
118
- | You are blocked or stopping | `outcome`, `blocker`, `stop_reason`, `no_change_reason` | Runs the corresponding stop/lifecycle rule |
119
- | You understand the objective better | `objective_refinement` | Appends to the objective; never replaces it |
120
- | A constraint or criterion is wrong | `retracted_constraints`, `revised_success_criteria` | Updates derived state within existing boundaries |
121
- | You need a prior approval checked | `gate_ids`; `retroactiveClaims` | Checks existing gate references or prior-round evidence |
122
-
123
- `execution_report.files_changed` is the **boundary net change**: paths whose
124
- content or file type differs between round preparation and this submission,
125
- including deletions. A commit alone adds no entry when content is unchanged.
126
- Do not list gitignored paths merely to look complete. The receipt's
127
- `files_reconciliation` block compares your report with the machine change set
128
- and reports match/mismatch/unknown/not_applicable; an unobservable Git boundary
129
- is `unknown`, never an empty diff.
130
-
131
- `emerged_subtasks` is the only sub-goal creation channel. It contains plain
132
- descriptions, never `sg-` IDs. `subgoal_updates` changes existing active IDs;
133
- done and canceled are terminal and cannot be reopened. The prompt or
134
- `submission_guidance` renders the real active IDs; never invent one.
135
-
136
- `outcome` may be `success`, `partial`, `failed`, or `blocked`. A blocked
137
- outcome needs a concrete `blocker`; `stop_reason` of `blocked` or
138
- `needs_human_input` also stops without claiming success.
139
-
140
- Optional malformed values are normalized or dropped. The strict exceptions are
141
- `subgoal_updates`, `round_contract`, and
142
- `execution_report.contract_item_claims`. Shape, reference, duplicate, command,
143
- and workspace-containment errors return `evaluation_invalid` or
144
- `contract_invalid` before advance. Correct the payload and resubmit the same
145
- `roundId`; nothing is committed and no rejection counter moves.
146
-
147
- A successful round should include an `execution_report`. An empty or missing
148
- report is a reporting gap (a `warn`), not by itself a rejection: acceptance is
149
- decided by machine evidence and contract rules, never by how many optional
150
- fields were filled. `no_change_reason` is an escape only when no enabled
151
- verification command exists. It never creates evidence and never excuses an
152
- open contract.
153
-
154
- Agent reports are claims quoted for audit. They never become verified facts.
155
- Do not infer a missing field from natural language, do not fill a field to
156
- satisfy a coverage check, and do not put a guessed evaluation in free text.
157
- When no event occurred, omit the field.
158
-
159
- Each prepared response carries `submission_guidance` with the real contract
160
- item ids/statuses, active sub-goal ids, real criterion ids/text, usable
161
- commands and the fields that apply now. Each submission returns
162
- `submission_receipt`, which separates: reports that were saved, derived state
163
- that actually changed, and machine verification results, plus the structured
164
- `files_reconciliation` block. A report marked `saved` is not a verified fact.
165
-
166
- ## IDs and contracts
167
-
168
- Prompts render stable IDs beside constraints, criteria, sub-goals, and contract
169
- items. Prefer those IDs for `constraint_violations`, criterion claims, status
170
- updates, and item claims.
171
-
172
- A sub-goal ID belongs to its declaration event. Re-declaring the same text in a
173
- later round creates a new sub-goal. Status changes require the exact active
174
- `sg-` ID; description matching is not a fallback.
175
-
176
- A Round Contract is a set of evidence-bound items, not prose. Each item must
177
- bind at least one configured, enabled, after-capable command. The runtime
178
- derives content-addressed `rc-XXXXXXXX` and `rci-XXXXXXXX` IDs, so restating an
179
- unchanged proposal keeps its identity. `subgoal_refs` belongs on the item; a
180
- machine-verified item backs exactly the sub-goals it names, without changing
181
- their declared `SubGoal.status`.
182
-
183
- Item status is machine-derived:
184
-
185
- - `pending`: not claimed as met;
186
- - `insufficient`: claimed as met but not backed by all required observations;
187
- - `contradicted`: a bound observation fails, or its entrypoint/configuration is
188
- no longer trustworthy;
189
- - `verified`: the Agent claims `met`, every bound command passes in the closing
190
- round's after phase, and the declaration binding remains intact.
191
-
192
- The contract closes only when every item is `verified` or a round reports
193
- `outcome: "blocked"`. Repeated unbacked claims create bounded verification
194
- debt. The same-check streak escalates at
195
- `engine.unverified_claim_streak_limit` (default 3) instead of retrying forever.
196
-
197
- Sub-goals may evolve during execution. LoopForge does not use fuzzy intent or
198
- similarity to judge drift. The enforced boundary is contract `scope`: work
199
- outside it is `round_scope_drift`, a machine fact no explanation waives. Revert
200
- the out-of-scope change, or close the contract as blocked and declare the
201
- expanded scope in a new proposal whose `scope` covers **every** file this round
202
- changed outside the current one — a partial expansion is still drift.
203
-
204
- ## Evidence commands
205
-
206
- Contract items are backed by commands the OPERATOR configures. The Agent never
207
- declares one, and does not discover or run project scripts to invent one. They
208
- live in `loop_policy.json` under `evidence.commands`, in the workspace the
209
- server was started in:
210
-
211
- ```json
212
- {
213
- "version": "5",
214
- "evidence": {
215
- "commands": [{
216
- "name": "verify",
217
- "enabled": true,
218
- "executable": "node",
219
- "args": ["scripts/verify.mjs"],
220
- "cwd": ".",
221
- "phase": "after",
222
- "required": true,
223
- "timeout_ms": 120000,
224
- "max_output_chars": 8000,
225
- "success_exit_codes": [0]
226
- }]
227
- }
228
- }
229
- ```
230
-
231
- `executable` and `args` are spawned without a shell and confined to the
232
- workspace. `loopforge doctor` statically checks every configured command —
233
- its name, executable, arguments, timeouts, and workspace containment — and
234
- never executes one.
235
-
236
- Every prepared response carries `submission_guidance.contract_commands` and
237
- `submission_guidance.contract_verification_available`; `loopforge_status`
238
- `view=session` also returns the full `capability` object. When verification is
239
- unavailable, no configured command can back a contract item: run rounds without
240
- a contract instead of declaring items that cannot close. The `warnings` list
241
- states the same thing in words.
242
-
243
- A command's ENTRYPOINT is the file it names plus `package.json` when a package
244
- manager runs it. It must already be part of the workspace when the round
245
- starts, and it must not change during the round that runs it — the runtime
246
- records those files at round start and compares them afterwards, whether or not
247
- git can see them. A changed entrypoint makes the observation untrustworthy:
248
- restore it to its round-start content. Do not author the verification script
249
- inside the round you expect it to verify — that round cannot be closed by it.
250
-
251
- To keep a script that must survive a rollback, it has to be part of the
252
- committed workspace rather than an uncommitted change: the post-backtrack
253
- restore check rejects a skipped file that is still byte-identical to its state
254
- at the rollback, so a script left sitting in the working tree blocks the redo.
255
- Prepare it before the round that depends on it.
256
-
257
- ## Backtrack and recovery
258
-
259
- A progress stall requires observable Git history over the lookback window.
260
- Committed work counts as motion through the Git HEAD change, even when the
261
- closing worktree is clean, and the round you are submitting counts too: if it
262
- moved files or committed, it cancels the verdict. If machine history cannot be
263
- read, no stall verdict is made. A machine-backed success round is finishing,
264
- even if its closing round changes no files.
265
-
266
- Backtrack records a rollback directive and restores the round counter to the
267
- last clean committed round. Rejected attempts are never history. The next
268
- submission is the redo of `restorePoint + 1` and must reuse the prompt's round
269
- ID. A successful redo retires the rollback record.
270
-
271
- The Recovery Brief identifies the trigger, restore point, redo ID, failed
272
- approaches, falsified assumptions, valid discoveries, files to revert, and
273
- target HEAD. It states restoration facts, not a prescribed command.
274
-
275
- When backtrack occurs:
276
-
277
- 1. Restore the workspace exactly as requested before doing more work: the
278
- restore point's HEAD, with none of the failed rounds' changes left behind.
279
- Work in progress the restore point already carried may stay.
280
- 2. Submit one recovery evaluation from the restored state, so LoopForge can
281
- verify the restore before the redo's own work — and any commit — follows.
282
- 3. Read the Recovery Brief, restored prompt, and derived state.
283
- 4. Do not repeat a failed approach without addressing its cause.
284
- 5. Carry valid discoveries into later evaluations.
285
-
286
- If the rolled-back work used an active contract, close the stalled contract in
287
- the redo with `outcome: "blocked"` and declare the revised contract in that
288
- same submission. Restating the stalled contract commits more of the same.
289
-
290
- ## Interpret results
291
-
292
- - Non-null `prompt`: execute it and submit the next evaluation.
293
- - `enforcementAction: "reject"`: retry the same logical round and ID; the
294
- attempt increases.
295
- - `enforcementAction: "backtrack"`: restore the workspace, submit one recovery
296
- evaluation from the restored state, then redo the round from its restored
297
- prompt and round ID.
298
- - Null `prompt`: inspect `stopReason`.
299
-
300
- Read `submission_guidance` before composing the next evaluation, and read
301
- `verificationStatus`, `roundSuccess`, `level`, `warnings`, and
302
- `enforcementReason` before planning the next slice. In
303
- `submission_receipt.verification`, `contract_status` is the contract-item
304
- posture and `evidence_status` is the round-level machine evidence posture; do
305
- not read "no active contract" as "verified". `submission_receipt.reports`
306
- distinguishes a saved report from derived state that changed and from a machine
307
- verification result; `not_applied` means the submission did not become history.
308
- These are evidence postures, not subjective quality scores.
309
-
310
- Errors use `{ok: false, error: {code, message, retryable, ...}}`. Branch on the
311
- stable `code`, not the prose in `message`. Payload errors such as
312
- `evaluation_invalid`, `contract_invalid`, `policy_invalid`, and round-ID
313
- errors are retryable with the same ID. `session_not_found`, `state_unavailable`,
314
- and `gate_disabled` describe state or policy; do not blindly resubmit.
315
-
316
- `completed` means success plus every active contract item is `verified`, or
317
- there is no active contract. Explicit `blocked` always wins over success.
318
- `incomplete` means completion was not machine-verified. Other terminal reasons
319
- include `failed`, `max_rounds`, `stalled`, `enforcement_terminated`, `paused`,
320
- and `cancelled`.
321
-
322
- ## Prompt levels and views
323
-
324
- L0 is a lean same-round retry, L1 normal continuation, and L2 full
325
- rehydration. They control state density only, never a reasoning technique. L2
326
- comes from round facts such as the first round, a plan or checkpoint boundary,
327
- recovery, contradiction, or repeated rejection. It is not a round-count timer.
328
-
329
- Use `loopforge_status` with `view: "session"` for the live round,
330
- `view: "loop"` for committed health, `view: "all"` after a restart,
331
- `view: "audit"` for completeness and evidence, and `view: "explain"` for a
332
- round's active contract, observations, flags, and decision. Use
333
- `loopforge_replay` for the committed timeline and diffs.
334
-
335
- The optional `.loopforge/state/<loopId>-state.md` is derived and regenerable.
336
- Read it when an L2 prompt points to it, but never treat it as a second source
337
- of truth.
338
-
339
- ## Gates and delegation
340
-
341
- Use `loopforge_pause` for an intentional interruption,
342
- `loopforge_resume` to reconstruct a durable session, and `loopforge_stop` only
343
- for an intentional terminal stop.
344
-
345
- The two gate tools are opt-in through `policy.gate.enabled`. When enabled,
346
- `loopforge_gate_check` preflights a structured action with its description,
347
- scope, effects, reversibility, and authorization. Classification is
348
- conservative: anything not provably safe becomes `user_required`. Present the
349
- approval question, record the decision with `loopforge_gate_resolve`, and cite
350
- the approved gate ID in `evaluation.gate_ids`. LoopForge records the process,
351
- but cannot prove that a human was present because the Agent submits the resolve
352
- call. Safe investigation and dry-runs need no gate.
353
-
354
- Delegation does not create another LoopForge mode. Give each worker a
355
- self-contained subtask and hard constraints, then place the result in
356
- `worker_results`. A worker result is a report with its source: its
357
- `discoveredConstraints` does **not** enter the global constraint set by itself.
358
- If you accept a worker's finding, state it in top-level
359
- `discovered_constraints` — that is the only promotion channel.
360
-
361
- ## Rules
362
-
363
- 1. Execute the prompt instead of generating another prompt.
364
- 2. Submit one honest structured evaluation after each attempt.
365
- 3. Treat required command evidence and verification findings as authoritative.
366
- 4. Restore the workspace before working after backtrack.
367
- 5. Keep one loop focused on one user objective.
368
- 6. Do not advance a paused or stopped session through another process.
369
- 7. Continue in the same Agent task when possible. LoopForge preserves state but
370
- does not create a background Agent.