Skip to content

feat(zeroshot-rust): project safe errors across product command and daemon boundaries #767

Description

@tomdps

Parent

Execution

AFK. Start only after every issue in Blocked by is merged, required CI is green for the resulting dev SHA, and the worktree is created from a freshly fetched origin/dev.

Outcome

Define one bounded product-command/daemon error projection from existing safe engine faults and protocol errors without leaking raw diagnostics.

Authoritative contracts/current state

#684 owns EngineFault; protocol errors remain authoritative for protocol methods. The native product currently lacks stable CLI/control error categories and must not expose EngineFault JSON or raw provider/process text directly.

Satisfied prerequisites

Owned scope

  • Define a closed product error code, bounded safe message/action, deterministic exit status, and daemon-control response mapping.
  • Map protocol validation/CAS/idempotency/capability/not-found conditions without reclassifying them as engine faults; map EngineFault only through its validated safe fields.
  • Keep raw diagnostics, source frames beyond the approved projection, provider codes, paths, URLs, commands, stderr, session IDs, and credentials out of command/control output.
  • Provide deterministic text/JSON renderers and round-trip tests with strict bounds/unknown-field rejection.

Acceptance criteria

  • Every engine/protocol category maps exhaustively to one stable code and exit status.
  • Changing raw diagnostic fixtures cannot change or enter rendered output.
  • Limit and limit-plus-one cases fail closed without truncating into misleading data.
  • No protocol schema, daemon host, CLI parser, exporter, telemetry, or retry behavior is added.

Verification

cargo test -p zeroshot-rust --test product_errors
cargo test -p zeroshot-rust --test fault_contract
cargo test -p zeroshot-rust --test architecture
npm run rust:check
npm run protocol:check
npm run typecheck
npm run lint
npm run test:unit
opcore check --changed

Every named focused target is an issue-owned deliverable and must execute non-zero tests before the common gates.

Non-goals

  • Daemon routing or CLI commands.
  • A second fault taxonomy, raw diagnostic serialization, or automatic retry.
  • Product export construction.

Blocked by

  • None; all prerequisites are already merged.

Unblocks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions