@bugb-technologies/bravos 1.12.1 → 1.14.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/dist/cli.js +6 -3
- package/dist/doctor.js +6 -1
- package/dist/guide.js +2 -0
- package/dist/help.js +16 -0
- package/dist/hooks.js +12 -2
- package/dist/plugin.js +4 -2
- package/dist/prefs.js +13 -3
- package/dist/start/answers.js +4 -0
- package/dist/start/index.js +27 -1
- package/dist/uninstall.js +1 -1
- package/docs/GUIDE.md +8 -0
- package/docs/UPGRADING.md +30 -0
- package/hooks/cards.mjs +74 -0
- package/hooks/lib/cards.mjs +201 -0
- package/hooks/lib/prefs.mjs +7 -4
- package/hooks/lib/threat-issues.mjs +343 -0
- package/package.json +1 -1
- package/templates/workflows/bravos-nightly-claude.yml +60 -0
- package/templates/workflows/bravos-nightly-codex.yml +60 -0
- package/templates/workflows/bravos-nightly-copilot.yml +60 -0
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
# delete that secret to run on your plan instead. Also enable Settings > Actions > General >
|
|
12
12
|
# "Allow GitHub Actions to create and approve pull requests". Pin the actions to commit SHAs if
|
|
13
13
|
# your organisation requires it.
|
|
14
|
+
# Team view, off by default: set the repository variable BRAVOS_THREAT_ISSUES to on (Settings > Secrets and
|
|
15
|
+
# variables > Actions > Variables) and the threat-issues job opens one issue per critical or high threat still
|
|
16
|
+
# untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after it was committed. A confirmed threat keeps its issue,
|
|
17
|
+
# relabelled confirmed; it closes once the threat is refuted, fixed, accepted or removed. It needs no secret: the
|
|
18
|
+
# job's own token opens the issues.
|
|
14
19
|
name: bravos nightly (Claude Code)
|
|
15
20
|
|
|
16
21
|
on:
|
|
@@ -267,3 +272,58 @@ jobs:
|
|
|
267
272
|
guardlink diff "$START" --markdown || true
|
|
268
273
|
} > "$RUNNER_TEMP/body.md"
|
|
269
274
|
gh pr create --base "$base" --head "$branch" --title "annotate: nightly coverage slice" --body-file "$RUNNER_TEMP/body.md"
|
|
275
|
+
|
|
276
|
+
# The team view, off by default: with the repository variable BRAVOS_THREAT_ISSUES set to on, one issue per critical
|
|
277
|
+
# or high @exposes claim still untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after its annotation was committed,
|
|
278
|
+
# relabelled confirmed when a test confirms it, and closed by a later run once the claim is refuted, fixed, accepted
|
|
279
|
+
# or removed; a claim untested again or due a retest reopens the issue the nightly closed. It reads the default
|
|
280
|
+
# branch as merged with guardlink and writes issues with gh and this job's own token; no agent runs here, and annotation
|
|
281
|
+
# text reaches gh only as arguments and --body-file from hooks/lib/threat-issues.mjs, never as a shell line.
|
|
282
|
+
threat-issues:
|
|
283
|
+
if: vars.BRAVOS_THREAT_ISSUES == 'on' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
|
284
|
+
runs-on: ubuntu-latest
|
|
285
|
+
timeout-minutes: 15
|
|
286
|
+
permissions:
|
|
287
|
+
contents: read
|
|
288
|
+
issues: write
|
|
289
|
+
defaults:
|
|
290
|
+
run:
|
|
291
|
+
shell: bash
|
|
292
|
+
steps:
|
|
293
|
+
- uses: actions/checkout@v4
|
|
294
|
+
with:
|
|
295
|
+
# guardlink blame reads when each claim was committed from the full history.
|
|
296
|
+
fetch-depth: 0
|
|
297
|
+
persist-credentials: false
|
|
298
|
+
|
|
299
|
+
- uses: actions/setup-node@v4
|
|
300
|
+
with:
|
|
301
|
+
node-version: 22
|
|
302
|
+
|
|
303
|
+
- name: Install guardlink
|
|
304
|
+
run: bash .bravos/hooks/lib/nightly-tools.sh annotate
|
|
305
|
+
|
|
306
|
+
- name: Issues for untested threats
|
|
307
|
+
env:
|
|
308
|
+
GH_TOKEN: ${{ github.token }}
|
|
309
|
+
REPO: ${{ github.repository }}
|
|
310
|
+
SERVER: ${{ github.server_url }}
|
|
311
|
+
SHA: ${{ github.sha }}
|
|
312
|
+
DAYS: ${{ vars.BRAVOS_THREAT_ISSUES_DAYS }}
|
|
313
|
+
run: |
|
|
314
|
+
model="$RUNNER_TEMP/bravos-issues-model.json"
|
|
315
|
+
ledger="$RUNNER_TEMP/bravos-issues-ledger.json"
|
|
316
|
+
blame="$RUNNER_TEMP/bravos-issues-blame.json"
|
|
317
|
+
if ! guardlink parse . > "$model" || ! jq -e '.exposures | arrays' "$model" > /dev/null; then
|
|
318
|
+
echo "::error::unknown: guardlink parse failed"
|
|
319
|
+
exit 1
|
|
320
|
+
fi
|
|
321
|
+
if ! guardlink hypothesis list --json > "$ledger" || ! jq -e '(.ledger == "present" or .ledger == "absent") and (.records | arrays)' "$ledger" > /dev/null; then
|
|
322
|
+
echo "::error::unknown: GuardLink hypothesis ledger unreadable"
|
|
323
|
+
exit 1
|
|
324
|
+
fi
|
|
325
|
+
if ! guardlink blame . --json > "$blame" || ! jq -e '.entries | arrays' "$blame" > /dev/null; then
|
|
326
|
+
echo "::error::unknown: guardlink blame failed"
|
|
327
|
+
exit 1
|
|
328
|
+
fi
|
|
329
|
+
node .bravos/hooks/lib/threat-issues.mjs "$model" "$ledger" "$blame"
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
# Needs the repo secret OPENAI_API_KEY, and Settings > Actions > General > "Allow GitHub
|
|
9
9
|
# Actions to create and approve pull requests". Pin the actions to commit SHAs if your
|
|
10
10
|
# organisation requires it.
|
|
11
|
+
# Team view, off by default: set the repository variable BRAVOS_THREAT_ISSUES to on (Settings > Secrets and
|
|
12
|
+
# variables > Actions > Variables) and the threat-issues job opens one issue per critical or high threat still
|
|
13
|
+
# untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after it was committed. A confirmed threat keeps its issue,
|
|
14
|
+
# relabelled confirmed; it closes once the threat is refuted, fixed, accepted or removed. It needs no secret: the
|
|
15
|
+
# job's own token opens the issues.
|
|
11
16
|
name: bravos nightly (Codex)
|
|
12
17
|
|
|
13
18
|
on:
|
|
@@ -262,3 +267,58 @@ jobs:
|
|
|
262
267
|
guardlink diff "$START" --markdown || true
|
|
263
268
|
} > "$RUNNER_TEMP/body.md"
|
|
264
269
|
gh pr create --base "$base" --head "$branch" --title "annotate: nightly coverage slice" --body-file "$RUNNER_TEMP/body.md"
|
|
270
|
+
|
|
271
|
+
# The team view, off by default: with the repository variable BRAVOS_THREAT_ISSUES set to on, one issue per critical
|
|
272
|
+
# or high @exposes claim still untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after its annotation was committed,
|
|
273
|
+
# relabelled confirmed when a test confirms it, and closed by a later run once the claim is refuted, fixed, accepted
|
|
274
|
+
# or removed; a claim untested again or due a retest reopens the issue the nightly closed. It reads the default
|
|
275
|
+
# branch as merged with guardlink and writes issues with gh and this job's own token; no agent runs here, and annotation
|
|
276
|
+
# text reaches gh only as arguments and --body-file from hooks/lib/threat-issues.mjs, never as a shell line.
|
|
277
|
+
threat-issues:
|
|
278
|
+
if: vars.BRAVOS_THREAT_ISSUES == 'on' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
|
279
|
+
runs-on: ubuntu-latest
|
|
280
|
+
timeout-minutes: 15
|
|
281
|
+
permissions:
|
|
282
|
+
contents: read
|
|
283
|
+
issues: write
|
|
284
|
+
defaults:
|
|
285
|
+
run:
|
|
286
|
+
shell: bash
|
|
287
|
+
steps:
|
|
288
|
+
- uses: actions/checkout@v4
|
|
289
|
+
with:
|
|
290
|
+
# guardlink blame reads when each claim was committed from the full history.
|
|
291
|
+
fetch-depth: 0
|
|
292
|
+
persist-credentials: false
|
|
293
|
+
|
|
294
|
+
- uses: actions/setup-node@v4
|
|
295
|
+
with:
|
|
296
|
+
node-version: 22
|
|
297
|
+
|
|
298
|
+
- name: Install guardlink
|
|
299
|
+
run: bash .bravos/hooks/lib/nightly-tools.sh annotate
|
|
300
|
+
|
|
301
|
+
- name: Issues for untested threats
|
|
302
|
+
env:
|
|
303
|
+
GH_TOKEN: ${{ github.token }}
|
|
304
|
+
REPO: ${{ github.repository }}
|
|
305
|
+
SERVER: ${{ github.server_url }}
|
|
306
|
+
SHA: ${{ github.sha }}
|
|
307
|
+
DAYS: ${{ vars.BRAVOS_THREAT_ISSUES_DAYS }}
|
|
308
|
+
run: |
|
|
309
|
+
model="$RUNNER_TEMP/bravos-issues-model.json"
|
|
310
|
+
ledger="$RUNNER_TEMP/bravos-issues-ledger.json"
|
|
311
|
+
blame="$RUNNER_TEMP/bravos-issues-blame.json"
|
|
312
|
+
if ! guardlink parse . > "$model" || ! jq -e '.exposures | arrays' "$model" > /dev/null; then
|
|
313
|
+
echo "::error::unknown: guardlink parse failed"
|
|
314
|
+
exit 1
|
|
315
|
+
fi
|
|
316
|
+
if ! guardlink hypothesis list --json > "$ledger" || ! jq -e '(.ledger == "present" or .ledger == "absent") and (.records | arrays)' "$ledger" > /dev/null; then
|
|
317
|
+
echo "::error::unknown: GuardLink hypothesis ledger unreadable"
|
|
318
|
+
exit 1
|
|
319
|
+
fi
|
|
320
|
+
if ! guardlink blame . --json > "$blame" || ! jq -e '.entries | arrays' "$blame" > /dev/null; then
|
|
321
|
+
echo "::error::unknown: guardlink blame failed"
|
|
322
|
+
exit 1
|
|
323
|
+
fi
|
|
324
|
+
node .bravos/hooks/lib/threat-issues.mjs "$model" "$ledger" "$blame"
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
# - BRAVOS_LICENCE as an Agents secret (Settings > Secrets and variables > Agents), so the paid
|
|
16
16
|
# skills run in Copilot's session. Copilot does not see ordinary Actions secrets.
|
|
17
17
|
# Assigning Copilot through the API is in public preview at GitHub and may change.
|
|
18
|
+
# Team view, off by default: set the repository variable BRAVOS_THREAT_ISSUES to on (Settings > Secrets and
|
|
19
|
+
# variables > Actions > Variables) and the threat-issues job opens one issue per critical or high threat still
|
|
20
|
+
# untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after it was committed. A confirmed threat keeps its issue,
|
|
21
|
+
# relabelled confirmed; it closes once the threat is refuted, fixed, accepted or removed. It needs no secret: the
|
|
22
|
+
# job's own token opens the issues.
|
|
18
23
|
name: bravos nightly (GitHub Copilot)
|
|
19
24
|
|
|
20
25
|
on:
|
|
@@ -93,3 +98,58 @@ jobs:
|
|
|
93
98
|
agent_assignment: {target_repo: $repo, base_branch: $base, custom_instructions: "", custom_agent: "", model: ""}}' \
|
|
94
99
|
| gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "repos/$REPO/issues" --input - \
|
|
95
100
|
| jq -r '"Assigned to Copilot: " + .html_url'
|
|
101
|
+
|
|
102
|
+
# The team view, off by default: with the repository variable BRAVOS_THREAT_ISSUES set to on, one issue per critical
|
|
103
|
+
# or high @exposes claim still untested BRAVOS_THREAT_ISSUES_DAYS days (default 2) after its annotation was committed,
|
|
104
|
+
# relabelled confirmed when a test confirms it, and closed by a later run once the claim is refuted, fixed, accepted
|
|
105
|
+
# or removed; a claim untested again or due a retest reopens the issue the nightly closed. It reads the default
|
|
106
|
+
# branch as merged with guardlink and writes issues with gh and this job's own token; no agent runs here, and annotation
|
|
107
|
+
# text reaches gh only as arguments and --body-file from hooks/lib/threat-issues.mjs, never as a shell line.
|
|
108
|
+
threat-issues:
|
|
109
|
+
if: vars.BRAVOS_THREAT_ISSUES == 'on' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
timeout-minutes: 15
|
|
112
|
+
permissions:
|
|
113
|
+
contents: read
|
|
114
|
+
issues: write
|
|
115
|
+
defaults:
|
|
116
|
+
run:
|
|
117
|
+
shell: bash
|
|
118
|
+
steps:
|
|
119
|
+
- uses: actions/checkout@v4
|
|
120
|
+
with:
|
|
121
|
+
# guardlink blame reads when each claim was committed from the full history.
|
|
122
|
+
fetch-depth: 0
|
|
123
|
+
persist-credentials: false
|
|
124
|
+
|
|
125
|
+
- uses: actions/setup-node@v4
|
|
126
|
+
with:
|
|
127
|
+
node-version: 22
|
|
128
|
+
|
|
129
|
+
- name: Install guardlink
|
|
130
|
+
run: bash .bravos/hooks/lib/nightly-tools.sh annotate
|
|
131
|
+
|
|
132
|
+
- name: Issues for untested threats
|
|
133
|
+
env:
|
|
134
|
+
GH_TOKEN: ${{ github.token }}
|
|
135
|
+
REPO: ${{ github.repository }}
|
|
136
|
+
SERVER: ${{ github.server_url }}
|
|
137
|
+
SHA: ${{ github.sha }}
|
|
138
|
+
DAYS: ${{ vars.BRAVOS_THREAT_ISSUES_DAYS }}
|
|
139
|
+
run: |
|
|
140
|
+
model="$RUNNER_TEMP/bravos-issues-model.json"
|
|
141
|
+
ledger="$RUNNER_TEMP/bravos-issues-ledger.json"
|
|
142
|
+
blame="$RUNNER_TEMP/bravos-issues-blame.json"
|
|
143
|
+
if ! guardlink parse . > "$model" || ! jq -e '.exposures | arrays' "$model" > /dev/null; then
|
|
144
|
+
echo "::error::unknown: guardlink parse failed"
|
|
145
|
+
exit 1
|
|
146
|
+
fi
|
|
147
|
+
if ! guardlink hypothesis list --json > "$ledger" || ! jq -e '(.ledger == "present" or .ledger == "absent") and (.records | arrays)' "$ledger" > /dev/null; then
|
|
148
|
+
echo "::error::unknown: GuardLink hypothesis ledger unreadable"
|
|
149
|
+
exit 1
|
|
150
|
+
fi
|
|
151
|
+
if ! guardlink blame . --json > "$blame" || ! jq -e '.entries | arrays' "$blame" > /dev/null; then
|
|
152
|
+
echo "::error::unknown: guardlink blame failed"
|
|
153
|
+
exit 1
|
|
154
|
+
fi
|
|
155
|
+
node .bravos/hooks/lib/threat-issues.mjs "$model" "$ledger" "$blame"
|