T-6K39-providers-onto-aspects-moved-install-pin-deps
State: closed/done · Impact: medium · Complexity: large
Rewire detect-runners’s own providers to consume the T-1VJD aspect
layer instead of re-reading manifests themselves, and move sdlc’s
detectDeps/resolvePinnedManagerInstall into this package as
resolveInstall/hasMissingDeps/missingDeps/resolvePinnedManagerInstall
— so “how to run it” (Layer 2a) sits on top of “what’s here” (Layer 1)
instead of duplicating the reads.
providers/{cargo,node-scripts,moon,just,mise,make}.ts each call their own
ctx.files()/ctx.readJson() for manifest presence/content. sdlc’s
lib/config/detect-deps.ts (detectDeps/hasMissingDeps/missingDeps/
INSTALL_VERBS/SetupCandidate) and lib/config/pinned-manager.ts
(resolvePinnedManagerInstall) already delegate JS package-manager
identification to detect-runners’s NODE_LOCKFILE_MANAGERS, but still do
their own separate filesystem reads to apply it.
Proposed
Section titled “Proposed”Each provider’s collect(ctx) gains a second parameter, the already-computed
AspectFacts for its manifest kind, and stops calling
ctx.files()/ctx.readJson() for presence/content (it may still use
ctx.which()/ctx.runner() for its own exec-kind probes, e.g. just --list, unaffected). resolveInstall/hasMissingDeps/missingDeps/
resolvePinnedManagerInstall land in detect-runners, adapted to take
AspectFacts instead of re-reading the filesystem. Public
collect/tasks/discover behavior is unchanged — this task’s own test
suite is the proof.
Approach
Section titled “Approach”- Thread
AspectFacts(fromT-1VJD’scollectAspects) into each provider’scollect(ctx, facts)signature; replace each provider’s ownctx.files()/ctx.readJson()manifest read with a read offfacts. - Move
detectDeps/hasMissingDeps/missingDeps/INSTALL_VERBS/SetupCandidatefromsolutions/ontological/lib/config/detect-deps.tsintopackages/ts/detect-runners, renamedresolveInstallper detection-consolidation.md §2’s target API, adapted to takeAspectFacts. - Move
resolvePinnedManagerInstall/PackageManagerPin/PinnedManagerSourcefromsolutions/ontological/lib/config/pinned-manager.tsinto the same package, same adaptation. - Do NOT delete the sdlc-side files yet or rewire sdlc’s own callers —
that’s
T-LCKH. This task lands the moved/rewired code indetect-runnerswith its own passing test suite, still unconsumed by sdlc.
| Area | Note |
|---|---|
packages/ts/detect-runners/src/providers/{cargo,node-scripts,moon,just,mise,make}.ts | Consume AspectFacts instead of independent manifest reads |
packages/ts/detect-runners/src/install.ts (new) | resolveInstall/hasMissingDeps/missingDeps, moved and adapted from sdlc’s detect-deps.ts |
packages/ts/detect-runners/src/pinned-manager.ts (new) | resolvePinnedManagerInstall, moved and adapted from sdlc’s pinned-manager.ts |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Every existing
detect-runnerstest (collect/tasks/discoverbehavior) passes unmodified — the provider rewrite is behavior-preserving. - AC-2:
resolveInstall(facts)against fixtures for JS (lockfile-based), Rust (Cargo.lock), Go (go.sum), Ruby (Gemfile.lock), and Python (requirements.txt-family) markers returns the sameSetupCandidate[]sdlc’s currentdetectDeps(root)returns for the equivalent fixture. - AC-3:
resolvePinnedManagerInstallreproducespackage.json#packageManager/.prototools/mise.tomlresolution byte-for-byte against sdlc’s current implementation’s test fixtures. - AC-4:
bun test packages/ts/detect-runnerspasses.
Out of scope
Section titled “Out of scope”- Deleting sdlc’s
detect-deps.ts/pinned-manager.ts/detect-setup.tsor rewiring sdlc’s own callers —T-LCKH. manifest-graph/project-facets.get.tsadoption —T-3GMU/T-OUKL.
Dependencies
Section titled “Dependencies”T-1VJD (needs AspectFacts/collectAspects to consume).
Discovery context
Section titled “Discovery context”Detection-consolidation research: ../decisions/D-LSLH-collapse-verbs-workflows-chain-hooks/detection-consolidation.md §2 “Layer 2a API”, §4 “What gets deleted”.
Depends on
Section titled “Depends on”T-1VJD