@codyswann/lisa 2.277.3 → 2.278.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/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +5 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup-project.d.ts.map +1 -1
- package/dist/cli/setup-project.js +12 -0
- package/dist/cli/setup-project.js.map +1 -1
- package/dist/cli/ui-automations-adapters.d.ts +22 -0
- package/dist/cli/ui-automations-adapters.d.ts.map +1 -1
- package/dist/cli/ui-automations-adapters.js +24 -12
- package/dist/cli/ui-automations-adapters.js.map +1 -1
- package/dist/cli/ui-automations.d.ts +1 -0
- package/dist/cli/ui-automations.d.ts.map +1 -1
- package/dist/cli/ui-automations.js +1 -0
- package/dist/cli/ui-automations.js.map +1 -1
- package/dist/cli/ui-cmd.d.ts +4 -1
- package/dist/cli/ui-cmd.d.ts.map +1 -1
- package/dist/cli/ui-cmd.js +72 -17
- package/dist/cli/ui-cmd.js.map +1 -1
- package/dist/cli/ui-confined-project-read.d.ts +22 -0
- package/dist/cli/ui-confined-project-read.d.ts.map +1 -0
- package/dist/cli/ui-confined-project-read.js +38 -0
- package/dist/cli/ui-confined-project-read.js.map +1 -0
- package/dist/cli/ui-deploy-pipeline.d.ts.map +1 -1
- package/dist/cli/ui-deploy-pipeline.js +4 -15
- package/dist/cli/ui-deploy-pipeline.js.map +1 -1
- package/dist/cli/ui-detected-stacks.d.ts +9 -8
- package/dist/cli/ui-detected-stacks.d.ts.map +1 -1
- package/dist/cli/ui-detected-stacks.js +111 -0
- package/dist/cli/ui-detected-stacks.js.map +1 -1
- package/dist/cli/ui-github-repo-gh.d.ts +6 -0
- package/dist/cli/ui-github-repo-gh.d.ts.map +1 -1
- package/dist/cli/ui-github-repo-gh.js.map +1 -1
- package/dist/cli/ui-github-repo-map.d.ts.map +1 -1
- package/dist/cli/ui-github-repo-map.js +26 -1
- package/dist/cli/ui-github-repo-map.js.map +1 -1
- package/dist/cli/ui-setup-readiness-config.d.ts +28 -0
- package/dist/cli/ui-setup-readiness-config.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness-config.js +116 -0
- package/dist/cli/ui-setup-readiness-config.js.map +1 -0
- package/dist/cli/ui-setup-readiness-contract.d.ts +32 -0
- package/dist/cli/ui-setup-readiness-contract.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness-contract.js +61 -0
- package/dist/cli/ui-setup-readiness-contract.js.map +1 -0
- package/dist/cli/ui-setup-readiness-install.d.ts +24 -0
- package/dist/cli/ui-setup-readiness-install.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness-install.js +207 -0
- package/dist/cli/ui-setup-readiness-install.js.map +1 -0
- package/dist/cli/ui-setup-readiness-local.d.ts +40 -0
- package/dist/cli/ui-setup-readiness-local.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness-local.js +235 -0
- package/dist/cli/ui-setup-readiness-local.js.map +1 -0
- package/dist/cli/ui-setup-readiness-remote.d.ts +30 -0
- package/dist/cli/ui-setup-readiness-remote.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness-remote.js +108 -0
- package/dist/cli/ui-setup-readiness-remote.js.map +1 -0
- package/dist/cli/ui-setup-readiness.d.ts +52 -0
- package/dist/cli/ui-setup-readiness.d.ts.map +1 -0
- package/dist/cli/ui-setup-readiness.js +125 -0
- package/dist/cli/ui-setup-readiness.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +14 -2
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/health/read-only-fs.d.ts +7 -0
- package/dist/health/read-only-fs.d.ts.map +1 -1
- package/dist/health/read-only-fs.js +40 -1
- package/dist/health/read-only-fs.js.map +1 -1
- package/dist/sync/registry.d.ts +14 -0
- package/dist/sync/registry.d.ts.map +1 -1
- package/dist/sync/registry.js +54 -15
- package/dist/sync/registry.js.map +1 -1
- 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/scripts/automation-status-codex-adapter.mjs +270 -23
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/automation-status-codex-adapter.mjs +270 -23
- 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/automation-status-codex-adapter.mjs +270 -23
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/automation-status-codex-adapter.mjs +270 -23
- 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/automation-status-codex-adapter.mjs +270 -23
- package/ui/index.html +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Strict transport contract for the console Setup readiness projection. */
|
|
2
|
+
import { summarizeHealthFindings, validateHealthResult, } from "../health/contract.js";
|
|
3
|
+
import { readStrictDenseArray, readStrictProperty, requireCanonicalUtcTimestamp, requireStrictRecord, } from "../health/strict-validation.js";
|
|
4
|
+
/** Stable finding identifiers, in the existing checklist render order. */
|
|
5
|
+
export const SETUP_READINESS_CHECKS = [
|
|
6
|
+
"setup.install",
|
|
7
|
+
"setup.sync",
|
|
8
|
+
"setup.agent-ready",
|
|
9
|
+
"setup.standards",
|
|
10
|
+
"setup.tracker",
|
|
11
|
+
"setup.prd-source",
|
|
12
|
+
"setup.github-governance",
|
|
13
|
+
"setup.secrets",
|
|
14
|
+
"setup.automations",
|
|
15
|
+
"setup.exploration",
|
|
16
|
+
"setup.wiki",
|
|
17
|
+
"setup.starter-provenance",
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Create one operator-readable deterministic Setup finding.
|
|
21
|
+
* @param check - Closed Setup checklist identifier
|
|
22
|
+
* @param status - Deterministic readiness status
|
|
23
|
+
* @param reason - Operator-readable evidence or remediation summary
|
|
24
|
+
* @returns Deterministic Setup readiness finding
|
|
25
|
+
*/
|
|
26
|
+
export function setupFinding(check, status, reason) {
|
|
27
|
+
return { check, layer: "deterministic", status, reason };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validate, detach, and freeze a Setup readiness projection.
|
|
31
|
+
* @param candidate - Untrusted projection
|
|
32
|
+
* @returns Strict schema-v1 result with exactly the twelve checklist findings
|
|
33
|
+
*/
|
|
34
|
+
export function validateSetupReadinessResult(candidate) {
|
|
35
|
+
const record = requireStrictRecord(candidate, ["schemaVersion", "observedAt", "findings"], "SetupReadinessResult");
|
|
36
|
+
if (readStrictProperty(record, "schemaVersion") !== 1) {
|
|
37
|
+
throw new Error("Invalid setup readiness schemaVersion: expected 1");
|
|
38
|
+
}
|
|
39
|
+
const observedAt = requireCanonicalUtcTimestamp(readStrictProperty(record, "observedAt"), "observedAt");
|
|
40
|
+
const rawFindings = readStrictDenseArray(readStrictProperty(record, "findings"), SETUP_READINESS_CHECKS.length, SETUP_READINESS_CHECKS.length, "findings");
|
|
41
|
+
const validated = validateHealthResult({
|
|
42
|
+
schemaVersion: 1,
|
|
43
|
+
runId: "setup-readiness-validation",
|
|
44
|
+
mode: "deterministic",
|
|
45
|
+
startedAt: observedAt,
|
|
46
|
+
completedAt: observedAt,
|
|
47
|
+
findings: rawFindings,
|
|
48
|
+
summary: summarizeHealthFindings(rawFindings),
|
|
49
|
+
}).findings;
|
|
50
|
+
const actual = validated.map(finding => finding.check);
|
|
51
|
+
if (SETUP_READINESS_CHECKS.some((check, index) => actual[index] !== check)) {
|
|
52
|
+
throw new Error(`Invalid setup readiness checks: expected ${SETUP_READINESS_CHECKS.join(", ")}`);
|
|
53
|
+
}
|
|
54
|
+
const findings = validated;
|
|
55
|
+
return Object.freeze({
|
|
56
|
+
schemaVersion: 1,
|
|
57
|
+
observedAt,
|
|
58
|
+
findings: Object.freeze(findings),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=ui-setup-readiness-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-setup-readiness-contract.js","sourceRoot":"","sources":["../../src/cli/ui-setup-readiness-contract.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAExC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,yBAAyB;IACzB,eAAe;IACf,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,0BAA0B;CAClB,CAAC;AAkBX;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,KAA0B,EAC1B,MAAoB,EACpB,MAAc;IAEd,OAA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CAChF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,SAA6C,CAAC;IAC/D,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa,EAAE,CAAC;QAChB,UAAU;QACV,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KAClC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HealthResult } from "../health/contract.js";
|
|
2
|
+
import type { JsonObject } from "../sync/json-path.js";
|
|
3
|
+
import { type SetupReadinessFinding } from "./ui-setup-readiness-contract.js";
|
|
4
|
+
/** Fixed Health checks that establish common project-owned apply surfaces. */
|
|
5
|
+
export declare const INSTALL_HEALTH_CHECKS: readonly ["project.state", "templates.managed", "package.conformance", "hooks.managed"];
|
|
6
|
+
/**
|
|
7
|
+
* Derive Codex's exact current managed-file set from the same selected plugin
|
|
8
|
+
* and agent discovery contract used by apply. No project file is trusted as a
|
|
9
|
+
* declaration of completeness.
|
|
10
|
+
* @param projectRoot - Project root to inspect
|
|
11
|
+
* @param config - Merged Lisa project configuration
|
|
12
|
+
* @returns Frozen authoritative Codex managed-file paths
|
|
13
|
+
*/
|
|
14
|
+
export declare function expectedCodexManagedFiles(projectRoot: string, config: JsonObject): Promise<readonly string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Establish only installation state that Lisa can observe authoritatively.
|
|
17
|
+
* External plugin/runtime state remains non-pass when no bounded reader exists.
|
|
18
|
+
* @param projectRoot - Project root to inspect
|
|
19
|
+
* @param config - Merged Lisa project configuration
|
|
20
|
+
* @param health - Current deterministic Health evidence, when available
|
|
21
|
+
* @returns Installation readiness finding for the configured harness
|
|
22
|
+
*/
|
|
23
|
+
export declare function installFinding(projectRoot: string, config: JsonObject, health: HealthResult | undefined): Promise<SetupReadinessFinding>;
|
|
24
|
+
//# sourceMappingURL=ui-setup-readiness-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-setup-readiness-install.d.ts","sourceRoot":"","sources":["../../src/cli/ui-setup-readiness-install.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAO1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,kCAAkC,CAAC;AAI1C,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,yFAKxB,CAAC;AAgIX;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAwB5B;AAgFD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAqEhC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/** Truthful, harness-aware installation evidence for Setup readiness. */
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { realpath } from "node:fs/promises";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { discoverLisaAgents, LISA_AGENTS_SUBDIR, } from "../codex/agent-installer.js";
|
|
6
|
+
import { DEFAULT_HARNESS, harnessIncludesAgent, } from "../core/config.js";
|
|
7
|
+
import { projectPluginFilter, selectProjectLisaPluginsFromState, } from "../core/lisa-plugin-selection.js";
|
|
8
|
+
import { normalizeHarness } from "../core/project-config.js";
|
|
9
|
+
import { projectPathKind, projectRegularFileExists, readProjectJsonObject, readProjectText, } from "../health/read-only-fs.js";
|
|
10
|
+
import { setupFinding, } from "./ui-setup-readiness-contract.js";
|
|
11
|
+
import { healthEvidenceFinding } from "./ui-setup-readiness-local.js";
|
|
12
|
+
import { readConfinedDetectedStacks } from "./ui-detected-stacks.js";
|
|
13
|
+
/** Fixed Health checks that establish common project-owned apply surfaces. */
|
|
14
|
+
export const INSTALL_HEALTH_CHECKS = [
|
|
15
|
+
"project.state",
|
|
16
|
+
"templates.managed",
|
|
17
|
+
"package.conformance",
|
|
18
|
+
"hooks.managed",
|
|
19
|
+
];
|
|
20
|
+
const MAX_MANAGED_FILES = 2_048;
|
|
21
|
+
const INSTALL_CHECK = "setup.install";
|
|
22
|
+
const EXTERNAL_ONLY_HARNESSES = new Set([
|
|
23
|
+
"cursor",
|
|
24
|
+
"agy",
|
|
25
|
+
"copilot",
|
|
26
|
+
"fleet",
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the configured harness without accepting a malformed value.
|
|
30
|
+
* @param config - Merged Lisa project configuration
|
|
31
|
+
* @returns Normalized harness, or undefined for malformed configuration
|
|
32
|
+
*/
|
|
33
|
+
function configuredHarness(config) {
|
|
34
|
+
const raw = config.harness ?? DEFAULT_HARNESS;
|
|
35
|
+
return typeof raw === "string" ? normalizeHarness(raw) : undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Require one non-empty, confined regular project file.
|
|
39
|
+
* @param root - Canonical project root
|
|
40
|
+
* @param relativePath - Project-relative file path
|
|
41
|
+
* @returns Whether the confined file exists and contains non-whitespace text
|
|
42
|
+
*/
|
|
43
|
+
async function nonemptyProjectFile(root, relativePath) {
|
|
44
|
+
const text = await readProjectText(root, relativePath);
|
|
45
|
+
return text !== undefined && text.trim().length > 0;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validate one normalized path relative to an agent-owned manifest directory.
|
|
49
|
+
* @param value - Untrusted managed-manifest entry
|
|
50
|
+
* @returns Whether the value is a normalized relative path
|
|
51
|
+
*/
|
|
52
|
+
function validManifestEntry(value) {
|
|
53
|
+
if (typeof value !== "string" ||
|
|
54
|
+
value.length === 0 ||
|
|
55
|
+
value.includes("\\") ||
|
|
56
|
+
path.posix.isAbsolute(value)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const segments = value.split("/");
|
|
60
|
+
return (segments.every(segment => segment !== "" && segment !== "." && segment !== "..") && path.posix.normalize(value) === value);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Refuse symlinked/special parents and final entries for one manifest file.
|
|
64
|
+
* @param root - Canonical project root
|
|
65
|
+
* @param configDir - Agent-owned configuration directory
|
|
66
|
+
* @param entry - Validated manifest-relative file path
|
|
67
|
+
* @returns Whether every parent and the final file are confined and regular
|
|
68
|
+
*/
|
|
69
|
+
async function manifestEntryIsRegular(root, configDir, entry) {
|
|
70
|
+
const segments = [configDir, ...entry.split("/")];
|
|
71
|
+
const parents = segments
|
|
72
|
+
.slice(0, -1)
|
|
73
|
+
.map((_, index) => segments.slice(0, index + 1).join("/"));
|
|
74
|
+
const kinds = await Promise.all(parents.map(parent => projectPathKind(root, parent)));
|
|
75
|
+
return (kinds.every(kind => kind === "directory") &&
|
|
76
|
+
(await projectRegularFileExists(root, `${configDir}/${entry}`)));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Validate a bounded managed-artifact manifest and every file it names.
|
|
80
|
+
* @param root - Canonical project root
|
|
81
|
+
* @param configDir - Managed configuration directory
|
|
82
|
+
* @param expectedFiles - Optional authoritative set of required files
|
|
83
|
+
* @returns Whether the manifest is bounded, exact, and fully present
|
|
84
|
+
*/
|
|
85
|
+
async function managedManifestIsComplete(root, configDir, expectedFiles) {
|
|
86
|
+
const manifest = await readProjectJsonObject(root, `${configDir}/.lisa-managed.json`);
|
|
87
|
+
const files = manifest?.files;
|
|
88
|
+
if (!Array.isArray(files) ||
|
|
89
|
+
files.length === 0 ||
|
|
90
|
+
files.length > MAX_MANAGED_FILES ||
|
|
91
|
+
!files.every(validManifestEntry) ||
|
|
92
|
+
new Set(files).size !== files.length) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (expectedFiles !== undefined) {
|
|
96
|
+
const observed = [...files].sort((left, right) => left.localeCompare(right));
|
|
97
|
+
const expected = [...expectedFiles].sort((left, right) => left.localeCompare(right));
|
|
98
|
+
if (observed.length !== expected.length ||
|
|
99
|
+
observed.some((entry, index) => entry !== expected[index])) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const present = await Promise.all(files.map(entry => manifestEntryIsRegular(root, configDir, entry)));
|
|
104
|
+
return present.every(Boolean);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Derive Codex's exact current managed-file set from the same selected plugin
|
|
108
|
+
* and agent discovery contract used by apply. No project file is trusted as a
|
|
109
|
+
* declaration of completeness.
|
|
110
|
+
* @param projectRoot - Project root to inspect
|
|
111
|
+
* @param config - Merged Lisa project configuration
|
|
112
|
+
* @returns Frozen authoritative Codex managed-file paths
|
|
113
|
+
*/
|
|
114
|
+
export async function expectedCodexManagedFiles(projectRoot, config) {
|
|
115
|
+
const root = await realpath(projectRoot);
|
|
116
|
+
const lisaRoot = await realpath(path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.."));
|
|
117
|
+
const [detectedTypes, wikiKind] = await Promise.all([
|
|
118
|
+
readConfinedDetectedStacks(root),
|
|
119
|
+
projectPathKind(root, "wiki/lisa-wiki.config.json"),
|
|
120
|
+
]);
|
|
121
|
+
const plugins = selectProjectLisaPluginsFromState(config, detectedTypes, wikiKind === "file");
|
|
122
|
+
const agents = await discoverLisaAgents(lisaRoot, projectPluginFilter(plugins));
|
|
123
|
+
return Object.freeze([
|
|
124
|
+
...agents.map(agent => path.posix.join(LISA_AGENTS_SUBDIR, `${agent.id}.toml`)),
|
|
125
|
+
"config.toml",
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Convert one boolean observation into a stable drift label.
|
|
130
|
+
* @param applicable - Whether the surface applies to the selected harness
|
|
131
|
+
* @param label - Stable operator-facing drift label
|
|
132
|
+
* @param observe - Read-only observation for the surface
|
|
133
|
+
* @returns Empty when inapplicable or present, otherwise the drift label
|
|
134
|
+
*/
|
|
135
|
+
async function evidenceDrift(applicable, label, observe) {
|
|
136
|
+
if (!applicable)
|
|
137
|
+
return [];
|
|
138
|
+
return (await observe()) ? [] : [label];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Collect missing or unsafe project-owned surfaces for one harness.
|
|
142
|
+
* @param root - Canonical project root
|
|
143
|
+
* @param harness - Normalized configured harness
|
|
144
|
+
* @param config - Merged Lisa project configuration
|
|
145
|
+
* @returns Stable labels for missing or unsafe harness surfaces
|
|
146
|
+
*/
|
|
147
|
+
async function projectSurfaceDrift(root, harness, config) {
|
|
148
|
+
const includes = (agent) => harnessIncludesAgent(harness, agent);
|
|
149
|
+
const needsAgents = includes("claude") ||
|
|
150
|
+
includes("codex") ||
|
|
151
|
+
includes("agy") ||
|
|
152
|
+
includes("copilot") ||
|
|
153
|
+
includes("opencode");
|
|
154
|
+
const codexFiles = includes("codex")
|
|
155
|
+
? await expectedCodexManagedFiles(root, config)
|
|
156
|
+
: undefined;
|
|
157
|
+
const observations = await Promise.all([
|
|
158
|
+
evidenceDrift(needsAgents, "AGENTS.md", async () => await nonemptyProjectFile(root, "AGENTS.md")),
|
|
159
|
+
evidenceDrift(includes("claude"), "CLAUDE.md canonical AGENTS.md pointer", async () => (await readProjectText(root, "CLAUDE.md"))?.includes("@AGENTS.md") ===
|
|
160
|
+
true),
|
|
161
|
+
evidenceDrift(includes("codex"), ".codex managed-artifact manifest", async () => await managedManifestIsComplete(root, ".codex", codexFiles)),
|
|
162
|
+
evidenceDrift(includes("copilot"), ".github/copilot-instructions.md", async () => await nonemptyProjectFile(root, ".github/copilot-instructions.md")),
|
|
163
|
+
evidenceDrift(includes("opencode"), ".opencode managed-artifact manifest", async () => await managedManifestIsComplete(root, ".opencode")),
|
|
164
|
+
evidenceDrift(includes("opencode"), "opencode.json", async () => await nonemptyProjectFile(root, "opencode.json")),
|
|
165
|
+
]);
|
|
166
|
+
return observations.flat();
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Establish only installation state that Lisa can observe authoritatively.
|
|
170
|
+
* External plugin/runtime state remains non-pass when no bounded reader exists.
|
|
171
|
+
* @param projectRoot - Project root to inspect
|
|
172
|
+
* @param config - Merged Lisa project configuration
|
|
173
|
+
* @param health - Current deterministic Health evidence, when available
|
|
174
|
+
* @returns Installation readiness finding for the configured harness
|
|
175
|
+
*/
|
|
176
|
+
export async function installFinding(projectRoot, config, health) {
|
|
177
|
+
const common = healthEvidenceFinding(INSTALL_CHECK, health, INSTALL_HEALTH_CHECKS, "Lisa's common project templates, package, and git hooks are current.", "fail");
|
|
178
|
+
if (common.status !== "pass")
|
|
179
|
+
return common;
|
|
180
|
+
const harness = configuredHarness(config);
|
|
181
|
+
if (harness === undefined) {
|
|
182
|
+
return setupFinding(INSTALL_CHECK, "fail", "The configured Lisa harness is missing or invalid; run lisa sync and lisa apply.");
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const root = await realpath(projectRoot);
|
|
186
|
+
const drift = await projectSurfaceDrift(root, harness, config);
|
|
187
|
+
if (drift.length > 0) {
|
|
188
|
+
return setupFinding(INSTALL_CHECK, "fail", `Configured-harness project surfaces are missing or unsafe: ${drift.join(", ")}. Run lisa apply.`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return setupFinding(INSTALL_CHECK, "fail", "Configured-harness project surfaces could not be inspected safely; replace symlinks, special files, or oversized files and run lisa apply.");
|
|
193
|
+
}
|
|
194
|
+
if (harnessIncludesAgent(harness, "claude")) {
|
|
195
|
+
const claudePlugins = healthEvidenceFinding(INSTALL_CHECK, health, ["plugins.current"], "Claude's enabled and installed Lisa plugins are current.", "warn");
|
|
196
|
+
if (claudePlugins.status !== "pass")
|
|
197
|
+
return claudePlugins;
|
|
198
|
+
}
|
|
199
|
+
if (harnessIncludesAgent(harness, "opencode")) {
|
|
200
|
+
return setupFinding(INSTALL_CHECK, "warn", "OpenCode's declared managed files are present, but their completeness against the current emit catalog cannot yet be established authoritatively.");
|
|
201
|
+
}
|
|
202
|
+
if (EXTERNAL_ONLY_HARNESSES.has(harness)) {
|
|
203
|
+
return setupFinding(INSTALL_CHECK, "warn", `Lisa's project-owned ${harness} surfaces are current, but external ${harness} plugin/runtime installation cannot yet be observed authoritatively.`);
|
|
204
|
+
}
|
|
205
|
+
return setupFinding(INSTALL_CHECK, "pass", `Lisa's required project-owned ${harness} installation surfaces are present and complete.`);
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=ui-setup-readiness-install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-setup-readiness-install.js","sourceRoot":"","sources":["../../src/cli/ui-setup-readiness-install.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,eAAe,EACf,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,YAAY,GAEb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,eAAe;IACf,mBAAmB;IACnB,qBAAq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AAa,EACb,MAAM,EACN,wBAAwB,OAAO,uCAAuC,OAAO,sEAAsE,CACpJ,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,CACjB,aAAa,EACb,MAAM,EACN,iCAAiC,OAAO,kDAAkD,CAC3F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HealthResult, HealthStatus } from "../health/contract.js";
|
|
2
|
+
import { type SetupReadinessCheck, type SetupReadinessFinding } from "./ui-setup-readiness-contract.js";
|
|
3
|
+
/** Fixed Health checks that establish local standards/governance conformance. */
|
|
4
|
+
export declare const STANDARDS_HEALTH_CHECKS: readonly ["templates.managed", "package.conformance", "hooks.managed", "config.sync", "instructions.canonical", "ci.workflows"];
|
|
5
|
+
/**
|
|
6
|
+
* Never upgrade standards adoption without current lint/test preservation proof.
|
|
7
|
+
* @param health - Current deterministic Health evidence, when available
|
|
8
|
+
* @returns Standards-adoption readiness finding
|
|
9
|
+
*/
|
|
10
|
+
export declare function standardsFinding(health: HealthResult | undefined): SetupReadinessFinding;
|
|
11
|
+
/**
|
|
12
|
+
* Aggregate stable check IDs without interpreting human-readable reasons.
|
|
13
|
+
* @param check - Setup checklist identifier being evaluated
|
|
14
|
+
* @param health - Current deterministic Health evidence, when available
|
|
15
|
+
* @param requiredChecks - Health check identifiers required for readiness
|
|
16
|
+
* @param passReason - Operator-readable reason used when every check passes
|
|
17
|
+
* @param unavailableStatus - Status used when required evidence is absent
|
|
18
|
+
* @returns Setup finding derived from the required Health checks
|
|
19
|
+
*/
|
|
20
|
+
export declare function healthEvidenceFinding(check: SetupReadinessCheck, health: HealthResult | undefined, requiredChecks: readonly string[], passReason: string, unavailableStatus?: HealthStatus): SetupReadinessFinding;
|
|
21
|
+
/**
|
|
22
|
+
* Require a complete source registry and no open knowledge gaps.
|
|
23
|
+
* @param projectRoot - Project root containing agent-ready evidence
|
|
24
|
+
* @returns Agent-readiness finding from confined registry and gap evidence
|
|
25
|
+
*/
|
|
26
|
+
export declare function agentReadyFinding(projectRoot: string): Promise<SetupReadinessFinding>;
|
|
27
|
+
/**
|
|
28
|
+
* Require the optional wiki to exist before accepting the Health wiki check.
|
|
29
|
+
* @param projectRoot - Project root containing the optional wiki
|
|
30
|
+
* @param health - Current deterministic Health evidence, when available
|
|
31
|
+
* @returns Wiki setup readiness finding
|
|
32
|
+
*/
|
|
33
|
+
export declare function wikiSetupFinding(projectRoot: string, health: HealthResult | undefined): Promise<SetupReadinessFinding>;
|
|
34
|
+
/**
|
|
35
|
+
* Read names referenced as `secrets.NAME` from current workflow files.
|
|
36
|
+
* @param projectRoot - Project root containing GitHub workflows
|
|
37
|
+
* @returns Sorted unique explicit workflow secret names
|
|
38
|
+
*/
|
|
39
|
+
export declare function readWorkflowSecretNames(projectRoot: string): Promise<readonly string[]>;
|
|
40
|
+
//# sourceMappingURL=ui-setup-readiness-local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-setup-readiness-local.d.ts","sourceRoot":"","sources":["../../src/cli/ui-setup-readiness-local.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQxE,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,kCAAkC,CAAC;AAK1C,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,iIAO1B,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,qBAAqB,CAevB;AA0GD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,UAAU,EAAE,MAAM,EAClB,iBAAiB,GAAE,YAAqB,GACvC,qBAAqB,CAwBvB;AAED;;;;GAIG;AAEH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC,CAqFhC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAuBhC;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CA+B5B"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/** Local filesystem and deterministic-Health evidence for Setup readiness. */
|
|
2
|
+
import { readdir, realpath } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { projectPathKind, projectRegularFileExists, readProjectText, resolveProjectPath, } from "../health/read-only-fs.js";
|
|
5
|
+
import { requireCanonicalUtcTimestamp } from "../health/strict-validation.js";
|
|
6
|
+
import { setupFinding, } from "./ui-setup-readiness-contract.js";
|
|
7
|
+
const AGENT_READY_CHECK = "setup.agent-ready";
|
|
8
|
+
const WIKI_CHECK = "setup.wiki";
|
|
9
|
+
/** Fixed Health checks that establish local standards/governance conformance. */
|
|
10
|
+
export const STANDARDS_HEALTH_CHECKS = [
|
|
11
|
+
"templates.managed",
|
|
12
|
+
"package.conformance",
|
|
13
|
+
"hooks.managed",
|
|
14
|
+
"config.sync",
|
|
15
|
+
"instructions.canonical",
|
|
16
|
+
"ci.workflows",
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Never upgrade standards adoption without current lint/test preservation proof.
|
|
20
|
+
* @param health - Current deterministic Health evidence, when available
|
|
21
|
+
* @returns Standards-adoption readiness finding
|
|
22
|
+
*/
|
|
23
|
+
export function standardsFinding(health) {
|
|
24
|
+
const managed = healthEvidenceFinding("setup.standards", health, STANDARDS_HEALTH_CHECKS, "Managed standards surfaces are current.", "fail");
|
|
25
|
+
return managed.status === "pass"
|
|
26
|
+
? setupFinding("setup.standards", "warn", "Managed standards surfaces are current, but bounded current lint, test, and behavior-preservation proof is unavailable.")
|
|
27
|
+
: managed;
|
|
28
|
+
}
|
|
29
|
+
/** Project workflow secret available without explicit provisioning. */
|
|
30
|
+
const IMPLICIT_WORKFLOW_SECRETS = new Set(["GITHUB_TOKEN"]);
|
|
31
|
+
/**
|
|
32
|
+
* Whether an unknown field is non-empty operator text.
|
|
33
|
+
* @param value - Untrusted field value
|
|
34
|
+
* @returns Whether the value contains non-whitespace text
|
|
35
|
+
*/
|
|
36
|
+
function hasText(value) {
|
|
37
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Canonicalize one strictly source-confined evidence path.
|
|
41
|
+
* @param value - Untrusted source evidence path
|
|
42
|
+
* @returns Normalized wiki/sources path, or undefined when invalid
|
|
43
|
+
*/
|
|
44
|
+
function normalizeSourceEvidencePath(value) {
|
|
45
|
+
if (!hasText(value) || value.includes("\\") || path.posix.isAbsolute(value)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const segments = value.split("/");
|
|
49
|
+
if (segments.some(segment => segment === "" || segment === "." || segment === "..")) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const normalized = path.posix.normalize(value);
|
|
53
|
+
return normalized === value && normalized.startsWith("wiki/sources/")
|
|
54
|
+
? normalized
|
|
55
|
+
: undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Refuse symlinks in every parent and inspect the final file with no-follow.
|
|
59
|
+
* @param root - Canonical project root
|
|
60
|
+
* @param evidencePath - Normalized project-relative evidence path
|
|
61
|
+
* @returns Whether the evidence path has safe parents and a regular final file
|
|
62
|
+
*/
|
|
63
|
+
async function sourceEvidenceIsRegular(root, evidencePath) {
|
|
64
|
+
const segments = evidencePath.split("/");
|
|
65
|
+
const parents = segments
|
|
66
|
+
.slice(0, -1)
|
|
67
|
+
.map((_, index) => segments.slice(0, index + 1).join("/"));
|
|
68
|
+
const parentKinds = await Promise.all(parents.map(parent => projectPathKind(root, parent)));
|
|
69
|
+
if (!parentKinds.every(kind => kind === "directory"))
|
|
70
|
+
return false;
|
|
71
|
+
return await projectRegularFileExists(root, evidencePath);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Validate one complete agent-ready source row and its confined evidence.
|
|
75
|
+
* @param root - Canonical project root
|
|
76
|
+
* @param source - Untrusted source-registry row
|
|
77
|
+
* @returns Completeness classification for the source row
|
|
78
|
+
*/
|
|
79
|
+
async function sourceRowIsComplete(root, source) {
|
|
80
|
+
if (source === null || typeof source !== "object" || Array.isArray(source)) {
|
|
81
|
+
return "invalid";
|
|
82
|
+
}
|
|
83
|
+
const probe = Reflect.get(source, "read_only_probe");
|
|
84
|
+
const evidence = Reflect.get(source, "sanitized_evidence");
|
|
85
|
+
const terminalStatus = Reflect.get(source, "terminal_status");
|
|
86
|
+
const openGap = Reflect.get(source, "open_gap");
|
|
87
|
+
if (!hasText(Reflect.get(source, "source_id")) ||
|
|
88
|
+
!hasText(Reflect.get(source, "scope")) ||
|
|
89
|
+
probe === null ||
|
|
90
|
+
typeof probe !== "object" ||
|
|
91
|
+
Array.isArray(probe) ||
|
|
92
|
+
!hasText(Reflect.get(probe, "command")) ||
|
|
93
|
+
!hasText(Reflect.get(probe, "observed")) ||
|
|
94
|
+
typeof terminalStatus !== "string" ||
|
|
95
|
+
!["complete", "partial", "unavailable", "pending"].includes(terminalStatus) ||
|
|
96
|
+
(openGap !== null && !hasText(openGap)) ||
|
|
97
|
+
!Array.isArray(evidence) ||
|
|
98
|
+
evidence.length === 0 ||
|
|
99
|
+
evidence.some(item => normalizeSourceEvidencePath(item) === undefined)) {
|
|
100
|
+
return "invalid";
|
|
101
|
+
}
|
|
102
|
+
const canonicalEvidence = evidence.map(item => normalizeSourceEvidencePath(item));
|
|
103
|
+
const regularFiles = await Promise.all(canonicalEvidence.map(item => sourceEvidenceIsRegular(root, item)));
|
|
104
|
+
if (!regularFiles.every(Boolean))
|
|
105
|
+
return "invalid";
|
|
106
|
+
return terminalStatus === "complete" && openGap === null
|
|
107
|
+
? "complete"
|
|
108
|
+
: "incomplete";
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Aggregate stable check IDs without interpreting human-readable reasons.
|
|
112
|
+
* @param check - Setup checklist identifier being evaluated
|
|
113
|
+
* @param health - Current deterministic Health evidence, when available
|
|
114
|
+
* @param requiredChecks - Health check identifiers required for readiness
|
|
115
|
+
* @param passReason - Operator-readable reason used when every check passes
|
|
116
|
+
* @param unavailableStatus - Status used when required evidence is absent
|
|
117
|
+
* @returns Setup finding derived from the required Health checks
|
|
118
|
+
*/
|
|
119
|
+
export function healthEvidenceFinding(check, health, requiredChecks, passReason, unavailableStatus = "warn") {
|
|
120
|
+
const byCheck = new Map((health?.findings ?? []).map(finding => [finding.check, finding]));
|
|
121
|
+
const unavailable = requiredChecks.filter(id => !byCheck.has(id));
|
|
122
|
+
if (unavailable.length > 0) {
|
|
123
|
+
return setupFinding(check, unavailableStatus, `Required deterministic evidence is unavailable: ${unavailable.join(", ")}.`);
|
|
124
|
+
}
|
|
125
|
+
const nonPassing = requiredChecks.filter(id => byCheck.get(id)?.status !== "pass");
|
|
126
|
+
if (nonPassing.length === 0) {
|
|
127
|
+
return setupFinding(check, "pass", passReason);
|
|
128
|
+
}
|
|
129
|
+
const hasFailure = nonPassing.some(id => byCheck.get(id)?.status === "fail");
|
|
130
|
+
return setupFinding(check, hasFailure ? "fail" : "warn", `Deterministic setup evidence is not passing: ${nonPassing.join(", ")}.`);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Require a complete source registry and no open knowledge gaps.
|
|
134
|
+
* @param projectRoot - Project root containing agent-ready evidence
|
|
135
|
+
* @returns Agent-readiness finding from confined registry and gap evidence
|
|
136
|
+
*/
|
|
137
|
+
// eslint-disable-next-line max-lines-per-function, sonarjs/cognitive-complexity -- one bounded registry-and-evidence validation transaction stays auditable together
|
|
138
|
+
export async function agentReadyFinding(projectRoot) {
|
|
139
|
+
try {
|
|
140
|
+
const root = await realpath(projectRoot);
|
|
141
|
+
const [registryText, gapsText] = await Promise.all([
|
|
142
|
+
readProjectText(root, "wiki/state/agent-ready/sources.json"),
|
|
143
|
+
readProjectText(root, "wiki/gaps.md"),
|
|
144
|
+
]);
|
|
145
|
+
if (registryText === undefined || gapsText === undefined) {
|
|
146
|
+
return setupFinding(AGENT_READY_CHECK, "warn", "Agent-ready evidence is incomplete: run /lisa:agent-ready to create the source registry and wiki/gaps.md.");
|
|
147
|
+
}
|
|
148
|
+
const parsed = JSON.parse(registryText);
|
|
149
|
+
if (parsed === null ||
|
|
150
|
+
typeof parsed !== "object" ||
|
|
151
|
+
Array.isArray(parsed) ||
|
|
152
|
+
Reflect.get(parsed, "schema_version") !== 1) {
|
|
153
|
+
return setupFinding(AGENT_READY_CHECK, "fail", "The agent-ready source registry is malformed or unsupported.");
|
|
154
|
+
}
|
|
155
|
+
requireCanonicalUtcTimestamp(Reflect.get(parsed, "updated_at"), "agent-ready updated_at");
|
|
156
|
+
const sources = Reflect.get(parsed, "sources");
|
|
157
|
+
if (!Array.isArray(sources) || sources.length === 0) {
|
|
158
|
+
return setupFinding(AGENT_READY_CHECK, "warn", "The agent-ready source registry has no inventoried sources.");
|
|
159
|
+
}
|
|
160
|
+
const sourceIds = sources.flatMap(source => {
|
|
161
|
+
if (source === null || typeof source !== "object")
|
|
162
|
+
return [];
|
|
163
|
+
const id = Reflect.get(source, "source_id");
|
|
164
|
+
return typeof id === "string" ? [id] : [];
|
|
165
|
+
});
|
|
166
|
+
const validations = await Promise.all(sources.map(source => sourceRowIsComplete(root, source)));
|
|
167
|
+
if (validations.includes("invalid")) {
|
|
168
|
+
return setupFinding(AGENT_READY_CHECK, "fail", "The agent-ready source registry has an invalid row or missing, unsafe, or non-file sanitized evidence.");
|
|
169
|
+
}
|
|
170
|
+
const incomplete = validations.filter(value => value === "incomplete").length;
|
|
171
|
+
if (new Set(sourceIds).size !== sources.length) {
|
|
172
|
+
return setupFinding(AGENT_READY_CHECK, "fail", "The agent-ready source registry has missing or duplicate source identifiers.");
|
|
173
|
+
}
|
|
174
|
+
const openGaps = [...gapsText.matchAll(/\*\*Status\*\*:\s*open\b/giu)]
|
|
175
|
+
.length;
|
|
176
|
+
if (incomplete > 0 || openGaps > 0) {
|
|
177
|
+
return setupFinding(AGENT_READY_CHECK, "warn", `Knowledge convergence is incomplete: ${incomplete} source record${incomplete === 1 ? "" : "s"} incomplete and ${openGaps} open gap${openGaps === 1 ? "" : "s"}.`);
|
|
178
|
+
}
|
|
179
|
+
return setupFinding(AGENT_READY_CHECK, "pass", `All ${sources.length} inventoried sources are complete and wiki/gaps.md has no open gaps.`);
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return setupFinding(AGENT_READY_CHECK, "fail", "Agent-ready evidence is unreadable; re-run /lisa:agent-ready.");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Require the optional wiki to exist before accepting the Health wiki check.
|
|
187
|
+
* @param projectRoot - Project root containing the optional wiki
|
|
188
|
+
* @param health - Current deterministic Health evidence, when available
|
|
189
|
+
* @returns Wiki setup readiness finding
|
|
190
|
+
*/
|
|
191
|
+
export async function wikiSetupFinding(projectRoot, health) {
|
|
192
|
+
try {
|
|
193
|
+
const root = await realpath(projectRoot);
|
|
194
|
+
if ((await projectPathKind(root, "wiki")) !== "directory") {
|
|
195
|
+
return setupFinding(WIKI_CHECK, "warn", "Optional LLM wiki is not installed. Run /lisa:wiki:install.");
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return setupFinding(WIKI_CHECK, "fail", "The wiki path is unsafe or unreadable.");
|
|
200
|
+
}
|
|
201
|
+
return healthEvidenceFinding(WIKI_CHECK, health, ["project.wiki"], "The optional LLM wiki contract files are installed.");
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Read names referenced as `secrets.NAME` from current workflow files.
|
|
205
|
+
* @param projectRoot - Project root containing GitHub workflows
|
|
206
|
+
* @returns Sorted unique explicit workflow secret names
|
|
207
|
+
*/
|
|
208
|
+
export async function readWorkflowSecretNames(projectRoot) {
|
|
209
|
+
try {
|
|
210
|
+
const root = await realpath(projectRoot);
|
|
211
|
+
if ((await projectPathKind(root, ".github/workflows")) !== "directory") {
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
const directory = resolveProjectPath(root, ".github/workflows");
|
|
215
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
216
|
+
const workflowNames = entries
|
|
217
|
+
.filter(entry => entry.isFile() && /\.(?:ya?ml)$/iu.test(entry.name))
|
|
218
|
+
.map(entry => `.github/workflows/${entry.name}`)
|
|
219
|
+
.sort((left, right) => left.localeCompare(right));
|
|
220
|
+
if (workflowNames.length > 100) {
|
|
221
|
+
throw new Error("Workflow secret inventory exceeds the bounded reader");
|
|
222
|
+
}
|
|
223
|
+
const contents = await Promise.all(workflowNames.map(name => readProjectText(root, name, 256 * 1024)));
|
|
224
|
+
const names = contents.flatMap(content => content === undefined
|
|
225
|
+
? []
|
|
226
|
+
: [...content.matchAll(/\bsecrets\.([A-Z][A-Z0-9_]*)\b/gu)].map(match => match[1]));
|
|
227
|
+
return [...new Set(names)]
|
|
228
|
+
.filter(name => !IMPLICIT_WORKFLOW_SECRETS.has(name))
|
|
229
|
+
.sort((left, right) => left.localeCompare(right));
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
return [];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=ui-setup-readiness-local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-setup-readiness-local.js","sourceRoot":"","sources":["../../src/cli/ui-setup-readiness-local.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBA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