@codyswann/lisa 4.23.17 → 4.23.19
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-gates.mjs +29 -50
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +14 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.js +10 -10
- package/expo/copy-overwrite/scripts/bdd/discover.mjs +72 -3
- package/expo/copy-overwrite/scripts/bdd/report.mjs +4 -5
- package/expo/copy-overwrite/scripts/bdd/validate.mjs +30 -13
- 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/.codex-plugin/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- package/plugins/lisa/rules/reference/bdd-e2e-coverage.md +6 -1
- package/plugins/lisa/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/lisa/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/lisa/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- 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-copilot/rules/reference/bdd-e2e-coverage.md +6 -1
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/bdd-e2e-coverage-reference.mdc +6 -1
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- 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/plugins/src/base/rules/reference/bdd-e2e-coverage.md +6 -1
- package/plugins/src/base/skills/lisa-secrets-access/scripts/providers.mjs +23 -1
- package/plugins/src/base/skills/lisa-secrets-access/scripts/sync-secret-to-ci.mjs +8 -7
- package/plugins/src/base/skills/lisa-setup-remote-env/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-setup-remote-env/assets/setup.sh +51 -21
- package/scripts/lisa-remote-env/setup.sh +51 -21
|
@@ -330,13 +330,35 @@ export function selectRequired(selected, required) {
|
|
|
330
330
|
return new Map(required.map(name => [name, selected.get(name)]));
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Read the provider grant through the ordinary narrowing controls, then expose
|
|
335
|
+
* exactly the names authorised by one consumer.
|
|
336
|
+
*
|
|
337
|
+
* This does not widen the provider grant and deliberately does not reuse
|
|
338
|
+
* `cfg.require`: that declaration controls ordinary resolution and
|
|
339
|
+
* materialization, while specialized consumers such as propagation carry
|
|
340
|
+
* their own reviewed exact-name authorization. Keeping those views separate
|
|
341
|
+
* prevents a propagating-only credential from being written to a materialized
|
|
342
|
+
* secrets file merely to make the propagation command able to read it.
|
|
343
|
+
*
|
|
344
|
+
* Provider retrieval itself remains bounded by the provider account's grant.
|
|
345
|
+
* Supported bulk-read providers return that granted view before this process
|
|
346
|
+
* applies the narrower consumer allowlist.
|
|
347
|
+
* @param {object} cfg Resolved configuration.
|
|
348
|
+
* @param {string[]|null|undefined} required Exact names authorised for this consumer.
|
|
349
|
+
* @returns {Map<string, {value: string, note: string, id: string|null}>} The consumer-specific provider view.
|
|
350
|
+
*/
|
|
351
|
+
export function fetchNamed(cfg, required) {
|
|
352
|
+
return selectRequired(normalizeRows(fetchRaw(cfg), cfg.narrow), required);
|
|
353
|
+
}
|
|
354
|
+
|
|
333
355
|
/**
|
|
334
356
|
* Read and select in one step — the normal entry point for consumers.
|
|
335
357
|
* @param {object} cfg Resolved configuration.
|
|
336
358
|
* @returns {Map<string, {value: string, note: string, id: string|null}>} Selected secrets.
|
|
337
359
|
*/
|
|
338
360
|
export function fetchAll(cfg) {
|
|
339
|
-
return
|
|
361
|
+
return fetchNamed(cfg, cfg.require);
|
|
340
362
|
}
|
|
341
363
|
|
|
342
364
|
/**
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
import { fileURLToPath } from "node:url";
|
|
51
51
|
import { realpathSync } from "node:fs";
|
|
52
52
|
|
|
53
|
-
import { ENV_KEY,
|
|
53
|
+
import { ENV_KEY, fetchNamed } from "./providers.mjs";
|
|
54
54
|
import { readConfig } from "./surfaces.mjs";
|
|
55
55
|
|
|
56
56
|
import { boundedChildOutput } from "../../lisa-setup-workstation/scripts/bounded-child.mjs";
|
|
@@ -316,10 +316,12 @@ export function listDestination(target) {
|
|
|
316
316
|
/**
|
|
317
317
|
* Resolve the value to propagate, from the provider and nowhere else.
|
|
318
318
|
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* The exact propagating name is the allowlist for this specialized consumer;
|
|
320
|
+
* ordinary `secrets.require` still controls resolution and materialization and
|
|
321
|
+
* is intentionally not widened. A name the provider does not grant this
|
|
322
|
+
* account is refused. An `excludeKeys` entry is reported on its own terms
|
|
323
|
+
* rather than as "not available": excluding a name and declaring it
|
|
324
|
+
* propagating are contradictory instructions, and guessing which one the
|
|
323
325
|
* operator meant is how a credential ends up somewhere nobody chose. The
|
|
324
326
|
* rotation path waives an exclusion because a credential it cannot see is one
|
|
325
327
|
* it cannot write *back* to its own record; there is no equivalent argument for
|
|
@@ -336,8 +338,7 @@ export function readValue(name, cfg) {
|
|
|
336
338
|
`config; this program will not choose for you.`
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
|
-
const hit =
|
|
340
|
-
if (!hit) throw new Error(`${name} is not available to this account`);
|
|
341
|
+
const hit = fetchNamed(cfg, [name]).get(name);
|
|
341
342
|
return assertValue(name, hit.value);
|
|
342
343
|
}
|
|
343
344
|
|
|
@@ -76,7 +76,7 @@ The complete logic is repository-owned so it is reviewed, versioned, tested, and
|
|
|
76
76
|
|
|
77
77
|
`node_modules/@codyswann/lisa` is therefore the only copy present on a fresh container, and it is a good one: it is the version that project pins, which is the version its setup should run. The entrypoint searches the agent directories first and falls back to it.
|
|
78
78
|
|
|
79
|
-
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess.
|
|
79
|
+
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess. A successful install records that lockfile's digest inside `node_modules`; a cached container skips the next install only while the digest still matches, and reconciles once after a lockfile change. `LISA_SKIP_INSTALL=1` opts out without recording a false successful reconciliation.
|
|
80
80
|
|
|
81
81
|
A project with no lockfile is not fatal on its own — a checkout may carry the skill directly — so the script says so and lets the resolver decide.
|
|
82
82
|
|
|
@@ -47,25 +47,50 @@ fi
|
|
|
47
47
|
# guessed: a guessed one fails on the container's first command with an error
|
|
48
48
|
# blaming the project rather than the guess.
|
|
49
49
|
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
# A directory's presence says nothing about which lockfile produced it. Remote
|
|
51
|
+
# vendors cache containers across commits, so node_modules can exist while
|
|
52
|
+
# carrying the previous Lisa release or an otherwise stale dependency graph.
|
|
53
|
+
# Persist the reconciled lockfile signature inside node_modules instead: a
|
|
54
|
+
# matching signature is the cheap resume path, and a changed or missing one
|
|
55
|
+
# earns one frozen reinstall.
|
|
56
|
+
lock_file=""
|
|
57
|
+
install_cmd=""
|
|
58
|
+
if [ -f bun.lock ]; then lock_file="bun.lock"; install_cmd="bun install --frozen-lockfile"
|
|
59
|
+
elif [ -f bun.lockb ]; then lock_file="bun.lockb"; install_cmd="bun install --frozen-lockfile"
|
|
60
|
+
elif [ -f pnpm-lock.yaml ]; then lock_file="pnpm-lock.yaml"; install_cmd="pnpm install --frozen-lockfile"
|
|
61
|
+
elif [ -f yarn.lock ]; then
|
|
62
|
+
lock_file="yarn.lock"
|
|
63
|
+
# Yarn Classic and Berry spell the same intent differently, and each rejects
|
|
64
|
+
# the other's flag. The lockfile itself says which is in use: Yarn 1 writes a
|
|
65
|
+
# "# yarn lockfile v1" header, Berry does not.
|
|
66
|
+
if head -5 yarn.lock | grep -q "yarn lockfile v1"; then
|
|
67
|
+
install_cmd="yarn install --frozen-lockfile"
|
|
68
|
+
else
|
|
69
|
+
install_cmd="yarn install --immutable"
|
|
66
70
|
fi
|
|
71
|
+
elif [ -f package-lock.json ]; then lock_file="package-lock.json"; install_cmd="npm ci"
|
|
72
|
+
fi
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
if [ -n "$install_cmd" ]; then
|
|
75
|
+
lock_digest=$(node -e '
|
|
76
|
+
const crypto = require("node:crypto");
|
|
77
|
+
const fs = require("node:fs");
|
|
78
|
+
const path = process.argv[1];
|
|
79
|
+
process.stdout.write(
|
|
80
|
+
crypto.createHash("sha256").update(path).update("\0").update(fs.readFileSync(path)).digest("hex")
|
|
81
|
+
);
|
|
82
|
+
' "$lock_file") || {
|
|
83
|
+
echo "Could not fingerprint $lock_file; refusing to trust cached dependencies." >&2
|
|
84
|
+
exit 1
|
|
85
|
+
}
|
|
86
|
+
lock_signature="$lock_file:$lock_digest"
|
|
87
|
+
lock_marker="node_modules/.lisa-lockfile.sha256"
|
|
88
|
+
cached_lock_signature=""
|
|
89
|
+
if [ -f "$lock_marker" ]; then
|
|
90
|
+
IFS= read -r cached_lock_signature < "$lock_marker" || true
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
if [ ! -d node_modules ] || [ "$cached_lock_signature" != "$lock_signature" ]; then
|
|
69
94
|
echo "Installing dependencies with: $install_cmd"
|
|
70
95
|
# CI=1 so lifecycle scripts take their automation path and leave the
|
|
71
96
|
# checkout alone. A remote-env setup is automation by definition, and a
|
|
@@ -96,12 +121,17 @@ if [ ! -d node_modules ]; then
|
|
|
96
121
|
echo " LISA_SKIP_INSTALL=1 — not running it."
|
|
97
122
|
else
|
|
98
123
|
CI=1 $install_cmd
|
|
124
|
+
# npm ci replaces node_modules, while the other managers may update it in
|
|
125
|
+
# place. Write only after a successful install so an interrupted or
|
|
126
|
+
# explicitly skipped reconciliation never blesses a stale cache.
|
|
127
|
+
mkdir -p node_modules
|
|
128
|
+
printf '%s\n' "$lock_signature" > "$lock_marker"
|
|
99
129
|
fi
|
|
100
|
-
else
|
|
101
|
-
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
102
|
-
# skill in a checkout directory, so let the resolver below decide.
|
|
103
|
-
echo "No lockfile found; skipping dependency install." >&2
|
|
104
130
|
fi
|
|
131
|
+
elif [ ! -d node_modules ]; then
|
|
132
|
+
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
133
|
+
# skill in a checkout directory, so let the resolver below decide.
|
|
134
|
+
echo "No lockfile found; skipping dependency install." >&2
|
|
105
135
|
fi
|
|
106
136
|
|
|
107
137
|
# Where the skill lives depends on how this project's harness receives it, and
|
|
@@ -90,12 +90,17 @@ platforms it requires and that each named platform has a configured runner.
|
|
|
90
90
|
string is still there, so renaming or deleting a test breaks the map loudly instead of leaving a
|
|
91
91
|
scenario silently unguarded.
|
|
92
92
|
|
|
93
|
+
One behavior may have multiple aligned tests in the same runner. Record each distinct file/evidence
|
|
94
|
+
pair as a mapping; the obligation counts once for traceability, while every test remains separately
|
|
95
|
+
falsifiable and can join to its own execution result. Only an exact repeated mapping is a duplicate.
|
|
96
|
+
|
|
93
97
|
`testDiscovery` closes the other direction. Validating only what the map DECLARES can never see a
|
|
94
98
|
test file nobody declared, so the gate walks the project's own roots and requires **every test it
|
|
95
99
|
finds to be named by a mapping or excused by an exclusion**. Roots and the evidence grammar are
|
|
96
100
|
per-runner configuration — list every directory, including subflow and helper directories, because
|
|
97
101
|
a directory omitted here is structurally invisible to the gate. Evidence grammars are an allowlist
|
|
98
|
-
of two (`call-title` reads `test("…")`-style declarations
|
|
102
|
+
of two (`call-title` reads `test("…")`-style declarations and known test modifiers while ignoring
|
|
103
|
+
suite/helper calls such as `test.describe` and `test.step`; `line-field` reads a leading `name:`
|
|
99
104
|
field), never a project-supplied regular expression, and a template-literal title is used verbatim
|
|
100
105
|
from the source rather than rewritten. A missing block is a defect in enforced mode
|
|
101
106
|
(`discovery-missing`); a malformed one is refused in **every** state (`discovery-invalid`), because
|
|
@@ -330,13 +330,35 @@ export function selectRequired(selected, required) {
|
|
|
330
330
|
return new Map(required.map(name => [name, selected.get(name)]));
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Read the provider grant through the ordinary narrowing controls, then expose
|
|
335
|
+
* exactly the names authorised by one consumer.
|
|
336
|
+
*
|
|
337
|
+
* This does not widen the provider grant and deliberately does not reuse
|
|
338
|
+
* `cfg.require`: that declaration controls ordinary resolution and
|
|
339
|
+
* materialization, while specialized consumers such as propagation carry
|
|
340
|
+
* their own reviewed exact-name authorization. Keeping those views separate
|
|
341
|
+
* prevents a propagating-only credential from being written to a materialized
|
|
342
|
+
* secrets file merely to make the propagation command able to read it.
|
|
343
|
+
*
|
|
344
|
+
* Provider retrieval itself remains bounded by the provider account's grant.
|
|
345
|
+
* Supported bulk-read providers return that granted view before this process
|
|
346
|
+
* applies the narrower consumer allowlist.
|
|
347
|
+
* @param {object} cfg Resolved configuration.
|
|
348
|
+
* @param {string[]|null|undefined} required Exact names authorised for this consumer.
|
|
349
|
+
* @returns {Map<string, {value: string, note: string, id: string|null}>} The consumer-specific provider view.
|
|
350
|
+
*/
|
|
351
|
+
export function fetchNamed(cfg, required) {
|
|
352
|
+
return selectRequired(normalizeRows(fetchRaw(cfg), cfg.narrow), required);
|
|
353
|
+
}
|
|
354
|
+
|
|
333
355
|
/**
|
|
334
356
|
* Read and select in one step — the normal entry point for consumers.
|
|
335
357
|
* @param {object} cfg Resolved configuration.
|
|
336
358
|
* @returns {Map<string, {value: string, note: string, id: string|null}>} Selected secrets.
|
|
337
359
|
*/
|
|
338
360
|
export function fetchAll(cfg) {
|
|
339
|
-
return
|
|
361
|
+
return fetchNamed(cfg, cfg.require);
|
|
340
362
|
}
|
|
341
363
|
|
|
342
364
|
/**
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
import { fileURLToPath } from "node:url";
|
|
51
51
|
import { realpathSync } from "node:fs";
|
|
52
52
|
|
|
53
|
-
import { ENV_KEY,
|
|
53
|
+
import { ENV_KEY, fetchNamed } from "./providers.mjs";
|
|
54
54
|
import { readConfig } from "./surfaces.mjs";
|
|
55
55
|
|
|
56
56
|
import { boundedChildOutput } from "../../lisa-setup-workstation/scripts/bounded-child.mjs";
|
|
@@ -316,10 +316,12 @@ export function listDestination(target) {
|
|
|
316
316
|
/**
|
|
317
317
|
* Resolve the value to propagate, from the provider and nowhere else.
|
|
318
318
|
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* The exact propagating name is the allowlist for this specialized consumer;
|
|
320
|
+
* ordinary `secrets.require` still controls resolution and materialization and
|
|
321
|
+
* is intentionally not widened. A name the provider does not grant this
|
|
322
|
+
* account is refused. An `excludeKeys` entry is reported on its own terms
|
|
323
|
+
* rather than as "not available": excluding a name and declaring it
|
|
324
|
+
* propagating are contradictory instructions, and guessing which one the
|
|
323
325
|
* operator meant is how a credential ends up somewhere nobody chose. The
|
|
324
326
|
* rotation path waives an exclusion because a credential it cannot see is one
|
|
325
327
|
* it cannot write *back* to its own record; there is no equivalent argument for
|
|
@@ -336,8 +338,7 @@ export function readValue(name, cfg) {
|
|
|
336
338
|
`config; this program will not choose for you.`
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
|
-
const hit =
|
|
340
|
-
if (!hit) throw new Error(`${name} is not available to this account`);
|
|
341
|
+
const hit = fetchNamed(cfg, [name]).get(name);
|
|
341
342
|
return assertValue(name, hit.value);
|
|
342
343
|
}
|
|
343
344
|
|
|
@@ -76,7 +76,7 @@ The complete logic is repository-owned so it is reviewed, versioned, tested, and
|
|
|
76
76
|
|
|
77
77
|
`node_modules/@codyswann/lisa` is therefore the only copy present on a fresh container, and it is a good one: it is the version that project pins, which is the version its setup should run. The entrypoint searches the agent directories first and falls back to it.
|
|
78
78
|
|
|
79
|
-
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess.
|
|
79
|
+
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess. A successful install records that lockfile's digest inside `node_modules`; a cached container skips the next install only while the digest still matches, and reconciles once after a lockfile change. `LISA_SKIP_INSTALL=1` opts out without recording a false successful reconciliation.
|
|
80
80
|
|
|
81
81
|
A project with no lockfile is not fatal on its own — a checkout may carry the skill directly — so the script says so and lets the resolver decide.
|
|
82
82
|
|
|
@@ -47,25 +47,50 @@ fi
|
|
|
47
47
|
# guessed: a guessed one fails on the container's first command with an error
|
|
48
48
|
# blaming the project rather than the guess.
|
|
49
49
|
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
# A directory's presence says nothing about which lockfile produced it. Remote
|
|
51
|
+
# vendors cache containers across commits, so node_modules can exist while
|
|
52
|
+
# carrying the previous Lisa release or an otherwise stale dependency graph.
|
|
53
|
+
# Persist the reconciled lockfile signature inside node_modules instead: a
|
|
54
|
+
# matching signature is the cheap resume path, and a changed or missing one
|
|
55
|
+
# earns one frozen reinstall.
|
|
56
|
+
lock_file=""
|
|
57
|
+
install_cmd=""
|
|
58
|
+
if [ -f bun.lock ]; then lock_file="bun.lock"; install_cmd="bun install --frozen-lockfile"
|
|
59
|
+
elif [ -f bun.lockb ]; then lock_file="bun.lockb"; install_cmd="bun install --frozen-lockfile"
|
|
60
|
+
elif [ -f pnpm-lock.yaml ]; then lock_file="pnpm-lock.yaml"; install_cmd="pnpm install --frozen-lockfile"
|
|
61
|
+
elif [ -f yarn.lock ]; then
|
|
62
|
+
lock_file="yarn.lock"
|
|
63
|
+
# Yarn Classic and Berry spell the same intent differently, and each rejects
|
|
64
|
+
# the other's flag. The lockfile itself says which is in use: Yarn 1 writes a
|
|
65
|
+
# "# yarn lockfile v1" header, Berry does not.
|
|
66
|
+
if head -5 yarn.lock | grep -q "yarn lockfile v1"; then
|
|
67
|
+
install_cmd="yarn install --frozen-lockfile"
|
|
68
|
+
else
|
|
69
|
+
install_cmd="yarn install --immutable"
|
|
66
70
|
fi
|
|
71
|
+
elif [ -f package-lock.json ]; then lock_file="package-lock.json"; install_cmd="npm ci"
|
|
72
|
+
fi
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
if [ -n "$install_cmd" ]; then
|
|
75
|
+
lock_digest=$(node -e '
|
|
76
|
+
const crypto = require("node:crypto");
|
|
77
|
+
const fs = require("node:fs");
|
|
78
|
+
const path = process.argv[1];
|
|
79
|
+
process.stdout.write(
|
|
80
|
+
crypto.createHash("sha256").update(path).update("\0").update(fs.readFileSync(path)).digest("hex")
|
|
81
|
+
);
|
|
82
|
+
' "$lock_file") || {
|
|
83
|
+
echo "Could not fingerprint $lock_file; refusing to trust cached dependencies." >&2
|
|
84
|
+
exit 1
|
|
85
|
+
}
|
|
86
|
+
lock_signature="$lock_file:$lock_digest"
|
|
87
|
+
lock_marker="node_modules/.lisa-lockfile.sha256"
|
|
88
|
+
cached_lock_signature=""
|
|
89
|
+
if [ -f "$lock_marker" ]; then
|
|
90
|
+
IFS= read -r cached_lock_signature < "$lock_marker" || true
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
if [ ! -d node_modules ] || [ "$cached_lock_signature" != "$lock_signature" ]; then
|
|
69
94
|
echo "Installing dependencies with: $install_cmd"
|
|
70
95
|
# CI=1 so lifecycle scripts take their automation path and leave the
|
|
71
96
|
# checkout alone. A remote-env setup is automation by definition, and a
|
|
@@ -96,12 +121,17 @@ if [ ! -d node_modules ]; then
|
|
|
96
121
|
echo " LISA_SKIP_INSTALL=1 — not running it."
|
|
97
122
|
else
|
|
98
123
|
CI=1 $install_cmd
|
|
124
|
+
# npm ci replaces node_modules, while the other managers may update it in
|
|
125
|
+
# place. Write only after a successful install so an interrupted or
|
|
126
|
+
# explicitly skipped reconciliation never blesses a stale cache.
|
|
127
|
+
mkdir -p node_modules
|
|
128
|
+
printf '%s\n' "$lock_signature" > "$lock_marker"
|
|
99
129
|
fi
|
|
100
|
-
else
|
|
101
|
-
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
102
|
-
# skill in a checkout directory, so let the resolver below decide.
|
|
103
|
-
echo "No lockfile found; skipping dependency install." >&2
|
|
104
130
|
fi
|
|
131
|
+
elif [ ! -d node_modules ]; then
|
|
132
|
+
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
133
|
+
# skill in a checkout directory, so let the resolver below decide.
|
|
134
|
+
echo "No lockfile found; skipping dependency install." >&2
|
|
105
135
|
fi
|
|
106
136
|
|
|
107
137
|
# Where the skill lives depends on how this project's harness receives it, and
|
|
@@ -330,13 +330,35 @@ export function selectRequired(selected, required) {
|
|
|
330
330
|
return new Map(required.map(name => [name, selected.get(name)]));
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Read the provider grant through the ordinary narrowing controls, then expose
|
|
335
|
+
* exactly the names authorised by one consumer.
|
|
336
|
+
*
|
|
337
|
+
* This does not widen the provider grant and deliberately does not reuse
|
|
338
|
+
* `cfg.require`: that declaration controls ordinary resolution and
|
|
339
|
+
* materialization, while specialized consumers such as propagation carry
|
|
340
|
+
* their own reviewed exact-name authorization. Keeping those views separate
|
|
341
|
+
* prevents a propagating-only credential from being written to a materialized
|
|
342
|
+
* secrets file merely to make the propagation command able to read it.
|
|
343
|
+
*
|
|
344
|
+
* Provider retrieval itself remains bounded by the provider account's grant.
|
|
345
|
+
* Supported bulk-read providers return that granted view before this process
|
|
346
|
+
* applies the narrower consumer allowlist.
|
|
347
|
+
* @param {object} cfg Resolved configuration.
|
|
348
|
+
* @param {string[]|null|undefined} required Exact names authorised for this consumer.
|
|
349
|
+
* @returns {Map<string, {value: string, note: string, id: string|null}>} The consumer-specific provider view.
|
|
350
|
+
*/
|
|
351
|
+
export function fetchNamed(cfg, required) {
|
|
352
|
+
return selectRequired(normalizeRows(fetchRaw(cfg), cfg.narrow), required);
|
|
353
|
+
}
|
|
354
|
+
|
|
333
355
|
/**
|
|
334
356
|
* Read and select in one step — the normal entry point for consumers.
|
|
335
357
|
* @param {object} cfg Resolved configuration.
|
|
336
358
|
* @returns {Map<string, {value: string, note: string, id: string|null}>} Selected secrets.
|
|
337
359
|
*/
|
|
338
360
|
export function fetchAll(cfg) {
|
|
339
|
-
return
|
|
361
|
+
return fetchNamed(cfg, cfg.require);
|
|
340
362
|
}
|
|
341
363
|
|
|
342
364
|
/**
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
import { fileURLToPath } from "node:url";
|
|
51
51
|
import { realpathSync } from "node:fs";
|
|
52
52
|
|
|
53
|
-
import { ENV_KEY,
|
|
53
|
+
import { ENV_KEY, fetchNamed } from "./providers.mjs";
|
|
54
54
|
import { readConfig } from "./surfaces.mjs";
|
|
55
55
|
|
|
56
56
|
import { boundedChildOutput } from "../../lisa-setup-workstation/scripts/bounded-child.mjs";
|
|
@@ -316,10 +316,12 @@ export function listDestination(target) {
|
|
|
316
316
|
/**
|
|
317
317
|
* Resolve the value to propagate, from the provider and nowhere else.
|
|
318
318
|
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* The exact propagating name is the allowlist for this specialized consumer;
|
|
320
|
+
* ordinary `secrets.require` still controls resolution and materialization and
|
|
321
|
+
* is intentionally not widened. A name the provider does not grant this
|
|
322
|
+
* account is refused. An `excludeKeys` entry is reported on its own terms
|
|
323
|
+
* rather than as "not available": excluding a name and declaring it
|
|
324
|
+
* propagating are contradictory instructions, and guessing which one the
|
|
323
325
|
* operator meant is how a credential ends up somewhere nobody chose. The
|
|
324
326
|
* rotation path waives an exclusion because a credential it cannot see is one
|
|
325
327
|
* it cannot write *back* to its own record; there is no equivalent argument for
|
|
@@ -336,8 +338,7 @@ export function readValue(name, cfg) {
|
|
|
336
338
|
`config; this program will not choose for you.`
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
|
-
const hit =
|
|
340
|
-
if (!hit) throw new Error(`${name} is not available to this account`);
|
|
341
|
+
const hit = fetchNamed(cfg, [name]).get(name);
|
|
341
342
|
return assertValue(name, hit.value);
|
|
342
343
|
}
|
|
343
344
|
|
|
@@ -76,7 +76,7 @@ The complete logic is repository-owned so it is reviewed, versioned, tested, and
|
|
|
76
76
|
|
|
77
77
|
`node_modules/@codyswann/lisa` is therefore the only copy present on a fresh container, and it is a good one: it is the version that project pins, which is the version its setup should run. The entrypoint searches the agent directories first and falls back to it.
|
|
78
78
|
|
|
79
|
-
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess.
|
|
79
|
+
So the install has to happen before the runner is resolved — and the entrypoint does it, rather than the settings field. Which package manager is read from the lockfile the project actually commits (`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`), never guessed: a guessed one fails on the container's first command with an error that blames the project rather than the guess. A successful install records that lockfile's digest inside `node_modules`; a cached container skips the next install only while the digest still matches, and reconciles once after a lockfile change. `LISA_SKIP_INSTALL=1` opts out without recording a false successful reconciliation.
|
|
80
80
|
|
|
81
81
|
A project with no lockfile is not fatal on its own — a checkout may carry the skill directly — so the script says so and lets the resolver decide.
|
|
82
82
|
|
|
@@ -47,25 +47,50 @@ fi
|
|
|
47
47
|
# guessed: a guessed one fails on the container's first command with an error
|
|
48
48
|
# blaming the project rather than the guess.
|
|
49
49
|
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
# A directory's presence says nothing about which lockfile produced it. Remote
|
|
51
|
+
# vendors cache containers across commits, so node_modules can exist while
|
|
52
|
+
# carrying the previous Lisa release or an otherwise stale dependency graph.
|
|
53
|
+
# Persist the reconciled lockfile signature inside node_modules instead: a
|
|
54
|
+
# matching signature is the cheap resume path, and a changed or missing one
|
|
55
|
+
# earns one frozen reinstall.
|
|
56
|
+
lock_file=""
|
|
57
|
+
install_cmd=""
|
|
58
|
+
if [ -f bun.lock ]; then lock_file="bun.lock"; install_cmd="bun install --frozen-lockfile"
|
|
59
|
+
elif [ -f bun.lockb ]; then lock_file="bun.lockb"; install_cmd="bun install --frozen-lockfile"
|
|
60
|
+
elif [ -f pnpm-lock.yaml ]; then lock_file="pnpm-lock.yaml"; install_cmd="pnpm install --frozen-lockfile"
|
|
61
|
+
elif [ -f yarn.lock ]; then
|
|
62
|
+
lock_file="yarn.lock"
|
|
63
|
+
# Yarn Classic and Berry spell the same intent differently, and each rejects
|
|
64
|
+
# the other's flag. The lockfile itself says which is in use: Yarn 1 writes a
|
|
65
|
+
# "# yarn lockfile v1" header, Berry does not.
|
|
66
|
+
if head -5 yarn.lock | grep -q "yarn lockfile v1"; then
|
|
67
|
+
install_cmd="yarn install --frozen-lockfile"
|
|
68
|
+
else
|
|
69
|
+
install_cmd="yarn install --immutable"
|
|
66
70
|
fi
|
|
71
|
+
elif [ -f package-lock.json ]; then lock_file="package-lock.json"; install_cmd="npm ci"
|
|
72
|
+
fi
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
if [ -n "$install_cmd" ]; then
|
|
75
|
+
lock_digest=$(node -e '
|
|
76
|
+
const crypto = require("node:crypto");
|
|
77
|
+
const fs = require("node:fs");
|
|
78
|
+
const path = process.argv[1];
|
|
79
|
+
process.stdout.write(
|
|
80
|
+
crypto.createHash("sha256").update(path).update("\0").update(fs.readFileSync(path)).digest("hex")
|
|
81
|
+
);
|
|
82
|
+
' "$lock_file") || {
|
|
83
|
+
echo "Could not fingerprint $lock_file; refusing to trust cached dependencies." >&2
|
|
84
|
+
exit 1
|
|
85
|
+
}
|
|
86
|
+
lock_signature="$lock_file:$lock_digest"
|
|
87
|
+
lock_marker="node_modules/.lisa-lockfile.sha256"
|
|
88
|
+
cached_lock_signature=""
|
|
89
|
+
if [ -f "$lock_marker" ]; then
|
|
90
|
+
IFS= read -r cached_lock_signature < "$lock_marker" || true
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
if [ ! -d node_modules ] || [ "$cached_lock_signature" != "$lock_signature" ]; then
|
|
69
94
|
echo "Installing dependencies with: $install_cmd"
|
|
70
95
|
# CI=1 so lifecycle scripts take their automation path and leave the
|
|
71
96
|
# checkout alone. A remote-env setup is automation by definition, and a
|
|
@@ -96,12 +121,17 @@ if [ ! -d node_modules ]; then
|
|
|
96
121
|
echo " LISA_SKIP_INSTALL=1 — not running it."
|
|
97
122
|
else
|
|
98
123
|
CI=1 $install_cmd
|
|
124
|
+
# npm ci replaces node_modules, while the other managers may update it in
|
|
125
|
+
# place. Write only after a successful install so an interrupted or
|
|
126
|
+
# explicitly skipped reconciliation never blesses a stale cache.
|
|
127
|
+
mkdir -p node_modules
|
|
128
|
+
printf '%s\n' "$lock_signature" > "$lock_marker"
|
|
99
129
|
fi
|
|
100
|
-
else
|
|
101
|
-
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
102
|
-
# skill in a checkout directory, so let the resolver below decide.
|
|
103
|
-
echo "No lockfile found; skipping dependency install." >&2
|
|
104
130
|
fi
|
|
131
|
+
elif [ ! -d node_modules ]; then
|
|
132
|
+
# Not fatal on its own. A project may carry no lockfile and still have the
|
|
133
|
+
# skill in a checkout directory, so let the resolver below decide.
|
|
134
|
+
echo "No lockfile found; skipping dependency install." >&2
|
|
105
135
|
fi
|
|
106
136
|
|
|
107
137
|
# Where the skill lives depends on how this project's harness receives it, and
|