@bugb-technologies/bravos 1.8.0 → 1.9.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.
@@ -3,6 +3,7 @@ import { spawn, spawnSync } from 'node:child_process';
3
3
  import { accessSync, constants, readFileSync } from 'node:fs';
4
4
  import { basename, delimiter, dirname, join } from 'node:path';
5
5
  import { contextGate, readContext } from './context.mjs';
6
+ import { legacySkills, legacySkillsLine } from './legacy-skills.mjs';
6
7
  import { THEMES } from './palette.mjs';
7
8
  import { commitsLine, commonDirFrom, readHandoff, readPrefs } from './prefs.mjs';
8
9
  import { readProving } from './proving.mjs';
@@ -135,7 +136,7 @@ export function contextLine(context, harness) {
135
136
  // @comment -- "The briefing's Intent line. While the context gate is closed it also says so in words an agent acts on: do not start threat-modelling, run the context skill first, and how a person declines. A recorded decline is shown with the name and date of the person who made it."
136
137
  function intentLine(intent, harness, gate, handoff = false) {
137
138
  const run = harness === 'claude' ? '/bravos-context' : 'the bravos-context skill';
138
- // Right after bravos start (a fresh hand-off marker), the person expects Bravos to begin: the agent starts the context step itself and goes on to annotation, unless their first message asks for something else.
139
+ // Right after bravos setup (a fresh hand-off marker), the person expects Bravos to begin: the agent starts the context step itself and goes on to annotation, unless their first message asks for something else.
139
140
  const begin = handoff && intent.status === 'none' ? ` Setup just finished here and the person expects Bravos to begin: start ${run} in your first reply without being asked, and go on to annotation once they have confirmed. If their first message asks for something else, do that and offer this once after.` : '';
140
141
  const closed = gate && gate.open === false ? `. Context comes first: do not annotate or start a campaign until a named person has confirmed it (or run bravos context decline --by "<name>" themselves).${begin}` : '';
141
142
  const declined = gate?.state === 'declined' ? `declined by ${gate.by} on ${gate.at}` : '';
@@ -251,13 +252,16 @@ export function buildBriefing(inputs) {
251
252
  }
252
253
  if (i.shadow) {
253
254
  tail.push(i.shadow.userNewer
254
- ? `Note: this repo's bravos (${i.shadow.repo}) is behind the person's user-level copy (${i.shadow.user}), which Claude Code uses; suggest they run bravos sync in this repo from their own terminal`
255
- : `Note: the person's user-level bravos skills (~/.claude/skills, ${i.shadow.user}) are used instead of this repo's (${i.shadow.repo}); tell them to run bravos sync --global from their own terminal, then start a new session`);
255
+ ? `Note: this repo's bravos (${i.shadow.repo}) is behind the person's user-level copy (${i.shadow.user}), which Claude Code uses; suggest they run bravos setup in this repo from their own terminal`
256
+ : `Note: the person's user-level bravos skills (~/.claude/skills, ${i.shadow.user}) are used instead of this repo's (${i.shadow.repo}); tell them to run bravos setup --global from their own terminal, then start a new session`);
256
257
  }
257
258
  const upkeep = upkeepLine(i.upkeep);
258
259
  if (upkeep) tail.push(upkeep);
259
260
  // The portal's last refusal to renew this machine, until it is signed in again (a revocation) or renewed (a plan that ended).
260
261
  if (i.licenceNote && (i.licenceNote.outcome === 'lapsed' || i.licence?.licensed === false)) tail.push(`Licence: ${i.licenceNote.note} Tell the person once, in plain words.`);
262
+ // Skills the retired Python bravos left at user level: the agent must not follow them (hooks/lib/legacy-skills.mjs).
263
+ const legacy = legacySkillsLine(i.legacy);
264
+ if (legacy) tail.push(legacy);
261
265
  if ((i.autopilot || i.prePr) && hooksLocked(i)) {
262
266
  // The repo registers the hooks for everyone; this person's copy answers nothing until they have a licence.
263
267
  const which = i.autopilot ? 'Autopilot (the end-of-turn check and the pre-PR gate)' : 'The pre-PR gate';
@@ -433,6 +437,19 @@ export function upkeepLine(u) {
433
437
  else parts.push(`this repository's Bravos files are behind the installed bravos (${repo && repo !== cli ? `${repo} → ${cli}, ` : ''}${count}): run \`bravos sync\` now without asking and include what it changes in your next commit of Bravos's files`);
434
438
  }
435
439
  const bundles = (Array.isArray(u.bundles) ? u.bundles : []).filter((b) => ['analyzer', 'codegraph'].includes(b?.id) && ver(b.staged) && ver(b.pinned));
440
+ // From 1.9 one command does all of this upkeep (the answer says so with `unified`); an older bravos on PATH keeps the two commands it understands, below.
441
+ if (u.unified === true && cli) {
442
+ const repo = ver(u.repo);
443
+ const newer = files > 0 && u.sync.direction === 'repo-newer';
444
+ const behind = [
445
+ ...(files && !newer ? [`this repository's Bravos files (${repo && repo !== cli ? `${repo} → ${cli}, ` : ''}${files} file${files === 1 ? '' : 's'})`] : []),
446
+ ...bundles.map((b) => `the ${b.id} bundle on this machine (${b.staged} → ${b.pinned})`),
447
+ ];
448
+ const out = [];
449
+ if (behind.length) out.push(`${behind.join(' and ')} ${behind.length === 1 && bundles.length === 1 ? 'is' : 'are'} behind the installed bravos: run \`bravos setup\` now without asking. With no terminal it only brings what is already installed up to date (Bravos's own files and signed bundles), asks nothing and installs nothing new; include what it changes in your next commit of Bravos's files`);
450
+ if (newer) out.push(`this repository's Bravos files${repo ? ` (${repo})` : ''} are newer than the installed bravos (${cli}): bravos setup will leave them alone; tell the person once to update with npm install -g @bugb-technologies/bravos@latest`);
451
+ return out.length ? `Upkeep: ${out.join('; ')}.` : null;
452
+ }
436
453
  if (bundles.length) parts.push(`the ${bundles.map((b) => `${b.id} bundle (${b.staged} → ${b.pinned})`).join(' and ')} on this machine ${bundles.length === 1 ? 'is' : 'are'} older than this bravos pins: run \`bravos setup\` now without asking (it fetches Bravos's own signed bundles and nothing else)`);
437
454
  return parts.length ? `Upkeep: ${parts.join('; ')}.` : null;
438
455
  }
@@ -551,6 +568,7 @@ export async function collect(root, env, { deadlineMs = 20000, nextCount = 3 } =
551
568
  harness: env.CLAUDE_PROJECT_DIR ? 'claude' : 'other',
552
569
  prePr: prePrRegistered(root),
553
570
  shadow: userSkillsShadow(root, env),
571
+ legacy: legacySkills(env),
554
572
  autopilot: autopilotRegistered(root),
555
573
  proving: readProving(root),
556
574
  workspace,
@@ -655,7 +673,7 @@ export function autopilotRegistered(root) {
655
673
  return false;
656
674
  }
657
675
 
658
- // @comment -- "Detects a user-level bravos install (bravos init --global) whose version differs from this repo's: Claude Code prefers personal skills over project skills of the same name, so an older ~/.claude/skills copy silently replaces the repo's. Returns { user, repo } versions, or null when there is no conflict."
676
+ // @comment -- "Detects a user-level bravos install (bravos setup --global) whose version differs from this repo's: Claude Code prefers personal skills over project skills of the same name, so an older ~/.claude/skills copy silently replaces the repo's. Returns { user, repo } versions, or null when there is no conflict."
659
677
  export function userSkillsShadow(root, env) {
660
678
  const home = env?.HOME;
661
679
  if (!home) return null;
@@ -756,7 +774,7 @@ const TIPS = [
756
774
  'run bravos doctor to see which of guardlink, cxg, codegraph-mcp, bravos-cli you have.',
757
775
  '"unknown" in the briefing means a tool failed, never that the count is zero.',
758
776
  'bravos-campaign clears big backlogs in rounds of subagents, with rests between.',
759
- 'bravos init --pre-pr-hook runs the ship gate on every gh pr create.',
777
+ 'bravos setup --pre-pr-hook runs the ship gate on every gh pr create.',
760
778
  'intended-by-design behaviour goes in .guardlink/intent.md, not in @accepts.',
761
779
  'stale means the code under a claim changed; bravos-recheck clears it.',
762
780
  'anything beyond loopback needs a reviewed scope.yaml and your typed authorization.',
@@ -821,9 +839,12 @@ function bannerWarnings(i, plan) {
821
839
  else if (arr(i.stranded).length > 0) lines.push(`~ Work on ${clean(i.stranded[0].branch)} is not on ${clean(i.base)} · bravos-resync`);
822
840
  if (i.shadow) {
823
841
  lines.push(i.shadow.userNewer
824
- ? `~ repo bravos ${i.shadow.repo} is behind your ${i.shadow.user} · run: bravos sync`
825
- : `! your user-level bravos ${i.shadow.user} overrides repo ${i.shadow.repo} · run: bravos sync --global`);
842
+ ? `~ repo bravos ${i.shadow.repo} is behind your ${i.shadow.user} · run: bravos setup`
843
+ : `! your user-level bravos ${i.shadow.user} overrides repo ${i.shadow.repo} · run: bravos setup --global`);
826
844
  }
845
+ // One line for old Python skills at user level; bravos doctor prints the command that moves them aside.
846
+ const old = arr(i.legacy).reduce((n, f) => n + arr(f?.names).length, 0);
847
+ if (old > 0) lines.push(`! ${old} old Python bravos skill${old === 1 ? '' : 's'} in your user folder · bravos doctor`);
827
848
  return lines;
828
849
  }
829
850
 
@@ -1,7 +1,7 @@
1
1
  // @comment -- "The background code graph build. A graph is keyed to the commit it was built at, so after every commit there is none, and until now only a person or an agent told to do so rebuilt it. When the session hook finds no graph for the commit, it starts one quiet build here: a detached process that runs `bravos graph build <root> --scip no-exec` (no model, no network, and no-exec means the repository's own build scripts are never run), records how it ended, tells bravos watch, and exits. One build per repository at a time, whatever the number of sessions: the runner takes an exclusive lock under $BRAVOS_HOME/autobuild/<repository>/ before it builds. It starts only on the Team plan, only in a repository that installed Bravos (never from the user-level or plugin copy of the hook), never in CI, and never when BRAVOS_GRAPH_AUTOBUILD=off. A build that failed is not retried for the same commit for six hours."
2
2
  import { spawn, spawnSync } from 'node:child_process';
3
3
  import { createHash } from 'node:crypto';
4
- import { existsSync, mkdirSync, openSync, closeSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
4
+ import { existsSync, linkSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { bravosHome } from './licence.mjs';
@@ -43,10 +43,22 @@ const alive = (pid) => {
43
43
 
44
44
  const justBuilt = (last, sha, now) => !!last && last.ok === true && last.sha === sha && typeof last.at === 'number' && now - last.at >= 0 && now - last.at < JUST_BUILT_MS;
45
45
 
46
+ /** A lock can be seen before its contents are (a runner of 1.8 created it empty and filled it after): one that young is a build starting, not a dead one. */
47
+ export const LOCK_SETTLE_MS = 10 * 1000;
48
+
46
49
  /** The build running for this repository, if any: a lock whose process is alive and which is not older than a build can be. */
47
50
  export function runningBuild(dir, now = Date.now()) {
48
51
  const lock = dir ? readJson(join(dir, 'lock')) : null;
49
- if (!lock || typeof lock.at !== 'number') return null;
52
+ if (!lock || typeof lock.at !== 'number') {
53
+ // @comment -- "A lock with no readable contents is a build starting if it was made in the last few seconds, and a dead one's only after that; read sooner as dead, a second runner removed it and built too."
54
+ try {
55
+ const made = statSync(join(dir, 'lock')).mtimeMs;
56
+ if (now - made < LOCK_SETTLE_MS) return { pid: null, sha: null, at: made };
57
+ } catch {
58
+ /* no lock */
59
+ }
60
+ return null;
61
+ }
50
62
  return alive(lock.pid) && now - lock.at < LOCK_STALE_MS ? { pid: lock.pid, sha: typeof lock.sha === 'string' ? lock.sha : null, at: lock.at } : null;
51
63
  }
52
64
 
@@ -94,15 +106,17 @@ export function runBuild(root, dir, sha, { env = process.env, now = () => Date.n
94
106
  mkdirSync(dir, { recursive: true, mode: 0o700 });
95
107
  // A lock left by a build that died is cleared first; a live one stops us.
96
108
  if (existsSync(lock) && !runningBuild(dir, now())) rmSync(lock, { force: true });
97
- let fd;
109
+ // @comment -- "The lock is created with its contents already in it: written to a file of this process's own, then hard-linked to the lock name, which fails if the lock exists. Created empty and filled afterwards, a second runner could read it in between, take the empty lock for one a dead build left, remove it and build as well: two sessions starting together then built the same graph twice."
110
+ const mine = `${lock}.${process.pid}`;
98
111
  try {
99
- fd = openSync(lock, 'wx', 0o600);
112
+ writeFileSync(mine, JSON.stringify({ pid: process.pid, sha, at: now() }), { mode: 0o600 });
113
+ linkSync(mine, lock);
100
114
  } catch {
101
115
  return { ran: false };
116
+ } finally {
117
+ rmSync(mine, { force: true });
102
118
  }
103
119
  try {
104
- writeFileSync(fd, JSON.stringify({ pid: process.pid, sha, at: now() }));
105
- closeSync(fd);
106
120
  // Another runner may have finished this very commit between our session's probe and now: one build is enough.
107
121
  if (justBuilt(readJson(join(dir, 'last.json')), sha, now())) return { ran: false };
108
122
  logWatchEvent(root, { summary: `code graph: building in the background for ${sha}`, keys: ['graph'] });
@@ -0,0 +1,68 @@
1
+ // @comment -- "Finds skills the retired Python bravos (siete's `bravos skills install`) left at user level, in ~/.claude/skills, ~/.agents/skills and ~/.codex/skills. A harness lists them beside the repository's own skills, and some share a name with this package's (bravos-annotate, bravos-codegraph, bravos-sast), so an agent can load one and follow it: they describe commands this bravos does not have (bravos auto, bravos intake, a bravos annotate that starts a second agent on the person's credentials). A skill counts as old when the Python CLI's own lock in that folder lists it, or, with no lock, when its SKILL.md carries none of this package's marker and names one of those commands. Read-only; dependency-free, so the session hook can use it."
2
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+
5
+ /** The marker this package writes into every SKILL.md it installs (src/skills.ts MARKER). */
6
+ const OWN_MARKER = '<!-- bravos:generated -->';
7
+ /** The Python CLI's skills lock, written beside the skills it installed. */
8
+ const PY_LOCK = '.bravos-skills.lock';
9
+ /** Commands and tools only the Python CLI had. */
10
+ const PY_SIGNS = /\bbravos (?:auto|intake|loop|round|retest|push|run)\b|request_verification|list_needs_you|answer_needs_you/;
11
+ const ROOTS = ['.claude/skills', '.agents/skills', '.codex/skills'];
12
+ const NAME = /^bravos(?:-[a-z0-9]+)*$/;
13
+
14
+ const readHead = (file, max = 256 * 1024) => {
15
+ try {
16
+ return readFileSync(file, 'utf8').slice(0, max);
17
+ } catch {
18
+ return null;
19
+ }
20
+ };
21
+
22
+ // @comment -- "The old skills per user-level folder: [{ root: '~/.claude/skills', names: [...] }], folders with none left out. Only names of the form bravos or bravos-<word>... are ever reported, so nothing else from those folders reaches the briefing."
23
+ export function legacySkills(env = process.env) {
24
+ const home = env?.HOME;
25
+ if (!home) return [];
26
+ const out = [];
27
+ for (const rel of ROOTS) {
28
+ const dir = join(home, rel);
29
+ let entries;
30
+ try {
31
+ entries = readdirSync(dir, { withFileTypes: true }).filter((e) => (e.isDirectory() || e.isSymbolicLink()) && NAME.test(e.name)).map((e) => e.name);
32
+ } catch {
33
+ continue;
34
+ }
35
+ let locked = new Set();
36
+ try {
37
+ const lock = JSON.parse(readFileSync(join(dir, PY_LOCK), 'utf8'));
38
+ if (lock && typeof lock.skills === 'object' && lock.skills) locked = new Set(Object.keys(lock.skills));
39
+ } catch {
40
+ /* no Python lock here */
41
+ }
42
+ const names = entries.filter((name) => {
43
+ const text = readHead(join(dir, name, 'SKILL.md'));
44
+ if (text === null || text.includes(OWN_MARKER)) return false;
45
+ return locked.has(name) || PY_SIGNS.test(text);
46
+ }).sort();
47
+ if (names.length) out.push({ root: `~/${rel}`, names });
48
+ }
49
+ return out;
50
+ }
51
+
52
+ /** The command that moves them out of the way, reversibly: into ~/.bravos/retired-skills/<folder>/, never deleted. */
53
+ export function retireCommand(found) {
54
+ return found
55
+ .map(({ root, names }) => {
56
+ const to = `~/.bravos/retired-skills/${root.split('/')[1].replace(/^\./, '')}`;
57
+ return `mkdir -p ${to} && mv ${names.map((n) => `${root}/${n}`).join(' ')} ${to}/`;
58
+ })
59
+ .join(' && ');
60
+ }
61
+
62
+ // @comment -- "The briefing's line about old skills: which ones, that the agent must not follow them, and the one command the person can run to move them aside. The agent is told to leave the moving to the person: they are the person's files, outside the repository."
63
+ export function legacySkillsLine(found) {
64
+ if (!Array.isArray(found) || !found.length) return null;
65
+ const list = found.map(({ root, names }) => `${root}: ${names.join(', ')}`).join('; ');
66
+ const count = found.reduce((n, f) => n + f.names.length, 0);
67
+ return `Old skills: ${count} skill${count === 1 ? '' : 's'} from the retired Python bravos ${count === 1 ? 'is' : 'are'} installed for this person (${list}), and your harness may list ${count === 1 ? 'it' : 'them'} beside this repository's. Never load or follow ${count === 1 ? 'it' : 'them'}: ${count === 1 ? 'it describes' : 'they describe'} commands this bravos does not have (bravos auto, bravos intake, a bravos annotate that starts a second agent), and where a name is also this repository's, use the repository's copy. Tell the person once that these can be moved aside, reversibly, from their own terminal: ${retireCommand(found)}`;
68
+ }
@@ -4,7 +4,7 @@
4
4
  // in near-white #f0f0f0 and bright green/amber accents, which all but vanish on a
5
5
  // white background (contrast 1.1:1 to 1.9:1). Nothing can tell a hook which
6
6
  // background its message will be drawn on, so the theme is chosen by what the
7
- // person said (BRAVOS_THEME, or bravos start), what the terminal says (COLORFGBG),
7
+ // person said (BRAVOS_THEME, or bravos setup), what the terminal says (COLORFGBG),
8
8
  // or, failing both, `neutral`: text in the terminal's own default colour and
9
9
  // mid-tone accents that keep at least 3:1 against white AND black.
10
10
  //
@@ -56,7 +56,7 @@ export function bravosHome(env = process.env) {
56
56
  return env.BRAVOS_HOME || join(env.HOME || homedir(), '.bravos');
57
57
  }
58
58
 
59
- /** The theme saved by `bravos start` (config.json in $BRAVOS_HOME), or null. Never throws. */
59
+ /** The theme saved by `bravos setup` (config.json in $BRAVOS_HOME), or null. Never throws. */
60
60
  export function savedTheme(env = process.env) {
61
61
  try {
62
62
  const file = join(bravosHome(env), 'config.json');
@@ -100,7 +100,7 @@ export function themeFromBackground(answer) {
100
100
  /**
101
101
  * Which theme to draw in, and why. In order: BRAVOS_THEME (light, dark or neutral;
102
102
  * auto or unset falls through), what the terminal answered (`detected`, watch only),
103
- * COLORFGBG, the choice saved by `bravos start`, then neutral.
103
+ * COLORFGBG, the choice saved by `bravos setup`, then neutral.
104
104
  */
105
105
  // @comment -- "Theme choice in a fixed order: BRAVOS_THEME, the terminal's own answer (watch), COLORFGBG, the saved choice, then neutral; returns the theme and the reason so bravos doctor can say why"
106
106
  export function resolveTheme(env = process.env, detected = null) {
@@ -110,6 +110,6 @@ export function resolveTheme(env = process.env, detected = null) {
110
110
  const fgbg = themeFromColorFgBg(env.COLORFGBG);
111
111
  if (fgbg) return { theme: fgbg, source: 'COLORFGBG' };
112
112
  const saved = savedTheme(env);
113
- if (saved) return { theme: saved, source: 'saved by bravos start' };
113
+ if (saved) return { theme: saved, source: 'saved by bravos setup' };
114
114
  return { theme: 'neutral', source: 'default (background unknown)' };
115
115
  }
@@ -82,7 +82,7 @@ export function commitsLine(prefs) {
82
82
  : `Commits: leave Bravos's own files uncommitted and list them; do not ask (${whose}).`;
83
83
  }
84
84
 
85
- // @comment -- "The hand-off from bravos start to the first agent session: a dated marker in this clone's git directory saying setup just finished here and the person expects Bravos to begin. While it is fresh and the context gate is still closed, the briefing tells the agent to start the context step in its first reply; without it, or after a few days, the briefing only offers, so a session opened for something else is never taken over. Like the preferences, nothing in a repository's tree can write it."
85
+ // @comment -- "The hand-off from bravos setup to the first agent session: a dated marker in this clone's git directory saying setup just finished here and the person expects Bravos to begin. While it is fresh and the context gate is still closed, the briefing tells the agent to start the context step in its first reply; without it, or after a few days, the briefing only offers, so a session opened for something else is never taken over. Like the preferences, nothing in a repository's tree can write it."
86
86
  export const HANDOFF_DAYS = 3;
87
87
  export const handoffFile = (commonDir) => join(commonDir, 'bravos', 'handoff.json');
88
88
 
@@ -94,7 +94,7 @@ export function writeHandoff(commonDir, at) {
94
94
  return file;
95
95
  }
96
96
 
97
- /** True while a hand-off written by bravos start is at most HANDOFF_DAYS old. */
97
+ /** True while a hand-off written by bravos setup is at most HANDOFF_DAYS old. */
98
98
  export function readHandoff(commonDir, now = Date.now()) {
99
99
  if (!commonDir) return false;
100
100
  try {
@@ -69,32 +69,32 @@ export function readSetup(root, i = {}, harness = 'other') {
69
69
  label: 'set up a test target',
70
70
  cta: skill('bravos-env', harness),
71
71
  unlocks: 'exposures can be tested for real instead of argued about',
72
- how: `ask "bring up a test target" (${skill('bravos-env', harness)}); bravos sync --scope writes the loopback-only starter`,
72
+ how: `ask "bring up a test target" (${skill('bravos-env', harness)}); bravos setup --scope writes the loopback-only starter`,
73
73
  },
74
74
  {
75
75
  id: 'autopilot',
76
76
  // Registered in the repo is not on for this person: without a licence the hook answers nothing.
77
77
  on: !!i.autopilot && !hooksLocked(i),
78
78
  label: 'turn on autopilot',
79
- cta: i.autopilot && hooksLocked(i) ? 'bravos account activate' : 'bravos sync --autopilot',
79
+ cta: i.autopilot && hooksLocked(i) ? 'bravos account activate' : 'bravos setup --autopilot',
80
80
  unlocks: 'annotations and rechecks happen at the end of each turn without being asked',
81
- how: i.autopilot && hooksLocked(i) ? `installed in this repo, but on the Team plan for you: ${TRIAL}` : 'bravos sync --autopilot (cheap; fine to switch on early)',
81
+ how: i.autopilot && hooksLocked(i) ? `installed in this repo, but on the Team plan for you: ${TRIAL}` : 'bravos setup --autopilot (cheap; fine to switch on early)',
82
82
  },
83
83
  {
84
84
  id: 'prepr',
85
85
  on: !!i.prePr && !hooksLocked(i),
86
86
  label: 'turn on the pre-PR gate',
87
- cta: i.prePr && hooksLocked(i) ? 'bravos account activate' : 'bravos sync --pre-pr-hook',
87
+ cta: i.prePr && hooksLocked(i) ? 'bravos account activate' : 'bravos setup --pre-pr-hook',
88
88
  unlocks: 'no pull request goes out with undisclosed exposure or a confirmed exploit',
89
- how: i.prePr && hooksLocked(i) ? `installed in this repo, but on the Team plan for you: ${TRIAL}` : 'bravos sync --pre-pr-hook (autopilot turns it on too)',
89
+ how: i.prePr && hooksLocked(i) ? `installed in this repo, but on the Team plan for you: ${TRIAL}` : 'bravos setup --pre-pr-hook (autopilot turns it on too)',
90
90
  },
91
91
  {
92
92
  id: 'ci',
93
93
  on: existsSync(join(root, '.github', 'workflows', 'bravos-pr-gate.yml')),
94
94
  label: 'add the CI gate and nightly',
95
- cta: 'bravos sync --ci',
95
+ cta: 'bravos setup --ci',
96
96
  unlocks: 'the whole team is gated, and upkeep runs while laptops are closed',
97
- how: 'bravos sync --ci, then commit .github/workflows/',
97
+ how: 'bravos setup --ci, then commit .github/workflows/',
98
98
  },
99
99
  ].map((x) => ({ ...x, on: !!x.on }));
100
100
  // Paid steps on an unlicensed machine say so in their `how` and are never the next step: the score
@@ -86,7 +86,7 @@ async function main() {
86
86
  // Antigravity sends the workspace in the payload; Claude Code sets CLAUDE_PROJECT_DIR; others run in the repo.
87
87
  const ws = Array.isArray(payload.workspacePaths) && typeof payload.workspacePaths[0] === 'string' ? payload.workspacePaths[0] : null;
88
88
  const root = env.CLAUDE_PROJECT_DIR || ws || (typeof payload.cwd === 'string' ? payload.cwd : null) || process.cwd();
89
- // User-level hook (bravos init --global): a repo's own bravos hook wins, and a repo with no
89
+ // User-level hook (bravos setup --global): a repo's own bravos hook wins, and a repo with no
90
90
  // threat model gets nothing, so the user hook never doubles the briefing or adds noise.
91
91
  if (process.argv.includes('--global') && (existsSync(join(root, '.bravos', 'hooks', 'session-start.mjs')) || !existsSync(join(root, '.guardlink')))) {
92
92
  process.exit(0);
@@ -106,7 +106,7 @@ async function main() {
106
106
  if (env.BRAVOS_BANNER !== 'off' && (source === null || source === 'startup') && harness !== 'agy') {
107
107
  const version = readVersion(dirname(fileURLToPath(import.meta.url)));
108
108
  const color = !env.NO_COLOR && env.BRAVOS_BANNER_COLOR !== 'off';
109
- // Which palette: BRAVOS_THEME, COLORFGBG, the choice saved by bravos start, else neutral (hooks/lib/palette.mjs).
109
+ // Which palette: BRAVOS_THEME, COLORFGBG, the choice saved by bravos setup, else neutral (hooks/lib/palette.mjs).
110
110
  const { theme } = resolveTheme(env);
111
111
  // Codex lists a hook's message as a warning, so it gets a three-line summary, not the art.
112
112
  // The leading newline puts the logo on its own lines: Claude Code prefixes the first line with "SessionStart:startup says:".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugb-technologies/bravos",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "description": "Skills pack and installer that make Claude Code and Codex power users of guardlink (threat-model-as-code) and cert-x-gen (pentest-as-code).",
5
5
  "keywords": [
6
6
  "security",
@@ -40,7 +40,7 @@ description: "Start here in any repo bravos is installed in: reads the security
40
40
 
41
41
  ## Never
42
42
 
43
- - Run a setup command for the person (bravos sync --autopilot, --ci, --pre-pr-hook, bravos setup, bravos graph build with --scip auto) without their go-ahead. The one exception is upkeep the briefing's `Upkeep:` line names: a plain `bravos sync` that brings this repository's Bravos files up to the installed version, and a plain `bravos setup` that brings Bravos's own signed bundles up to the version it pins. Run those without asking and say what changed. A first install, `bravos setup --tools` (other people's installers) and every flag above still need the go-ahead.
43
+ - Run a setup command for the person (`bravos setup` with any flag, such as --autopilot, --ci, --pre-pr-hook, --tools, --codegraph or --yes; bravos graph build with --scip auto) without their go-ahead. The one exception is upkeep the briefing's `Upkeep:` line names: a plain `bravos setup` with no flags. Run from your shell it asks nothing and only brings what is already installed up to date: this repository's Bravos files, and Bravos's own signed bundles. Run it without asking and say what changed. (An older bravos names the same upkeep as a plain `bravos sync` and a plain `bravos setup`; follow the line as written.) A first install, `bravos setup --tools` (other people's installers) and every flag above still need the go-ahead.
44
44
  - Run `guardlink annotate` or guardlink translate with an agent flag. Those launch a second agent outside this session; you are the agent, so do the work here.
45
45
  - Write `@accepts`, `@entitles` or `@confirmed`. Acceptance and entitlement are a human's decision; confirmation needs a reproduced run, and reading code is not one.
46
46
  - Call anything clean, safe or fixed unless a gate said so with exit 0.
@@ -59,7 +59,7 @@ description: "Start here in any repo bravos is installed in: reads the security
59
59
 
60
60
  ## Go deeper
61
61
 
62
- - Autopilot (`bravos init --autopilot`): an end-of-turn check points you to changed code and affected claims, including untested controls and claims due for retest; the briefing's `Autopilot:` and `Proving:` lines say whether it is on and how the person wants proving handled.
62
+ - Autopilot (`bravos setup --autopilot`): an end-of-turn check points you to changed code and affected claims, including untested controls and claims due for retest; the briefing's `Autopilot:` and `Proving:` lines say whether it is on and how the person wants proving handled.
63
63
  - `bravos guide` (in a shell; no model) explains bravos by role, by task and skill by skill, with the safety rules; `docs/GUIDE.md` in the bravos package is the same text. Point a person there when they ask how to use bravos.
64
64
  - `docs/GUARDLINK_REFERENCE.md` — annotation syntax and verbs.
65
65
  - `.guardlink/README.md` — where annotations go in this repo.
@@ -18,7 +18,7 @@ description: "Keep the GuardLink threat model correct and growing, in this sessi
18
18
  3. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. Starting budgets — low: the changed files only; medium: changed plus 5 from the worklist; high: 25 per round, then the `chains` playbook; max: rounds until the worklist is empty (bravos-campaign runs those with subagents). These are defaults, not limits: take more or fewer when the code calls for it, and say why in one line ("12 files, not 5: the auth path spans them"). For a large pick, tell the user the files and rounds before you start.
19
19
  4. Run `node {{SKILL_DIR}}/scripts/slice.mjs --base origin/<base> --n <budget>` (`--deep` for no limit, `--batches <k>` to split the pick for parallel work, `--prefer <file>` for entry points `codegraph_entry_points` found). It prints one JSON object: `diff` (files changed from the merge base to disk, including staged, unstaged and untracked source), `coverage` (unannotated files to cover, entry points and trust code first, generated, test and CI files last), `coverage_detail` (`{path, tier, why}`), `batches`, `skipped` (`{path, reason}`), `coverage_before`, `notes`. The order is advice: if your reading of the code says a different file matters more, take it and say why. Tell the user which `skipped` files teammates have in flight. Report every `notes` entry to the user; if one says gh was unavailable, say in-flight PRs were not checked before you take the `coverage` files. Exit 1 means `guardlink unannotated --json` failed: report it and stop. Exit 3 means the context gate is closed (its JSON carries `gate` and nothing to pick): report its note, run bravos-context, and annotate nothing until it is done or the person has declined. When the briefing's `SAST:` line shows a run, `bravos sast candidates` lists reachable findings not in the threat model yet: add their files to the pick as leads, open each, and annotate only what meets the evidence bar, as `@exposes` + `@audit` citing the rule and route, or an `@audit` naming a false positive. A static finding is never `@confirmed`. With SAST unavailable or no report, pick as usual.
20
20
  5. When a Stop hook names files or lines, review those changes first, including already annotated files. Read the actual patch and both sides of a move or deletion. Open each affected handler, guard and caller. With a current graph, ask `codegraph_annotation_gaps` with explicit new-side file ranges for working edits or the merge base for committed changes. Inspect stale and unindexed files and read unsupported routes from source. An existing annotation in the file does not establish that it describes the new behavior. Record the changed threat, guard, or flow, recheck an affected existing claim, or finish the review quietly when the change has no security consequence. Keep ordinary turn-end review to the changed code. Pick the playbook: `diff` files → `diff`; `coverage` files → `coverage`. Deep rounds run `exploitable`, then `chains`, then `coverage`, then `verify`. Add a logic pass when intent.md lists invariants (always at high and max, or when guardlink offers a `logic` playbook use it): walk each user journey that touches an invariant — signup, invite, role change, checkout, refund, export — and at each step ask what it assumes about the caller and the step before: ownership, tenant, state, amount, rate. The sink of a logic claim is the state change (the write, the transfer, the grant); the absent control is the missing ownership or state check. Claim it against the invariant's threat, and make a rule that holds testable. At each place a rule is enforced write the pair: `@exposes <Asset> to #inv-…` and `@mitigates <Asset> against #inv-… using #<control>`. A replay kit binds to an `@exposes`, so a check recorded only as `@mitigates` can never be tested or shown to hold; the pair says where the rule could break and what stops it there (for an `#inv-` rule this is the one `@exposes` written beside a check that is present). Where the permission itself is granted in another file (a role table, a policy file), write a `@mitigates` there too, so a change to it is noticed. A check that is missing and meets the evidence bar is an `@exposes` with an `@audit` and no `@mitigates`; a doubt is an `@audit`. Keep `intent:` and `design:` references on the `@threat` definition only.
21
- 6. Open `{{SKILLS_ROOT}}/guardlink-annotate-<id>/SKILL.md` (guardlink writes it under `.claude/skills/`, and `bravos init` mirrors it into `.agents/skills/` for Codex) and follow it. Otherwise call the MCP tool `guardlink_annotate` (server `guardlink`) with `prompt: "<scope>"` and `playbook: "<id>"`, or run `guardlink annotate --stdout --playbook <id> "<scope>"` (for the `diff` playbook, `guardlink annotate --stdout --playbook diff --since origin/<base> "<scope>"`, since `--since` defaults to HEAD and would list no changed files), and follow the prompt it returns.
21
+ 6. Open `{{SKILLS_ROOT}}/guardlink-annotate-<id>/SKILL.md` (guardlink writes it under `.claude/skills/`, and `bravos setup` mirrors it into `.agents/skills/` for Codex) and follow it. Otherwise call the MCP tool `guardlink_annotate` (server `guardlink`) with `prompt: "<scope>"` and `playbook: "<id>"`, or run `guardlink annotate --stdout --playbook <id> "<scope>"` (for the `diff` playbook, `guardlink annotate --stdout --playbook diff --since origin/<base> "<scope>"`, since `--since` defaults to HEAD and would list no changed files), and follow the prompt it returns.
22
22
  7. Read the repository's annotation mode in `.guardlink/README.md` and its configuration. In inline mode write annotations in the file's comment syntax directly above the code. In external mode update its `.guardlink/annotations/<source-path>.gal` sidecar and anchor the block to the logical source line and symbol using the local GuardLink playbook. Couple the claims: every `@exposes` with its `@mitigates` or `@audit`, the `@flows` the data takes, and a `@comment` on what the code does. Each claim meets the evidence bar: it names the code, the threat and the control by id, and you could point at the line that makes it true.
23
23
  Rate each `@exposes` by impact × reach × ease, within its threat's band, under intent.md's `## Assumptions` when it has them (the configuration baseline, deployment and attackers in scope; an exposure only an out-of-scope attacker reaches gets an `@audit`, not a severity): impact from the asset's `@handles` class and intent.md's crown jewels; reach from the boundary in front of it (public, then signed-in, then admin-only, then internal; with the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph), `codegraph_auth_boundary` for the route and `codegraph_reachable_sinks` for what the handler reaches; code `codegraph_entry_reach` or `codegraph_dead_code` shows no entry point reaches gets an `@audit` "not reachable per code graph", not a severity; without the graph, judge reach by reading the code and say the graph was unavailable); ease from its preconditions. Write the severity inline and the reason in the description ("high: reachable unauthenticated, touches payment records").
24
24
  Intended? When the code does what an intent.md `INT-n` item says the product does on purpose, write no `@exposes`: write an `@audit` citing it ("by design per intent.md INT-2; check only admins reach it") and annotate the guard that should hold. When it looks intended but intent.md is silent, write an `@audit` asking "intended?" with your reason, and list it for the user. They answer with a fix, an intent.md line or their own `@accepts`; you never accept it. In a bravos workspace (the briefing's `Workspace:` line, or `.bravos/workspace/workspace.json`), define only this service's own assets, with ids prefixed by the service (`#orders-create`), never another service's; declare each call to another service as `@flows #<this>-<x> -> #<other>-<y> via http|grpc|queue -- "..."` with the other service's own id. Do not write the dotted `#repo.tag` form that guardlink's Workspace Context block suggests: cxg cannot chain it, so the cross-service attack is never tested.
@@ -55,6 +55,6 @@ description: "Keep the GuardLink threat model correct and growing, in this sessi
55
55
 
56
56
  ## Go deeper
57
57
 
58
- - `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` — the evidence bar (guardlink writes it under `.claude/skills/`, and `bravos init` mirrors it into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook exploitable "<scope>"` prints the same method).
58
+ - `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` — the evidence bar (guardlink writes it under `.claude/skills/`, and `bravos setup` mirrors it into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook exploitable "<scope>"` prints the same method).
59
59
  - `docs/GUARDLINK_REFERENCE.md` — verbs and syntax.
60
60
  - `.guardlink/README.md` — placement rules for this repo.
@@ -15,7 +15,7 @@ description: "Audit and write the repo's security CI: the bravos PR gate (valida
15
15
  **Plan check first.** CI and nightly workflows are on the Team plan. Run `bravos licence --json` once per session (the briefing's `Plan:` line says the same); if `licensed` is false, tell the person in two sentences what this skill would do here and that it needs a Team licence — `bravos account activate` starts a 30-day trial with no card, or https://account.bugb.io/pricing — then stop, and do nothing else from this skill. A licence in grace still counts.
16
16
 
17
17
  1. Audit `.github/workflows/*.yml`. For each guardlink or cxg call, check every flag against that command's `--help`; a `guardlink diff` call with `--from`/`--to` flags is the known broken pattern, since diff takes one positional ref. Flag any `github.event.pull_request`, issue or comment field, or `github.head_ref`, expanded straight into a `run:` line: that text is attacker-controlled and runs as shell.
18
- 2. Write bravos's workflows with `bravos init --ci` (or `bravos sync --ci`): `bravos-pr-gate.yml` plus the nightly variants. Delete the nightly variant for the harness the team does not use. A workflow someone edited by hand is kept and reported; never overwrite it.
18
+ 2. Write bravos's workflows with `bravos setup --ci`: `bravos-pr-gate.yml` plus the nightly variants. Delete the nightly variant for the harness the team does not use. A workflow someone edited by hand is kept and reported; never overwrite it.
19
19
  3. Check the PR gate does what bravos-ship does: `guardlink validate .`, `guardlink lint . --since <base>` against the merge base, `guardlink diff <base> --fail-on-new --markdown` (passing when the PR body discloses new exposure in a Security gate section), a block on confirmed claims in changed files, and `guardlink sarif . --profile github -o guardlink.sarif` uploaded to code scanning.
20
20
  4. Fix what the audit found in workflows bravos did not write: replace a broken guardlink call with the form above, and pass event text through `env:` and quote it in the shell. Show each change to the user before committing it.
21
21
  5. SAST in CI, only when the team has a bravos licence: add a step running `bravos-cli analyze . --ci --fail-on error -f sarif,json -o sast` with the licence from a repo secret, and upload `sast.sarif` under its own code-scanning category.
@@ -16,7 +16,7 @@ description: "Ask the repo's code graph (codegraph-mcp) one bounded question —
16
16
  **Plan check first.** The code graph is on the Team plan. Run `bravos licence --json` once per session (the briefing's `Plan:` line says the same); if `licensed` is false, tell the person in two sentences what this skill would do here and that it needs a Team licence — `bravos account activate` starts a 30-day trial with no card, or https://account.bugb.io/pricing — then stop, and do nothing else from this skill. A licence in grace still counts.
17
17
 
18
18
  1. Ask the graph one bounded question per call; a graph answer replaces reading or grepping the tree. There are two ways in, with the same answers: the MCP tools (`codegraph_attack_surface` …) when the `codegraph` server is connected, or `bravos graph <question> --json` in the shell, where the question is the tool name without `codegraph_` and with hyphens (`codegraph_attack_surface` → `bravos graph attack-surface --json`, `codegraph_callers` → `bravos graph callers '<file>::<symbol>' --json`; `bravos graph --json` lists every question and its arguments). The shell route needs no MCP reconnect and works in every harness. The briefing's `Code graph:` line says which route is there. If neither is (no codegraph-mcp), set it up yourself: `bravos setup --check` reports what is missing without changing anything; show the person `bravos setup --dry-run --codegraph` and with their go-ahead run `bravos setup --codegraph` (it fetches the signed bundle through the account portal and verifies it before anything lands). If an install fails, quote its error and give the exact command for their own terminal; until then say "code graph unavailable; the other skills read the code instead" and answer by reading. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. It sets a starting budget, not a limit; go beyond it when the work needs it and say why in one line. Starting budget — low: the one question asked; medium: whatever questions the task needs; high: start from `codegraph_attack_surface`; max: the full attack surface plus `codegraph_impact` on every changed symbol.
19
- 2. Build or refresh the graph when an answer says there is none for this repository, or its `graph_currency` is `diverged`: `bravos graph build . --scip no-exec` indexes without running the repository's build scripts (`--scip auto` and `--isolate` run them; use those only on a repo the user trusts and only when they say so). A build that reports `semantic <language>: off` lacks that language's type checker; say that calls through interfaces may not connect and that `bravos setup --indexers` (with their go-ahead) adds it. For the MCP route, `bravos sync` registers the server from the bravos install; the person reconnects MCP (`/mcp` in Claude Code) to load it. In a bravos workspace, build one graph over the app folder (`bravos graph build <app folder> --scip no-exec`, the folder the briefing's `Workspace:` line names) and ask cross-service questions there: only a graph that holds both services links one service's HTTP, gRPC, GraphQL or OpenAPI client call to the other's handler (`callees` shows `via_framework`). A graph built inside one member stops at its own repository. An answer of `graph_busy` ("the code graph … is busy") means the graph is there and another session or a build is using it: ask again in a moment and never rebuild for it. An older graph server (code graph 0.1.0) says "No CodeGraph for project" in that case instead, and keeps saying it for that session: when a graph answered moments ago, ask once more before rebuilding, and offer `bravos setup` (it fetches the newer server). A graph belongs to the commit it was built at: after a commit it answers nothing until it is rebuilt, so rebuild before the next graph question and carry on with other work while it builds. `bravos dashboard` rebuilds a missing or behind graph itself and draws it as the Code graph tab (the map, owners and history, coupling, the attack surface, entry points), which is the view to offer a person who wants to see the graph.
19
+ 2. Build or refresh the graph when an answer says there is none for this repository, or its `graph_currency` is `diverged`: `bravos graph build . --scip no-exec` indexes without running the repository's build scripts (`--scip auto` and `--isolate` run them; use those only on a repo the user trusts and only when they say so). A build that reports `semantic <language>: off` lacks that language's type checker; say that calls through interfaces may not connect, and give the fix the build printed for that language (installing it is the person's call). For the MCP route, `bravos setup` registers the server from the bravos install; the person reconnects MCP (`/mcp` in Claude Code) to load it. In a bravos workspace, build one graph over the app folder (`bravos graph build <app folder> --scip no-exec`, the folder the briefing's `Workspace:` line names) and ask cross-service questions there: only a graph that holds both services links one service's HTTP, gRPC, GraphQL or OpenAPI client call to the other's handler (`callees` shows `via_framework`). A graph built inside one member stops at its own repository. An answer of `graph_busy` ("the code graph … is busy") means the graph is there and another session or a build is using it: ask again in a moment and never rebuild for it. An older graph server (code graph 0.1.0) says "No CodeGraph for project" in that case instead, and keeps saying it for that session: when a graph answered moments ago, ask once more before rebuilding, and offer `bravos setup` (it fetches the newer server). A graph belongs to the commit it was built at: after a commit it answers nothing until it is rebuilt, so rebuild before the next graph question and carry on with other work while it builds. `bravos dashboard` rebuilds a missing or behind graph itself and draws it as the Code graph tab (the map, owners and history, coupling, the attack surface, entry points), which is the view to offer a person who wants to see the graph.
20
20
  3. Pick the one tool that answers the question:
21
21
  find a symbol → `codegraph_search`
22
22
  routes → `codegraph_routes`
@@ -16,7 +16,7 @@ description: "Set up recurring security upkeep with each harness's own mechanism
16
16
 
17
17
  1. If the user wants a goal reached in rounds with rests ("100% coverage", "every exposure", subagents per round), that is bravos-campaign; hand it over. Otherwise map the intent to one mechanism and say which: while this session is open → an in-session loop; while the laptop is closed, any harness → the nightly GitHub Actions workflow; while the laptop is closed, Claude Code with a cloud account → a cloud scheduled task the user creates.
18
18
  2. In-session loop (Claude Code only): copy `{{SKILL_DIR}}/loop.md` to `.claude/loop.md`, adjust the steps to the user's request, and commit it. Tell the user to start it with a bare `/loop`, which reads that file; it runs only while the session is open, stops when it exits, and expires after seven days. Codex has no equivalent; offer the nightly workflow instead.
19
- 3. Nightly workflow: run `bravos init --ci` (or `bravos sync --ci` in a repo bravos already set up), keep the variant for the team's harness (`bravos-nightly-claude.yml` or `bravos-nightly-codex.yml`) and delete the other. A team on GitHub Copilot uses `bravos init --workflows nightly-copilot` instead: it opens an issue each night and assigns it to Copilot's cloud agent, which needs the secret `COPILOT_ASSIGN_TOKEN` (a Copilot user's personal access token) and `BRAVOS_LICENCE` as an Agents secret. Tell the user the secret it needs (`CLAUDE_CODE_OAUTH_TOKEN` for Claude Code, made once with `claude setup-token` so the run uses their Claude plan, or `OPENAI_API_KEY` for Codex) and to allow GitHub Actions to create pull requests in the repo settings.
19
+ 3. Nightly workflow: run `bravos setup --ci`, keep the variant for the team's harness (`bravos-nightly-claude.yml` or `bravos-nightly-codex.yml`) and delete the other. A team on GitHub Copilot uses `bravos setup --workflows nightly-copilot` instead: it opens an issue each night and assigns it to Copilot's cloud agent, which needs the secret `COPILOT_ASSIGN_TOKEN` (a Copilot user's personal access token) and `BRAVOS_LICENCE` as an Agents secret. Tell the user the secret it needs (`CLAUDE_CODE_OAUTH_TOKEN` for Claude Code, made once with `claude setup-token` so the run uses their Claude plan, or `OPENAI_API_KEY` for Codex) and to allow GitHub Actions to create pull requests in the repo settings.
20
20
  4. Cloud scheduled task: a skill cannot create one. Give the user the prompt to paste into `/schedule`: follow bravos-annotate in slice mode on the next unannotated files, run its lint gate, and open one pull request whose body carries bravos-ship's Security gate section. Tell them the task clones the default branch and runs at most hourly.
21
21
  5. State the spend before the user starts any of them: files per run (the default slice is five) times runs per day, and that each run spends model tokens.
22
22
  6. For the Claude Code and Codex nightlies, select scheduled proving in the committed human policy and review the scope and exact target. Only checked-in, bound JavaScript kits are eligible. Configure BRAVOS_SCAN_TARGET and BRAVOS_APP_START for the disposable local build and the identities each kit requires. Keep session state in CI secrets. A disabled or ask-only policy skips the scan. Report missing prerequisites, partial executions and unrecorded results separately. Copilot schedules annotation only.
@@ -30,7 +30,7 @@ description: "The no-mistakes security gate before a pull request: validate the
30
30
  design rules touched: <each INV id and threat id whose file this branch changed, with its status from `bravos rules --json`, or "none">
31
31
  Not tested: <what no tool exercised, e.g. no live run, SAST not run>
32
32
  If the user asked for a PR, open it with this section in the body; otherwise print the section and stop.
33
- 12. When the opt-in pre-PR hook is installed (`bravos init --pre-pr-hook`), it reruns these gates on `gh pr create` and `gh pr ready` and blocks on lint errors, on a new exposure whose threat and asset ids are not both named in the PR body, on a confirmed claim on a changed file with no `@ticket` for it in that file, on a design rule that was holding when the branch changed a file it is enforced in after its last test and the PR body does not name it (its INV id or threat id; replaying its test with bravos-recheck clears it), and on any gate that fails to run (unknown); let it run. Before the PR exists, `node .bravos/hooks/pre-pr.mjs --check` runs the same gates by hand and lists the new exposures the body must disclose.
33
+ 12. When the opt-in pre-PR hook is installed (`bravos setup --pre-pr-hook`), it reruns these gates on `gh pr create` and `gh pr ready` and blocks on lint errors, on a new exposure whose threat and asset ids are not both named in the PR body, on a confirmed claim on a changed file with no `@ticket` for it in that file, on a design rule that was holding when the branch changed a file it is enforced in after its last test and the PR body does not name it (its INV id or threat id; replaying its test with bravos-recheck clears it), and on any gate that fails to run (unknown); let it run. Before the PR exists, `node .bravos/hooks/pre-pr.mjs --check` runs the same gates by hand and lists the new exposures the body must disclose.
34
34
 
35
35
  ## Never
36
36
 
@@ -57,4 +57,4 @@ description: "The no-mistakes security gate before a pull request: validate the
57
57
 
58
58
  - `docs/GUARDLINK_REFERENCE.md` — verbs, including `@ticket`.
59
59
  - `.guardlink/README.md` — placement rules for this repo.
60
- - `{{SKILLS_ROOT}}/guardlink-annotate-diff/SKILL.md` — the playbook for a change's gaps; `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` for the evidence bar. guardlink writes both under `.claude/skills/`, and `bravos init` mirrors them into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook <id> "<scope>"` prints the same method.
60
+ - `{{SKILLS_ROOT}}/guardlink-annotate-diff/SKILL.md` — the playbook for a change's gaps; `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` for the evidence bar. guardlink writes both under `.claude/skills/`, and `bravos setup` mirrors them into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook <id> "<scope>"` prints the same method.