looply-cli 0.5.4 → 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/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 +122 -4
- package/dist/autonomy-tick.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +2 -0
- 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 +40 -7
- 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 +56 -33
- package/dist/daemon-cmd.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/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/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/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 +17 -1
- package/dist/run-launcher.d.ts.map +1 -1
- package/dist/run-launcher.js +36 -5
- package/dist/run-launcher.js.map +1 -1
- package/dist/server-client.d.ts +5 -1
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +1 -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
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
|
+
//# sourceMappingUR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@
|
|
|
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,EAIL,KAAK,2BAA2B,EAEjC,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,UAAU;IACzB,GAAG,E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,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
|