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 test/unit/notify-pagerduty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe("triggerPagerDutyIncident — cooldown gate (alert fatigue control #2)"
const tenMinutesAgo = new Date(Date.now() - 10 * 60 * 1000).toISOString();
await recordAuditEvent(env, {
eventType: "external_notification.pagerduty",
actor: "loopover",
actor: "gittensory",
targetKey: "ops_anomaly:acme/widgets",
outcome: "completed",
detail: "triggered",
Expand Down
6 changes: 3 additions & 3 deletions test/unit/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ describe("registry normalization", () => {
it("parses per-repo time-decay overrides from the registry scoring.time_decay block (#703)", () => {
const snapshot = normalizeRegistryPayload(
{
// JSONbored/gittensory's real master_repositories.json shape: a partial override (no steepness).
"JSONbored/gittensory": {
// JSONbored/loopover's real master_repositories.json shape: a partial override (no steepness).
"JSONbored/loopover": {
emission_share: 0.01,
scoring: { pr_lookback_days: 45, time_decay: { grace_period_hours: 24, sigmoid_midpoint_days: 10, min_multiplier: 0.05 } },
},
Expand All @@ -86,7 +86,7 @@ describe("registry normalization", () => {
"2026-05-22T00:00:00.000Z",
);
const byName = Object.fromEntries(snapshot.repositories.map((r) => [r.repo, r]));
expect(byName["JSONbored/gittensory"]!.timeDecay).toEqual({
expect(byName["JSONbored/loopover"]!.timeDecay).toEqual({
gracePeriodHours: 24,
sigmoidMidpointDays: 10,
sigmoidSteepness: null, // absent → falls back to the global default at resolve time
Expand Down
4 changes: 2 additions & 2 deletions test/unit/scoring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ NOVELTY_BONUS_SCALAR = 3
const c = DEFAULT_SCORING_CONSTANTS;
// No overrides → all snapshot defaults.
expect(resolveTimeDecay(c, null)).toEqual({ gracePeriodHours: 12, sigmoidMidpointDays: 10, sigmoidSteepness: 0.4, minMultiplier: 0.05 });
// Partial override (JSONbored/gittensory's real config: grace 24, midpoint 10, min 0.05, no steepness)
// Partial override (JSONbored/loopover's real config: grace 24, midpoint 10, min 0.05, no steepness)
// → overridden fields apply, the absent steepness falls back to the default.
expect(resolveTimeDecay(c, { gracePeriodHours: 24, sigmoidMidpointDays: 10, minMultiplier: 0.05 })).toEqual({
gracePeriodHours: 24,
Expand Down Expand Up @@ -1938,7 +1938,7 @@ NOVELTY_BONUS_SCALAR = 3

it("applies each live repo's resolved curve in the preview (per-repo, not global)", () => {
const input: ScorePreviewInput = { repoFullName: repo.fullName, sourceTokenScore: 58, totalTokenScore: 600, sourceLines: 60, openPrCount: 0, credibility: 1, applyTimeDecay: true, prAgeHours: 18 };
// Repo with a 24h grace override (like JSONbored/gittensory) → an 18h-old PR is still fresh.
// Repo with a 24h grace override (like JSONbored/loopover) → an 18h-old PR is still fresh.
const repo24: RepositoryRecord = { ...repo, registryConfig: { ...repo.registryConfig!, timeDecay: { gracePeriodHours: 24 } } };
expect(buildScorePreview({ repo: repo24, snapshot, input }).scoreEstimate.timeDecayMultiplier).toBe(1);
// Same PR on a repo using the default 12h grace → past grace, so it decays.
Expand Down