mirror of
https://github.com/bitbaum/causius.git
synced 2026-12-04 05:30:28 +01:00
* Matters: encrypted, agentic legal workspace behind OrangeCat sign-in A matter is sealed per matter (AES-256-GCM data key under CAUSIUS_MASTER_KEY). The agent works it with tools (search, read, deadlines, tasks, drafts, approvals); every personal detail is swapped for a placeholder before a model sees it, and the person's account name is always one of them. The database in the clear holds no name, message, deadline or document. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Fleet design system, a technical narrative, one account across the fleet, domain checks - @bitbaum/design-tokens replaces the bespoke paper-and-ink theme; Solon's grammar (kicker, headline-caps, btn-frame) for every page, pinned dark. - New Platform, Security and Ecosystem pages; the home page rebuilt around what works today (lib/capabilities.ts is the one place a status is decided). - Sign-in and sign-up routes hand straight to OrangeCat; the account menu and the ecosystem page link the rest of the fleet, read from the fleet map. - The agent can check domain names with the registries over RDAP. - The i18n parity test reads ICU properly (select branches, apostrophes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Provision matters on the host: database, OrangeCat client, runtime env Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ --------- Co-authored-by: Claude <noreply@anthropic.com>
26 lines
982 B
TypeScript
26 lines
982 B
TypeScript
import { readdirSync, readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { PGlite } from "@electric-sql/pglite";
|
|
import { drizzle } from "drizzle-orm/pglite";
|
|
import type { Db } from "../db";
|
|
import * as schema from "../db/schema";
|
|
|
|
/**
|
|
* A real Postgres in the test process (PGlite), with the same migration SQL
|
|
* the deploy applies on the box. Tests run against the schema that ships,
|
|
* not a mock of it.
|
|
*/
|
|
export async function testDb(): Promise<{ db: Db; close: () => Promise<void> }> {
|
|
const pg = new PGlite();
|
|
const dir = join(process.cwd(), "drizzle");
|
|
for (const file of readdirSync(dir).filter((f) => f.endsWith(".sql")).sort()) {
|
|
for (const statement of readFileSync(join(dir, file), "utf8").split("--> statement-breakpoint")) {
|
|
if (statement.trim()) await pg.exec(statement);
|
|
}
|
|
}
|
|
const db = drizzle(pg, { schema }) as unknown as Db;
|
|
return { db, close: () => pg.close() };
|
|
}
|
|
|
|
export const MASTER = Buffer.alloc(32, 7);
|