Skip to content

Restore CI compiler and dependencies before setup with stable inputs - #85

Merged
RCmerci merged 2 commits into
mainfrom
codex/ci-cache-prerestore-20261016
Oct 16, 2026
Merged

RCmerci merged 2 commits into
mainfrom
codex/ci-cache-prerestore-20261016

Conversation

@RCmerci

@RCmerci RCmerci commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

CI created OCaml before restoring the installed switch and keyed the restore with that newly generated compiler binary. This change identifies exact build inputs before setup, restores the workspace switch plus opam metadata, validates the saved compiler/state receipt, and lets setup reuse the compiler. Rejected restored state is quarantined on the disposable hosted runner for clean cold setup.

The key retains absolute-path, runner image, Apple SDK/clang, native-library ABI, lock and resolved-pin matching. A fixed opam-repository commit binds compiler source checksums, patches and build configuration. Re-pin, system requirement checks, locked install, full build/native embed and complete regression tests stay unconditional. The shared Apple builder still hashes the actual compiler binary for native provenance.

Controlled measurement at head 22cb26610650d3ae9d0b0aad01c27b34a81ff389: cold attempt 1, hot attempt 2. Both checked out the same merge commit 2322e97b79922ccd62cc3984d113e3fe38d99262, with identical image macos26 / 20261013.0424.1, complete input identity, resolved pins, compiler configuration/hash and all 181 installed package versions.

Measurement Cold Hot
Job, excluding queue 1206 s (20:06) 350 s (5:50)
Dispatch to job start 69 s 11 s
setup-ocaml 325 s 58 s
Compiler installation group 261.516 s absent
Cache restore 1 s (miss) 32 s (exact hit)
Locked install 586 s 4 s (Nothing to do.)
Actual dependency installs / recompiles 170 / 0 0 / 0
Full build and native embed 39 s 43 s
Full regression suite 145 s 128 s
Cache save 27 s skipped, existing exact entry

Observed job saving: 856 s (14:16), 70.98%, excluding queue. The hot action log has CI_CACHE_HIT: true, the receipt is accepted, and setup has no compiler installation group, switch-create or installed/recompiled package actions. Both attempts pass the complete build/tests.

Exact key: journal-opam-v3-macOS-ARM64-6ec349f2d60af43970feecf6d093c205753c26255cbfd75c03e5ad7bad066d51. Cached paths are /Users/runner/work/logseq_journal/logseq_journal/_opam and /Users/runner/.opam. Compiler SHA-256 in both receipts: 39817c9cbca6b75d35d019dca63eb741f02234926d404f9b1aca54e4cbc64f83.

Final source is synchronized with main 1e38f64644cdd49081004722cd9dd43759b2aaaf at head b6da1a58b2fc1f75614bc417f01d8b83f6bea995; the same four CI/skill file blobs are unchanged from the measured head. Final integrated verification: run 38880280772 passed in 343 s (5:43), with queue 9 s, the same exact cache key, accepted receipt, unchanged compiler, zero package installs/recompiles, and full build/tests passing.

Validation: all 30 build-boundary tests pass at final head; actionlint and diff checks pass. Test-first cases cover pre-setup identity and invalid inputs, exact receipt acceptance, missing/corrupt compiler/switch metadata, partial/missing restore rejection and owned-runner quarantine guards. Read-only journal-code-review found no evidence-backed issue in scope. No business/spec/Dune/lock change appears in the diff against current main. Three pre-existing unrelated decision documents still fail spec-dev-tool section validation; they were not changed.

This is one controlled pair, not a guaranteed future duration. Image, SDK, library, lock, recipe or resolved-pin changes correctly select another cold cache. GitHub PR merge-ref caches remain scoped to their PR, so a sibling PR cannot inherit this PR's cache until a matching default-branch cache exists. Corrupt immutable entries are rejected and require an authorized namespace bump/removal for persistent recovery. No merge or security-policy change is requested.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T08:59:28.187396Z 22cb266 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@RCmerci
RCmerci merged commit bb2b9fb into main Oct 16, 2026
1 check passed
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.

1 participant