loopforge 3.9.2 → 4.0.7
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 +236 -112
- package/dist/audit.d.ts +73 -15
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +131 -61
- package/dist/audit.js.map +1 -1
- package/dist/canonical-state.d.ts +152 -40
- package/dist/canonical-state.d.ts.map +1 -1
- package/dist/canonical-state.js +382 -206
- package/dist/canonical-state.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +41 -12
- package/dist/cli.js.map +1 -1
- package/dist/cognitive-governance.d.ts +0 -2
- package/dist/cognitive-governance.d.ts.map +1 -1
- package/dist/cognitive-governance.js +0 -4
- package/dist/cognitive-governance.js.map +1 -1
- package/dist/committed-round.d.ts +105 -141
- package/dist/committed-round.d.ts.map +1 -1
- package/dist/committed-round.js +249 -372
- package/dist/committed-round.js.map +1 -1
- package/dist/constraint-lifecycle.d.ts +73 -0
- package/dist/constraint-lifecycle.d.ts.map +1 -0
- package/dist/constraint-lifecycle.js +174 -0
- package/dist/constraint-lifecycle.js.map +1 -0
- package/dist/context-boundary.d.ts +83 -0
- package/dist/context-boundary.d.ts.map +1 -0
- package/dist/context-boundary.js +101 -0
- package/dist/context-boundary.js.map +1 -0
- package/dist/contract-items.d.ts +12 -8
- package/dist/contract-items.d.ts.map +1 -1
- package/dist/contract-items.js +31 -26
- package/dist/contract-items.js.map +1 -1
- package/dist/contract-requirement.d.ts +47 -0
- package/dist/contract-requirement.d.ts.map +1 -0
- package/dist/contract-requirement.js +51 -0
- package/dist/contract-requirement.js.map +1 -0
- package/dist/criterion-status.d.ts +35 -0
- package/dist/criterion-status.d.ts.map +1 -0
- package/dist/criterion-status.js +89 -0
- package/dist/criterion-status.js.map +1 -0
- package/dist/enforcement-gate.d.ts +32 -67
- package/dist/enforcement-gate.d.ts.map +1 -1
- package/dist/enforcement-gate.js +203 -439
- package/dist/enforcement-gate.js.map +1 -1
- package/dist/engine.d.ts +9 -103
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +28 -887
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +69 -0
- package/dist/errors.js.map +1 -0
- package/dist/evidence-claims.d.ts +33 -31
- package/dist/evidence-claims.d.ts.map +1 -1
- package/dist/evidence-claims.js +58 -72
- package/dist/evidence-claims.js.map +1 -1
- package/dist/evidence-posture-view.d.ts +19 -0
- package/dist/evidence-posture-view.d.ts.map +1 -0
- package/dist/evidence-posture-view.js +116 -0
- package/dist/evidence-posture-view.js.map +1 -0
- package/dist/evidence-posture.d.ts +73 -0
- package/dist/evidence-posture.d.ts.map +1 -0
- package/dist/evidence-posture.js +281 -0
- package/dist/evidence-posture.js.map +1 -0
- package/dist/evidence-provider.d.ts +55 -37
- package/dist/evidence-provider.d.ts.map +1 -1
- package/dist/evidence-provider.js +182 -332
- package/dist/evidence-provider.js.map +1 -1
- package/dist/explain.d.ts +167 -27
- package/dist/explain.d.ts.map +1 -1
- package/dist/explain.js +373 -58
- package/dist/explain.js.map +1 -1
- package/dist/field-accounting.d.ts.map +1 -1
- package/dist/field-accounting.js +3 -22
- package/dist/field-accounting.js.map +1 -1
- package/dist/generate-schema.js +13 -8
- package/dist/generate-schema.js.map +1 -1
- package/dist/git-boundary.d.ts +128 -0
- package/dist/git-boundary.d.ts.map +1 -0
- package/dist/git-boundary.js +625 -0
- package/dist/git-boundary.js.map +1 -0
- package/dist/git-facts.d.ts +22 -0
- package/dist/git-facts.d.ts.map +1 -0
- package/dist/git-facts.js +29 -0
- package/dist/git-facts.js.map +1 -0
- package/dist/git-motion.d.ts +37 -0
- package/dist/git-motion.d.ts.map +1 -0
- package/dist/git-motion.js +59 -0
- package/dist/git-motion.js.map +1 -0
- package/dist/history.d.ts +44 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +77 -0
- package/dist/history.js.map +1 -0
- package/dist/index.d.ts +19 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +16 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +80 -14
- package/dist/init.js.map +1 -1
- package/dist/loop-compiler.d.ts +51 -19
- package/dist/loop-compiler.d.ts.map +1 -1
- package/dist/loop-compiler.js +423 -507
- package/dist/loop-compiler.js.map +1 -1
- package/dist/loop-store.d.ts +6 -5
- package/dist/loop-store.d.ts.map +1 -1
- package/dist/loop-store.js +153 -35
- package/dist/loop-store.js.map +1 -1
- package/dist/mcp/round-lifecycle.d.ts +285 -81
- package/dist/mcp/round-lifecycle.d.ts.map +1 -1
- package/dist/mcp/round-lifecycle.js +1629 -574
- package/dist/mcp/round-lifecycle.js.map +1 -1
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +61 -19
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +81 -39
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +963 -271
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/submission-boundary.d.ts +23 -31
- package/dist/mcp/submission-boundary.d.ts.map +1 -1
- package/dist/mcp/submission-boundary.js +242 -82
- package/dist/mcp/submission-boundary.js.map +1 -1
- package/dist/mcp/submission-handle.d.ts +66 -0
- package/dist/mcp/submission-handle.d.ts.map +1 -0
- package/dist/mcp/submission-handle.js +173 -0
- package/dist/mcp/submission-handle.js.map +1 -0
- package/dist/mcp/tools.d.ts +17 -7
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +763 -244
- package/dist/mcp/tools.js.map +1 -1
- package/dist/open-question.d.ts +7 -0
- package/dist/open-question.d.ts.map +1 -0
- package/dist/open-question.js +14 -0
- package/dist/open-question.js.map +1 -0
- package/dist/policy-metrics.d.ts +31 -21
- package/dist/policy-metrics.d.ts.map +1 -1
- package/dist/policy-metrics.js +117 -64
- package/dist/policy-metrics.js.map +1 -1
- package/dist/policy.d.ts +15 -40
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +13 -13
- package/dist/policy.js.map +1 -1
- package/dist/progress.d.ts +45 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +136 -0
- package/dist/progress.js.map +1 -0
- package/dist/prompt-assembler.d.ts +28 -9
- package/dist/prompt-assembler.d.ts.map +1 -1
- package/dist/prompt-assembler.js +592 -603
- package/dist/prompt-assembler.js.map +1 -1
- package/dist/prompt-coverage.d.ts +39 -0
- package/dist/prompt-coverage.d.ts.map +1 -0
- package/dist/prompt-coverage.js +80 -0
- package/dist/prompt-coverage.js.map +1 -0
- package/dist/prompt-freshness.d.ts +25 -0
- package/dist/prompt-freshness.d.ts.map +1 -0
- package/dist/prompt-freshness.js +88 -0
- package/dist/prompt-freshness.js.map +1 -0
- package/dist/prompt-policy.d.ts +14 -4
- package/dist/prompt-policy.d.ts.map +1 -1
- package/dist/prompt-policy.js +29 -10
- package/dist/prompt-policy.js.map +1 -1
- package/dist/protocol.d.ts +875 -419
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +73 -99
- package/dist/protocol.js.map +1 -1
- package/dist/recovery-guidance.d.ts +13 -0
- package/dist/recovery-guidance.d.ts.map +1 -0
- package/dist/recovery-guidance.js +15 -0
- package/dist/recovery-guidance.js.map +1 -0
- package/dist/recovery.d.ts +68 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +234 -0
- package/dist/recovery.js.map +1 -0
- package/dist/replay.d.ts +42 -8
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +311 -84
- package/dist/replay.js.map +1 -1
- package/dist/result-facts.d.ts +45 -0
- package/dist/result-facts.d.ts.map +1 -0
- package/dist/result-facts.js +86 -0
- package/dist/result-facts.js.map +1 -0
- package/dist/round-contract.d.ts +38 -8
- package/dist/round-contract.d.ts.map +1 -1
- package/dist/round-contract.js +71 -31
- package/dist/round-contract.js.map +1 -1
- package/dist/round-coordinator.d.ts +45 -91
- package/dist/round-coordinator.d.ts.map +1 -1
- package/dist/round-coordinator.js +254 -271
- package/dist/round-coordinator.js.map +1 -1
- package/dist/round-driver.d.ts +56 -16
- package/dist/round-driver.d.ts.map +1 -1
- package/dist/round-driver.js +225 -39
- package/dist/round-driver.js.map +1 -1
- package/dist/round-facts.d.ts +33 -52
- package/dist/round-facts.d.ts.map +1 -1
- package/dist/round-facts.js +54 -157
- package/dist/round-facts.js.map +1 -1
- package/dist/round-guidance.d.ts +56 -0
- package/dist/round-guidance.d.ts.map +1 -0
- package/dist/round-guidance.js +161 -0
- package/dist/round-guidance.js.map +1 -0
- package/dist/round-outcome.d.ts +21 -0
- package/dist/round-outcome.d.ts.map +1 -0
- package/dist/round-outcome.js +31 -0
- package/dist/round-outcome.js.map +1 -0
- package/dist/round-transaction.d.ts +168 -21
- package/dist/round-transaction.d.ts.map +1 -1
- package/dist/round-transaction.js +856 -39
- package/dist/round-transaction.js.map +1 -1
- package/dist/self-eval.d.ts +40 -60
- package/dist/self-eval.d.ts.map +1 -1
- package/dist/self-eval.js +455 -384
- package/dist/self-eval.js.map +1 -1
- package/dist/storage.d.ts +16 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +54 -4
- package/dist/storage.js.map +1 -1
- package/dist/subgoal-state.d.ts +2 -3
- package/dist/subgoal-state.d.ts.map +1 -1
- package/dist/subgoal-state.js +2 -3
- package/dist/subgoal-state.js.map +1 -1
- package/dist/submission-guidance.d.ts +43 -21
- package/dist/submission-guidance.d.ts.map +1 -1
- package/dist/submission-guidance.js +368 -262
- package/dist/submission-guidance.js.map +1 -1
- package/dist/submission-receipt.d.ts +16 -8
- package/dist/submission-receipt.d.ts.map +1 -1
- package/dist/submission-receipt.js +146 -51
- package/dist/submission-receipt.js.map +1 -1
- package/dist/token-utils.d.ts +47 -7
- package/dist/token-utils.d.ts.map +1 -1
- package/dist/token-utils.js +66 -15
- package/dist/token-utils.js.map +1 -1
- package/dist/transaction-identity.d.ts +9 -0
- package/dist/transaction-identity.d.ts.map +1 -0
- package/dist/transaction-identity.js +69 -0
- package/dist/transaction-identity.js.map +1 -0
- package/dist/verification-actions.d.ts +13 -0
- package/dist/verification-actions.d.ts.map +1 -0
- package/dist/verification-actions.js +44 -0
- package/dist/verification-actions.js.map +1 -0
- package/dist/verification-gate.d.ts +26 -46
- package/dist/verification-gate.d.ts.map +1 -1
- package/dist/verification-gate.js +218 -427
- package/dist/verification-gate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/working-memory.d.ts +187 -0
- package/dist/working-memory.d.ts.map +1 -0
- package/dist/working-memory.js +767 -0
- package/dist/working-memory.js.map +1 -0
- package/dist/workspace-checkpoint.d.ts +88 -0
- package/dist/workspace-checkpoint.d.ts.map +1 -0
- package/dist/workspace-checkpoint.js +326 -0
- package/dist/workspace-checkpoint.js.map +1 -0
- package/dist/workspace-restore.d.ts +68 -0
- package/dist/workspace-restore.d.ts.map +1 -0
- package/dist/workspace-restore.js +604 -0
- package/dist/workspace-restore.js.map +1 -0
- package/dist/workspace.d.ts +0 -9
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +0 -17
- package/dist/workspace.js.map +1 -1
- package/loop_policy.json +5 -19
- package/package.json +2 -2
- package/skills/forge/SKILL.md +212 -0
- package/skills/forge/references/evidence-and-contracts.md +204 -0
- package/skills/forge/references/recovery-and-views.md +188 -0
- package/dist/cognitive-facts.d.ts +0 -30
- package/dist/cognitive-facts.d.ts.map +0 -1
- package/dist/cognitive-facts.js +0 -113
- package/dist/cognitive-facts.js.map +0 -1
- package/dist/loop-extras-parser.d.ts +0 -81
- package/dist/loop-extras-parser.d.ts.map +0 -1
- package/dist/loop-extras-parser.js +0 -213
- package/dist/loop-extras-parser.js.map +0 -1
- package/dist/loop-projection.d.ts +0 -6
- package/dist/loop-projection.d.ts.map +0 -1
- package/dist/loop-projection.js +0 -28
- package/dist/loop-projection.js.map +0 -1
- package/skills/perception/SKILL.md +0 -370
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** v4.0.3: ONE projection of a round's Git facts for read-only surfaces.
|
|
2
|
+
*
|
|
3
|
+
* Replay, explain and metrics previously picked the FIRST `kind === "git"`
|
|
4
|
+
* delta for `files_changed`/heads while the gate/receipt used the UNION
|
|
5
|
+
* selector. With several Git providers those views could describe different
|
|
6
|
+
* change sets. This module is the one selector: the change set is the union
|
|
7
|
+
* of every Git delta; a head pair is reported only when every Git provider
|
|
8
|
+
* agrees, otherwise it is unknown.
|
|
9
|
+
*/
|
|
10
|
+
import type { ObservationDelta } from "./evidence-provider.js";
|
|
11
|
+
export interface GitRoundFacts {
|
|
12
|
+
state: "observed" | "unknown" | "not_applicable";
|
|
13
|
+
/** Union change set; null when unknown/not applicable. */
|
|
14
|
+
changedFiles: string[] | null;
|
|
15
|
+
/** A head is known only when every Git provider reports the same value. */
|
|
16
|
+
headBefore: string | null;
|
|
17
|
+
headAfter: string | null;
|
|
18
|
+
/** First non-null after status, in delta order. */
|
|
19
|
+
status: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function gitRoundFacts(deltas: ReadonlyArray<ObservationDelta>): GitRoundFacts;
|
|
22
|
+
//# sourceMappingURL=git-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-facts.d.ts","sourceRoot":"","sources":["../src/git-facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;IACjD,0DAA0D;IAC1D,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mDAAmD;IACnD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,GACtC,aAAa,CAmBf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** v4.0.3: ONE projection of a round's Git facts for read-only surfaces.
|
|
2
|
+
*
|
|
3
|
+
* Replay, explain and metrics previously picked the FIRST `kind === "git"`
|
|
4
|
+
* delta for `files_changed`/heads while the gate/receipt used the UNION
|
|
5
|
+
* selector. With several Git providers those views could describe different
|
|
6
|
+
* change sets. This module is the one selector: the change set is the union
|
|
7
|
+
* of every Git delta; a head pair is reported only when every Git provider
|
|
8
|
+
* agrees, otherwise it is unknown.
|
|
9
|
+
*/
|
|
10
|
+
import { gitDeltaState } from "./evidence-provider.js";
|
|
11
|
+
import { observedGitHead } from "./git-motion.js";
|
|
12
|
+
export function gitRoundFacts(deltas) {
|
|
13
|
+
const gitDeltas = deltas.filter((delta) => delta.kind === "git");
|
|
14
|
+
const state = gitDeltaState(deltas);
|
|
15
|
+
const single = (values) => values.length > 0 &&
|
|
16
|
+
values.every((value) => value !== null && value === values[0])
|
|
17
|
+
? values[0]
|
|
18
|
+
: null;
|
|
19
|
+
return {
|
|
20
|
+
state: state.state,
|
|
21
|
+
changedFiles: state.state === "observed" ? [...state.changedFiles] : null,
|
|
22
|
+
headBefore: single(gitDeltas.map((delta) => observedGitHead(delta.before ?? undefined))),
|
|
23
|
+
headAfter: single(gitDeltas.map((delta) => observedGitHead(delta.after ?? undefined))),
|
|
24
|
+
status: gitDeltas
|
|
25
|
+
.map((delta) => delta.after?.status ?? null)
|
|
26
|
+
.find((value) => value !== null) ?? null,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=git-facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-facts.js","sourceRoot":"","sources":["../src/git-facts.ts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,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,IAAI;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** v3.9.7: the Git arm of machine progress.
|
|
2
|
+
*
|
|
3
|
+
* Kept dependency-free (types only) so both the observation delta derivation
|
|
4
|
+
* and `progress.ts` can use the ONE Git motion rule without an import cycle.
|
|
5
|
+
* This is still a Git-specific correctness rule: complete boundary
|
|
6
|
+
* fingerprints and HEAD movement. A restore is NOT round progress: it happens
|
|
7
|
+
* before the redo prompt and belongs to no round delta.
|
|
8
|
+
*/
|
|
9
|
+
import type { MachineObservation, ProgressCoverage } from "./protocol.js";
|
|
10
|
+
/** v3.9.9: the Git workspace evidence coverage a rule must select explicitly.
|
|
11
|
+
* The descriptor is a FACT about the persisted Git observation (domain
|
|
12
|
+
* "workspace", object "git-motion", the observed boundary scope, the Git
|
|
13
|
+
* observation schema version) — not a policy key and not a provider vote.
|
|
14
|
+
* Rules match it exactly; a provider that merely mimics the strings cannot
|
|
15
|
+
* participate because selection is also kind-gated to `kind: "git"`. */
|
|
16
|
+
export declare const GIT_WORKSPACE_COVERAGE: ProgressCoverage;
|
|
17
|
+
/** The ONE definition of machine Git motion for a single round.
|
|
18
|
+
*
|
|
19
|
+
* Motion is a non-empty file list or a HEAD that moved across the round. A
|
|
20
|
+
* clean worktree is not the same thing as no progress: commit-per-slice
|
|
21
|
+
* workflows leave no file delta even though HEAD advanced. A workspace
|
|
22
|
+
* restore is not a round's work; it happens before the redo prompt, so no
|
|
23
|
+
* restore-point arm exists here.
|
|
24
|
+
*
|
|
25
|
+
* Observability stays the caller's concern: this answers "did this round
|
|
26
|
+
* move", never "could the round be observed". */
|
|
27
|
+
export declare function gitMotionSignal(input: {
|
|
28
|
+
/** The round's derived Git change set; null means unknown. */
|
|
29
|
+
changedFiles: ReadonlyArray<string> | null;
|
|
30
|
+
headBefore?: string | null;
|
|
31
|
+
headAfter?: string | null;
|
|
32
|
+
}): boolean | null;
|
|
33
|
+
/** Git HEAD as a machine observation exposes it, or null when it is silent. */
|
|
34
|
+
export declare function observedGitHead(observation: MachineObservation | undefined): string | null;
|
|
35
|
+
/** The Git observation this side of a delta actually observed, else null. */
|
|
36
|
+
export declare function observedGitObservation(observation: MachineObservation | null | undefined): MachineObservation | null;
|
|
37
|
+
//# sourceMappingURL=git-motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-motion.d.ts","sourceRoot":"","sources":["../src/git-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG1E;;;;;yEAKyE;AACzE,eAAO,MAAM,sBAAsB,EAAE,gBAKpC,CAAC;AAEF;;;;;;;;;kDASkD;AAClD,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,8DAA8D;IAC9D,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,OAAO,GAAG,IAAI,CASjB;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAC7B,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAC1C,MAAM,GAAG,IAAI,CAKf;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GACjD,kBAAkB,GAAG,IAAI,CAI3B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** v3.9.7: the Git arm of machine progress.
|
|
2
|
+
*
|
|
3
|
+
* Kept dependency-free (types only) so both the observation delta derivation
|
|
4
|
+
* and `progress.ts` can use the ONE Git motion rule without an import cycle.
|
|
5
|
+
* This is still a Git-specific correctness rule: complete boundary
|
|
6
|
+
* fingerprints and HEAD movement. A restore is NOT round progress: it happens
|
|
7
|
+
* before the redo prompt and belongs to no round delta.
|
|
8
|
+
*/
|
|
9
|
+
import { GIT_OBSERVATION_SCHEMA_VERSION } from "./protocol.js";
|
|
10
|
+
/** v3.9.9: the Git workspace evidence coverage a rule must select explicitly.
|
|
11
|
+
* The descriptor is a FACT about the persisted Git observation (domain
|
|
12
|
+
* "workspace", object "git-motion", the observed boundary scope, the Git
|
|
13
|
+
* observation schema version) — not a policy key and not a provider vote.
|
|
14
|
+
* Rules match it exactly; a provider that merely mimics the strings cannot
|
|
15
|
+
* participate because selection is also kind-gated to `kind: "git"`. */
|
|
16
|
+
export const GIT_WORKSPACE_COVERAGE = {
|
|
17
|
+
domain: "workspace",
|
|
18
|
+
object: "git-motion",
|
|
19
|
+
scope: "tracked_and_non_ignored_untracked",
|
|
20
|
+
version: GIT_OBSERVATION_SCHEMA_VERSION,
|
|
21
|
+
};
|
|
22
|
+
/** The ONE definition of machine Git motion for a single round.
|
|
23
|
+
*
|
|
24
|
+
* Motion is a non-empty file list or a HEAD that moved across the round. A
|
|
25
|
+
* clean worktree is not the same thing as no progress: commit-per-slice
|
|
26
|
+
* workflows leave no file delta even though HEAD advanced. A workspace
|
|
27
|
+
* restore is not a round's work; it happens before the redo prompt, so no
|
|
28
|
+
* restore-point arm exists here.
|
|
29
|
+
*
|
|
30
|
+
* Observability stays the caller's concern: this answers "did this round
|
|
31
|
+
* move", never "could the round be observed". */
|
|
32
|
+
export function gitMotionSignal(input) {
|
|
33
|
+
if (input.changedFiles !== null && input.changedFiles.length > 0)
|
|
34
|
+
return true;
|
|
35
|
+
const { headBefore, headAfter } = input;
|
|
36
|
+
if (headAfter && headBefore && headAfter !== headBefore)
|
|
37
|
+
return true;
|
|
38
|
+
if (input.changedFiles === null)
|
|
39
|
+
return null;
|
|
40
|
+
// An observed empty change set is no motion only when both HEADs are known;
|
|
41
|
+
// otherwise a commit-only slice could still have moved HEAD.
|
|
42
|
+
if (!headBefore || !headAfter)
|
|
43
|
+
return null;
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
/** Git HEAD as a machine observation exposes it, or null when it is silent. */
|
|
47
|
+
export function observedGitHead(observation) {
|
|
48
|
+
return observation && observation.kind === "git" &&
|
|
49
|
+
typeof observation.data.head === "string" && observation.data.head
|
|
50
|
+
? observation.data.head
|
|
51
|
+
: null;
|
|
52
|
+
}
|
|
53
|
+
/** The Git observation this side of a delta actually observed, else null. */
|
|
54
|
+
export function observedGitObservation(observation) {
|
|
55
|
+
return observation && observation.kind === "git" && observation.status === "observed"
|
|
56
|
+
? observation
|
|
57
|
+
: null;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=git-motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-motion.js","sourceRoot":"","sources":["../src/git-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D;;;;;yEAKyE;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAqB;IACtD,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,mCAAmC;IAC1C,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEF;;;;;;;;;kDASkD;AAClD,MAAM,UAAU,eAAe,CAAC,KAK/B;IACC,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9E,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,SAAS,IAAI,UAAU,IAAI,SAAS,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACrE,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7C,4EAA4E;IAC5E,6DAA6D;IAC7D,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAC7B,WAA2C;IAE3C,OAAO,WAAW,IAAI,WAAW,CAAC,IAAI,KAAK,KAAK;QAC5C,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI;QACpE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;QACvB,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,sBAAsB,CACpC,WAAkD;IAElD,OAAO,WAAW,IAAI,WAAW,CAAC,IAAI,KAAK,KAAK,IAAI,WAAW,CAAC,MAAM,KAAK,UAAU;QACnF,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** The read-only history loader.
|
|
2
|
+
*
|
|
3
|
+
* One store read and one decode pass produce the committed-round views, the
|
|
4
|
+
* current branch, its directives, the pending directive and the explicit
|
|
5
|
+
* legacy report. This module owns no state and performs no derivation of its
|
|
6
|
+
* own: it composes the existing read models (`decodeCommittedRecord`,
|
|
7
|
+
* `resolveBranchViews`, `legacyTransactionRounds`) so every consumer sees the
|
|
8
|
+
* same window instead of re-scanning the Vault with its own query pair.
|
|
9
|
+
*/
|
|
10
|
+
import { type BranchView, type CommittedRoundView, type LegacyRound } from "./committed-round.js";
|
|
11
|
+
import type { LoopStore, VaultEntry } from "./loop-store.js";
|
|
12
|
+
import type { OperatorAcceptance } from "./protocol.js";
|
|
13
|
+
/** Stable canonical text for the immutable operator surface. The field order
|
|
14
|
+
* is fixed by the protocol shape, so every copy serializes identically. */
|
|
15
|
+
export declare function operatorAcceptanceKey(value: OperatorAcceptance): string;
|
|
16
|
+
export interface CommittedHistory {
|
|
17
|
+
loopId: string;
|
|
18
|
+
/** The flat entry view this history was built from (session, feedback,
|
|
19
|
+
* rollback directives, gate records). Read-only. */
|
|
20
|
+
entries: VaultEntry[];
|
|
21
|
+
/** Decoded evaluation + rollback records. */
|
|
22
|
+
views: CommittedRoundView[];
|
|
23
|
+
branch: BranchView;
|
|
24
|
+
/** Current-branch evaluation rounds, ascending. */
|
|
25
|
+
rounds: CommittedRoundView[];
|
|
26
|
+
/** Committed rollback directives on the current branch chain. */
|
|
27
|
+
directives: CommittedRoundView[];
|
|
28
|
+
/** The last directive whose child branch has no evaluation commit yet. */
|
|
29
|
+
pendingDirective: CommittedRoundView | null;
|
|
30
|
+
/** Rounds whose persisted envelope is an unsupported schema. They are NOT
|
|
31
|
+
* history; the explicit list makes the loss visible. */
|
|
32
|
+
legacyRounds: LegacyRound[];
|
|
33
|
+
}
|
|
34
|
+
export declare function emptyCommittedHistory(loopId?: string): CommittedHistory;
|
|
35
|
+
/** Build the read model from an already-loaded flat entry view. */
|
|
36
|
+
export declare function buildCommittedHistory(entries: ReadonlyArray<VaultEntry>): CommittedHistory;
|
|
37
|
+
/** The one Vault read used by the runtime's read paths. */
|
|
38
|
+
export declare function loadCommittedHistory(store: LoopStore, loopId: string): CommittedHistory;
|
|
39
|
+
/** The compile window: current-branch evaluation rounds below `currentRound`.
|
|
40
|
+
* This is the same rule as `derivationRounds(entries, currentRound)`, but it
|
|
41
|
+
* reads the branch already resolved by the loader instead of decoding the
|
|
42
|
+
* entries again. */
|
|
43
|
+
export declare function historyWindow(history: CommittedHistory, currentRound?: number): CommittedRoundView[];
|
|
44
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD;4EAC4E;AAC5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAMvE;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf;yDACqD;IACrD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6CAA6C;IAC7C,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,mDAAmD;IACnD,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,iEAAiE;IACjE,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,0EAA0E;IAC1E,gBAAgB,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC5C;6DACyD;IACzD,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,MAAM,SAAK,GAAG,gBAAgB,CAWnE;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GACjC,gBAAgB,CAgClB;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,GACb,gBAAgB,CAElB;AAED;;;qBAGqB;AACrB,wBAAgB,aAAa,CAC3B,OAAO,EAAE,gBAAgB,EACzB,YAAY,GAAE,MAAiC,GAC9C,kBAAkB,EAAE,CAEtB"}
|
package/dist/history.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** The read-only history loader.
|
|
2
|
+
*
|
|
3
|
+
* One store read and one decode pass produce the committed-round views, the
|
|
4
|
+
* current branch, its directives, the pending directive and the explicit
|
|
5
|
+
* legacy report. This module owns no state and performs no derivation of its
|
|
6
|
+
* own: it composes the existing read models (`decodeCommittedRecord`,
|
|
7
|
+
* `resolveBranchViews`, `legacyTransactionRounds`) so every consumer sees the
|
|
8
|
+
* same window instead of re-scanning the Vault with its own query pair.
|
|
9
|
+
*/
|
|
10
|
+
import { decodeCommittedRecord, legacyTransactionRounds, resolveBranchViews, } from "./committed-round.js";
|
|
11
|
+
import { OperatorAcceptanceConflictError } from "./errors.js";
|
|
12
|
+
/** Stable canonical text for the immutable operator surface. The field order
|
|
13
|
+
* is fixed by the protocol shape, so every copy serializes identically. */
|
|
14
|
+
export function operatorAcceptanceKey(value) {
|
|
15
|
+
return JSON.stringify([
|
|
16
|
+
value.task,
|
|
17
|
+
value.success_criteria,
|
|
18
|
+
value.hard_constraints,
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
export function emptyCommittedHistory(loopId = "") {
|
|
22
|
+
return {
|
|
23
|
+
loopId,
|
|
24
|
+
entries: [],
|
|
25
|
+
views: [],
|
|
26
|
+
branch: { loopId, branchId: "", rounds: [], directives: [], pendingDirective: null },
|
|
27
|
+
rounds: [],
|
|
28
|
+
directives: [],
|
|
29
|
+
pendingDirective: null,
|
|
30
|
+
legacyRounds: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Build the read model from an already-loaded flat entry view. */
|
|
34
|
+
export function buildCommittedHistory(entries) {
|
|
35
|
+
const copy = [...entries];
|
|
36
|
+
const views = copy
|
|
37
|
+
.map(decodeCommittedRecord)
|
|
38
|
+
.filter((view) => view !== null);
|
|
39
|
+
const branch = resolveBranchViews(views);
|
|
40
|
+
const loopId = branch.loopId ||
|
|
41
|
+
copy.find((entry) => typeof entry.loop_id === "string" && entry.loop_id.length > 0)?.loop_id ||
|
|
42
|
+
"";
|
|
43
|
+
let acceptance = null;
|
|
44
|
+
for (const view of views) {
|
|
45
|
+
if (!view.operatorAcceptance)
|
|
46
|
+
continue;
|
|
47
|
+
if (acceptance === null) {
|
|
48
|
+
acceptance = view.operatorAcceptance;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (operatorAcceptanceKey(acceptance) !== operatorAcceptanceKey(view.operatorAcceptance)) {
|
|
52
|
+
throw new OperatorAcceptanceConflictError(loopId);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
loopId,
|
|
57
|
+
entries: copy,
|
|
58
|
+
views,
|
|
59
|
+
branch,
|
|
60
|
+
rounds: branch.rounds,
|
|
61
|
+
directives: branch.directives,
|
|
62
|
+
pendingDirective: branch.pendingDirective,
|
|
63
|
+
legacyRounds: legacyTransactionRounds(copy),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** The one Vault read used by the runtime's read paths. */
|
|
67
|
+
export function loadCommittedHistory(store, loopId) {
|
|
68
|
+
return buildCommittedHistory(store.listEntries(loopId));
|
|
69
|
+
}
|
|
70
|
+
/** The compile window: current-branch evaluation rounds below `currentRound`.
|
|
71
|
+
* This is the same rule as `derivationRounds(entries, currentRound)`, but it
|
|
72
|
+
* reads the branch already resolved by the loader instead of decoding the
|
|
73
|
+
* entries again. */
|
|
74
|
+
export function historyWindow(history, currentRound = Number.POSITIVE_INFINITY) {
|
|
75
|
+
return history.rounds.filter((view) => view.round < currentRound);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,GAInB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAI9D;4EAC4E;AAC5E,MAAM,UAAU,qBAAqB,CAAC,KAAyB;IAC7D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,KAAK,CAAC,IAAI;QACV,KAAK,CAAC,gBAAgB;QACtB,KAAK,CAAC,gBAAgB;KACvB,CAA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AAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACzF,MAAM,IAAI,+BAA+B,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IACD,OAAO;QACL,MAAM;QACN,OAAO,EAAE,IAAI;QACb,KAAK;QACL,MAAM;QACN,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,YAAY,EAAE,uBAAuB,CAAC,IAAI,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,oBAAoB,CAClC,KAAgB,EAChB,MAAc;IAEd,OAAO,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;qBAGqB;AACrB,MAAM,UAAU,aAAa,CAC3B,OAAyB,EACzB,eAAuB,MAAM,CAAC,iBAAiB;IAE/C,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,30 +15,40 @@
|
|
|
15
15
|
* const server = new McpServer();
|
|
16
16
|
* server.start();
|
|
17
17
|
*/
|
|
18
|
-
export {
|
|
19
|
-
export type {
|
|
18
|
+
export { AgentStatus, makeSelfEvaluation, makeLoopObjective, makeLoopRoundResult, makeLoopCompileRequest, makeLoopCompileResponse, makeVerificationFlag, makeVerificationResult, makeEnforcementResult, makeSubGoal, makeConstraintMeta, } from "./protocol.js";
|
|
19
|
+
export type { SelfEvaluation, LoopObjective, LoopRoundResult, LoopCompileRequest, LoopCompileResponse, WorkerResult, VerificationFlag, VerificationResult, EnforcementResult, SubGoal, ConstraintMeta, PromptArtifact, PromptContextMode, PromptContextReason, PromptWorkingMemoryProjection, PromptCoverage, CompiledRoundFacts, ContractSupersede, ExecutionClaim, ProgressCoverage, SubmissionDiagnostic, SubmissionDiagnosticHandling, SubmissionGuidance, SubmissionHandle, SubmissionReceipt, SubmissionReportHandling, CheckpointRef, CheckpointRole, WorkspaceCheckpointManifest, RecoveryTarget, EvidencePosture, EvidencePostureStatus, } from "./protocol.js";
|
|
20
|
+
export { deriveEvidencePosture, rollbackEvidencePosture, EVIDENCE_POSTURE_CAPS, } from "./evidence-posture.js";
|
|
21
|
+
export type { EvidencePostureInput } from "./evidence-posture.js";
|
|
20
22
|
export { getPolicy, loadPolicy, resetPolicy, DEFAULT_POLICY, writeStateFile, } from "./policy.js";
|
|
21
|
-
export type { LoopPolicy,
|
|
23
|
+
export type { LoopPolicy, EnginePolicy, BackendPolicy, PromptPolicy, StateFilePolicy, EvidencePolicy, CommandEvidencePolicy, McpPolicy, } from "./policy.js";
|
|
22
24
|
export { FileLoopStore, queryLoopEntries, LOOP_STORE_SCHEMA_VERSION, } from "./loop-store.js";
|
|
23
25
|
export type { LoopStore, LoopSessionDocument, LoopRoundDocument, VaultEntry, } from "./loop-store.js";
|
|
24
|
-
export { compileLoop, decideLevel, computeGoalTextHash, deriveGoalId, getPreviousRound, buildSelfEvalBlock,
|
|
26
|
+
export { compileLoop, decideLevel, computeGoalTextHash, deriveGoalId, getPreviousRound, buildSelfEvalBlock, } from "./loop-compiler.js";
|
|
25
27
|
export { allFieldGuidePaths, deriveSubmissionGuidance, fieldGuide, fieldGuideDescription, renderSelfEvalBlock, } from "./submission-guidance.js";
|
|
26
28
|
export type { FieldGuide, GuidanceOptions, GuidanceSessionView, SelfEvalPromptContext, } from "./submission-guidance.js";
|
|
27
29
|
export { deriveCommittedSubmissionView, deriveSubmissionReceipt, } from "./submission-receipt.js";
|
|
28
30
|
export type { ReceiptFacts, ReceiptInput, } from "./submission-receipt.js";
|
|
29
31
|
export { ReplayBackend } from "./replay.js";
|
|
30
|
-
export { LoopForgeEngine, createEngine,
|
|
31
|
-
export
|
|
32
|
+
export { LoopForgeEngine, createEngine, } from "./engine.js";
|
|
33
|
+
export { buildSelfEvaluation, parseExecutionReport, parseWorkerResults, } from "./self-eval.js";
|
|
32
34
|
export type { StopReason } from "./protocol.js";
|
|
33
35
|
export { McpServer } from "./mcp/server.js";
|
|
34
36
|
export { SessionManager } from "./mcp/session.js";
|
|
35
37
|
export type { McpSession, McpSessionSummary } from "./mcp/session.js";
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
38
|
+
export type { InvocationInputs, ResumeInputs, StartInput, } from "./mcp/round-lifecycle.js";
|
|
39
|
+
export { EvidenceCollector, GitEvidenceProvider, CommandEvidenceProvider, registerEvidenceProvider, unregisterEvidenceProvider, isProviderRegistered, isPassedAfterObservation, deriveObservationDeltas, gitDeltaState, observationVersionIssue, expectedObservationSchemaVersion, coverageKey, } from "./evidence-provider.js";
|
|
40
|
+
export type { EvidenceProvider, EvidenceCaptureContext, EvidenceCaptureResult, EvidenceCollectOptions, EvidenceProviderFactory, ObservationDelta, ObservationProgress, ObservationVersionIssue, GitDeltaState, } from "./evidence-provider.js";
|
|
41
|
+
export { deriveProgressWindow, deriveRoundProgress, GIT_WORKSPACE_COVERAGE, } from "./progress.js";
|
|
42
|
+
export type { ProgressWindow, RoundProgress, } from "./progress.js";
|
|
38
43
|
export { logEvent, } from "./observability.js";
|
|
39
44
|
export type { LogEventData, } from "./observability.js";
|
|
40
45
|
export { PolicyMetricsCollector, policyMetrics, getPolicyMetrics, resetPolicyMetrics, } from "./policy-metrics.js";
|
|
41
46
|
export type { PolicyMetricsSnapshot } from "./policy-metrics.js";
|
|
42
47
|
export { ROUND_TRANSACTION_SCHEMA_VERSION, RoundTransactionCoordinator, makeRoundId, prepareRoundTransaction, parseRoundTransactionSnapshot, } from "./round-transaction.js";
|
|
43
|
-
export type { RoundTransactionPhase, RoundTransactionSnapshot, RoundTransactionInput, RoundTransactionOutcome, } from "./round-transaction.js";
|
|
48
|
+
export type { RoundTransactionPhase, RoundTransactionSnapshot, RoundTransactionInput, RoundTransactionOutcome, RetryContext, } from "./round-transaction.js";
|
|
49
|
+
export { FileWorkspaceCheckpointStore, buildCheckpointRef, checkpointContentHash, deriveCheckpointId, parseCheckpointManifest, CHECKPOINT_SCHEMA_VERSION, } from "./workspace-checkpoint.js";
|
|
50
|
+
export { executeRestore, preflightRestore, } from "./workspace-restore.js";
|
|
51
|
+
export type { RestorePreflight, RestoreResult, } from "./workspace-restore.js";
|
|
52
|
+
export { captureBoundary } from "./git-boundary.js";
|
|
53
|
+
export type { BoundaryCapture, BoundaryMaterializer, GitCaptureResult, GitFileState, GitTrackedEntry, } from "./git-boundary.js";
|
|
44
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,wB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BAAuB,EACvB,YAAY,GACb,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,28 +16,36 @@
|
|
|
16
16
|
* server.start();
|
|
17
17
|
*/
|
|
18
18
|
// Protocol types
|
|
19
|
-
export {
|
|
19
|
+
export { AgentStatus, makeSelfEvaluation, makeLoopObjective, makeLoopRoundResult, makeLoopCompileRequest, makeLoopCompileResponse, makeVerificationFlag, makeVerificationResult, makeEnforcementResult, makeSubGoal, makeConstraintMeta, } from "./protocol.js";
|
|
20
|
+
// Evidence posture (v4.0.3)
|
|
21
|
+
export { deriveEvidencePosture, rollbackEvidencePosture, EVIDENCE_POSTURE_CAPS, } from "./evidence-posture.js";
|
|
20
22
|
// Policy
|
|
21
23
|
export { getPolicy, loadPolicy, resetPolicy, DEFAULT_POLICY, writeStateFile, } from "./policy.js";
|
|
22
24
|
// Durable store
|
|
23
25
|
export { FileLoopStore, queryLoopEntries, LOOP_STORE_SCHEMA_VERSION, } from "./loop-store.js";
|
|
24
26
|
// Loop Compiler
|
|
25
|
-
export { compileLoop, decideLevel, computeGoalTextHash, deriveGoalId, getPreviousRound, buildSelfEvalBlock,
|
|
27
|
+
export { compileLoop, decideLevel, computeGoalTextHash, deriveGoalId, getPreviousRound, buildSelfEvalBlock, } from "./loop-compiler.js";
|
|
26
28
|
// Submission channel (v3.9.1)
|
|
27
29
|
export { allFieldGuidePaths, deriveSubmissionGuidance, fieldGuide, fieldGuideDescription, renderSelfEvalBlock, } from "./submission-guidance.js";
|
|
28
30
|
export { deriveCommittedSubmissionView, deriveSubmissionReceipt, } from "./submission-receipt.js";
|
|
29
31
|
// Replay
|
|
30
32
|
export { ReplayBackend } from "./replay.js";
|
|
31
33
|
// Engine
|
|
32
|
-
export { LoopForgeEngine, createEngine,
|
|
34
|
+
export { LoopForgeEngine, createEngine, } from "./engine.js";
|
|
35
|
+
export { buildSelfEvaluation, parseExecutionReport, parseWorkerResults, } from "./self-eval.js";
|
|
33
36
|
// MCP (v1.3)
|
|
34
37
|
export { McpServer } from "./mcp/server.js";
|
|
35
38
|
export { SessionManager } from "./mcp/session.js";
|
|
36
39
|
// EvidenceProvider (v1.18 / v3.8: machine observations)
|
|
37
|
-
export { EvidenceCollector, GitEvidenceProvider, CommandEvidenceProvider, registerEvidenceProvider, unregisterEvidenceProvider, isProviderRegistered, isPassedAfterObservation, deriveObservationDeltas, gitDeltaState, } from "./evidence-provider.js";
|
|
40
|
+
export { EvidenceCollector, GitEvidenceProvider, CommandEvidenceProvider, registerEvidenceProvider, unregisterEvidenceProvider, isProviderRegistered, isPassedAfterObservation, deriveObservationDeltas, gitDeltaState, observationVersionIssue, expectedObservationSchemaVersion, coverageKey, } from "./evidence-provider.js";
|
|
41
|
+
export { deriveProgressWindow, deriveRoundProgress, GIT_WORKSPACE_COVERAGE, } from "./progress.js";
|
|
38
42
|
// Structured tracing and policy effectiveness metrics (v1.20)
|
|
39
43
|
export { logEvent, } from "./observability.js";
|
|
40
44
|
export { PolicyMetricsCollector, policyMetrics, getPolicyMetrics, resetPolicyMetrics, } from "./policy-metrics.js";
|
|
41
45
|
// Unified round transaction (v1.19)
|
|
42
46
|
export { ROUND_TRANSACTION_SCHEMA_VERSION, RoundTransactionCoordinator, makeRoundId, prepareRoundTransaction, parseRoundTransactionSnapshot, } from "./round-transaction.js";
|
|
47
|
+
// Workspace checkpoints and restore (v3.9.8)
|
|
48
|
+
export { FileWorkspaceCheckpointStore, buildCheckpointRef, checkpointContentHash, deriveCheckpointId, parseCheckpointManifest, CHECKPOINT_SCHEMA_VERSION, } from "./workspace-checkpoint.js";
|
|
49
|
+
export { executeRestore, preflightRestore, } from "./workspace-restore.js";
|
|
50
|
+
export { captureBoundary } from "./git-boundary.js";
|
|
43
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAiB;AACjB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAqCvB,4BAA4B;AAC5B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,SAAS;AACT,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AAarB,gBAAgB;AAChB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAQzB,gBAAgB;AAChB,OAAO,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,8BAA8B;AAC9B,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACx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AwB,CAAC;AAKhC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/init.d.ts
CHANGED
|
@@ -7,9 +7,25 @@ export interface InitOptions {
|
|
|
7
7
|
}
|
|
8
8
|
export interface InitResult {
|
|
9
9
|
client: InitClient;
|
|
10
|
+
/** The installed skill directory (`<target>/forge`). */
|
|
11
|
+
skillDir: string;
|
|
12
|
+
/** The core SKILL.md path inside that directory. */
|
|
10
13
|
skillPath: string;
|
|
11
14
|
installed: boolean;
|
|
15
|
+
/** v4.0.4: the directory exists but at least one packaged skill file is
|
|
16
|
+
* missing or differs. Default init never overwrites it; `--force`
|
|
17
|
+
* refreshes it. Extra user files do not make a tree stale. */
|
|
18
|
+
stale: boolean;
|
|
19
|
+
/** Installed files, relative to `skillDir`, sorted for deterministic output. */
|
|
20
|
+
files: string[];
|
|
12
21
|
registration: string | Record<string, unknown>;
|
|
13
22
|
}
|
|
23
|
+
/** v4.0.4: does every packaged skill file exist in `destDir` with identical
|
|
24
|
+
* bytes? Extra files in the destination are user state and are ignored, so a
|
|
25
|
+
* local note never makes the package-owned tree look stale. */
|
|
26
|
+
export declare function installedSkillIsCurrent(destDir: string): boolean;
|
|
27
|
+
/** Read-only inspection for `doctor`. Returns null when no skill is installed
|
|
28
|
+
* at `destDir`; never copies or repairs anything. */
|
|
29
|
+
export declare function inspectInstalledSkill(destDir: string): "current" | "stale" | null;
|
|
14
30
|
export declare function initializeClient(options: InitOptions): InitResult;
|
|
15
31
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,wCAAwC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAcxC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,UAAU,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB;;mEAE+D;IAC/D,KAAK,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD;AAuDD;;gEAEgE;AAChE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAiBhE;AAED;sDACsD;AACtD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAGjF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CA2BjE"}
|
package/dist/init.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/** Client-specific skill onboarding. */
|
|
2
|
-
import {
|
|
2
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
-
const
|
|
7
|
+
const skillSourceDir = join(packageRoot, "skills", "forge");
|
|
8
8
|
function destination(options) {
|
|
9
9
|
if (options.target)
|
|
10
|
-
return resolve(options.target, "
|
|
10
|
+
return resolve(options.target, "forge");
|
|
11
11
|
if (options.client === "claude") {
|
|
12
|
-
return join(homedir(), ".claude", "skills", "
|
|
12
|
+
return join(homedir(), ".claude", "skills", "forge");
|
|
13
13
|
}
|
|
14
14
|
if (options.client === "codex") {
|
|
15
|
-
return join(homedir(), ".codex", "skills", "
|
|
15
|
+
return join(homedir(), ".codex", "skills", "forge");
|
|
16
16
|
}
|
|
17
|
-
return resolve(".loopforge", "skills", "
|
|
17
|
+
return resolve(".loopforge", "skills", "forge");
|
|
18
18
|
}
|
|
19
19
|
function registration(client) {
|
|
20
20
|
if (client === "claude") {
|
|
@@ -29,20 +29,86 @@ function registration(client) {
|
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
/** Copy each entry into an already-created destination. Per-entry copying
|
|
33
|
+
* avoids `cpSync(srcDir, destDir)` nesting the source under an existing
|
|
34
|
+
* destination, and keeps the operation explicit about what it owns. */
|
|
35
|
+
function copySkillTree(sourceDir, destDir) {
|
|
36
|
+
mkdirSync(destDir, { recursive: true });
|
|
37
|
+
for (const entry of readdirSync(sourceDir, { withFileTypes: true })) {
|
|
38
|
+
cpSync(join(sourceDir, entry.name), join(destDir, entry.name), {
|
|
39
|
+
recursive: true,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function listFiles(root, current = root) {
|
|
44
|
+
const out = [];
|
|
45
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
46
|
+
const full = join(current, entry.name);
|
|
47
|
+
if (entry.isDirectory()) {
|
|
48
|
+
out.push(...listFiles(root, full));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
out.push(relative(root, full).split("\\").join("/"));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return out.sort();
|
|
55
|
+
}
|
|
56
|
+
/** v4.0.4: does every packaged skill file exist in `destDir` with identical
|
|
57
|
+
* bytes? Extra files in the destination are user state and are ignored, so a
|
|
58
|
+
* local note never makes the package-owned tree look stale. */
|
|
59
|
+
export function installedSkillIsCurrent(destDir) {
|
|
60
|
+
if (!existsSync(destDir))
|
|
61
|
+
return false;
|
|
62
|
+
try {
|
|
63
|
+
for (const rel of listFiles(skillSourceDir)) {
|
|
64
|
+
const installed = join(destDir, rel);
|
|
65
|
+
if (!existsSync(installed))
|
|
66
|
+
return false;
|
|
67
|
+
if (!readFileSync(join(skillSourceDir, rel)).equals(readFileSync(installed))) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// A path that is not a readable file (a directory named SKILL.md, a
|
|
75
|
+
// permission error) is not a current install. init must still report it,
|
|
76
|
+
// never throw while merely inspecting.
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Read-only inspection for `doctor`. Returns null when no skill is installed
|
|
81
|
+
* at `destDir`; never copies or repairs anything. */
|
|
82
|
+
export function inspectInstalledSkill(destDir) {
|
|
83
|
+
if (!existsSync(destDir))
|
|
84
|
+
return null;
|
|
85
|
+
return installedSkillIsCurrent(destDir) ? "current" : "stale";
|
|
86
|
+
}
|
|
32
87
|
export function initializeClient(options) {
|
|
33
|
-
|
|
34
|
-
|
|
88
|
+
const skillPath = join(skillSourceDir, "SKILL.md");
|
|
89
|
+
if (!existsSync(skillPath)) {
|
|
90
|
+
throw new Error(`Packaged Forge skill not found: ${skillPath}`);
|
|
35
91
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
92
|
+
const skillDir = destination(options);
|
|
93
|
+
// Default install is a no-op when the skill directory exists. It never
|
|
94
|
+
// repairs a partial install or overwrites user edits; `--force` replaces
|
|
95
|
+
// the package-owned directory wholesale so stale references disappear.
|
|
96
|
+
const installed = options.force === true || !existsSync(skillDir);
|
|
38
97
|
if (installed) {
|
|
39
|
-
|
|
40
|
-
|
|
98
|
+
if (options.force === true && existsSync(skillDir)) {
|
|
99
|
+
rmSync(skillDir, { recursive: true, force: true });
|
|
100
|
+
}
|
|
101
|
+
copySkillTree(skillSourceDir, skillDir);
|
|
41
102
|
}
|
|
42
103
|
return {
|
|
43
104
|
client: options.client,
|
|
44
|
-
|
|
105
|
+
skillDir,
|
|
106
|
+
skillPath: join(skillDir, "SKILL.md"),
|
|
45
107
|
installed,
|
|
108
|
+
// v4.0.4: an upgrade can leave an older installed copy behind. Report it
|
|
109
|
+
// instead of silently keeping rules that may contradict the runtime.
|
|
110
|
+
stale: !installed && !installedSkillIsCurrent(skillDir),
|
|
111
|
+
files: installed ? listFiles(skillDir) : [],
|
|
46
112
|
registration: registration(options.client),
|
|
47
113
|
};
|
|
48
114
|
}
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAExC,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA0BzC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACxE,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE5D,SAAS,WAAW,CAAC,OAAoB;IACvC,IAAI,OAAO,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC,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