Skip to content

Mail a notice with compute access decisions - #2300

Merged
neuromechanist merged 10 commits into
devfrom
feature/compute-decision-reason
Nov 22, 2026
Merged

neuromechanist merged 10 commits into
devfrom
feature/compute-decision-reason

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

The compute terms (nemarOrg/docs#105) promise that a suspension or an ending of compute access is mailed with the reason and how to ask for a review. Part of #2026.

The audit reason stays free text for the record and is never mailed. A separate, person-facing notice is added:

Decision notice
suspend, revoke required
deny optional
grant refused (400), so an admin never believes a grant mail carried text it does not
  • Shared contract: COMPUTE_ACCESS_NOTICE_RULE, computeAccessNoticeProblem (one rule for the Worker and the CLI), 1000 characters after trimming, control characters other than newline and tab refused; the schema stays open, the route closes it with .strict()
  • Route: per-decision closed body; a refused notice is 400 invalid_body naming notice with the rule's word, never the value
  • Mail: notice escaped under a fixed heading; denial, suspension and ending close with "To ask for a review of this decision, reply to this email or write to .", where the address is the configured REPLY_TO (the same value the mail's Reply-To carries; [email protected] on staging), falling back to [email protected] only when unset. The old "contact the administrators" sentences are replaced by it. The mail is HTML only (sendEmail has no text part). Sentences stay in email.ts next to the other mail bodies: account-copy.ts is the copy the CLI and website render and mirror, and neither renders a mail
  • CLI: --notice <text> on suspend/revoke (required, checked before sending) and deny (optional); grant has no such option; the notice is sent trimmed, as the website sends it
  • Outer notice bound (4 * 1000 UTF-16 units on the value as sent) carries the rule word, so a heavily padded notice is 400 notice: notice_too_long, never a raw too_big
  • compute-terms.ts docblock: the counsel gate is gone; terms publish when compute opens
  • CHANGELOG entry

Follow-up outside this repo: the website compute tab (ComputeDecisionDialog) gains the notice field and the new mirrored copy keys, and it ships together with this Worker change: without it, its suspend and revoke buttons get 400 notice_required. The admin runbook admin/operations/compute-requests.md gains --notice in nemarOrg/docs (lands with this PR).

Release coordination: website staging first, then nemar-cli dev; the two main promotions (website and nemar-cli) are a pair and go out together.

Tests (targeted): bun run typecheck clean; biome clean on changed files (only pre-existing any warnings). Backend compute-access, hold-reaper, partner-credentials, lifecycle and email suites: 562 pass. Root compute-access CLI and notice unit tests, route inventory, export surface, contract schemas, compute contract, partner e2e, user e2e CLI: 880 pass, 2 fail in account-copy-parity (it compares against the sibling website checkout, and it also fails on a dev checkout; account-copy.ts is untouched here). Mutations checked: making suspend optional and dropping the notice escaping each fail a route test. Full bun test not run (epic -> dev only).

Review fixes (targeted): typecheck clean; biome clean on changed files (pre-existing any warnings only). compute-access-notice.unit + compute-access-cli: 40 pass. compute-access-decision-routes (70) plus every backend *email* suite: 290 pass. New tests: a route test with three padded or oversized notices (each 400 notice_too_long, no too_big, no value echoed, nobody mailed), a CLI test that a 1000-character notice plus 3001 spaces suspends and is mailed, and a route test that sets REPLY_TO (bare and mailbox form) and asserts the captured reply_to and the address in the sentence. Mutations: reverting the trim and the guard message makes the CLI and route padding tests fail.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2300

Version: 0.10.39-PR2300.ca74f1f
Commit: ca74f1f


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 651cde4 into dev Nov 22, 2026
51 of 53 checks passed
@neuromechanist
neuromechanist deleted the feature/compute-decision-reason branch November 22, 2026 17:26
This was referenced Nov 22, 2026

This branch was previously deployed

1 inactive deployment
npm — ca74f1fd Deployed Nov 22, 2026 by neuromechanist via publish #4733
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