looply-cli 0.5.3 → 0.5.5
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/agent-exec.d.ts +10 -5
- package/dist/agent-exec.d.ts.map +1 -1
- package/dist/agent-exec.js.map +1 -1
- package/dist/autonomy-controller.d.ts +14 -1
- package/dist/autonomy-controller.d.ts.map +1 -1
- package/dist/autonomy-controller.js +55 -2
- package/dist/autonomy-controller.js.map +1 -1
- package/dist/autonomy-store.d.ts +35 -2
- package/dist/autonomy-store.d.ts.map +1 -1
- package/dist/autonomy-store.js +27 -2
- package/dist/autonomy-store.js.map +1 -1
- package/dist/autonomy-tick.d.ts +25 -2
- package/dist/autonomy-tick.d.ts.map +1 -1
- package/dist/autonomy-tick.js +145 -4
- package/dist/autonomy-tick.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +112 -82
- package/dist/bin.js.map +1 -1
- package/dist/checkout-carry.d.ts.map +1 -1
- package/dist/checkout-carry.js +12 -0
- package/dist/checkout-carry.js.map +1 -1
- package/dist/config.d.ts +41 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +64 -8
- package/dist/config.js.map +1 -1
- package/dist/coordinator-state.d.ts +14 -0
- package/dist/coordinator-state.d.ts.map +1 -1
- package/dist/coordinator-state.js +29 -0
- package/dist/coordinator-state.js.map +1 -1
- package/dist/daemon-cmd.d.ts +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +69 -33
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/daemon.d.ts +15 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +21 -3
- package/dist/daemon.js.map +1 -1
- package/dist/git-driver.d.ts +6 -0
- package/dist/git-driver.d.ts.map +1 -1
- package/dist/git-driver.js +12 -0
- package/dist/git-driver.js.map +1 -1
- package/dist/index-for-head.js +1 -1
- package/dist/index-for-head.js.map +1 -1
- package/dist/init-detect.d.ts.map +1 -1
- package/dist/init-detect.js +1 -1
- package/dist/init-detect.js.map +1 -1
- package/dist/machine-run-slots.d.ts +59 -0
- package/dist/machine-run-slots.d.ts.map +1 -0
- package/dist/machine-run-slots.js +140 -0
- package/dist/machine-run-slots.js.map +1 -0
- package/dist/model-routing.d.ts +52 -7
- package/dist/model-routing.d.ts.map +1 -1
- package/dist/model-routing.js +84 -14
- package/dist/model-routing.js.map +1 -1
- package/dist/model-settings.d.ts +67 -0
- package/dist/model-settings.d.ts.map +1 -0
- package/dist/model-settings.js +177 -0
- package/dist/model-settings.js.map +1 -0
- package/dist/model-transport.d.ts +8 -0
- package/dist/model-transport.d.ts.map +1 -1
- package/dist/model-transport.js +6 -3
- package/dist/model-transport.js.map +1 -1
- package/dist/programme-mode.d.ts +6 -0
- package/dist/programme-mode.d.ts.map +1 -1
- package/dist/programme-mode.js +23 -0
- package/dist/programme-mode.js.map +1 -1
- package/dist/project-index-store.d.ts +19 -1
- package/dist/project-index-store.d.ts.map +1 -1
- package/dist/project-index-store.js +40 -5
- package/dist/project-index-store.js.map +1 -1
- package/dist/project-terminal.d.ts +25 -0
- package/dist/project-terminal.d.ts.map +1 -0
- package/dist/project-terminal.js +46 -0
- package/dist/project-terminal.js.map +1 -0
- package/dist/provider-cmd.d.ts +13 -4
- package/dist/provider-cmd.d.ts.map +1 -1
- package/dist/provider-cmd.js +111 -11
- package/dist/provider-cmd.js.map +1 -1
- package/dist/provider-ready.d.ts +15 -2
- package/dist/provider-ready.d.ts.map +1 -1
- package/dist/provider-ready.js +46 -2
- package/dist/provider-ready.js.map +1 -1
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +4 -0
- package/dist/providers.js.map +1 -1
- package/dist/pursuit-ending.d.ts +57 -0
- package/dist/pursuit-ending.d.ts.map +1 -0
- package/dist/pursuit-ending.js +128 -0
- package/dist/pursuit-ending.js.map +1 -0
- package/dist/run-base.d.ts +84 -0
- package/dist/run-base.d.ts.map +1 -0
- package/dist/run-base.js +142 -0
- package/dist/run-base.js.map +1 -0
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +46 -5
- package/dist/run-cmd.js.map +1 -1
- package/dist/run-ended.d.ts +16 -0
- package/dist/run-ended.d.ts.map +1 -1
- package/dist/run-ended.js +30 -0
- package/dist/run-ended.js.map +1 -1
- package/dist/run-ending-locator.d.ts +10 -0
- package/dist/run-ending-locator.d.ts.map +1 -1
- package/dist/run-ending-locator.js +45 -0
- package/dist/run-ending-locator.js.map +1 -1
- package/dist/run-launcher.d.ts +30 -1
- package/dist/run-launcher.d.ts.map +1 -1
- package/dist/run-launcher.js +60 -2
- package/dist/run-launcher.js.map +1 -1
- package/dist/server-client.d.ts +16 -2
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +9 -0
- package/dist/server-client.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +17 -0
- package/dist/setup.js.map +1 -1
- package/dist/workspace-provisioner.d.ts +2 -0
- package/dist/workspace-provisioner.d.ts.map +1 -1
- package/dist/workspace-provisioner.js +27 -1
- package/dist/workspace-provisioner.js.map +1 -1
- package/package.json +54 -54
- package/win/HandleProbe.cs +116 -116
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPILE_REFUSED_NOTE = exports.COMPILE_EMPTY_NOTE = void 0;
|
|
4
|
+
exports.describePursuitEnding = describePursuitEnding;
|
|
5
|
+
const core_1 = require("@looply/core");
|
|
6
|
+
/**
|
|
7
|
+
* WHY A PURSUIT ENDED, SAID TO A PERSON WHO IS NOT A DEVELOPER.
|
|
8
|
+
*
|
|
9
|
+
* The controller decides THAT a pursuit is over and which branch ended it (the
|
|
10
|
+
* `end` code on its terminal action). What it hands over is a sentence for a
|
|
11
|
+
* log — "Start 1 was attempted 3 times and never began" — and until this file
|
|
12
|
+
* the server, and through it a customer's ticket, got even less: "this pursuit
|
|
13
|
+
* ended as human_required". A ticket that says it needs a person must say WHY,
|
|
14
|
+
* plainly, and what was tried.
|
|
15
|
+
*
|
|
16
|
+
* So this turns the code, the controller's own sentence and whatever else this
|
|
17
|
+
* machine remembers (what the launcher said, what the last run said on its way
|
|
18
|
+
* out, whether the safety brake or the AI tool was holding it) into one plain
|
|
19
|
+
* paragraph. It decides nothing: every input is already a conclusion.
|
|
20
|
+
*
|
|
21
|
+
* The words a run or a launcher said are QUOTED, never interpreted — except the
|
|
22
|
+
* two compile notes below, which are this repository's own fixed phrases
|
|
23
|
+
* (exported so `run-cmd` writes exactly what is matched here).
|
|
24
|
+
*/
|
|
25
|
+
/** What `run-cmd` notes when the planner produced no steps at all. */
|
|
26
|
+
exports.COMPILE_EMPTY_NOTE = 'compile: the plan came back empty';
|
|
27
|
+
/** The start of what `run-cmd` notes when every planned step was refused. */
|
|
28
|
+
exports.COMPILE_REFUSED_NOTE = 'compile: every step was refused';
|
|
29
|
+
/** A quoted fragment: one line, scrubbed, short enough to leave room for the advice. */
|
|
30
|
+
function quote(text, max = 220) {
|
|
31
|
+
let s = (0, core_1.cleanPursuitEndReason)(text).replace(/[.\s]+$/, '');
|
|
32
|
+
if (s.length > max)
|
|
33
|
+
s = `${s.slice(0, max - 1).trimEnd()}…`;
|
|
34
|
+
return s;
|
|
35
|
+
}
|
|
36
|
+
const EMPTY_PLAN_ADVICE = 'the planner found nothing to change. If this ticket asks for a change, say plainly what should happen ' +
|
|
37
|
+
'(for example: "the Save button should show a confirmation message"), then start it again.';
|
|
38
|
+
/** What the last run's note says about the plan, when it is one of the two compile notes. */
|
|
39
|
+
function planTrouble(note) {
|
|
40
|
+
if (note === undefined || note === '')
|
|
41
|
+
return null;
|
|
42
|
+
if (note.includes(exports.COMPILE_EMPTY_NOTE))
|
|
43
|
+
return { code: 'plan_empty', sentence: EMPTY_PLAN_ADVICE };
|
|
44
|
+
if (note.includes(exports.COMPILE_REFUSED_NOTE)) {
|
|
45
|
+
const n = /(\d+) step\(s\)/.exec(note)?.[1];
|
|
46
|
+
return {
|
|
47
|
+
code: 'plan_refused',
|
|
48
|
+
sentence: `every step of its plan${n === undefined ? '' : ` (${n} step${n === '1' ? '' : 's'})`} was refused because it ` +
|
|
49
|
+
'pointed at code that does not exist in this repository as it is now. Describe the change in more detail ' +
|
|
50
|
+
'(which screen or file, what should happen), or check the right repository is connected, then start it again.',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/** The sentence and code for an ending. Pure. */
|
|
56
|
+
function describePursuitEnding(ctx) {
|
|
57
|
+
const out = (code, because) => ({
|
|
58
|
+
code,
|
|
59
|
+
because: (0, core_1.cleanPursuitEndReason)(because),
|
|
60
|
+
});
|
|
61
|
+
const refusal = ctx.refusal === undefined || ctx.refusal === '' ? null : quote(ctx.refusal);
|
|
62
|
+
switch (ctx.end) {
|
|
63
|
+
case 'start_never_began': {
|
|
64
|
+
const n = ctx.attempts ?? 3;
|
|
65
|
+
const why = ctx.lastLaunchNote === undefined || ctx.lastLaunchNote === ''
|
|
66
|
+
? 'each try was launched but never reported that it had begun'
|
|
67
|
+
: quote(ctx.lastLaunchNote);
|
|
68
|
+
return out('start_never_began', `Looply tried to start this ${n} time${n === 1 ? '' : 's'} on ${ctx.machine} and it never began: ${why}. ` +
|
|
69
|
+
`Someone needs to check that ${ctx.machine} can run Looply (the app is up to date and its AI tool is installed and signed in), then start it again.`);
|
|
70
|
+
}
|
|
71
|
+
case 'plan_limit_reached':
|
|
72
|
+
return out('plan_limit_reached', 'Looply re-planned this goal as many times as it is allowed and it is still not done, so it stopped rather than plan again' +
|
|
73
|
+
(refusal === null ? '. ' : ` (its last check: ${refusal}). `) +
|
|
74
|
+
'Someone needs to look at what was delivered and say what is still missing.');
|
|
75
|
+
case 'needs_decision':
|
|
76
|
+
return out('needs_decision', `Looply needs a person to decide something before it can go on${refusal === null ? '.' : `: ${refusal}.`}`);
|
|
77
|
+
case 'requirement_uncovered':
|
|
78
|
+
return out('requirement_uncovered', 'The work was delivered, but a required part of this goal is not covered' +
|
|
79
|
+
(refusal === null ? '. ' : `: ${refusal}. `) +
|
|
80
|
+
'Someone needs to either ask for the missing part or confirm that what is there is enough.');
|
|
81
|
+
case 'repository_changed':
|
|
82
|
+
return out('repository_changed', `The code on ${ctx.machine} changed while Looply was checking the work, so it stopped to be safe. ` +
|
|
83
|
+
'Someone needs to make sure nobody else is editing that copy of the repository, then start it again.');
|
|
84
|
+
case 'run_refused':
|
|
85
|
+
return out('run_refused', `Looply stopped without the goal being met${refusal === null ? '' : `: ${refusal}`}. Someone needs to look at it and say what should happen next.`);
|
|
86
|
+
case 'records_damaged':
|
|
87
|
+
return out('records_damaged', `Looply's own record of what it has spent on this goal on ${ctx.machine} is damaged, so it stopped rather than guess ` +
|
|
88
|
+
`(${quote(ctx.because, 160)}). Someone needs to check that machine before starting it again.`);
|
|
89
|
+
case 'grant_mismatch':
|
|
90
|
+
return out('grant_mismatch', `The goal no longer matches what ${ctx.machine} was asked to work on (${quote(ctx.because, 160)}). ` +
|
|
91
|
+
'Someone needs to check the goal and start it again.');
|
|
92
|
+
case 'out_of_time':
|
|
93
|
+
case 'budget_exhausted':
|
|
94
|
+
return exhausted(ctx, out);
|
|
95
|
+
case 'goal_met':
|
|
96
|
+
return out('goal_met', refusal === null ? 'The goal was met.' : `The goal was met: ${refusal}.`);
|
|
97
|
+
case 'superseded':
|
|
98
|
+
return out('superseded', 'The goal was changed, so this pursuit of the earlier wording stopped.');
|
|
99
|
+
case 'abandoned':
|
|
100
|
+
return out('abandoned', 'The goal was given up.');
|
|
101
|
+
case 'cancelled':
|
|
102
|
+
return out('cancelled', 'A person stopped this.');
|
|
103
|
+
default:
|
|
104
|
+
return out(ctx.end, ctx.because);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** Ran out of Starts or of time: say what was holding it, or what the last try said. */
|
|
108
|
+
function exhausted(ctx, out) {
|
|
109
|
+
const head = ctx.end === 'out_of_time'
|
|
110
|
+
? 'The time given for this goal ran out before it was done'
|
|
111
|
+
: `Looply used all ${ctx.maxStarts} of its tries on this goal and it is still not done`;
|
|
112
|
+
if (ctx.providerNotReady !== undefined && ctx.providerNotReady !== '') {
|
|
113
|
+
return out('provider_not_ready', `${head}: the AI tool on ${ctx.machine} was not ready, so no work could start (${quote(ctx.providerNotReady)}). ` +
|
|
114
|
+
`Someone needs to fix that on ${ctx.machine}, then start it again.`);
|
|
115
|
+
}
|
|
116
|
+
if (ctx.safetyBrake !== undefined && ctx.safetyBrake !== '') {
|
|
117
|
+
return out('safety_brake', `${head}: Looply's safety brake had stopped it repeating something that was not working (${quote(ctx.safetyBrake)}). ` +
|
|
118
|
+
'Someone needs to look at what it was stuck on before starting it again.');
|
|
119
|
+
}
|
|
120
|
+
const plan = planTrouble(ctx.lastRunNote);
|
|
121
|
+
if (plan !== null)
|
|
122
|
+
return out(plan.code, `${head}: ${plan.sentence}`);
|
|
123
|
+
if (ctx.lastRunNote !== undefined && ctx.lastRunNote !== '') {
|
|
124
|
+
return out('repeated_failure', `${head}. Its last try ended: ${quote(ctx.lastRunNote)}. Someone needs to look at that before starting it again.`);
|
|
125
|
+
}
|
|
126
|
+
return out(ctx.end, `${head}. Someone needs to look at what was done and decide whether to start it again.`);
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=pursuit-ending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pursuit-ending.js","sourceRoot":"","sources":["../src/pursuit-ending.ts"],"names":[],"mappings":";;;AAwFA,sDAsFC;AA9KD,uCAAkG;AAElG;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sEAAsE;AACzD,QAAA,kBAAkB,GAAG,mCAAmC,CAAC;AACtE,6EAA6E;AAChE,QAAA,oBAAoB,GAAG,iCAAiC,CAAC;AAkCtE,wFAAwF;AACxF,SAAS,KAAK,CAAC,IAAY,EAAE,GAAG,GAAG,GAAG;IAC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CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,gFAAgF,CAAC,CAAC;AAC/G,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LaneClaimRecord } from './lane-claims';
|
|
2
|
+
/**
|
|
3
|
+
* WHERE A RUN IN A MACHINE-MADE CHECKOUT IS CUT FROM.
|
|
4
|
+
*
|
|
5
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
* Without this a run's branch is cut from wherever HEAD is, and in a checkout
|
|
7
|
+
* the machine reuses HEAD is the PREVIOUS run's branch — so ticket N+1 stacked
|
|
8
|
+
* on ticket N, and nothing could be reviewed on its own. Now, in a checkout the
|
|
9
|
+
* machine made (never the person's own checkout), a run is cut from:
|
|
10
|
+
*
|
|
11
|
+
* 1. HEAD, when this checkout's last cut was for THE SAME GOAL — a goal's
|
|
12
|
+
* later Starts continue its own work (the coordinator keeps a goal's plan
|
|
13
|
+
* checkout for it, F28), and the goal-gap / "looks done" checks read this
|
|
14
|
+
* checkout, so they judge that goal's own tree;
|
|
15
|
+
* 1b. the goal's OWN recorded work (its newest delivered commit, else the branch
|
|
16
|
+
* its run claimed) when it lands in a different checkout — a retired home;
|
|
17
|
+
* 2. the delivered tip of the goal it depends on, when it depends on exactly
|
|
18
|
+
* ONE goal — B builds on A's work, not on a base that lacks it;
|
|
19
|
+
* 3. the project's base branch otherwise (`run.base_branch`, else the
|
|
20
|
+
* repository's default branch) — so independent tickets never stack;
|
|
21
|
+
* 4. HEAD as before, said out loud, when no base can be found.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ THE MARKER IS PER CHECKOUT (`checkout-goal.json` in its own state dir),
|
|
24
|
+
* written at the cut, and it is the only memory this needs: which goal this
|
|
25
|
+
* tree's HEAD belongs to.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CHECKOUT_GOAL_MARKER = "checkout-goal.json";
|
|
28
|
+
export interface CheckoutGoal {
|
|
29
|
+
readonly goalId: string | null;
|
|
30
|
+
readonly branch: string;
|
|
31
|
+
readonly at: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function readCheckoutGoal(stateDir: string): CheckoutGoal | null;
|
|
34
|
+
export declare function writeCheckoutGoal(stateDir: string, marker: CheckoutGoal): void;
|
|
35
|
+
/** The slice of git this needs; every verb is a read. */
|
|
36
|
+
export interface BaseGit {
|
|
37
|
+
remoteHeadBranch(): Promise<string | null>;
|
|
38
|
+
refExists(ref: string): Promise<boolean>;
|
|
39
|
+
isAncestor(ancestor: string, of: string): Promise<boolean>;
|
|
40
|
+
listWorktrees(): Promise<Array<{
|
|
41
|
+
path: string;
|
|
42
|
+
head: string;
|
|
43
|
+
branch: string | null;
|
|
44
|
+
}>>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The project's base branch: `configured` when it names a ref that exists; else
|
|
48
|
+
* the remote's default branch (`origin/HEAD`) — as the LOCAL branch of that name
|
|
49
|
+
* unless the remote one is strictly newer; else the branch the main checkout is
|
|
50
|
+
* on (unless that is one of looply's own). Null when none can be found.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveBaseBranch(git: BaseGit, configured?: string): Promise<{
|
|
53
|
+
readonly ref: string;
|
|
54
|
+
readonly because: string;
|
|
55
|
+
} | null>;
|
|
56
|
+
export type CutPoint = {
|
|
57
|
+
readonly kind: 'continue';
|
|
58
|
+
readonly because: string;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'dependency';
|
|
61
|
+
readonly ref: string;
|
|
62
|
+
readonly because: string;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: 'base';
|
|
65
|
+
readonly ref: string;
|
|
66
|
+
readonly because: string;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'head';
|
|
69
|
+
readonly because: string;
|
|
70
|
+
};
|
|
71
|
+
export interface CutInput {
|
|
72
|
+
/** The goal this run is bound to, if any. */
|
|
73
|
+
readonly goalId?: string;
|
|
74
|
+
/** That goal's dependencies, as the mirror holds them. */
|
|
75
|
+
readonly dependsOn?: readonly string[];
|
|
76
|
+
/** Which goal this checkout's HEAD belongs to (`readCheckoutGoal`). */
|
|
77
|
+
readonly checkout: CheckoutGoal | null;
|
|
78
|
+
/** The machine's lane-claim records (`readLaneClaims`). */
|
|
79
|
+
readonly claims: readonly LaneClaimRecord[];
|
|
80
|
+
readonly configuredBase?: string;
|
|
81
|
+
}
|
|
82
|
+
/** Decide where this run's branch starts. Never throws: an unreadable answer degrades to HEAD, said. */
|
|
83
|
+
export declare function cutPointFor(git: BaseGit, input: CutInput): Promise<CutPoint>;
|
|
84
|
+
//# sourceMappingURL=run-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-base.d.ts","sourceRoot":"","sources":["../src/run-base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAQtE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAM9E;AAED,yDAAyD;AACzD,MAAM,WAAW,OAAO;IACtB,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CA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AC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,wGAAwG;AACxG,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6BlF"}
|
package/dist/run-base.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHECKOUT_GOAL_MARKER = void 0;
|
|
4
|
+
exports.readCheckoutGoal = readCheckoutGoal;
|
|
5
|
+
exports.writeCheckoutGoal = writeCheckoutGoal;
|
|
6
|
+
exports.resolveBaseBranch = resolveBaseBranch;
|
|
7
|
+
exports.cutPointFor = cutPointFor;
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
/**
|
|
11
|
+
* WHERE A RUN IN A MACHINE-MADE CHECKOUT IS CUT FROM.
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
* Without this a run's branch is cut from wherever HEAD is, and in a checkout
|
|
15
|
+
* the machine reuses HEAD is the PREVIOUS run's branch — so ticket N+1 stacked
|
|
16
|
+
* on ticket N, and nothing could be reviewed on its own. Now, in a checkout the
|
|
17
|
+
* machine made (never the person's own checkout), a run is cut from:
|
|
18
|
+
*
|
|
19
|
+
* 1. HEAD, when this checkout's last cut was for THE SAME GOAL — a goal's
|
|
20
|
+
* later Starts continue its own work (the coordinator keeps a goal's plan
|
|
21
|
+
* checkout for it, F28), and the goal-gap / "looks done" checks read this
|
|
22
|
+
* checkout, so they judge that goal's own tree;
|
|
23
|
+
* 1b. the goal's OWN recorded work (its newest delivered commit, else the branch
|
|
24
|
+
* its run claimed) when it lands in a different checkout — a retired home;
|
|
25
|
+
* 2. the delivered tip of the goal it depends on, when it depends on exactly
|
|
26
|
+
* ONE goal — B builds on A's work, not on a base that lacks it;
|
|
27
|
+
* 3. the project's base branch otherwise (`run.base_branch`, else the
|
|
28
|
+
* repository's default branch) — so independent tickets never stack;
|
|
29
|
+
* 4. HEAD as before, said out loud, when no base can be found.
|
|
30
|
+
*
|
|
31
|
+
* ⚠️ THE MARKER IS PER CHECKOUT (`checkout-goal.json` in its own state dir),
|
|
32
|
+
* written at the cut, and it is the only memory this needs: which goal this
|
|
33
|
+
* tree's HEAD belongs to.
|
|
34
|
+
*/
|
|
35
|
+
exports.CHECKOUT_GOAL_MARKER = 'checkout-goal.json';
|
|
36
|
+
function readCheckoutGoal(stateDir) {
|
|
37
|
+
try {
|
|
38
|
+
const raw = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stateDir, exports.CHECKOUT_GOAL_MARKER), 'utf8'));
|
|
39
|
+
if (typeof raw.branch !== 'string' || typeof raw.at !== 'string')
|
|
40
|
+
return null;
|
|
41
|
+
return { goalId: typeof raw.goalId === 'string' ? raw.goalId : null, branch: raw.branch, at: raw.at };
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function writeCheckoutGoal(stateDir, marker) {
|
|
48
|
+
(0, node_fs_1.mkdirSync)(stateDir, { recursive: true });
|
|
49
|
+
const target = (0, node_path_1.join)(stateDir, exports.CHECKOUT_GOAL_MARKER);
|
|
50
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
51
|
+
(0, node_fs_1.writeFileSync)(tmp, `${JSON.stringify(marker)}\n`, 'utf8');
|
|
52
|
+
(0, node_fs_1.renameSync)(tmp, target);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The project's base branch: `configured` when it names a ref that exists; else
|
|
56
|
+
* the remote's default branch (`origin/HEAD`) — as the LOCAL branch of that name
|
|
57
|
+
* unless the remote one is strictly newer; else the branch the main checkout is
|
|
58
|
+
* on (unless that is one of looply's own). Null when none can be found.
|
|
59
|
+
*/
|
|
60
|
+
async function resolveBaseBranch(git, configured) {
|
|
61
|
+
if (configured !== undefined) {
|
|
62
|
+
return (await git.refExists(configured)) ? { ref: configured, because: 'run.base_branch' } : null;
|
|
63
|
+
}
|
|
64
|
+
const remote = await git.remoteHeadBranch().catch(() => null);
|
|
65
|
+
if (remote !== null) {
|
|
66
|
+
const local = remote.slice(remote.indexOf('/') + 1);
|
|
67
|
+
const hasLocal = local !== '' && (await git.refExists(`refs/heads/${local}`));
|
|
68
|
+
const hasRemote = await git.refExists(remote);
|
|
69
|
+
if (hasLocal && hasRemote) {
|
|
70
|
+
// The newer of the two when one contains the other; the person's own branch when they diverged.
|
|
71
|
+
const remoteNewer = (await git.isAncestor(local, remote)) && !(await git.isAncestor(remote, local));
|
|
72
|
+
return remoteNewer
|
|
73
|
+
? { ref: remote, because: `the remote default branch (${remote} is ahead of ${local})` }
|
|
74
|
+
: { ref: local, because: `the default branch (${remote})` };
|
|
75
|
+
}
|
|
76
|
+
if (hasLocal)
|
|
77
|
+
return { ref: local, because: `the default branch (${remote})` };
|
|
78
|
+
if (hasRemote)
|
|
79
|
+
return { ref: remote, because: 'the remote default branch' };
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const main = (await git.listWorktrees())[0];
|
|
83
|
+
const branch = main?.branch?.replace(/^refs\/heads\//, '') ?? null;
|
|
84
|
+
if (branch !== null && branch !== '' && !branch.startsWith('looply/') && (await git.refExists(`refs/heads/${branch}`))) {
|
|
85
|
+
return { ref: branch, because: 'the branch the main checkout is on' };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
/* no worktree list: nothing more to try */
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
/** Decide where this run's branch starts. Never throws: an unreadable answer degrades to HEAD, said. */
|
|
94
|
+
async function cutPointFor(git, input) {
|
|
95
|
+
if (input.goalId !== undefined && input.checkout?.goalId === input.goalId) {
|
|
96
|
+
return { kind: 'continue', because: `this checkout holds ${input.goalId}'s own work (${input.checkout.branch})` };
|
|
97
|
+
}
|
|
98
|
+
if (input.goalId !== undefined) {
|
|
99
|
+
// This goal already has work on a branch — its home checkout was retired, or it was placed
|
|
100
|
+
// elsewhere: carry on from that work rather than redo it from the base.
|
|
101
|
+
const own = await dependencyTip(git, input.goalId, input.claims);
|
|
102
|
+
if (own !== null)
|
|
103
|
+
return { kind: 'dependency', ref: own.ref, because: `${input.goalId} already has work at ${own.ref} (${own.what}); continuing from it` };
|
|
104
|
+
}
|
|
105
|
+
const deps = input.dependsOn ?? [];
|
|
106
|
+
if (input.goalId !== undefined && deps.length === 1) {
|
|
107
|
+
const dep = deps[0];
|
|
108
|
+
const tip = await dependencyTip(git, dep, input.claims);
|
|
109
|
+
if (tip !== null)
|
|
110
|
+
return { kind: 'dependency', ref: tip.ref, because: `it depends on ${dep}, whose work is at ${tip.ref} (${tip.what})` };
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const base = await resolveBaseBranch(git, input.configuredBase);
|
|
114
|
+
if (base !== null)
|
|
115
|
+
return { kind: 'base', ref: base.ref, because: base.because };
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
/* fall through to HEAD */
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
kind: 'head',
|
|
122
|
+
because: input.configuredBase !== undefined
|
|
123
|
+
? `run.base_branch ${input.configuredBase} does not exist here`
|
|
124
|
+
: 'no default branch could be found (no origin/HEAD, no main checkout branch)',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** The newest delivered commit of `goalId`, else the tip of its newest claimed branch. */
|
|
128
|
+
async function dependencyTip(git, goalId, claims) {
|
|
129
|
+
const mine = claims.filter((c) => c.goalId === goalId);
|
|
130
|
+
for (const c of [...mine].reverse()) {
|
|
131
|
+
if (c.kind === 'delivery' && (await git.refExists(c.commitSha).catch(() => false))) {
|
|
132
|
+
return { ref: c.commitSha, what: `its delivered commit on ${c.branch}` };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
for (const c of [...mine].reverse()) {
|
|
136
|
+
if (c.kind === 'claims' && (await git.refExists(`refs/heads/${c.branch}`).catch(() => false))) {
|
|
137
|
+
return { ref: c.branch, what: 'the branch its run worked on' };
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=run-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-base.js","sourceRoot":"","sources":["../src/run-base.ts"],"names":[],"mappings":";;;AAsCA,4CAQC;AAED,8CAMC;AAgBD,8CAgCC;AAqBD,kCA6BC;AAxJD,qCAA6E;AAC7E,yCAAiC;AAGjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEU,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAQzD,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,QAAQ,EAAE,4BAAoB,CAAC,EAAE,MAAM,CAAC,CAA0B,CAAC;QAC5G,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC9E,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IACxG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,QAAgB,EAAE,MAAoB;IACtE,IAAA,mBAAS,EAAC,QAAQ,EAAE,EAAE,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AAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC9F,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC;QACjE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
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,KAAK,IAAI,EAaT,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
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,KAAK,IAAI,EAaT,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA+B/E,OAAO,EAGL,KAAK,aAAa,EAIlB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAoBxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiB9E,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,uBAAuB,CAAC;AAe/B,OAAO,EAaL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAgCtB,OAAO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;;;;;;;GAQG;AACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;AACzB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,EAAE,aAAa;AACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;AACpB;;;;;;;;;;;;GAYG;AACH,IAAI,CAAC,EAAE,cAAc,GACpB,MAAM,CA4FR;AAED;;;;;;;;;;;GAWG;AACH;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,IAAI,EAAE,mBAAmB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChF,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;CACnF;AAiID;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAu2HnE"}
|
package/dist/run-cmd.js
CHANGED
|
@@ -15,12 +15,14 @@ const core_1 = require("@looply/core");
|
|
|
15
15
|
const config_1 = require("./config");
|
|
16
16
|
const ledger_store_1 = require("./ledger-store");
|
|
17
17
|
const run_ended_1 = require("./run-ended");
|
|
18
|
+
const pursuit_ending_1 = require("./pursuit-ending");
|
|
18
19
|
const exemption_store_1 = require("./exemption-store");
|
|
19
20
|
const queue_store_1 = require("./queue-store");
|
|
20
21
|
const lane_claims_1 = require("./lane-claims");
|
|
21
22
|
const run_delivery_1 = require("./run-delivery");
|
|
22
23
|
const goal_met_target_1 = require("./goal-met-target");
|
|
23
24
|
const reaper_1 = require("./reaper");
|
|
25
|
+
const run_base_1 = require("./run-base");
|
|
24
26
|
const requirement_claims_1 = require("./requirement-claims");
|
|
25
27
|
const evidence_cache_1 = require("./evidence-cache");
|
|
26
28
|
const control_file_1 = require("./control-file");
|
|
@@ -807,7 +809,7 @@ async function runLoop(opts) {
|
|
|
807
809
|
return;
|
|
808
810
|
try {
|
|
809
811
|
const tree = await git.headTreeSha();
|
|
810
|
-
const indexStore = new project_index_store_1.ProjectIndexStore(stateDir, ledger_store_1.nodeLedgerFs);
|
|
812
|
+
const indexStore = new project_index_store_1.ProjectIndexStore(stateDir, ledger_store_1.nodeLedgerFs, (0, git_driver_1.projectStateDir)(cwd));
|
|
811
813
|
/**
|
|
812
814
|
* ⚠️ THE PACKAGE SET IS PART OF THE KEY, NOT JUST OF THE BUILD. Passing
|
|
813
815
|
* it is what stops a config edit — which no tree sha covers — being
|
|
@@ -858,7 +860,7 @@ async function runLoop(opts) {
|
|
|
858
860
|
projectKey: memoryKey,
|
|
859
861
|
headTreeSha: () => git.headTreeSha(),
|
|
860
862
|
indexFor: async (tree) => {
|
|
861
|
-
const store = new project_index_store_1.ProjectIndexStore(stateDir, ledger_store_1.nodeLedgerFs);
|
|
863
|
+
const store = new project_index_store_1.ProjectIndexStore(stateDir, ledger_store_1.nodeLedgerFs, (0, git_driver_1.projectStateDir)(cwd));
|
|
862
864
|
const packages = (0, index_for_head_1.workspacePackages)(config);
|
|
863
865
|
// Same key as the block above, and for the same reason.
|
|
864
866
|
const cached = await store.load(tree, packages.map((pkg) => pkg.name));
|
|
@@ -2920,7 +2922,8 @@ async function runLoop(opts) {
|
|
|
2920
2922
|
// and the next Start tries again.
|
|
2921
2923
|
log(`compile : every step was refused — ${checked.refused.length} step(s) cited evidence that does not hold at the tree. ` +
|
|
2922
2924
|
'Nothing queued, and this goal still has no plan.');
|
|
2923
|
-
|
|
2925
|
+
// Matched by pursuit-ending.ts to explain an ending to a person; keep the prefix.
|
|
2926
|
+
compileNote = `${pursuit_ending_1.COMPILE_REFUSED_NOTE} — ${checked.refused.length} step(s) cited evidence that does not hold at the tree`;
|
|
2924
2927
|
}
|
|
2925
2928
|
else if (!(stillOurs = await freshAuthority(binding.goal.id, binding.goal.version, binding.goal.text)).ok) {
|
|
2926
2929
|
/**
|
|
@@ -3019,7 +3022,7 @@ async function runLoop(opts) {
|
|
|
3019
3022
|
}
|
|
3020
3023
|
else if (!compiled.steps.length) {
|
|
3021
3024
|
log('compile : the plan came back empty — nothing to do for this goal.');
|
|
3022
|
-
compileNote =
|
|
3025
|
+
compileNote = pursuit_ending_1.COMPILE_EMPTY_NOTE;
|
|
3023
3026
|
}
|
|
3024
3027
|
else {
|
|
3025
3028
|
log(
|
|
@@ -3875,7 +3878,45 @@ async function runLoop(opts) {
|
|
|
3875
3878
|
}
|
|
3876
3879
|
},
|
|
3877
3880
|
}
|
|
3878
|
-
:
|
|
3881
|
+
: (0, reaper_1.hasProvisionedMarker)(cwd)
|
|
3882
|
+
? {
|
|
3883
|
+
/**
|
|
3884
|
+
* PARALLEL TICKETS: A RUN IN A CHECKOUT THE MACHINE MADE IS CUT FROM ITS OWN BASE,
|
|
3885
|
+
* never from whatever the previous run in that checkout left on HEAD — see
|
|
3886
|
+
* `run-base.ts`. Its own goal's earlier work continues on HEAD; a single
|
|
3887
|
+
* dependency's delivered tip comes next; the project's base branch otherwise. The
|
|
3888
|
+
* person's own checkout is never touched by this: there, HEAD stays the start.
|
|
3889
|
+
*/
|
|
3890
|
+
integrationBase: async () => {
|
|
3891
|
+
const goalId = binding.kind === 'bound' ? binding.goal.id : undefined;
|
|
3892
|
+
let cut;
|
|
3893
|
+
try {
|
|
3894
|
+
cut = await (0, run_base_1.cutPointFor)(git, {
|
|
3895
|
+
...(goalId === undefined ? {} : { goalId }),
|
|
3896
|
+
dependsOn: binding.kind === 'bound' ? (binding.goal.dependsOn ?? []) : [],
|
|
3897
|
+
checkout: (0, run_base_1.readCheckoutGoal)(stateDir),
|
|
3898
|
+
claims: (0, lane_claims_1.readLaneClaims)(cwd),
|
|
3899
|
+
...(config.run.baseBranch === undefined ? {} : { configuredBase: config.run.baseBranch }),
|
|
3900
|
+
});
|
|
3901
|
+
}
|
|
3902
|
+
catch (e) {
|
|
3903
|
+
cut = { kind: 'head', because: e.message };
|
|
3904
|
+
}
|
|
3905
|
+
log(cut.kind === 'continue'
|
|
3906
|
+
? `base : continuing on HEAD — ${cut.because}`
|
|
3907
|
+
: cut.kind === 'head'
|
|
3908
|
+
? `base : cutting from HEAD — ${cut.because}`
|
|
3909
|
+
: `base : cutting from ${cut.ref} — ${cut.because}`);
|
|
3910
|
+
try {
|
|
3911
|
+
(0, run_base_1.writeCheckoutGoal)(stateDir, { goalId: goalId ?? null, branch, at: new Date().toISOString() });
|
|
3912
|
+
}
|
|
3913
|
+
catch {
|
|
3914
|
+
// The marker is a memory, not a gate: without it the next run is cut from the base.
|
|
3915
|
+
}
|
|
3916
|
+
return cut.kind === 'base' || cut.kind === 'dependency' ? cut.ref : null;
|
|
3917
|
+
},
|
|
3918
|
+
}
|
|
3919
|
+
: {}),
|
|
3879
3920
|
// Attribution for this run's header event, passed as opaque values. The
|
|
3880
3921
|
// runner spreads them and knows nothing about what they mean — that is the
|
|
3881
3922
|
// whole point of the carrier, and why RoundRunner still contains no
|