Initial curated projectbrain source from 8a7b1e0651dbdab97d744cbd2e653ab3970ac6c5

This commit is contained in:
Public Source Publisher committed 2026-10-01 01:43:26 +02:00
commit 5aa3e8d685
700 files changed
+132801

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { normalizeAutonomyState } from "../src/repositories/autonomyRepository.js";
import { canonicalLifecycleFromAutonomy } from "../src/services/canonicalLifecycle.js";
describe("backend canonical lifecycle projection", () => {
it("uses the same seven-state semantics as the product contract", () => {
expect(canonicalLifecycleFromAutonomy(normalizeAutonomyState({ enabled: false, status: "off" }))).toBe("ready");
expect(canonicalLifecycleFromAutonomy(normalizeAutonomyState({
enabled: true,
status: "blocked",
blocker: { kind: "human", reason: "Owner decision required", at: "2026-09-01T00:00:00Z" },
}))).toBe("needs_user");
expect(canonicalLifecycleFromAutonomy(normalizeAutonomyState({
enabled: true,
status: "blocked",
blocker: { kind: "retryable", reason: "Runner timeout", at: "2026-09-01T00:00:00Z" },
}))).toBe("recovering");
const completed = normalizeAutonomyState({ enabled: true, status: "completed" });
expect(canonicalLifecycleFromAutonomy({ ...completed, status: "completed" })).toBe("done");
});
});