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
|
@@ -7,34 +7,37 @@
|
|
|
7
7
|
import type { MachineObservation } from "./protocol.js";
|
|
8
8
|
import type { ObservationDelta } from "./evidence-provider.js";
|
|
9
9
|
import type { VaultEntry } from "./loop-store.js";
|
|
10
|
-
import type { ContractBinding, ExecutionReport, PromptArtifact, RoundContractProposal, RoundOutcome, SelfEvaluation, SubmissionDiagnostic, SubGoalUpdate, VerificationFlag } from "./protocol.js";
|
|
10
|
+
import type { CheckpointRef, CompiledRoundFacts, ContractBinding, ContractSupersede, EvidencePosture, ExecutionReport, LoopRoundResult, OperatorAcceptance, PromptArtifact, RecoveryDirective, RoundContractProposal, RoundOutcome, SelfEvaluation, SubmissionDiagnostic, SubGoalUpdate, VerificationFlag } from "./protocol.js";
|
|
11
11
|
import type { RoundProcessResult } from "./round-coordinator.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* directive. One shape for the compile-side Recovery Brief, the state file's
|
|
15
|
-
* Recent tier and the rollback prompt — these were three renderers over two
|
|
16
|
-
* independent derivations (the committed record and an in-memory walk).
|
|
17
|
-
*
|
|
18
|
-
* Note the target is a RESTORE POINT, not an upper bound: the redo re-commits
|
|
19
|
-
* the same round numbers the abandoned rounds occupied (round-lifecycle.ts
|
|
20
|
-
* sets `currentRound = backtrackTarget + 1`), so this is never a window
|
|
21
|
-
* fence. Abandonment is temporal, not numeric. */
|
|
22
|
-
export interface BacktrackRecoveryRecord {
|
|
23
|
-
readonly target: number;
|
|
24
|
-
readonly triggerRule: string;
|
|
25
|
-
readonly failedRounds: number[];
|
|
26
|
-
readonly approaches: string[];
|
|
27
|
-
readonly wrongAssumptions: string[];
|
|
28
|
-
readonly skippedFiles: string[];
|
|
29
|
-
readonly skippedFingerprints: Record<string, string>;
|
|
30
|
-
readonly targetGitHead?: string;
|
|
31
|
-
}
|
|
12
|
+
import type { RoundTransactionSnapshot } from "./round-transaction.js";
|
|
13
|
+
export type CommittedAction = "continue" | "stop" | "recovery" | "backtrack";
|
|
32
14
|
export interface CommittedRoundView {
|
|
33
|
-
readonly source: "feedback" | "
|
|
15
|
+
readonly source: "feedback" | "rollback";
|
|
34
16
|
readonly sourceEntry: VaultEntry | Record<string, unknown>;
|
|
35
17
|
readonly loopId: string;
|
|
36
18
|
readonly round: number;
|
|
37
19
|
readonly roundId: string;
|
|
20
|
+
/** v3.9.6: transaction/branch identity. Optional on hand-built/library
|
|
21
|
+
* views; committed decoders always set them. The branch read model
|
|
22
|
+
* normalizes a missing kind/branch to an evaluation on the root branch. */
|
|
23
|
+
readonly transactionId?: string;
|
|
24
|
+
readonly branchId?: string;
|
|
25
|
+
readonly kind?: "evaluation" | "rollback";
|
|
26
|
+
/** v3.9.6: evaluation for ordinary work; agent/machine for a directive. */
|
|
27
|
+
readonly origin?: "evaluation" | "agent" | "machine";
|
|
28
|
+
/** v3.9.6: rollback directive facts; null for ordinary evaluation rounds. */
|
|
29
|
+
readonly recovery?: RecoveryDirective | null;
|
|
30
|
+
/** v3.9.7: the transaction's automatic before-image, if one was captured. */
|
|
31
|
+
readonly beforeCheckpoint: CheckpointRef | null;
|
|
32
|
+
/** v3.9.7: Agent-created mid-round savepoints on this transaction. */
|
|
33
|
+
readonly checkpoints: CheckpointRef[];
|
|
34
|
+
/** v3.9.7: present only on a redo transaction that completed a verified
|
|
35
|
+
* restore. The directive remains the target's one source. */
|
|
36
|
+
readonly restore: RoundTransactionSnapshot["restore"] | null;
|
|
37
|
+
/** Operator-owned immutable acceptance, when this transaction carries it. */
|
|
38
|
+
readonly operatorAcceptance: OperatorAcceptance | null;
|
|
39
|
+
/** v4.0.1: the compile facts stamped at commit, when present. */
|
|
40
|
+
readonly compiled: CompiledRoundFacts | null;
|
|
38
41
|
readonly sequence?: number;
|
|
39
42
|
readonly attempt: number;
|
|
40
43
|
readonly promptArtifact: PromptArtifact | null;
|
|
@@ -42,10 +45,26 @@ export interface CommittedRoundView {
|
|
|
42
45
|
readonly executionReport: ExecutionReport | null;
|
|
43
46
|
readonly verificationFlags: VerificationFlag[];
|
|
44
47
|
readonly result: RoundProcessResult | null;
|
|
48
|
+
/** v4.0.3: the evidence posture persisted with this transaction. The
|
|
49
|
+
* current (schema 8) decoder refuses a commit without one, so this is null
|
|
50
|
+
* only on a hand-built/library view. */
|
|
51
|
+
readonly evidencePosture: EvidencePosture | null;
|
|
45
52
|
readonly action: CommittedAction;
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
/** v4.0.3/v4.0.6: the Agent's success claim — a derived projection of
|
|
54
|
+
* `outcome === "success"`, never a machine verdict. */
|
|
55
|
+
readonly agentSuccessClaim: boolean;
|
|
56
|
+
/** v4.0.6: the Agent-declared outcome. */
|
|
57
|
+
readonly agentOutcome: RoundOutcome | null;
|
|
58
|
+
/** v4.0.6: the Agent's committed overall-objective refinement, if this
|
|
59
|
+
* round carried one. The latest such value on the current branch is the
|
|
60
|
+
* working objective text. */
|
|
61
|
+
readonly objectiveRefinement?: string;
|
|
48
62
|
readonly contractProposal: RoundContractProposal | null;
|
|
63
|
+
/** v4.0.6: this round's explicit contract redirection, DERIVED from the
|
|
64
|
+
* committed proposal's optional `supersedes` (never a second persisted
|
|
65
|
+
* field). A target the reducer cannot match is inert, never a reason to
|
|
66
|
+
* close a contract. */
|
|
67
|
+
readonly contractRedirect: ContractSupersede | null;
|
|
49
68
|
/** v3.8: the machine binding stamped when the declaring round committed. */
|
|
50
69
|
readonly contractBinding: ContractBinding | null;
|
|
51
70
|
readonly beforeEvidence: MachineObservation[];
|
|
@@ -65,103 +84,77 @@ export interface CommittedRoundView {
|
|
|
65
84
|
readonly constraintViolations?: string[];
|
|
66
85
|
readonly discoveredConstraints?: string[];
|
|
67
86
|
readonly activeConstraints?: string[];
|
|
87
|
+
/** Effective retirements from the compile that produced this round. */
|
|
88
|
+
readonly compiledRetirements?: string[];
|
|
68
89
|
readonly retractedConstraints?: string[];
|
|
90
|
+
/** v4.0.2: committed Agent-reported unresolved questions (report-only).
|
|
91
|
+
* Read by bounded Working Memory, replay and explain; never by a gate. */
|
|
92
|
+
readonly openQuestions?: string[];
|
|
93
|
+
/** v4.0.3: stable ids of questions resolved in this committed round. */
|
|
94
|
+
readonly resolvedOpenQuestionIds?: string[];
|
|
69
95
|
readonly emergedSubtasks?: string[];
|
|
70
96
|
readonly subgoalUpdates?: SubGoalUpdate[];
|
|
71
|
-
/** v3.8.1: present only on a committed rollback directive, null elsewhere.
|
|
72
|
-
* Decoded from `result.*` on the durable feedback entry and from the
|
|
73
|
-
* `lineage.backtrack*` stamps on a hydrated merged entry. */
|
|
74
|
-
readonly backtrack: BacktrackRecoveryRecord | null;
|
|
75
97
|
}
|
|
76
|
-
/** v3.8.1: decode a rollback directive's facts from either carrier —
|
|
77
|
-
* `result.*` on a durable :feedback entry, `lineage.*` on a hydrated merged
|
|
78
|
-
* entry. Returns null when no restore point is recorded, which is also the
|
|
79
|
-
* signal that the record cannot serve as recovery guidance. */
|
|
80
|
-
export declare function decodeBacktrackRecord(source: unknown): BacktrackRecoveryRecord | null;
|
|
81
98
|
export declare function decodeCommittedRound(entry: VaultEntry): CommittedRoundView | null;
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
* lineage entry cannot become a second history. */
|
|
86
|
-
export declare function decodeMergedRound(entry: unknown): CommittedRoundView | null;
|
|
99
|
+
/** v3.9.6: decode a committed rollback directive event. It is a typed event
|
|
100
|
+
* in the round document, never a normal feedback round. */
|
|
101
|
+
export declare function decodeRollbackEvent(entry: VaultEntry): CommittedRoundView | null;
|
|
87
102
|
/** Normalize committed history: rollback directives disappear, later records
|
|
88
103
|
* replace earlier records for the same logical round, and output is ascending. */
|
|
89
|
-
/**
|
|
90
|
-
* merged
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
/** v4.0.1: decode either an ordinary committed round or a rollback event.
|
|
105
|
+
* There is no merged-lineage representation any more: a committed round is
|
|
106
|
+
* exactly its durable :feedback envelope, and a rollback is its event. */
|
|
107
|
+
export declare function decodeCommittedRecord(entry: unknown): CommittedRoundView | null;
|
|
108
|
+
/** THE committed-view → compiler-request projection.
|
|
109
|
+
*
|
|
110
|
+
* The compiler once received these fields from the caller's mutable
|
|
111
|
+
* `last_round_result`, which existed on the live path and was absent on
|
|
112
|
+
* resume/unpause/backtrack compiles. This projection lets one committed
|
|
113
|
+
* fact source feed every consumer. Optional declarations are read from the
|
|
114
|
+
* decoded view where it exposes them. */
|
|
115
|
+
export declare function roundResultFromCommittedRound(view: CommittedRoundView): LoopRoundResult;
|
|
116
|
+
/** The ONE pending-directive lookup for a redo round. The directive's
|
|
117
|
+
* `target.redo_round` is the branch fence, so a deep restore and a
|
|
118
|
+
* same-round redo match the same way. */
|
|
119
|
+
export declare function pendingBacktrackRecord(entries: ReadonlyArray<unknown>, redoRound: number): CommittedRoundView | null;
|
|
94
120
|
/** Lineage sub-object of an entry (`loop_lineage`; v3.7: the legacy
|
|
95
121
|
* top-level `lineage` alias was removed), or {} when absent. */
|
|
96
122
|
export declare function entryLineage(entry: unknown): Record<string, unknown>;
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* the
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
export declare function
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
export declare function
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
export declare function
|
|
124
|
-
/** v3.
|
|
125
|
-
*
|
|
126
|
-
* `decodeRound` (hydrated merged lineage first, then the durable feedback
|
|
127
|
-
* entry) plus the rollback handling in `historyRounds` — so the compile path,
|
|
128
|
-
* the projection, the live coordinator, audit and explain can no longer
|
|
129
|
-
* disagree about which rounds are this branch's history, nor about how their
|
|
130
|
-
* envelope was interpreted.
|
|
131
|
-
*
|
|
132
|
-
* `currentRound` bounds the window exactly as before (default: unbounded). It
|
|
133
|
-
* is NOT a rollback fence: the redo re-commits the round numbers the abandoned
|
|
134
|
-
* rounds occupied, so abandonment is temporal, not numeric, and cannot be
|
|
135
|
-
* expressed as a bound here. */
|
|
123
|
+
/** v3.9.6: the ONE branch read model. */
|
|
124
|
+
export interface BranchView {
|
|
125
|
+
loopId: string;
|
|
126
|
+
branchId: string;
|
|
127
|
+
/** Evaluation rounds on the current branch, ascending. */
|
|
128
|
+
rounds: CommittedRoundView[];
|
|
129
|
+
/** Rollback directives on the chain, chronological. */
|
|
130
|
+
directives: CommittedRoundView[];
|
|
131
|
+
/** The last directive whose child branch has no evaluation commit yet. */
|
|
132
|
+
pendingDirective: CommittedRoundView | null;
|
|
133
|
+
}
|
|
134
|
+
/** Resolve the current branch from already-decoded committed views. This is
|
|
135
|
+
* the branch walker itself; `resolveBranch` is only the entry-decoding
|
|
136
|
+
* wrapper, so a caller that already holds the views (the history loader)
|
|
137
|
+
* never decodes the same entries twice. */
|
|
138
|
+
export declare function resolveBranchViews(records: ReadonlyArray<CommittedRoundView>): BranchView;
|
|
139
|
+
/** Resolve the current branch from committed records in the raw entry view.
|
|
140
|
+
* Decoding happens once here; the walker itself is `resolveBranchViews`. */
|
|
141
|
+
export declare function resolveBranch(entries: ReadonlyArray<unknown>): BranchView;
|
|
142
|
+
/** v3.9.6: current-branch evaluation rounds. */
|
|
143
|
+
export declare function branchRounds(entries: ReadonlyArray<unknown>): CommittedRoundView[];
|
|
144
|
+
/** v3.9.6: rollback directive chain. */
|
|
145
|
+
export declare function branchDirectives(entries: ReadonlyArray<unknown>): CommittedRoundView[];
|
|
146
|
+
/** v3.9.6: the pending directive controlling a redo round. */
|
|
147
|
+
export declare function pendingRollbackDirective(entries: ReadonlyArray<unknown>, redoRound?: number): CommittedRoundView | null;
|
|
148
|
+
/** v3.9.6: machine deadlock guard. Agent-origin directives never consume it. */
|
|
149
|
+
export declare function hasCommittedMachineBacktrack(entries: ReadonlyArray<unknown>, currentRound: number): boolean;
|
|
150
|
+
/** v3.9.6: live history window = current branch below the round being
|
|
151
|
+
* compiled. `currentRound` is the round being prepared/submitted. */
|
|
136
152
|
export declare function derivationRounds(entries: ReadonlyArray<unknown>, currentRound?: number): CommittedRoundView[];
|
|
137
|
-
/** v3.
|
|
138
|
-
*
|
|
139
|
-
* callers fail OPEN rather than inventing a bound. */
|
|
140
|
-
export declare function persistedFrontier(entries: ReadonlyArray<unknown>): number | null;
|
|
141
|
-
/** v3.8.1: THE window for a READ-ONLY view of a loop — audit, explain, replay,
|
|
142
|
-
* the projection, the metrics replay. Same decoder and same rollback handling
|
|
143
|
-
* as `derivationRounds`, plus the bound those callers cannot compute
|
|
144
|
-
* themselves.
|
|
145
|
-
*
|
|
146
|
-
* The live paths bound their window at the round being compiled, and that
|
|
147
|
-
* bound is what keeps a backtracked branch out of this branch's history. A
|
|
148
|
-
* read-only view has no compile round, so it reads the SAME frontier from the
|
|
149
|
-
* durable session document and applies it only while a committed rollback
|
|
150
|
-
* directive is still in effect — a directive stops being history the moment
|
|
151
|
-
* the redo commit replaces its round's record, which is exactly when the
|
|
152
|
-
* abandoned rounds have been re-committed and must count again.
|
|
153
|
-
*
|
|
154
|
-
* With no directive in effect the window stays UNBOUNDED on purpose: after a
|
|
155
|
-
* stop, terminate or max_rounds the session's `current_round` sits ON the
|
|
156
|
-
* round it just committed, so bounding there would silently drop the loop's
|
|
157
|
-
* final round. An unobservable frontier fails open the same way — a read-only
|
|
158
|
-
* view never invents a fence, it only applies the one the runtime recorded. */
|
|
153
|
+
/** v3.9.6: read-only history = current branch rounds. No session frontier,
|
|
154
|
+
* no numeric fence, no second cursor. */
|
|
159
155
|
export declare function readOnlyRounds(entries: ReadonlyArray<unknown>): CommittedRoundView[];
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
* baseline. The derived delta is never evidence — it is a change-set view
|
|
163
|
-
* over these facts, not a second observation collection. */
|
|
164
|
-
export declare function machineEvidenceForRound(view: CommittedRoundView): MachineObservation[];
|
|
156
|
+
/** v3.9.6: read-only rollback events = committed directive chain. */
|
|
157
|
+
export declare function readOnlyRollbacks(entries: ReadonlyArray<unknown>): CommittedRoundView[];
|
|
165
158
|
/** v3.8: Rounds whose persisted transaction carries a LEGACY schema version.
|
|
166
159
|
* A hard version break must be visible, not silent: these rounds drop out of
|
|
167
160
|
* history views, so audit/status surface them here instead of letting the
|
|
@@ -173,38 +166,9 @@ export interface LegacyRound {
|
|
|
173
166
|
* breaks — a round that fails any check is not committed history — so all
|
|
174
167
|
* must be REPORTED, not just the transaction one.
|
|
175
168
|
* v3.9.1 adds "observation": a transaction whose embedded Git/command
|
|
176
|
-
* observation schema is unsupported.
|
|
177
|
-
|
|
169
|
+
* observation schema is unsupported. v4.0.4 adds "prompt_context": the
|
|
170
|
+
* artifact has the current schema but an illegal context-boundary pair. */
|
|
171
|
+
envelope: "transaction" | "prompt_artifact" | "prompt_context" | "observation";
|
|
178
172
|
}
|
|
179
173
|
export declare function legacyTransactionRounds(entries: unknown[]): LegacyRound[];
|
|
180
|
-
/** The ONE definition of machine Git motion for a single round.
|
|
181
|
-
*
|
|
182
|
-
* Motion is a non-empty file list, a HEAD that moved across the round, or a
|
|
183
|
-
* HEAD that landed on the rollback's restore point — restoring the workspace
|
|
184
|
-
* IS that round's work, and would otherwise read as a round that did
|
|
185
|
-
* nothing. A clean worktree is not the same thing as no progress:
|
|
186
|
-
* commit-per-slice workflows leave no file delta even though HEAD advanced.
|
|
187
|
-
*
|
|
188
|
-
* Observability stays the caller's concern: this answers "did this round
|
|
189
|
-
* move", never "could the round be observed". The restore-point arm compares
|
|
190
|
-
* short hashes, the rule `checkBacktrackGitHeadRestore` uses; the
|
|
191
|
-
* before/after arm compares the observations themselves. */
|
|
192
|
-
export declare function gitMotionSignal(input: {
|
|
193
|
-
/** The round's derived Git change set; null means unknown. */
|
|
194
|
-
changedFiles: ReadonlyArray<string> | null;
|
|
195
|
-
headBefore?: string | null;
|
|
196
|
-
headAfter?: string | null;
|
|
197
|
-
restoreTargetHead?: string | null;
|
|
198
|
-
}): boolean | null;
|
|
199
|
-
/** Git HEAD as a machine observation exposes it, or null when it is silent. */
|
|
200
|
-
export declare function observedGitHead(observation: MachineObservation | undefined): string | null;
|
|
201
|
-
/** The in-flight round's own motion, from its derived Git delta. A Git
|
|
202
|
-
* boundary that cannot be compared yields `null` unless HEAD movement or the
|
|
203
|
-
* restore point independently proves motion. */
|
|
204
|
-
export declare function inFlightGitMotion(deltas: ReadonlyArray<ObservationDelta>, restoreTargetHead?: string): boolean | null;
|
|
205
|
-
/** Machine-observed git motion for the most recent contiguous window.
|
|
206
|
-
* A clean worktree is not the same thing as no progress: commit-per-slice
|
|
207
|
-
* workflows leave no file delta even though HEAD advanced. Unknown motion in
|
|
208
|
-
* any round makes the window undecidable rather than falsely empty. */
|
|
209
|
-
export declare function machineGitMotionSeries(rounds: ReadonlyArray<CommittedRoundView>, currentRound: number, lookback: number): boolean[] | null;
|
|
210
174
|
//# sourceMappingURL=committed-round.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committed-round.d.ts","sourceRoot":"","sources":["../src/committed-round.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"committed-round.d.ts","sourceRoot":"","sources":["../src/committed-round.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,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