refactor(governance): close M15 decision-test residual + L12 least-privilege docs checker (#1230 B2.8) - #1296
Merged
Merged
Conversation
…privilege docs checker (#1230 B2.8)
Deploying openelement with
|
| Latest commit: |
0dc9c1e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://15012e55.lessjs.pages.dev |
| Branch Preview URL: | https://fix-1230-b2-8-governance-ded.lessjs.pages.dev |
Contributor
|
APIError: Insufficient Balance |
…B2.8 thinker follow-up)
Contributor
|
APIError: Insufficient Balance |
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1230. Refs #1288 (stage), #1155 (umbrella), #1216 (A10.8 M15 origin). Dependencies landed: #1294 (B2.6), #1295 (B2.7). ADR-0144 boundary, ADR-0151 train.
Problem
After B2.6/B2.7 burned down the bespoke generic machinery, three residuals remained on the CI/check/task governance surface:
check-repo-hygiene.ts(allow/deny classification: credential-template carve-out, large-binary allowlist, tracked-ignored allowlist, removed-package-mention allowlist),check-static-output-freeze.ts(the normalizers that decide which byte differences are masked before the freeze comparison — precisely "logic that can turn failure into success"),check-visual-baseline-duplicates.ts(hash-grouping verdict).deno run -A— ambient authority for a docs check that needs only read + git.policy.ts→ deno tasks → owning scripts) stays free of duplicate owners.Owner
One responsibility, one semantic owner after this PR:
tools/autoflow/policy.ts(machine-readable)policy.test.ts(every gate → existing task; no two gates share a command)check-repo-hygiene.tsrepo:hygienegate; content-level secrets stay with gitleaks (#1294)check-static-output-freeze.tscheck:static-output-freeze --self-checkgate (ci/release)check-visual-baseline-duplicates.tscheck:visual-baselinesgatecheck-audit-citations.tsaudit:citations:checktask, now--allow-read --allow-run=git(L12)check-release-truth.ts: release-state.json consistency + README/STATUS/ROADMAP registry anchors)release:truth:checkgate (new in this PR; thinker review of the initial push confirmed the local-only reachability violated CI-GATING)ci+releasetiers inpolicy.ts; same command thedocs:truthcomposition runs, which now delegates to the taskAudit findings (what was verified, not assumed)
test:e2e:firefox-smoke/test:e2e:webkit-smokesharing tasktest:e2e:browser-smoke— inspected: same task, different args (per-browser project), i.e. parameterized distinct concerns, not duplication. The guard now compares the full command vector.autoflow-cijobs (dependency-review / autoflow-ci / node-serve-smoke / workspace-qualification / pr-full-ci-evidence) each own a distinct assertion; generic-toolchain steps are the single OSS owner wiring from refactor(autoflow): shrink policy registry to OE-specific invariants (#1229 B2.7) #1295.check-strategic-docs.ts,check-public-docs-integrity.ts,claims-registry.tsare libraries imported bycheck-docs-truth.ts(one owner, seven--check=selector tasks), not parallel checkers.coverage-summary.ts,gate-verdict.ts,stress-gate.ts,benchmark-v044.ts,third-party-wc-smoke.tsare libraries of tested consumers.check-audit-citations.ts(manual/evidence, this PR's L12 fix),check-v044-performance.ts+benchmark-v044.ts(manual v0.44 acceptance gate perdocs/current/v0.44.0-PERFORMANCE.md),check-v044-legacy-absence.ts(scan logic tested viatools/migration/v044/migration.test.ts).policy.tsalready is the machine-readable registry; a second list would add drift. Instead two guard tests keep the registry referentially intact, anddocs/governance/PROJECT_WORKFLOW.mdstates the ownership rule without duplicating the list (net-reduction rule honored).CI-GATING follow-up (thinker review of the initial push)
check-release-truth.tswas reachable only via the localdocs:truthcomposition — a release-truth check with no CI wiring. Fixed in this PR: newrelease:truth:checkdeno task (least privilege,--allow-readonly) + policy gate, tiers['ci','release'](matching siblingrelease:evidence:check), triggers coveringdocs/release/release-state.json,docs/{status,roadmap,current}/,README*, the starter'sdeno.json,tools/check-release-truth(.test).ts,tools/project-constants.ts,tools/lib/version.ts, rootdeno.json.docs:truthnow delegates to the task instead of inlining the command (one owner of the invocation).check-docs-truth.tsfull mode — the other half of the composition — is CI-gated piecewise: its full check set[strategic, public, current, www, text, evidence, claims]maps 1:1 onto the gated selector tasksdocs:check-strategy,docs:check-public,docs:check-current,www:check-current-truth,text-integrity:check,release:evidence:check,docs:check-claims. No additional gate needed; verified against thedocsTruthChecksregistry and the policy gate list.M15 residual resolution (decision-logic tests for every gate that can turn failure into success)
check-repo-hygiene.tscheck-repo-hygiene.test.ts(6 tests): credential template carve-out is exact (.env.exampleallowed,.env/.env.production/id_rsa/*.pemfail), large-binary allowlist, root-anchored artifact tripwire, tracked-ignored allowlist, active-scan classification, exact-path mention allowlistcheck-static-output-freeze.tscheck-static-output-freeze.test.ts(4 tests): arg parsing (flag-without-value edge),builtAtmasking is the only island-manifest difference masked, pagefind canonicalization (hash/language-order/set-order), non-normalized paths byte-untouched, diff verdicts (identical/differs/one-sided)check-visual-baseline-duplicates.tscheck-visual-baseline-duplicates.test.ts(3 tests): hash grouping, same-size-different-hash is not a duplicate, empty/singleton passcheck-project-workflow.ts,check-workflow-slimming.tsqualify-workspace-runtime.ts,smoke-www-dev.ts,nitro-proof.ts,third-party-wc-*generate-ui-token-module.ts --check,generate-openelement-export-files.ts --checkcheckers.test.ts, per-script.test.ts, autoflow suite)L12 resolution
audit:citations:check:deno run -A→deno run --allow-read --allow-run=git.--allow-run=gitis required (archived reports are verified against their archival commit);--allow-writeis deliberately absent (the task never passes--write; the write form is documented in the script header for manual use). After this change zero check/governance tasks run with ambient authority; the remainingdeno run -Atasks are npm test-runner binaries (playwright/markdownlint/vite) and integration smokes that need broad permissions by nature. Behavior verified identical: same exit code and same output under both permission sets (the 14 pre-existing citation drifts indocs/audit/2026-08-17-deep-repo-scan.mdreproduce at origin/dev and are untouched — that report's drift is a content issue, not this packet's scope).Deletion / surviving-owner table
No scripts, gates, tasks, or jobs were deleted — the audit (above) found zero remaining exact duplicates after #1294/#1295, and the issue explicitly optimizes for one-owner clarity, not fewest tasks. No protection is dropped: every check green before this PR is green after it, with the same or tighter wiring.
docs:truthwrapper vs the 7 granularcheck-docs-truthgatescheck-release-truth.ts; local composition, not CI-duplicatedwww:check-current-truthvswww:check-artifact-truthtest:e2e:installvstest:e2e:browsers:installtest:e2e:browser-smokedocs:check-version-anchorsvscheck-release-truthanchor setsdocs:check-version-anchorsgate) / release-state + registry-line anchors (release:truth:checkgate, this PR)Before / After (counts)
release:truth:check— the gated invocation the gate anddocs:truthnow share)tools/check-*.ts)release:truth:check— closes the CI-GATING hole; a wiring fix, not new machinery)-Aambient authorityWhy-not-second-owner
No second registry/policy document was created:
policy.ts+ the two guard tests are the registry, and duplicating it into docs would create the drift this stage exists to remove. ThePROJECT_WORKFLOW.mdaddition is a pointer to the owner rule, not a copied list.check-release-truth.tswas not re-wired into CI here: version/release truth gating is B2.9 (#1231) packet scope (M16/M17), and touching it would fork ownership mid-train; it keeps its current single caller (docs:truth) and its test.Evidence
Local, on this branch (macOS, Deno workspace), exact commands and exit codes:
deno test --allow-read tools/check-repo-hygiene.test.ts tools/check-static-output-freeze.test.ts→ exit 1 before the refactors (TS2305, 11 missing-export errors); after exporting the decision logic behindimport.meta.main→ 11 passed, 0 failed.deno test tools/autoflow/__tests__/→ 138 passed, 0 failed (135 → 138: two registry guards + the release-truth gate assertion; RED first — the gate test failed before the gate was added).deno task release:truth:check→ exit 0;deno task docs:truth→ exit 0 via the new task (composition behavior preserved).deno task test→ exit 0 (1783 passed, 105 steps, 0 failed; starter workspace 150 passed, 0 failed).deno task pack:dry-run→ exit 0;deno task package-artifacts:check→ exit 0 (5 packages).deno task check:static-output-freeze --self-check→ exit 0 (655 files byte-identical across two builds — exercises the refactored main end-to-end).deno task audit:citations:check(least privilege) vsdeno run -A ...→ identical output and exit code (L12 behavior-preserving).deno task check:visual-baselines→ exit 0 (236 baselines, 0 duplicates) — exercises the refactored main.deno task fmt:check,lint,lint:markdown,typecheck,arch:check,repo:hygiene,workflow:check,workflow:check-slimming,actions:check-pins,docs:truth,text-integrity:check,docs:check-role-neutral,freeze:semantics:check→ all exit 0.Scope
Touched:
deno.json(L12 task permissions; newrelease:truth:checktask;docs:truthdelegates to it),tools/check-audit-citations.ts(usage header),tools/check-repo-hygiene.ts+ new test,tools/check-static-output-freeze.ts+ new test,tools/check-visual-baseline-duplicates.ts+ new test,tools/autoflow/policy.ts(gate trigger covers the new visual-baseline test file; newrelease:truth:checkgate),tools/autoflow/__tests__/policy.test.ts(two registry guards + release-truth gate tier/command assertion),docs/governance/PROJECT_WORKFLOW.md(ownership pointer). No frozen-semantics paths touched (verified:freeze:semantics:checkexit 0); no package source or public API changed; no control-plane files touched.Risk
import.meta.main-guard only; runtime behavior is unchanged and each script's real invocation was exercised after the change (self-check, visual-baselines gate, repo:hygiene gate).check-repo-hygiene.tsnow stats every tracked file (previously only binary-extension files) — read-only, negligible cost.release:truth:checkgate joins ci/release selection; push-tier selection is unchanged (the gate is ci/release-only, matchingrelease:evidence:check).docs/audit/2026-08-17-deep-repo-scan.mdsurface when the (ungated) citation checker runs; identical at origin/dev.