Skip to content

fail-safe CLI: unknown verb exits 0; no exit-10 for agent logical failure #22

Closed

Description

@kanfil

Two fail-safety gaps found while wiring the Argo lane (adlc-argo-wf !3 review). Both are small, both have silent-success failure modes.

M1 — unknown top-level verb exits 0 (must)

src/dispatch.mjs:154-157 — the default: case prints help and returns 0. Consequence, verified: adlc-cli factory-mission --issue … --run-id … prints help and exits 0 — a run that never happened reports success. (The Argo seed template shipped exactly this invocation.) Fix: return 1 for an unrecognized command string; keep bare help/no-args at 0.

M2 — exit-10 contract unimplemented (must, retry-gating)

The Argo lane retry gate (expression: asInt(lastRetry.exitCode) != 10) needs logical failure to exit 10. Today:

Acceptance

  • Unknown verb → non-zero exit with usage hint.
  • Simulated agent logical failure → exit 10, zero Argo retries; OOM-kill/infra → retried with backoff.
  • Paused workflow → documented code the lane expression excludes.

Lane context: adlc-argo-wf !3 comment (2026-09-30) carries the full five-item review; agentic-container side (exit-10 propagation) tracked separately.

Activity

  1. kanfil commented on Sep 30, 2026

    @kanfil
    MemberAuthor

    Mission started on tikalk/adlc-cli#22 (fail-safe CLI: unknown-verb exit + exit-10). Run mission-adlc-cli-22-20260930, worktree-isolated (fix/issue-22-cli-fail-safe), autonomous. Drafts stay local; step findings publish here as markers.

  2. kanfil commented on Sep 30, 2026

    @kanfil
    MemberAuthor

    Test step done — RED gate passed (executor re-ran the suite: 12 tests, 3 pass, 9 fail).

    • New file tests/cli-failsafe.test.mjs. Genuine behavior failure: unknown verb exits 0, expected 1 (0 !== 1). Guards green: bare→0, help→0, run-without-prompt→1.
    • 8 M2 failures are seam-missing (src/exit-codes.mjs absent). Implementer contract: provide classifyAgentExit({code, signal}) (0→0, non-zero child→10, signal→130) and classifyWorkflowStatus(status) (COMPLETED→0, PAUSED→3, FAILED→10, ABORTED→1); wire into dispatch.mjs default (unknown→1), agent.mjs post-spawn return, workflow.mjs run/resume terminal mapping. Lane expression (applied in adlc-argo-wf, not here): asInt(lastRetry.exitCode) != 10 && asInt(lastRetry.exitCode) != 3.
  3. added a commit that references this issue on Sep 30, 2026
    a96cfd0
  4. kanfil commented on Sep 30, 2026

    @kanfil
    MemberAuthor

    Mission complete — audit trail:

    • setup: worktree fix/issue-22-cli-fail-safe off main; remote lease acquired; issue OPEN unlabeled → autonomous.
    • test: tests/cli-failsafe.test.mjs (12 tests), RED verified by executor re-run (9 fail: 1 behavior + 8 seam-missing).
    • code: src/exit-codes.mjs + wiring in dispatch.mjs/agent.mjs/workflow.mjs; GREEN verified (12/12 new, 318/318 full, 34 suites).
    • converge: DONE — all success criteria met, non-goals held (no container/template/lane edits), 0 circuit appends.
    • write-back: PR fail-safe CLI exit codes: unknown verb → 1, logical failure → 10, paused → 3 #23 opened (agent-authored, human merge only — not merged). Run archive: workspace .adlc/workflows/runs/mission-adlc-cli-22-20260930/ (brief.md, iterations.md, mission.yml).
    • Skipped per repo reality: lifecycle/agent-authored labels do not exist in this repo → no label transitions; stamp carried in PR body. No engine-managed run → completion recorded in local state, not workflow state advance.
      Remaining for the lane: container propagation (tikalk/engineering/agentic-container#1) + lane expression application (adlc-argo-wf values MR).
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions