Skip to content

emptyState

emptyState(projectName?): object

Defined in: types/src/state.ts:107

string = 'unnamed'

activeDraft: string | null

activePhase: string | null

activeSpec: string | null

Active <id>-SPEC.md while loopPosition==='SPEC'; null otherwise.

activeTask: { id: string; status: "PENDING" | "IN_PROGRESS" | "DONE" | "DONE_WITH_CONCERNS" | "NEEDS_CONTEXT" | "BLOCKED"; touchedFiles: string[]; } | null

decisions: object[]

deferred: object[]

draftReadAt: string | null

ISO8601 timestamp of the most recent successful cadence draft approve. The DRAFT-read mtime gate (Phase 23.1) refuses settle when the DRAFT.md file’s mtime is newer than this — the human edited the draft after approving. null means no approve has happened yet (gate silently passes).

loopPosition: "SPEC" | "DRAFT" | "BUILD" | "SETTLE" | "IDLE" = LoopPositionZ

openDrafts: object[]

project: object

createdAt: string

name: string

revision: number

Optimistic-concurrency counter (Phase 173). Bumped by exactly 1 on every successful SimpleStateBackend.commit(). A caller’s in-memory state carries the revision it was read at; commit() refuses when the on-disk revision has since moved, rather than silently overwriting a concurrent writer’s change. .default(0) keeps pre-Phase-173 state.json files parsing unchanged.

schemaVersion: 1

session: object

lastHandoff: string | null

subagentBaselines: Record<string, { startedAt: string; taskStatuses: Record<string, string>; touchedFiles: string[]; }>

Per-subagent baseline snapshot (subagent task-redundancy monitoring). Keyed by the Claude Code agentId from the SubagentStart hook. taskStatuses is a snapshot of every DRAFT task’s status at the moment this subagent began (baseline-at-start, not current-at-stop — fairer to the subagent; see the design doc’s “SubagentStop: safety net” section). touchedFiles accumulates via PostToolUse for the duration of this subagent’s run. Entries are ephemeral — created at SubagentStart, deleted at the matching SubagentStop; an orphaned entry from a crash/interrupt is harmless (never compared against again).

subagentSpawns: number

tokenUtilization: number

skillAudit: object

invoked: string[]

required: string[]

tier: "standard" | "complex" | "quick-fix" | null