Skip to content

native: ClaudiaKit models — Codable protocol types + backend-generated fixtures #143

Description

@itomek

Part of #125. Blocked by the scaffold and the conversation/prompt protocol issues.

Problem

Swift needs Codable mirrors of the wire protocol (tasks, workspaces, WS envelope, conversation events, prompts). Hand-mirroring drifts silently unless fixtures pin it.

Outcome

ClaudiaKit model layer decoding every protocol message, verified against JSON fixtures generated by the backend so drift breaks tests, not the app.

Acceptance criteria

  • Codable models: WS envelope, Task/TaskState/Workspace, conversation:event payloads, task:prompt/answer, server-info
  • Backend script (npm run gen:swift-fixtures) emits fixture JSON from the real TypeScript types/test data into the Swift test bundle
  • Swift tests decode 100% of fixtures; unknown-enum values decode to .unknown(raw) rather than throwing
  • protocolVersion surfaced and checked against server-info

Scope & expectations

  • Where: apps/ClaudiaNative/ClaudiaKit/Sources/Models, fixture-gen script in backend/scripts/
  • Constraints: tolerant decoding everywhere (forward-compat); no codegen dependency — plain Codable + fixtures

How to verify

CLI — xcodebuild test (or swift test) output green over the generated fixtures; show the fixture-gen command output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions