Runtime Contracts Backlog
This backlog captures the implementation-backed runtime surfaces that still need canonical documentation before the docs hub can fully support rebuilding the product from scratch.
Priority 1: Persistence and server contracts
Section titled “Priority 1: Persistence and server contracts”ciq-mvp2-app/src/server/user-store.ts- persisted
UserDatashape - hydration and backfill rules
- default data generation
- workspace, KB, and agent reconstruction side effects
- persisted
ciq-mvp2-app/src/app/api/user-data/route.ts- request and response contracts
- mutation union types
- auth assumptions
ciq-mvp2-app/src/app/api/setup-status/route.ts- setup lifecycle contract
- onboarding computation rules
- connection mutation semantics
Priority 2: Runtime state architecture
Section titled “Priority 2: Runtime state architecture”ciq-mvp2-app/src/components/providers.tsx- provider graph
- local-to-server migration behavior
ciq-mvp2-app/src/contexts/workspaces-context.tsx- workspace, KB, and group ownership
- load and persist triggers
ciq-mvp2-app/src/contexts/channels-context.tsx- setup-status loading
- connection persistence split
- label normalization and side effects
ciq-mvp2-app/src/contexts/agents-context.tsx- live-agents API behavior
- fallback semantics
- agent validation and status rules
Priority 3: Auth and environment boundaries
Section titled “Priority 3: Auth and environment boundaries”ciq-mvp2-app/src/lib/client-session.ts- session cookie/local storage relationship
ciq-mvp2-app/src/server/auth-guard.ts- protected route gating
ciq-mvp2-app/src/lib/live-agents-api.ts- external service contract
- environment variable requirements
- normalization behavior
Priority 4: Seed and default system behavior
Section titled “Priority 4: Seed and default system behavior”ciq-mvp2-app/src/app/account/workspaces/_data/seed.tsciq-mvp2-app/src/constants/defaults.tsciq-mvp2-app/src/types/*.ts
Document:
- canonical IDs and default entities
- mock data assumptions vs runtime-persisted data
- which types are source contracts vs UI convenience types
Recommended destination docs
Section titled “Recommended destination docs”docs/api/user-data.mddocs/api/setup-status.mddocs/api/live-agents.mddocs/architecture/runtime-state.mddocs/architecture/provider-graph.mddocs/architecture/persistence-model.mddocs/ops/environment-and-secrets.md
Definition of done
Section titled “Definition of done”This backlog is complete when an implementer can recreate the runtime architecture, persistence model, and API behavior from docs alone without reading the source files above.