loopforge 1.15.1 → 2.0.1
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.
- package/README.md +172 -95
- package/dist/backends/interface.d.ts +5 -10
- package/dist/backends/interface.d.ts.map +1 -1
- package/dist/backends/interface.js +3 -4
- package/dist/backends/interface.js.map +1 -1
- package/dist/canonical-state.d.ts +53 -0
- package/dist/canonical-state.d.ts.map +1 -0
- package/dist/canonical-state.js +161 -0
- package/dist/canonical-state.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +227 -0
- package/dist/cli.js.map +1 -0
- package/dist/enforcement-gate.d.ts.map +1 -1
- package/dist/enforcement-gate.js +28 -10
- package/dist/enforcement-gate.js.map +1 -1
- package/dist/engine.d.ts +9 -28
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +135 -361
- package/dist/engine.js.map +1 -1
- package/dist/evidence-provider.d.ts +146 -0
- package/dist/evidence-provider.d.ts.map +1 -0
- package/dist/evidence-provider.js +512 -0
- package/dist/evidence-provider.js.map +1 -0
- package/dist/index.d.ts +19 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +15 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +49 -0
- package/dist/init.js.map +1 -0
- package/dist/interop.d.ts +35 -0
- package/dist/interop.d.ts.map +1 -0
- package/dist/interop.js +34 -0
- package/dist/interop.js.map +1 -0
- package/dist/loop-compiler.d.ts +14 -64
- package/dist/loop-compiler.d.ts.map +1 -1
- package/dist/loop-compiler.js +305 -2206
- package/dist/loop-compiler.js.map +1 -1
- package/dist/loop-extras-parser.d.ts +82 -0
- package/dist/loop-extras-parser.d.ts.map +1 -0
- package/dist/loop-extras-parser.js +217 -0
- package/dist/loop-extras-parser.js.map +1 -0
- package/dist/loop-store.d.ts +104 -0
- package/dist/loop-store.d.ts.map +1 -0
- package/dist/loop-store.js +421 -0
- package/dist/loop-store.js.map +1 -0
- package/dist/mcp/server.d.ts +9 -6
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +109 -73
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +102 -21
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +795 -400
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/tools.d.ts +18 -268
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +226 -12
- package/dist/mcp/tools.js.map +1 -1
- package/dist/observability.d.ts +36 -16
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +82 -23
- package/dist/observability.js.map +1 -1
- package/dist/policy-metrics.d.ts +46 -0
- package/dist/policy-metrics.d.ts.map +1 -0
- package/dist/policy-metrics.js +146 -0
- package/dist/policy-metrics.js.map +1 -0
- package/dist/policy.d.ts +52 -147
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +118 -191
- package/dist/policy.js.map +1 -1
- package/dist/prompt-assembler.d.ts +30 -0
- package/dist/prompt-assembler.d.ts.map +1 -0
- package/dist/prompt-assembler.js +278 -0
- package/dist/prompt-assembler.js.map +1 -0
- package/dist/prompt-policy.d.ts +29 -0
- package/dist/prompt-policy.d.ts.map +1 -0
- package/dist/prompt-policy.js +51 -0
- package/dist/prompt-policy.js.map +1 -0
- package/dist/protocol.d.ts +75 -152
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +11 -53
- package/dist/protocol.js.map +1 -1
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +1 -27
- package/dist/replay.js.map +1 -1
- package/dist/round-coordinator.d.ts +90 -0
- package/dist/round-coordinator.d.ts.map +1 -0
- package/dist/round-coordinator.js +186 -0
- package/dist/round-coordinator.js.map +1 -0
- package/dist/round-driver.d.ts +53 -0
- package/dist/round-driver.d.ts.map +1 -0
- package/dist/round-driver.js +101 -0
- package/dist/round-driver.js.map +1 -0
- package/dist/round-transaction.d.ts +70 -0
- package/dist/round-transaction.d.ts.map +1 -0
- package/dist/round-transaction.js +290 -0
- package/dist/round-transaction.js.map +1 -0
- package/dist/self-eval.d.ts +26 -0
- package/dist/self-eval.d.ts.map +1 -0
- package/dist/self-eval.js +154 -0
- package/dist/self-eval.js.map +1 -0
- package/dist/storage.d.ts +39 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +193 -0
- package/dist/storage.js.map +1 -0
- package/dist/verification-gate.d.ts +31 -7
- package/dist/verification-gate.d.ts.map +1 -1
- package/dist/verification-gate.js +250 -7
- package/dist/verification-gate.js.map +1 -1
- package/loop_policy.json +19 -53
- package/package.json +13 -10
- package/skills/perception/SKILL.md +80 -267
- package/dist/backends/fs.d.ts +0 -36
- package/dist/backends/fs.d.ts.map +0 -1
- package/dist/backends/fs.js +0 -362
- package/dist/backends/fs.js.map +0 -1
- package/dist/builder.d.ts +0 -19
- package/dist/builder.d.ts.map +0 -1
- package/dist/builder.js +0 -215
- package/dist/builder.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -12
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -14
- package/dist/mcp-server.js.map +0 -1
- package/dist/memory-bridge.d.ts +0 -47
- package/dist/memory-bridge.d.ts.map +0 -1
- package/dist/memory-bridge.js +0 -290
- package/dist/memory-bridge.js.map +0 -1
- package/dist/runtime.d.ts +0 -80
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -699
- package/dist/runtime.js.map +0 -1
- package/dist/tests/_helpers.d.ts +0 -25
- package/dist/tests/_helpers.d.ts.map +0 -1
- package/dist/tests/_helpers.js +0 -47
- package/dist/tests/_helpers.js.map +0 -1
- package/dist/tests/builder.test.d.ts +0 -2
- package/dist/tests/builder.test.d.ts.map +0 -1
- package/dist/tests/builder.test.js +0 -112
- package/dist/tests/builder.test.js.map +0 -1
- package/dist/tests/enforcement-gate.test.d.ts +0 -2
- package/dist/tests/enforcement-gate.test.d.ts.map +0 -1
- package/dist/tests/enforcement-gate.test.js +0 -328
- package/dist/tests/enforcement-gate.test.js.map +0 -1
- package/dist/tests/engine.test.d.ts +0 -2
- package/dist/tests/engine.test.d.ts.map +0 -1
- package/dist/tests/engine.test.js +0 -375
- package/dist/tests/engine.test.js.map +0 -1
- package/dist/tests/generate-schema.test.d.ts +0 -8
- package/dist/tests/generate-schema.test.d.ts.map +0 -1
- package/dist/tests/generate-schema.test.js +0 -199
- package/dist/tests/generate-schema.test.js.map +0 -1
- package/dist/tests/loop-compiler.test.d.ts +0 -2
- package/dist/tests/loop-compiler.test.d.ts.map +0 -1
- package/dist/tests/loop-compiler.test.js +0 -1059
- package/dist/tests/loop-compiler.test.js.map +0 -1
- package/dist/tests/mcp.test.d.ts +0 -7
- package/dist/tests/mcp.test.d.ts.map +0 -1
- package/dist/tests/mcp.test.js +0 -505
- package/dist/tests/mcp.test.js.map +0 -1
- package/dist/tests/memory-bridge.test.d.ts +0 -8
- package/dist/tests/memory-bridge.test.d.ts.map +0 -1
- package/dist/tests/memory-bridge.test.js +0 -383
- package/dist/tests/memory-bridge.test.js.map +0 -1
- package/dist/tests/policy.test.d.ts +0 -2
- package/dist/tests/policy.test.d.ts.map +0 -1
- package/dist/tests/policy.test.js +0 -49
- package/dist/tests/policy.test.js.map +0 -1
- package/dist/tests/protocol.test.d.ts +0 -2
- package/dist/tests/protocol.test.d.ts.map +0 -1
- package/dist/tests/protocol.test.js +0 -73
- package/dist/tests/protocol.test.js.map +0 -1
- package/dist/tests/replay.test.d.ts +0 -2
- package/dist/tests/replay.test.d.ts.map +0 -1
- package/dist/tests/replay.test.js +0 -222
- package/dist/tests/replay.test.js.map +0 -1
- package/dist/tests/runtime.test.d.ts +0 -7
- package/dist/tests/runtime.test.d.ts.map +0 -1
- package/dist/tests/runtime.test.js +0 -337
- package/dist/tests/runtime.test.js.map +0 -1
- package/dist/tests/verification-gate.test.d.ts +0 -2
- package/dist/tests/verification-gate.test.d.ts.map +0 -1
- package/dist/tests/verification-gate.test.js +0 -407
- package/dist/tests/verification-gate.test.js.map +0 -1
- package/skills/prompt-techniques/SKILL.md +0 -52
- package/skills/prompt-techniques/references/chain-of-thought.md +0 -207
- package/skills/prompt-techniques/references/few-shot.md +0 -174
- package/skills/prompt-techniques/references/least-to-most.md +0 -182
- package/skills/prompt-techniques/references/step-back.md +0 -160
- package/skills/prompt-techniques/references/tree-of-thought.md +0 -191
- package/skills/prompt-techniques/references/zero-shot.md +0 -97
package/README.md
CHANGED
|
@@ -1,137 +1,214 @@
|
|
|
1
1
|
# LoopForge
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
claude mcp add loopforge -- npx loopforge-mcp
|
|
23
|
+
For Codex:
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
npx loopforge status
|
|
25
|
+
```bash
|
|
26
|
+
loopforge init --client codex
|
|
27
|
+
codex mcp add loopforge -- npx loopforge mcp
|
|
22
28
|
```
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
##
|
|
53
|
+
## Prompt views
|
|
53
54
|
|
|
54
|
-
LoopForge
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
Every artifact records its state hash, prompt hash, level reasons, included
|
|
66
|
+
sections, character budget, round ID, and attempt number.
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
150
|
+
## CLI
|
|
104
151
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
206
|
+
## 2.0 compatibility boundary
|
|
132
207
|
|
|
133
|
-
|
|
134
|
-
|
|
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,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** @deprecated Use LoopStore from loop-store.js directly.
|
|
2
2
|
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
3
|
+
* Kept for backward compatibility with modules that still reference
|
|
4
|
+
* VaultBackend as a parameter type. New code should depend on LoopStore. */
|
|
6
5
|
export interface VaultEntry {
|
|
7
6
|
id?: string;
|
|
8
7
|
task_id?: string;
|
|
@@ -15,7 +14,6 @@ export interface VaultEntry {
|
|
|
15
14
|
quality_score?: number;
|
|
16
15
|
success?: boolean;
|
|
17
16
|
skill_used?: string;
|
|
18
|
-
technique_used?: string;
|
|
19
17
|
loop_id?: string;
|
|
20
18
|
loop_lineage?: Record<string, unknown>;
|
|
21
19
|
loop_objective?: Record<string, unknown> | null;
|
|
@@ -28,8 +26,8 @@ export interface VaultEntry {
|
|
|
28
26
|
[key: string]: unknown;
|
|
29
27
|
}
|
|
30
28
|
export interface VaultBackend {
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/** Optional atomic critical section used by storage adapters. */
|
|
30
|
+
withLock?<T>(fn: () => T): T;
|
|
33
31
|
queryEntries(opts?: {
|
|
34
32
|
prefix?: string;
|
|
35
33
|
taskIdPattern?: string;
|
|
@@ -37,8 +35,5 @@ export interface VaultBackend {
|
|
|
37
35
|
}): VaultEntry[];
|
|
38
36
|
appendEntry(entry: VaultEntry): void;
|
|
39
37
|
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
38
|
}
|
|
44
39
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA;;;6EAG6E;AAE7E,MAAM,WAAW,UAAU;IACzB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AG,MAAM,CAAC;CAE9C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** @deprecated Use LoopStore from loop-store.js directly.
|
|
2
2
|
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
3
|
+
* Kept for backward compatibility with modules that still reference
|
|
4
|
+
* VaultBackend as a parameter type. New code should depend on LoopStore. */
|
|
6
5
|
export {};
|
|
7
6
|
//# sourceMappingURL=interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/backends/interface.ts"],"names":[],"mappings":"AAAA;;;6EAG6E"}
|
|
@@ -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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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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