Skip to content

W9: admin run quality drill-down (#588) - #598

Merged
neuromechanist merged 13 commits into
feature/issue-586-epic-pipeline-progressfrom
feature/issue-588-w9-admin
Nov 26, 2026
Merged

neuromechanist merged 13 commits into
feature/issue-586-epic-pipeline-progressfrom
feature/issue-588-w9-admin

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Phase W9 of #586 (tracking #588), part of nemarOrg/nemar-cli#2324: the admin run drill-down.

What it adds

  • Run page quality section (/admin/pipelines/runs/<id>): one sentence per run-quality word (run_in_progress included), a "Not public" label from dataset_public, the expiry date (an expired canary says "Expired on"), the deferral of a serving_index_deferred run, and a link to the drill-down.
  • Drill-down (/admin/pipelines/runs/<id>/quality): the run's succeeded recordings (paged by after), and one recording's stored-data views only (Spectrum, component maps, class histogram) drawn with the W4/W6 renderers. Views that declare inputs (nemar.ic-activity, nemar.signal-window) are listed as "drawn on the dataset page once promoted". No CSP change: every fetch is same-origin.
  • Same-origin proxy .../quality/[...rest].ts (src/lib/quality-views/admin-proxy.ts), meeting each obligation of nemar-cli's docblock:
    • adminGate;
    • rest from the raw url.pathname, never from params;
    • forward path from a copy of qualityAdminForwardPath;
    • any ? refused;
    • GET only (the route exports ALL);
    • the caller's own session cookie is the only credential forwarded;
    • no-store on every answer, upstream 401, 403 and 429 included;
    • a 4 MiB cap counted on streamed bytes;
    • only Content-Type, Content-Disposition and X-Content-Type-Options relayed (nosniff forced);
    • no redirect followed;
    • forwarded through the service binding (apiFetch).
  • Public link only for a current derivative of a dataset with dataset_public. A concealed anonymous deposit fails that gate, so it never gets one.
  • Contract copy: admin-route-contract.ts holds the admin mount and the proxy obligations. It is kept apart from route-contract.ts, so the dataset page carries none of it. The run-quality words go in compute-pipeline-contract.ts.

Tests

  • test/quality-admin-proxy.test.ts: covers every obligation on real Requests against a real local HTTP server. That includes nemar-cli #2390's dot-segment and encoding cases, non-GET methods, ?, the over-cap body, no service identity, no-store on every status, header stripping and redirects.
  • test/quality-admin-drill.test.ts: the drill client through the real proxy. Covers the expired, missing and failed states.
  • test/pipeline-quality-view.test.ts: tested on answers captured from the real backend (scripts/capture-run-quality-fixtures.mjs).
  • test/pipeline-admin-ui.test.ts: source scans (no set:html, gate before fetch, no-store, binding).
  • Drift tests widened to the admin mount, the obligations text and the run-quality words.
  • e2e/admin-quality.spec.ts: 7 pass against scripts/local-backend.mjs --seed-pipeline --seed-quality. The script now also seeds canary, expired, in-progress and deferred runs.
  • Mutation testing: 28 mutants, 27 killed. The survivor is equivalent: a raw . or .. segment is also refused by the decoded recording rule.

Gates

  • typecheck
  • lint
  • targeted Vitest
  • build plus size check (the admin-drill chunk is 25.6 KB of 30)
  • e2e
  • full bun run test (267 files pass, 8 skipped locally)
  • In CI the drift tests are expected red against nemar-cli dev until epic #2324 merges. The widened route and pipeline drift tests pass against the epic checkout.

Notes

  • The run detail does not serve runs_without_index_after; only a dispatch answer carries it. The page reads it when present. Otherwise it says the run goes ahead 24 hours after the first deferral, and gives the time this deferral was recorded.
  • The admin mount sends no ETag, so a record is read without one. It is still checked whole, view digests and file hashes included.
  • Overlap with W7 and W8: admin-drill.ts repeats panel.ts's draw steps rather than editing panel.ts; panel-model.ts is only imported.

Agentic AI tools were used.

Paths, words, grammar, forward path and the proxy obligations of nemar-cli's admin mount; the route drift test widened to them. Tested: drift test against the epic checkout (5 pass).
Run-quality and recordings states, page size, serving_index_deferred; drift test widened and the stamp pattern read from its new leaf. Tested: drift test against the epic checkout (7 pass).
Admin gate, GET only, no query, raw rest, forward path, caller's session cookie only, no-store, 4 MiB counted cap, three relayed headers, no redirects, service binding. Tested: proxy tests against a local HTTP server.
Local backend seeds canary, expired, in-progress and deferred runs; capture script writes their real answers. Tested: captured from the epic backend.
Tested: pipeline-quality-view (18 pass) on captured answers.
Tested: drill client through the real proxy (9 pass).
Tested: pipeline-admin-ui (81 pass), typecheck, build and size check.
Tested: 7 pass against the local backend.
Not tested: prose only.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: fde6064
Status: ✅  Deploy successful!
Preview URL: https://40f7e2cc.nemar-website.pages.dev
Branch Preview URL: https://feature-issue-588-w9-admin.nemar-website.pages.dev

View logs

sessionCookieOf picks __Host-nemar_session, else the legacy cookie; empty or duplicated is no session. A 204 or 205 is relayed without a body. Tested: proxy and drill tests.
Grouped by the panel's tab in the panel's words; links #600 for the shared drawView. Tested: drill tests.
Tested: e2e 7 pass on the local backend.
Tested: pipeline-admin-ui (86 pass).
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