Repository navigation
Phase E3: Compute job page - #507
Merged
neuromechanist merged 17 commits intoNov 7, 2026
Merged
neuromechanist merged 17 commits into
neuromechanist merged 17 commits into
Conversation
neuromechanist
force-pushed
the
feature/issue-496-compute-job-page
branch
from
November 7, 2026 17:21
18360f2 to
bc998d7
Compare
neuromechanist
merged commit Nov 7, 2026
41299d4
into
feature/issue-493-epic-compute-web
2 of 3 checks passed
This was referenced Nov 7, 2026
Closed
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 E3 of epic #493: the compute job page
/compute/jobs/<id>. Implements #496 from the approved plan (#496 (comment)) and the driver's answers to its eight questions. Base is the epic branch; do not merge here.What it does
chargeTextwith the table), one plain sentence per failure code (17), the log on request, result links on request with renew and cursor paging, and a cancel for a live job through the sharedConfirmDialog.nextPoll, injected clock).displaySafeBodyso hostile characters are written out; lines capped at 2,000 characters; last 200 lines with "Show earlier lines"; a log cut at 1 MiB says so and points atnemar compute logs.safeResultHref,rel="noopener noreferrer", never stored, logged or copied; the list clears on a bfcache restore and when the links expire.Cache-Control: private, no-storeandReferrer-Policy: no-referrerbefore any return;/computeadded torouteBypassesEdgeCache; the proxy forwardsX-Nemar-Truncated(its constant has one reader, a scan asserts it)./compute/jobs/<id>is this route; no mismatch.Backend gaps filed (nemar-cli, generic wording)
nemar-cli#2094 log tail (the route serves the FIRST 1 MiB; the issue text assumed
?tail=), #2095 result links as attachments, #2096 server-stated results expiry, #2097 per-stage times. Existing: #2079 (job name; the guard reads an optionalname).Where the backend differs from the issue (the backend won; quoted from caf3a77a, 27eecff9)
The job read is
GET /compute/me/jobs/:idanswering{ job, stale }; 17 failure codes, not 8; notailon the log; no job name; three times only; the cancel route refuses nothing by state (an ended job answers 200already_ended,cancelled: false), socanCancelis the page's own choice; the links field isfiles; no route serves the submitted record or manifest, so the 410 copy says only what the page keeps (state, resources, charge, log).Deviations from the plan
cancel_requestedagain, notalready_cancelled(captured); the words follow the data.compute-job-live.tsis the clock exception; the page frontmatter reads the clock through itsnowMs(so the one-clock rule holds).localjobs(the concurrency limit left no room onlocalrich) and runs the backend asENVIRONMENT=developmentbecause compute only runs inproductionordevelopment.noticeis required by the guard (a missing one is a shape error) so it is never retyped on the site.Fixtures
Step 0 passed: the backend's lifecycle fixture runs outside
bun test.scripts/capture-compute-job-fixtures.mjs(command incompute-api-job.test.ts's header) writes nine files from the real router: the ten states, 17 failure codes, a recorded cancel, a stale read, a lifecycle job at running and finished, logs (live, ended, empty, hostile, over 1 MiB headers only, none yet), results (get, renew, second page, bad state, expired 410, failed), cancel outcomes (including with the cluster down) and the refusals. Lifecycle files carry fresh ids and signatures on every run; the first page of 1,000 links is summarized, not stored.Gates
bun run lint,bun run typecheck(0 errors),bun run build(passes;public/og-image.pngreverted).bun run testwith the drift variables pointed at the Epic D worktree (27eecff9): 192 files passed, 3 skipped, 5263 tests passed. New:compute-job-view,compute-logs,compute-failure,compute-api-job,api-proxy-compute-log,compute-job-ui,compute-job-contract-drift, middleware andsafeRedirectPathcases.>to>=at the retention boundary (1), cancel offered with a cancel recorded (2), non-https result link (2), hidden tab does not pause (1), ANSI not stripped (5), proxy header dropped (1).dev: the drift tests (newNEMAR_CLI_COMPUTE_SUBMIT_CONTRACTand_RESPONSES_CONTRACTvariables and sparse-checkout paths added toci.yml).Browser check (real Chrome, real local backend with
--seed-compute --seed-compute-jobs)Run: finished job (log, Get links, download list, Renew gives new links, no link in the source, storage, URL or console; a minted link fetched with curl returns the file); the watch job went running to finished in place with the aria-live text, results and retention line appeared, polling stopped (no requests afterwards); polling on a running job at about 7, 19, 42 s (10, 20, 40 s backoff with jitter); hidden tab simulated with
document.hiddenandvisibilitychange: no request for 80 s, one immediately on return; cancel from the dialog with a double click on confirm sent one POST, badge to Canceled, status line focused; cancel from a stale tab (job already canceled elsewhere) says "The job was canceled."; hostile log (escapes visible, nothing executed, 5,000-character line capped); log over 1 MiB (truncated note, "last 200 of 33,116 lines of the first 1 MiB", earlier lines add 1,000); 1,002 outputs (100 rows, 9 x "Show 100 more" to 1,000, next page, Renew of the page shown, back to the first); expiring (2 days left) and expired (real 410 copy, button gone); foreign, absent and malformed ids answer the same 404 page; page headers; signed-out 302 to login withnext; light and dark; 360 px in an iframe (no horizontal scroll, stacked rows).Not run or not verifiable: a real click on a result anchor opening a new tab (the tab did not appear in the tool's group; the link's bytes were verified with curl and the anchor's
rel,targetandreferrerpolicyinspected); a truly hidden tab (simulated); keyboard-only run and focus order,prefers-reduced-motionlive (no animation in any job style by a scan), a real screen reader; astale: truepage and a 5xx live (fixture and unit tests only); Escape in the dialog; the deployed build. Dev-server finding:bun run dev(Vite) 500s a URL ending in.txt(a results cursor that is a path ending in.txt); dev-only (a deployed build was checked), no code change; the seed uses.dat.Review round (security review: no Critical; all findings fixed)
AbortSignal.timeoutfor each and a mutation (job read back on the 5 s default) that fails them.compute-job-results-state.ts, rendered by onerenderResults(); the "Get download links" button is derived from the job, not from what was shown last, so a back-forward-cache restore brings it back. 13 behavioral tests (rows dropped afterexpires_at, restore drops every link and status and returns the button, 410 never returns it); mutatinghandlePageshow,expireIfDueand the button rule to no-ops, and keeping the rows after expiry, each fails tests. No DOM harness was added: the pageshow listener is only a one-line call into the tested function, pinned by a source scan.allowLoopback); logs write out LRM, RLM and ALM (anescapeMarksoption ofdisplaySafeBody, mail unchanged); the first poll no longer counts as a change (10, 20, 40, 60: the SSR record seeds state, cancel flag, charge and stale); result anchors carry the file path as visually hidden text and the<ul>lostrole="region"; a partner job'sbad_statereads like its log ("appear once NEMAR has checked the job"); Refresh and Resume go through the poller's one-in-flight rule (restartNow), show "Refreshing", and on failure stop the poller and say "Could not refresh just now. Try again."; the source scan banswindow.open,location.assignandreplace,sendBeaconand friends, and its comment stripper no longer takes a//inside a string, template or pattern for a comment (tested); role=status regions are filled one tick after they are un-hidden.pageshowwithpersisted: trueafter Get links (list gone, panel hidden, button back, no link in the DOM, Get links works again); a cancel that takes 7 s (longer than the old 5 s deadline) ends in "The job was canceled."; a forced 2-hour clock jump shows "Updates paused." with Resume, a failed Resume shows "Refreshing" then the failure sentence with the button usable, a successful one clears it.clearResultssuccessor and the expiry timing are tested through the pure functions and the browser, not through a DOM test.