Skip to content

Self-host M5: CI gate — sidecar SHA stamp must match spine entry before merge #8703

Description

@PurHur

Category

bootstrap

Problem

prelinked/bootstrap-gen0/.m3_compiler_lib_sidecar.sha can drift from the SHA of test/selfhost/compiler_lib_spine_smoke/main.php while fast M5 gates still pass with a stale gen-0 blob. Workers editing the spine entry can merge without refreshing sidecars, causing cold-boot / vendor-absent failures that surface only under --strict or manual wave-check.

Goal

Add script/check-selfhost-spine-sidecar-sync.php and wire it into script/ci-fast.sh (inventory tail) so PR CI fails when the stamp ≠ spine entry SHA unless explicitly waived.

Repro (failure mode today)

# 1. Touch spine entry without updating sidecar stamp
echo '// drift probe' >> test/selfhost/compiler_lib_spine_smoke/main.php

# 2. Fast gates may still pass
make north-star5-verify-fast
php script/bootstrap-inventory.php --check

# 3. Stale blob only obvious when comparing SHAs manually
cat prelinked/bootstrap-gen0/.m3_compiler_lib_sidecar.sha
sha256sum test/selfhost/compiler_lib_spine_smoke/main.php

Expected after fix: step 2 exits non-zero with actionable message listing refresh commands.

php-src reference

N/A — project bootstrap integrity gate (#1492, docs/bootstrap-m5-fast-path.md).

Scope (this repo)

Piece Path
New script script/check-selfhost-spine-sidecar-sync.php
Stamp prelinked/bootstrap-gen0/.m3_compiler_lib_sidecar.sha
Entry SSOT test/selfhost/compiler_lib_spine_smoke/main.php
CI script/ci-fast.sh inventory tail (after check-selfhost-spine-coverage-sync.php)
Docs docs/bootstrap-m5-fast-path.md — refresh workflow
Unit test test/unit/script/CheckSelfhostSpineSidecarSyncTest.php

Done when

  • Sync script exits 0 on green master; non-zero when stamp ≠ sha256(main.php) (or documented canonical hash input)
  • BOOTSTRAP_ALLOW_STALE_SIDECAR=1 opt-out documented for intentional blob batch PRs only
  • ./script/ci-fast.sh invokes the check by default
  • Unit test covers match, mismatch, and opt-out env
  • Docs list: update stamp → optional make bootstrap-selfhost-lib-spine-smoke → refresh prelinked/bootstrap-gen0/

Verify

php script/check-selfhost-spine-sidecar-sync.php
make north-star5-verify-fast
php script/check-selfhost-spine-coverage-sync.php
./script/ci-fast.sh

Links

#1492 · #8703 · docs/bootstrap-m5-fast-path.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions