Repository navigation
Description
Goal
After this phase a signed-in person can see their compute access state and request access from Settings, in the same words the CLI prints, and the repository has one documented way to run the website against a local backend with a real session.
The decision that compute pages are Phase 3 of website ADR 0010 is recorded.
Routing
- Readiness: expand. The planner reads Epic D's merged Phase D1: Compute access request and approval nemar-cli#2022 and Phase D2: Compute user API and read commands nemar-cli#2023 (the
compute_access*fields on the session user,POST /users/me/compute-access/requestand its refusal codes,GET /compute/meand itsaccessobject, thecompute_access.*copy keys, thecompute_accessgap block and the newaffiliationgap) and quotes the real names in the plan. The plan must decide: how the card reaches the current terms version (server-sideGET /compute/mein the page frontmatter is the intended route) and what the card shows when that read fails; how the refusal renderer is shared with the upload-access card without copying it; and the exact local sign-in recipe, found by trying it. - Implementer: Sonnet
- Opus checkpoint: none
- Depends on: Phase D1: Compute access request and approval nemar-cli#2022, Phase D2: Compute user API and read commands nemar-cli#2023; Unblocks: Phase E2: Compute dashboard #495, Phase E3: Job page #496, Phase E4: Admin compute tab #497, Phase E5: Replace the Compute dialog #498
- Repository and base branch: nemarOrg/website, epic branch
feature/issue-#493-epic-compute-web
Scope
In: the #compute-access card beside #upload-access in src/pages/settings.astro; transcribing the new copy keys and gap rules; the session-user fields and state derivation; the request client; the Affiliation field label; the local-backend recipe; the ADR.
Out: the dashboard (#495), job pages (#496), the admin tab (#497), the dataset dialog (#498); any change to who may request (the backend decides).
Design references
Design section 4 (the request preconditions, states, "compute access and upload access are separate grants"); website ADR 0010 (Phase 3), ADR 0014 (account tier surfaces), ADR 0015 (profile gaps and mirrored copy).
Closest code: src/pages/settings.astro (#upload-access card, the "Upload access request" script block), src/lib/account-tier.ts (deriveUploadAccessState, validateWhy, uploadAccessErrorMessage), src/lib/account-api.ts (requestUploadAccess, AccountApiError), src/lib/account-copy.ts, src/lib/profile-gaps.ts, src/lib/docs-base.ts.
Changes
- Create the ADR
.context/decisions/<next>-compute-pages-follow-adr-0010-phase-3.mdfrom0000-template.mdand add it to the README index: compute pages are ADR 0010's Phase 3; access is the separatecompute_accessgrant (nemar-cli ADR 0040 keepsservice_accessfor upload); the pages are a front end that decides nothing; compute pages live on the app host only; charts are hand-rolled (ADR 0007); untrusted job text renders inert (ADR 0029). - Transcribe, do not import: new
compute_access.*keys and thegap.blocks.compute_access,gap.blocks.noun.compute_accessandgap.field.affiliation.*keys intosrc/lib/account-copy.ts; the"compute_access"block, the block order and theaffiliationrow intosrc/lib/profile-gaps.ts(its derivation and the nemar-cli one are the same rules). Run nemar-cli'stest/account-copy-parity.test.tsandtest/profile-gaps-matrix.test.tswith both checkouts side by side and record the result in the PR. src/lib/auth.tsandsrc/lib/account-tier.ts:compute_access,compute_access_requested_atandcompute_access_granted_atas optional fields, never defaulted (absent means the backend cannot say, and the card says nothing about state rather than "not requested");deriveComputeAccessStatereturningnone | requested | active | suspended | denied | revokedwith the stamp. Extend the dev mock users insrc/lib/auth-dev.tsthe way@nemar.askedwas added, soastro devrenders each state.src/lib/compute-api.ts(new; Phase E2: Compute dashboard #495 extends it):getComputeMeoverdashboardApiBase, SSR withcookieHeader, browser through/api/v1, with the deadline helpers the other clients use.src/lib/account-api.ts:requestComputeAccess({ purpose, acceptTermsVersion })andcomputeAccessErrorMessage(status, code, detail)coveringpurpose_required,terms_not_accepted,email_not_verified,orcid_not_proven,profile_incomplete,access_closed,already_active,terms_unpublished, and an unknown code.src/pages/settings.astro: acard card--widewithid="compute-access"after the upload-access card, same markup shape: a Status row (badge per state with the date), the state body from copy, and for statenoneon a verified account a form with the purpose textarea (20 to 1,000 characters with a counter), a required checkbox "I accept the compute terms" showing the current version and linking the terms page (DOCS_COMPUTE_PATHinsrc/lib/docs-base.ts), the refusal list frommissing(reuse the upload card's renderer), and an alert line.terms_publishedfalse shows theterms_unpublishedcopy and no form.orcid_not_provenpoints at the ORCID card. Use[hidden]with:not([hidden])display rules, the known Astro gotcha. Duplicate the card CSS with a sync comment; do not hoist it.- The Affiliation input: its "optional" tag becomes the copy key's "needed for compute access". Check that
ProfileNudgeand the dashboard nudge do not now nag every account about affiliation beyond what the gap copy says; if they do, say so in the plan. .context/handoff.md(or a new.context/local-backend.md): the recipe for runningbun run devagainst a local nemar-cli backend (PUBLIC_API_BASE_URL, the seeded@nemar.testfixture accounts whose sign-in codes the dev backend echoes, how the session cookie is obtained on localhost, and what to do if it cannot be). If no working recipe exists, stop and escalate: the later phases and the epic check depend on it.
Tests (write these first)
deriveComputeAccessStatefor all six states and for absent fields. Fails if absent maps tonone.account-copy.test.tsandprofile-gaps.test.tsextended: every transcribed key exists, the block order isverified, upload_access, compute_access, publication,affiliationblocks only compute access, and the nemar-cli parity test passes with both checkouts.computeAccessErrorMessagefor each code, using response bodies captured from the merged backend (a refusal for each code, fixture provenance in the test file). Fails if a code falls through to the generic message.parseAccountErrorBodykeepsmissingfor a compute refusal.- A
getComputeMetest with a capturedGET /compute/mebody, includingterms_published: false. - Browser check, not Vitest: each state of the card in
astro devwith the mock users, then against the local backend with a real request, in light and dark and at phone width; confirm no horizontal scroll and the hidden-attribute behaviour.
Acceptance criteria
- A request from the card reaches the backend and the card re-renders as requested; a refusal lists its missing fields as links.
- No sentence about compute access is typed at a call site; all come from
ACCOUNT_COPY. - The local sign-in recipe works from a clean checkout and is written down.
- The ADR is in the index.
Gates
bun run typecheck && bun run lint && bun run test && bun run build, plus nemar-cli bun test test/account-copy-parity.test.ts test/profile-gaps-matrix.test.ts with the checkouts adjacent.
Rules that bite here
- ADR 0015: copy and gap rules are transcribed and pinned by a drift test on each side; a retyped sentence is drift.
- Absent is unknown, not "no": showing "Not requested" to an account the old backend could not describe invites a request that will be refused.
- Scoped styles do not cross components; duplicate and comment.
- Never use mocks: fixtures are captured from the real backend.
Closes #Ndoes not close issues here; close by hand.
Escalate to the owner if
- The merged backend differs from the design in a way that changes who may request or what the card may promise.
- No local session recipe can be made to work.
- The compute terms page is not yet published and the owner wants the form open anyway.
When merged
Note in the epic issue which keys and rules were transcribed and from which nemar-cli commit; tell the nemarOrg/nemar-cli#2022 driver if the drift test needed a change on the nemar-cli side.
Activity
neuromechanist commentedon Nov 7, 2026
Merged into the epic branch (PR 502, c06ccd5). Expected CI reds until the compute epic reaches nemar-cli dev: account-copy-drift (27 keys) and compute-terms-contract-drift.