refactor/pool: split retainedCacheDigests, Decide and NPM.Fetch into helpers #92

Merged
pti merged 1 commit from refactor/complexity-pool-gc-decide-npm into main 2026-10-19 22:29:09 +02:00
Owner

Part of #71, the pool gc, decision and npm slice. retainedCacheDigests was at Sonar cognitive complexity 37, Decide at 27 and NPM.Fetch at 27. retainedCacheDigests now walks each artifact kind through its own helper, all four walks kept. Decide extracts constraint parsing, the lock-satisfies predicate, the up-to-date or realize choice and the keep-existing note, with the decision ladder left in place. Fetch extracts the per-package body and the runtime artifact fetch, the platform-scoped targets gate stays in Fetch. Reviewer pass ran eleven mutations, ten caught by existing tests. The one survivor was a gap already in main, no test fed Decide a lock whose version does not parse, so one TestDecide row was added that pins the parse-failure path. 🤖 Generated with Claude Code

Part of #71, the pool gc, decision and npm slice. retainedCacheDigests was at Sonar cognitive complexity 37, Decide at 27 and NPM.Fetch at 27. retainedCacheDigests now walks each artifact kind through its own helper, all four walks kept. Decide extracts constraint parsing, the lock-satisfies predicate, the up-to-date or realize choice and the keep-existing note, with the decision ladder left in place. Fetch extracts the per-package body and the runtime artifact fetch, the platform-scoped targets gate stays in Fetch. Reviewer pass ran eleven mutations, ten caught by existing tests. The one survivor was a gap already in main, no test fed Decide a lock whose version does not parse, so one TestDecide row was added that pins the parse-failure path. 🤖 Generated with Claude Code
refactor(pool): split retainedCacheDigests, Decide and NPM.Fetch into helpers
All checks were successful
Lint / lint (pull_request) Successful in 1m11s
Lint / sonarqube (pull_request) Has been skipped
f02e436520
Sonar go:S3776 (issue #71) flagged these three above cognitive
complexity 25. retainedCacheDigests now delegates to one helper per
artifact kind (npm packages, runtime, archive, release; all four walks
kept). Decide extracts constraint parsing, lock-satisfies-constraint,
the up-to-date-or-realize verdict and the keep-existing note, leaving
the decision ladder in one place. NPM.Fetch moves the per-package and
per-runtime-artifact bodies into fetchPackage and fetchRuntimeArtifact.
Behaviour-neutral: error strings and side-effect order are unchanged.

Also adds a TestDecide row pinning that an unparseable LockVersion
does not satisfy the constraint (no install short-circuit); it fails
if lockSatisfies returns true on a parse failure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pti merged commit ae69016753 into main 2026-10-19 22:29:09 +02:00
pti deleted branch refactor/complexity-pool-gc-decide-npm 2026-10-19 22:29:09 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!92
No description provided.