Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scoring/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@
const scenarioPreviews = buildScenarioPreviews(args.input, args.repo, args.snapshot, args.contributorEvidence, current);
const blockedBy = blockedByFor(args.input, args.repo, current, branchEligibility);
const gateDeltas = buildGateDeltas(current, scenarioPreviews);
const effectiveEstimatedScore = current.scoreEstimate.estimatedMergedScore;

Check notice on line 206 in src/scoring/preview.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 206 in src/scoring/preview.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
const underlyingPotentialScore = current.scoreEstimate.pendingSaturationScore;
const scoreabilityStatus = statusFor(args.repo, blockedBy, effectiveEstimatedScore, scenarioPreviews);
const warnings = warningsFor(args.input, args.repo, current, branchEligibility);
const warnings = [...args.snapshot.warnings, ...warningsFor(args.input, args.repo, current, branchEligibility)];
const actions = [
...(!current.gates.baseTokenGatePassed ? ["Increase meaningful source change size or scope clarity before relying on this preview."] : []),
...(current.scoreEstimate.openPrMultiplier === 0 ? ["Land or close existing open PRs before opening more concurrent work."] : []),
Expand Down
11 changes: 11 additions & 0 deletions test/unit/scoring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,20 @@
return new Response("not found", { status: 404 });
});
const served = await getOrCreateScoringModelSnapshot(env);
expect(served.warnings.some((warning) => /stale/i.test(warning))).toBe(false);

Check notice on line 114 in test/unit/scoring.test.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 114 in test/unit/scoring.test.ts

View check run for this annotation

Deleted GitHub App / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
});

it("surfaces snapshot warnings in score previews (#810)", () => {
const warning = "Scoring constants snapshot is stale; preview scores may use old constants.";
const preview = buildScorePreview({
repo,
input: { repoFullName: repo.fullName, sourceTokenScore: 10 },
snapshot: { ...snapshot, warnings: [warning] },
});

expect(preview.warnings).toContain(warning);
});

it("prefers exponential saturation when mixed upstream constants are present", () => {
const parsed = parsePythonNumberConstants(`
MERGED_PR_BASE_SCORE = 25
Expand Down
Loading