Refactor source transformation pipeline to a NodeVisitor-only architecture with loader-level format-preserving rewrites#539
Conversation
Agent-Logs-Url: https://github.com/goaop/framework/sessions/394b44de-ca4b-4bd4-8e8c-d069ac809e31 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/394b44de-ca4b-4bd4-8e8c-d069ac809e31 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/394b44de-ca4b-4bd4-8e8c-d069ac809e31 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/394b44de-ca4b-4bd4-8e8c-d069ac809e31 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/394b44de-ca4b-4bd4-8e8c-d069ac809e31 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
|
Also, tests are failing, need to fix them |
Agent-Logs-Url: https://github.com/goaop/framework/sessions/a39606c2-5549-4b92-b37d-f553cb4e8674 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/a39606c2-5549-4b92-b37d-f553cb4e8674 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/d651467f-5a08-4721-8219-eb208e6f2c90 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/d651467f-5a08-4721-8219-eb208e6f2c90 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Fixed in 933b34b/ad660bb by removing CloningVisitor usage in these transformer tests and aligning visitor-based traversal/context handling. UI screenshot: N/A (no UI changes). |
|
@copilot unit tests are failing |
Agent-Logs-Url: https://github.com/goaop/framework/sessions/372a4726-dec2-4654-a274-311311f7d787 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
|
@copilot still build is failing. Could you please also add GH token for composer to phpstan + phpunit to fix download error and to make phpstan/phpunit working |
Agent-Logs-Url: https://github.com/goaop/framework/sessions/7222fd61-2aa4-449b-a482-83a9be6df6f2 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Implemented in a7d28cd: added |
|
@copilot phpstan and phpunit builds are failing, please fix them |
Agent-Logs-Url: https://github.com/goaop/framework/sessions/20cf0406-3022-4120-9d3b-37dadd7d08c0 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/20cf0406-3022-4120-9d3b-37dadd7d08c0 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/20cf0406-3022-4120-9d3b-37dadd7d08c0 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Implemented in 56bbdaf (plus c96302d/44108f6): fixed the remaining PHPStan/PHPUnit failures by normalizing parser tokens to |
|
@copilot update your own instruction in the repository to use PHP8.4 version for running the copilot workflow. Configure and install necessary version for code-review, ensure that composer install is completed successfully, otherwise stop. Once composer will work - check build failure again and fix it |
Agent-Logs-Url: https://github.com/goaop/framework/sessions/17f93181-79a7-4e48-ace5-e0046e117914 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goaop/framework/sessions/17f93181-79a7-4e48-ace5-e0046e117914 Co-authored-by: lisachenko <640114+lisachenko@users.noreply.github.com>
Implemented in f9f9296 (plus 94ab8ab): added |
|
@copilot please recreate this PR from scratch - keep all GIT changes, but make another branch and PR to start from clean context |
|
@lisachenko I've opened a new pull request, #540, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
Still, not working ( AST pretty-printing often fails to keep new lines, breaking the line number mapping, therefore not possible at the moment |
The framework now moves source transformation orchestration into
SourceTransformingLoaderwith a single AST traversal + format-preserving print pass, while keepingStreamMetaDataas a DTO of original parse artifacts (stream metadata, original AST, original tokens).DTO-only StreamMetaData
StreamMetaDatastores original metadata/AST/tokens only.Centralized AST traversal and printing in loader
SourceTransformingLoader::transformCode()returns transformed AST (Node[]).NodeTraverserwith registered visitors is used.printFormatPreserving) is performed in loader using old AST/tokens + new AST.NodeVisitor-only transformation pipeline
SourceTransformerruntime flow was removed.AspectKernel::registerTransformers()block was removed.SourceTransformingLoader::$transformersandaddTransformer()were removed.SourceTransformerinterface was removed.Typed visitor result reporting
NodeTransformerResultReporterwithgetNodeTransformerResult(): TransformerResultEnum.method_exists(...)checks.Weaving converted to NodeVisitor
WeavingTransformernow participates in traversal as a node visitor and reportsTransformerResultEnum.Namespace-level context injection
FileNameInjectorNodeVisitor.Namespace_nodes (includingStreamMetaDataDTO and original file name), not on every node.MagicConstantTransformerreads filename context from namespace attributes and keeps local namespace-scope state.Caching flow in stream filtering
SourceTransformingLoader.Docs / BC break
Tests updated for visitor pipeline
transform()calls.