Repository navigation
chore: mago-sharp moves into php-sharp as sharp/mago - #120
Merged
Merged
Conversation
`mago init` sent every new project to upstream Mago. The generated mago.toml referenced https://mago.carthage.software/<version>/schema.json and upstream docs, and the closing summary linked upstream's site. It also hard-coded `version = "1"`, upstream's major line, so mago-sharp 0.2.0 refused to run in the project it had just initialized ("mago.toml is pinned to major version `1`, but the installed mago binary is `0.2.0`"). The generated file now: - references vendor/heyjordanparker/mago-sharp/schema.json only when the Composer wrapper has written that file next to the new mago.toml, and writes no schema line otherwise; - links the repository docs at the running version, https://github.com/heyJordanParker/mago-sharp/tree/<version>/docs, in the file comment and the closing summary; - pins the running binary's major version. The template substitution moves out of the test module into generate_config_content, so `mago init` and the tests share one path.
…pstream Mago The install, upgrade and configuration guides sent users to upstream Mago: the carthage.software installer, the ghcr.io/carthage-software/mago Docker image, Homebrew, WinGet, Nixpkgs and crates.io packages, the 1.51.0 release, and schema files hosted on mago.carthage.software. mago-sharp publishes none of those. Following them installed upstream Mago, and the 1.x version pins they showed make mago-sharp 0.x refuse to run. - The installer commands use mago-sharp's scripts/install.sh from the repository, in the guide, the home page and the README. - The Docker install section and the GitHub Actions container job are removed. The Homebrew, WinGet, Nixpkgs and Cargo sections are removed. - The README drops the crates.io badge, which showed upstream's version and linked upstream's crate. - Version examples use 0.2.0 and the 0 major line. - The editor schema section documents the Composer-written vendor/heyjordanparker/mago-sharp/schema.json and `mago config --schema` for other installs.
… purity of magic and property calls
Problem
- A `.sharp` property typed as a plain PHP class with `__invoke`, called as
`this.format(amount)`, gets two `call_targets` records: `Property` and the
`FunctionLike` of `Formatter::__invoke`. `Types::call_target` mapped both and
panicked in `agreed_kind`, so `mago compile` crashed on a file the checker
accepts.
- `Recorder::call` ignored the `MagicMethod` and `Property` records, so a getter
calling a method a plain PHP `__call` serves, or a plain PHP property holding
a closure, passed the pure-getter check with no `extern`.
Solution
- `Types::call_target` lowers a call with a `Property` record as that property.
The same call's `FunctionLike` records stay for the effects check.
- `Recorder::call` records a `MagicMethod` as a call of the class's `__call` or
`__callStatic`, through the same `extern` lookup as any plain PHP method
(spec section 29: a call to plain PHP with no declaration has an unknown
effect).
- `Recorder::property_call` records a call of a plain PHP property holding a
`\Closure` or a callable with the effects of the `extern` on its class, and
an unknown effect without one. A PHP# property has a `Function` type, which is
pure without `uses` (spec section 29: code without a body is pure unless it
says `uses`). An object's `__invoke` is already recorded as the method it is.
- `Effect::Unknown` names the target of the `extern` to write, so the help of a
property call names its class.
crates/
├── analyzer/
│ ├── src/effects/
│ │ ├── check.rs the help writes the extern target `Effect::Unknown` names
│ │ ├── mod.rs `Effect::Unknown` names the extern target
│ │ └── summary.rs `MagicMethod` and `Property` arms, `property_call`
│ └── tests/sharp.rs three pure-getter tests: magic calls, `Function` property, plain PHP properties
└── sharp-bridge/
├── src/lower/types.rs `call_target` lowers a call with a `Property` record as the property
└── tests/lower.rs a called property holding an invokable object lowers as the property
fix: PHP# messages in PHP#'s own words (null check, bool conditions, stub docblocks)
… pin the minor before 1.0 The Docker recipe documented ghcr.io/carthage-software/mago, an upstream image mago-sharp does not publish. Removing the pages also removes them from set-version.php, which read every listed file and stopped on a missing one. The sidebar is built from page front matter, so no menu entry remains. The GitHub Actions quick setup used nhedger/setup-mago, which installs upstream Mago. It now installs PHP, runs composer install and calls vendor/bin/mago. GITHUB_TOKEN is passed to the job because the Composer wrapper downloads the binary on first run and reads that variable to avoid anonymous rate limits. The note about 1.17.0 described upstream releases no mago-sharp version had, so it is gone. Below 1.0 a minor release is the breaking one, as in Cargo's caret rule, so mago init now writes version = "0.2" for a 0.2.x binary. From 1.0 on it writes the major alone, such as version = "1". A "0.2" pin under 0.3.0 is minor drift, which warns and runs under the default fail level. The configuration guides show the pin init writes and explain the rule. The README license badge read the license of upstream's mago crate on crates.io. It now reads this repository's license from GitHub.
Problem
In a .sharp file, an operand that may be `false`, such as the result of a
PHP method that returns `int|false`, got PHP's truthiness help:
Ensure the left operand is non-falsy before the operation, or explicitly
cast if coercion is intended.
Ensure the operand is non-falsy before concatenation, or explicitly cast
to string.
PHP# has no falsiness. It keeps `(int)` and `(string)` between numbers
only, so no cast turns `false` into a number or a string.
Solution
- The .sharp help names the `false` to rule out:
Ensure the left operand is not `false` before the operation.
Ensure the right operand is not `false` before the operation.
Ensure the operand is not `false` before concatenation.
- A .sharp file reaches the concatenation help after `text .= value`,
which the parser refuses as PHP syntax and still hands to the analyzer.
- .php text stays upstream's, byte for byte. The test pins the .php twin.
crates/analyzer/
├── src/expression/binary/arithmetic.rs possibly-false-operand help, both sides
├── src/expression/binary/concat.rs possibly-false-operand help
└── tests/sharp.rs an_operand_that_may_be_false_asks_for_a_check_of_false
…t may be false
Problem
In a .sharp file, a loop over a value that may be `false`, such as the
result of a PHP method that returns `list<int>|false`, got PHP's help:
Consider checking for `false` or truthiness before the loop if this is
not intended.
PHP# has no truthiness.
Solution
- The .sharp help names only the `false` to rule out:
Consider checking for `false` before the loop if this is not intended.
- .php text stays upstream's, byte for byte. The test pins the .php twin.
crates/analyzer/
├── src/statement/loop/mod.rs possibly-false-iterator help
└── tests/sharp.rs a_loop_over_a_value_that_may_be_false_asks_for_a_check_of_false
Problem
In a .sharp file, two `||` reports printed the bool their left operand
always is without backticks, while every other `&&` and `||` report
writes `true` and `false` as PHP# writes them:
Redundant `||` operation: left operand is always true and right operand
is not evaluated.
Redundant `||` operation: left operand is always false and right operand
is evaluated.
Solution
- `display_bool` gives a `bool` value as the analyzed file writes it in
prose: `true` and `false` in backticks in .sharp, bare in PHP.
`display_truth` uses it for its .sharp words.
- The two `||` reports use it:
Redundant `||` operation: left operand is always `true` and right
operand is not evaluated.
Redundant `||` operation: left operand is always `false` and right
operand is evaluated.
- .php text stays upstream's, byte for byte. The test pins both .php
reports.
crates/analyzer/
├── src/utils/names.rs display_bool, display_truth
├── src/expression/binary/logical.rs `true || x` and `false || x` reports
└── tests/sharp.rs a_condition_that_always_or_never_holds_speaks_of_its_bool
Problem
A .sharp file that calls a PHP method asserting `non-empty-mixed` got a
redundant-assertion note that named the asserted type as plain `Any`:
The assertion against `Any` always holds because `one` is `1`.
`Any` drops the non-empty that makes the assertion hold. PHP prints
Mago's `truthy-mixed`, which speaks of a truthiness PHP# does not have.
Solution
- `display_sharp_type` names a truthy `mixed` by the name its docblock
writes, as it already keeps Mago's `numeric`, `scalar` and `never`:
The assertion against `non-empty-mixed` always holds because `one` is
`1`.
- Only a `@psalm-assert non-empty-mixed` or `@return non-empty-mixed`
in PHP builds this type. `Any` and `Any?` stay as they are.
- .php text stays upstream's, byte for byte. The test pins the .php twin.
crates/analyzer/
├── src/utils/names.rs display_sharp_type
└── tests/sharp.rs an_assertion_of_non_empty_mixed_names_the_type_its_docblock_writes
Problem: mago compile started the Lean runner of each stale law file only after the previous one ended, so a project's law files verified one after another. One process per file is the shape to keep: in one process every import after the first copies 494 MB of .olean data, and Environment.freeRegions is unsafe under loaded extensions and initializers. Solution: Lean::prove runs the stale files' runners on Mago's thread pool, after the one lake build of the compile. The threads setting mago compile already uses caps how many run at once, and so caps memory near 465 MB per runner. The answers are then reported in file order as before. Cargo.lock <- mago-sharp-lean depends on rayon crates/sharp-lean/ ├── Cargo.toml <- adds the workspace's rayon └── src/lean.rs <- prove asks runner::check for every stale file in parallel tests/compile.rs <- two stale law files prove, break and run their runners at the same time
…rogram reaches it Problem 320c48e gave the possibly-false concatenation help a .sharp form. Only `text .= value` reached it, and the parser refuses `.=` in .sharp: `.=` is PHP syntax: in PHP# `.` is member access The analyzer still reports on that refused node, so the test pinned a path no PHP# program reaches. In .sharp, `+` on strings is analyzed in arithmetic.rs and never calls analyze_string_concat_operand: `+` cannot join `"a"` and `false|string`: it joins two strings or adds two numbers. Solution - concat.rs matches master again. Its help has one text, upstream's. - The test drops the `.=` method and its expected lines in both dialects, and keeps the arithmetic cases. crates/analyzer/ ├── src/expression/binary/concat.rs possibly-false-operand help, as on master └── tests/sharp.rs an_operand_that_may_be_false_asks_for_a_check_of_false
# Conflicts: # Cargo.toml
Problem In a .sharp file, a null check that cannot matter names the pattern it is written with, as in "Redundant `is null` check". The analyzer found the words `is` and `not` by scanning the source text back from the start of `null`. A comment between the words stopped the scan, so const a = report is /* c */ null; reported "Redundant `null` check" and lost the `is`. The scan also sat in a message helper, where other code would copy it. Solution - The words come from the syntax tree. `Is` keeps its `is` keyword and `NotPattern` its `not`, so the syntax tree is unchanged. - While the analyzer runs the PHP of an `is` or `match`, its context holds the form's patterns, each with the `is` written before it. - The report finds the pattern that holds the null value it checks, and names the `is` and each `not` written right before it. - `written_null_pattern`'s text scan is deleted. - The messages the tests pin keep their words. A .php file keeps its own `===` and `!==` reports. crates/analyzer/ ├── src/context/mod.rs Context.patterns ├── src/expression/mod.rs analyze_php_shape pushes and drops the form's patterns ├── src/expression/binary/comparison.rs written_null_pattern reads the nodes, written_words walks a pattern └── tests/sharp.rs a_redundant_null_check_names_its_pattern_without_its_comments
Problem - `Recorder::property_call` gave a call of a plain PHP `\Closure` or `callable` property the effects of the `extern` on its class, so `extern Holder;` made `this.holder.closure(2)` pure in a getter or a law. A class-wide `extern` declares the class's own members, not the code a property holds, which the caller can set to anything. - The refusal's help told the user to write `extern Holder;`, which must not fix the call. Solution - `Recorder::property_call` records the call as `Effect::Unknown(None)` whatever `extern` the class has. - `Effect::Unknown` carries the callee an `extern` would declare, or `None` for a property call, which no `extern` declares. - `impure` writes a property call's own help: the property holds plain PHP code with no declared effect, so type it as a PHP# `Function<…>` or move the call out of the getter or law. Every other unknown callee keeps the `extern` help. crates/analyzer/ ├── src/effects/ │ ├── check.rs the property help; impure names the getter or law it refuses │ ├── mod.rs Effect::Unknown(Option<Word>): None for a property call │ └── summary.rs property_call is always Unknown(None); plain_php wraps its cause in Some └── tests/sharp.rs extern Holder; leaves the getter refused; the law twin; HOLDER shared
Only plain PHP classes reach Effect::Unknown(None), because property_call returns early for a PHP# class. The help asked the developer to type the property as a PHP# Function<…>, which a plain PHP class cannot take. It now names what works: call the property outside the getter or law, or through a method of its class that an extern declares.
Problem: a Lean step that failed, from a lake crash, a broken runner pipe or a proof file that cannot be written, reported as "Database error: I/O error: ...", which sends the developer to the wrong part of Mago. And the .sharp folder was written out three times: in unit.rs for compiled_path, in the compile command for delete_all_but and package_compiled_folders, and in sharp-lean for .sharp/.lean/. Solution: the orchestrator reports prove's error as "The Lean step failed: <the error>." through OrchestratorError::General. unit.rs makes COMPILED_FOLDER public beside SHARP_UNIT_MAGIC, and the compile command and Package::new read it. crates/ ├── orchestrator/src/service/incremental_analysis/compile.rs <- maps prove's error to "The Lean step failed: …" ├── sharp-bridge/src/unit.rs <- pub const COMPILED_FOLDER └── sharp-lean/src/package.rs <- Package::new joins unit::COMPILED_FOLDER src/commands/compile.rs <- reads unit::COMPILED_FOLDER, drops its own copy
fix: point mago init and the install docs at mago-sharp instead of upstream Mago
…tter
Problem
Spec section 24 capitalizes every PHP# type except the built-in ones, and
the parser relies on it: `is_at_typed_local` reads a capitalized name
before `<` as a type with type arguments. Nothing checked the rule. A file
with `import Lib.Box as box;` and then `box<int> b = Crates.first();`
reads the local as a comparison, and the developer gets "This statement
has no effect: use the result of `box<int> b = Crates.first()`" instead of
an error that names the type.
Solution
One helper, `check_capitalized`, refuses a name whose first byte is not
A to Z, the same test the parser applies:
`box` must start with a capital letter: PHP# capitalizes every type except the built-in ones.
- `check_class_name` runs it on a class, interface or enum name, after the
reserved-name, keyword and `__Something__` checks, so a name gets one
error only. A name that starts with `_` is not capitalized and is
refused.
- Interfaces now go through `check_class_name` as classes and enums do,
so `check_slice` no longer checks an interface name on its own. This
also refuses `interface Mixed`, which the engine refuses as it refuses
`class Mixed`.
- `check_declarations` runs it on an import's `as` name, unless the
reserved-name error already refused that name.
Plain PHP files keep their lowercase class names and `use` aliases.
Type parameter declarations and `struct` do not parse on master yet, so
they are not covered here.
crates/semantics/
├── src/internal/
│ ├── mod.rs walk_in_interface calls check_class_name in .sharp
│ └── checker/sharp.rs check_capitalized; check_class_name runs it last;
│ check_declarations runs it on an import alias;
│ check_slice drops its own interface name check
└── tests/sharp.rs lowercase class, interface, enum and import alias refused,
capitalized forms clean, `_Box` refused, interface Mixed
refused, PHP twins unchanged
…t-callees refactor: lower a PHP# method call from what the analysis recorded it runs
Problem: the .lean folder that holds the Lake package was written out twice: as LEAN_FOLDER in the compile command, which keeps delete_all_but away from the package, and as a literal in Package::new, which builds it. A rename in one place would let mago compile delete the package it just built. Solution: mago_sharp_lean exports PACKAGE_FOLDER beside proof_file, and Package::new and the compile command both read it. The command's LEAN_FOLDER is gone, and the proving test asserts the package folder survives the compile. crates/sharp-lean/src/ ├── lib.rs <- exports PACKAGE_FOLDER └── package.rs <- pub const PACKAGE_FOLDER; Package::new joins it src/commands/compile.rs <- delete_all_but skips .sharp/ joined with PACKAGE_FOLDER, drops LEAN_FOLDER tests/compile.rs <- the proving test asserts the package folder is still a folder
# Conflicts: # crates/sharp-bridge/src/lower/types.rs
Problem: master gained #132, which refuses an `as`, `is` or `match` the engine has no test for, so the branch was behind master again. Solution: Merge origin/master at 9e99ae6. The merge had no conflict. #132 changes the semantics checker, the pattern utilities and one bridge test, and the branch changes none of them except the bridge test file, where both sides keep their own rows. crates/ ├── semantics/src/internal/checker/sharp.rs <- #132: refuses as, is and match without a PHP test ├── semantics/tests/sharp.rs <- #132 ├── syntax/src/utils/pattern.rs <- #132: one place decides which types as and is can test └── sharp-bridge/tests/lower.rs <- #132's new test beside this branch's dropped row
…loat # Conflicts: # crates/analyzer/src/expression/assignment/array_assignment.rs
… and one collection's inlined method Problem: The review of #118 found three programs the checker got wrong: - Registry.ids.add(1) on a static Set property was refused with mixed-property-access, because check_changed_collection wrote the property back as an instance property of the value Registry. List and Map had the same wrong error. Routing it to the static write showed that static_property_assignment never checked a private set, so Hidden.tags = [5] from another class compiled. - (maybe ??= []).add(1) on a Set<int>? compiled, and so did add("x"). The ??= value was typed Set<never>: analyze_assignment retyped the right side [] as the place's Set and used it for the whole coalesced value, dropping the Set<int> the left side kept. The place kept Set<never> afterwards too, and a property written with ??= did the same in property_assignment. - tags.add("b") on a List|Set local compiled. The call resolves on both collections, so the bridge runs Sharp\Collection::add, a List append, on the Set. filter on List|Set renumbers a Set the same way. Three tests also checked programs the semantic checks refuse: a Set<int|string>, union-typed properties, and public fields. Solution: - check_changed_collection sends Class.name to static_property_assignment, as assign_to_expression does. resolve_static_properties takes for_assignment, and a static write checks write visibility with check_resolved_property_write_visibility after the read check, as an instance write does. In PHP, a write past a public private(set) static property from another scope is now invalid-property-write too; PHP throws an Error there. - get_written_literal_type types a literal at a declared collection for = and ??= alike, in analyze_assignment and property_assignment. For ??= it retypes the right side alone and keeps the left side without null. - report_collection_method_on_object also refuses an INLINED_COLLECTION_METHODS call that resolves on more than one collection, with the same not-supported-yet refusal. - The three tests now check programs the language accepts, as the review asked. crates/analyzer/ ├── src/expression/call/method_call.rs <- static place; inlined method on several collections refused ├── src/expression/assignment/mod.rs <- get_written_literal_type; static_property_assignment pub(crate) ├── src/expression/assignment/property_assignment.rs <- uses get_written_literal_type ├── src/expression/assignment/static_property_assignment.rs <- resolves for assignment; PHP private(set) case ├── src/expression/access/static_property_access.rs <- resolves for reading ├── src/resolver/static_property.rs <- for_assignment checks write visibility └── tests/sharp.rs <- static place, ??= place, union rows; refused programs dropped
…line
Problem: round two of the review found four faults.
- `public float half() => 2 ** -1;` was reported twice: the `**` refusal,
then the float place's `convert with (float) (2 ** -1)`, which still throws.
- In a literal, the known-items loop stopped at the first refused item, so
`[1, "a"]` named the `1` while `["a", 1]` kept the ordinary message.
- `1_000_000` was quoted as `1000000.0`, not as written.
- A value written over several lines put its newlines into the title.
The 31 tests each carried a `.php` twin that guards nothing, and two of
them passed without the codex code they claimed to prove.
Solution:
- A refused power has the error type, as a refused PHP# index read does,
so its place and its readers report nothing more. `never` gave extra
`impossible-assignment` and `never-return` reports on `let` and `**=`.
- A literal's item refused only for an `int` is remembered and the loop goes
on. The array is refused for the `int` only when everything else fits.
- A decimal literal keeps its digits. Hex, octal and binary keep the value.
- `quoted_source` turns every run of whitespace that holds a newline into
one space.
- Five `.sharp`-only table tests replace the 31: places, fixes, ordinary
messages, accepted forms, exponentiation. The `int|List<int>` and
`int|Function<int()>` rows fail without the codex clears.
crates/
├── codex/src/ttype/comparator/array_comparator.rs <- items go on past an
│ int refusal
└── analyzer/
├── src/expression/binary/arithmetic.rs <- error type after the refusal
├── src/utils/mod.rs <- quoted_source; decimal literals keep digits
└── tests/sharp.rs <- five table tests, `.sharp` only
…ethods fix: a PHP# Set's add, remove and clear write back to a place, as a List's and a Map's changing methods do
feat: refuse an int where a float is expected in PHP# code
…hrough a method Problem - master 82593a4 does not compile. #129 gave static_property_assignment::analyze a seventh parameter, assigned_value, the written value an int-for-float refusal points at. #118 added a call to it in check_changed_collection with six arguments. Each pull request passed CI alone, and their merge fails with E0061 at crates/analyzer/src/expression/call/method_call.rs:569. Solution - check_changed_collection passes None as the assigned value. A changing method call, such as Registry.ids.add(1), writes the changed collection, not a value written in the code, so there is no int to quote. The property_assignment::analyze call below it already passes None for the same reason. - a_changing_collection_method_writes_back_through_a_static_property, #118's test of Registry.ids.add(1), Registry.lines.add(2) and Registry.counts.delete("a"), reaches this call and compiles and passes again. crates/analyzer/src/expression/call/ method_call.rs check_changed_collection passes None as a static property's assigned value
…tion-write fix: build master again, where a static collection property changes through a method
…t pin goes sharp/bin/test installed mago from GitHub at the commit SHARP_MAGO_COMMIT in ext/sharp/sharp_unit.h named, and refused an engine built at another commit. With Mago in sharp/mago, the tree is the version: sharp/bin/test builds sharp/mago with cargo into sharp/build/<os>-<arch>/mago, and the bridge's header, php --ri sharp and ri_sharp.phpt drop the commit.
php-src ignores **/tests/**/*.php, which matched 3,575 tracked files in sharp/mago, so a new Mago test fixture would never show in git status. sharp/mago keeps its own .gitignore.
Mago releases from php-sharp now, under php-sharp's v-prefixed tags. The Composer wrapper downloads its binary from php-sharp's release v<version>, mago self-update and scripts/install.sh read php-sharp's releases, and every link to the mago-sharp repository points at php-sharp and sharp/mago.
mago-sharp's ci.yml moves to .github/workflows/mago.yml and runs in sharp/mago. Its ci-passed now also needs plain-php, which takes sharp.yml's PLAIN_PHP: it installs heyjordanparker/mago-sharp from git archive, the way Packagist ships it, with the binary build-and-test and release-build built. sharp.yml stops reading a pinned Mago commit: it caches the Mago build by Cargo.lock and checks ext/sharp/sharp_unit.h against sharp/mago's bridge. Mago's inert issue templates and funding file go with its .github folder.
…l requests Mago's per-pull-request mutants shards took over an hour on every push. Each builder already proves a new test fails with its code removed, and the reviewer checks that proof. mutants.yml runs the same shards on master, against a merge's diff and nightly against the last day's diff, and blocks nothing.
mago-sharp's cd.yml moves to .github/workflows/release.yml. A tag such as v0.4.0 builds the mago binary per platform and publishes php-sharp's release, after checking that the tag, PHP_SHARP_VERSION and sharp/mago's Cargo version agree. The source archives go: php-sharp's tag archives hold sharp/mago.
sharp/mago/.gitattributes marks crates/, src/ and Cargo.* export-ignore, so php-sharp's own tag archives leave Mago's sources out. The release builds mago-<version>-source.tar.gz and .zip from sharp/mago again, as mago-sharp's release did, under names that say they hold Mago.
README.md, sharp/README.md, docs/how-we-work.md and docs/architecture/spec-examples.md stop describing a pinned Mago commit, a re-pin and a second repository. docs/architecture/mago.md says what builds from sharp/mago, how an upstream Mago tag comes in with git subtree pull, and how an owner moves an open mago-sharp branch over with git subtree merge.
The COMPOSER job splits sharp/mago with splitsh-lite and pushes it to heyJordanParker/mago-sharp with the MAGO_SHARP_DEPLOY_KEY deploy key on every master push and v* tag, as it splits sharp/composer, so Packagist keeps serving heyjordanparker/mago-sharp. splitsh-lite starts the split at the commit that added sharp/mago, so the push forces, and the mirror's archive branch keeps its commits from before the move. docs/architecture/mago.md says how each open engine pull request replaces its re-pin with one git subtree pull, and in which order they land.
Rust 1.99's clippy adds assert_is_empty to pedantic, and 28 test assertions in sharp/mago break it under --all-targets. mago-sharp's cached CI never re-linted them. Upstream Mago allows the lint beside manual_assert, so the tree does the same.
Against a base without sharp/mago, every Mago line is new, so the pull request that adds the tree can't be measured line by line. completes.yml passes the same way when the base has no sharp/bin/spec.
A force push on a published package's master could rewind it after any later mistake. splitsh-lite's split starts at the commit that added sharp/mago and doesn't hold 625c278, so it never contains the mirror's master. Until that branch is rewritten once, the job skips the master push with a warning. Tags still push.
heyJordanParker
added a commit
that referenced
this pull request
Oct 13, 2026
Master brings #120: Mago lives in `sharp/mago/`, and php-sharp pins no Mago commit. It also brings #105's failing spec examples as one empty file per example under `sharp/baseline/spec/`. Two files conflicted: - `ext/sharp/sharp_unit.h` takes master's side, with no Mago commit. The next merge, of mago-sharp `feat/slice-generics` into `sharp/mago/`, writes the header its bridge generates. - The slice's one-file list `sharp/baseline/spec` is removed, as docs/architecture/spec-examples.md says. The next merge lists the examples the slice fixes and fails in the folder. ext/sharp/sharp_unit.h master's header, which names no Mago commit sharp/baseline/spec the one-file list removed for the folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mago-sharp moves into php-sharp as
sharp/mago/, with its whole history, so one feature is one pull request across the checker, the engine, the standard library and the spec.What changes
git subtree add --prefix=sharp/magoof mago-sharp at625c278f8, the commit php-sharp's engine runs today, with full history (no--squash).git log -- sharp/magoandgit blamereach every mago-sharp and upstream Mago commit.sharp/bin/testbuildsmagofromsharp/mago/with cargo. Nothing comes from GitHub.SHARP_MAGO_COMMITleavesext/sharp/sharp_unit.h,php --ri sharpand the bridge'sbuild.rs.sharp.ymlverifiesext/sharp/sharp_unit.hagainst the bridge insharp/mago/.**/tests/**/*.phpignore rule no longer hides 3,575 files undersharp/mago/..github/workflows/mago.ymlruns Mago's gates per pull request: fmt, clippy-D warnings, the full workspace suite, the release build, the WASM build,typos, patch-coverage, andplain-php.plain-phpinstalls the Composer package from the tree.ci-passedaggregates them..github/workflows/mutants.ymlrunscargo mutantson each push to master and nightly, never on a pull request.v*tag runs.github/workflows/release.yml. It fails unlessPHP_SHARP_VERSIONand Mago's Cargo version both equal the tag.magofor every platform, with attestations and Mago's source archives, as php-sharp's release.install.sh,mago self-update, the Composer wrapper and every README and doc link now point at php-sharp's releases.heyJordanParker/mago-sharpbecomes a read-only mirror. TheCOMPOSERjob splitssharp/mago/withsplitsh-liteand pushes it there withMAGO_SHARP_DEPLOY_KEYon every master push andv*tag, so Packagist keeps servingheyjordanparker/mago-sharp.625c278f8is not in it. Until mago-sharp's master is rewritten once to the split, the job skips the master push and prints why. That one-time rewrite waits for Jordan's approval. Tags push. mago-sharp's brancharchiveholds the old master at9339e1f7e.Open pull requests
Each open engine PR merges master and replaces its re-pin with one pull of its pinned commit. Then it
git rms the two modify/delete filessharp/mago/.github/actions/setup-lean/action.ymlandsharp/mago/.github/workflows/ci.yml:They land in this order:
a9f18829acd18e1bb91b38428547859808bf1d0f. That commit holds the pins of Run section 9's constructors and init on the engine #110 (c3a2b5af8) and §28: the engine refuses a file whose law or structure rule the checker refuses #113 (b9ffc3c5e).feat/extensions,feat/slice-genericsandfeat/foreign-classes.Then one PR runs
git subtree pull --prefix=sharp/mago https://github.com/heyJordanParker/mago-sharp.git archivefor the rest of mago-sharp's master. The open mago-sharp PRs move over by their owners:An upstream Mago tag comes in the same way:
docs/architecture/mago.mdholds all of these.Verification
git subtree mergeof mago-sharpfeat/same-namespace-names(mago-sharp Eight fixes a Laravel app needed, and interface { get; init; } #179) applied cleanly. Its diff equals the branch's own diff: 9 files, +427/-85.a9f18829amerged with only the two expected modify/delete conflicts.git subtree pullof upstream tag1.51.1found the shared history. The fork left upstream at1.51.0.ext/sharp/sharp_unit.hequals the header the bridge at625c278f8generates (diff -u: no output).cargo fmt --all -- --checkinsharp/mago/passes.mago.yml,mutants.ymlandrelease.yml.sharp/mago/in 4.5 seconds.git merge-base --is-ancestor 625c278f8 <split>exits 1, and the split has one root.git subtree splitsegfaults on macOS and did not finish in 8 minutes on Linux.trace grep -i "github.com/heyjordanparker/mago-sharp"finds onlydocs/architecture/mago.md, and625c278f8appears only in history notes.