Repository navigation
docs(whats-new): patches read a company mailbox and keep its attachments - #1293
Merged
Merged
Conversation
Release 39, written from 17b1ad8: the Email (IMAP) integration (#1266, #1262, #1264). Sets the patchy release to 0.39.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 of 2 tasks
allisonmahmood
added a commit
that referenced
this pull request
Nov 8, 2026
## What changed Every open of a patch added a full point to that person's score for it, and Home's **Your usual** sorts by that score. The coming switcher (#1091) makes it easy to flip between two patches all day, and each flip would add another point, so those two would crowd everything else off the shelf. Now an open adds its point only when it comes at least 10 minutes after the person's last open of that patch. An open inside the window still moves the last-open time, so a patch reopened every few minutes counts about once. The score now counts separate returns, not raw opens. Closes #1267 ## Look at **The conflict branch of `upsertOpen`** (`packages/patches/src/Patches.ts`). Only the incoming open's term is gated, on `abs(EXCLUDED.last_opened_at − patch_opens.last_opened_at) ≥ 10 minutes`. `GREATEST`, both decay terms, the current-version and serving predicate and the `xmax = 0` first-open check are unchanged: ```sql score = patch_opens.score * halving(latest - patch_opens.last_opened_at) + CASE WHEN abs(extract(epoch FROM EXCLUDED.last_opened_at - patch_opens.last_opened_at)) >= 600 THEN halving(latest - EXCLUDED.last_opened_at) ELSE 0 END, last_opened_at = latest ``` The `abs` keeps the existing late-arrival case working: an open stamped a week earlier that arrives late still adds its age-correct half point. The rule goes by arrival order, as the issue accepts. Opens at minutes 0, 18 and 9, arriving in that order, count twice, because the row keeps only the last open. **The new and changed tests, red then green.** I put `origin/main`'s `Patches.ts` back under the new tests (`git restore --source=origin/main -- packages/patches/src/Patches.ts`): ``` × remembers each member's opens of live patches, halving every week AssertionError: expected 2 to be close to 1 +/- 1e-9 × counts reopens within 10 minutes of the last open once AssertionError: expected 1.9993137356513948 to be close to 0.9993137356513948 +/- 1e-9 × lets exactly one of a member's racing opens be their first AssertionError: expected 3 to be close to 1 +/- 1e-9 ``` With the change: ``` ✓ remembers each member's opens of live patches, halving every week ✓ counts reopens within 10 minutes of the last open once ✓ reads a decade-old open as nearly nothing and still counts the next one ✓ lets exactly one of a member's racing opens be their first ``` The new test covers four things: - An open 9:59 after the last adds nothing and still moves `last_opened_at`. - A second open 9:59 after that one also adds nothing, because the window is measured from the last open, not the last one that counted. - An open exactly 10:00 after the last counts. - An earlier open that arrives late inside the window adds nothing and leaves the last open where it was. The week-late case, first-open attribution and the simultaneous-insert race keep their tests. Their expected scores drop where their opens land in one instant: the racers now total 1, not 3. Two mutations are also caught: `>` in place of `>=` fails the exact-10:00 step, and dropping `abs` fails the week-late case. ## How it was verified - `pnpm exec vitest run` over `packages/patches/src/Patches.test.ts`, `packages/portal/src/PortalPages.test.ts` and `packages/serving/src/Pages.test.ts` (the suites that record or read opens): 173 passed. - `pnpm check`: format, lint, typecheck and synth pass. - `pnpm verify` (on the previous base, before the docs-only #1264 and #1293): `postgres-concurrency`, `tier2-smoke` and `browser` (85 Playwright tests) pass. - Failing locally, and failing the same on `origin/main`: - The `test`, `test (bun)`, `cli-smoke` and `install` steps hit two known causes on this machine. CLI stub servers get a stray `GET /`, and npm is missing beside `/usr/bin/node`, which stops the installer tests and the install line in the packed e2e. - `Supervisor` and `PatchesApi` each timed out once under load and pass when run alone. - CI is the arbiter for these. - Not checked: Home visibly reordering with real usage. This change only alters scores; no page's markup changes, so there are no screenshots. The new test shows the "Done means" behaviour at the score: reopening every few minutes counts once, and an open 10 minutes or more after the last, including a late one, still counts. **Hit every surface:** only *Vocabulary and product shape* applied. The **Open** entry in the Patches glossary and the **Your usual** entry in the Portal glossary say how reopens count, and so do the `Open.score`, `recordOpen` and `REOPEN_WINDOW` comments. `docs/product.md` still holds ("opened most in the last 30 days"). Nothing changes in the API, the CLI, the dev loop, migrations, company resources, the markup of served pages, or the repo layout. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required This changes how a score is computed. There is no schema change, and no API or CLI change. - **What does a revert leave behind?** Scores already written under the new rule, lower for patches reopened in quick succession. They stay as written, in the same columns and shape. - **Does the release before it still work with that?** Yes. It reads and writes the same `patch_opens` rows. During a rollout, old servers still count every open, which only inflates scores the way they did before. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 of 2 tasks
allisonmahmood
added a commit
that referenced
this pull request
Nov 8, 2026
## What changed This adds release 40's What's new entry, written from `08e1fd9`. It covers everything merged since release 39's `through` (`17b1ad8`), and sets the `patchy` release to `0.40.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Jump anywhere with ⌘⇧K | #1294, #1298, #1304, #1307 | | Improved: Your usual stays yours | #1295 | | Patch changes: Mod+Shift+K no longer reaches patch code; Patchy serves one script first in every patch document | #1298 | #1293 is release 39's own entry. The range is exactly the switcher stack (#1091), which ships as one release. #1295 had to ship no later than the menu, and it does. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `64ce907` (release 39) to this PR's merge:** - **No PR in the range is `one-way`.** There are no migrations, no API or CLI contract changes, and no infrastructure changes. - **#1295** changes only how new opens add to a person's score. Scores written under the new rule stay valid for release 39, which keeps counting every open. - **#1298** inserts the relay into served patch bytes at serve time. Stored files and digests are unchanged, so release 39 serves them as before. - **#1304 and #1307** add a `sessionStorage` entry that release 39 never reads. #1307's new `claims` field on a completed Clerk handshake exists only in memory. **Rollback line:** If this release misbehaves, roll back to `64ce90784350341fc2f60fe4f4161a78444f243e` (release 39). ## How it was verified - **Tests:** the `packages/core` What's new test passes (5), the `packages/api` suites pass (64), and the three files are formatted. - **The range:** each of #1294, #1298, #1295, #1304 and #1307 was: - reviewed by GPT 6.1 Sol at xhigh, with every finding fixed or declined in writing on the PR; - accepted on its final head by an agent that didn't write it; - merged green on a branch up to date with main. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The changelog entry and the release version only. - **What does a revert leave behind?** Nothing. CLIs installed from this release report `0.40.0` and are told to match the server, as at every release. - **Does the release before it still work with that?** Yes. Written by Claude Opus 5.5 in Claude Code, orchestrated from T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What changed
This adds release 39's What's new entry, written from
17b1ad8. It covers everything merged since release 38'sthrough(1d59c40), and sets thepatchyrelease to0.39.0inpackages/patchy/package.jsonandCURRENT_RELEASE.#1247 is release 38's own entry. The range is exactly the Email (IMAP) stack, which ships as one release.
Look at
releasesinpackages/core/src/whatsNew.ts.cbbd767(release 38) to this PR's merge:one-way. It adds theimapintegration kind. Release 38 can't decode a manifest that declaresimap, so after a rollback, patches published with an Email (IMAP) connection would fail. No migration.one-way. Its parts carry anattachmentflag that feat(integrations): patches read IMAP folders and messages #1262 alone doesn't have. That only matters for a rollback to a release holding feat(integrations): patches read IMAP folders and messages #1262 without feat(integrations): patches save IMAP attachments into their files #1264, and none exists, because the three ship together here.0035_runtime_calls_bytes, a nullable column that release 38 ignores. Itsrollback-rehearsalcheck passed.Rollback line: Rolling back past #1266 would break patches that declare an Email (IMAP) connection, because release 38 can't read a manifest that declares
imap; fix forward instead.How it was verified
packages/coreWhat's new test and thepackages/apisuites pass (69 tests).mainbetween merges. Each rebased tree was identical to the head its verdict was given on./healthz/deep, iscbbd767(release 38). The Deploy run updated last succeeded, and none is unfinished.Release impact
Text and version numbers only. Like every release, the
0.39.0bump tells CLIs and patch repos installed before this deploy to upgrade. The release it announces isone-way; see the rollback line.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.