@davidvornholt/standards 0.22.1 → 0.22.2
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 +1 -1
- package/package.json +1 -1
- package/src/cli.ts +2 -2
- package/src/github-live-drift.ts +1 -1
- package/src/poller-outcome.ts +5 -3
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ standards poller --print-units --config <path>
|
|
|
33
33
|
|
|
34
34
|
`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.
|
|
35
35
|
|
|
36
|
-
`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
|
|
36
|
+
`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.
|
|
37
37
|
|
|
38
38
|
`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. `check` includes `structure`, so these rules gate every consumer PR.
|
|
39
39
|
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -1216,13 +1216,13 @@ const runCheckCommand = async (consumer: string): Promise<boolean> => {
|
|
|
1216
1216
|
};
|
|
1217
1217
|
|
|
1218
1218
|
// The canonical workflow sets this only for its unprivileged quality job,
|
|
1219
|
-
// where
|
|
1219
|
+
// where the check aggregator job runs the same live check with its own workflow
|
|
1220
1220
|
// token. Absent that exact workflow seam, local and explicit checks remain
|
|
1221
1221
|
// fail-closed.
|
|
1222
1222
|
const runGithubCheckGate = (consumer: string): Promise<boolean> => {
|
|
1223
1223
|
if (process.env[SKIP_GITHUB_CHECK_ENV] === 'true') {
|
|
1224
1224
|
console.log(
|
|
1225
|
-
`standards github: live settings check skipped because ${SKIP_GITHUB_CHECK_ENV}=true; the canonical workflow's
|
|
1225
|
+
`standards github: live settings check skipped because ${SKIP_GITHUB_CHECK_ENV}=true; the canonical workflow's check aggregator job must own this check`,
|
|
1226
1226
|
);
|
|
1227
1227
|
return Promise.resolve(true);
|
|
1228
1228
|
}
|
package/src/github-live-drift.ts
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import { type GithubSettings, isRecord } from './github-settings-parse';
|
|
36
36
|
|
|
37
37
|
const LABEL_VISIBILITY_PROBLEM =
|
|
38
|
-
'declared labels not visible to this token, so the gate cannot verify them. Label reads need issues: read (or pull-requests: read); the canonical
|
|
38
|
+
'declared labels not visible to this token, so the gate cannot verify them. Label reads need issues: read (or pull-requests: read); the canonical check aggregator job already grants issues: read, so in CI this points at a stale synced workflow or an organization policy restricting the workflow token rather than anything to change in the declaration. Locally, use a token with one of those permissions';
|
|
39
39
|
const PERMISSION_DENIAL_MESSAGES: ReadonlySet<string> = new Set([
|
|
40
40
|
'Resource not accessible by integration',
|
|
41
41
|
'Resource not accessible by personal access token',
|
package/src/poller-outcome.ts
CHANGED
|
@@ -54,9 +54,11 @@ const REVIEW_STATUSES: ReadonlySet<string> = new Set([
|
|
|
54
54
|
'cannot-review',
|
|
55
55
|
]);
|
|
56
56
|
|
|
57
|
-
// Conventional Commit subject:
|
|
58
|
-
//
|
|
59
|
-
|
|
57
|
+
// Conventional Commit subject: squash merges promote the PR title to the
|
|
58
|
+
// commit subject on main, and no CI gate lints it, so this validation is
|
|
59
|
+
// the enforcement point for poller-authored PRs.
|
|
60
|
+
const PR_TITLE_PATTERN =
|
|
61
|
+
/^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?:\([a-z0-9./-]+\))?!?: [^ \n\r\u2028\u2029]/u;
|
|
60
62
|
|
|
61
63
|
export const readFixOutcome = async (
|
|
62
64
|
workDir: string,
|