Repository navigation
Keep a published pair's baseline across a failed review - #772
Merged
Merged
Conversation
Review again restarts a failed published-pair review through the normal start route, but `markScanFailed` cleared `previous_version`, so the restart compared against the default predecessor even when the original request named another baseline. Most published-pair failures happen during acquisition, before the pipeline records any baseline, so the row usually had none to keep anyway. A published pair's baseline is a registry-confirmed request input, not a pipeline result. The start route now hands it to `createScanJob`, which names it on the row from creation; the mid-run baseline record leaves a published row alone, since the baseline manifest is reviewed bytes; and `markScanFailed` keeps it for `published` rows while still clearing it for every other source. Review again passes it back as `baselineVersion`, and the start route confirms it against the registry as it did the first time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Detection eval report
Corpus coverage (gated)
Regression (gated)
Acknowledged positives:
Frontier (reported — truth-labeled hard cases)recall 92% (11/12)
Benign hard-negatives (gated — false-positive precision)false positives 1/22 (5%)
Evasion robustness (reported)
Release injection (gated — payload spliced into an existing module)
Updated by CI for this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
staged-publish-review | c491d9d | Commit Preview URL Branch Preview URL |
Oct 09 2026, 05:33 PM |
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.
Follow-up to #767.
Why
#767 added Review again for failed reviews. It restarts through the normal
POST /api/v1/scans. ButmarkScanFailedclearedprevious_version, so restarting a failed published-pair review compared against the default predecessor. That happened even when the original request, for example a /diff save, named a different baseline.Clearing alone wasn't the whole problem. Most published-pair failures happen while fetching the packages, before the pipeline records any baseline. So the row usually had nothing to keep.
What changes
createScanJob, which writes it toprevious_versionforpublishedrows only.recordScanBaselineskipspublishedrows. The baseline's package.json is reviewed bytes and must not replace a version the registry confirmed.markScanFailedkeepsprevious_versionforpublishedrows. Staged, auto-discovery and gate scans still clear it on failure, so for them a failed scan still names no baseline.reviewAgainRequestpasses the kept baseline back asbaselineVersion. The start route checks it exactly as it checks a first request: it must be a plain version that is published, or the restart gets a 404.previous_versionis reused.Verification
New tests:
test/workers/scan-baseline-record.test.ts:test/workers/scans-published-pair.test.ts:test/scan-review-again.test.ts: the restart request carriesbaselineVersion.With the server change reverted, the four new DB and route tests fail.
pnpm run verify:quickpasses.Limits
previous_versionappears. That is the dashboard's "from X" and the package releases baseline label, which before showed nothing or "—".Docs
docs/ui.md: the Review again paragraph says a published-pair restart names its requested baseline.docs/diff-baseline.md: covers the published-pair exception to writingprevious_versionbefore completion.