@davidvornholt/standards 0.25.0 → 0.26.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 CHANGED
@@ -1,59 +1,265 @@
1
1
  # @davidvornholt/standards
2
2
 
3
- CLI for bootstrapping, synchronizing, and validating repositories that consume [davidvornholt/standards](https://github.com/davidvornholt/standards).
3
+ CLI for initializing, synchronizing, and validating repositories that consume [`davidvornholt/standards`](../../README.md).
4
+
5
+ ## Install
6
+
7
+ Start a new repository without a prior installation:
4
8
 
5
9
  ```sh
6
10
  bunx @davidvornholt/standards init
7
- standards sync
8
- standards check
9
- standards doctor
10
- standards structure
11
- standards dependabot --check
12
- standards dependabot --write
13
- standards dev-env
14
- standards github --check
15
- standards github --apply
16
- standards creds login github
17
- standards creds login cloudflare
18
- standards creds add cloudflare --dest ci:ci.cloudflare_workers_token --permissions "Workers Scripts Write"
19
- standards creds add cloudflare --dest ci:ci.cloudflare_dns_token --zone 1bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --permissions "DNS Write"
20
- standards creds add cloudflare --dest ci:ci.r2_read --bucket assets --s3 --permissions "Workers R2 Storage Bucket Item Read"
21
- standards creds add cloudflare --dest ci:ci.eu_r2_read --bucket eu-assets --jurisdiction eu --s3 --permissions "Workers R2 Storage Bucket Item Read"
22
- standards creds add github --dest ci:ci.broker_app
23
- standards creds plan
24
- standards creds apply
25
- standards creds revoke --token-id <token-id>
26
- standards screenshots publish docs/pr/settings-page.png docs/pr/settings-empty-state.png
27
- standards poller --config <path>
28
- standards poller --print-units --config <path>
11
+ bun install
12
+ bun run check
13
+ ```
14
+
15
+ Adopt an existing repository by installing the exact package first:
16
+
17
+ ```sh
18
+ bun add --dev --exact @davidvornholt/standards
19
+ bun standards init
20
+ ```
21
+
22
+ Read the [adoption guide](../../docs/adoption.md) before running `init` in a repository that already has agent instructions, Just recipes, Dependabot configuration, or Claude skills.
23
+
24
+ ## Commands
25
+
26
+ | Command | Purpose |
27
+ | --- | --- |
28
+ | `init` | Seed project-owned files, mirror canonical paths, generate owned output, and create the lock. |
29
+ | `sync` | Mirror the selected upstream revision and update the lock. |
30
+ | `check` | Verify drift, extension points, structure, generated output, and GitHub settings. |
31
+ | `doctor` | Validate integration points without checking lock-backed drift. |
32
+ | `structure` | Validate the monorepo contract. |
33
+ | `dependabot` | Verify or regenerate `.github/dependabot.yml`. |
34
+ | `dev-env` | Generate workspace `.env.local` files. |
35
+ | `github` | Compare or converge live repository settings. |
36
+ | `creds` | Mint and reconcile brokered credentials. |
37
+ | `screenshots` | Publish pull-request screenshots through the configured bucket. |
38
+ | `poller` | Run one approved fix or review automation tick. |
39
+ | `help` | Print command and option help. |
40
+
41
+ Use `bun standards help`, `bun standards creds help`, or `bun standards screenshots help` for the complete invocation syntax.
42
+
43
+ ## init
44
+
45
+ ```sh
46
+ bun standards init [--dir <repo>] [--from <source>] [--ref <ref>]
47
+ ```
48
+
49
+ `init` is a one-time ownership cutover. It:
50
+
51
+ 1. seeds missing project-owned files from `template/`;
52
+ 2. mirrors every canonical path in `sync-standards.json`;
53
+ 3. regenerates engine-owned output;
54
+ 4. writes `sync-standards.lock`.
55
+
56
+ Existing project-owned files are kept. Synced files are replaced. `init` refuses after a lock exists and refuses before writing when a managed destination is a directory containing unowned work.
57
+
58
+ ## sync
59
+
60
+ ```sh
61
+ bun standards sync --dry-run
62
+ bun standards sync
63
+ bun standards sync --ref v0.26.1
64
+ bun standards sync --from ../standards
65
+ ```
66
+
67
+ `sync` mirrors canonical files and symlinks, removes canonical paths deleted upstream, regenerates `.github/dependabot.yml`, and rewrites the lock.
68
+
69
+ `--dry-run` prints the full plan without writing. `--ref` selects a tag, branch, or full commit SHA for a remote source. `--from` accepts another GitHub source or a local checkout.
70
+
71
+ A local source is useful for testing unpublished canonical changes, but its lock may describe content that does not exist upstream. Discard that test state afterward. See [Sync and ownership](../../docs/sync-and-ownership.md#test-an-unpublished-canonical-change).
72
+
73
+ ## check
74
+
75
+ ```sh
76
+ bun standards check
77
+ ```
78
+
79
+ The command fails when:
80
+
81
+ - a lock-backed canonical path changed, disappeared, or has the wrong path type;
82
+ - a required extension point is missing or invalid;
83
+ - generated Dependabot output differs from its inputs;
84
+ - the monorepo structure contract fails;
85
+ - the CI secret files have an invalid encrypted or example shape;
86
+ - declared GitHub settings differ from live state or cannot be verified.
87
+
88
+ The canonical workflow performs the live GitHub comparison in its restricted aggregator job. Local checks use the available `gh`, `GH_TOKEN`, or `GITHUB_TOKEN` authentication.
89
+
90
+ ## doctor and structure
91
+
92
+ ```sh
93
+ bun standards doctor
94
+ bun standards structure
95
+ bun standards structure --profile source
96
+ ```
97
+
98
+ `doctor` checks project-owned integration points such as `biome.jsonc`, `AGENTS.local.md`, package scripts, sync policy, settings overlays, and Dependabot inputs.
99
+
100
+ `structure` checks the exact Bun declaration, workspace scripts, internal dependency versions, package exports, TypeScript inheritance, accessibility wiring, workspace READMEs, and CI secret structure. The `source` profile records the few intentional differences in this repository itself.
101
+
102
+ ## dependabot
103
+
104
+ ```sh
105
+ bun standards dependabot --check
106
+ bun standards dependabot --write
107
+ ```
108
+
109
+ The generated `.github/dependabot.yml` combines:
110
+
111
+ - canonical `.github/dependabot.base.yml`;
112
+ - project-owned `.github/dependabot.local.yml`.
113
+
114
+ The local overlay may add update blocks, private registries, and `ignore` or `registries` entries on matching canonical targets. It cannot replace canonical policy.
115
+
116
+ ## dev-env
117
+
118
+ ```sh
119
+ bun standards dev-env
120
+ just dev-env-generate
121
+ ```
122
+
123
+ Each workspace environment is composed in this order:
124
+
125
+ 1. `config/dev.yaml`, tracked configuration;
126
+ 2. `secrets/dev.yaml`, SOPS-encrypted shared secrets and reference policy;
127
+ 3. `config/dev.local.yaml`, gitignored machine-specific overrides.
128
+
129
+ Later layers win, but one key cannot exist in both tracked layers. The command validates every destination before writing and commits all generated-file changes as one transaction.
130
+
131
+ A plain layer may reference one part of a broker-owned S3 pair:
132
+
133
+ ```yaml
134
+ apps:
135
+ web:
136
+ R2_ACCESS_KEY_ID:
137
+ brokeredS3: assets
138
+ key: assets.web
139
+ part: access_key_id
140
+ ```
141
+
142
+ Authorize the complete pair in encrypted `secrets/dev.yaml`:
143
+
144
+ ```yaml
145
+ brokeredReferences:
146
+ - assets:assets.web
147
+ ```
148
+
149
+ The referenced target must contain both `access_key_id` and `secret_access_key`. Every generated `.env.local`, transaction artifact, and `config/dev.local.yaml` must be ignored by Git.
150
+
151
+ ## github
152
+
153
+ ```sh
154
+ bun standards github --check
155
+ bun standards github --apply
29
156
  ```
30
157
 
31
- `dependabot --write` regenerates the composed `.github/dependabot.yml` from the canonical `.github/dependabot.base.yml` and the optional repo-owned `.github/dependabot.local.yml`; `init` and `sync` do the same automatically. `dependabot --check` verifies the generated file still matches its sources, and `doctor`/`check` include the same verification. The overlay is deliberately lean and additive only: new update blocks for repo-specific ecosystems, top-level private registry definitions, and `ignore` or `registries` entries appended by repeating a canonical block's normalized target. Matching blocks cannot add labels, groups, cooldowns, pull-request limits, or other policy. Update blocks for the same ecosystem and target branch must not select intersecting directories after Dependabot's path normalization. A plural `directories` target is expanded as a glob when it contains `*`, `?`, or both `[` and `]`: `*` and bare `**` stay within one path segment, `**/` matches zero or more directory segments, `?` matches one non-separator character, and bracket expressions match character sets or ranges. Singular `directory` values are always literal.
158
+ The command merges `.github/settings.json` with `.github/settings.local.json`, then compares or converges repository settings, declared rulesets, and canonical labels. Undeclared live labels are left alone. Undeclared repository-owned rulesets are removed by `--apply`.
159
+
160
+ `--apply` needs admin authentication and rechecks the API response instead of treating an accepted request as success. A repository whose plan cannot enforce rulesets may declare `"rulesetEnforcement": "unavailable-on-plan"` in the local settings file.
161
+
162
+ ## creds
163
+
164
+ The broker writes secret values directly into SOPS targets. It does not print them or pass them through command arguments.
32
165
 
33
- `dev-env` composes each workspace's dev environment from three declaration layers sharing one workspace shape — keyed by workspace group and a one-segment kebab-case workspace name (`apps.<name>`, `packages.<name>`): the tracked plain `config/dev.yaml`, the SOPS-encrypted `secrets/dev.yaml` (required, decrypted via sops), and the gitignored plain `config/dev.local.yaml`, applied in that order with later layers overriding per key. Effective values may also come from authorized broker-owned S3 pairs in separate SOPS targets referenced by either plain layer. Secret-layer env values are strings; a plain-layer env value may be a string or the brokered reference described below. A key declared in both tracked shared layers is a validation problem — a value is either configuration or a secret — while a local override of either is the file's purpose. Plain layers are optional and may be comment-only; `config/dev.local.yaml` must itself be gitignored because it may override secret values. The command transactionally writes every declared workspace's `.env.local` with owner-only permissions and a do-not-edit header naming the contributing sources. It also discovers direct `apps/*` and `packages/*` directories containing `package.json` and removes a stale `.env.local` only when its first line is that exact header; hand-owned files, edited headers, nested directories, and symlinked paths are left untouched. Writes and removals commit or roll back as one transaction, preserving prior contents, modes, and absent files. The final files and the transaction's actual random `.env.local.standards-*.tmp` and `.env.local.standards-*.bak` paths must all be gitignored before staging starts. Existing consumers must add those two artifact patterns themselves because `.gitignore` is seeded only during `init`; `sync` does not change it. Its portable dotenv codec exactly round-trips every value it accepts through Bun and Node without adding helper environment variables. A value the shared syntax cannot encode exactly is gathered as a validation problem instead of being changed silently. Validation gathers all document, containment, destination-type, workspace, and gitignore problems before writing anything; symlink destinations, duplicate resolved destinations, changed parent-directory identities, and symlinked workspace paths are rejected without following the link. Cleanup trouble after a completed commit is reported loudly as a warning rather than falsely reporting generation failure. Parent identities are checked immediately before each path operation; an unavoidable swap in the syscall-sized interval after a check remains outside the non-hostile maintainer threat model. The canonical `justfile` exposes the command as `just dev-env-generate`, and `just dev-refresh` chains a `just secrets edit dev` session into regeneration. A plain configuration layer may declare a **brokered S3 pair reference** instead of a literal: an object value `{ brokeredS3: <secrets-target>, key: <dotted.key>, part: access_key_id | secret_access_key }` pointing at a credential pair `creds add cloudflare --s3` minted into another SOPS target. An existing target name must bind exactly one contained file, either `infra/hosts/<name>/secrets.yaml` or `secrets/<name>.yaml`; both files existing is an ambiguity error, never host preference. The SOPS-encrypted `secrets/dev.yaml` must authorize every referenced pair with its exact `<secrets-target>:<dotted.key>` string under the reserved top-level `brokeredReferences` list. Plain layers reject that reserved key, and the secrets layer rejects reference objects: configuration selects a pair while encrypted policy authorizes its release into plaintext `.env.local`. Resolution rejects an unauthorized reference with the exact allowlist entry to add before invoking SOPS on that target. It then requires both `access_key_id` and `secret_access_key` to be strings, even when the reference selects only one part. Resolution runs after layer composition, so a later layer's literal overrides an earlier layer's reference and a reference that lost the merge is never decrypted; each authorized referenced target is decrypted once per run, and a missing target, ambiguous target, missing or partial pair, or unencodable resolved value is gathered as a named validation problem without exposing secret values. The secret value therefore keeps exactly one home — the broker's ledger. The loop closes on the broker side: after `creds add` verifies an exact referenced pair write, and after `creds apply` verifies a renewal in one, the command regenerates the dev env files itself, so a rotated pair reaches every generated `.env.local` without a manual step. Refresh evidence is pair-granular: a bearer sibling in the same SOPS file cannot trigger rendering of an unsafe pair, and a verified S3 sibling updates while an unsafe pair keeps its prior generated lines. If those prior owned lines cannot be proven and preserved, the refresh fails without changing any env file; every refresh failure is reported after the durable SOPS write remains committed.
166
+ ### Bootstrap providers
34
167
 
35
- `check` also rejects the raw token formed by `biome-` + `ignore` anywhere in lock-listed canonical files. The intentionally blunt policy keeps synced sources compatible with consumer Biome configurations without invoking Biome or maintaining language-aware comment parsing.
168
+ ```sh
169
+ bun standards creds login github
170
+ bun standards creds login github --org <org>
171
+ bun standards creds login cloudflare
172
+ bun standards creds status
173
+ ```
174
+
175
+ The machine-global broker store lives at `$XDG_CONFIG_HOME/standards/broker.yaml`, or `~/.config/standards/broker.yaml` by default, with owner-only permissions. It holds one private GitHub App per repository owner and one Cloudflare bootstrap token per account.
36
176
 
37
- `github --check` compares the live GitHub repository (including the canonical squash-only repository settings, rulesets, and declared labels) against the merged declaration in `.github/settings.json` + `.github/settings.local.json`; `github --apply` converges that declared state. The canonical declaration enables squash while disabling merge commits and rebases, and its default-branch ruleset independently allows only squash. Undeclared live labels remain untouched, while undeclared repository-owned rulesets are removed. `check` runs the same comparison whenever `.github/settings.json` is present, and fails closed: declared state the token cannot see fails the gate with a message naming the token fix instead of passing unverified. The canonical workflow sets `STANDARDS_SKIP_GITHUB_CHECK=true` only in its unprivileged quality step because its `check` aggregator job runs the live comparison with its own workflow token; this is a workflow-internal integration seam, not a general way to disable the local gate. The CLI prints an explicit diagnostic whenever that exact value skips either `check`'s live phase or `github --check`; `github --apply` is never skipped. `--apply` re-diffs the PATCH response, so a setting GitHub accepts with HTTP 200 but silently ignores (plan-unavailable features) is a reported failure, not a false success. A repository whose GitHub plan cannot enforce rulesets can declare that in the seam (see `rulesetEnforcement` below); both commands then skip rulesets and plan-gated repository settings, converge the rest, and print an unprotected-branch notice on every run.
177
+ ### Mint credentials
178
+
179
+ ```sh
180
+ bun standards creds add github --dest ci:ci.broker_app
181
+ bun standards creds add cloudflare \
182
+ --dest ci:ci.cloudflare_workers_token \
183
+ --permissions "Workers Scripts Write"
184
+ bun standards creds add cloudflare \
185
+ --dest assets:assets.screenshots_rw \
186
+ --bucket screenshots \
187
+ --s3 \
188
+ --permissions "Workers R2 Storage Bucket Item Write"
189
+ ```
38
190
 
39
- `structure` enforces the canonical monorepo structure contract: workspace scripts (`check-types`, `lint`, `lint:fix`, `test`), root gate scripts, filtered Turbo convenience aliases, internal `0.0.0`/`workspace:*` versioning, package `exports`, shared tsconfig inheritance, and browser a11y wiring. Only a workspace containing an explicit `*.a11y.ts` suite must provide a `test:a11y` script and direct `@axe-core/playwright` and `@playwright/test` dependencies. Every repo-owned workspace must carry a non-empty `README.md` as the prerequisite for documenting its configuration and secrets; the gate checks presence, not content completeness. Canonical workspaces synced from the standards template (the `apps/*` or `packages/*` entries in `sync-standards.json`) are exempt under the consumer profile because a consumer cannot fix them locally, and an unreadable or symlinked `sync-standards.json` fails the gate rather than guessing which workspaces are repo-owned. `structure` also validates the CI secrets contract without decrypting anything, using the plaintext key structure SOPS leaves in place: `secrets/ci.yaml` must be a contained regular file with complete SOPS metadata, every business leaf value must have a complete `ENC[AES256_GCM,...]` envelope (a rejected leaf is reported by key path only, never by value), and the repo-owned `secrets/ci.example.yaml` must mirror the structural business-key paths in both directions with plaintext placeholders. `ci.ntfy_topic_url` is always required for `Notify pause`. `ci.broker_app.app_id` and `ci.broker_app.private_key` are required for the weekly `Standards sync` workflow unless the validated `sync-standards.local.json` policy sets `"autoSync": false`. Required workflow values must each be one encrypted scalar because the resolver requires a string. The secrets files, workspace READMEs, and sync manifest cannot be supplied through symlinks. `check` includes `structure`, so these rules gate every consumer PR.
191
+ Use `--zone <id>` for zone-scoped Cloudflare permissions and `--jurisdiction eu` for an EU R2 bucket. Run `bun standards creds permissions` to list accepted permission-group names.
40
192
 
41
- `poller` runs one tick of the fix poller: host-level automation that turns maintainer-approved GitHub issues into verified draft PRs and maintainer-approved draft PRs into completed review-fix cycles, using headless Codex runs. All workflow state lives in GitHub labels, comments, and draft PRs (the labels are canonical declared settings — see `github --apply`), so ticks are stateless, re-runnable, and safe to schedule from any host. A tick claims work by label (`fix-in-progress` / `review-in-progress`), releases claims stale for longer than `staleClaimHours`, and fails loudly — a red tick means jobs stalled, never silence. A separate acknowledgement tick validates pending approvals and posts one deduplicated queued message per approval generation; it never claims or starts work, so it can keep giving maintainers prompt feedback while the worker is occupied. When a worker claims a request, it posts a concise start message. The exact approval and distributed claim records remain in hidden comment metadata, and losing claim contenders remove their duplicate comments. Trust is verified per event, not per configuration: the approval labels (`approved-for-fix`, `approved-for-review`) only count when the applying user holds the `admin` or `maintain` role, bind to the exact approved issue revision or PR head, and are revalidated before publication; only admin/maintain comments are treated as answers to agent questions. Approved Codex runs inherit the poller's GitHub token and use authenticated `gh` for relevant reads and comments; review runs also maintain the PR review ledger, apply authorized title or body edits, post fix threads, and file deferred findings directly. The run works in a throwaway git worktree, grants Codex write access to that worktree and its exact Git common directory so commits can update the linked repository metadata, and hands results back through a structured outcome file. The poller then verifies the approved head, commits, and protected paths before pushing or publishing; it replies to and resolves agent-posted fix threads only after the reviewed head is pushed, and it alone changes protocol labels, posts the final report, and flips a reviewed draft ready, while required CI remains the quality gate. If publishing a sealed fix or review result fails, the poller releases only its owned in-progress claim and keeps the approval and sealed output, so the next worker tick retries publication without another Codex run. Sealed review plans from the earlier protocol are rejected and their output branches are ignored, so the review reruns on a fresh protocol-versioned branch rather than silently dropping legacy deferred work. Host mutation is declarative-only: `--print-units` emits four correctly escaped systemd units for the polling host's infrastructure repository to adapt and deploy: the worker service and timer plus an independent lightweight acknowledgement service and timer. That repository owns the service identity, writable HOME, PATH, authenticated `gh`, lingering, and deployment. The worker service's tick budget (`TimeoutStartSec`) is derived from `maxJobsPerTick` × `runTimeoutMinutes` plus overhead, so re-render and redeploy the units after changing either value.
193
+ ### Reconcile Cloudflare tokens
42
194
 
43
- `creds` is the credential broker: it mints scoped Cloudflare tokens, rotates and revokes those tokens, and places GitHub App credentials into SOPS-encrypted targets — secret values never touch stdout, argv, or an agent's context; commands print only metadata (token name, scopes, expiry, destination). Cloudflare reconciliation has exactly two sources of truth: the plaintext key structure of the SOPS files and the provider token list under the deterministic naming scheme `standards/<owner>/<repo>/<sops-target>/<dotted.key>`; there is no separate credential manifest. `plan` and `apply` reconcile Cloudflare only: each run uses the stored bootstrap credential to verify its current provider token ID, excludes that ID from reconciliation regardless of its current name, and aborts if the identity cannot be correlated with the complete account token list; a brokered token whose SOPS key was deleted is revoked, while one nearing expiry (30 days) is renewed by creating a fresh-expiry replacement with the live token's policies, durably writing and verifying the new value, and only then revoking the old token; secrets the broker did not mint are never touched. Both also report what reconciliation will never touch, in two separately labelled and separately counted blocks that never block: unmanaged tokens, meaning every unexpired token in the account whose name falls outside the reserved `standards/` namespace — with one exception, this machine's own bootstrap credential, which every run removes by verified ID before anything is classified — and tokens brokered to another repository, each printed with the repository whose `apply` owns it. An expired token is omitted from the unmanaged listing because it grants nothing. Neither block is idle information: nothing here renews or revokes those tokens, and a forgotten one — the original half of a hand-made credential that was replaced rather than retired, or a brokered token whose repository was renamed away — stays valid indefinitely, so a listed token is normally printed with the exact command that retires it, carrying `--account` and, for a token brokered elsewhere, `--force` and the one condition that justifies it. Two rows are exceptions. A token named `standards-broker` holds the reserved name for a machine's bootstrap credential, so it is either another machine's or a superseded one on this machine; `revoke` refuses it by name, so the row names the Cloudflare dashboard rather than a command that would always fail. The other exception looks like an ordinary brokered-elsewhere row, and its command fails. `plan` classifies by exact token name, so a token whose brokered repository differs from this checkout's origin only in capitalisation lands in the brokered-elsewhere block with a `--force` command; `revoke` compares repository names case-insensitively, reads the same token as this checkout's own, and refuses. Row and block header both read that token as foreign — the header labels the block tokens brokered to another repository, and the row explains the `--force` by the owning repository having been renamed, transferred, or deleted. Neither holds there: GitHub names are case-insensitive, so the owning repository is this one and it is still alive. Re-point the origin remote at the capitalisation the token carries, or retire the token in the Cloudflare dashboard. A name that claims this repository's brokered namespace without being one the broker mints is a finding instead, and findings abort reconciliation before any mutation, because reconciliation cannot own that token; plain `revoke --token-id` takes it once you decide it should go. `revoke --token-id <id>` deletes exactly one Cloudflare token, named by its 32-character hexadecimal ID, with `--account <id>` required whenever more than one account is configured; it records no ownership, so the power is momentary rather than standing and a human names the target every time. It refuses an ID the account does not hold, the bootstrap credential this machine has stored (matched by verified ID, so a rename cannot disguise it), and any other token named `standards-broker`, the reserved name for a machine's bootstrap (matched by name, because that one is another machine's bootstrap or a superseded one, retired in the Cloudflare dashboard where you can confirm whose it is — the broker cannot re-mint its own root credential). A token brokered to this repository is refused with the remedy that works here: delete its SOPS key in this repository and run `apply`, which revokes the token and keeps the secret in step. A token whose brokered name differs from this checkout's origin only in capitalisation is refused too, and without the `apply` remedy: reconciliation matches the name exactly, so from here it would neither renew nor revoke the token. Its remedies are re-pointing the origin remote at the capitalisation the token carries, which brings it back under reconciliation, or retiring it in the Cloudflare dashboard. A token brokered to a repository that is genuinely a different one is refused with that repository named, because the same `apply` remedy runs there. `--force` widens exactly that last refusal, and nothing else: it lets `revoke` delete a token whose brokered repository is not this checkout's. It verifies nothing about the state of that repository, so it is justified only when nothing reconciles the token any more — the owning repository was renamed, transferred, or deleted, and no checkout resolves to its name. `revoke` decides ownership from the origin remote and compares it case-insensitively, as GitHub names are; `plan` classifies by exact name instead, which is why the two disagree about a case-only difference. When the origin remote resolves to no GitHub repository, every brokered token is refused, `--force` included, because the check it widens is the one that could not be run. `--force` never bypasses either bootstrap guard, the case-only refusal, or that unresolvable-origin refusal. Without a manifest there is no desired-policy record, so live policy drift is not detected, and a repository rename or transfer changes the deterministic namespace and requires the visible old token to be re-minted under the new name and revoked. `add cloudflare` mints an account-owned API token (default TTL 90 days) scoped to the named permission groups (`permissions` lists the valid names) and writes it to `--dest <target>:<dotted.key>`, where `<target>` resolves like the canonical `just secrets` targets (`ci` → `secrets/ci.yaml`, `prod-1` → `infra/hosts/prod-1/secrets.yaml`). `--zone <zone-id>[,<zone-id>...]` adds a zone resource so zone-scoped groups such as DNS Write can be minted. Zones are named by their 32-character hexadecimal ID, shown on the zone's dashboard overview and not a secret; resolving a domain name instead would need Zone Read on the bootstrap token, which holds Account API Tokens / Edit and nothing else. With zones named, the selection is split by what each group can target: every group Cloudflare reports as zone-scoped forms one policy holding all named zones, and groups that can only target an account keep their own account policy on the same token, so one credential can hold DNS access next to account-wide access. A group Cloudflare reports as both takes the zone policy, which is the narrower reading of `--zone`. A group matching neither resource is named and rejected, `--zone` requires at least one zone-scoped group, and `--zone` cannot be combined with `--bucket`, which is a separate credential. The mint summary prints the resources the token reaches, so an account policy alongside the zones is visible rather than implied. `--bucket <name>` switches the policy resource to a single R2 bucket; `--jurisdiction default|eu` selects the provider jurisdiction and defaults to `default`, producing `com.cloudflare.edge.r2.bucket.<account_id>_default_<bucket>` or `com.cloudflare.edge.r2.bucket.<account_id>_eu_<bucket>`. FedRAMP jurisdictions are not supported. Bucket destinations accept only bucket-scoped groups such as Workers R2 Storage Bucket Item Read/Write, and account-scoped groups are rejected. `--s3` requires `--bucket` and stores the S3-compatible credential pair Cloudflare derives from an API token — access key ID is the token ID, secret access key is the SHA-256 hex digest of the token value — as `<dotted.key>.access_key_id` and `<dotted.key>.secret_access_key` under the destination instead of the raw token value; the default endpoint is `https://<account_id>.r2.cloudflarestorage.com`, while EU uses `https://<account_id>.eu.r2.cloudflarestorage.com`. Reconciliation infers each destination's concrete write footprint from the plaintext SOPS key structure — a bearer owns the leaf at its key, while an S3 token owns both pair leaves — and aborts before mutation when managed footprints intersect. `plan` and `apply` renew and revoke S3 destinations like any other brokered token, but renewal first proves the stored access key ID matches the current provider token; an incomplete pair, unreadable value, or identity mismatch is surfaced as a finding and never mutated automatically. `add github` selects the private broker App whose owner matches the destination repository's origin owner, checks both local SOPS leaves before authenticating, proves that the exact selected App is installed on that repository, and writes only while that full App identity still holds the synchronized broker-store entry; missing, duplicate, replaced, or mismatched owners fail before SOPS changes. Durable GitHub tokens cannot be created via API (PAT and OAuth-app creation are UI-only), so workflows mint short-lived installation tokens from the App at runtime (`actions/create-github-app-token`), scoped per repository and permission. The canonical weekly sync expects `bun standards creds add github --dest ci:ci.broker_app`, then mints a current-repository branch writer with Contents write and Workflows write plus a separate PR opener with Contents read and Pull requests write; both mint before sync but enter only their post-sync operations, and missing credentials, unapproved App permissions, or minting failures stop the workflow without a fallback. Existing broker Apps must add Workflows write on the App settings page and have every installation owner approve that permission before consumers adopt the workflow. Bootstrap is once per machine and per GitHub owner: `login github` creates a private personal App, while `login github --org <org>` creates or replaces only that organization's entry; each manifest conversion records GitHub's authoritative owner, and the command opens the installation page, where the App must be bound to selected repositories rather than all repositories. GitHub App names are globally unique and limited to 34 characters, so organization defaults include owners up to 17 characters; a longer owner or a colliding replacement name requires an explicit shorter unused `--name`. The first GitHub-specific command against an existing singleton broker store authenticates as that App, resolves its registration owner, and atomically migrates the old mapping to that one owner; a failed lookup leaves the persisted bytes untouched. If the singleton was a public App installed on repositories owned by other users or organizations, those repositories stop matching after migration because owner selection no longer treats that App as shared. For each affected owner, run `login github` while signed in as that personal owner or `login github --org <owner>`, install the new private App only on the selected repositories, run `bun standards creds add github --dest <target>:<key>` in every consumer, and verify its workflows can mint tokens. Retire the old public App only after every repository owner has its own entry, every intended SOPS destination has been reprovisioned, and token minting has been verified; until then, keep its key and installation available for any destinations not yet migrated. `login cloudflare` guides the one dashboard paste Cloudflare requires for the first account token (named `standards-broker` to match the App, created from the "Create additional tokens" token template because its "Account API Tokens: Edit" permission is unavailable in the custom token builder, and holding that permission only), verifies that it is active, correlates its verified ID with the complete account token list and an active list record, and stores it; a bootstrap token named inside the minted `standards/` namespace is rejected before storage to keep its role unambiguous, while any other divergence from the recommended name only warns. `plan` and `apply` do not rotate GitHub App keys; create a replacement key on the App's settings page, atomically replace that owner's `private_key` in the protected machine-global broker store while preserving its `0600` mode, then update every intended SOPS destination, verify workflows can mint installation tokens, and revoke the old key manually. Root credentials live in the machine-global broker store (see Configuration); SOPS writes go through `sops edit` with a non-interactive editor, preserving comments and reusing the file's data key.
195
+ ```sh
196
+ bun standards creds plan
197
+ bun standards creds apply
198
+ ```
199
+
200
+ The desired destinations are inferred from SOPS key structure. `plan` reports renewals, revocations, unmanaged tokens, and tokens owned by another repository. `apply` renews expiring brokered tokens and revokes brokered tokens whose SOPS destination was removed. It never changes credentials it did not mint.
201
+
202
+ To delete one Cloudflare token outside normal reconciliation:
203
+
204
+ ```sh
205
+ bun standards creds revoke --account <account-id> --token-id <token-id>
206
+ ```
207
+
208
+ Bootstrap credentials and tokens still owned by an active repository are refused.
209
+
210
+ ## screenshots
211
+
212
+ ```sh
213
+ bun standards screenshots publish docs/pr/settings-page.png docs/pr/settings-empty-state.png
214
+ ```
215
+
216
+ The command reads `config/screenshots.yaml`, resolves its S3 pair from SOPS, uploads each supported image to a content-addressed key, and prints Markdown image lines in input order.
217
+
218
+ ```yaml
219
+ pair: assets:assets.screenshots_rw
220
+ bucket: screenshots
221
+ endpoint: https://<account-id>.r2.cloudflarestorage.com
222
+ publicBaseUrl: https://screenshots.example.com
223
+ ```
224
+
225
+ Published URLs are public and permanent. Use demo data and exclude secrets and personal data.
226
+
227
+ ## poller
228
+
229
+ ```sh
230
+ bun standards poller --config <path>
231
+ bun standards poller --acknowledge-only --config <path>
232
+ bun standards poller --print-units --config <path>
233
+ ```
234
+
235
+ The host-level JSON configuration requires:
236
+
237
+ ```json
238
+ {
239
+ "repos": ["owner/repo"],
240
+ "model": "<codex model>",
241
+ "reasoningEffort": "<effort>"
242
+ }
243
+ ```
44
244
 
45
- `screenshots publish` uploads UI screenshots to the repository's configured public bucket and prints one PR-ready markdown image line per file in input order. The feature is opt-in through the tracked `config/screenshots.yaml`; without it the command reports that publishing is not enabled. Validation gathers every configuration and file problem before any upload starts. It rejects unreadable or empty files, unsupported extensions (`.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`), and basenames that are not URL-safe. Objects land at `screenshots/<sha256-of-content>/<basename>`, so identical bytes republish to the same URL and a key cannot identify different bytes. The markdown alt text is the basename without its extension. The command resolves the named S3 pair from its SOPS target at publish time. It uses the values in memory and never prints, exports, or copies them elsewhere. A missing target or pair fails with the exact `creds add cloudflare --s3` invocation that mints it. Published URLs are public to anyone holding the link. The synced `screenshots-in-prs` skill owns the capture conventions and forbids screenshots of real secrets or personal data. `--dir <path>` selects the repository when not running from its root.
245
+ Optional keys are `maxJobsPerTick`, `staleClaimHours`, `runTimeoutMinutes`, `cacheDir`, and `extraCodexArgs`. One poller supports at most 12 repositories.
46
246
 
47
- `structure --profile source` validates the standards source repository itself, which is deliberately not a consumer. The profile pins its intentional exceptions so they cannot drift silently: exact, ordered root gate scripts that run this CLI from the local checkout (`structure --profile source`, `dependabot --check` or `dependabot --write`, `github --check`, and the Turbo gate) instead of a recursive `standards check`, and a non-private published bin-only CLI workspace that carries a stable release SemVer and exactly maps the `standards` bin to `src/cli.ts` without `exports`. Every other consumer rule still applies.
247
+ The worker accepts only exact issue or draft-PR revisions approved by a user with `admin` or `maintain` role. It runs Codex in a disposable worktree, revalidates approval before publication, and leaves merge to a human. The polling host owns authenticated `codex` and `gh`, the service token, writable home, configuration, and systemd deployment.
48
248
 
49
- ## Configuration
249
+ ## Configuration index
50
250
 
51
- - **`.github/dependabot.local.yml`** (optional) — repo-owned Dependabot extension composed with the canonical `.github/dependabot.base.yml` into the generated `.github/dependabot.yml`. May define `updates` and top-level `registries`; a block matching a canonical normalized target may only add `ignore` and/or `registries` entries. Other matching-block policy is rejected deliberately. A missing or comments-only file means no additions. CLI 0.10.1 requires the selected content ref to contain the canonical base and rejects older refs before mutation.
52
- - **`sync-standards.local.json`** (optional) — consumer-owned sync policy at the repo root, validated by `doctor`/`check` and every `init`/`sync` even when an explicit ref or local source makes its `"ref"` irrelevant. All fields optional; a missing file means the defaults. `"ref"` is a non-empty single-line string that pins a tag, branch, or full commit sha to sync from instead of `main` (an explicit `--ref` overrides it; a local-path `--from` source is used as-is and ignores only the validated pin). `"autoSync": false` is read by the standards-sync workflow, not the CLI, and skips the weekly scheduled run; deliberate syncs then run locally because the secret-bearing workflow is schedule-only. Version 0.7.0 removes the legacy `STANDARDS_AUTO_SYNC` and `STANDARDS_SYNC_REF` variable behavior; consumers must upgrade the package and lockfile before adopting a policy file.
53
- - **`.github/settings.local.json` `"rulesetEnforcement": "unavailable-on-plan"`** (optional) — declares that the repository's GitHub plan cannot enforce rulesets (private repositories on GitHub Free, both personal accounts and organizations). `github --check` and `--apply` then skip rulesets instead of comparing them, because a comparison cannot be trusted there: personal accounts answer ruleset reads with HTTP 403, and free-plan organizations report declared rulesets as active while silently not enforcing them. Plan-gated repository settings that only function alongside branch protection (`allow_auto_merge`) are skipped for the same reason — GitHub accepts a PATCH for them with HTTP 200 and silently keeps the old value. The remaining repository merge settings are still checked and converged, and both commands print an unprotected-branch notice on every run. The only accepted value is `"unavailable-on-plan"` (enforcement is the default; omit the key on paid plans), and combining the opt-out with additional local rulesets is rejected. After upgrading the plan, remove the declaration and run `bun standards github --apply` to restore enforcement.
54
- - **`config/screenshots.yaml`** (optional; required for `screenshots publish`). This tracked per-repository declaration enables screenshot publishing. It has exactly four required keys: `pair` (the brokered S3 credential as `<target>:<dotted.key>`, e.g. `assets:assets.screenshots_rw`, minted with `bun standards creds add cloudflare --s3 --dest <target>:<key> --bucket <bucket> --permissions "Workers R2 Storage Bucket Item Write"`), `bucket` (the bucket name), `endpoint` (the S3 endpoint URL, e.g. `https://<account_id>.r2.cloudflarestorage.com`), and `publicBaseUrl` (the public base URL serving the bucket, e.g. a custom domain bound to it). Every value here is configuration, not a secret. The credential pair stays in its SOPS target and is resolved only at publish time.
55
- - **Poller config file** (required for `poller`, passed via `--config`) — host-level JSON, deliberately not repository state. Required: `"repos"` (1–12 unique `owner/repo` strings), `"model"` and `"reasoningEffort"` (passed to `codex exec`; the model choice is deliberate and has no default). The 12-repository maximum and five-minute acknowledgement cooldown keep supported mixed fix/review queues and persisted review-plan recovery below the 5,000-request/hour GitHub API budget with at least 1,400 requests/hour reserved for pagination, active jobs, writes, and other token users; the compound regression bound covers four acknowledged fixes plus four acknowledged reviews with persisted plans in every repository at no more than 3,312 requests/hour. Existing configs above the repository limit must be reduced or split across pollers with independent GitHub API budgets before upgrading. Optional: `"maxJobsPerTick"` (default 1 — the maximum number of new Codex runs the sequential worker may start in one tick), `"staleClaimHours"` (default 6; must exceed `runTimeoutMinutes` so a sweep can never release the claim of a job that is still running), `"runTimeoutMinutes"` (default 240 — the timeout catches wedged agents, not honest multi-hour review runs), `"cacheDir"` (default `~/.cache/standards-poller`; holds bare mirrors and job worktrees; relative paths resolve against the config file), `"extraCodexArgs"` (extra `codex exec` arguments, e.g. enabling the collaboration feature for subagent fan-out). Unknown keys are rejected. The poller needs `git`, `gh`, `codex` (authenticated — its rotating auth state must live in a writable location), and a GitHub token per the bullet below; the token needs issues, pull-requests, and contents write on the watched repos, and nothing else.
56
- - **Broker store** (created by `creds login`) — machine-global root credentials at `$XDG_CONFIG_HOME/standards/broker.yaml` (default `~/.config/standards/broker.yaml`; override with `STANDARDS_BROKER_FILE`), holding one private GitHub App identity (owner, id, slug, client id, private key) per GitHub account and one bootstrap token per Cloudflare account. The file is plaintext with `0600` permissions — deliberately the same local-account trust boundary as the plaintext personal age identity at `~/.config/sops/age/keys.txt`, which unlocks the same secrets; SOPS-encrypting the store to that adjacent identity would not improve custody. Writes use an owner-only temporary file and atomic replacement, and simultaneous provider logins merge rather than overwrite other accounts; `creds status` lists every App and owner and warns when the final mode is broader. The store lives outside every repository, is never synced or backed up, and losing it is cheap: re-run the provider login commands, revoke the old App keys on each App's settings page, and retire the old bootstrap tokens in the Cloudflare dashboard. The dashboard is the only route for those tokens: `login cloudflare` walks you through creating a second one under the reserved `standards-broker` name, the old one stays live under that same name, and `revoke` refuses every token holding it. On an additional machine, do not create second Apps: generate an additional private key from each existing App's settings page (GitHub Apps support several active keys; key generation has no API) and add it to that machine's store, so retiring a machine revokes one key per owner, not the setups.
57
- - **`GH_TOKEN` / `GITHUB_TOKEN`** (optional generally; poller automation requires this or a logged-in `gh`) — GitHub API token for the `github` command and the GitHub portion of `check`; poller runs pass environment tokens through to Codex, while a local poller can share the service identity's authenticated `gh` state. When neither is available, other commands can still read public repositories anonymously, but poller writes and `github --apply` fail. GitHub's REST API reveals repo merge settings only to write-capable viewers, and `check` retries REST-hidden keys over GraphQL, which serves them to read-only tokens. REST serves ruleset `bypass_actors` only to a user-scoped token holding repository Administration read (a fine-grained PAT with that permission, or the local `gh` CLI under an admin account), and never to a GitHub App installation token at any permission level, so `check` retries the hidden lists over GraphQL, which withholds the actor identities but answers an exact bypass-actor count (established for a GitHub App installation token and for a non-admin classic-scope viewer, not for every identity class): a declared-empty list verifies exactly, a count that disagrees with the declared length is drift, and a matching non-zero count leaves *which* actors bypass unconfirmed, so the gate fails closed on that ruleset. An installation-token run therefore leaves a declared non-empty list failing until the check is re-run locally with admin `gh` auth; widening the App's permissions is not the fix. Private-repository labels require Issues read (or Pull requests read); a token that still cannot see declared state fails the check rather than passing unverified. In CI, the canonical workflow verifies with the workflow token, granted read-only "Contents" and "Issues"; Issues is what declared-label reads need, listing rulesets rides on the implicit "Metadata" read, and merge settings come over GraphQL. A private-repository probe compared that grant set against a broker App installation token across every read the check performs and found no difference, so CI provisions no settings credential of its own.
251
+ | File or variable | Purpose |
252
+ | --- | --- |
253
+ | `sync-standards.json` | Canonical source, seed directory, and managed paths. |
254
+ | `sync-standards.local.json` | Optional `ref` pin and `autoSync` policy. |
255
+ | `sync-standards.lock` | Exact synchronized commit and managed digests. |
256
+ | `.github/dependabot.local.yml` | Project-owned Dependabot additions. |
257
+ | `.github/settings.local.json` | Project-owned GitHub settings additions. |
258
+ | `config/dev.yaml` | Shared non-secret development configuration. |
259
+ | `secrets/dev.yaml` | Shared development secrets and broker-reference policy. |
260
+ | `config/dev.local.yaml` | Machine-specific overrides. |
261
+ | `config/screenshots.yaml` | Public screenshot bucket and SOPS pair reference. |
262
+ | `STANDARDS_BROKER_FILE` | Optional broker-store path override. |
263
+ | `GH_TOKEN` or `GITHUB_TOKEN` | GitHub API authentication where required. |
58
264
 
59
- See the standards repository README for the ownership model and adoption workflow.
265
+ The [root README](../../README.md) gives the short overview. The [adoption guide](../../docs/adoption.md) and [sync guide](../../docs/sync-and-ownership.md) explain repository ownership and first use.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davidvornholt/standards",
3
- "version": "0.25.0",
3
+ "version": "0.26.1",
4
4
  "description": "Bootstrap, synchronize, and validate davidvornholt/standards consumers",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -164,6 +164,7 @@
164
164
  "src/screenshots-upload.ts",
165
165
  "src/sops-exec.ts",
166
166
  "src/structure-check.ts",
167
+ "src/structure-bun-version.ts",
167
168
  "src/structure-profile.ts",
168
169
  "src/structure-readme.ts",
169
170
  "src/structure-secret-document.ts",
@@ -183,17 +184,17 @@
183
184
  },
184
185
  "devDependencies": {
185
186
  "@davidvornholt/typescript-config": "0.0.0",
186
- "@types/bun": "^1.3.14",
187
+ "@types/bun": "^1.4.2",
187
188
  "sigstore": "5.0.0",
188
189
  "typescript": "7.0.2"
189
190
  },
190
191
  "engines": {
191
- "bun": ">=1.3.14"
192
+ "bun": ">=1.4.2"
192
193
  },
193
194
  "publishConfig": {
194
195
  "access": "public"
195
196
  },
196
197
  "dependencies": {
197
- "yaml": "^2.9.0"
198
+ "yaml": "^2.9.1"
198
199
  }
199
200
  }
@@ -3,6 +3,8 @@
3
3
  // itself, lists and mints scoped tokens, and revokes them. Token values
4
4
  // returned by create flow only into SOPS writers,
5
5
  // never stdout.
6
+ // User-owned tokens are intentionally outside this API and the bootstrap
7
+ // credential's authority; they must be managed separately in Cloudflare.
6
8
 
7
9
  import {
8
10
  type CfResult,
@@ -57,6 +57,8 @@ export const loadOwnedGithubStore = async (
57
57
  return { ok: true, value: migrated };
58
58
  };
59
59
 
60
+ // Private Apps belong to one owner. Selecting by repository owner keeps each
61
+ // owner's credentials separate; installation access is verified before export.
60
62
  export const selectGithubAppForRepo = (
61
63
  apps: ReadonlyArray<GithubBrokerApp>,
62
64
  repo: string,
package/src/creds-plan.ts CHANGED
@@ -7,6 +7,8 @@
7
7
  // tokens it minted for another repository, are reported
8
8
  // (creds-plan-unmanaged.ts) but never mutated. Execution lives in
9
9
  // creds-plan-run.ts.
10
+ // Live policy is preserved, not compared with a separate desired-policy manifest.
11
+ // Adding policy-drift enforcement would require a new source of truth.
10
12
 
11
13
  import { cloudflareExpiresOn } from './creds-cloudflare-expiry';
12
14
  import { groupByIntersectingFootprint } from './creds-plan-groups';
@@ -143,7 +143,6 @@ export const applySopsEditorChanges = (
143
143
  }
144
144
  document.setIn(path, change.value);
145
145
  }
146
- // biome-ignore lint/nursery/noBaseToString: YAML Document implements toString as its comment-preserving serializer.
147
146
  return document.toString();
148
147
  };
149
148
  const runEditor = (): void => {
@@ -24,7 +24,7 @@ export const startBrokerLockLease = (
24
24
  holderPath: string,
25
25
  intervalMs: number,
26
26
  ): Worker => {
27
- const lease = new Worker(import.meta.url, {
27
+ const lease = new Worker(new URL(import.meta.url), {
28
28
  workerData: { holderPath, intervalMs } satisfies LeaseWorkerData,
29
29
  });
30
30
  lease.unref();
@@ -24,6 +24,9 @@ export type BrokerStore = {
24
24
  readonly cloudflare: ReadonlyArray<CloudflareBrokerAccount>;
25
25
  };
26
26
  export const EMPTY_BROKER_STORE: BrokerStore = { github: [], cloudflare: [] };
27
+ // This machine-global store trusts the local account, like its age private key.
28
+ // Encrypting it with a colocated key would not protect against that account.
29
+ // Repository secrets still belong in SOPS; this store stays outside repositories.
27
30
  const OWNER_ONLY_FILE_MODE = 0o600;
28
31
  const OWNER_ONLY_DIR_MODE = 0o700;
29
32
  const FILE_MODE_MODULUS = 0o1000;
@@ -22,6 +22,8 @@ export type ResolvedDevEnv = {
22
22
  readonly problems: ReadonlyArray<string>;
23
23
  };
24
24
 
25
+ // Each variable independently selects a complete pair and then one part.
26
+ // Variable names and neighboring references do not imply a shared credential.
25
27
  const lookupReference = (
26
28
  document: unknown,
27
29
  reference: BrokeredS3Reference,
@@ -120,6 +120,8 @@ const BYPASS_ACTOR_PROBE = 1;
120
120
  // `totalCount` means the connection is being filtered rather than merely
121
121
  // redacted, so it supplies no count; a null *element* is the documented
122
122
  // identity-withholding shape, so only the length is checked.
123
+ // Probes with restricted tokens confirmed that hidden actors still count:
124
+ // https://github.com/davidvornholt/standards/pull/176
123
125
  const countedRuleset = (node: unknown): readonly [number, number] | null => {
124
126
  if (!isRecord(node) || typeof node.databaseId !== 'number') {
125
127
  return null;
@@ -163,6 +163,9 @@ export const runCodex = async (
163
163
  {
164
164
  detached: true,
165
165
  stdio: ['ignore', 'ignore', 'pipe'],
166
+ // Approved runs share the host service identity and its GitHub token.
167
+ // Approval and write revalidation constrain the workflow; they do not
168
+ // isolate credentials. This assumes trusted, maintainer-approved work.
166
169
  env: { ...process.env },
167
170
  },
168
171
  );
@@ -0,0 +1,12 @@
1
+ const BUN_PACKAGE_MANAGER =
2
+ /^bun@(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u;
3
+ const PACKAGE_MANAGER_PROBLEM =
4
+ 'package.json: "packageManager" must pin an exact bun@x.y.z version';
5
+
6
+ export const collectBunVersionProblems = (
7
+ manifest: Record<string, unknown>,
8
+ ): ReadonlyArray<string> =>
9
+ typeof manifest.packageManager === 'string' &&
10
+ BUN_PACKAGE_MANAGER.test(manifest.packageManager)
11
+ ? []
12
+ : [PACKAGE_MANAGER_PROBLEM];
@@ -3,6 +3,7 @@ import { readdir } from 'node:fs/promises';
3
3
  import { isAbsolute, join } from 'node:path';
4
4
  import { isRecord } from './github-settings-parse';
5
5
  import { readJsonFile } from './json-file';
6
+ import { collectBunVersionProblems } from './structure-bun-version';
6
7
  import {
7
8
  missingPublishedCliProblems,
8
9
  rootScriptExpectations,
@@ -189,6 +190,7 @@ export const collectStructureProblems = async (
189
190
  ...resolved.flatMap((r) => (r.problem === null ? [] : [r.problem])),
190
191
  ...loaded.flatMap((l) => (l.problem === null ? [] : [l.problem])),
191
192
  ...missingPublishedCliProblems(profile, workspaces),
193
+ ...collectBunVersionProblems(root),
192
194
  ...inspectRootScripts(root, profile, requireA11y),
193
195
  ...inspections.flatMap((i) => [...i.problems]),
194
196
  ...readmeProblems,
@@ -8,9 +8,10 @@ import { isRecord } from './github-settings-parse';
8
8
  // drifting silently while the normal quality gate stays green.
9
9
  export type StructureProfile = 'consumer' | 'source';
10
10
 
11
- const CONSUMER_CHECK = 'turbo run lint check-types test build test:a11y';
11
+ const CONSUMER_CHECK =
12
+ 'turbo run lint check-types test build test:a11y --output-logs=errors-only';
12
13
  const CONSUMER_CHECK_FIX =
13
- 'turbo run lint:fix check-types test build test:a11y';
14
+ 'turbo run lint:fix check-types test build test:a11y --output-logs=errors-only';
14
15
  const ROOT_A11Y = 'turbo run test:a11y';
15
16
 
16
17
  export const PUBLISHED_CLI_WORKSPACE = 'packages/standards-cli';
@@ -32,7 +33,7 @@ const SOURCE_ROOT_EXPECTATIONS: ReadonlyArray<RootScriptExpectation> = [
32
33
  `${SOURCE_CLI} structure --profile source`,
33
34
  `${SOURCE_CLI} dependabot --check`,
34
35
  `${SOURCE_CLI} github --check`,
35
- 'turbo run lint check-types test',
36
+ 'turbo run lint check-types test --output-logs=errors-only',
36
37
  ],
37
38
  exact: true,
38
39
  },
@@ -42,7 +43,7 @@ const SOURCE_ROOT_EXPECTATIONS: ReadonlyArray<RootScriptExpectation> = [
42
43
  `${SOURCE_CLI} structure --profile source`,
43
44
  `${SOURCE_CLI} dependabot --write`,
44
45
  `${SOURCE_CLI} github --check`,
45
- 'turbo run lint:fix check-types test',
46
+ 'turbo run lint:fix check-types test --output-logs=errors-only',
46
47
  ],
47
48
  exact: true,
48
49
  },