Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ pushed directly. Branch protection details: [`docs/fleet-operations.md`](docs/fl
its trailer. The pin and the trailer are one value and always move together.
- **The wave keeps it current.** `tools/fleet-wave.sh` replaces each kit file a target branch
carries and adds every file the tier and platform allow that it lacks: `.github/dependabot.yml`
from the variant `tools/kit-platforms.sh` picks (and the Dependabot stubs with it), the root
from the variant `tools/kit-platforms.sh` picks (and the Dependabot stubs with it), except on a
`maintenance-paused` repo, where it deletes the file so Dependabot stays off, the root
`.node-version` from `templates/github/node-version/<platform>`, the `.claude/settings.json`
attribution keys. It deletes the retired check-run agent copies from Shopify repos: Macroscope's
check-run agents and ignore file reach every repo from driver-agents, its policy repo, and a copy
Expand Down Expand Up @@ -216,7 +217,7 @@ any 0.0.x change and a prerelease count as majors, and a message whose bump line
dependency list is not eligible. A Vercel site waits because Vercel blocks the build of a merge by
`driver-digital-agents`, which has no seat on the team (#157). Majors and every other case wait for
the reviewer, who is also assigned, except on a repo with the `maintenance-paused` topic, where they
wait unassigned; Dependabot itself assigns no one. The `Dependabot verdict` check
wait unassigned (such a repo normally has no Dependabot at all: [branch model](docs/branch-model.md)); Dependabot itself assigns no one. The `Dependabot verdict` check
is not required in branch protection: human PRs never get one.

The validate stub's `name:` stays byte-identical (`Dependabot validate`) in every repo, because
Expand Down
8 changes: 4 additions & 4 deletions docs/HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ open `todo` issues (`gh issue list --label todo`); this file points at them rath
- **Dependabot sometimes ignores `@dependabot rebase`** (Driver-Digital-Website #196-#198 on 11-03,
#198 on 11-16), cause unknown. It answered the v1.23.0 wave's request on LittleMe#57; if one
goes unanswered again, file it.
- **`maintenance-paused` (13 repos)** took effect with the v1.23.0 wave: their held Dependabot PRs
should request no reviewer and assign no one from now on.
- **The Node-pin to-dos** (from #86) have merged everywhere but three open PRs: Kissy-Kissy#82,
R-Finds#55 and LittleMe#61. foundrae's `main-development` PR (#256) is also open; its theme push
- **`maintenance-paused` now switches Dependabot off** (`docs/branch-model.md`). Eleven paused repos
are archived. Team-Laird and studio-sulzer stay on the kit and lose `dependabot.yml` with the next
wave; their alerts and security updates are off. `dependabot-report`'s unassigned case for a paused repo is now unreachable.
- **The Node-pin to-dos** (from #86) have merged on every repo still on the kit. foundrae's `main-development` PR (#256) is also open; its theme push
fails on that branch's own files (`.shopifyignore` lacks `assets/.vite/*`, and
`templates/page.all_components.liquid` has a Liquid error). driver-onboarding#41 adds mise to the
setup docs.
Expand Down
4 changes: 2 additions & 2 deletions docs/branch-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ platform topic also brings a root `.node-version` from `templates/github/node-ve

## Which repos get what

Five GitHub topics on each repo and its visibility decide it; a sixth, `maintenance-paused`, changes only who is asked to review. `tools/kit-platforms.sh` lists the files
Five GitHub topics on each repo and its visibility decide it; a sixth, `maintenance-paused`, switches Dependabot off. `tools/kit-platforms.sh` lists the files
each platform and each tier adds.

| Topic | Means |
Expand All @@ -18,7 +18,7 @@ each platform and each tier adds.
| `shopify-theme` | A Shopify site: adds the Shopify files on a private repo. |
| `vercel-site` | A Vercel site: the shared kit plus the root `.node-version`. |
| `wordpress-site` | A WordPress site: the shared kit plus the root `.node-version`. |
| `maintenance-paused` | Driver has no maintenance agreement for the site. Dependabot still runs and safe updates still auto-merge, but a PR the report holds gets no reviewer or assignee. Remove the topic when the client asks for help again. |
| `maintenance-paused` | Driver has no maintenance agreement for the site, so nothing runs there. The repo is archived too, which the wave and the audit skip, unless it is the only home of a live site's code (the Vercel sites). That repo stays on the kit without Dependabot: the wave deletes its `.github/dependabot.yml`, and its Dependabot alerts and security updates are off in its settings. Driver-Digital-Website runs the same stack with alerts on, so its alerts stand in for theirs. To resume: unarchive the repo, remove the topic, wave, and turn alerts and security updates back on. |

A repo carries at most one platform topic; the wave stops on a repo with two.

Expand Down
2 changes: 1 addition & 1 deletion templates/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ take it from there. The dispatcher owns every Bonsai status move; no workflow he
| `claude-standards.md` | `.github/claude-standards.md` — every kit repo | The house standards: commits, comments, to-dos, `docs/HANDOFF.md`, docs shipping with the change, branches and PRs, comments on a PR, closing issues, theme editor changes on a preview, page builder files, Figma designs on a PR, client team memory, `ponytail:` comments, subagents, replies. The repo's `CLAUDE.md` imports it with `@.github/claude-standards.md` (replacing any pasted copy). On a PR run the import resolves to the PR head's copy, so it carries style only. |
| `claude-settings.json` | `.claude/settings.json` — every kit repo | Shared Claude Code project settings: turns off the commit `Co-Authored-By` trailer and the PR "Generated with" footer in interactive sessions (CI sets the same keys). The kit owns only its `attribution` keys: the wave merges them into a repo's existing file and the audit compares only them, so the repo keeps the rest. |
| `shopify-tool-smoke.yml` | `.github/workflows/` — Shopify repos with a store, on the agents pipeline | Manual (`workflow_dispatch`) diagnostic for the Shopify admin tool: secrets → `driver-agents` clone of `main` → token mint → Admin API, read-only. Fails **loudly** where `claude.yml` degrades — that's the point. |
| `dependabot/<variant>.yml` | `.github/dependabot.yml` — every kit repo | The Dependabot config, one whole file per kind of repo: `npm.yml` (a root `package.json`), `actions.yml` (no root `package.json`; every kit repo has workflows once waved), and one per repo with its own exceptions (`driver-agents.yml`, `vite-plugin-shopify-clean.yml`). `tools/kit-platforms.sh` picks the variant; a new exception becomes a variant, not a hand edit. Its `github-actions` block is also the updater for the stub pins, which nothing else bumps between waves. |
| `dependabot/<variant>.yml` | `.github/dependabot.yml` — every kit repo but a `maintenance-paused` one | The Dependabot config, one whole file per kind of repo: `npm.yml` (a root `package.json`), `actions.yml` (no root `package.json`; every kit repo has workflows once waved), and one per repo with its own exceptions (`driver-agents.yml`, `vite-plugin-shopify-clean.yml`). `tools/kit-platforms.sh` picks the variant; a new exception becomes a variant, not a hand edit. Its `github-actions` block is also the updater for the stub pins, which nothing else bumps between waves. |
| `node-version/<platform>` | `.node-version` at the repo root — wave targets with a platform topic | The Node major for that platform (`24`), so a Node move is one kit edit and a wave from `main` with `--message`, with no release. The reusables read it before `.nvmrc` and `package.json`; developers get it through mise once driver-onboarding#41 lands. Vercel builds on `package.json` `engines.node` and ignores this file, so a Vercel repo keeps `engines.node` at the same major (`24.x`); the audit flags a mismatch. |
| `lint.yml` | `.github/workflows/lint.yml` — every kit repo | actionlint + shellcheck over the installing repo's own `.github/workflows/`. Guards the one CI failure with no signal: a YAML or shell error surfaces as a `startup_failure` — no check run, no notification — which on the PR page is indistinguishable from checks that have not started. Check-run context is the job id, **`actionlint`**. Not the same file as the central repo's own `.github/workflows/lint.yml`, which runs a superset and never ships. |

Expand Down
9 changes: 6 additions & 3 deletions templates/github/claude-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ file from the PR head, so anything load-bearing belongs in `CLAUDE.md` or `.clau
never append a correction beneath it. Leave old reference docs in `docs/` as they are unless the
change makes them misleading for current work. A doc in another repo gets a `todo` issue there
instead of an edit.
- **Branches and pull requests** — Macroscope reviews a pull request at most three times, every
push to a published PR spends one, and it does not review drafts. A session works on one feature
- **Branches and pull requests** — Macroscope reviews a pull request automatically at most three
times, every push to a published PR spends one, and it does not review drafts. A session works on one feature
branch, commits each piece of work separately (even when they touch unrelated things) and pushes
to the branch as often as it likes, then opens one PR at the end as a draft (`gh pr create
--draft`). It never marks the PR ready for review: the person running the session publishes it, or
says to, once they have reviewed it. Once a PR is published, collect fixes locally and push them
together. One exception, for an org admin, who can bypass branch protection: a minor docs-only
together. When the three reviews are spent, convert the PR to draft and mark it ready again (`gh pr
ready <n> --undo`, then `gh pr ready <n>`): marking it ready starts a new review. A PR comment
`@macroscope-app review this PR` also works. Never close and reopen a PR for this: the count
survives it, and closing deletes the preview theme and any theme-editor changes on it. One exception, for an org admin, who can bypass branch protection: a minor docs-only
change may go straight to `main` when no feature branch is open, or when it concerns `main` and not
the branch's work; anyone else opens a PR for it. When the session's work is on a
feature branch, its docs updates, the end-of-session `docs/HANDOFF.md` included, are committed to
Expand Down
3 changes: 0 additions & 3 deletions templates/github/dependabot/vite-plugin-shopify-clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ updates:
schedule:
interval: "monthly"
# TS 7 is outside @typescript-eslint's peer range and breaks npm ci; drop once it isn't.
# Vitest 5 drops Node 20, which we keep until Vite drops it; drop this then.
ignore:
- dependency-name: "typescript"
update-types: ["version-update:semver-major"]
- dependency-name: "vitest"
update-types: ["version-update:semver-major"]
assignees:
- "mcarter-astronautdev"
groups:
Expand Down
23 changes: 14 additions & 9 deletions tools/fleet-pin-audit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ expected() { # file tier platform node_version_source
tier_allows "$2" "$(file_tier "$1")" && { [ -z "$fp" ] || [ "$fp" = "$3" ]; } && wave_adds "$1" "$4"
}

scan_ref() { # repo ref platform tier is_default
local repo="$1" ref="$2" plat="$3" tier="$4" is_default="$5" files f fp ft t
scan_ref() { # repo ref platform tier is_default paused
local repo="$1" ref="$2" plat="$3" tier="$4" is_default="$5" paused="$6" files f fp ft t
# A standards-only target has no .github/workflows; its .github/ kit files are still checked below.
files="$(gh api "repos/$ORG/$repo/contents/.github/workflows?ref=$ref" --jq '.[].name' 2>/dev/null)" || files=""
for f in $files; do
Expand Down Expand Up @@ -184,13 +184,17 @@ scan_ref() { # repo ref platform tier is_default
done
fi
# .github/dependabot.yml and .node-version are compared only where the wave writes them: an
# enrolled branch the wave never reaches keeps its own files.
# enrolled branch the wave never reaches keeps its own files. A maintenance-paused repo carries none.
if [ "$waved" = 1 ]; then
if grep -qx dependabot.yml <<<"$dotgithub"; then
gh api "repos/$ORG/$repo/contents/.github/dependabot.yml?ref=$ref" \
-H 'Accept: application/vnd.github.raw' > "$TMP/raw" 2>/dev/null \
&& content_row "$repo" "$ref" dependabot.yml "$KIT/dependabot/$variant.yml"
else
if [ "$paused" = 1 ]; then
echo "CONTENT $repo@$ref dependabot.yml DRIFT paused: the wave deletes it"
else
gh api "repos/$ORG/$repo/contents/.github/dependabot.yml?ref=$ref" \
-H 'Accept: application/vnd.github.raw' > "$TMP/raw" 2>/dev/null \
&& content_row "$repo" "$ref" dependabot.yml "$KIT/dependabot/$variant.yml"
fi
elif [ "$paused" != 1 ]; then
echo "CONTENT $repo@$ref dependabot.yml DRIFT missing"
fi
fi
Expand Down Expand Up @@ -256,6 +260,7 @@ report="$(
# archived, so they never count as drift.
topics_enrolled "${topics//,/ }" || plat="unenrolled"
tier="$(repo_tier "$priv" "${topics//,/ }")"
paused=0; topics_paused "${topics//,/ }" && paused=1
# The two topic states the wave refuses outright. repo_tier reads a public repo as public whatever
# its topics, so without these rows such a repo could read converged.
if [ "$plat" != unenrolled ]; then
Expand All @@ -264,10 +269,10 @@ report="$(
echo "CONTENT $repo@$def topics DRIFT public repo tagged $PIPELINE_TOPIC, which the wave refuses"
fi
fi
scan_ref "$repo" "$def" "$plat" "$tier" 1
scan_ref "$repo" "$def" "$plat" "$tier" 1 "$paused"
if [ "$def" = main ]; then
gh api --paginate "repos/$ORG/$repo/branches?per_page=100" --jq '.[].name' 2>/dev/null \
| grep -E '^main-.' | while read -r b; do scan_ref "$repo" "$b" "$plat" "$tier" 0; done
| grep -E '^main-.' | while read -r b; do scan_ref "$repo" "$b" "$plat" "$tier" 0 "$paused"; done
fi
done | sort
)"
Expand Down
24 changes: 15 additions & 9 deletions tools/fleet-wave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
# stubs and shopify-tool-smoke.yml file's keys are merged into an existing one
# dependabot.yml <- written at .github/ on every target from its
# templates/github/dependabot/ variant (picked by
# tools/kit-platforms.sh)
# tools/kit-platforms.sh); deleted instead on a
# maintenance-paused repo
# node-version <- written as the root .node-version on every
# Shopify, Vercel or WordPress target, from
# templates/github/node-version/<platform>
Expand Down Expand Up @@ -196,7 +197,7 @@ handle_of() {
# exit 0. An explicit `exit` in the subshell does propagate — the assignment carries
# the status, and the CALLER's errexit is live.
targets() {
local repos r def priv topics plat tier branches b
local repos r def priv topics plat tier paused branches b
if [ -n "$ONLY" ]; then
# Its own statement, not interpolated into the string: a substitution embedded in a larger word
# cannot fail the assignment, so a typo'd --only would fall through to the "no targets" message
Expand Down Expand Up @@ -232,6 +233,7 @@ targets() {
plat=$(topics_platform "${topics//,/ }")
[ "$plat" != several ] || { echo "$r carries more than one platform topic — pick one" >&2; exit 2; }
tier=$(repo_tier "$priv" "${topics//,/ }")
paused=0; if topics_paused "${topics//,/ }"; then paused=1; fi
# Guard 10, per repo: the topic asks for what the visibility forbids, so neither can be trusted.
if [ "$priv" != true ] && [[ ",$topics," == *",$PIPELINE_TOPIC,"* ]]; then
echo "$r is public but carries $PIPELINE_TOPIC — the pipeline runs on private repos only" >&2; exit 2
Expand All @@ -253,16 +255,16 @@ targets() {
|| api "repos/$ORG/$r/contents/.github/claude-standards.md?ref=$b" --jq .sha >/dev/null 2>&1 \
|| api "repos/$ORG/$r/contents/.github/workflows/lint.yml?ref=$b" --jq .sha >/dev/null 2>&1 \
|| api "repos/$ORG/$r/contents/.github/workflows/shopify-theme.yml?ref=$b" --jq .sha >/dev/null 2>&1; then
echo "$r $b $plat $tier kit"
echo "$r $b $plat $tier kit $paused"
elif [ "$b" = "$def" ]; then
echo "$r $b $plat $tier new"
echo "$r $b $plat $tier new $paused"
fi
done
done <<<"$repos"
}

plan_and_push() {
local repo=$1 branch=$2 plat=$3 tier=$4 found=$5 tmp f fp ft cur
local repo=$1 branch=$2 plat=$3 tier=$4 found=$5 paused=$6 tmp f fp ft cur
tmp="$TMP/$repo/$branch"; rm -rf "$tmp"; mkdir -p "$tmp"
local -a tree=() deletes=()
local changes=0 existing root dotgithub workflows dotclaude kit_paths variant src nv
Expand Down Expand Up @@ -315,6 +317,10 @@ plan_and_push() {
# per-repo edit. Nothing outside .github/, .claude/, .macroscope/check-run-agents/ and the root
# .node-version is ever written.
for f in "${FULL_FILES[@]}"; do
if [ "$f" = dependabot.yml ] && [ "$paused" = 1 ]; then
if grep -qxF "$(dest "$f")" <<<"$existing"; then deletes+=("$f"); changes=1; echo " delete $f (maintenance-paused)"; fi
continue
fi
# Guard 9, per file: a platform file is never written to a repo of another platform, and one
# already there blocks the wave instead of being refreshed into place.
fp=$(file_platform "$f")
Expand Down Expand Up @@ -433,16 +439,16 @@ if [ "$DRY" -eq 0 ]; then
DRY=1
# Called from an `if` body, never as the right side of `||`: that context disables errexit for
# the whole function, and a failed read would then plan on as if nothing happened.
while read -r repo branch plat tier found; do if [ -n "$repo" ]; then plan_and_push "$repo" "$branch" "$plat" "$tier" "$found" >/dev/null; fi; done <<<"$TARGETS"
while read -r repo branch plat tier found paused; do if [ -n "$repo" ]; then plan_and_push "$repo" "$branch" "$plat" "$tier" "$found" "$paused" >/dev/null; fi; done <<<"$TARGETS"
DRY=0
[ "$BLOCKED" -eq 0 ] || { echo "refusing to wave: fix the blocked targets above first" >&2; exit 3; }
fi
n=0
labelled=" "
while read -r repo branch plat tier found; do
while read -r repo branch plat tier found paused; do
[ -n "$repo" ] || continue
echo "== $repo@$branch ($plat, $tier$([ "$found" = kit ] || echo ", no kit yet"))"
plan_and_push "$repo" "$branch" "$plat" "$tier" "$found"; n=$((n+1))
echo "== $repo@$branch ($plat, $tier$([ "$found" = kit ] || echo ", no kit yet")$([ "$paused" = 0 ] || echo ", paused"))"
plan_and_push "$repo" "$branch" "$plat" "$tier" "$found" "$paused"; n=$((n+1))
# Macroscope's design fidelity check runs only on PRs labelled figma, so every kit repo has the label.
if [ "$DRY" -eq 0 ] && [[ "$labelled" != *" $repo "* ]]; then
gh label create figma --repo "$ORG/$repo" --color A259FF --force \
Expand Down
Loading