session kind: ChatRecord.kind teach|practice (absent = teach)
Practice sessions (owner, 2026-10-04): the marker rides the record and
the normalized summary (absent field reads as teach — pre-practice
records never migrate); POST /api/chats accepts {kind: 'practice'}.
The agent branch, tools, and UI land in the following slices.
This commit is contained in:
@@ -21,12 +21,20 @@ import type { EmissionStats } from "./graph.ts";
|
||||
* is the client's own grouping fold (core/view.ts, Wave D) — a pending quiz
|
||||
* is an unanswered question tool call, which is exactly what makes
|
||||
* resume-mid-question free. */
|
||||
/** The session's kind (practice sessions, owner 2026-10-04): "teach" is
|
||||
* the default and ABSENT on pre-practice records (no migration — absence
|
||||
* reads as teach); "practice" marks an adaptive-practice session — the
|
||||
* practice agent, its two tools, no extraction, no graph writes. */
|
||||
export type ChatKind = "teach" | "practice";
|
||||
|
||||
export interface ChatRecord {
|
||||
id: string;
|
||||
title: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
messages: LhMessage[];
|
||||
/** The session's kind — absent = teach (pre-practice records). */
|
||||
kind?: ChatKind;
|
||||
/** The session's plan tree (vision §2) — written by plan tools via saveTree. */
|
||||
tree?: PlanTree;
|
||||
/** Append-only usage log (observability, 2026-09): one entry per model
|
||||
@@ -202,6 +210,8 @@ export interface ChatSummary {
|
||||
title: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
/** Normalized kind (absent record field reads as teach). */
|
||||
kind: ChatKind;
|
||||
messageCount: number;
|
||||
/** The session's current phase, derived from the stored plan tree. */
|
||||
phase: Phase3;
|
||||
|
||||
+3
-1
@@ -32,7 +32,9 @@ import type { UserSettings } from "./settings.ts";
|
||||
|
||||
export interface ChatStore {
|
||||
/** Create a session record (persisted immediately). */
|
||||
createChat(title: string): ChatRecord;
|
||||
/** Create a session record; kind "practice" marks a practice session
|
||||
* (absent = teach, the default). */
|
||||
createChat(title: string, kind?: "practice"): ChatRecord;
|
||||
/** The full record, or null if unknown id / corrupt file. */
|
||||
getChat(id: string): ChatRecord | null;
|
||||
/** All sessions, newest activity first (the sidebar's list view). */
|
||||
|
||||
Reference in New Issue
Block a user