loopforge 1.12.0 → 1.15.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.
Files changed (71) hide show
  1. package/dist/backends/fs.d.ts.map +1 -1
  2. package/dist/backends/fs.js +12 -8
  3. package/dist/backends/fs.js.map +1 -1
  4. package/dist/builder.d.ts +8 -1
  5. package/dist/builder.d.ts.map +1 -1
  6. package/dist/builder.js +28 -72
  7. package/dist/builder.js.map +1 -1
  8. package/dist/enforcement-gate.d.ts +44 -0
  9. package/dist/enforcement-gate.d.ts.map +1 -0
  10. package/dist/enforcement-gate.js +253 -0
  11. package/dist/enforcement-gate.js.map +1 -0
  12. package/dist/engine.d.ts +11 -4
  13. package/dist/engine.d.ts.map +1 -1
  14. package/dist/engine.js +87 -118
  15. package/dist/engine.js.map +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +4 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/loop-compiler.d.ts.map +1 -1
  21. package/dist/loop-compiler.js +689 -480
  22. package/dist/loop-compiler.js.map +1 -1
  23. package/dist/mcp/session.d.ts +9 -1
  24. package/dist/mcp/session.d.ts.map +1 -1
  25. package/dist/mcp/session.js +100 -44
  26. package/dist/mcp/session.js.map +1 -1
  27. package/dist/observability.d.ts +1 -1
  28. package/dist/observability.js +1 -1
  29. package/dist/policy.d.ts +72 -2
  30. package/dist/policy.d.ts.map +1 -1
  31. package/dist/policy.js +96 -2
  32. package/dist/policy.js.map +1 -1
  33. package/dist/protocol.d.ts +33 -2
  34. package/dist/protocol.d.ts.map +1 -1
  35. package/dist/protocol.js +22 -2
  36. package/dist/protocol.js.map +1 -1
  37. package/dist/runtime.d.ts +8 -4
  38. package/dist/runtime.d.ts.map +1 -1
  39. package/dist/runtime.js +102 -108
  40. package/dist/runtime.js.map +1 -1
  41. package/dist/tests/builder.test.js +5 -3
  42. package/dist/tests/builder.test.js.map +1 -1
  43. package/dist/tests/enforcement-gate.test.d.ts +2 -0
  44. package/dist/tests/enforcement-gate.test.d.ts.map +1 -0
  45. package/dist/tests/enforcement-gate.test.js +328 -0
  46. package/dist/tests/enforcement-gate.test.js.map +1 -0
  47. package/dist/tests/engine.test.js +9 -5
  48. package/dist/tests/engine.test.js.map +1 -1
  49. package/dist/tests/generate-schema.test.js +2 -2
  50. package/dist/tests/loop-compiler.test.js +28 -20
  51. package/dist/tests/loop-compiler.test.js.map +1 -1
  52. package/dist/tests/mcp.test.js +22 -2
  53. package/dist/tests/mcp.test.js.map +1 -1
  54. package/dist/tests/policy.test.js +1 -1
  55. package/dist/tests/policy.test.js.map +1 -1
  56. package/dist/tests/runtime.test.js +19 -5
  57. package/dist/tests/runtime.test.js.map +1 -1
  58. package/dist/verification-gate.d.ts +6 -0
  59. package/dist/verification-gate.d.ts.map +1 -1
  60. package/dist/verification-gate.js +3 -2
  61. package/dist/verification-gate.js.map +1 -1
  62. package/loop_policy.json +8 -3
  63. package/package.json +1 -1
  64. package/skills/perception/SKILL.md +35 -17
  65. package/skills/prompt-techniques/SKILL.md +52 -52
  66. package/skills/prompt-techniques/references/chain-of-thought.md +207 -207
  67. package/skills/prompt-techniques/references/few-shot.md +174 -174
  68. package/skills/prompt-techniques/references/least-to-most.md +182 -182
  69. package/skills/prompt-techniques/references/step-back.md +160 -160
  70. package/skills/prompt-techniques/references/tree-of-thought.md +191 -191
  71. package/skills/prompt-techniques/references/zero-shot.md +97 -97
@@ -19,8 +19,9 @@ import { makeVerificationFlag, makeVerificationResult } from "./protocol.js";
19
19
  /** Extract the round number from a vault entry's loop_lineage.
20
20
  * Returns 0 if the entry has no lineage or no round field.
21
21
  * In practice, persistLoopLineage always writes round ≥ 1, so 0
22
- * unambiguously means "not a valid round entry" in this context. */
23
- function entryRound(entry) {
22
+ * unambiguously means "not a valid round entry" in this context.
23
+ * Exported for reuse by enforcement-gate.ts. */
24
+ export function entryRound(entry) {
24
25
  const lineage = (entry.loop_lineage ?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,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;IAEzD,IAAI,OAAsC,CAAC;IAC3C,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,GAAG,cAAc,CAAC;IAC3B,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QACnB,OAAO,GAAG,SAAS,CAAC;IACtB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,SAAS,CAAC;IACtB,CAAC;IAED,OAAO,sBAAsB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC"}
package/loop_policy.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "version": "1",
3
3
  "constraints": {
4
- "retire_window": 3,
5
- "max_active": 12
4
+ "retire_window": 3
6
5
  },
7
6
  "summary": {
8
7
  "window": 5,
@@ -59,6 +58,12 @@
59
58
  "enabled": true,
60
59
  "max_feedback_entries": 5,
61
60
  "max_discoveries_in_project": 3,
62
- "write_on_outcomes": ["completed", "circuit_breaker", "max_rounds"]
61
+ "write_on_outcomes": ["task_complete", "circuit_breaker", "max_rounds"]
62
+ },
63
+ "state_file": {
64
+ "enabled": true,
65
+ "directory": ".loopforge/state",
66
+ "max_checkpoints": 5,
67
+ "max_summary_rounds": 5
63
68
  }
64
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopforge",
3
- "version": "1.12.0",
3
+ "version": "1.15.1",
4
4
  "description": "Loop-Time Intelligence Layer for AI coding agents — per-iteration prompt compiler with structured memory, constraint inheritance, and drift correction.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -61,9 +61,13 @@ Keep the returned sessionId — you will need it for every subsequent call.
61
61
  ```
62
62
 
63
63
  **Step 2 — Execute the round:**
64
- Execute the compiled prompt exactly as you would any user task. Read files,
65
- write code, run tests, fix bugs. The prompt already contains the task scope,
66
- constraints, and quality expectations for this specific round.
64
+ - **BEFORE executing the prompt**: Read `.loopforge/state/{loopId}-state.md`
65
+ for the loop's accumulated state — objective, constraints, progress, and
66
+ cross-round summary. This file is rewritten each round and is the single
67
+ source of truth for loop state. The prompt references this file; you must
68
+ read it to know the active constraints and progress.
69
+ - Execute the compiled prompt exactly as you would any user task. Read files,
70
+ write code, run tests, fix bugs.
67
71
 
68
72
  After executing, prepare a structured self-evaluation. Pass it as the
69
73
  `evaluation` parameter to `loopforge_next` — do NOT embed it as a text block
@@ -201,14 +205,21 @@ remembering across rounds.
201
205
 
202
206
  The prompt changes between rounds based on your trajectory. Pay attention to:
203
207
 
204
- - **Compile level** — `l0` (cached, fast path), `l1` (patched, mild drift),
205
- `l2` (full recompile, significant change). L2 means the compiler detected a
206
- major shift — read the prompt carefully.
208
+ - **Compile level** — `l0` (retry — honest failure, no new info, same prompt),
209
+ `l1` (continue — default path, state evolved, technique keyword-routed from Tier 1),
210
+ `l2` (restart — Round 1, checkpoint boundary, or goal_id change; full
211
+ context rebuild. **At L2**: LoopForge provides a Technique Selection block —
212
+ read `skills/prompt-techniques/SKILL.md`, freely choose the best reasoning
213
+ strategy for this round, read the corresponding reference file, and apply
214
+ the technique directly to the task). L2 means you have a new chance to
215
+ pick the right approach.
207
216
  - **Warnings** — constraint violations accumulating, task drift, quality
208
217
  decline. These are the compiler begging you to course-correct.
209
- - **Technique escalation** — the compiler may escalate from Tier 1 to
210
- Tier 2 (step-back/least-to-most/ToT) after consecutive failures. Trust
211
- the new technique — it's chosen for structured reasoning depth.
218
+ - **Technique autonomy (v1.15)** — at L2 restarts, you freely choose your
219
+ reasoning technique. LoopForge no longer auto-selects or forces technique
220
+ changes after failures. Read the technique catalog, pick what fits the
221
+ current challenge, and apply it. Trust your own judgment — you have the
222
+ full loop state in the state file.
212
223
 
213
224
  ## Stop Condition Matrix
214
225
 
@@ -218,21 +229,28 @@ The prompt changes between rounds based on your trajectory. Pay attention to:
218
229
  | 3 consecutive failed rounds | `circuit_breaker` | Tell user the approach is stuck, suggest a different strategy |
219
230
  | Round count reached `maxRounds` | `max_rounds` | Summarize progress, ask user whether to extend |
220
231
  | No `---loopforge-eval` block found | `stalled` | Fix your output format and restart |
232
+ | Enforcement gate rejected your eval | `enforcementAction: "reject"` | Read the rejection prompt's **Required Fix** section, redo the SAME round, re-submit a corrected self-evaluation |
233
+ | Enforcement gate terminated loop | `enforcement_terminated` | Too many rejections or progress stalled — report to user and suggest a different approach |
221
234
  | User interrupts or fatal error | (call `loopforge_stop`) | Clean stop with trajectory preserved |
222
235
 
223
236
  ## Rules
224
237
 
225
238
  1. **Always pass the evaluation parameter.** `loopforge_next` requires it.
226
239
  If you omit it, the MCP client will reject the call with a schema error.
227
- 2. **Be honest in self-evaluation.** Lying about success or hiding violations
228
- produces a false success signal. The circuit breaker exists to stop bad
229
- loops — if you fake success=true every round, it fires anyway.
230
- 3. **One loop per task.** Don't reuse a sessionId across different tasks.
231
- 4. **Execute the prompt you're given.** The compiler may change technique or
232
- narrow scope between rounds. Trust it — it sees the trajectory.
233
- 5. **Call loopforge_next within the same turn.** Don't leave a round hanging
240
+ 2. **Read the state file every round.** Before executing the prompt, read
241
+ `.loopforge/state/{loopId}-state.md`. It contains the accumulated constraints,
242
+ progress, and cross-round summary. Skip this and you'll miss active guardrails.
243
+ 3. **Be honest in self-evaluation.** Lying about success or hiding violations
244
+ produces a false success signal. The enforcement gate will REJECT fake
245
+ successes, and the circuit breaker exists to stop bad loops.
246
+ 4. **One loop per task.** Don't reuse a sessionId across different tasks.
247
+ 5. **Execute the prompt you're given — and own your technique choice.** At L2
248
+ restarts, read the technique catalog and freely choose the best strategy.
249
+ At L1, follow the keyword-routed technique. The compiler provides context
250
+ and guardrails — you provide the reasoning strategy.
251
+ 6. **Call loopforge_next within the same turn.** Don't leave a round hanging
234
252
  across conversation turns. The MCP server is in-memory.
235
- 6. **After process restart, use loopforge_resume.** The session state is saved
253
+ 7. **After process restart, use loopforge_resume.** The session state is saved
236
254
  to vault every round. Call `loopforge_resume` with the original `loopId` to
237
255
  pick up where you left off — no need to restart from round 1.
238
256
 
@@ -1,52 +1,52 @@
1
- ---
2
- name: prompt-techniques
3
- description: >
4
- Reference catalog of 7 prompt engineering techniques. This skill should be
5
- used when the AI needs to recall the purpose, method steps, and use cases
6
- of techniques like zero-shot, few-shot, chain-of-thought, step-back,
7
- least-to-most, or tree-of-thought. It is a pure reference skill — no
8
- workflow instructions, only technique documentation loaded on demand.
9
- ---
10
-
11
- # Prompt Techniques Reference
12
-
13
- This skill catalogs seven prompt engineering techniques. Use `references/` files
14
- to load detailed technique documentation on demand. Each reference includes:
15
- purpose, input requirements, recommended JSON input templates, method steps,
16
- design rules, when-to-use guidance, and example use cases.
17
-
18
- ## Technique Overview
19
-
20
- | Technique | Cognitive Load | Independence | When to Use |
21
- |-----------|---------------|-------------|-------------|
22
- | zero-shot | Low | Either | Simple code explanation, formatting, renaming. |
23
- | few-shot | Medium | Continuous | Standard CRUD modules, unit tests with fixed patterns. |
24
- | chain-of-thought | Medium-High | Either | Multi-step reasoning; use `zero-shot-cot` without examples, `few-shot-cot` with examples. |
25
- | step-back | High | Independent | Vague errors, messy legacy refactoring — abstract principles first. |
26
- | least-to-most | High | Continuous | Large multi-step modules — decompose into ordered sub-tasks. |
27
- | tree-of-thought | High | Independent | Core algorithms, crypto/signature verification, Assembly ops — explore multiple candidate paths. |
28
-
29
- ## How to Use
30
-
31
- 1. Read `references/<technique>.md` for the selected technique. Each reference contains:
32
- - **Purpose** — what problem the technique solves.
33
- - **Input Requirements** — required and optional parameters.
34
- - **Recommended JSON Input** — a complete input template with example values.
35
- - **Method Steps** — step-by-step construction guide.
36
- - **Design Rules** — specific rules for high-quality prompt construction.
37
- - **Case Generation Rules** — how to generate examples, decompositions, branches, or abstractions (where applicable).
38
- - **Single-Pass vs Two-Stage** — when to use each execution mode (step-back, least-to-most).
39
- - **Search Strategy Selection** — beam/dfs/expert-panel guidance (tree-of-thought).
40
- - **Prompt Output Template** — a complete 8-section output skeleton with section-level format specifications. Defines the exact structure the generated prompt must follow. The technique-specific section (section 5) format varies per technique: Few-Shot uses input→output pairs, Few-Shot-CoT uses reasoning triples, Step-Back uses abstraction framework boxes, Least-to-Most uses ordered subproblems, Tree-of-Thought uses state tables + evaluation criteria. Zero-Shot omits section 5 entirely for a lightweight 7-section prompt.
41
- - **When to Use** — concrete scenarios and example use cases.
42
- 2. `references/chain-of-thought.md` covers both `zero-shot-cot` and `few-shot-cot`, including paper citations for Few-Shot-CoT.
43
- 3. Do not load all references at once — read only the one selected by the router in Step 1.
44
-
45
- ## Reference Files
46
-
47
- - `references/zero-shot.md`
48
- - `references/few-shot.md`
49
- - `references/chain-of-thought.md` (covers zero-shot-cot and few-shot-cot)
50
- - `references/step-back.md`
51
- - `references/least-to-most.md`
52
- - `references/tree-of-thought.md`
1
+ ---
2
+ name: prompt-techniques
3
+ description: >
4
+ Reference catalog of 7 prompt engineering techniques. This skill should be
5
+ used when the AI needs to recall the purpose, method steps, and use cases
6
+ of techniques like zero-shot, few-shot, chain-of-thought, step-back,
7
+ least-to-most, or tree-of-thought. It is a pure reference skill — no
8
+ workflow instructions, only technique documentation loaded on demand.
9
+ ---
10
+
11
+ # Prompt Techniques Reference
12
+
13
+ This skill catalogs seven prompt engineering techniques. Use `references/` files
14
+ to load detailed technique documentation on demand. Each reference includes:
15
+ purpose, input requirements, recommended JSON input templates, method steps,
16
+ design rules, when-to-use guidance, and example use cases.
17
+
18
+ ## Technique Overview
19
+
20
+ | Technique | Cognitive Load | Independence | When to Use |
21
+ |-----------|---------------|-------------|-------------|
22
+ | zero-shot | Low | Either | Simple code explanation, formatting, renaming. |
23
+ | few-shot | Medium | Continuous | Standard CRUD modules, unit tests with fixed patterns. |
24
+ | chain-of-thought | Medium-High | Either | Multi-step reasoning; use `zero-shot-cot` without examples, `few-shot-cot` with examples. |
25
+ | step-back | High | Independent | Vague errors, messy legacy refactoring — abstract principles first. |
26
+ | least-to-most | High | Continuous | Large multi-step modules — decompose into ordered sub-tasks. |
27
+ | tree-of-thought | High | Independent | Core algorithms, crypto/signature verification, Assembly ops — explore multiple candidate paths. |
28
+
29
+ ## How to Use
30
+
31
+ 1. Read `references/<technique>.md` for the selected technique. Each reference contains:
32
+ - **Purpose** — what problem the technique solves.
33
+ - **Input Requirements** — required and optional parameters.
34
+ - **Recommended JSON Input** — a complete input template with example values.
35
+ - **Method Steps** — step-by-step construction guide.
36
+ - **Design Rules** — specific rules for high-quality prompt construction.
37
+ - **Case Generation Rules** — how to generate examples, decompositions, branches, or abstractions (where applicable).
38
+ - **Single-Pass vs Two-Stage** — when to use each execution mode (step-back, least-to-most).
39
+ - **Search Strategy Selection** — beam/dfs/expert-panel guidance (tree-of-thought).
40
+ - **Prompt Output Template** — a complete 8-section output skeleton with section-level format specifications. Defines the exact structure the generated prompt must follow. The technique-specific section (section 5) format varies per technique: Few-Shot uses input→output pairs, Few-Shot-CoT uses reasoning triples, Step-Back uses abstraction framework boxes, Least-to-Most uses ordered subproblems, Tree-of-Thought uses state tables + evaluation criteria. Zero-Shot omits section 5 entirely for a lightweight 7-section prompt.
41
+ - **When to Use** — concrete scenarios and example use cases.
42
+ 2. `references/chain-of-thought.md` covers both `zero-shot-cot` and `few-shot-cot`, including paper citations for Few-Shot-CoT.
43
+ 3. Do not load all references at once — read only the one selected by the router in Step 1.
44
+
45
+ ## Reference Files
46
+
47
+ - `references/zero-shot.md`
48
+ - `references/few-shot.md`
49
+ - `references/chain-of-thought.md` (covers zero-shot-cot and few-shot-cot)
50
+ - `references/step-back.md`
51
+ - `references/least-to-most.md`
52
+ - `references/tree-of-thought.md`