From 56b4a84eacbb66324d6ad961e7a8cbdd88d4cd0b Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Thu, 4 Jun 2026 17:12:40 -0400 Subject: [PATCH 1/2] fix(factory): onboard bonedigger into factory model Assisted-by: Claude Sonnet 4.6 via GitHub Copilot CLI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/sync-templates.yml | 13 +++- AGENTS.md | 90 ++++++++++++++++++++++++++++ docs/skills/bonedigger-overview.md | 5 +- docs/skills/bonedigger-templates.md | 7 ++- 4 files changed, 108 insertions(+), 7 deletions(-) create mode 100644 AGENTS.md diff --git a/.github/workflows/sync-templates.yml b/.github/workflows/sync-templates.yml index 47f3001..913b174 100644 --- a/.github/workflows/sync-templates.yml +++ b/.github/workflows/sync-templates.yml @@ -22,6 +22,15 @@ jobs: - projectbluefin/dakota - projectbluefin/knuckle steps: + - name: Get mergeraptor token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 + with: + app-id: ${{ secrets.MERGERAPTOR_APP_ID }} + private-key: ${{ secrets.MERGERAPTOR_PRIVATE_KEY }} + owner: projectbluefin + repositories: bluefin,bluefin-lts,common,dakota,knuckle + - name: Checkout bonedigger uses: actions/checkout@v4 with: @@ -31,7 +40,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ matrix.repo }} - token: ${{ secrets.BONEDIGGER_SYNC_TOKEN }} + token: ${{ steps.app-token.outputs.token }} path: downstream - name: Copy templates @@ -41,7 +50,7 @@ jobs: - name: Open PR if changed env: - GH_TOKEN: ${{ secrets.BONEDIGGER_SYNC_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} REPO: ${{ matrix.repo }} SHA: ${{ github.sha }} run: | diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f05858b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,90 @@ +# bonedigger — Agent & Copilot Instructions + +`projectbluefin/bonedigger` is the reusable lifecycle and diagnostics tool for the Project Bluefin factory. + +It owns: +- the reusable issue lifecycle workflow (`.github/workflows/lifecycle.yml`) +- the canonical issue templates (`templates/`) +- the canonical `ujust report` recipe (`just/report.just`) +- the template sync workflow that opens downstream PRs + +## Start here + +Read the repo skill docs before changing behavior: +- `docs/skills/bonedigger-overview.md` — architecture, adoption, repo layout +- `docs/skills/bonedigger-lifecycle.md` — issue state machine, slash commands, labels +- `docs/skills/bonedigger-templates.md` — template sync and downstream targets +- `docs/skills/bonedigger-ujust.md` — client-side data collection and scrubbing + +## Factory role + +bonedigger is factory infrastructure. It serves these repos directly: +- `projectbluefin/common` — ships `ujust report` to all variants +- `projectbluefin/dakota` — reference implementation and consumer +- `projectbluefin/bluefin` +- `projectbluefin/bluefin-lts` +- `projectbluefin/knuckle` + +Any repo that adopts `projectbluefin/bonedigger/.github/workflows/lifecycle.yml@main` is also a bonedigger consumer. + +## Issue lifecycle + +Queue state machine: + +`filed → approved → queued → claimed → done` + +| Stage | Trigger | +|---|---| +| `filed` | Issue opened; bonedigger inserts the pipeline widget | +| `approved` | Maintainer applies `status/approved` or comments `/approve` or `/lgtm` | +| `queued` | `queue/agent-ready` applied automatically | +| `claimed` | Contributor comments `/claim`; assignee + widget update | +| `done` | Fix shipped; issue closed and awaits `ujust verify` confirmations | + +## Claiming work + +- Claim a queued issue with `/claim` +- Return it with `/unclaim` if you stop working on it +- Maintainers approve work with `/approve` or `/lgtm` +- Use `agent/blocked` only when human input is required + +## Labels + +Factory labels expected here: +- `hive/p0`, `hive/p1` +- `priority/p0`, `priority/p1` +- `queue/agent-ready`, `queue/claimed` +- `agent/blocked` + +Lifecycle labels managed by the workflow: +- `needs-triage`, `status/discussing`, `status/approved` +- `priority/high`, `priority/critical`, `stale-digest`, `lgtm` +- `needs-human/agent-oops`, `kind:agent-donation` +- `flow/project-report`, `flow/issue-review`, `flow/pr-review` +- `hold`, `do-not-merge` + +## Local validation + +Use the lightest checks that match the change: + +```bash +actionlint .github/workflows/*.yml +``` + +For doc-only changes, read the rendered Markdown and verify links/targets manually. + +For template changes, confirm the sync workflow still targets the factory repos listed above. + +## CI/CD integration points + +- `lifecycle.yml` is a reusable workflow triggered by downstream repos on `issues`, `issue_comment`, and `schedule` +- `sync-templates.yml` opens PRs against downstream repos when `templates/` changes on `main` +- Cross-repo writes must use the `mergeraptor` GitHub App token pattern; PATs are not allowed +- Repo settings should stay factory-aligned: squash merge, auto-merge, and delete-branch-on-merge enabled + +## PR rules + +- Use Conventional Commits for commits and PR titles +- No WIP PRs +- Keep scope tight; bonedigger changes can affect the whole factory +- Prefer one branch per logical fix diff --git a/docs/skills/bonedigger-overview.md b/docs/skills/bonedigger-overview.md index 29db318..7fc9817 100644 --- a/docs/skills/bonedigger-overview.md +++ b/docs/skills/bonedigger-overview.md @@ -76,5 +76,6 @@ Inputs: `brand_name`, `brand_emoji`, `pipeline_marker` (default: `