loopforge 3.0.0 → 3.6.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 (194) hide show
  1. package/README.md +126 -143
  2. package/dist/audit.d.ts +50 -0
  3. package/dist/audit.d.ts.map +1 -0
  4. package/dist/audit.js +131 -0
  5. package/dist/audit.js.map +1 -0
  6. package/dist/canonical-state.d.ts +98 -23
  7. package/dist/canonical-state.d.ts.map +1 -1
  8. package/dist/canonical-state.js +257 -181
  9. package/dist/canonical-state.js.map +1 -1
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/cli.js +40 -33
  12. package/dist/cli.js.map +1 -1
  13. package/dist/cognitive-facts.d.ts +17 -0
  14. package/dist/cognitive-facts.d.ts.map +1 -0
  15. package/dist/cognitive-facts.js +99 -0
  16. package/dist/cognitive-facts.js.map +1 -0
  17. package/dist/cognitive-governance.d.ts +25 -33
  18. package/dist/cognitive-governance.d.ts.map +1 -1
  19. package/dist/cognitive-governance.js +38 -138
  20. package/dist/cognitive-governance.js.map +1 -1
  21. package/dist/committed-round.d.ts +59 -0
  22. package/dist/committed-round.d.ts.map +1 -0
  23. package/dist/committed-round.js +222 -0
  24. package/dist/committed-round.js.map +1 -0
  25. package/dist/enforcement-gate.d.ts +78 -0
  26. package/dist/enforcement-gate.d.ts.map +1 -0
  27. package/dist/enforcement-gate.js +1109 -0
  28. package/dist/enforcement-gate.js.map +1 -0
  29. package/dist/engine.d.ts +111 -0
  30. package/dist/engine.d.ts.map +1 -0
  31. package/dist/engine.js +887 -0
  32. package/dist/engine.js.map +1 -0
  33. package/dist/evidence-claims.d.ts +50 -0
  34. package/dist/evidence-claims.d.ts.map +1 -0
  35. package/dist/evidence-claims.js +116 -0
  36. package/dist/evidence-claims.js.map +1 -0
  37. package/dist/evidence-provider.d.ts +50 -23
  38. package/dist/evidence-provider.d.ts.map +1 -1
  39. package/dist/evidence-provider.js +167 -50
  40. package/dist/evidence-provider.js.map +1 -1
  41. package/dist/generate-schema.js +1 -84
  42. package/dist/generate-schema.js.map +1 -1
  43. package/dist/index.d.ts +19 -22
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +16 -15
  46. package/dist/index.js.map +1 -1
  47. package/dist/loop-compiler.d.ts +58 -3
  48. package/dist/loop-compiler.d.ts.map +1 -1
  49. package/dist/loop-compiler.js +841 -304
  50. package/dist/loop-compiler.js.map +1 -1
  51. package/dist/loop-extras-parser.d.ts +2 -2
  52. package/dist/loop-extras-parser.d.ts.map +1 -1
  53. package/dist/loop-extras-parser.js +2 -2
  54. package/dist/loop-extras-parser.js.map +1 -1
  55. package/dist/loop-projection.d.ts +6 -0
  56. package/dist/loop-projection.d.ts.map +1 -0
  57. package/dist/loop-projection.js +26 -0
  58. package/dist/loop-projection.js.map +1 -0
  59. package/dist/loop-store.d.ts +115 -24
  60. package/dist/loop-store.d.ts.map +1 -1
  61. package/dist/loop-store.js +365 -218
  62. package/dist/loop-store.js.map +1 -1
  63. package/dist/mcp/round-lifecycle.d.ts +214 -0
  64. package/dist/mcp/round-lifecycle.d.ts.map +1 -0
  65. package/dist/mcp/round-lifecycle.js +935 -0
  66. package/dist/mcp/round-lifecycle.js.map +1 -0
  67. package/dist/mcp/server.d.ts +2 -1
  68. package/dist/mcp/server.d.ts.map +1 -1
  69. package/dist/mcp/server.js +29 -43
  70. package/dist/mcp/server.js.map +1 -1
  71. package/dist/mcp/session.d.ts +64 -101
  72. package/dist/mcp/session.d.ts.map +1 -1
  73. package/dist/mcp/session.js +433 -1110
  74. package/dist/mcp/session.js.map +1 -1
  75. package/dist/mcp/tools.d.ts +20 -11
  76. package/dist/mcp/tools.d.ts.map +1 -1
  77. package/dist/mcp/tools.js +587 -413
  78. package/dist/mcp/tools.js.map +1 -1
  79. package/dist/policy-metrics.d.ts +12 -24
  80. package/dist/policy-metrics.d.ts.map +1 -1
  81. package/dist/policy-metrics.js +78 -184
  82. package/dist/policy-metrics.js.map +1 -1
  83. package/dist/policy.d.ts +61 -50
  84. package/dist/policy.d.ts.map +1 -1
  85. package/dist/policy.js +48 -146
  86. package/dist/policy.js.map +1 -1
  87. package/dist/prompt-assembler.d.ts +37 -6
  88. package/dist/prompt-assembler.d.ts.map +1 -1
  89. package/dist/prompt-assembler.js +487 -278
  90. package/dist/prompt-assembler.js.map +1 -1
  91. package/dist/prompt-policy.d.ts +1 -8
  92. package/dist/prompt-policy.d.ts.map +1 -1
  93. package/dist/prompt-policy.js +8 -26
  94. package/dist/prompt-policy.js.map +1 -1
  95. package/dist/protocol.d.ts +398 -236
  96. package/dist/protocol.d.ts.map +1 -1
  97. package/dist/protocol.js +147 -17
  98. package/dist/protocol.js.map +1 -1
  99. package/dist/replay.d.ts +5 -13
  100. package/dist/replay.d.ts.map +1 -1
  101. package/dist/replay.js +32 -69
  102. package/dist/replay.js.map +1 -1
  103. package/dist/round-contract.d.ts +64 -0
  104. package/dist/round-contract.d.ts.map +1 -0
  105. package/dist/round-contract.js +80 -0
  106. package/dist/round-contract.js.map +1 -0
  107. package/dist/round-coordinator.d.ts +23 -25
  108. package/dist/round-coordinator.d.ts.map +1 -1
  109. package/dist/round-coordinator.js +103 -92
  110. package/dist/round-coordinator.js.map +1 -1
  111. package/dist/round-driver.d.ts +13 -13
  112. package/dist/round-driver.d.ts.map +1 -1
  113. package/dist/round-driver.js +25 -14
  114. package/dist/round-driver.js.map +1 -1
  115. package/dist/round-transaction.d.ts +14 -18
  116. package/dist/round-transaction.d.ts.map +1 -1
  117. package/dist/round-transaction.js +37 -47
  118. package/dist/round-transaction.js.map +1 -1
  119. package/dist/self-eval.d.ts +48 -0
  120. package/dist/self-eval.d.ts.map +1 -0
  121. package/dist/self-eval.js +248 -0
  122. package/dist/self-eval.js.map +1 -0
  123. package/dist/storage.d.ts +9 -4
  124. package/dist/storage.d.ts.map +1 -1
  125. package/dist/storage.js +18 -6
  126. package/dist/storage.js.map +1 -1
  127. package/dist/token-utils.d.ts +15 -3
  128. package/dist/token-utils.d.ts.map +1 -1
  129. package/dist/token-utils.js +24 -5
  130. package/dist/token-utils.js.map +1 -1
  131. package/dist/verification-gate.d.ts +149 -0
  132. package/dist/verification-gate.d.ts.map +1 -0
  133. package/dist/verification-gate.js +1343 -0
  134. package/dist/verification-gate.js.map +1 -0
  135. package/dist/workspace.d.ts +29 -0
  136. package/dist/workspace.d.ts.map +1 -0
  137. package/dist/workspace.js +61 -0
  138. package/dist/workspace.js.map +1 -0
  139. package/loop_policy.json +37 -16
  140. package/package.json +5 -10
  141. package/skills/perception/SKILL.md +184 -202
  142. package/dist/canonical-event-writer.d.ts +0 -20
  143. package/dist/canonical-event-writer.d.ts.map +0 -1
  144. package/dist/canonical-event-writer.js +0 -131
  145. package/dist/canonical-event-writer.js.map +0 -1
  146. package/dist/compiler-subgoals.d.ts +0 -7
  147. package/dist/compiler-subgoals.d.ts.map +0 -1
  148. package/dist/compiler-subgoals.js +0 -93
  149. package/dist/compiler-subgoals.js.map +0 -1
  150. package/dist/derive-id.d.ts +0 -12
  151. package/dist/derive-id.d.ts.map +0 -1
  152. package/dist/derive-id.js +0 -31
  153. package/dist/derive-id.js.map +0 -1
  154. package/dist/mcp/session-projection.d.ts +0 -5
  155. package/dist/mcp/session-projection.d.ts.map +0 -1
  156. package/dist/mcp/session-projection.js +0 -18
  157. package/dist/mcp/session-projection.js.map +0 -1
  158. package/dist/mcp/session-queue.d.ts +0 -3
  159. package/dist/mcp/session-queue.d.ts.map +0 -1
  160. package/dist/mcp/session-queue.js +0 -18
  161. package/dist/mcp/session-queue.js.map +0 -1
  162. package/dist/mcp/session-types.d.ts +0 -72
  163. package/dist/mcp/session-types.d.ts.map +0 -1
  164. package/dist/mcp/session-types.js +0 -2
  165. package/dist/mcp/session-types.js.map +0 -1
  166. package/dist/round-commit-store.d.ts +0 -12
  167. package/dist/round-commit-store.d.ts.map +0 -1
  168. package/dist/round-commit-store.js +0 -13
  169. package/dist/round-commit-store.js.map +0 -1
  170. package/dist/round-gate.d.ts +0 -31
  171. package/dist/round-gate.d.ts.map +0 -1
  172. package/dist/round-gate.js +0 -259
  173. package/dist/round-gate.js.map +0 -1
  174. package/dist/round-recovery.d.ts +0 -17
  175. package/dist/round-recovery.d.ts.map +0 -1
  176. package/dist/round-recovery.js +0 -117
  177. package/dist/round-recovery.js.map +0 -1
  178. package/dist/round-report.d.ts +0 -16
  179. package/dist/round-report.d.ts.map +0 -1
  180. package/dist/round-report.js +0 -401
  181. package/dist/round-report.js.map +0 -1
  182. package/dist/runtime-services.d.ts +0 -59
  183. package/dist/runtime-services.d.ts.map +0 -1
  184. package/dist/runtime-services.js +0 -460
  185. package/dist/runtime-services.js.map +0 -1
  186. package/dist/vault-format.d.ts +0 -4
  187. package/dist/vault-format.d.ts.map +0 -1
  188. package/dist/vault-format.js +0 -4
  189. package/dist/vault-format.js.map +0 -1
  190. package/dist/vault-types.d.ts +0 -24
  191. package/dist/vault-types.d.ts.map +0 -1
  192. package/dist/vault-types.js +0 -2
  193. package/dist/vault-types.js.map +0 -1
  194. package/loopforge-policy.json +0 -340
@@ -1,93 +0,0 @@
1
- import { deriveSubGoalId } from "./derive-id.js";
2
- import { getPolicy } from "./policy.js";
3
- import { makeSubGoal } from "./protocol.js";
4
- import { jaccardSimilarity, entryRound } from "./token-utils.js";
5
- function lineage(entry) {
6
- const value = entry.loop_lineage;
7
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
8
- }
9
- function matchSubGoal(target, subGoals, threshold) {
10
- const trimmed = target.trim();
11
- const exact = subGoals.findIndex((goal) => goal.id === trimmed);
12
- if (exact >= 0)
13
- return exact;
14
- let bestIdx = -1;
15
- let bestScore = 0;
16
- for (let i = 0; i < subGoals.length; i++) {
17
- const score = jaccardSimilarity(trimmed, subGoals[i].description);
18
- if (score > bestScore) {
19
- bestScore = score;
20
- bestIdx = i;
21
- }
22
- }
23
- return bestScore >= threshold ? bestIdx : -1;
24
- }
25
- /** Derive the complete SubGoal lifecycle from prior entries and this projection. */
26
- export function manageSubGoals(loopId, currentRound, lastRoundResult, vaultContext, project) {
27
- const policy = getPolicy().evolution;
28
- const entries = vaultContext && Array.isArray(vaultContext.results)
29
- ? vaultContext.results.filter((value) => {
30
- if (value === null || typeof value !== "object" || Array.isArray(value))
31
- return false;
32
- const entry = value;
33
- return entry.loop_id === loopId || lineage(entry).loop_id === loopId;
34
- })
35
- : [];
36
- const subGoals = [];
37
- for (const entry of entries.filter((item) => entryRound(item) >= 1 && entryRound(item) < currentRound)) {
38
- const descriptions = project(entry)?.discoveries?.emergedWork ?? [];
39
- for (const description of descriptions) {
40
- if (matchSubGoal(description, subGoals, policy.subgoal_dedup_threshold) >= 0)
41
- continue;
42
- const round = entryRound(entry);
43
- subGoals.push(makeSubGoal({ id: deriveSubGoalId(description), description: description.trim(), status: "pending", declared_at_round: round, status_changed_at_round: round, priority: subGoals.length }));
44
- }
45
- }
46
- if (lastRoundResult) {
47
- const round = lastRoundResult.round || currentRound - 1;
48
- for (const description of lastRoundResult.discoveries?.emergedWork ?? []) {
49
- if (matchSubGoal(description, subGoals, policy.subgoal_dedup_threshold) >= 0)
50
- continue;
51
- subGoals.push(makeSubGoal({ id: deriveSubGoalId(description), description: description.trim(), status: "pending", declared_at_round: round, status_changed_at_round: round, priority: subGoals.length }));
52
- }
53
- const update = (items, status) => {
54
- for (const description of items) {
55
- const index = matchSubGoal(description, subGoals, policy.subgoal_match_threshold);
56
- if (index < 0)
57
- continue;
58
- const goal = subGoals[index];
59
- if (goal.status === "done" || goal.status === "canceled")
60
- continue;
61
- goal.status = status;
62
- goal.status_changed_at_round = round;
63
- if (status === "done")
64
- goal.completed_at_round = round;
65
- }
66
- };
67
- update(lastRoundResult.subGoalEvents?.completed ?? [], "done");
68
- update(lastRoundResult.subGoalEvents?.blocked ?? [], "blocked");
69
- update(lastRoundResult.subGoalEvents?.canceled ?? [], "canceled");
70
- for (const goal of subGoals) {
71
- if (goal.status !== "pending" && goal.status !== "in_progress")
72
- continue;
73
- if ((lastRoundResult.evidence?.criteriaMet ?? []).some((criterion) => jaccardSimilarity(criterion, goal.description) >= policy.subgoal_auto_complete_threshold)) {
74
- goal.status = "done";
75
- goal.status_changed_at_round = round;
76
- goal.completed_at_round = round;
77
- }
78
- }
79
- }
80
- const rank = (status) => ({ in_progress: 0, pending: 1, blocked: 2, done: 3, canceled: 4 }[status]);
81
- subGoals.sort((a, b) => {
82
- const byStatus = rank(a.status) - rank(b.status);
83
- if (byStatus !== 0)
84
- return byStatus;
85
- if (a.status === "pending")
86
- return (currentRound - a.declared_at_round) - (currentRound - b.declared_at_round);
87
- if (a.status === "done")
88
- return (b.completed_at_round ?? 0) - (a.completed_at_round ?? 0);
89
- return a.declared_at_round - b.declared_at_round;
90
- });
91
- return subGoals;
92
- }
93
- //# sourceMappingURL=compiler-subgoals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiler-subgoals.js","sourceRoot":"","sources":["../src/compiler-subgoals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKjE,SAAS,OAAO,CAAC,KAAY;IAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC;IACjC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AACpG,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,QAAmB,EAAE,SAAiB;IAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,EA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ared by every persisted cognitive ID. */
2
- export declare function normalizeIdText(text: string): string;
3
- /** Preserve the historical hash lengths by making the length explicit. */
4
- export declare function deriveTextHash(text: string, length?: number): string;
5
- export declare function deriveItemId(text: string): string;
6
- export declare function deriveSubGoalId(text: string): string;
7
- export declare function deriveConstraintId(text: string): string;
8
- export declare function deriveCriterionId(text: string): string;
9
- export declare function deriveGateId(text: string): string;
10
- export declare function deriveTodoId(text: string): string;
11
- export declare function isStableItemId(value: string): boolean;
12
- //# sourceMappingURL=derive-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"derive-id.d.ts","sourceRoot":"","sources":["../src/derive-id.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,CAEhE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
package/dist/derive-id.js DELETED
@@ -1,31 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- /** Stable text normalization shared by every persisted cognitive ID. */
3
- export function normalizeIdText(text) {
4
- return text.trim().replace(/\s+/g, " ").toLowerCase();
5
- }
6
- /** Preserve the historical hash lengths by making the length explicit. */
7
- export function deriveTextHash(text, length = 12) {
8
- return createHash("sha256").update(normalizeIdText(text)).digest("hex").slice(0, length);
9
- }
10
- export function deriveItemId(text) {
11
- return deriveTextHash(text, 8);
12
- }
13
- export function deriveSubGoalId(text) {
14
- return `sg-${deriveTextHash(text, 8)}`;
15
- }
16
- export function deriveConstraintId(text) {
17
- return `c-${deriveTextHash(text, 8)}`;
18
- }
19
- export function deriveCriterionId(text) {
20
- return `cr-${deriveTextHash(text, 8)}`;
21
- }
22
- export function deriveGateId(text) {
23
- return `gate-${deriveTextHash(text, 12)}`;
24
- }
25
- export function deriveTodoId(text) {
26
- return `todo-${deriveTextHash(text, 8)}`;
27
- }
28
- export function isStableItemId(value) {
29
- return /^(?:c|cr|sg)-[a-f0-9]{8}$/i.test(value);
30
- }
31
- //# sourceMappingURL=derive-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"derive-id.js","sourceRoot":"","sources":["../src/derive-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AACxD,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAM,GAAG,EAAE;IACtD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,QAAQ,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { LoopForgeRequest, VerificationFlag } from "../protocol.js";
2
- import type { McpSession } from "./session-types.js";
3
- /** Build the narrow compiler request from the current session projection. */
4
- export declare function buildLoopRequest(session: McpSession, lastView?: import("../protocol.js").CompilerRoundProjection, verificationFlags?: VerificationFlag[]): LoopForgeRequest;
5
- //# sourceMappingURL=session-projection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-projection.d.ts","sourceRoot":"","sources":["../../src/mcp/session-projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,UAAU,EACnB,QAAQ,CAAC,EAAE,OAAO,gBAAgB,EAAE,uBAAuB,EAC3D,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,GACrC,gBAAgB,CAalB"}
@@ -1,18 +0,0 @@
1
- import { Mode } from "../protocol.js";
2
- /** Build the narrow compiler request from the current session projection. */
3
- export function buildLoopRequest(session, lastView, verificationFlags) {
4
- const request = {
5
- task: session.task,
6
- mode: Mode.LOOP_COMPILE,
7
- skill_name: null,
8
- task_id: null,
9
- loop_id: session.loopId,
10
- round: session.currentRound,
11
- max_rounds: session.maxRounds,
12
- verification_flags: verificationFlags ?? [],
13
- };
14
- if (lastView)
15
- request.last_round_view = lastView;
16
- return request;
17
- }
18
- //# sourceMappingURL=session-projection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-projection.js","sourceRoot":"","sources":["../../src/mcp/session-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,6EAA6E;AAC7E,MAAM,UAAU,gBAAgB,CAC9B,OAAmB,EACnB,QAA2D,EAC3D,iBAAsC;IAEtC,MAAM,OAAO,GAA4B;QACvC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,IAAI,CAAC,YAAY;QACvB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,OAAO,CAAC,MAAM;QACvB,KAAK,EAAE,OAAO,CAAC,YAAY;QAC3B,UAAU,EAAE,OAAO,CAAC,SAAS;QAC7B,kBAAkB,EAAE,iBAAiB,IAAI,EAAE;KAC5C,CAAC;IACF,IAAI,QAAQ;QAAE,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC;IACjD,OAAO,OAA2B,CAAC;AACrC,CAAC"}
@@ -1,3 +0,0 @@
1
- /** Serialize asynchronous state transitions per session ID. */
2
- export declare function withSessionQueue<T>(queues: Map<string, Promise<void>>, sessionId: string, work: () => Promise<T>): Promise<T>;
3
- //# sourceMappingURL=session-queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-queue.d.ts","sourceRoot":"","sources":["../../src/mcp/session-queue.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAaZ"}
@@ -1,18 +0,0 @@
1
- /** Serialize asynchronous state transitions per session ID. */
2
- export async function withSessionQueue(queues, sessionId, work) {
3
- const previous = queues.get(sessionId) ?? Promise.resolve();
4
- let release;
5
- const gate = new Promise((resolve) => { release = resolve; });
6
- const tail = previous.then(() => gate);
7
- queues.set(sessionId, tail);
8
- await previous;
9
- try {
10
- return await work();
11
- }
12
- finally {
13
- release();
14
- if (queues.get(sessionId) === tail)
15
- queues.delete(sessionId);
16
- }
17
- }
18
- //# sourceMappingURL=session-queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-queue.js","sourceRoot":"","sources":["../../src/mcp/session-queue.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAkC,EAClC,SAAiB,EACjB,IAAsB;IAEtB,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5D,IAAI,OAAoB,CAAC;IACzB,MAAM,IAAI,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC5B,MAAM,QAAQ,CAAC;IACf,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,OAAO,EAAE,CAAC;QACV,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,IAAI;YAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -1,72 +0,0 @@
1
- import type { RuntimeServices } from "../runtime-services.js";
2
- import type { ProviderSnapshot } from "../evidence-provider.js";
3
- import type { RoundTransactionSnapshot } from "../round-transaction.js";
4
- import type { CompilerRoundProjection, GateActionDescriptor, LoopForgeRequest, RoundReport, VerificationFlag, ExternalContextProvider, LoopTerminalSink } from "../protocol.js";
5
- export interface McpSession {
6
- sessionId: string;
7
- loopId: string;
8
- task: string;
9
- runtime: RuntimeServices;
10
- currentRound: number;
11
- maxRounds: number;
12
- successTrajectory: boolean[];
13
- status: "running" | "stopped" | "stalled" | "paused";
14
- createdAt: number;
15
- lastRoundProjection?: CompilerRoundProjection;
16
- consecutiveRejections: number;
17
- escalatedRejectionChecks: string[];
18
- driftClarificationStreak: number;
19
- backtrackSkippedFiles: string[];
20
- backtrackTargetGitHead?: string;
21
- evidenceBaseline?: ProviderSnapshot[];
22
- roundSnapshot?: RoundTransactionSnapshot;
23
- currentPrompt?: string | null;
24
- currentLevel?: string;
25
- currentWarnings?: string[];
26
- currentCanonicalState?: Record<string, unknown>;
27
- stopReason?: string;
28
- }
29
- export interface McpSessionSummary {
30
- sessionId: string;
31
- loopId: string;
32
- round: number;
33
- status: McpSession["status"];
34
- }
35
- export interface StartInput {
36
- task: string;
37
- loopId?: string;
38
- maxRounds?: number;
39
- domain?: string;
40
- planSource?: string;
41
- constraints?: string[];
42
- successCriteria?: string[];
43
- }
44
- export interface AdvanceResult {
45
- sessionId: string;
46
- round: number;
47
- roundId?: string;
48
- prompt: string | null;
49
- stopReason?: string;
50
- stopDetail?: string;
51
- level?: string;
52
- roundSuccess?: boolean;
53
- warnings?: string[];
54
- enforcementAction?: "accept" | "reject" | "terminate" | "backtrack";
55
- enforcementReason?: string;
56
- restoreRound?: number;
57
- skippedRounds?: number[];
58
- skippedFiles?: string[];
59
- recoveryRequirements?: string[];
60
- error?: {
61
- code: string;
62
- message: string;
63
- retryable?: boolean;
64
- stateHash?: string;
65
- };
66
- }
67
- export interface SessionDependencies {
68
- contextProvider?: ExternalContextProvider;
69
- terminalSinks: Set<LoopTerminalSink>;
70
- }
71
- export type { GateActionDescriptor, LoopForgeRequest, RoundReport, VerificationFlag };
72
- //# sourceMappingURL=session-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-types.d.ts","sourceRoot":"","sources":["../../src/mcp/session-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhL,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,EAAE,CAAC;IAC7B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBA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Q,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpF;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,aAAa,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACtC;AAED,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=session-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-types.js","sourceRoot":"","sources":["../../src/mcp/session-types.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- import type { VaultEntry } from "./vault-types.js";
2
- import type { LoopStore } from "./loop-store.js";
3
- export interface RoundCommitStore {
4
- find(loopId: string, round: number): VaultEntry[];
5
- }
6
- /** Backend-specific lookup kept outside storage/session orchestration. */
7
- export declare class VaultRoundCommitStore implements RoundCommitStore {
8
- private readonly backend;
9
- constructor(backend: LoopStore);
10
- find(loopId: string, round: number): VaultEntry[];
11
- }
12
- //# sourceMappingURL=round-commit-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"round-commit-store.d.ts","sourceRoot":"","sources":["../src/round-commit-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC;CACnD;AAED,0EAA0E;AAC1E,qBAAa,qBAAsB,YAAW,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,SAAS;IAE/C,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE;CAKlD"}
@@ -1,13 +0,0 @@
1
- /** Backend-specific lookup kept outside storage/session orchestration. */
2
- export class VaultRoundCommitStore {
3
- backend;
4
- constructor(backend) {
5
- this.backend = backend;
6
- }
7
- find(loopId, round) {
8
- const prefix = `loop:${loopId}:r${round}:event`;
9
- return this.backend.queryLoopEvents(loopId)
10
- .filter((entry) => entry.task_id === prefix);
11
- }
12
- }
13
- //# sourceMappingURL=round-commit-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"round-commit-store.js","sourceRoot":"","sources":["../src/round-commit-store.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,OAAkB;QAAlB,YAAO,GAAP,OAAO,CAAW;IAAG,CAAC;IAEnD,IAAI,CAAC,MAAc,EAAE,KAAa;QAChC,MAAM,MAAM,GAAG,QAAQ,MAAM,KAAK,KAAK,QAAQ,CAAC;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;aACxC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -1,31 +0,0 @@
1
- import type { VaultEntry } from "./vault-types.js";
2
- import type { ProviderSnapshot } from "./evidence-provider.js";
3
- import type { CompilerRoundProjection, EvidenceDerivedView, EnforcementResult, RoundReport, VerificationResult } from "./protocol.js";
4
- /** The only input accepted by the runtime verification and enforcement gates. */
5
- export interface RoundGateContext {
6
- report: RoundReport;
7
- evidence: EvidenceDerivedView;
8
- previous?: CompilerRoundProjection | null;
9
- history: VaultEntry[];
10
- currentRound: number;
11
- providerSnapshots: ProviderSnapshot[];
12
- expectedAction?: string;
13
- backtrackSkippedFiles?: string[];
14
- /** v2.13: Git HEAD commit of the backtrack restore point. When set, the
15
- * current round's git evidence must match it — the post-backtrack round
16
- * is a pure verification round, so any HEAD movement means the workspace
17
- * was not restored before working. */
18
- backtrackTargetGitHead?: string;
19
- consecutiveRejections?: number;
20
- driftClarificationStreak?: number;
21
- /** Terminal enforcement checks that have already issued their one guided
22
- * retry. Tracked per rule so unrelated failures do not consume each
23
- * other's escalation budget. */
24
- escalatedRejectionChecks?: string[];
25
- }
26
- /** Verify a normalized report without creating a legacy round projection. */
27
- export declare function verifyRoundReport(context: RoundGateContext): VerificationResult;
28
- /** Enforcement consumes the same normalized context and never re-extracts evidence. */
29
- export declare function enforceRoundReport(context: RoundGateContext, verification: VerificationResult): EnforcementResult;
30
- export declare function makeRoundGateContext(report: RoundReport, currentRound: number, history: VaultEntry[], providerSnapshots: ProviderSnapshot[], remainingCriteria?: string[], options?: Omit<RoundGateContext, "report" | "evidence" | "currentRound" | "history" | "providerSnapshots">): RoundGateContext;
31
- //# sourceMappingURL=round-gate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"round-gate.d.ts","sourceRoot":"","sources":["../src/round-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EAEX,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAcvB,iFAAiF;AACjF,MAAM,WAAW,gBAAg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