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

@@ -0,0 +1,24 @@
import { describe, expect, it } from "vitest";
import { hasGiteaAutonomyCompletionEvidence } from "../src/repositories/autonomyRepository.js";
import { autonomyGiteaBranch, isGiteaAutoExecutionBranch } from "../src/services/giteaAutonomyExecution.js";
describe("Gitea Auto execution contract", () => {
it("derives one deterministic atomic-claim branch from a durable work id", () => {
expect(autonomyGiteaBranch("PHX-003")).toBe("projectbrain/auto/phx-003");
expect(autonomyGiteaBranch(" UI / Polish #4 ")).toBe("projectbrain/auto/ui-polish-4");
expect(isGiteaAutoExecutionBranch("projectbrain/auto/phx-003")).toBe(true);
expect(isGiteaAutoExecutionBranch("chatgpt/other-work")).toBe(false);
});
it("requires merge, exact head and validation evidence before Gitea completion is authoritative", () => {
expect(hasGiteaAutonomyCompletionEvidence([
"gitea:auto:merge:abc",
"gitea:auto:head:def",
])).toBe(false);
expect(hasGiteaAutonomyCompletionEvidence([
"gitea:auto:merge:abc",
"gitea:auto:head:def",
"gitea:auto:validation:42",
])).toBe(true);
});
});