This was generated by AI during triage.
Summary
When arkenv init refuses to proceed because a safety check tripped (unmet technical requirements, dirty git tree, non-empty directory), the --agent / --json output does not tell the calling agent which check failed or how to escalate. Agents are left pattern-matching on prose like "Use --force to bypass these checks."
Spun out of the discussion on #1111, where it was decided that --agent must never imply --force — meaning agents need a deliberate, machine-readable path to escalate instead.
Current behavior
- Safety-check refusals are reported via human-oriented
error/info log lines (e.g. Technical requirements not met: … Use --force to bypass these checks.), and the command exits without a structured explanation.
- The JSON reporter's terminal
status: "error" payload carries only free-text message/error fields — no stable identifier distinguishing "requirements not met" from "dirty git tree" from any other failure.
Desired behavior
Every deliberate refusal in the CLI's JSON output carries:
- a stable, documented error
code (e.g. REQUIREMENTS_NOT_MET, GIT_TREE_DIRTY, NON_EMPTY_DIR) that is part of the CLI's public contract;
- a
retryWith hint listing the flags that would bypass the check (e.g. ["--force"]), empty when the failure is not bypassable;
- enough structured detail for the agent to report the problem (e.g. the failed requirements with
current/expected).
Unexpected/internal errors keep a generic code (e.g. INTERNAL) so consumers can distinguish "the CLI refused" from "the CLI broke".
Acceptance criteria
Out of scope
Related
Summary
When
arkenv initrefuses to proceed because a safety check tripped (unmet technical requirements, dirty git tree, non-empty directory), the--agent/--jsonoutput does not tell the calling agent which check failed or how to escalate. Agents are left pattern-matching on prose like "Use --force to bypass these checks."Spun out of the discussion on #1111, where it was decided that
--agentmust never imply--force— meaning agents need a deliberate, machine-readable path to escalate instead.Current behavior
error/infolog lines (e.g.Technical requirements not met:…Use --force to bypass these checks.), and the command exits without a structured explanation.status: "error"payload carries only free-textmessage/errorfields — no stable identifier distinguishing "requirements not met" from "dirty git tree" from any other failure.Desired behavior
Every deliberate refusal in the CLI's JSON output carries:
code(e.g.REQUIREMENTS_NOT_MET,GIT_TREE_DIRTY,NON_EMPTY_DIR) that is part of the CLI's public contract;retryWithhint listing the flags that would bypass the check (e.g.["--force"]), empty when the failure is not bypassable;current/expected).Unexpected/internal errors keep a generic code (e.g.
INTERNAL) so consumers can distinguish "the CLI refused" from "the CLI broke".Acceptance criteria
init(requirements, git status, non-empty directory) emits a distinct stable code in JSON moderetryWitharray naming the bypass flag(s)--force, inspectcode/retryWith, retry deliberatelyOut of scope
--agent,--yes, or--forcesemantics (settled in should we keep both--yesand--force? #1110 / should--agentcontinue using--yes? should it use--force? #1111)ArkEnvError) — separate surfaceinit(can follow once the pattern exists)Related
--agentcontinue using--yes? should it use--force? #1111 — decision:--agentimplies--yes, never--force--yesand--force? #1110 — decision: keep both--yesand--force