loopforge 3.0.0 → 3.2.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 +128 -145
- package/dist/audit.d.ts +50 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +158 -0
- package/dist/audit.js.map +1 -0
- package/dist/canonical-state.d.ts +28 -20
- package/dist/canonical-state.d.ts.map +1 -1
- package/dist/canonical-state.js +82 -173
- package/dist/canonical-state.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +25 -16
- package/dist/cli.js.map +1 -1
- package/dist/cognitive-governance.d.ts +25 -33
- package/dist/cognitive-governance.d.ts.map +1 -1
- package/dist/cognitive-governance.js +38 -138
- package/dist/cognitive-governance.js.map +1 -1
- package/dist/enforcement-gate.d.ts +76 -0
- package/dist/enforcement-gate.d.ts.map +1 -0
- package/dist/enforcement-gate.js +1071 -0
- package/dist/enforcement-gate.js.map +1 -0
- package/dist/engine.d.ts +99 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +839 -0
- package/dist/engine.js.map +1 -0
- package/dist/evidence-claims.d.ts +50 -0
- package/dist/evidence-claims.d.ts.map +1 -0
- package/dist/evidence-claims.js +134 -0
- package/dist/evidence-claims.js.map +1 -0
- package/dist/evidence-provider.d.ts +21 -23
- package/dist/evidence-provider.d.ts.map +1 -1
- package/dist/evidence-provider.js +74 -34
- package/dist/evidence-provider.js.map +1 -1
- package/dist/generate-schema.js +1 -84
- package/dist/generate-schema.js.map +1 -1
- package/dist/index.d.ts +19 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/loop-compiler.d.ts +41 -3
- package/dist/loop-compiler.d.ts.map +1 -1
- package/dist/loop-compiler.js +632 -273
- package/dist/loop-compiler.js.map +1 -1
- package/dist/loop-extras-parser.d.ts +2 -2
- package/dist/loop-extras-parser.d.ts.map +1 -1
- package/dist/loop-extras-parser.js +2 -2
- package/dist/loop-extras-parser.js.map +1 -1
- package/dist/loop-projection.d.ts +26 -0
- package/dist/loop-projection.d.ts.map +1 -0
- package/dist/loop-projection.js +142 -0
- package/dist/loop-projection.js.map +1 -0
- package/dist/loop-store.d.ts +112 -24
- package/dist/loop-store.d.ts.map +1 -1
- package/dist/loop-store.js +365 -218
- package/dist/loop-store.js.map +1 -1
- package/dist/mcp/round-lifecycle.d.ts +216 -0
- package/dist/mcp/round-lifecycle.d.ts.map +1 -0
- package/dist/mcp/round-lifecycle.js +926 -0
- package/dist/mcp/round-lifecycle.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +28 -42
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +53 -101
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +306 -1105
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/tools.d.ts +13 -16
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +479 -413
- package/dist/mcp/tools.js.map +1 -1
- package/dist/policy-metrics.d.ts +12 -17
- package/dist/policy-metrics.d.ts.map +1 -1
- package/dist/policy-metrics.js +95 -161
- package/dist/policy-metrics.js.map +1 -1
- package/dist/policy.d.ts +44 -35
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +31 -115
- package/dist/policy.js.map +1 -1
- package/dist/prompt-assembler.d.ts +37 -6
- package/dist/prompt-assembler.d.ts.map +1 -1
- package/dist/prompt-assembler.js +389 -160
- package/dist/prompt-assembler.js.map +1 -1
- package/dist/prompt-policy.d.ts +1 -8
- package/dist/prompt-policy.d.ts.map +1 -1
- package/dist/prompt-policy.js +8 -26
- package/dist/prompt-policy.js.map +1 -1
- package/dist/protocol.d.ts +357 -229
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +139 -15
- package/dist/protocol.js.map +1 -1
- package/dist/replay.d.ts +5 -13
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +19 -55
- package/dist/replay.js.map +1 -1
- package/dist/round-coordinator.d.ts +20 -24
- package/dist/round-coordinator.d.ts.map +1 -1
- package/dist/round-coordinator.js +99 -92
- package/dist/round-coordinator.js.map +1 -1
- package/dist/round-driver.d.ts +14 -13
- package/dist/round-driver.d.ts.map +1 -1
- package/dist/round-driver.js +26 -14
- package/dist/round-driver.js.map +1 -1
- package/dist/round-transaction.d.ts +15 -18
- package/dist/round-transaction.d.ts.map +1 -1
- package/dist/round-transaction.js +38 -47
- package/dist/round-transaction.js.map +1 -1
- package/dist/self-eval.d.ts +53 -0
- package/dist/self-eval.d.ts.map +1 -0
- package/dist/self-eval.js +284 -0
- package/dist/self-eval.js.map +1 -0
- package/dist/storage.d.ts +9 -4
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +18 -6
- package/dist/storage.js.map +1 -1
- package/dist/token-utils.d.ts +15 -3
- package/dist/token-utils.d.ts.map +1 -1
- package/dist/token-utils.js +24 -5
- package/dist/token-utils.js.map +1 -1
- package/dist/verification-gate.d.ts +108 -0
- package/dist/verification-gate.d.ts.map +1 -0
- package/dist/verification-gate.js +971 -0
- package/dist/verification-gate.js.map +1 -0
- package/loop_policy.json +44 -15
- package/package.json +5 -10
- package/skills/perception/SKILL.md +182 -199
- package/dist/canonical-event-writer.d.ts +0 -20
- package/dist/canonical-event-writer.d.ts.map +0 -1
- package/dist/canonical-event-writer.js +0 -131
- package/dist/canonical-event-writer.js.map +0 -1
- package/dist/compiler-subgoals.d.ts +0 -7
- package/dist/compiler-subgoals.d.ts.map +0 -1
- package/dist/compiler-subgoals.js +0 -93
- package/dist/compiler-subgoals.js.map +0 -1
- package/dist/derive-id.d.ts +0 -12
- package/dist/derive-id.d.ts.map +0 -1
- package/dist/derive-id.js +0 -31
- package/dist/derive-id.js.map +0 -1
- package/dist/mcp/session-projection.d.ts +0 -5
- package/dist/mcp/session-projection.d.ts.map +0 -1
- package/dist/mcp/session-projection.js +0 -18
- package/dist/mcp/session-projection.js.map +0 -1
- package/dist/mcp/session-queue.d.ts +0 -3
- package/dist/mcp/session-queue.d.ts.map +0 -1
- package/dist/mcp/session-queue.js +0 -18
- package/dist/mcp/session-queue.js.map +0 -1
- package/dist/mcp/session-types.d.ts +0 -72
- package/dist/mcp/session-types.d.ts.map +0 -1
- package/dist/mcp/session-types.js +0 -2
- package/dist/mcp/session-types.js.map +0 -1
- package/dist/round-commit-store.d.ts +0 -12
- package/dist/round-commit-store.d.ts.map +0 -1
- package/dist/round-commit-store.js +0 -13
- package/dist/round-commit-store.js.map +0 -1
- package/dist/round-gate.d.ts +0 -31
- package/dist/round-gate.d.ts.map +0 -1
- package/dist/round-gate.js +0 -259
- package/dist/round-gate.js.map +0 -1
- package/dist/round-recovery.d.ts +0 -17
- package/dist/round-recovery.d.ts.map +0 -1
- package/dist/round-recovery.js +0 -117
- package/dist/round-recovery.js.map +0 -1
- package/dist/round-report.d.ts +0 -16
- package/dist/round-report.d.ts.map +0 -1
- package/dist/round-report.js +0 -401
- package/dist/round-report.js.map +0 -1
- package/dist/runtime-services.d.ts +0 -59
- package/dist/runtime-services.d.ts.map +0 -1
- package/dist/runtime-services.js +0 -460
- package/dist/runtime-services.js.map +0 -1
- package/dist/vault-format.d.ts +0 -4
- package/dist/vault-format.d.ts.map +0 -1
- package/dist/vault-format.js +0 -4
- package/dist/vault-format.js.map +0 -1
- package/dist/vault-types.d.ts +0 -24
- package/dist/vault-types.d.ts.map +0 -1
- package/dist/vault-types.js +0 -2
- package/dist/vault-types.js.map +0 -1
- package/loopforge-policy.json +0 -340
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* verify → enforce → stop decision
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Before this module, runtime.ts and session.ts each maintained their
|
|
9
|
+
* own copy of the pipeline (~60 lines each). Drift between the two
|
|
10
|
+
* paths (e.g. git verification only wired into one side) was a known
|
|
11
|
+
* risk. The RoundCoordinator is the single source of truth.
|
|
10
12
|
*
|
|
11
13
|
* State transitions:
|
|
12
14
|
* RoundStarted → EvidenceCaptured → EvaluationSubmitted
|
|
@@ -15,18 +17,28 @@
|
|
|
15
17
|
* Persistence is owned by round-transaction.ts so reject paths remain
|
|
16
18
|
* side-effect free and accepted decisions can be replayed idempotently.
|
|
17
19
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
+
import { queryLoopEntries } from "./loop-store.js";
|
|
21
|
+
import { CHECK_SUCCESS_UNVERIFIED, verifySelfEvaluation, entryRound } from "./verification-gate.js";
|
|
22
|
+
import { effectiveSuccess } from "./self-eval.js";
|
|
23
|
+
import { enforceRound, buildRejectionPrompt, findSafeRestorePoint, buildBacktrackPrompt, findBacktrackTargetGitHead, } from "./enforcement-gate.js";
|
|
20
24
|
import { logEvent } from "./observability.js";
|
|
21
25
|
import { getPolicy } from "./policy.js";
|
|
22
|
-
|
|
26
|
+
/** v3.2: Whether a round's success enters the success trajectory. Excluded
|
|
27
|
+
* when the gate contradicted the round, or when the success claim carries no
|
|
28
|
+
* machine-verified observation (success_unverified warn) — an
|
|
29
|
+
* accepted-but-unverified round is not evidence of progress. */
|
|
30
|
+
function shouldPushSuccess(gateContradicted, verificationFlags) {
|
|
31
|
+
if (gateContradicted)
|
|
32
|
+
return false;
|
|
33
|
+
return !verificationFlags.some((flag) => flag.severity === "warn" && flag.check === CHECK_SUCCESS_UNVERIFIED);
|
|
34
|
+
}
|
|
23
35
|
// ── RoundCoordinator ───────────────────────────────────────────────────────
|
|
24
36
|
export class RoundCoordinator {
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
this.
|
|
37
|
+
store;
|
|
38
|
+
constructor(store) {
|
|
39
|
+
this.store = store;
|
|
28
40
|
}
|
|
29
|
-
/** Process a single round's
|
|
41
|
+
/** Process a single round's self-evaluation through the decision pipeline:
|
|
30
42
|
* verify → enforce → stop decision.
|
|
31
43
|
*
|
|
32
44
|
* This is the single entry point called by SessionManager.
|
|
@@ -34,36 +46,30 @@ export class RoundCoordinator {
|
|
|
34
46
|
* - Compiling the next prompt (if action is "continue")
|
|
35
47
|
* - Managing heartbeat / signal handlers (runtime only)
|
|
36
48
|
* - Memory injection (both paths, before calling processRound)
|
|
37
|
-
* - Transactional
|
|
49
|
+
* - Transactional feedback commit (accepted rounds only)
|
|
38
50
|
* - State file I/O (both paths, after compiling)
|
|
39
51
|
*
|
|
40
52
|
* @param driftClarificationStreak v2.12: Current clarification streak
|
|
41
53
|
* from session state. Passed through to enforceRound for R7 escalation. */
|
|
42
54
|
processRound(input, driftClarificationStreak = 0) {
|
|
43
|
-
const { loopId, task, currentRound, maxRounds,
|
|
44
|
-
const
|
|
45
|
-
const roundSuccess = roundReport.outcome === "success";
|
|
55
|
+
const { loopId, task, currentRound, maxRounds, selfEval, extractionSucceeded, lastSelfEval, consecutiveRejections, evidenceSnapshots, } = input;
|
|
56
|
+
const roundSuccess = selfEval.success ?? false;
|
|
46
57
|
// ── 1. Query vault entries ──────────────────────────────────────────
|
|
47
|
-
//
|
|
58
|
+
// Lineage entries (constraint violations, output summaries) and feedback
|
|
59
|
+
// entries (execution_evidence, progress estimates) are both needed by
|
|
60
|
+
// the enforcement gate. queryLoopEntries excludes feedback by default,
|
|
61
|
+
// so we issue a second query and merge both result sets.
|
|
48
62
|
const prefix = `loop:${loopId}:r`;
|
|
49
|
-
const vaultEntries = this.
|
|
50
|
-
?
|
|
63
|
+
const vaultEntries = this.store
|
|
64
|
+
? [
|
|
65
|
+
...queryLoopEntries(this.store, loopId, { prefix }),
|
|
66
|
+
...queryLoopEntries(this.store, loopId, { prefix, feedbackOnly: true }),
|
|
67
|
+
]
|
|
51
68
|
: [];
|
|
52
69
|
// ── 2. Verification gate ────────────────────────────────────────────
|
|
53
|
-
const
|
|
54
|
-
previous: previousProjection ?? null,
|
|
55
|
-
expectedAction: input.expectedAction,
|
|
56
|
-
backtrackSkippedFiles: input.backtrackSkippedFiles,
|
|
57
|
-
backtrackTargetGitHead: input.backtrackTargetGitHead,
|
|
58
|
-
consecutiveRejections,
|
|
59
|
-
driftClarificationStreak,
|
|
60
|
-
escalatedRejectionChecks: input.escalatedRejectionChecks,
|
|
61
|
-
});
|
|
62
|
-
const currentProjection = deriveCompilerProjection(roundReport, currentRound, input.remainingCriteria ?? [], evidenceSnapshots ?? []);
|
|
63
|
-
const verifyResult = verifyRoundReport(gateContext);
|
|
70
|
+
const verifyResult = verifySelfEvaluation(selfEval, currentRound, vaultEntries, lastSelfEval ?? null, evidenceSnapshots ?? [], input.backtrackSkippedFiles ?? [], input.backtrackTargetGitHead);
|
|
64
71
|
const verificationFlags = verifyResult.flags;
|
|
65
72
|
const gateContradicted = verifyResult.verdict === "contradicted";
|
|
66
|
-
const clarificationAccepted = verificationFlags.some((item) => item.check === "intent_drift" && item.severity === "warn");
|
|
67
73
|
if (gateContradicted) {
|
|
68
74
|
logEvent("gate_contradicted", {
|
|
69
75
|
loopId,
|
|
@@ -72,8 +78,10 @@ export class RoundCoordinator {
|
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
80
|
// ── 3. Enforcement gate ──────────────────────────────────────────
|
|
75
|
-
//
|
|
76
|
-
|
|
81
|
+
// v2.5: heuristic extractions now run partial enforcement. Rules that
|
|
82
|
+
// depend on execution_evidence (R3/R4/R5) self-skip when evidence is
|
|
83
|
+
// missing. Rules that don't need evidence (R1/R2/R6/R7) always run.
|
|
84
|
+
const enforceResult = enforceRound(selfEval, verifyResult, currentRound, vaultEntries, consecutiveRejections, !extractionSucceeded, driftClarificationStreak);
|
|
77
85
|
if (enforceResult.action === "reject") {
|
|
78
86
|
const newRejections = consecutiveRejections + 1;
|
|
79
87
|
const rejectionPrompt = buildRejectionPrompt(currentRound, task, enforceResult, verificationFlags);
|
|
@@ -94,10 +102,9 @@ export class RoundCoordinator {
|
|
|
94
102
|
roundSuccess,
|
|
95
103
|
gateContradicted,
|
|
96
104
|
newConsecutiveRejections: newRejections,
|
|
97
|
-
// Don't update
|
|
98
|
-
|
|
105
|
+
// Don't update lastSelfEval on reject — the agent redoes the same round
|
|
106
|
+
newLastSelfEval: undefined,
|
|
99
107
|
shouldPushSuccessTrajectory: false,
|
|
100
|
-
escalationIssued: enforceResult.escalation_issued ?? false,
|
|
101
108
|
};
|
|
102
109
|
}
|
|
103
110
|
if (enforceResult.action === "terminate") {
|
|
@@ -116,7 +123,7 @@ export class RoundCoordinator {
|
|
|
116
123
|
roundSuccess,
|
|
117
124
|
gateContradicted,
|
|
118
125
|
newConsecutiveRejections: 0,
|
|
119
|
-
|
|
126
|
+
newLastSelfEval: selfEval,
|
|
120
127
|
shouldPushSuccessTrajectory: false,
|
|
121
128
|
};
|
|
122
129
|
}
|
|
@@ -141,18 +148,34 @@ export class RoundCoordinator {
|
|
|
141
148
|
roundSuccess,
|
|
142
149
|
gateContradicted,
|
|
143
150
|
newConsecutiveRejections: 0,
|
|
144
|
-
|
|
151
|
+
newLastSelfEval: selfEval,
|
|
145
152
|
shouldPushSuccessTrajectory: false,
|
|
146
153
|
};
|
|
147
154
|
}
|
|
148
|
-
// Collect files changed in skipped rounds for the restore prompt
|
|
149
|
-
const skippedFiles =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
// v2.13: Collect files changed in skipped rounds for the restore prompt
|
|
156
|
+
const skippedFiles = [];
|
|
157
|
+
for (let r = restorePoint.round + 1; r < currentRound; r++) {
|
|
158
|
+
// v3.2.1: match the feedback entry (execution_evidence lives there) —
|
|
159
|
+
// the compile-time lineage entry for the same round precedes it in
|
|
160
|
+
// the flat view and carries no evidence.
|
|
161
|
+
const entry = vaultEntries.find((e) => entryRound(e) === r && e.task_type !== "loop_lineage");
|
|
162
|
+
if (entry?.execution_evidence) {
|
|
163
|
+
const ev = entry.execution_evidence;
|
|
164
|
+
const files = Array.isArray(ev.files_changed)
|
|
165
|
+
? ev.files_changed.filter((f) => typeof f === "string")
|
|
166
|
+
: [];
|
|
167
|
+
for (const f of files) {
|
|
168
|
+
if (!skippedFiles.includes(f))
|
|
169
|
+
skippedFiles.push(f);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// v2.12: Capture the restore point's git HEAD so the next round's
|
|
174
|
+
// verification can confirm the workspace returned to this commit.
|
|
175
|
+
const targetGitHead = findBacktrackTargetGitHead(restorePoint.round, vaultEntries);
|
|
153
176
|
const backtrackPrompt = buildBacktrackPrompt(currentRound, restorePoint.round, enforceResult.check ?? "progress_stall", getPolicy().engine.backtrack_preserve_discoveries
|
|
154
177
|
? restorePoint.skippedDiscoveries
|
|
155
|
-
: [], skippedFiles);
|
|
178
|
+
: [], skippedFiles, targetGitHead ?? undefined);
|
|
156
179
|
logEvent("enforcement_backtrack", {
|
|
157
180
|
loopId,
|
|
158
181
|
round: currentRound,
|
|
@@ -165,11 +188,11 @@ export class RoundCoordinator {
|
|
|
165
188
|
action: "backtrack",
|
|
166
189
|
backtrackPrompt,
|
|
167
190
|
backtrackTarget: restorePoint.round,
|
|
168
|
-
backtrackTargetGitHead,
|
|
169
191
|
backtrackSkippedDiscoveries: getPolicy().engine.backtrack_preserve_discoveries
|
|
170
192
|
? restorePoint.skippedDiscoveries
|
|
171
193
|
: [],
|
|
172
194
|
backtrackSkippedFiles: skippedFiles,
|
|
195
|
+
backtrackTargetGitHead: targetGitHead ?? undefined,
|
|
173
196
|
backtrackTriggerRule: enforceResult.check,
|
|
174
197
|
verificationFlags,
|
|
175
198
|
enforcementAction: "backtrack",
|
|
@@ -178,22 +201,35 @@ export class RoundCoordinator {
|
|
|
178
201
|
roundSuccess,
|
|
179
202
|
gateContradicted,
|
|
180
203
|
newConsecutiveRejections: 0, // reset — fresh start
|
|
181
|
-
|
|
204
|
+
newLastSelfEval: undefined,
|
|
182
205
|
shouldPushSuccessTrajectory: false,
|
|
183
206
|
};
|
|
184
207
|
}
|
|
185
208
|
// Accept: reset rejection counter
|
|
186
209
|
// (consecutiveRejections reset to 0 — caller persists)
|
|
187
|
-
// ── 4.
|
|
210
|
+
// ── 4. Auto-feedback (AFTER enforcement, only if accepted) ──────────
|
|
188
211
|
// ── 5. Stop condition checks ────────────────────────────────────────
|
|
189
|
-
// 5a.
|
|
190
|
-
|
|
191
|
-
|
|
212
|
+
// 5a. Extraction failed → stalled
|
|
213
|
+
if (!extractionSucceeded) {
|
|
214
|
+
return {
|
|
215
|
+
action: "stop",
|
|
216
|
+
stopReason: "stalled",
|
|
217
|
+
verificationFlags,
|
|
218
|
+
roundSuccess,
|
|
219
|
+
gateContradicted,
|
|
220
|
+
newConsecutiveRejections: 0,
|
|
221
|
+
newLastSelfEval: selfEval,
|
|
222
|
+
shouldPushSuccessTrajectory: shouldPushSuccess(gateContradicted, verificationFlags),
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// 5b. Agent says stop
|
|
226
|
+
if (!selfEval.should_continue) {
|
|
192
227
|
let reason;
|
|
193
|
-
if (
|
|
228
|
+
if (effectiveSuccess(selfEval)) {
|
|
194
229
|
reason = "completed";
|
|
195
230
|
}
|
|
196
|
-
else if (
|
|
231
|
+
else if (selfEval.outcome === "blocked" ||
|
|
232
|
+
selfEval.stop_reason === "blocked" || selfEval.stop_reason === "needs_human_input") {
|
|
197
233
|
reason = "blocked";
|
|
198
234
|
}
|
|
199
235
|
else {
|
|
@@ -206,47 +242,18 @@ export class RoundCoordinator {
|
|
|
206
242
|
roundSuccess,
|
|
207
243
|
gateContradicted,
|
|
208
244
|
newConsecutiveRejections: 0,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
shouldPushSuccessTrajectory: !gateContradicted,
|
|
245
|
+
newLastSelfEval: selfEval,
|
|
246
|
+
shouldPushSuccessTrajectory: shouldPushSuccess(gateContradicted, verificationFlags),
|
|
212
247
|
};
|
|
213
248
|
}
|
|
214
|
-
// 5b. Circuit breaker — max consecutive failed rounds.
|
|
215
|
-
//
|
|
216
|
-
// When the last N accepted rounds (including this one) all reported
|
|
217
|
-
// failure with no recovery, the loop is failing faster than it can
|
|
218
|
-
// self-correct. Stop before errors compound (p^N). The trajectory only
|
|
219
|
-
// contains committed, non-contradicted rounds, so this never fires on
|
|
220
|
-
// an enforcement-rejected round (those never reach this point).
|
|
221
|
-
const breakerMax = getPolicy().engine.max_circuit_breaker;
|
|
222
|
-
if (breakerMax > 0) {
|
|
223
|
-
const breakerWindow = [...(input.successTrajectory ?? []), roundSuccess]
|
|
224
|
-
.slice(-breakerMax);
|
|
225
|
-
if (breakerWindow.length === breakerMax &&
|
|
226
|
-
breakerWindow.every((value) => value === false)) {
|
|
227
|
-
logEvent("session_end", {
|
|
228
|
-
loopId,
|
|
229
|
-
stopReason: "circuit_breaker",
|
|
230
|
-
round: currentRound,
|
|
231
|
-
});
|
|
232
|
-
return {
|
|
233
|
-
action: "stop",
|
|
234
|
-
stopReason: "circuit_breaker",
|
|
235
|
-
verificationFlags,
|
|
236
|
-
roundSuccess,
|
|
237
|
-
gateContradicted,
|
|
238
|
-
newConsecutiveRejections: 0,
|
|
239
|
-
newRoundProjection: currentProjection,
|
|
240
|
-
clarificationAccepted,
|
|
241
|
-
shouldPushSuccessTrajectory: false,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
249
|
// 5c. Max rounds reached
|
|
246
250
|
//
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
251
|
+
// NOTE: The binary-success circuit breaker previously at 5c is removed.
|
|
252
|
+
// Genuine agent stalls are now detected by the enforcement gate via
|
|
253
|
+
// enforceProgressStall (R4: delta < 5% → reject → terminate on repeat)
|
|
254
|
+
// and enforceProgressStallTerminal (R5: delta = 0 for N rounds → terminate).
|
|
255
|
+
// These use progress_estimate, not the binary success flag, so they
|
|
256
|
+
// correctly distinguish "task not done yet" from "agent is stuck".
|
|
250
257
|
if (currentRound >= maxRounds) {
|
|
251
258
|
return {
|
|
252
259
|
action: "stop",
|
|
@@ -255,9 +262,8 @@ export class RoundCoordinator {
|
|
|
255
262
|
roundSuccess,
|
|
256
263
|
gateContradicted,
|
|
257
264
|
newConsecutiveRejections: 0,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
shouldPushSuccessTrajectory: !gateContradicted,
|
|
265
|
+
newLastSelfEval: selfEval,
|
|
266
|
+
shouldPushSuccessTrajectory: shouldPushSuccess(gateContradicted, verificationFlags),
|
|
261
267
|
};
|
|
262
268
|
}
|
|
263
269
|
// ── 6. Continue — caller compiles next round ────────────────────────
|
|
@@ -268,9 +274,10 @@ export class RoundCoordinator {
|
|
|
268
274
|
roundSuccess,
|
|
269
275
|
gateContradicted,
|
|
270
276
|
newConsecutiveRejections: 0,
|
|
271
|
-
|
|
272
|
-
shouldPushSuccessTrajectory:
|
|
273
|
-
|
|
277
|
+
newLastSelfEval: selfEval,
|
|
278
|
+
shouldPushSuccessTrajectory: shouldPushSuccess(gateContradicted, verificationFlags),
|
|
279
|
+
// v2.12: Propagate clarification acceptance signal for streak tracking
|
|
280
|
+
clarificationAccepted: enforceResult.clarification_accepted ?? false,
|
|
274
281
|
};
|
|
275
282
|
}
|
|
276
283
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-coordinator.js","sourceRoot":"","sources":["../src/round-coordinator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"round-coordinator.js","sourceRoot":"","sources":["../src/round-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAUnD,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAA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gBACZ,gBAAgB;gBAChB,wBAAwB,EAAE,CAAC;gBAC3B,eAAe,EAAE,QAAQ;gBACzB,2BAA2B,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;aACpF,CAAC;QACJ,CAAC;QAED,uEAAuE;QACvE,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,iBAAiB;YACjB,iBAAiB,EAAE,QAAQ;YAC3B,YAAY;YACZ,gBAAgB;YAChB,wBAAwB,EAAE,CAAC;YAC3B,eAAe,EAAE,QAAQ;YACzB,2BAA2B,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YACnF,uEAAuE;YACvE,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,IAAI,KAAK;SACrE,CAAC;IACJ,CAAC;CACF"}
|
package/dist/round-driver.d.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* in their adapters.
|
|
7
7
|
*/
|
|
8
8
|
import type { LoopStore } from "./loop-store.js";
|
|
9
|
-
import {
|
|
9
|
+
import { LoopForgeEngine } from "./engine.js";
|
|
10
10
|
import type { ProviderSnapshot } from "./evidence-provider.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { LoopForgeRequest, LoopForgeResponse, PromptArtifact, SelfEvaluation } from "./protocol.js";
|
|
12
12
|
import type { RoundTransactionOutcome, RoundTransactionSnapshot } from "./round-transaction.js";
|
|
13
13
|
export interface PreparedRound {
|
|
14
14
|
prompt: string;
|
|
@@ -18,28 +18,26 @@ export interface PreparedRound {
|
|
|
18
18
|
snapshot: RoundTransactionSnapshot;
|
|
19
19
|
stateFileContent?: string;
|
|
20
20
|
warnings?: string[];
|
|
21
|
-
|
|
21
|
+
/** v3.0.1: The full compile response. Callers may cache it (e.g. for the
|
|
22
|
+
* typed projection) instead of recompiling for derived views. */
|
|
23
|
+
compileResponse?: LoopForgeResponse;
|
|
22
24
|
}
|
|
23
25
|
export interface CompleteRoundInput {
|
|
24
26
|
snapshot: RoundTransactionSnapshot;
|
|
25
27
|
loopId: string;
|
|
26
28
|
task: string;
|
|
27
29
|
maxRounds: number;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
selfEval: SelfEvaluation;
|
|
31
|
+
extractionSucceeded: boolean;
|
|
32
|
+
lastSelfEval?: SelfEvaluation;
|
|
30
33
|
consecutiveRejections: number;
|
|
31
34
|
successTrajectory: boolean[];
|
|
32
35
|
/** v2.12: Current clarification streak for R7 escalation. */
|
|
33
36
|
driftClarificationStreak?: number;
|
|
34
|
-
/** Terminal enforcement checks that already consumed their guided retry. */
|
|
35
|
-
escalatedRejectionChecks?: string[];
|
|
36
37
|
/** v2.13: Files from skipped backtrack rounds for restore check. */
|
|
37
38
|
backtrackSkippedFiles?: string[];
|
|
38
|
-
/** v2.
|
|
39
|
-
* verification gate; the post-backtrack round must match it. */
|
|
39
|
+
/** v2.12: Git HEAD of the backtrack restore point (workspace restore check). */
|
|
40
40
|
backtrackTargetGitHead?: string;
|
|
41
|
-
expectedAction?: string;
|
|
42
|
-
remainingCriteria?: string[];
|
|
43
41
|
}
|
|
44
42
|
export interface CompletedRound {
|
|
45
43
|
outcome: RoundTransactionOutcome;
|
|
@@ -47,9 +45,12 @@ export interface CompletedRound {
|
|
|
47
45
|
}
|
|
48
46
|
export declare class RoundDriver {
|
|
49
47
|
private readonly engine;
|
|
50
|
-
private readonly
|
|
51
|
-
constructor(engine:
|
|
48
|
+
private readonly store;
|
|
49
|
+
constructor(engine: LoopForgeEngine, store?: LoopStore);
|
|
52
50
|
prepare(request: LoopForgeRequest, loopId: string, round: number): Promise<PreparedRound | null>;
|
|
51
|
+
/** Synchronous fallback for legacy embedding APIs. Async evidence providers
|
|
52
|
+
* are deliberately skipped by EvidenceCollector.collect(). */
|
|
53
|
+
prepareSync(request: LoopForgeRequest, loopId: string, round: number): PreparedRound | null;
|
|
53
54
|
private compile;
|
|
54
55
|
/** Compile a fresh prompt for a zero-commit enforcement retry. The logical
|
|
55
56
|
* round ID and before-evidence snapshot remain stable; only attempt changes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-driver.d.ts","sourceRoot":"","sources":["../src/round-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"round-driver.d.ts","sourceRoot":"","sources":["../src/round-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACf,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;sEACkE;IAClE,eAAe,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,cAAc,CAAC;IACzB,mBAAmB,EAAE,OAAO,CA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 +6,34 @@
|
|
|
6
6
|
* in their adapters.
|
|
7
7
|
*/
|
|
8
8
|
import { EvidenceCollector } from "./evidence-provider.js";
|
|
9
|
-
import { writeStateFile } from "./policy.js";
|
|
9
|
+
import { getPolicy, writeStateFile } from "./policy.js";
|
|
10
10
|
import { prepareRejectedAttempt, prepareRoundTransaction, RoundTransactionCoordinator, } from "./round-transaction.js";
|
|
11
11
|
export class RoundDriver {
|
|
12
12
|
engine;
|
|
13
|
-
|
|
14
|
-
constructor(engine,
|
|
13
|
+
store;
|
|
14
|
+
constructor(engine, store) {
|
|
15
15
|
this.engine = engine;
|
|
16
|
-
this.
|
|
16
|
+
this.store = store ?? engine.getStore();
|
|
17
17
|
}
|
|
18
18
|
async prepare(request, loopId, round) {
|
|
19
|
+
// v3.0.1: compile (CPU-bound) and before-evidence collection (external
|
|
20
|
+
// process spawns) run concurrently — the git/command spawns were the
|
|
21
|
+
// latency tail behind the old compile-first, evidence-second order.
|
|
22
|
+
const [response, evidenceBaseline] = await Promise.all([
|
|
23
|
+
Promise.resolve().then(() => this.compile(request, loopId, true)),
|
|
24
|
+
this.collectEvidence(loopId, "before"),
|
|
25
|
+
]);
|
|
26
|
+
if (!response)
|
|
27
|
+
return null;
|
|
28
|
+
return this.finishPrepare(response, loopId, round, evidenceBaseline);
|
|
29
|
+
}
|
|
30
|
+
/** Synchronous fallback for legacy embedding APIs. Async evidence providers
|
|
31
|
+
* are deliberately skipped by EvidenceCollector.collect(). */
|
|
32
|
+
prepareSync(request, loopId, round) {
|
|
19
33
|
const response = this.compile(request, loopId, true);
|
|
20
34
|
if (!response)
|
|
21
35
|
return null;
|
|
22
|
-
const evidenceBaseline =
|
|
36
|
+
const evidenceBaseline = EvidenceCollector.fromProviderNames(getPolicy().evidence.providers).collect({ loopId });
|
|
23
37
|
return this.finishPrepare(response, loopId, round, evidenceBaseline);
|
|
24
38
|
}
|
|
25
39
|
compile(request, loopId, persistLineage) {
|
|
@@ -53,7 +67,7 @@ export class RoundDriver {
|
|
|
53
67
|
snapshot,
|
|
54
68
|
stateFileContent: response.state_file_content,
|
|
55
69
|
warnings: response.warnings,
|
|
56
|
-
|
|
70
|
+
compileResponse: response,
|
|
57
71
|
};
|
|
58
72
|
}
|
|
59
73
|
finishPrepare(response, loopId, round, evidenceBaseline) {
|
|
@@ -67,32 +81,30 @@ export class RoundDriver {
|
|
|
67
81
|
snapshot,
|
|
68
82
|
stateFileContent: response.state_file_content,
|
|
69
83
|
warnings: response.warnings,
|
|
70
|
-
|
|
84
|
+
compileResponse: response,
|
|
71
85
|
};
|
|
72
86
|
}
|
|
73
87
|
async complete(input) {
|
|
74
88
|
const actualEvidence = await this.collectEvidence(input.loopId, "after");
|
|
75
|
-
const transaction = new RoundTransactionCoordinator(this.engine, this.
|
|
89
|
+
const transaction = new RoundTransactionCoordinator(this.engine, this.store);
|
|
76
90
|
const outcome = transaction.process({
|
|
77
91
|
snapshot: input.snapshot,
|
|
78
92
|
task: input.task,
|
|
79
93
|
maxRounds: input.maxRounds,
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
selfEval: input.selfEval,
|
|
95
|
+
extractionSucceeded: input.extractionSucceeded,
|
|
96
|
+
lastSelfEval: input.lastSelfEval,
|
|
82
97
|
consecutiveRejections: input.consecutiveRejections,
|
|
83
98
|
successTrajectory: input.successTrajectory,
|
|
84
99
|
actualEvidence,
|
|
85
100
|
driftClarificationStreak: input.driftClarificationStreak,
|
|
86
101
|
backtrackSkippedFiles: input.backtrackSkippedFiles,
|
|
87
102
|
backtrackTargetGitHead: input.backtrackTargetGitHead,
|
|
88
|
-
expectedAction: input.expectedAction,
|
|
89
|
-
escalatedRejectionChecks: input.escalatedRejectionChecks,
|
|
90
|
-
remainingCriteria: input.remainingCriteria,
|
|
91
103
|
});
|
|
92
104
|
return { outcome, actualEvidence };
|
|
93
105
|
}
|
|
94
106
|
recover(snapshot) {
|
|
95
|
-
return new RoundTransactionCoordinator(this.engine, this.
|
|
107
|
+
return new RoundTransactionCoordinator(this.engine, this.store).recover(snapshot);
|
|
96
108
|
}
|
|
97
109
|
collectEvidence(loopId, phase) {
|
|
98
110
|
return EvidenceCollector.fromPolicy().collectAsync({ loopId, phase });
|
package/dist/round-driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-driver.js","sourceRoot":"","sources":["../src/round-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"round-driver.js","sourceRoot":"","sources":["../src/round-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AA0ChC,MAAM,OAAO,WAAW;IAGO;IAFZ,KAAK,CAAY;IAElC,YAA6B,MAAuB,EAAE,KAAiB;QAA1C,WAAM,GAAN,MAAM,CAAiB;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAyB,EACzB,MAAc,EACd,KAAa;QAEb,uEAAuE;QACvE,qEAAqE;QACrE,oEAAoE;QACpE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACrD,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACjE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC;SACvC,CAAC,CAAC;QACH,IAAI,CAAC,QA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,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,IAAI,2BAA2B,CACjD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACX,CAAC;QACF,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;YAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;YAC9C,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;YAClD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,cAAc;YACd,wBAAwB,EAAE,KAAK,CAAC,wBAAwB;YACxD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;YAClD,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;SACrD,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,QAAkC;QACxC,OAAO,IAAI,2BAA2B,CACpC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACX,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IAEO,eAAe,CACrB,MAAc,EACd,KAAyB;QAEzB,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
*
|
|
3
3
|
* A logical round has one deterministic roundId. Rejected attempts keep the
|
|
4
4
|
* same identity and before snapshot; only accepted decisions are committed to
|
|
5
|
-
*
|
|
5
|
+
* feedback storage. The committed feedback embeds the decision so replay after
|
|
6
6
|
* a process crash is idempotent.
|
|
7
7
|
*/
|
|
8
8
|
import type { LoopStore } from "./loop-store.js";
|
|
9
|
-
import {
|
|
9
|
+
import { LoopForgeEngine } from "./engine.js";
|
|
10
10
|
import type { ProviderSnapshot } from "./evidence-provider.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { SelfEvaluation } from "./protocol.js";
|
|
12
12
|
import type { PromptArtifact } from "./protocol.js";
|
|
13
13
|
import { type RoundProcessResult } from "./round-coordinator.js";
|
|
14
|
-
import type { RoundCommitStore } from "./
|
|
15
|
-
export declare const
|
|
14
|
+
import type { RoundCommitStore } from "./storage.js";
|
|
15
|
+
export declare const ROUND_TRANSACTION_SCHEMA_VERSION: 1;
|
|
16
16
|
export type RoundTransactionPhase = "prepared" | "prompted" | "evaluated" | "rejected" | "committed" | "terminated";
|
|
17
17
|
export interface RoundTransactionSnapshot {
|
|
18
|
-
|
|
18
|
+
schemaVersion: typeof ROUND_TRANSACTION_SCHEMA_VERSION;
|
|
19
19
|
roundId: string;
|
|
20
20
|
loopId: string;
|
|
21
21
|
round: number;
|
|
@@ -24,7 +24,7 @@ export interface RoundTransactionSnapshot {
|
|
|
24
24
|
beforeEvidence: ProviderSnapshot[];
|
|
25
25
|
afterEvidence?: ProviderSnapshot[];
|
|
26
26
|
roundEvidence?: ProviderSnapshot[];
|
|
27
|
-
|
|
27
|
+
evaluation?: SelfEvaluation;
|
|
28
28
|
result?: RoundProcessResult;
|
|
29
29
|
createdAt: number;
|
|
30
30
|
updatedAt: number;
|
|
@@ -35,22 +35,18 @@ export interface RoundTransactionInput {
|
|
|
35
35
|
snapshot: RoundTransactionSnapshot;
|
|
36
36
|
task: string;
|
|
37
37
|
maxRounds: number;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
selfEval: SelfEvaluation;
|
|
39
|
+
extractionSucceeded: boolean;
|
|
40
|
+
lastSelfEval?: SelfEvaluation;
|
|
40
41
|
consecutiveRejections: number;
|
|
41
42
|
successTrajectory: boolean[];
|
|
42
43
|
/** v2.12: Current clarification streak for R7 escalation. */
|
|
43
44
|
driftClarificationStreak?: number;
|
|
44
|
-
/** Terminal enforcement checks that already consumed their guided retry. */
|
|
45
|
-
escalatedRejectionChecks?: string[];
|
|
46
45
|
/** v2.13: Files from skipped backtrack rounds for restore check. */
|
|
47
46
|
backtrackSkippedFiles?: string[];
|
|
48
|
-
/** v2.
|
|
49
|
-
*
|
|
47
|
+
/** v2.12: Git HEAD of the backtrack restore point. The verification gate
|
|
48
|
+
* checks the workspace returns to this commit before accepting work. */
|
|
50
49
|
backtrackTargetGitHead?: string;
|
|
51
|
-
expectedAction?: string;
|
|
52
|
-
/** Criteria still open when this prompt was compiled. */
|
|
53
|
-
remainingCriteria?: string[];
|
|
54
50
|
actualEvidence: ProviderSnapshot[];
|
|
55
51
|
}
|
|
56
52
|
export interface RoundTransactionOutcome {
|
|
@@ -65,13 +61,14 @@ export declare function prepareRoundTransaction(loopId: string, round: number, b
|
|
|
65
61
|
* its identity or evidence baseline. Evaluation fields belong to the previous
|
|
66
62
|
* attempt and are cleared before the Agent receives the retry prompt. */
|
|
67
63
|
export declare function prepareRejectedAttempt(rejected: RoundTransactionSnapshot, promptArtifact: PromptArtifact): RoundTransactionSnapshot;
|
|
64
|
+
export declare function isProcessResult(value: unknown): value is RoundProcessResult;
|
|
68
65
|
/** Parse a persisted snapshot without trusting arbitrary vault data. */
|
|
69
66
|
export declare function parseRoundTransactionSnapshot(value: unknown): RoundTransactionSnapshot | null;
|
|
70
67
|
export declare class RoundTransactionCoordinator {
|
|
71
68
|
private readonly engine;
|
|
72
|
-
private readonly
|
|
69
|
+
private readonly store;
|
|
73
70
|
private readonly commitStore;
|
|
74
|
-
constructor(engine:
|
|
71
|
+
constructor(engine: LoopForgeEngine, store?: LoopStore, commitStore?: RoundCommitStore);
|
|
75
72
|
process(input: RoundTransactionInput): RoundTransactionOutcome;
|
|
76
73
|
/** Recover an already committed decision without evaluating or writing. */
|
|
77
74
|
recover(snapshot: RoundTransactionSnapshot): RoundTransactionOutcome | null;
|