Skip to content

Enrich rwx results --json from the results details endpoint#534

Open
robinaugh wants to merge 2 commits into
mainfrom
jason/rwx-897-enriched-results-json
Open

Enrich rwx results --json from the results details endpoint#534
robinaugh wants to merge 2 commits into
mainfrom
jason/rwx-897-enriched-results-json

Conversation

@robinaugh

@robinaugh robinaugh commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Background

  • Linear: RWX-962 (also relates to RWX-897)
  • Server-side endpoint: rwx-cloud/cloud#7626

We want to expose more detailed information about runs and tasks via rwx results --json. Before launch, a docs page at rwx.com/docs/results will list the available attributes, so the help text refers to that rather than baking the docs into the client.

Problem

rwx results --json returns a fixed shape focused on the actionable failure prompt. The new /mint/api/results/details endpoint returns a richer curated payload, but the CLI doesn't consume it.

Solution

  • Fetch the curated payload from /mint/api/results/details and fold it into the base JSON output.
  • Enriched snake_case keys are rewritten to PascalCase to match the existing output casing. The enriched id is surfaced as ID alongside RunID/TaskID.
  • An empty payload (enrichment not enabled for the org) leaves the base output unchanged, so this is a no-op until the endpoint is rolled out.
  • Task-scoped lookups stay task-scoped: the original run/task identifier is passed through rather than the resolved run ID.
  • The plain-text (non-JSON) output is unchanged.

The --billing / --performance augmentation flags were descoped from this PR to keep it focused on the core enrichment. Their implementation is stashed in RWX-989 for re-add later.

Example outputs

Help text:

╰─⠠⠵ ./rwx results --help
Get results for a run.

The default output is an LLM-friendly prompt for investigating run failures: the
run's status plus a failure summary you can hand to a coding agent.

Pass --output json to get structured run and task fields instead. For the full
list of JSON fields, see https://rwx.com/docs/results or run:

    rwx docs pull /results

Usage:
  rwx results [run-id | run-id --task <key>] [flags]

Flags:
      --branch string       get results for a specific branch instead of the current git branch
      --commit string       get results for a specific commit SHA
      --definition string   get results for a specific definition path
      --fail-fast           stop waiting when failures are available (only has an effect when used with --wait)
  -h, --help                help for results
      --open                open the run in a browser
      --repo string         get results for a specific repository instead of the current git repository
      --task string         task key (e.g., ci.checks.lint); resolves the task by key instead of ID
      --wait                poll for the run to complete and report the result status

Global Flags:
      --access-token string   the access token for RWX (default "$RWX_ACCESS_TOKEN")
      --output string         output format: text or json (default "text")

Command task piped into jq (abridged):

╰─⠠⠵ ./rwx results f068b078bca8b14180335cde89859698 | jq
{
  "ArtifactCount": 1,
  "AttemptCount": 1,
  "Completed": true,
  "CompletedAt": "2026-06-02T13:05:28.873Z",
  "Key": "write-artifact",
  "ResultStatus": "succeeded",
  "RunID": "611b86e40127478bb6bd4ce9a196b159",
  "StartedAt": "2026-06-02T13:05:27.290Z",
  "TaskID": "f068b078bca8b14180335cde89859698",
  "TaskStatus": {
    "AbortedStatus": "not_applicable",
    "Execution": "finished",
    "FinishedStatus": "executed",
    "Result": "succeeded",
    "WaitingStatus": "not_applicable"
  },
  "TaskType": "command"
}

Further confirmation needed

  • Verify end-to-end against the live /mint/api/results/details endpoint once it ships (the merge is a no-op against the current empty response).

@robinaugh robinaugh self-assigned this Jun 5, 2026
@robinaugh robinaugh force-pushed the jason/rwx-897-enriched-results-json branch from 26d9a50 to be1514e Compare June 5, 2026 18:19
@robinaugh robinaugh marked this pull request as ready for review June 5, 2026 18:39
kylekthompson
kylekthompson previously approved these changes Jun 5, 2026
kylekthompson
kylekthompson previously approved these changes Jun 8, 2026
Fetch the curated payload from /mint/api/results/details and fold it into
the base JSON output. Enriched snake_case keys are rewritten to PascalCase to
match the existing output, and the enriched id is surfaced as ID alongside
RunID/TaskID. An empty payload (enrichment not enabled for the org) leaves the
base output unchanged. Task-scoped lookups stay task-scoped by passing the
original run/task identifier rather than the resolved run ID.
@robinaugh robinaugh force-pushed the jason/rwx-897-enriched-results-json branch from 22cad74 to 87268eb Compare June 8, 2026 16:15
kylekthompson
kylekthompson previously approved these changes Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants