loopforge 3.2.1 → 3.7.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.
- package/README.md +74 -71
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +6 -38
- package/dist/audit.js.map +1 -1
- package/dist/canonical-state.d.ts +71 -6
- package/dist/canonical-state.d.ts.map +1 -1
- package/dist/canonical-state.js +176 -29
- package/dist/canonical-state.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -26
- package/dist/cli.js.map +1 -1
- package/dist/cognitive-facts.d.ts +17 -0
- package/dist/cognitive-facts.d.ts.map +1 -0
- package/dist/cognitive-facts.js +99 -0
- package/dist/cognitive-facts.js.map +1 -0
- package/dist/cognitive-governance.d.ts +0 -1
- package/dist/cognitive-governance.d.ts.map +1 -1
- package/dist/cognitive-governance.js +1 -4
- package/dist/cognitive-governance.js.map +1 -1
- package/dist/committed-round.d.ts +100 -0
- package/dist/committed-round.d.ts.map +1 -0
- package/dist/committed-round.js +349 -0
- package/dist/committed-round.js.map +1 -0
- package/dist/enforcement-gate.d.ts +4 -2
- package/dist/enforcement-gate.d.ts.map +1 -1
- package/dist/enforcement-gate.js +385 -357
- package/dist/enforcement-gate.js.map +1 -1
- package/dist/engine.d.ts +16 -4
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +65 -16
- package/dist/engine.js.map +1 -1
- package/dist/evidence-claims.d.ts.map +1 -1
- package/dist/evidence-claims.js +15 -39
- package/dist/evidence-claims.js.map +1 -1
- package/dist/evidence-provider.d.ts +35 -17
- package/dist/evidence-provider.d.ts.map +1 -1
- package/dist/evidence-provider.js +105 -108
- package/dist/evidence-provider.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/loop-compiler.d.ts +21 -10
- package/dist/loop-compiler.d.ts.map +1 -1
- package/dist/loop-compiler.js +232 -276
- package/dist/loop-compiler.js.map +1 -1
- package/dist/loop-projection.d.ts +5 -25
- package/dist/loop-projection.d.ts.map +1 -1
- package/dist/loop-projection.js +18 -134
- package/dist/loop-projection.js.map +1 -1
- package/dist/loop-store.d.ts +16 -18
- package/dist/loop-store.d.ts.map +1 -1
- package/dist/loop-store.js +21 -63
- package/dist/loop-store.js.map +1 -1
- package/dist/mcp/round-lifecycle.d.ts +13 -10
- package/dist/mcp/round-lifecycle.d.ts.map +1 -1
- package/dist/mcp/round-lifecycle.js +95 -68
- package/dist/mcp/round-lifecycle.js.map +1 -1
- package/dist/mcp/server.js +3 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +17 -5
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +177 -54
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +161 -53
- package/dist/mcp/tools.js.map +1 -1
- package/dist/policy-metrics.d.ts +0 -7
- package/dist/policy-metrics.d.ts.map +1 -1
- package/dist/policy-metrics.js +15 -55
- package/dist/policy-metrics.js.map +1 -1
- package/dist/policy.d.ts +22 -31
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +24 -42
- package/dist/policy.js.map +1 -1
- package/dist/prompt-assembler.d.ts +0 -3
- package/dist/prompt-assembler.d.ts.map +1 -1
- package/dist/prompt-assembler.js +124 -191
- package/dist/prompt-assembler.js.map +1 -1
- package/dist/protocol.d.ts +61 -46
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +2 -18
- package/dist/protocol.js.map +1 -1
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +21 -22
- package/dist/replay.js.map +1 -1
- package/dist/round-contract.d.ts +64 -0
- package/dist/round-contract.d.ts.map +1 -0
- package/dist/round-contract.js +80 -0
- package/dist/round-contract.js.map +1 -0
- package/dist/round-coordinator.d.ts +5 -3
- package/dist/round-coordinator.d.ts.map +1 -1
- package/dist/round-coordinator.js +34 -29
- package/dist/round-coordinator.js.map +1 -1
- package/dist/round-driver.d.ts +0 -4
- package/dist/round-driver.d.ts.map +1 -1
- package/dist/round-driver.js +1 -11
- package/dist/round-driver.js.map +1 -1
- package/dist/round-transaction.d.ts +0 -1
- package/dist/round-transaction.d.ts.map +1 -1
- package/dist/round-transaction.js +0 -1
- package/dist/round-transaction.js.map +1 -1
- package/dist/self-eval.d.ts +29 -34
- package/dist/self-eval.d.ts.map +1 -1
- package/dist/self-eval.js +112 -148
- package/dist/self-eval.js.map +1 -1
- package/dist/token-utils.d.ts +7 -3
- package/dist/token-utils.d.ts.map +1 -1
- package/dist/token-utils.js +18 -3
- package/dist/token-utils.js.map +1 -1
- package/dist/verification-gate.d.ts +72 -21
- package/dist/verification-gate.d.ts.map +1 -1
- package/dist/verification-gate.js +544 -157
- package/dist/verification-gate.js.map +1 -1
- package/dist/workspace.d.ts +29 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +61 -0
- package/dist/workspace.js.map +1 -0
- package/loop_policy.json +5 -17
- package/package.json +2 -2
- package/skills/perception/SKILL.md +137 -136
|
@@ -11,16 +11,19 @@
|
|
|
11
11
|
* this round is excluded from the success trend (NOT
|
|
12
12
|
* modified). Flags become hard constraints — the agent
|
|
13
13
|
* must respond in the next round.
|
|
14
|
+
*
|
|
15
|
+
* v3.7: every check belongs to one of four verification domains (CHECK_DOMAIN
|
|
16
|
+
* below): evaluation consistency / evidence integrity / plan & contract /
|
|
17
|
+
* progress & recovery. A domain describes a check's semantic job — it never
|
|
18
|
+
* changes run order or verdict aggregation. Round Contract checks are further
|
|
19
|
+
* framed as declaration / execution / closure stages in their doc comments.
|
|
14
20
|
*/
|
|
15
21
|
import type { VaultEntry } from "./loop-store.js";
|
|
16
22
|
import type { ProviderSnapshot } from "./evidence-provider.js";
|
|
17
23
|
import type { SelfEvaluation, VerificationResult } from "./protocol.js";
|
|
18
|
-
export declare const CHECK_PROGRESS_REGRESSION = "progress_regression";
|
|
19
|
-
export declare const CHECK_EMPTY_CHANGE_WITH_PASSING = "empty_change_with_passing";
|
|
20
24
|
export declare const CHECK_SUCCESS_WITH_REMAINING_CRITERIA = "success_with_remaining_criteria";
|
|
21
25
|
export declare const CHECK_SUCCESS_WITHOUT_VERIFIED_EVIDENCE = "success_without_verified_evidence";
|
|
22
26
|
export declare const CHECK_OUTCOME_SUCCESS_CONTRADICTION = "outcome_success_contradiction";
|
|
23
|
-
export declare const CHECK_SUCCESS_CLAIM_CONFLICT = "success_claim_conflict";
|
|
24
27
|
export declare const CHECK_BLOCKED_WITHOUT_BLOCKER = "blocked_without_blocker";
|
|
25
28
|
export declare const CHECK_RETROACTIVE_CLAIM_BAD_ROUND = "retroactive_claim_bad_round";
|
|
26
29
|
export declare const CHECK_RETROACTIVE_CLAIM_UNVERIFIED = "retroactive_claim_unverified";
|
|
@@ -30,20 +33,72 @@ export declare const CHECK_RETRACT_FRESH_CONSTRAINT = "retract_fresh_constraint"
|
|
|
30
33
|
export declare const CHECK_EVIDENCE_INTEGRITY = "evidence_integrity";
|
|
31
34
|
export declare const CHECK_REQUIRED_COMMAND_FAILED = "required_command_failed";
|
|
32
35
|
export declare const CHECK_COMMAND_EVIDENCE_MISMATCH = "command_evidence_mismatch";
|
|
36
|
+
/** v3.3: Verification domain integrity — a command entrypoint (run-tests.sh,
|
|
37
|
+
* package.json, …) changed in the same round the command ran. The runtime
|
|
38
|
+
* executed a script the agent just rewrote, so the observation has no
|
|
39
|
+
* stable baseline: error. Test-file changes are normal dev activity (TDD):
|
|
40
|
+
* warn-only, see CHECK_TEST_FILES_MODIFIED. */
|
|
41
|
+
export declare const CHECK_VERIFICATION_ENTRYPOINT_MODIFIED = "verification_entrypoint_modified";
|
|
42
|
+
/** v3.3: Test files changed in the same round a verification command passed.
|
|
43
|
+
* Warn-only — the command result stays usable. */
|
|
44
|
+
export declare const CHECK_TEST_FILES_MODIFIED = "test_files_modified";
|
|
33
45
|
export declare const CHECK_INTENT_DRIFT = "intent_drift";
|
|
34
46
|
export declare const CHECK_SUBGOAL_DRIFT = "subgoal_drift";
|
|
35
47
|
export declare const CHECK_BACKTRACK_WORKSPACE_NOT_RESTORED = "backtrack_workspace_not_restored";
|
|
36
48
|
export declare const CHECK_CRITERIA_CLAIMS_UNVERIFIED = "criteria_claims_unverified";
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
export declare const
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
/** Contract proposed with an empty done_when — nothing is promised, so
|
|
50
|
+
* nothing can be verified at the boundary. Warn: the contract can be fixed
|
|
51
|
+
* by re-declaring next round. */
|
|
52
|
+
export declare const CHECK_ROUND_UNDERSPECIFIED = "round_underspecified";
|
|
53
|
+
/** done_when items exist but verification_plan is empty or names commands
|
|
54
|
+
* that are not configured AND enabled in policy.evidence.commands — the
|
|
55
|
+
* completion claims could never be machine-checked. Warn. */
|
|
56
|
+
export declare const CHECK_ROUND_UNVERIFIABLE = "round_unverifiable";
|
|
57
|
+
/** The round's actual git changes include files outside the ACTIVE
|
|
58
|
+
* contract's declared scope. Warn + drift_clarification exemption
|
|
59
|
+
* (R7-style). */
|
|
60
|
+
export declare const CHECK_ROUND_SCOPE_DRIFT = "round_scope_drift";
|
|
61
|
+
/** success claimed under the ACTIVE contract whose done_when items are
|
|
62
|
+
* either claimed met without machine-verified evidence or silently dropped
|
|
63
|
+
* (not in success_criteria_met NOR success_criteria_remaining). Error. */
|
|
64
|
+
export declare const CHECK_PREMATURE_BOUNDARY = "premature_boundary";
|
|
65
|
+
/** v3.5: Closing a Round Contract is a success-class claim and must be
|
|
66
|
+
* machine-backed. The eval's met claims satisfy every done_when of the
|
|
67
|
+
* ACTIVE contract but its verification_plan commands did not pass this
|
|
68
|
+
* round. Error; warn under evidence.machine_backed_success "warn"; never
|
|
69
|
+
* downgraded by no_change_reason (all done_when met contradicts "no
|
|
70
|
+
* change"). Fail-open: plan names no longer configured+enabled are not
|
|
71
|
+
* required (cannot observe). */
|
|
72
|
+
export declare const CHECK_CONTRACT_COMPLETION_UNVERIFIED = "contract_completion_unverified";
|
|
73
|
+
/** v3.5: The ACTIVE contract is still open (not completed, not blocked)
|
|
74
|
+
* while a different contract was proposed — the proposal is ignored until
|
|
75
|
+
* the active one closes. Warn: the walker still ignores it; this only
|
|
76
|
+
* surfaces the otherwise-silent state. */
|
|
77
|
+
export declare const CHECK_CONTRACT_PREMATURE = "contract_premature";
|
|
78
|
+
export type VerificationDomain =
|
|
79
|
+
/** The declaration is self-consistent (and consistent with committed facts). */
|
|
80
|
+
"evaluation_consistency"
|
|
81
|
+
/** Machine evidence and the agent's claims about it. */
|
|
82
|
+
| "evidence_integrity"
|
|
83
|
+
/** Plan conformance: intent/sub-goal drift (two detection bases under the
|
|
84
|
+
* "plan drift" label) and the Round Contract declaration/execution/closure
|
|
85
|
+
* checks. */
|
|
86
|
+
| "plan_contract"
|
|
87
|
+
/** Workspace restore after backtrack. Machine-side progress enforcement
|
|
88
|
+
* (the stall evaluator) lives in the enforcement gate, not here. */
|
|
89
|
+
| "progress_recovery";
|
|
90
|
+
export declare const CHECK_DOMAIN: Readonly<Record<string, VerificationDomain>>;
|
|
91
|
+
/** Normalize a contract scope entry: backslashes → forward slashes, strip
|
|
92
|
+
* leading "./", trim, strip trailing slashes. "." / "./" / "" normalize to
|
|
93
|
+
* "" = the repository root (everything is in scope). */
|
|
94
|
+
export declare function normalizeScopeEntry(path: string): string;
|
|
95
|
+
/** Whether a git-diff file path falls inside any declared scope entry:
|
|
96
|
+
* exact file match, or the file lives under a declared directory. The ""
|
|
97
|
+
* entry (repo root) matches everything. Git paths are always workspace-
|
|
98
|
+
* relative with forward slashes. */
|
|
99
|
+
export declare function isFileInScope(file: string, scope: string[]): boolean;
|
|
100
|
+
/** Git-diff files outside the declared scope (the round_scope_drift signal). */
|
|
101
|
+
export declare function collectOutOfScopeFiles(files: string[], scope: string[]): string[];
|
|
47
102
|
export interface EvidenceStatus {
|
|
48
103
|
/** Whether this round produced a machine-verified observation. */
|
|
49
104
|
providerStatus: "verified" | "unavailable" | "absent";
|
|
@@ -61,13 +116,7 @@ export interface EvidenceStatus {
|
|
|
61
116
|
* of letting evidence-dependent checks silently disappear when snapshots are
|
|
62
117
|
* missing — the fix for the "weakest when it matters most" gap. */
|
|
63
118
|
export declare function deriveEvidenceStatus(selfEval: SelfEvaluation, evidenceSnapshots: ProviderSnapshot[]): EvidenceStatus;
|
|
64
|
-
/**
|
|
65
|
-
* each of the last `lookback` committed rounds, rebuilt from the feedback
|
|
66
|
-
* entries' roundEvidence snapshots (already persisted at commit). Returns
|
|
67
|
-
* null when fewer than `lookback` rounds carry git snapshots — the machine
|
|
68
|
-
* signal is unavailable and callers (R4/R5 on the heuristic path) keep
|
|
69
|
-
* their legacy skip. The snapshot shape is parsed defensively here because
|
|
70
|
-
* this module must not import round-transaction (import cycle). */
|
|
119
|
+
/** Per-round machine progress over decoded committed history. */
|
|
71
120
|
export declare function machineProgressSeries(vaultEntries: VaultEntry[], currentRound: number, lookback: number): boolean[] | null;
|
|
72
121
|
interface ParsedTestCounts {
|
|
73
122
|
passed: number;
|
|
@@ -89,7 +138,9 @@ export declare function parseTestOutput(stdout: string): ParsedTestCounts | null
|
|
|
89
138
|
*
|
|
90
139
|
* @param selfEval The agent's self-evaluation for the current round.
|
|
91
140
|
* @param currentRound The current round number (1-based).
|
|
92
|
-
* @param vaultEntries Vault entries for this loop (
|
|
141
|
+
* @param vaultEntries Vault entries for this loop (committed lineage
|
|
142
|
+
* entries AND :feedback entries — the feedback
|
|
143
|
+
* entries feed the ACTIVE-contract derivation).
|
|
93
144
|
* @param prevSelfEval The agent's self-evaluation from the previous round
|
|
94
145
|
* (null for round 1).
|
|
95
146
|
* @param evidenceSnapshots v1.18: Evidence snapshots from configured providers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-gate.d.ts","sourceRoot":"","sources":["../src/verification-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verification-gate.d.ts","sourceRoot":"","sources":["../src/verification-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAiB,cAAc,EAAoB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AA4BzG,eAAO,MAAM,qCAAqC,oCAAoC,CAAC;AACvF,eAAO,MAAM,uCAAuC,sCAAsC,CAAC;AAI3F,eAAO,MAAM,mCAAmC,kCAAkC,CAAC;AACnF,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,eAAO,MAAM,iCAAiC,gCAAgC,CAAC;AAC/E,eAAO,MAAM,kCAAkC,iCAAiC,CAAC;AACjF,eAAO,MAAM,oCAAoC,mCAAmC,CAAC;AACrF,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,8BAA8B,6BAA6B,CAAC;AACzE,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAC3E;;;;gDAIgD;AAChD,eAAO,MAAM,sCAAsC,qCAAqC,CAAC;AACzF;mDACmD;AACnD,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,sCAAsC,qCAAqC,CAAC;AACzF,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAiB7E;;kCAEkC;AAClC,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE;;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