Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/governance-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,33 @@ jobs:
# the .ts is a separate follow-up after the dual-target window.
run: deno run --allow-read --no-lock .standards-checkout/scripts/check-ts-allowlist.deno.js

- name: check-ts-allowlist source/compile drift (informational)
# Non-blocking — informational until the AffineScript compiler
# output is hash-pinned per compiler version. The compiler header
# currently stamps "Generated by AffineScript compiler" which is
# a moving target as the codegen evolves, so spurious diff =
# "compiler bumped" vs real diff = "someone edited .affine
# without recompiling". Promotion to blocking is gated on a
# compiler-version pin landing (see standards#312).
continue-on-error: true
run: |
if ! command -v affinescript >/dev/null 2>&1; then
echo "::notice::affinescript compiler unavailable on runner — skipping drift check"
exit 0
fi
tmp="$(mktemp /tmp/check-ts-allowlist-drift.XXXXXX.deno.js)"
if ! affinescript compile --deno-esm -o "$tmp" .standards-checkout/scripts/check-ts-allowlist.affine; then
echo "::warning::affinescript compile failed — drift check skipped"
rm -f "$tmp"
exit 0
fi
if diff -u .standards-checkout/scripts/check-ts-allowlist.deno.js "$tmp"; then
echo "✅ check-ts-allowlist .affine source and .deno.js compiled output are in sync"
else
echo "::warning::check-ts-allowlist.deno.js drifted from check-ts-allowlist.affine — re-run \`just check-ts-allowlist-drift\` locally and recommit the .deno.js"
fi
rm -f "$tmp"

# Shared escape hatch for the banned-language-file checks below.
# Honours three exemption mechanisms (see
# standards/docs/EXEMPTION-MECHANISMS.adoc):
Expand Down
13 changes: 13 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ help-me:
@echo "Include the output of 'just doctor' in your report."


# Verify scripts/check-ts-allowlist.deno.js matches what compiling
# scripts/check-ts-allowlist.affine produces. Run after editing the
# .affine source. Exit 0 = in sync; non-zero with diff = drifted.
# See standards#312.
check-ts-allowlist-drift:
@command -v affinescript >/dev/null 2>&1 || { echo "affinescript compiler not on PATH — skipping drift check"; exit 0; }
@tmp="$$(mktemp /tmp/check-ts-allowlist-drift.XXXXXX.deno.js)"; \
affinescript compile --deno-esm -o "$$tmp" scripts/check-ts-allowlist.affine; \
diff -u scripts/check-ts-allowlist.deno.js "$$tmp"; \
rc=$$?; \
rm -f "$$tmp"; \
exit $$rc

# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
crg-grade:
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
Expand Down
6 changes: 6 additions & 0 deletions scripts/check-ts-allowlist.affine
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
//
// Step 2 of the estate-wide TypeScript → AffineScript migration campaign
// (hyperpolymath/standards#239 umbrella, #241 tail-batch-1 issue).
//
// Compiled output: scripts/check-ts-allowlist.deno.js (committed). After
// editing this file, re-run `just check-ts-allowlist-drift` to verify the
// committed .deno.js matches what compiling this source produces. The
// governance reusable runs the same check in CI as a non-blocking
// informational step (standards#312).

use Deno::{
readTextFile, walkRecursive, exit, consoleError,
Expand Down