looply-cli 0.5.10 → 0.5.11
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/dist/.src-hash +1 -1
- package/dist/autonomy-controller.d.ts +23 -1
- package/dist/autonomy-controller.d.ts.map +1 -1
- package/dist/autonomy-controller.js +50 -9
- package/dist/autonomy-controller.js.map +1 -1
- package/dist/autonomy-store.d.ts +33 -1
- package/dist/autonomy-store.d.ts.map +1 -1
- package/dist/autonomy-store.js +58 -8
- package/dist/autonomy-store.js.map +1 -1
- package/dist/autonomy-tick.d.ts +23 -1
- package/dist/autonomy-tick.d.ts.map +1 -1
- package/dist/autonomy-tick.js +80 -14
- package/dist/autonomy-tick.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +25 -5
- package/dist/bin.js.map +1 -1
- package/dist/branch-delivery-wiring.d.ts.map +1 -1
- package/dist/branch-delivery-wiring.js +6 -1
- package/dist/branch-delivery-wiring.js.map +1 -1
- package/dist/branch-delivery.d.ts +135 -6
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +540 -80
- package/dist/branch-delivery.js.map +1 -1
- package/dist/branch-replay.d.ts +45 -0
- package/dist/branch-replay.d.ts.map +1 -0
- package/dist/branch-replay.js +123 -0
- package/dist/branch-replay.js.map +1 -0
- package/dist/commit-ownership.d.ts +102 -0
- package/dist/commit-ownership.d.ts.map +1 -0
- package/dist/commit-ownership.js +97 -0
- package/dist/commit-ownership.js.map +1 -0
- package/dist/coordinator-state.d.ts.map +1 -1
- package/dist/coordinator-state.js +21 -1
- package/dist/coordinator-state.js.map +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +24 -3
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/deliver-cmd.d.ts +18 -0
- package/dist/deliver-cmd.d.ts.map +1 -1
- package/dist/deliver-cmd.js +71 -5
- package/dist/deliver-cmd.js.map +1 -1
- package/dist/delivery-settings-cache.d.ts +15 -1
- package/dist/delivery-settings-cache.d.ts.map +1 -1
- package/dist/delivery-settings-cache.js +31 -3
- package/dist/delivery-settings-cache.js.map +1 -1
- package/dist/environment-hold.d.ts +69 -0
- package/dist/environment-hold.d.ts.map +1 -0
- package/dist/environment-hold.js +120 -0
- package/dist/environment-hold.js.map +1 -0
- package/dist/gate.d.ts.map +1 -1
- package/dist/gate.js +15 -1
- package/dist/gate.js.map +1 -1
- package/dist/github-api.d.ts +19 -0
- package/dist/github-api.d.ts.map +1 -1
- package/dist/github-api.js +26 -0
- package/dist/github-api.js.map +1 -1
- package/dist/goal-adaptive.d.ts +1 -0
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +26 -13
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-compile.d.ts +37 -0
- package/dist/goal-compile.d.ts.map +1 -1
- package/dist/goal-compile.js +25 -1
- package/dist/goal-compile.js.map +1 -1
- package/dist/goal-replay.d.ts +83 -0
- package/dist/goal-replay.d.ts.map +1 -0
- package/dist/goal-replay.js +121 -0
- package/dist/goal-replay.js.map +1 -0
- package/dist/goal-reproof.d.ts +5 -0
- package/dist/goal-reproof.d.ts.map +1 -1
- package/dist/goal-reproof.js +11 -4
- package/dist/goal-reproof.js.map +1 -1
- package/dist/grant-pause.d.ts +48 -0
- package/dist/grant-pause.d.ts.map +1 -0
- package/dist/grant-pause.js +103 -0
- package/dist/grant-pause.js.map +1 -0
- package/dist/grant-reconcile.d.ts +8 -2
- package/dist/grant-reconcile.d.ts.map +1 -1
- package/dist/grant-reconcile.js +9 -2
- package/dist/grant-reconcile.js.map +1 -1
- package/dist/grant-waiting-wiring.d.ts +49 -0
- package/dist/grant-waiting-wiring.d.ts.map +1 -0
- package/dist/grant-waiting-wiring.js +77 -0
- package/dist/grant-waiting-wiring.js.map +1 -0
- package/dist/planner-timeouts.d.ts +14 -0
- package/dist/planner-timeouts.d.ts.map +1 -0
- package/dist/planner-timeouts.js +51 -0
- package/dist/planner-timeouts.js.map +1 -0
- package/dist/run-cmd.d.ts +12 -1
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +146 -10
- package/dist/run-cmd.js.map +1 -1
- package/dist/run-refusal-marks.d.ts +7 -1
- package/dist/run-refusal-marks.d.ts.map +1 -1
- package/dist/run-refusal-marks.js +4 -0
- package/dist/run-refusal-marks.js.map +1 -1
- package/dist/server-client.d.ts +15 -1
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +17 -0
- package/dist/server-client.js.map +1 -1
- package/dist/start-attempts.d.ts +4 -2
- package/dist/start-attempts.d.ts.map +1 -1
- package/dist/start-attempts.js +6 -1
- package/dist/start-attempts.js.map +1 -1
- package/package.json +2 -2
package/dist/goal-reproof.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-reproof.js","sourceRoot":"","sources":["../src/goal-reproof.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"goal-reproof.js","sourceRoot":"","sources":["../src/goal-reproof.ts"],"names":[],"mappings":";;AA2CA,sCA4BC;AAlCD;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,SAA4B,EAAE,IAAiB;IAC/F,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IACvF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,wBAAwB,KAAK,CAAC,MAAM,kEAAkE,EAAE,CAAC;IACxI,CAAC;IACD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,qGAAqG;IACrG,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,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S WITHOUT SPENDING.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* A grant is 8 Starts within 24 hours. The hours were meant to bound SPENDING; they also ran
|
|
6
|
+
* while a goal could not spend at all — waiting for a goal it depends on, for a checkout slot,
|
|
7
|
+
* or out a machine fault — and the grant ran out with nothing done. TAB-B-64 (2026-10-16) waited
|
|
8
|
+
* on TAB-B-63 from 00:37 and would have lost its grant at 00:37 the next day without one Start.
|
|
9
|
+
*
|
|
10
|
+
* So while the tick DEFERS a goal for one of those reasons, before anything is spent, this
|
|
11
|
+
* accrues the time, and the controller judges expiry against `expiresAt + pausedMs`
|
|
12
|
+
* (`effectiveExpiry`). The figure is reported to the server, which applies it to its own
|
|
13
|
+
* projection; `expiresAt` itself is never touched — it is the immutable term the person granted,
|
|
14
|
+
* compared on every reconcile.
|
|
15
|
+
*
|
|
16
|
+
* Bounded by MAX_GRANT_PAUSE_MS (7 days), so a goal nothing will ever unblock still ends.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ ONE WRITE PER TRANSITION, NOT PER CADENCE. `since` marks a wait in progress; the time is
|
|
19
|
+
* folded into `pausedMs` only when the wait ends, and `effective` adds the open stretch on read.
|
|
20
|
+
*/
|
|
21
|
+
export declare const GRANT_PAUSE_FILE = "pause.json";
|
|
22
|
+
export interface GrantPause {
|
|
23
|
+
/** Closed waits, summed. */
|
|
24
|
+
readonly pausedMs: number;
|
|
25
|
+
/** When the wait now in progress began (ms since epoch), or null. */
|
|
26
|
+
readonly since: number | null;
|
|
27
|
+
/** The figure last accepted by the server, so a report is sent only when it moved. */
|
|
28
|
+
readonly reportedMs: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function readGrantPause(stateDir: string, controllerId: string): GrantPause;
|
|
31
|
+
/** The paused time so far, the open stretch included, capped. */
|
|
32
|
+
export declare function pausedNow(p: GrantPause, now: number): number;
|
|
33
|
+
/** The grant's effective end as an ISO string, for the controller's facts. */
|
|
34
|
+
export declare function effectiveExpiresAt(expiresAt: string, p: GrantPause, now: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* Note whether the goal is waiting (deferred before spending) this cadence. Writes only on a
|
|
37
|
+
* change: a wait starting, or a wait ending (folded into `pausedMs`). Returns the state now.
|
|
38
|
+
*/
|
|
39
|
+
export declare function noteWaiting(stateDir: string, controllerId: string, waiting: boolean, now: number): GrantPause;
|
|
40
|
+
/** Record that the server accepted this figure. */
|
|
41
|
+
export declare function noteReported(stateDir: string, controllerId: string, reportedMs: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* Is a report due? The server's projection ends a grant at `expiresAt + pausedMs`, so a figure
|
|
44
|
+
* it has not heard cannot keep the grant alive there: report every minute of new pause.
|
|
45
|
+
*/
|
|
46
|
+
export declare const PAUSE_REPORT_STEP_MS: number;
|
|
47
|
+
export declare function pauseReportDue(p: GrantPause, now: number): number | null;
|
|
48
|
+
//# sourceMappingURL=grant-pause.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-pause.d.ts","sourceRoot":"","sources":["../src/grant-pause.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAQD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,UAAU,CAYjF;AAUD,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAa7G;AAED,mDAAmD;AACnD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAI7F;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAY,CAAC;AAE9C,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGxE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAUSE_REPORT_STEP_MS = exports.GRANT_PAUSE_FILE = void 0;
|
|
4
|
+
exports.readGrantPause = readGrantPause;
|
|
5
|
+
exports.pausedNow = pausedNow;
|
|
6
|
+
exports.effectiveExpiresAt = effectiveExpiresAt;
|
|
7
|
+
exports.noteWaiting = noteWaiting;
|
|
8
|
+
exports.noteReported = noteReported;
|
|
9
|
+
exports.pauseReportDue = pauseReportDue;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
|
+
const core_1 = require("@looply/core");
|
|
13
|
+
/**
|
|
14
|
+
* A GRANT'S CLOCK STANDS STILL WHILE ITS GOAL WAITS WITHOUT SPENDING.
|
|
15
|
+
*
|
|
16
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
* A grant is 8 Starts within 24 hours. The hours were meant to bound SPENDING; they also ran
|
|
18
|
+
* while a goal could not spend at all — waiting for a goal it depends on, for a checkout slot,
|
|
19
|
+
* or out a machine fault — and the grant ran out with nothing done. TAB-B-64 (2026-10-16) waited
|
|
20
|
+
* on TAB-B-63 from 00:37 and would have lost its grant at 00:37 the next day without one Start.
|
|
21
|
+
*
|
|
22
|
+
* So while the tick DEFERS a goal for one of those reasons, before anything is spent, this
|
|
23
|
+
* accrues the time, and the controller judges expiry against `expiresAt + pausedMs`
|
|
24
|
+
* (`effectiveExpiry`). The figure is reported to the server, which applies it to its own
|
|
25
|
+
* projection; `expiresAt` itself is never touched — it is the immutable term the person granted,
|
|
26
|
+
* compared on every reconcile.
|
|
27
|
+
*
|
|
28
|
+
* Bounded by MAX_GRANT_PAUSE_MS (7 days), so a goal nothing will ever unblock still ends.
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ ONE WRITE PER TRANSITION, NOT PER CADENCE. `since` marks a wait in progress; the time is
|
|
31
|
+
* folded into `pausedMs` only when the wait ends, and `effective` adds the open stretch on read.
|
|
32
|
+
*/
|
|
33
|
+
exports.GRANT_PAUSE_FILE = 'pause.json';
|
|
34
|
+
const EMPTY = { pausedMs: 0, since: null, reportedMs: 0 };
|
|
35
|
+
function pathFor(stateDir, controllerId) {
|
|
36
|
+
return (0, node_path_1.join)(stateDir, 'autonomy', controllerId, exports.GRANT_PAUSE_FILE);
|
|
37
|
+
}
|
|
38
|
+
function readGrantPause(stateDir, controllerId) {
|
|
39
|
+
try {
|
|
40
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)(pathFor(stateDir, controllerId), 'utf8'));
|
|
41
|
+
const num = (x) => (typeof x === 'number' && Number.isFinite(x) && x >= 0 ? x : 0);
|
|
42
|
+
return {
|
|
43
|
+
pausedMs: num(raw.pausedMs),
|
|
44
|
+
since: typeof raw.since === 'number' && Number.isFinite(raw.since) ? raw.since : null,
|
|
45
|
+
reportedMs: num(raw.reportedMs),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return EMPTY;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function write(stateDir, controllerId, p) {
|
|
53
|
+
const target = pathFor(stateDir, controllerId);
|
|
54
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.join)(stateDir, 'autonomy', controllerId), { recursive: true });
|
|
55
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
56
|
+
(0, node_fs_1.writeFileSync)(tmp, `${JSON.stringify(p)}\n`, 'utf8');
|
|
57
|
+
(0, node_fs_1.renameSync)(tmp, target);
|
|
58
|
+
}
|
|
59
|
+
/** The paused time so far, the open stretch included, capped. */
|
|
60
|
+
function pausedNow(p, now) {
|
|
61
|
+
const open = p.since === null ? 0 : Math.max(0, now - p.since);
|
|
62
|
+
return Math.min(p.pausedMs + open, core_1.MAX_GRANT_PAUSE_MS);
|
|
63
|
+
}
|
|
64
|
+
/** The grant's effective end as an ISO string, for the controller's facts. */
|
|
65
|
+
function effectiveExpiresAt(expiresAt, p, now) {
|
|
66
|
+
const at = (0, core_1.effectiveExpiry)(expiresAt, pausedNow(p, now));
|
|
67
|
+
return Number.isNaN(at) ? expiresAt : new Date(at).toISOString();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Note whether the goal is waiting (deferred before spending) this cadence. Writes only on a
|
|
71
|
+
* change: a wait starting, or a wait ending (folded into `pausedMs`). Returns the state now.
|
|
72
|
+
*/
|
|
73
|
+
function noteWaiting(stateDir, controllerId, waiting, now) {
|
|
74
|
+
const cur = readGrantPause(stateDir, controllerId);
|
|
75
|
+
if (waiting && cur.since === null) {
|
|
76
|
+
const next = { ...cur, since: now };
|
|
77
|
+
write(stateDir, controllerId, next);
|
|
78
|
+
return next;
|
|
79
|
+
}
|
|
80
|
+
if (!waiting && cur.since !== null) {
|
|
81
|
+
const next = { ...cur, pausedMs: pausedNow(cur, now), since: null };
|
|
82
|
+
write(stateDir, controllerId, next);
|
|
83
|
+
return next;
|
|
84
|
+
}
|
|
85
|
+
return cur;
|
|
86
|
+
}
|
|
87
|
+
/** Record that the server accepted this figure. */
|
|
88
|
+
function noteReported(stateDir, controllerId, reportedMs) {
|
|
89
|
+
const cur = readGrantPause(stateDir, controllerId);
|
|
90
|
+
if (reportedMs <= cur.reportedMs)
|
|
91
|
+
return;
|
|
92
|
+
write(stateDir, controllerId, { ...cur, reportedMs });
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Is a report due? The server's projection ends a grant at `expiresAt + pausedMs`, so a figure
|
|
96
|
+
* it has not heard cannot keep the grant alive there: report every minute of new pause.
|
|
97
|
+
*/
|
|
98
|
+
exports.PAUSE_REPORT_STEP_MS = 60 * 1000;
|
|
99
|
+
function pauseReportDue(p, now) {
|
|
100
|
+
const current = pausedNow(p, now);
|
|
101
|
+
return current - p.reportedMs >= exports.PAUSE_REPORT_STEP_MS ? current : null;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=grant-pause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-pause.js","sourceRoot":"","sources":["../src/grant-pause.ts"],"names":[],"mappings":";;;AA0CA,wCAYC;AAWD,8BAGC;AAGD,gDAGC;AAMD,kCAaC;AAGD,oCAIC;AAQD,wCAGC;AA/GD,qCAA6E;AAC7E,yCAAiC;AACjC,uCAAmE;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AAEU,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAW7C,MAAM,KAAK,GAAe,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;AAEtE,SAAS,OAAO,CAAC,QAAgB,EAAE,YAAoB;IACrD,OAAO,IAAA,gBAAI,EAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,wBAAgB,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,cAAc,CAAC,QAAgB,EAAE,YAAoB;IACnE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,OAAO,CAAC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AAE,IAAI,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,mDAAmD;AACnD,SAAgB,YAAY,CAAC,QAAgB,EAAE,YAAoB,EAAE,UAAkB;IACrF,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACnD,IAAI,UAAU,IAAI,GAAG,CAAC,UAAU;QAAE,OAAO;IACzC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,GAAG,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACU,QAAA,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAE9C,SAAgB,cAAc,CAAC,CAAa,EAAE,GAAW;IACvD,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAClC,OAAO,OAAO,GAAG,CAAC,CAAC,UAAU,IAAI,4BAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GoalAutonomyState, type GoalState, type MachineSettlableState } from '@looply/core';
|
|
2
2
|
import type { Reconciliation } from './autonomy-controller';
|
|
3
3
|
import type { AutonomyProgress } from './autonomy-store';
|
|
4
4
|
import type { ServerAutonomy } from './server-client';
|
|
@@ -51,7 +51,13 @@ export declare const IMMUTABLE_GRANT_FIELDS: readonly ["controllerId", "goalId",
|
|
|
51
51
|
* which is a contradiction rather than an absence, since the machine only holds
|
|
52
52
|
* grants the server minted.
|
|
53
53
|
*/
|
|
54
|
-
export declare function reconcileGrant(local: LocalGrant, remote: ServerAutonomy | null, goal: CurrentGoal | null, now: number
|
|
54
|
+
export declare function reconcileGrant(local: LocalGrant, remote: ServerAutonomy | null, goal: CurrentGoal | null, now: number,
|
|
55
|
+
/**
|
|
56
|
+
* How long this machine has seen the goal wait without spending (`grant-pause.ts`). The
|
|
57
|
+
* server's own figure (`remote.pausedMs`) lags it by at most one report; the larger of the two
|
|
58
|
+
* is the clock that stood still. Capped by core's MAX_GRANT_PAUSE_MS either way.
|
|
59
|
+
*/
|
|
60
|
+
localPausedMs?: number): Reconciliation;
|
|
55
61
|
/**
|
|
56
62
|
* The states a machine may report about itself, as the controller's vocabulary.
|
|
57
63
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant-reconcile.d.ts","sourceRoot":"","sources":["../src/grant-reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"grant-reconcile.d.ts","sourceRoot":"","sources":["../src/grant-reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACnH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,gBAAgB,EAChB,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CACtE,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,8EAMzB,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,cAAc,GAAG,IAAI,EAC7B,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,GAAG,EAAE,MAAM;AACX;;;;GAIG;AACH,aAAa,SAAI,GAChB,cAAc,CAgEhB;AAcD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,GAAG,IAAI,CAoBrF"}
|
package/dist/grant-reconcile.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IMMUTABLE_GRANT_FIELDS = void 0;
|
|
4
4
|
exports.reconcileGrant = reconcileGrant;
|
|
5
5
|
exports.settlableState = settlableState;
|
|
6
|
+
const core_1 = require("@looply/core");
|
|
6
7
|
/** The immutable fields, named once so the comparison and its test agree. */
|
|
7
8
|
exports.IMMUTABLE_GRANT_FIELDS = [
|
|
8
9
|
'controllerId',
|
|
@@ -18,7 +19,13 @@ exports.IMMUTABLE_GRANT_FIELDS = [
|
|
|
18
19
|
* which is a contradiction rather than an absence, since the machine only holds
|
|
19
20
|
* grants the server minted.
|
|
20
21
|
*/
|
|
21
|
-
function reconcileGrant(local, remote, goal, now
|
|
22
|
+
function reconcileGrant(local, remote, goal, now,
|
|
23
|
+
/**
|
|
24
|
+
* How long this machine has seen the goal wait without spending (`grant-pause.ts`). The
|
|
25
|
+
* server's own figure (`remote.pausedMs`) lags it by at most one report; the larger of the two
|
|
26
|
+
* is the clock that stood still. Capped by core's MAX_GRANT_PAUSE_MS either way.
|
|
27
|
+
*/
|
|
28
|
+
localPausedMs = 0) {
|
|
22
29
|
if (remote === null) {
|
|
23
30
|
return {
|
|
24
31
|
kind: 'mismatch',
|
|
@@ -66,7 +73,7 @@ function reconcileGrant(local, remote, goal, now) {
|
|
|
66
73
|
// The clock, checked against the SERVER's copy. A machine whose clock ran
|
|
67
74
|
// fast must not be able to extend an authorization, and one whose clock ran
|
|
68
75
|
// slow must not keep spending past the end.
|
|
69
|
-
const expires =
|
|
76
|
+
const expires = (0, core_1.effectiveExpiry)(remote.expiresAt, Math.max(remote.pausedMs ?? 0, localPausedMs));
|
|
70
77
|
if (Number.isNaN(expires)) {
|
|
71
78
|
return { kind: 'mismatch', because: 'the expiry on this grant cannot be read' };
|
|
72
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant-reconcile.js","sourceRoot":"","sources":["../src/grant-reconcile.ts"],"names":[],"mappings":";;;AAmEA,
|
|
1
|
+
{"version":3,"file":"grant-reconcile.js","sourceRoot":"","sources":["../src/grant-reconcile.ts"],"names":[],"mappings":";;;AAmEA,wCA2EC;AAqBD,wCAoBC;AAvLD,uCAAmH;AAmDnH,6EAA6E;AAChE,QAAA,sBAAsB,GAAG;IACpC,cAAc;IACd,QAAQ;IACR,aAAa;IACb,WAAW;IACX,WAAW;CACH,CAAC;AAEX;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,KAAiB,EACjB,MAA6B,EAC7B,IAAwB,EACxB,GAAW;AACX;;;;GAIG;AACH,aAAa,GAAG,CAAC;IAEjB,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,qCAAqC,KAAK,CAAC,YAAY,EAAE;SACnE,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,iEAAiE;QACjE,sDAAsD;QACtD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,0BAA0B,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;IACjF,CAAC;IAED,wEAAwE;IACxE,4CAA4C;IAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAEpE,wEAAwE;IACxE,EAAE;IACF,2EAA2E;IAC3E,8EAA8E;IAC9E,wEAAwE;IACxE,6EAA6E;IAC7E,4EAA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zD,CAAC;AAED,0EAA0E;AAC1E,SAAS,aAAa,CAAC,KAAiB,EAAE,MAAsB;IAC9D,KAAK,MAAM,KAAK,IAAI,8BAAsB,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO,gBAAgB,KAAK,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC7F,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,KAAwB;IACrD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,gBAAgB,CAAC;QACtB,KAAK,kBAAkB,CAAC;QACxB,KAAK,YAAY,CAAC;QAClB,KAAK,WAAW;YACd,OAAO,KAAK,CAAC;QACf,KAAK,WAAW;YACd,yEAAyE;YACzE,sCAAsC;YACtC,OAAO,IAAI,CAAC;QACd,KAAK,YAAY;YACf,wBAAwB;YACxB,OAAO,IAAI,CAAC;QACd,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,KAAK,GAAU,KAAK,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EnvironmentCode, GoalHold } from '@looply/core';
|
|
2
|
+
import type { AutonomyProgress } from './autonomy-store';
|
|
3
|
+
import { type EnvironmentHoldFact } from './environment-hold';
|
|
4
|
+
/**
|
|
5
|
+
* THE DAEMON'S HANDLE ON A GOAL THAT WAITS: built once per project, so `daemon-cmd` gains a few
|
|
6
|
+
* fields on the tick and nothing else.
|
|
7
|
+
*
|
|
8
|
+
* environmentHold(grant) — is a machine fault being waited out (`environment-hold.ts`)?
|
|
9
|
+
* onEnvironmentFault(...) — a Start was voided for one: write the hold, tell the server;
|
|
10
|
+
* grantClock — the paused clock (`grant-pause.ts`), and its report to the server;
|
|
11
|
+
* dependencyWait / moved — say a dependency hold to the server, and clear it once the goal moves.
|
|
12
|
+
*
|
|
13
|
+
* Every server call here is fire-and-forget: the server's copy is for a reader (AutoRyn says
|
|
14
|
+
* "Can't start yet: …"), and a failure is retried on the next change or the next minute.
|
|
15
|
+
*/
|
|
16
|
+
export interface GrantWaitingDeps {
|
|
17
|
+
readonly stateDir: string;
|
|
18
|
+
readonly projectDir: string;
|
|
19
|
+
readonly projectId: string;
|
|
20
|
+
readonly client: {
|
|
21
|
+
recordAutonomyPause(projectId: string, controllerId: string, pausedMs: number): Promise<{
|
|
22
|
+
pausedMs: number;
|
|
23
|
+
}>;
|
|
24
|
+
recordGoalHold(projectId: string, goalId: string, hold: GoalHold | null): Promise<unknown>;
|
|
25
|
+
};
|
|
26
|
+
readonly log: (line: string) => void;
|
|
27
|
+
/** The Looply version running now. Defaults to this package's own. */
|
|
28
|
+
readonly looplyVersion?: string;
|
|
29
|
+
/** The config digest now. Defaults to `configDigest(projectDir)`. */
|
|
30
|
+
readonly digest?: () => string;
|
|
31
|
+
}
|
|
32
|
+
export interface GrantWaiting {
|
|
33
|
+
environmentHold(grant: AutonomyProgress): EnvironmentHoldFact;
|
|
34
|
+
onEnvironmentFault(grant: AutonomyProgress, code: EnvironmentCode, because: string): void;
|
|
35
|
+
readonly grantClock: {
|
|
36
|
+
expiresAt(grant: AutonomyProgress, now: number): string;
|
|
37
|
+
waiting(grant: AutonomyProgress, waiting: boolean, now: number): void;
|
|
38
|
+
};
|
|
39
|
+
/** The local paused figure, for reconcile. */
|
|
40
|
+
pausedMs(grant: AutonomyProgress, now: number): number;
|
|
41
|
+
/** A dependency hold, said to the server once per change. */
|
|
42
|
+
dependencyHold(goalId: string, because: string): void;
|
|
43
|
+
/** The goal moved (launched or ended): any hold the server shows is cleared. */
|
|
44
|
+
moved(goalId: string): void;
|
|
45
|
+
}
|
|
46
|
+
/** This package's version, read the way `looply --version` reads it. */
|
|
47
|
+
export declare function packageVersion(): string;
|
|
48
|
+
export declare function makeGrantWaiting(deps: GrantWaitingDeps): GrantWaiting;
|
|
49
|
+
//# sourceMappingURL=grant-waiting-wiring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-waiting-wiring.d.ts","sourceRoot":"","sources":["../src/grant-waiting-wiring.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE;QACf,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC9G,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAC5F,CAAC;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,sEAAsE;IACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;IAC9D,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1F,QAAQ,CAAC,UAAU,EAAE;QACnB,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;QACxD,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACvE,CAAC;IACF,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACvD,6DAA6D;IAC7D,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,gFAAgF;IAChF,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,wEAAwE;AACxE,wBAAgB,cAAc,IAAI,MAAM,CAMvC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAuDrE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packageVersion = packageVersion;
|
|
4
|
+
exports.makeGrantWaiting = makeGrantWaiting;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const environment_hold_1 = require("./environment-hold");
|
|
8
|
+
const grant_pause_1 = require("./grant-pause");
|
|
9
|
+
/** This package's version, read the way `looply --version` reads it. */
|
|
10
|
+
function packageVersion() {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '..', 'package.json'), 'utf8')).version ?? 'unknown';
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return 'unknown';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function makeGrantWaiting(deps) {
|
|
19
|
+
const version = deps.looplyVersion ?? packageVersion();
|
|
20
|
+
const digest = deps.digest ?? (() => (0, environment_hold_1.configDigest)(deps.projectDir));
|
|
21
|
+
/** What the server was last told, per goal — so a hold is said once per change. */
|
|
22
|
+
const told = new Map();
|
|
23
|
+
const tell = (goalId, hold) => {
|
|
24
|
+
const key = hold === null ? '' : `${hold.code}:${hold.reason}`;
|
|
25
|
+
if (told.get(goalId) === key)
|
|
26
|
+
return;
|
|
27
|
+
told.set(goalId, key);
|
|
28
|
+
deps.client.recordGoalHold(deps.projectId, goalId, hold).catch((e) => {
|
|
29
|
+
told.delete(goalId);
|
|
30
|
+
deps.log(`autonomy: could not tell the server why ${goalId} is held (${e.message})`);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const reporting = new Set();
|
|
34
|
+
return {
|
|
35
|
+
environmentHold(grant) {
|
|
36
|
+
const record = (0, environment_hold_1.readEnvironmentHold)(deps.stateDir, grant.controllerId);
|
|
37
|
+
if (record === null)
|
|
38
|
+
return { held: false };
|
|
39
|
+
const fact = (0, environment_hold_1.decideEnvironmentHold)(record, { at: Date.now(), looplyVersion: version, configDigest: digest() });
|
|
40
|
+
if (fact.held)
|
|
41
|
+
tell(grant.goalId, { code: record.code, reason: fact.because.replace(/^held: /, '').slice(0, 300) });
|
|
42
|
+
return fact;
|
|
43
|
+
},
|
|
44
|
+
onEnvironmentFault(grant, code, because) {
|
|
45
|
+
(0, environment_hold_1.writeEnvironmentHold)(deps.stateDir, grant.controllerId, {
|
|
46
|
+
code,
|
|
47
|
+
reason: because.slice(0, 300),
|
|
48
|
+
since: new Date().toISOString(),
|
|
49
|
+
looplyVersion: version,
|
|
50
|
+
configDigest: digest(),
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
grantClock: {
|
|
54
|
+
expiresAt: (grant, now) => (0, grant_pause_1.effectiveExpiresAt)(grant.expiresAt, (0, grant_pause_1.readGrantPause)(deps.stateDir, grant.controllerId), now),
|
|
55
|
+
waiting(grant, waiting, now) {
|
|
56
|
+
const p = (0, grant_pause_1.noteWaiting)(deps.stateDir, grant.controllerId, waiting, now);
|
|
57
|
+
const due = (0, grant_pause_1.pauseReportDue)(p, now);
|
|
58
|
+
if (due === null || reporting.has(grant.controllerId))
|
|
59
|
+
return;
|
|
60
|
+
reporting.add(grant.controllerId);
|
|
61
|
+
deps.client
|
|
62
|
+
.recordAutonomyPause(deps.projectId, grant.controllerId, due)
|
|
63
|
+
.then((r) => (0, grant_pause_1.noteReported)(deps.stateDir, grant.controllerId, Math.min(r.pausedMs, due)))
|
|
64
|
+
.catch((e) => deps.log(`autonomy: could not report ${grant.goalId}'s paused clock (${e.message})`))
|
|
65
|
+
.finally(() => reporting.delete(grant.controllerId));
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
pausedMs: (grant, now) => (0, grant_pause_1.pausedNow)((0, grant_pause_1.readGrantPause)(deps.stateDir, grant.controllerId), now),
|
|
69
|
+
dependencyHold(goalId, because) {
|
|
70
|
+
tell(goalId, { code: 'dependency', reason: because.slice(0, 300) });
|
|
71
|
+
},
|
|
72
|
+
moved(goalId) {
|
|
73
|
+
tell(goalId, null);
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=grant-waiting-wiring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-waiting-wiring.js","sourceRoot":"","sources":["../src/grant-waiting-wiring.ts"],"names":[],"mappings":";;AAyDA,wCAMC;AAED,4CAuDC;AAxHD,qCAAuC;AACvC,yCAAiC;AAGjC,yDAM4B;AA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;YAC5B,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,KAAK,CAAC,MAAM;YACV,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HOW MANY TIMES ONE PLANNING HAS TIMED OUT ON THIS MACHINE — the count `goal-compile.ts`'s
|
|
3
|
+
* `compileTierFor` turns into a longer limit and a smaller plan (TAB-B-57, 2026-10-16: two Starts
|
|
4
|
+
* lost to a ten-minute planner timeout before the third compiled).
|
|
5
|
+
*
|
|
6
|
+
* Keyed by whatever the caller names one planning by (`<id>@<version>`), in the PROJECT's state
|
|
7
|
+
* directory, so a later Start placed in another checkout still knows. Separate from the compiler
|
|
8
|
+
* on purpose: the compiler writes nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PLANNER_TIMEOUTS_FILE = "planner-timeouts.json";
|
|
11
|
+
export declare function plannerTimeoutsFor(stateDir: string, key: string): number;
|
|
12
|
+
/** Count one more timeout for `key`; returns the new count. Never throws: the count only lengthens a limit. */
|
|
13
|
+
export declare function notePlannerTimeout(stateDir: string, key: string): number;
|
|
14
|
+
//# sourceMappingURL=planner-timeouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-timeouts.d.ts","sourceRoot":"","sources":["../src/planner-timeouts.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQxE;AAED,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBxE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLANNER_TIMEOUTS_FILE = void 0;
|
|
4
|
+
exports.plannerTimeoutsFor = plannerTimeoutsFor;
|
|
5
|
+
exports.notePlannerTimeout = notePlannerTimeout;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
/**
|
|
9
|
+
* HOW MANY TIMES ONE PLANNING HAS TIMED OUT ON THIS MACHINE — the count `goal-compile.ts`'s
|
|
10
|
+
* `compileTierFor` turns into a longer limit and a smaller plan (TAB-B-57, 2026-10-16: two Starts
|
|
11
|
+
* lost to a ten-minute planner timeout before the third compiled).
|
|
12
|
+
*
|
|
13
|
+
* Keyed by whatever the caller names one planning by (`<id>@<version>`), in the PROJECT's state
|
|
14
|
+
* directory, so a later Start placed in another checkout still knows. Separate from the compiler
|
|
15
|
+
* on purpose: the compiler writes nothing.
|
|
16
|
+
*/
|
|
17
|
+
exports.PLANNER_TIMEOUTS_FILE = 'planner-timeouts.json';
|
|
18
|
+
function plannerTimeoutsFor(stateDir, key) {
|
|
19
|
+
try {
|
|
20
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, exports.PLANNER_TIMEOUTS_FILE), 'utf8'));
|
|
21
|
+
const n = raw[key];
|
|
22
|
+
return typeof n === 'number' && Number.isFinite(n) && n > 0 ? Math.floor(n) : 0;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Count one more timeout for `key`; returns the new count. Never throws: the count only lengthens a limit. */
|
|
29
|
+
function notePlannerTimeout(stateDir, key) {
|
|
30
|
+
const path = (0, node_path_1.join)(stateDir, exports.PLANNER_TIMEOUTS_FILE);
|
|
31
|
+
try {
|
|
32
|
+
let raw = {};
|
|
33
|
+
try {
|
|
34
|
+
raw = JSON.parse((0, node_fs_1.readFileSync)(path, 'utf8'));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
raw = {};
|
|
38
|
+
}
|
|
39
|
+
const next = (typeof raw[key] === 'number' ? raw[key] : 0) + 1;
|
|
40
|
+
raw[key] = next;
|
|
41
|
+
(0, node_fs_1.mkdirSync)(stateDir, { recursive: true });
|
|
42
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
43
|
+
(0, node_fs_1.writeFileSync)(tmp, `${JSON.stringify(raw)}\n`, 'utf8');
|
|
44
|
+
(0, node_fs_1.renameSync)(tmp, path);
|
|
45
|
+
return next;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=planner-timeouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-timeouts.js","sourceRoot":"","sources":["../src/planner-timeouts.ts"],"names":[],"mappings":";;;AAeA,gDAQC;AAGD,gDAmBC;AA7CD,qCAA6E;AAC7E,yCAAiC;AAEjC;;;;;;;;GAQG;AAEU,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D,SAAgB,kBAAkB,CAAC,QAAgB,EAAE,GAAW;IAC9D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,6BAAqB,CAAC,EAAE,MAAM,CAAC,CAA4B,CAAC;QAC/G,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,+GAA+G;AAC/G,SAAgB,kBAAkB,CAAC,QAAgB,EAAE,GAAW;IAC9D,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,QAAQ,EAAE,6BAAqB,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,IAAI,GAAG,GAA2B,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAA2B,CAAC;QACzE,CAAC;QAAC,MAAM,CAAC;YACP,GAAG,GAAG,EAAE,CAAC;QACX,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/D,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAChB,IAAA,mBAAS,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;QACzC,IAAA,uBAAa,EAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,IAAA,oBAAU,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
package/dist/run-cmd.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type RepairContext, type RunSummary } from './round-runner';
|
|
|
6
6
|
import type { AnsweredQuestionView, PartialQuestionBody } from '@looply/core';
|
|
7
7
|
import { type ApprovalResolutionContext } from './approval-resolution';
|
|
8
8
|
import { type RepositorySpan } from '@looply/core';
|
|
9
|
+
import type { EnvironmentCode } from '@looply/core';
|
|
9
10
|
import { type GovernedActionResultContext } from './governed-run';
|
|
10
11
|
/**
|
|
11
12
|
* The composition root for `looply run`.
|
|
@@ -154,6 +155,11 @@ export declare class RunRefused extends Error {
|
|
|
154
155
|
* the mark so the daemon can settle the pursuit with facts, not a sentence.
|
|
155
156
|
*/
|
|
156
157
|
readonly delivery?: RunDelivery | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Which machine fault, on an `environment` refusal only — carried to the mark so the
|
|
160
|
+
* controller's hold names it (`environment-hold.ts`).
|
|
161
|
+
*/
|
|
162
|
+
readonly environment?: EnvironmentCode | undefined;
|
|
157
163
|
/**
|
|
158
164
|
* The same refusal, for a machine.
|
|
159
165
|
*
|
|
@@ -178,7 +184,12 @@ export declare class RunRefused extends Error {
|
|
|
178
184
|
* delivering run, the commit, and each required step's outcome. Carried to
|
|
179
185
|
* the mark so the daemon can settle the pursuit with facts, not a sentence.
|
|
180
186
|
*/
|
|
181
|
-
delivery?: RunDelivery | undefined
|
|
187
|
+
delivery?: RunDelivery | undefined,
|
|
188
|
+
/**
|
|
189
|
+
* Which machine fault, on an `environment` refusal only — carried to the mark so the
|
|
190
|
+
* controller's hold names it (`environment-hold.ts`).
|
|
191
|
+
*/
|
|
192
|
+
environment?: EnvironmentCode | undefined);
|
|
182
193
|
}
|
|
183
194
|
/** What `looply run` exits with when it refuses for good. */
|
|
184
195
|
export declare const EXIT_REFUSED = 3;
|
package/dist/run-cmd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-cmd.d.ts","sourceRoot":"","sources":["../src/run-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,OAAO,EAGL,KAAK,cAAc,EAKnB,K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