Skip to content

feat: publish a stable JSON error and exit-code compatibility contract #25

Closed

Description

@abruption

Priority

P0 — public integration contract.

Problem

The README calls JSON output stable and versioned, but usage errors and runtime failures currently emit ad-hoc objects that do not share the schemaVersion 1 result shape. Consumers such as session-peer need an explicit contract for success, refusal, unknown evidence, and operational errors.

Scope

  • publish JSON Schema artifacts for list, inspect, unlock, and CLI error results
  • define required and optional fields, enum values, nullability, and unknown-field compatibility
  • define the mapping between command outcomes and exit codes 0, 2, 3, and 64
  • document that live_owner is liveness evidence and is not equivalent to safeToUnlock
  • exclude raw transcript contents, secrets, and unnecessary sensitive paths from new error metadata
  • add golden fixtures and backward-compatibility tests against v0.1.1 output

Acceptance criteria

  • every --json invocation writes exactly one valid JSON value to stdout
  • JSON errors carry schemaVersion and a stable machine-readable code
  • schemas validate representative success, refusal, unknown, and error fixtures
  • existing schemaVersion 1 result fields remain backward compatible
  • unknown additive fields are explicitly permitted
  • feat: define the supported package and JSON API boundary #15 links to and enforces this contract through package smoke tests

Dependencies

This is a focused deliverable under #15 and must land before #16 or #20 relies on the public JSON root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions