Skip to content

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 UserData shape
    • hydration and backfill rules
    • default data generation
    • workspace, KB, and agent reconstruction side effects
  • 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
  • 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.ts
  • ciq-mvp2-app/src/constants/defaults.ts
  • ciq-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
  • docs/api/user-data.md
  • docs/api/setup-status.md
  • docs/api/live-agents.md
  • docs/architecture/runtime-state.md
  • docs/architecture/provider-graph.md
  • docs/architecture/persistence-model.md
  • docs/ops/environment-and-secrets.md

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.