Skip to content

Phase 4a: admin pipeline grid API and status command - #2335

Merged
neuromechanist merged 11 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2326-pipeline-grid
Nov 23, 2026
Merged

neuromechanist merged 11 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2326-pipeline-grid

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 4a of the ADR 0134 epic: the admin pipeline grid API and nemar admin compute pipeline status (ADR 0134 decision 5).

  • GET /admin/compute/pipeline/grid: one recipe's runs over the eligible datasets, a row per dataset and a column per declared checkpoint (then stored), each cell passed/total with a mark (pipelineCellMark). Filters: status, recipe_version, executor, runner, dataset; keyset paging by dataset id (after, limit default 100, at most 500); matched counts over the whole filtered set; facets (recipe versions, runners).
  • GET /admin/compute/pipeline/coverage: per registry recipe, eligible, covered (a succeeded run at the dataset's newest version with the registry's current recipe version), complete (covered, every recording passed at the recipe's last checkpoint), covered at any recipe version, counts by status, and a daily failure trend from the stamps (30 days by default, 90 at most), zero-filled.
  • GET /admin/compute/pipeline/runs/:stamp: one run's checkpoints, counts, last live counts, and the failures each lists (at most ten, from D1), with unlisted and failures_unreadable; stamp_not_found (404) for none.
  • What a run shows is PIPELINE_RUN_STATUS_SQL, a SQL expression held equal to pipelineRunStatus over every stamp state, job state and report age. A row's run is the newest stamp of the recipe, never refused and never a tuple_mismatch hold (NOT_HOLD_STAMP_SQL, now shared with reconciliation).
  • All three routes are admin-only and READ ONLY; grid?sync=1 syncs the open stamps first. No migration, no cron, no switch, no users read.
  • CLI: pipeline status is the grid (syncs first unless --no-sync), pipeline failures <stamp-id> the drill-down, and the stamp list moved to pipeline stamps. The old GET /admin/compute/pipeline/status route is unchanged, so released CLIs keep working.
  • Contract (shared/contract/compute-admin.ts): literal word lists and bounds the website's drift tests can read from the text (COMPUTE_PIPELINE_GRID_STATUSES, COMPUTE_PIPELINE_CELL_MARKS, COMPUTE_PIPELINE_RUN_OUTCOMES, the page and trend bounds, COMPUTE_PIPELINE_RECIPE_VERSION_RE) and open response schemas.

Owner answers (2026-11-23)

  • pipeline status becomes the grid; the stamp list moves to pipeline stamps; new pipeline failures; the old route is kept.
  • Coverage as recommended: newest dataset version and the registry's current recipe version, with complete and covered_any_version beside it.
  • Lean failure views: the daily trend from stamps, the drill-down from D1 only. Follow-ups: Pipeline coverage history in the observability snapshot #2333 (coverage history in the observability snapshot), Page the full recordings table in the pipeline drill-down #2334 (paging the full recordings table).
  • Read only by default; the CLI opts in to the sync unless --no-sync; the website never syncs.

Deviations from the plan

  • complete is read at the recipe's last declared checkpoint before stored (every recording passed processing), not at stored.
  • The response records cells and by_status are z.record(...) of open values, so a key a newer Worker adds at that level never breaks a CLI; the CLI parses each cell with ComputePipelineCellSchema.
  • PIPELINE_STALLED_SQL now interpolates PIPELINE_STALLED_SECONDS and STALLABLE_JOB_STATES instead of a literal 180 and state list.
  • pipeline failures prints the Worker's sentence for an unknown stamp ("There is no such pipeline stamp."), as failWith does for every command.

Closes #2326
Part of epic #2324

Test plan

  • bun run typecheck, bun run lint, Biome on every touched file, bun run migrations:d1-check
  • Targeted: backend/test/compute-pipeline-grid.test.ts (22: who may, rows and cells, stalled, finished and failed runs, hold and refused stamps, totals, filters, runner filter and facet, paging, bad queries, read-only vs sync=1, the page's query plan uses the stamp index, run status SQL equals pipelineRunStatus, drill-down, coverage and trend), compute-pipeline-routes, compute-progress-reconcile, compute-pipeline-input, compute-admin-contract, compute-checkpoints, contract-schemas, admin-route-inventory, api-export-surface, help-tiers: 334 pass, 0 fail
  • test/admin-compute-pipeline-cli.test.ts: 65 pass, 0 fail (stamps, the grid, failures, refusals before anything is sent)
  • Mutations, each failing its test and reverted: the status SQL's unreported branch and its threshold; the hold exclusion; the eligibility predicate; the cursor > to >=; the run-filter flag; dropping the failed precedence and the zero-total rule of the mark; the coverage recipe-version and newest-version checks; the trend zero-fill; dropping a CLI flag's forwarding; extra standard output in --json
  • Not run: the full bun test (the epic to dev gate)
  • Not run: the website Phase 4b drift tests (Phase 4b: admin pipeline dashboard and coverage card website#586); they read this contract once the epic is on dev
  • Docs: nemarOrg/docs#140 (regenerated admin/commands.mdx and the operations page), to merge only after a nemar-cli release carries this

Review round 1

  • I1: a run that ended with no job (create_failed, no_job) has its outcome already: pipelineCellMark takes hasJob, so its cells read no_counts, never pending forever (grid and drill-down). Tests: a job-less failed stamp's row and drill-down, a pipelineCellMark case; mutation "ignore hasJob" fails 2 tests.
  • I2: unlisted counts only the recordings that first stopped at a checkpoint (its failed and skipped less the previous checkpoint's, which equals the previous checkpoint's passed less this one's once reconciled, and also holds for live rows), never one listed earlier; 0 for an unreconciled stored row. Tests: import, preprocess and quality of the four-recording run are 0; a run with 12 load failures lists 10 and leaves out 2. Mutation "count every failed and skipped recording" fails 2 tests. The schema description and the CLI wording ("and N more recordings that stopped here are not listed") say so.
  • S1: cellText looks a mark up only with Object.hasOwn, so a Worker word like constructor prints as the word. Test over four prototype words; mutation "index the table" fails it.
  • S2: help, route docblock and docs: stalled is "its last report is more than 3 minutes old ... a job that never reported is never stalled"; ? also covers a job that never reported or no job; complete is read at the last checkpoint before stored; coverage counts a finished run once a sync has recorded it (read-only views can lag); the grid works in read-only maintenance mode.
  • S3: RUN_DETAIL_SQL uses NEWEST_VERSION_SQL("s"); stamp_not_found is answered by the shared refuse of compute.ts; pipeline failures accepts any safe-integer stamp id of up to 16 digits, as the route does.
  • S4: docs#140 lists admin compute move-charge, is a GitHub draft, and says the website "will read" the routes.
  • Gates: typecheck, lint and Biome clean; targeted backend and contract tests 303 pass, 0 fail; test/admin-compute-pipeline-cli.test.ts 66 pass, 0 fail.

Review round 2

  • The stored guard stays as a documented defensive guard (the row reconciliation writes already gives 0); a test hand-seeds an unreconciled stored row that would otherwise read 4 unlisted. Mutation "drop the guard" fails it.
  • The running total of stopped recordings never falls (Math.max); a live-run test with a lagging checkpoint gives import 1, preprocess 0, quality 0 unlisted. Mutation "let the total fall" fails it.
  • Stalled wording in the CLI help: "or the job's state is unreported; a submitted, queued or running job that never sent a progress report is never stalled".
  • COMPUTE_PIPELINE_STAMP_ID_RE is declared once in shared/contract/compute-admin.ts and used by the route and the CLI; a CLI test sends failures 1000000001 and gets the Worker's answer.
  • Gates: typecheck, lint and Biome clean; targeted backend and contract tests 258 pass, 0 fail; test/admin-compute-pipeline-cli.test.ts 66 pass, 0 fail.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2335

Version: 0.10.40-PR2335.c787a27
Commit: c787a27


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review converged: round 1 by a two-reviewer panel (code+types+tests; errors+comments with docs#140), round 2 delta; every finding fixed, the last round verified by the driver. CI fix c787a27 (OIDC route walk gains the :stamp parameter). All checks green on c787a27.

@neuromechanist
neuromechanist merged commit 146c3ef into feature/issue-2324-epic-pipeline-progress Nov 23, 2026
27 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2326-pipeline-grid branch November 23, 2026 09:03

This branch was previously deployed

1 inactive deployment
npm — c787a27a Deployed Nov 23, 2026 by neuromechanist via publish #4801
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.

1 participant