Problem
phpc doctor --gates is the presenter-facing ladder for example web smokes and bootstrap probes (#1752, #1903, #2010, #2102), but new env vars land in script/ci-defaults.env + docs/local-ci-matrix.md without a mechanical check that doctor output still lists them.
Gate drift causes “CI failed on FOO_GATE” while phpc doctor --gates omits FOO, wasting contributor time on harness hosts.
Goal
script/check-doctor-gates-sync.php — parse ci-defaults.env export *_GATE= names (or curated allowlist file) and assert each appears in lib/Doctor.php gate listing or documented opt-out list in docs/local-ci-matrix.md
DOCTOR_GATES_MATRIX_SYNC_GATE=1 default in script/ci-fast.sh inventory checks (opt-out =0 for doctor-only edits)
test/unit/DoctorGatesSyncTest.php — fails with actionable diff when drift detected
Implementation hints
| Piece |
Path |
Notes |
| Checker |
script/check-doctor-gates-sync.php |
Mirror check-wave3-roadmap-sync.php / check-bootstrap-inventory-triage-sync.php exit codes |
| Parse SSOT |
script/ci-defaults.env |
Regex: ^export ([A-Z0-9_]+_GATE)= |
| Doctor |
lib/Doctor.php |
Grep listGate / table rows for env var substring |
| Matrix |
docs/local-ci-matrix.md |
Backtick gate name in table counts as documented |
| Allowlist |
docs/doctor-gates-allowlist.txt (optional) |
Internal-only gates: WAVE3_ROADMAP_SYNC_GATE, PHP_COMPILER_SKIP_SERVE_TESTS, … |
| CI |
script/ci-common.sh |
ci_run_inventory_checks() next to #1802 / #2265 |
| Test |
test/unit/DoctorGatesSyncTest.php |
Shell out to checker or unit-test parser |
v1 gate name patterns (include)
*_SMOKE_GATE, *_SYNC_GATE, BOOTSTRAP_*_GATE, MINIWEBAPP_*_GATE, THROWSWEB_*_GATE, FASTCGI_*_GATE, SERVE_*_GATE
v1 exclusions (allowlist)
- Gates only used inside
ci-local.sh without presenter visibility (document why in allowlist file)
- Deprecated aliases (e.g. never-shipped
THROWSWEB_WEB_SMOKE_GATE — use THROWS_WEB_SMOKE_GATE)
Regen / fix workflow
php script/check-doctor-gates-sync.php
# add missing rows to lib/Doctor.php + docs/local-ci-matrix.md
./script/ci-fast.sh
Harness:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php script/check-doctor-gates-sync.php'
Acceptance criteria
Verification (local / Docker only)
./script/ci-fast.sh
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter DoctorGatesSync'
make test-harness
No GitHub Actions (#394 ✅).
Dependencies
Links
Problem
phpc doctor --gatesis the presenter-facing ladder for example web smokes and bootstrap probes (#1752, #1903, #2010, #2102), but new env vars land inscript/ci-defaults.env+docs/local-ci-matrix.mdwithout a mechanical check that doctor output still lists them.Gate drift causes “CI failed on
FOO_GATE” whilephpc doctor --gatesomitsFOO, wasting contributor time on harness hosts.Goal
script/check-doctor-gates-sync.php— parseci-defaults.envexport *_GATE=names (or curated allowlist file) and assert each appears inlib/Doctor.phpgate listing or documented opt-out list indocs/local-ci-matrix.mdDOCTOR_GATES_MATRIX_SYNC_GATE=1default inscript/ci-fast.shinventory checks (opt-out=0for doctor-only edits)test/unit/DoctorGatesSyncTest.php— fails with actionable diff when drift detectedImplementation hints
script/check-doctor-gates-sync.phpcheck-wave3-roadmap-sync.php/check-bootstrap-inventory-triage-sync.phpexit codesscript/ci-defaults.env^export ([A-Z0-9_]+_GATE)=lib/Doctor.phplistGate/ table rows for env var substringdocs/local-ci-matrix.mddocs/doctor-gates-allowlist.txt(optional)WAVE3_ROADMAP_SYNC_GATE,PHP_COMPILER_SKIP_SERVE_TESTS, …script/ci-common.shci_run_inventory_checks()next to #1802 / #2265test/unit/DoctorGatesSyncTest.phpv1 gate name patterns (include)
*_SMOKE_GATE,*_SYNC_GATE,BOOTSTRAP_*_GATE,MINIWEBAPP_*_GATE,THROWSWEB_*_GATE,FASTCGI_*_GATE,SERVE_*_GATEv1 exclusions (allowlist)
ci-local.shwithout presenter visibility (document why in allowlist file)THROWSWEB_WEB_SMOKE_GATE— useTHROWS_WEB_SMOKE_GATE)Regen / fix workflow
php script/check-doctor-gates-sync.php # add missing rows to lib/Doctor.php + docs/local-ci-matrix.md ./script/ci-fast.shHarness:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php script/check-doctor-gates-sync.php'Acceptance criteria
export EXAMPLE_FOO_GATEwithout doctor/matrix entry failsci-fastwhen gate enabledDOCTOR_GATES_MATRIX_SYNC_GATE=0skips for iterationVerification (local / Docker only)
./script/ci-fast.sh ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter DoctorGatesSync' make test-harnessNo GitHub Actions (#394 ✅).
Dependencies
--gatesbaselineLinks
docs/local-ci-matrix.md