Skip to content

ci: sharp/baseline/spec becomes one empty file per failing example - #122

Merged
heyJordanParker merged 2 commits into
masterfrom
chore/spec-list-folder
Oct 13, 2026
Merged

heyJordanParker merged 2 commits into
masterfrom
chore/spec-list-folder

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

sharp/baseline/spec becomes a folder with one empty file per failing example, so feature PRs that fix or list different examples never edit the same file. Today every merge to master conflicts every open PR. #116 did it to #102, #110, #113, #114 and #115.

What changes

  • One file per failing example. Master's 113 entries become sharp/baseline/spec/<section>/<id>, for example sharp/baseline/spec/§12/iterables. towncrier keeps changelog entries the same way, one news fragment per file.
  • The failing run prints the commands.
    • git rm -q sharp/baseline/spec/<section>/<id> for an example that passes.
    • mkdir -p … && touch … for a new failure.
    • This replaces the old cp command.
  • Every rule stays as strict.
    • An example that passes must leave the list.
    • An example off the list must pass.
    • An example the base already checked never joins the list unchanged.
    • sharp/bin/spec also fails on a file that isn't empty, a path that isn't <section>/<id>, and an id listed under two sections.
  • No legacy path. ci: SPEC_GUARD lets a feature PR change the spec with its code #119 taught the guard to read the folder, and this PR deletes the one-file reading. A base with no list now lists no example instead of skipping the comparison.

Open PRs

An open PR that edited the old list converts once, when it merges master:

  1. git reports a modify/delete conflict on sharp/baseline/spec. Resolve it with git rm sharp/baseline/spec.
  2. Run sharp/bin/test --spec.
  3. Run the commands it prints. They delete the files of the examples the PR fixed and add files for the examples it lists.

docs/architecture/spec-examples.md says so.

Verification

  • Master's guard on this branch, as SPEC_GUARD runs it. php origin/master:sharp/bin/spec --base origin/master printed "0 entries join sharp/baseline/spec, 0 leave it."
  • This branch's guard refuses an unchanged example that joins. Adding README/readme-cart printed "README readme-cart joins the list, and its code and setup are the same as readme-cart's at chore/spec-list-folder." with exit 1.
  • It refuses a malformed path. §2/bad name printed "sharp/baseline/spec/§2/bad name is not a <section>/<example id> file, such as sharp/baseline/spec/§6.1/map-reads." with exit 2.
  • COMPLETES on the folder. BODY="Completes: §30" printed "§30 still has 1 entries in sharp/baseline/spec: tuples."
  • The full spec run. The LINUX job runs the check against the folder.

Every feature pull request edited the one list file, so every merge to
master conflicted every open pull request: #116 did it to #102, #110, #113,
#114 and #115. towncrier keeps changelog entries as one file each for the
same reason. Each failing example is now sharp/baseline/spec/<section>/<id>.
A passing example leaves through the git rm the failing run prints, and
every rule stays as strict. master's 113 entries convert in this commit.
@heyJordanParker
heyJordanParker merged commit ff9c05a into master Oct 13, 2026
12 checks passed
heyJordanParker added a commit that referenced this pull request Oct 13, 2026
Problem: the generics slice branched from master c3a4a3c. Master since
gained effects on function types (#126), private fields with no modifier
(#128), union collections (#116), the sortedBy key rule (#125), macOS and
Linux CI (#127), function uses (#122) and message fixes (#117). Ten files
conflicted, and one master test named a syntax field the slice renamed.

Solution: every conflict keeps both sides' behavior.
- A refused expression has the error type in PHP# and `never` in PHP, as
  master types it, and `is_refused` keeps the slice's wider set of refused
  generic expressions.
- An argument is a possible mismatch only when the parts it may share with
  the parameter, as `shareable_part` takes them, fit through master's
  `can_argument_be_identical`, and `verify_argument_type` returns whether
  the argument fits, as master's effect rules read it.
- A method value's signature names the class it is read through, as master
  needs for `extern` lookups, while the slice still specializes it for its
  receiver and fixes its type arguments.
- A PHP# literal's backed enum key and master's other new calls pass the
  dialect `get_backing_key_type` takes on the slice.
- Comparisons master added use the slice's `ComparisonResult::for_dialect`.

crates/
├── analyzer/src/
│   ├── artifacts.rs                         tested_types beside function_values
│   ├── expression/
│   │   ├── array.rs                         master's PHP# key branch, with the dialect
│   │   ├── assignment/array_assignment.rs   every declared element, for_dialect
│   │   └── mod.rs                           slice's is_refused, master's error type
│   ├── invocation/arguments.rs              shareable_part over can_argument_be_identical
│   ├── resolver/
│   │   ├── method.rs                        declared collections, paired with their written atomic
│   │   └── property.rs                      method value source is the read-through class
│   └── statement/
│       ├── class_like/property.rs           for_dialect, records fitting function values
│       └── function_like/mod.rs             passes tested_types and function_values up
├── codex/src/scanner/ttype.rs               function type keeps its effects and its type parameters
└── syntax/tests/sharp.rs                    effects test reads type_arguments.arguments
@heyJordanParker
heyJordanParker deleted the chore/spec-list-folder 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