@bugb-technologies/bravos 1.2.0 → 1.3.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.
@@ -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