looply-cli 0.5.39 → 0.5.48
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/account-standing.d.ts +23 -0
- package/dist/account-standing.d.ts.map +1 -0
- package/dist/account-standing.js +41 -0
- package/dist/account-standing.js.map +1 -0
- package/dist/autonomy-controller.d.ts.map +1 -1
- package/dist/autonomy-controller.js +6 -0
- package/dist/autonomy-controller.js.map +1 -1
- package/dist/autonomy-tick.d.ts.map +1 -1
- package/dist/autonomy-tick.js +20 -2
- package/dist/autonomy-tick.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +5 -0
- package/dist/bin.js.map +1 -1
- package/dist/branch-delivery-wiring.d.ts +56 -1
- package/dist/branch-delivery-wiring.d.ts.map +1 -1
- package/dist/branch-delivery-wiring.js +135 -26
- package/dist/branch-delivery-wiring.js.map +1 -1
- package/dist/branch-delivery.d.ts +20 -0
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +78 -6
- package/dist/branch-delivery.js.map +1 -1
- package/dist/canary-cmd.d.ts +42 -0
- package/dist/canary-cmd.d.ts.map +1 -0
- package/dist/canary-cmd.js +242 -0
- package/dist/canary-cmd.js.map +1 -0
- package/dist/canary-wiring.d.ts +31 -0
- package/dist/canary-wiring.d.ts.map +1 -0
- package/dist/canary-wiring.js +139 -0
- package/dist/canary-wiring.js.map +1 -0
- package/dist/canary.d.ts +123 -0
- package/dist/canary.d.ts.map +1 -0
- package/dist/canary.js +259 -0
- package/dist/canary.js.map +1 -0
- package/dist/checkout-deps.d.ts +6 -0
- package/dist/checkout-deps.d.ts.map +1 -1
- package/dist/checkout-deps.js +11 -0
- package/dist/checkout-deps.js.map +1 -1
- package/dist/checkout-leftovers.d.ts.map +1 -1
- package/dist/checkout-leftovers.js +28 -21
- package/dist/checkout-leftovers.js.map +1 -1
- package/dist/coordinator-state.d.ts.map +1 -1
- package/dist/coordinator-state.js +6 -4
- package/dist/coordinator-state.js.map +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +76 -1
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/deliver-cmd.d.ts +11 -0
- package/dist/deliver-cmd.d.ts.map +1 -1
- package/dist/deliver-cmd.js +23 -0
- package/dist/deliver-cmd.js.map +1 -1
- package/dist/environment-hold.d.ts +32 -1
- package/dist/environment-hold.d.ts.map +1 -1
- package/dist/environment-hold.js +52 -5
- package/dist/environment-hold.js.map +1 -1
- package/dist/feature-report.d.ts +4 -2
- package/dist/feature-report.d.ts.map +1 -1
- package/dist/feature-report.js +47 -6
- package/dist/feature-report.js.map +1 -1
- package/dist/gate-health.d.ts +7 -0
- package/dist/gate-health.d.ts.map +1 -1
- package/dist/gate-health.js +11 -1
- package/dist/gate-health.js.map +1 -1
- package/dist/git-driver.d.ts +5 -0
- package/dist/git-driver.d.ts.map +1 -1
- package/dist/git-driver.js +8 -0
- package/dist/git-driver.js.map +1 -1
- package/dist/goal-adaptive.d.ts +25 -1
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +42 -1
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-compile.d.ts.map +1 -1
- package/dist/goal-compile.js +16 -0
- package/dist/goal-compile.js.map +1 -1
- package/dist/goal-gap.d.ts +35 -3
- package/dist/goal-gap.d.ts.map +1 -1
- package/dist/goal-gap.js +110 -11
- package/dist/goal-gap.js.map +1 -1
- package/dist/grant-waiting-wiring.d.ts +17 -1
- package/dist/grant-waiting-wiring.d.ts.map +1 -1
- package/dist/grant-waiting-wiring.js +29 -2
- package/dist/grant-waiting-wiring.js.map +1 -1
- package/dist/heroku-cli.d.ts +13 -1
- package/dist/heroku-cli.d.ts.map +1 -1
- package/dist/heroku-cli.js +15 -0
- package/dist/heroku-cli.js.map +1 -1
- package/dist/machine-settings.d.ts +11 -0
- package/dist/machine-settings.d.ts.map +1 -1
- package/dist/machine-settings.js +41 -0
- package/dist/machine-settings.js.map +1 -1
- package/dist/outcome-audit.d.ts +150 -0
- package/dist/outcome-audit.d.ts.map +1 -0
- package/dist/outcome-audit.js +310 -0
- package/dist/outcome-audit.js.map +1 -0
- package/dist/parts-attribution.d.ts +38 -0
- package/dist/parts-attribution.d.ts.map +1 -0
- package/dist/parts-attribution.js +61 -0
- package/dist/parts-attribution.js.map +1 -0
- package/dist/project-terminal.d.ts +3 -1
- package/dist/project-terminal.d.ts.map +1 -1
- package/dist/project-terminal.js +37 -5
- package/dist/project-terminal.js.map +1 -1
- package/dist/provider-accounts.d.ts +5 -1
- package/dist/provider-accounts.d.ts.map +1 -1
- package/dist/provider-accounts.js +1 -0
- package/dist/provider-accounts.js.map +1 -1
- package/dist/pursuit-delivery.d.ts +5 -20
- package/dist/pursuit-delivery.d.ts.map +1 -1
- package/dist/pursuit-delivery.js +30 -2
- package/dist/pursuit-delivery.js.map +1 -1
- package/dist/pursuit-ending.d.ts.map +1 -1
- package/dist/pursuit-ending.js +10 -0
- package/dist/pursuit-ending.js.map +1 -1
- package/dist/qa-feedback.d.ts +110 -0
- package/dist/qa-feedback.d.ts.map +1 -0
- package/dist/qa-feedback.js +353 -0
- package/dist/qa-feedback.js.map +1 -0
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +90 -7
- package/dist/run-cmd.js.map +1 -1
- package/dist/run-refusal-marks.d.ts +8 -1
- package/dist/run-refusal-marks.d.ts.map +1 -1
- package/dist/run-refusal-marks.js +14 -1
- package/dist/run-refusal-marks.js.map +1 -1
- package/dist/self-update.d.ts +440 -0
- package/dist/self-update.d.ts.map +1 -0
- package/dist/self-update.js +1006 -0
- package/dist/self-update.js.map +1 -0
- package/dist/serve-cmd.d.ts +32 -1
- package/dist/serve-cmd.d.ts.map +1 -1
- package/dist/serve-cmd.js +162 -7
- package/dist/serve-cmd.js.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +3 -0
- package/dist/serve.js.map +1 -1
- package/dist/server-client.d.ts +32 -1
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +28 -0
- package/dist/server-client.js.map +1 -1
- package/dist/setup-check-wiring.d.ts +31 -0
- package/dist/setup-check-wiring.d.ts.map +1 -0
- package/dist/setup-check-wiring.js +195 -0
- package/dist/setup-check-wiring.js.map +1 -0
- package/dist/setup-check.d.ts +228 -0
- package/dist/setup-check.d.ts.map +1 -0
- package/dist/setup-check.js +632 -0
- package/dist/setup-check.js.map +1 -0
- package/dist/signals.d.ts +13 -0
- package/dist/signals.d.ts.map +1 -1
- package/dist/signals.js +26 -1
- package/dist/signals.js.map +1 -1
- package/dist/ticket-attachments.d.ts +31 -1
- package/dist/ticket-attachments.d.ts.map +1 -1
- package/dist/ticket-attachments.js +232 -9
- package/dist/ticket-attachments.js.map +1 -1
- package/dist/watchdog-wiring.d.ts +151 -0
- package/dist/watchdog-wiring.d.ts.map +1 -0
- package/dist/watchdog-wiring.js +406 -0
- package/dist/watchdog-wiring.js.map +1 -0
- package/dist/watchdog.d.ts +124 -0
- package/dist/watchdog.d.ts.map +1 -0
- package/dist/watchdog.js +444 -0
- package/dist/watchdog.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { type AccountsFacts, type BranchDeliveryReport, type GoalHold, type RedBaseFacts, type WatchdogReport } from '@looply/core';
|
|
2
|
+
import type { AutonomyProgress } from './autonomy-store';
|
|
3
|
+
import { type DeliveryEntry } from './branch-delivery';
|
|
4
|
+
import type { HerokuLoginFact } from './branch-delivery-wiring';
|
|
5
|
+
import type { SetAside } from './checkout-leftovers';
|
|
6
|
+
import type { EnvironmentHoldRecord } from './environment-hold';
|
|
7
|
+
import { type OutcomeAuditDeps } from './outcome-audit';
|
|
8
|
+
/**
|
|
9
|
+
* LOOPLY NOTICES AND REPAIRS ITS OWN STUCK STATES.
|
|
10
|
+
*
|
|
11
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
* 🔴 WHAT THIS EXISTS FOR (2026-10-22). Every stall that day was found by a Claude session reading
|
|
13
|
+
* `~/.looply/serve.log` and `<repo>/.looply/state`, then repaired by hand or by a release:
|
|
14
|
+
*
|
|
15
|
+
* - a goal held on a verdict a newer Looply, or simply a later look, would judge differently;
|
|
16
|
+
* - a checkout Looply reuses, left with an earlier run's changes in it;
|
|
17
|
+
* - every account a ticket may use resting on a usage limit while other connected accounts sat
|
|
18
|
+
* idle, refused by their owners' settings — the ticket said only "usage limit";
|
|
19
|
+
* - a delivery in a state no pass moves (a push that failed, a branch pushed with no pull request);
|
|
20
|
+
* - the PC's Heroku CLI signed in as another account, so every deploy failed.
|
|
21
|
+
*
|
|
22
|
+
* Every 15 minutes the daemon looks (`makeWatchdog`) and, for each goal and delivery:
|
|
23
|
+
*
|
|
24
|
+
* 1. lists what has waited past the threshold (`WATCHDOG_STALLED_AFTER_MS`), with its code;
|
|
25
|
+
* 2. runs the SAFE remedy for what it knows — asks the hold's question again and releases the
|
|
26
|
+
* hold when the answer changed (an account free for every role, the AI tool ready, room on the
|
|
27
|
+
* disk, its own checkout cleaned — never a red base, see `causeGone`); sets aside what an earlier run left in a
|
|
28
|
+
* checkout LOOPLY MADE once it has stood unchanged and idle; delivers again a change whose push
|
|
29
|
+
* or pull request failed; reads the Heroku sign-in against what each environment needs;
|
|
30
|
+
* 3. says what it cannot fix ONCE, on the ticket, through the path every stall already takes
|
|
31
|
+
* (`stall.ts`: the hold's or the delivery's diagnosis, which AutoRyn puts on the ticket when it
|
|
32
|
+
* is due) — and only a wait nobody told the ticket about is told here;
|
|
33
|
+
* 4. records what it did in `.looply/state/watchdog.json`, which the feature report carries to
|
|
34
|
+
* AutoRyn (core `watchdog.ts`);
|
|
35
|
+
* 5. checks that what Looply REPORTED actually happened (`outcome-audit.ts`): a settled goal was
|
|
36
|
+
* delivered, Starts do work, a budget went on the goal, deliveries move.
|
|
37
|
+
*
|
|
38
|
+
* ⚠️ NEVER DESTRUCTIVE TO A PERSON'S WORK. Nothing here touches the project's own folder or a
|
|
39
|
+
* checkout a person made (`machineMadeCheckout`); a Looply checkout's changes are SAVED (a patch and
|
|
40
|
+
* the new files, `checkout-leftovers.ts`) before it is reset, and only when no run holds it. A hold
|
|
41
|
+
* released early costs nothing: a fault still there holds the goal again and counts from when it
|
|
42
|
+
* first began. Nothing here changes who may use which account, or spends a try.
|
|
43
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
44
|
+
*/
|
|
45
|
+
export declare const WATCHDOG_FILE = "watchdog.json";
|
|
46
|
+
/** A Looply checkout's changes must stand unchanged, with no run in it, this long before they are set aside. */
|
|
47
|
+
export declare const CHECKOUT_SETTLE_MS: number;
|
|
48
|
+
/** How long an undelivered change waits between deliveries again, and how many it gets per commit. */
|
|
49
|
+
export declare const DELIVERY_RETRY_MS: number;
|
|
50
|
+
export declare const DELIVERY_RETRIES_MAX = 8;
|
|
51
|
+
/** A set-aside that failed is tried again after this, doubling each time it fails again (up to a day). */
|
|
52
|
+
export declare const SET_ASIDE_BACKOFF_MS: number;
|
|
53
|
+
export interface WatchdogDeps {
|
|
54
|
+
readonly stateDir: string;
|
|
55
|
+
now(): number;
|
|
56
|
+
log(line: string): void;
|
|
57
|
+
/** Every grant this machine holds; only authorized ones are looked at. */
|
|
58
|
+
grants(): readonly AutonomyProgress[];
|
|
59
|
+
/** What each goal waits on, as the tick said it, and since when (epoch ms) it has waited. */
|
|
60
|
+
waits(): ReadonlyMap<string, {
|
|
61
|
+
readonly because: string;
|
|
62
|
+
readonly since: number;
|
|
63
|
+
}>;
|
|
64
|
+
readonly holdRecords: {
|
|
65
|
+
read(controllerId: string): EnvironmentHoldRecord | null;
|
|
66
|
+
/** Does it hold now (`decideEnvironmentHold` with this Looply, this config and — for a usage limit — this goal's accounts)? */
|
|
67
|
+
stands(record: EnvironmentHoldRecord, goalId: string): boolean;
|
|
68
|
+
release(controllerId: string): boolean;
|
|
69
|
+
};
|
|
70
|
+
/** The accounts a goal may use now, for its implementer (`account-standing.ts`); null when unknown. */
|
|
71
|
+
accounts?(goalId: string): AccountsFacts | null;
|
|
72
|
+
/**
|
|
73
|
+
* An account, of the project's provider, that may take this goal's calls in EVERY role its runs
|
|
74
|
+
* use, and is not resting; null when there is none (or it cannot tell).
|
|
75
|
+
*/
|
|
76
|
+
accountFree?(goalId: string): string | null;
|
|
77
|
+
/** The AI tool can run here now; null when this daemon cannot tell (a configured provider). */
|
|
78
|
+
providerReady?(): boolean | null;
|
|
79
|
+
/** Why no new checkout fits now, or null when one does; undefined when it could not be read. */
|
|
80
|
+
diskProblem?(): string | null | undefined;
|
|
81
|
+
/** The red base's own facts, for a diagnosis. */
|
|
82
|
+
redBase?(): RedBaseFacts | null;
|
|
83
|
+
readonly checkouts?: {
|
|
84
|
+
/** Checkouts under this project's workspaces folders that no run holds (`abandonedWorkspaces`). */
|
|
85
|
+
idle(): readonly string[];
|
|
86
|
+
/** Made by Looply: inside its workspaces folders, never the project's own folder. */
|
|
87
|
+
madeByLooply(path: string): boolean;
|
|
88
|
+
/** A run took it since `idle` was asked. */
|
|
89
|
+
busy(path: string): boolean;
|
|
90
|
+
/** What is changed there, Looply's own folder left out; null when it could not be read. */
|
|
91
|
+
changes(path: string): Promise<readonly string[] | null>;
|
|
92
|
+
setAside(path: string): Promise<SetAside | null>;
|
|
93
|
+
};
|
|
94
|
+
readonly deliveries?: {
|
|
95
|
+
all(): readonly DeliveryEntry[];
|
|
96
|
+
retry(goalId: string): Promise<BranchDeliveryReport | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Is delivering it again still wanted (the outcome auditor's check: the goal active at its version, no later attempt,
|
|
99
|
+
* the server agreeing, read now)? `retry`: cannot tell now; `quiet`: a person ended it on purpose. Absent: not asked.
|
|
100
|
+
*/
|
|
101
|
+
wanted?(goalId: string, sha: string): Promise<{
|
|
102
|
+
wanted: true;
|
|
103
|
+
} | {
|
|
104
|
+
wanted: false;
|
|
105
|
+
because: string;
|
|
106
|
+
retry: boolean;
|
|
107
|
+
quiet?: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
};
|
|
110
|
+
herokuLogins?(): Promise<readonly HerokuLoginFact[]>;
|
|
111
|
+
/** Tell the server a wait, as a hold (`grant-waiting-wiring.ts`'s `say`). */
|
|
112
|
+
tellHold?(goalId: string, hold: GoalHold): void;
|
|
113
|
+
/** Clear the hold the server shows for a goal, ONLY when it is still one of this code (`unsay`). */
|
|
114
|
+
untellHold?(goalId: string, code: GoalHold['code']): void;
|
|
115
|
+
/** The outcome auditor's reads and its one repair (`outcome-audit.ts`). */
|
|
116
|
+
readonly audit?: OutcomeAuditDeps;
|
|
117
|
+
}
|
|
118
|
+
/** The last look, as AutoRyn is shown it; null before the first. */
|
|
119
|
+
export declare function readWatchdogReport(stateDir: string): WatchdogReport | null;
|
|
120
|
+
/** One look. Never throws for what it finds; a remedy that fails is said and left for the next look. */
|
|
121
|
+
export declare function watchdogPass(deps: WatchdogDeps): Promise<WatchdogReport>;
|
|
122
|
+
/** The daemon's handle: called on its five-minute cadence, it looks at most every 15 minutes. Never throws. */
|
|
123
|
+
export declare function makeWatchdog(deps: WatchdogDeps, every?: number): () => Promise<WatchdogReport | null>;
|
|
124
|
+
//# sourceMappingURL=watchdog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../src/watchdog.ts"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAA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,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAChD,oGAAoG;IACpG,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC1D,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAwDD,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAE1E;AAuDD,wGAAwG;AACxG,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAmP9E;AAED,+GAA+G;AAC/G,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,GAAE,MAA0B,GAAG,MAAM,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAiBxH"}
|
package/dist/watchdog.js
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SET_ASIDE_BACKOFF_MS = exports.DELIVERY_RETRIES_MAX = exports.DELIVERY_RETRY_MS = exports.CHECKOUT_SETTLE_MS = exports.WATCHDOG_FILE = void 0;
|
|
4
|
+
exports.readWatchdogReport = readWatchdogReport;
|
|
5
|
+
exports.watchdogPass = watchdogPass;
|
|
6
|
+
exports.makeWatchdog = makeWatchdog;
|
|
7
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const core_1 = require("@looply/core");
|
|
11
|
+
const branch_delivery_1 = require("./branch-delivery");
|
|
12
|
+
const outcome_audit_1 = require("./outcome-audit");
|
|
13
|
+
/**
|
|
14
|
+
* LOOPLY NOTICES AND REPAIRS ITS OWN STUCK STATES.
|
|
15
|
+
*
|
|
16
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
* 🔴 WHAT THIS EXISTS FOR (2026-10-22). Every stall that day was found by a Claude session reading
|
|
18
|
+
* `~/.looply/serve.log` and `<repo>/.looply/state`, then repaired by hand or by a release:
|
|
19
|
+
*
|
|
20
|
+
* - a goal held on a verdict a newer Looply, or simply a later look, would judge differently;
|
|
21
|
+
* - a checkout Looply reuses, left with an earlier run's changes in it;
|
|
22
|
+
* - every account a ticket may use resting on a usage limit while other connected accounts sat
|
|
23
|
+
* idle, refused by their owners' settings — the ticket said only "usage limit";
|
|
24
|
+
* - a delivery in a state no pass moves (a push that failed, a branch pushed with no pull request);
|
|
25
|
+
* - the PC's Heroku CLI signed in as another account, so every deploy failed.
|
|
26
|
+
*
|
|
27
|
+
* Every 15 minutes the daemon looks (`makeWatchdog`) and, for each goal and delivery:
|
|
28
|
+
*
|
|
29
|
+
* 1. lists what has waited past the threshold (`WATCHDOG_STALLED_AFTER_MS`), with its code;
|
|
30
|
+
* 2. runs the SAFE remedy for what it knows — asks the hold's question again and releases the
|
|
31
|
+
* hold when the answer changed (an account free for every role, the AI tool ready, room on the
|
|
32
|
+
* disk, its own checkout cleaned — never a red base, see `causeGone`); sets aside what an earlier run left in a
|
|
33
|
+
* checkout LOOPLY MADE once it has stood unchanged and idle; delivers again a change whose push
|
|
34
|
+
* or pull request failed; reads the Heroku sign-in against what each environment needs;
|
|
35
|
+
* 3. says what it cannot fix ONCE, on the ticket, through the path every stall already takes
|
|
36
|
+
* (`stall.ts`: the hold's or the delivery's diagnosis, which AutoRyn puts on the ticket when it
|
|
37
|
+
* is due) — and only a wait nobody told the ticket about is told here;
|
|
38
|
+
* 4. records what it did in `.looply/state/watchdog.json`, which the feature report carries to
|
|
39
|
+
* AutoRyn (core `watchdog.ts`);
|
|
40
|
+
* 5. checks that what Looply REPORTED actually happened (`outcome-audit.ts`): a settled goal was
|
|
41
|
+
* delivered, Starts do work, a budget went on the goal, deliveries move.
|
|
42
|
+
*
|
|
43
|
+
* ⚠️ NEVER DESTRUCTIVE TO A PERSON'S WORK. Nothing here touches the project's own folder or a
|
|
44
|
+
* checkout a person made (`machineMadeCheckout`); a Looply checkout's changes are SAVED (a patch and
|
|
45
|
+
* the new files, `checkout-leftovers.ts`) before it is reset, and only when no run holds it. A hold
|
|
46
|
+
* released early costs nothing: a fault still there holds the goal again and counts from when it
|
|
47
|
+
* first began. Nothing here changes who may use which account, or spends a try.
|
|
48
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
49
|
+
*/
|
|
50
|
+
exports.WATCHDOG_FILE = 'watchdog.json';
|
|
51
|
+
/** A Looply checkout's changes must stand unchanged, with no run in it, this long before they are set aside. */
|
|
52
|
+
exports.CHECKOUT_SETTLE_MS = core_1.WATCHDOG_EVERY_MS;
|
|
53
|
+
/** How long an undelivered change waits between deliveries again, and how many it gets per commit. */
|
|
54
|
+
exports.DELIVERY_RETRY_MS = core_1.WATCHDOG_EVERY_MS;
|
|
55
|
+
exports.DELIVERY_RETRIES_MAX = 8;
|
|
56
|
+
/** A set-aside that failed is tried again after this, doubling each time it fails again (up to a day). */
|
|
57
|
+
exports.SET_ASIDE_BACKOFF_MS = core_1.WATCHDOG_EVERY_MS;
|
|
58
|
+
const SET_ASIDE_BACKOFF_MAX_MS = 24 * 60 * 60_000;
|
|
59
|
+
const SAID_MAX = 500;
|
|
60
|
+
/**
|
|
61
|
+
* A USAGE limit rests the account that met it (`markAccountResting`), so another free account is a
|
|
62
|
+
* real change. A rate limit, a 429 or "overloaded" rests nobody: those wait out their own retry.
|
|
63
|
+
*/
|
|
64
|
+
const USAGE_LIMIT = /\b(usage limit|limit will reset)\b/i;
|
|
65
|
+
const TRANSIENT_LIMIT = /\b(rate limit|rate-limited|429|overloaded)/i;
|
|
66
|
+
/** The wait the tick says when the AI tool cannot run (`providerHoldReason`). */
|
|
67
|
+
const PROVIDER_WAIT = /^the AI provider is not ready on this machine\b/;
|
|
68
|
+
/** A delivery that no pass advances, and that delivering again can move. */
|
|
69
|
+
const PUSH_FAILED = /\bgit push to origin failed\b/;
|
|
70
|
+
const NO_PULL_REQUEST = /\bno pull request could be opened\b/;
|
|
71
|
+
const empty = () => ({ version: 1, report: null, dirty: {}, said: [], retried: {}, logins: {}, failed: {}, waits: {}, told: [], audit: (0, outcome_audit_1.emptyAuditState)() });
|
|
72
|
+
function readState(stateDir) {
|
|
73
|
+
try {
|
|
74
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, exports.WATCHDOG_FILE), 'utf8'));
|
|
75
|
+
if (raw.version !== 1)
|
|
76
|
+
return empty();
|
|
77
|
+
const obj = (v) => (typeof v === 'object' && v !== null && !Array.isArray(v) ? v : {});
|
|
78
|
+
return {
|
|
79
|
+
version: 1,
|
|
80
|
+
report: (0, core_1.cleanWatchdogReport)(raw.report),
|
|
81
|
+
dirty: obj(raw.dirty),
|
|
82
|
+
said: Array.isArray(raw.said) ? raw.said.filter((s) => typeof s === 'string') : [],
|
|
83
|
+
retried: obj(raw.retried),
|
|
84
|
+
logins: obj(raw.logins),
|
|
85
|
+
failed: obj(raw.failed),
|
|
86
|
+
waits: obj(raw.waits),
|
|
87
|
+
told: Array.isArray(raw.told) ? raw.told.filter((s) => typeof s === 'string') : [],
|
|
88
|
+
audit: (0, outcome_audit_1.readAuditState)(raw.audit),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return empty();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function writeState(stateDir, state) {
|
|
96
|
+
(0, node_fs_1.mkdirSync)(stateDir, { recursive: true });
|
|
97
|
+
const target = (0, node_path_1.join)(stateDir, exports.WATCHDOG_FILE);
|
|
98
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
99
|
+
(0, node_fs_1.writeFileSync)(tmp, `${JSON.stringify(state, null, 2)}\n`, 'utf8');
|
|
100
|
+
(0, node_fs_1.renameSync)(tmp, target);
|
|
101
|
+
}
|
|
102
|
+
/** The last look, as AutoRyn is shown it; null before the first. */
|
|
103
|
+
function readWatchdogReport(stateDir) {
|
|
104
|
+
return readState(stateDir).report;
|
|
105
|
+
}
|
|
106
|
+
const safely = (f, fallback) => {
|
|
107
|
+
if (f === undefined)
|
|
108
|
+
return fallback;
|
|
109
|
+
try {
|
|
110
|
+
return f();
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return fallback;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Is the cause of this hold gone? The sentence saying how, or null while it stands (or when this
|
|
118
|
+
* kind of hold cannot be asked again here — a missing tool, a sandbox denial wait for a change).
|
|
119
|
+
*/
|
|
120
|
+
function causeGone(record, goalId, deps, accounts, cleaned) {
|
|
121
|
+
switch (record.code) {
|
|
122
|
+
case 'provider_limit': {
|
|
123
|
+
// Only a USAGE limit, which rested an account: a 429 or "overloaded" waits out its own short retry.
|
|
124
|
+
if (!USAGE_LIMIT.test(record.reason) || TRANSIENT_LIMIT.test(record.reason))
|
|
125
|
+
return null;
|
|
126
|
+
if (accounts === null || accounts.resting.length === 0)
|
|
127
|
+
return null;
|
|
128
|
+
const free = safely(deps.accountFree ? () => deps.accountFree(goalId) : undefined, null);
|
|
129
|
+
return free === null ? null : `the AI account "${free}" can take every part of its work now`;
|
|
130
|
+
}
|
|
131
|
+
case 'provider_unavailable':
|
|
132
|
+
return safely(deps.providerReady, null) === true ? 'the AI tool on this computer is ready again' : null;
|
|
133
|
+
case 'disk_full':
|
|
134
|
+
return safely(deps.diskProblem, undefined) === null ? 'there is room for a checkout again' : null;
|
|
135
|
+
/**
|
|
136
|
+
* ⚠️ A RED BASE IS NEVER RELEASED HERE. Its record (`base-health.json`) is one per project, of
|
|
137
|
+
* whatever tree the last check ran on — a dependency's tip, the goal's own earlier work, a person's
|
|
138
|
+
* HEAD — so no comparison from here tells whether THIS goal's tree changed, and a wrong guess
|
|
139
|
+
* restarts real checks every look. What can change it releases it already: a new Looply version
|
|
140
|
+
* and a changed check list (`decideEnvironmentHold`), the hold's own retry, and a person's "Re-run
|
|
141
|
+
* the base check" on the ticket. The watchdog only says it (with the files to leave out).
|
|
142
|
+
*/
|
|
143
|
+
case 'checkout_failed': {
|
|
144
|
+
// Only when THIS goal's checkout was the one cleaned: the hold names it.
|
|
145
|
+
const own = cleaned.find((p) => namesCheckout(record.reason, p));
|
|
146
|
+
return own === undefined ? null : `the changes an earlier run left in its checkout (${(0, node_path_1.basename)(own)}) were set aside`;
|
|
147
|
+
}
|
|
148
|
+
default:
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** Whether a hold's sentence names this checkout: its full path, or its folder name as a whole word. */
|
|
153
|
+
function namesCheckout(reason, path) {
|
|
154
|
+
const norm = (s) => s.replace(/\\/g, '/').toLowerCase();
|
|
155
|
+
if (norm(reason).includes(norm(path)))
|
|
156
|
+
return true;
|
|
157
|
+
const name = (0, node_path_1.basename)(path);
|
|
158
|
+
if (name.length < 4)
|
|
159
|
+
return false;
|
|
160
|
+
return new RegExp(`(^|[\\\\/\\s('"])${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}($|[\\\\/\\s)'",.:;])`, 'i').test(reason);
|
|
161
|
+
}
|
|
162
|
+
/** One look. Never throws for what it finds; a remedy that fails is said and left for the next look. */
|
|
163
|
+
async function watchdogPass(deps) {
|
|
164
|
+
const now = deps.now();
|
|
165
|
+
const at = new Date(now).toISOString();
|
|
166
|
+
const state = readState(deps.stateDir);
|
|
167
|
+
const said = new Set(state.said);
|
|
168
|
+
const once = (key) => {
|
|
169
|
+
if (said.has(key))
|
|
170
|
+
return false;
|
|
171
|
+
said.add(key);
|
|
172
|
+
return true;
|
|
173
|
+
};
|
|
174
|
+
const actions = [];
|
|
175
|
+
const act = (a) => {
|
|
176
|
+
actions.push({ at, ...a });
|
|
177
|
+
deps.log(`watchdog: ${a.goalId === null ? '' : `${a.goalId}: `}${a.said}${a.todo === null ? '' : ` — to do: ${a.todo}`}`);
|
|
178
|
+
};
|
|
179
|
+
const waiting = [];
|
|
180
|
+
const long = (since) => {
|
|
181
|
+
const t = typeof since === 'number' ? since : Date.parse(since);
|
|
182
|
+
return !Number.isNaN(t) && now - t >= core_1.WATCHDOG_STALLED_AFTER_MS;
|
|
183
|
+
};
|
|
184
|
+
// ── 1. checkouts Looply made, left with changes in them ──
|
|
185
|
+
const cleaned = [];
|
|
186
|
+
if (deps.checkouts !== undefined) {
|
|
187
|
+
const c = deps.checkouts;
|
|
188
|
+
const dirty = {};
|
|
189
|
+
// Kept across looks: a checkout a run took meanwhile, or not looked at this time, keeps its back-off.
|
|
190
|
+
const failed = { ...state.failed };
|
|
191
|
+
for (const path of safely(() => c.idle(), [])) {
|
|
192
|
+
// 🔴 NEVER A PERSON'S OWN FOLDER: not even read.
|
|
193
|
+
if (!safely(() => c.madeByLooply(path), false))
|
|
194
|
+
continue;
|
|
195
|
+
const changed = await c.changes(path).catch(() => null);
|
|
196
|
+
if (changed !== null && changed.length === 0)
|
|
197
|
+
delete failed[path];
|
|
198
|
+
if (changed === null || changed.length === 0)
|
|
199
|
+
continue;
|
|
200
|
+
const fingerprint = (0, node_crypto_1.createHash)('sha256').update([...changed].sort().join('\n')).digest('hex').slice(0, 16);
|
|
201
|
+
const prior = state.dirty[path];
|
|
202
|
+
const since = prior !== undefined && prior.fingerprint === fingerprint ? prior.since : at;
|
|
203
|
+
dirty[path] = { fingerprint, since };
|
|
204
|
+
// A run between its steps, or a person looking, has a moment: only changes that STOOD are set aside.
|
|
205
|
+
if (now - Date.parse(since) < exports.CHECKOUT_SETTLE_MS || safely(() => c.busy(path), true))
|
|
206
|
+
continue;
|
|
207
|
+
// A set-aside that failed on these same changes waits, doubling each time, before it is tried again.
|
|
208
|
+
const fail = state.failed[path];
|
|
209
|
+
if (fail !== undefined && fail.fingerprint === fingerprint) {
|
|
210
|
+
const wait = Math.min(exports.SET_ASIDE_BACKOFF_MS * 2 ** Math.max(0, fail.count - 1), SET_ASIDE_BACKOFF_MAX_MS);
|
|
211
|
+
if (now - Date.parse(fail.last) < wait)
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
const aside = await c.setAside(path);
|
|
216
|
+
if (aside === null)
|
|
217
|
+
continue;
|
|
218
|
+
cleaned.push(path);
|
|
219
|
+
delete dirty[path];
|
|
220
|
+
delete failed[path];
|
|
221
|
+
const named = aside.paths.slice(0, 3).join(', ') + (aside.paths.length > 3 ? ', …' : '');
|
|
222
|
+
act({
|
|
223
|
+
area: 'checkout',
|
|
224
|
+
outcome: 'fixed',
|
|
225
|
+
goalId: null,
|
|
226
|
+
code: null,
|
|
227
|
+
said: `a checkout Looply made (${(0, node_path_1.basename)(path)}) held ${aside.paths.length} changed file(s) an earlier run left (${named}); they were saved under the project's .looply/state/set-aside and the checkout is clean again`,
|
|
228
|
+
todo: null,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
catch (e) {
|
|
232
|
+
const count = fail !== undefined && fail.fingerprint === fingerprint ? fail.count + 1 : 1;
|
|
233
|
+
failed[path] = { fingerprint, last: at, count };
|
|
234
|
+
// Said once per set of changes; the retries after it are quiet.
|
|
235
|
+
if (once(`checkout-failed|${path}|${fingerprint}`)) {
|
|
236
|
+
act({
|
|
237
|
+
area: 'checkout',
|
|
238
|
+
outcome: 'alerted',
|
|
239
|
+
goalId: null,
|
|
240
|
+
code: null,
|
|
241
|
+
said: `a checkout Looply made (${(0, node_path_1.basename)(path)}) has changes an earlier run left, and they could not be set aside: ${e.message.slice(0, 160)}`,
|
|
242
|
+
todo: `look at ${(0, node_path_1.basename)(path)} in Looply's checkouts folder on this PC; Looply tries again by itself, less and less often`,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
state.dirty = dirty;
|
|
248
|
+
state.failed = failed;
|
|
249
|
+
}
|
|
250
|
+
// ── 2. goals held for a machine fault ──
|
|
251
|
+
const held = new Set();
|
|
252
|
+
for (const g of safely(() => deps.grants(), [])) {
|
|
253
|
+
if (g.state !== 'authorized')
|
|
254
|
+
continue;
|
|
255
|
+
const record = safely(() => deps.holdRecords.read(g.controllerId), null);
|
|
256
|
+
if (record === null || !safely(() => deps.holdRecords.stands(record, g.goalId), false))
|
|
257
|
+
continue;
|
|
258
|
+
held.add(g.goalId);
|
|
259
|
+
const since = record.firstSince ?? record.since;
|
|
260
|
+
const accounts = record.code === 'provider_limit' ? safely(deps.accounts ? () => deps.accounts(g.goalId) : undefined, null) : null;
|
|
261
|
+
const gone = causeGone(record, g.goalId, deps, accounts, cleaned);
|
|
262
|
+
if (gone !== null && safely(() => deps.holdRecords.release(g.controllerId), false)) {
|
|
263
|
+
act({ area: 'hold', outcome: 'fixed', goalId: g.goalId, code: record.code, said: `held (${(0, core_1.holdDetail)(record.reason).slice(0, 120)}); ${gone} — released, it is tried again now`, todo: null });
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const detail = (0, core_1.holdDetail)(record.reason);
|
|
267
|
+
if (!long(since))
|
|
268
|
+
continue;
|
|
269
|
+
waiting.push({ goalId: g.goalId, code: record.code, since, reason: detail || record.reason });
|
|
270
|
+
if (!once(`hold|${g.goalId}|${record.code}|${since}`))
|
|
271
|
+
continue;
|
|
272
|
+
// The ticket carries this diagnosis already (the tick tells it); this says what it says.
|
|
273
|
+
const redBase = record.code === 'gate_crashed' ? safely(deps.redBase, null) : null;
|
|
274
|
+
const d = (0, core_1.diagnoseHold)({ code: record.code, reason: record.reason }, since, { redBase, accounts });
|
|
275
|
+
// The account picture only when no account could take it: the same rule the ticket's diagnosis uses.
|
|
276
|
+
const blocked = accounts !== null && accounts.usable.length === 0 && (accounts.resting.length > 0 || accounts.refused.length > 0);
|
|
277
|
+
const picture = blocked
|
|
278
|
+
? ` Accounts — resting: ${accounts.resting.length > 0 ? (0, core_1.restingList)(accounts.resting) : 'none'}; refused for this ticket: ${accounts.refused.length > 0 ? (0, core_1.refusedList)(accounts.refused) : 'none'}.`
|
|
279
|
+
: '';
|
|
280
|
+
act({ area: blocked ? 'accounts' : 'hold', outcome: 'alerted', goalId: g.goalId, code: record.code, said: `${d.what}${picture}`, todo: d.fix });
|
|
281
|
+
}
|
|
282
|
+
// ── 3. waits nobody told the ticket about ──
|
|
283
|
+
const waits = safely(() => deps.waits(), new Map());
|
|
284
|
+
const seenWaits = {};
|
|
285
|
+
const toldNow = new Set();
|
|
286
|
+
for (const [goalId, w] of waits) {
|
|
287
|
+
const provider = PROVIDER_WAIT.test(w.because);
|
|
288
|
+
// A daemon that restarted began its clock again: the wait it saw before, of the same kind, began earlier.
|
|
289
|
+
const before = state.waits[goalId];
|
|
290
|
+
const sinceMs = before !== undefined && before.provider === provider ? Math.min(Date.parse(before.since), w.since) : w.since;
|
|
291
|
+
const since = new Date(sinceMs).toISOString();
|
|
292
|
+
seenWaits[goalId] = { since, provider };
|
|
293
|
+
if (held.has(goalId) || !long(sinceMs)) {
|
|
294
|
+
if (state.told.includes(goalId) && provider && !held.has(goalId))
|
|
295
|
+
toldNow.add(goalId);
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
waiting.push({ goalId, code: provider ? 'provider_unavailable' : null, since, reason: w.because });
|
|
299
|
+
// The AI tool cannot run: said on the ticket like a hold. Other waits (a dependency, a slot) are told already or are not stalls.
|
|
300
|
+
if (!provider || safely(deps.providerReady, null) === true || deps.tellHold === undefined)
|
|
301
|
+
continue;
|
|
302
|
+
toldNow.add(goalId);
|
|
303
|
+
if (!once(`wait|${goalId}|provider_unavailable|${since}`))
|
|
304
|
+
continue;
|
|
305
|
+
const reason = w.because.length > 300 ? `${w.because.slice(0, 299)}…` : w.because;
|
|
306
|
+
const d = (0, core_1.diagnoseHold)({ code: 'provider_unavailable', reason }, since);
|
|
307
|
+
safely(() => deps.tellHold(goalId, { code: 'provider_unavailable', reason, diagnosis: d }), undefined);
|
|
308
|
+
act({ area: 'wait', outcome: 'alerted', goalId, code: 'provider_unavailable', said: d.what, todo: d.fix });
|
|
309
|
+
}
|
|
310
|
+
// A goal told as waiting on the AI tool that now waits on something else (or no longer waits): the
|
|
311
|
+
// ticket's "Can't start yet" is cleared. A goal held meanwhile is told its hold by the tick itself.
|
|
312
|
+
for (const goalId of state.told) {
|
|
313
|
+
if (toldNow.has(goalId) || held.has(goalId))
|
|
314
|
+
continue;
|
|
315
|
+
safely(() => deps.untellHold?.(goalId, 'provider_unavailable'), undefined);
|
|
316
|
+
}
|
|
317
|
+
state.waits = seenWaits;
|
|
318
|
+
state.told = [...toldNow];
|
|
319
|
+
// ── 4. deliveries no pass moves ──
|
|
320
|
+
if (deps.deliveries !== undefined) {
|
|
321
|
+
const retried = {};
|
|
322
|
+
for (const e of safely(() => deps.deliveries.all(), [])) {
|
|
323
|
+
if (e.done === true)
|
|
324
|
+
continue;
|
|
325
|
+
const note = e.note ?? '';
|
|
326
|
+
const stuck = (e.state === 'not-pushed' && PUSH_FAILED.test(note)) || (e.state === 'pushed' && NO_PULL_REQUEST.test(note));
|
|
327
|
+
if (stuck) {
|
|
328
|
+
const prior = state.retried[e.goalId];
|
|
329
|
+
const r = prior !== undefined && prior.sha === e.sha ? prior : { sha: e.sha, count: 0, last: '' };
|
|
330
|
+
retried[e.goalId] = r;
|
|
331
|
+
const due = r.count < exports.DELIVERY_RETRIES_MAX && (r.last === '' || now - Date.parse(r.last) >= exports.DELIVERY_RETRY_MS) && now - Date.parse(e.updatedAt) >= exports.DELIVERY_RETRY_MS;
|
|
332
|
+
// 🔴 Still wanted? A ticket closed since (its goal abandoned) is never pushed or opened again.
|
|
333
|
+
const want = due && deps.deliveries.wanted !== undefined
|
|
334
|
+
? await deps.deliveries.wanted(e.goalId, e.sha).catch((err) => ({ wanted: false, because: err.message, retry: true, quiet: false }))
|
|
335
|
+
: { wanted: true };
|
|
336
|
+
if (!want.wanted && !want.retry && want.quiet !== true && once(`delivery-unwanted|${e.goalId}|${e.sha}`)) {
|
|
337
|
+
act({ area: 'delivery', outcome: 'alerted', goalId: e.goalId, code: e.state, said: `not delivered again: ${want.because.slice(0, 200)}`, todo: 'a person decides: deliver it by hand, or close the ticket' });
|
|
338
|
+
}
|
|
339
|
+
if (due && want.wanted) {
|
|
340
|
+
const report = await deps.deliveries.retry(e.goalId).catch((err) => {
|
|
341
|
+
deps.log(`watchdog: ${e.goalId}: delivering again failed — ${err.message}`);
|
|
342
|
+
return null;
|
|
343
|
+
});
|
|
344
|
+
retried[e.goalId] = { sha: e.sha, count: r.count + 1, last: at };
|
|
345
|
+
if (report !== null && report.state !== 'not-pushed' && report.state !== 'pushed') {
|
|
346
|
+
act({ area: 'delivery', outcome: 'fixed', goalId: e.goalId, code: e.state, said: `the finished change had not reached a pull request (${note.slice(0, 160)}); delivered again: ${report.state}${report.pullRequestUrl ? ` (${report.pullRequestUrl})` : ''}`, todo: null });
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
act({ area: 'delivery', outcome: 'noted', goalId: e.goalId, code: e.state, said: `delivered the finished change again (try ${r.count + 1} of ${exports.DELIVERY_RETRIES_MAX}); still ${report?.state ?? e.state}: ${(report?.note ?? note).slice(0, 200)}`, todo: null });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
const { diagnosis } = (0, branch_delivery_1.deliveryStall)(e, null, at);
|
|
353
|
+
if (diagnosis === null || !long(diagnosis.since))
|
|
354
|
+
continue;
|
|
355
|
+
waiting.push({ goalId: e.goalId, code: diagnosis.kind, since: diagnosis.since, reason: diagnosis.what });
|
|
356
|
+
// Said on the ticket by the delivery's own report (its `stall`); recorded here once.
|
|
357
|
+
if (once(`delivery|${e.goalId}|${diagnosis.kind}|${diagnosis.since}`)) {
|
|
358
|
+
act({ area: 'delivery', outcome: 'alerted', goalId: e.goalId, code: e.state, said: diagnosis.what, todo: diagnosis.fix });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
state.retried = retried;
|
|
362
|
+
}
|
|
363
|
+
// ── 5. the PC's sign-in to its deploy targets ──
|
|
364
|
+
if (deps.herokuLogins !== undefined) {
|
|
365
|
+
const facts = await deps.herokuLogins().catch(() => []);
|
|
366
|
+
for (const f of facts) {
|
|
367
|
+
const before = state.logins[f.environment];
|
|
368
|
+
if (f.signedInAs === null) {
|
|
369
|
+
if (once(`deploy_login|${f.environment}|unreadable`)) {
|
|
370
|
+
act({ area: 'deploy_login', outcome: 'alerted', goalId: null, code: null, said: `could not read which account this PC's Heroku CLI is signed in as (${f.because ?? 'no answer'}); deploys to ${f.app} (${f.environment}) need ${f.needs}`, todo: `install the Heroku CLI on this PC and sign it in as ${f.needs} (heroku login)` });
|
|
371
|
+
}
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
state.logins[f.environment] = f.signedInAs;
|
|
375
|
+
// Readable again: a later failure to read it is news again.
|
|
376
|
+
said.delete(`deploy_login|${f.environment}|unreadable`);
|
|
377
|
+
const right = f.signedInAs.toLowerCase() === f.needs.toLowerCase();
|
|
378
|
+
if (right) {
|
|
379
|
+
// Right again: a later switch is news again.
|
|
380
|
+
for (const k of [...said])
|
|
381
|
+
if (k.startsWith(`deploy_login|${f.environment}|`))
|
|
382
|
+
said.delete(k);
|
|
383
|
+
if (before !== undefined && before !== null && before.toLowerCase() !== f.needs.toLowerCase()) {
|
|
384
|
+
act({ area: 'deploy_login', outcome: 'fixed', goalId: null, code: null, said: `this PC's Heroku CLI is signed in as ${f.needs} again; deploys to ${f.app} (${f.environment}) go ahead, and a failed one is tried again by itself`, todo: null });
|
|
385
|
+
}
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
if (once(`deploy_login|${f.environment}|${f.signedInAs.toLowerCase()}`)) {
|
|
389
|
+
act({
|
|
390
|
+
area: 'deploy_login',
|
|
391
|
+
outcome: 'alerted',
|
|
392
|
+
goalId: null,
|
|
393
|
+
code: null,
|
|
394
|
+
said: `this PC's Heroku CLI is signed in as ${f.signedInAs}, but deploys to ${f.app} (${f.environment}) need ${f.needs}, so they would fail`,
|
|
395
|
+
todo: `sign this PC's Heroku CLI in as ${f.needs} (heroku login); Looply deploys again by itself once it is`,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// ── 6. what Looply reported, against what happened ──
|
|
401
|
+
if (deps.audit !== undefined) {
|
|
402
|
+
try {
|
|
403
|
+
state.audit = await (0, outcome_audit_1.auditOutcomes)(deps.audit, { now, at, once, act, log: deps.log }, state.audit);
|
|
404
|
+
}
|
|
405
|
+
catch (e) {
|
|
406
|
+
deps.log(`watchdog: the outcome check failed — ${e.message}`);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const report = {
|
|
410
|
+
at,
|
|
411
|
+
waiting: waiting.sort((a, b) => Date.parse(a.since) - Date.parse(b.since)).slice(0, core_1.WATCHDOG_WAITING_MAX),
|
|
412
|
+
actions: [...(state.report?.actions ?? []), ...actions].slice(-core_1.WATCHDOG_ACTIONS_MAX),
|
|
413
|
+
};
|
|
414
|
+
try {
|
|
415
|
+
writeState(deps.stateDir, { ...state, report, said: [...said].slice(-SAID_MAX) });
|
|
416
|
+
}
|
|
417
|
+
catch (e) {
|
|
418
|
+
deps.log(`watchdog: could not record this look (${e.message})`);
|
|
419
|
+
}
|
|
420
|
+
return report;
|
|
421
|
+
}
|
|
422
|
+
/** The daemon's handle: called on its five-minute cadence, it looks at most every 15 minutes. Never throws. */
|
|
423
|
+
function makeWatchdog(deps, every = core_1.WATCHDOG_EVERY_MS) {
|
|
424
|
+
let last = null;
|
|
425
|
+
let running = false;
|
|
426
|
+
return async () => {
|
|
427
|
+
const now = deps.now();
|
|
428
|
+
if (running || (last !== null && now - last < every))
|
|
429
|
+
return null;
|
|
430
|
+
running = true;
|
|
431
|
+
last = now;
|
|
432
|
+
try {
|
|
433
|
+
return await watchdogPass(deps);
|
|
434
|
+
}
|
|
435
|
+
catch (e) {
|
|
436
|
+
deps.log(`watchdog: this look failed — ${e.message}`);
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
finally {
|
|
440
|
+
running = false;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=watchdog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../src/watchdog.ts"],"names":[],"mappings":";;;AAwMA,gDAEC;AAwDD,oCAmPC;AAGD,oCAiBC;AAzgBD,6CAAyC;AACzC,qCAA6E;AAC7E,yCAA2C;AAC3C,uCAiBsB;AAEtB,uDAAsE;AAItE,mDAAyH;AAEzH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEU,QAAA,aAAa,GAAG,eAAe,CAAC;AAC7C,gHAAgH;AACnG,QAAA,kBAAkB,GAAG,wBAAiB,CAAC;AACpD,sGAAsG;AACzF,QAAA,iBAAiB,GAAG,wBAAiB,CAAC;AACtC,QAAA,oBAAoB,GAAG,CAAC,CAAC;AACtC,0GAA0G;AAC7F,QAAA,oBAAoB,GAAG,wBAAiB,CAAC;AACtD,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AAClD,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB;;;GAGG;AACH,MAAM,WAAW,GAAG,qCAAqC,CAAC;AAC1D,MAAM,eAAe,GAAG,6CAA6C,CAAC;AACtE,iFAAiF;AACjF,MAAM,aAAa,GAAG,iDAAiD,CAAC;AACxE,4EAA4E;AAC5E,MAAM,WAAW,GAAG,+BAA+B,CAAC;AACpD,MAAM,eAAe,GAAG,qCAAqC,CAAC;AAgF9D,MAAM,KAAK,GAAG,GAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,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,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAClE,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,GAAG,GAAG,CAAC;QACX,IAAI,CAAC;YACH,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,GAAG,CAAC,gCAAiC,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "looply-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.48",
|
|
4
4
|
"description": "Leave your coding agent running. looply picks the work, holds the rails, and proves every change before it is kept.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@looply/core": "0.5.
|
|
35
|
+
"@looply/core": "0.5.48",
|
|
36
36
|
"pdfjs-dist": "5.6.205",
|
|
37
|
-
"qrcode-terminal": "
|
|
38
|
-
"yaml": "
|
|
37
|
+
"qrcode-terminal": "0.12.0",
|
|
38
|
+
"yaml": "2.9.0"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"playwright-core": "1.63.0"
|