Skip to content

armgit / cogit

Public Imported from GitHub
0

Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.

feat!: remove epochs

Eren6f02d534a239
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ee336a..c8cdf40 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Map rows show the date only on a day's first row (the rest show the time), the `mN` label is quieter, and "↑ continues <session> · m37" is now "↑ m37" with the session in its tooltip.
### Removed
+- Epochs are gone: no `cogit epoch` command, no epoch in the record skill or the closing pass, and the Outline lists sessions in start order instead of grouping them. Older `project.json` and session files still read; their epoch fields are ignored.
+- The map header's "N epochs · N sessions" counter and "generated …" line, and the "↑ mN" mark on a session's first message row (the session row keeps it).
- The map is quieter: no "experimental" badge or "you" labels in the Outline, no dot grid, minimap or React Flow credit, and the toolbar shows only the session count. The author shows only when more than one person recorded sessions.
- The map no longer draws the dashed return arrow and the "↩ mN" mark (a branch already shows the return; the details panel still lists it), nor the epoch tag on session rows.
diff --git a/docs/format.md b/docs/format.md
index 7a1aef8..fa3ea75 100644
--- a/docs/format.md
+++ b/docs/format.md
@@ -14,7 +14,7 @@ fails when a file and the code disagree.
```
<project>/.cogit/
- project.json # name, epochs, schema version (shared, versioned)
+ project.json # name, schema version (shared, versioned)
sessions/<session-id>.json # one file per session, the notes (versioned)
sessions/<session-id>.events.jsonl # append-only structure facts (versioned)
conversations/<session-id>.jsonl.gz # the conversation store (local by default)
@@ -75,18 +75,15 @@ of a document must do it in code (a migration), not by hand-editing old files.
```json
{
- "epochs": [
- {"createdAt": "2026-10-26T12:00:00.000Z", "id": "e2e", "title": "End-to-end"}
- ],
"name": "cogit",
"schema": 1
}
```
-An **epoch** is a named stretch of work (a feature, an epic); a session points at
-one through the session file's `epoch` field. `project.json` is the only file two
-people write; cogit writes it with sorted keys and one epoch per line so git
-merges concurrent epoch additions line by line.
+`project.json` is the only file two people write; cogit writes it with sorted keys,
+one per line. Older files also list `epochs` (named stretches of work that sessions
+pointed at through an `epoch` field); cogit no longer groups sessions that way, so
+readers drop both fields and a rewrite leaves them out.
## sessions/<session-id>.json
@@ -99,7 +96,6 @@ slug (`[A-Za-z0-9][A-Za-z0-9_.-]{0,127}`), normally the agent's session id.
"sessionId": "9c32…",
"agent": "claude-code",
"title": "e2e setup flow",
- "epoch": "e2e",
"startedAt": "2026-10-26T10:00:00.000Z",
"updatedAt": "2026-10-26T10:30:00.000Z",
"status": {
diff --git a/docs/guide/map.md b/docs/guide/map.md
index 71ad9cc..64c82bd 100644
--- a/docs/guide/map.md
+++ b/docs/guide/map.md
@@ -24,8 +24,7 @@ was deleted or moved stays as a card marked "missing"; `cogit config prune` remo
The map reads like a git graph of your conversations. Time runs down the page.
-- **A session** is one Claude Code chat. Its header shows the title, the feature it belongs
- to (an *epoch*) and when it ran.
+- **A session** is one Claude Code chat. Its header shows the title and when it ran.
- **A row** is one message you sent, titled in your words and saying what came of it.
- **A branch** is a chain of messages that answer each other. It gets its own coloured lane;
its first message is a hollow ring carrying the branch's title. A new topic in the same chat
diff --git a/docs/schema/project.json b/docs/schema/project.json
index 8c8935d..d7f5c54 100644
--- a/docs/schema/project.json
+++ b/docs/schema/project.json
@@ -10,41 +10,11 @@
"type": "string",
"minLength": 1,
"maxLength": 200
- },
- "epochs": {
- "default": [],
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
- },
- "title": {
- "type": "string",
- "minLength": 1,
- "maxLength": 200
- },
- "createdAt": {
- "type": "string",
- "format": "date-time",
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
- }
- },
- "required": [
- "id",
- "title",
- "createdAt"
- ],
- "additionalProperties": false
- }
}
},
"required": [
"schema",
- "name",
- "epochs"
+ "name"
],
"additionalProperties": false
}
diff --git a/docs/schema/session-input.json b/docs/schema/session-input.json
index d51956d..607efda 100644
--- a/docs/schema/session-input.json
+++ b/docs/schema/session-input.json
@@ -15,17 +15,6 @@
"type": "string",
"maxLength": 200
},
- "epoch": {
- "anyOf": [
- {
- "type": "string",
- "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
- },
- {
- "type": "null"
- }
- ]
- },
"status": {
"type": "object",
"properties": {
diff --git a/docs/schema/session.json b/docs/schema/session.json
index 72c5a24..19103ea 100644
--- a/docs/schema/session.json
+++ b/docs/schema/session.json
@@ -21,18 +21,6 @@
"type": "string",
"maxLength": 200
},
- "epoch": {
- "default": null,
- "anyOf": [
- {
- "type": "string",
- "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
- },
- {
- "type": "null"
- }
- ]
- },
"startedAt": {
"type": "string",
"format": "date-time",
@@ -406,7 +394,6 @@
"sessionId",
"agent",
"title",
- "epoch",
"startedAt",
"updatedAt",
"status",
diff --git a/packages/cli/skills/record/SKILL.md b/packages/cli/skills/record/SKILL.md
index c6f9463..6527679 100644
--- a/packages/cli/skills/record/SKILL.md
+++ b/packages/cli/skills/record/SKILL.md
@@ -36,8 +36,6 @@ One JSON object:
- `sessionId`: always `"${CLAUDE_SESSION_ID}"`.
- `title`: a few words; on the first write or when the focus changed.
-- `epoch`: an `epochs` id that fits; a distinct new feature first gets
- `node "${CLAUDE_PLUGIN_ROOT}/dist/cli.js" epoch add <id> "<title>" -C "<dir>"`. Omit when unsure.
- `status`: replaces all four fields, so send each: `goal` (one sentence), `done`, `pending`
(`{ "text", "needsUser": true }` when it waits on the user), `next` (concrete step).
- `nodes`: only new nodes or changed fields; the rest is kept.
diff --git a/packages/cli/src/commands/backfill.ts b/packages/cli/src/commands/backfill.ts
index 1c181be..3a09ea3 100644
--- a/packages/cli/src/commands/backfill.ts
+++ b/packages/cli/src/commands/backfill.ts
@@ -157,13 +157,11 @@ export function agentRecord(text: string): Record<string, unknown> {
/**
* A small model writes `null` for a note it has nothing for (`"why": null`).
* The schema wants such a field left out, and one null would fail the whole
- * write, so they are dropped; a node's `parent: null` (a root) and `epoch: null` stay.
+ * write, so they are dropped; a node's `parent: null` (a root) stays.
*/
export function withoutNulls(record: Record<string, unknown>): Record<string, unknown> {
- // `epoch: null` means "no epoch"; any other null at the top is a missing field.
- const top = Object.fromEntries(
- Object.entries(record).filter(([key, value]) => value !== null || key === "epoch"),
- );
+ // Any null at the top is a missing field.
+ const top = Object.fromEntries(Object.entries(record).filter(([, value]) => value !== null));
if (!Array.isArray(top.nodes)) return top;
return {
...top,
diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts
index a47a7a5..7e73e6a 100644
--- a/packages/cli/src/commands/build.ts
+++ b/packages/cli/src/commands/build.ts
@@ -120,7 +120,6 @@ async function unrecordedSessions(
sessionId: id,
agent: "claude-code",
title: "",
- epoch: null,
startedAt,
updatedAt: info.mtime.toISOString(),
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/src/commands/epoch.ts b/packages/cli/src/commands/epoch.ts
deleted file mode 100644
index 9bf4f0c..0000000
--- a/packages/cli/src/commands/epoch.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { CliError, type Io } from "../io.js";
-import { Slug } from "../schema/common.js";
-import { resolveProjectRoot } from "../store/root.js";
-import { loadProject, updateProject } from "../store/stores.js";
-
-export async function epochAdd(dir: string, id: string, title: string, io: Io): Promise<void> {
- const { root } = await resolveProjectRoot(dir);
- if (!Slug.safeParse(id).success) {
- throw new CliError(`invalid epoch id "${id}": use letters, digits, _ . -`);
- }
- const project = await loadProject(root);
- if (!project.found) throw new CliError(`${root} is not initialized; run \`cogit init\` first`);
- if (!project.ok) throw new CliError(project.error);
-
- let added = false;
- await updateProject(root, (cur) => {
- const p = cur ?? project.data;
- const same = p.epochs.find((e) => e.id === id);
- if (same) {
- if (same.title !== title) {
- throw new CliError(`epoch "${id}" already exists with title "${same.title}"`);
- }
- return p;
- }
- added = true;
- return { ...p, epochs: [...p.epochs, { id, title, createdAt: io.now() }] };
- });
- io.out(added ? `Added epoch ${id}: ${title}` : `Epoch ${id} already exists`);
-}
diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts
index e64edac..6271fe7 100644
--- a/packages/cli/src/commands/init.ts
+++ b/packages/cli/src/commands/init.ts
@@ -244,7 +244,7 @@ export async function init(dir: string, opts: InitOptions, io: Io): Promise<void
await askProjectSettings(io, root, opts);
await askLanguage(io, opts);
- await updateProject(root, (cur) => cur ?? { schema: 1, name, epochs: [] });
+ await updateProject(root, (cur) => cur ?? { schema: 1, name });
await mkdir(projectPaths(root).sessions, { recursive: true });
await applyGitPolicy(io, root, policy, config.shareConversations);
await register(io, root, name);
diff --git a/packages/cli/src/commands/log.ts b/packages/cli/src/commands/log.ts
index b13aed9..b378c28 100644
--- a/packages/cli/src/commands/log.ts
+++ b/packages/cli/src/commands/log.ts
@@ -150,7 +150,6 @@ export interface LogSession {
title: string;
/** Who recorded the session (Story 9.3); absent on older records. */
author?: string;
- epoch: string | null;
startedAt: string;
updatedAt: string;
/** Newest first. */
@@ -212,7 +211,6 @@ function toLogSession(effective: EffectiveSession): LogSession {
sessionId: session.sessionId,
title: session.title,
...(session.author === undefined ? {} : { author: session.author }),
- epoch: session.epoch,
startedAt: session.startedAt,
updatedAt: session.updatedAt,
messages: logMessages,
@@ -288,7 +286,7 @@ function sessionHeading(session: LogSession): string {
const title = session.title.trim() === "" ? session.sessionId : oneLine(session.title);
const author = session.author === undefined ? "" : ` · by ${session.author}`;
return (
- `## ${title} (${session.sessionId})${author} · ${session.epoch ?? "unassigned"} · ` +
+ `## ${title} (${session.sessionId})${author} · ` +
`${stamp(session.startedAt)} → ${stamp(session.updatedAt)}`
);
}
@@ -467,7 +465,6 @@ export interface ShowModel {
summary?: string;
sessionId: string;
sessionTitle: string;
- epoch: string | null;
at?: string;
parent: ShowRef | null;
children: ShowRef[];
@@ -602,7 +599,6 @@ export async function show(opts: ShowOptions): Promise<ShowModel> {
...(message.summary === undefined ? {} : { summary: message.summary }),
sessionId,
sessionTitle: session.title,
- epoch: session.epoch,
...(message.at === undefined ? {} : { at: message.at }),
parent:
message.parent === null || message.parent === undefined
@@ -638,7 +634,7 @@ export function formatShow(model: ShowModel): string[] {
const title = oneLine(model.sessionTitle) || model.sessionId;
const lines: string[] = [
`${model.id} ${model.label} ${model.title}`,
- `Session: ${title} (${model.sessionId}) · ${model.epoch ?? "unassigned"} · ${stamp(model.at)}`,
+ `Session: ${title} (${model.sessionId}) · ${stamp(model.at)}`,
];
if (model.parent !== null) lines.push(`Parent: ${refText(model.parent, model.sessionId)}`);
if (model.children.length > 0)
diff --git a/packages/cli/src/commands/session.ts b/packages/cli/src/commands/session.ts
index 57c326b..071d579 100644
--- a/packages/cli/src/commands/session.ts
+++ b/packages/cli/src/commands/session.ts
@@ -114,11 +114,6 @@ export async function sessionWrite(
// know is made up; its node is dropped instead of stored beside the real one.
const input = nameMessages(redacted, messages, io, opts.by === "side");
if (count > 0) io.warn(`redacted ${count} secret-looking value(s)`);
- if (input.epoch && !project.data.epochs.some((e) => e.id === input.epoch)) {
- io.warn(
- `epoch "${input.epoch}" is not in project.json; the session shows as unassigned until you run \`cogit epoch add ${input.epoch} <title>\``,
- );
- }
// Cross-session parents (8.6) are checked against the other records before the
// merge; `startedAt` is the current session's own start.
@@ -294,8 +289,8 @@ function structureChanges(
}
/**
- * What the skill injects before the agent updates its record: the project's
- * epochs, the summary language, a compact view of this session (node ids,
+ * What the skill injects before the agent updates its record: the summary
+ * language, a compact view of this session (node ids,
* parents, kinds and titles, without summaries, which merging keeps anyway) and
* the user's messages from the transcript that have no node yet, so the agent
* cannot skip or reorder one.
@@ -340,18 +335,16 @@ export async function sessionShow(
project: project.data.name,
language: config.language,
messageSummaries: config.messageSummaries,
- epochs: project.data.epochs.map(({ id, title }) => ({ id, title })),
session: null,
};
const messages = await readSessionMessages(root, sessionId, io.env);
const labels = hashesToLabels(messages);
const effective = await effectiveRecord(root, sessionId, loaded, messages);
if (effective) {
- const { title, epoch, status, nodes } = effective;
+ const { title, status, nodes } = effective;
view.session = {
sessionId,
title,
- epoch,
status,
nodes: nodes.map(({ id, parent, kind, title }) => {
const label = labels.get(id);
diff --git a/packages/cli/src/program.ts b/packages/cli/src/program.ts
index 70782b7..8ea2792 100644
--- a/packages/cli/src/program.ts
+++ b/packages/cli/src/program.ts
@@ -12,7 +12,6 @@ import {
configPrune,
configSet,
} from "./commands/config.js";
-import { epochAdd } from "./commands/epoch.js";
import { hooksInstall, hooksUninstall } from "./commands/hooks.js";
import { type InitOptions, init } from "./commands/init.js";
import { formatShow, log, logFile, logUnread, show } from "./commands/log.js";
@@ -405,22 +404,6 @@ export function createProgram(makeIo: IoFactory = processIo, deps: ProgramDeps =
}),
);
- const epoch = program
- .command("epoch")
- .description("manage epochs (features, epics)")
- .helpGroup("Set up:")
- .addHelpText("after", examples('cogit epoch add e2e "End-to-end"'));
- epoch
- .command("add")
- .argument("<id>", "short id, e.g. e2e")
- .argument("<title>")
- .option("-C, --dir <dir>", "project directory", ".")
- .action(
- run(async (id: string, title: string, opts: { dir: string }) =>
- epochAdd(opts.dir, id, title, makeIo(false)),
- ),
- );
-
const session = program
.command("session")
.description("session records (used by the agent skill)")
diff --git a/packages/cli/src/schema/merge.ts b/packages/cli/src/schema/merge.ts
index 77c59eb..5022239 100644
--- a/packages/cli/src/schema/merge.ts
+++ b/packages/cli/src/schema/merge.ts
@@ -116,7 +116,6 @@ export function mergeSession(
sessionId: input.sessionId,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: now,
updatedAt: now,
status: { goal: "", done: [], pending: [], next: "" },
@@ -191,7 +190,6 @@ export function mergeSession(
...base,
agent: input.agent ?? base.agent,
title: input.title ?? base.title,
- epoch: input.epoch === undefined ? base.epoch : input.epoch,
status: input.status ?? base.status,
...(input.leftOff === undefined && base.leftOff === undefined
? {}
diff --git a/packages/cli/src/schema/project.ts b/packages/cli/src/schema/project.ts
index 40a6182..749e493 100644
--- a/packages/cli/src/schema/project.ts
+++ b/packages/cli/src/schema/project.ts
@@ -1,19 +1,14 @@
import { z } from "zod";
-import { IsoDate, Slug } from "./common.js";
export const PROJECT_SCHEMA = 1;
-export const Epoch = z.object({
- id: Slug,
- title: z.string().min(1).max(200),
- createdAt: IsoDate,
-});
-
+/**
+ * The project file. Older ones also list `epochs`; the parse drops them, since
+ * sessions are no longer grouped into epochs.
+ */
export const Project = z.object({
schema: z.literal(PROJECT_SCHEMA),
name: z.string().min(1).max(200),
- epochs: z.array(Epoch).default([]),
});
-export type Epoch = z.infer<typeof Epoch>;
export type Project = z.infer<typeof Project>;
diff --git a/packages/cli/src/schema/session.ts b/packages/cli/src/schema/session.ts
index 76545ba..d16f11f 100644
--- a/packages/cli/src/schema/session.ts
+++ b/packages/cli/src/schema/session.ts
@@ -115,7 +115,6 @@ export const Session = z.object({
sessionId: Slug,
agent: z.string().min(1).max(64).default("claude-code"),
title: z.string().max(200).default(""),
- epoch: Slug.nullable().default(null),
startedAt: IsoDate,
updatedAt: IsoDate,
status: Status.default({ goal: "", done: [], pending: [], next: "" }),
@@ -152,13 +151,13 @@ export const LineageNodeInput = LineageNode.omit({
/**
* What the agent sends to `session write`. Everything but the id is optional;
- * the CLI owns `schema`, `startedAt` and `updatedAt`.
+ * the CLI owns `schema`, `startedAt` and `updatedAt`. An `epoch` from an older
+ * skill is dropped with the other unknown keys: epochs are gone.
*/
export const SessionInput = z.object({
sessionId: Slug,
agent: z.string().min(1).max(64).optional(),
title: z.string().max(200).optional(),
- epoch: Slug.nullable().optional(),
status: Status.optional(),
leftOff: z.string().max(400).optional(),
nodes: z.array(LineageNodeInput).optional(),
diff --git a/packages/cli/src/store/stores.ts b/packages/cli/src/store/stores.ts
index 2f16665..2679c0c 100644
--- a/packages/cli/src/store/stores.ts
+++ b/packages/cli/src/store/stores.ts
@@ -53,37 +53,13 @@ async function update<S extends z.ZodType, R extends z.infer<S>>(
export const loadProject = (root: string) =>
load(projectPaths(root).project, Project, PROJECT_SCHEMA);
-/** One object on one line, its keys sorted, so diffs stay line-sized. */
-function stableInline(value: object): string {
- const entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));
- return `{${entries.map(([key, v]) => `${JSON.stringify(key)}: ${JSON.stringify(v)}`).join(", ")}}`;
-}
-
/**
- * `project.json` as git should see it (Story 9.3): sorted keys and one epoch per
- * line, so two people adding different epochs merge without a conflict. Epochs
- * are the only array that grows; everything else is a single line.
+ * `project.json` as git should see it (Story 9.3): sorted keys, one per line.
+ * Older files also carry an `epochs` list; a rewrite drops it with the rest of
+ * the epochs.
*/
-export function projectJson(project: {
- schema: number;
- name: string;
- epochs: readonly object[];
-}): string {
- const epochs =
- project.epochs.length === 0
- ? ' "epochs": [],'
- : [
- ' "epochs": [',
- project.epochs.map((epoch) => ` ${stableInline(epoch)}`).join(",\n"),
- " ],",
- ].join("\n");
- return `${[
- "{",
- epochs,
- ` "name": ${JSON.stringify(project.name)},`,
- ` "schema": ${project.schema}`,
- "}",
- ].join("\n")}\n`;
+export function projectJson(project: { schema: number; name: string }): string {
+ return `${["{", ` "name": ${JSON.stringify(project.name)},`, ` "schema": ${project.schema}`, "}"].join("\n")}\n`;
}
/**
diff --git a/packages/cli/src/view/files.ts b/packages/cli/src/view/files.ts
index d01c4f4..4231999 100644
--- a/packages/cli/src/view/files.ts
+++ b/packages/cli/src/view/files.ts
@@ -95,7 +95,7 @@ export function buildFileHistory(
return files.sort((a, b) => timeOf(b.lastAt) - timeOf(a.lastAt) || a.path.localeCompare(b.path));
}
-/** Every session of a built page, epoch order and then the unassigned ones. */
+/** Every session of a built page, in start order. */
export function modelSessions(model: LineageViewModel): FileSourceSession[] {
- return [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned];
+ return model.sessions;
}
diff --git a/packages/cli/src/view/lineage.ts b/packages/cli/src/view/lineage.ts
index 67aa444..fc84c52 100644
--- a/packages/cli/src/view/lineage.ts
+++ b/packages/cli/src/view/lineage.ts
@@ -8,7 +8,6 @@ import {
type StatusCard,
VIEW_SCHEMA,
type ViewChatTurn,
- type ViewEpoch,
type ViewNode,
type ViewPendingMessage,
type ViewSession,
@@ -258,7 +257,6 @@ function toViewSession(
agent: session.agent,
title: sessionTitle(session),
...(session.author === undefined ? {} : { author: session.author }),
- epoch: session.epoch,
startedAt: session.startedAt,
updatedAt: session.updatedAt,
status: session.status,
@@ -328,15 +326,8 @@ export function resolveContinues(sessions: ViewSession[]): void {
}
}
-/**
- * Builds the page model: epochs in project order, sessions by `startedAt`, and
- * every session whose epoch is null or unknown in the `unassigned` group.
- */
+/** Builds the page model: every session, by `startedAt`. */
export function buildViewModel(input: ViewModelInput): LineageViewModel {
- const buckets = new Map<string, ViewSession[]>(
- input.project.epochs.map((epoch) => [epoch.id, []]),
- );
- const unassigned: ViewSession[] = [];
const sessions = [...input.sessions].sort(byStartedAt);
const views: ViewSession[] = [];
@@ -350,26 +341,16 @@ export function buildViewModel(input: ViewModelInput): LineageViewModel {
input.commitSubjects,
input.commitFiles,
);
- const bucket = session.epoch === null ? undefined : buckets.get(session.epoch);
- (bucket ?? unassigned).push(view);
views.push(view);
}
resolveContinues(views);
- const epochs: ViewEpoch[] = input.project.epochs.map((epoch) => ({
- id: epoch.id,
- title: epoch.title,
- createdAt: epoch.createdAt,
- sessions: buckets.get(epoch.id) ?? [],
- }));
-
return {
kind: "lineage",
schema: VIEW_SCHEMA,
project: { name: input.project.name, path: input.path, generatedAt: input.generatedAt },
status: statusCard(sessions, input.generatedAt),
- epochs,
- unassigned,
+ sessions: views,
...(input.settings === undefined ? {} : { settings: input.settings }),
};
}
diff --git a/packages/cli/src/view/model.ts b/packages/cli/src/view/model.ts
index 9d4b9b2..d325653 100644
--- a/packages/cli/src/view/model.ts
+++ b/packages/cli/src/view/model.ts
@@ -192,7 +192,6 @@ export interface ViewSession {
title: string;
/** Who recorded the session (Story 9.3); absent on records written before it. */
author?: string;
- epoch: string | null;
startedAt: string;
updatedAt: string;
status: ViewStatus;
@@ -218,13 +217,6 @@ export interface ViewSession {
chat?: ViewChatTurn[];
}
-export interface ViewEpoch {
- id: string;
- title: string;
- createdAt: string;
- sessions: ViewSession[];
-}
-
/**
* One entry of the map's project switcher (Story 8.12): a registered project
* with the line that says where its work left off.
@@ -284,9 +276,8 @@ export interface LineageViewModel {
generatedAt: string;
};
status: StatusCard;
- epochs: ViewEpoch[];
- /** Sessions with no epoch, or with an epoch that no longer exists. */
- unassigned: ViewSession[];
+ /** Every session, in start order. */
+ sessions: ViewSession[];
/**
* Every registered project, most recently active first, for the map's
* switcher (Story 8.12). Missing directories are left out; older pages simply
diff --git a/packages/cli/src/view/search.ts b/packages/cli/src/view/search.ts
index 9de3ea5..bbbc468 100644
--- a/packages/cli/src/view/search.ts
+++ b/packages/cli/src/view/search.ts
@@ -280,11 +280,10 @@ export type HashRefResult =
/** A pasted hash (or a unique prefix) as the map resolves it, like `show`. */
export function resolveHashPrefix(model: LineageViewModel, ref: string): HashRefResult {
const prefix = ref.trim().toLowerCase();
- const found = [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned].flatMap(
- (session) =>
- session.messages
- .filter((message) => message.id.startsWith(prefix))
- .map((message) => ({ session, message })),
+ const found = model.sessions.flatMap((session) =>
+ session.messages
+ .filter((message) => message.id.startsWith(prefix))
+ .map((message) => ({ session, message })),
);
if (found.length === 0) return { kind: "none" };
if (found.length > 1) return { kind: "ambiguous", count: found.length };
@@ -300,7 +299,7 @@ export function resolveHashPrefix(model: LineageViewModel, ref: string): HashRef
/** The map's search: every session of the page as a source, in page order. */
export function searchLineage(model: LineageViewModel, query: string): SearchHit[] {
- const sessions = [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned];
+ const sessions = model.sessions;
return searchSources(
sessions.map((session) => ({
sessionId: session.sessionId,
diff --git a/packages/cli/test/backfill.test.ts b/packages/cli/test/backfill.test.ts
index 4299633..240cb23 100644
--- a/packages/cli/test/backfill.test.ts
+++ b/packages/cli/test/backfill.test.ts
@@ -114,7 +114,6 @@ describe("catchUpPrompt", () => {
sessionId: "s1",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -167,10 +166,9 @@ describe("headless output", () => {
expect(
withoutNulls({
status: null,
- epoch: null,
nodes: [{ id: "m1", parent: null, why: null, decidedBy: null, title: "t" }, 3],
}),
- ).toEqual({ epoch: null, nodes: [{ id: "m1", parent: null, title: "t" }, 3] });
+ ).toEqual({ nodes: [{ id: "m1", parent: null, title: "t" }, 3] });
expect(withoutNulls({ nodes: "x" })).toEqual({ nodes: "x" });
});
diff --git a/packages/cli/test/blame.test.ts b/packages/cli/test/blame.test.ts
index 4266fdf..8a4217c 100644
--- a/packages/cli/test/blame.test.ts
+++ b/packages/cli/test/blame.test.ts
@@ -17,7 +17,6 @@ function session(over: Partial<Session> & { sessionId: string }): Session {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/build.test.ts b/packages/cli/test/build.test.ts
index 2261033..6e0f2bc 100644
--- a/packages/cli/test/build.test.ts
+++ b/packages/cli/test/build.test.ts
@@ -7,7 +7,6 @@ import { gzipSync } from "node:zlib";
import { beforeEach, describe, expect, it } from "vitest";
import { buildProject } from "../src/commands/build.js";
import { configSet } from "../src/commands/config.js";
-import { epochAdd } from "../src/commands/epoch.js";
import { init } from "../src/commands/init.js";
import { sessionWrite } from "../src/commands/session.js";
import { cogitGitignore } from "../src/git.js";
@@ -48,7 +47,6 @@ function session(over: Partial<Session> & { sessionId: string }): Session {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -146,17 +144,15 @@ describe("buildMessages", () => {
});
describe("buildViewModel", () => {
- it("orders epochs by project order, sessions by startedAt and groups unknown epochs", () => {
+ it("lists every session by startedAt", () => {
const sessions = [
session({
sessionId: "late",
- epoch: "e1",
startedAt: "2026-01-02T00:00:00.000Z",
updatedAt: "2026-01-02T00:00:00.000Z",
}),
session({
sessionId: "early",
- epoch: "e1",
startedAt: "2026-01-01T00:00:00.000Z",
updatedAt: "2026-01-05T00:00:00.000Z",
status: {
@@ -168,13 +164,11 @@ describe("buildViewModel", () => {
}),
session({
sessionId: "ghost",
- epoch: "nope",
startedAt: "2026-01-04T00:00:00.000Z",
updatedAt: "2026-01-04T00:00:00.000Z",
}),
session({
sessionId: "none",
- epoch: null,
startedAt: "2026-01-03T00:00:00.000Z",
updatedAt: "2026-01-03T00:00:00.000Z",
}),
@@ -183,20 +177,13 @@ describe("buildViewModel", () => {
project: {
schema: 1,
name: "p",
- epochs: [
- { id: "e2", title: "Second", createdAt: T0 },
- { id: "e1", title: "First", createdAt: T0 },
- ],
},
sessions,
path: "/tmp/p",
generatedAt: T0,
});
- expect(model.epochs.map((e) => e.id)).toEqual(["e2", "e1"]);
- expect(model.epochs[1]?.sessions.map((s) => s.sessionId)).toEqual(["early", "late"]);
- expect(model.epochs[0]?.sessions).toEqual([]);
- expect(model.unassigned.map((s) => s.sessionId)).toEqual(["none", "ghost"]);
+ expect(model.sessions.map((s) => s.sessionId)).toEqual(["early", "late", "none", "ghost"]);
expect(model.status).toEqual({
goal: "ship",
done: ["a"],
@@ -209,7 +196,7 @@ describe("buildViewModel", () => {
it("appends unrecorded messages to the end of the chain", () => {
const model = buildViewModel({
- project: { schema: 1, name: "p", epochs: [] },
+ project: { schema: 1, name: "p" },
sessions: [
session({
sessionId: "s",
@@ -232,7 +219,7 @@ describe("buildViewModel", () => {
],
]),
});
- const messages = model.unassigned[0]?.messages ?? [];
+ const messages = model.sessions[0]?.messages ?? [];
expect(messages.map((message) => message.title)).toEqual([
"Recorded message",
"Second message",
@@ -252,7 +239,7 @@ describe("buildViewModel", () => {
it("turns a cross-session parent into a continues mark and a root", () => {
const model = buildViewModel({
- project: { schema: 1, name: "p", epochs: [] },
+ project: { schema: 1, name: "p" },
sessions: [
session({
sessionId: "first",
@@ -270,24 +257,24 @@ describe("buildViewModel", () => {
path: "/tmp/p",
generatedAt: T0,
});
- const second = model.unassigned.find((s) => s.sessionId === "second");
+ const second = model.sessions.find((s) => s.sessionId === "second");
expect(second?.messages[0]).toMatchObject({
parent: null,
continues: { sessionId: "first", sessionTitle: "Earlier chat", id: "h1", label: "m1" },
});
// The other session is untouched: its own message stays a root.
- expect(model.unassigned[0]?.messages[0]?.continues).toBeUndefined();
+ expect(model.sessions[0]?.messages[0]?.continues).toBeUndefined();
});
it("has an empty status card without sessions", () => {
const model = buildViewModel({
- project: { schema: 1, name: "p", epochs: [] },
+ project: { schema: 1, name: "p" },
sessions: [],
path: "/tmp/p",
generatedAt: T0,
});
expect(model.status).toEqual({ goal: "", done: [], pending: [], next: "", lastActivity: null });
- expect(model.unassigned).toEqual([]);
+ expect(model.sessions).toEqual([]);
});
});
@@ -410,7 +397,7 @@ describe("statusCard", () => {
describe("embedViewModel", () => {
const model = buildViewModel({
- project: { schema: 1, name: "p", epochs: [] },
+ project: { schema: 1, name: "p" },
sessions: [],
path: "/tmp/p",
generatedAt: T0,
@@ -459,7 +446,6 @@ describe("cogit build", () => {
await mkdir(root);
io = fakeIo(envFor(dir));
await init(root, { name: "proj", retention: "keep", language: "auto" }, fakeIo(envFor(dir)));
- await epochAdd(root, "e1", "First", fakeIo(envFor(dir)));
});
it("writes the map, keeping good sessions and warning about bad ones", async () => {
@@ -468,7 +454,6 @@ describe("cogit build", () => {
session({
sessionId: "s1",
title: "one",
- epoch: "e1",
startedAt: "2026-01-02T00:00:00.000Z",
nodes: [
node("m1", "message", "A", null, {
@@ -483,7 +468,6 @@ describe("cogit build", () => {
session({
sessionId: "s2",
title: "two",
- epoch: "e1",
startedAt: "2026-01-01T00:00:00.000Z",
}),
);
@@ -491,7 +475,6 @@ describe("cogit build", () => {
"s3",
session({
sessionId: "s3",
- epoch: "missing",
startedAt: "2026-01-05T00:00:00.000Z",
updatedAt: "2026-12-01T00:00:00.000Z",
status: {
@@ -502,14 +485,11 @@ describe("cogit build", () => {
},
}),
);
- await saveSession(
- "s4",
- session({ sessionId: "s4", epoch: null, startedAt: "2026-01-03T00:00:00.000Z" }),
- );
+ await saveSession("s4", session({ sessionId: "s4", startedAt: "2026-01-03T00:00:00.000Z" }));
await writeFile(paths().session("bad"), "{nope");
await writeFile(paths().session("partial"), '{"schema":1,"sessionId":"p"}');
await saveSession("newer", {
- ...session({ sessionId: "newer", epoch: "e1" }),
+ ...session({ sessionId: "newer" }),
schema: 2,
});
await writeFile(join(paths().sessions, "notes.txt"), "ignored");
@@ -530,9 +510,8 @@ describe("cogit build", () => {
// The panel reads the same project again; its warnings must not repeat.
expect(io.warnings.filter((line) => line.startsWith("skipping session bad:"))).toHaveLength(1);
- expect(model.epochs[0]?.sessions.map((s) => s.sessionId)).toEqual(["s2", "s1", "newer"]);
- expect(model.unassigned.map((s) => s.sessionId)).toEqual(["s4", "s3"]);
- expect(model.epochs[0]?.sessions[1]?.messages[0]?.summary).toBe("token [REDACTED]");
+ expect(model.sessions.map((s) => s.sessionId)).toEqual(["s2", "s1", "s4", "s3", "newer"]);
+ expect(model.sessions[1]?.messages[0]?.summary).toBe("token [REDACTED]");
expect(model.status.goal).toBe("latest");
const html = await readFile(paths().html, "utf8");
@@ -554,7 +533,6 @@ describe("cogit build", () => {
session({
sessionId: "s1",
title: "one",
- epoch: "e1",
startedAt: "2026-01-02T00:00:00.000Z",
nodes: [
node("h1", "message", "Write a", null, {
@@ -624,17 +602,11 @@ describe("cogit build", () => {
const transcript = lines.map((line) => JSON.stringify(line)).join("\n");
await writeFile(join(folder, "s1.jsonl"), transcript);
await writeFile(join(folder, "s2.jsonl"), transcript);
- await saveSession(
- "s1",
- session({ sessionId: "s1", epoch: "e1", nodes: [node("m1", "message", "Fix it")] }),
- );
- await saveSession(
- "s2",
- session({ sessionId: "s2", epoch: "e1", nodes: [node("a", "step", "Old record")] }),
- );
+ await saveSession("s1", session({ sessionId: "s1", nodes: [node("m1", "message", "Fix it")] }));
+ await saveSession("s2", session({ sessionId: "s2", nodes: [node("a", "step", "Old record")] }));
const model = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- const [s1, s2] = model.epochs[0]?.sessions ?? [];
+ const [s1, s2] = model.sessions ?? [];
const raw = "Fix the card <system-reminder>x</system-reminder>";
const turn = {
id: messageHash("s1", { at: T0, text: raw }),
@@ -669,8 +641,8 @@ describe("cogit build", () => {
await writeFile(paths().readState, "[]");
const model = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(model.unassigned.map((s) => s.sessionId)).toEqual(["s3"]);
- expect(model.unassigned[0]?.messages).toEqual([
+ expect(model.sessions.map((s) => s.sessionId)).toEqual(["s3"]);
+ expect(model.sessions[0]?.messages).toEqual([
expect.objectContaining({ title: "Start the work", unsummarized: true }),
]);
await expect(readFile(paths().session("s3"), "utf8")).rejects.toThrow();
@@ -689,13 +661,12 @@ describe("cogit build", () => {
"s1",
session({
sessionId: "s1",
- epoch: "e1",
nodes: [node("m1", "message", "Ship it", null, { commits: [short] })],
}),
);
const first = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(first.epochs[0]?.sessions[0]?.messages[0]?.commitTags).toEqual([
+ expect(first.sessions[0]?.messages[0]?.commitTags).toEqual([
{ hash: short, subject: "feat: first commit", files: ["a.txt"] },
]);
@@ -705,12 +676,11 @@ describe("cogit build", () => {
"s1",
session({
sessionId: "s1",
- epoch: "e1",
nodes: [node("m1", "message", "Ship it", null, { commits: [short, "0000000"] })],
}),
);
const second = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(second.epochs[0]?.sessions[0]?.messages[0]?.commitTags).toEqual([
+ expect(second.sessions[0]?.messages[0]?.commitTags).toEqual([
{ hash: short, subject: "feat: first commit", files: ["a.txt"] },
{ hash: "0000000" },
]);
@@ -740,10 +710,7 @@ describe("cogit build", () => {
];
const transcript = join(folder, "s1.jsonl");
await writeFile(transcript, lines.map((line) => JSON.stringify(line)).join("\n"));
- await saveSession(
- "s1",
- session({ sessionId: "s1", epoch: "e1", nodes: [node("m1", "message", "First")] }),
- );
+ await saveSession("s1", session({ sessionId: "s1", nodes: [node("m1", "message", "First")] }));
const hash = (uuid: string, at: string, text: string) => messageHash("s1", { uuid, at, text });
const hashes = [
@@ -752,7 +719,7 @@ describe("cogit build", () => {
hash("u3", T0, "Third"),
];
const first = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(first.epochs[0]?.sessions[0]?.chat?.map((t) => t.id)).toEqual(hashes.slice(0, 2));
+ expect(first.sessions[0]?.chat?.map((t) => t.id)).toEqual(hashes.slice(0, 2));
expect((await readConversationStore(root, "s1")).map((t) => [t.uuid, t.text])).toEqual([
["u1", "First"],
["u2", "Second"],
@@ -761,11 +728,7 @@ describe("cogit build", () => {
// A later turn is appended to the store, not to a rewritten file.
await appendFile(transcript, `\n${JSON.stringify(userLine("u3", "Third", T0))}`);
const second = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(second.epochs[0]?.sessions[0]?.chat?.map((t) => t.text)).toEqual([
- "First",
- "Second",
- "Third",
- ]);
+ expect(second.sessions[0]?.chat?.map((t) => t.text)).toEqual(["First", "Second", "Third"]);
expect((await readConversationStore(root, "s1")).map((t) => t.uuid)).toEqual([
"u1",
"u2",
@@ -775,7 +738,7 @@ describe("cogit build", () => {
// Claude Code deletes the transcript; the store still feeds the drill-down.
await rm(transcript);
const third = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(third.epochs[0]?.sessions[0]).toMatchObject({
+ expect(third.sessions[0]).toMatchObject({
transcriptAvailable: false,
chat: [
{ id: hashes[0], text: "First", replies: ["Answer one"] },
@@ -787,11 +750,7 @@ describe("cogit build", () => {
// An unreadable transcript falls back to the store instead of a lost chat.
await mkdir(transcript);
const fourth = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(fourth.epochs[0]?.sessions[0]?.chat?.map((t) => t.text)).toEqual([
- "First",
- "Second",
- "Third",
- ]);
+ expect(fourth.sessions[0]?.chat?.map((t) => t.text)).toEqual(["First", "Second", "Third"]);
expect(io.warnings).toEqual(
expect.arrayContaining([expect.stringMatching(/^could not read the conversation of s1: /)]),
);
@@ -823,21 +782,18 @@ describe("cogit build", () => {
paths().conversation("s1"),
gzipSync(Buffer.from(`${JSON.stringify(stored)}\n`)),
);
- await saveSession(
- "s1",
- session({ sessionId: "s1", epoch: "e1", nodes: [node("m1", "message", "First")] }),
- );
+ await saveSession("s1", session({ sessionId: "s1", nodes: [node("m1", "message", "First")] }));
const id = messageHash("s1", { uuid: "u1", at: T0, text: "First" });
const first = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(first.epochs[0]?.sessions[0]?.messages[0]?.id).toBe(id);
+ expect(first.sessions[0]?.messages[0]?.id).toBe(id);
expect((await readConversationStore(root, "s1"))[0]?.hash).toBe(id);
// The transcript goes; the stored hash keeps the same id and the record matches.
await rm(transcript);
const second = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(second.epochs[0]?.sessions[0]?.messages.map((m) => m.id)).toEqual([id]);
- expect(second.epochs[0]?.sessions[0]?.messages[0]?.unsummarized).toBeUndefined();
+ expect(second.sessions[0]?.messages.map((m) => m.id)).toEqual([id]);
+ expect(second.sessions[0]?.messages[0]?.unsummarized).toBeUndefined();
});
it("writes the project ignore rules once, also in an existing project", async () => {
@@ -863,15 +819,12 @@ describe("cogit build", () => {
message: { content: "Hi" },
}),
);
- await saveSession(
- "s1",
- session({ sessionId: "s1", epoch: "e1", nodes: [node("m1", "message", "Hi")] }),
- );
+ await saveSession("s1", session({ sessionId: "s1", nodes: [node("m1", "message", "Hi")] }));
// A file where the store's directory belongs makes the append fail.
await writeFile(paths().conversations, "not a directory");
const model = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(model.epochs[0]?.sessions[0]?.chat?.[0]?.text).toBe("Hi");
+ expect(model.sessions[0]?.chat?.[0]?.text).toBe("Hi");
expect(io.warnings).toEqual(
expect.arrayContaining([expect.stringMatching(/^could not store the conversation of s1: /)]),
);
@@ -883,7 +836,7 @@ describe("cogit build", () => {
await rm(ignore, { force: true });
await mkdir(ignore);
const model = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(model.epochs[0]?.id).toBe("e1");
+ expect(model.sessions).toEqual([]);
expect(io.warnings).toEqual(
expect.arrayContaining([expect.stringMatching(/^could not update \.cogit\/\.gitignore: /)]),
);
@@ -907,7 +860,6 @@ describe("cogit build", () => {
"s1",
session({
sessionId: "s1",
- epoch: "e1",
nodes: [
node("topic", "phase", "Topic"),
node("m1", "message", "First", "topic", { at: T0 }),
@@ -916,7 +868,7 @@ describe("cogit build", () => {
);
const before = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- const messages = before.epochs[0]?.sessions[0]?.messages ?? [];
+ const messages = before.sessions[0]?.messages ?? [];
expect(messages.map((message) => message.title)).toEqual([
"First",
"Second message, with the card",
@@ -946,7 +898,7 @@ describe("cogit build", () => {
expect.stringMatching(/m2: parent topic is not an earlier message of this session, using m1/),
]);
const after = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- expect(after.epochs[0]?.sessions[0]?.messages.map((message) => message.title)).toEqual([
+ expect(after.sessions[0]?.messages.map((message) => message.title)).toEqual([
"First",
"Second message",
]);
@@ -964,24 +916,20 @@ describe("cogit build", () => {
"s1",
session({
sessionId: "s1",
- epoch: "e1",
nodes: [node("m1", "message", "One", null, { at: T0 })],
}),
);
// A session with no transcript must not break the count.
- await saveSession("s2", session({ sessionId: "s2", epoch: "e1" }));
+ await saveSession("s2", session({ sessionId: "s2" }));
const on = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
- const recorded = (model: typeof on) =>
- model.epochs[0]?.sessions.find((s) => s.sessionId === "s1");
+ const recorded = (model: typeof on) => model.sessions.find((s) => s.sessionId === "s1");
expect(recorded(on)).not.toHaveProperty("unrecordedMessages");
await configSet("sessionEndCatchUp", "false", fakeIo(envFor(dir)));
const off = await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
expect(recorded(off)?.unrecordedMessages).toBe(1);
- expect(off.epochs[0]?.sessions.find((s) => s.sessionId === "s2")).not.toHaveProperty(
- "unrecordedMessages",
- );
+ expect(off.sessions.find((s) => s.sessionId === "s2")).not.toHaveProperty("unrecordedMessages");
});
it("builds without printing when quiet and survives a missing sessions directory", async () => {
@@ -989,8 +937,7 @@ describe("cogit build", () => {
await buildProject({ dir: root, io, templateHtml: TEMPLATE, quiet: true });
expect(io.lines).toEqual([]);
expect(embedded(await readFile(paths().html, "utf8"))).toMatchObject({
- epochs: [{ id: "e1", sessions: [] }],
- unassigned: [],
+ sessions: [],
});
});
@@ -1013,20 +960,20 @@ describe("cogit build", () => {
/schema version/,
);
- await writeFile(paths().project, JSON.stringify({ schema: 2, name: "future", epochs: [] }));
+ await writeFile(paths().project, JSON.stringify({ schema: 2, name: "future" }));
await buildProject({ dir: root, io, templateHtml: TEMPLATE });
expect(io.warnings).toContain("schema v2 is newer than supported v1; reading best-effort");
});
it("rebuilds quietly after a session write with the bundled template", async () => {
await sessionWrite({ dir: root }, io, async () =>
- JSON.stringify({ sessionId: "s1", title: "written", epoch: "e1" }),
+ JSON.stringify({ sessionId: "s1", title: "written" }),
);
expect(io.lines).toEqual(["Saved session s1 (0 nodes)"]);
const html = await readFile(paths().html, "utf8");
expect(html).toContain('<div id="root">');
expect(embedded(html)).toMatchObject({
- epochs: [{ id: "e1", sessions: [{ sessionId: "s1", title: "written" }] }],
+ sessions: [{ sessionId: "s1", title: "written" }],
});
});
diff --git a/packages/cli/test/close.test.ts b/packages/cli/test/close.test.ts
index dc0b5a6..736059a 100644
--- a/packages/cli/test/close.test.ts
+++ b/packages/cli/test/close.test.ts
@@ -80,7 +80,6 @@ function session(nodes: Partial<Session["nodes"][number]>[]): Session {
sessionId: "s1",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/config-epoch.test.ts b/packages/cli/test/config-epoch.test.ts
index a655b23..18f933a 100644
--- a/packages/cli/test/config-epoch.test.ts
+++ b/packages/cli/test/config-epoch.test.ts
@@ -2,7 +2,6 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { beforeEach, describe, expect, it } from "vitest";
import { configGet, configPrune, configSet } from "../src/commands/config.js";
-import { epochAdd } from "../src/commands/epoch.js";
import { init } from "../src/commands/init.js";
import { CliError } from "../src/io.js";
import { globalPaths } from "../src/store/paths.js";
@@ -152,31 +151,3 @@ describe("config prune", () => {
await expect(configPrune({}, fakeIo(env))).rejects.toThrow(/registry: invalid JSON/);
});
});
-
-describe("epoch add", () => {
- let root: string;
- beforeEach(async () => {
- root = join(dir, "proj");
- await mkdir(root);
- });
-
- it("adds an epoch once and accepts a repeat with the same title", async () => {
- await init(root, { name: "p", retention: "keep", language: "auto" }, fakeIo(env));
- const io = fakeIo(env);
- await epochAdd(root, "e2e", "E2E setup", io);
- await epochAdd(root, "e2e", "E2E setup", io);
- expect(io.lines).toEqual(["Added epoch e2e: E2E setup", "Epoch e2e already exists"]);
- expect(await loadProject(root)).toMatchObject({
- data: { epochs: [{ id: "e2e", title: "E2E setup", createdAt: "2026-10-21T10:00:00.000Z" }] },
- });
- await expect(epochAdd(root, "e2e", "Other", io)).rejects.toThrow(/already exists/);
- });
-
- it("rejects bad ids and uninitialized or corrupt projects", async () => {
- await expect(epochAdd(root, "../x", "t", fakeIo(env))).rejects.toThrow(/invalid epoch id/);
- await expect(epochAdd(root, "e1", "t", fakeIo(env))).rejects.toThrow(/not initialized/);
- await mkdir(join(root, ".cogit"));
- await writeFile(join(root, ".cogit", "project.json"), '{"schema":1}');
- await expect(epochAdd(root, "e1", "t", fakeIo(env))).rejects.toThrow(/name/);
- });
-});
diff --git a/packages/cli/test/events.test.ts b/packages/cli/test/events.test.ts
index 045c721..027cd82 100644
--- a/packages/cli/test/events.test.ts
+++ b/packages/cli/test/events.test.ts
@@ -48,7 +48,6 @@ describe("message ids", () => {
sessionId: "s1",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: AT,
updatedAt: AT,
status: { goal: "", done: [], pending: [], next: "" },
@@ -87,7 +86,6 @@ describe("message ids", () => {
sessionId: "s1",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: AT,
updatedAt: AT,
status: { goal: "", done: [], pending: [], next: "" },
@@ -279,7 +277,6 @@ describe("session write with stable ids", () => {
sessionId: "s1",
agent: "claude-code",
title: "old",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -345,7 +342,6 @@ describe("migrate ids", () => {
sessionId: "s1",
agent: "claude-code",
title: "old",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -397,7 +393,6 @@ describe("migrate ids", () => {
sessionId: "s2",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/files.test.ts b/packages/cli/test/files.test.ts
index eeee71e..73dd8dd 100644
--- a/packages/cli/test/files.test.ts
+++ b/packages/cli/test/files.test.ts
@@ -112,38 +112,27 @@ describe("buildFileHistory", () => {
expect(buildFileHistory([source("s1", "Empty", [])])).toEqual([]);
});
- it("flattens a page's epochs and unassigned sessions for the union", () => {
+ it("lists a page's sessions for the union", () => {
const sessions = modelSessions({
kind: "lineage",
schema: 1,
project: { name: "p", path: "/p", generatedAt: T0 },
status: { goal: "", done: [], pending: [], next: "", lastActivity: null },
- epochs: [
+ sessions: [
{
- id: "e1",
- title: "One",
- createdAt: T0,
- sessions: [
- {
- sessionId: "s1",
- agent: "claude-code",
- title: "Epoch chat",
- epoch: "e1",
- startedAt: T0,
- updatedAt: T0,
- status: { goal: "", done: [], pending: [], next: "" },
- messages: [],
- transcriptAvailable: true,
- },
- ],
+ sessionId: "s1",
+ agent: "claude-code",
+ title: "Epoch chat",
+ startedAt: T0,
+ updatedAt: T0,
+ status: { goal: "", done: [], pending: [], next: "" },
+ messages: [],
+ transcriptAvailable: true,
},
- ],
- unassigned: [
{
sessionId: "s2",
agent: "claude-code",
title: "Loose chat",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -190,7 +179,6 @@ describe("cogit log --file", () => {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/hooks.test.ts b/packages/cli/test/hooks.test.ts
index fb5f45b..01e2012 100644
--- a/packages/cli/test/hooks.test.ts
+++ b/packages/cli/test/hooks.test.ts
@@ -86,7 +86,6 @@ describe("session start handoff", () => {
sessionId: id,
agent: "claude-code",
title: id,
- epoch: null,
startedAt,
updatedAt,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/init.test.ts b/packages/cli/test/init.test.ts
index 8a450b5..3df0ffc 100644
--- a/packages/cli/test/init.test.ts
+++ b/packages/cli/test/init.test.ts
@@ -53,7 +53,7 @@ describe("init", () => {
await mkdir(join(root, ".codelineage"), { recursive: true });
await writeFile(
join(root, ".codelineage", "project.json"),
- `${JSON.stringify({ schema: 1, name: "old", epochs: [] })}\n`,
+ `${JSON.stringify({ schema: 1, name: "old" })}\n`,
);
const io = fakeIo(env);
@@ -67,7 +67,7 @@ describe("init", () => {
it("creates the project with defaults and registers it", async () => {
const io = fakeIo(env);
await init(root, {}, io);
- expect(await loadProject(root)).toMatchObject({ ok: true, data: { name: "proj", epochs: [] } });
+ expect(await loadProject(root)).toMatchObject({ ok: true, data: { name: "proj" } });
expect(await readdir(join(root, ".cogit"))).toContain("sessions");
expect(await loadRegistry(env)).toMatchObject({
ok: true,
diff --git a/packages/cli/test/log.test.ts b/packages/cli/test/log.test.ts
index 6644e8d..3a9485d 100644
--- a/packages/cli/test/log.test.ts
+++ b/packages/cli/test/log.test.ts
@@ -31,7 +31,6 @@ function session(over: Partial<Session> & { sessionId: string }): Session {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -56,7 +55,6 @@ describe("cogit log and show", () => {
sessionId: "s1",
title: "Ship the parser",
author: "Eren",
- epoch: "e8",
startedAt: "2026-10-20T09:00:00.000Z",
updatedAt: "2026-10-20T10:00:00.000Z",
nodes: [
@@ -208,7 +206,7 @@ describe("cogit log and show", () => {
it("prints sessions newest first with labels, return marks and commits", async () => {
const model = await log({ dir: root, io });
const lines = formatLog(model);
- expect(lines[0]).toContain("## Later chat (s2) · unassigned");
+ expect(lines[0]).toContain("## Later chat (s2) · ");
const byAuthor = lines.find((line) => line.startsWith("## Ship the parser"));
expect(byAuthor).toContain("· by Eren ·");
expect(lines[0]).toContain(stamp("2026-10-21T10:00:00.000Z"));
diff --git a/packages/cli/test/migrate.test.ts b/packages/cli/test/migrate.test.ts
index 545ed16..20b820d 100644
--- a/packages/cli/test/migrate.test.ts
+++ b/packages/cli/test/migrate.test.ts
@@ -80,7 +80,6 @@ describe("migrateProject", () => {
await atomicWriteJson(join(root, ".codelineage", "project.json"), {
schema: 1,
name: "p",
- epochs: [],
});
const resolved = await resolveProjectRoot(root);
diff --git a/packages/cli/test/panel.test.ts b/packages/cli/test/panel.test.ts
index 5a7e770..d193acf 100644
--- a/packages/cli/test/panel.test.ts
+++ b/packages/cli/test/panel.test.ts
@@ -235,7 +235,6 @@ describe("panel card unread count (10.3)", () => {
sessionId: "s1",
agent: "claude-code",
title: "t",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -251,7 +250,7 @@ describe("panel card unread count (10.3)", () => {
],
};
await mkdir(paths.sessions, { recursive: true });
- await writeFile(paths.project, JSON.stringify({ schema: 1, name: "proj", epochs: [] }));
+ await writeFile(paths.project, JSON.stringify({ schema: 1, name: "proj" }));
await writeFile(paths.session("s1"), JSON.stringify(session));
// A directory where read.json belongs: reading it is an error, not "empty".
await mkdir(paths.readState, { recursive: true });
diff --git a/packages/cli/test/pr.test.ts b/packages/cli/test/pr.test.ts
index e73d00d..53ec529 100644
--- a/packages/cli/test/pr.test.ts
+++ b/packages/cli/test/pr.test.ts
@@ -35,7 +35,6 @@ function session(): Session {
sessionId: "s1",
agent: "claude-code",
title: "Ship the parser",
- epoch: null,
startedAt: "2026-10-20T09:00:00.000Z",
updatedAt: "2026-10-20T10:00:00.000Z",
status: {
diff --git a/packages/cli/test/program-commands.test.ts b/packages/cli/test/program-commands.test.ts
index ed6e356..89dc987 100644
--- a/packages/cli/test/program-commands.test.ts
+++ b/packages/cli/test/program-commands.test.ts
@@ -78,14 +78,11 @@ describe("commands through the CLI", () => {
expect(await cli("init", root, "--yes", "--retention", "90", "--language", "auto")).toBe("");
});
- it("runs config get/set and epoch add", async () => {
+ it("runs config get/set", async () => {
await cli("config", "set", "updateEveryTurns", "7");
expect((await loadConfig(io.env)).updateEveryTurns).toBe(7);
await cli("config", "get", "updateEveryTurns");
expect(io.lines.at(-1)).toBe("7");
- await cli("init", root, "--yes", "--retention", "keep");
- await cli("epoch", "add", "e1", "First", "-C", root);
- expect(io.lines.at(-1)).toBe("Added epoch e1: First");
});
it("runs why from the CLI", async () => {
@@ -104,7 +101,6 @@ describe("commands through the CLI", () => {
sessionId: "s1",
agent: "claude-code",
title: "CLI session",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -278,7 +274,6 @@ describe("commands through the CLI", () => {
sessionId: "s1",
agent: "claude-code",
title: "CLI session",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/program.test.ts b/packages/cli/test/program.test.ts
index eaf2b1e..351c738 100644
--- a/packages/cli/test/program.test.ts
+++ b/packages/cli/test/program.test.ts
@@ -53,7 +53,6 @@ describe("createProgram", () => {
"open",
"config",
"hooks",
- "epoch",
"session",
"backfill",
"hook",
diff --git a/packages/cli/test/resume.test.ts b/packages/cli/test/resume.test.ts
index 66c7c78..8d727b5 100644
--- a/packages/cli/test/resume.test.ts
+++ b/packages/cli/test/resume.test.ts
@@ -3,7 +3,6 @@ import { join } from "node:path";
import { beforeEach, describe, expect, it } from "vitest";
import { claudeConfigDir, collectTranscriptIds } from "../src/agents/claude/transcripts.js";
import { buildProject } from "../src/commands/build.js";
-import { epochAdd } from "../src/commands/epoch.js";
import { init } from "../src/commands/init.js";
import type { Session } from "../src/schema/session.js";
import { projectPaths } from "../src/store/paths.js";
@@ -15,7 +14,6 @@ function session(over: Partial<Session> & { sessionId: string }): Session {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -84,16 +82,9 @@ describe("buildProject transcript availability", () => {
root = join(dir, "proj");
await mkdir(root);
await init(root, { name: "proj", retention: "keep", language: "auto" }, fakeIo(envFor(dir)));
- await epochAdd(root, "e1", "First", fakeIo(envFor(dir)));
const paths = projectPaths(root);
- await writeFile(
- paths.session("alive"),
- JSON.stringify(session({ sessionId: "alive", epoch: "e1" })),
- );
- await writeFile(
- paths.session("gone"),
- JSON.stringify(session({ sessionId: "gone", epoch: "e1" })),
- );
+ await writeFile(paths.session("alive"), JSON.stringify(session({ sessionId: "alive" })));
+ await writeFile(paths.session("gone"), JSON.stringify(session({ sessionId: "gone" })));
});
it("marks sessions whose transcript file exists", async () => {
@@ -103,7 +94,7 @@ describe("buildProject transcript availability", () => {
await writeFile(join(projectDir, "alive.jsonl"), "{}\n");
const model = await buildProject({ dir: root, io: fakeIo(env) });
- const sessions = model.epochs[0]?.sessions ?? [];
+ const sessions = model.sessions ?? [];
expect(sessions.map((s) => [s.sessionId, s.transcriptAvailable])).toEqual([
["alive", true],
["gone", false],
diff --git a/packages/cli/test/schema.test.ts b/packages/cli/test/schema.test.ts
index 9c5c46a..dbcba04 100644
--- a/packages/cli/test/schema.test.ts
+++ b/packages/cli/test/schema.test.ts
@@ -26,7 +26,7 @@ describe("Session schema", () => {
it("fills defaults for a minimal session", () => {
const s = Session.parse({ schema: 1, sessionId: "abc", startedAt: T0, updatedAt: T0 });
expect(s.agent).toBe("claude-code");
- expect(s.epoch).toBeNull();
+ expect(s).not.toHaveProperty("epoch");
expect(s.status).toEqual({ goal: "", done: [], pending: [], next: "" });
expect(s.nodes).toEqual([]);
});
@@ -104,8 +104,11 @@ describe("Session schema", () => {
});
describe("Project and Config schemas", () => {
- it("defaults epochs and settings", () => {
- expect(Project.parse({ schema: 1, name: "p" }).epochs).toEqual([]);
+ it("drops an old project's epochs and defaults the settings", () => {
+ expect(Project.parse({ schema: 1, name: "p", epochs: [{ id: "e1" }] })).toEqual({
+ schema: 1,
+ name: "p",
+ });
expect(Config.parse({ schema: 1 })).toMatchObject({
language: "auto",
updateEveryTurns: 15,
@@ -242,19 +245,18 @@ describe("mergeSession", () => {
it("replaces status when sent and keeps fields that were not sent", () => {
const first = mergeSession(
undefined,
- input({ sessionId: "s1", title: "t", epoch: "e2e", status: { goal: "g", done: ["a"] } }),
+ input({ sessionId: "s1", title: "t", status: { goal: "g", done: ["a"] } }),
T0,
).session;
const kept = mergeSession(first, input({ sessionId: "s1" }), T1).session;
- expect(kept).toMatchObject({ title: "t", epoch: "e2e" });
+ expect(kept).toMatchObject({ title: "t" });
expect(kept.status.done).toEqual(["a"]);
const replaced = mergeSession(
first,
- input({ sessionId: "s1", epoch: null, status: { goal: "g2" } }),
+ input({ sessionId: "s1", status: { goal: "g2" } }),
T1,
).session;
- expect(replaced.epoch).toBeNull();
expect(replaced.status).toEqual({ goal: "g2", done: [], pending: [], next: "" });
});
diff --git a/packages/cli/test/search.test.ts b/packages/cli/test/search.test.ts
index 2e4aff6..6eda3b4 100644
--- a/packages/cli/test/search.test.ts
+++ b/packages/cli/test/search.test.ts
@@ -33,7 +33,6 @@ function session(over: Partial<Session> & { sessionId: string }): Session {
schema: 1,
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -229,31 +228,22 @@ describe("hash jump", () => {
schema: 1,
project: { name: "p", path: "/tmp/p", generatedAt: T0 },
status: { goal: "", done: [], pending: [], next: "", lastActivity: null },
- epochs: [
+ sessions: [
{
- id: "e1",
- title: "Epoch one",
- createdAt: T0,
- sessions: [
- {
- sessionId: "s1",
- agent: "claude-code",
- title: "One",
- epoch: "e1",
- startedAt: T0,
- updatedAt: T0,
- status: { goal: "", done: [], pending: [], next: "" },
- messages: [
- message({ id: A, title: "First", at: T0, label: "m1" }),
- message({ id: B, title: "Second", at: T0, label: "m2" }),
- message({ id: C, title: "Third", at: T0, label: "m3" }),
- ],
- transcriptAvailable: true,
- },
+ sessionId: "s1",
+ agent: "claude-code",
+ title: "One",
+ startedAt: T0,
+ updatedAt: T0,
+ status: { goal: "", done: [], pending: [], next: "" },
+ messages: [
+ message({ id: A, title: "First", at: T0, label: "m1" }),
+ message({ id: B, title: "Second", at: T0, label: "m2" }),
+ message({ id: C, title: "Third", at: T0, label: "m3" }),
],
+ transcriptAvailable: true,
},
],
- unassigned: [],
};
it("recognises a hash and resolves only a unique prefix", () => {
@@ -315,7 +305,6 @@ describe("cogit search", () => {
const s1 = session({
sessionId: "s1",
title: "Ship the parser",
- epoch: "e8",
startedAt: "2026-10-20T09:00:00.000Z",
updatedAt: "2026-10-20T10:00:00.000Z",
nodes: [
diff --git a/packages/cli/test/session-git.test.ts b/packages/cli/test/session-git.test.ts
index df16af3..e46ac6e 100644
--- a/packages/cli/test/session-git.test.ts
+++ b/packages/cli/test/session-git.test.ts
@@ -60,7 +60,6 @@ describe("the record travels with the repo (Story 9.3)", () => {
sessionId: id,
agent: "claude-code",
title,
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -71,7 +70,7 @@ describe("the record travels with the repo (Story 9.3)", () => {
const makeProject = async (): Promise<void> => {
const paths = projectPaths(root);
await mkdir(paths.sessions, { recursive: true });
- await writeFile(paths.project, projectJson({ schema: 1, name: "proj", epochs: [] }));
+ await writeFile(paths.project, projectJson({ schema: 1, name: "proj" }));
await writeFile(paths.session("s1"), JSON.stringify(session("s1", "My session")));
await writeFile(paths.events("s1"), "");
};
@@ -202,20 +201,8 @@ describe("the record travels with the repo (Story 9.3)", () => {
expect(await sessionAuthor(root, noName)).toBe(userInfo().username);
});
- it("writes stable project.json with one epoch per line", () => {
- expect(projectJson({ schema: 1, name: "p", epochs: [] })).toBe(
- '{\n "epochs": [],\n "name": "p",\n "schema": 1\n}\n',
- );
- const text = projectJson({
- schema: 1,
- name: "p",
- epochs: [{ id: "e1", title: "One", createdAt: T0 }],
- });
- expect(text).toBe(
- `{\n "epochs": [\n {"createdAt": ${JSON.stringify(T0)}, "id": "e1", "title": "One"}\n ],\n "name": "p",\n "schema": 1\n}\n`,
- );
- // Each epoch is its own line, so two people add different ones without a conflict.
- expect(text.split("\n").filter((line) => line.includes('"id"'))).toHaveLength(1);
+ it("writes stable project.json, one sorted key per line", () => {
+ expect(projectJson({ schema: 1, name: "p" })).toBe('{\n "name": "p",\n "schema": 1\n}\n');
});
});
@@ -240,10 +227,7 @@ describe("ignore files and git hooks", () => {
await git("config", "user.email", "[email protected]");
await git("config", "user.name", "Tester");
await mkdir(projectPaths(root).base, { recursive: true });
- await writeFile(
- projectPaths(root).project,
- projectJson({ schema: 1, name: "proj", epochs: [] }),
- );
+ await writeFile(projectPaths(root).project, projectJson({ schema: 1, name: "proj" }));
});
it("adds and removes the root ignore line with the policy", async () => {
@@ -421,7 +405,6 @@ describe("ignore files and git hooks", () => {
sessionId: "s0",
agent: "claude-code",
title: "Earlier work",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/session.test.ts b/packages/cli/test/session.test.ts
index 146eb86..3f75681 100644
--- a/packages/cli/test/session.test.ts
+++ b/packages/cli/test/session.test.ts
@@ -6,7 +6,6 @@ import { Readable } from "node:stream";
import { promisify } from "node:util";
import { beforeEach, describe, expect, it } from "vitest";
import { configSet } from "../src/commands/config.js";
-import { epochAdd } from "../src/commands/epoch.js";
import { init } from "../src/commands/init.js";
import { readStdin, sessionShow, sessionWrite } from "../src/commands/session.js";
import { messageHash } from "../src/messages.js";
@@ -70,7 +69,6 @@ describe("session write", () => {
await mkdir(root);
io = fakeIo(envFor(dir));
await init(root, { name: "p", retention: "keep", language: "auto" }, fakeIo(envFor(dir)));
- await epochAdd(root, "e2e", "E2E", fakeIo(envFor(dir)));
});
it("drops a side message node the transcript does not have", async () => {
@@ -210,7 +208,6 @@ describe("session write", () => {
await write({
sessionId: "s1",
title: "setup",
- epoch: "e2e",
nodes: [{ id: "n1", kind: "phase", title: "start" }],
});
await write({
@@ -218,7 +215,7 @@ describe("session write", () => {
nodes: [{ id: "n2", parent: "n1", kind: "decision", title: "use elk", why: "nesting" }],
});
const s = await loadSession(root, "s1");
- expect(s).toMatchObject({ ok: true, data: { title: "setup", epoch: "e2e" } });
+ expect(s).toMatchObject({ ok: true, data: { title: "setup" } });
expect(s.found && s.ok && s.data.nodes.map((n) => n.id)).toEqual(["n1", "n2"]);
expect(io.lines).toEqual(["Saved session s1 (1 nodes)", "Saved session s1 (2 nodes)"]);
expect(io.warnings).toEqual([]);
@@ -234,15 +231,13 @@ describe("session write", () => {
expect(io.warnings).toEqual(["redacted 1 secret-looking value(s)"]);
});
- it("warns about unknown epochs and repaired trees but still saves", async () => {
+ it("warns about repaired trees but still saves", async () => {
await write({
sessionId: "s1",
- epoch: "nope",
nodes: [{ id: "a", parent: "ghost", kind: "step", title: "x" }],
});
- expect(io.warnings[0]).toMatch(/epoch "nope" is not in project.json/);
- expect(io.warnings[1]).toMatch(/parent ghost not found/);
- expect(await loadSession(root, "s1")).toMatchObject({ ok: true, data: { epoch: "nope" } });
+ expect(io.warnings[0]).toMatch(/parent ghost not found/);
+ expect(await loadSession(root, "s1")).toMatchObject({ ok: true });
});
it("repairs a message parent to the previous message and drops bad links", async () => {
@@ -311,7 +306,6 @@ describe("session write", () => {
sessionId: "late",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: "2026-10-22T00:00:00.000Z",
updatedAt: "2026-10-22T00:00:00.000Z",
status: { goal: "", done: [], pending: [], next: "" },
@@ -378,9 +372,8 @@ describe("session show", () => {
expect(shown()).toMatchObject({ initialized: false, error: expect.stringMatching(/JSON/) });
});
- it("shows epochs, language and a compact record without summaries", async () => {
+ it("shows the language and a compact record without summaries", async () => {
await init(root, { name: "p", retention: "keep", language: "tr" }, fakeIo(envFor(dir)));
- await epochAdd(root, "e2e", "E2E", fakeIo(envFor(dir)));
await sessionShow(root, "s1", io);
expect(shown()).toEqual({
initialized: true,
@@ -388,7 +381,6 @@ describe("session show", () => {
project: "p",
language: "tr",
messageSummaries: false,
- epochs: [{ id: "e2e", title: "E2E" }],
session: null,
newMessages: null,
lastMessages: [],
@@ -399,7 +391,6 @@ describe("session show", () => {
JSON.stringify({
sessionId: "s1",
title: "t",
- epoch: "e2e",
status: { goal: "g" },
nodes: [{ id: "a", kind: "phase", title: "A", summary: "long text", why: "because" }],
}),
@@ -408,7 +399,6 @@ describe("session show", () => {
expect(shown().session).toEqual({
sessionId: "s1",
title: "t",
- epoch: "e2e",
status: { goal: "g", done: [], pending: [], next: "" },
nodes: [{ id: "a", parent: null, kind: "phase", title: "A" }],
});
diff --git a/packages/cli/test/store.test.ts b/packages/cli/test/store.test.ts
index 52673ce..6525e74 100644
--- a/packages/cli/test/store.test.ts
+++ b/packages/cli/test/store.test.ts
@@ -165,15 +165,14 @@ describe("withLock", () => {
describe("stores", () => {
it("creates and updates project.json under the lock", async () => {
expect(await loadProject(dir)).toEqual({ found: false });
- await updateProject(dir, (cur) => cur ?? { schema: 1, name: "p", epochs: [] });
+ await updateProject(dir, (cur) => cur ?? { schema: 1, name: "p" });
await updateProject(dir, (cur) => ({
- ...(cur ?? { schema: 1, name: "p", epochs: [] }),
- epochs: [{ id: "e1", title: "E", createdAt: T0 }],
+ ...(cur ?? { schema: 1, name: "p" }),
}));
expect(await loadProject(dir)).toMatchObject({
found: true,
ok: true,
- data: { epochs: [{ id: "e1" }] },
+ data: { name: "p" },
});
});
@@ -181,7 +180,7 @@ describe("stores", () => {
const p = projectPaths(dir);
await mkdir(p.base, { recursive: true });
await writeFile(p.project, "{broken");
- await expect(updateProject(dir, () => ({ schema: 1, name: "p", epochs: [] }))).rejects.toThrow(
+ await expect(updateProject(dir, () => ({ schema: 1, name: "p" }))).rejects.toThrow(
/invalid JSON/,
);
expect(await readFile(p.project, "utf8")).toBe("{broken");
@@ -197,7 +196,6 @@ describe("stores", () => {
sessionId: "s1",
agent: "claude-code",
title: "",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/thought.test.ts b/packages/cli/test/thought.test.ts
index dc66bdb..22b207d 100644
--- a/packages/cli/test/thought.test.ts
+++ b/packages/cli/test/thought.test.ts
@@ -51,7 +51,7 @@ const TEMPLATE = `<!doctype html><html><body><div id="root"></div>
const DATA_PREFIX = `<script id="${DATA_ELEMENT_ID}" type="application/json">`;
function embedded(html: string): {
- unassigned: { messages: { commits?: string[] }[] }[];
+ sessions: { messages: { commits?: string[] }[] }[];
} {
const start = html.indexOf(DATA_PREFIX);
const end = html.indexOf("</script>", start);
@@ -64,7 +64,6 @@ function session(nodes: Session["nodes"], id = "s1"): Session {
sessionId: id,
agent: "claude-code",
title: "Ship it",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -89,7 +88,7 @@ describe("the thought behind a commit (Story 9.4)", () => {
const writeProject = async (nodes: Session["nodes"]): Promise<void> => {
const paths = projectPaths(root);
await mkdir(paths.sessions, { recursive: true });
- await writeFile(paths.project, projectJson({ schema: 1, name: "proj", epochs: [] }));
+ await writeFile(paths.project, projectJson({ schema: 1, name: "proj" }));
await writeFile(paths.session("s1"), JSON.stringify(session(nodes)));
};
@@ -537,7 +536,7 @@ describe("the thought behind a commit (Story 9.4)", () => {
await buildProject({ dir: root, io, templateHtml: TEMPLATE });
const html = await readFile(projectPaths(root).html, "utf8");
- expect(embedded(html).unassigned[0]?.messages[0]?.commits).toContain(full);
+ expect(embedded(html).sessions[0]?.messages[0]?.commits).toContain(full);
const effective = await loadEffectiveSessions(root, io);
const commits = effective[0]?.messages[0]?.commits ?? [];
diff --git a/packages/cli/test/unread.test.ts b/packages/cli/test/unread.test.ts
index fe30100..0e68017 100644
--- a/packages/cli/test/unread.test.ts
+++ b/packages/cli/test/unread.test.ts
@@ -37,7 +37,6 @@ function session(nodes: Session["nodes"]): Session {
sessionId: "s1",
agent: "claude-code",
title: "Ship the parser",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "Parse the file", done: [], pending: [], next: "" },
@@ -57,7 +56,7 @@ function message(id: string, title: string, commits?: string[]): Session["nodes"
}
interface Embedded {
- unassigned: {
+ sessions: {
messages: {
id: string;
change?: { added: number; removed: number; files: number };
@@ -85,7 +84,7 @@ describe("how much code landed per message (10.3)", () => {
const writeProject = async (nodes: Session["nodes"]): Promise<void> => {
const paths = projectPaths(root);
await mkdir(paths.sessions, { recursive: true });
- await writeFile(paths.project, projectJson({ schema: 1, name: "proj", epochs: [] }));
+ await writeFile(paths.project, projectJson({ schema: 1, name: "proj" }));
await writeFile(paths.session("s1"), JSON.stringify(session(nodes)));
};
@@ -137,7 +136,7 @@ describe("how much code landed per message (10.3)", () => {
await createCommits();
await buildProject({ dir: root, io, templateHtml: TEMPLATE });
const html = await readFile(projectPaths(root).html, "utf8");
- const messages = embedded(html).unassigned[0]?.messages ?? [];
+ const messages = embedded(html).sessions[0]?.messages ?? [];
const a = messages.find((node) => node.id === A);
const b = messages.find((node) => node.id === B);
const c = messages.find((node) => node.id === C);
diff --git a/packages/cli/test/why.test.ts b/packages/cli/test/why.test.ts
index 862adfe..acec816 100644
--- a/packages/cli/test/why.test.ts
+++ b/packages/cli/test/why.test.ts
@@ -32,7 +32,6 @@ function session(over: Partial<Session> = {}): Session {
sessionId: "s1",
agent: "claude-code",
title: "Ship the parser",
- epoch: null,
startedAt: "2026-10-20T09:00:00.000Z",
updatedAt: "2026-10-20T10:00:00.000Z",
status: { goal: "", done: [], pending: [], next: "" },
diff --git a/packages/cli/test/worktree.test.ts b/packages/cli/test/worktree.test.ts
index be002db..9e4d7cb 100644
--- a/packages/cli/test/worktree.test.ts
+++ b/packages/cli/test/worktree.test.ts
@@ -4,7 +4,6 @@ import { join } from "node:path";
import { beforeEach, describe, expect, it } from "vitest";
import { buildProject } from "../src/commands/build.js";
import { configSet } from "../src/commands/config.js";
-import { epochAdd } from "../src/commands/epoch.js";
import { init } from "../src/commands/init.js";
import { sessionShow, sessionWrite } from "../src/commands/session.js";
import { runHook } from "../src/hooks/run.js";
@@ -109,7 +108,7 @@ describe("commands in a worktree", () => {
const templateHtml = `<script id="${DATA_ELEMENT_ID}" type="application/json"></script>`;
const model = await buildProject({ dir: wt, io: fakeIo(env), templateHtml });
- expect(model.unassigned[0]?.worktree).toEqual({ path: wt, branch: "feature" });
+ expect(model.sessions[0]?.worktree).toEqual({ path: wt, branch: "feature" });
});
it("shows the main record, the worktree as dir and the inbox under it", async () => {
@@ -138,12 +137,6 @@ describe("commands in a worktree", () => {
});
});
- it("adds epochs to the main project", async () => {
- await epochAdd(wt, "e1", "Epoch", fakeIo(env));
- const project = await loadProject(main);
- expect(project.found && project.ok && project.data.epochs.map((e) => e.id)).toEqual(["e1"]);
- });
-
it("counts hook turns for a worktree session in the main checkout", async () => {
await configSet("updateEveryTurns", "1", fakeIo(env));
await configSet("recorder", "mixed", fakeIo(env));
diff --git a/packages/template/src/App.tsx b/packages/template/src/App.tsx
index 72df0b3..03c0134 100644
--- a/packages/template/src/App.tsx
+++ b/packages/template/src/App.tsx
@@ -8,7 +8,6 @@ import {
stepHitIndex,
} from "../../cli/src/view/search.js";
import { BackToPanel, Brand } from "./Brand.js";
-import { formatTime } from "./format.js";
import { Graph } from "./Graph.js";
import { Inbox } from "./Inbox.js";
import { type MapSearchState, SearchBox } from "./MapSearch.js";
@@ -17,9 +16,6 @@ import { SettingsButton } from "./SettingsModal.js";
import { ThemeButton } from "./ThemeButton.js";
export function App({ model }: { model: LineageViewModel }) {
- const sessionCount =
- model.epochs.reduce((sum, epoch) => sum + epoch.sessions.length, 0) + model.unassigned.length;
-
// The search state lives here because the box sits in the page head and the
// map needs the hits; `useDeferredValue` keeps typing responsive while the
// scan runs over every message and conversation.
@@ -79,12 +75,6 @@ export function App({ model }: { model: LineageViewModel }) {
<ProjectSwitcher model={model} />
<BackToPanel />
</div>
- <div className="meta">
- <span>
- {model.epochs.length} epochs · {sessionCount} sessions
- </span>
- <span className="muted">generated {formatTime(model.project.generatedAt)}</span>
- </div>
</header>
{/* Story 11.1: only this project's rows, same as the panel's inbox. */}
diff --git a/packages/template/src/GitGraph.tsx b/packages/template/src/GitGraph.tsx
index 6391610..ffba034 100644
--- a/packages/template/src/GitGraph.tsx
+++ b/packages/template/src/GitGraph.tsx
@@ -37,7 +37,6 @@ function Row({
bigChangeLines,
onSelect,
onUnfold,
- onContinue,
}: {
row: GitRow;
/** The row above is on the same day, so this one shows only the time. */
@@ -54,7 +53,6 @@ function Row({
bigChangeLines: number;
onSelect: (row: GitMessageRow) => void;
onUnfold: (segmentId: string) => void;
- onContinue: (continues: NonNullable<ViewNode["continues"]>) => void;
}) {
const style = {
top: row.y - row.height / 2,
@@ -139,18 +137,6 @@ function Row({
{formatChange(message.change)}
</span>
) : null}
- {message.continues ? (
- <span
- className="git-continues"
- title={`Open ${message.continues.sessionTitle} at ${message.continues.label ?? message.continues.id}`}
- onClick={(event: MouseEvent) => {
- event.stopPropagation();
- onContinue(message.continues as NonNullable<ViewNode["continues"]>);
- }}
- >
- ↑ {message.continues.label ?? message.continues.id}
- </span>
- ) : null}
{row.head ? <span className="left-off">left off here</span> : null}
{message.unsummarized ? <span className="unsummarized">not summarized yet</span> : null}
</button>
@@ -167,7 +153,6 @@ export function GitGraph({
bigChangeLines,
onSelect,
onUnfold,
- onContinue,
}: {
git: GitLayout;
/** Message id of the open drill-down, if it belongs to this session. */
@@ -184,8 +169,6 @@ export function GitGraph({
bigChangeLines: number;
onSelect: (row: GitMessageRow) => void;
onUnfold: (segmentId: string) => void;
- /** Opens the earlier session this message continues, at that message. */
- onContinue: (continues: NonNullable<ViewNode["continues"]>) => void;
}) {
const branches = useMemo(
() => new Map(git.segments.map((segment) => [segment.id, segment])),
@@ -280,7 +263,6 @@ export function GitGraph({
bigChangeLines={bigChangeLines}
onSelect={onSelect}
onUnfold={onUnfold}
- onContinue={onContinue}
/>
);
})}
diff --git a/packages/template/src/Graph.tsx b/packages/template/src/Graph.tsx
index 74d5513..1e5ab2e 100644
--- a/packages/template/src/Graph.tsx
+++ b/packages/template/src/Graph.tsx
@@ -105,16 +105,8 @@ function SessionMessages({
highlights: ReadonlySet<string> | undefined;
activeHitId: string | null;
}) {
- const {
- selection,
- readIds,
- bigChangeLines,
- openNode,
- openContinue,
- unfold,
- resizeRows,
- storeRowWidth,
- } = useContext(GraphActions);
+ const { selection, readIds, bigChangeLines, openNode, unfold, resizeRows, storeRowWidth } =
+ useContext(GraphActions);
const own = selection?.sessionId === session.sessionId;
if (git.rows.length === 0)
return <p className="graph-status empty">No messages recorded in this session yet.</p>;
@@ -130,7 +122,6 @@ function SessionMessages({
bigChangeLines={bigChangeLines}
onSelect={(row) => openNode(session.sessionId, row.message.id, row.segmentId)}
onUnfold={unfold}
- onContinue={(continues) => openContinue(continues.sessionId, continues.id)}
/>
<RowEdge
git={git}
@@ -232,11 +223,7 @@ function sameSet(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {
}
function findSession(model: LineageViewModel, id: string): ViewSession | undefined {
- for (const epoch of model.epochs) {
- const session = epoch.sessions.find((candidate) => candidate.sessionId === id);
- if (session) return session;
- }
- return model.unassigned.find((session) => session.sessionId === id);
+ return model.sessions.find((session) => session.sessionId === id);
}
function Flow({ model, search }: { model: LineageViewModel; search: MapSearchState }) {
@@ -361,14 +348,7 @@ function Flow({ model, search }: { model: LineageViewModel; search: MapSearchSta
},
[model.project.path],
);
- const unread = useMemo(
- () =>
- unreadViewMessages(
- [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned],
- readIds,
- ),
- [model, readIds],
- );
+ const unread = useMemo(() => unreadViewMessages(model.sessions, readIds), [model, readIds]);
const unreadBig = useMemo(
() =>
unread.filter((message) => message.change.added + message.change.removed >= bigChangeLines),
diff --git a/packages/template/src/Outline.tsx b/packages/template/src/Outline.tsx
index 662de53..120c02b 100644
--- a/packages/template/src/Outline.tsx
+++ b/packages/template/src/Outline.tsx
@@ -1,56 +1,34 @@
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useState } from "react";
import type { LineageViewModel, ViewSession } from "../../cli/src/view/model.js";
import { kindLabel } from "./format.js";
-import { epochId, nodeId, sessionId, UNASSIGNED_EPOCH_ID } from "./graph.js";
+import { nodeId, sessionId } from "./graph.js";
import type { Selection } from "./SidePanel.js";
/**
- * Experimental outline tree (epoch → session → messages) that sits next to the
- * map. Selecting a row opens its session's message graph (or goes back to the
- * session graph for an epoch) and opens the same drill-down a map click would.
+ * Outline tree (session → messages) that sits next to the map, sessions in the
+ * map's start order. Selecting a row opens its session's message graph and the
+ * same drill-down a map click would.
*/
export interface OutlineTarget {
/** The session to open; null returns the map to the session level. */
sessionId: string | null;
- /** Highlight key: `epoch:…`, `session:…` or `node:…`. */
+ /** Highlight key: `session:…` or `node:…`. */
focusId: string;
- /** Drill-down content; `null` for epochs. */
+ /** Drill-down content. */
selection: Selection | null;
}
-interface Group {
- id: string;
- title: string;
- sessions: ViewSession[];
-}
-
-function groups(model: LineageViewModel): Group[] {
- const result: Group[] = model.epochs.map((epoch) => ({
- id: epochId(epoch.id),
- title: epoch.title,
- sessions: epoch.sessions,
- }));
- if (model.unassigned.length > 0) {
- result.push({ id: UNASSIGNED_EPOCH_ID, title: "Unassigned", sessions: model.unassigned });
- }
- return result;
-}
-
/**
- * Ancestor chain of an outline item, including the item itself: the epoch for a
- * session, the epoch and session for a message. `null` when the id does not
- * belong to this model.
+ * Chain of an outline item, the item itself last: a session alone, or the
+ * session and then the message. `null` when the id does not belong to this model.
*/
export function outlinePath(model: LineageViewModel, targetId: string): string[] | null {
- for (const group of groups(model)) {
- if (group.id === targetId) return [group.id];
- for (const session of group.sessions) {
- const key = sessionId(session.sessionId);
- if (key === targetId) return [group.id];
- if (session.messages.some((message) => nodeId(key, message.id) === targetId)) {
- return [group.id, key];
- }
+ for (const session of model.sessions) {
+ const key = sessionId(session.sessionId);
+ if (key === targetId) return [key];
+ if (session.messages.some((message) => nodeId(key, message.id) === targetId)) {
+ return [key, targetId];
}
}
return null;
@@ -171,12 +149,8 @@ export function Outline({
onSelect: (target: OutlineTarget) => void;
onClose: () => void;
}) {
- const allGroups = useMemo(() => groups(model), [model]);
- // Epochs start open so the tree lists every session; sessions close their
- // messages until asked, mirroring the map's collapsed default.
- const [expanded, setExpanded] = useState<Set<string>>(
- () => new Set(allGroups.map((group) => group.id)),
- );
+ // Sessions close their messages until asked, mirroring the map's collapsed default.
+ const [expanded, setExpanded] = useState<Set<string>>(() => new Set());
// Map clicks drive the highlight too; reveal the row when it is nested.
useEffect(() => {
@@ -217,53 +191,20 @@ export function Outline({
</button>
</header>
<div className="outline-scroll">
- {allGroups.length === 0 ? (
+ {model.sessions.length === 0 ? (
<p className="empty">No sessions recorded yet.</p>
) : (
<ul className="outline-list">
- {allGroups.map((group) => {
- const open = expanded.has(group.id) && group.sessions.length > 0;
- return (
- <li key={group.id}>
- <div className="outline-row">
- <ExpandToggle
- id={group.id}
- hasChildren={group.sessions.length > 0}
- expanded={expanded.has(group.id)}
- onToggle={toggle}
- />
- <button
- type="button"
- className={`outline-item${activeId === group.id ? " is-active" : ""}`}
- onClick={() =>
- onSelect({
- sessionId: null,
- focusId: group.id,
- selection: null,
- })
- }
- >
- <span className="label">{group.title}</span>
- <span className="outline-count">{group.sessions.length}</span>
- </button>
- </div>
- {open ? (
- <ul>
- {group.sessions.map((session) => (
- <SessionRow
- key={session.sessionId}
- session={session}
- activeId={activeId}
- expanded={expanded}
- onToggle={toggle}
- onSelect={onSelect}
- />
- ))}
- </ul>
- ) : null}
- </li>
- );
- })}
+ {model.sessions.map((session) => (
+ <SessionRow
+ key={session.sessionId}
+ session={session}
+ activeId={activeId}
+ expanded={expanded}
+ onToggle={toggle}
+ onSelect={onSelect}
+ />
+ ))}
</ul>
)}
</div>
diff --git a/packages/template/src/SidePanel.tsx b/packages/template/src/SidePanel.tsx
index 1fc7a3c..1d94bea 100644
--- a/packages/template/src/SidePanel.tsx
+++ b/packages/template/src/SidePanel.tsx
@@ -35,12 +35,7 @@ export type Selection =
| { type: "session"; sessionId: string };
function findSession(model: LineageViewModel, sessionId: string): ViewSession | undefined {
- for (const epoch of model.epochs) {
- for (const session of epoch.sessions) {
- if (session.sessionId === sessionId) return session;
- }
- }
- return model.unassigned.find((session) => session.sessionId === sessionId);
+ return model.sessions.find((session) => session.sessionId === sessionId);
}
function findMessage(session: ViewSession, id: string): ViewNode | undefined {
diff --git a/packages/template/src/fixture.ts b/packages/template/src/fixture.ts
index 970d3d3..d1f6a95 100644
--- a/packages/template/src/fixture.ts
+++ b/packages/template/src/fixture.ts
@@ -11,7 +11,6 @@ const message = (
const session = (
sessionId: string,
title: string,
- epoch: string | null,
startedAt: string,
updatedAt: string,
messages: ViewNode[],
@@ -20,7 +19,6 @@ const session = (
sessionId,
agent: "claude-code",
title,
- epoch,
startedAt,
updatedAt,
status,
@@ -30,7 +28,7 @@ const session = (
/**
* Dev-only sample data (`npm run dev -w template`). Mirrors the shape `cogit
- * build` produces: two epochs, three sessions (one unassigned), a branch that
+ * build` produces: three sessions in start order, a branch that
* folds, a return link and an unrecorded message at the end of a chain.
*/
export const fixture: LineageViewModel = {
@@ -68,130 +66,111 @@ export const fixture: LineageViewModel = {
agents: ["claude-code"],
bigChangeLines: 300,
},
- epochs: [
- {
- id: "map",
- title: "Project map",
- createdAt: "2026-10-19T09:00:00.000Z",
- sessions: [
- session(
- "fixture-template",
- "Template package and single-file output",
- "map",
- "2026-10-24T08:00:00.000Z",
- "2026-10-24T11:42:00.000Z",
- [
- message("m1", "Scaffold the template package", null, "2026-10-24T09:00:00.000Z", {
- summary: "React 19 + Vite 8, one index.html at build time.",
- branch: {
- title: "Template scaffold",
- asked: "Which build setup keeps the page one file?",
- outcome: "Vite + vite-plugin-singlefile; the data is embedded as JSON.",
- open: "",
- },
- }),
- message("m2", "Wire the data contract", "m1", "2026-10-24T09:12:00.000Z", {
- summary: "The page reads the JSON script element and types it once.",
- work: ["Added view/model.ts shared by CLI and template"],
- files: ["packages/cli/src/view/model.ts", "packages/cli/src/view/lineage.ts"],
- }),
- message("m3", "Read data from the DOM", "m2", "2026-10-24T09:20:00.000Z", {
- summary: "A fetch would break file://; the JSON element survives inlining.",
- decidedBy: "agent",
- alternatives: [{ option: "fetch the JSON", why: "breaks over file://" }],
- }),
- message("m4", "Build the dev fixture", "m3", "2026-10-24T09:41:00.000Z", {
- summary: "Two epochs, three sessions, one unassigned.",
- commits: ["1a2b3c4", "9f8e7d6"],
- commitTags: [
- { hash: "1a2b3c4", subject: "feat(template): add the dev fixture" },
- { hash: "9f8e7d6" },
- ],
- files: ["packages/template/src/fixture.ts"],
- }),
- message("m5", "Check the page in the browser", "m4", "2026-10-24T10:02:00.000Z", {
- summary: "Layout measured; console clean.",
- }),
- message("m6", "Draw nested groups", "m4", "2026-10-24T10:20:00.000Z", {
- summary: "A second branch off the fixture work.",
- files: ["packages/template/src/Graph.tsx"],
- branch: {
- title: "Nested groups",
- asked: "How do epochs, sessions and messages nest?",
- outcome: "Groups around the git rows.",
- open: "",
- },
- }),
- message("m7", "Return to the data contract", "m6", "2026-10-24T10:35:00.000Z", {
- summary: "The contract needed one more field for the pending count.",
- links: ["m2"],
- }),
- message("m8", "Ship the map", "m7", "2026-10-24T11:10:00.000Z", {
- summary: "Build, open and verify.",
- }),
- message("m9", "Lineage graph idea", null, "2026-10-24T11:42:00.000Z", {
- summary: "A git graph of the user's messages.",
- files: ["packages/cli/src/view/files.ts"],
- branch: {
- title: "Git graph",
- asked: "What if the map read like a git history?",
- outcome: "",
- open: "Not built yet.",
- },
- }),
+ sessions: [
+ session(
+ "fixture-template",
+ "Template package and single-file output",
+ "2026-10-24T08:00:00.000Z",
+ "2026-10-24T11:42:00.000Z",
+ [
+ message("m1", "Scaffold the template package", null, "2026-10-24T09:00:00.000Z", {
+ summary: "React 19 + Vite 8, one index.html at build time.",
+ branch: {
+ title: "Template scaffold",
+ asked: "Which build setup keeps the page one file?",
+ outcome: "Vite + vite-plugin-singlefile; the data is embedded as JSON.",
+ open: "",
+ },
+ }),
+ message("m2", "Wire the data contract", "m1", "2026-10-24T09:12:00.000Z", {
+ summary: "The page reads the JSON script element and types it once.",
+ work: ["Added view/model.ts shared by CLI and template"],
+ files: ["packages/cli/src/view/model.ts", "packages/cli/src/view/lineage.ts"],
+ }),
+ message("m3", "Read data from the DOM", "m2", "2026-10-24T09:20:00.000Z", {
+ summary: "A fetch would break file://; the JSON element survives inlining.",
+ decidedBy: "agent",
+ alternatives: [{ option: "fetch the JSON", why: "breaks over file://" }],
+ }),
+ message("m4", "Build the dev fixture", "m3", "2026-10-24T09:41:00.000Z", {
+ summary: "Three sessions in start order.",
+ commits: ["1a2b3c4", "9f8e7d6"],
+ commitTags: [
+ { hash: "1a2b3c4", subject: "feat(template): add the dev fixture" },
+ { hash: "9f8e7d6" },
],
- {
- goal: "Render a typed fixture through the template.",
- done: ["Scaffold Vite + React", "Add the fixture"],
- pending: [{ text: "Confirm the graph layout", needsUser: true }],
- next: "Check the page in the browser.",
+ files: ["packages/template/src/fixture.ts"],
+ }),
+ message("m5", "Check the page in the browser", "m4", "2026-10-24T10:02:00.000Z", {
+ summary: "Layout measured; console clean.",
+ }),
+ message("m6", "Draw nested groups", "m4", "2026-10-24T10:20:00.000Z", {
+ summary: "A second branch off the fixture work.",
+ files: ["packages/template/src/Graph.tsx"],
+ branch: {
+ title: "Nested groups",
+ asked: "How do sessions and messages nest?",
+ outcome: "Groups around the git rows.",
+ open: "",
+ },
+ }),
+ message("m7", "Return to the data contract", "m6", "2026-10-24T10:35:00.000Z", {
+ summary: "The contract needed one more field for the pending count.",
+ links: ["m2"],
+ }),
+ message("m8", "Ship the map", "m7", "2026-10-24T11:10:00.000Z", {
+ summary: "Build, open and verify.",
+ }),
+ message("m9", "Lineage graph idea", null, "2026-10-24T11:42:00.000Z", {
+ summary: "A git graph of the user's messages.",
+ files: ["packages/cli/src/view/files.ts"],
+ branch: {
+ title: "Git graph",
+ asked: "What if the map read like a git history?",
+ outcome: "",
+ open: "Not built yet.",
},
- ),
+ }),
],
- },
- {
- id: "capture",
- title: "Capture pipeline",
- createdAt: "2026-10-20T10:00:00.000Z",
- sessions: [
- session(
- "fixture-capture",
- "Session merge and redaction",
- "capture",
- "2026-10-20T09:00:00.000Z",
- "2026-10-20T16:30:00.000Z",
- [
- message("c1", "Harden session writes", null, "2026-10-20T09:00:00.000Z", {
- summary: "Locked read → merge → write with redaction.",
- files: ["packages/cli/src/store/stores.ts"],
- branch: {
- title: "Safe writes",
- asked: "How do two turns write the same session?",
- outcome: "A per-session lock, then merge and redact.",
- open: "",
- },
- }),
- message("c2", "Keep parents optional on input", "c1", "2026-10-20T09:30:00.000Z", {
- why: "The agent can add a child without re-sending the whole tree.",
- decidedBy: "agreed",
- }),
- message("c3", "Add the turn counter", "c2", "2026-10-20T16:30:00.000Z"),
- ],
- {
- goal: "Make session writes safe under concurrency.",
- done: ["Per-session lock", "redactDeep"],
- pending: [],
- next: "Add the turn counter.",
+ {
+ goal: "Render a typed fixture through the template.",
+ done: ["Scaffold Vite + React", "Add the fixture"],
+ pending: [{ text: "Confirm the graph layout", needsUser: true }],
+ next: "Check the page in the browser.",
+ },
+ ),
+ session(
+ "fixture-capture",
+ "Session merge and redaction",
+ "2026-10-20T09:00:00.000Z",
+ "2026-10-20T16:30:00.000Z",
+ [
+ message("c1", "Harden session writes", null, "2026-10-20T09:00:00.000Z", {
+ summary: "Locked read → merge → write with redaction.",
+ files: ["packages/cli/src/store/stores.ts"],
+ branch: {
+ title: "Safe writes",
+ asked: "How do two turns write the same session?",
+ outcome: "A per-session lock, then merge and redact.",
+ open: "",
},
- ),
+ }),
+ message("c2", "Keep parents optional on input", "c1", "2026-10-20T09:30:00.000Z", {
+ why: "The agent can add a child without re-sending the whole tree.",
+ decidedBy: "agreed",
+ }),
+ message("c3", "Add the turn counter", "c2", "2026-10-20T16:30:00.000Z"),
],
- },
- ],
- unassigned: [
+ {
+ goal: "Make session writes safe under concurrency.",
+ done: ["Per-session lock", "redactDeep"],
+ pending: [],
+ next: "Add the turn counter.",
+ },
+ ),
session(
"fixture-unassigned",
"Scratch notes on status cards",
- null,
"2026-10-19T16:00:00.000Z",
"2026-10-19T18:00:00.000Z",
[
@@ -210,7 +189,7 @@ export const fixture: LineageViewModel = {
next: "Ask before implementing.",
},
),
- ],
+ ].sort((a, b) => a.startedAt.localeCompare(b.startedAt)),
// Story 8.15: the files view, as `build` unions message files and commit files.
files: [
{
diff --git a/packages/template/src/gitLayout.ts b/packages/template/src/gitLayout.ts
index ea84c5c..a5dd0ff 100644
--- a/packages/template/src/gitLayout.ts
+++ b/packages/template/src/gitLayout.ts
@@ -261,9 +261,7 @@ export function rowHeight(
(message.label ?? message.id).length * 7 +
Math.min(row.tags, TAGS_PER_LINE) * TAG_WIDTH +
(row.head ? 92 : 0) +
- (message.unsummarized ? 116 : 0) +
- // The "↑ m67" mark sits in the row, next to the title; its session is in the tooltip.
- (message.continues ? 34 + (message.continues.label ?? message.continues.id).length * 7 : 0);
+ (message.unsummarized ? 116 : 0);
const room = Math.max(TITLE_MIN_WIDTH, rowWidth - fixed);
const titleLines = Math.max(1, Math.ceil((message.title.length * TITLE_CHAR) / room));
const tagLines = Math.ceil(row.tags / TAGS_PER_LINE);
diff --git a/packages/template/src/graph.ts b/packages/template/src/graph.ts
index 1c4916f..b9ff823 100644
--- a/packages/template/src/graph.ts
+++ b/packages/template/src/graph.ts
@@ -50,7 +50,7 @@ function time(value: string): number {
}
function latestSession(model: LineageViewModel): ViewSession | undefined {
- const all = [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned];
+ const all = model.sessions;
return all.sort(
(a, b) => time(b.updatedAt) - time(a.updatedAt) || a.sessionId.localeCompare(b.sessionId),
)[0];
@@ -64,7 +64,7 @@ function latestSession(model: LineageViewModel): ViewSession | undefined {
*/
export function headOf(model: LineageViewModel): Head | null {
let best: { sessionId: string; messageId: string; at: number } | null = null;
- for (const session of [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned]) {
+ for (const session of model.sessions) {
for (const message of session.messages) {
const at = time(message.at ?? "");
if (at === Number.NEGATIVE_INFINITY) continue;
@@ -96,14 +96,6 @@ export function shortHash(id: string): string {
return isMessageHash(id) ? id.slice(0, 8) : id;
}
-/** Outline group key of an epoch; epochs are only tags on the map now. */
-export function epochId(id: string): string {
- return `epoch:${id}`;
-}
-
-/** Outline group key for sessions with no epoch (or an unknown one). */
-export const UNASSIGNED_EPOCH_ID = "unassigned";
-
/**
* Node ids are flat per session: the outline and the map agree on the same id
* when the outline highlights a message.
diff --git a/packages/template/src/sessionLayout.ts b/packages/template/src/sessionLayout.ts
index b317e8f..c4a7c20 100644
--- a/packages/template/src/sessionLayout.ts
+++ b/packages/template/src/sessionLayout.ts
@@ -7,7 +7,7 @@ import { headOf } from "./graph.js";
* graph, laid out by the same engine as a session's messages. A session's
* parent is the session its first message continues (8.6), so a new chat that
* picks up earlier work grows out of that earlier session; everything else is a
- * root. Epochs are not boxes any more, just tags on the dots.
+ * root.
*/
/** Wider than a message row: a session row carries a title, a count and a tag. */
@@ -45,9 +45,9 @@ export function sessionParentOf(session: ViewSession, known: ReadonlySet<string>
return known.has(other) ? other : null;
}
-/** Every session of the map in start order, across epochs and unassigned. */
+/** Every session of the map in start order. */
export function allSessions(model: LineageViewModel): ViewSession[] {
- const all = [...model.epochs.flatMap((epoch) => epoch.sessions), ...model.unassigned];
+ const all = model.sessions;
return all.sort(
(a, b) => time(a.startedAt) - time(b.startedAt) || a.sessionId.localeCompare(b.sessionId),
);
diff --git a/packages/template/src/styles.css b/packages/template/src/styles.css
index f6b2edb..e56f4a9 100644
--- a/packages/template/src/styles.css
+++ b/packages/template/src/styles.css
@@ -311,6 +311,7 @@ main.map-page {
.page-title .muted {
margin: 2px 0 0;
+ font-size: 11px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
diff --git a/packages/template/test/graph.test.ts b/packages/template/test/graph.test.ts
index 92a99f3..3b3f249 100644
--- a/packages/template/test/graph.test.ts
+++ b/packages/template/test/graph.test.ts
@@ -21,27 +21,18 @@ const model: LineageViewModel = {
schema: 1,
project: { name: "p", path: "/tmp/p", generatedAt: AT },
status: { goal: "", done: [], pending: [], next: "", lastActivity: null },
- epochs: [
+ sessions: [
{
- id: "e1",
- title: "Epoch one",
- createdAt: AT,
- sessions: [
- {
- sessionId: "s1",
- agent: "claude-code",
- title: "One",
- epoch: "e1",
- startedAt: AT,
- updatedAt: AT,
- status: { goal: "", done: [], pending: [], next: "" },
- messages: [message("m1"), message("m2", "2026-10-21T10:01:00.000Z", "m1")],
- transcriptAvailable: true,
- },
- ],
+ sessionId: "s1",
+ agent: "claude-code",
+ title: "One",
+ startedAt: AT,
+ updatedAt: AT,
+ status: { goal: "", done: [], pending: [], next: "" },
+ messages: [message("m1"), message("m2", "2026-10-21T10:01:00.000Z", "m1")],
+ transcriptAvailable: true,
},
],
- unassigned: [],
};
describe("headOf", () => {
@@ -52,23 +43,19 @@ describe("headOf", () => {
it("has no message for a session without any, and is null for an empty map", () => {
const empty: LineageViewModel = {
...model,
- epochs: [
- {
- ...model.epochs[0]!,
- sessions: [{ ...model.epochs[0]!.sessions[0]!, messages: [] }],
- },
- ],
+ sessions: [{ ...model.sessions[0]!, messages: [] }],
};
expect(headOf(empty)).toEqual({ sessionId: "s1", messageId: null });
- expect(headOf({ ...model, epochs: [], unassigned: [] })).toBeNull();
+ expect(headOf({ ...model, sessions: [] })).toBeNull();
});
it("follows the newest message, not the most recently updated record", () => {
const fixedLater: LineageViewModel = {
...model,
- unassigned: [
+ sessions: [
+ ...model.sessions,
{
- ...model.epochs[0]!.sessions[0]!,
+ ...model.sessions[0]!,
sessionId: "u1",
// Its record was touched last (say, an old pending item was fixed),
// but its message is older than s1's newest one.
@@ -81,8 +68,9 @@ describe("headOf", () => {
const newerMessage: LineageViewModel = {
...fixedLater,
- unassigned: [
- { ...fixedLater.unassigned[0]!, messages: [message("m9", "2026-10-22T00:00:00.000Z")] },
+ sessions: [
+ ...model.sessions,
+ { ...fixedLater.sessions[1]!, messages: [message("m9", "2026-10-22T00:00:00.000Z")] },
],
};
expect(headOf(newerMessage)).toEqual({ sessionId: "u1", messageId: "m9" });
@@ -91,15 +79,10 @@ describe("headOf", () => {
it("falls back to the most recently updated session when messages carry no time", () => {
const untimed: LineageViewModel = {
...model,
- epochs: [
+ sessions: [
{
- ...model.epochs[0]!,
- sessions: [
- {
- ...model.epochs[0]!.sessions[0]!,
- messages: [{ id: "m1", kind: "message", title: "m1", parent: null }],
- },
- ],
+ ...model.sessions[0]!,
+ messages: [{ id: "m1", kind: "message", title: "m1", parent: null }],
},
],
};
diff --git a/packages/template/test/outline.test.ts b/packages/template/test/outline.test.ts
index ff49494..8bc01e9 100644
--- a/packages/template/test/outline.test.ts
+++ b/packages/template/test/outline.test.ts
@@ -8,12 +8,11 @@ function message(id: string, at = AT, parent: string | null = null): ViewNode {
return { id, kind: "message", title: id, at, parent };
}
-function session(id: string, epoch: string | null, messages: ViewNode[]): ViewSession {
+function session(id: string, messages: ViewNode[]): ViewSession {
return {
sessionId: id,
agent: "claude-code",
title: id,
- epoch,
startedAt: AT,
updatedAt: AT,
status: { goal: "", done: [], pending: [], next: "" },
@@ -27,34 +26,20 @@ const model: LineageViewModel = {
schema: 1,
project: { name: "p", path: "/tmp/p", generatedAt: AT },
status: { goal: "", done: [], pending: [], next: "", lastActivity: null },
- epochs: [
- {
- id: "e1",
- title: "Epoch one",
- createdAt: AT,
- sessions: [
- session("s1", "e1", [message("m1"), message("m2", "2026-10-21T10:01:00.000Z", "m1")]),
- ],
- },
+ sessions: [
+ session("s1", [message("m1"), message("m2", "2026-10-21T10:01:00.000Z", "m1")]),
+ session("u1", []),
],
- unassigned: [session("u1", null, [])],
};
describe("outlinePath", () => {
- it("returns the epoch for an epoch row", () => {
- expect(outlinePath(model, "epoch:e1")).toEqual(["epoch:e1"]);
+ it("returns a session row alone", () => {
+ expect(outlinePath(model, "session:s1")).toEqual(["session:s1"]);
+ expect(outlinePath(model, "session:u1")).toEqual(["session:u1"]);
});
- it("returns the owning epoch for a session row", () => {
- expect(outlinePath(model, "session:s1")).toEqual(["epoch:e1"]);
- });
-
- it("returns the epoch and session for a message row", () => {
- expect(outlinePath(model, "node:session:s1:m2")).toEqual(["epoch:e1", "session:s1"]);
- });
-
- it("places unassigned sessions under the unassigned group", () => {
- expect(outlinePath(model, "session:u1")).toEqual(["unassigned"]);
+ it("returns the session and then the message for a message row", () => {
+ expect(outlinePath(model, "node:session:s1:m2")).toEqual(["session:s1", "node:session:s1:m2"]);
});
it("returns null for an id outside the model", () => {
diff --git a/packages/template/test/session-git.test.ts b/packages/template/test/session-git.test.ts
index 4deb2a6..2c12262 100644
--- a/packages/template/test/session-git.test.ts
+++ b/packages/template/test/session-git.test.ts
@@ -13,7 +13,6 @@ const session: ViewSession = {
agent: "claude-code",
title: "Session one",
author: "Eren",
- epoch: "e1",
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -28,8 +27,7 @@ function modelOf(current: ViewSession): LineageViewModel {
schema: 1,
project: { name: "p", path: "/p", generatedAt: T0 },
status: { goal: "", done: [], pending: [], next: "", lastActivity: T0 },
- epochs: [{ id: "e1", title: "E", createdAt: T0, sessions: [current] }],
- unassigned: [],
+ sessions: [current],
};
}
@@ -50,9 +48,12 @@ describe("Story 9.3 on the map", () => {
expect(render(modelOf(session))).not.toContain("session-author");
const two = modelOf(session);
- two.unassigned = [
- { ...session, sessionId: "s2", author: "Ada", startedAt: "2026-10-26T11:00:00.000Z" },
- ];
+ two.sessions.push({
+ ...session,
+ sessionId: "s2",
+ author: "Ada",
+ startedAt: "2026-10-26T11:00:00.000Z",
+ });
const html = render(two);
expect(html).toContain('class="muted session-author"');
expect(html).toContain("Eren");
diff --git a/packages/template/test/sessionLayout.test.ts b/packages/template/test/sessionLayout.test.ts
index 24735d9..aefa43c 100644
--- a/packages/template/test/sessionLayout.test.ts
+++ b/packages/template/test/sessionLayout.test.ts
@@ -32,7 +32,6 @@ function session(
sessionId,
agent: "claude-code",
title: `Session ${sessionId}`,
- epoch: "e1",
startedAt: at(startedAt),
updatedAt: at(updatedAt),
status: { goal: "", done: [], pending: [], next: "" },
@@ -59,8 +58,7 @@ function modelOf(sessions: ViewSession[]): LineageViewModel {
schema: 1,
project: { name: "p", path: "/tmp/p", generatedAt: at(0) },
status: { goal: "", done: [], pending: [], next: "", lastActivity: null },
- epochs: [{ id: "e1", title: "Epoch one", createdAt: at(0), sessions }],
- unassigned: [],
+ sessions: [...sessions],
};
}
@@ -79,9 +77,9 @@ describe("sessionParentOf", () => {
});
describe("layoutSessionGraph", () => {
- it("lists every session in start order across epochs and unassigned", () => {
+ it("lists every session in start order", () => {
const model = modelOf([session("late", 60, 120), session("early", 0, 30)]);
- model.unassigned = [session("scratch", 30, 40)];
+ model.sessions.push(session("scratch", 30, 40));
expect(allSessions(model).map((session) => session.sessionId)).toEqual([
"early",
"scratch",
diff --git a/packages/template/test/unread.test.ts b/packages/template/test/unread.test.ts
index b1598fb..0a3444f 100644
--- a/packages/template/test/unread.test.ts
+++ b/packages/template/test/unread.test.ts
@@ -34,7 +34,6 @@ const session: ViewSession = {
sessionId: "s1",
agent: "claude-code",
title: "Session one",
- epoch: null,
startedAt: T0,
updatedAt: T0,
status: { goal: "", done: [], pending: [], next: "" },
@@ -52,8 +51,7 @@ function modelOf(current: ViewSession): LineageViewModel {
schema: 1,
project: { name: "p", path: "/p", generatedAt: T0 },
status: { goal: "", done: [], pending: [], next: "", lastActivity: T0 },
- epochs: [{ id: "e1", title: "E", createdAt: T0, sessions: [current] }],
- unassigned: [],
+ sessions: [current],
read: [],
settings: {
recorder: "mixed",