Skip to content

chore(toolchain): provision OCaml/wasmtime/Deno + migrate harnesses to Deno (#133/#253)#150

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/tender-allen-xzjBQ
Jun 1, 2026
Merged

chore(toolchain): provision OCaml/wasmtime/Deno + migrate harnesses to Deno (#133/#253)#150
hyperpolymath merged 3 commits into
mainfrom
claude/tender-allen-xzjBQ

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Two related estate-toolchain changes:

1. Durable provisioningtools/provision.sh (exposed as just provision / just setup, wired into setup.sh) installs:

  • Deno — the JS runtime, fetched from the GitHub release assets. deno.land / dl.deno.land are denied by the network policy (x-deny-reason: host_not_allowed), but github.com release downloads are reachable — same channel that works for wasmtime/just.
  • wasmtime — the Phase 1 / GATE: contributor can tw build → run on Wasmtime → get an actionable violation message #132 capstone execution gate, via crates.io.
  • AffineScript — the parser/codegen compiler. It is an OCaml program (built from hyperpolymath/affinescript with opam + dune at the SHA pinned in c5-regenerate.yml), not an npm package — @hyperpolymath/affinescript 404s on npmjs.

The stale deps recipe (which ran npm ci against the package.json that #133 removed) is replaced with a real toolchain check.

2. node → Deno harness migration (estate #133 / standards#253) — the node tests/*.mjs runners now run under Deno with scoped permissions (--allow-read --allow-write --allow-run --allow-env --allow-sys):

  • deno.json (tasks + config), the Justfile deno_run recipes, e2e.yml (smoke + build-e2e jobs install Deno from the release assets), and tests/e2e.sh.
  • The .mjs were already Deno-shaped (node: imports, import.meta.url-derived __dirname), so the change is mechanical — no source edits to the harnesses.

Cleanup — removed the ReScript-era leftovers deno.lock + package-lock.json, and the stale rescript build / node_modules/@rescript references in the E2E script.

Why

@hyperpolymath/affinescript is OCaml, so it was never an npm/Deno/Bun package — there's nothing to "migrate" for the compiler. The only JS-runtime surface is the .mjs harnesses, and the estate standard is Deno (#133/#253), not Bun. This PR makes the toolchain reproducible and finishes the node→Deno harness move.

Verification (local, deno 2.8.1)

  • deno task test-aspect / test-proof — green
  • just deps (deno/cargo/wasmtime ok), just test-aspect / test-proof — green
  • E2E_BUILD=0 bash tests/e2e.sh47 passed / 0 failed / 7 skipped
  • tools/provision.sh runs clean (idempotent skip when tools present)

The CI Deno-install steps + full e2e.yml flow are verified by this PR's own run.

Note on AffineScript

provision.sh can build AffineScript here (github.com clone is reachable, opam is apt-installable) but it's a ~5-min OCaml build, so I didn't run it in this session — it's codified per the authoritative c5-regenerate.yml recipe. Building it is the unblock for the #127 front-end→IR seam.

https://claude.ai/code/session_01Rq4da8i2uGnDUfanSB1Hx4


Generated by Claude Code

…o Deno (#133/#253)

Provisioning (tools/provision.sh, `just provision`/`setup`, wired into setup.sh):
- Deno from the GitHub release assets (deno.land is denylisted by the network
  policy; github.com is reachable).
- wasmtime via crates.io (the #132 capstone execution gate).
- AffineScript built from hyperpolymath/affinescript with opam + dune at the SHA
  pinned in c5-regenerate.yml. AffineScript is an OCaml compiler, NOT an npm
  package (@hyperpolymath/affinescript 404s on npmjs).
- Replace the stale `deps` recipe (ran `npm ci` against the package.json that
  #133 removed) with a real toolchain check.

node -> Deno migration of the .mjs harnesses (deno.json + Justfile deno_run
recipes + e2e.yml smoke/build-e2e jobs + tests/e2e.sh), scoped permissions
(read/write/run/env/sys). The .mjs were already Deno-shaped (node: imports,
import.meta.url-derived __dirname), so the change is mechanical.

Cleanup: remove the ReScript-era deno.lock + package-lock.json and the stale
rescript build / node_modules/@rescript references in the E2E script.

Verified locally with deno 2.8.1: deno tasks, just deps, just test-aspect/proof,
and E2E_BUILD=0 tests/e2e.sh (47 passed / 0 failed / 7 skipped) all green.
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 79 issues detected

Severity Count
🔴 Critical 1
🟠 High 7
🟡 Medium 71

⚠️ 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 boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in c5-regenerate.yml",
    "type": "missing_timeout_minutes",
    "file": "c5-regenerate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cargo-audit.yml",
    "type": "missing_timeout_minutes",
    "file": "cargo-audit.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 dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review June 1, 2026 13:08
@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 1, 2026 13:09
…npm refs

- CLAUDE.md gains an 'Environment & Toolchain' section: Deno-first JS runtime,
  AffineScript=OCaml (not npm), provisioning via just provision, the network
  policy (github.com/crates.io/npmjs/apt reachable; deno.land/api.github.com/
  wasmtime.dev denylisted), and the git-proxy ref-delete limitation.
- docs/wiki/Home.md quick-start: ReScript/npm/node smoke -> AffineScript + Deno.
- docs/wiki/Proof-Debt-Status.md: node -> deno for the proof regression.

(Dated audit/maintenance reports under docs/reports/ are left as-is — historical
records, not live instructions.)
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 79 issues detected

Severity Count
🔴 Critical 1
🟠 High 7
🟡 Medium 71

⚠️ 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 boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in c5-regenerate.yml",
    "type": "missing_timeout_minutes",
    "file": "c5-regenerate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cargo-audit.yml",
    "type": "missing_timeout_minutes",
    "file": "cargo-audit.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 dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

…ed network

The OCaml/AffineScript path failed in container/CI envs. Four real fixes,
each surfaced by running it:
- apt-get update returns 100 on denylisted 3rd-party PPAs (deadsnakes/ondrej
  403) -> tolerate (`|| true`); opam is in universe, already indexed.
- opam refuses to init as root -> export OPAMROOTISOK=1.
- opam's bwrap sandbox fails in containers -> --disable-sandboxing.
- opam.ocaml.org/index.tar.gz is denylisted (403) -> point the default repo at
  the github.com git mirror (github is reachable), same lesson as Deno.
Also activate the switch env (eval opam env) and add a final binary check so the
script can't report success without producing affinescript.

Justfile deps-audit: drop the vacuous `npm audit` (no package.json since #133);
use `cargo audit` (guarded) — the real dep audit for this Rust/Deno repo.
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 79 issues detected

Severity Count
🔴 Critical 1
🟠 High 7
🟡 Medium 71

⚠️ 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 boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in c5-regenerate.yml",
    "type": "missing_timeout_minutes",
    "file": "c5-regenerate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cargo-audit.yml",
    "type": "missing_timeout_minutes",
    "file": "cargo-audit.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 dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit efccef1 into main Jun 1, 2026
31 checks passed
@hyperpolymath
hyperpolymath deleted the claude/tender-allen-xzjBQ branch June 1, 2026 21:02
Sign up for free to 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.

2 participants