@bugb-technologies/bravos 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/dist/ci.js +11 -3
- package/dist/cli.js +50 -8
- package/dist/doctor.js +4 -16
- package/dist/guide.js +5 -3
- package/dist/help.js +16 -16
- package/dist/hooks.js +21 -0
- package/dist/install-proof-tool.js +117 -0
- package/dist/proof-tools.js +29 -0
- package/dist/report/check.js +4 -1
- package/dist/report/data.js +81 -149
- package/dist/report/markdown.js +1 -1
- package/dist/report/redact.js +16 -0
- package/dist/report/runs.js +169 -0
- package/dist/resync.js +272 -0
- package/dist/setup.js +31 -16
- package/dist/start/answers.js +5 -3
- package/dist/start/index.js +28 -14
- package/dist/versions.js +4 -3
- package/docs/GUIDE.md +12 -2
- package/hooks/lib/autopilot.mjs +216 -77
- package/hooks/lib/briefing.mjs +36 -5
- package/hooks/lib/nightly-stage.mjs +66 -0
- package/hooks/lib/nightly-tools.sh +45 -0
- package/hooks/lib/pre-pr.mjs +88 -17
- package/hooks/lib/proof-tool-pins.json +12 -0
- package/hooks/lib/replay.mjs +579 -0
- package/hooks/lib/resync.mjs +78 -0
- package/hooks/lib/setup.mjs +15 -6
- package/hooks/lib/snapshot.mjs +189 -0
- package/hooks/session-start.mjs +7 -3
- package/package.json +1 -1
- package/skills/bravos/SKILL.md +2 -1
- package/skills/bravos-annotate/SKILL.md +6 -5
- package/skills/bravos-annotate/scripts/slice.mjs +15 -8
- package/skills/bravos-cicd/SKILL.md +1 -1
- package/skills/bravos-env/SKILL.md +3 -3
- package/skills/bravos-prove/SKILL.md +11 -15
- package/skills/bravos-recheck/SKILL.md +3 -3
- package/skills/bravos-report/SKILL.md +1 -1
- package/skills/bravos-resync/SKILL.md +52 -0
- package/skills/bravos-schedule/SKILL.md +1 -1
- package/skills/bravos-ship/SKILL.md +1 -1
- package/skills/bravos-templatize/SKILL.md +3 -3
- package/templates/workflows/bravos-nightly-claude.yml +131 -74
- package/templates/workflows/bravos-nightly-codex.yml +130 -73
- package/templates/workflows/bravos-pr-gate.yml +88 -14
package/dist/resync.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// @comment -- "bravos resync: carries GuardLink annotation work from another branch or commit (sidecars, external mode) onto this checkout, mechanically and with no model: copies the sidecars whose source file still exists and that this checkout lacks, appends the definitions they reference and this checkout does not define (flagging ones that look like an existing id under another name), then with --apply reanchors and validates, and reports what moved, what lost its symbol and which files changed since the claims were written. A dry run unless --apply; never merges two sidecars, never deletes, never touches the source branch. Inline mode copies nothing and points at merge or cherry-pick. --list prints local branches carrying annotation work their base lacks."
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { pathToFileURL } from 'node:url';
|
|
6
|
+
import { hooksDir } from './paths.js';
|
|
7
|
+
import { BravosError } from './types.js';
|
|
8
|
+
export const SIDECAR_DIR = '.guardlink/annotations/';
|
|
9
|
+
export const RESYNC_RECORD = '.bravos/resync/last.json';
|
|
10
|
+
// @comment -- "Read-only git over argv (no shell): stdout, or null on any failure or non-zero exit. Output is capped generously because ls-tree and show of a large definitions file can be big."
|
|
11
|
+
function gitIn(root, env) {
|
|
12
|
+
return (args) => {
|
|
13
|
+
const r = spawnSync('git', args, { cwd: root, env, encoding: 'utf8', timeout: 30000, maxBuffer: 256 * 1024 * 1024, stdio: ['ignore', 'pipe', 'ignore'] });
|
|
14
|
+
return r.error || r.status !== 0 ? null : r.stdout;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// @comment -- "Runs guardlink over argv with a long timeout and returns its exit status and combined output; a missing guardlink reads as status null, which the report states rather than failing."
|
|
18
|
+
function guardlink(root, env, args) {
|
|
19
|
+
const r = spawnSync('guardlink', args, { cwd: root, env, encoding: 'utf8', timeout: 300000, maxBuffer: 256 * 1024 * 1024, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
20
|
+
if (r.error)
|
|
21
|
+
return { status: null, out: '' };
|
|
22
|
+
return { status: r.status, out: `${r.stdout ?? ''}\n${r.stderr ?? ''}` };
|
|
23
|
+
}
|
|
24
|
+
// @comment -- "Option-injection guard: --from reaches git as an argument, so a value beginning with '-' (e.g. --output=…) is refused before any git call, and the ref must resolve to a commit."
|
|
25
|
+
export function assertRef(ref) {
|
|
26
|
+
if (typeof ref !== 'string' || ref.length === 0 || ref.startsWith('-') || /[\0\n]/.test(ref)) {
|
|
27
|
+
throw new BravosError(`bravos resync: --from needs a branch or commit name (got "${ref}")`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Definitions declared on lines of a definitions file: `@asset Name (#id)`, `@threat …`, `@control …`, `@actor …`. */
|
|
31
|
+
// @comment -- "Pure parser for one-line GuardLink declarations (@asset, @threat, @control, @actor with a (#id)), keeping the raw line so it can be carried verbatim; the CWE is read from a cwe:CWE-n token when present."
|
|
32
|
+
export function parseDefinitions(text) {
|
|
33
|
+
const out = [];
|
|
34
|
+
for (const line of text.split('\n')) {
|
|
35
|
+
const m = /@(asset|threat|control|actor)\s+(\S+)\s*\(#([A-Za-z0-9][\w.-]*)\)/.exec(line);
|
|
36
|
+
if (!m)
|
|
37
|
+
continue;
|
|
38
|
+
const cwe = /cwe:(CWE-\d+)/i.exec(line);
|
|
39
|
+
out.push({ kind: m[1], name: m[2], id: m[3], cwe: cwe ? cwe[1].toUpperCase() : null, line: line.trimEnd() });
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
/** The #ids a sidecar's annotation lines reference, outside their quoted descriptions. */
|
|
44
|
+
// @comment -- "Pure extractor: for each @ line other than @source and @comment, the #ids before its ` -- \"` description, so a # inside prose is never mistaken for a reference; a parenthesised (#id), which names the annotation itself, is skipped."
|
|
45
|
+
export function referencedIds(sidecar) {
|
|
46
|
+
const ids = new Set();
|
|
47
|
+
for (const raw of sidecar.split('\n')) {
|
|
48
|
+
const line = raw.trim();
|
|
49
|
+
if (!line.startsWith('@') || line.startsWith('@source') || line.startsWith('@comment'))
|
|
50
|
+
continue;
|
|
51
|
+
// A parenthesised (#id) names the annotation itself (a @boundary's own id): a declaration, not a reference.
|
|
52
|
+
const head = line.split(' -- "')[0].replace(/\(#[A-Za-z0-9][\w.-]*\)/g, '');
|
|
53
|
+
for (const m of head.matchAll(/#([A-Za-z0-9][\w.-]*)/g))
|
|
54
|
+
ids.add(m[1]);
|
|
55
|
+
}
|
|
56
|
+
return ids;
|
|
57
|
+
}
|
|
58
|
+
const norm = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
59
|
+
/** Existing definitions that look like the same thing as `d`: same kind, and the same CWE or the same normalized name. */
|
|
60
|
+
// @comment -- "Pure duplicate heuristic for a carried definition: an existing one of the same kind with the same CWE, or whose name or id normalizes the same; only ever a suggestion for a person or agent to map."
|
|
61
|
+
export function duplicatesOf(d, existing) {
|
|
62
|
+
return existing
|
|
63
|
+
.filter((e) => e.kind === d.kind && e.id !== d.id && ((d.cwe && e.cwe === d.cwe) || norm(e.name) === norm(d.name) || norm(e.id) === norm(d.id)))
|
|
64
|
+
.map((e) => e.id);
|
|
65
|
+
}
|
|
66
|
+
function readConfig(root) {
|
|
67
|
+
try {
|
|
68
|
+
const c = JSON.parse(readFileSync(join(root, '.guardlink', 'config.json'), 'utf8'));
|
|
69
|
+
return { mode: c?.annotation_mode === 'external' ? 'external' : 'inline', definitions: typeof c?.definitions === 'string' ? c.definitions : 'definitions.ts' };
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return { mode: 'inline', definitions: 'definitions.ts' };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function coverage(root, env) {
|
|
76
|
+
const r = guardlink(root, env, ['ci', '-f', 'json']);
|
|
77
|
+
try {
|
|
78
|
+
const c = JSON.parse(r.out.slice(r.out.indexOf('{'), r.out.lastIndexOf('}') + 1))?.summary?.coverage;
|
|
79
|
+
return c ? { annotated_files: c.annotated_files, source_files: c.source_files, annotations: c.annotations } : null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Sidecars `guardlink reanchor` reports by kind: { moved: [...], symbol_gone: [...] }. */
|
|
86
|
+
// @comment -- "Pure parser for guardlink reanchor's text report: each [kind] `sidecar` line, grouped by kind."
|
|
87
|
+
export function parseReanchor(out) {
|
|
88
|
+
const by = {};
|
|
89
|
+
for (const m of out.matchAll(/\[(moved|symbol_gone|line_gone|file_gone)\] `([^`]+)`/g))
|
|
90
|
+
(by[m[1]] ??= []).push(m[2]);
|
|
91
|
+
return by;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Plans (and with apply, performs) carrying annotation work from `from` onto the checkout at `root`.
|
|
95
|
+
*/
|
|
96
|
+
// @comment -- "The resync pipeline: resolve the ref, classify its sidecars against this checkout, gather missing definitions and duplicate suggestions, then with apply write sidecars and a marked definitions block, reanchor, validate and measure coverage; the report is also saved to .bravos/resync/last.json (ignored scratch) for the bravos-resync skill. Writes only under .guardlink/ and .bravos/resync/, and only with apply."
|
|
97
|
+
export function resync(root, from, opts = {}) {
|
|
98
|
+
const env = opts.env ?? process.env;
|
|
99
|
+
assertRef(from);
|
|
100
|
+
const git = gitIn(root, env);
|
|
101
|
+
const sha = git(['rev-parse', '--verify', '--quiet', `${from}^{commit}`])?.trim();
|
|
102
|
+
if (!sha)
|
|
103
|
+
throw new BravosError(`bravos resync: ${from} is not a branch or commit in this repository`);
|
|
104
|
+
const head = git(['rev-parse', 'HEAD'])?.trim();
|
|
105
|
+
if (head === sha)
|
|
106
|
+
throw new BravosError(`bravos resync: ${from} is this checkout's own commit; check out the branch you want to carry the work onto first`);
|
|
107
|
+
const { mode, definitions } = readConfig(root);
|
|
108
|
+
const commitsNotHere = Number(git(['rev-list', '--count', `HEAD..${sha}`])?.trim() ?? 0);
|
|
109
|
+
const report = {
|
|
110
|
+
schema: 'bravos.resync/v1', from, sha, mode, applied: false,
|
|
111
|
+
copied: [], both: [], same: 0, sourceGone: [],
|
|
112
|
+
definitionsCarried: [], definitionsMissing: [], possibleDuplicates: [], changedSince: [],
|
|
113
|
+
reanchored: null, symbolGone: [], validate: null, coverage: { before: null, after: null },
|
|
114
|
+
commitsNotHere, note: null,
|
|
115
|
+
};
|
|
116
|
+
if (mode === 'inline') {
|
|
117
|
+
report.note = `inline mode: annotations live in source comments, so they travel with code. Bring the ${commitsNotHere} commit(s) on ${from} over with git merge or git cherry-pick, then run guardlink validate and bravos-resync's re-read step.`;
|
|
118
|
+
return save(root, report, false);
|
|
119
|
+
}
|
|
120
|
+
const listed = (git(['ls-tree', '-r', '--name-only', sha, '--', SIDECAR_DIR]) ?? '').split('\n').filter((f) => f.endsWith('.gal'));
|
|
121
|
+
const carried = new Map();
|
|
122
|
+
for (const f of listed) {
|
|
123
|
+
const src = f.slice(SIDECAR_DIR.length, -'.gal'.length);
|
|
124
|
+
if (!existsSync(join(root, src))) {
|
|
125
|
+
report.sourceGone.push(src);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const theirs = git(['show', `${sha}:${f}`]);
|
|
129
|
+
if (theirs === null)
|
|
130
|
+
continue;
|
|
131
|
+
if (existsSync(join(root, f))) {
|
|
132
|
+
if (readFileSync(join(root, f), 'utf8') === theirs)
|
|
133
|
+
report.same++;
|
|
134
|
+
else
|
|
135
|
+
report.both.push(f);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
carried.set(f, theirs);
|
|
139
|
+
report.copied.push(f);
|
|
140
|
+
// Changed since: the source file here differs from the one the claims were written against.
|
|
141
|
+
const diff = spawnSync('git', ['diff', '--quiet', sha, '--', src], { cwd: root, env, stdio: 'ignore', timeout: 30000 });
|
|
142
|
+
if (diff.status === 1)
|
|
143
|
+
report.changedSince.push(src);
|
|
144
|
+
}
|
|
145
|
+
const defsRel = join('.guardlink', definitions);
|
|
146
|
+
const ours = existsSync(join(root, defsRel)) ? parseDefinitions(readFileSync(join(root, defsRel), 'utf8')) : [];
|
|
147
|
+
const theirsDefs = parseDefinitions(git(['show', `${sha}:${defsRel}`]) ?? '');
|
|
148
|
+
const known = new Set(ours.map((d) => d.id));
|
|
149
|
+
const needed = new Set();
|
|
150
|
+
for (const text of carried.values())
|
|
151
|
+
for (const id of referencedIds(text))
|
|
152
|
+
if (!known.has(id))
|
|
153
|
+
needed.add(id);
|
|
154
|
+
const carriedDefs = [];
|
|
155
|
+
for (const id of [...needed].sort()) {
|
|
156
|
+
const d = theirsDefs.find((x) => x.id === id);
|
|
157
|
+
if (!d) {
|
|
158
|
+
report.definitionsMissing.push(id);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
carriedDefs.push(d);
|
|
162
|
+
report.definitionsCarried.push(id);
|
|
163
|
+
const dup = duplicatesOf(d, ours);
|
|
164
|
+
if (dup.length)
|
|
165
|
+
report.possibleDuplicates.push({ id, kind: d.kind, candidates: dup });
|
|
166
|
+
}
|
|
167
|
+
if (!opts.apply)
|
|
168
|
+
return save(root, report, false);
|
|
169
|
+
report.coverage.before = coverage(root, env);
|
|
170
|
+
const before = parseReanchor(guardlink(root, env, ['reanchor', '.']).out);
|
|
171
|
+
for (const [f, text] of carried) {
|
|
172
|
+
mkdirSync(dirname(join(root, f)), { recursive: true });
|
|
173
|
+
writeFileSync(join(root, f), text);
|
|
174
|
+
}
|
|
175
|
+
if (carriedDefs.length) {
|
|
176
|
+
const block = ['', `// ─── carried from ${from}@${sha.slice(0, 12)} by bravos resync (map possible duplicates, then drop them here) ───`, ...carriedDefs.map((d) => d.line), ''].join('\n');
|
|
177
|
+
const path = join(root, defsRel);
|
|
178
|
+
const existing = existsSync(path) ? readFileSync(path, 'utf8') : '';
|
|
179
|
+
writeFileSync(path, existing.replace(/\n*$/, '\n') + block);
|
|
180
|
+
}
|
|
181
|
+
const moved = parseReanchor(guardlink(root, env, ['reanchor', '.']).out).moved ?? [];
|
|
182
|
+
const apply = guardlink(root, env, ['reanchor', '.', '--apply']);
|
|
183
|
+
if (apply.status !== null) {
|
|
184
|
+
const copiedSet = new Set(report.copied);
|
|
185
|
+
const existingMoved = new Set(before.moved ?? []);
|
|
186
|
+
report.reanchored = { carried: moved.filter((f) => copiedSet.has(f)).length, existing: moved.filter((f) => existingMoved.has(f)).length };
|
|
187
|
+
report.symbolGone = [...new Set(parseReanchor(guardlink(root, env, ['reanchor', '.']).out).symbol_gone ?? [])].filter((f) => copiedSet.has(f));
|
|
188
|
+
const v = guardlink(root, env, ['validate', '.']);
|
|
189
|
+
const counts = /(\d+) error\(s\), (\d+) warning\(s\)/.exec(v.out);
|
|
190
|
+
report.validate = counts ? { errors: Number(counts[1]), warnings: Number(counts[2]) } : null;
|
|
191
|
+
report.coverage.after = coverage(root, env);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
report.note = 'guardlink not found on PATH: sidecars and definitions were written, but nothing was reanchored or validated; install guardlink and run guardlink reanchor . --apply';
|
|
195
|
+
}
|
|
196
|
+
report.applied = true;
|
|
197
|
+
return save(root, report, true);
|
|
198
|
+
}
|
|
199
|
+
// @comment -- "Saves the report to .bravos/resync/last.json, with a .gitignore of * beside it so the scratch never reaches git; a failure to save never fails the resync."
|
|
200
|
+
function save(root, report, _applied) {
|
|
201
|
+
try {
|
|
202
|
+
const dir = join(root, dirname(RESYNC_RECORD));
|
|
203
|
+
mkdirSync(dir, { recursive: true });
|
|
204
|
+
if (!existsSync(join(dir, '.gitignore')))
|
|
205
|
+
writeFileSync(join(dir, '.gitignore'), '*\n');
|
|
206
|
+
writeFileSync(join(root, RESYNC_RECORD), JSON.stringify(report, null, 2) + '\n');
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
/* the record is a convenience for the skill */
|
|
210
|
+
}
|
|
211
|
+
return report;
|
|
212
|
+
}
|
|
213
|
+
/** Report lines for a person. */
|
|
214
|
+
// @comment -- "Formats a ResyncReport as plain lines: what would be (or was) carried, what needs a person, and the next step."
|
|
215
|
+
export function formatReport(r) {
|
|
216
|
+
const verb = r.applied ? 'carried' : 'would carry';
|
|
217
|
+
const lines = [`bravos resync from ${r.from} (${r.sha.slice(0, 12)}), ${r.mode} mode${r.applied ? '' : ' — dry run, nothing written'}`];
|
|
218
|
+
if (r.note)
|
|
219
|
+
lines.push(r.note);
|
|
220
|
+
if (r.mode === 'inline')
|
|
221
|
+
return lines;
|
|
222
|
+
lines.push(`Sidecars: ${verb} ${r.copied.length} · already here ${r.same} · both have differing sidecars ${r.both.length} · source file gone ${r.sourceGone.length}`);
|
|
223
|
+
lines.push(`Definitions: ${verb} ${r.definitionsCarried.length}${r.definitionsMissing.length ? ` · referenced but defined nowhere ${r.definitionsMissing.length} (${r.definitionsMissing.slice(0, 5).join(', ')})` : ''}`);
|
|
224
|
+
if (r.possibleDuplicates.length) {
|
|
225
|
+
lines.push(`Possible duplicates to map onto this checkout's ids (${r.possibleDuplicates.length}):`);
|
|
226
|
+
for (const d of r.possibleDuplicates.slice(0, 10))
|
|
227
|
+
lines.push(` #${d.id} (${d.kind}) ~ ${d.candidates.map((c) => `#${c}`).join(', ')}`);
|
|
228
|
+
if (r.possibleDuplicates.length > 10)
|
|
229
|
+
lines.push(` … and ${r.possibleDuplicates.length - 10} more (in ${RESYNC_RECORD})`);
|
|
230
|
+
}
|
|
231
|
+
lines.push(`Changed since the claims were written: ${r.changedSince.length} file(s); re-read their annotations against today's code`);
|
|
232
|
+
if (r.both.length)
|
|
233
|
+
lines.push(`Both sides annotate ${r.both.length} file(s); not merged: ${r.both.slice(0, 3).join(', ')}${r.both.length > 3 ? ' …' : ''}`);
|
|
234
|
+
if (r.applied) {
|
|
235
|
+
if (r.reanchored)
|
|
236
|
+
lines.push(`Reanchored: ${r.reanchored.carried} carried sidecar(s), plus ${r.reanchored.existing} that had already drifted here`);
|
|
237
|
+
if (r.symbolGone.length)
|
|
238
|
+
lines.push(`Symbol gone (rewrite or drop): ${r.symbolGone.length} — ${r.symbolGone.slice(0, 3).join(', ')}${r.symbolGone.length > 3 ? ' …' : ''}`);
|
|
239
|
+
if (r.validate)
|
|
240
|
+
lines.push(`guardlink validate: ${r.validate.errors} error(s), ${r.validate.warnings} warning(s)`);
|
|
241
|
+
const c = (x) => (x ? `${x.annotated_files}/${x.source_files} files, ${x.annotations} annotations` : 'unknown');
|
|
242
|
+
lines.push(`Coverage: ${c(r.coverage.before)} → ${c(r.coverage.after)}`);
|
|
243
|
+
lines.push('Next: bravos-resync maps the duplicates, re-reads the changed files and drops what lost its code; nothing here is verified.');
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
lines.push(`Next: bravos resync --from ${r.from} --apply`);
|
|
247
|
+
}
|
|
248
|
+
lines.push(`Details: ${RESYNC_RECORD}`);
|
|
249
|
+
return lines;
|
|
250
|
+
}
|
|
251
|
+
/** Stranded annotation work and the checkout's own staleness, from the hooks' shared helper. */
|
|
252
|
+
// @comment -- "bravos resync --list: the checkout's staleness against its base and the idle local branches carrying .guardlink/ work the base lacks, using hooks/lib/resync.mjs (the same answer the session briefing gives)."
|
|
253
|
+
export async function listStranded(root, env = process.env) {
|
|
254
|
+
const lib = await import(pathToFileURL(join(hooksDir(), 'lib', 'resync.mjs')).href);
|
|
255
|
+
const g = gitIn(root, env);
|
|
256
|
+
const git = async (args) => g(args)?.trim() ?? null;
|
|
257
|
+
const base = (await git(['symbolic-ref', '-q', '--short', 'refs/remotes/origin/HEAD'])) || 'origin/main';
|
|
258
|
+
const branchRef = await git(['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
259
|
+
const branch = branchRef && branchRef !== 'HEAD' ? branchRef : null;
|
|
260
|
+
const stale = lib.staleness({ ...(await lib.gitStaleness(git, base)), branch, base });
|
|
261
|
+
const stranded = await lib.strandedBranches(git, base, { current: branch });
|
|
262
|
+
const lines = [];
|
|
263
|
+
lines.push(stale ? lib.staleLine(stale, { branch, base }) : `This checkout${branch ? ` (${branch})` : ''} is current with ${base} (as of last fetch).`);
|
|
264
|
+
if (stranded.length === 0)
|
|
265
|
+
lines.push(`No idle local branch carries annotation work that ${base} lacks.`);
|
|
266
|
+
else {
|
|
267
|
+
lines.push(`Idle branches with annotation work not on ${base}:`);
|
|
268
|
+
for (const s of stranded)
|
|
269
|
+
lines.push(` ${s.branch}: ${s.files} .guardlink/ file(s) — bravos resync --from ${s.branch}`);
|
|
270
|
+
}
|
|
271
|
+
return lines;
|
|
272
|
+
}
|
package/dist/setup.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @comment -- "bravos setup: puts the binaries bravos drives onto this machine. The analyzer and the code graph are licensed bundles fetched through the account portal (artifacts.ts); guardlink and cxg are free CLIs installed with their own package managers. --check reports without changing anything, --dry-run says what would run, and nothing is fetched or installed without a licence for it. Also the SAST runner: `bravos sast run` invokes the staged analyzer with the argv the Python CLI used and writes the run folder the briefing and `bravos sast` read."
|
|
2
|
+
import { checkProofTool, formatProofTool } from './proof-tools.js';
|
|
2
3
|
import { spawnSync } from 'node:child_process';
|
|
3
4
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import { join } from 'node:path';
|
|
@@ -8,7 +9,8 @@ import { whichBin } from './guardlink.js';
|
|
|
8
9
|
import { findAnalyzer } from './graphbin.js';
|
|
9
10
|
import { licenceLib, requireFeature } from './licence.js';
|
|
10
11
|
import { BravosError } from './types.js';
|
|
11
|
-
import {
|
|
12
|
+
import { PROOF_TOOL_PINS } from './versions.js';
|
|
13
|
+
import { installProofTool, proofToolAction } from './install-proof-tool.js';
|
|
12
14
|
// @comment -- "What is here and what setup would do, read-only: for each piece its path when present, the pinned version, whether the licence covers it, and the one action."
|
|
13
15
|
export async function plan(env) {
|
|
14
16
|
const L = await licenceLib();
|
|
@@ -19,18 +21,29 @@ export async function plan(env) {
|
|
|
19
21
|
const items = [
|
|
20
22
|
{ id: 'analyzer', present: staged(env, 'analyzer') ?? findAnalyzer(env), wanted: VERSIONS.analyzer, licensed: sast, action: !t ? 'no build for this platform' : sast ? 'fetch, verify and stage the analyzer bundle' : 'on the Team plan: bravos account activate' },
|
|
21
23
|
{ id: 'codegraph', present: staged(env, 'codegraph') ?? graphBin('codegraph-build', env), wanted: VERSIONS.codegraph, licensed: graph, action: !t ? 'no build for this platform' : graph ? 'fetch, verify and stage codegraph-build and codegraph-mcp' : 'on the Team plan: bravos account activate' },
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
...['guardlink', 'cxg'].map(id => ({
|
|
25
|
+
id, present: whichBin(id, env), wanted: PROOF_TOOL_PINS[id].revision ?? PROOF_TOOL_PINS[id].version,
|
|
26
|
+
licensed: null, action: proofToolAction(id), proofTool: checkProofTool(id, env),
|
|
27
|
+
})),
|
|
24
28
|
];
|
|
25
29
|
return { items, licence: v };
|
|
26
30
|
}
|
|
27
|
-
export const formatPlan = (items) => items.map(
|
|
31
|
+
export const formatPlan = (items) => items.map(i => {
|
|
32
|
+
if (i.present && i.proofTool && i.proofTool.status !== 'ready') {
|
|
33
|
+
return '✘ ' + i.id.padEnd(10) + ' ' + i.present + ' (' + i.proofTool.status + ') — ' + i.action;
|
|
34
|
+
}
|
|
35
|
+
const status = i.present ? i.present : 'absent — ' + i.action;
|
|
36
|
+
return (i.present ? '✔ ' : '✘ ') + i.id.padEnd(10) + ' ' + status + (i.present && i.licensed === false ? ' (licence does not cover it now)' : '');
|
|
37
|
+
});
|
|
28
38
|
// @comment -- "The setup itself. Default: the two licensed bundles for a licensed machine; --tools adds guardlink and cxg; --analyzer/--codegraph narrow it. Each licensed piece passes the gate before the first request. --dry-run prints the actions; -y is required for the package-manager installs because they run other people's installers."
|
|
29
39
|
export async function runSetup(env, opts, io) {
|
|
30
40
|
const lines = [];
|
|
31
41
|
const { items } = await plan(env);
|
|
32
42
|
if (opts.check) {
|
|
33
43
|
lines.push(...formatPlan(items));
|
|
44
|
+
for (const item of items)
|
|
45
|
+
if (item.proofTool)
|
|
46
|
+
lines.push(formatProofTool(item.proofTool));
|
|
34
47
|
return lines;
|
|
35
48
|
}
|
|
36
49
|
const pick = opts.analyzer || opts.codegraph || opts.tools ? { analyzer: !!opts.analyzer, codegraph: !!opts.codegraph, tools: !!opts.tools } : { analyzer: true, codegraph: true, tools: false };
|
|
@@ -53,23 +66,25 @@ export async function runSetup(env, opts, io) {
|
|
|
53
66
|
lines.push(...selfTest(kind, r.dir, env));
|
|
54
67
|
}
|
|
55
68
|
if (pick.tools) {
|
|
56
|
-
for (const i of items
|
|
57
|
-
if (i.
|
|
58
|
-
|
|
69
|
+
for (const i of items) {
|
|
70
|
+
if (i.id !== 'guardlink' && i.id !== 'cxg')
|
|
71
|
+
continue;
|
|
72
|
+
const check = i.proofTool;
|
|
73
|
+
if (!check)
|
|
74
|
+
throw new BravosError(i.id + ': capability check is unavailable');
|
|
75
|
+
if (i.present && check.status === 'ready') {
|
|
76
|
+
lines.push(formatProofTool(check), i.id + ': already compatible at ' + i.present);
|
|
59
77
|
continue;
|
|
60
78
|
}
|
|
61
79
|
if (opts.dryRun || !opts.yes) {
|
|
62
|
-
|
|
80
|
+
const state = i.present ? check.status + ' at ' + i.present : 'absent';
|
|
81
|
+
lines.push(i.id + ': ' + state + ' — ' + i.action + (opts.yes ? '' : ' (add -y to run it here)'));
|
|
63
82
|
continue;
|
|
64
83
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (r.status !== 0)
|
|
70
|
-
throw new BravosError(`${cmd} failed (exit ${r.status}): ${(r.stderr || r.stdout || '').trim().split('\n').slice(-3).join(' ')}`);
|
|
71
|
-
}
|
|
72
|
-
lines.push(`${i.id}: installed`);
|
|
84
|
+
const path = installProofTool(i.id, env, io.echo);
|
|
85
|
+
lines.push(i.id + ': installed and verified on PATH at ' + path);
|
|
86
|
+
if (i.id === 'cxg')
|
|
87
|
+
lines.push('Browser replay also needs the CXG Python requirements and Playwright Chromium for the selected Python environment.');
|
|
73
88
|
}
|
|
74
89
|
}
|
|
75
90
|
return lines;
|
package/dist/start/answers.js
CHANGED
|
@@ -6,7 +6,7 @@ export const PRESETS = {
|
|
|
6
6
|
pr: { label: 'Map threats and check every pull request', hint: 'no AI key needed', pr: 'hook+github', autopilot: false, schedule: 'none', proving: 'ask' },
|
|
7
7
|
everything: { label: 'Everything: annotations, PR checks and scheduled testing', hint: 'weekly nightly run, autopilot on', pr: 'hook+github', autopilot: true, schedule: 'weekly', proving: 'ask' },
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
9
|
+
/** Pricing for optional CXG model generation. */
|
|
10
10
|
export const PENTEST_COST_URL = 'https://bugb.io/pricing#pentest-cost';
|
|
11
11
|
/** The bravos init arguments these answers amount to (the review step prints them). */
|
|
12
12
|
// @comment -- "The init flags for the chosen answers: agents, the pre-PR hook, autopilot, which workflows and the nightly cadence, and the loopback scope starter when testing is on"
|
|
@@ -36,16 +36,18 @@ export function nightlySecrets(a) {
|
|
|
36
36
|
}
|
|
37
37
|
// @comment -- "proving.md in the exact form the prove skill and the briefing read: choice, generation, the person's own words quoted, and confirmed by their name and the date. Setup records no target or start command: the agent finds how the app starts and where it listens (loopback only) when it tests, and writes them then."
|
|
38
38
|
export function provingText(a, date) {
|
|
39
|
-
const quoted = a.words.trim().replace(/\s+/g, ' ').replace(/"/g, "'");
|
|
40
39
|
return [
|
|
41
40
|
'# How findings are proven',
|
|
42
41
|
'',
|
|
43
42
|
'Recorded by `bravos start` from the answers below. Edit it, or run `bravos start --again`, to change it.',
|
|
44
43
|
'',
|
|
45
44
|
`choice: ${a.proving}`,
|
|
45
|
+
...(a.proving === 'auto' ? [`kits: ${a.kitPolicy ?? 'reviewed'}`] : []),
|
|
46
46
|
`generation: ${a.generation ? 'yes' : 'no'}`,
|
|
47
47
|
'',
|
|
48
|
-
|
|
48
|
+
// Automatic tests need the one local app they may contact; the agent finds it (bravos-env) and a person merges it.
|
|
49
|
+
...(a.proving === 'auto' ? ['Automatic tests start once a `target: http://localhost:<port>/` line naming your local app is added here and merged to the default branch (bravos-env does this with you).', ''] : []),
|
|
50
|
+
JSON.stringify(a.words.trim()),
|
|
49
51
|
'',
|
|
50
52
|
`— confirmed by ${a.name.trim()}, ${date}`,
|
|
51
53
|
'',
|
package/dist/start/index.js
CHANGED
|
@@ -70,7 +70,7 @@ async function flow(opts, d) {
|
|
|
70
70
|
p.warn(`The old Python bravos at ${shadow} may run instead of this one. Rename it: mv ${shadow} ${shadow}-py`);
|
|
71
71
|
}
|
|
72
72
|
const has = (s, f) => !!s.lic?.unlocked.includes(f);
|
|
73
|
-
const missingTools = (s) => (s.items ?? []).filter((i) => (i.id === 'guardlink' || i.id === 'cxg') && !i.present);
|
|
73
|
+
const missingTools = (s) => (s.items ?? []).filter((i) => (i.id === 'guardlink' || i.id === 'cxg') && (!i.present || (i.proofTool && i.proofTool.status !== 'ready')));
|
|
74
74
|
const missingBundles = (s) => (s.items ?? []).filter((i) => (i.id === 'analyzer' || i.id === 'codegraph') && !i.present && i.licensed);
|
|
75
75
|
const steps = [
|
|
76
76
|
// theme
|
|
@@ -110,7 +110,11 @@ async function flow(opts, d) {
|
|
|
110
110
|
// tools
|
|
111
111
|
async (s) => {
|
|
112
112
|
s.items = (await d.setupPlan()).items;
|
|
113
|
-
p.note(s.items.map((i) =>
|
|
113
|
+
p.note(s.items.map((i) => {
|
|
114
|
+
if (i.present && i.proofTool && i.proofTool.status !== 'ready')
|
|
115
|
+
return `✗ ${i.id.padEnd(10)} ${i.present} needs a compatible build for ${i.proofTool.capability}`;
|
|
116
|
+
return `${i.present ? '✔' : '✗'} ${i.id.padEnd(10)} ${i.present ? 'installed' : i.licensed === false ? 'Team plan' : `missing — ${i.action}`}`;
|
|
117
|
+
}).join('\n'), 'Tools');
|
|
114
118
|
const missing = [...missingTools(s), ...missingBundles(s)];
|
|
115
119
|
s.installTools = false;
|
|
116
120
|
if (!missing.length)
|
|
@@ -192,7 +196,7 @@ async function flow(opts, d) {
|
|
|
192
196
|
s.autopilot = false;
|
|
193
197
|
return;
|
|
194
198
|
}
|
|
195
|
-
s.autopilot = await p.confirm('autopilot', '
|
|
199
|
+
s.autopilot = await p.confirm('autopilot', 'Review changed code at the end of each agent turn? Autopilot asks the agent to update relevant claims and follows your testing preference.', s.autopilot ?? saved?.autopilot ?? (s.preset === 'pr' && !opts.yes ? true : PRESETS[s.preset].autopilot));
|
|
196
200
|
},
|
|
197
201
|
// scheduled run (GitHub Actions)
|
|
198
202
|
async (s) => {
|
|
@@ -202,7 +206,7 @@ async function flow(opts, d) {
|
|
|
202
206
|
s.schedule = 'none';
|
|
203
207
|
return;
|
|
204
208
|
}
|
|
205
|
-
p.info('A scheduled run has an agent annotate
|
|
209
|
+
p.info('A scheduled run has an agent annotate the next slice on GitHub. The Claude Code and Codex workflows also support authorized probe replay. Claude Code signs in there with your Claude plan and GitHub Copilot uses your Copilot plan, like a session would; Codex needs an OpenAI API key. The PR check uses no AI.');
|
|
206
210
|
s.schedule = await p.select('schedule', 'Run Bravos on a schedule in GitHub Actions?', [
|
|
207
211
|
{ value: 'none', label: 'No schedule', hint: 'no sign-in needed' },
|
|
208
212
|
{ value: 'weekly', label: 'Once a week', hint: 'Sunday night; the cheapest', recommended: true },
|
|
@@ -229,22 +233,27 @@ async function flow(opts, d) {
|
|
|
229
233
|
}
|
|
230
234
|
const choices = [
|
|
231
235
|
{ value: 'ask', label: 'Ask me every time before testing', recommended: true },
|
|
232
|
-
{ value: 'auto', label: 'Test my local app
|
|
233
|
-
|
|
236
|
+
{ value: 'auto', label: 'Test my local app as I build', hint: 'includes scoped tests written by this agent' },
|
|
237
|
+
{ value: 'auto-reviewed', label: 'Automatically replay reviewed kits only', hint: 'uses the tested kit version on the default branch' },
|
|
238
|
+
...(s.schedule !== 'none' && s.nightlyAgent !== 'copilot' ? [{ value: 'schedule', label: 'Only in the scheduled run' }] : []),
|
|
234
239
|
{ value: 'none', label: 'Never test, just annotate' },
|
|
235
240
|
];
|
|
236
241
|
p.info('Bravos only tests apps you own, on localhost; your agent finds how to start the app when it tests. Anything else needs a reviewed scope file and your own typed authorization at that time; setup never fills that in.');
|
|
237
|
-
const
|
|
238
|
-
|
|
242
|
+
const previous = s.proving ?? saved?.proving ?? PRESETS[s.preset].proving;
|
|
243
|
+
const previousKits = s.kitPolicy ?? saved?.kitPolicy ?? (saved?.generation === false ? 'reviewed' : 'session');
|
|
244
|
+
const want = previous === 'auto' && previousKits === 'reviewed' ? 'auto-reviewed' : previous;
|
|
245
|
+
const choice = await p.select('proving', 'How should Bravos handle testing?', choices, choices.some((c) => c.value === want) ? want : 'ask');
|
|
246
|
+
s.proving = choice === 'auto-reviewed' ? 'auto' : choice;
|
|
247
|
+
s.kitPolicy = choice === 'auto-reviewed' ? 'reviewed' : 'session';
|
|
239
248
|
},
|
|
240
|
-
//
|
|
249
|
+
// Optional external generation is separate from replaying harness-authored tests.
|
|
241
250
|
async (s) => {
|
|
242
251
|
if (s.proving === 'none') {
|
|
243
252
|
s.generation = false;
|
|
244
253
|
return;
|
|
245
254
|
}
|
|
246
|
-
p.info(`
|
|
247
|
-
s.generation = await p.confirm('generation', '
|
|
255
|
+
p.info(`Your coding agent can write tests in this session. Optional CXG model generation spends additional credits. See ${PENTEST_COST_URL}`);
|
|
256
|
+
s.generation = await p.confirm('generation', 'Allow CXG to generate additional probes through a paid model API?', s.generation ?? saved?.generation ?? false, { yes: 'Allow model API spend', no: 'Use the current agent and supplied tests', recommend: false });
|
|
248
257
|
},
|
|
249
258
|
// the person's own words
|
|
250
259
|
async (s) => {
|
|
@@ -333,7 +342,7 @@ async function flow(opts, d) {
|
|
|
333
342
|
...(answers.schedule !== 'none' ? [` + .github/workflows/bravos-nightly-${answers.nightlyAgent}.yml (${answers.schedule}, cron ${CRON[answers.schedule]} UTC)`] : []),
|
|
334
343
|
...(answers.schedule !== 'none' && answers.nightlyAgent === 'copilot' ? [' + .github/workflows/copilot-setup-steps.yml (prepares Copilot\'s session: Node and guardlink)'] : []),
|
|
335
344
|
...(answers.proving !== 'none' ? [' + .guardlink/scope.yaml (localhost only; authorization left for you)'] : []),
|
|
336
|
-
...(answers.name ? [` + .guardlink/proving.md (${answers.proving}${answers.generation ? ',
|
|
345
|
+
...(answers.name ? [` + .guardlink/proving.md (${answers.proving}${answers.generation ? ', model API generation allowed' : ''}, confirmed by ${answers.name})`] : []),
|
|
337
346
|
...(Object.keys(s.secrets).length ? [` + GitHub secrets: ${Object.keys(s.secrets).join(', ')}`] : []),
|
|
338
347
|
' + .bravos/setup.json (your answers, for bravos start --again)',
|
|
339
348
|
...(has(s, 'codegraph') ? ['Then: build the code graph for this repository'] : []),
|
|
@@ -382,6 +391,7 @@ function toAnswers(s) {
|
|
|
382
391
|
schedule: s.schedule ?? 'none',
|
|
383
392
|
nightlyAgent: s.nightlyAgent ?? 'claude',
|
|
384
393
|
proving: s.proving ?? 'none',
|
|
394
|
+
...(s.proving === 'auto' ? { kitPolicy: s.kitPolicy } : {}),
|
|
385
395
|
generation: !!s.generation,
|
|
386
396
|
words: s.proving === 'auto' || s.proving === 'schedule' ? (s.words ?? '') : '',
|
|
387
397
|
name: s.name ?? '',
|
|
@@ -395,6 +405,10 @@ async function apply(answers, s, d, opts, has) {
|
|
|
395
405
|
const r = await p.spin('Installing guardlink and cxg', () => d.bravos(['setup', '--tools', '-y']), (r) => (r.code ? { fail: 'Installing guardlink and cxg — failed' } : 'Installed guardlink and cxg'));
|
|
396
406
|
for (const l of [...r.out, ...r.err])
|
|
397
407
|
(r.code ? p.warn : p.info)(l);
|
|
408
|
+
// A tool that would not install (no cargo, offline, an incompatible build) limits proving, not the
|
|
409
|
+
// rest of setup: carry on, and say what still needs doing instead of leaving the repo unset.
|
|
410
|
+
if (r.code)
|
|
411
|
+
p.warn('Carrying on without them: annotation and the briefing work now; proving needs guardlink and cxg. Fix the line above, then run bravos setup --tools.');
|
|
398
412
|
}
|
|
399
413
|
if (answers.installTools && has.missingBundles) {
|
|
400
414
|
const r = await p.spin('Fetching the Bravos analyzer and code graph', () => d.bravos(['setup']), (r) => (r.code ? { fail: 'Fetching the analyzer and code graph — failed' } : 'Fetched the analyzer and code graph'));
|
|
@@ -438,9 +452,9 @@ async function apply(answers, s, d, opts, has) {
|
|
|
438
452
|
`Open ${tool} in ${tildify(repo, d.env.HOME)} and type:`,
|
|
439
453
|
'',
|
|
440
454
|
` ${handoff} learns what the app is for (asks you a few questions)`,
|
|
441
|
-
` ${sigil(lead)}bravos-annotate maps the threats in your code
|
|
455
|
+
` ${sigil(lead)}bravos-annotate maps the threats in your code`,
|
|
442
456
|
'',
|
|
443
|
-
'
|
|
457
|
+
'Autopilot can review later changes in your agent. Live testing follows the preference and target you authorized.',
|
|
444
458
|
copied ? `(${handoff} is on your clipboard.) The Bravos banner shows the next step each time you open a session.` : 'The Bravos banner shows the next step each time you open a session.',
|
|
445
459
|
'Follow along in a second terminal: bravos watch',
|
|
446
460
|
].join('\n'), 'One step left, in your agent');
|
package/dist/versions.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { hooksDir } from './paths.js';
|
|
1
4
|
// @comment -- "The versions of the two binary bundles this CLI installs. Pinned here, not read from the network: a bravos release names the analyzer and code-graph builds it was tested with, and bravos setup fetches exactly those."
|
|
2
5
|
/** The licensed analyzer bundle (bravos-cli plus gitleaks, osv-scanner, kics, zizmor and the rules), published by specter-v1's analyzer-release workflow. */
|
|
3
6
|
export const ANALYZER_VERSION = '0.6.1';
|
|
4
7
|
/** The code graph binaries (codegraph-build, codegraph-mcp), published by specter-v1's codegraph-release workflow. */
|
|
5
8
|
export const CODEGRAPH_VERSION = '0.1.0';
|
|
6
|
-
|
|
7
|
-
export const GUARDLINK_VERSION = '2.5.0';
|
|
8
|
-
export const CXG_VERSION = '1.7.0';
|
|
9
|
+
export const PROOF_TOOL_PINS = JSON.parse(readFileSync(join(hooksDir(), 'lib', 'proof-tool-pins.json'), 'utf8'));
|
package/docs/GUIDE.md
CHANGED
|
@@ -44,7 +44,7 @@ Keep bravos watch running in a second terminal pane beside your agent (free, rea
|
|
|
44
44
|
|
|
45
45
|
### Hands-off: autopilot
|
|
46
46
|
|
|
47
|
-
bravos init --autopilot (or sync --autopilot) makes upkeep happen without anyone asking. At
|
|
47
|
+
bravos init --autopilot (or sync --autopilot) makes upkeep happen without anyone asking. At turn end the agent reviews changed code, including edits inside annotated files. It follows the recorded proving preference for affected claims. The pre-PR gate runs on every gh pr create.
|
|
48
48
|
|
|
49
49
|
Proving follows your choice, not a fixed rule: the first time it comes up the agent asks you once — prove automatically on your loopback target, ask each time, on a schedule, or not now — and records your words in .guardlink/proving.md. Say "ask me first" or "stop auto-proving" at any time to change it. Non-loopback targets still need a reviewed scope and your typed authorization every time.
|
|
50
50
|
|
|
@@ -84,7 +84,7 @@ Run bravos first: it reads the briefing, explains the loop in five lines and rou
|
|
|
84
84
|
|
|
85
85
|
Skills: `/bravos-cicd` · `/bravos-schedule`
|
|
86
86
|
|
|
87
|
-
bravos init --ci writes the PR gate and nightly workflows. bravos-cicd audits existing workflows: broken guardlink calls, script injection from pull-request text, missing SARIF upload. The
|
|
87
|
+
bravos init --ci writes the PR gate and nightly workflows. bravos-cicd audits existing workflows: broken guardlink calls, script injection from pull-request text, missing SARIF upload. The Claude and Codex nightlies can replay committed, bound kits when scheduled testing is authorized. The Copilot job assigns an annotation task.
|
|
88
88
|
|
|
89
89
|
## What to do, by task
|
|
90
90
|
|
|
@@ -130,6 +130,12 @@ Skills: `/bravos-templatize` · `/bravos-env` · `/bravos-prove`
|
|
|
130
130
|
|
|
131
131
|
Template → authorized target → run. Only a reproduced run confirms; reading code never does.
|
|
132
132
|
|
|
133
|
+
### My branch moved, or I found old annotation work
|
|
134
|
+
|
|
135
|
+
Skills: `/bravos-resync`
|
|
136
|
+
|
|
137
|
+
When the briefing says this checkout is far behind its base, or lists idle branches with annotation work the base lacks: saves uncommitted work in a commit, starts a branch from the base, carries the sidecars and definitions with bravos resync, maps ids that duplicate the base's, and re-reads every carried claim on code that changed since. Old annotations are leads until re-read.
|
|
138
|
+
|
|
133
139
|
### I fixed a finding
|
|
134
140
|
|
|
135
141
|
Skills: `/bravos-recheck`
|
|
@@ -222,6 +228,10 @@ Runs the authorized test, reads cxg's report and exit code, writes outcomes only
|
|
|
222
228
|
|
|
223
229
|
After a fix: stale claims, retest-kit replay, no new exposure, what to test next.
|
|
224
230
|
|
|
231
|
+
### bravos-resync
|
|
232
|
+
|
|
233
|
+
A stale checkout or a left-behind branch: carries its annotation work onto the base with bravos resync, maps duplicate ids, re-reads every carried claim on changed code.
|
|
234
|
+
|
|
225
235
|
### bravos-sast
|
|
226
236
|
|
|
227
237
|
Licensed static analysis joined to guardlink claims and reachability; gates on findings new since the base.
|