fix: tolerate rsi cron naming drift

This commit is contained in:
artale 2026-06-21 01:16:44 +02:00
parent ec26b560ab
commit 5112394d0d
2 changed files with 10 additions and 2 deletions

View File

@ -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");
});

View File

@ -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,