Skip to content

CLI: agent-mode contract — env path unknown-key exit code, idempotent spec archive, JSON output, migrate --split #700

Description

@mlorentedev

Problem. Gaps an autonomous agent hits chaining dotf via exit codes: (a) dotf env path NO_SUCH_KEY prints an empty line and exits 0 — unknown key indistinguishable from unset value; (b) re-archiving a spec errors spec not found instead of acknowledging "already archived" (non-idempotent second call); (c) dotf secrets set with bw missing misattributes the failure as item "…" not found (backup gets it right: exec: "bw": not found); (d) secrets migrate shared-source guard recommends migrate --split which does not exist (Error: unknown flag: --split) — implement or reword (C9); (e) no command offers --json; agents parse prose. Good contracts to preserve: verify/render --strict/run --only exit semantics, update's skip-vs-fail split, generate --check.

Repro: E3 T5, E2 S12/S15, W6b (exact commands in the report).

Fix direction. Exit-code contract documented per noun; --json on doctor/verify/ls/update first; unknown-key exit 1; idempotent archive message; accurate bw-absent errors.

Source: docs/audits/process-audit-2026-07-07.md §4 P9 (CONFIRMED).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions