ci(canvas): add Canvas↔app design-token SSOT drift gate (app#86) #3041
Reference in New Issue
Block a user
Delete Branch "feat/canvas-app-token-drift-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs molecule-ai/molecule-app#86.
Adds the canvas-side half of the cross-repo design-token SSOT drift gate. The app-side gate already lives in
molecule-ai/molecule-app/.gitea/scripts/check_canvas_token_drift.py; this PR adds the symmetric check from the canvas repo.What
.gitea/scripts/check_app_token_drift.pyfetchesmolecule-ai/molecule-app/app/globals.cssand compares the shared semantic color tokens (--color-surface,--color-ink,--color-accent, etc.) against the localcanvas/src/app/globals.css..gitea/workflows/design-token-drift-gate.ymlruns the check on changes to the canvas globals.css or the gate itself.continue-on-error: true, not inall-required) and skips loud whenAPP_SSOT_READ_TOKENis absent.Test plan
python3 -c "import yaml; yaml.safe_load(open('.gitea/workflows/design-token-drift-gate.yml'))"✅.gitea/scripts/check_app_token_drift.pyagainstcanvas/src/app/globals.csslocally; it extracts 14 light + 14 dark tokens successfully.SOP Checklist
Comprehensive testing performed
APP_SSOT_READ_TOKENis absent.Local-postgres E2E run
N/A: pure CI/script change; no database surface.
Staging-smoke verified or pending
N/A: advisory CI gate; no runtime service changes.
Root-cause not symptom
Closes the canvas-side half of the SSOT-durability gap tracked in molecule-app#86.
Five-Axis review walked
No backwards-compat shim / dead code added
Yes. New additive gate.
Memory/saved-feedback consulted
APPROVED. 5-axis review on head
7b322d0a.Correctness: the new advisory gate fetches molecule-app globals.css through the Gitea contents API, decodes the content, extracts the shared light/dark semantic token set, and reports concrete drift. It skips loudly when APP_SSOT_READ_TOKEN is absent, matching the stated advisory phase.
Robustness/security/performance: token is only used as an API read credential and not printed; network fetch has a timeout; local parsing failures become CI errors. The workflow is path-filtered and continue-on-error, so it will not unexpectedly block all-required. Tests cover aligned, drift, missing token, missing file, and extraction paths. CI / all-required is green.
APPROVED after independent 5-axis review.
Correctness: the advisory design-token drift gate fetches the app SSOT through the Gitea contents API, compares the intended shared light/dark token set, reports specific diffs, and skips cleanly when the read token is not yet provisioned. Tests cover parsing, aligned/drift cases, missing token, missing canvas file, and mocked fetch. Robustness/security: read-only token use and advisory
continue-on-errorare appropriate for phase 1. Performance/readability are fine.