mirror of
https://github.com/bitbaum/causius.git
synced 2026-12-04 20:08:42 +01:00
Six workflows (debt collection notice, rent increase, tax assessment, dismissal, insurance refusal, founding an association) on the start screen. Each tells the agent what to establish and what to draft, and the person what to have ready. No law lives in them: a test refuses any digit in a brief, so deadlines and articles are always researched and cited. The matter keeps its workflow (sealed, optional), and Find a helper opens on its area. Roadmap: ask across a matter's documents as a table, watch a matter's rules for change, flat-priced helper payments (no fee sharing). Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud Co-authored-by: Claude <noreply@anthropic.com>
28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import en from "../messages/en.json";
|
|
import { MatterCore } from "./matters/store";
|
|
import { HELPER_AREAS } from "./professions";
|
|
import { WORKFLOWS } from "./workflows";
|
|
|
|
describe("workflows", () => {
|
|
it("carry no law of their own: no deadlines, amounts or article numbers", () => {
|
|
// A brief says what to find out; the rule is researched and cited each time.
|
|
for (const w of WORKFLOWS) expect(w.brief, w.id).not.toMatch(/\d/);
|
|
});
|
|
|
|
it("each name an area a helper can list, so Find a helper can filter by it", () => {
|
|
for (const w of WORKFLOWS) expect(HELPER_AREAS).toContain(w.area);
|
|
});
|
|
|
|
it("each have words for the person", () => {
|
|
for (const w of WORKFLOWS) expect(en.Workflows.items).toHaveProperty(w.id);
|
|
});
|
|
|
|
it("are optional on a matter, and an unknown one is refused", () => {
|
|
const base = { title: "T", summary: "", area: "", facts: [], hide: [] };
|
|
expect(MatterCore.parse(base).workflow).toBeUndefined();
|
|
expect(MatterCore.parse({ ...base, workflow: "rent-increase" }).workflow).toBe("rent-increase");
|
|
expect(MatterCore.safeParse({ ...base, workflow: "made-up" }).success).toBe(false);
|
|
});
|
|
});
|