build(bootstrap): make the SessionStart prover hook synchronous#324
Merged
Conversation
Flip .claude/hooks/session-start.sh from async to synchronous so session start blocks until Coq/Idris2/Zig are provisioned — the first prompt is guaranteed a working prover instead of racing the background install. The ~10-15 min Idris2 source build is paid once on a cold container; Claude Code on the web caches the container after the hook completes, so subsequent sessions hit the idempotent early-exits and start fast. Still fail-soft + idempotent, so a timeout-truncated cold build just resumes on the next session until the container is cached. The verbose build is logged to a file; only a one-line-per-prover summary reaches the transcript. Validated in-session: emits no async JSON; runs bootstrap to completion; prints the prover summary; no-ops silently when CLAUDE_CODE_REMOTE is unset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AGFqWzByua4dKbA7W7oVsL
hyperpolymath
marked this pull request as ready for review
June 26, 2026 22:50
hyperpolymath
added a commit
that referenced
this pull request
Jun 27, 2026
…SPDX + trusted-base) (#329) ## Summary Two governance checks have been red on **every** PR (#322–#324) for reasons unrelated to any diff — both are repo-level. This clears the two that are in ephapax's control. Fixes were derived from the **exact `standards@d135b05` check-script regexes** (fetched via raw HTTPS and verified locally, not guessed). ### 1. `governance / Licence consistency` Root `LICENSE` is the verbatim MPL-2.0 text with **no SPDX header**. `check-licence-consistency.sh` does: ```sh grep -m1 -E '^[[:space:]]*SPDX-License-Identifier:' "$lic_file" ``` then normalises the identifier and checks it matches the manifest. **Fix:** prepend `SPDX-License-Identifier: MPL-2.0` (normalises to `mpl-2.0`, matches `Cargo.toml` `license = "MPL-2.0"`). Verified the grep now matches. ### 2. `governance / Trusted-base reduction policy` `check-trusted-base.sh` flags `^[[:space:]]*(Axiom|Admitted|admit\.)`. `formal/RegionEnvL1.v:17` is a **prose comment** — *"Axiom budget: this file is axiom-free"* — that happens to start with "Axiom". A false positive. **Fix:** reword to *"On the axiom budget: …"* so the line no longer matches (verified). Chosen over a `.trusted-base-ignore` entry deliberately: the file stays **fully scanned**, so a genuine future axiom there is still caught — and a `TRUSTED:`/`AXIOM:` inline annotation would be *false* (the file really is axiom-free; that's the whole point of `RegionEnvL1.v`). ## Not fixable here `scan / Hypatia Neurosymbolic Analysis` fails on an Elixir `CompileError` (`real_subdirs`) **inside the `standards`/Hypatia repo** — out of ephapax's reach. Flagging, not fixing. ## Verification - Both fixes checked against the actual fetched regexes (`standards@d135b05`). - `formal/RegionEnvL1.v` still compiles under `coqc 8.18.0` (comment-only change). - 2 files, +3/−1. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AGFqWzByua4dKbA7W7oVsL --- _Generated by [Claude Code](https://claude.ai/code/session_01AGFqWzByua4dKbA7W7oVsL)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Flip
.claude/hooks/session-start.shfrom async to synchronous, as requested. The session now blocks until Coq/Idris2/Zig are provisioned, so the first prompt is guaranteed a working prover instead of racing the background install.Why this is the right trade-off (not just a slower start)
The ~10–15 min Idris2 source build is paid once on a cold container. Claude Code on the web caches the container after the SessionStart hook completes, so every subsequent session hits the installers' idempotent early-exits and starts fast — with the prover guarantee intact each time. And because the installers are fail-soft + idempotent, a cold build truncated by any hook timeout simply resumes on the next session until the container is cached. Net: pay once, fast + guaranteed thereafter.
Change
{"async": true, ...}) so the hook runs synchronously.$TMPDIR/ephapax-bootstrap.log; only a one-line-per-prover summary reaches the session transcript (no build spam).Only
.claude/hooks/session-start.shchanges; the installer scripts, devcontainer,.tool-versions, andjust bootstrapare untouched.Validated in-session
bootstrap-provers.shto completion and prints the Coq/Idris2/Zig summary.CLAUDE_CODE_REMOTEis unset (devcontainers use postCreate instead).CLAUDE_CODE_REMOTE=true, so the remote path is the one that fires.Hook execution mode
Synchronous. Pro: provers guaranteed before the first prompt (no race). Con: first cold session waits for the build; amortized to ~0 by container caching thereafter.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AGFqWzByua4dKbA7W7oVsL
Generated by Claude Code