Skip to content

Document the BC/versioning policy, pair @internal with @psalm-internal, and make the BC check branch-aware - #90

Merged
MidnightDesign merged 1 commit into
masterfrom
chore/bc-enforcement
Jul 23, 2026
Merged

Document the BC/versioning policy, pair @internal with @psalm-internal, and make the BC check branch-aware#90
MidnightDesign merged 1 commit into
masterfrom
chore/bc-enforcement

Conversation

@MidnightDesign

@MidnightDesign MidnightDesign commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Establishes the project's backward-compatibility and versioning policy, fixes the @internal surface 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.md

Defines the public surface as 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 runs, and how the version is chosen and recorded.

2. @internal hygiene + a lint

Delimiters and TypeParser carried @psalm-internal but not @internal, so Roave (which only recognizes @internal) treated them as public API. This pairs them and adds InternalAnnotationConsistencyTest — a file-scanning guard (same style as the existing BuiltinFunctionsTest) that fails if any @psalm-internal symbol lacks @internal, keeping the surface from drifting again.

3. Branch-aware BC check

The Backward Compatibility job runs Roave as:

  • informational on master and feature branches — during a pre-release minor cycle the trunk intentionally accumulates the next version's breaks, so a reported break there is expected;
  • blocking on maintenance branches (*.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 src changes are docblock lines (no mutations), and the new test lives in tests/. Roave itself only runs in CI.

Notes

🤖 Generated with Claude Code

…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
MidnightDesign merged commit 69efa1d into master Jul 23, 2026
25 checks passed
@MidnightDesign
MidnightDesign deleted the chore/bc-enforcement branch July 23, 2026 12:35
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
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