Document the BC/versioning policy, pair @internal with @psalm-internal, and make the BC check branch-aware - #90
Merged
Conversation
…ernal, and make the BC check branch-aware Three related pieces: - docs/BACKWARD-COMPATIBILITY.md sets out the policy: the public surface is every public symbol not marked @internal, the pre-1.0 rule that the minor is the compatibility boundary, the split between structural and behavioral breaks, how the check is wired, and how the version is chosen and recorded. - @internal hygiene: Delimiters and TypeParser carried @psalm-internal but not @internal, so the BC checker (which only recognizes @internal) treated them as public API. Pair them, and add InternalAnnotationConsistencyTest to keep every @psalm-internal symbol paired with @internal going forward. - The Backward Compatibility CI job is informational on master and feature branches — where the trunk intentionally accumulates the next minor's breaks — and blocking on maintenance branches (*.x), which promise compatibility. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaVJhFFYHJee3UokQwFG6E
MidnightDesign
force-pushed
the
chore/bc-enforcement
branch
from
July 23, 2026 12:28
0ee6bc6 to
8689415
Compare
MidnightDesign
added a commit
that referenced
this pull request
Jul 23, 2026
Brings in the trunk process docs (#89) and the BC policy + @internal hygiene (#90). Conflict resolution: - src/Parser/Delimiters.php: kept deleted. generics removes this class; #90 had added @internal to it on master. Keeping it deleted wins. - src/Parser/TypeParser.php: auto-merged. It now carries #90's @internal next to its @psalm-internal, alongside the generics changes. InternalAnnotationConsistencyTest (from #90) passes: every @psalm-internal source file also carries @internal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaVJhFFYHJee3UokQwFG6E
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.
Summary
Establishes the project's backward-compatibility and versioning policy, fixes the
@internalsurface so the break-detector reads it correctly, and wires that detector to match how the branches are used.1. BC/versioning policy —
docs/BACKWARD-COMPATIBILITY.mdDefines the public surface as every
publicsymbol not marked@internal, the pre-1.0 rule that the minor is the compatibility boundary, the split between structural and behavioral breaks, how the check runs, and how the version is chosen and recorded.2.
@internalhygiene + a lintDelimitersandTypeParsercarried@psalm-internalbut not@internal, so Roave (which only recognizes@internal) treated them as public API. This pairs them and addsInternalAnnotationConsistencyTest— a file-scanning guard (same style as the existingBuiltinFunctionsTest) that fails if any@psalm-internalsymbol lacks@internal, keeping the surface from drifting again.3. Branch-aware BC check
The
Backward Compatibilityjob runs Roave as:masterand feature branches — during a pre-release minor cycle the trunk intentionally accumulates the next version's breaks, so a reported break there is expected;*.x, e.g.0.3.x), which promise compatibility.Implemented via
continue-on-error: ${{ !endsWith(github.base_ref, '.x') }}.Validation
PHPUnit (1030 tests), PHP CS Fixer, PHPStan, and Psalm all pass locally. Infection is unaffected — the only
srcchanges are docblock lines (no mutations), and the new test lives intests/. Roave itself only runs in CI.Notes
master; independent of Point Dependabot at master and document the trunk-based release model #89 (RELEASING.md), which this doc cross-references.@internalis itself a structural change Roave will report onmaster— expected and informational during the 0.2 → 0.3 window.🤖 Generated with Claude Code