loopforge 1.12.0 → 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 (182) hide show
  1. package/README.md +172 -95
  2. package/dist/backends/interface.d.ts +3 -9
  3. package/dist/backends/interface.d.ts.map +1 -1
  4. package/dist/backends/interface.js +1 -5
  5. package/dist/backends/interface.js.map +1 -1
  6. package/dist/canonical-state.d.ts +53 -0
  7. package/dist/canonical-state.d.ts.map +1 -0
  8. package/dist/canonical-state.js +161 -0
  9. package/dist/canonical-state.js.map +1 -0
  10. package/dist/cli.d.ts +4 -0
  11. package/dist/cli.d.ts.map +1 -0
  12. package/dist/cli.js +227 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/enforcement-gate.d.ts +44 -0
  15. package/dist/enforcement-gate.d.ts.map +1 -0
  16. package/dist/enforcement-gate.js +271 -0
  17. package/dist/enforcement-gate.js.map +1 -0
  18. package/dist/engine.d.ts +17 -7
  19. package/dist/engine.d.ts.map +1 -1
  20. package/dist/engine.js +158 -249
  21. package/dist/engine.js.map +1 -1
  22. package/dist/evidence-provider.d.ts +113 -0
  23. package/dist/evidence-provider.d.ts.map +1 -0
  24. package/dist/evidence-provider.js +419 -0
  25. package/dist/evidence-provider.js.map +1 -0
  26. package/dist/index.d.ts +19 -11
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +16 -10
  29. package/dist/index.js.map +1 -1
  30. package/dist/init.d.ts +15 -0
  31. package/dist/init.d.ts.map +1 -0
  32. package/dist/init.js +49 -0
  33. package/dist/init.js.map +1 -0
  34. package/dist/interop.d.ts +30 -0
  35. package/dist/interop.d.ts.map +1 -0
  36. package/dist/interop.js +29 -0
  37. package/dist/interop.js.map +1 -0
  38. package/dist/loop-compiler.d.ts +14 -64
  39. package/dist/loop-compiler.d.ts.map +1 -1
  40. package/dist/loop-compiler.js +307 -2001
  41. package/dist/loop-compiler.js.map +1 -1
  42. package/dist/loop-store.d.ts +82 -0
  43. package/dist/loop-store.d.ts.map +1 -0
  44. package/dist/loop-store.js +332 -0
  45. package/dist/loop-store.js.map +1 -0
  46. package/dist/mcp/server.d.ts +9 -6
  47. package/dist/mcp/server.d.ts.map +1 -1
  48. package/dist/mcp/server.js +109 -73
  49. package/dist/mcp/server.js.map +1 -1
  50. package/dist/mcp/session.d.ts +84 -20
  51. package/dist/mcp/session.d.ts.map +1 -1
  52. package/dist/mcp/session.js +718 -316
  53. package/dist/mcp/session.js.map +1 -1
  54. package/dist/mcp/tools.d.ts +18 -268
  55. package/dist/mcp/tools.d.ts.map +1 -1
  56. package/dist/mcp/tools.js +225 -12
  57. package/dist/mcp/tools.js.map +1 -1
  58. package/dist/observability.d.ts +36 -16
  59. package/dist/observability.d.ts.map +1 -1
  60. package/dist/observability.js +82 -23
  61. package/dist/observability.js.map +1 -1
  62. package/dist/policy-metrics.d.ts +46 -0
  63. package/dist/policy-metrics.d.ts.map +1 -0
  64. package/dist/policy-metrics.js +146 -0
  65. package/dist/policy-metrics.js.map +1 -0
  66. package/dist/policy.d.ts +58 -75
  67. package/dist/policy.d.ts.map +1 -1
  68. package/dist/policy.js +122 -93
  69. package/dist/policy.js.map +1 -1
  70. package/dist/prompt-assembler.d.ts +30 -0
  71. package/dist/prompt-assembler.d.ts.map +1 -0
  72. package/dist/prompt-assembler.js +257 -0
  73. package/dist/prompt-assembler.js.map +1 -0
  74. package/dist/prompt-policy.d.ts +29 -0
  75. package/dist/prompt-policy.d.ts.map +1 -0
  76. package/dist/prompt-policy.js +51 -0
  77. package/dist/prompt-policy.js.map +1 -0
  78. package/dist/protocol.d.ts +117 -91
  79. package/dist/protocol.d.ts.map +1 -1
  80. package/dist/protocol.js +40 -36
  81. package/dist/protocol.js.map +1 -1
  82. package/dist/replay.d.ts.map +1 -1
  83. package/dist/replay.js +1 -27
  84. package/dist/replay.js.map +1 -1
  85. package/dist/round-coordinator.d.ts +90 -0
  86. package/dist/round-coordinator.d.ts.map +1 -0
  87. package/dist/round-coordinator.js +186 -0
  88. package/dist/round-coordinator.js.map +1 -0
  89. package/dist/round-driver.d.ts +53 -0
  90. package/dist/round-driver.d.ts.map +1 -0
  91. package/dist/round-driver.js +101 -0
  92. package/dist/round-driver.js.map +1 -0
  93. package/dist/round-transaction.d.ts +70 -0
  94. package/dist/round-transaction.d.ts.map +1 -0
  95. package/dist/round-transaction.js +290 -0
  96. package/dist/round-transaction.js.map +1 -0
  97. package/dist/runtime.d.ts +35 -17
  98. package/dist/runtime.d.ts.map +1 -1
  99. package/dist/runtime.js +357 -344
  100. package/dist/runtime.js.map +1 -1
  101. package/dist/storage.d.ts +38 -0
  102. package/dist/storage.d.ts.map +1 -0
  103. package/dist/storage.js +201 -0
  104. package/dist/storage.js.map +1 -0
  105. package/dist/verification-gate.d.ts +39 -7
  106. package/dist/verification-gate.d.ts.map +1 -1
  107. package/dist/verification-gate.js +198 -9
  108. package/dist/verification-gate.js.map +1 -1
  109. package/loop_policy.json +26 -47
  110. package/package.json +13 -10
  111. package/skills/perception/SKILL.md +80 -249
  112. package/dist/backends/fs.d.ts +0 -36
  113. package/dist/backends/fs.d.ts.map +0 -1
  114. package/dist/backends/fs.js +0 -358
  115. package/dist/backends/fs.js.map +0 -1
  116. package/dist/builder.d.ts +0 -12
  117. package/dist/builder.d.ts.map +0 -1
  118. package/dist/builder.js +0 -259
  119. package/dist/builder.js.map +0 -1
  120. package/dist/mcp-server.d.ts +0 -12
  121. package/dist/mcp-server.d.ts.map +0 -1
  122. package/dist/mcp-server.js +0 -14
  123. package/dist/mcp-server.js.map +0 -1
  124. package/dist/memory-bridge.d.ts +0 -47
  125. package/dist/memory-bridge.d.ts.map +0 -1
  126. package/dist/memory-bridge.js +0 -290
  127. package/dist/memory-bridge.js.map +0 -1
  128. package/dist/tests/_helpers.d.ts +0 -25
  129. package/dist/tests/_helpers.d.ts.map +0 -1
  130. package/dist/tests/_helpers.js +0 -47
  131. package/dist/tests/_helpers.js.map +0 -1
  132. package/dist/tests/builder.test.d.ts +0 -2
  133. package/dist/tests/builder.test.d.ts.map +0 -1
  134. package/dist/tests/builder.test.js +0 -110
  135. package/dist/tests/builder.test.js.map +0 -1
  136. package/dist/tests/engine.test.d.ts +0 -2
  137. package/dist/tests/engine.test.d.ts.map +0 -1
  138. package/dist/tests/engine.test.js +0 -371
  139. package/dist/tests/engine.test.js.map +0 -1
  140. package/dist/tests/generate-schema.test.d.ts +0 -8
  141. package/dist/tests/generate-schema.test.d.ts.map +0 -1
  142. package/dist/tests/generate-schema.test.js +0 -199
  143. package/dist/tests/generate-schema.test.js.map +0 -1
  144. package/dist/tests/loop-compiler.test.d.ts +0 -2
  145. package/dist/tests/loop-compiler.test.d.ts.map +0 -1
  146. package/dist/tests/loop-compiler.test.js +0 -1051
  147. package/dist/tests/loop-compiler.test.js.map +0 -1
  148. package/dist/tests/mcp.test.d.ts +0 -7
  149. package/dist/tests/mcp.test.d.ts.map +0 -1
  150. package/dist/tests/mcp.test.js +0 -485
  151. package/dist/tests/mcp.test.js.map +0 -1
  152. package/dist/tests/memory-bridge.test.d.ts +0 -8
  153. package/dist/tests/memory-bridge.test.d.ts.map +0 -1
  154. package/dist/tests/memory-bridge.test.js +0 -383
  155. package/dist/tests/memory-bridge.test.js.map +0 -1
  156. package/dist/tests/policy.test.d.ts +0 -2
  157. package/dist/tests/policy.test.d.ts.map +0 -1
  158. package/dist/tests/policy.test.js +0 -49
  159. package/dist/tests/policy.test.js.map +0 -1
  160. package/dist/tests/protocol.test.d.ts +0 -2
  161. package/dist/tests/protocol.test.d.ts.map +0 -1
  162. package/dist/tests/protocol.test.js +0 -73
  163. package/dist/tests/protocol.test.js.map +0 -1
  164. package/dist/tests/replay.test.d.ts +0 -2
  165. package/dist/tests/replay.test.d.ts.map +0 -1
  166. package/dist/tests/replay.test.js +0 -222
  167. package/dist/tests/replay.test.js.map +0 -1
  168. package/dist/tests/runtime.test.d.ts +0 -7
  169. package/dist/tests/runtime.test.d.ts.map +0 -1
  170. package/dist/tests/runtime.test.js +0 -323
  171. package/dist/tests/runtime.test.js.map +0 -1
  172. package/dist/tests/verification-gate.test.d.ts +0 -2
  173. package/dist/tests/verification-gate.test.d.ts.map +0 -1
  174. package/dist/tests/verification-gate.test.js +0 -407
  175. package/dist/tests/verification-gate.test.js.map +0 -1
  176. package/skills/prompt-techniques/SKILL.md +0 -52
  177. package/skills/prompt-techniques/references/chain-of-thought.md +0 -207
  178. package/skills/prompt-techniques/references/few-shot.md +0 -174
  179. package/skills/prompt-techniques/references/least-to-most.md +0 -182
  180. package/skills/prompt-techniques/references/step-back.md +0 -160
  181. package/skills/prompt-techniques/references/tree-of-thought.md +0 -191
  182. package/skills/prompt-techniques/references/zero-shot.md +0 -97
package/README.md CHANGED
@@ -1,137 +1,214 @@
1
1
  # LoopForge
2
2
 
3
- **Loop-Time Intelligence Layer** for AI coding agents. Per-iteration prompt compiler
4
- with structured memory, constraint inheritance, and drift correction — maintains
5
- cognitive stability across long-horizon agent loops. Supports single-agent and
6
- multi-agent (AgentTool / Coordinator) scenarios.
3
+ LoopForge is a cognitive state runtime for AI coding agents. It keeps a task's
4
+ objective, constraints, evidence, decisions, progress, and recovery state stable
5
+ across many Agent-driven rounds.
7
6
 
8
- Spec: [`../docs/loopforge-spec.md`](../docs/loopforge-spec.md)
7
+ The Agent still reads code, edits files, runs tools, and decides how to reason.
8
+ LoopForge does not provide a model, scheduler, or unattended worker. Its job is
9
+ to make a long task resumable and auditable without letting the prompt become the
10
+ only copy of the state.
9
11
 
10
- ## Quick Start
12
+ LoopForge 2.0 is currently available as `2.0.0`. It requires Node.js 18 or
13
+ newer and has no runtime dependencies.
14
+
15
+ ## Install
11
16
 
12
17
  ```bash
13
- npm install loopforge
18
+ npm install -g loopforge@next
19
+ loopforge init --client claude
20
+ claude mcp add loopforge -- npx loopforge mcp
21
+ ```
14
22
 
15
- # MCP server (recommended)
16
- claude mcp add loopforge -- npx loopforge-mcp
23
+ For Codex:
17
24
 
18
- # CLI
19
- npx loopforge init
20
- npx loopforge compile '{"task":"Audit ERC20","loop_id":"audit","round":1,"goal_id":"audit"}'
21
- npx loopforge status
25
+ ```bash
26
+ loopforge init --client codex
27
+ codex mcp add loopforge -- npx loopforge mcp
22
28
  ```
23
29
 
24
- ```typescript
25
- // Library API
26
- import { createEngine, ReplayBackend, FSBackend } from "loopforge";
27
-
28
- const engine = createEngine();
29
- const result = engine.invokeLoopCompile({
30
- task: "Audit ERC20 token",
31
- mode: "loop_compile",
32
- loop_id: "audit",
33
- round: 1,
34
- goal_id: "audit",
35
- });
30
+ For another MCP client:
31
+
32
+ ```bash
33
+ loopforge init --client generic
36
34
  ```
37
35
 
38
- ## 3 Modes
36
+ The generic command prints an MCP configuration fragment and installs the
37
+ Perception skill under `.loopforge/skills/` unless `--target` is supplied.
39
38
 
40
- | Mode | When | Returns |
41
- |------|------|---------|
42
- | `loop_compile` | Every agent loop iteration | Compiled prompt + recompile level + health + advisories |
43
- | `feedback` | After execution | Quality score → vault persistence |
44
- | `review` | Audit prompt quality | Structural checks + constraint compliance |
39
+ ## How a loop works
45
40
 
46
- ## Recompile Levels
41
+ 1. The Agent calls `loopforge_start` with the task and hard constraints.
42
+ 2. LoopForge compiles one prompt from the canonical state.
43
+ 3. The Agent executes that prompt and submits a structured evaluation through
44
+ `loopforge_next`.
45
+ 4. LoopForge captures evidence, verifies the evaluation, enforces the round
46
+ boundary, and either commits, rejects, or stops the round.
47
+ 5. If work remains, the next prompt is compiled from the committed state.
47
48
 
48
- - **L0 Fast Path** — goal unchanged, no new failures → reuse cached prompt
49
- - **L1 Patch** — new constraints or repair signals → patch previous prompt
50
- - **L2 Full Recompile** — round 1, goal changed, plan_source, strategy collapse → full build
49
+ A rejected attempt keeps the same logical round ID, increments its attempt
50
+ number, and commits no feedback. A process restart can recover the current prompt
51
+ and the last committed decision without advancing the round twice.
51
52
 
52
- ## Multi-Agent Support (v1.9)
53
+ ## Prompt views
53
54
 
54
- LoopForge treats all agents the same — whether a single agent, an agent spawning
55
- sub-agents via AgentTool, or a Coordinator orchestrating Workers. The core loop
56
- (compile → execute → self-eval → compile) is identical.
55
+ LoopForge renders exactly one prompt artifact for each attempt. L0, L1, and L2
56
+ describe how much state is included, not which reasoning method the Agent must
57
+ use.
57
58
 
58
- ### Delegation Helpers (AgentTool Mode)
59
+ | Level | Use |
60
+ | --- | --- |
61
+ | L0 | Same-round retry with the rejection reason and changed evidence |
62
+ | L1 | Normal continuation with a compact state capsule |
63
+ | L2 | First round, checkpoint, goal change, or full state rehydration |
59
64
 
60
- When the main agent spawns sub-agents, three optional helpers improve delegation quality:
65
+ Every artifact records its state hash, prompt hash, level reasons, included
66
+ sections, character budget, round ID, and attempt number.
61
67
 
62
- ```typescript
63
- import {
64
- filterConstraintsForSubTask, // filter relevant constraints for a sub-task
65
- formatDelegationPrompt, // format a self-contained sub-agent prompt
66
- recordDelegation, // write delegation journal to vault
67
- buildDelegationSummary, // build delegation history table for prompts
68
- } from "loopforge";
68
+ ## Durable storage
69
+
70
+ Typed JSON documents are stored by loop under:
71
+
72
+ ```text
73
+ .loopforge/
74
+ loops/<sha256(loopId)>/
75
+ metadata.json
76
+ session.json
77
+ rounds/<round>.json
78
+ state/<loopId>-state.md
69
79
  ```
70
80
 
71
- - **`filterConstraintsForSubTask(allConstraints, subTask, threshold?)`** — Jaccard-based constraint filter. Returns only constraints relevant to the sub-task (default threshold 0.15).
72
- - **`formatDelegationPrompt(subTask, subAgentType, constraints, options?)`** — Produces self-contained prompts for Explore / General-purpose / Plan sub-agents. No "based on above" references — sub-agents can't see the parent conversation.
73
- - **`recordDelegation(loopId, round, entries)`** — Engine method. Writes delegation journal to vault.
74
- - **`buildDelegationSummary(vaultContext)`** — Reads delegation history from vault and formats a summary table for injection into the next round's prompt.
81
+ The JSON session and round documents are the durable transaction truth. The
82
+ Markdown state file is a human-readable derived view and may be disabled with
83
+ `state_file.enabled`.
84
+
85
+ To import a pre-2.0 vault without deleting it:
86
+
87
+ ```bash
88
+ loopforge migrate
89
+ loopforge migrate --from path/to/prompt_vault.json --json
90
+ ```
91
+
92
+ The migration is idempotent and writes a marker under `.loopforge/migrations/`.
93
+
94
+ ## MCP tools
95
+
96
+ The stdio server exposes synchronous Agent-driven tools:
97
+
98
+ - `loopforge_start`
99
+ - `loopforge_next`
100
+ - `loopforge_status`
101
+ - `loopforge_pause`
102
+ - `loopforge_resume`
103
+ - `loopforge_stop`
104
+ - `loopforge_list`
105
+ - `loopforge_replay`
106
+ - `loopforge_health`
75
107
 
76
- ### Worker Results (Coordinator / Multi-Agent)
108
+ Tool results include `structuredContent` and a serialized text block for older
109
+ clients. LoopForge intentionally does not implement MCP Tasks. Long-running work
110
+ belongs to the Agent that is already executing the user's task.
77
111
 
78
- The main agent reports sub-agent results via `worker_results` in its self-evaluation:
112
+ Running sessions use renewable leases so two MCP processes cannot advance the
113
+ same loop at once. Paused and running sessions can be reconstructed from the
114
+ typed store after a restart.
115
+
116
+ ## Command evidence
117
+
118
+ Git evidence is enabled by default. Verification commands are explicit and
119
+ disabled unless added to `loop_policy.json`:
79
120
 
80
121
  ```json
81
122
  {
82
- "success": true,
83
- "output_summary": "Spawned 2 Workers. Worker A found 3 reentrancy bugs. Worker B fixed auth.",
84
- "constraint_violations": [],
85
- "should_continue": true,
86
- "worker_results": [
87
- {
88
- "agentId": "abc123",
89
- "subAgentType": "explore",
90
- "subTask": "Search for security vulnerabilities",
91
- "resultSummary": "Found 3 reentrancy bugs in withdraw(), deposit(), transfer()",
92
- "success": true,
93
- "discoveredConstraints": ["All external calls must use nonReentrant modifier"]
94
- }
95
- ]
123
+ "evidence": {
124
+ "providers": ["git"],
125
+ "timeout_ms": 120000,
126
+ "commands": [
127
+ {
128
+ "name": "tests",
129
+ "enabled": true,
130
+ "executable": "npm",
131
+ "args": ["test"],
132
+ "cwd": ".",
133
+ "phase": "after",
134
+ "required": true,
135
+ "timeout_ms": 120000,
136
+ "max_output_chars": 20000,
137
+ "success_exit_codes": [0]
138
+ }
139
+ ]
140
+ }
96
141
  }
97
142
  ```
98
143
 
99
- The engine auto-detects `worker_results` → writes to delegation journal → injects delegation
100
- history into the next round's compiled prompt. Constraints discovered by Workers flow into
101
- the active constraint set and appear in future prompts automatically.
144
+ Commands run with `shell: false`. Their working directory must resolve inside
145
+ the workspace. Output is capped at 20,000 characters and timeouts abort the
146
+ child process. If an Agent claims success while a required command fails, times
147
+ out, is missing, or has an invalid working directory, the verification verdict
148
+ is `contradicted`.
102
149
 
103
- ### Design Principle
150
+ ## CLI
104
151
 
105
- LoopForge does not distinguish between "single-agent mode" and "coordinator mode."
106
- The main agent — whatever its role — receives compiled prompts, executes, and reports
107
- results. LoopForge records, compresses, and injects. The agent decides.
152
+ ```bash
153
+ loopforge mcp
154
+ loopforge init --client claude|codex|generic [--target DIR] [--force]
155
+ loopforge doctor [--json]
156
+ loopforge inspect LOOP_ID [--round N] [--prompt] [--json]
157
+ loopforge migrate [--from PATH] [--json]
158
+ ```
108
159
 
109
- ## CLI Commands
160
+ `inspect` hides full prompts unless `--prompt` is present. `doctor` checks the
161
+ Node version, store permissions, Git availability, and configured command
162
+ evidence paths without running verification commands.
110
163
 
111
- ```bash
112
- loopforge init # Init vault
113
- loopforge compile '<json>' # Compile prompt (or pipe via stdin)
114
- loopforge feedback '<json>' # Record feedback
115
- loopforge run '<json>' # Autonomous loop (v1.2)
116
- loopforge replay <loop-id> # Loop timeline
117
- loopforge diff <loop-id> <a> <b> # Diff two rounds
118
- loopforge review <loop-id> <rN> # Audit stored prompt
119
- loopforge resume <loop-id> # Resume loop from vault (v1.3.1)
120
- loopforge status # Vault health
164
+ ## Library API
165
+
166
+ ```typescript
167
+ import { run } from "loopforge";
168
+
169
+ const result = await run({
170
+ task: "Audit this repository and fix confirmed defects",
171
+ constraintsFromPlan: ["Do not change the public API"],
172
+ execute: async (prompt, context) => {
173
+ return agent.execute(prompt, { signal: context.signal });
174
+ },
175
+ });
121
176
  ```
122
177
 
123
- ## API Modules
178
+ For an embedding that already owns long-term context or telemetry, use explicit
179
+ hooks instead of auto-discovery:
180
+
181
+ ```typescript
182
+ const result = await run({
183
+ task,
184
+ execute,
185
+ contextProvider: async ({ loopId, round, lastEvaluation }) => {
186
+ return myContextStore.read({ loopId, round, lastEvaluation });
187
+ },
188
+ terminalSinks: [async (event) => myTelemetry.record(event)],
189
+ });
190
+ ```
191
+
192
+ Custom evidence providers, trace sinks, checkpoint sinks, and `LoopStore`
193
+ implementations remain dependency-free extension points.
194
+
195
+ ## Development
196
+
197
+ ```bash
198
+ npm run check
199
+ npm test
200
+ npm pack --dry-run --json
201
+ ```
124
202
 
125
- | Module | Import | Purpose |
126
- |--------|--------|---------|
127
- | `loopforge` | Main entry | `createEngine`, `compileLoop`, types |
128
- | `loopforge/compiler` | `compileLoop`, `decideLevel`, `buildDelegationSummary` | Pure-function compiler + delegation helpers |
129
- | `loopforge/replay` | `ReplayBackend` | Time-travel audit queries |
203
+ The schema in `../loopforge-protocol.json` is generated from `src/protocol.ts`.
204
+ Do not edit it by hand.
130
205
 
131
- ## Zero Dependencies
206
+ ## 2.0 compatibility boundary
132
207
 
133
- No runtime dependencies — Node.js stdlib only. TypeScript strict mode.
134
- Tests use Node.js built-in test runner (`node:test`).
208
+ The 2.0 release removes the prompt-technique catalog, strategy heuristics, MCP
209
+ Tasks, automatic memory discovery, global PromptCraft vaults, Markdown lineage
210
+ fallbacks, `Technique` and `Analysis` wire fields, and the `loopforge-mcp`
211
+ binary. Use `loopforge mcp`, the typed `FileLoopStore`, and explicit providers.
135
212
 
136
213
  ## License
137
214
 
@@ -1,8 +1,4 @@
1
- /** VaultBackend — storage abstraction interface.
2
- *
3
- * 9 methods that define the storage contract. All engine I/O goes through
4
- * this interface — no direct filesystem access outside of backend implementations.
5
- */
1
+ /** Internal projection used while engine query code moves onto typed LoopStore APIs. */
6
2
  export interface VaultEntry {
7
3
  id?: string;
8
4
  task_id?: string;
@@ -15,7 +11,6 @@ export interface VaultEntry {
15
11
  quality_score?: number;
16
12
  success?: boolean;
17
13
  skill_used?: string;
18
- technique_used?: string;
19
14
  loop_id?: string;
20
15
  loop_lineage?: Record<string, unknown>;
21
16
  loop_objective?: Record<string, unknown> | null;
@@ -28,6 +23,8 @@ export interface VaultEntry {
28
23
  [key: string]: unknown;
29
24
  }
30
25
  export interface VaultBackend {
26
+ /** Optional atomic critical section used by storage adapters. */
27
+ withLock?<T>(fn: () => T): T;
31
28
  readVault(): Record<string, unknown>;
32
29
  writeVault(data: Record<string, unknown>): void;
33
30
  queryEntries(opts?: {
@@ -37,8 +34,5 @@ export interface VaultBackend {
37
34
  }): VaultEntry[];
38
35
  appendEntry(entry: VaultEntry): void;
39
36
  appendEntries(entries: VaultEntry[]): number;
40
- writeLineageMd(loopId: string, roundNum: number, content: string, metadata: Record<string, unknown>): string | null;
41
- readLineageMd(loopId: string, roundNum: number): string | null;
42
- scanLineageMd(loopId: string): VaultEntry[];
43
37
  }
44
38
  //# sourceMappingURL=interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,cAAc,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AM,CAAC;QACvB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,GAAG,UAAU,EAAE,CAAC;IAEjB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACrC,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;CAE9C"}
@@ -1,7 +1,3 @@
1
- /** VaultBackend — storage abstraction interface.
2
- *
3
- * 9 methods that define the storage contract. All engine I/O goes through
4
- * this interface — no direct filesystem access outside of backend implementations.
5
- */
1
+ /** Internal projection used while engine query code moves onto typed LoopStore APIs. */
6
2
  export {};
7
3
  //# sourceMappingURL=interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA,wFAAwF"}
@@ -0,0 +1,53 @@
1
+ /** Canonical cognitive state used to render both prompts and state projections.
2
+ *
3
+ * The canonical state is data, not Markdown. Prompt and state-file renderers
4
+ * consume the same value so they cannot silently drift apart.
5
+ */
6
+ import type { CheckpointSummary, LoopCompileRequest, LoopCompileResponse, VerificationFlag } from "./protocol.js";
7
+ export declare const CANONICAL_STATE_SCHEMA_VERSION: 1;
8
+ export interface CanonicalLoopState {
9
+ schemaVersion: typeof CANONICAL_STATE_SCHEMA_VERSION;
10
+ loopId: string;
11
+ round: number;
12
+ maxRounds: number;
13
+ goalId: string;
14
+ objective: string;
15
+ objectiveVersion: number;
16
+ currentTask: string;
17
+ successCriteria: string[];
18
+ hardConstraints: string[];
19
+ activeConstraints: string[];
20
+ retiredConstraints: string[];
21
+ changesSinceLastRound: string[];
22
+ remainingCriteria: string[];
23
+ blockers: string[];
24
+ verificationFlags: VerificationFlag[];
25
+ discoveries: string[];
26
+ nextAction: string;
27
+ rollingOutcomes: string[];
28
+ recurringIssues: string[];
29
+ failedPatterns: string[];
30
+ checkpoints: CheckpointSummary[];
31
+ suggestedNextTask: string;
32
+ externalContext: string;
33
+ stateFilePath: string;
34
+ progress: {
35
+ estimate: number | null;
36
+ criteriaMet: string[];
37
+ criteriaRemaining: string[];
38
+ filesChanged: string[];
39
+ tests: {
40
+ passed: number;
41
+ failed: number;
42
+ skipped: number;
43
+ } | null;
44
+ };
45
+ }
46
+ /** Deterministic JSON serialization used by state and prompt hashes. */
47
+ export declare function stableStringify(value: unknown): string;
48
+ export declare function hashCanonicalState(state: CanonicalLoopState): string;
49
+ /** Human/Agent-readable materialized view. It is always reproducible from the
50
+ * canonical state and is never consulted as transaction truth. */
51
+ export declare function renderCanonicalStateMarkdown(state: CanonicalLoopState): string;
52
+ export declare function createCanonicalLoopState(request: LoopCompileRequest, response: LoopCompileResponse, stateFilePath: string): CanonicalLoopState;
53
+ //# sourceMappingURL=canonical-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-state.d.ts","sourceRoot":"","sources":["../src/canonical-state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,8BAA8B,EAAG,CAAU,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,OAAO,8BAA8B,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;QAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,KAAK,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;KACnE,CAAC;CACH;AAQD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYtD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAEpE;AASD;kEACkE;AAClE,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAqE9E;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,MAAM,GACpB,kBAAkB,CAmEpB"}
@@ -0,0 +1,161 @@
1
+ /** Canonical cognitive state used to render both prompts and state projections.
2
+ *
3
+ * The canonical state is data, not Markdown. Prompt and state-file renderers
4
+ * consume the same value so they cannot silently drift apart.
5
+ */
6
+ import { createHash } from "node:crypto";
7
+ export const CANONICAL_STATE_SCHEMA_VERSION = 1;
8
+ function unique(values) {
9
+ return [...new Set(values.filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim()))];
10
+ }
11
+ /** Deterministic JSON serialization used by state and prompt hashes. */
12
+ export function stableStringify(value) {
13
+ if (value === null || typeof value !== "object") {
14
+ return JSON.stringify(value);
15
+ }
16
+ if (Array.isArray(value)) {
17
+ return `[${value.map((item) => stableStringify(item)).join(",")}]`;
18
+ }
19
+ const record = value;
20
+ const keys = Object.keys(record).sort();
21
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`).join(",")}}`;
22
+ }
23
+ export function hashCanonicalState(state) {
24
+ return createHash("sha256").update(stableStringify(state)).digest("hex");
25
+ }
26
+ function addList(lines, title, values) {
27
+ if (values.length === 0)
28
+ return;
29
+ lines.push(`## ${title}`, "");
30
+ for (const value of values)
31
+ lines.push(`- ${value}`);
32
+ lines.push("");
33
+ }
34
+ /** Human/Agent-readable materialized view. It is always reproducible from the
35
+ * canonical state and is never consulted as transaction truth. */
36
+ export function renderCanonicalStateMarkdown(state) {
37
+ const lines = [
38
+ `# LoopForge State — ${state.loopId}`,
39
+ "",
40
+ `**Schema**: ${state.schemaVersion}`,
41
+ `**Round**: ${state.round}/${state.maxRounds}`,
42
+ `**Goal ID**: ${state.goalId}`,
43
+ "",
44
+ "## Loop Objective",
45
+ "",
46
+ state.objective,
47
+ "",
48
+ "## Current Task",
49
+ "",
50
+ state.currentTask,
51
+ "",
52
+ ];
53
+ addList(lines, "Success Criteria", state.successCriteria);
54
+ addList(lines, "Hard Constraints", state.hardConstraints);
55
+ addList(lines, "Active Constraints", state.activeConstraints);
56
+ addList(lines, "Changes Since Last Round", state.changesSinceLastRound);
57
+ if (state.progress.estimate !== null ||
58
+ state.progress.criteriaMet.length > 0 ||
59
+ state.progress.criteriaRemaining.length > 0 ||
60
+ state.progress.filesChanged.length > 0 ||
61
+ state.progress.tests !== null) {
62
+ const total = state.progress.criteriaMet.length + state.progress.criteriaRemaining.length;
63
+ lines.push("## Progress Dashboard", "");
64
+ if (total > 0) {
65
+ lines.push(`**Criteria**: ${state.progress.criteriaMet.length}/${total}`);
66
+ }
67
+ if (state.progress.estimate !== null) {
68
+ lines.push(`**Estimated Completion**: ${(state.progress.estimate * 100).toFixed(0)}%`);
69
+ }
70
+ if (state.progress.tests) {
71
+ lines.push(`**Tests**: ${state.progress.tests.passed} passed, ` +
72
+ `${state.progress.tests.failed} failed, ${state.progress.tests.skipped} skipped`);
73
+ }
74
+ if (state.progress.filesChanged.length > 0) {
75
+ lines.push("", "**Files Changed**:");
76
+ for (const file of state.progress.filesChanged)
77
+ lines.push(`- ${file}`);
78
+ }
79
+ lines.push("");
80
+ }
81
+ addList(lines, "Remaining", state.remainingCriteria);
82
+ addList(lines, "Blockers", state.blockers);
83
+ addList(lines, "Discoveries", state.discoveries);
84
+ addList(lines, "Cross-Round Outcomes", state.rollingOutcomes);
85
+ addList(lines, "Recurring Issues", state.recurringIssues);
86
+ addList(lines, "Failed Patterns", state.failedPatterns);
87
+ addList(lines, "Retired Constraints", state.retiredConstraints);
88
+ if (state.nextAction) {
89
+ lines.push("## Next Action", "", state.nextAction, "");
90
+ }
91
+ if (state.verificationFlags.length > 0) {
92
+ lines.push("## Verification", "");
93
+ for (const flag of state.verificationFlags) {
94
+ lines.push(`- [${flag.severity}] [${flag.check}] ${flag.detail}`);
95
+ }
96
+ lines.push("");
97
+ }
98
+ if (state.externalContext) {
99
+ lines.push("## External Context", "", state.externalContext, "");
100
+ }
101
+ return lines.join("\n").trimEnd() + "\n";
102
+ }
103
+ export function createCanonicalLoopState(request, response, stateFilePath) {
104
+ const last = request.last_round_result;
105
+ const objective = response.loop_objective;
106
+ const verificationFlags = request.verification_flags ?? [];
107
+ const rolling = response.rolling_summary;
108
+ const executionEvidence = last?.execution_evidence;
109
+ const changes = unique([
110
+ request.new_since_last_round,
111
+ last?.output_summary,
112
+ ...(last?.wrong_assumptions ?? []).map((value) => `Corrected assumption: ${value}`),
113
+ ]);
114
+ const discoveries = unique([
115
+ ...(last?.discovered_constraints ?? []),
116
+ ...(last?.emerged_subtasks ?? []),
117
+ ]);
118
+ const blockers = unique([
119
+ ...(last?.constraint_violations ?? []),
120
+ last?.manual_fixes_needed,
121
+ request.rejection_notice,
122
+ ...response.warnings,
123
+ ]);
124
+ return {
125
+ schemaVersion: CANONICAL_STATE_SCHEMA_VERSION,
126
+ loopId: response.loop_id || request.loop_id,
127
+ round: response.round || request.round,
128
+ maxRounds: request.max_rounds ?? 20,
129
+ goalId: response.goal_id,
130
+ objective: objective?.objective || request.task,
131
+ objectiveVersion: objective?.version ?? 1,
132
+ currentTask: request.task,
133
+ successCriteria: unique(objective?.success_criteria ?? []),
134
+ hardConstraints: unique(objective?.hard_constraints ?? []),
135
+ activeConstraints: unique(response.constraints_active),
136
+ retiredConstraints: unique(response.constraints_retired),
137
+ changesSinceLastRound: changes,
138
+ remainingCriteria: unique(last?.execution_evidence?.success_criteria_remaining ?? []),
139
+ blockers,
140
+ verificationFlags,
141
+ discoveries,
142
+ nextAction: last?.next_action?.trim() || response.suggested_next_task,
143
+ rollingOutcomes: unique(rolling?.key_outcomes ?? []),
144
+ recurringIssues: unique(rolling?.recurring_issues ?? []),
145
+ failedPatterns: unique(rolling?.failed_patterns ?? []),
146
+ checkpoints: response.checkpoint_summary
147
+ ? [response.checkpoint_summary]
148
+ : [],
149
+ suggestedNextTask: response.suggested_next_task,
150
+ externalContext: request.external_context?.trim() ?? "",
151
+ stateFilePath,
152
+ progress: {
153
+ estimate: executionEvidence?.progress_estimate ?? null,
154
+ criteriaMet: unique(executionEvidence?.success_criteria_met ?? []),
155
+ criteriaRemaining: unique(executionEvidence?.success_criteria_remaining ?? []),
156
+ filesChanged: unique(executionEvidence?.files_changed ?? []),
157
+ tests: executionEvidence?.test_results ?? null,
158
+ },
159
+ };
160
+ }
161
+ //# sourceMappingURL=canonical-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-state.js","sourceRoot":"","sources":["../src/canonical-state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQzC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAU,CAAC;AAqCzD,SAAS,MAAM,CAAC,MAAwC;IACtD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CACrD,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACrE,CAAC;IACD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1B,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,eAAe,CA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D,WAAW,EAAE,QAAQ,CAAC,kBAAkB;YACtC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC/B,CAAC,CAAC,EAAE;QACN,iBAAiB,EAAE,QAAQ,CAAC,mBAAmB;QAC/C,eAAe,EAAE,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE;QACvD,aAAa;QACb,QAAQ,EAAE;YACR,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;YACtD,WAAW,EAAE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,IAAI,EAAE,CAAC;YAClE,iBAAiB,EAAE,MAAM,CACvB,iBAAiB,EAAE,0BAA0B,IAAI,EAAE,CACpD;YACD,YAAY,EAAE,MAAM,CAAC,iBAAiB,EAAE,aAAa,IAAI,EAAE,CAAC;YAC5D,KAAK,EAAE,iBAAiB,EAAE,YAAY,IAAI,IAAI;SAC/C;KACF,CAAC;AACJ,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ /** Unified LoopForge command line. */
3
+ export declare function main(argv?: string[]): void;
4
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,sCAAsC;AA6LtC,wBAAgB,IAAI,CAAC,IAAI,WAAwB,GAAG,IAAI,CAsBvD"}