@codyswann/lisa 2.281.0 → 2.282.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-contents/gitignore +2 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +20 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/standards-proof-cmd.d.ts +7 -0
- package/dist/cli/standards-proof-cmd.d.ts.map +1 -0
- package/dist/cli/standards-proof-cmd.js +14 -0
- package/dist/cli/standards-proof-cmd.js.map +1 -0
- package/dist/cli/ui-setup-readiness-local.d.ts +2 -1
- package/dist/cli/ui-setup-readiness-local.d.ts.map +1 -1
- package/dist/cli/ui-setup-readiness-local.js +4 -2
- package/dist/cli/ui-setup-readiness-local.js.map +1 -1
- package/dist/cli/ui-setup-readiness.d.ts.map +1 -1
- package/dist/cli/ui-setup-readiness.js +3 -2
- package/dist/cli/ui-setup-readiness.js.map +1 -1
- package/dist/cli/update-check-hook.d.ts +19 -0
- package/dist/cli/update-check-hook.d.ts.map +1 -0
- package/dist/cli/update-check-hook.js +36 -0
- package/dist/cli/update-check-hook.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +37 -6
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/standards/capture.d.ts +41 -0
- package/dist/standards/capture.d.ts.map +1 -0
- package/dist/standards/capture.js +196 -0
- package/dist/standards/capture.js.map +1 -0
- package/dist/standards/contract.d.ts +45 -0
- package/dist/standards/contract.d.ts.map +1 -0
- package/dist/standards/contract.js +175 -0
- package/dist/standards/contract.js.map +1 -0
- package/dist/standards/git-state.d.ts +30 -0
- package/dist/standards/git-state.d.ts.map +1 -0
- package/dist/standards/git-state.js +179 -0
- package/dist/standards/git-state.js.map +1 -0
- package/dist/standards/index.d.ts +8 -0
- package/dist/standards/index.d.ts.map +1 -0
- package/dist/standards/index.js +8 -0
- package/dist/standards/index.js.map +1 -0
- package/dist/standards/readiness.d.ts +11 -0
- package/dist/standards/readiness.d.ts.map +1 -0
- package/dist/standards/readiness.js +170 -0
- package/dist/standards/readiness.js.map +1 -0
- package/dist/standards/registry.d.ts +42 -0
- package/dist/standards/registry.d.ts.map +1 -0
- package/dist/standards/registry.js +330 -0
- package/dist/standards/registry.js.map +1 -0
- package/dist/standards/storage-reasons.d.ts +15 -0
- package/dist/standards/storage-reasons.d.ts.map +1 -0
- package/dist/standards/storage-reasons.js +48 -0
- package/dist/standards/storage-reasons.js.map +1 -0
- package/dist/standards/storage.d.ts +36 -0
- package/dist/standards/storage.d.ts.map +1 -0
- package/dist/standards/storage.js +330 -0
- package/dist/standards/storage.js.map +1 -0
- package/dist/standards/test-evidence.d.ts +19 -0
- package/dist/standards/test-evidence.d.ts.map +1 -0
- package/dist/standards/test-evidence.js +195 -0
- package/dist/standards/test-evidence.js.map +1 -0
- package/package.json +1 -1
- 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-doctor/SKILL.md +21 -3
- package/plugins/lisa/scripts/doctor-report.mjs +266 -22
- package/plugins/lisa/skills/lisa-doctor/SKILL.md +21 -3
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/doctor-report.mjs +266 -22
- package/plugins/lisa-agy/skills/lisa-doctor/SKILL.md +21 -3
- 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/scripts/doctor-report.mjs +266 -22
- package/plugins/lisa-copilot/skills/lisa-doctor/SKILL.md +21 -3
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/doctor-report.mjs +266 -22
- package/plugins/lisa-cursor/skills/lisa-doctor/SKILL.md +21 -3
- 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/scripts/doctor-report.mjs +266 -22
- package/plugins/src/base/skills/lisa-doctor/SKILL.md +21 -3
- package/rails/copy-overwrite/lefthook.yml +9 -11
- package/rails/copy-overwrite/scripts/lisa-clean-git-env.sh +13 -0
- package/typescript/copy-contents/.husky/pre-push +9 -0
- package/ui/index.html +3 -2
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/** Bounded, no-shell Git observation for standards proof freshness. */
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
3
|
+
import { realpath } from "node:fs/promises";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
const execFileAsync = promisify(execFile);
|
|
6
|
+
const GIT_TIMEOUT_MS = 5_000;
|
|
7
|
+
const MAX_GIT_OUTPUT_BYTES = 64 * 1024;
|
|
8
|
+
/**
|
|
9
|
+
* Read canonical identity, commit/tree objects, and complete nonignored dirt.
|
|
10
|
+
* Git optional locks and fsmonitor are disabled because UI observation must be
|
|
11
|
+
* read-only and safe to repeat.
|
|
12
|
+
* @param projectRoot - Path within the repository
|
|
13
|
+
* @returns Bounded repository state
|
|
14
|
+
*/
|
|
15
|
+
export async function readStandardsGitState(projectRoot) {
|
|
16
|
+
const requested = await realpath(projectRoot);
|
|
17
|
+
const root = await realpath(await git(requested, ["rev-parse", "--show-toplevel"]));
|
|
18
|
+
const remoteNames = (await git(root, ["remote"], true))
|
|
19
|
+
.split("\n")
|
|
20
|
+
.map(value => value.trim())
|
|
21
|
+
.filter(Boolean);
|
|
22
|
+
const remoteUrls = remoteNames.includes("origin")
|
|
23
|
+
? (await git(root, ["remote", "get-url", "--all", "origin"]))
|
|
24
|
+
.split("\n")
|
|
25
|
+
.map(value => value.trim())
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
: [];
|
|
28
|
+
if (remoteUrls.length !== 1) {
|
|
29
|
+
throw new Error(remoteUrls.length === 0
|
|
30
|
+
? "Repository origin is missing."
|
|
31
|
+
: "Repository origin is ambiguous.");
|
|
32
|
+
}
|
|
33
|
+
const [head, tree, status] = await Promise.all([
|
|
34
|
+
git(root, ["rev-parse", "HEAD"]),
|
|
35
|
+
git(root, ["rev-parse", "HEAD^{tree}"]),
|
|
36
|
+
git(root, [
|
|
37
|
+
"status",
|
|
38
|
+
"--porcelain=v1",
|
|
39
|
+
"--untracked-files=all",
|
|
40
|
+
"--ignore-submodules=none",
|
|
41
|
+
"--",
|
|
42
|
+
".",
|
|
43
|
+
":(exclude).lisa/standards/latest.json",
|
|
44
|
+
], true),
|
|
45
|
+
]);
|
|
46
|
+
return Object.freeze({
|
|
47
|
+
root,
|
|
48
|
+
identity: normalizeGitRemoteIdentity(remoteUrls[0]),
|
|
49
|
+
head,
|
|
50
|
+
tree,
|
|
51
|
+
clean: status.length === 0,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Require a parent commit for the non-vacuous threshold-ratchet comparison.
|
|
56
|
+
* @param projectRoot - Canonical repository root
|
|
57
|
+
* @returns Parent commit object identifier
|
|
58
|
+
*/
|
|
59
|
+
export async function requireStandardsBaseCommit(projectRoot) {
|
|
60
|
+
try {
|
|
61
|
+
return await git(projectRoot, ["rev-parse", "HEAD^"]);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
const isShallow = (await git(projectRoot, ["rev-parse", "--is-shallow-repository"])) ===
|
|
65
|
+
"true";
|
|
66
|
+
if (isShallow) {
|
|
67
|
+
throw new Error("Standards proof requires more Git history for threshold comparison in a shallow clone. Run `git fetch --deepen=1` and retry.");
|
|
68
|
+
}
|
|
69
|
+
throw new Error("Standards proof requires a parent commit for threshold comparison.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Normalize HTTPS, SSH URL, and SCP-like remotes to host[:port]/owner/repo.
|
|
74
|
+
* Credentials are never retained and default transport ports are removed.
|
|
75
|
+
* @param remote - One configured origin URL
|
|
76
|
+
* @returns Stable lowercase repository identity
|
|
77
|
+
*/
|
|
78
|
+
export function normalizeGitRemoteIdentity(remote) {
|
|
79
|
+
const trimmed = remote.trim();
|
|
80
|
+
const scp = /^(?:[^@/:]+@)?([^/:]+):(.+)$/u.exec(trimmed);
|
|
81
|
+
if (scp && !trimmed.includes("://")) {
|
|
82
|
+
return finishIdentity(scp[1], scp[2]);
|
|
83
|
+
}
|
|
84
|
+
const parsed = parseRemoteUrl(trimmed);
|
|
85
|
+
if (!["https:", "http:", "ssh:", "git:"].includes(parsed.protocol)) {
|
|
86
|
+
throw new Error("Repository origin uses an unsupported protocol.");
|
|
87
|
+
}
|
|
88
|
+
const defaultPort = (parsed.protocol === "https:" && parsed.port === "443") ||
|
|
89
|
+
(parsed.protocol === "http:" && parsed.port === "80") ||
|
|
90
|
+
((parsed.protocol === "ssh:" || parsed.protocol === "git:") &&
|
|
91
|
+
parsed.port === "22");
|
|
92
|
+
const authority = `${parsed.hostname}${parsed.port && !defaultPort ? `:${parsed.port}` : ""}`;
|
|
93
|
+
return finishIdentity(authority, parsed.pathname);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Complete and validate a normalized repository identity.
|
|
97
|
+
* @param authority - Lower-level remote host and optional non-default port
|
|
98
|
+
* @param pathname - Remote repository path
|
|
99
|
+
* @returns Normalized stable repository identity
|
|
100
|
+
*/
|
|
101
|
+
function finishIdentity(authority, pathname) {
|
|
102
|
+
const normalizedPath = pathname
|
|
103
|
+
.split("/")
|
|
104
|
+
.filter(Boolean)
|
|
105
|
+
.join("/")
|
|
106
|
+
.replace(/\.git$/iu, "")
|
|
107
|
+
.toLowerCase();
|
|
108
|
+
const normalizedAuthority = authority.toLowerCase();
|
|
109
|
+
if (normalizedAuthority.length === 0 ||
|
|
110
|
+
normalizedPath.length === 0 ||
|
|
111
|
+
normalizedPath.includes("..") ||
|
|
112
|
+
!normalizedPath.includes("/")) {
|
|
113
|
+
throw new Error("Repository origin does not identify an owner/repository.");
|
|
114
|
+
}
|
|
115
|
+
return `${normalizedAuthority}/${normalizedPath}`;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Parse one URL without retaining credentials in any result.
|
|
119
|
+
* @param remote - Remote URL candidate
|
|
120
|
+
* @returns Parsed URL object
|
|
121
|
+
*/
|
|
122
|
+
function parseRemoteUrl(remote) {
|
|
123
|
+
try {
|
|
124
|
+
return new URL(remote);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
throw new Error("Repository origin is not a supported Git remote URL.");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Run one bounded read-only Git command without shell interpolation.
|
|
132
|
+
* @param cwd - Repository working directory
|
|
133
|
+
* @param args - Fixed Git arguments
|
|
134
|
+
* @param allowEmpty - Whether an empty stdout value is valid
|
|
135
|
+
* @returns Trimmed bounded stdout
|
|
136
|
+
*/
|
|
137
|
+
async function git(cwd, args, allowEmpty = false) {
|
|
138
|
+
try {
|
|
139
|
+
const { stdout } = await execFileAsync("git", [
|
|
140
|
+
"-c",
|
|
141
|
+
"core.fsmonitor=false",
|
|
142
|
+
"-c",
|
|
143
|
+
"core.untrackedCache=false",
|
|
144
|
+
...args,
|
|
145
|
+
], {
|
|
146
|
+
cwd,
|
|
147
|
+
timeout: GIT_TIMEOUT_MS,
|
|
148
|
+
maxBuffer: MAX_GIT_OUTPUT_BYTES,
|
|
149
|
+
encoding: "utf8",
|
|
150
|
+
env: {
|
|
151
|
+
...getProcessEnvironment(),
|
|
152
|
+
GIT_OPTIONAL_LOCKS: "0",
|
|
153
|
+
GIT_DIR: undefined,
|
|
154
|
+
GIT_WORK_TREE: undefined,
|
|
155
|
+
GIT_INDEX_FILE: undefined,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
const output = stdout.trim();
|
|
159
|
+
if (!allowEmpty && output.length === 0) {
|
|
160
|
+
throw new Error("Git returned no repository state.");
|
|
161
|
+
}
|
|
162
|
+
return output;
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
if (error instanceof Error && error.message.startsWith("Repository ")) {
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
throw new Error("Git repository state could not be observed.");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Read the CLI environment at one reviewable process boundary.
|
|
173
|
+
* @returns Current process environment
|
|
174
|
+
*/
|
|
175
|
+
function getProcessEnvironment() {
|
|
176
|
+
// eslint-disable-next-line no-restricted-syntax -- Git must inherit the operator toolchain while clearing repository redirects
|
|
177
|
+
return process.env;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=git-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-state.js","sourceRoot":"","sources":["../../src/standards/git-state.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,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AM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACtE,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,+HAA+H;IAC/H,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./capture.js";
|
|
2
|
+
export * from "./contract.js";
|
|
3
|
+
export * from "./git-state.js";
|
|
4
|
+
export * from "./readiness.js";
|
|
5
|
+
export * from "./registry.js";
|
|
6
|
+
export * from "./storage.js";
|
|
7
|
+
export * from "./test-evidence.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standards/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./capture.js";
|
|
2
|
+
export * from "./contract.js";
|
|
3
|
+
export * from "./git-state.js";
|
|
4
|
+
export * from "./readiness.js";
|
|
5
|
+
export * from "./registry.js";
|
|
6
|
+
export * from "./storage.js";
|
|
7
|
+
export * from "./test-evidence.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standards/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SetupReadinessFinding } from "../cli/ui-setup-readiness-contract.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validate the stored proof against current Git, stack, config, registry, and
|
|
4
|
+
* Lisa version without executing project commands or writing any state.
|
|
5
|
+
* Strict recomputation rejects casual tampering; defending against a malicious
|
|
6
|
+
* actor who can rewrite both repository inputs and local proof is out of scope.
|
|
7
|
+
* @param projectRoot - Canonical project root
|
|
8
|
+
* @returns setup.standards proof contribution
|
|
9
|
+
*/
|
|
10
|
+
export declare function standardsProofFinding(projectRoot: string): Promise<SetupReadinessFinding>;
|
|
11
|
+
//# sourceMappingURL=readiness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../../src/standards/readiness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAoBnF;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC,CA8BhC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** Read-only setup.standards proof validation and freshness recomputation. */
|
|
2
|
+
import { getPackageVersion } from "../cli/version.js";
|
|
3
|
+
import { readConfinedDetectedStacks } from "../cli/ui-detected-stacks.js";
|
|
4
|
+
import { readConfinedMergedConfig } from "../cli/ui-confined-project-read.js";
|
|
5
|
+
import { setupFinding } from "../cli/ui-setup-readiness-contract.js";
|
|
6
|
+
import { readStandardsGitState } from "./git-state.js";
|
|
7
|
+
import { resolveStandardsCheckPlan, } from "./registry.js";
|
|
8
|
+
import { readStandardsProof } from "./storage.js";
|
|
9
|
+
const STANDARDS_FINDING_ID = "setup.standards";
|
|
10
|
+
const PROOF_COMMAND_HINT = "Run lisa standards-proof.";
|
|
11
|
+
const OBSERVATION_REASONS = Object.freeze({
|
|
12
|
+
git: "Git repository identity and state could not be observed",
|
|
13
|
+
stacks: "project stack detection could not be completed",
|
|
14
|
+
config: "local Lisa configuration is malformed or unreadable",
|
|
15
|
+
plan: "required standards check plan is incomplete or unavailable",
|
|
16
|
+
generic: "current standards proof inputs could not be observed",
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Validate the stored proof against current Git, stack, config, registry, and
|
|
20
|
+
* Lisa version without executing project commands or writing any state.
|
|
21
|
+
* Strict recomputation rejects casual tampering; defending against a malicious
|
|
22
|
+
* actor who can rewrite both repository inputs and local proof is out of scope.
|
|
23
|
+
* @param projectRoot - Canonical project root
|
|
24
|
+
* @returns setup.standards proof contribution
|
|
25
|
+
*/
|
|
26
|
+
export async function standardsProofFinding(projectRoot) {
|
|
27
|
+
const stored = await readStandardsProof(projectRoot);
|
|
28
|
+
if (stored.status === "missing") {
|
|
29
|
+
return setupFinding(STANDARDS_FINDING_ID, "warn", `Standards proof is missing. ${PROOF_COMMAND_HINT}`);
|
|
30
|
+
}
|
|
31
|
+
if (stored.status === "unreadable") {
|
|
32
|
+
return setupFinding(STANDARDS_FINDING_ID, "fail", `Standards proof is unreadable: ${stored.reason}. ${PROOF_COMMAND_HINT}`);
|
|
33
|
+
}
|
|
34
|
+
const proof = stored.proof;
|
|
35
|
+
if (proof.lisaVersion !== getPackageVersion()) {
|
|
36
|
+
return stale("Lisa version changed");
|
|
37
|
+
}
|
|
38
|
+
const gitObservation = await observeCurrentInput(async () => await readStandardsGitState(projectRoot), OBSERVATION_REASONS.git);
|
|
39
|
+
if (gitObservation.status === "unavailable")
|
|
40
|
+
return gitObservation.finding;
|
|
41
|
+
const repositoryCause = repositoryStaleCause(proof, gitObservation.value);
|
|
42
|
+
if (repositoryCause !== undefined)
|
|
43
|
+
return stale(repositoryCause);
|
|
44
|
+
const observation = await observeCurrentPlanInputs(gitObservation.value);
|
|
45
|
+
if (observation.status === "unavailable")
|
|
46
|
+
return observation.finding;
|
|
47
|
+
return evaluateProofFreshness(proof, observation.value);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Observe current project and plan inputs without running quality commands.
|
|
51
|
+
* @param git - Previously validated repository state
|
|
52
|
+
* @returns Available plan inputs or the first fail-closed finding
|
|
53
|
+
*/
|
|
54
|
+
async function observeCurrentPlanInputs(git) {
|
|
55
|
+
const stackObservation = await observeCurrentInput(async () => await readConfinedDetectedStacks(git.root), OBSERVATION_REASONS.stacks);
|
|
56
|
+
if (stackObservation.status === "unavailable")
|
|
57
|
+
return stackObservation;
|
|
58
|
+
const projectTypes = stackObservation.value;
|
|
59
|
+
const configObservation = await observeCurrentInput(async () => await readConfinedMergedConfig(git.root), OBSERVATION_REASONS.config);
|
|
60
|
+
if (configObservation.status === "unavailable")
|
|
61
|
+
return configObservation;
|
|
62
|
+
const config = configObservation.value;
|
|
63
|
+
const planObservation = await observeCurrentInput(async () => await resolveStandardsCheckPlan(git.root, projectTypes, config), OBSERVATION_REASONS.plan);
|
|
64
|
+
if (planObservation.status === "unavailable")
|
|
65
|
+
return planObservation;
|
|
66
|
+
return {
|
|
67
|
+
status: "available",
|
|
68
|
+
value: {
|
|
69
|
+
projectTypes,
|
|
70
|
+
plan: planObservation.value,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Compare a stored proof with freshly observed inputs.
|
|
76
|
+
* @param proof - Strict stored standards proof
|
|
77
|
+
* @param current - Fresh repository and plan inputs
|
|
78
|
+
* @returns Current pass or stale/unavailable finding
|
|
79
|
+
*/
|
|
80
|
+
function evaluateProofFreshness(proof, current) {
|
|
81
|
+
try {
|
|
82
|
+
const cause = planStaleCause(proof, current);
|
|
83
|
+
if (cause !== undefined)
|
|
84
|
+
return stale(cause);
|
|
85
|
+
return setupFinding(STANDARDS_FINDING_ID, "pass", "Managed standards and automated lint, analysis, test, guardrail, and threshold conformance are current for this Git artifact.");
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return observationFailed(OBSERVATION_REASONS.generic);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Find the first repository-state mismatch.
|
|
93
|
+
* @param proof - Stored proof
|
|
94
|
+
* @param git - Current repository state
|
|
95
|
+
* @returns Operator-readable stale cause, when present
|
|
96
|
+
*/
|
|
97
|
+
function repositoryStaleCause(proof, git) {
|
|
98
|
+
if (!git.clean)
|
|
99
|
+
return "tracked or nonignored worktree state changed";
|
|
100
|
+
if (git.identity !== proof.repository.identity)
|
|
101
|
+
return "repository identity changed";
|
|
102
|
+
if (git.head !== proof.repository.head)
|
|
103
|
+
return "HEAD changed";
|
|
104
|
+
if (git.tree !== proof.repository.tree)
|
|
105
|
+
return "Git tree changed";
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Find the first project-plan or result mismatch.
|
|
110
|
+
* @param proof - Stored proof
|
|
111
|
+
* @param current - Current project types and standards plan
|
|
112
|
+
* @returns Operator-readable stale cause, when present
|
|
113
|
+
*/
|
|
114
|
+
function planStaleCause(proof, current) {
|
|
115
|
+
const { plan, projectTypes } = current;
|
|
116
|
+
if (JSON.stringify(projectTypes) !== JSON.stringify(proof.projectTypes))
|
|
117
|
+
return "detected project types changed";
|
|
118
|
+
if (plan.configDigest !== proof.configDigest)
|
|
119
|
+
return "Lisa configuration changed";
|
|
120
|
+
if (plan.registryDigest !== proof.registryDigest)
|
|
121
|
+
return "standards registry changed";
|
|
122
|
+
const expected = plan.checks.map(check => check.id);
|
|
123
|
+
if (JSON.stringify(expected) !== JSON.stringify(proof.applicableChecks))
|
|
124
|
+
return "required check membership changed";
|
|
125
|
+
if (hasIncompleteResults(proof, plan))
|
|
126
|
+
return "required check results are incomplete";
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Determine whether any stored result differs from its required check.
|
|
131
|
+
* @param proof - Stored proof
|
|
132
|
+
* @param plan - Current standards check plan
|
|
133
|
+
* @returns Whether required result evidence is incomplete
|
|
134
|
+
*/
|
|
135
|
+
function hasIncompleteResults(proof, plan) {
|
|
136
|
+
return proof.results.some((result, index) => result.check !== plan.checks[index]?.id ||
|
|
137
|
+
result.category !== plan.checks[index]?.category ||
|
|
138
|
+
result.status !== "pass");
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Create a stale-proof warning with the remediation command.
|
|
142
|
+
* @param cause - Operator-readable stale cause
|
|
143
|
+
* @returns Stale standards finding
|
|
144
|
+
*/
|
|
145
|
+
function stale(cause) {
|
|
146
|
+
return setupFinding(STANDARDS_FINDING_ID, "warn", `Standards proof is stale: ${cause}. ${PROOF_COMMAND_HINT}`);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create a fail-closed observation warning with the remediation command.
|
|
150
|
+
* @param reason - Sanitized observation failure reason
|
|
151
|
+
* @returns Fail-closed standards finding
|
|
152
|
+
*/
|
|
153
|
+
function observationFailed(reason) {
|
|
154
|
+
return setupFinding(STANDARDS_FINDING_ID, "warn", `Standards proof freshness could not be established: ${reason}. ${PROOF_COMMAND_HINT}`);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Convert one throwing observation into a fail-closed result.
|
|
158
|
+
* @param operation - Read-only operation to execute
|
|
159
|
+
* @param reason - Sanitized reason to expose if observation fails
|
|
160
|
+
* @returns Available value or sanitized unavailable finding
|
|
161
|
+
*/
|
|
162
|
+
async function observeCurrentInput(operation, reason) {
|
|
163
|
+
try {
|
|
164
|
+
return { status: "available", value: await operation() };
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return { status: "unavailable", finding: observationFailed(reason) };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readiness.js","sourceRoot":"","sources":["../../src/standards/readiness.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAA0B,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EACL,yBAAyB,GAE1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,yDAAyD;IAC9D,MAAM,EAAE,gDAAgD;IACxD,MAAM,EAAE,qDAAqD;IAC7D,IAAI,EAAE,4DAA4D;IAClE,OAAO,EAAE,sDAAsD;CAChE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAmB;IAEnB,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,YAAY,CACjB,oBAAoB,EACpB,MAAM,EACN,+BAA+B,kBAAkB,EAAE,CACpD,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QACnC,OAAO,YAA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AE,EAAE;QACvC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ;QAChD,MAAM,CAAC,MAAM,KAAK,MAAM,CAC3B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,YAAY,CACjB,oBAAoB,EACpB,MAAM,EACN,6BAA6B,KAAK,KAAK,kBAAkB,EAAE,CAC5D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,MAAc;IACvC,OAAO,YAAY,CACjB,oBAAoB,EACpB,MAAM,EACN,uDAAuD,MAAM,KAAK,kBAAkB,EAAE,CACvF,CAAC;AACJ,CAAC;AAOD;;;;;GAKG;AACH,KAAK,UAAU,mBAAmB,CAChC,SAA2B,EAC3B,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,SAAS,EAAE,EAAE,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;IACvE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ProjectType } from "../core/config.js";
|
|
2
|
+
import { type JsonObject } from "../sync/json-path.js";
|
|
3
|
+
import type { StandardsCheckCategory } from "./contract.js";
|
|
4
|
+
import { type TestEvidenceFormat } from "./test-evidence.js";
|
|
5
|
+
/** One fixed, no-shell command in the current standards registry. */
|
|
6
|
+
export interface StandardsCheckSpec {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly category: StandardsCheckCategory;
|
|
9
|
+
readonly argv: readonly [string, ...string[]];
|
|
10
|
+
readonly timeoutMs: number;
|
|
11
|
+
readonly testEvidence?: TestEvidenceFormat;
|
|
12
|
+
readonly environment?: Readonly<Record<string, string>>;
|
|
13
|
+
}
|
|
14
|
+
/** Fully resolved current check plan and its tamper-evident registry digest. */
|
|
15
|
+
export interface StandardsCheckPlan {
|
|
16
|
+
readonly checks: readonly StandardsCheckSpec[];
|
|
17
|
+
readonly registryDigest: string;
|
|
18
|
+
readonly configDigest: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the exact ordered union of checks for current detected stacks.
|
|
22
|
+
* Missing managed scripts and threshold tooling fail before any command runs.
|
|
23
|
+
* @param projectRoot - Canonical project root
|
|
24
|
+
* @param projectTypes - Expanded, canonical detected types
|
|
25
|
+
* @param config - Current bounded merged Lisa config
|
|
26
|
+
* @returns Closed current check plan
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveStandardsCheckPlan(// eslint-disable-line max-lines-per-function -- the closed multi-stack registry is one auditable ordered plan
|
|
29
|
+
projectRoot: string, projectTypes: readonly ProjectType[], config: JsonObject): Promise<StandardsCheckPlan>;
|
|
30
|
+
/**
|
|
31
|
+
* Digest only configuration that changes standards applicability or policy.
|
|
32
|
+
* @param config - Current merged Lisa config
|
|
33
|
+
* @returns Canonical standards configuration digest
|
|
34
|
+
*/
|
|
35
|
+
export declare function digestStandardsConfig(config: JsonObject): string;
|
|
36
|
+
/**
|
|
37
|
+
* Return a canonical SHA-256 digest without retaining config values.
|
|
38
|
+
* @param value - JSON-like value to digest
|
|
39
|
+
* @returns Canonical SHA-256 digest
|
|
40
|
+
*/
|
|
41
|
+
export declare function digestStandardsValue(value: unknown): string;
|
|
42
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/standards/registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CA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