feat(FN-5009): merge fusion/fn-5009

This commit is contained in:
gsxdsm
2026-05-18 12:31:21 -07:00
parent 9aa7518bad
commit a8a413cc91
10 changed files with 513 additions and 0 deletions

View File

@@ -184,6 +184,28 @@ describe("settings key parity", () => {
expect(isGlobalSettingsKey("capacityRiskBannerEnabled")).toBe(false);
});
it("keeps backlog pressure alert settings project-scoped with documented defaults", () => {
expect(DEFAULT_PROJECT_SETTINGS.backlogPressureAlertEnabled).toBe(true);
expect(DEFAULT_PROJECT_SETTINGS.backlogPressureRatioThreshold).toBe(10);
expect(DEFAULT_PROJECT_SETTINGS.backlogPressureMinTodoCount).toBe(5);
expect(DEFAULT_PROJECT_SETTINGS.backlogPressureAlertCooldownMs).toBe(24 * 60 * 60_000);
expect(PROJECT_SETTINGS_KEYS).toContain("backlogPressureAlertEnabled");
expect(PROJECT_SETTINGS_KEYS).toContain("backlogPressureRatioThreshold");
expect(PROJECT_SETTINGS_KEYS).toContain("backlogPressureMinTodoCount");
expect(PROJECT_SETTINGS_KEYS).toContain("backlogPressureAlertCooldownMs");
expect(isProjectSettingsKey("backlogPressureAlertEnabled")).toBe(true);
expect(isProjectSettingsKey("backlogPressureRatioThreshold")).toBe(true);
expect(isProjectSettingsKey("backlogPressureMinTodoCount")).toBe(true);
expect(isProjectSettingsKey("backlogPressureAlertCooldownMs")).toBe(true);
expect(isGlobalSettingsKey("backlogPressureAlertEnabled")).toBe(false);
expect(isGlobalSettingsKey("backlogPressureRatioThreshold")).toBe(false);
expect(isGlobalSettingsKey("backlogPressureMinTodoCount")).toBe(false);
expect(isGlobalSettingsKey("backlogPressureAlertCooldownMs")).toBe(false);
});
it("keeps github tracking keys in expected scopes with documented defaults", () => {
expect(DEFAULT_PROJECT_SETTINGS.githubTrackingEnabledByDefault).toBe(false);
expect(DEFAULT_PROJECT_SETTINGS.githubTrackingDefaultRepo).toBeUndefined();

View File

@@ -290,6 +290,10 @@ export const DEFAULT_PROJECT_SETTINGS = {
// Capacity risk warning default: only warn once todo is meaningfully backlogged.
capacityRiskBannerEnabled: false,
capacityRiskTodoThreshold: 20,
backlogPressureAlertEnabled: true,
backlogPressureRatioThreshold: 10,
backlogPressureMinTodoCount: 5,
backlogPressureAlertCooldownMs: 24 * 60 * 60_000,
staleHighFanoutBlockerAgeThresholdMs: 2 * 60 * 60 * 1000,
staleInProgressWarningMs: 4 * 60 * 60_000,
staleInProgressCriticalMs: 24 * 60 * 60_000,

View File

@@ -2981,6 +2981,17 @@ export interface ProjectSettings {
* idle non-ephemeral agents available. Warning fires only when todo is strictly
* greater than this threshold. Default: 20. */
capacityRiskTodoThreshold?: number;
/** Enables scheduler backlog-pressure imbalance alerts. Default: true. */
backlogPressureAlertEnabled?: boolean;
/** Todo/max(In-Progress,1) ratio above which backlog pressure alerting triggers.
* Must be a positive finite number. Default: 10. */
backlogPressureRatioThreshold?: number;
/** Minimum todo inventory required before backlog pressure alerting can trigger.
* Must be a positive finite number. Default: 5. */
backlogPressureMinTodoCount?: number;
/** Minimum cooldown in milliseconds between backlog-pressure alerts.
* Default: 24 * 60 * 60_000. */
backlogPressureAlertCooldownMs?: number;
/** TTL in milliseconds for persisted AI planning/subtask/mission interview sessions.
* Sessions older than this cutoff are expired by the dashboard session cleanup loop.
* Valid range: 600000 (10 minutes) to 2592000000 (30 days).