@codyswann/lisa 3.41.0 → 3.42.0
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/all/copy-overwrite/scripts/lisa-environment-prepare.mjs +356 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +4 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +7 -0
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +15 -3
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/core/workflow-reference-guard.d.ts +17 -0
- package/dist/core/workflow-reference-guard.d.ts.map +1 -0
- package/dist/core/workflow-reference-guard.js +145 -0
- package/dist/core/workflow-reference-guard.js.map +1 -0
- package/dist/strategies/package-lisa.d.ts +2 -1
- package/dist/strategies/package-lisa.d.ts.map +1 -1
- package/dist/strategies/package-lisa.js +168 -42
- package/dist/strategies/package-lisa.js.map +1 -1
- package/expo/create-only/.github/workflows/playwright-e2e.yml +92 -75
- package/expo/package-lisa/package.lisa.json +3 -3
- package/package.json +3 -3
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/typescript/package-lisa/package.lisa.json +2 -2
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// This file is managed by Lisa and IS replaced on each `lisa` run.
|
|
3
|
+
// Do not edit directly — durable changes belong upstream in Lisa.
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* lisa-environment-prepare — the caller the `environment:*` facade never had.
|
|
7
|
+
*
|
|
8
|
+
* Lisa already defines the facade and ships gates that prove a project's reset
|
|
9
|
+
* guard REFUSES. It shipped nothing that actually resets an environment before
|
|
10
|
+
* a suite, so every consumer hand-wired its own: measured 2026-08-19, one
|
|
11
|
+
* frontend resets after its browser suite via `if: always()`, the same repo's
|
|
12
|
+
* native suite resets not at all, and a second repo's shape could not be
|
|
13
|
+
* verified. A native suite had therefore been accumulating data nightly.
|
|
14
|
+
*
|
|
15
|
+
* This module owns three things and deliberately no more:
|
|
16
|
+
*
|
|
17
|
+
* 1. **Sequencing.** Reset before reseed, always, regardless of the order a
|
|
18
|
+
* caller lists them. They are not commutative: reseeding and then emptying
|
|
19
|
+
* leaves an empty environment that reports as prepared.
|
|
20
|
+
* 2. **Failure semantics.** A verb the caller ASKED FOR and that the project
|
|
21
|
+
* does not declare is a failure, never a skip. This is the whole point. A
|
|
22
|
+
* suite that runs against an environment nobody reset, and reports green,
|
|
23
|
+
* is the defect the facade work existed to prevent, and it is exactly what
|
|
24
|
+
* a tolerant "the script wasn't there, carry on" would reintroduce.
|
|
25
|
+
* 3. **Refusing production before invoking anything.**
|
|
26
|
+
*
|
|
27
|
+
* What it does NOT own is what the verbs do. Per the facade contract §3 the
|
|
28
|
+
* verbs are an interface, not a mechanism; a project may implement them with a
|
|
29
|
+
* local script today and a scoped Lambda tomorrow without this file changing.
|
|
30
|
+
*
|
|
31
|
+
* ## On the production refusal, and what it is worth
|
|
32
|
+
*
|
|
33
|
+
* The check here is a CALLER-SIDE refusal on the environment name it was
|
|
34
|
+
* handed. It is not identity verification and must not be read as any: this
|
|
35
|
+
* process has no connection to the target and no way to learn that a name
|
|
36
|
+
* reading `dev` addresses a production database through a tunnel or a copied
|
|
37
|
+
* env file. That gap is closed by layers this file cannot reach — the reset
|
|
38
|
+
* capability not being deployed to production at all, an execution role that
|
|
39
|
+
* cannot invoke it there, the implementation asserting its own resolved stage,
|
|
40
|
+
* and the implementation asserting the database it actually connected to.
|
|
41
|
+
*
|
|
42
|
+
* So this refusal is the cheap outer layer of several, and its value is that
|
|
43
|
+
* it is the one that fires before a single process starts. It is written
|
|
44
|
+
* against the shipped `lisa-destructive-guard` classifier rather than a fresh
|
|
45
|
+
* regex so that "what counts as production" has ONE definition in Lisa — the
|
|
46
|
+
* guard already treats `prod`, `prd` and `live` as production and treats an
|
|
47
|
+
* identity it cannot read exactly as it treats production.
|
|
48
|
+
*
|
|
49
|
+
* @module scripts/lisa-environment-prepare
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
53
|
+
import { join } from "node:path";
|
|
54
|
+
import { spawnSync } from "node:child_process";
|
|
55
|
+
|
|
56
|
+
import { classifyEnvironment } from "./lisa-destructive-guard.mjs";
|
|
57
|
+
import { invokedAsScript } from "./lib/invoked-as-script.mjs";
|
|
58
|
+
import { readGates } from "./lisa-gates.mjs";
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The facade's verbs, in the only order they may run.
|
|
62
|
+
*
|
|
63
|
+
* Order is a property of the module rather than of the caller's argument list,
|
|
64
|
+
* because a caller that lists them the other way round has made a mistake this
|
|
65
|
+
* module can simply not honour.
|
|
66
|
+
*/
|
|
67
|
+
export const FACADE_VERBS = Object.freeze(["reset", "reseed"]);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Every reason a preparation can refuse or fail.
|
|
71
|
+
*
|
|
72
|
+
* Machine-readable and stable: reports and workflow steps branch on these, and
|
|
73
|
+
* the facade contract §4 obligation 5 requires a refusal to carry the guard's
|
|
74
|
+
* own vocabulary so it is demonstrably a refusal rather than a crash on the
|
|
75
|
+
* way to one.
|
|
76
|
+
*/
|
|
77
|
+
export const PREPARE_REASONS = Object.freeze([
|
|
78
|
+
"environment_env_required",
|
|
79
|
+
"environment_name_malformed",
|
|
80
|
+
"environment_runner_malformed",
|
|
81
|
+
"environment_target_forbidden",
|
|
82
|
+
"environment_verb_unknown",
|
|
83
|
+
"environment_verb_missing",
|
|
84
|
+
"environment_verb_failed",
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The task name a verb resolves to.
|
|
89
|
+
* @param {string} verb One of {@link FACADE_VERBS}.
|
|
90
|
+
* @returns {string} The npm script name, e.g. `environment:reset`.
|
|
91
|
+
*/
|
|
92
|
+
function taskFor(verb) {
|
|
93
|
+
return `environment:${verb}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A usable environment name.
|
|
98
|
+
*
|
|
99
|
+
* An allowlist of shapes, not a denylist of dangerous characters, and that is
|
|
100
|
+
* the whole point — a denylist is a list of the attacks someone thought of.
|
|
101
|
+
* This admits `dev`, `staging`, `us-prod-1`, `preview_2`; it admits nothing
|
|
102
|
+
* carrying a space, a quote, a semicolon, a backtick, or `$(`.
|
|
103
|
+
*
|
|
104
|
+
* Without it, `classifyEnvironment` is not sufficient protection even though it
|
|
105
|
+
* is the right classifier: it splits on non-alphanumerics and inspects the
|
|
106
|
+
* SEGMENTS, so `dev; rm -rf /` yields `dev`, `rm`, `rf` — none of which look
|
|
107
|
+
* like production — and the value passes the refusal. Measured before this
|
|
108
|
+
* existed, `--env='dev; touch /tmp/x'` produced the command
|
|
109
|
+
* `bun run environment:reset -- --env=dev; touch /tmp/x`. The injected half
|
|
110
|
+
* could name production, so the omission defeated the production guard using
|
|
111
|
+
* the very input that guard exists to check.
|
|
112
|
+
*/
|
|
113
|
+
const ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/u;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A usable task-runner prefix.
|
|
117
|
+
*
|
|
118
|
+
* Same reasoning, applied to the other value that reaches the child process.
|
|
119
|
+
* It comes from `.lisa.config.json`, which is a less likely attacker channel
|
|
120
|
+
* than a workflow input — but "less likely" is not a property worth relying on
|
|
121
|
+
* when the check costs one regular expression. Mirrors the plain-command
|
|
122
|
+
* validation `quality.yml` already applies to a resolved gate command.
|
|
123
|
+
*/
|
|
124
|
+
const RUNNER_PREFIX = /^[A-Za-z0-9][A-Za-z0-9 ._@:/-]*$/u;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The argument vector for a verb.
|
|
128
|
+
*
|
|
129
|
+
* A vector rather than a command line, and executed WITHOUT a shell, so no
|
|
130
|
+
* amount of punctuation in any element can become syntax. The name validation
|
|
131
|
+
* above already makes that unreachable; this makes it impossible rather than
|
|
132
|
+
* merely blocked, which is the correct arrangement for the destructive path.
|
|
133
|
+
*
|
|
134
|
+
* The bare `--` is load-bearing and not stylistic. Measured on 2026-08-19:
|
|
135
|
+
* `npm run <task> --env=dev` reaches the script with NO arguments at all,
|
|
136
|
+
* while `bun run <task> --env=dev` forwards it — so the form without `--` is
|
|
137
|
+
* correct on one runner and silently argument-less on the other. Both runners
|
|
138
|
+
* forward correctly with `--`, so that is the only portable form.
|
|
139
|
+
* @param {string} runner Task-runner prefix, e.g. `bun run`.
|
|
140
|
+
* @param {string} verb One of {@link FACADE_VERBS}.
|
|
141
|
+
* @param {string} env The target environment name.
|
|
142
|
+
* @returns {string[]} The argument vector, executable without a shell.
|
|
143
|
+
*/
|
|
144
|
+
function argvFor(runner, verb, env) {
|
|
145
|
+
return [...runner.trim().split(/\s+/u), taskFor(verb), "--", `--env=${env}`];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The default executor: run the vector directly, inheriting stdio.
|
|
150
|
+
*
|
|
151
|
+
* No `shell: true`. stdio is inherited so a failing reset's own output reaches
|
|
152
|
+
* the operator unaltered — a summary reprinted by this module would be strictly
|
|
153
|
+
* less useful than what the project's own tooling already said.
|
|
154
|
+
* @param {string[]} argv The argument vector.
|
|
155
|
+
* @returns {number|null} Exit code, or null when the child was killed.
|
|
156
|
+
*/
|
|
157
|
+
function spawnExec(argv) {
|
|
158
|
+
const [file, ...args] = argv;
|
|
159
|
+
const child = spawnSync(file, args, { stdio: "inherit" });
|
|
160
|
+
if (child.error) return null;
|
|
161
|
+
return child.status;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Prepare an environment by running the requested facade verbs in order.
|
|
166
|
+
*
|
|
167
|
+
* Every refusal happens BEFORE the first invocation. That ordering is
|
|
168
|
+
* deliberate: a run that resets and then discovers the reseed is missing has
|
|
169
|
+
* emptied a shared environment and left it empty, which is a worse state than
|
|
170
|
+
* the one it started in and one no later step can undo.
|
|
171
|
+
* @param {object} options Options.
|
|
172
|
+
* @param {string} [options.env] Target environment name. Mandatory.
|
|
173
|
+
* @param {readonly string[]} [options.verbs] Verbs the caller requires.
|
|
174
|
+
* @param {Record<string, string>} [options.scripts] The project's npm scripts.
|
|
175
|
+
* @param {string} [options.runner] Task-runner prefix, e.g. `bun run`.
|
|
176
|
+
* @param {(command: string) => number|null} [options.exec] Executor.
|
|
177
|
+
* @returns {{ok: boolean, reason: string|null, message: string, ran: string[]}} Outcome.
|
|
178
|
+
*/
|
|
179
|
+
export function prepareEnvironment({
|
|
180
|
+
env,
|
|
181
|
+
verbs = FACADE_VERBS,
|
|
182
|
+
scripts = {},
|
|
183
|
+
runner = "npm run",
|
|
184
|
+
exec = spawnExec,
|
|
185
|
+
}) {
|
|
186
|
+
const target = typeof env === "string" ? env.trim() : "";
|
|
187
|
+
if (!target) {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
reason: "environment_env_required",
|
|
191
|
+
message:
|
|
192
|
+
"--env is required and has no default. A default that is safe in one repo is the production default in another, so there is no value to fall back to.",
|
|
193
|
+
ran: [],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Shape BEFORE meaning. A name that cannot be a name is refused as
|
|
198
|
+
// malformed rather than classified, because classification of a malformed
|
|
199
|
+
// value is where the injection lived: the classifier reads alphanumeric
|
|
200
|
+
// segments and is blind to the punctuation between them.
|
|
201
|
+
if (!ENVIRONMENT_NAME.test(target)) {
|
|
202
|
+
return {
|
|
203
|
+
ok: false,
|
|
204
|
+
reason: "environment_name_malformed",
|
|
205
|
+
message: `"${target}" is not a usable environment name. Names must start with a letter or digit and contain only letters, digits, dot, underscore and hyphen. Anything else is refused before it is classified, because a value carrying shell punctuation can look non-production segment by segment while naming production in the part that gets executed.`,
|
|
206
|
+
ran: [],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (!RUNNER_PREFIX.test(runner)) {
|
|
211
|
+
return {
|
|
212
|
+
ok: false,
|
|
213
|
+
reason: "environment_runner_malformed",
|
|
214
|
+
message: `the configured task runner "${runner}" is not a plain command. Set gates.runner in .lisa.config.json to something like "bun run".`,
|
|
215
|
+
ran: [],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const unknown = verbs.filter(verb => !FACADE_VERBS.includes(verb));
|
|
220
|
+
if (unknown.length > 0) {
|
|
221
|
+
return {
|
|
222
|
+
ok: false,
|
|
223
|
+
reason: "environment_verb_unknown",
|
|
224
|
+
message: `unknown verb(s): ${unknown.join(", ")}. The facade defines exactly ${FACADE_VERBS.join(" and ")}.`,
|
|
225
|
+
ran: [],
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Ambiguity resolves to refusal: `classifyEnvironment` reports `unresolved`
|
|
230
|
+
// for anything it cannot read, and this treats that identically to
|
|
231
|
+
// production. "I could not tell" must never be the cheaper answer.
|
|
232
|
+
if (classifyEnvironment(target) !== "non-production") {
|
|
233
|
+
return {
|
|
234
|
+
ok: false,
|
|
235
|
+
reason: "environment_target_forbidden",
|
|
236
|
+
message: `"${target}" is refused as a destructive target. Production is refused with no override, and an environment identity that cannot be classified fails closed exactly as production does.`,
|
|
237
|
+
ran: [],
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Resolve every requested verb before running any of them.
|
|
242
|
+
const ordered = FACADE_VERBS.filter(verb => verbs.includes(verb));
|
|
243
|
+
const missing = ordered.filter(verb => !scripts[taskFor(verb)]);
|
|
244
|
+
if (missing.length > 0) {
|
|
245
|
+
return {
|
|
246
|
+
ok: false,
|
|
247
|
+
reason: "environment_verb_missing",
|
|
248
|
+
message: `the caller requires ${missing.map(taskFor).join(" and ")}, which this project does not declare. A required verb that is absent is a failure, not a skip — a suite running against an environment nobody prepared proves nothing. Declare the script, or stop requiring the verb.`,
|
|
249
|
+
ran: [],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const ran = [];
|
|
254
|
+
for (const verb of ordered) {
|
|
255
|
+
const argv = argvFor(runner, verb, target);
|
|
256
|
+
ran.push(argv.join(" "));
|
|
257
|
+
const status = exec(argv);
|
|
258
|
+
// A null status is spawnSync's report of a child killed by a signal. Any
|
|
259
|
+
// reading other than "failed" lets an OOM-killed reset clear the suite.
|
|
260
|
+
if (status !== 0) {
|
|
261
|
+
return {
|
|
262
|
+
ok: false,
|
|
263
|
+
reason: "environment_verb_failed",
|
|
264
|
+
message: `${taskFor(verb)} ${status === null ? "was killed before it finished" : `exited ${status}`}. Nothing after it ran: a reseed layered onto a failed reset produces fixture data on top of whatever the last run left behind.`,
|
|
265
|
+
ran,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
ok: true,
|
|
272
|
+
reason: null,
|
|
273
|
+
message: `prepared ${target}: ${ordered.map(taskFor).join(", ")}`,
|
|
274
|
+
ran,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Read a `--name=<value>` flag from the argument list.
|
|
280
|
+
* @param {readonly string[]} argv Arguments after the script name.
|
|
281
|
+
* @param {string} name Flag name, without dashes.
|
|
282
|
+
* @returns {string|null} The value, or null when absent.
|
|
283
|
+
*/
|
|
284
|
+
function readFlag(argv, name) {
|
|
285
|
+
const prefix = `--${name}=`;
|
|
286
|
+
const hit = argv.find(arg => arg.startsWith(prefix));
|
|
287
|
+
return hit ? hit.slice(prefix.length) : null;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* The `scripts` block of the project's `package.json`.
|
|
292
|
+
* @param {string} cwd Project root.
|
|
293
|
+
* @returns {Record<string, string>} The scripts, empty when unreadable.
|
|
294
|
+
*/
|
|
295
|
+
function readPackageScripts(cwd) {
|
|
296
|
+
const path = join(cwd, "package.json");
|
|
297
|
+
if (!existsSync(path)) return {};
|
|
298
|
+
try {
|
|
299
|
+
return JSON.parse(readFileSync(path, "utf8"))?.scripts ?? {};
|
|
300
|
+
} catch {
|
|
301
|
+
return {};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* CLI entry point.
|
|
307
|
+
* @param {readonly string[]} [argv] Arguments after the script name.
|
|
308
|
+
* @param {string} [cwd] Project root.
|
|
309
|
+
* @returns {number} Process exit code.
|
|
310
|
+
*/
|
|
311
|
+
export function runCli(argv = process.argv.slice(2), cwd = process.cwd()) {
|
|
312
|
+
const env = readFlag(argv, "env");
|
|
313
|
+
const verbsFlag = readFlag(argv, "verbs");
|
|
314
|
+
const verbs = verbsFlag
|
|
315
|
+
? verbsFlag
|
|
316
|
+
.split(",")
|
|
317
|
+
.map(verb => verb.trim())
|
|
318
|
+
.filter(Boolean)
|
|
319
|
+
: FACADE_VERBS;
|
|
320
|
+
|
|
321
|
+
let runner = "npm run";
|
|
322
|
+
try {
|
|
323
|
+
runner = readGates(cwd).runner;
|
|
324
|
+
} catch {
|
|
325
|
+
// An unreadable config falls back to the same default the gate runner
|
|
326
|
+
// uses, so the two never disagree about how to invoke a task. The comment
|
|
327
|
+
// that stood here claimed this was "not a reason to guess a runner and
|
|
328
|
+
// press on", which is the opposite of what the code does — it does press
|
|
329
|
+
// on, deliberately. Pressing on is safe because the fallback is a plain
|
|
330
|
+
// `npm run`: a project whose scripts are not reachable that way fails at
|
|
331
|
+
// the verb, with its own error, rather than here with a guess about why.
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const result = prepareEnvironment({
|
|
335
|
+
env,
|
|
336
|
+
verbs,
|
|
337
|
+
scripts: readPackageScripts(cwd),
|
|
338
|
+
runner,
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
if (result.ok) {
|
|
342
|
+
console.log(`✅ ${result.message}`);
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
console.error(`❌ environment preparation refused: ${result.reason}`);
|
|
346
|
+
console.error(` ${result.message}`);
|
|
347
|
+
return 1;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Realpath-based, for the reason spelled out at the foot of lisa-gates.mjs: a
|
|
351
|
+
// string comparison of module URLs answers "no" through a symlinked checkout,
|
|
352
|
+
// a git worktree, or a macOS /tmp path, and this file would then load, run
|
|
353
|
+
// nothing, and exit 0 — a preparation that never happened, reported as done.
|
|
354
|
+
if (invokedAsScript(import.meta.url)) {
|
|
355
|
+
process.exit(runCli());
|
|
356
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA4YjC,CAAC"}
|
|
@@ -207,6 +207,10 @@ export const LISA_OWNED_HASH_LEDGER = Object.freeze({
|
|
|
207
207
|
"d7d88e44763694bed5eae998cd3663922c957e49f9f9621d9201f0417a4128ad",
|
|
208
208
|
"e17c45f7cadf0fb55dd07270776caf211af99b7d4771a4fde75aafe5919e8dbe",
|
|
209
209
|
]),
|
|
210
|
+
"scripts/lisa-environment-prepare.mjs": Object.freeze([
|
|
211
|
+
"c765c7a44ea81d54c7820f2068c8811fb73ca3e5f063cb55a8c30391d1326323",
|
|
212
|
+
"f8c8e276fa6d68ed661f07882f20ee095d18a5e8a90136f78f1ed2b032ce33d4",
|
|
213
|
+
]),
|
|
210
214
|
"scripts/lisa-floor-collisions.mjs": Object.freeze([
|
|
211
215
|
"2d11968f6852ab745cba939de03c6d6cb5f413975d2cfc8fc447bdd0b218e91a",
|
|
212
216
|
"3c7a0234b4f5609fce49e44711d2ec86af8cf7fb82b0831e4450e3347ecefe45",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lisa-owned-hash-ledger.js","sourceRoot":"","sources":["../../src/core/lisa-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kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,wCAAwC,EAAE,MAAM,CAAC,MAAM,CAAC;QACtD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,sDAAsD,EAAE,MAAM,CAAC,MAAM,CAAC;QACpE,kEAAkE;KACnE,CAAC;IACF,oDAAoD,EAAE,MAAM,CAAC,MAAM,CAAC;QAClE,kEAAkE;KACnE,CAAC;IACF,uCAAuC,EAAE,MAAM,CAAC,MAAM,CAAC;QACrD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,wCAAwC,EAAE,MAAM,CAAC,MAAM,CAAC;QACtD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;CACH,CAAC,CAAC;AACH,sEAAsE"}
|
|
1
|
+
{"version":3,"file":"lisa-owned-hash-ledger.js","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,6EAA6E;AAE7E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAE/B,MAAM,CAAC,MAAM,CAAC;IAChB,wBAAwB,EAAE,MAAM,CAAC,MAAM,CAAC;QACtC,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,0BAA0B,EAAE,MAAM,C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ClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,wCAAwC,EAAE,MAAM,CAAC,MAAM,CAAC;QACtD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,sDAAsD,EAAE,MAAM,CAAC,MAAM,CAAC;QACpE,kEAAkE;KACnE,CAAC;IACF,oDAAoD,EAAE,MAAM,CAAC,MAAM,CAAC;QAClE,kEAAkE;KACnE,CAAC;IACF,uCAAuC,EAAE,MAAM,CAAC,MAAM,CAAC;QACrD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;IACF,wCAAwC,EAAE,MAAM,CAAC,MAAM,CAAC;QACtD,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;QAClE,kEAAkE;KACnE,CAAC;CACH,CAAC,CAAC;AACH,sEAAsE"}
|
package/dist/core/lisa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lisa.d.ts","sourceRoot":"","sources":["../../src/core/lisa.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA2BnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,iBAAiB,EAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAe9D,OAAO,KAAK,EAIV,UAAU,EACV,UAAU,EAGX,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"lisa.d.ts","sourceRoot":"","sources":["../../src/core/lisa.ts"],"names":[],"mappings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;;OAGG;IACH,OAAO,CAAC,SAAS;IAuDjB;;;OAGG;IACH,OAAO,CAAC,OAAO;IAMf;;OAEG;YACW,mBAAmB;IAajC;;OAEG;YACW,gBAAgB;IA+B9B;;OAEG;IACH,OAAO,CAAC,WAAW;IA4BnB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAqCxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAyCvB;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAgB7B;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;OAKG;YACW,WAAW;IAQzB;;;;;OAKG;YACW,qBAAqB;CAqDpC"}
|
package/dist/core/lisa.js
CHANGED
|
@@ -29,6 +29,7 @@ import { getLisaDistDir, hashFile, isRunningAsTrampoline, regenerateLockfilesInP
|
|
|
29
29
|
import { COPY_STRATEGIES, createInitialCounters, harnessIncludesAgent, } from "./config.js";
|
|
30
30
|
import { migrateInstructionFiles, relocateProjectLearningsLedger, } from "./instruction-files-migration.js";
|
|
31
31
|
import { assertSafeLearningParents, resolveSafeLearningTarget, } from "./learnings-file-safety.js";
|
|
32
|
+
import { findLocalWorkflowReferences } from "./workflow-reference-guard.js";
|
|
32
33
|
import { readProjectConfig, resolveLegacyProjectLearningsFile, resolveProjectLearningsFile, } from "./project-config.js";
|
|
33
34
|
import { decideTemplateOwnership, templateSkipDescription, } from "./template-ownership.js";
|
|
34
35
|
/**
|
|
@@ -438,6 +439,12 @@ export class Lisa {
|
|
|
438
439
|
if (!(await fse.pathExists(targetPath))) {
|
|
439
440
|
return;
|
|
440
441
|
}
|
|
442
|
+
const referencing = await findLocalWorkflowReferences(this.config.destDir, relativePath);
|
|
443
|
+
if (referencing.length > 0) {
|
|
444
|
+
logger.warn(`Kept (still called locally by ${referencing.join(", ")}): ${relativePath}`);
|
|
445
|
+
this.counters.skipped++;
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
441
448
|
if (this.config.dryRun) {
|
|
442
449
|
logger.dry(`Would delete: ${relativePath}`);
|
|
443
450
|
this.counters.deleted++;
|