@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.
Files changed (125) hide show
  1. package/all/copy-contents/gitignore +2 -0
  2. package/dist/cli/index.d.ts +3 -0
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +20 -15
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/standards-proof-cmd.d.ts +7 -0
  7. package/dist/cli/standards-proof-cmd.d.ts.map +1 -0
  8. package/dist/cli/standards-proof-cmd.js +14 -0
  9. package/dist/cli/standards-proof-cmd.js.map +1 -0
  10. package/dist/cli/ui-setup-readiness-local.d.ts +2 -1
  11. package/dist/cli/ui-setup-readiness-local.d.ts.map +1 -1
  12. package/dist/cli/ui-setup-readiness-local.js +4 -2
  13. package/dist/cli/ui-setup-readiness-local.js.map +1 -1
  14. package/dist/cli/ui-setup-readiness.d.ts.map +1 -1
  15. package/dist/cli/ui-setup-readiness.js +3 -2
  16. package/dist/cli/ui-setup-readiness.js.map +1 -1
  17. package/dist/cli/update-check-hook.d.ts +19 -0
  18. package/dist/cli/update-check-hook.d.ts.map +1 -0
  19. package/dist/cli/update-check-hook.js +36 -0
  20. package/dist/cli/update-check-hook.js.map +1 -0
  21. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  22. package/dist/core/upstream-evidence-manifest.js +37 -6
  23. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  24. package/dist/standards/capture.d.ts +41 -0
  25. package/dist/standards/capture.d.ts.map +1 -0
  26. package/dist/standards/capture.js +196 -0
  27. package/dist/standards/capture.js.map +1 -0
  28. package/dist/standards/contract.d.ts +45 -0
  29. package/dist/standards/contract.d.ts.map +1 -0
  30. package/dist/standards/contract.js +175 -0
  31. package/dist/standards/contract.js.map +1 -0
  32. package/dist/standards/git-state.d.ts +30 -0
  33. package/dist/standards/git-state.d.ts.map +1 -0
  34. package/dist/standards/git-state.js +179 -0
  35. package/dist/standards/git-state.js.map +1 -0
  36. package/dist/standards/index.d.ts +8 -0
  37. package/dist/standards/index.d.ts.map +1 -0
  38. package/dist/standards/index.js +8 -0
  39. package/dist/standards/index.js.map +1 -0
  40. package/dist/standards/readiness.d.ts +11 -0
  41. package/dist/standards/readiness.d.ts.map +1 -0
  42. package/dist/standards/readiness.js +170 -0
  43. package/dist/standards/readiness.js.map +1 -0
  44. package/dist/standards/registry.d.ts +42 -0
  45. package/dist/standards/registry.d.ts.map +1 -0
  46. package/dist/standards/registry.js +330 -0
  47. package/dist/standards/registry.js.map +1 -0
  48. package/dist/standards/storage-reasons.d.ts +15 -0
  49. package/dist/standards/storage-reasons.d.ts.map +1 -0
  50. package/dist/standards/storage-reasons.js +48 -0
  51. package/dist/standards/storage-reasons.js.map +1 -0
  52. package/dist/standards/storage.d.ts +36 -0
  53. package/dist/standards/storage.d.ts.map +1 -0
  54. package/dist/standards/storage.js +330 -0
  55. package/dist/standards/storage.js.map +1 -0
  56. package/dist/standards/test-evidence.d.ts +19 -0
  57. package/dist/standards/test-evidence.d.ts.map +1 -0
  58. package/dist/standards/test-evidence.js +195 -0
  59. package/dist/standards/test-evidence.js.map +1 -0
  60. package/package.json +1 -1
  61. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa/.codex-plugin/skills/lisa-doctor/SKILL.md +21 -3
  64. package/plugins/lisa/scripts/doctor-report.mjs +266 -22
  65. package/plugins/lisa/skills/lisa-doctor/SKILL.md +21 -3
  66. package/plugins/lisa-agy/plugin.json +1 -1
  67. package/plugins/lisa-agy/scripts/doctor-report.mjs +266 -22
  68. package/plugins/lisa-agy/skills/lisa-doctor/SKILL.md +21 -3
  69. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  71. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  72. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-copilot/scripts/doctor-report.mjs +266 -22
  76. package/plugins/lisa-copilot/skills/lisa-doctor/SKILL.md +21 -3
  77. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-cursor/scripts/doctor-report.mjs +266 -22
  79. package/plugins/lisa-cursor/skills/lisa-doctor/SKILL.md +21 -3
  80. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-expo-agy/plugin.json +1 -1
  83. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  88. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  92. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  93. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  97. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  98. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  103. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  107. package/plugins/lisa-rails-agy/plugin.json +1 -1
  108. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  112. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  113. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  117. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  118. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  120. package/plugins/src/base/scripts/doctor-report.mjs +266 -22
  121. package/plugins/src/base/skills/lisa-doctor/SKILL.md +21 -3
  122. package/rails/copy-overwrite/lefthook.yml +9 -11
  123. package/rails/copy-overwrite/scripts/lisa-clean-git-env.sh +13 -0
  124. package/typescript/copy-contents/.husky/pre-push +9 -0
  125. package/ui/index.html +3 -2
@@ -0,0 +1,41 @@
1
+ import type { ProjectType } from "../core/config.js";
2
+ import { readConfinedMergedConfig } from "../cli/ui-confined-project-read.js";
3
+ import { type StandardsProof } from "./contract.js";
4
+ import { readStandardsGitState, requireStandardsBaseCommit } from "./git-state.js";
5
+ import { resolveStandardsCheckPlan, type StandardsCheckSpec } from "./registry.js";
6
+ import { writeStandardsProof } from "./storage.js";
7
+ /** Bounded result from one standards command invocation. */
8
+ export interface StandardsCommandOutcome {
9
+ readonly exitCode: number;
10
+ readonly output: string;
11
+ }
12
+ /** Injectable boundaries for focused capture verification. */
13
+ export interface StandardsCaptureDependencies {
14
+ readonly readGitState: typeof readStandardsGitState;
15
+ readonly requireBaseCommit: typeof requireStandardsBaseCommit;
16
+ readonly readProjectTypes: (root: string) => Promise<readonly ProjectType[]>;
17
+ readonly readConfig: typeof readConfinedMergedConfig;
18
+ readonly resolvePlan: typeof resolveStandardsCheckPlan;
19
+ readonly runCommand: (root: string, check: StandardsCheckSpec) => Promise<StandardsCommandOutcome>;
20
+ readonly writeProof: typeof writeStandardsProof;
21
+ readonly lisaVersion: () => string;
22
+ readonly now: () => Date;
23
+ readonly onProgress: (message: string) => void;
24
+ }
25
+ /**
26
+ * Run every current applicable check and publish proof only after all pass and
27
+ * every bound input remains unchanged. This establishes automated standards
28
+ * conformance; it does not claim empirical product verification.
29
+ * @param projectRoot - Supported project repository
30
+ * @param dependencies - Injectable process boundaries
31
+ * @returns Strict proof written for the unchanged artifact
32
+ */
33
+ export declare function captureStandardsProof(projectRoot: string, dependencies?: Partial<StandardsCaptureDependencies>): Promise<StandardsProof>;
34
+ /**
35
+ * Execute one fixed argv with a deadline, no shell, and bounded private output.
36
+ * @param root - Canonical project repository
37
+ * @param check - Fixed registry check to execute
38
+ * @returns Exit status and bounded private output
39
+ */
40
+ export declare function runStandardsCommand(root: string, check: StandardsCheckSpec): Promise<StandardsCommandOutcome>;
41
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/standards/capture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB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GAAE,OAAO,CAAC,4BAA4B,CAAM,GACvD,OAAO,CAAC,cAAc,CAAC,CA2DzB;AA8DD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,uBAAuB,CAAC,CA2DlC"}
@@ -0,0 +1,196 @@
1
+ /** Explicit standards-proof capture orchestration. */
2
+ import { execFile } from "node:child_process";
3
+ import { promisify } from "node:util";
4
+ import { getPackageVersion } from "../cli/version.js";
5
+ import { readConfinedDetectedStacks } from "../cli/ui-detected-stacks.js";
6
+ import { readConfinedMergedConfig } from "../cli/ui-confined-project-read.js";
7
+ import { STANDARDS_PROOF_ARTIFACT, } from "./contract.js";
8
+ import { readStandardsGitState, requireStandardsBaseCommit, } from "./git-state.js";
9
+ import { resolveStandardsCheckPlan, } from "./registry.js";
10
+ import { writeStandardsProof } from "./storage.js";
11
+ import { hasPositiveTestEvidence } from "./test-evidence.js";
12
+ const execFileAsync = promisify(execFile);
13
+ const MAX_CHECK_OUTPUT_BYTES = 1024 * 1024;
14
+ const DEFAULT_DEPENDENCIES = {
15
+ readGitState: readStandardsGitState,
16
+ requireBaseCommit: requireStandardsBaseCommit,
17
+ readProjectTypes: readConfinedDetectedStacks,
18
+ readConfig: readConfinedMergedConfig,
19
+ resolvePlan: resolveStandardsCheckPlan,
20
+ runCommand: runStandardsCommand,
21
+ writeProof: writeStandardsProof,
22
+ lisaVersion: getPackageVersion,
23
+ now: () => new Date(),
24
+ onProgress: message => process.stdout.write(`${message}\n`),
25
+ };
26
+ /**
27
+ * Run every current applicable check and publish proof only after all pass and
28
+ * every bound input remains unchanged. This establishes automated standards
29
+ * conformance; it does not claim empirical product verification.
30
+ * @param projectRoot - Supported project repository
31
+ * @param dependencies - Injectable process boundaries
32
+ * @returns Strict proof written for the unchanged artifact
33
+ */
34
+ export async function captureStandardsProof(projectRoot, dependencies = {}) {
35
+ const deps = { ...DEFAULT_DEPENDENCIES, ...dependencies };
36
+ const before = await observeBoundInputs(projectRoot, deps);
37
+ if (!before.git.clean) {
38
+ throw new Error("Standards proof requires a clean tracked, staged, submodule, and nonignored worktree.");
39
+ }
40
+ await deps.requireBaseCommit(before.git.root);
41
+ const results = [];
42
+ for (const check of before.plan.checks) {
43
+ deps.onProgress(`standards-proof: running ${check.id}`);
44
+ const startedAt = deps.now().toISOString();
45
+ const outcome = await deps.runCommand(before.git.root, check);
46
+ const completedAt = deps.now().toISOString();
47
+ if (outcome.exitCode !== 0) {
48
+ throw new Error(`Standards check failed: ${check.id}.`);
49
+ }
50
+ if (check.testEvidence !== undefined &&
51
+ !hasPositiveTestEvidence(check.testEvidence, outcome.output)) {
52
+ throw new Error(`Standards check did not prove any executed tests: ${check.id}.`);
53
+ }
54
+ // eslint-disable-next-line functional/immutable-data -- bounded ordered check ledger is private until validation and atomic publication
55
+ results.push(Object.freeze({
56
+ check: check.id,
57
+ category: check.category,
58
+ status: "pass",
59
+ startedAt,
60
+ completedAt,
61
+ }));
62
+ }
63
+ const after = await observeBoundInputs(before.git.root, deps);
64
+ assertUnchanged(before, after);
65
+ // eslint-disable-next-line code-organization/enforce-statement-order -- capture time must be read only after unchanged-input validation
66
+ const capturedAt = deps.now().toISOString();
67
+ // eslint-disable-next-line code-organization/enforce-statement-order -- immutable proof assembly intentionally follows unchanged-input validation
68
+ const proof = {
69
+ schemaVersion: 1,
70
+ artifact: STANDARDS_PROOF_ARTIFACT,
71
+ lisaVersion: deps.lisaVersion(),
72
+ registryDigest: before.plan.registryDigest,
73
+ configDigest: before.plan.configDigest,
74
+ repository: {
75
+ identity: before.git.identity,
76
+ head: before.git.head,
77
+ tree: before.git.tree,
78
+ },
79
+ projectTypes: before.projectTypes,
80
+ applicableChecks: before.plan.checks.map(check => check.id),
81
+ capturedAt,
82
+ results,
83
+ };
84
+ return (await deps.writeProof(before.git.root, proof, deps.now())).proof;
85
+ }
86
+ /**
87
+ * Capture the exact stack/config/registry/git state around command execution.
88
+ * @param projectRoot - Supported project repository
89
+ * @param deps - Injectable process boundaries
90
+ * @returns Current proof-bound inputs
91
+ */
92
+ async function observeBoundInputs(projectRoot, deps) {
93
+ const git = await deps.readGitState(projectRoot);
94
+ const [projectTypes, config] = await Promise.all([
95
+ deps.readProjectTypes(git.root),
96
+ deps.readConfig(git.root),
97
+ ]);
98
+ const plan = await deps.resolvePlan(git.root, projectTypes, config);
99
+ return Object.freeze({ git, projectTypes, plan });
100
+ }
101
+ /**
102
+ * Reject any before/after drift before storage mutation.
103
+ * @param before - Inputs observed before quality commands
104
+ * @param after - Inputs observed after quality commands
105
+ */
106
+ function assertUnchanged(before, after) {
107
+ if (!after.git.clean) {
108
+ throw new Error("Repository changed while standards checks were running.");
109
+ }
110
+ const scalarPairs = [
111
+ ["identity", before.git.identity, after.git.identity],
112
+ ["HEAD", before.git.head, after.git.head],
113
+ ["tree", before.git.tree, after.git.tree],
114
+ ["registry", before.plan.registryDigest, after.plan.registryDigest],
115
+ ["config", before.plan.configDigest, after.plan.configDigest],
116
+ ];
117
+ const changed = scalarPairs.find(([_label, left, right]) => left !== right);
118
+ if (changed !== undefined) {
119
+ throw new Error(`Standards proof input changed during capture: ${changed[0]}.`);
120
+ }
121
+ if (JSON.stringify(before.projectTypes) !== JSON.stringify(after.projectTypes)) {
122
+ throw new Error("Standards proof project types changed during capture.");
123
+ }
124
+ if (JSON.stringify(before.plan.checks) !== JSON.stringify(after.plan.checks)) {
125
+ throw new Error("Standards proof check plan changed during capture.");
126
+ }
127
+ }
128
+ /**
129
+ * Execute one fixed argv with a deadline, no shell, and bounded private output.
130
+ * @param root - Canonical project repository
131
+ * @param check - Fixed registry check to execute
132
+ * @returns Exit status and bounded private output
133
+ */
134
+ export async function runStandardsCommand(root, check) {
135
+ const [command, ...args] = check.argv;
136
+ try {
137
+ const { stdout, stderr } = await execFileAsync(command, args, {
138
+ cwd: root,
139
+ timeout: check.timeoutMs,
140
+ maxBuffer: MAX_CHECK_OUTPUT_BYTES,
141
+ encoding: "utf8",
142
+ env: {
143
+ ...getProcessEnvironment(),
144
+ GIT_ALTERNATE_OBJECT_DIRECTORIES: undefined,
145
+ GIT_CONFIG: undefined,
146
+ GIT_CONFIG_PARAMETERS: undefined,
147
+ GIT_CONFIG_COUNT: undefined,
148
+ GIT_OBJECT_DIRECTORY: undefined,
149
+ GIT_DIR: undefined,
150
+ GIT_WORK_TREE: undefined,
151
+ GIT_IMPLICIT_WORK_TREE: undefined,
152
+ GIT_GRAFT_FILE: undefined,
153
+ GIT_INDEX_FILE: undefined,
154
+ GIT_NO_REPLACE_OBJECTS: undefined,
155
+ GIT_REPLACE_REF_BASE: undefined,
156
+ GIT_PREFIX: undefined,
157
+ GIT_SHALLOW_FILE: undefined,
158
+ GIT_COMMON_DIR: undefined,
159
+ GIT_OPTIONAL_LOCKS: "0",
160
+ CI: "1",
161
+ VERIFY_BASE_SHA: undefined,
162
+ VERIFY_HEAD_SHA: undefined,
163
+ VERIFY_BASE_REF: undefined,
164
+ VERIFY_CHANGE_TYPES: undefined,
165
+ VERIFY_LABELS: undefined,
166
+ VERIFY_PR_NUMBER: undefined,
167
+ VERIFY_GITHUB_REPOSITORY: undefined,
168
+ VERIFY_GITHUB_TOKEN: undefined,
169
+ ...check.environment,
170
+ },
171
+ });
172
+ return Object.freeze({ exitCode: 0, output: `${stdout}\n${stderr}` });
173
+ }
174
+ catch (error) {
175
+ const failure = error;
176
+ if (failure.code === "ENOENT") {
177
+ throw new Error(`Required standards tool is unavailable for ${check.id}.`);
178
+ }
179
+ if (failure.killed === true) {
180
+ throw new Error(`Standards check timed out: ${check.id}.`);
181
+ }
182
+ return Object.freeze({
183
+ exitCode: typeof failure.code === "number" ? failure.code : 1,
184
+ output: `${failure.stdout ?? ""}\n${failure.stderr ?? ""}`,
185
+ });
186
+ }
187
+ }
188
+ /**
189
+ * Read the explicit CLI process environment for child quality commands.
190
+ * @returns Current process environment
191
+ */
192
+ function getProcessEnvironment() {
193
+ // eslint-disable-next-line no-restricted-syntax -- explicit operator command must inherit the configured project toolchain
194
+ return process.env;
195
+ }
196
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/standards/capture.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAE3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,GAG1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC1C,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;AAyB3C,MAAM,oBAAoB,GAAiC;IACzD,YAAY,EAAE,qBAAqB;IACnC,iBAAiB,EAAE,0BAA0B;IAC7C,gBAAgB,EAAE,0BAA0B;IAC5C,UAAU,EAAE,wBAAwB;IACpC,WAAW,EAAE,yBAAyB;IACtC,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE,mBAAmB;IAC/B,WAAW,EAAE,iBAAiB;IAC9B,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;IACrB,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC;CA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OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7D,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,KAAK,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE;SAC3D,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,2HAA2H;IAC3H,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /** Strict, agent-neutral contract for one standards-conformance proof. */
2
+ import type { ProjectType } from "../core/config.js";
3
+ export declare const STANDARDS_PROOF_PATH = ".lisa/standards/latest.json";
4
+ export declare const STANDARDS_PROOF_ARTIFACT = "lisa-standards-proof";
5
+ export declare const STANDARDS_PROOF_SCHEMA_VERSION = 1;
6
+ export declare const STANDARDS_CHECK_CATEGORIES: readonly ["lint", "static-analysis", "test", "guardrail", "threshold"];
7
+ /** Closed category names accepted in standards proof results. */
8
+ export type StandardsCheckCategory = (typeof STANDARDS_CHECK_CATEGORIES)[number];
9
+ /** One successful bounded check, without stdout, stderr, or environment data. */
10
+ export interface StandardsProofResult {
11
+ readonly check: string;
12
+ readonly category: StandardsCheckCategory;
13
+ readonly status: "pass";
14
+ readonly startedAt: string;
15
+ readonly completedAt: string;
16
+ }
17
+ /** Git artifact identity established by a standards run. */
18
+ export interface StandardsRepositoryProof {
19
+ readonly identity: string;
20
+ readonly head: string;
21
+ readonly tree: string;
22
+ }
23
+ /** Complete immutable proof envelope. */
24
+ export interface StandardsProof {
25
+ readonly schemaVersion: 1;
26
+ readonly artifact: typeof STANDARDS_PROOF_ARTIFACT;
27
+ readonly lisaVersion: string;
28
+ readonly registryDigest: string;
29
+ readonly configDigest: string;
30
+ readonly repository: StandardsRepositoryProof;
31
+ readonly projectTypes: readonly ProjectType[];
32
+ readonly applicableChecks: readonly string[];
33
+ readonly capturedAt: string;
34
+ readonly results: readonly StandardsProofResult[];
35
+ }
36
+ /**
37
+ * Validate untrusted proof data into a detached, deeply frozen envelope.
38
+ * Timestamps are audit metadata only: they must be ordered and not in the
39
+ * future, but proof freshness is established by recomputed bound inputs.
40
+ * @param candidate - Untrusted proof candidate
41
+ * @param now - Observation time used only to reject future timestamps
42
+ * @returns Strict immutable proof
43
+ */
44
+ export declare function validateStandardsProof(candidate: unknown, now?: Date): StandardsProof;
45
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/standards/contract.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWrD,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,eAAO,MAAM,0BAA0B,wEAM7B,CAAC;AACX,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,wBAAwB,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACnD;AAqCD;;;;;;;GAOG;AAEH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,OAAO,EAClB,GAAG,GAAE,IAAiB,GACrB,cAAc,CA6EhB"}
@@ -0,0 +1,175 @@
1
+ import { hasUnsafeTextCharacter, readStrictDenseArray, readStrictProperty as read, requireBoundedMachineId, requireCanonicalUtcTimestamp, requireClosedString, requireStrictRecord, } from "../health/strict-validation.js";
2
+ export const STANDARDS_PROOF_PATH = ".lisa/standards/latest.json";
3
+ export const STANDARDS_PROOF_ARTIFACT = "lisa-standards-proof";
4
+ export const STANDARDS_PROOF_SCHEMA_VERSION = 1;
5
+ export const STANDARDS_CHECK_CATEGORIES = [
6
+ "lint",
7
+ "static-analysis",
8
+ "test",
9
+ "guardrail",
10
+ "threshold",
11
+ ];
12
+ const PROOF_FIELDS = [
13
+ "schemaVersion",
14
+ "artifact",
15
+ "lisaVersion",
16
+ "registryDigest",
17
+ "configDigest",
18
+ "repository",
19
+ "projectTypes",
20
+ "applicableChecks",
21
+ "capturedAt",
22
+ "results",
23
+ ];
24
+ const REPOSITORY_FIELDS = ["identity", "head", "tree"];
25
+ const RESULT_FIELDS = [
26
+ "check",
27
+ "category",
28
+ "status",
29
+ "startedAt",
30
+ "completedAt",
31
+ ];
32
+ const PROJECT_TYPES = [
33
+ "typescript",
34
+ "npm-package",
35
+ "harper-fabric",
36
+ "phaser",
37
+ "expo",
38
+ "nestjs",
39
+ "cdk",
40
+ "rails",
41
+ ];
42
+ const MAX_CHECKS = 64;
43
+ const SHA = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u;
44
+ const DIGEST = /^sha256:[0-9a-f]{64}$/u;
45
+ const REPOSITORY_IDENTITY = /^[a-z\d.-]+(?::\d+)?\/[a-z\d._/-]+$/u;
46
+ /**
47
+ * Validate untrusted proof data into a detached, deeply frozen envelope.
48
+ * Timestamps are audit metadata only: they must be ordered and not in the
49
+ * future, but proof freshness is established by recomputed bound inputs.
50
+ * @param candidate - Untrusted proof candidate
51
+ * @param now - Observation time used only to reject future timestamps
52
+ * @returns Strict immutable proof
53
+ */
54
+ // eslint-disable-next-line max-lines-per-function -- exact closed-field validation remains one auditable transaction
55
+ export function validateStandardsProof(candidate, now = new Date()) {
56
+ const input = requireStrictRecord(candidate, PROOF_FIELDS, "StandardsProof");
57
+ if (read(input, "schemaVersion") !== STANDARDS_PROOF_SCHEMA_VERSION) {
58
+ throw new Error("Invalid standards proof schemaVersion: expected 1");
59
+ }
60
+ if (read(input, "artifact") !== STANDARDS_PROOF_ARTIFACT) {
61
+ throw new Error("Invalid standards proof artifact identity");
62
+ }
63
+ const lisaVersion = requireText(read(input, "lisaVersion"), "lisaVersion", 64);
64
+ const registryDigest = requireDigest(read(input, "registryDigest"), "registryDigest");
65
+ const configDigest = requireDigest(read(input, "configDigest"), "configDigest");
66
+ const repository = requireRepository(read(input, "repository"));
67
+ const projectTypes = readStrictDenseArray(read(input, "projectTypes"), 1, PROJECT_TYPES.length, "projectTypes").map((value, index) => requireClosedString(value, PROJECT_TYPES, `projectTypes[${index}]`));
68
+ if (new Set(projectTypes).size !== projectTypes.length) {
69
+ throw new Error("Invalid projectTypes: entries must be unique");
70
+ }
71
+ const applicableChecks = readStrictDenseArray(read(input, "applicableChecks"), 1, MAX_CHECKS, "applicableChecks").map((value, index) => requireBoundedMachineId(value, `applicableChecks[${index}]`, 128));
72
+ if (new Set(applicableChecks).size !== applicableChecks.length) {
73
+ throw new Error("Invalid applicableChecks: entries must be unique");
74
+ }
75
+ const capturedAt = requireCanonicalUtcTimestamp(read(input, "capturedAt"), "capturedAt");
76
+ if (capturedAt > now.toISOString()) {
77
+ throw new Error("Invalid capturedAt: standards proof is from the future");
78
+ }
79
+ const results = readStrictDenseArray(read(input, "results"), 1, MAX_CHECKS, "results").map((value, index) => requireResult(value, index, capturedAt));
80
+ if (results.length !== applicableChecks.length ||
81
+ results.some((result, index) => result.check !== applicableChecks[index])) {
82
+ throw new Error("Invalid standards proof results: checks must exactly match applicableChecks");
83
+ }
84
+ return Object.freeze({
85
+ schemaVersion: 1,
86
+ artifact: STANDARDS_PROOF_ARTIFACT,
87
+ lisaVersion,
88
+ registryDigest,
89
+ configDigest,
90
+ repository,
91
+ projectTypes: Object.freeze(projectTypes),
92
+ applicableChecks: Object.freeze(applicableChecks),
93
+ capturedAt,
94
+ results: Object.freeze(results),
95
+ });
96
+ }
97
+ /**
98
+ * Validate one result row and its bounded, ordered timestamps.
99
+ * @param candidate - Untrusted result candidate
100
+ * @param index - Result position used in validation messages
101
+ * @param capturedAt - Proof capture timestamp that bounds completion
102
+ * @returns Strict immutable result row
103
+ */
104
+ function requireResult(candidate, index, capturedAt) {
105
+ const input = requireStrictRecord(candidate, RESULT_FIELDS, `results[${index}]`);
106
+ const startedAt = requireCanonicalUtcTimestamp(read(input, "startedAt"), `results[${index}].startedAt`);
107
+ const completedAt = requireCanonicalUtcTimestamp(read(input, "completedAt"), `results[${index}].completedAt`);
108
+ if (completedAt < startedAt || completedAt > capturedAt) {
109
+ throw new Error(`Invalid results[${index}] timestamp order`);
110
+ }
111
+ return Object.freeze({
112
+ check: requireBoundedMachineId(read(input, "check"), `results[${index}].check`, 128),
113
+ category: requireClosedString(read(input, "category"), STANDARDS_CHECK_CATEGORIES, `results[${index}].category`),
114
+ status: requireClosedString(read(input, "status"), ["pass"], `results[${index}].status`),
115
+ startedAt,
116
+ completedAt,
117
+ });
118
+ }
119
+ /**
120
+ * Validate the normalized remote identity and exact Git object IDs.
121
+ * @param candidate - Untrusted repository proof candidate
122
+ * @returns Strict immutable repository proof
123
+ */
124
+ function requireRepository(candidate) {
125
+ const input = requireStrictRecord(candidate, REPOSITORY_FIELDS, "repository");
126
+ const identity = requireText(read(input, "identity"), "repository.identity", 512);
127
+ if (!REPOSITORY_IDENTITY.test(identity) || identity.endsWith(".git")) {
128
+ throw new Error("Invalid repository.identity: expected normalized remote identity");
129
+ }
130
+ const head = requireSha(read(input, "head"), "repository.head");
131
+ const tree = requireSha(read(input, "tree"), "repository.tree");
132
+ return Object.freeze({ identity, head, tree });
133
+ }
134
+ /**
135
+ * Require one SHA-1 or SHA-256 Git object identifier.
136
+ * @param value - Candidate object identifier
137
+ * @param field - Field name used in validation messages
138
+ * @returns Validated object identifier
139
+ */
140
+ function requireSha(value, field) {
141
+ if (typeof value !== "string" || !SHA.test(value)) {
142
+ throw new Error(`Invalid ${field}: expected a Git object identifier`);
143
+ }
144
+ return value;
145
+ }
146
+ /**
147
+ * Require one prefixed SHA-256 digest.
148
+ * @param value - Candidate digest
149
+ * @param field - Field name used in validation messages
150
+ * @returns Validated digest
151
+ */
152
+ function requireDigest(value, field) {
153
+ if (typeof value !== "string" || !DIGEST.test(value)) {
154
+ throw new Error(`Invalid ${field}: expected sha256 digest`);
155
+ }
156
+ return value;
157
+ }
158
+ /**
159
+ * Require compact printable scalar text.
160
+ * @param value - Candidate scalar
161
+ * @param field - Field name used in validation messages
162
+ * @param maximumBytes - Maximum UTF-8 byte length
163
+ * @returns Validated text
164
+ */
165
+ function requireText(value, field, maximumBytes) {
166
+ if (typeof value !== "string" ||
167
+ value.trim() !== value ||
168
+ value.length === 0 ||
169
+ Buffer.byteLength(value, "utf8") > maximumBytes ||
170
+ hasUnsafeTextCharacter(value)) {
171
+ throw new Error(`Invalid ${field}: expected bounded text`);
172
+ }
173
+ return value;
174
+ }
175
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/standards/contract.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,IAAI,IAAI,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAClE,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,iBAAiB;IACjB,MAAM;IACN,WAAW;IACX,WAAW;CACH,CAAC;AAmCX,MAAM,YAAY,GAAG;IACnB,eAAe;IACf,UAAU;IACV,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,YAAY;IACZ,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,SAAS;CACD,CAAC;AACX,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAChE,MAAM,aAAa,GAAG;IACpB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,aAAa;CACL,CAAC;AACX,MAAM,aAAa,GAAG;IACpB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;CACkC,CAAC;AAC5C,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,GAAG,GAAG,kCAAkC,CAAC;AAC/C,MAAM,MAAM,GAAG,wBAAwB,CAAC;AACxC,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAEnE;;;;;;;GAOG;AACH,qHAAqH;AACrH,MAAM,UAAU,sBAAsB,CACpC,SAAk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KAAa,EACb,YAAoB;IAEpB,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,KAAK,KAAK;QACtB,KAAK,CAAC,MAAM,KAAK,CAAC;QAClB,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,YAAY;QAC/C,sBAAsB,CAAC,KAAK,CAAC,EAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,yBAAyB,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** Exact repository state bound into a proof. */
2
+ export interface StandardsGitState {
3
+ readonly root: string;
4
+ readonly identity: string;
5
+ readonly head: string;
6
+ readonly tree: string;
7
+ readonly clean: boolean;
8
+ }
9
+ /**
10
+ * Read canonical identity, commit/tree objects, and complete nonignored dirt.
11
+ * Git optional locks and fsmonitor are disabled because UI observation must be
12
+ * read-only and safe to repeat.
13
+ * @param projectRoot - Path within the repository
14
+ * @returns Bounded repository state
15
+ */
16
+ export declare function readStandardsGitState(projectRoot: string): Promise<StandardsGitState>;
17
+ /**
18
+ * Require a parent commit for the non-vacuous threshold-ratchet comparison.
19
+ * @param projectRoot - Canonical repository root
20
+ * @returns Parent commit object identifier
21
+ */
22
+ export declare function requireStandardsBaseCommit(projectRoot: string): Promise<string>;
23
+ /**
24
+ * Normalize HTTPS, SSH URL, and SCP-like remotes to host[:port]/owner/repo.
25
+ * Credentials are never retained and default transport ports are removed.
26
+ * @param remote - One configured origin URL
27
+ * @returns Stable lowercase repository identity
28
+ */
29
+ export declare function normalizeGitRemoteIdentity(remote: string): string;
30
+ //# sourceMappingURL=git-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-state.d.ts","sourceRoot":"","sources":["../../src/standards/git-state.ts"],"names":[],"mappings":"AASA,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CA8C5B;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBjE"}