Skip to content

ci: SPEC_GUARD lets a feature PR change the spec with its code - #119

Merged
heyJordanParker merged 3 commits into
masterfrom
chore/spec-guard-feature-prs
Oct 13, 2026
Merged

heyJordanParker merged 3 commits into
masterfrom
chore/spec-guard-feature-prs

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

SPEC_GUARD stops one feature from landing as one pull request. This lets a feature PR change the spec, its examples, sharp/baseline/spec, the harness, the checker and the engine together. It keeps the ratchet.

What changes

  • The docs-only rule goes. An entry no longer joins sharp/baseline/spec only in a PR that changes docs/spec.md, README.md and the list alone.
  • GUARDED keeps only sharp/bin/spec. That file is the code that measures an example, so it still changes only in a PR of its own, beside Markdown. sharp/bin/, sharp/docker/ and .github/ leave the guard. So does sharp/harness/, because feature PRs add harness classes: the structs examples needed Username.sharp.
  • A harness change is reviewed instead. A PR that adds or changes a file in sharp/harness/ lists it in its body. Its review checks that no stub makes an example pass falsely. docs/architecture/spec-examples.md, docs/how-we-work.md and sharp/README.md say so.
  • The ratchet stays.
    • An example that passes must leave the list. That is sharp/bin/spec in LINUX.
    • An example off the list must pass. That is the same check.
    • An example whose fingerprint the base already checked never joins the list. That is SPEC_GUARD.
  • The guard reads the list as a folder too. SPEC_GUARD and COMPLETES run the base's sharp/bin/spec. So this script learns to read sharp/baseline/spec/<section>/<id> before the next PR, chore/spec-list-folder, turns the list into that folder. It also counts the folder's files as the list, not as "other files".
    • After this merges, chore/spec-list-folder converts master's 113 entries to one empty file each. It also deletes the one-file reading this PR keeps.
    • That split is forced: master's guard refuses any PR that changes sharp/bin/spec beside a new file outside its list. So the folder can't arrive in this PR.

Verification

  • Master's guard on this branch: php origin/master:sharp/bin/spec --base origin/master printed "0 entries join sharp/baseline/spec, 0 leave it."
  • This branch's guard on itself: sharp/bin/spec --base origin/master printed "0 entries join sharp/baseline/spec, 0 leave it."
  • This branch's guard judging chore/spec-list-folder (folder head, file base): it printed "0 entries join sharp/baseline/spec, 0 leave it."
  • This branch's COMPLETES on the folder: BODY="Completes: §30" printed "§30 still has 1 entries in sharp/baseline/spec: tuples."
  • php -l sharp/bin/spec: no syntax errors.

The guard let an entry join sharp/baseline/spec only in a PR that changed
docs/spec.md, README.md and the list alone, and kept every example and every
file in sharp/harness/, sharp/bin/, sharp/docker/ and .github/ unchanged in
any PR that changed code. So a feature could never land its spec change,
its checker and its engine in one PR. Both rules go. GUARDED shrinks to what
measures the examples, sharp/bin/spec and sharp/harness/, which still change
only in a PR of their own. The ratchet stays: the list names exactly the
failing examples, and an example the base checked never joins it unchanged.
sharp/bin/spec changes only in a PR of its own, so its comments say what
holds before and after Mago moves into the tree: sharp/bin/test provides the
mago it runs.
…folder too

Feature pull requests add harness classes, such as the Username struct the
structs examples use, so GUARDED keeps only sharp/bin/spec, the code that
measures an example. A pull request lists its harness changes, and its
review checks that no stub makes an example pass falsely.

The guard and COMPLETES run the base's sharp/bin/spec on the pull request.
So this one learns to read sharp/baseline/spec as a folder of empty
<section>/<id> files, and counts that folder's files as the list, before
the pull request that turns the list into that folder.
@heyJordanParker
heyJordanParker merged commit 849c0f1 into master Oct 13, 2026
12 checks passed
@heyJordanParker
heyJordanParker deleted the chore/spec-guard-feature-prs branch November 3, 2026 22:08
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