Skip to content

chore: sharp/mago pulls mago-sharp's last master, and an absent input is there only under its exact name - #125

Closed
heyJordanParker wants to merge 6 commits into
masterfrom
chore/mago-archive
Closed

heyJordanParker wants to merge 6 commits into
masterfrom
chore/mago-archive

Conversation

@heyJordanParker

@heyJordanParker heyJordanParker commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

mago-sharp is frozen, and its archive branch keeps its last master, 29fc7ec. sharp/mago/ held mago-sharp 3cc39cc, the commit #114 pulled, so two merged mago-sharp pull requests never reached PHP#:

Solution

  • sharp/mago/ pulls mago-sharp's last master, as docs/architecture/mago.md says:
    git subtree pull --prefix=sharp/mago https://github.com/heyJordanParker/mago-sharp.git archive -m "Merge mago-sharp's last master into sharp/mago"
    fix: extension hosts read PHP# as it means, load project classes, and fit the timeout #181 changes only mago-sharp's .github/workflows/ci.yml, which sharp/mago/ no longer has, so the modify/delete conflict is resolved with git rm. php-sharp's .github/workflows/mutants.yml already runs mutants only on master and nightly, never on a pull request, so nothing carries over.
  • An input stamped absent is there only under its exact name, as on Linux. Eight fixes a Laravel app needed, and interface { get; init; } #179 lists the files that would declare a class of the file's namespace, as Zend/tests/sharp/Environment.php beside Deploy.sharp, as inputs stamped absent. On a disk that ignores case, as macOS's does, run-tests writes environment.php for environment.phpt, and the engine opened it for Environment.php. So the engine refused Deploy.sharp, PhpForms.sharp and Positions.sharp as out of date, and the MACOS job would fail. This is be812ec from feat/extensions (feat: run extension members and give string its trim(), spec section 26 #115), without that branch's SOURCE_LISTING:
    • the engine's sharp_folder_holds_name keeps an input stamped absent current unless its folder holds a file of exactly that name;
    • the bridge's unit::stamp stamps a file only when its folder holds it under its exact name. It asks the folder before it reads the file, so a missing file takes the same branch on Linux, where patch-coverage runs, as on macOS, and a missing folder holds nothing;
    • refusal_absent_input.phpt and the bridge's stamp test cover a name that differs only in case and a missing folder.

Spec examples

sharp/bin/test --spec passes one more example, which leaves sharp/baseline/spec/, and no entry joins it:

  • §23 own-namespace-shadows

Verification

On macOS:

  • sharp/bin/test --census --differential --spec, after merging master: 176 of 176 tests pass, laws.phpt and structure_rules.phpt included, the census and differential pass, every file mago compile accepts passes php -l, 17 of 17 self-test examples, and the spec run matches sharp/baseline/spec/: 179 examples checked, 1 ignored, 91 fail.
  • sharp/bin/spec --base origin/master reports "0 entries join sharp/baseline/spec, 1 leave it."
  • cargo test -p mago-names -p mago-orchestrator -p mago-semantics -p mago-analyzer -p mago-sharp-bridge passes, and so do cargo fmt --check and cargo clippy -D warnings on the bridge.
  • mago analyze of sharp/composer finds no issues.
  • The bridge's generated sharp_unit.h and kind.rs equal the committed ones.

Files

sharp/
├── mago/                            mago-sharp 29fc7ec93, its last master, by git subtree pull
│   └── crates/sharp-bridge/
│       ├── src/unit.rs              stamp: a file is there only under its exact name
│       └── tests/unit.rs            a name that differs only in case stamps nothing
└── baseline/spec/                   loses §23 own-namespace-shadows
ext/sharp/sharp.c                    sharp_folder_holds_name: an input stamped absent stays current unless its exact name is there
Zend/tests/sharp/refusal_absent_input.phpt   environment.php is no Environment.php

heyJordanParker and others added 6 commits October 13, 2026 23:08
# Conflicts:
#	sharp/mago/.github/workflows/ci.yml
A compiled file lists, as inputs stamped absent, the files a class name
could resolve to, as `Environment.php` beside a file that names the
standard `Environment`. A disk that ignores case, as macOS's does by
default, opens `environment.php` for `Environment.php`. So the engine
refused that compiled file as out of date while run-tests wrote
`environment.php` for `environment.phpt`, and a compile beside it
stamped `Environment.php` with `environment.php`'s hash.

- The engine's `sharp_folder_holds_name` keeps an input stamped absent
  current unless its folder holds a file of exactly that name.
- The bridge's `unit::stamp` stamps a file only when its folder holds
  it under its exact name, through `folder_holds_name`.

A compile on a disk that ignores case and one on Linux now stamp the
same inputs, and the engine reads them the same way.

Cherry-picked-from: be812ec on feat/extensions (#115), without that branch's SOURCE_LISTING
Co-Authored-By: Claude <[email protected]>
mago-sharp #179 lets a class of the file's namespace win over a Sharp default name, so §23's own-namespace-shadows passes.

Co-Authored-By: Claude <[email protected]>
patch-coverage runs on Linux, where a file opens only under its exact name, so no test reached the branches where the folder holds another case of it. stamp now checks the folder first: a missing file takes the same branch on every disk, and a missing folder holds nothing. Every input stamps as before.

Co-Authored-By: Claude <[email protected]>
# Conflicts:
#	sharp/mago/crates/sharp-bridge/src/unit.rs
#	sharp/mago/crates/sharp-bridge/tests/unit.rs
@heyJordanParker

Copy link
Copy Markdown
Owner Author

Closed without merging: master already holds everything this PR was for. mago-sharp's final master (29fc7ec, with #179 and #181) is in master's history through #115, and the case-exact absent-input fix landed with #115. At ca2d9cc the branch changes 0 files.

@heyJordanParker
heyJordanParker deleted the chore/mago-archive branch October 13, 2026 22:47
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