Stack Elevator layer-purity rules#1
Conversation
- New CoreLayerPurityRule and ServiceLayerPurityRule enforcing Stack Elevator layer boundaries (Core must not depend on Service/Platform layers; Service must not depend on Platform) - StackElevatorLayerResolver and StackElevatorNameExtractor services for classifying symbols into stack layers - StackLayer enum defining the layer hierarchy - Test coverage for both rules with fixture data across clean and violating cases - Rules registered in extension.neon; composer.json and README updated Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2f087ad5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ($node instanceof Expr\New_ | ||
| || $node instanceof Expr\StaticCall | ||
| || $node instanceof Expr\StaticPropertyFetch | ||
| || $node instanceof Expr\ClassConstFetch |
There was a problem hiding this comment.
Include namespace constant fetches in layer checks
When Core or Service code reads a namespaced constant such as \Novatorius\Fixture\Integration\STRIPE_KEY, PHP-Parser emits Expr\ConstFetch, not Expr\ClassConstFetch, so extract() returns no name and both purity rules miss the lower-layer dependency even though constant fetches are documented as checked. Add handling for Expr\ConstFetch here so namespace constants cannot bypass the layer rules; built-in constants will still be ignored by the existing prefix checks.
Useful? React with 👍 / 👎.
Summary
Part of the Project Rocky agent-readiness wave.
CoreLayerPurityRule— Core-layer classes must not depend on Service- or Platform-layer symbolsServiceLayerPurityRule— Service-layer classes must not depend on Platform-layer symbolsStackElevatorLayerResolverandStackElevatorNameExtractorservices for classifying symbols into stack layers, plus aStackLayerenum defining the hierarchyextension.neoncomposer.jsonandREADME.mdaccordinglyAssumptions made during this work are logged in the charter-756 assumption log.
🤖 Generated with Claude Code
https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL