Skip to content

Self-host M2: spine inventory coverage drift guard (595→603 file list) #1945

Description

@PurHur

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):

  1. Parse inventory file list from php script/bootstrap-inventory.php --json (or parse docs/bootstrap-inventory.md table)
  2. Parse require_once paths from compiler_lib_spine_smoke/main.php
  3. Exit 1 with sorted list of missing lib/*.php paths (max 20 printed, full list to /tmp or --verbose)
  4. 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

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions