Repository navigation
Report the first answer and a time stop from the upgrade pass - #110
Merged
Merged
Conversation
Resolution.Upgrade carries the first solve's answer and whether time cut the pass short, so a caller can fall back without solving again (rstudio/package-manager#22820). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ctx that ends just after the pass returned did not cut it short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An index can report a ended ctx as unusable metadata, so check ctx after scoring a re-solve. Test ctx ends at a loop check, in the root set and in a usability lookup; test that cloneResolution copies every field. Make the StoppedByTime doc and the CHANGELOG entry match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merging at Since this adds a public API, it had two independent reviews (separate Claude sessions that did not write it):
RoboRev: job 5710 found one medium (a deadline that passed after the pass finished counted as a stop), fixed in Left as is, all low:
|
Merged
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.
Resolution.Upgradenow reports on theUpgradeRootspass:Firstis the first solve's answer (the pass-off answer) andStoppedByTimesays whether a time bound or the end ofctxcut the pass short. Package Manager needs this to fall back to the first answer when its deadline interrupts a pass, without solving again (rstudio/package-manager#22820). It is nil with the pass off, and the answer the pass keeps does not change.API (
resolver/resolver.go):Resolution.Upgrade *UpgradeReport, withFirst *ResolutionandStoppedByTime bool. When the pass keeps the first answer, the outerResolutionis a copy, soFirstshares no maps or slices with it.By time:
UpgradeTimeFactor/UpgradeMaxTimereached between re-solves, a re-solve cut by that bound, or the pass running into the end ofctx(cancel or deadline). The step bounds, theUpgradeRootsbudget, and running out of roots are not.Tests (
resolver/upgrade_report_test.go, fake clock and a hand-expired ctx, no sleeps):Upgrade is nil. Mutations caught: dropping the ctx signal, dropping the cut-re-solve signal, always reporting true, and returningFirstaliased with the outer answer each fail at least one test.u.failedremoved.cloneResolutionhas a field-by-field test and a reflect guard for new map/slice/pointer fields.go test ./...(1281 pass, 0 fail),go test -race ./resolver/,go vet,gofmt -l, golangci-lint v2.11.2: 0 issues.🤖 Generated with Claude Code