Skip to content

chore(config): SessionStart toolchain hook + Phase-3 state note (Refs #57)#482

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/pensive-fermi-JVCzu
May 30, 2026
Merged

chore(config): SessionStart toolchain hook + Phase-3 state note (Refs #57)#482
hyperpolymath merged 1 commit into
mainfrom
claude/pensive-fermi-JVCzu

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

What

Wrap-up for the res-to-affine Phase 3 work (slices 1 #477 + 2 #481): a SessionStart hook so web sessions can build/test this project without manual setup, plus state documentation.

Changes

  • .claude/hooks/session-start.sh — SessionStart hook provisioning the OCaml toolchain via apt (ocaml-nox ocaml-dune ocaml-findlib, libcmdliner/libfmt/libalcotest, menhir/libmenhir/libsedlex, libppx-deriving/libppxlib/libyojson, js-of-ocaml/libjs-of-ocaml-dev), the tree-sitter CLI (npm i -g tree-sitter-cli@^0.25.0), and the pinned tree-sitter-rescript grammar (editors/tree-sitter-rescript/scripts/install.sh). apt rather than opam because opam.ocaml.org is blocked by this environment's network policy (403), while Ubuntu's packages happen to match the project's version pins — this exact set was verified to give a clean full dune build. Synchronous, idempotent (skips if dune/tree-sitter/parser.c already present), best-effort (a failed step warns to stderr, never aborts session start), web-only (CLAUDE_CODE_REMOTE guard).
  • .claude/settings.json — registers the hook under hooks.SessionStart; adds dune build/runtest/exec/test + tree-sitter to the permission allowlist. The existing read-only allowlist is preserved verbatim.
  • STATE.a2ml — dated session note documenting Phase 3 slices 1+2, the conservative skip-don't-guess design, the qualified-path-RHS deferral (parses post-LANG: type/effect grammar has no module-qualified path — Pkg.Type/Pkg.Effect unrepresentable (estate-wide port blocker; ADR-014) #228 but won't resolve against a non-existent module), and the local build/test/oracle verification. Mirror keys (authoritative-status-doc/drift-flag) untouched, so the doc-truthing guard stays green.

Validation (local, apt-bootstrapped toolchain)

Check Result
node -e JSON.parse(settings.json) ✅ valid
Hook run (CLAUDE_CODE_REMOTE=true) ✅ exit 0 (idempotent skip path; toolchain already present)
bash -n session-start.sh ✅ clean
full dune build ✅ exit 0
dune runtest tools/res-to-affine/ ✅ 21/21
./tools/check-doc-truthing.sh ✅ pass
./tools/check-no-extension-ts.sh ✅ pass

No OCaml source touched — config + docs only, so the build/migration-assistant jobs are unaffected. Known-baseline checks (vscode-smoke, the governance TS-exemption flag, Hypatia) remain pre-existing and unrelated.

Hook execution mode: synchronous

Guarantees the toolchain is ready before the session begins (no race where Claude runs dune before deps exist); cost is a one-time install on the first session (the container caches afterward). Can switch to async if you'd prefer faster startup. Once this lands on main, all future web sessions use it.

Refs #57

https://claude.ai/code/session_017T8SzHr2yXav8hm4Ho76Uw


Generated by Claude Code

…57)

Wrap-up for the res-to-affine Phase 3 work (slices 1 #477 + 2 #481).

- .claude/hooks/session-start.sh — SessionStart hook provisioning the OCaml
  toolchain (apt: dune / cmdliner / fmt / alcotest / menhir / sedlex /
  ppx_deriving / ppxlib / yojson / js_of_ocaml), the tree-sitter CLI, and the
  pinned tree-sitter-rescript grammar, so web sessions can `dune build` /
  `dune runtest` without manual setup. apt (not opam) because opam.ocaml.org
  is network-blocked here while Ubuntu's packages match the project's version
  pins. Synchronous, idempotent, best-effort, web-only (CLAUDE_CODE_REMOTE).
- .claude/settings.json — register the hook; add dune / tree-sitter build+test
  permissions (existing read-only allowlist preserved).
- STATE.a2ml — dated session note documenting Phase 3 slices 1+2, the
  conservative design, the qualified-path deferral, and the local
  build / test / compiler-oracle verification.

Validated locally: full `dune build` exit 0; `dune runtest tools/res-to-affine/`
green; doc-truthing + no-extension-ts guards pass; hook runs clean on the
idempotent path.

Refs #57

https://claude.ai/code/session_017T8SzHr2yXav8hm4Ho76Uw
@hyperpolymath hyperpolymath marked this pull request as ready for review May 30, 2026 23:40
@hyperpolymath hyperpolymath merged commit 138baac into main May 30, 2026
0 of 24 checks passed
@hyperpolymath hyperpolymath deleted the claude/pensive-fermi-JVCzu branch May 30, 2026 23:40
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