Skip to content

emptyState

emptyState(projectName?): object

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

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[]

optional provenance?: object[]

Phase 291 (291-01, T1): per-requirement provenance for required above — one entry per (skill, source) pair, where source is 'config', 'draft', or `pack:<id>`. required stays the deduped, enforcement-facing union; this array is deliberately NOT deduped across sources, so a skill demanded by both config and a pack yields two entries rather than one collapsed row that hides who demanded it. Absent on every pre-phase-291 record.

MUST stay .optional() with NO .default(...), mirroring SummaryZ.coverageScheme/GateProvenanceZ.providerSelection (phase 239/263 precedent): this same shape is mirrored onto SummaryZ.skillAudit, and cadence summary verify Zod-parses a SUMMARY and then content-hashes the PARSED object (core/src/services/summary-hash.ts), so a default here would be injected into every historical SUMMARY at parse time, change its digest, and falsely report every past settle as tampered. core/tests/summary-skill-audit-provenance-schema.test.ts fails if a default is added. Kept inline (not a named/exported schema) on purpose — the shape has exactly one consumer pair and needs no public name.

required: string[]

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