@bugb-technologies/bravos 1.1.0 → 1.2.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.
- package/README.md +8 -4
- package/dist/ci.js +26 -1
- package/dist/cli.js +92 -6
- package/dist/doctor.js +3 -0
- package/dist/guide.js +2 -2
- package/dist/help.js +18 -2
- package/dist/palette.js +100 -0
- package/dist/plugin-release.js +13 -6
- package/dist/start/answers.js +85 -0
- package/dist/start/index.js +454 -0
- package/dist/start/repos.js +78 -0
- package/dist/start/ui.js +219 -0
- package/dist/watch-frame.js +28 -16
- package/dist/watch.js +40 -1
- package/docs/GUIDE.md +5 -1
- package/hooks/lib/briefing.mjs +12 -12
- package/hooks/lib/palette.mjs +115 -0
- package/hooks/session-start.mjs +4 -1
- package/package.json +3 -1
- package/skills/bravos-cicd/SKILL.md +1 -1
- package/skills/bravos-schedule/SKILL.md +1 -1
- package/templates/omp/bravos.js +5 -0
- package/templates/workflows/bravos-nightly-claude.yml +7 -3
- package/templates/workflows/bravos-nightly-copilot.yml +73 -0
- package/templates/workflows/copilot-setup-steps.yml +35 -0
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
# file's human-written attestation the scan step skips and the job annotates only.
|
|
7
7
|
# The nightly is on the Team plan: add the repo secret BRAVOS_LICENCE (the token from
|
|
8
8
|
# account.bugb.io/dashboard/license) so the agent's paid skills run; without it they say so and stop.
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
9
|
+
# Claude Code here signs in with your Claude plan, so the run uses that plan like a session would:
|
|
10
|
+
# run `claude setup-token` once on your machine and store what it prints as the repo secret
|
|
11
|
+
# CLAUDE_CODE_OAUTH_TOKEN. A repo that already set ANTHROPIC_API_KEY keeps working on that key;
|
|
12
|
+
# delete that secret to run on your plan instead. Also enable Settings > Actions > General >
|
|
13
|
+
# "Allow GitHub Actions to create and approve pull requests". Pin the actions to commit SHAs if
|
|
14
|
+
# your organisation requires it.
|
|
12
15
|
name: bravos nightly (Claude Code)
|
|
13
16
|
|
|
14
17
|
on:
|
|
@@ -57,6 +60,7 @@ jobs:
|
|
|
57
60
|
- name: Annotate the next slice
|
|
58
61
|
uses: anthropics/claude-code-action@v1
|
|
59
62
|
with:
|
|
63
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
60
64
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
61
65
|
prompt: |
|
|
62
66
|
Follow .claude/skills/bravos-annotate/SKILL.md in slice mode (the default) to cover the
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# bravos:generated — written by `bravos init --workflows nightly-copilot`; `bravos sync` refreshes it while this line stays.
|
|
2
|
+
# The nightly for teams on GitHub Copilot: on the schedule this job opens one issue asking Copilot's
|
|
3
|
+
# cloud agent to cover the next slice of unannotated files with the bravos-annotate skill, and
|
|
4
|
+
# assigns the issue to Copilot. Copilot works in its own session on GitHub Actions (prepared by
|
|
5
|
+
# copilot-setup-steps.yml, written alongside this file) and opens the pull request itself; the
|
|
6
|
+
# bravos PR gate then checks it like any other. It annotates only, and uses your Copilot plan:
|
|
7
|
+
# no AI API key. While an earlier nightly issue is still open it skips, so issues never pile up.
|
|
8
|
+
# Needs:
|
|
9
|
+
# - Copilot cloud agent enabled for this repository and for the person below (a Copilot Pro,
|
|
10
|
+
# Pro+, Business or Enterprise plan);
|
|
11
|
+
# - the repo secret COPILOT_ASSIGN_TOKEN: that person's personal access token. GitHub assigns
|
|
12
|
+
# Copilot only with a user's token, so the workflow's own token cannot. Fine-grained: read
|
|
13
|
+
# access to metadata, read and write access to actions, contents, issues and pull requests.
|
|
14
|
+
# Classic: the repo scope;
|
|
15
|
+
# - BRAVOS_LICENCE as an Agents secret (Settings > Secrets and variables > Agents), so the paid
|
|
16
|
+
# skills run in Copilot's session. Copilot does not see ordinary Actions secrets.
|
|
17
|
+
# Assigning Copilot through the API is in public preview at GitHub and may change.
|
|
18
|
+
name: bravos nightly (GitHub Copilot)
|
|
19
|
+
|
|
20
|
+
on:
|
|
21
|
+
schedule:
|
|
22
|
+
- cron: '17 3 * * 1-5'
|
|
23
|
+
workflow_dispatch:
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
issues: read
|
|
28
|
+
|
|
29
|
+
concurrency:
|
|
30
|
+
group: bravos-nightly
|
|
31
|
+
cancel-in-progress: false
|
|
32
|
+
|
|
33
|
+
jobs:
|
|
34
|
+
assign:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
timeout-minutes: 10
|
|
37
|
+
defaults:
|
|
38
|
+
run:
|
|
39
|
+
shell: bash
|
|
40
|
+
steps:
|
|
41
|
+
- name: Ask Copilot for the next slice
|
|
42
|
+
env:
|
|
43
|
+
GH_TOKEN: ${{ secrets.COPILOT_ASSIGN_TOKEN }}
|
|
44
|
+
REPO: ${{ github.repository }}
|
|
45
|
+
BASE: ${{ github.event.repository.default_branch }}
|
|
46
|
+
START: ${{ github.sha }}
|
|
47
|
+
run: |
|
|
48
|
+
if [ -z "$GH_TOKEN" ]; then
|
|
49
|
+
echo "::error::Add the repo secret COPILOT_ASSIGN_TOKEN (a personal access token of someone with Copilot); see the comment at the top of this workflow"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
open=$(gh issue list -R "$REPO" --label bravos-nightly --state open --json number --jq length)
|
|
53
|
+
if [ "$open" != "0" ]; then
|
|
54
|
+
echo "::notice::An earlier bravos nightly issue is still open; skipping until Copilot's pull request is merged or the issue is closed"
|
|
55
|
+
exit 0
|
|
56
|
+
fi
|
|
57
|
+
gh label create bravos-nightly -R "$REPO" --color 1E9A6C --description "Opened by the bravos nightly for Copilot" 2>/dev/null || true
|
|
58
|
+
body=$(cat <<EOF
|
|
59
|
+
Cover the next slice of unannotated files in this repository with GuardLink annotations.
|
|
60
|
+
|
|
61
|
+
- Follow the bravos-annotate skill (\`.claude/skills/bravos-annotate/SKILL.md\` or \`.agents/skills/bravos-annotate/SKILL.md\`) in slice mode, its default, on the files \`guardlink unannotated --json\` lists first.
|
|
62
|
+
- Do the work yourself in this session. Never run guardlink annotate with an agent flag.
|
|
63
|
+
- Stop when \`guardlink lint . --since $START --json\` reports 0 errors and \`guardlink validate .\` passes.
|
|
64
|
+
- Change annotations only, not code, and open one pull request with them.
|
|
65
|
+
|
|
66
|
+
Opened by the bravos nightly. While this issue is open the nightly opens no other; the next one comes after it closes.
|
|
67
|
+
EOF
|
|
68
|
+
)
|
|
69
|
+
jq -n --arg title "bravos nightly: annotate the next slice" --arg body "$body" --arg repo "$REPO" --arg base "$BASE" \
|
|
70
|
+
'{title: $title, body: $body, labels: ["bravos-nightly"], assignees: ["copilot-swe-agent[bot]"],
|
|
71
|
+
agent_assignment: {target_repo: $repo, base_branch: $base, custom_instructions: "", custom_agent: "", model: ""}}' \
|
|
72
|
+
| gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "repos/$REPO/issues" --input - \
|
|
73
|
+
| jq -r '"Assigned to Copilot: " + .html_url'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# bravos:generated — written with bravos-nightly-copilot.yml; `bravos sync` refreshes it while this line stays.
|
|
2
|
+
# Prepares GitHub Copilot cloud agent's session on GitHub Actions: Node and guardlink, so the
|
|
3
|
+
# bravos skills can run guardlink there. Copilot reads this file only from the default branch, and
|
|
4
|
+
# only a single job named copilot-setup-steps; it honours steps, permissions, runs-on, services,
|
|
5
|
+
# snapshot and timeout-minutes (at most 59). The push and pull_request triggers just check the
|
|
6
|
+
# steps still work when this file changes.
|
|
7
|
+
name: Copilot setup steps
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
push:
|
|
12
|
+
paths:
|
|
13
|
+
- .github/workflows/copilot-setup-steps.yml
|
|
14
|
+
pull_request:
|
|
15
|
+
paths:
|
|
16
|
+
- .github/workflows/copilot-setup-steps.yml
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
copilot-setup-steps:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
timeout-minutes: 15
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: 22
|
|
33
|
+
|
|
34
|
+
- name: Install guardlink
|
|
35
|
+
run: npm install -g guardlink
|