tea-cli: tea api exits 0 on HTTP errors and prefixes NOTE: lines to stdout — audit every helper that pipes it into jq #260

Open
opened 2026-08-26 11:47:05 +00:00 by jbr870 · 0 comments
Owner

Spawned from finding F-PO-61-3-2 (pre-existing, severity high) on issue #61 during decision D-PO-61-3-2.

Original scope note: Two independent defects in the forge CLI this project's tea-cli adapter is built on, both confirmed live during #61's run and neither introduced by it:

  1. tea api exits 0 on HTTP-level errors. It returns exit 0 on 403 and 404; it fails non-zero only on client-side errors such as an unknown login name. Anything judging success by return code gets a false green.
  2. tea api prefixes advisory lines to stdout. NOTE: no login matched this repository, falling back to login '<x>' is printed before the body, so the JSON does not start at byte zero and a naive | jq fails.

Every helper in the suite that pipes tea api into jq is exposed on both counts. The blast radius is _shared/procedures/bin/ and the tea-cli adapter generally — the same code path that writes and reads every typed phase record.

Disposition rationale: This is the same class the repo has already legislated against twice — the rc-checked-stdout rule (#33) and the gate-output rule (#49) — so the principle is settled and only the audit-and-fix work remains. It belongs to component:adapters and wants its own slice; folding it into a devcontainer feature would bury a suite-wide correctness issue inside an infra ticket. accept would knowingly leave a false-green surface in the code that records what every phase did.

Shape of the work:

  • Audit every tea api call site in plugin/skills/_shared/procedures/bin/ and plugin/skills/tea-cli/bin/.
  • Decide the canonical wrapper: check the HTTP status explicitly (not the exit code), and strip the leading advisory lines before the body reaches jq.
  • Check whether glab/gh have the same behaviour before writing a tea-only fix.

This issue was deferred out of the parent feature's scope; it carries no PREQ yet. Run /dev:requirements --issue={this} to flesh it out before planning.

Spawned from finding `F-PO-61-3-2` (pre-existing, severity high) on issue #61 during decision `D-PO-61-3-2`. **Original scope note:** Two independent defects in the forge CLI this project's `tea-cli` adapter is built on, both confirmed live during #61's run and neither introduced by it: 1. **`tea api` exits 0 on HTTP-level errors.** It returns exit 0 on 403 and 404; it fails non-zero only on client-side errors such as an unknown login name. Anything judging success by return code gets a **false green**. 2. **`tea api` prefixes advisory lines to stdout.** `NOTE: no login matched this repository, falling back to login '<x>'` is printed before the body, so the JSON does not start at byte zero and a naive `| jq` fails. Every helper in the suite that pipes `tea api` into `jq` is exposed on both counts. The blast radius is `_shared/procedures/bin/` and the `tea-cli` adapter generally — the same code path that writes and reads every typed phase record. **Disposition rationale:** This is the same class the repo has already legislated against twice — the rc-checked-stdout rule (#33) and the gate-output rule (#49) — so the principle is settled and only the audit-and-fix work remains. It belongs to `component:adapters` and wants its own slice; folding it into a devcontainer feature would bury a suite-wide correctness issue inside an infra ticket. `accept` would knowingly leave a false-green surface in the code that records what every phase did. **Shape of the work:** - Audit every `tea api` call site in `plugin/skills/_shared/procedures/bin/` and `plugin/skills/tea-cli/bin/`. - Decide the canonical wrapper: check the HTTP status explicitly (not the exit code), and strip the leading advisory lines before the body reaches `jq`. - Check whether `glab`/`gh` have the same behaviour before writing a tea-only fix. This issue was deferred out of the parent feature's scope; it carries no PREQ yet. Run `/dev:requirements --issue={this}` to flesh it out before planning.
Sign in to join this conversation.
No description provided.