looply-cli 0.5.52 → 0.5.54
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/autonomy-controller.d.ts.map +1 -1
- package/dist/autonomy-controller.js +19 -0
- package/dist/autonomy-controller.js.map +1 -1
- package/dist/branch-delivery-wiring.d.ts +23 -0
- package/dist/branch-delivery-wiring.d.ts.map +1 -1
- package/dist/branch-delivery-wiring.js +189 -38
- package/dist/branch-delivery-wiring.js.map +1 -1
- package/dist/branch-delivery.d.ts +58 -1
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +242 -9
- package/dist/branch-delivery.js.map +1 -1
- package/dist/bug-repro.d.ts +99 -11
- package/dist/bug-repro.d.ts.map +1 -1
- package/dist/bug-repro.js +236 -15
- package/dist/bug-repro.js.map +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +53 -2
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/earlier-answers-cache.d.ts +71 -0
- package/dist/earlier-answers-cache.d.ts.map +1 -0
- package/dist/earlier-answers-cache.js +253 -0
- package/dist/earlier-answers-cache.js.map +1 -0
- package/dist/failing-checks-tick.d.ts +158 -0
- package/dist/failing-checks-tick.d.ts.map +1 -0
- package/dist/failing-checks-tick.js +313 -0
- package/dist/failing-checks-tick.js.map +1 -0
- package/dist/feature-report.d.ts +2 -0
- package/dist/feature-report.d.ts.map +1 -1
- package/dist/feature-report.js +19 -5
- package/dist/feature-report.js.map +1 -1
- package/dist/gate-health.d.ts +8 -0
- package/dist/gate-health.d.ts.map +1 -1
- package/dist/gate-health.js +13 -0
- package/dist/gate-health.js.map +1 -1
- package/dist/goal-adaptive.d.ts +56 -3
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +126 -12
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-already-met.d.ts +62 -0
- package/dist/goal-already-met.d.ts.map +1 -0
- package/dist/goal-already-met.js +95 -0
- package/dist/goal-already-met.js.map +1 -0
- package/dist/goal-execution-evidence.d.ts +7 -1
- package/dist/goal-execution-evidence.d.ts.map +1 -1
- package/dist/goal-execution-evidence.js +12 -1
- package/dist/goal-execution-evidence.js.map +1 -1
- package/dist/goal-gap.d.ts +63 -7
- package/dist/goal-gap.d.ts.map +1 -1
- package/dist/goal-gap.js +126 -18
- package/dist/goal-gap.js.map +1 -1
- package/dist/project-memory-store.d.ts +7 -0
- package/dist/project-memory-store.d.ts.map +1 -1
- package/dist/project-memory-store.js +31 -1
- package/dist/project-memory-store.js.map +1 -1
- package/dist/project-terminal.d.ts +1 -0
- package/dist/project-terminal.d.ts.map +1 -1
- package/dist/project-terminal.js +14 -2
- package/dist/project-terminal.js.map +1 -1
- package/dist/pursuit-ending.d.ts.map +1 -1
- package/dist/pursuit-ending.js +11 -0
- package/dist/pursuit-ending.js.map +1 -1
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +92 -6
- package/dist/run-cmd.js.map +1 -1
- package/dist/run-refusal-marks.d.ts +12 -0
- package/dist/run-refusal-marks.d.ts.map +1 -1
- package/dist/run-refusal-marks.js +22 -3
- package/dist/run-refusal-marks.js.map +1 -1
- package/dist/server-client.d.ts +32 -0
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +38 -0
- package/dist/server-client.js.map +1 -1
- package/dist/setup-check-wiring.d.ts +8 -0
- package/dist/setup-check-wiring.d.ts.map +1 -1
- package/dist/setup-check-wiring.js +61 -9
- package/dist/setup-check-wiring.js.map +1 -1
- package/dist/setup-check.d.ts +43 -1
- package/dist/setup-check.d.ts.map +1 -1
- package/dist/setup-check.js +125 -3
- package/dist/setup-check.js.map +1 -1
- package/dist/visual-proof-browser.d.ts +6 -0
- package/dist/visual-proof-browser.d.ts.map +1 -1
- package/dist/visual-proof-browser.js +16 -0
- package/dist/visual-proof-browser.js.map +1 -1
- package/dist/visual-proof-config.d.ts +10 -1
- package/dist/visual-proof-config.d.ts.map +1 -1
- package/dist/visual-proof-config.js +20 -2
- package/dist/visual-proof-config.js.map +1 -1
- package/dist/visual-proof-detect.d.ts +45 -3
- package/dist/visual-proof-detect.d.ts.map +1 -1
- package/dist/visual-proof-detect.js +60 -3
- package/dist/visual-proof-detect.js.map +1 -1
- package/dist/visual-proof-run.d.ts +8 -0
- package/dist/visual-proof-run.d.ts.map +1 -1
- package/dist/visual-proof-run.js +16 -6
- package/dist/visual-proof-run.js.map +1 -1
- package/package.json +2 -2
- package/win/contained-node.cjs +110 -1
- package/dist/.src-hash +0 -1
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EARLIER_ANSWERS_USED_FILE = exports.EARLIER_ANSWERS_FILE = void 0;
|
|
4
|
+
exports.readEarlierAnswersCache = readEarlierAnswersCache;
|
|
5
|
+
exports.makeEarlierAnswersPull = makeEarlierAnswersPull;
|
|
6
|
+
exports.rememberEarlierAnswers = rememberEarlierAnswers;
|
|
7
|
+
exports.earlierAnswerViews = earlierAnswerViews;
|
|
8
|
+
exports.earlierAnswersForPlan = earlierAnswersForPlan;
|
|
9
|
+
exports.usedAnswersFor = usedAnswersFor;
|
|
10
|
+
exports.rememberUsedAnswers = rememberUsedAnswers;
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
const core_1 = require("@looply/core");
|
|
14
|
+
const server_client_1 = require("./server-client");
|
|
15
|
+
/**
|
|
16
|
+
* WHAT PEOPLE ALREADY ANSWERED IN AUTORYN, AS THIS MACHINE LAST HEARD IT (`earlier-answers.json`).
|
|
17
|
+
*
|
|
18
|
+
* AutoRyn keeps the list per component — a person's answer to a question Looply asked, a reply correcting a reading
|
|
19
|
+
* Looply took, a rule the owner wrote — and pushes it to the server. The daemon pulls it on the five-minute cadence and
|
|
20
|
+
* at a person's Start; every run reads this file once, before it plans, and keeps the entries as project memory
|
|
21
|
+
* (`rememberEarlierAnswers`). A failed pull keeps the last list, so an offline machine uses what it was last told.
|
|
22
|
+
*
|
|
23
|
+
* 🔴 NO FILE IS NOT AN EMPTY LIST. An older server (no such route: 404) or a machine that never heard back leaves no
|
|
24
|
+
* file, and then memory is left exactly as it is — nothing is withdrawn on a guess. An empty list from the server is a
|
|
25
|
+
* real answer ("there is nothing"), and withdraws everything AutoRyn sent before.
|
|
26
|
+
*
|
|
27
|
+
* 🔴 THE LIST IS AUTORYN'S; THIS IS A COPY. Nothing a model writes reaches it: it comes from the server, is validated
|
|
28
|
+
* by core, and is written to memory as a `decision` with a human source by the runtime — a write `admitMemory` refuses
|
|
29
|
+
* to any model process.
|
|
30
|
+
*/
|
|
31
|
+
exports.EARLIER_ANSWERS_FILE = 'earlier-answers.json';
|
|
32
|
+
function readEarlierAnswersCache(stateDir) {
|
|
33
|
+
try {
|
|
34
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, exports.EARLIER_ANSWERS_FILE), 'utf8'));
|
|
35
|
+
const v = (0, core_1.validateEarlierAnswers)(raw['answers']);
|
|
36
|
+
if (!v.ok)
|
|
37
|
+
return null;
|
|
38
|
+
return {
|
|
39
|
+
answers: v.answers,
|
|
40
|
+
updatedAt: typeof raw['updatedAt'] === 'string' ? raw['updatedAt'] : null,
|
|
41
|
+
fetchedAt: typeof raw['fetchedAt'] === 'string' ? raw['fetchedAt'] : '',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One pull: ask the server, write the cache when the answer changed. Never throws. A server without the route (an
|
|
50
|
+
* older looply-api) answers 404: quietly nothing, and no file is written.
|
|
51
|
+
*/
|
|
52
|
+
function makeEarlierAnswersPull(deps) {
|
|
53
|
+
let failureReported = false;
|
|
54
|
+
const reportOnce = (why) => {
|
|
55
|
+
if (failureReported)
|
|
56
|
+
return;
|
|
57
|
+
failureReported = true;
|
|
58
|
+
deps.log(`answers : could not refresh what people already answered in AutoRyn — ${why}`);
|
|
59
|
+
};
|
|
60
|
+
return async () => {
|
|
61
|
+
let body;
|
|
62
|
+
try {
|
|
63
|
+
body = await deps.fetch();
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
if (e instanceof server_client_1.ServerError && e.status === 404)
|
|
67
|
+
return 'failed';
|
|
68
|
+
if (!(e instanceof server_client_1.ServerError && (e.isOffline || e.isAuth)))
|
|
69
|
+
reportOnce(e.message);
|
|
70
|
+
return 'failed';
|
|
71
|
+
}
|
|
72
|
+
const b = body;
|
|
73
|
+
if (typeof b !== 'object' || b === null || !Array.isArray(b.answers)) {
|
|
74
|
+
reportOnce('the server answered with something that is not a list of answers');
|
|
75
|
+
return 'failed';
|
|
76
|
+
}
|
|
77
|
+
const v = (0, core_1.validateEarlierAnswers)(b.answers);
|
|
78
|
+
if (!v.ok) {
|
|
79
|
+
reportOnce(v.because);
|
|
80
|
+
return 'failed';
|
|
81
|
+
}
|
|
82
|
+
failureReported = false;
|
|
83
|
+
const updatedAt = typeof b.updatedAt === 'string' ? b.updatedAt : null;
|
|
84
|
+
const before = readEarlierAnswersCache(deps.stateDir);
|
|
85
|
+
if (before !== null && JSON.stringify(before.answers) === JSON.stringify(v.answers) && before.updatedAt === updatedAt)
|
|
86
|
+
return 'unchanged';
|
|
87
|
+
try {
|
|
88
|
+
(0, node_fs_1.mkdirSync)(deps.stateDir, { recursive: true });
|
|
89
|
+
const target = (0, node_path_1.join)(deps.stateDir, exports.EARLIER_ANSWERS_FILE);
|
|
90
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
91
|
+
(0, node_fs_1.writeFileSync)(tmp, JSON.stringify({ answers: v.answers, updatedAt, fetchedAt: new Date(deps.now()).toISOString() }, null, 2) + '\n', 'utf8');
|
|
92
|
+
(0, node_fs_1.renameSync)(tmp, target);
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
deps.log(`answers : could not write the earlier answers (${e.message})`);
|
|
96
|
+
return 'failed';
|
|
97
|
+
}
|
|
98
|
+
const live = v.answers.filter((a) => a.off !== true).length;
|
|
99
|
+
deps.log(`answers : ${live} earlier answer(s) from AutoRyn${v.skipped > 0 ? ` (${v.skipped} this Looply cannot read)` : ''}`);
|
|
100
|
+
return 'updated';
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const VIA = 'earlier-answer';
|
|
104
|
+
/** What a live entry is, for "is it still on the list": its words and its standing. */
|
|
105
|
+
const liveKey = (subject, content, standing) => `${subject}\u0000${content}\u0000${standing}`;
|
|
106
|
+
/**
|
|
107
|
+
* KEEP THE LIST AS PROJECT MEMORY, AND WITHDRAW WHAT AUTORYN NO LONGER HOLDS — the same shape as the config's
|
|
108
|
+
* decisions (`run-cmd.ts` `rememberHumanDecisions`), on its own channel.
|
|
109
|
+
*
|
|
110
|
+
* - each entry that is on (not `off`) is a `decision`, `source: 'human'` — a person said it, through AutoRyn — with
|
|
111
|
+
* who, when and which ticket on its provenance, and whether it is the owner's rule or what one person said once;
|
|
112
|
+
* - every earlier answer memory holds that is gone from the list, or switched off, is withdrawn by APPENDING a
|
|
113
|
+
* withdrawal, never by deleting (what the project used to hold is part of how it came to hold what it does).
|
|
114
|
+
*
|
|
115
|
+
* Withdrawals first, then the writes, so a list replaced wholesale never holds old and new at once. Only records that
|
|
116
|
+
* came through this channel are touched: the config's decisions are the config's.
|
|
117
|
+
*
|
|
118
|
+
* `cache` null (never heard, or an older server): nothing is written and nothing is withdrawn. Returns what it did.
|
|
119
|
+
*/
|
|
120
|
+
async function rememberEarlierAnswers(store, cache, projectKey) {
|
|
121
|
+
const done = { remembered: 0, withdrawn: 0 };
|
|
122
|
+
if (store === null || cache === null)
|
|
123
|
+
return done;
|
|
124
|
+
const live = cache.answers.filter((a) => a.off !== true);
|
|
125
|
+
const keep = new Set(live.map((a) => liveKey(a.question, a.answer, (0, core_1.answerStandingOf)(a.origin))));
|
|
126
|
+
/**
|
|
127
|
+
* Every standing record of this channel, read from the whole history rather than through `current()`: `current()`
|
|
128
|
+
* is bounded per kind, and a record past that bound would never be withdrawn — it would only stop being shown until
|
|
129
|
+
* the bound moved, and then come back.
|
|
130
|
+
*/
|
|
131
|
+
const history = store.history();
|
|
132
|
+
const retired = new Set(history.flatMap((r) => (r.supersedes === undefined ? [] : [r.supersedes])));
|
|
133
|
+
const standing = history.filter((r) => r.kind === 'decision' && r.provenance.via === VIA && r.withdrawn !== true && !retired.has(r.id));
|
|
134
|
+
for (const r of standing) {
|
|
135
|
+
if (keep.has(liveKey(r.subject, r.content, r.provenance.earlier?.standing ?? 'precedent')))
|
|
136
|
+
continue;
|
|
137
|
+
const w = await store.remember({
|
|
138
|
+
kind: 'decision',
|
|
139
|
+
source: 'human',
|
|
140
|
+
subject: r.subject,
|
|
141
|
+
// Names the record it retires, so two withdrawals of one question are two records, not one.
|
|
142
|
+
content: `withdrawn in AutoRyn (${r.id})`,
|
|
143
|
+
provenance: { via: VIA, refs: [r.id], actor: 'autoryn', note: 'switched off or removed in AutoRyn' },
|
|
144
|
+
scope: { projectKey },
|
|
145
|
+
supersedes: r.id,
|
|
146
|
+
withdrawn: true,
|
|
147
|
+
}, false);
|
|
148
|
+
if (w.ok)
|
|
149
|
+
done.withdrawn += 1;
|
|
150
|
+
}
|
|
151
|
+
for (const a of live) {
|
|
152
|
+
const standingNow = (0, core_1.answerStandingOf)(a.origin);
|
|
153
|
+
const r = await store.remember({
|
|
154
|
+
kind: 'decision',
|
|
155
|
+
// A person said it. The runtime knows it came from the server's copy of AutoRyn's list, never from a model.
|
|
156
|
+
source: 'human',
|
|
157
|
+
subject: a.question,
|
|
158
|
+
content: a.answer,
|
|
159
|
+
provenance: {
|
|
160
|
+
via: VIA,
|
|
161
|
+
refs: [`autoryn:${a.id}`, ...(a.ticket?.key === undefined ? [] : [a.ticket.key])],
|
|
162
|
+
actor: a.by ?? 'a person, through AutoRyn',
|
|
163
|
+
note: standingNow === 'rule' ? "the owner's rule, through AutoRyn" : 'a person, through AutoRyn',
|
|
164
|
+
earlier: {
|
|
165
|
+
id: a.id,
|
|
166
|
+
standing: standingNow,
|
|
167
|
+
...(a.by === undefined ? {} : { by: a.by }),
|
|
168
|
+
...(a.at === undefined ? {} : { at: a.at }),
|
|
169
|
+
...(a.ticket?.key === undefined ? {} : { ticket: a.ticket.key }),
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
scope: { projectKey },
|
|
173
|
+
}, false);
|
|
174
|
+
if (r.ok)
|
|
175
|
+
done.remembered += 1;
|
|
176
|
+
}
|
|
177
|
+
return done;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The earlier answers memory holds now, as the prompts show them: the owner's rules first, then what people said,
|
|
181
|
+
* newest first; numbered A1, A2, … in that order.
|
|
182
|
+
*/
|
|
183
|
+
function earlierAnswerViews(store) {
|
|
184
|
+
if (store === null)
|
|
185
|
+
return [];
|
|
186
|
+
const records = store.current(null, { kind: 'decision', via: VIA });
|
|
187
|
+
const ordered = [...records].sort((a, b) => {
|
|
188
|
+
const ra = a.provenance.earlier?.standing === 'rule' ? 0 : 1;
|
|
189
|
+
const rb = b.provenance.earlier?.standing === 'rule' ? 0 : 1;
|
|
190
|
+
if (ra !== rb)
|
|
191
|
+
return ra - rb;
|
|
192
|
+
const ta = a.provenance.earlier?.at ?? a.recordedAt;
|
|
193
|
+
const tb = b.provenance.earlier?.at ?? b.recordedAt;
|
|
194
|
+
return ta < tb ? 1 : ta > tb ? -1 : a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
195
|
+
});
|
|
196
|
+
return ordered.map((r, i) => {
|
|
197
|
+
const e = r.provenance.earlier;
|
|
198
|
+
return {
|
|
199
|
+
ref: `A${i + 1}`,
|
|
200
|
+
question: r.subject,
|
|
201
|
+
answer: r.content,
|
|
202
|
+
standing: e?.standing ?? 'precedent',
|
|
203
|
+
...(e?.by === undefined ? {} : { by: e.by }),
|
|
204
|
+
...(e?.at === undefined ? {} : { at: e.at }),
|
|
205
|
+
...(e?.ticket === undefined ? {} : { ticketKey: e.ticket }),
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** The block the planner and the implementer get beside the rest of memory, or null when there is none. */
|
|
210
|
+
function earlierAnswersForPlan(views) {
|
|
211
|
+
const block = (0, core_1.earlierAnswersBlock)(views);
|
|
212
|
+
return block.length === 0 ? null : block.join('\n');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* THE EARLIER ANSWERS AN `incomplete` GOAL CHECK RELIED ON, KEPT UNTIL THE GOAL IS DELIVERED (review, 2026-11-17).
|
|
216
|
+
* The check that found work missing named them, a plan followed, and the check that later found the goal met may not
|
|
217
|
+
* name them again — so they are kept per goal version, beside the project's other state, and said with the delivery
|
|
218
|
+
* (`carryUsed`). Best effort: a file that cannot be read or written costs the sentence, never the run.
|
|
219
|
+
*/
|
|
220
|
+
exports.EARLIER_ANSWERS_USED_FILE = 'earlier-answers-used.json';
|
|
221
|
+
const MAX_USED_KEPT = 10;
|
|
222
|
+
function readUsedFile(stateDir) {
|
|
223
|
+
try {
|
|
224
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, exports.EARLIER_ANSWERS_USED_FILE), 'utf8'));
|
|
225
|
+
return typeof raw === 'object' && raw !== null && !Array.isArray(raw) ? raw : {};
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return {};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/** The notes kept for this goal version (none for another version: an edited goal is judged afresh). */
|
|
232
|
+
function usedAnswersFor(stateDir, goalId, goalVersion) {
|
|
233
|
+
const e = readUsedFile(stateDir)[goalId];
|
|
234
|
+
return e !== undefined && e.version === goalVersion && Array.isArray(e.used) ? e.used.filter((u) => typeof u === 'string') : [];
|
|
235
|
+
}
|
|
236
|
+
function rememberUsedAnswers(stateDir, goalId, goalVersion, used) {
|
|
237
|
+
if (used.length === 0)
|
|
238
|
+
return;
|
|
239
|
+
try {
|
|
240
|
+
const all = readUsedFile(stateDir);
|
|
241
|
+
const had = usedAnswersFor(stateDir, goalId, goalVersion);
|
|
242
|
+
all[goalId] = { version: goalVersion, used: [...new Set([...had, ...used])].slice(0, MAX_USED_KEPT) };
|
|
243
|
+
(0, node_fs_1.mkdirSync)(stateDir, { recursive: true });
|
|
244
|
+
const target = (0, node_path_1.join)(stateDir, exports.EARLIER_ANSWERS_USED_FILE);
|
|
245
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
246
|
+
(0, node_fs_1.writeFileSync)(tmp, JSON.stringify(all, null, 2) + '\n', 'utf8');
|
|
247
|
+
(0, node_fs_1.renameSync)(tmp, target);
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
/* the sentence is lost, nothing else */
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=earlier-answers-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earlier-answers-cache.js","sourceRoot":"","sources":["../src/earlier-answers-cache.ts"],"names":[],"mappings":";;;AAqCA,0DAaC;AAMD,wDAiDC;AAoBD,wDAkEC;AAMD,gDAuBC;AAGD,sDAGC;AAuBD,wCAGC;AAED,kDAcC;AA5QD,qCAA6E;AAC7E,yCAAiC;AACjC,uCAMsB;AAEtB,mDAA8C;AAE9C;;;;;;;;;;;;;;;GAeG;AAEU,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAQ3D,SAAgB,uBAAuB,CAAC,QAAgB;IACtD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,4BAAoB,CAAC,EAAE,MAAM,CAAC,CAA4B,CAAC;QAC9G,MAAM,CAAC,GAAG,IAAA,6BAAsB,EAAC,GAAG,CAAC,SAAS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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClI,CAAC;AAED,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,MAAc,EAAE,WAAmB,EAAE,IAAuB;IAChH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC9B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAC1D,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC;QACtG,IAAA,mBAAS,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,IAAA,gBAAI,EAAC,QAAQ,EAAE,iCAAyB,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;QAC3C,IAAA,uBAAa,EAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QAChE,IAAA,oBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;IAC1C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { type MaintenanceItem } from '@looply/core';
|
|
2
|
+
import { type BaseHealth } from './gate-health';
|
|
3
|
+
import type { SetupVerdict } from './setup-check';
|
|
4
|
+
/**
|
|
5
|
+
* "THE TESTS ON MAIN ARE FAILING" BECOMES ONE PROPOSAL — on solid evidence, and never twice.
|
|
6
|
+
*
|
|
7
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
8
|
+
* 🔴 WHY (owner, 2026-11-16: Looply finds the work itself, without ever flooding the board). The
|
|
9
|
+
* setup check already runs each served repository's checks on its unchanged base — when it is
|
|
10
|
+
* first served, when the base moves, at most 8 full checks per PC per day — and a red answer
|
|
11
|
+
* reached only the setup card. This reads what that check wrote (`setup-base-verdict.json`, see
|
|
12
|
+
* `setup-check.ts`) and runs nothing itself: it costs no extra base check.
|
|
13
|
+
*
|
|
14
|
+
* WHAT COUNTS (each rule is a way a false ticket was possible):
|
|
15
|
+
* - a REQUIRED step red on the unchanged base (`deliveryRequired`): an optional lint step is not
|
|
16
|
+
* a defect anyone asked to be held to;
|
|
17
|
+
* - never the machine's failure: a step that could not run or timed out (its state), the sandbox
|
|
18
|
+
* or a missing tool (`classifyGateCrash`), a database the sandbox cannot start
|
|
19
|
+
* (`missingService`) — `machineFault` on the verdict. Such a check says nothing about the code:
|
|
20
|
+
* it neither counts nor breaks a run of red checks;
|
|
21
|
+
* - the SAME failures (the same failing test files, or the same step when it names none) on TWO
|
|
22
|
+
* base checks in a row, the second on the same or a later commit of the base. A flake is red
|
|
23
|
+
* once; a branch force-pushed back is not "later";
|
|
24
|
+
* - and, because the setup check installs without the packages' install scripts, confirmed by a goal's own
|
|
25
|
+
* base check or by the repository's CI before anything is proposed (`evidenceFor`).
|
|
26
|
+
*
|
|
27
|
+
* ONE PROBLEM, ONE PROPOSAL: the key is the failures' digest (`failingChecksKey`) and the week is
|
|
28
|
+
* the week they were first seen, so however long they stay red it is the same proposal, refreshed.
|
|
29
|
+
* When the base is green again, the open proposal is superseded (`item: null`).
|
|
30
|
+
*
|
|
31
|
+
* ⚠️ BEHIND THE MAINTENANCE SWITCH. Proposed only while the project's maintenance setting is on
|
|
32
|
+
* (AutoRyn's per-component switch, off by default); the evidence is still collected while it is off,
|
|
33
|
+
* so turning it on proposes at once what two checks already found.
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ AN OLDER SERVER. The proposal goes to its own route, which an older looply-api does not have:
|
|
36
|
+
* it answers 404, nothing is recorded, and it is tried again later — never the weekly-plan route,
|
|
37
|
+
* whose "supersede everything else open" would have closed the week's maintenance proposals.
|
|
38
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
*/
|
|
40
|
+
export declare const FAILING_CHECKS_STATE_FILE = "failing-checks-state.json";
|
|
41
|
+
/** The red base checks in a row with the same failures. */
|
|
42
|
+
export interface FailingStreak {
|
|
43
|
+
key: string;
|
|
44
|
+
step: string;
|
|
45
|
+
tests: string[];
|
|
46
|
+
testCount: number;
|
|
47
|
+
branch: string | null;
|
|
48
|
+
since: string;
|
|
49
|
+
firstSha: string;
|
|
50
|
+
lastSha: string;
|
|
51
|
+
checkedAt: string;
|
|
52
|
+
checks: number;
|
|
53
|
+
excerpt: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface FailingChecksState {
|
|
56
|
+
version: 1;
|
|
57
|
+
/** The verdict last read (its `checkedAt`), so one setup check is counted once. */
|
|
58
|
+
lastVerdictAt: string | null;
|
|
59
|
+
streak: FailingStreak | null;
|
|
60
|
+
/** What the server last accepted from here: an open proposal for this key and week. */
|
|
61
|
+
proposed: {
|
|
62
|
+
key: string;
|
|
63
|
+
week: string;
|
|
64
|
+
} | null;
|
|
65
|
+
/** What is still to be sent. */
|
|
66
|
+
pending: 'propose' | 'clear' | null;
|
|
67
|
+
lastFailureAt: number | null;
|
|
68
|
+
lastFailure: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* What confirmed the streak's failures beside the setup check (`evidenceFor`), for its key: a goal's own base
|
|
71
|
+
* check, or the repository's CI. Absent in a state an older Looply wrote: asked for again.
|
|
72
|
+
*/
|
|
73
|
+
evidence?: {
|
|
74
|
+
key: string;
|
|
75
|
+
by: 'run' | 'ci';
|
|
76
|
+
sha: string;
|
|
77
|
+
} | null;
|
|
78
|
+
/** When the repository's CI was last asked and did not confirm (ms), so it is asked at most every 30 minutes. */
|
|
79
|
+
ciAskedAt?: number | null;
|
|
80
|
+
}
|
|
81
|
+
export declare function readFailingChecksState(stateDir: string): FailingChecksState;
|
|
82
|
+
/** What one setup check says for this purpose. */
|
|
83
|
+
export type VerdictReading = {
|
|
84
|
+
kind: 'red';
|
|
85
|
+
step: string;
|
|
86
|
+
tests: string[];
|
|
87
|
+
testCount: number;
|
|
88
|
+
excerpt: string | null;
|
|
89
|
+
} | {
|
|
90
|
+
kind: 'green';
|
|
91
|
+
}
|
|
92
|
+
/** Says nothing about the code: neither counts nor breaks a run of red checks. */
|
|
93
|
+
| {
|
|
94
|
+
kind: 'none';
|
|
95
|
+
because: string;
|
|
96
|
+
};
|
|
97
|
+
/** The plain branch name of a base ref ("refs/remotes/origin/main" → "main"), or null. */
|
|
98
|
+
export declare function branchOf(ref: string): string | null;
|
|
99
|
+
export declare function readVerdict(v: SetupVerdict): VerdictReading;
|
|
100
|
+
/**
|
|
101
|
+
* One verdict read into the state. Pure but for `isSameOrLater` (git ancestry). A verdict already read
|
|
102
|
+
* changes nothing.
|
|
103
|
+
*/
|
|
104
|
+
export declare function observeVerdict(state: FailingChecksState, verdict: SetupVerdict | null, isSameOrLater: (earlier: string, later: string) => Promise<boolean>): Promise<{
|
|
105
|
+
state: FailingChecksState;
|
|
106
|
+
reading: VerdictReading | null;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* 🔴 WHAT CONFIRMS A RED SETUP CHECK (review, 2026-11-17). The setup check installs the dependencies WITHOUT
|
|
110
|
+
* the packages' install scripts (`setup-check.ts`), and its own card says a red answer there is "not kept for
|
|
111
|
+
* runs". A run's install runs those scripts: a repository whose tests import a generated client (a Prisma
|
|
112
|
+
* `postinstall`) is red in the setup check and green in every run and in its own CI. Two such setup checks
|
|
113
|
+
* filed "N test files fail on main" while main was green — and the goal made of it was let run on its red
|
|
114
|
+
* base and asked to fix what was not broken. So the setup check's streak is only ever proposed with one of:
|
|
115
|
+
* - a goal's OWN base check (`base-health.json`, `by: 'run'`, `run-cmd.ts`) of a commit the streak saw,
|
|
116
|
+
* red with the same failures — dependencies installed the way runs install them. Free: it is a file;
|
|
117
|
+
* - the repository's own CI red on the streak's latest commit, when it can be read (GitHub checks and
|
|
118
|
+
* statuses with this PC's GitHub login). One read per commit, again at most every 30 minutes.
|
|
119
|
+
* Neither runs a check: the daily cap on full base checks is untouched. Without either, nothing is proposed
|
|
120
|
+
* and the card's red stays a setup line; a repository nobody runs goals in, with no readable CI, is not filed.
|
|
121
|
+
*/
|
|
122
|
+
export declare function evidenceFor(streak: FailingStreak, run: BaseHealth | null, isSameOrLater: (earlier: string, later: string) => Promise<boolean>): Promise<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* The repository's CI on one commit, from its checks and statuses (`GitHubApi.checksFor`): red when any of them
|
|
125
|
+
* failed, green when every one passed, unknown when there are none or some still run.
|
|
126
|
+
*/
|
|
127
|
+
export declare function ciVerdictOf(checks: ReadonlyArray<{
|
|
128
|
+
state: 'success' | 'failure' | 'pending';
|
|
129
|
+
}>): 'red' | 'green' | 'unknown';
|
|
130
|
+
/** The proposal a streak makes: the week it was first seen, and the item. */
|
|
131
|
+
export declare function proposalOf(streak: FailingStreak): {
|
|
132
|
+
week: string;
|
|
133
|
+
item: MaintenanceItem;
|
|
134
|
+
};
|
|
135
|
+
export interface FailingChecksTickDeps {
|
|
136
|
+
stateDir: string;
|
|
137
|
+
/** The setup check's last verdict (`readSetupVerdict`), or null. */
|
|
138
|
+
verdict(): SetupVerdict | null;
|
|
139
|
+
/** The last base check of this repository (`readBaseHealth`): a goal's own (`by: 'run'`) confirms a streak. */
|
|
140
|
+
runCheck(): BaseHealth | null;
|
|
141
|
+
/** The repository's own CI on a commit: red, green, or unknown (not readable, nothing reported, still running). */
|
|
142
|
+
ciOn(sha: string): Promise<'red' | 'green' | 'unknown'>;
|
|
143
|
+
/** True when `later` is `earlier` or a commit after it on the base (git ancestry). */
|
|
144
|
+
isSameOrLater(earlier: string, later: string): Promise<boolean>;
|
|
145
|
+
/** The project's maintenance switch, as this machine last heard it. */
|
|
146
|
+
maintenanceOn(): boolean;
|
|
147
|
+
/** `POST /v1/projects/:id/maintenance/failing-checks`. */
|
|
148
|
+
send(body: {
|
|
149
|
+
week: string;
|
|
150
|
+
item: MaintenanceItem | null;
|
|
151
|
+
}): Promise<unknown>;
|
|
152
|
+
log(line: string): void;
|
|
153
|
+
now(): number;
|
|
154
|
+
}
|
|
155
|
+
export type FailingChecksOutcome = 'idle' | 'waiting' | 'off' | 'unconfirmed' | 'proposed' | 'cleared' | 'failed';
|
|
156
|
+
/** One cadence: read a new verdict, send what is due. Never throws. */
|
|
157
|
+
export declare function makeFailingChecksTick(deps: FailingChecksTickDeps): () => Promise<FailingChecksOutcome>;
|
|
158
|
+
//# sourceMappingURL=failing-checks-tick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failing-checks-tick.d.ts","sourceRoot":"","sources":["../src/failing-checks-tick.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAGrE,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QA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