AI Integration — surfaces, auth, and the loops¶
The AI layer — every surface where Claude runs, the Claude auth order and secrets matrix, the loops, and how all of it propagates to the fleet.
One page for the whole AI layer: what runs where, how it authenticates, and the feedback loops it powers. If you're setting up Claude for this repo (or a fleet repo), start at Auth & secrets.
The four AI surfaces¶
- Local
.claude/layer — skills, commands, agents, and hooks that make the dash self-managing from a local Claude Code session. The full inventory lives in.claude/README.md; highlights: therun-dashskill (orchestration hub,driver.py),drift-report(explains drift-gate checks (a)–(l)),standardize-audit/standardize-project,actions-triage,triage-attention/evolve-project/refresh-portfolio, the/adopt-schemaand/adopt-releasecommands, thefeature-scoutsubagent, and the Future-Features session hooks. - CI workflows — every
anthropics/claude-code-action@v1call site in the hub:claude.yml(@claude mention handler),fleet-pulse.yml(the daily loop'sdoctorjob — the Opus fixer; self-skips without Claude auth), the three agent tiers ofissue-pipeline.yml(intake / implement / complete; each self-skips without Claude auth, and tier 1 still builds and uploads its evidence bundles), theagent-filljob offanout.yml(kitsstandardizeandschema), the verifier pass offleet-verify.yml, and the matrixevolvejob ofrepo-evolution.yml(the weekly per-repo improvement pass — one Opus agent per opted-in submodule, draft PR in its upstream; the plan job fails loudly without auth, before any spend). - MCP servers —
.mcp.json:github(needs aGITHUB_TOKENenv var),memory,sequentialthinking,context7. - Copilot-format reference templates —
.github/agents/,.github/instructions/,.github/prompts/are consumed in place by hub skills (e.g.evolve-projectreads the agent personas); nothing seeds them into submodules, and they are not Task-launchable Claude subagents (only.claude/agents/are).
Auth & secrets¶
OAuth only for now (2026-11-15).
ANTHROPIC_API_KEYis disabled:ai_auth:defaults tooauth, no call site passes the key, andclaude-auth/claude-runskipapi_keyin any order, so the sections below describe the restorable mechanism, not today's behaviour. The secret is left in place; reverting that change restores the key.
Every Claude call site tries its credentials in the order its repo's CLAUDE_AUTH_ORDER variable names. The order is configured per repo and per group in _data/fleet.yml ai_auth:. The fleet default is oauth,api_key, the house convention since 2026-07: CLAUDE_CODE_OAUTH_TOKEN first, ANTHROPIC_API_KEY as the fallback. See Auth order per repo.
| Secret | Used by | Required? |
|---|---|---|
CLAUDE_CODE_OAUTH_TOKEN |
claude.yml, fleet-pulse.yml, issue-pipeline.yml, repo-evolution.yml, fanout.yml (kit schema) agent_fill, seeded fleet claude.yml workflows |
Preferred Claude auth. From claude setup-token (a one-year credential), seeded onto the hub — token-rotation.yml carries it to the rest of the fleet weekly. |
CLAUDE_CODE_OAUTH_REFRESH_TOKEN |
token-rotation.yml |
Optional, hub only. Lets the weekly rotation re-mint the OAuth token without a browser. Unset → the loop still propagates and audits, it just asks a human when the credential nears its expiry. See TOKEN-ROTATION.md. |
ANTHROPIC_API_KEY |
same call sites | The metered method. It comes second in the default order, or first in a repo whose ai_auth order puts api_key first. |
FLEET_TOKEN |
fleet-pulse.yml, issue-pipeline.yml, repo-evolution.yml, fanout.yml, token-rotation.yml, reconcile-registry.yml, schema-vendor.yml |
The one control-plane PAT. Fine-grained, covering the fleet: actions:read + contents:read + issues:read/write + pull_requests:read/write, plus contents:write + workflows:write on repos the fan-outs and the fixer may open PRs against (GitHub refuses a push touching .github/workflows/* without the Workflows permission), plus secrets:write for the weekly rotation (writing an Actions secret is an admin-level call — token-rotation.yml is the only workflow that needs it). Probed everywhere by the shared resolve-fleet-token action (GET /user), never presence-checked; GITHUB_TOKEN is the unprobed last resort. The legacy per-loop PATs (FANOUT_TOKEN, ACTIONS_ANALYTICS_TOKEN, DAILY_ANALYSIS_TOKEN) are gone from the hub and from every workflow. |
One-time setup¶
claude setup-token # mint an OAuth token
gh secret set CLAUDE_CODE_OAUTH_TOKEN -R bamr87/bamr87 # provision the hub
dash secrets rotate --apply # carry it to the rest of the fleet
The third line is what the weekly token-rotation.yml run does on its own every Monday, so seeding the hub is now the whole manual step — per-repo gh secret set is no longer needed, and a newly-registered repo is enrolled by the next run without anyone remembering to. Optionally provision CLAUDE_CODE_OAUTH_REFRESH_TOKEN on the hub to let the loop re-mint the credential too. Full doc: TOKEN-ROTATION.md.
Status:
CLAUDE_CODE_OAUTH_TOKENis provisioned inbamr87/bamr87(since 2026-07-16) andFLEET_TOKENis the one live control-plane PAT — the hub's AI steps run. The legacy per-loop PATs were retired 2026-08-05 (PAT_TOKEN's last call site was removed in PR #61); the legacy names above survive only as fallback expressions in the workflows.ANTHROPIC_API_KEYremains unset (it's only the fallback). Fleet repos still need their ownCLAUDE_CODE_OAUTH_TOKENfor seededclaude.ymlworkflows — as of 2026-08-23 the weeklytoken-rotation.ymlloop provisions and refreshes those from the hub's copy, so they are no longer placed by hand.FLEET_TOKENneedssecrets:writeadded for that loop to write anything; until it is, the loop audits and reports rather than failing.
Canonical call site¶
Copy this shape verbatim into any new workflow (it is what claude.yml uses):
- id: claude-auth
uses: bamr87/bamr87/.github/actions/claude-auth@main
with:
order: ${{ vars.CLAUDE_AUTH_ORDER }}
has-oauth: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN != '' }}
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ steps.claude-auth.outputs.method == 'oauth' && secrets.CLAUDE_CODE_OAUTH_TOKEN || '' }}
anthropic_api_key: ${{ steps.claude-auth.outputs.method == 'api_key' && secrets.ANTHROPIC_API_KEY || '' }}
claude_args: "--max-budget-usd 10" # see "Spend guardrails" below — required
Auth order per repo¶
ai_auth: in _data/fleet.yml decides which credential each repo tries first:
ai_auth:
variable: CLAUDE_AUTH_ORDER
methods: { oauth: CLAUDE_CODE_OAUTH_TOKEN, api_key: ANTHROPIC_API_KEY }
default: oauth,api_key # everything not matched below
groups:
metered-lanes: # API key first, OAuth as the fallback
order: api_key,oauth
repos: [lifehacker.dev, it-journey]
categories: [] # …or every registry repo in a category
repos:
zer0-mistakes: api_key # the key only, never OAuth
- Precedence.
repos:beatsgroups:, which beatsdefault:. A repo matched by two groups with different orders is an error. So is an unknown method or a key that names no fleet repo. Every writer refuses to act until the errors are fixed. - What it drives at runtime. The order is projected onto each repo as the
CLAUDE_AUTH_ORDERrepository variable. Everyclaude-code-actionstep reads it throughclaude-auth. Everyai-lanereads it throughclaude-run, where it becomesAI_AUTH_ORDER. claude-authoutputs a method name, never the secret. An API key that the models endpoint refuses (401/403) falls through to the next method.claude-rungives the CLI only the credential being tried. If that credential is refused (rejected, or its quota exhausted), it moves on to the next one. It never moves on after any other kind of failure. A transient API failure (529, 503,overloaded) whose payload shows nothing billed is re-run on the same credential, up toAI_TRANSIENT_RETRIEStimes (default 2) after theAI_TRANSIENT_BACKOFFwaits (default 30 s, then 90 s); a call that billed anything is never re-run. An order withoutapi_keynever spends the key, not even on the single-shot API fallback.- What it drives in the secret store.
dash secrets push,dash secrets sync,dash secrets rotateand the weekly rotation send a repo only the credentials its order uses. The hub keeps every fleet secret whatever its own order, because it is the copy the fleet is written from. - An unset variable means the default, so a repo behaves exactly as before until it is given an order.
dash config auth # each repo's order, where it came from, what it holds, its variable
dash config auth --offline # the resolution alone (no GitHub calls)
dash config auth sync # dry run: which CLAUDE_AUTH_ORDER variables would change
dash config auth sync --apply # set them (the weekly token-rotation variable pass does the same)
Anthropic API keys (per workspace)¶
The api_key credential is not one fleet-wide value. Each repo holds the key of the Console workspace that pays for it, as declared in _data/fleet.yml api_keys::
- A workspace claims repos by registry name, by
owner/repo(which can be outside the registry, like a content site in another GitHub org), or by GitHub owner. - A repo the registry knows is claimed by its registry name, never its
owner/repo: the registry follows a transfer, a pasted slug does not.bash-365.comonce claimedamr-bash/bash-365.comafter that repo had moved tobash-365/bash-365.com(#337);test_fleet_config.pynow fails on such a slug. - Every repo that no workspace claims gets the key from the Default Workspace.
- A repo whose
ai_authorder leavesapi_keyout is never sent a key.
What the Admin API can and cannot do. It can list keys (with expires_at) and disable them. It cannot create a key: keys, and their expiry, are minted in the Claude Console. That makes rotation assisted:
- Create the keys. In the Console (Settings → API keys → Create key), create each workspace's key scoped to that workspace, with an expiry of
lifetime_days(7). - Paste them into
.env. Use any name starting withANTHROPIC_API_KEY. The tool matches each value to its Console record by the key's partial hint and reads the workspace from the key's scope, so names don't matter. Admin keys and OAuth tokens are never taken, whatever they're called. - Run
dash keys rotate --apply, or use the Auth tab's Anthropic API keys panel. For each workspace it: - takes the newest active key;
- refuses any key that outlives the policy (
--allow-long-livedoverrides); - proves the key with one cheap Messages call, made exactly as CI makes it (no workspace header, so a key that would need one fails here rather than in CI);
- writes the key hub-first to every repo the workspace serves;
- records the ledger
_data/api_keys.yml(ids, names, dates, repos; never a value); - and only then disables the key it replaced. That's only when every repo took the new one, and only a key this tool deployed itself, never one in use by hand.
- Let the daily check watch it.
api-keys.ymlrunsdash keys watch. It judges the deployed keys, proves the hub's own key live, and keeps one issue open fromrenew_before_days(2) before expiry until the replacement lands.
dash keys # each workspace's key in .env, its expiry vs policy, the repos it serves
dash keys verify # + one cheap call per key (a fraction of a cent each)
dash keys rotate # dry run: what would be written where
dash keys rotate --apply # write, hub first, then disable the replaced keys
dash keys watch # the daily check: the DEPLOYED keys, from the ledger
CLAUDE_CONSOLE_TOKEN is the Admin API credential. It must be a service-account key not scoped to a workspace (a workspace-scoped key is refused by the Admin API), or an sk-ant-admin key. It is hub-only and never a fleet secret. Because dash keys owns ANTHROPIC_API_KEY (managed_by: keys in the token contract), the weekly rotation and dash secrets push|sync leave that secret alone. Otherwise they would overwrite every workspace's key with the hub's single copy.
Keyless: stage 2 (Workload Identity Federation)¶
A 7-day key still has to be created by a person once a week. The documented way to have no key at all is Workload Identity Federation. A GitHub Actions job presents its OIDC token and exchanges it at POST /v1/oauth/token for a Claude access token that lives for minutes. There's nothing to mint, paste, expire or rotate. The plan is to prototype it on one repo before any fan-out:
- One-time setup (a human, in the Console or with an
org:adminOAuth token): - a service account per workspace with
organization_role: developer; - a GitHub issuer (
issuer_url: https://token.actions.githubusercontent.com,jwks: {type: discovery}); - and one rule per workspace (
oauth_scope: workspace:inference), matched to an exactrepo:<owner>/<repo>:ref:refs/heads/mainsubject. Never a trailing*, which would also admit pull requests from forks. - In the job: grant
id-token: write, request the OIDC token, and exchange it. The SDKs do the exchange themselves whenANTHROPIC_FEDERATION_RULE_ID,ANTHROPIC_ORGANIZATION_ID,ANTHROPIC_SERVICE_ACCOUNT_IDandANTHROPIC_IDENTITY_TOKENare set. - Open questions the prototype has to answer before this replaces keys:
- Can
claude-code-actionand theclaudeCLI take the federated token? Probably viaANTHROPIC_AUTH_TOKEN, but that isn't confirmed. - Is
token_lifetime_secondslong enough for a 30-minute agent run? Otherwise the run needs a refresh path. - GitHub's OIDC tokens are single-use (
jti), so a job that calls the CLI more than once needs one exchange, not several.
The Harness Console has the same controls. The Auth tab has an AI auth order panel (resolve, sync dry run, confirm-gated sync), and the fleet-wide default is a choice on the Config tab.
Spend guardrails¶
--max-turns bounds iterations, not spend. One turn against a large context can outspend thirty small ones, which is why a turn cap is not a budget: six scheduled loops ran for months turn-capped and dollar-uncapped (bamr87#128).
Every anthropics/claude-code-action call site therefore also passes --max-budget-usd. The ceiling is declared once in _data/fleet.yml budget: — usd_per_turn (the derivation rule), default_usd, local_usd (for dash ai run), and call_sites, keyed <workflow file>:<job id>. A claude_args string cannot read YAML, so the number is necessarily written twice; .github/scripts/dash-gen/test_ai_budget.py asserts that the two copies agree, that no call site is missing a cap, and that each cap clears usd_per_turn × --max-turns. Adding a new Claude call site without a cap fails that test.
A cap is a circuit breaker, not a target. A budget abort stops the agent mid-task — worse than a turn overshoot, which at least stops at a boundary — so caps are set at roughly 1.5× a full run's observed spend, and hitting one is never a silent truncation. Read the current table with dash config show budget.
What a cap does when it binds is a three-part contract, asserted by test_ai_budget.py because every part of it is invisible until the day a ceiling is actually reached:
- The step fails.
::error::writes an annotation; it does not fail anything. A cost step that only annotated left the job green, and everysuccess()-gated step after it ran on truncated work — including the ones that open pull requests. The step now exits non-zero, matchingdash ai run, which already did: one event, one verdict. - The verdict is readable. The cost step is
id: costand publishesbudget_hitas a step output. Whetherclaude-code-actionitself exits non-zero on an abort is not a documented contract, so the workflow that publishes a PR from the agent's working tree (repo-evolution.yml) gates on that output rather than on the action's exit code — and when it is set they still publish, as a draft whose body says the diff is partial and unverified. Discarding a run that has already been paid for is the worse failure; shipping one that reads like a completed pass is the dangerous one. At the other call sites the agent opens its own PR, so a red job is the whole signal. - The spend is still recorded.
ai_usage_collector.pyregex-scrapestotal_cost_usdout of the run log, so a run it cannot see is a run charged to nobody — and an abort is not the normal termination path. Each cost step therefore echoes the result record into the log itself, so it can no longer go missing on exactly the runs where the spend was highest. The echo and claude-code-action's own result block are two prints of one call: the collector folds them by session id (else duration and turns), the rulesfleet_lake.pyuses, andparity.ai_ci_costinai_usage.ymlholds the ledger to the echo lines on every run that has them. Until 2026-11-07 the block's cost line was read as a second call and every hub loop run was charged twice (WORKFLOW-OPTIMIZATION.md).
A spent usage window is capacity, not a defect. Every hub loop shares one Claude subscription, so when its weekly or five-hour window runs out, every loop that starts afterwards is refused at its first call (api_error_status: 429, $0, empty modelUsage) until the reset. Reported as a red run, that kept fleet-pulse and issue-pipeline red for three mornings in a row (2026-10-23..25) and fed the doctor its own failures (#335, #348). So every scheduled call site marks its agent step continue-on-error: true and passes usage-limit: skip to claude-cost, which then owns the job's verdict: a usage limit is a warning, a job summary line and usage_limit=true (the issue pipeline's later tiers skip on it instead of paying their setup to be refused too); a budget hit, a refused credential, an agent failure or a missing result record still exit 1. The two halves are useless apart, so test_ai_budget.py asserts they come as a pair and that every scheduled loop uses them. Whether a refused subscription should fall back to the metered ANTHROPIC_API_KEY (the api_key half of CLAUDE_AUTH_ORDER, which the claude-run step already honours on a 429) is a billing decision #348 holds open; nothing falls back today.
Under subscription auth a cap is a throughput ceiling, not a spend ceiling. Every call site is OAuth-first, so in the normal case total_cost_usd is a priced estimate of what the work would have cost on the API, not an amount anyone is billed — it is a true dollar ceiling only where ANTHROPIC_API_KEY is in use. Both are worth having, and nothing downstream presents these numbers as an invoice: the job summary and the abort annotation both say which they are.
Cost is reported on every run, not only failures. Each call site's Report Claude run cost step is the shared claude-cost action — one script, not six copies (which had drifted: fleet-pulse reported against $25 while its cap was $40) — which reads ${RUNNER_TEMP}/claude-execution-output.json and writes spend / cap / turns to the job summary; it used to sit behind if: failure(), so a green run — the common case, and the one whose spend accumulates unnoticed — printed nothing. The durable record still belongs to ai_usage_collector.py and fleet_lake.py; the step is a readout, not a third parser.
Locally, tools/dash ai run -- <args> is the same guardrail: it wraps claude -p --output-format json at budget.local_usd and records the run's cost into the ledger's runs section (schema).
Local headless runs (the JEV loop runner's executor)¶
tools/dash ai run is also the one executor JEV's local loop runner uses (ADR 0002, P1; flags in the dash-gen README). The guardrails it adds for a local agent:
- The CI cap, not a local one.
--call-site <workflow>:<job>caps the run at that step'sbudget.call_sitesentry, so a local scout attempt is capped at the $8 CI uses;--max-budget-usdcan only lower it. - One credential, chosen once. With
--isolateor--auth-order, the order is--auth-order, elseCLAUDE_AUTH_ORDER, elseai_auth:, and the first credential that is present wins: foroauththeCLAUDE_CODE_OAUTH_TOKENvariable, then the keychain login (claude auth status), then the hub.envvalue; forapi_keythe variable, then.env. The.envis parsed for those two names only, never sourced. The other credential is unset — under-pan exportedANTHROPIC_API_KEYwould otherwise win over OAuth — as are the CLI's other auth inputs (ANTHROPIC_AUTH_TOKEN,ANTHROPIC_BASE_URL,CLAUDE_CONFIG_DIR, the provider switches), and nothing falls back to it in the run, which keeps #348's status quo. The loop runner also pins the source (--auth-source): the credential its host check chose and its canary proved, or a refusal (exit 3, no spend), never the next source in the order. - A 429 is capacity, not a defect, locally too:
--usage-limit skipturns a spent window into exit 0 with a warning ("the credential is VALID — do NOT rotate it"), the same verdict claude-cost'susage-limit: skipgives a scheduled loop. - No unmeasured run is free. A run that leaves no result record is ledgered at its cap with
cost_source: estimatedwhenever the session may have started or a wall clock or signal stopped it, andno-spendonly when the model was provably never reached: with stream-json output, the CLI exited before its init event (which it prints before any request); with json output, which shows no init, only when the first thing on stderr is the CLI's own argv refusal. A cancel that lands while a finished run is being recorded waits for the ledger row, at most--ledger-waitseconds (30) when another writer holds the ledger's lock.dash aireports billed and estimated dollars apart. Every figure is API-equivalent (estimate) under subscription auth — a throughput ceiling, not an invoice. - The agent's environment is built, not inherited.
--isolategives claude PATH, HOME, the locale and a fixed set of offline git/npm/pip settings, plus at most one Claude credential: no GitHub token, no SSH agent, noANTHROPIC_BASE_URL, no PYTHONPATH or OTEL settings. The session flags and the sandbox that go with it are recorded in ADR 0002's P1 section. - A monthly ceiling for the loops. The loop runner (
tools/dash loop run) also holds every local loop attempt to_data/fleet.ymlbudget.loops($25 a UTC month, a--scheduledrun stopping at 80%), summed over the ledger rows ai-run writes withorigin: localand aloopfield, plus the runner's own cap-priced charge for any attempt that left no row (<ledger>.loops-unledgered.jsonl); an attempt runs only when the month can absorb its full call-site cap, ai-run is handed exactly that cap, and a plaindash ai run(no loop) never counts against it. An unreadable ledger stops the loops until it is repaired in place (moved aside, the month would read as $0).budget.loops+budget.jevstay insideharnesses.budget.monthly_ai_usd(test_ai_budget.py);tools/dash loop budgetprints the month (docs/JEV.md). - A ceiling per expedite sprint.
_data/fleet.ymlbudget.sprintsholds each sprint Amr declares (constitution § 27): an API-equivalent (estimate) ceiling and an appetite in hours. Inside its time box every loop attempt on one of its repositories, the loop runner's, JEV tiers 1 and 2 and the issue pipeline's tier jobs, runs only when the sprint's spend (the AI ledger's loop rows, JEV's ledger, the sprint repositories' own CI runs and the tier caps each issue-pipeline run reserved for sprint items, recorded in_data/issue_pipeline.ymlsprint.reservations) plus the attempt's full call-site cap fits; past it the attempt is abudget-skip, the sprint stops and the stop is recorded. A ceiling sits inside every cap above and never raises one: a ceiling or appetite that is.inf,.nan, 0 or negative, a ceiling aboveharnesses.budget.monthly_ai_usdand two overlapping sprints are refused at load (tools/jev/sprints.py,test_ai_budget.py), andvars.EXPEDITE_SPRINT_ENABLED='false'stops every sprint loop on a schedule (EXPEDITE-SPRINTS.md).
The loops¶
- Kill switches — every loop's switch is listed in
_data/fleet.ymlswitches:(constitution § 17, HUB-057): the repo variable or env each workflow actually reads, whether it is opt-in ('true'to run) or opt-out ('false'to pause), its default, its documented state and the command that flips it. The live*_ENABLEDvariables are projections of that map; until the dry-run projection op lands, a flip is that command plus a same-day PR recording it in the map.tools/test_loop_switches.pyfails when a scheduled or switched hub workflow has no entry. The local loop runner (tools/dash loop, JEV.md) resolves this map on every run that could spend or file, manual included, together withvars.FLEET_AGENTS_PAUSED, and exits 5 while any level it answers to isoff. - Self-evolution —
triage-attention(read Monitor signals) →evolve-project(fix the top item) →refresh-portfolio(regen) → PR → gates verify → human merges. No CI twin for the hub (unified-evolution.ymlwas retired 2026-10-27); the per-submodule CI pass isrepo-evolution.yml. Details: DASH.md. - Actions optimization — folded into the daily loop below:
fleet-pulse.ymlcommits_data/actions_usage.ymland feeds its slow / flaky / high-cost flags into the same ranked queue as the failures, so an expensive workflow gets a fix PR, not just an issue. Locally, theactions-triageskill reads the same data. Details: DASH.md. - The daily fleet loop —
fleet-pulse.yml(daily 06:00) gathers every signal in one job (Actions cost, Claude spend, engagement actuals, the prior-day digest_reports/daily/<date>.md, and the open-state snapshot_data/fleet_triage.yml→ the/triage/portal), publishes them in ONE commit, merges the failing and expensive signals into a single ranked queue (dash-gen remediate), and hands it to an Opus agent that opens a draft PR with the fix — in the hub, or in the submodule that owns the workflow — falling back to a hub issue when it can't. Deduped by hidden marker, capped by_data/fleet.yml. Locally, thetriage-attentionskill reads the same snapshot. Details: DAILY-ANALYSIS.md. - The issue pipeline —
issue-pipeline.yml(daily 08:00) is the issue-side counterpart: a deterministicscanjob derives every open issue's stage from its LABELS, scores its gaps / priority / size / autonomy, dedupes, caps per_data/fleet.yml, and publishes_data/issue_pipeline.yml→ the/issue-pipeline/portal. Then three Opus tiers: intake reproduces each issue in an isolated virtual environment (tools/issue-evidence.sh) and turns it into a specification with attached evidence; implement opens a draft PR; complete drives that PR to mergeable and marks it ready for review unlesshuman-reviewsays a person does. No tier ever merges. Because a PR opened withGITHUB_TOKENnever triggers its own CI, tier 2 needsFLEET_TOKENfor the checks tier 3 reads — the workflow probes it rather than presence-checking it. Locally, theissue-pipelineskill drives the same data. Details: ISSUE-PIPELINE.md. - Repo evolution —
repo-evolution.yml(weekly, Monday 09:00) is the fourth loop and the only proactive one: the three above react to a signal (a red workflow, a filed issue, an ageing credential); this one improves what nobody filed — documentation accuracy, onboarding, clarity, small correctness gaps — in each opted-in submodule's own upstream repo. A deterministicplanjob (dash-gen targets) selects registry opt-ins that are owned, non-archived submodules, skips any whose previous pass is still open (one draft per repo is the backpressure), caps per_data/fleet.yml, and writes each a brief from the registry and the triage snapshot; a matrixevolvejob runs one Opus agent per repo on a credential-less checkout and the workflow opens the draft PR, marker first. The brief tells the agent about the repo's failing workflows and open issues so it stays out of the doctor's and the pipeline's lanes. Locally,tools/dash evolve --repo <name>/--all. Details: EVOLUTION.md. - Future-Features —
SessionStart/Stophooks keep the pipeline active in every session; thefeature-scoutsubagent proposes roadmap-ready specs; a human approves before anything lands in_data/roadmap.yml(rendered at the dash Roadmap surface). - Credential rotation —
token-rotation.yml(weekly, Monday 02:00) is the third reconciliation loop:fleet-pulsefixes broken workflows,issue-pipelineresolves issues, this one keeps credentials current. The hub is the master copy: it audits every fleet repo's secret age from GitHub's ownupdated_at, propagates the hub's storedCLAUDE_CODE_OAUTH_TOKEN(andANTHROPIC_API_KEY, when one is set there) to any copy that is missing or stale, brings each repo's canonical repository variables into line with the hub's live values in the same pass, re-mints via the optional OAuth refresh grant when one is provisioned, and files one tracking issue when a human has to runclaude setup-token. Ledger:_data/token_rotation.yml(names, ages, outcomes — never a value). Locally,dash secrets plan/dash secrets rotate. Details: TOKEN-ROTATION.md. - Drift —
drift-check.ymlrunstools/check-drift.shin CI; the/drift-reportskill explains any failure (checks (a)–(l)) with the exact fix.
Usage dashboard (transparency + audit)¶
Two layers, one page family:
- Fleet ledger —
/ai-usage/(committed):.github/workflows/fleet-pulse.ymlrunstools/dash-gen ai-usagedaily, harvesting every Claude touchpoint the fleet leaves in public infrastructure — CI runs of any workflow that calls Claude by any of the fleet's three routes (anthropics/claude-code-action, theclaude-runcomposite, a vendoredscripts/ai/run.sh) in any registry repo and in the hub itself, commits with aCo-Authored-By: Claudetrailer, and PRs carrying the Claude Code marker — into_data/ai_usage.yml, categorized by repo / workflow / registry category / day, with per-run audit links. - How a CI run is priced (
cost_sourceon every ledger row,pricing:for the window):reportedis the run's owntotal_cost_usd, summed across the run's Claude sessions and de-duplicated persession_id(the figure is cumulative within a session, and GitHub's log zip carries each job's text twice);tokensprices a payload that carries a model and a token breakdown but no cost, at the same API list pricesdash aiuses, cache writes at 1.25x/2x input and cache reads at 0.1x;no-spendis a run that cannot have spent anything (skipped, or a log with no Claude step in it — the loops open with an "is the loop on?" gate job);estimatedis a run that ran Claude and left no usage behind, carrying an explicitest_cost_usdfrom the workflow's own priced median, else its turns atbudget.usd_per_turn, else the fleet median. Totals reportci_cost_usd(measured),ci_estimated_usdandci_accounted_usd; the budget check reads the accounted figure — a ceiling judged on the measured half alone read a fleet whose runs were 87% unpriced as $1.03 against $75/month (2026-10-29). - Local sessions —
/ai-activity/(gitignored):tools/dash aishadow-prices this machine's~/.claude/projects/transcripts with full token detail. The report it writes (_data/ai_activity.yml) carries a separateheadless:section fed bytools/dash ai run: it reportsbilled_cost_usd(thetotal_cost_usdthe CLI reported for itself, not a list-price shadow price) apart fromestimated_cost_usd(a run that left no result, charged at its cap), under subscription auth both are API-equivalent (estimate), and it is never summed with the scan (a headless run leaves a transcript the scan also reads, so each row is flaggedalso_in_scan). No page renders that section yet: the legacy/ai-activity/URL redirects to/activity, which reads the local lake, and the lake does not ingest the ledger's runs. Publishing local spend is an explicit opt-in: runningtools/dash-gen ai-usagelocally folds the machine ledger's windowed aggregate into the committed file'slocalsection; the daily CI refresh preserves (never adds, never erases) that section.
Fleet propagation¶
Both fan-outs ride tools/fanout.sh — dry-run by default, PRs only, additive-only, external-upstream guard, bot identity bamr87-bot <10567847+bamr87@users.noreply.github.com>:
fanout.yml(kitstandardize) with artifactsagent-context,claudeseeds the agent-context kit (templates/agent-context/): aCLAUDE.mdscaffold (only when the repo has no agent-context file) and the@claudemention workflow — the sameclaude.ymlthe hub runs. Defaults stayeditorconfig,ci.fanout.yml(kitschema) seeds the Pyramid Schema kit; the optionalagent_fillinput runs a Claude Code pass that fills scaffold TODOs on the adoption PR branch (single target only); each kit's pass is a JEV step spec (tools/jev/steps/fanout/agent-fill-<kit>.yml) the workflow's inline prompt is held to, and the same pass runs locally throughtools/dash loop run fanout agent-fill-<kit>. See SCHEMA-FRAMEWORK.md.fanout.yml(kitharness) is the inventory-driven third fan-out: itsplanjob resolvestarget: gapsfrom the committed_data/harness_registry.yml(built daily bydash-gen harnesses, graded against_data/fleet.ymlharnesses:), so agent-context kit PRs go only to the repos the data says are missing or behind — andupgrade: truerefreshes machine-seeded harnesses stuck on an old kit (byte-identical check; hand-modified copies untouched). The read-only board is/harnesses/; the runbook is HARNESS-OPS.md.
Each fleet repo that adopts claude.yml needs its own CLAUDE_CODE_OAUTH_TOKEN secret — provisioned and kept current by the weekly rotation loop rather than by hand (see One-time setup and TOKEN-ROTATION.md).