Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  recovery-policy.test.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { describe, expect, it } from "vitest";
import {
  isPluginLocalInvalidConfigSnapshot,
  shouldAttemptLastKnownGoodRecovery,
} from "./recovery-policy.js";
import type { ConfigFileSnapshot } from "./types.openclaw.js";

type PolicySnapshot = Pick<ConfigFileSnapshot, "valid" | "issues" | "legacyIssues">;

function snapshot(params: Partial<PolicySnapshot>): PolicySnapshot {
  return {
    valid: false,
    issues: [],
    legacyIssues: [],
    ...params,
  };
}

describe("config recovery policy", () => {
  it("skips whole-file recovery for issues scoped only to plugin entries", () => {
    const current = snapshot({
      issues: [
        {
          path: "plugins.entries.feishu",
          message: "plugin requires newer host",
        },
        {
          path: "plugins.entries.lossless-claw.config.cacheAwareCompaction",
          message: "invalid config: must NOT have additional properties",
        },
      ],
    });

    expect(isPluginLocalInvalidConfigSnapshot(current)).toBe(true);
    expect(shouldAttemptLastKnownGoodRecovery(current)).toBe(false);
  });

  it("keeps recovery enabled for mixed plugin and root config invalidity", () => {
    const current = snapshot({
      issues: [
        { path: "plugins.entries.feishu", message: "plugin requires newer host" },
        { path: "gateway.mode", message: "Expected string" },
      ],
    });

    expect(isPluginLocalInvalidConfigSnapshot(current)).toBe(false);
    expect(shouldAttemptLastKnownGoodRecovery(current)).toBe(true);
  });

  it("keeps recovery enabled for ambiguous plugin collection issues", () => {
    const current = snapshot({
      issues: [{ path: "plugins.entries", message: "Expected object" }],
    });

    expect(isPluginLocalInvalidConfigSnapshot(current)).toBe(false);
    expect(shouldAttemptLastKnownGoodRecovery(current)).toBe(true);
  });

  it("keeps recovery enabled when legacy config issues are present", () => {
    const current = snapshot({
      issues: [{ path: "plugins.entries.feishu", message: "plugin requires newer host" }],
      legacyIssues: [{ path: "heartbeat", message: "Use agents.defaults.heartbeat" }],
    });

    expect(isPluginLocalInvalidConfigSnapshot(current)).toBe(false);
    expect(shouldAttemptLastKnownGoodRecovery(current)).toBe(true);
  });
});

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge