@codyswann/lisa 4.105.0 → 4.106.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/lisa.d.ts +21 -0
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +48 -0
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +9 -2
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/sonar/sonar-shim-fs.d.ts +32 -0
- package/dist/sonar/sonar-shim-fs.d.ts.map +1 -0
- package/dist/sonar/sonar-shim-fs.js +70 -0
- package/dist/sonar/sonar-shim-fs.js.map +1 -0
- package/dist/sonar/sonar-shim-repoint.d.ts +71 -0
- package/dist/sonar/sonar-shim-repoint.d.ts.map +1 -0
- package/dist/sonar/sonar-shim-repoint.js +221 -0
- package/dist/sonar/sonar-shim-repoint.js.map +1 -0
- package/package.json +4 -4
- 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-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- package/plugins/lisa/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa-agy/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- 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-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa-copilot/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa-cursor/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/lisa-devin/skills/lisa-root-cause-analysis/SKILL.md +27 -0
- 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-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-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-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-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-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-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-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-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-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-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-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-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-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-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/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-reproduce-bug/SKILL.md +5 -0
- package/plugins/src/base/skills/lisa-root-cause-analysis/SKILL.md +27 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a path is a regular, non-symlinked file, and its permission bits.
|
|
3
|
+
* @param absolute - Absolute path to inspect
|
|
4
|
+
* @returns The permission bits, or undefined when missing or not a regular file
|
|
5
|
+
*/
|
|
6
|
+
export declare function regularFileMode(absolute: string): Promise<number | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a file's real parent directory lies inside the project.
|
|
9
|
+
*
|
|
10
|
+
* `lstat` on the shim only rejects a symlink at the final component; a
|
|
11
|
+
* symlinked ancestor such as `.claude/hooks` would still route the write to a
|
|
12
|
+
* directory outside the checkout. Resolving both sides closes that.
|
|
13
|
+
* @param projectRoot - Absolute project root
|
|
14
|
+
* @param absolute - Absolute path of the file about to be rewritten
|
|
15
|
+
* @returns True when the resolved parent is the project root or beneath it
|
|
16
|
+
*/
|
|
17
|
+
export declare function parentInsideProject(projectRoot: string, absolute: string): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Replace a file's contents atomically, keeping its permission bits.
|
|
20
|
+
*
|
|
21
|
+
* Writes a sibling temporary file, sets its mode, then renames it over the
|
|
22
|
+
* target, so a failure part-way leaves the working shim intact rather than
|
|
23
|
+
* truncated. A target the operator made unwritable is refused up front: the
|
|
24
|
+
* rename would otherwise succeed (it needs only directory write access) and
|
|
25
|
+
* silently override that choice.
|
|
26
|
+
* @param absolute - Absolute path of the file to replace
|
|
27
|
+
* @param body - New contents
|
|
28
|
+
* @param mode - Permission bits for the replacement
|
|
29
|
+
* @throws {Error} When the target is not writable or any step fails
|
|
30
|
+
*/
|
|
31
|
+
export declare function replaceFileAtomically(absolute: string, body: string, mode: number): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=sonar-shim-fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonar-shim-fs.d.ts","sourceRoot":"","sources":["../../src/sonar/sonar-shim-fs.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem guards for repointing Sonar hook shims in place.
|
|
3
|
+
*
|
|
4
|
+
* CodySwannGT/lisa#4502. Split from `sonar-shim-repoint.ts` so the parsing
|
|
5
|
+
* contract and the write-safety contract each stay small enough to read whole.
|
|
6
|
+
* Every helper here exists to make one rewrite of a host-owned file safe: never
|
|
7
|
+
* write through a symlink or out of the project, never leave a truncated shim
|
|
8
|
+
* behind, and never overwrite a shim the operator made read-only.
|
|
9
|
+
* @module sonar/sonar-shim-fs
|
|
10
|
+
*/
|
|
11
|
+
import { randomUUID } from "node:crypto";
|
|
12
|
+
import { constants } from "node:fs";
|
|
13
|
+
import { access, chmod, lstat, realpath, rename, rm, writeFile, } from "node:fs/promises";
|
|
14
|
+
import * as path from "node:path";
|
|
15
|
+
/**
|
|
16
|
+
* Whether a path is a regular, non-symlinked file, and its permission bits.
|
|
17
|
+
* @param absolute - Absolute path to inspect
|
|
18
|
+
* @returns The permission bits, or undefined when missing or not a regular file
|
|
19
|
+
*/
|
|
20
|
+
export async function regularFileMode(absolute) {
|
|
21
|
+
const stats = await lstat(absolute).catch(() => undefined);
|
|
22
|
+
if (stats === undefined || !stats.isFile())
|
|
23
|
+
return undefined;
|
|
24
|
+
return stats.mode & 0o7777;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Whether a file's real parent directory lies inside the project.
|
|
28
|
+
*
|
|
29
|
+
* `lstat` on the shim only rejects a symlink at the final component; a
|
|
30
|
+
* symlinked ancestor such as `.claude/hooks` would still route the write to a
|
|
31
|
+
* directory outside the checkout. Resolving both sides closes that.
|
|
32
|
+
* @param projectRoot - Absolute project root
|
|
33
|
+
* @param absolute - Absolute path of the file about to be rewritten
|
|
34
|
+
* @returns True when the resolved parent is the project root or beneath it
|
|
35
|
+
*/
|
|
36
|
+
export async function parentInsideProject(projectRoot, absolute) {
|
|
37
|
+
const [root, parent] = await Promise.all([
|
|
38
|
+
realpath(projectRoot),
|
|
39
|
+
realpath(path.dirname(absolute)),
|
|
40
|
+
]);
|
|
41
|
+
const relative = path.relative(root, parent);
|
|
42
|
+
return !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Replace a file's contents atomically, keeping its permission bits.
|
|
46
|
+
*
|
|
47
|
+
* Writes a sibling temporary file, sets its mode, then renames it over the
|
|
48
|
+
* target, so a failure part-way leaves the working shim intact rather than
|
|
49
|
+
* truncated. A target the operator made unwritable is refused up front: the
|
|
50
|
+
* rename would otherwise succeed (it needs only directory write access) and
|
|
51
|
+
* silently override that choice.
|
|
52
|
+
* @param absolute - Absolute path of the file to replace
|
|
53
|
+
* @param body - New contents
|
|
54
|
+
* @param mode - Permission bits for the replacement
|
|
55
|
+
* @throws {Error} When the target is not writable or any step fails
|
|
56
|
+
*/
|
|
57
|
+
export async function replaceFileAtomically(absolute, body, mode) {
|
|
58
|
+
await access(absolute, constants.W_OK);
|
|
59
|
+
const temporary = path.join(path.dirname(absolute), `.${path.basename(absolute)}.lisa-${randomUUID()}.tmp`);
|
|
60
|
+
try {
|
|
61
|
+
await writeFile(temporary, body, { flag: "wx", mode });
|
|
62
|
+
await chmod(temporary, mode);
|
|
63
|
+
await rename(temporary, absolute);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
await rm(temporary, { force: true });
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=sonar-shim-fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonar-shim-fs.js","sourceRoot":"","sources":["../../src/sonar/sonar-shim-fs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,EAAE,EACF,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAgB;IAEhB,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,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AC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim locations `lisa-setup-sonar` §4a documents, relative to the project root.
|
|
3
|
+
*
|
|
4
|
+
* Parity gaps, deliberately not listed here: OpenCode and Devin have no vendor
|
|
5
|
+
* `sonar integrate` path, so there is no vendor shim for Lisa to manage; Cursor
|
|
6
|
+
* is wired by `/lisa:setup:sonar` and §4a does not document its shim location,
|
|
7
|
+
* so its repointing stays with that setup skill. Windows `.ps1` shims are also
|
|
8
|
+
* out of scope: the wrapper is bash-only, so those remain manual §4a patching.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SONAR_SHIM_PATHS: readonly string[];
|
|
11
|
+
/** Lisa's Sonar hook wrapper, relative to the project root. */
|
|
12
|
+
export declare const SONAR_WRAPPER_PATH = "scripts/lisa-hooks/sonar-secrets.sh";
|
|
13
|
+
/** Outcome of one repoint pass. */
|
|
14
|
+
export interface SonarShimRepointResult {
|
|
15
|
+
/** Whether the wrapper exists; nothing is rewritten when it does not. */
|
|
16
|
+
readonly wrapperPresent: boolean;
|
|
17
|
+
/** Shim paths (relative to the project root) rewritten by this pass. */
|
|
18
|
+
readonly repointed: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Shim paths that could not be read or rewritten safely: not readable, not
|
|
21
|
+
* writable, or reached through a symlinked folder outside the project.
|
|
22
|
+
*/
|
|
23
|
+
readonly failed: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* Shim paths that call `sonar hook` but are neither the vendor form nor
|
|
26
|
+
* already repointed; left untouched for an operator to patch per §4a.
|
|
27
|
+
*/
|
|
28
|
+
readonly unrecognized: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether a shim already executes the wrapper.
|
|
32
|
+
* @param body - Shim file contents
|
|
33
|
+
* @returns True when an executable line invokes the wrapper
|
|
34
|
+
*/
|
|
35
|
+
export declare function invokesWrapper(body: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Extract the vendor event from an unmodified vendor shim body.
|
|
38
|
+
* @param body - Shim file contents
|
|
39
|
+
* @returns The event name, or undefined when the body is already repointed,
|
|
40
|
+
* customised, or otherwise not exactly the vendor's guard-then-hook sequence
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseVendorShimEvent(body: string): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Render a shim that delegates to the wrapper.
|
|
45
|
+
* @param shebang - The original shim's shebang line, if it had one
|
|
46
|
+
* @param relWrapper - POSIX path from the shim's directory to the wrapper
|
|
47
|
+
* @param event - Vendor event name the wrapper forwards to `sonar hook`
|
|
48
|
+
* @returns New shim body
|
|
49
|
+
*/
|
|
50
|
+
export declare function renderRepointedShim(shebang: string | undefined, relWrapper: string, event: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Called with each shim's absolute path just before it is replaced, so the
|
|
53
|
+
* caller can back it up (apply registers it for rollback).
|
|
54
|
+
*/
|
|
55
|
+
export type BeforeShimWrite = (absolute: string) => Promise<void>;
|
|
56
|
+
/** Options for {@link repointSonarShims}. */
|
|
57
|
+
export interface RepointSonarShimsOptions {
|
|
58
|
+
/** Invoked before each replacement; a rejection marks the shim `failed`. */
|
|
59
|
+
readonly beforeWrite?: BeforeShimWrite;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Repoint every documented vendor shim in a project at Lisa's wrapper.
|
|
63
|
+
*
|
|
64
|
+
* A no-op when the wrapper is absent: a shim pointed at a missing wrapper would
|
|
65
|
+
* fail every hook, which is worse than the vendor behaviour it replaces.
|
|
66
|
+
* @param projectRoot - Absolute project root
|
|
67
|
+
* @param options - Optional pre-write hook (used by apply for rollback backup)
|
|
68
|
+
* @returns Whether the wrapper exists, and each shim's outcome by category
|
|
69
|
+
*/
|
|
70
|
+
export declare function repointSonarShims(projectRoot: string, options?: RepointSonarShimsOptions): Promise<SonarShimRepointResult>;
|
|
71
|
+
//# sourceMappingURL=sonar-shim-repoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonar-shim-repoint.d.ts","sourceRoot":"","sources":["../../src/sonar/sonar-shim-repoint.ts"],"names":[],"mappings":"AA+BA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAM7C,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AAoCxE,mCAAmC;AACnC,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAcD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQrE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ,MAAM,CAaR;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;CACxC;AA0FD;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,sBAAsB,CAAC,CA2BjC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repoint `sonar integrate`-generated hook shims at Lisa's Sonar wrapper.
|
|
3
|
+
*
|
|
4
|
+
* CodySwannGT/lisa#4502. `sonar integrate <agent>` writes a shim that pipes the
|
|
5
|
+
* hook payload straight to `sonar hook <event>`, so an unauthenticated CLI
|
|
6
|
+
* blocks every prompt with a reason that reads like a real finding. #2324
|
|
7
|
+
* shipped `scripts/lisa-hooks/sonar-secrets.sh`, which resolves
|
|
8
|
+
* `SONARQUBE_CLI_TOKEN` and downgrades that case to a warning — but the shim
|
|
9
|
+
* is generated, not copied, so only a human following `lisa-setup-sonar` §4a
|
|
10
|
+
* ever repointed it. A host project whose shim predates #2324 kept blocking
|
|
11
|
+
* every prompt (headless workers never started), and `processSonarIntegration`
|
|
12
|
+
* re-runs `sonar integrate` on each apply, which restores the vendor shim.
|
|
13
|
+
*
|
|
14
|
+
* This module closes the loop at apply time. It is deliberately conservative:
|
|
15
|
+
* it rewrites only a shim at a documented location whose body is exactly the
|
|
16
|
+
* vendor's (comments aside, the `command -v sonar` guard followed by one
|
|
17
|
+
* `sonar hook <event>` line, in that order). A shim that already executes the
|
|
18
|
+
* wrapper is left alone, which makes the rewrite idempotent, and any other body
|
|
19
|
+
* is treated as operator-customised and never touched. Write safety (symlinked
|
|
20
|
+
* ancestors, atomic replacement, read-only shims) lives in `sonar-shim-fs.ts`.
|
|
21
|
+
* @module sonar/sonar-shim-repoint
|
|
22
|
+
*/
|
|
23
|
+
import { readFile } from "node:fs/promises";
|
|
24
|
+
import * as path from "node:path";
|
|
25
|
+
import { parentInsideProject, regularFileMode, replaceFileAtomically, } from "./sonar-shim-fs.js";
|
|
26
|
+
/**
|
|
27
|
+
* Shim locations `lisa-setup-sonar` §4a documents, relative to the project root.
|
|
28
|
+
*
|
|
29
|
+
* Parity gaps, deliberately not listed here: OpenCode and Devin have no vendor
|
|
30
|
+
* `sonar integrate` path, so there is no vendor shim for Lisa to manage; Cursor
|
|
31
|
+
* is wired by `/lisa:setup:sonar` and §4a does not document its shim location,
|
|
32
|
+
* so its repointing stays with that setup skill. Windows `.ps1` shims are also
|
|
33
|
+
* out of scope: the wrapper is bash-only, so those remain manual §4a patching.
|
|
34
|
+
*/
|
|
35
|
+
export const SONAR_SHIM_PATHS = [
|
|
36
|
+
".claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh",
|
|
37
|
+
".claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh",
|
|
38
|
+
".codex/hooks/sonar-secrets/build-scripts/prompt-secrets.sh",
|
|
39
|
+
".github/hooks/sonar-secrets/build-scripts/pretool-secrets.sh",
|
|
40
|
+
".agents/sonar/hooks/pretool-secrets.sh",
|
|
41
|
+
];
|
|
42
|
+
/** Lisa's Sonar hook wrapper, relative to the project root. */
|
|
43
|
+
export const SONAR_WRAPPER_PATH = "scripts/lisa-hooks/sonar-secrets.sh";
|
|
44
|
+
/**
|
|
45
|
+
* An executable line delegating to the wrapper. Only a real invocation counts
|
|
46
|
+
* as "already repointed": a comment that merely names the wrapper must not
|
|
47
|
+
* hide a live `sonar hook` call.
|
|
48
|
+
*/
|
|
49
|
+
const WRAPPER_INVOCATION = /^exec\s+bash\s+"?[^"\s]*scripts\/lisa-hooks\/sonar-secrets\.sh"?\s+[a-z][a-z0-9-]*$/;
|
|
50
|
+
/**
|
|
51
|
+
* The vendor shim's guard, in the only order it is written: anything else (an
|
|
52
|
+
* early `exit 0` that disables the hook, say) is a customisation, and
|
|
53
|
+
* rewriting it would silently re-enable or change what it does.
|
|
54
|
+
*/
|
|
55
|
+
const VENDOR_GUARD_SEQUENCE = [
|
|
56
|
+
/^if\s+!\s+command\s+-v\s+sonar\b[^;]*;\s*then$/,
|
|
57
|
+
/^exit\s+0$/,
|
|
58
|
+
/^fi$/,
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* The single hook call; capture group 1 is the vendor event name.
|
|
62
|
+
*
|
|
63
|
+
* A trailing `"$@"` is recognised but dropped on rewrite: the wrapper takes the
|
|
64
|
+
* event as its only argument, and the vendor shim is never passed others.
|
|
65
|
+
*/
|
|
66
|
+
const VENDOR_HOOK_LINE = /^(?:exec\s+)?(?:cat\s*\|\s*)?sonar\s+hook\s+([a-z][a-z0-9-]*)(?:\s+"\$@")?$/;
|
|
67
|
+
/** Any call of the vendor hook command, whether or not it is recognisable. */
|
|
68
|
+
const SONAR_HOOK_CALL = /\bsonar\s+hook\b/;
|
|
69
|
+
/**
|
|
70
|
+
* The executable lines of a shim: trimmed, without blanks or comments.
|
|
71
|
+
* @param body - Shim file contents
|
|
72
|
+
* @returns Non-blank, non-comment lines in file order
|
|
73
|
+
*/
|
|
74
|
+
function executableLines(body) {
|
|
75
|
+
return body
|
|
76
|
+
.split("\n")
|
|
77
|
+
.map(line => line.trim())
|
|
78
|
+
.filter(line => line !== "" && !line.startsWith("#"));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Whether a shim already executes the wrapper.
|
|
82
|
+
* @param body - Shim file contents
|
|
83
|
+
* @returns True when an executable line invokes the wrapper
|
|
84
|
+
*/
|
|
85
|
+
export function invokesWrapper(body) {
|
|
86
|
+
return executableLines(body).some(line => WRAPPER_INVOCATION.test(line));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Extract the vendor event from an unmodified vendor shim body.
|
|
90
|
+
* @param body - Shim file contents
|
|
91
|
+
* @returns The event name, or undefined when the body is already repointed,
|
|
92
|
+
* customised, or otherwise not exactly the vendor's guard-then-hook sequence
|
|
93
|
+
*/
|
|
94
|
+
export function parseVendorShimEvent(body) {
|
|
95
|
+
const lines = executableLines(body);
|
|
96
|
+
if (lines.length !== VENDOR_GUARD_SEQUENCE.length + 1)
|
|
97
|
+
return undefined;
|
|
98
|
+
const guarded = VENDOR_GUARD_SEQUENCE.every((pattern, index) => pattern.test(lines[index] ?? ""));
|
|
99
|
+
const hookLine = lines[VENDOR_GUARD_SEQUENCE.length] ?? "";
|
|
100
|
+
return guarded ? VENDOR_HOOK_LINE.exec(hookLine)?.[1] : undefined;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Render a shim that delegates to the wrapper.
|
|
104
|
+
* @param shebang - The original shim's shebang line, if it had one
|
|
105
|
+
* @param relWrapper - POSIX path from the shim's directory to the wrapper
|
|
106
|
+
* @param event - Vendor event name the wrapper forwards to `sonar hook`
|
|
107
|
+
* @returns New shim body
|
|
108
|
+
*/
|
|
109
|
+
export function renderRepointedShim(shebang, relWrapper, event) {
|
|
110
|
+
return [
|
|
111
|
+
shebang ?? "#!/bin/bash",
|
|
112
|
+
`# Delegates to Lisa's ${SONAR_WRAPPER_PATH}, which resolves`,
|
|
113
|
+
"# SONARQUBE_CLI_TOKEN and downgrades an unauthenticated scanner to a warning.",
|
|
114
|
+
"# Re-running `sonar integrate` restores the vendor shim; `lisa apply` repoints it.",
|
|
115
|
+
"if ! command -v sonar &> /dev/null; then",
|
|
116
|
+
" exit 0",
|
|
117
|
+
"fi",
|
|
118
|
+
'here="$(cd -- "$(dirname -- "$0")" && pwd)"',
|
|
119
|
+
`exec bash "\${here}/${relWrapper}" ${event}`,
|
|
120
|
+
"",
|
|
121
|
+
].join("\n");
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Classify a body that is not a vendor shim.
|
|
125
|
+
* @param body - Shim file contents
|
|
126
|
+
* @returns `unrecognized` when it still calls `sonar hook` directly
|
|
127
|
+
*/
|
|
128
|
+
function classifyNonVendor(body) {
|
|
129
|
+
if (invokesWrapper(body))
|
|
130
|
+
return "skipped";
|
|
131
|
+
const callsHook = executableLines(body).some(line => SONAR_HOOK_CALL.test(line));
|
|
132
|
+
return callsHook ? "unrecognized" : "skipped";
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Classify a shim body and, when it is the vendor's, rewrite it in place.
|
|
136
|
+
* @param absolute - Absolute shim path
|
|
137
|
+
* @param relative - Shim path relative to the project root
|
|
138
|
+
* @param mode - Permission bits to restore after the write
|
|
139
|
+
* @param beforeWrite - Hook run just before the replacement
|
|
140
|
+
* @returns The outcome for this shim
|
|
141
|
+
*/
|
|
142
|
+
async function rewriteIfVendor(absolute, relative, mode, beforeWrite) {
|
|
143
|
+
const body = await readFile(absolute, "utf8");
|
|
144
|
+
const event = invokesWrapper(body) ? undefined : parseVendorShimEvent(body);
|
|
145
|
+
if (event === undefined)
|
|
146
|
+
return classifyNonVendor(body);
|
|
147
|
+
const firstLine = body.split("\n", 1)[0];
|
|
148
|
+
const shebang = firstLine?.startsWith("#!") ? firstLine : undefined;
|
|
149
|
+
const relWrapper = path.posix.relative(path.posix.dirname(relative), SONAR_WRAPPER_PATH);
|
|
150
|
+
await beforeWrite?.(absolute);
|
|
151
|
+
await replaceFileAtomically(absolute, renderRepointedShim(shebang, relWrapper, event), mode);
|
|
152
|
+
return "repointed";
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Repoint one shim when it is an unmodified vendor shim.
|
|
156
|
+
*
|
|
157
|
+
* Never throws: an unreadable or unwritable shim, or one whose parent folder
|
|
158
|
+
* resolves outside the project through a symlink, is reported as `failed`, so
|
|
159
|
+
* one bad file cannot abort (and roll back) the whole apply and the operator
|
|
160
|
+
* is told about it.
|
|
161
|
+
* @param projectRoot - Absolute project root
|
|
162
|
+
* @param relative - Shim path relative to the project root
|
|
163
|
+
* @param beforeWrite - Hook run just before the replacement
|
|
164
|
+
* @returns The outcome for this shim
|
|
165
|
+
*/
|
|
166
|
+
async function repointShim(projectRoot, relative, beforeWrite) {
|
|
167
|
+
const absolute = path.join(projectRoot, relative);
|
|
168
|
+
const mode = await regularFileMode(absolute);
|
|
169
|
+
if (mode === undefined)
|
|
170
|
+
return "skipped";
|
|
171
|
+
try {
|
|
172
|
+
if (!(await parentInsideProject(projectRoot, absolute)))
|
|
173
|
+
return "failed";
|
|
174
|
+
return await rewriteIfVendor(absolute, relative, mode, beforeWrite);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return "failed";
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Collect the shim paths that ended with one outcome.
|
|
182
|
+
* @param outcomes - Path/outcome pairs in {@link SONAR_SHIM_PATHS} order
|
|
183
|
+
* @param wanted - Outcome to select
|
|
184
|
+
* @returns Matching shim paths
|
|
185
|
+
*/
|
|
186
|
+
function pathsWith(outcomes, wanted) {
|
|
187
|
+
return outcomes
|
|
188
|
+
.filter(([, outcome]) => outcome === wanted)
|
|
189
|
+
.map(([relative]) => relative);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Repoint every documented vendor shim in a project at Lisa's wrapper.
|
|
193
|
+
*
|
|
194
|
+
* A no-op when the wrapper is absent: a shim pointed at a missing wrapper would
|
|
195
|
+
* fail every hook, which is worse than the vendor behaviour it replaces.
|
|
196
|
+
* @param projectRoot - Absolute project root
|
|
197
|
+
* @param options - Optional pre-write hook (used by apply for rollback backup)
|
|
198
|
+
* @returns Whether the wrapper exists, and each shim's outcome by category
|
|
199
|
+
*/
|
|
200
|
+
export async function repointSonarShims(projectRoot, options = {}) {
|
|
201
|
+
const wrapperMode = await regularFileMode(path.join(projectRoot, SONAR_WRAPPER_PATH));
|
|
202
|
+
if (wrapperMode === undefined) {
|
|
203
|
+
return {
|
|
204
|
+
wrapperPresent: false,
|
|
205
|
+
repointed: [],
|
|
206
|
+
failed: [],
|
|
207
|
+
unrecognized: [],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const outcomes = await Promise.all(SONAR_SHIM_PATHS.map(async (relative) => [
|
|
211
|
+
relative,
|
|
212
|
+
await repointShim(projectRoot, relative, options.beforeWrite),
|
|
213
|
+
]));
|
|
214
|
+
return {
|
|
215
|
+
wrapperPresent: true,
|
|
216
|
+
repointed: pathsWith(outcomes, "repointed"),
|
|
217
|
+
failed: pathsWith(outcomes, "failed"),
|
|
218
|
+
unrecognized: pathsWith(outcomes, "unrecognized"),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=sonar-shim-repoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonar-shim-repoint.js","sourceRoot":"","sources":["../../src/sonar/sonar-shim-repoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,6DAA6D;IAC7D,8DAA8D;IAC9D,4DAA4D;IAC5D,8DAA8D;IAC9D,wCAAwC;CACzC,CAAC;AAEF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAExE;;;;GAIG;AACH,MAAM,kBAAkB,GACtB,qFAAqF,CAAC;AAExF;;;;GAIG;AACH,MAAM,qBAAqB,GAAsB;IAC/C,gDAAgD;IAChD,YAAY;IACZ,MAAM;CACP,CAAC;AAEF;;;;;GAKG;AACH,MAAM,gBAAgB,GACpB,6EAA6E,CAAC;AAEhF,8EAA8E;AAC9E,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAuB3C;;;;GAIG;AACH,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SACxB,M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MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,gBAAgB,CAAC,GAAG,CAClB,KAAK,EAAC,QAAQ,EAAC,EAAE,CACf;QACE,QAAQ;QACR,MAAM,WAAW,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC;KACrD,CACb,CACF,CAAC;IACF,OAAO;QACL,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;QAC3C,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACrC,YAAY,EAAE,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"qs": "^6.16.0"
|
|
195
195
|
},
|
|
196
196
|
"name": "@codyswann/lisa",
|
|
197
|
-
"version": "4.
|
|
197
|
+
"version": "4.106.1",
|
|
198
198
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
199
199
|
"main": "dist/index.js",
|
|
200
200
|
"exports": {
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"test": "tests"
|
|
358
358
|
},
|
|
359
359
|
"types": "./dist/index.d.ts",
|
|
360
|
-
"lisaReleaseCommit": "
|
|
361
|
-
"gitHead": "
|
|
362
|
-
"lisaReleaseTag": "v4.
|
|
360
|
+
"lisaReleaseCommit": "c02ad27ae6d3157449a57bcf3782f57788677cab",
|
|
361
|
+
"gitHead": "c02ad27ae6d3157449a57bcf3782f57788677cab",
|
|
362
|
+
"lisaReleaseTag": "v4.106.1"
|
|
363
363
|
}
|
|
@@ -24,6 +24,11 @@ So the reproduction states, explicitly:
|
|
|
24
24
|
- **Prerequisites**, listed as setup.
|
|
25
25
|
- **Replacement scaffolding**, each item with the real behaviour it substitutes.
|
|
26
26
|
- **Whether the failure survives with prerequisites in place and replacement scaffolding removed.** If it does not, this is a lead rather than a reproduction. Say so and keep going.
|
|
27
|
+
- **That the entry point reaches the code the fix will change.** A reproduction
|
|
28
|
+
that mounts or calls the cited component or function directly, not through
|
|
29
|
+
the entry point, is replacement scaffolding. Show the path (importer trace, a
|
|
30
|
+
temporary `[DEBUG:<issue>]`-tagged `throw`, or route-scoped coverage) before treating the cited code
|
|
31
|
+
as the fix target.
|
|
27
32
|
|
|
28
33
|
If the real path is unreachable — no credentials, no environment, no data — that is a blocked reproduction. Report the missing access instead of substituting scaffolding and calling the bug reproduced.
|
|
29
34
|
|
|
@@ -13,6 +13,31 @@ Produce a proof, not an explanation. Every link in the chain rests on something
|
|
|
13
13
|
|
|
14
14
|
The characteristic failure of this work is a fluent wrong answer: a plausible story assembled from reading code and delivered with confidence. Reading is how a hypothesis is formed. Running something is how it is confirmed. **Do not report a cause you have not executed against.**
|
|
15
15
|
|
|
16
|
+
## A cited line is a hypothesis, not a location
|
|
17
|
+
|
|
18
|
+
When the work item names a file, symbol or line as the cause, treat that as
|
|
19
|
+
hypothesis zero. Its kill condition is: **no production entry point reaches it.**
|
|
20
|
+
Check that before editing anything.
|
|
21
|
+
|
|
22
|
+
- Trace importers of the module, including barrel re-exports and default exports,
|
|
23
|
+
up to a route, screen, endpoint or command the user actually hits.
|
|
24
|
+
- A module with no importers can still be an entry point itself: a script or
|
|
25
|
+
command launched directly, a `bin`/`main` in the package manifest, a
|
|
26
|
+
file-based route, or a handler, job or plugin registered through
|
|
27
|
+
configuration. Check that before reading zero importers as dead code.
|
|
28
|
+
Zero production importers kills the hypothesis only when the module is not
|
|
29
|
+
itself an entry point: then the code is dead or superseded, and fixing it
|
|
30
|
+
changes nothing the user sees.
|
|
31
|
+
- When the trace is ambiguous, prove it by execution: a temporary
|
|
32
|
+
`throw new Error("[DEBUG:<issue>] reached")` (or a `[DEBUG:<issue>]` log line)
|
|
33
|
+
in the cited block while driving the real entry point,
|
|
34
|
+
or coverage scoped to that route. If it never fires, the line is not on the path.
|
|
35
|
+
- A test that renders or calls the cited symbol directly does not establish
|
|
36
|
+
reachability. It goes red-to-green on dead code too.
|
|
37
|
+
|
|
38
|
+
Record the result in the evidence trail:
|
|
39
|
+
`Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)`.
|
|
40
|
+
|
|
16
41
|
## Surviving a disproof is not proof
|
|
17
42
|
|
|
18
43
|
A candidate that no observation has killed is **still standing**, not confirmed. Elimination narrows the field; it does not establish a cause. Closing requires a **positive confirmation**: an execution whose output is what the cause predicts and would not be what it produces if the cause were something else.
|
|
@@ -123,6 +148,8 @@ Stopping is a legitimate outcome and not a silent one. Record the verdict as **u
|
|
|
123
148
|
|---|---|---|---|
|
|
124
149
|
| 1 | file:line | log output, value, exit code | what this establishes |
|
|
125
150
|
|
|
151
|
+
Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)
|
|
152
|
+
|
|
126
153
|
### Cause — confirmed verdicts only
|
|
127
154
|
**Proximate:** file:line — the line that directly produces the symptom.
|
|
128
155
|
**Root:** file:line — why that line behaves that way.
|
|
@@ -22,6 +22,11 @@ So the reproduction states, explicitly:
|
|
|
22
22
|
- **Prerequisites**, listed as setup.
|
|
23
23
|
- **Replacement scaffolding**, each item with the real behaviour it substitutes.
|
|
24
24
|
- **Whether the failure survives with prerequisites in place and replacement scaffolding removed.** If it does not, this is a lead rather than a reproduction. Say so and keep going.
|
|
25
|
+
- **That the entry point reaches the code the fix will change.** A reproduction
|
|
26
|
+
that mounts or calls the cited component or function directly, not through
|
|
27
|
+
the entry point, is replacement scaffolding. Show the path (importer trace, a
|
|
28
|
+
temporary `[DEBUG:<issue>]`-tagged `throw`, or route-scoped coverage) before treating the cited code
|
|
29
|
+
as the fix target.
|
|
25
30
|
|
|
26
31
|
If the real path is unreachable — no credentials, no environment, no data — that is a blocked reproduction. Report the missing access instead of substituting scaffolding and calling the bug reproduced.
|
|
27
32
|
|
|
@@ -11,6 +11,31 @@ Produce a proof, not an explanation. Every link in the chain rests on something
|
|
|
11
11
|
|
|
12
12
|
The characteristic failure of this work is a fluent wrong answer: a plausible story assembled from reading code and delivered with confidence. Reading is how a hypothesis is formed. Running something is how it is confirmed. **Do not report a cause you have not executed against.**
|
|
13
13
|
|
|
14
|
+
## A cited line is a hypothesis, not a location
|
|
15
|
+
|
|
16
|
+
When the work item names a file, symbol or line as the cause, treat that as
|
|
17
|
+
hypothesis zero. Its kill condition is: **no production entry point reaches it.**
|
|
18
|
+
Check that before editing anything.
|
|
19
|
+
|
|
20
|
+
- Trace importers of the module, including barrel re-exports and default exports,
|
|
21
|
+
up to a route, screen, endpoint or command the user actually hits.
|
|
22
|
+
- A module with no importers can still be an entry point itself: a script or
|
|
23
|
+
command launched directly, a `bin`/`main` in the package manifest, a
|
|
24
|
+
file-based route, or a handler, job or plugin registered through
|
|
25
|
+
configuration. Check that before reading zero importers as dead code.
|
|
26
|
+
Zero production importers kills the hypothesis only when the module is not
|
|
27
|
+
itself an entry point: then the code is dead or superseded, and fixing it
|
|
28
|
+
changes nothing the user sees.
|
|
29
|
+
- When the trace is ambiguous, prove it by execution: a temporary
|
|
30
|
+
`throw new Error("[DEBUG:<issue>] reached")` (or a `[DEBUG:<issue>]` log line)
|
|
31
|
+
in the cited block while driving the real entry point,
|
|
32
|
+
or coverage scoped to that route. If it never fires, the line is not on the path.
|
|
33
|
+
- A test that renders or calls the cited symbol directly does not establish
|
|
34
|
+
reachability. It goes red-to-green on dead code too.
|
|
35
|
+
|
|
36
|
+
Record the result in the evidence trail:
|
|
37
|
+
`Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)`.
|
|
38
|
+
|
|
14
39
|
## Surviving a disproof is not proof
|
|
15
40
|
|
|
16
41
|
A candidate that no observation has killed is **still standing**, not confirmed. Elimination narrows the field; it does not establish a cause. Closing requires a **positive confirmation**: an execution whose output is what the cause predicts and would not be what it produces if the cause were something else.
|
|
@@ -121,6 +146,8 @@ Stopping is a legitimate outcome and not a silent one. Record the verdict as **u
|
|
|
121
146
|
|---|---|---|---|
|
|
122
147
|
| 1 | file:line | log output, value, exit code | what this establishes |
|
|
123
148
|
|
|
149
|
+
Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)
|
|
150
|
+
|
|
124
151
|
### Cause — confirmed verdicts only
|
|
125
152
|
**Proximate:** file:line — the line that directly produces the symptom.
|
|
126
153
|
**Root:** file:line — why that line behaves that way.
|
|
@@ -22,6 +22,11 @@ So the reproduction states, explicitly:
|
|
|
22
22
|
- **Prerequisites**, listed as setup.
|
|
23
23
|
- **Replacement scaffolding**, each item with the real behaviour it substitutes.
|
|
24
24
|
- **Whether the failure survives with prerequisites in place and replacement scaffolding removed.** If it does not, this is a lead rather than a reproduction. Say so and keep going.
|
|
25
|
+
- **That the entry point reaches the code the fix will change.** A reproduction
|
|
26
|
+
that mounts or calls the cited component or function directly, not through
|
|
27
|
+
the entry point, is replacement scaffolding. Show the path (importer trace, a
|
|
28
|
+
temporary `[DEBUG:<issue>]`-tagged `throw`, or route-scoped coverage) before treating the cited code
|
|
29
|
+
as the fix target.
|
|
25
30
|
|
|
26
31
|
If the real path is unreachable — no credentials, no environment, no data — that is a blocked reproduction. Report the missing access instead of substituting scaffolding and calling the bug reproduced.
|
|
27
32
|
|
|
@@ -11,6 +11,31 @@ Produce a proof, not an explanation. Every link in the chain rests on something
|
|
|
11
11
|
|
|
12
12
|
The characteristic failure of this work is a fluent wrong answer: a plausible story assembled from reading code and delivered with confidence. Reading is how a hypothesis is formed. Running something is how it is confirmed. **Do not report a cause you have not executed against.**
|
|
13
13
|
|
|
14
|
+
## A cited line is a hypothesis, not a location
|
|
15
|
+
|
|
16
|
+
When the work item names a file, symbol or line as the cause, treat that as
|
|
17
|
+
hypothesis zero. Its kill condition is: **no production entry point reaches it.**
|
|
18
|
+
Check that before editing anything.
|
|
19
|
+
|
|
20
|
+
- Trace importers of the module, including barrel re-exports and default exports,
|
|
21
|
+
up to a route, screen, endpoint or command the user actually hits.
|
|
22
|
+
- A module with no importers can still be an entry point itself: a script or
|
|
23
|
+
command launched directly, a `bin`/`main` in the package manifest, a
|
|
24
|
+
file-based route, or a handler, job or plugin registered through
|
|
25
|
+
configuration. Check that before reading zero importers as dead code.
|
|
26
|
+
Zero production importers kills the hypothesis only when the module is not
|
|
27
|
+
itself an entry point: then the code is dead or superseded, and fixing it
|
|
28
|
+
changes nothing the user sees.
|
|
29
|
+
- When the trace is ambiguous, prove it by execution: a temporary
|
|
30
|
+
`throw new Error("[DEBUG:<issue>] reached")` (or a `[DEBUG:<issue>]` log line)
|
|
31
|
+
in the cited block while driving the real entry point,
|
|
32
|
+
or coverage scoped to that route. If it never fires, the line is not on the path.
|
|
33
|
+
- A test that renders or calls the cited symbol directly does not establish
|
|
34
|
+
reachability. It goes red-to-green on dead code too.
|
|
35
|
+
|
|
36
|
+
Record the result in the evidence trail:
|
|
37
|
+
`Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)`.
|
|
38
|
+
|
|
14
39
|
## Surviving a disproof is not proof
|
|
15
40
|
|
|
16
41
|
A candidate that no observation has killed is **still standing**, not confirmed. Elimination narrows the field; it does not establish a cause. Closing requires a **positive confirmation**: an execution whose output is what the cause predicts and would not be what it produces if the cause were something else.
|
|
@@ -121,6 +146,8 @@ Stopping is a legitimate outcome and not a silent one. Record the verdict as **u
|
|
|
121
146
|
|---|---|---|---|
|
|
122
147
|
| 1 | file:line | log output, value, exit code | what this establishes |
|
|
123
148
|
|
|
149
|
+
Reachability: <entry point> → … → <cited symbol> (static | throw | scoped coverage)
|
|
150
|
+
|
|
124
151
|
### Cause — confirmed verdicts only
|
|
125
152
|
**Proximate:** file:line — the line that directly produces the symptom.
|
|
126
153
|
**Root:** file:line — why that line behaves that way.
|