Repository navigation
feat(cli): publish --dry-run shows what a repo's version keeps, and publish warns near the limits - #1188
Conversation
5f76ca6 to
a80b2ff
Compare
|
Review (GPT 6.1 Sol, xhigh) on a80b2ff: FAIL, three confirmed defects, being fixed.
Found sound:
|
|
Re-check (GPT 6.1 Sol, xhigh) on d7b09ce: FAIL. The three earlier findings are closed. Rewriting the manifest in place and restoring it has four new problems:
It also conflicts with #1175 in Next: the dry run does the real preparation in a temporary copy of the repo, so the repo is never written and the size check sees the same synced files a real publish would. That also removes the |
|
Re-check (GPT 6.1 Sol, xhigh) on f84ca9f: FAIL.
Next: the scope narrows to what #1167 asked for. |
|
Re-check (GPT 6.1 Sol, xhigh) on a0fc92f: FAIL, two P2 output gaps, being fixed. Verified:
Remaining:
Recommendation: the description sync and its in-memory prediction should share one pure function. |
|
Re-check (GPT 6.1 Sol, xhigh) on bf1e7d9: PASS, no findings. Both earlier P2s are closed.
For integration: after #1175 and #1179 merge, rebase onto |
059055c to
8932680
Compare
…ublish warns near the limits Co-Authored-By: Claude Opus 5.5 <[email protected]>
bf1e7d9 to
6bc6c1c
Compare
|
Re-check (GPT 6.1 Sol, xhigh) on the rebase over #1175 and the train (now head
|
…, as publish does Co-Authored-By: Claude Opus 5.5 <[email protected]>
…as publish does Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Re-checks (GPT 6.1 Sol, xhigh) after the rebase
|
Acceptance: PASS with notesThe head moved to Checked This is a focused re-acceptance of I drove the environment's own CLI as Ada against a tier 1 repo from The dry run and publish give the same document, and nothing is written: passed
The TypeScript and missing description case,
|
|
The acceptance verdict above is on |
…ges publish (#1241) ## What changed This adds release 36's What's new entry, written from `1acc968`. It covers everything merged since release 35's `through` (`dd0e2ec`), and sets the `patchy` release to `0.36.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | Improved: shortcuts work where you use them (keys for one part of a patch, the closest wins, text boxes keep their typing keys) | #1231 | | Improved: the shortcuts sheet shows what works where you are (Ctrl+/ and ⌘/ open it, its commands run, it opens from a patch's menu and in view on a narrow screen, keeps the look, spells keys out away from a Mac) | #1231, #1181, #1178, #1180, #1177 | | Fixed: keys pressed while a patch opens reach it | #1183 | | Fixed: pages styled with Tailwind 4 publish, and a look with the same rule saves | #1191 | | Fixed: an old copy of a patch no longer replaces newer work (**Breaking** for such a copy: it needs `patchy pull` or one `--allow-behind` publish) | #1179 | | Improved: your agent can check a publish before sending it | #1188 | | Improved: your agent hears what changed when it updates a patch | #1186, #1185 | | Fixed: your agent stops chasing false alarms (`pnpm install` exit codes, `manifest.json` bytes, the description notice, a copied dev record) | #1176, #1174, #1175 | | Behind the scenes: fuller hotkeys instructions for agents; fewer redraw costs for patches with many shortcuts | #1182, #1187 | `patchChanges` has three sentences for the agent refreshing a patch across this release: - #1231's, from its PR: text fields keep their keys, `preventDefault()`, and the sheet's Mod+/ and `.hotkey-row` buttons. - The sheet's dialog renders in `document.body`, and element-only page rules don't reach it (#1178, #1180). Its own row lists last (#1181). The hotkey label helpers take only valid literals (#1177). - Publish's `unknown_base_version` (#1179). It also rewords release 33's "Press ? to see every shortcut a patch has". That was true only for a patch that mounts the shortcuts sheet, so it now says a patch *can* list its shortcuts. The rest get no line: - #1206, #1207, #1209 and #1220 are `pnpm dev eval` tooling. - #1222 is release 35's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`, and release 33's reworded line. - **Rollback safety, from the live commit `d28fdd0` (release 35) to `1acc968`:** - #1191 is labelled `one-way`. Its Release impact: a company look published after this release with a nested `@supports` condition stays stored after a revert. Release 35 refuses any bundle carrying it, so repo publishes in that company would fail until an admin runs `patchy look restore` to an earlier revision. Pages and Tailwind 4 repos already published stay published. - #1183 is the only change to what the server serves browsers: the shell's script, under a digest-named URL. Its revert leaves nothing behind. - The hotkeys PRs change `patchy/hotkeys`, which patches bundle when they are built. Published patches keep their copy. - The CLI PRs change what a CLI writes and refuses. Release 35 reads everything they leave behind: #1176's `allowBuilds` entry, #1174's indented `manifest.json`, and the `version` recorded by an `--allow-behind` publish. **Rollback line:** If this release misbehaves, roll back to `d28fdd0` (release 35). First check that no company's look has a nested `@supports` condition, and `patchy look restore` an earlier revision where one does (#1191). ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (22 tests), and `bun fmt` passes on the changed files. - **Facts.** The sheet's new `document.body` home and its element-rule reset were checked against `hotkeys.ts` and `hotkeySheet.ts` on main. - **Deploy state.** I pinned the live commit from `/healthz/deep`: `d28fdd0` (release 35). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. Like every release, the `0.36.0` bump tells CLIs and patch repos installed before this deploy to upgrade. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
Publish keeps the repo with each version, up to 2,000 files and 10 MiB, but an agent found out how big its repo was only when publish refused it. One repo was 172 MB of source material. Now
patchy publish --dry-runchecks the release, TypeScript, version, description and repo snapshot without building or sending; publish still runs the build. It lists the file count and size against the limits, and every top-level file and folder with its files and bytes. For what it checks, it refuses as publish would, in publish's order:unknown_base_versionfor a bound repo with no recorded version,release_mismatchandtoolchain_unsupportedfor the installed release and TypeScript,invalid_manifestfor a missing or invalid description, andtoo_largeover the limits. It doesn't runpatchy.config.ts, check generated state, find server code, check a tier 2 repo's workerd pin, build or typecheck, so publish can still refuse what it passed. Publish and the dry run warn past 80% of either limit.patchy-loopsays what belongs in the kept repo: what builds, runs and maintains the patch, and not research inputs, QA output or bulky source material.Closes #1167
Look at
What the dry run does (
dryRunPublishinpackages/patchy/src/commands.ts):State.hasPendingPublish), so an older CLI's tier 0 attempt isn't cleared. If one is pending, its notice is remembered at once, so any later refusal still carries it.checkRepoPublish, which a real publish also runs: it refuses file-mode flags, andunknown_base_versionunless--allow-behindis passed.checkRepoToolchain, publish's own first check, also shared: the installed release, then TypeScript. It only reads.Project.previewDescriptionSyncmakes the portal read the description sync makes and decides as the sync decides. It returnspatchy.json's text as the sync would leave it, without writing it, and remembers the sync's notice as publish does.Project.publishDescription, publish's description check, shared: the description as the sync would leave it must be there and valid.RepoSnapshot.surveyapplies publish's walk, exclusions, refusals and warnings from file sizes alone, counting thatpatchy.jsontext.notefield stating that scope, or refuses with thetoo_largedocument publish gives, notices included.It doesn't build, typecheck, generate the manifest, copy the repo or write anything. Earlier rounds built in place and then in a temp copy. Both leaked writes into the repo or lost inputs from outside it, and Repo snapshots: see the size and contents before publish, and say what belongs #1167 asked for neither.
One decision for the description sync (
Project.ts).readPortalDescriptionis the portal read, refusing a gone patch as publish does.portalSyncis pure: from the stamps, it returns the repo with the portal's text and stamp plus the notice, or nothing.syncDescriptionwrites its result, andpreviewDescriptionSynconly measures it, so the two can't drift. fix(cli): no description notice when only its stamp moved, and a copied dev record says how to start #1175's rule, that identical text updates the stamp with no notice, lives inportalSync: whenrepo.description === cloud.description, it returns the repo with emptywarnings, so publish and the dry run both follow it. A dry-run test pins both notices, and it fails without the rule.The ranking (
repoSnapshot.ts): entries rank by the larger of their share of the file limit and the byte limit, then by size. So a folder of 1,650 small screenshots comes before a 1 MiB fixture. Thetoo_largerefusal uses the same entries, and gives each folder's file count.Warnings survive a later failure in publish.
prepareRepoPublishremembers the snapshot's warnings (near-limit, symlinks) and the agent-typecheck warning as it finds them, so a typecheck failure after them still reports them, as ADR-0004 asks.A new repo with an 8.4 MiB research file and 30 QA screenshots. On the base, publish keeps it without a word and
--dry-runis an unknown flag. On the head, publish warns and the dry run lists what the version would keep. After adding both folders to.gitignore, it lists 16 files, 38.3 KiB.The transcript ran at
735dca6, when the dry run still built. Its snapshot lines and warnings read the same today. Its headline now reads "Dry run: Checks the release, TypeScript, version, description and repo snapshot without building or sending; publish still runs the build." The one-file entries are now ordered by size, so the warning'sLargest:namesAGENTS.md 2.9 KiBrather than.gitignore 29 B.Transcript
repo-snapshot-previewBefore is
1f187a9(where this branch left main) and after is735dca6(feat/repo-snapshot-preview), both on theteamscenario, frompnpm dev transcript.Each line ran in its own
bash -cfrom the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads<origin>, its environment folder<env>, its checkout<checkout>and the home folder~; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as).3 of 4 lines changed.
A new repo with research inputs and QA screenshots beside its source
$ patchy init notes --purpose "Team notes" > /dev/null && cd notes && mkdir research qa && head -c 880…: no change, exit 0 in 1.4 sPublishing it
Changed. Before, exit 0 in 1.6 s; after, exit 0 in 1.5 s.
Repo: 47 files, 9.0 MiB, kept with this version +Warning: The repo is 9.0 MiB in 47 files, near the most a version keeps: 10.0 MiB and 2000 files. Largest: research/ 1 file, 8.4 MiB; qa/ 30 files, 585.9 KiB; pnpm-lock.yaml 30.2 KiB; src/ 3 files, 2.5 KiB; .gitignore 29 B. Add what the patch doesn't need to .gitignore before it gets there.What the next version would keep, before anything is sent
Changed. Before, exit 1 in 0.3 s; after, exit 0 in 1.1 s.
18 of 48 lines are cut from the middle.
--jsonhas it all.Leaving the research and QA output out
Changed. Before, exit 1 in 0.2 s; after, exit 0 in 1.2 s.
15 of 45 lines are cut from the middle.
--jsonhas it all.How it was verified
repoSnapshot.test.tscovers ranking and warnings near either limit: an 8.5 MiB asset warns withassets/ 1 file, 8.5 MiBfirst, and 1,650 tiny files putqa/above a 1 MiB fixture. Entries using the same share of the limits order by size, and thetoo_largerefusal names entries in the new format.cliRepoPublish.test.ts:/api/publishand saves no attempt. Itsnotestates the scope, itsentriesinclude an untrackednotes.mdand add up tofiles, and after an interrupted publish it warns that the next publish recovers it. With a file,--dry-runpoints atpatchy validate <file>.patchy.jsonand every other file in the repo are byte-identical after a dry run.too_largewith the same failure document as the real publish that follows, compared whole, the portal's notice inwarningsincluded.too_largewith the pending notice inwarnings. A dry run whose portal read finds the patch gone refuses, exit 2, with the notice too.warnings.--dry-run --allow-behindpasses.bf1e7d9, with the machine heavily loaded by other worktrees:pnpm vitest runoncliRepoPublish,cliRepoDescriptions,cliRepoBuild,cliRepoRecovery,repoBuild,repoSnapshot,StateandProjectpassed 64 of 65. The one failure, incliRepoRecovery, was the local editor's port probe sending an extraGET /to a test that asserts an exact request list; it passed on three reruns. The new full-document parity and pending-notice tests fail ata0fc92fand pass atbf1e7d9.pnpm lint,pnpm format:checkandpnpm typecheck(the workspace, tests included) are clean. I didn't run a fullpnpm verifyor the whole offline suite locally; CI runs them on this PR.Release impact
A new flag and a new warning. Nothing that publishes today is refused or changed. The
too_largemessage lists entries in a new format, but agents branch on itscode, which is unchanged.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.