Repository navigation
Redesign detection API around ecosystems and detectors - #48
Merged
Merged
Conversation
pushpak1300
force-pushed
the
refactor
branch
2 times, most recently
from
May 18, 2026 19:06
86813eb to
e1dc1b3
Compare
pushpak1300
marked this pull request as ready for review
June 19, 2026 09:46
pushpak1300
marked this pull request as draft
July 3, 2026 17:25
This was referenced Jul 3, 2026
Applies the over-engineering audit findings: - Fold directory conventions (action, ddd, modular) into approaches() as full-confidence results, removing the parallel approach() EnumSet and ApproachDetector - Replace the Wilson score interval with a plain >80% vote-share gate - Replace the enum-case tokenizer with a line-based regex (enum cases end in ; or =, switch labels end in :) - Remove the unused ttl()/withoutCache()/fresh() cache knobs - Remove InstalledSet in favor of EnumSet::uses on System surfaces - Remove the Hosts\Js wrapper in favor of System::jsPackageManagers() - Remove the empty PhpEcosystem subclass; Ecosystem is now concrete - Remove unused PackageCollection::direct()/indirect(), Package::matches(), SystemProbe::pathExists()/resetCache(), and JsLockfile memoization - Reuse MarkerDetector::markerMatches for the cache marker hash - Drop the unused illuminate/routing dependency - Restructure README and UPGRADE guides in the Laravel docs style Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Roster now reports only on the project itself. The System facade, its manager, the PATH binary probes (SystemProbe, PackageManagersDetector, the detectors' system-binary tables), and the roster:scan --no-system flag are removed. Host-machine detection can return in a future release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
#65) Correctness: - Replace Log facade calls in scanners with a container-safe warn helper so Project::scan() no longer crashes outside a Laravel container - Report Stack::LIVEWIRE for Volt-only apps instead of falling through to Stack::BLADE - Stop ProjectManager::scan($path) from repointing the memoized default instance when scanning another directory - Resolve composer vendor-dir from a memoized manifest so computePath() no longer depends on call order - Add missing declare(strict_types=1) to PackageCollection, PackageJson, and YarnPackageLock API: - Rename stack()/frontend() to stacks()/frontends() across Project, ProjectManager, the facade, and toArray() keys - Add EnumSet::usesAll(), ApproachSet::usesAll(), and ApproachSet::result() for typed result lookup - Type EnumSet::uses() as BackedEnum|array instead of mixed - Add ProjectManager::fresh() to bypass the cache, and proxy toArray() - Accept any-of arrays in Ecosystem::usesDirect() and add PackageCollection::direct() - Make Package::major() return null for unknown versions - Make the roster:scan directory argument optional, defaulting to the application base path - Mark Project::normalizeBasePath() as internal Architecture: - Extract a shared PackageScanner base and fold the duplicated direct-dependency, constraint, and path logic out of the Composer and JS scanners; rename Composer to ComposerLock with a directory-based constructor matching every other scanner - Unify scanner error handling: consistent warning level, lockfile path in every message, and distinct decode-failure vs missing-key messages - Derive the cache lockfile list from JsPackageManager::cases() and version the cache key - Inline the single-use CachesScan trait into ProjectManager - Remove SourceFiles::contains() to avoid double file reads on the approaches scan path - Drop the lockFile() abstract that PackageJson had to fake Tests: - Cover YarnPackageLock (v1, berry, scoped headers) and BunPackageLock (JSONC, malformed) using the previously orphaned fixtures - Cover EditorsDetector including glob markers - Cover cache hit, lockfile-content invalidation, fresh(), no-driver fallback, and default-instance isolation on ProjectManager - Pin normalizeVersion behavior for prerelease/range/protocol shapes - Add StackDetector branches: inertia vue/svelte, legacy adapter, passport, folio/volt API suppression, blade suppression - Replace in-place fixture renaming with temp-dir copies, drop the unused toBeOne expectation and no-op TestCase overrides, and remove orphaned fixtures
pushpak1300
marked this pull request as ready for review
July 6, 2026 13:34
Project (the low-level, uncached scan primitive) shared its name with the Facades\Project facade, so importing the wrong one silently lost caching. Renaming it to ProjectScan and routing ScanCommand and the README's non-container example through ProjectManager instead leaves exactly one obvious public entry point. Also removes the invokable-vs-resourceful controller-style detector: its 2-of-7 REST-action-name heuristic was loose enough to misclassify controllers with just a couple of coincidentally-named custom actions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was
linked to
issues
Jul 8, 2026
joetannenbaum
left a comment
Contributor
There was a problem hiding this comment.
This looks good overall. It's a massive PR that I wish was split up into incremental steps that was easier to consume, but from what I see it looks good. Just a couple of questions/comments.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 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.
Currently Roster is a flat list of composer packages: you ask
$roster->uses(Packages::INERTIA)and get a bool. There's no place for JS packages, no notion of a stack, no way to ask about frontend, browser test framework, configured agents and editors, or the conventions a codebase has adopted.This PR redesigns detection around a single
Projectfacade that reads lockfiles, configuration markers, and (opt-in) the project's own source code.Before:
After:
usesand the oldusesVersioncollapse into one signature:uses($packages, $constraint = null)accepting any composer-semver constraint (^1.2.3,~1.2,>=11 <14,1.0 || ^2.0, bare1.2.3= exact match). Batch checks land via array shapes: indexed array for any-of names, associative for per-package constraints, plus a separateusesAllfor the "every one of these" question. The enum surfaces (stacks,frontends,browserTestFrameworks,agents,editors) share the sameuses/usesAll/allshape viaEnumSet.JS lockfile scanners (npm, pnpm, yarn, bun) walk the full lockfile rather than just root dependencies, so
js()->uses()finds transitive packages the same wayphp()->uses()finds them incomposer.lock. Direct vs indirect is classified frompackage.json. Bun is detected via bothbun.lockandbun.lockb.Agents and editors are separate enums, detected from repo markers like
.claude,.cursor,.idea, orAGENTS.md.Agentholds AI coding tools (Claude Code, Cursor, Codex, Copilot, Gemini, etc.) andEditorholds IDEs (PHPStorm, VSCode, Zed, Sublime Text).Project::approaches()reports stylistic conventions read from the source itself, with evidence thresholds:$fillablevs$guardedmass assignment, enum case casing, pipe vs array validation rules, inline validation vs form requests,#[Signature]vs$signaturecommands,notify()vs theNotificationfacade, the authorization style (gate /$user->can()/ attribute / trait), authenticated-user retrieval (facade / request / helper), and the model key style (UUID / ULID / default incrementing). A style only reports when it has at least 3 votes and more than 80% agreement, and eachApproachResultexposes the confidence ratio, vote counts, and the files that voted. Because source files change without touching a lockfile, approaches are computed lazily per process and never persisted with the cached scan;roster:scantakes an--approachesflag to include them.Scans memoize per process and persist via the app's cache driver, keyed on a hash of lockfile contents and detector markers, so edits to
composer.lockor a newly added.claudedirectory invalidate automatically.Project::fresh()bypasses both, and everything falls back to a direct scan when the cache driver is missing or fails.An earlier revision of this PR also shipped a
Systemfacade for binaries on PATH; that surface was dropped to keep the package purely project-scoped.Warning
BC break across the public API. The
Rosterfacade is replaced byProject. ThePackagesandIdesenums and the alias registry are gone; pass raw package names andRoster::extend()is removed.usesVersionfolds intouses.ApproachesbecomesApproach,NodePackageManagerbecomesJsPackageManager, and PHPStorm and VSCode move fromAgentto the newEditorenum.TestFrameworkandStarterKitdetection have been removed.Full migration table in UPGRADE.md.