clud-bug 0.7.0-rc.17 → 0.7.0-rc.19

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 (45) hide show
  1. package/dist/cli/hooks.d.ts.map +1 -1
  2. package/dist/cli/hooks.js +11 -2
  3. package/dist/cli/hooks.js.map +1 -1
  4. package/dist/cli/main.d.ts.map +1 -1
  5. package/dist/cli/main.js +113 -34
  6. package/dist/cli/main.js.map +1 -1
  7. package/dist/cli/post-check-run.d.ts +16 -0
  8. package/dist/cli/post-check-run.d.ts.map +1 -0
  9. package/dist/cli/post-check-run.js +93 -0
  10. package/dist/cli/post-check-run.js.map +1 -0
  11. package/dist/cli/review-prompt.d.ts +6 -0
  12. package/dist/cli/review-prompt.d.ts.map +1 -1
  13. package/dist/cli/review-prompt.js +85 -18
  14. package/dist/cli/review-prompt.js.map +1 -1
  15. package/dist/core/check-verdict.d.ts +31 -0
  16. package/dist/core/check-verdict.d.ts.map +1 -0
  17. package/dist/core/check-verdict.js +66 -0
  18. package/dist/core/check-verdict.js.map +1 -0
  19. package/dist/core/index.d.ts +2 -0
  20. package/dist/core/index.d.ts.map +1 -1
  21. package/dist/core/index.js +2 -0
  22. package/dist/core/index.js.map +1 -1
  23. package/dist/core/prompt-builder.d.ts +18 -0
  24. package/dist/core/prompt-builder.d.ts.map +1 -1
  25. package/dist/core/prompt-builder.js +24 -2
  26. package/dist/core/prompt-builder.js.map +1 -1
  27. package/dist/core/review-context.d.ts +39 -0
  28. package/dist/core/review-context.d.ts.map +1 -0
  29. package/dist/core/review-context.js +99 -0
  30. package/dist/core/review-context.js.map +1 -0
  31. package/dist/core/version.d.ts +1 -1
  32. package/dist/core/version.js +1 -1
  33. package/package.json +1 -1
  34. package/src/cli/hooks.ts +11 -2
  35. package/src/cli/main.ts +102 -36
  36. package/src/cli/post-check-run.ts +115 -0
  37. package/src/cli/review-prompt.ts +95 -17
  38. package/src/core/check-verdict.ts +93 -0
  39. package/src/core/index.ts +18 -0
  40. package/src/core/prompt-builder.ts +44 -2
  41. package/src/core/review-context.ts +106 -0
  42. package/src/core/version.ts +1 -1
  43. package/templates/workflow-py.yml.tmpl +1 -1
  44. package/templates/workflow-ts.yml.tmpl +1 -1
  45. package/templates/workflow.yml.tmpl +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAkBA;sDACsD;AACtD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAuBhE;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC;AAED,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CActE;AAcD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAwBvF"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAkBA;sDACsD;AACtD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAgChE;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC;AAED,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CActE;AAcD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAwBvF"}
package/dist/cli/hooks.js CHANGED
@@ -54,8 +54,17 @@ export function buildCommitReviewCommand(version) {
54
54
  `gitdir=$(git rev-parse --git-dir 2>/dev/null) || exit 0`,
55
55
  `marker="$gitdir/clud-bug-last-commit-review"`,
56
56
  `[ "$(cat "$marker" 2>/dev/null)" = "$sha" ] && exit 0`,
57
- `recipe=$(npx clud-bug@${version} review-prompt --trigger commit 2>/dev/null) || exit 0`,
58
- `[ -n "$recipe" ] || exit 0`,
57
+ // H4 one retry on a transient npx/network blip (a stale lock, a slow
58
+ // registry) before giving up, so a hiccup doesn't silently skip the review.
59
+ // `|| recipe=` clears it on a NON-ZERO exit so partial/error stdout from a
60
+ // mid-run crash (or an old npm warning on stdout) is never mistaken for a
61
+ // valid recipe — only a clean, exit-0 run surfaces.
62
+ `recipe=$(npx clud-bug@${version} review-prompt --trigger commit 2>/dev/null) || recipe=`,
63
+ `if [ -z "$recipe" ]; then sleep 1; recipe=$(npx clud-bug@${version} review-prompt --trigger commit 2>/dev/null) || recipe=; fi`,
64
+ // H4 — when the recipe still can't be fetched, leave a diagnostic marker so a
65
+ // FAILED review is distinguishable from a CLEAN one (a clean review surfaces
66
+ // the recipe + the agent reports clean). Never blocks the commit.
67
+ `if [ -z "$recipe" ]; then printf '%s' "$sha" > "$gitdir/clud-bug-review-skipped" 2>/dev/null || true; exit 0; fi`,
59
68
  `printf '%s' "$sha" > "$marker" 2>/dev/null || true`,
60
69
  `printf '%s\\n\\n%s\\n' "clud-bug commit review (max mode — on this session's subscription): a commit was just made. Follow this recipe now — review that commit against the skills it names and surface any findings." "$recipe"`,
61
70
  `exit 2`,
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,6DAA6D;AAC7D,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAC9E,2EAA2E;AAC3E,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,2BAA2B;AAE3B;sDACsD;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,OAAO;QACL,6EAA6E;QAC7E,0EAA0E;QAC1E,6EAA6E;QAC7E,KAAK,oBAAoB,0DAA0D;QACnF,iFAAiF;QACjF,2EAA2E;QAC3E,2EAA2E;QAC3E,6EAA6E;QAC7E,2EAA2E;QAC3E,uBAAuB;QACvB,8FAA8F;QAC9F,iDAAiD;QACjD,yDAAyD;QACzD,8CAA8C;QAC9C,uDAAuD;QACvD,yBAAyB,OAAO,wDAAwD;QACxF,4BAA4B;QAC5B,oDAAoD;QACpD,kOAAkO;QAClO,QAAQ;KACT,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAcD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,E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,CAAC;YACN,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GACZ,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,YAAY,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AA4PA,iBAAe,IAAI,kBA6BlB;AA09DD,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAsRA,iBAAe,IAAI,kBA8BlB;AAigED,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/cli/main.js CHANGED
@@ -27,6 +27,7 @@ import { computeAuditFileSet } from './audit.js';
27
27
  import { renderAuditHeader } from '../core/audit.js';
28
28
  import { runUpdate } from './update.js';
29
29
  import { runReviewPrompt } from './review-prompt.js';
30
+ import { runPostCheckRun } from './post-check-run.js';
30
31
  import { getPendingWorkflowEdits, makeBranchName, git as gitCmd } from './edit-workflow.js';
31
32
  import { applyToRepo as applyAgentDocs } from './agents-md.js';
32
33
  import { detectRepo, detectDefaultBranch, getProtectionState, enableConversationResolution } from './branch-protection.js';
@@ -66,6 +67,12 @@ function parseArgs(argv) {
66
67
  // (3 `kind: design` skills) and flips the off-by-default `design` block to
67
68
  // enabled so the visual review lens runs (local recipe + hosted bot).
68
69
  withDesign: false,
70
+ // rc.18: `clud-bug init --local-only` installs MAX MODE (skills + slash
71
+ // command + commit hook), but SKIPS the GitHub Action workflows (which run
72
+ // claude-code-action with ANTHROPIC_API_KEY). For repos that review on a
73
+ // Claude subscription via the in-session hook, not a billed CI Action.
74
+ // Implies --with-local-review + --with-hooks.
75
+ localOnly: false,
69
76
  // v0.7.0-rc.4: `clud-bug configure-github` flags.
70
77
  // --dry-run prints the diff but skips PATCH; --branch overrides "main".
71
78
  dryRun: false,
@@ -117,6 +124,8 @@ function parseArgs(argv) {
117
124
  args.withHooks = true;
118
125
  else if (a === '--with-design')
119
126
  args.withDesign = true;
127
+ else if (a === '--local-only')
128
+ args.localOnly = true;
120
129
  else if (a === '--dry-run')
121
130
  args.dryRun = true;
122
131
  else if (a === '--branch')
@@ -125,6 +134,23 @@ function parseArgs(argv) {
125
134
  args.trigger = argv[++i];
126
135
  else if (a === '--diff-size')
127
136
  args.diffSizeBytes = Number(argv[++i]);
137
+ // H3: `clud-bug post-check-run` flags.
138
+ else if (a === '--sha')
139
+ args.sha = argv[++i];
140
+ else if (a === '--verdict')
141
+ args.verdict = argv[++i];
142
+ else if (a === '--critical-count')
143
+ args.criticalCount = Number(argv[++i]);
144
+ else if (a === '--source')
145
+ args.source = argv[++i];
146
+ else if (a === '--strict')
147
+ args.strict = true;
148
+ else if (a === '--no-strict')
149
+ args.strict = false;
150
+ else if (a === '--owner')
151
+ args.owner = argv[++i];
152
+ else if (a === '--details-url')
153
+ args.detailsUrl = argv[++i];
128
154
  else
129
155
  args._.push(a);
130
156
  }
@@ -220,6 +246,11 @@ Commands:
220
246
  the session's own subscription. Plans via the shared
221
247
  engine: --trigger commit (default) → a fast single pass;
222
248
  push/pr → the full multi-pass plan. Prints to stdout.
249
+ post-check-run Post the \`clud-bug-review\` GitHub check so branch
250
+ protection can gate the merge (H3). --verdict
251
+ clean|critical|failed --sha <sha> [--critical-count N]
252
+ [--source local|ci] [--strict|--no-strict] [--dry-run].
253
+ clean→success, critical+strict→failure, else neutral.
223
254
 
224
255
  Options:
225
256
  --offline Skip skills.sh; pin only the bundled baseline specimens.
@@ -237,6 +268,10 @@ Options:
237
268
  --with-design (init) Install the design-critic kit (3 \`kind: design\`
238
269
  skills) and enable the off-by-default visual review
239
270
  lens — renders changed UI and critiques it. Off by default.
271
+ --local-only (init) MAX MODE: install the slash command + commit hook
272
+ (implies --with-local-review + --with-hooks) but SKIP the
273
+ GitHub Action workflows. Reviews run in your Claude Code
274
+ session on your subscription — no API key, no per-review bill.
240
275
  --quiet,-q Token-frugal mode for agent invocations. Suppresses
241
276
  progress chatter; emits exactly one final
242
277
  \`ok <key-value>\` summary line per command. Errors
@@ -298,6 +333,7 @@ async function main() {
298
333
  case 'post-inline-threads': return runPostInlineThreads(args);
299
334
  case 'resolve-threads': return runResolveThreads(args);
300
335
  case 'review-prompt': return runReviewPrompt(args);
336
+ case 'post-check-run': return runPostCheckRun(args);
301
337
  default:
302
338
  process.stderr.write(`Unknown command: ${cmd || '(none)'}\n\n${HELP}`);
303
339
  process.exit(2);
@@ -1151,27 +1187,37 @@ async function runInit(args) {
1151
1187
  language: templateLanguage(tmplName),
1152
1188
  }),
1153
1189
  });
1154
- const workflowPath = join(cwd, '.github', 'workflows', 'clud-bug-review.yml');
1155
- await mkdir(dirname(workflowPath), { recursive: true });
1156
- await writeFile(workflowPath, workflow);
1157
- log(` wrote ${rel(cwd, workflowPath)}`);
1158
- // Install the audit workflow alongside the per-PR review one.
1159
- // Manual-trigger by default; users opt into the cron by uncommenting.
1160
- // Routed through renderFile so {{CCA_VERSION}} substitution pins
1161
- // claude-code-action consistently with the review workflow.
1162
- const auditTmpl = await renderFile(join(TEMPLATES, 'audit.yml.tmpl'), {});
1163
- const auditPath = join(cwd, '.github', 'workflows', 'clud-bug-audit.yml');
1164
- await writeFile(auditPath, auditTmpl);
1165
- log(` wrote ${rel(cwd, auditPath)}`);
1166
- // Install the self-update workflow. Cron weekly Mondays 12:00 UTC; opens
1167
- // a PR if a newer clud-bug version is published. Disable by deleting the
1168
- // file or pinning via .claude/skills/.clud-bug.json.
1169
- // Routed through renderFile for parity (no CCA ref today but future
1170
- // tokens should propagate uniformly).
1171
- const selfUpdateTmpl = await renderFile(join(TEMPLATES, 'self-update.yml.tmpl'), {});
1172
- const selfUpdatePath = join(cwd, '.github', 'workflows', 'clud-bug-self-update.yml');
1173
- await writeFile(selfUpdatePath, selfUpdateTmpl);
1174
- log(` wrote ${rel(cwd, selfUpdatePath)}`);
1190
+ // --local-only (max mode): SKIP the GitHub Action workflows entirely. The
1191
+ // review + audit workflows run `claude-code-action` with ANTHROPIC_API_KEY
1192
+ // (per-token cost); max mode reviews on the session's own subscription, so a
1193
+ // local-only install must never add a token-billing Action. (self-update is
1194
+ // benign but skipped too local-only means no clud-bug CI workflows at all.)
1195
+ if (args.localOnly) {
1196
+ log(' skipped GitHub Action workflows (--local-only: max mode runs on the session subscription, no API key)');
1197
+ }
1198
+ else {
1199
+ const workflowPath = join(cwd, '.github', 'workflows', 'clud-bug-review.yml');
1200
+ await mkdir(dirname(workflowPath), { recursive: true });
1201
+ await writeFile(workflowPath, workflow);
1202
+ log(` wrote ${rel(cwd, workflowPath)}`);
1203
+ // Install the audit workflow alongside the per-PR review one.
1204
+ // Manual-trigger by default; users opt into the cron by uncommenting.
1205
+ // Routed through renderFile so {{CCA_VERSION}} substitution pins
1206
+ // claude-code-action consistently with the review workflow.
1207
+ const auditTmpl = await renderFile(join(TEMPLATES, 'audit.yml.tmpl'), {});
1208
+ const auditPath = join(cwd, '.github', 'workflows', 'clud-bug-audit.yml');
1209
+ await writeFile(auditPath, auditTmpl);
1210
+ log(` wrote ${rel(cwd, auditPath)}`);
1211
+ // Install the self-update workflow. Cron weekly Mondays 12:00 UTC; opens
1212
+ // a PR if a newer clud-bug version is published. Disable by deleting the
1213
+ // file or pinning via .claude/skills/.clud-bug.json.
1214
+ // Routed through renderFile for parity (no CCA ref today but future
1215
+ // tokens should propagate uniformly).
1216
+ const selfUpdateTmpl = await renderFile(join(TEMPLATES, 'self-update.yml.tmpl'), {});
1217
+ const selfUpdatePath = join(cwd, '.github', 'workflows', 'clud-bug-self-update.yml');
1218
+ await writeFile(selfUpdatePath, selfUpdateTmpl);
1219
+ log(` wrote ${rel(cwd, selfUpdatePath)}`);
1220
+ }
1175
1221
  // v0.7.0 (Wave 6b): optional local-review slash command. Scaffolds
1176
1222
  // `.claude/commands/clud-bug-review.md` so `/clud-bug-review` works inside a
1177
1223
  // Claude Code session — the agent reviews the current branch's open PR using
@@ -1180,6 +1226,12 @@ async function runInit(args) {
1180
1226
  // `--with-hooks` implies `--with-local-review` — the auto hook and the manual
1181
1227
  // `/clud-bug-review` command are complementary (the hook auto-runs the engine
1182
1228
  // recipe on each commit; the command runs it on demand against the PR).
1229
+ // --local-only IS the max-mode install: the slash command + the commit hook,
1230
+ // minus the GitHub Action workflows (gated above).
1231
+ if (args.localOnly) {
1232
+ args.withLocalReview = true;
1233
+ args.withHooks = true;
1234
+ }
1183
1235
  if (args.withHooks)
1184
1236
  args.withLocalReview = true;
1185
1237
  if (args.withLocalReview) {
@@ -1285,9 +1337,14 @@ async function runInit(args) {
1285
1337
  log(' committing...');
1286
1338
  const toAdd = [
1287
1339
  '.claude',
1288
- '.github/workflows/clud-bug-review.yml',
1289
- '.github/workflows/clud-bug-audit.yml',
1290
- '.github/workflows/clud-bug-self-update.yml',
1340
+ // No GitHub Action workflows under --local-only (none were written).
1341
+ ...(args.localOnly
1342
+ ? []
1343
+ : [
1344
+ '.github/workflows/clud-bug-review.yml',
1345
+ '.github/workflows/clud-bug-audit.yml',
1346
+ '.github/workflows/clud-bug-self-update.yml',
1347
+ ]),
1291
1348
  ...agentDocs.created,
1292
1349
  ...agentDocs.touched,
1293
1350
  ];
@@ -1302,22 +1359,44 @@ async function runInit(args) {
1302
1359
  await runInitBranchProtection(args);
1303
1360
  log('');
1304
1361
  log('Field kit assembled. Next:');
1305
- log(' 1. Set ANTHROPIC_API_KEY in your repo secrets:');
1306
- log(' Settings Secrets and variables Actions New repository secret');
1307
- if (!args.commit) {
1308
- log(' 2. git add .claude .github/workflows/clud-bug-*.yml && git commit && git push');
1309
- log(' 3. Open a PR — the naturalist arrives within ~2 minutes.');
1362
+ if (args.localOnly) {
1363
+ log(' Max mode reviews run inside your Claude Code session on your own');
1364
+ log(' subscription. No API key, no GitHub Action, no per-review bill. On every');
1365
+ log(' commit the hook surfaces a review recipe; or run /clud-bug-review on demand.');
1366
+ if (!args.commit) {
1367
+ log(' → git add .claude && git commit && git push');
1368
+ }
1369
+ else {
1370
+ log(' → git push.');
1371
+ }
1310
1372
  }
1311
1373
  else {
1312
- log(' 2. git push, then open a PR — the naturalist arrives within ~2 minutes.');
1374
+ log(' 1. Set ANTHROPIC_API_KEY in your repo secrets:');
1375
+ log(' Settings → Secrets and variables → Actions → New repository secret');
1376
+ if (!args.commit) {
1377
+ log(' 2. git add .claude .github/workflows/clud-bug-*.yml && git commit && git push');
1378
+ log(' 3. Open a PR — the naturalist arrives within ~2 minutes.');
1379
+ }
1380
+ else {
1381
+ log(' 2. git push, then open a PR — the naturalist arrives within ~2 minutes.');
1382
+ }
1313
1383
  }
1314
1384
  log('');
1315
1385
  log('Drop your own .claude/skills/<name>/SKILL.md files anytime — they get pinned automatically.');
1316
- log('For a whole-repo walk: Actions tab Clud Bug 🐛 Audit → Run workflow.');
1317
- log('Self-update is on (weekly Mondays 12:00 UTC). Pin via "pinVersion" in .claude/skills/.clud-bug.json.');
1386
+ // These reference the GitHub Action workflows, which --local-only does not write.
1387
+ if (!args.localOnly) {
1388
+ log('For a whole-repo walk: Actions tab → Clud Bug 🐛 Audit → Run workflow.');
1389
+ log('Self-update is on (weekly Mondays 12:00 UTC). Pin via "pinVersion" in .claude/skills/.clud-bug.json.');
1390
+ }
1318
1391
  log('');
1319
- log('Strict mode is ON by default (clud-bug-review fails the check on critical findings).');
1320
- log(' Add `clud-bug-review` to your branch protection required checks for full enforcement.');
1392
+ if (args.localOnly) {
1393
+ log('Strict mode + branch-protection enforcement apply to the GitHub Action path; max mode is');
1394
+ log('advisory by design — findings surface in your session for you to act on.');
1395
+ }
1396
+ else {
1397
+ log('Strict mode is ON by default (clud-bug-review fails the check on critical findings).');
1398
+ log(' • Add `clud-bug-review` to your branch protection required checks for full enforcement.');
1399
+ }
1321
1400
  log(' • Opt out by setting "strictMode": false in .claude/skills/.clud-bug.json.');
1322
1401
  // v0.6.33 — opt-in unified install (mirror of logmind v0.6.8). When
1323
1402
  // --with-skdd is passed, subprocess to `pip install logmind` + `logmind init`