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
3 changes: 0 additions & 3 deletions src/scoring/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ const NON_SCORING_UPSTREAM_CONSTANT_NAMES = new Set([
// Fallback weight applied by the validator's load_programming_language_weights() for extensions absent from
// the JSON file; gittensory reads the JSON directly and does not track this loader default (#1692).
"DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT",
// Validator-side window (days) within which a linked issue's close timestamp must fall relative to the PR
// merge to count as a valid link; gittensory's scoring preview does not model this linkage constraint (#1692).
"MAX_ISSUE_CLOSE_WINDOW_DAYS",
]);

/**
Expand Down
14 changes: 6 additions & 8 deletions test/unit/scoring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,22 +391,20 @@ NOVELTY_BONUS_SCALAR = 3
expect(withScoringGap).toEqual(["NOVELTY_BONUS_SCALAR"]);
});

it("excludes DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT and MAX_ISSUE_CLOSE_WINDOW_DAYS from unmodeled drift (#1692)", () => {
// Both are numeric constants in the live upstream constants.py that the parser successfully reads, but
// neither is a scoring dimension gittensory models — excluding them prevents perpetual false-positive
// drift warnings on every refreshScoringModelSnapshot run (same pattern as EMISSION_SHARE_TOLERANCE #809).
it("keeps linked-issue close-window constants visible as unmodeled drift (#1692)", () => {
// DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT is loader fallback metadata, but MAX_ISSUE_CLOSE_WINDOW_DAYS
// controls linked-issue eligibility; keep it visible until the preview models that scoring rule.
const result = findUnmodeledUpstreamConstants(
"DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT = 0.12\nMAX_ISSUE_CLOSE_WINDOW_DAYS = 1\n",
);
expect(result).toEqual([]);
expect(result).toEqual(["MAX_ISSUE_CLOSE_WINDOW_DAYS"]);
expect(result).not.toContain("DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT");
expect(result).not.toContain("MAX_ISSUE_CLOSE_WINDOW_DAYS");

// A genuinely new upstream scoring dimension still surfaces alongside them.
// A genuinely new upstream scoring dimension still surfaces alongside the close-window gap.
const withNewDimension = findUnmodeledUpstreamConstants(
"DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT = 0.12\nMAX_ISSUE_CLOSE_WINDOW_DAYS = 1\nNOVELTY_BONUS_SCALAR = 3\n",
);
expect(withNewDimension).toEqual(["NOVELTY_BONUS_SCALAR"]);
expect(withNewDimension).toEqual(["MAX_ISSUE_CLOSE_WINDOW_DAYS", "NOVELTY_BONUS_SCALAR"]);
});

it("truncates the unmodeled-constants warning when upstream defines more than 12 (#809)", async () => {
Expand Down
Loading