mirror of
https://github.com/wassname/pi-goals.git
synced 2026-09-20 13:10:47 +08:00
Unify Log boundaries, serialize completion edits, preserve immutable session state and solo recovery, and match stock worker execution events. Remove unused plan views and brittle prose checks; correct installation and context guidance. Co-Authored-By: Pi/OpenAI <288921227+claudypoo@users.noreply.github.com>
20 lines
1.1 KiB
TypeScript
20 lines
1.1 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { planViews } from "../src/plan-view.js";
|
|
|
|
it.each(["", " "])("ignores %sindented identity bookkeeping and Log edits, but reviews tasks and goals", indent => {
|
|
const base = `# Plan\n- [ ] goal: result\n - tasks:\n - [ ] run it\n${indent}- worker session: /saved.jsonl\n## Log\nfirst entry`;
|
|
const view = planViews(base).notify;
|
|
expect(planViews(base.replace("/saved.jsonl", "/moved.jsonl")).notify).toBe(view);
|
|
expect(planViews(base.replace("first entry", "second entry")).notify).toBe(view);
|
|
expect(planViews(base.replace("- [ ] run it", "- [x] run it")).notify).not.toBe(view);
|
|
expect(planViews(base.replace("[ ] goal: result", "[x] goal: result")).notify).not.toBe(view);
|
|
});
|
|
|
|
it("uses Log as the boundary even when Interview precedes Goals", () => {
|
|
const plan = "# Plan\n## Interview\nOriginal discussion\n## Goals\n- [ ] goal: output\n### Log\n- [ ] goal: archived";
|
|
const view = planViews(plan).notify;
|
|
expect(view).toContain("goal: output");
|
|
expect(view).not.toContain("archived");
|
|
expect(planViews(plan.replace("goal: output", "goal: changed output")).notify).not.toBe(view);
|
|
});
|