Repository navigation
ci: check architecture rules with StructArmed - #174
Merged
Merged
Conversation
…chitecture rules These classes broke the rules StructArmed starts enforcing in the next commit; `BinaryException` is never thrown on its own, and the Velox `Strategy` interface has no implementation. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
StructArmed runs isolated in `tools/structarmed` through bamarni/composer-bin-plugin, as in Testo, so its dependencies never touch the root lock beyond the plugin itself. Rules: Kernel (Common, Config, Version, Service) must not reach into modules or the CLI shell, modules must not depend on the shell or cyclically on each other, an `Internal` namespace stays private to its module and out of public signatures; the `@internal` tag grants no exemption because nearly every class in DLoad carries it. Known debt — the `Registry`/`Repository` cycle, `DloadResult` in Common, Velox reaching for the `DLoad` facade — sits in `baseline.php`, so the check blocks only new violations. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
`DloadResult` is public API and hands out a `Binary`, so `Binary` is part of the shared contract rather than debt to move out; it already depends on kernel modules only. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
🔍 What was changed
composer structarmed, after a one-timecomposer bin structarmed install; it lives isolated intools/structarmed, as in Testo. A new blockingstructarmedjob in the static analysis workflow runs it on every PR.Binary,Common,Config,Version,Service) does not reach into modules or the CLI shell, modules do not depend on the shell or cyclically on each other, anInternalnamespace stays private to its module and out of public signatures, andsrcuses noexit/eval/superglobals/debug dumps.Internalrules come from Testo with one change: the@internaltag grants no exemption, since nearly every DLoad class carries it.srcfixes the rules asked for: missing@internaltags,finalNyholmFactoryImpl, abstractBinaryException, and the unused VeloxStrategyinterface removed.Review notes
Existing debt sits in
tools/structarmed/baseline.php, so the check fails only on new violations. Each item needs a refactoring of its own:Registry↔Repositorycycle; the cheap cut is on theRegistryside, where three classes depend onRepositoryonly forRepositoryException.Velox\Internal\DependencyCheckerdepends on theDLoadfacade.Software\ComposerPackagesusesCommon\Internal\Injection\ConfigInflector.Checklist
composer structarmedpasses; a probe class with deliberate violations tripped every custom rulecomposer psalmpassesDownloaderTestandPackageRegistryCommandsTestfail locally, with and without these changes