Consume cli-guard complex actions: native ward ci watch + run-latest defaulting #90

Closed
opened 2026-06-15 14:09:56 +00:00 by coilysiren · 1 comment
Owner

Consume cli-guard complex actions: native ward ci watch

cli-guard now ships the complex actions layer (poll-until composite verbs
with fail-when), implemented in coilyco-flight-deck/cli-guard#140. This is the
downstream consumption work that issue's open-item #5 named, plus a deferred
defaulting feature surfaced during implementation.

Do

  1. Bump the pinned cli-guard commit in ward's go.mod to the release that
    carries the complex-actions feature (the push that lands cli-guard#140).

  2. Add the ci-watch action to cmd/ward-kdl/ward-kdl.forgejo.guardfile.kdl,
    polling the already-granted list tasks leaf. Canonical grammar:

    action ci-watch {
        describe "Watch a CI run to completion, then surface failing-job status."
        input repo { positional; required; help "owner/name" }
        input run  { flag; help "run number" }
        poll list tasks {
            args { owner-repo $repo }
            until """
                length([?run_number==$run && status!='success'
                        && status!='failure' && status!='cancelled'
                        && status!='skipped']) == `0`
                """
            every   "10s"
            timeout "30m"
            as run_tasks
        }
        fail-when "length($run_tasks[?status=='failure']) > `0`"
    }
    
  3. Verify the response shape: cli-guard evaluates until against the decoded
    ListActionTasks response as the JMESPath root. The canonical expression
    assumes the response is a bare task array. If forgejo wraps it
    ({workflow_runs: [...]}), adjust the expression to project that key first.

  4. Keep scripts/watch-ci.sh's log-tail wrapper until the logs leaf lands
    (no OpenAPI op for action logs - gitea#35176); retire only its poll loop.

Deferred from v1 (decide here)

  • --run defaulting to the latest run. cli-guard v1 binds $run only when
    --run is supplied; the canonical until then needs it. The "default: latest
    in the listing" behavior was NOT implemented (it needs a pre-flight or an
    input default <jmespath> slot, which v1 reserves but does not build). Decide
    whether ward ci watch owner/repo (no run) should resolve the latest run, and
    whether that belongs in cli-guard (an input default expression) or ward.

Reference

## Consume cli-guard complex actions: native `ward ci watch` cli-guard now ships the **complex actions** layer (poll-until composite verbs with `fail-when`), implemented in coilyco-flight-deck/cli-guard#140. This is the downstream consumption work that issue's open-item #5 named, plus a deferred defaulting feature surfaced during implementation. ### Do 1. Bump the pinned cli-guard commit in ward's `go.mod` to the release that carries the complex-actions feature (the push that lands cli-guard#140). 2. Add the `ci-watch` action to `cmd/ward-kdl/ward-kdl.forgejo.guardfile.kdl`, polling the already-granted `list tasks` leaf. Canonical grammar: ```kdl action ci-watch { describe "Watch a CI run to completion, then surface failing-job status." input repo { positional; required; help "owner/name" } input run { flag; help "run number" } poll list tasks { args { owner-repo $repo } until """ length([?run_number==$run && status!='success' && status!='failure' && status!='cancelled' && status!='skipped']) == `0` """ every "10s" timeout "30m" as run_tasks } fail-when "length($run_tasks[?status=='failure']) > `0`" } ``` 3. Verify the response shape: cli-guard evaluates `until` against the decoded ListActionTasks response as the JMESPath root. The canonical expression assumes the response is a bare task array. If forgejo wraps it (`{workflow_runs: [...]}`), adjust the expression to project that key first. 4. Keep `scripts/watch-ci.sh`'s log-tail wrapper until the logs leaf lands (no OpenAPI op for action logs - gitea#35176); retire only its poll loop. ### Deferred from v1 (decide here) - **`--run` defaulting to the latest run.** cli-guard v1 binds `$run` only when `--run` is supplied; the canonical `until` then needs it. The "default: latest in the listing" behavior was NOT implemented (it needs a pre-flight or an input `default <jmespath>` slot, which v1 reserves but does not build). Decide whether `ward ci watch owner/repo` (no run) should resolve the latest run, and whether that belongs in cli-guard (an input `default` expression) or ward. ### Reference - Engine + grammar: cli-guard `docs/specverb-actions.md`. - Design + invariants: coilyco-flight-deck/cli-guard#140. - Related: ward#88 (native `ward ci watch` verb).
Author
Owner

The feature shipped as cli-guard v0.15.0 (tag on commit 8d7720f). That is
the concrete version to pin in ward's go.mod for step 1.

The feature shipped as **cli-guard v0.15.0** (tag on commit `8d7720f`). That is the concrete version to pin in ward's `go.mod` for step 1.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/ward#90
No description provided.