Repository navigation
Phase B3b: admin quality views by stamp (#2324) - #2390
Merged
neuromechanist merged 19 commits intoNov 26, 2026
Merged
neuromechanist merged 19 commits into
neuromechanist merged 19 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2390Version: 🤖 Updated on each push. |
neuromechanist
merged commit Nov 26, 2026
6a88f88
into
feature/issue-2324-epic-pipeline-progress
48 of 53 checks passed
This was referenced Nov 26, 2026
This branch was previously deployed
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.
Phase B3b of #2324: the admin half of #2384. It adds an admin mount that serves a run's quality record and files by stamp, canaries included, for the website's W9 drill-down. The private mount stays in #2384.
What changed
GET /admin/compute/pipeline/runs/:stamp/quality/record/<recording>and.../quality/file/<sha256>/<recording>(backend/src/routes/admin/quality-views.ts), registered on the admin router after itsauthMiddleware,adminMiddlewareandcookieOriginGuard, and after the B3 run-quality page.state = 'stored'andexpires_athas not passed, of any retention (canary, catalog or published, superseded included). Every other case gets a fixed word and no store read:stamp_not_found,derivative_not_keyed,derivative_copying,derivative_failedorviews_expired.serveRecordingViews(backend/src/services/quality-serve.ts), and both mounts call it. It does the full schema check, recording scope only, the record's own dataset and recording, the row'squality_plugins, one file per digest, declared files only, the size bounds, a re-hash before serving,nosniff, and an attachment for unlisted formats. The public route keeps its gate and cache. The refactor does not change its behavior: B2's suites pass unchanged.cache.matchorcache.put. Every answer, refusals included, isno-store, with noCache-Tag, noETagand no public address.shared/contract/quality-route.ts):QUALITY_ADMIN_ROUTE_WORDS(the public words plus the five state words,method_not_allowed405 andquality_unavailable503), the path builders, andqualityAdminRest, which holds the grammar below.compute-pipeline.ts's header.The path grammar W9's proxy must enforce
restis the raw, still percent-encoded path after/admin/compute/pipeline/runs/<stamp>/quality/. It must be exactly one of:<recording>is one or more/-separated segments..or...^(?:[A-Za-z0-9._~!$&'()*+,;=:@-]|%[0-9A-Fa-f]{2})+$.%2F,%5Cor%2E(any case), and no encoded control character (%00-%1F,%7F).The proxy can call
qualityAdminRest(rest)from the shared contract; it returns null for anything outside the grammar. The backend enforces the same grammar, then checks that the recording is one the public route takes (isRecordingPath).Security points (a) to (f)
anonymous = 1, private, never published): an admin gets 200 with private headers and no public path in the body, and a member is refused. The public route refuses the same deposit, and nothing is cached.Mutation table
Script: kept in the session scratchpad (
b3b-mutations.py). Each mutant edits one gate, runs the targeted suites, and is reverted./\.allowed.and..segments allowedrunViewRefusal; the table's CHECK holds four states)expires_atignoredCache-Tagon admin answernosniffdropped from file headersTests
bun run typecheckquality-admin-views(new, 20 tests),quality-route,quality-cache-purge,quality-admin-route,quality-documents,metadata-json-quality: 134 passquality-route-contract,admin-route-inventory,api-export-surface,quality-documents-contract,compute-admin-contract: 207 passbun test: not run, per the epic's test-cost rule (it runs at epic todev)All tests run on real D1 (bun:sqlite with every migration), real hashed API keys through the real admin router, and Miniflare R2 holding nemar-ica's real product. Nothing touches a remote resource.
Refs #2324, #2384.
Agentic AI tools were used.