Break out runs and batches per type, removing ID-prefix inference - #34
Open
jordanalexmeyer wants to merge 5 commits into
Open
Break out runs and batches per type, removing ID-prefix inference#34jordanalexmeyer wants to merge 5 commits into
jordanalexmeyer wants to merge 5 commits into
Conversation
Run inspection/control and batch status are now typed subgroups under each action verb (extract/parse/classify/split/edit runs|batches, plus workflows runs), mirroring the MCP server's per-type tool breakout. The top-level runs, batches, and run groups are removed; extend run moves to extend workflows run (and workflows run batch). Each typed command carries exactly the flags its kind supports, IDs are validated against the invoked command's kind with a redirect to the owning command on mismatch, and edit detections get exposes form detection runs. Skill, help topics, evals, and integration tests are re-pointed at the typed shapes.
batch.go was carrying two unrelated concerns: the per-verb batch submit builders with their upload plumbing, and the typed `<verb> batches get|watch` inspection subgroups. Splitting the inspection side into batches.go mirrors the runs.go/runs_list.go layout and pairs with internal/extendx/batches.go. Pure code motion.
The detections group could fetch sgr_ runs but not start them, so the async POST /form_detection_runs endpoint was unreachable from the CLI. `extend edit detections create <input>` mirrors the config knobs of the synchronous `edit schema generate` (--instructions, --input-schema, --advanced-options) and follows the action-verb wait convention: block until PROCESSED/FAILED by default, --wait=false to detach and poll with `edit detections get`.
Cobra returns flag.ErrHelp for non-runnable groups before Args validation, so removed top-level groups (runs/run/batches) and typed leaves a kind doesn't have (parse runs cancel, edit runs list, workflows batches) printed help and exited 0 — silently succeeding for scripts gating on exit status. Groups are now runnable so NoArgs rejects unknown subcommands, and the root names the typed replacement for the three removed group names. A new test pins the exit contract. Evals: unmodeled typed runs/batches shapes and edit detections no longer fall through to the action-verb emitters (which fabricated a fresh successful run out of cleanup/inspection calls); runs delete and edit detections create/get are modeled; the extract-batch fixture uses the real bpr_ prefix so ValidateBatchID accepts the follow-up watch; sgr_ and batch-ID prefixes join the fabrication patterns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures run inspection/control and batch status into typed per-verb subcommands, mirroring the MCP server's per-type tool breakout and eliminating all ID-prefix inference. Based on #32.
New command surface
Removed: top-level
runs,batches, andrun, along with--typeonruns listand the--response-typegating. Each typed command carries exactly the flags its kind supports.How it works
internal/extendx: prefix tables are demoted to validation only.ValidateRunID/ValidateBatchIDfail fast on a wrong-type ID with a redirect to the owning command (extend extract runs get pr_x→ "use 'extend parse runs get pr_x'").SupportsRunActionkeeps redirects honest: an action the actual kind lacks says so instead of naming a nonexistent command.internal/cli: onerunsGroupSpec/batchesGroupSpecper kind generates the typed subgroups with capability flags (cancellable, listable, updatable, parse's--response-type, per-kind list filters), following the processors.go accessor pattern.test/integration, skill evals, and the eval stub all re-pointed at the typed shapes;internal/cli/AGENTS.mdexample updated.Warning
Breaking change for every scripted
extend runs/batches/runinvocation (acceptable per the README's instability warning). Needs a loud release note; a docs PR for cli.mdx/agents.md follows separately, timed with the release.Test plan
go build ./... && go test ./... && go vet ./...green (main module + evals/runner module);gofmt -lcleantest/integrationcompiles; run commands rewritten to typed paths (needsEXTEND_TEST_RUN_OPS=1for live verification)extract runs get pr_xredirect,extract runs cancel pr_xnon-cancellable message,edit detections getprefix validation