Skip to content

feat(scripts+ci): swap governance TS-allowlist check to AffineScript-compiled .deno.js - #311

Merged
hyperpolymath merged 2 commits into
mainfrom
feat/check-ts-allowlist-workflow-swap-to-affine
May 30, 2026
Merged

feat(scripts+ci): swap governance TS-allowlist check to AffineScript-compiled .deno.js#311
hyperpolymath merged 2 commits into
mainfrom
feat/check-ts-allowlist-workflow-swap-to-affine

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Depends on: #310

Second half of the seed-PR plan from #283: once the .affine source actually compiles + runs (#310), wire the workflow at the AffineScript-compiled output.

Changes

  1. scripts/check-ts-allowlist.deno.js (NEW, 344 lines)

  2. .github/workflows/governance-reusable.yml:193

    • deno run ... check-ts-allowlist.ts... check-ts-allowlist.deno.js
    • Comment block explains the dual-target window: .ts kept for the regression suite (scripts/tests/check-ts-allowlist-test.sh) and for parallel-validation; retirement is a separate follow-up after the validation window.

Why ship the compiled artifact (vs compile-in-CI)

Compile-in-CI would require an AffineScript toolchain in the workflow (OCaml + dune + affinescript repo as a dep). The compiler is deterministic for this surface; committing the output keeps CI provider-free and matches the precedent in affinescript/tests/codegen-deno/*.deno.js (committed golden files).

Drift between source and committed output is the obvious risk. Follow-up will add a just check-ts-allowlist-drift recipe (recompile + diff) wired into a non-blocking CI lint.

Verification

End-to-end runtime test of the compiled output (matches the runtime fix in PR #310 commit b046787):

fixtureexitoutput
empty dir0success line
src/Foo.ts violation1error block + file list
mod.ts (filename ok)0success line
scripts/x.ts (dir ok)0success line

Test plan

  • CI green on this branch — note AS scanner / Hypatia / SPARK Theatre Gate may need to acknowledge the new committed .deno.js as a generated artifact (ignore findings tagged as generated)
  • scripts/tests/check-ts-allowlist-test.sh still passes against the unchanged .ts archetype (no behavioural change to .ts)
  • Caller repos using governance-reusable.yml show green "Check for TypeScript" steps after merge

Refs #239 (umbrella TS→AffineScript), #241 (STEP 2 tail-batch-1). Follow-up plan: add drift-detection lint, then a separate PR retires the .ts archetype after the parallel-validation window.

Generated with Claude Code

…compiled .deno.js
Depends on: #310
Closes the second half of the seed-PR plan from #283: now that the
.affine source actually compiles and runs (#310), wire the workflow at
the AffineScript-compiled output.
## Changes
1. `scripts/check-ts-allowlist.deno.js` (NEW, 344 lines)
- Generated by `affinescript compile --deno-esm` from the post-#310
`.affine` source. Self-contained Deno-ESM bundle with inlined
runtime shims for the codegen-known externs (walkRecursive,
regexMatch, readTextFile, exit, consoleError) and the public
`split` / `ends_with` helpers. Auto-invokes `await main()` at
module load — same shape Deno runs the existing `.ts` with.
2. `.github/workflows/governance-reusable.yml:193`
- `deno run ... check-ts-allowlist.ts` → `... check-ts-allowlist.deno.js`
- Comment block explains the dual-target window: .ts is kept for
the regression suite (`scripts/tests/check-ts-allowlist-test.sh`)
and for parallel-validation; retirement is a separate follow-up.
## Why ship the compiled artifact (vs compile-in-CI)
Compile-in-CI would require an AffineScript toolchain in the workflow
(currently OCaml + dune + the affinescript repo checked out as a
dep). The compiler is deterministic for this surface; committing the
output keeps CI provider-free and matches the precedent in
`affinescript/tests/codegen-deno/*.deno.js` (committed golden files).
Drift between source and committed output is the obvious risk. A
follow-up PR will add a `just check-ts-allowlist-drift` recipe
(recompile + diff) wired into a non-blocking CI lint, mirroring the
golden-file maintenance pattern in the affinescript repo.
## Verification
End-to-end runtime test of the compiled output (per PR #310 commit msg
b046787):
empty dir -> exit 0, success line
src/Foo.ts violation -> exit 1, error block + file list
mod.ts (filename ok) -> exit 0
scripts/x.ts (dir ok) -> exit 0
Workflow YAML linting: this change is one line of `run:` text; the
governance-reusable.yml workflow is unchanged in shape, only its
script target moves.
## Test plan
- [ ] CI green on this branch (note: AS scanner / Hypatia / SPARK
Theatre Gate may need to acknowledge the new committed .deno.js
as a generated artifact; ignore findings tagged as generated)
- [ ] `scripts/tests/check-ts-allowlist-test.sh` still passes against
the unchanged .ts archetype
- [ ] Caller repos using `governance-reusable.yml` show green
"Check for TypeScript" steps after merge
Refs #239 (umbrella TS→AffineScript), #241 (STEP 2 tail-batch-1).
Follow-up plan: add drift-detection lint; then a separate PR retires
the .ts archetype after a parallel-validation window.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o.js runtime
Mirrors the workflow swap in this PR. Three updates to
`docs/EXEMPTION-MECHANISMS.adoc`:
1. Layer 4a description — point at `scripts/check-ts-allowlist.affine`
as the source of truth, note the compiled `.deno.js` is what the
workflow actually runs.
2. History — add a fourth bullet covering standards#283 / #310 / #311:
the TS→AffineScript port arc, with the dual-target rationale spelled
out (`.ts` kept for regression suite + parallel-validation; `.deno.js`
is the workflow target).
3. Cross-references — replace the single `.ts` line with three lines
covering all three files (.affine source / .deno.js runtime / .ts
archetype) and what each is for. Reduces "which file should I edit?"
ambiguity for the next contributor.
No behavioural change; pure doc alignment so the prose matches the
workflow + source layout after #311 lands.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit 16160f8 into mainMay 30, 2026
9 of 18 checks passed
@hyperpolymath
hyperpolymath deleted the feat/check-ts-allowlist-workflow-swap-to-affine branch May 30, 2026 18:54
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 191 issues detected

SeverityCount
🔴 Critical64
🟠 High37
🟡 Medium90

⚠️Action Required: Critical security issues found!

View findings
[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in affinescript-verify.yml",
"type": "missing_timeout_minutes",
"file": "affinescript-verify.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in changelog-reusable.yml",
"type": "missing_timeout_minutes",
"file": "changelog-reusable.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql-reusable.yml",
"type": "missing_timeout_minutes",
"file": "codeql-reusable.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in deno-ci-reusable.yml",
"type": "missing_timeout_minutes",
"file": "deno-ci-reusable.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in doc-format.yml",
"type": "missing_timeout_minutes",
"file": "doc-format.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@hyperpolymath