Repository navigation
perf(patchy): publish checks the look in its own request instead of downloading it - #729
Merged
Merged
Conversation
Owner
Author
|
Review, round 1 (GPT 6.1 Sol, xhigh, in Codex): no findings. Sol traced the absent / |
allisonmahmood
force-pushed
the
perf/594-publish-look-stamp
branch
2 times, most recently
from
October 18, 2026 00:25
7ecf4eb to
aebeaca
Compare
…ownloading it
Repo publish called GET /api/look, which carries the current look's files,
every revision and the admins, only to compare one revision number and time.
The publish request now carries the repo's look stamp as metadata.look
(absent: no check; null: the Patchy look; { revision, createdAt }: a company
revision). The publish handler reads the company's current revision in one
plain query through Looks.current, before the version is recorded and outside
the publish transaction, and adds today's warning to the response, so a
same-key retry replays it. A failed read warns and never fails the publish.
The CLI stops calling GET /api/look during publish and remembers a successful
response's warnings before its local writes.
Closes #594
Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood
force-pushed
the
perf/594-publish-look-stamp
branch
from
October 18, 2026 12:20
aebeaca to
8e5535f
Compare
allisonmahmood
added a commit
that referenced
this pull request
Oct 19, 2026
…ng Reconnecting (#783) Release 14's What's new entry, written from \`7694bab\`. It covers everything merged since release 13's \`through\` (\`c9b8fc4\`), and sets the \`patchy\` release to \`0.14.0\` (\`packages/patchy/package.json\` and \`CURRENT_RELEASE\`). | Change | PRs | | --- | --- | | Improved: Tools with server code answer faster | #756, #764, #768, #769, #771, #772, #773, #775, #778 | | Improved: Your company's tools and pages open sooner | #759, #761, #766, #770 | | Fixed: Tools stop flashing Reconnecting while they load | #755, #776, #780 | | Improved: Publishing is quicker | #729 | | Improved: New tools start with a tidy layout | #763 | | Improved: Your usual is easier to scan | #721 | | Fixed: A page that isn't there says what to do | #762 | | Fixed: A logo Patchy can't read is refused, not a crash | #728 | | Behind the scenes: richer logs for live data | #758 | #720 is release 13's own entry, so it's left out. Made by Claude Opus 5.5 via Claude 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.
Repo
patchy publishcalledGET /api/lookwhenever the page used the look. That response carries the current look's files (up to 512 KiB with embedded fonts), every revision, the admins and, with no company look, the Patchy look's files. Publish then compared only the current revision's number and time.How
PublishMetadatagains an optionallook: absent means no check,nullmeans the Patchy look, and{ revision, createdAt }names a company revision (LookStampin@patchy/api). Nothing new is stored on the version, so there's no migration.Looks.currentreads the company's current revision (number, time, author, note) in one plain query, with no files, history, admins or locks. The publish handler compares revision andcreatedAtafter admission and beforeContent.publish, so outside the publish transaction. On a mismatch it adds today's wording towarnings. This covers a newer revision, a restore to an earlier one, and moves to or from no look. Because the warning is in the stored response, a same-key retry replays it. A changed stamp under the same key changes the payload digest, so it getspublish_key_conflict. A failed read logs a warning and adds "Could not check whether this repo's look is current: The look could not be read." The publish never fails or rolls back because of it.index.json. It no longer callsGET /api/look.sendPublishremembers a successful response's warnings before its local writes, so a failed write still reports them.Older CLIs keep working
An older CLI sends no
lookand still callsGET /api/lookitself. The server reads an absent field as "no check", and that route is unchanged (patchy look --jsonrelies on its full body).PublishMetadatadecodes an absentlookas absent, notnull, and encodes it back the same way, so an attempt saved before this change replays byte for byte. The server tests publish a stampless request while the company has a look and get no look warning. The recovery test replays a saved attempt with the stamp removed and checks it goes out unchanged.Tests
PatchesApi.test.ts› "publish look check":publish_key_conflictLookslayer) warns, and the publish succeedscliRepoBuild.test.ts: publish sends the stamp and ships the repo's own look bytes, makes noGET /api/look, and passes the response's warning through--jsonwith exit 0. A page with its own stylesheet sends no stamp.cliRepoRecovery.test.ts: a local write failure after the server accepts the publish still reports the server's warnings. I confirmed this test fails without the change. A saved attempt without a stamp resends without one.cliPublish.test.ts: a file publish sends no stamp.look restore none, it warned "… Patchy Dev has no look now. …". The server log for the publish showed/api/me,/api/patches/…,/api/releaseand/api/publish, and noGET /api/look.Hit every surface
packages/api(PublishMetadata.look, publish endpoint description) → patches handler → CLI request. The--jsonshape is unchanged because warnings ride the existingwarnings.docs/API.mdis regenerated.GET /api/look, so I left them as they are.GLOSSARY-MAP.md's Patches → Companies edge now includes reading the current look revision. No new term: "look revision" and its stamp already exist.@patchy/patchesnow lists@patchy/companies, which it already reached through runtime, primitives and integrations.Closes #594
Built by Claude Opus 5.5 in Claude Code, running in T3 Code; reviewed by GPT 6.1 Sol in Codex.