Skip to content

Compute decision dialog: notice to the person - #583

Merged
neuromechanist merged 6 commits into
stagingfrom
feature/compute-decision-notice
Nov 22, 2026
Merged

neuromechanist merged 6 commits into
stagingfrom
feature/compute-decision-notice

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

The website half of nemarOrg/nemar-cli#2300, which adds a person-facing notice to the admin compute-access decision: required for suspend and revoke, optional for deny, refused for grant (COMPUTE_ACCESS_NOTICE_RULE / computeAccessNoticeProblem in nemar-cli shared/contract/compute-access.ts).
Without this, the Compute tab's Suspend and Revoke would get 400 invalid_body (notice: notice_required) once #2300 deploys.

Merge order (website ADR 0030 addendum)

This is a coupled change and merges as a pair:

  1. Merge this PR into staging first.
  2. Then merge Mail a notice with compute access decisions nemar-cli#2300 into dev immediately after.

Each side's parity check reads the other's pre-release branch, so test/account-copy-drift.test.ts and test/compute-admin-contract-drift.test.ts here are red against nemar-cli dev until #2300 lands there, and nemar-cli's account-copy-parity is red against staging until this lands.

Changes

  • src/lib/account-copy.ts: mirrors the new shared keys string for string (compute_admin.dialog.notice_label, notice_label_optional, notice_help, notice_required_hint; compute_admin.error.notice_required, notice_refused, notice_too_long, notice_control_char).
  • src/lib/compute-admin-contract.ts: transcribes COMPUTE_ACCESS_NOTICE_MAX_CHARS (1000), COMPUTE_ACCESS_NOTICE_RULE, the four notice words, and computeAccessNoticeProblem / hasPurposeControlChar with bodies identical to nemar-cli's.
  • test/compute-admin-contract-drift.test.ts: holds the bound, the rule record, the word union and both function bodies (token for token) to nemar-cli; new pure extractors extractStringUnion and extractFunctionBody in test/compute-contract-drift.ts, tested on inline sources. Same sparse checkout and NEMAR_CLI_COMPUTE_ADMIN_CONTRACT (the file was already in the list); the ci.yml comment says so.
  • decideComputeAccess(id, decision, reason, notice, init): sends notice trimmed, omits an empty optional one, and refuses a notice the rule refuses before sending (400 invalid_body with fields: [{ path: "notice", code }]), so nothing is posted.
  • readComputeError now returns a 400's fields; ComputeAdminApiError.fields, noticeProblemOf and noticeProblemText word a backend notice refusal from the copy instead of the raw notice: notice_required sentence. It is classified refused (no re-read, row restored).
  • ComputeDecisionDialog.astro: a "Notice to the person" textarea for suspend and revoke (required) and deny (optional), hidden for grant, which sends no notice key at all. The count is in code points after trimming. The line under the field shows the required hint or the problem in copy words, and the confirm button stays disabled until the rule accepts the notice. The page passes notice through the decide flow.
  • scripts/capture-compute-admin-fixtures.mjs: suspend and revoke now send a notice, and new captures cover deny_with_notice and the five notice refusals. The fixtures were re-captured from nemar-cli#2300 head 485352dd; the change is additions only, and existing ids are unchanged.

Testing

  • bun run typecheck: 0 errors
  • bun run lint: clean
  • bun run test with every NEMAR_CLI_* drift variable from ci.yml pointed at a detached worktree of nemar-cli#2300 head (485352dd): 238 files, 6655 tests passed
  • bun run build: passes (public/og-image.png restored afterwards)
  • nemar-cli side: account-copy-parity and publication-review-copy-parity with NEMAR_WEBSITE_* pointed at this branch, plus contract-schemas and the compute-access tests: 156 pass

@cloudflare-workers-and-pages

Copy link
Copy Markdown

@neuromechanist
neuromechanist merged commit 270d440 into staging Nov 22, 2026
3 of 4 checks passed
@neuromechanist
neuromechanist deleted the feature/compute-decision-notice branch November 22, 2026 16:28
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