feat(capture): --pin flag writes installed versions into the manifest#145
Merged
Conversation
OpenSpec change: capture --pin writes installed winget versions into the emitted manifest's per-app version field; capture --update stops dropping declared version/driver through the merge. Extends the windows-version-capture-pinning capability. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjiYqx7LVvR2Yr883PMKYr
One winget list pass now feeds both the display-name map and a version map (seam swap: getDisplayNameMapFn -> listInstalledFn); under --pin the conversion loop records each app's installed version, best-effort and never fatal. The --update merge stops silently dropping declared version/driver fields and, under --pin, refreshes a pin only on a non-empty lookup so skew never blanks declared state. Sanitize copies version/driver through (realizer-path parity). --pin advertised in capabilities and the CLI JSON contract. Implements openspec/changes/capture-pin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjiYqx7LVvR2Yr883PMKYr
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.
Implements OpenSpec change
capture-pin— wedge blocker #1 from the 2026-07 market brief. Capture already parsed installed winget versions during its display-name pass and discarded them; the entire downstream stack (manifestApp.Version,winget install --version,apply --repin) was shipped but dormant. This activates it.What
capture --pin(opt-in): writes each app's installed version into the emitted manifest's per-appversionfield. Best-effort — a missing version omits the field; a failedwinget listdegrades to no versions; capture never fails over version data. Without--pin, fresh-capture output is byte-identical to before.getDisplayNameMapFn→listInstalledFn = snapshot.TakeSnapshot) derives display names and versions from the single existingwinget list— no new winget invocation, no extra lock-contention exposure.--updatemerge fix: existing entries'version/driverfields were silently dropped by the merge (non-destructive-defaults violation; the realizer path already preserved them). Now preserved; under--update --pina pin is refreshed only on a non-empty installed-version lookup — skew never blanks a declared pin.version/driverthrough (realizer parity); sanitized shared manifests can be reproducible.--pinincommands.capture.flags+ mirrored indocs/contracts/cli-json-contract.md(additive, no schema bump).--pinaccepted as a no-op — versions were already recorded unconditionally there.Review
Dual-pass review (ContractGuard + code review, both Opus): 0 blockers, 0 majors; all minors addressed in this diff (realizer no-op test coverage, key-sensitive never-blank test, empty-version-map warning under
--pin, spec wording scoped to fresh capture, truncated-Id caveat documented in design.md).Tests
11 new hermetic tests (pin emission, skew/error degradation, sanitize, update preserve/refresh/never-blank/new-app, realizer no-op, capabilities advert).
go test ./...green;npm run openspec:validate80/80.🤖 Generated with Claude Code
https://claude.ai/code/session_01WjiYqx7LVvR2Yr883PMKYr