Problem
M2 spine smoke links 595 / 603 inventory files (#1872 SSOT: php script/bootstrap-spine-count.php). check-selfhost-spine-count-sync.php only guards counts in docs — it does not fail when specific inventory paths are still absent from test/selfhost/compiler_lib_spine_smoke/main.php.
Contributors closing #1922 grep bootstrap-inventory.php by hand instead of a deterministic missing-file list.
Goal
Add script/check-selfhost-spine-coverage-sync.php (+ optional SELFHOST_SPINE_COVERAGE_SYNC_GATE=1 in ci-fast.sh inventory checks):
- Parse inventory file list from
php script/bootstrap-inventory.php --json (or parse docs/bootstrap-inventory.md table)
- Parse
require_once paths from compiler_lib_spine_smoke/main.php
- Exit 1 with sorted list of missing
lib/*.php paths (max 20 printed, full list to /tmp or --verbose)
- Exit 0 when spine includes all 603 inventory files
Implementation hints
| Piece |
Path |
Notes |
| Checker |
script/check-selfhost-spine-coverage-sync.php |
Mirror style of check-selfhost-spine-count-sync.php |
| Helper |
Reuse bootstrap_count_spine_requires() from script/bootstrap-spine-count.php |
Avoid duplicating regex |
| Inventory |
script/bootstrap-inventory.php |
--check already knows 603 files |
| Dev helper |
script/bootstrap-selfhost-next-includes.php --bundle=... |
Document in checker stderr footer |
| CI |
script/ci-common.sh ci_run_inventory_checks() |
Default on; opt-out SELFHOST_SPINE_COVERAGE_SYNC_GATE=0 during bulk spine PRs |
| Test |
test/unit/SelfhostSpineCoverageSyncTest.php |
Fixture: temp spine missing one file → exit 1 |
Suggested output
check-selfhost-spine-coverage-sync: FAILED — 8 inventory files missing from spine:
lib/JIT/Builtin/Type/Foo.php
...
Next: php script/bootstrap-selfhost-next-includes.php --bundle=test/selfhost/compiler_lib_spine_smoke/main.php --limit=8
Acceptance criteria
Verification (local / Docker only)
php script/check-selfhost-spine-coverage-sync.php
php script/bootstrap-inventory.php --check
./script/ci-fast.sh --filter SelfhostSpineCoverage
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
php script/check-selfhost-spine-coverage-sync.php
No GitHub Actions (#394 ✅).
Dependencies
Links
Problem
M2 spine smoke links 595 / 603 inventory files (#1872 SSOT:
php script/bootstrap-spine-count.php).check-selfhost-spine-count-sync.phponly guards counts in docs — it does not fail when specific inventory paths are still absent fromtest/selfhost/compiler_lib_spine_smoke/main.php.Contributors closing #1922 grep
bootstrap-inventory.phpby hand instead of a deterministic missing-file list.Goal
Add
script/check-selfhost-spine-coverage-sync.php(+ optionalSELFHOST_SPINE_COVERAGE_SYNC_GATE=1inci-fast.shinventory checks):php script/bootstrap-inventory.php --json(or parsedocs/bootstrap-inventory.mdtable)require_oncepaths fromcompiler_lib_spine_smoke/main.phplib/*.phppaths (max 20 printed, full list to/tmpor--verbose)Implementation hints
script/check-selfhost-spine-coverage-sync.phpcheck-selfhost-spine-count-sync.phpbootstrap_count_spine_requires()fromscript/bootstrap-spine-count.phpscript/bootstrap-inventory.php--checkalready knows 603 filesscript/bootstrap-selfhost-next-includes.php --bundle=...script/ci-common.shci_run_inventory_checks()SELFHOST_SPINE_COVERAGE_SYNC_GATE=0during bulk spine PRstest/unit/SelfhostSpineCoverageSyncTest.phpSuggested output
Acceptance criteria
mastertoday (8 files until Self-host M2: Close compiler_lib_spine_smoke gap (589→593 inventory units) #1922 lands)./script/ci-fast.shruns checker when gate=1test/unit/SelfhostSpineCoverageSyncTest.phpgreenVerification (local / Docker only)
php script/check-selfhost-spine-coverage-sync.php php script/bootstrap-inventory.php --check ./script/ci-fast.sh --filter SelfhostSpineCoverage docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ php script/check-selfhost-spine-coverage-sync.phpNo GitHub Actions (#394 ✅).
Dependencies
require_onceuntil checker greenLinks
check-m2-spine-issue-hygiene.php(DevEx: Close stale m2-spine-unit issues when file already in compiler_lib_spine_smoke #1808)