From 5112394d0d94303e431d327df1f84b6daf67a0b7 Mon Sep 17 00:00:00 2001 From: artale Date: Sun, 21 Jun 2026 01:16:44 +0200 Subject: [PATCH] fix: tolerate rsi cron naming drift --- src/fable5/rsi-reconcile.test.ts | 9 ++++++++- src/fable5/rsi-reconcile.ts | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fable5/rsi-reconcile.test.ts b/src/fable5/rsi-reconcile.test.ts index 587a04f..1085cf6 100644 --- a/src/fable5/rsi-reconcile.test.ts +++ b/src/fable5/rsi-reconcile.test.ts @@ -46,10 +46,17 @@ describe("rsi reconcile", () => { expect(receipt.decision).toBe("healthy"); }); - it("marks degraded when cron is missing", () => { + it("keeps healthy when only cron naming drifts", () => { const receipt = reconcileRsi({ host: "example", runner: runner({ "skill_health.py|rsi-diagnosis": { status: 1, stdout: "" } }) }); expect(receipt.facts.cron_present).toBe(false); + expect(receipt.decision).toBe("healthy_but_autopatch_unproven"); + }); + + it("marks degraded when live skill health is missing", () => { + const receipt = reconcileRsi({ host: "example", runner: runner({ "test -f /tmp/skill_health.py": { status: 1, stdout: "" } }) }); + + expect(receipt.facts.skill_health_present).toBe(false); expect(receipt.decision).toBe("degraded"); }); diff --git a/src/fable5/rsi-reconcile.ts b/src/fable5/rsi-reconcile.ts index bfcdee4..e20ebfe 100644 --- a/src/fable5/rsi-reconcile.ts +++ b/src/fable5/rsi-reconcile.ts @@ -45,7 +45,8 @@ export function reconcileRsi(opts: RsiReconcileOptions): RsiReconcileReceipt { deploy_route_present: isOk("deploy_route", checks), auto_patch_proven: /All patched|auto-patching/.test(latest), }; - const coreHealthy = facts.cron_present && facts.skill_health_present && /100%|65\/65/.test(facts.latest_score ?? "") && facts.factory_watcher_active && facts.deploy_route_present; + // ponytail: cron name drift is a warning; live health + watcher + deploy route are the gate. + const coreHealthy = facts.skill_health_present && /100%|65\/65/.test(facts.latest_score ?? "") && facts.factory_watcher_active && facts.deploy_route_present; const receipt: RsiReconcileReceipt = { created_at: (opts.now ?? new Date()).toISOString(), host: opts.host,