Repository navigation
plan x get: surface input resolution status - #326
Conversation
|
The filter at Two cheap shapes: Counted summary (one line under each step header): Trailing marker (keep the filter, name what it dropped): Either makes the filter part of the contract instead of a hidden behavior the user has to reverse-engineer. |
|
At plan level, |
36df6aa to
c1133fe
Compare
The plan API now reports how each input was resolved at dispatch
(literal, callerSecret, ref, default, unbound), but plan x get
showed none of it. This change replaces the flat STEP/PHASE/ERROR
table with a nested per-step layout that keeps inputs and errors
visually owned by the step they belong to:
Steps:
send_request completed
check_status completed
capture ← steps.send_request.outputs.capture (ref)
echo_region failed
error: extra_output "got_region" declares a schema...
region ← prod-token (callerSecret)
Plan-level params get an "Inputs:" section in the same arrow/via
form, useful for confirming which --param-secret bindings actually
took effect at dispatch time. Pure literal/default/unbound step
inputs are filtered as noise; unknown enum values are treated as
interesting so a future server-side addition surfaces rather than
getting silently dropped.
Also adds utils.TimeAgo for the compact "X ago" form (the existing
FormatTimestamp gives the verbose absolute+relative form suitable
for detail views, not table columns) and uses it in the plan x list
table. Several other printers across the CLI inline the same
time.Parse + timeago.NoMax pattern; migrating those is left for a
separate cleanup.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Three rounds of review feedback consolidated: - Resolve and display values, not just resolution methods. plan x get now fetches the compiled plan (best-effort) and uses it to render literal values from execution.spec.params, refs from step.Args.Refs, and defaults from the action's declared params. Plan-level secret bindings already showed the secret name; step-level inputs that were previously filtered as noise are now shown with their resolved values, so users can see exactly what the runner saw. - Replace the ambiguous "literal" enum with prose. At plan level literal really meant "the caller passed --param" and "default" meant "the plan's default kicked in"; at step level literal meant "the plan author hardcoded it" and default meant "the action's default kicked in". The tags now say so directly: (from --param), (from --param-secret), (plan default), (set in plan), (ref), (default), (unbound). - Fix the visual hierarchy so step fields don't look like sibling inputs. error: and an explicit inputs: subheader sit at one indent level under each step; individual input rows sit one further indent under the inputs: header. The reader can no longer mistake error for an input named error. Also rebuilds plan get from a thin metadata blurb into a full spec view: per-param defaults/required/optional, plan-level outputs (refs, no redundant tag), and per-step structure (action ID + revision, image, condition, wired inputs, declared extra_outputs). Friendly action names are not loaded; the reader can copy the action ID into signadot plan action get for more. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
c1133fe to
e151887
Compare
|
@scott-cotton, I added further changes, see below: Updates since the initial reviewThe original PR was scoped to making input resolution methods visible. After review iterations it grew into surfacing resolved values end-to-end, plus a fuller 1. Show every step input, with valuesEarlier the printer filtered "noisy" inputs (literal/default/unbound) at the step level. That had two problems flagged in review:
Resolution: drop the filter, fetch the compiled plan via a best-effort
If the plan can't be fetched (deleted, network blip), the printer renders without values — gracefully degrades. 2. Replace the ambiguous "literal" enum with proseBoth plan-level and step-level had a
3. Visual hierarchy under each step
4. Rebuild
|
Bumps go-sdk to the latest feature-plan tip, which adds a Name field
on PlanStepAction and removes Requires/Validations from the action
status. The two views that render plan structure now show the action
name when the server supplies it:
Steps:
send_request completed
action: request-http (f3ppjxbzpddry) (revision 1)
inputs:
url ← http://httpbin.org/uuid (set in plan)
method ← GET (set in plan)
When the name isn't populated (plans compiled before the field was
added), it falls back to the bare action ID. Same actionLabel helper
in both plan and planexec packages keeps the rendering consistent.
Also tracks the SDK shape changes so the build keeps working:
- PlanActionStatus.Requires/Validations removed → drop the
"Requires" line and the per-runner-group validations table
from plan action get
- PlanSpec.Requires removed → drop the "Requires" line from
plan get (it was a roll-up the apiserver no longer computes)
- PlanStepAction gained Timeout/TimeoutInputName → surface in
plan get when present
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ize sections
Three related rendering changes layered on top of the surface-outputs work:
- Outputs were rendered in two ad-hoc shapes that didn't match the
rest of the view: inline values as `--- name ---\n<value>` blocks
and artifacts as a separate STEP/TYPE/SIZE/READY table at the end.
Both folded into a single arrow-form Outputs: section that mirrors
Inputs: and Steps:
Outputs:
exitCode ← 0 (inline, from tests)
report (artifact, 5.073kB, ready, from tests)
test_artifacts (artifact, 5.469MB, ready, application/gzip, from tests)
Step-level outputs (PlanStepStatus.Outputs) get the same treatment
inside each step block, between inputs and the next step. Together
the two views show what each step emitted and how each plan-level
output was wired through to the caller. Artifact tags include
ready/not ready (always), Content-Type from metadata.contentType
when present, and any artifact.error.
- Multi-line literal values broke the inline arrow form. A 38-line
Playwright script as a step input rendered with the (set in plan)
tag landing many lines below the row, visually disconnected.
truncateForDisplay collapses to a single line + (N lines) marker;
over-long single-line values get a trailing ellipsis at 80 chars.
Same change applies to plan get's formatValue.
- Normalize section labels and order across plan get and plan x get.
plan get used Params / Outputs / Steps; plan x get used Inputs /
Steps / Outputs. Both now use Inputs → Steps → Outputs (matches
plan action get too) so the reader sees the same skeleton in all
three views; the via tags carry the spec-vs-runtime distinction.
Also unifies the three exec-detail entry points: outputs now live in
printExecDetails, so plan run, plan x get, and plan x cancel all
render the same trailing Outputs: block. PrintRunResult collapses to
a thin wrapper.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The attach event stream had two visual breaks that confused users:
1. Plan-level outputs that were artifacts rendered as `value=<nil>`
because AttachEvent only carried Name+Value:
time=17:33:14 type=output name=report value=<nil>
time=17:33:14 type=output name=test_artifacts value=<nil>
time=17:33:14 type=output name=exitCode value=0
The full PlanOutputStatus is in hand at emit time (the events come
from a GetPlanExecution snapshot once the run hits a terminal phase,
not from the SSE log stream). Plumb the artifact-side fields through
so artifact rows show the real metadata and inline rows are
self-disambiguating:
time=17:33:14 type=output name=exitCode step=tests kind=inline value=0
time=17:33:14 type=output name=report step=tests kind=artifact size=12KB ready=true
time=17:33:14 type=output name=test_artifacts step=tests kind=artifact size=2.3MB ready=true content_type=application/gzip
AttachEvent gains kind / size / ready / contentType (omitempty so
older JSON consumers ignoring unknown fields keep working). Output
events also gain step= when the plan-level output came from a
step (StepRef.StepID), matching the from <step> attribution in
plan x get's rendered Outputs section. Format parity with that
view: ready/not ready always shown for artifacts, content_type
from metadata.contentType when set, artifact.error surfaced.
2. The "Created execution X for plan Y" line printed before the
stream started was a plain stderr banner; the rest of the stream
used time=… type=… key=value form. Move it into attachExecution
as the first structured event so the lifecycle reads consistently
from creation to result:
time=17:33:11 type=created id=8y6b6w2g6ycss plan_id=lmsu2671y8ufl
time=17:33:14 type=output …
time=17:33:14 type=result id=8y6b6w2g6ycss phase=completed
Non-attach mode still prints the stderr banner; only --attach
gets the structured "created" event. JSON consumers piping
through jq now see a clean event stream with no banner noise on
stderr to filter out.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@scott-cotton, latest commit ( Before
AfterWhat changed:
New JSON modeConsumers now get a complete event stream — no banner break, no need to filter stderr. {"time":"…","type":"created","id":"8y6b…","planID":"lmsu…"}
{"time":"…","type":"output","name":"report","step":"tests","kind":"artifact","size":5187,"ready":true}
{"time":"…","type":"output","name":"test_artifacts","step":"tests","kind":"artifact","size":5054054,"ready":true,"contentType":"application/gzip"}
{"time":"…","type":"output","name":"exitCode","step":"tests","kind":"inline","value":0}
{"time":"…","type":"result","id":"8y6b…","phase":"completed"}Files touched
|
The latest go-sdk drop adds PlanSpec.SelectionHint and a matching SelectionHint field on PlanCompileInput — a curated short description meant for selection / pick-list UI, distinct from the verbose multi-line Prompt that compiled the plan. - plan tag list: replace the PROMPT column with SELECTION HINT, sourced from spec.selectionHint. plan tag list already truncated the prompt to a single line, but real prompts are 80+ chars of cryptic context that doesn't help a user pick between tagged plans. SelectionHint is purpose-built for this slot. Plans compiled before the field existed render an empty cell; new plans fill it in. Also moves the inline timeago formatting in this printer to utils.TimeAgo, matching the cleanup landed earlier in this PR. - plan compile --selection-hint: convenience flag for setting the hint at compile time. The /plans/compile API already accepts it in the JSON body; agents had to construct the payload by hand or recompile through plan create. Plumbs cfg.SelectionHint into PlanCompileInput. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@scott-cotton, latest commit (
|
scott-cotton
left a comment
There was a problem hiding this comment.
Re-review
The two earlier comments were addressed cleanly: the silent filter is gone (everything is shown now, with resolved values), and unbound at step level surfaces instead of being suppressed. On top of that, the PR has grown into a larger rendering overhaul — full per-step layout, prose vias, value resolution via best-effort GetPlan, unified Outputs: section, attach event parity, an SDK bump, and a new --selection-hint flag. The output examples in the PR description look great and the core idea is right.
Build, vet, and go test ./internal/command/planexec/... all pass.
Issues worth fixing before merge
1. go.sum has a stale signadot/go-sdk entry
github.com/signadot/go-sdk v0.3.8-0.20260505171357-a02f1a78bde4 h1:...
github.com/signadot/go-sdk v0.3.8-0.20260505171357-a02f1a78bde4/go.mod h1:...
github.com/signadot/go-sdk v0.3.8-0.20260505200838-3bae35b0d0d8 h1:...
github.com/signadot/go-sdk v0.3.8-0.20260505200838-3bae35b0d0d8/go.mod h1:...
go.mod only requires the …200838 version. Running go mod tidy removes the …171357 lines — looks like a leftover from the intermediate "two SDK bumps in one PR" history.
2. Significant duplication between internal/command/plan/printers.go and internal/command/planexec/printers.go
These helpers are now defined verbatim (or near-verbatim) in both files: actionLabel, printInputLine, formatValue, truncateForDisplay, maxValueDisplay, paramsAsMap, stepArgsValues. They render the same arrow/via shape and are intentionally meant to stay in sync — the comments in both copies even say so. Promoting these to a small shared package (e.g. internal/command/planshared or internal/print/plan) would prevent the two views from drifting. Not a blocker, but a meaningful follow-up.
3. plantag/printers.go has a half-migrated cleanup
The PR migrates printTagTable to use utils.TimeAgo, but printHistoryTable immediately below it still inlines the time.Parse(time.RFC3339, ...) + timeago.NoMax(...) pattern. The time and timeago imports survive only because of that one function. Migrating it in this PR would let the imports come out, and it's the same file. The PR description does mention "migrating those is left for a separate cleanup" — fair, but this one is mid-cleanup-in-progress, so it's a small finish.
Smaller observations
fetchPlanSpecinplanexec/get.goadds a second API round-trip perplan x get/plan x cancel. The graceful-degrade behavior (returnnil, render without resolved values) is right, but worth knowing this doubles the request count on every detail render.formatOutputTagseparates the source-step suffix with, from <stepID>; on plan-level rollups with no other tags this reads as(inline, from tests). Fine, just slightly awkward — one example in the PR description even has it landing inside what visually looks like multi-column padding ((artifact, 5.073kB, ready, from tests)). Worth eyeballing in a real terminal to confirm it doesn't look like a formatting bug.printPlanInputstakesex *models.PlanExecutionbut only usesex.Status.Inputsandex.Spec.Params(viaexecParams). Could narrow the parameter, but not a real problem.- No tests for the new printer logic. Given how much branching there is (inline vs artifact, with/without StepRef, multi-line truncation, action label fallbacks, all four resolved-via prose forms), a few golden-file tests would buy a lot of regression coverage cheaply. Out of scope for this PR if you'd rather follow up.
Overall
Good iteration on the prior feedback, and the merged output shape is clearly better than what was there. The go.sum stale entry is the thing I'd most want addressed in this PR; the duplication note is more of a design heads-up that I'd push as a follow-up.
Review feedback from #326: - Extract the rendering helpers shared by plan, planaction, planexec, and plantag into a new internal/command/planshared package: PrintInputLine, FormatValue, FormatImage, ActionLabel, ParamsAsMap, StepArgsValues, MaxValueDisplay. Previously duplicated verbatim in plan/printers.go and planexec/printers.go (and partially in planaction/printers.go for FormatImage), with comments saying the copies were "intentionally meant to stay in sync." A single source of truth is the right way to enforce that. - Finish the timeago→utils.TimeAgo migration in plantag/printers.go. printTagTable was migrated in the previous commit but printHistoryTable still inlined time.Parse(time.RFC3339, ...) + timeago.NoMax(...). Migrating it lets the time and timeago imports come out of the file entirely. - Narrow printPlanInputs in planexec/printers.go to take inputs + suppliedParams + planSpec instead of the whole *PlanExecution. Drops the now-unused execParams helper. - Remove the stale duplicate go-sdk entry in go.sum (leftover from two SDK bumps in the same PR; go mod tidy resolves it). No behavioural change — all four views (plan get, plan x get, plan tag list, plan action get) render identically. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@scott-cotton, pushed 5aa7baf. Review items addressed:
|
Stacked on #325.
Summary
plan x getwith a nested per-step layout that keeps inputs and errors visually owned by the step they belong to. Per-step inputs surface refs and secret-backed bindings; pure literal/default/unbound inputs are filtered as noise.Inputs:section in the same arrow/via form. Useful for confirming which--param-secretbindings actually took effect at dispatch time.utils.TimeAgofor the compact "X ago" form (the existingFormatTimestampgives the verbose absolute+relative form, too wide for table columns), and uses it inplan x list. Several other printers inline the sametime.Parse + timeago.NoMaxpattern; migrating those is left for a separate cleanup.Examples
Step ref (data flow between steps):
Plan-level params with literal + unbound:
--param-secretbinding + step failure (error nested under the failing step):Test plan
plan x get <id>for an exec with no params shows noInputs:section, just the nested stepsplan x get <id>for an exec with--param-secretshows thecallerSecretrow with the bound secret nameplan x get <id>for an exec with a step that refs another step's output shows the ref expression text under the consuming stepplan x get <id>for a failed exec shows the step error nested under the failed stepplan x liststill shows the compact "X ago" form in the CREATED column