@sabaiway/agent-workflow-kit 23.3.1 → 23.4.1
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/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +2 -2
- package/bridges/antigravity-cli-bridge/bin/agy-review-harness.test.mjs +7 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review-honesty.test.mjs +2 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review-model-screen.test.mjs +2 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review.sh +18 -10
- package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +50 -50
- package/bridges/antigravity-cli-bridge/bin/agy.sh +6 -2
- package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +5 -5
- package/bridges/antigravity-cli-bridge/capability.json +2 -2
- package/bridges/antigravity-cli-bridge/references/models-and-flags.md +1 -1
- package/bridges/antigravity-cli-bridge/setup/README.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +1 -1
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +73 -93
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +7 -3
- package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +6 -10
- package/bridges/codex-cli-bridge/bin/codex-fixtures-harness.test.mjs +77 -0
- package/bridges/codex-cli-bridge/bin/codex-fixtures.test.mjs +215 -0
- package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +18 -18
- package/bridges/codex-cli-bridge/bin/codex-review-honesty.test.mjs +2 -1
- package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +13 -13
- package/bridges/codex-cli-bridge/bin/codex-review.sh +17 -10
- package/bridges/codex-cli-bridge/bin/codex-review.test.mjs +30 -29
- package/bridges/codex-cli-bridge/capability.json +1 -1
- package/bridges/typesafe-jev-bridge/SKILL.md +19 -12
- package/bridges/typesafe-jev-bridge/bin/jev-ask-harness.test.mjs +109 -0
- package/bridges/typesafe-jev-bridge/bin/jev-ask.sh +9 -4
- package/bridges/typesafe-jev-bridge/bin/jev-ask.test.mjs +108 -104
- package/bridges/typesafe-jev-bridge/bin/jev-client.mjs +27 -13
- package/bridges/typesafe-jev-bridge/capability.json +11 -1
- package/capability.json +1 -1
- package/package.json +2 -1
- package/references/modes/bridge-settings.md +6 -5
- package/references/modes/coverage-check.md +1 -1
- package/tools/apply-danger-check.mjs +2 -2
- package/tools/bridge-settings-read.mjs +8 -3
- package/tools/bridge-settings.mjs +28 -43
- package/tools/coverage-check.mjs +9 -8
- package/tools/detect-backends.mjs +1 -1
- package/tools/distribution-files/retired.mjs +7 -7
- package/tools/distribution-files/scripts.mjs +10 -11
- package/tools/ensure-ops.mjs +21 -21
- package/tools/ensure-specs.mjs +10 -9
- package/tools/family-registry.mjs +4 -4
- package/tools/git-hooks.mjs +5 -5
- package/tools/manifest/schema.md +4 -1
- package/tools/manifest/validate.mjs +10 -0
- package/tools/node-evidence.mjs +14 -12
- package/tools/recommendations.mjs +2 -2
- package/tools/review-state-build.mjs +3 -2
- package/tools/review-state.mjs +1 -1
- package/tools/write-lanes.mjs +2 -2
package/tools/ensure-specs.mjs
CHANGED
|
@@ -24,16 +24,12 @@
|
|
|
24
24
|
import { readFileSync, lstatSync } from 'node:fs';
|
|
25
25
|
import { join } from 'node:path';
|
|
26
26
|
import { lstatNoFollow, writeContainedFileAtomic, writeProjectFileCreateOnly } from './atomic-write.mjs';
|
|
27
|
-
import {
|
|
27
|
+
import { readDeployedScripts } from './node-evidence.mjs';
|
|
28
28
|
import { SCRIPT_PRIORS, classifyDeployedScript } from './script-priors.mjs';
|
|
29
29
|
import { bundledImportsOf, composeFailure, composeOutcome, dependenciesFirst, nodeEvidenceRefusal, probeSeedTarget, tmpNote } from './ensure-ops.mjs';
|
|
30
30
|
import { fileLine, hookLine } from './distribution-files/index.mjs';
|
|
31
31
|
|
|
32
32
|
const OP = 'specs';
|
|
33
|
-
const READER = DEPLOYED_SCRIPTS.filter((e) => e.module === 'spec-schema');
|
|
34
|
-
const CHECKER = DEPLOYED_SCRIPTS.filter((e) => e.module === 'docs-size');
|
|
35
|
-
const REPORTER = DEPLOYED_SCRIPTS.filter((e) => e.module === 'test-reporter');
|
|
36
|
-
const COMMAND = DEPLOYED_SCRIPTS.find((e) => !e.module);
|
|
37
33
|
const STORE_ROOT_REL = 'docs/ai/specs/index.md';
|
|
38
34
|
const STORE_ROOT_TEMPLATE = ['references', 'templates', 'specs', 'index.md'];
|
|
39
35
|
const DATE_PLACEHOLDER = '{{DATE}}';
|
|
@@ -47,8 +43,13 @@ const wrongKind = (rel, kind) => composeFailure(OP, 'wrong-node-kind', `${rel}:
|
|
|
47
43
|
|
|
48
44
|
// The bundled side: the pairs, the reporter, the command and their whole import closure in write order → { files } | { refusal }.
|
|
49
45
|
const readBundles = (kitRoot, read) => {
|
|
46
|
+
const deployed = readDeployedScripts();
|
|
47
|
+
const reader = deployed.filter((e) => e.module === 'spec-schema');
|
|
48
|
+
const checker = deployed.filter((e) => e.module === 'docs-size');
|
|
49
|
+
const reporter = deployed.filter((e) => e.module === 'test-reporter');
|
|
50
|
+
const command = deployed.find((e) => !e.module);
|
|
50
51
|
const byPath = new Map();
|
|
51
|
-
const queue = [...
|
|
52
|
+
const queue = [...reader, ...checker, ...reporter, command];
|
|
52
53
|
for (const entry of queue) {
|
|
53
54
|
if (byPath.has(entry.path)) continue;
|
|
54
55
|
let bundle;
|
|
@@ -59,12 +60,12 @@ const readBundles = (kitRoot, read) => {
|
|
|
59
60
|
}
|
|
60
61
|
const imports = bundledImportsOf(entry.path, bundle);
|
|
61
62
|
byPath.set(entry.path, { path: entry.path, rel: entry.deployed, bundle, imports });
|
|
62
|
-
queue.push(...
|
|
63
|
+
queue.push(...deployed.filter((e) => imports.includes(e.path)));
|
|
63
64
|
}
|
|
64
65
|
const of = (entries) => (path) => entries.some((e) => e.path === path);
|
|
65
66
|
const group = (keep) => dependenciesFirst([...byPath.values()].filter((f) => keep(f.path)));
|
|
66
|
-
const own = [
|
|
67
|
-
return { files: [...group((p) => !own.some((is) => is(p)) && p !==
|
|
67
|
+
const own = [reader, checker, reporter].map(of);
|
|
68
|
+
return { files: [...group((p) => !own.some((is) => is(p)) && p !== command.path), ...own.flatMap(group), ...group((p) => p === command.path)] };
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
// Each folder on the way to a pair file or a file it imports, lstat-ed without following a link → a refusal or null.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// side effects on import (the isDirectRun idiom) — tests import the helpers with nothing run.
|
|
18
18
|
|
|
19
19
|
import { existsSync, statSync, readFileSync, lstatSync } from 'node:fs';
|
|
20
|
-
import { join, resolve, dirname } from 'node:path';
|
|
20
|
+
import { join, resolve, dirname, posix } from 'node:path';
|
|
21
21
|
import { fileURLToPath } from 'node:url';
|
|
22
22
|
import os from 'node:os';
|
|
23
23
|
import { resolveDir, detectBackends, findOnPath } from './detect-backends.mjs';
|
|
@@ -85,8 +85,8 @@ import { toViewModel } from './view-model.mjs';
|
|
|
85
85
|
import { render } from './renderers.mjs';
|
|
86
86
|
// The feature-spec adoption state (contract: kit/spec-adoption) — read-only leaves, no cycle.
|
|
87
87
|
import { ADOPTION, readDeclineAck, surveySpecAdoption } from './spec-adoption.mjs';
|
|
88
|
-
|
|
89
|
-
import {
|
|
88
|
+
import { KIT_COMMANDS } from '../references/scripts/run.mjs';
|
|
89
|
+
import { KIT_SCRIPTS_DIR } from './node-evidence.mjs';
|
|
90
90
|
|
|
91
91
|
// ── manifestState values — re-export the EXACT public subset family-registry exported before B1 ─────
|
|
92
92
|
// (the 7 state constants + DISPLAY_NAMES) so every existing importer (uninstall.mjs, the test suites)
|
|
@@ -357,7 +357,7 @@ export const ADR_LAYOUT_PATHS = Object.freeze({
|
|
|
357
357
|
// The DEPLOYED rotator is the discriminator: the new-scheme file names the store path, the
|
|
358
358
|
// pre-migration one does not. Never "has decisions.md, lacks adr/" — that shape false-positives a
|
|
359
359
|
// tree whose NEW rotator already reds its own gate, and every No-Node project.
|
|
360
|
-
rotator:
|
|
360
|
+
rotator: posix.join(KIT_SCRIPTS_DIR, KIT_COMMANDS['archive-decisions']),
|
|
361
361
|
storeMarker: 'docs/ai/adr',
|
|
362
362
|
});
|
|
363
363
|
const ENOENT = 'ENOENT';
|
package/tools/git-hooks.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
11
11
|
import { dirname, join, resolve } from 'node:path';
|
|
12
12
|
import { fileURLToPath } from 'node:url';
|
|
13
13
|
import { writeProjectFileCreateOnly } from './atomic-write.mjs';
|
|
14
|
-
import {
|
|
14
|
+
import { readDeployedScripts, INSTALLER_REL, readNodeEvidenceScripts, SCRIPTS_DIR } from './node-evidence.mjs';
|
|
15
15
|
import { shellQuoteArg } from './repo-lex.mjs';
|
|
16
16
|
import { GIT_MAX_BUFFER } from './git-env.mjs';
|
|
17
17
|
import { KIT_COMMAND_PATH, KIT_COMMANDS } from '../references/scripts/run.mjs';
|
|
@@ -21,7 +21,7 @@ import { readLayoutSetup } from './source-size-core.mjs';
|
|
|
21
21
|
|
|
22
22
|
const TOOLS = dirname(fileURLToPath(import.meta.url));
|
|
23
23
|
export const SCRIPTS_REL = SCRIPTS_DIR;
|
|
24
|
-
export {
|
|
24
|
+
export { readDeployedScripts, INSTALLER_REL };
|
|
25
25
|
|
|
26
26
|
const EXIT_OK = 0;
|
|
27
27
|
const EXIT_INCOMPLETE = 1;
|
|
@@ -172,7 +172,7 @@ export const planGitHooks = ({ root, variant, toolsDir = TOOLS, lstat = lstatSyn
|
|
|
172
172
|
nodes.set(rel, node);
|
|
173
173
|
return node;
|
|
174
174
|
};
|
|
175
|
-
for (const rel of enforcing ?
|
|
175
|
+
for (const rel of enforcing ? readDeployedScripts().map(({ deployed }) => deployed) : [INSTALLER_REL]) {
|
|
176
176
|
for (const folder of foldersOf(rel)) if (!nodes.has(folder)) (folders.push(folder), probe(folder, isPlainDir, 'a plain directory'));
|
|
177
177
|
probe(rel, isFile, 'a regular file');
|
|
178
178
|
}
|
|
@@ -180,8 +180,8 @@ export const planGitHooks = ({ root, variant, toolsDir = TOOLS, lstat = lstatSyn
|
|
|
180
180
|
if (variant === 'hook-checks') return planHookChecks({ root, toolsDir, installer, installerNode: nodes.get(INSTALLER_REL), lstat, readFile, deps });
|
|
181
181
|
// A flat evidence name is no copy path: another node kind there is not evidence, never a refusal.
|
|
182
182
|
const evidence = (rel) => (nodes.has(rel) ? isFile(nodes.get(rel)) : nodes.get(SCRIPTS_REL) !== null && isFile(nodeAt(join(root, rel), lstat)));
|
|
183
|
-
const deployed = enforcing &&
|
|
184
|
-
const copies = enforcing && !deployed ?
|
|
183
|
+
const deployed = enforcing && readNodeEvidenceScripts().some((name) => evidence(`${SCRIPTS_REL}/${name}`));
|
|
184
|
+
const copies = enforcing && !deployed ? readDeployedScripts().map(({ deployed: rel, bundled }) =>
|
|
185
185
|
({ rel, path: join(root, rel), action: 'created', bytes: readFile(join(toolsDir, '..', bundled)) })) : [];
|
|
186
186
|
const placed = copies.find(({ rel }) => rel === INSTALLER_REL);
|
|
187
187
|
if (!placed && !isFile(nodes.get(INSTALLER_REL))) throw refusal(`${installer} is absent — nothing here places the hook installer`);
|
package/tools/manifest/schema.md
CHANGED
|
@@ -79,9 +79,12 @@ this block). Each entry:
|
|
|
79
79
|
- `default` (string|null, **required property** — a missing key fails validation) — `null` = no
|
|
80
80
|
file default, the wrapper built-ins apply (state them in `effect`); a non-null default must
|
|
81
81
|
itself pass the kind's validation.
|
|
82
|
+
- `offered` (string[], optional; `posture` only) — when present, a non-empty array of distinct
|
|
83
|
+
strings, each passing the posture value rule, that contains the entry's string `default`.
|
|
84
|
+
On another kind, or in any other shape (`null` included), it makes the manifest invalid.
|
|
82
85
|
- `appliesTo` (string[], required) — the wrapper `cmd` names (from `roles.*.cmd` of THIS
|
|
83
86
|
manifest) that APPLY the key. Every wrapper still RECOGNIZES the whole family registry (the
|
|
84
|
-
union of
|
|
87
|
+
union of every bundled bridge's `settings` keys) and skips other wrappers' keys silently.
|
|
85
88
|
- `effect` (string, required) — what the knob does, incl. built-in defaults and any spend/risk
|
|
86
89
|
caveat (the credit-rate caveat rides here for the tier knob).
|
|
87
90
|
- `retired` (string, optional; **>= 20 chars when present**) — the STATED reason a key is kept only
|
|
@@ -610,6 +610,16 @@ export const validateManifest = (skillDir, options = {}) => {
|
|
|
610
610
|
if (!cmds.has(c)) errors.push(`${at}.appliesTo names "${c}" which is no roles.*.cmd of this manifest`);
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
+
if (Object.hasOwn(entry, 'offered')) {
|
|
614
|
+
const offered = entry.offered;
|
|
615
|
+
const validOffered = entry.kind === 'posture' && Array.isArray(offered) && offered.length > 0
|
|
616
|
+
&& offered.every((value) => typeof value === 'string' && settingValueValid(entry, value))
|
|
617
|
+
&& new Set(offered).size === offered.length
|
|
618
|
+
&& typeof entry.default === 'string' && offered.includes(entry.default);
|
|
619
|
+
if (!validOffered) {
|
|
620
|
+
errors.push(`${at}.offered (${JSON.stringify(entry.key)}) must be a non-empty array of unique posture values containing the string default (posture kind only)`);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
613
623
|
if (!SETTING_KINDS.has(entry.kind)) {
|
|
614
624
|
errors.push(`${at}.kind must be one of enum|integer|duration|boolean|posture`);
|
|
615
625
|
return; // the typed checks below are meaningless without a kind
|
package/tools/node-evidence.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// node-evidence.mjs — does Node PROVABLY run in this project tree? Contract: docs/ai/specs/kit/node-evidence.md.
|
|
2
|
-
// Pure over an injectable lstat; no writes, no
|
|
2
|
+
// Pure over an injectable lstat; no writes, no reads on import. Dependency-free, Node >= 22.
|
|
3
3
|
|
|
4
4
|
import { lstatSync } from 'node:fs';
|
|
5
5
|
import { join, posix } from 'node:path';
|
|
6
6
|
import { readFamily } from '../references/scripts/family.mjs';
|
|
7
|
+
import { KIT_COMMANDS } from '../references/scripts/run.mjs';
|
|
7
8
|
import { KIT_FOLDER_ROOT } from './source-size-config.mjs';
|
|
8
9
|
|
|
9
10
|
export const NODE_EVIDENCE = Object.freeze({
|
|
@@ -17,12 +18,12 @@ export const PACKAGE_JSON_REL = 'package.json';
|
|
|
17
18
|
export const SCRIPTS_DIR = 'scripts';
|
|
18
19
|
export const KIT_SCRIPTS_DIR = KIT_FOLDER_ROOT;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// kit
|
|
23
|
-
|
|
21
|
+
export const INSTALLER_REL = posix.join(KIT_SCRIPTS_DIR, KIT_COMMANDS['install-git-hooks']);
|
|
22
|
+
|
|
23
|
+
// The kit's one door to the script family: read at the first call, never at import; refusals escape.
|
|
24
|
+
const familyCache = {};
|
|
25
|
+
export const readDeployedScripts = () => familyCache.deployed ??= Object.freeze(readFamily().filter(({ role }) => role === 'deployed').map(({ path, module, seed }) =>
|
|
24
26
|
Object.freeze({ path, module, seed, deployed: `${KIT_SCRIPTS_DIR}/${path}`, bundled: `references/scripts/${path}` })));
|
|
25
|
-
export const INSTALLER_REL = DEPLOYED_SCRIPTS.find(({ module }) => module === 'git-hooks').deployed;
|
|
26
27
|
|
|
27
28
|
// The nine flat runnable names probed before the kit folder (frozen, so a flat deployment keeps its
|
|
28
29
|
// evidence), then the deployed manifest paths, sorted — each relative to scripts/.
|
|
@@ -38,18 +39,18 @@ const FLAT_SCRIPTS = [
|
|
|
38
39
|
'spec-schema.mjs',
|
|
39
40
|
];
|
|
40
41
|
const KIT_UNDER_SCRIPTS = posix.relative(SCRIPTS_DIR, KIT_SCRIPTS_DIR);
|
|
41
|
-
export const
|
|
42
|
+
export const readNodeEvidenceScripts = () => familyCache.scripts ??= Object.freeze([
|
|
42
43
|
...FLAT_SCRIPTS,
|
|
43
|
-
...
|
|
44
|
+
...readDeployedScripts().map(({ path }) => path).sort().map((path) => `${KIT_UNDER_SCRIPTS}/${path}`),
|
|
44
45
|
]);
|
|
45
46
|
|
|
46
|
-
export const
|
|
47
|
+
export const readNodeEvidenceProbes = () => familyCache.probes ??= Object.freeze([PACKAGE_JSON_REL, ...readNodeEvidenceScripts().map((name) => `${SCRIPTS_DIR}/${name}`)]);
|
|
47
48
|
|
|
48
49
|
const ENOENT = 'ENOENT';
|
|
49
50
|
const kindOf = (st) => (st.isSymbolicLink() ? 'a symlink' : st.isDirectory() ? 'a directory' : st.isFile() ? 'a regular file' : 'not a regular file');
|
|
50
51
|
|
|
51
52
|
const answer = (state, evidence, wrongKind, extra = {}) =>
|
|
52
|
-
Object.freeze({ state, evidence, probed:
|
|
53
|
+
Object.freeze({ state, evidence, probed: readNodeEvidenceProbes(), wrongKind: Object.freeze(wrongKind), ...extra });
|
|
53
54
|
|
|
54
55
|
// probeNodeEvidence(cwd, lstat) -> { state, evidence, probed, wrongKind, error? }: the first regular file
|
|
55
56
|
// among the probes answers; a probe failing with anything but ENOENT answers unreadable at once; a path of
|
|
@@ -57,6 +58,7 @@ const answer = (state, evidence, wrongKind, extra = {}) =>
|
|
|
57
58
|
// not follow the LEAF but walks THROUGH a symlinked folder, whose files are not this tree's — so scripts/,
|
|
58
59
|
// the kit folder and each module folder are proven plain, once each, before any script beneath counts.
|
|
59
60
|
export const probeNodeEvidence = (cwd, lstat = lstatSync) => {
|
|
61
|
+
const probes = readNodeEvidenceProbes();
|
|
60
62
|
const wrongKind = [];
|
|
61
63
|
const folders = new Map();
|
|
62
64
|
const plainFolder = (rel) => {
|
|
@@ -79,7 +81,7 @@ export const probeNodeEvidence = (cwd, lstat = lstatSync) => {
|
|
|
79
81
|
try {
|
|
80
82
|
if (probeKind(PACKAGE_JSON_REL, 'file') === 'file') return answer(NODE_EVIDENCE.PACKAGE_JSON, PACKAGE_JSON_REL, wrongKind);
|
|
81
83
|
if (plainFolder(SCRIPTS_DIR)) {
|
|
82
|
-
for (const rel of
|
|
84
|
+
for (const rel of probes.slice(1)) {
|
|
83
85
|
if (foldersOf(rel).every(plainFolder) && probeKind(rel, 'file') === 'file') return answer(NODE_EVIDENCE.DEPLOYED_SCRIPTS, rel, wrongKind);
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -93,7 +95,7 @@ export const hasNodeEvidence = (probe) => probe.state === NODE_EVIDENCE.PACKAGE_
|
|
|
93
95
|
|
|
94
96
|
// The sentence a skip line carries: every probe checked, and what of the wrong kind sat at any of them.
|
|
95
97
|
export const describeNodeProbes = (probe = null) => {
|
|
96
|
-
const probes = `${PACKAGE_JSON_REL} and the kit-seeded ${SCRIPTS_DIR}/ files (${
|
|
98
|
+
const probes = `${PACKAGE_JSON_REL} and the kit-seeded ${SCRIPTS_DIR}/ files (${readNodeEvidenceScripts().join(', ')})`;
|
|
97
99
|
const wrong = probe?.wrongKind?.length ? ` — not evidence: ${probe.wrongKind.join('; ')}` : '';
|
|
98
100
|
return `${probes}${wrong}`;
|
|
99
101
|
};
|
|
@@ -85,7 +85,7 @@ import { nearestExistingDir, worktreesGrantDir, worktreesGrantHoldsHome } from '
|
|
|
85
85
|
import { readBundledAgents, writeCheapAgents, EXECUTOR_VEHICLE } from './cheap-agents.mjs';
|
|
86
86
|
import { ATTRIBUTION_KEY, LEGACY_ATTRIBUTION_KEY, attributionHidesText, effectiveAttribution, readAttributionChoice, wrongTypedKey } from './attribution.mjs';
|
|
87
87
|
import { planGlobalRemoval } from './hide-footprint.mjs';
|
|
88
|
-
import {
|
|
88
|
+
import { readDeployedScripts, INSTALLER_REL, NODE_EVIDENCE, probeNodeEvidence } from './node-evidence.mjs';
|
|
89
89
|
// The vehicle READINESS comes from the read-only half — the same survey `recipes` and `status` read.
|
|
90
90
|
import { surveyExecutorVehicle, readExecutorPosture, agentsAccepted, readStamp, readFsDeps, AGENTS_DIR, WORKFLOW_STAMP, EXPECTED_WORKFLOW_VERSION } from './cheap-agents-read.mjs';
|
|
91
91
|
// The ack store's path, keys, lane registry, fingerprint and guarded reader live in their own leaf
|
|
@@ -1064,7 +1064,7 @@ const enforcementOffer = (root, deps) => {
|
|
|
1064
1064
|
if (!listings.has(folder)) listings.set(folder, readDir(folder));
|
|
1065
1065
|
return listings.get(folder).includes(name);
|
|
1066
1066
|
});
|
|
1067
|
-
if (!
|
|
1067
|
+
if (!readDeployedScripts().every(({ path }) => inBundle(path))) throw new Error(`${bundleRoot}: a runnable enforcement script is missing`);
|
|
1068
1068
|
// Evidence none with nothing of the wrong kind already proves the destination clean: every deployed path is a
|
|
1069
1069
|
// probe, so each is absent and scripts/, the kit folder and each module folder are absent or plain directories.
|
|
1070
1070
|
if (readHookState(root, deps).state === 'unmanaged') throw new Error(ENFORCEMENT_UNMANAGED_HOOK);
|
|
@@ -6,7 +6,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
6
6
|
import { detectBackends } from './detect-backends.mjs';
|
|
7
7
|
import { resolveActivityRecipe, DISPLAY_ALIASES, requiredBackendsForConfiguredRecipe, composeReadiness } from './recipes.mjs';
|
|
8
8
|
import { loadConfig } from './orchestration-config.mjs';
|
|
9
|
-
import { plansInFlight } from './plan-files.mjs';
|
|
9
|
+
import { plansInFlight, readPlanEntries } from './plan-files.mjs';
|
|
10
10
|
import { GIT_MAX_BUFFER, resolveGitLocation, stripGitLocationEnv, withGitPath } from './git-env.mjs';
|
|
11
11
|
import {
|
|
12
12
|
computeTreeFingerprint,
|
|
@@ -86,7 +86,8 @@ export const buildState = ({ cwd, env = process.env, detect = detectBackends, su
|
|
|
86
86
|
const resolved = resolveActivityRecipe({ config: config ?? {}, readiness: detection, activity: ACTIVITY, slot: SLOT });
|
|
87
87
|
const obligations = requiredBackendsForConfiguredRecipe({ config: config ?? {}, readiness: detection, detectionFailed: detectionWarning != null });
|
|
88
88
|
const requiredBackends = obligations.backends;
|
|
89
|
-
const
|
|
89
|
+
const entries = readPlanEntries(root);
|
|
90
|
+
const plans = plansInFlight(root, () => entries);
|
|
90
91
|
// The injected lstat threads through EVERY stat-dependent computation (fingerprint, clean, the
|
|
91
92
|
// mask count) — a partial injection would let a test observe an inconsistent state.
|
|
92
93
|
const fingerprint = location.state === 'work-tree' ? computeTreeFingerprint(cwd, { lstat, env }) : null;
|
package/tools/review-state.mjs
CHANGED
|
@@ -174,7 +174,7 @@ Sandbox-safe: runs fully inside an OS sandbox (fs + git reads, no network) — t
|
|
|
174
174
|
Human residual: git commit --no-verify and receipt-file deletion remain possible — this is a
|
|
175
175
|
self-discipline mechanism, not a security boundary.
|
|
176
176
|
|
|
177
|
-
Exit codes: 0 pass (or plain report); 1 check failed
|
|
177
|
+
Exit codes: 0 pass (or plain report); 1 check failed, config error or unreadable docs/plans (loud); 2 usage.`;
|
|
178
178
|
|
|
179
179
|
const KNOWN_ARGS = new Set(['--help', '-h', '--check', '--json']);
|
|
180
180
|
|
package/tools/write-lanes.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { join, resolve } from 'node:path';
|
|
|
2
2
|
import { dirCovers } from './declared-paths.mjs';
|
|
3
3
|
import { claudeDirOf, quoteArg, skillTargets } from './jev-facts.mjs';
|
|
4
4
|
import { targetsFor } from './jev-connect.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { readDeployedScripts, INSTALLER_REL } from './node-evidence.mjs';
|
|
6
6
|
import { dqUnsafePath } from './checker-claim.mjs';
|
|
7
7
|
import { isLineUnsafe } from './source-size-refusal.mjs';
|
|
8
8
|
import { SOURCE_SIZE_GATE_ID } from './source-size-gate-cmd.mjs';
|
|
@@ -112,7 +112,7 @@ const getStartupPaths = ({ env, home, platform }) => targetsFor({
|
|
|
112
112
|
}).filter(({ path }) => path !== null).map(({ path }) => path);
|
|
113
113
|
|
|
114
114
|
const preCommitOf = (facts) => join(facts.hooksDir ?? join(facts.root, '.git', 'hooks'), 'pre-commit');
|
|
115
|
-
const getEnforcementPaths = (facts) => [...
|
|
115
|
+
const getEnforcementPaths = (facts) => [...readDeployedScripts().map(({ deployed }) => join(facts.root, deployed)), preCommitOf(facts)];
|
|
116
116
|
const getGuardPaths = (facts) => [preCommitOf(facts), join(facts.root, INSTALLER_REL)];
|
|
117
117
|
|
|
118
118
|
const formatCommand = (argv) => argv.map(quoteArg).join(' ');
|