Repository navigation
Release 0.10.24 - #1964
Merged
Merged
Release 0.10.24#1964
Conversation
* feat(email): Cloudflare provider behind a flag Add EMAIL_PROVIDER=cloudflare and a send_email binding path in sendEmail behind the unchanged dev fence. Resend stays the default. Cloudflare error codes map to EmailRejectedError or a plain Error. Tested with a binding recorder and Miniflare's send_email binding. * feat(email): Cloudflare path for broadcasts With EMAIL_PROVIDER=cloudflare, sendBroadcast sends one message per allowed recipient through sendEmail; the per-recipient fence and result accounting are unchanged and the Resend batch path stays for production. Tests use the shared binding recorder. * feat(email): store inbound mail in R2 Add the Worker email() handler. A message routed to the Worker is stored raw at inbound/raw/YYYY/MM/DD/<uuid>.eml with envelope metadata; with no MAIL_INBOUND binding it is rejected. Adds the EMAIL, EMAIL_PROVIDER and MAIL_INBOUND binding types and the ForwardableEmailMessage lint global. Tested against Miniflare R2 and the bundled Worker. * chore(staging): wire Cloudflare mail for dev Add the dev send_email binding restricted to the staging senders, the nemar-mail-dev inbound bucket, and EMAIL_PROVIDER, FROM_EMAIL and REPLY_TO for test.nemar.org. Only [env.dev] changes; production stays on Resend. * docs: ADR 0110 and email epic notes Record the move to the Cloudflare Email Service as a proposed ADR, add the epic working notes, and link them from the context index. * fix(email): refuse an unknown EMAIL_PROVIDER An unknown provider value now throws EmailProviderConfigError instead of using Resend, and that error counts as a certain non-delivery. The resolver returns the provider with its binding, used by sendEmail and broadcast. * fix(email): bound each broadcast send On the Cloudflare provider each per-recipient send in sendBroadcast is bounded, so a hung binding fails that recipient instead of holding the admin request. * fix(email): byte-clamp inbound metadata, retry put Clamp the three header-derived metadata values by UTF-8 bytes without splitting a character, and retry a failed put once without metadata so the message is kept. The body stays buffered because the retry needs the bytes again. * feat(email): add a text part on the Cloudflare path Derive a plain-text alternative from the HTML with a small dependency-free converter; codes and links survive. The Resend request is unchanged. * docs: align ADR 0110 and epic notes Match the strict EMAIL_PROVIDER rule and the text part, place the index entry after ADR 0109, and correct the Wrangler pin note. * fix(email): harden the HTML to text converter Decode each link label, url and text exactly once and never re-strip decoded text, look entities up in a Map, read unquoted href, cap the input at 256 KiB, and scan blocks and links forward once so unclosed tags cost linear time.
The tag v0.10.23 was created at 2026-10-23T23:51Z, so the entry is dated 2026-10-23. Docs only, tested with the changelog format test.
The apex MX moved to Email Routing on 2026-10-23 with the catch-all forwarding as before, and the soak fallback is limited to refusals that certainly sent nothing. Epic phase table matches the issues.
Email on Cloudflare, phase 1: staging mail
The live send_email runtime refuses an EmailAddress object whose name is not a string, so a bare reply-to address made every staging send fail. Miniflare accepted it. Tested: email provider, broadcast, binding and inbound suites; typecheck; biome.
* Fall back to Resend on Cloudflare quota refusal * Bind Cloudflare email in production, no switch * Sort imports in email-provider test * Log and harden the Resend fallback
bun install blocked it; the script only links a fallback binary. Tested: bun install prints no blocked-script notice, lint and typecheck pass.
* feat: queue announcements on the outbox Migration 0100 adds status and outcome counters to broadcast_emails. sendBroadcast enqueues one message per allowed recipient when the Cloudflare provider and EMAIL_OUTBOX are both present. Tested with real D1 and a recording Queue binding. * feat: consume the announcement outbox queue() dispatches broadcast messages to handleOutboxBatch, which sends through sendEmail and records each outcome on the audit row. Rate limits retry after 300s; unknown outcomes are never retried. Exports CLOUDFLARE_LIMIT_CODES. * feat: announcement status route and CLI GET /admin/notify/:id reports a queued announcement's counts; nemar admin notify prints the queued result and gains --status. POST answers 502 when enqueueing fails. * fix: idempotent announcement outcomes Add broadcast_outcomes keyed by recipient hash; counters move only when the outcome insert took. A partial enqueue records unqueued outcomes and answers 200 with the counts. * fix: bound outbox retries and pace limits max_retries 10 with growing limit delay, give up and record a failure on the final attempt, defer the rest of a batch after a limit refusal, skip already-recorded recipients. Names the queues in wrangler and tags the unrecognised-message log. * fix: show enqueue failure and redaction in CLI * test: allow 0100's outcomes table after 0098 * fix: dedupe queued recipients by hash key * test: pin getBroadcastStatus export Adds the new CLI API export to the per-module pin and the post-split list. Tested: api export surface, notify CLI and route inventory tests. * feat: store email bounce and complaint events * feat: route email events, prune after 180 days * docs: amend ADR 0110 for the soak and events * test: account for 0101 and events consumers The outbox retry check now reads only the outbox consumers, and the 0098 schema check lists 0101's table and indexes as a later migration's. Tested: events, outbox, 0098 migration and provider suites. * fix: delay event retries, tighten ADR 0110 A failed D1 write now retries after a growing delay instead of at once; the ADR states the outbox retry bound, the de-duplication, and that every other event type is dropped. Tested: events and outbox suites, ADR index, typecheck.
* Let an administrator redo a finished review start takes ?redo=1: a reported commit is restarted on its row through the restart edits use, a running review is never superseded (review_running), the Worker echoes redo, and the audit row records it. No SQL or migration change. Tested with the real handler and router, and with six mutations of the restart rule. * Add --redo to nemar admin pr-reviews start Named redo, and start --all --redo for every open pull request with a finished review (drafts, running reviews, exempt pull requests and commits capped for edits stay out). A Worker that predates the flag is detected by the missing echo and the command says so. Tested through the real CLI against the real router, and with four mutations. * Record start --redo in ADR 0093 and 0107 Amendment of ADR 0093 for the redo and its two limits, the matching notes in ADR 0107 decision 4, and one clause in the AGENTS.md ADR 0093 entry. Docs only. * Keep a redo off live jobs, blocks and the edit cap Review findings on the redo: an administrator's start no longer supersedes a job still inside its limit (claimed less than 50 minutes ago, even after the watchdog closed the row), a redo of a blocked contributor's finished review answers contributor_paused and writes nothing, a redo leaves the edit count alone, and an administrator's start is tried again when the row moves under it. The job limit is pinned to the workflow. Tests with five mutations. * Report an ignored --redo truthfully A Worker that predates the flag: the answer it gave is reported (a start it made is not hidden), then the command says the flag was ignored and exits 1 without the bug-report hint; a bulk run stops after one answer and keeps its results, in the JSON too. The dry-run list marks the finished reviews and their verdicts, and the help states the block, exemption, running-job and edit-count rules. * Bring the redo ADR text in line with the code ADR 0093 amendment: blocks, edit count, the claim window, retries, volume and the name overlap with ADR 0102; ADR 0092 and 0107 pointers; AGENTS.md wording. Docs only. * Refuse the restart if a job claimed meanwhile The restart write now also requires the claimed_at it read, so a job that claims the review between the guard and the write is never superseded by an administrator's start; the next try reads the claimed row and the guard refuses it. Tested with an injected claim, redo and plain, and a mutation. * Polish the ignored --redo report Say how many were not tried only when some were; report the ignored flag before a fault exit and keep the bug-report hint for a real fault; mark the finished reviews of every verdict in the tests; say in the help that a recent claim holds a start back. * Tighten the redo ADR wording ADR 0092 names the 50-minute claim window, ADR 0093 says which starts begin the edit count again and that a blocked redo leaves the result alone. Docs only.
Email on Cloudflare: Phase 2 (production sending prepared)
freshDb and freshDbWithForeignKeys deserialize a copy of a lazily built migrated template. Full backend suite: 8446 pass, 183 s.
unit-pure-shard runs bun test --shard=i/6 with seeded timings; the unit-pure gate keeps the required check name and proves every classified file ran. The file classifier moves to scripts/ci/unit-pure-files.sh, shared with deploy-backend test-gate (left serial). Tier-routing guard reads the script.
Gate proves the exact set of files each shard ran (junit), none twice; deploy gate and shards write the classifier output to a file and refuse an empty list; one unit_pure_due output replaces three copies of the nine-term filter; tier guard pins both callers of the shared script.
The exactly-once block meant for the unit-pure gate was also inserted into the scrub-tools gate, which has no file list, so jq failed to compile and the gate went red although every scrub shard passed. Tested: workflow YAML and tier-routing suites (64 pass).
* feat: add support ticket tables (migration 0102) * feat: ticket assignment and visibility rules * feat: parse and thread inbound mail into tickets * feat: ticket inbound mail after the raw put * feat: release tickets on demotion, revoke, delete * refactor: move clampUtf8Bytes to lib/utf8 * fix: tighten ticket schema checks and indexes * fix: reserved restricted tags, tombstone unlink * fix: authorise threading, verified auth, reopen * fix: let a ticket's own restriction bind assignment * fix: strict alignment, guarded reopen events
* Add a sliding-window scheduler for bulk starts runPaced keeps at most n of the reviews a run started in progress, starting the next as each leaves in_progress. A read that cannot tell is never taken as finished, and three in a row stop the run. Ctrl-C ends a wait at once and reports what was never tried. Tested on a simulated pool with a virtual clock, with six mutations. * Add --concurrency to nemar admin pr-reviews start start --all [--redo] --concurrency n keeps at most n of the reviews the run started in progress, reading the admin list every 30 seconds while it waits. Ctrl-C and three unreadable lists in a row stop the run and list what was never started (as commands for a redo). The unpaced run goes through the same scheduler with no limit. Hint above ten starts at once, plan in --dry-run, concurrency and not_started in the JSON. Tested through the real CLI against the real router with jobs finishing during the run, and with five mutations. * Record the pacing of a bulk start in ADR 0093 Amendment for start --all --concurrency and the pointer from ADR 0107's note on the output-tokens-per-minute limit. Docs only. * Keep the pacing honest when the list misleads Review fixes for the scheduler: a review that leaves the in-progress list is confirmed finished before its slot is freed (a closed pull request or a lagging search also drops out), a start that may have reached the Worker takes a slot, a slot is held at most 100 minutes, a read in flight no longer holds Ctrl-C, and Ctrl-C during the last unreadable read ends as interrupted. Tests with four more mutations. * Make Ctrl-C and the stop reports reliable A second Ctrl-C leaves at once and the first says so, one keypress delivered twice counts once, ten unreadable reads (about five minutes) stop the run with a dim line for each, a failed start is listed to be checked, the redo continuation says to run the commands by name, and no markReportedExit before exit 130. Tests for a closed pull request, a hanging list read, a hanging start (paced and unpaced), the unreadable branch and the 128,000 figure. * Correct the pacing amendment The overdue time is 90 minutes, not 60; leaving the list is confirmed; the unpaced run's Ctrl-C and JSON change are named; ten unreadable reads; the second amendment is named in ADR 0107. Docs only. * Hold the slot for a cut connection and name the commit Round 2 fixes: a start whose connection or response failed (status 0) may have begun the review and takes a slot; the confirmation names the commit the run started so an unreadable GitHub or a moved head no longer reads as finished; both reads are bounded at two minutes; a second Ctrl-C says which start was in flight. The tests observe the front instead of sleeping, kill every child they launch, and cover the dropped response, the unbounded read and the moved head. ADR 0093 follows.
* feat: threading headers on sendEmail * feat: support_tickets email preference * feat: escalation owner on mail queues * feat: notify admins of new tickets * feat: support ticket admin routes * chore: production MAIL_INBOUND binding * docs: ADR 0111 support tickets * fix: use 3a restricted tags and reply_failed * fix: escalation owner cleared when not owner * fix: mail routes hide counts, replays, reopens * fix: idempotent replies, trimmed References * docs: ADR 0111 review fixes * fix: announce reprocessed tickets before 404 * fix: reopen guard, References keeps root * docs: ADR 0111 key lifetime rules * test: expect support_tickets in --all update Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
CI: migrated test db template and six unit-pure shards
* Add terminalSafeText for ticket text Co-Authored-By: Claude Opus 5.5 <[email protected]> * Add mail admin API client functions Co-Authored-By: Claude Opus 5.5 <[email protected]> * Add nemar admin mail command group Co-Authored-By: Claude Opus 5.5 <[email protected]> * Escape direction marks and zero-width characters Co-Authored-By: Claude Opus 5.5 <[email protected]> * Harden admin mail errors, names and usage exits Co-Authored-By: Claude Opus 5.5 <[email protected]> * Name exit 4 in the mail help line Co-Authored-By: Claude Opus 5.5 <[email protected]> * Print mail output only once fully built A failed name lookup partway through show, queues or away no longer leaves a partial render on stdout. --json detection in usage errors ignores arguments after --. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Stop advising a retry on delivery unknown The server answers every repeat of a reply_delivery_unknown key the same way and never sends it, so the CLI no longer tells the caller to retry with it. It says to read the thread and that only a new key sends again. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Escape every invisible format character The display escape set now covers Unicode category Cf (soft hyphen, invisible operators, tag characters) and the invisible look-alikes outside it (combining grapheme joiner, Hangul fillers, variation selectors). Astral code points are written as \u{...}. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Type reply and note message ids as numbers ReplyResponse.message_id is the stored row id, a number; the contract said string. Adds NoteResponse for the note route. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fork pull requests on dataset repositories now get BIDS validation and version-check: the per-dataset shims trigger on pull_request_target, check out nothing from the pull request, pass only shape-checked identifiers through env, and mint a token scoped to the .github repository.
* test: pin fork shim safety properties * docs: amend ADR 0020 for fork shims * docs: index the ADR 0020 amendment
Email epic: support tickets, nemar admin mail, retention
* Stop setting Message-ID on ticket replies * Answer mail reply errors with 409 and 422 * Accept word ticket refs in mail_tickets * Use three-word ticket references * Use template literals in mail route test * Address review of word refs and replies
Email epic: fix ticket replies, word refs
Per-admin unread mail tickets
Sweep CI accounts with open upload requests
Merged
Contributor
Author
Release review: integration scope,
|
* Changelog for 0.10.24 * Fix exit codes and onboard note
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.
Release 0.10.24
This PR promotes
devtomainwith a regular merge, never a squash. The head isdevat 59f3b45 (version 0.10.24-dev16).The release ships epic #1893, which moves NEMAR mail onto Cloudflare Email Service and adds support tickets. It contains Phases 1 to 5 and 6a (#1902, #1917, #1916, #1928, #1930, #1940, #1944, #1945, #1952) and per-admin unread markers. It also contains the dataset CI shims on
pull_request_target(#1784, #1947), the upstream tag passed through onboard (#1933), the--redoand--concurrencyflags onnemar admin pr-reviews start(#1922, #1929), the shardedunit-purejob, and the staging test-account sweep change.Production keeps sending through Resend:
EMAIL_PROVIDERis unset in the production stanza, and switching it is Phase 2's flip after the sending-limit increase and a soak. No routing rule targets the production Worker yet, so theemail()handler is inert until the Phase 6 cutover.Pre-merge checklist (
.context/release-safety-playbook.md)devhead (59f3b45), includingintegration-dev; the checks on this pull request run on the same head.CREATE ... IF NOT EXISTSorADD COLUMNwith defaults. 0107's backfill and 0109's rebuild touch onlymail_tickets, which this same release creates, so they run on empty tables in production. No existing production table is rebuilt, dropped or rewritten. The 0102 seed points the*queue at thenemarAdminaccount, which exists in production with the admin role (checked read-only); if it did not, the insert would still succeed and tickets would fall to the pool.send_emailbinding (noreply@ and support@), theMAIL_INBOUNDR2 binding, theEMAIL_OUTBOXproducer and the outbox and events consumers with dead-letter queues, andMAIL_RETENTION_DAYS = "730". The bucket, all four production queues and the Email Sending onboarding of the domain exist (checked 2026-10-25), so the deploy does not fail on a missing resource.REPLY_TOchanges from info@ to support@ on deploy. Until the cutover, support@ reaches the same monitored inbox through the existing catch-all.deploy-backend.ymlstill installs the root dependencies before the backend ones (shared/changes).postal-mimeis a new backend dependency with an updated lockfile.auto-tag.ymlis unchanged.purgeExpiredTicketsjoins the dev cron allowlist; it touches only that environment's own mail tables. The test-account sweep is gated byisNonProductionEnvat the call site and inside the function. Ticket notices go only to active owners and admins with the preference on, never to senders, and the inbound handler never auto-replies.origin/main...origin/devdiff: one integration-scoped reviewer (Sonnet). No Critical findings. Its three Important items were deploy preconditions, theREPLY_TOchange and the 0102 seed; each is answered in the boxes above.000013bf-00000ce6-00005110-64cf5ca31e52bdf5d534f266b33e7ec2, read 2026-10-26 at about 02:42 UTC. The latestnemarOrg/nemar-db-backupcommit is 2026-10-26T02:22:56Z.1e3405ca-0f0b-4aaa-bc8e-7e78a2d9dba1(deployed 2026-10-24 00:22 UTC)./healthreports 0.10.23 before this release.Production effects
Reply-To: [email protected].Post-merge watch
deploy-backend.ymlonmainruns twice (the merge, then the strip commit). Both must reach the/healthsmoke check, and/healthmust report 0.10.24.auto-tag.ymlcreatesv0.10.24,npm-publish.ymlpublishes it, andsync-dev.ymlmovesdevto 0.10.25-dev0.nemar admin mail queuesagainst production lists*,securityandconduct.Rollback
cd backend && bunx cfman wrangler --account sccn rollback 1e3405ca-0f0b-4aaa-bc8e-7e78a2d9dba1 -c wrangler-sccn.toml.main.