@codyswann/lisa 2.342.5 → 2.342.7

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 (73) hide show
  1. package/all/copy-overwrite/scripts/lisa-hooks/block-no-verify.sh +35 -1
  2. package/dist/codex/scripts/block-no-verify.sh +24 -1
  3. package/dist/core/upstream-evidence-manifest.js +9 -9
  4. package/package.json +1 -1
  5. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  7. package/plugins/lisa/hooks/block-no-verify.agy.sh +24 -1
  8. package/plugins/lisa/hooks/block-no-verify.sh +35 -1
  9. package/plugins/lisa/hooks/threshold-ratchet-compare.mjs +23 -0
  10. package/plugins/lisa/hooks/threshold-ratchet.mjs +24 -0
  11. package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +24 -1
  12. package/plugins/lisa-agy/plugin.json +1 -1
  13. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  14. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  15. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  16. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  17. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-copilot/hooks/block-no-verify.sh +35 -1
  20. package/plugins/lisa-copilot/hooks/threshold-ratchet-compare.mjs +23 -0
  21. package/plugins/lisa-copilot/hooks/threshold-ratchet.mjs +24 -0
  22. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cursor/hooks/block-no-verify.sh +35 -1
  24. package/plugins/lisa-cursor/hooks/threshold-ratchet-compare.mjs +23 -0
  25. package/plugins/lisa-cursor/hooks/threshold-ratchet.mjs +24 -0
  26. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa-expo-agy/plugin.json +1 -1
  29. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  39. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  44. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  49. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-rails-agy/plugin.json +1 -1
  54. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  59. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  64. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/src/base/hooks/block-no-verify.agy.sh +24 -1
  67. package/plugins/src/base/hooks/block-no-verify.sh +35 -1
  68. package/plugins/src/base/hooks/threshold-ratchet-compare.mjs +23 -0
  69. package/plugins/src/base/hooks/threshold-ratchet.mjs +24 -0
  70. package/rails/copy-overwrite/scripts/check-threshold-ratchet.mjs +24 -0
  71. package/rails/copy-overwrite/scripts/threshold-ratchet-compare.mjs +23 -0
  72. package/typescript/copy-overwrite/scripts/check-threshold-ratchet.mjs +24 -0
  73. package/typescript/copy-overwrite/scripts/threshold-ratchet-compare.mjs +23 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.342.5",
3
+ "version": "2.342.7",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -79,8 +79,31 @@ except ValueError:
79
79
 
80
80
  normalized_tokens = [token.strip("();|&") for token in tokens]
81
81
 
82
+ # Git resolves any UNAMBIGUOUS abbreviation of a long option, so `--no-veri`
83
+ # skips hooks exactly as completely as `--no-verify`. Matched as a prefix
84
+ # rather than by listing abbreviations; `--no-verbose` diverges after
85
+ # `--no-ver` and so is correctly not caught.
86
+ NO_VERIFY = "--no-verify"
87
+ NO_VERIFY_MIN_PREFIX = len("--no-v")
88
+
89
+
90
+ def disables_verification(token):
91
+ """Whether a token is `--no-verify` or an abbreviation git would accept.
92
+
93
+ Args:
94
+ token: A single shell token from the command line.
95
+
96
+ Returns:
97
+ True if git would read this token as --no-verify.
98
+ """
99
+ return (
100
+ len(token) >= NO_VERIFY_MIN_PREFIX
101
+ and len(token) <= len(NO_VERIFY)
102
+ and NO_VERIFY.startswith(token)
103
+ )
104
+
82
105
  for i, token in enumerate(normalized_tokens):
83
- if token == "--no-verify":
106
+ if disables_verification(token):
84
107
  sys.exit(1)
85
108
  if token == "HUSKY=0" or token.startswith("HUSKY_SKIP_HOOKS="):
86
109
  sys.exit(1)
@@ -118,8 +118,42 @@ def is_permitted_hooks_path(value):
118
118
  cleaned = cleaned[2:]
119
119
  return cleaned.rstrip("/") in PERMITTED_HOOKS_PATHS
120
120
 
121
+
122
+ # Git resolves any UNAMBIGUOUS abbreviation of a long option, so `--no-verify`
123
+ # is only the longest of the spellings that disable verification: `git commit
124
+ # --no-veri` skips hooks exactly as completely. An equality check therefore
125
+ # enforced the guard against the one spelling nobody in a hurry types.
126
+ #
127
+ # Matched as "a prefix of --no-verify" rather than by listing abbreviations,
128
+ # because the set of accepted abbreviations is a property of git's parser and
129
+ # changes with the surrounding options. `--no-verbose` is NOT caught, and must
130
+ # not be: it diverges from `--no-verify` at the character after `--no-ver`, so
131
+ # it fails the prefix test.
132
+ #
133
+ # The floor is `--no-v`. Shorter is refused anyway — bare `--no-` is not a flag
134
+ # — and blocking an abbreviation git would reject as ambiguous costs nothing,
135
+ # while missing one git accepts costs the whole guard.
136
+ NO_VERIFY = "--no-verify"
137
+ NO_VERIFY_MIN_PREFIX = len("--no-v")
138
+
139
+
140
+ def disables_verification(token):
141
+ """Whether a token is `--no-verify` or an abbreviation git would accept.
142
+
143
+ Args:
144
+ token: A single shell token from the command line.
145
+
146
+ Returns:
147
+ True if git would read this token as --no-verify.
148
+ """
149
+ return (
150
+ len(token) >= NO_VERIFY_MIN_PREFIX
151
+ and len(token) <= len(NO_VERIFY)
152
+ and NO_VERIFY.startswith(token)
153
+ )
154
+
121
155
  for i, token in enumerate(normalized_tokens):
122
- if token == "--no-verify":
156
+ if disables_verification(token):
123
157
  sys.exit(1)
124
158
  if token == "HUSKY=0" or token.startswith("HUSKY_SKIP_HOOKS="):
125
159
  sys.exit(1)
@@ -72,6 +72,29 @@ export function compareConstraints(relPath, base, current) {
72
72
  });
73
73
  continue;
74
74
  }
75
+ // A bound's DIRECTION carries as much of the gate as its number. Flipping
76
+ // `rate>=0.99` to `rate<=0.99` keeps the key and the value and inverts the
77
+ // meaning: "at least 99% success" becomes "at most 99% success", a gate
78
+ // that now passes when the system is broken. Comparing only values, that
79
+ // read as unchanged.
80
+ //
81
+ // Rejected rather than re-evaluated in the new direction, because the two
82
+ // bounds are not commensurable — there is no value at which `<=0.99` is
83
+ // "no weaker than" `>=0.99`. The honest verdict is that the change cannot
84
+ // be proven safe, so it belongs in the existing allow-list path where a
85
+ // human records why, not in a comparison that would have to invent an
86
+ // ordering between incomparable gates.
87
+ if (currentC.direction !== baseC.direction) {
88
+ findings.push({
89
+ file: relPath,
90
+ key,
91
+ type: TYPE_WEAKENED,
92
+ base: baseC.value,
93
+ current: currentC.value,
94
+ message: `${relPath}: ${key} changed bound direction (${baseC.direction} → ${currentC.direction}) — the gate's meaning is inverted, so preserving it cannot be proven from the value alone.`,
95
+ });
96
+ continue;
97
+ }
75
98
  const weakened =
76
99
  baseC.direction === "min"
77
100
  ? currentC.value < baseC.value
@@ -172,6 +172,30 @@ function run(mode, baseRef, onlyFiles) {
172
172
  const watched = plan.files.filter(f => familyFor(f));
173
173
  if (watched.length === 0) return 0;
174
174
 
175
+ // A null baseline means one of two opposite things, and they must not be
176
+ // conflated: the file is NEW (nothing to weaken — pass), or it exists at the
177
+ // baseline and could not be read (nothing could be COMPARED — the one case
178
+ // where the ratchet cannot do its job). Both arrive here as null because
179
+ // `git()` swallows every failure, so the ratchet passed exactly when it had
180
+ // no evidence — failing open in its blind spot.
181
+ //
182
+ // `cat-file -e` answers the question `git show` cannot: does this path exist
183
+ // at that ref? Absent means new; present-but-unreadable means undeterminable,
184
+ // and an undeterminable ratchet must refuse rather than wave the change on.
185
+ const unreadable = watched.filter(
186
+ f =>
187
+ git(["show", `${plan.baselineRef}:${f}`], root) === null &&
188
+ git(["cat-file", "-e", `${plan.baselineRef}:${f}`], root) !== null
189
+ );
190
+ if (unreadable.length > 0) {
191
+ return undeterminable(
192
+ mode,
193
+ `could not read the baseline for ${unreadable.join(", ")} — ` +
194
+ `the file exists at ${plan.baselineRef} but its contents could not be ` +
195
+ `retrieved, so a loosened threshold could not be detected`
196
+ );
197
+ }
198
+
175
199
  const findings = watched.flatMap(f =>
176
200
  compareFile(
177
201
  f,
@@ -172,6 +172,30 @@ function run(mode, baseRef, onlyFiles) {
172
172
  const watched = plan.files.filter(f => familyFor(f));
173
173
  if (watched.length === 0) return 0;
174
174
 
175
+ // A null baseline means one of two opposite things, and they must not be
176
+ // conflated: the file is NEW (nothing to weaken — pass), or it exists at the
177
+ // baseline and could not be read (nothing could be COMPARED — the one case
178
+ // where the ratchet cannot do its job). Both arrive here as null because
179
+ // `git()` swallows every failure, so the ratchet passed exactly when it had
180
+ // no evidence — failing open in its blind spot.
181
+ //
182
+ // `cat-file -e` answers the question `git show` cannot: does this path exist
183
+ // at that ref? Absent means new; present-but-unreadable means undeterminable,
184
+ // and an undeterminable ratchet must refuse rather than wave the change on.
185
+ const unreadable = watched.filter(
186
+ f =>
187
+ git(["show", `${plan.baselineRef}:${f}`], root) === null &&
188
+ git(["cat-file", "-e", `${plan.baselineRef}:${f}`], root) !== null
189
+ );
190
+ if (unreadable.length > 0) {
191
+ return undeterminable(
192
+ mode,
193
+ `could not read the baseline for ${unreadable.join(", ")} — ` +
194
+ `the file exists at ${plan.baselineRef} but its contents could not be ` +
195
+ `retrieved, so a loosened threshold could not be detected`
196
+ );
197
+ }
198
+
175
199
  const findings = watched.flatMap(f =>
176
200
  compareFile(
177
201
  f,
@@ -72,6 +72,29 @@ export function compareConstraints(relPath, base, current) {
72
72
  });
73
73
  continue;
74
74
  }
75
+ // A bound's DIRECTION carries as much of the gate as its number. Flipping
76
+ // `rate>=0.99` to `rate<=0.99` keeps the key and the value and inverts the
77
+ // meaning: "at least 99% success" becomes "at most 99% success", a gate
78
+ // that now passes when the system is broken. Comparing only values, that
79
+ // read as unchanged.
80
+ //
81
+ // Rejected rather than re-evaluated in the new direction, because the two
82
+ // bounds are not commensurable — there is no value at which `<=0.99` is
83
+ // "no weaker than" `>=0.99`. The honest verdict is that the change cannot
84
+ // be proven safe, so it belongs in the existing allow-list path where a
85
+ // human records why, not in a comparison that would have to invent an
86
+ // ordering between incomparable gates.
87
+ if (currentC.direction !== baseC.direction) {
88
+ findings.push({
89
+ file: relPath,
90
+ key,
91
+ type: TYPE_WEAKENED,
92
+ base: baseC.value,
93
+ current: currentC.value,
94
+ message: `${relPath}: ${key} changed bound direction (${baseC.direction} → ${currentC.direction}) — the gate's meaning is inverted, so preserving it cannot be proven from the value alone.`,
95
+ });
96
+ continue;
97
+ }
75
98
  const weakened =
76
99
  baseC.direction === "min"
77
100
  ? currentC.value < baseC.value
@@ -172,6 +172,30 @@ function run(mode, baseRef, onlyFiles) {
172
172
  const watched = plan.files.filter(f => familyFor(f));
173
173
  if (watched.length === 0) return 0;
174
174
 
175
+ // A null baseline means one of two opposite things, and they must not be
176
+ // conflated: the file is NEW (nothing to weaken — pass), or it exists at the
177
+ // baseline and could not be read (nothing could be COMPARED — the one case
178
+ // where the ratchet cannot do its job). Both arrive here as null because
179
+ // `git()` swallows every failure, so the ratchet passed exactly when it had
180
+ // no evidence — failing open in its blind spot.
181
+ //
182
+ // `cat-file -e` answers the question `git show` cannot: does this path exist
183
+ // at that ref? Absent means new; present-but-unreadable means undeterminable,
184
+ // and an undeterminable ratchet must refuse rather than wave the change on.
185
+ const unreadable = watched.filter(
186
+ f =>
187
+ git(["show", `${plan.baselineRef}:${f}`], root) === null &&
188
+ git(["cat-file", "-e", `${plan.baselineRef}:${f}`], root) !== null
189
+ );
190
+ if (unreadable.length > 0) {
191
+ return undeterminable(
192
+ mode,
193
+ `could not read the baseline for ${unreadable.join(", ")} — ` +
194
+ `the file exists at ${plan.baselineRef} but its contents could not be ` +
195
+ `retrieved, so a loosened threshold could not be detected`
196
+ );
197
+ }
198
+
175
199
  const findings = watched.flatMap(f =>
176
200
  compareFile(
177
201
  f,
@@ -72,6 +72,29 @@ export function compareConstraints(relPath, base, current) {
72
72
  });
73
73
  continue;
74
74
  }
75
+ // A bound's DIRECTION carries as much of the gate as its number. Flipping
76
+ // `rate>=0.99` to `rate<=0.99` keeps the key and the value and inverts the
77
+ // meaning: "at least 99% success" becomes "at most 99% success", a gate
78
+ // that now passes when the system is broken. Comparing only values, that
79
+ // read as unchanged.
80
+ //
81
+ // Rejected rather than re-evaluated in the new direction, because the two
82
+ // bounds are not commensurable — there is no value at which `<=0.99` is
83
+ // "no weaker than" `>=0.99`. The honest verdict is that the change cannot
84
+ // be proven safe, so it belongs in the existing allow-list path where a
85
+ // human records why, not in a comparison that would have to invent an
86
+ // ordering between incomparable gates.
87
+ if (currentC.direction !== baseC.direction) {
88
+ findings.push({
89
+ file: relPath,
90
+ key,
91
+ type: TYPE_WEAKENED,
92
+ base: baseC.value,
93
+ current: currentC.value,
94
+ message: `${relPath}: ${key} changed bound direction (${baseC.direction} → ${currentC.direction}) — the gate's meaning is inverted, so preserving it cannot be proven from the value alone.`,
95
+ });
96
+ continue;
97
+ }
75
98
  const weakened =
76
99
  baseC.direction === "min"
77
100
  ? currentC.value < baseC.value