@codyswann/lisa 3.70.0 → 3.70.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/lisa-hooks/block-no-verify.sh +224 -7
- package/dist/cli/prompts.d.ts +52 -1
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +57 -2
- package/dist/cli/prompts.js.map +1 -1
- package/dist/codex/scripts/block-no-verify.sh +190 -3
- package/dist/configs/vitest/scratch-global-setup.d.ts +32 -0
- package/dist/configs/vitest/scratch-global-setup.d.ts.map +1 -1
- package/dist/configs/vitest/scratch-global-setup.js +48 -0
- package/dist/configs/vitest/scratch-global-setup.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +2 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +4 -0
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +7 -3
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/opencode/hooks-installer.d.ts.map +1 -1
- package/dist/opencode/hooks-installer.js +14 -0
- package/dist/opencode/hooks-installer.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +30 -11
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/dist/strategies/strategy.interface.d.ts +15 -0
- package/dist/strategies/strategy.interface.d.ts.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/hooks/block-no-verify.agy.sh +200 -6
- package/plugins/lisa/hooks/block-no-verify.sh +224 -7
- package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +200 -6
- package/plugins/lisa-agy/plugin.json +1 -1
- 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/hooks/block-no-verify.sh +224 -7
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-no-verify.sh +224 -7
- 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/hooks/block-no-verify.agy.sh +200 -6
- package/plugins/src/base/hooks/block-no-verify.sh +224 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-installer.d.ts","sourceRoot":"","sources":["../../src/opencode/hooks-installer.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOrD,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAKxD,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD,2EAA2E;AAC3E,eAAO,MAAM,gCAAgC,oCAAoE,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks-installer.d.ts","sourceRoot":"","sources":["../../src/opencode/hooks-installer.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOrD,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAKxD,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD,2EAA2E;AAC3E,eAAO,MAAM,gCAAgC,oCAAoE,CAAC;AAmClH,gDAAgD;AAChD,MAAM,WAAW,0BAA0B;IACzC,uEAAuE;IACvE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,SAAS,WAAW,EAAE,EACrC,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACtC,OAAO,CAAC,0BAA0B,CAAC,CAyDrC;AAgGD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAyCpE;AAiGD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAa5B"}
|
|
@@ -52,9 +52,23 @@ export const OPENCODE_EAGER_RULES_INSTRUCTION = `${OPENCODE_CONFIG_DIR}/${OPENCO
|
|
|
52
52
|
* Each glob is matched against the parsed shell command; `*` matches any run of
|
|
53
53
|
* characters. Deny-only (no catch-all allow) so non-matching commands fall
|
|
54
54
|
* through to the host's / OpenCode's default posture.
|
|
55
|
+
*
|
|
56
|
+
* Documented parity gap. OpenCode gives Lisa a glob list, not a hook it can
|
|
57
|
+
* tokenize, so the short `-n` bypass the shell variants close by parsing a
|
|
58
|
+
* `git commit` argv is only PARTLY reachable here. The two globs below cover
|
|
59
|
+
* the spellings that put `-n` directly after the subcommand — `git commit -n`,
|
|
60
|
+
* and by prefix the bundled `-nm "msg"` / `-nam "msg"` — which is every form
|
|
61
|
+
* observed in practice. A cluster that reaches `-n` later on the line
|
|
62
|
+
* (`git commit -am wip -n`) is NOT matched, and cannot be without a glob broad
|
|
63
|
+
* enough to refuse `grep -n`. That is the same precision the `*--no-verify*`
|
|
64
|
+
* glob above already ships with: it likewise fires on the flag quoted inside a
|
|
65
|
+
* commit message. The tokenizing variants (Claude, agy, Codex) have no such
|
|
66
|
+
* gap; this list is a floor, not parity.
|
|
55
67
|
*/
|
|
56
68
|
const NO_VERIFY_DENY_PATTERNS = {
|
|
57
69
|
"*--no-verify*": "deny",
|
|
70
|
+
"*git commit -n*": "deny",
|
|
71
|
+
"*git commit -an*": "deny",
|
|
58
72
|
"*HUSKY=0*": "deny",
|
|
59
73
|
"*HUSKY_SKIP_HOOKS=*": "deny",
|
|
60
74
|
"*core.hooksPath*/dev/null*": "deny",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-installer.js","sourceRoot":"","sources":["../../src/opencode/hooks-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAA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G;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAe;IAEf,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CACzB,OAAO,EACP,mBAAmB,EACnB,sBAAsB,CACvB,CAAC;IACF,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,OAAO;SACX,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC3E,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-overwrite.d.ts","sourceRoot":"","sources":["../../src/strategies/copy-overwrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAS7D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG9E;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAE1C;;;;;;;OAOG;IACG,KAAK,CACT,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"copy-overwrite.d.ts","sourceRoot":"","sources":["../../src/strategies/copy-overwrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAS7D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG9E;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAE1C;;;;;;;OAOG;IACG,KAAK,CACT,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC;IA+F/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;YACW,mBAAmB;IAwBjC;;;;;;;;;;;;;;;;;OAiBG;YACW,qBAAqB;IAkBnC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;YACW,mBAAmB;CAkClC"}
|
|
@@ -41,19 +41,22 @@ export class CopyOverwriteStrategy {
|
|
|
41
41
|
// reached only when `skipGitCheck` is set — the postinstall's flag, not the
|
|
42
42
|
// command's. So `lisa apply` typed by an operator, `lisa apply --yes`, and
|
|
43
43
|
// every non-TTY run took the prompt branch instead and replaced the file
|
|
44
|
-
// without ever classifying it. Non-TTY is not the exotic case:
|
|
45
|
-
//
|
|
46
|
-
// `
|
|
47
|
-
//
|
|
48
|
-
// being silently downgraded could be walked around by running the
|
|
49
|
-
// the normal way (#2577).
|
|
44
|
+
// without ever classifying it. Non-TTY is not the exotic case: it is what
|
|
45
|
+
// every scripted and agent-driven apply gets, and at the time
|
|
46
|
+
// `createPrompter` answered it with `AutoAcceptPrompter`, whose
|
|
47
|
+
// `promptOverwrite` says "yes" without asking anyone. The guard that stops
|
|
48
|
+
// a guard being silently downgraded could be walked around by running the
|
|
49
|
+
// command the normal way (#2577). That prompter mapping is itself fixed in
|
|
50
|
+
// #3026, but this classification stays ahead of every branch regardless:
|
|
51
|
+
// `--yes` still reaches the overwrite, and a downgrade must not ride in on
|
|
52
|
+
// it.
|
|
50
53
|
const preserved = await this.preserveOwnedHostCopy(sourcePath, destPath, relativePath, context);
|
|
51
54
|
if (preserved !== undefined)
|
|
52
55
|
return preserved;
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
56
|
+
// An apply with nobody to ask cannot prompt, and replacing a file the
|
|
57
|
+
// project may have customised without asking is not a decision this path
|
|
58
|
+
// gets to make. So the file is left alone — but reported as `stale`, never
|
|
59
|
+
// as `skipped`.
|
|
57
60
|
//
|
|
58
61
|
// Reporting it as `skipped` is what made template changes undeliverable in
|
|
59
62
|
// practice: the postinstall bootstrap is how downstream projects take an
|
|
@@ -61,7 +64,23 @@ export class CopyOverwriteStrategy {
|
|
|
61
64
|
// it beside genuinely-identical files under "identical or create-only".
|
|
62
65
|
// A fix to an enforcement guard could ship in a release and reach nobody,
|
|
63
66
|
// with nothing in the output to say so.
|
|
64
|
-
|
|
67
|
+
//
|
|
68
|
+
// There are two ways to have nobody to ask, and only the first was
|
|
69
|
+
// recognised. `skipGitCheck` is the postinstall's flag. The second is a
|
|
70
|
+
// plain `lisa apply` in a shell with no TTY — every agent, script, and CI
|
|
71
|
+
// run — where `promptOverwrite` is not a question at all: with no usable
|
|
72
|
+
// stdin the prompter answers without asking anyone. That route fell
|
|
73
|
+
// through to the prompt branch below and replaced host-customised
|
|
74
|
+
// `knip.json`, `eslint.config.ts`, and `tsconfig.json` outright, reporting
|
|
75
|
+
// them as approved. `core/lisa-owned-templates` had already written down
|
|
76
|
+
// the rule this violates — those files "are seeded by Lisa and then edited
|
|
77
|
+
// downstream, so a non-interactive apply must never replace them without
|
|
78
|
+
// being asked" — but "non-interactive" had been read as one flag rather
|
|
79
|
+
// than as the condition it names (#3026).
|
|
80
|
+
//
|
|
81
|
+
// `--yes` is not this case. That flag is the operator deciding in advance,
|
|
82
|
+
// so `context.unattended` is false for it and the overwrite proceeds.
|
|
83
|
+
if (config.skipGitCheck || context.unattended === true) {
|
|
65
84
|
return this.applyNonInteractive(sourcePath, destPath, relativePath, context);
|
|
66
85
|
}
|
|
67
86
|
if (config.dryRun) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-overwrite.js","sourceRoot":"","sources":["../../src/strategies/copy-overwrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,OAAO,qBAAqB;IACvB,IAAI,GAAG,gBAAyB,CAAC;IAE1C;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,CACT,UAAkB,EAClB,QAAgB,EAChB,YAAoB,EACpB,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QACxD,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBACnB,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;gBAChC,MAAM,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACvC,CAAC;YACD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACjE,CAAC;QAED,IAAI,MAAM,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC/C,OAAO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QAEnD,OAAO;YACL,YAAY;YACZ,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -10,6 +10,21 @@ export interface StrategyContext {
|
|
|
10
10
|
readonly backupFile: (absolutePath: string) => Promise<void>;
|
|
11
11
|
/** Prompt user for overwrite decision */
|
|
12
12
|
readonly promptOverwrite: (relativePath: string, sourcePath: string, destPath: string) => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Whether this run has no operator decision available to it.
|
|
15
|
+
*
|
|
16
|
+
* True means `promptOverwrite` is not a question — there is no TTY behind it
|
|
17
|
+
* and no `--yes` was passed, so whatever it returns was decided by Lisa, not
|
|
18
|
+
* by anybody. A strategy that would replace a file the host may have
|
|
19
|
+
* customised has to know that, because "the callback said yes" is not
|
|
20
|
+
* approval when nobody was asked (#3026).
|
|
21
|
+
*
|
|
22
|
+
* Production wires this from the prompter at the single place a context is
|
|
23
|
+
* built, in `Lisa.processStrategy`. Omitted means attended, which is what
|
|
24
|
+
* every strategy that never prompts wants and what a test that does not care
|
|
25
|
+
* gets.
|
|
26
|
+
*/
|
|
27
|
+
readonly unattended?: boolean;
|
|
13
28
|
/**
|
|
14
29
|
* Known-good hashes proving which contents Lisa has shipped at each path.
|
|
15
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.interface.d.ts","sourceRoot":"","sources":["../../src/strategies/strategy.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAE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CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAE5B;;;;;;;OAOG;IACH,KAAK,CACH,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"zod-validation-error": "^4.0.0"
|
|
144
144
|
},
|
|
145
145
|
"name": "@codyswann/lisa",
|
|
146
|
-
"version": "3.70.
|
|
146
|
+
"version": "3.70.2",
|
|
147
147
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
148
148
|
"main": "dist/index.js",
|
|
149
149
|
"exports": {
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Antigravity (agy) PreToolUse hook: blocks shell commands that bypass Lisa's
|
|
3
3
|
# git quality gates (exact parity with the Claude block-no-verify.sh): the
|
|
4
|
-
# `--no-verify` long flag
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
4
|
+
# `--no-verify` long flag and any abbreviation git accepts for it, its short
|
|
5
|
+
# form `-n` as a real argv token of a `git commit` (bare or bundled, as in
|
|
6
|
+
# `-nm "msg"`), `HUSKY=0`/`HUSKY_SKIP_HOOKS=` (disables husky hooks), and
|
|
7
|
+
# `core.hooksPath` pointed anywhere but an allowlisted in-repo hooks dir
|
|
8
|
+
# (disables all git hooks). Shell-token matching avoids false positives from
|
|
9
|
+
# issue bodies, heredocs, and commit-message prose while still catching quoted
|
|
10
|
+
# real argv values such as `git -c "core.hooksPath=/dev/null"`.
|
|
11
|
+
#
|
|
12
|
+
# This file used to be cited BY the Claude variant as the reason the short `-n`
|
|
13
|
+
# was excluded ("grep cannot distinguish a real -n option from prose"). Neither
|
|
14
|
+
# variant greps: both tokenize, which is exactly what tells an option from a
|
|
15
|
+
# quoted message. The cross-reference outlived the matcher it described, and a
|
|
16
|
+
# stale rationale is worse than none — it reads as a considered decision and
|
|
17
|
+
# stops the next reader from re-examining it.
|
|
9
18
|
#
|
|
10
19
|
# agy protocol (distinct from the Claude block-no-verify.sh exit-code protocol):
|
|
11
20
|
# - stdin = JSON: { "toolCall": { "name": "run_command",
|
|
@@ -25,7 +34,7 @@ allow() {
|
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
deny() {
|
|
28
|
-
printf '%s\n' '{"decision":"deny","reason":"This command bypasses Lisa pre-commit/pre-push quality gates (--no-verify, HUSKY=0, or core.hooksPath disabling). Fix the underlying issue (security audit, lint, typecheck, tests, formatting) instead. If a fix is genuinely impossible, ask the user to make the risk-acceptance decision and add a specific documented ignore; never bypass the hook."}'
|
|
37
|
+
printf '%s\n' '{"decision":"deny","reason":"This command bypasses Lisa pre-commit/pre-push quality gates (--no-verify or its short form -n, HUSKY=0, or core.hooksPath disabling). `git commit -n` and a cluster such as `-nm \"msg\"` skip pre-commit exactly as completely as the long flag. Fix the underlying issue (security audit, lint, typecheck, tests, formatting) instead. If a fix is genuinely impossible, ask the user to make the risk-acceptance decision and add a specific documented ignore; never bypass the hook."}'
|
|
29
38
|
exit 0
|
|
30
39
|
}
|
|
31
40
|
|
|
@@ -123,6 +132,191 @@ def is_permitted_hooks_path(value):
|
|
|
123
132
|
return cleaned.rstrip("/") in PERMITTED_HOOKS_PATHS
|
|
124
133
|
|
|
125
134
|
|
|
135
|
+
# `git commit -n` is the short spelling of --no-verify and skips pre-commit and
|
|
136
|
+
# commit-msg identically; so does a cluster such as `-nm "msg"`. Matching it
|
|
137
|
+
# needs SCOPE, which is why it was long excluded: `-n` means --dry-run to `git
|
|
138
|
+
# push`, --no-stat to `git merge`, and a line count to head/tail/sort/grep. Only
|
|
139
|
+
# `git commit` reads it as a hook bypass, so only that invocation's argv is
|
|
140
|
+
# scanned. Parity with the Claude block-no-verify.sh, which carries the full
|
|
141
|
+
# rationale for why a tokenizer can make this distinction and a grep could not.
|
|
142
|
+
#
|
|
143
|
+
# A SECOND tokenizer pass, deliberately not shared with the checks above:
|
|
144
|
+
# `shlex.split` glues `|` and `;` to their neighbours, so `git commit -m x &&
|
|
145
|
+
# grep -n foo` would read as one long git invocation and refuse the grep.
|
|
146
|
+
# `punctuation_chars=True` emits the operators as their own tokens, giving the
|
|
147
|
+
# scan a boundary to stop at.
|
|
148
|
+
COMMAND_SEPARATORS = {
|
|
149
|
+
";", "|", "||", "&", "&&", "(", ")", "<", ">", ">>", "<<", "&|",
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
# git's own options taking a SEPARATE value token, skipped when looking for the
|
|
153
|
+
# subcommand so `git -c core.hooksPath=x commit` still reaches `commit`.
|
|
154
|
+
GIT_GLOBAL_SEPARATE_VALUE = {
|
|
155
|
+
"-c", "-C", "--config-env", "--git-dir", "--work-tree",
|
|
156
|
+
"--namespace", "--exec-path", "--super-prefix",
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
# `git commit` long options whose value can be a separate token, listed so the
|
|
160
|
+
# VALUE is never read as a flag (`git commit --author "A -n B" -m x` is fine).
|
|
161
|
+
# Only genuinely value-taking options belong here: a boolean added by mistake
|
|
162
|
+
# would swallow the next token and miss `git commit --amend -n`.
|
|
163
|
+
COMMIT_LONG_SEPARATE_VALUE = {
|
|
164
|
+
"--message", "--file", "--author", "--date", "--template", "--cleanup",
|
|
165
|
+
"--reuse-message", "--reedit-message", "--fixup", "--squash",
|
|
166
|
+
"--pathspec-from-file", "--trailer",
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
# Short options REQUIRING a value. In a cluster the value is whatever follows in
|
|
170
|
+
# the same token, or the next token when nothing does — which is why `-mn` is
|
|
171
|
+
# the message "n" and not a bypass, while `-nm msg` is one.
|
|
172
|
+
COMMIT_SHORT_REQUIRED_VALUE = set("mFcCt")
|
|
173
|
+
|
|
174
|
+
# Short options taking an OPTIONAL value, which git reads only when attached:
|
|
175
|
+
# `-uno` is --untracked-files=no, so `-un` is a mode and not a bypass.
|
|
176
|
+
COMMIT_SHORT_OPTIONAL_VALUE = set("uS")
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def line_boundaries_as_separators(text):
|
|
180
|
+
"""Turn newlines into command separators, keeping continuations intact.
|
|
181
|
+
|
|
182
|
+
A newline ends a command exactly as `;` does, but shlex treats it as plain
|
|
183
|
+
whitespace — so `git commit -m x` on one line and `grep -n foo` on the next
|
|
184
|
+
read as ONE invocation and the grep gets refused. That is the same
|
|
185
|
+
false-positive class the short-form match exists to avoid, arriving through
|
|
186
|
+
the boundary rather than through the token.
|
|
187
|
+
|
|
188
|
+
Backslash-newline is joined first, because there the newline is NOT a
|
|
189
|
+
boundary: `git commit \\` + newline + `-nm x` is one command, and turning
|
|
190
|
+
that newline into a separator would hide a real bypass.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
text: The command line, heredoc payloads already stripped.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
The same command with line breaks spelled as separators.
|
|
197
|
+
"""
|
|
198
|
+
joined = text.replace("\r\n", "\n").replace("\\\n", " ")
|
|
199
|
+
return joined.replace("\n", " ; ")
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def shell_tokens(text):
|
|
203
|
+
"""Tokenize a command with shell operators kept as their own tokens.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
text: The command line, heredoc payloads already stripped.
|
|
207
|
+
|
|
208
|
+
Returns:
|
|
209
|
+
The token list, with `;`, `|`, `&&`, `(` and friends standing alone.
|
|
210
|
+
"""
|
|
211
|
+
lexer = shlex.shlex(
|
|
212
|
+
line_boundaries_as_separators(text), posix=True, punctuation_chars=True
|
|
213
|
+
)
|
|
214
|
+
lexer.whitespace_split = True
|
|
215
|
+
# shlex treats `#` as a comment introducer and would truncate the line;
|
|
216
|
+
# `shlex.split` disables it, and so must this.
|
|
217
|
+
lexer.commenters = ""
|
|
218
|
+
return list(lexer)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def cluster_skips_verification(cluster):
|
|
222
|
+
"""Read a short-option cluster the way git's own parser reads it.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
cluster: A single token beginning with one `-`, e.g. `-nm` or `-mn`.
|
|
226
|
+
|
|
227
|
+
Returns:
|
|
228
|
+
A pair (bypasses, consumes_next_token).
|
|
229
|
+
"""
|
|
230
|
+
body = cluster[1:]
|
|
231
|
+
for offset, letter in enumerate(body):
|
|
232
|
+
if letter == "n":
|
|
233
|
+
return (True, False)
|
|
234
|
+
if letter in COMMIT_SHORT_REQUIRED_VALUE:
|
|
235
|
+
return (False, offset == len(body) - 1)
|
|
236
|
+
if letter in COMMIT_SHORT_OPTIONAL_VALUE:
|
|
237
|
+
return (False, False)
|
|
238
|
+
return (False, False)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def commit_bypasses_verification(argv):
|
|
242
|
+
"""Whether a `git commit` invocation's argv carries a real short `-n`.
|
|
243
|
+
|
|
244
|
+
Args:
|
|
245
|
+
argv: Tokens following the `commit` subcommand, to the end of the line.
|
|
246
|
+
|
|
247
|
+
Returns:
|
|
248
|
+
True if git would read one of them as --no-verify.
|
|
249
|
+
"""
|
|
250
|
+
index = 0
|
|
251
|
+
while index < len(argv):
|
|
252
|
+
token = argv[index]
|
|
253
|
+
index += 1
|
|
254
|
+
# `--` ends the options; a file legitimately named `-n` is not a bypass.
|
|
255
|
+
if token in COMMAND_SEPARATORS or token == "--":
|
|
256
|
+
return False
|
|
257
|
+
if token.startswith("--"):
|
|
258
|
+
if token in COMMIT_LONG_SEPARATE_VALUE:
|
|
259
|
+
index += 1
|
|
260
|
+
continue
|
|
261
|
+
# A bare `-` is git's stdin placeholder, not an option cluster.
|
|
262
|
+
if not token.startswith("-") or token == "-":
|
|
263
|
+
continue
|
|
264
|
+
bypasses, consumes_next = cluster_skips_verification(token)
|
|
265
|
+
if bypasses:
|
|
266
|
+
return True
|
|
267
|
+
if consumes_next:
|
|
268
|
+
index += 1
|
|
269
|
+
return False
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def subcommand_after_git(tokens, start):
|
|
273
|
+
"""Find the subcommand a `git` token introduces, and its argv.
|
|
274
|
+
|
|
275
|
+
Args:
|
|
276
|
+
tokens: The full operator-aware token list.
|
|
277
|
+
start: Index just past the `git` token.
|
|
278
|
+
|
|
279
|
+
Returns:
|
|
280
|
+
A pair (subcommand, argv), or None when the invocation names none.
|
|
281
|
+
"""
|
|
282
|
+
index = start
|
|
283
|
+
while index < len(tokens):
|
|
284
|
+
token = tokens[index]
|
|
285
|
+
if token in COMMAND_SEPARATORS:
|
|
286
|
+
return None
|
|
287
|
+
if not token.startswith("-"):
|
|
288
|
+
return (token, tokens[index + 1:])
|
|
289
|
+
index += 2 if token in GIT_GLOBAL_SEPARATE_VALUE else 1
|
|
290
|
+
return None
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
def git_commit_skips_verification(text):
|
|
294
|
+
"""Whether the command runs `git commit` with the short `-n` bypass.
|
|
295
|
+
|
|
296
|
+
Args:
|
|
297
|
+
text: The command line, heredoc payloads already stripped.
|
|
298
|
+
|
|
299
|
+
Returns:
|
|
300
|
+
True if any `git commit` invocation on the line skips verification.
|
|
301
|
+
"""
|
|
302
|
+
try:
|
|
303
|
+
scoped_tokens = shell_tokens(text)
|
|
304
|
+
except ValueError:
|
|
305
|
+
return False
|
|
306
|
+
for index, token in enumerate(scoped_tokens):
|
|
307
|
+
# `/usr/bin/git` and a bare `git` are the same program; an env prefix
|
|
308
|
+
# (`HUSKY=1 git commit -n`) simply sits in an earlier token.
|
|
309
|
+
if token != "git" and not token.endswith("/git"):
|
|
310
|
+
continue
|
|
311
|
+
found = subcommand_after_git(scoped_tokens, index + 1)
|
|
312
|
+
if found and found[0] == "commit" and commit_bypasses_verification(found[1]):
|
|
313
|
+
return True
|
|
314
|
+
return False
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
if git_commit_skips_verification(strip_heredocs(command)):
|
|
318
|
+
sys.exit(1)
|
|
319
|
+
|
|
126
320
|
for i, token in enumerate(normalized_tokens):
|
|
127
321
|
if disables_verification(token):
|
|
128
322
|
sys.exit(1)
|