Repository navigation
fix(cli): no description notice when only its stamp moved, and a copied dev record says how to start - #1175
Conversation
|
Review (GPT 6.1 Sol, xhigh) on 65d6fdf: approve, no findings.
|
Acceptance: PASS with notesChecked Done means
Golden journeys
Rollback answers: they match the diff. Only message text changes. Exit codes, Not run
Notes
Transcript: the description notice and a copied dev record, before and after
Transcript Before is Each line ran in its own 6 of 11 lines changed. A published tier 1 repo, pulled into a second folder
|
…ed dev record says how to start Co-Authored-By: Claude Opus 5.5 <[email protected]>
65d6fdf to
8dd3b3a
Compare
…ublish warns near the limits (#1188) ## 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-run` **checks 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_version` for a bound repo with no recorded version, `release_mismatch` and `toolchain_unsupported` for the installed release and TypeScript, `invalid_manifest` for a missing or invalid description, and `too_large` over the limits. It doesn't run `patchy.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-loop` says 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** (`dryRunPublish` in `packages/patchy/src/commands.ts`): 1. It looks for a pending publish without reading it (`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. 2. `checkRepoPublish`, which a real publish also runs: it refuses file-mode flags, and `unknown_base_version` unless `--allow-behind` is passed. 3. `checkRepoToolchain`, publish's own first check, also shared: the installed release, then TypeScript. It only reads. 4. `Project.previewDescriptionSync` makes the portal read the description sync makes and decides as the sync decides. It returns `patchy.json`'s text as the sync would leave it, without writing it, and remembers the sync's notice as publish does. 5. `Project.publishDescription`, publish's description check, shared: the description as the sync would leave it must be there and valid. 6. `RepoSnapshot.survey` applies publish's walk, exclusions, refusals and warnings from file sizes alone, counting that `patchy.json` text. 7. It reports, with a `note` field stating that scope, or refuses with the `too_large` document 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 #1167 asked for neither. - **One decision for the description sync** (`Project.ts`). `readPortalDescription` is the portal read, refusing a gone patch as publish does. `portalSync` is pure: from the stamps, it returns the repo with the portal's text and stamp plus the notice, or nothing. `syncDescription` writes its result, and `previewDescriptionSync` only measures it, so the two can't drift. #1175's rule, that identical text updates the stamp with no notice, lives in `portalSync`: when `repo.description === cloud.description`, it returns the repo with empty `warnings`, 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. The `too_large` refusal uses the same entries, and gives each folder's file count. - **Warnings survive a later failure in publish.** `prepareRepoPublish` remembers 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-run` is 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's `Largest:` names `AGENTS.md 2.9 KiB` rather than `.gitignore 29 B`. <!-- patchy-dev:transcript:repo-snapshot-preview --> #### Transcript `repo-snapshot-preview` Before is `1f187a9` (where this branch left main) and after is `735dca6` (feat/repo-snapshot-preview), both on the `team` scenario, from `pnpm dev transcript`. Each line ran in its own `bash -c` from 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 <details><summary><code>$ patchy init notes --purpose "Team notes" > /dev/null && cd notes && mkdir research qa && head -c 880…</code>: no change, exit 0 in 1.4 s</summary> ```console $ patchy init notes --purpose "Team notes" > /dev/null && cd notes && mkdir research qa && head -c 8800000 /dev/zero > research/interviews.bin && for i in $(seq 1 30); do head -c 20000 /dev/zero > qa/screen-$i.png; done && ls AGENTS.md CLAUDE.md fixtures helpers index.html node_modules package.json patchy patchy.config.ts patchy.json pnpm-lock.yaml qa research src tsconfig.json vite.config.ts ``` </details> ##### Publishing it **Changed.** Before, exit 0 in 1.6 s; after, exit 0 in 1.5 s. ```console $ cd notes && patchy publish 2>&1 | grep -E "^(Repo|Warning)" 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. ``` ```diff 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. ```console $ cd notes && patchy publish --dry-run Checking a publish to <origin> (target came from patchy.json). Dry run passed publish's local checks. Nothing was sent. Repo: 47 files, 9.0 MiB, of the 2000 files and 10.0 MiB a version keeps: 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 .oxlintrc.json 722 B AGENTS.md 2.9 KiB CLAUDE.md 11 B fixtures/ 1 file, 0 B helpers/ 1 file, 0 B index.html 247 B package.json 475 B patchy.config.ts 226 B patchy.json 183 B tsconfig.json 624 B vite.config.ts 278 B [stderr] 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. ``` ```diff -DESCRIPTION - Publish the current patch repo, or a single self-contained HTML file. - -USAGE - patchy publish [flags] [<file>] - -ARGUMENTS - file string HTML file path (optional) - -FLAGS - --name string Set the patch's name in its company - --patch string Update an existing patch only; never creates a patch - --share choice Who can open the patch: your company or anyone with the link (choices: company, public) - --description string Set the description when publishing an HTML file - --force Accept the reported dependant or source breakage; ask the person first - --allow-behind Publish this repo over versions published since it was pulled or last published; ask the person first - --new Always create a new patch - -GLOBAL FLAGS - --help, -h Show help information @@ 18 lines cut @@ + helpers/ 1 file, 0 B + index.html 247 B + package.json 475 B + patchy.config.ts 226 B + patchy.json 183 B + tsconfig.json 624 B + vite.config.ts 278 B [stderr] -Unrecognized flag: --dry-run in command patchy publish +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. ``` _18 of 48 lines are cut from the middle. `--json` has it all._ ##### Leaving the research and QA output out **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 1.2 s. ```console $ cd notes && printf 'research/\nqa/\n' >> .gitignore && patchy publish --dry-run Checking a publish to <origin> (target came from patchy.json). Dry run passed publish's local checks. Nothing was sent. Repo: 16 files, 38.3 KiB, of the 2000 files and 10.0 MiB a version keeps: pnpm-lock.yaml 30.2 KiB src/ 3 files, 2.5 KiB .gitignore 43 B .oxlintrc.json 722 B AGENTS.md 2.9 KiB CLAUDE.md 11 B fixtures/ 1 file, 0 B helpers/ 1 file, 0 B index.html 247 B package.json 475 B patchy.config.ts 226 B patchy.json 183 B tsconfig.json 624 B vite.config.ts 278 B ``` ```diff -DESCRIPTION - Publish the current patch repo, or a single self-contained HTML file. - -USAGE - patchy publish [flags] [<file>] - -ARGUMENTS - file string HTML file path (optional) - -FLAGS - --name string Set the patch's name in its company - --patch string Update an existing patch only; never creates a patch - --share choice Who can open the patch: your company or anyone with the link (choices: company, public) - --description string Set the description when publishing an HTML file - --force Accept the reported dependant or source breakage; ask the person first - --allow-behind Publish this repo over versions published since it was pulled or last published; ask the person first - --new Always create a new patch - -GLOBAL FLAGS - --help, -h Show help information @@ 15 lines cut @@ + AGENTS.md 2.9 KiB + CLAUDE.md 11 B + fixtures/ 1 file, 0 B + helpers/ 1 file, 0 B + index.html 247 B + package.json 475 B + patchy.config.ts 226 B + patchy.json 183 B + tsconfig.json 624 B + vite.config.ts 278 B ``` _15 of 45 lines are cut from the middle. `--json` has it all._ <!-- /patchy-dev:transcript:repo-snapshot-preview --> ## How it was verified - `repoSnapshot.test.ts` covers ranking and warnings near either limit: an 8.5 MiB asset warns with `assets/ 1 file, 8.5 MiB` first, and 1,650 tiny files put `qa/` above a 1 MiB fixture. Entries using the same share of the limits order by size, and the `too_large` refusal names entries in the new format. - `cliRepoPublish.test.ts`: - A dry run sends no `/api/publish` and saves no attempt. Its `note` states the scope, its `entries` include an untracked `notes.md` and add up to `files`, and after an interrupted publish it warns that the next publish recovers it. With a file, `--dry-run` points at `patchy validate <file>`. - With a newer portal description, `patchy.json` and every other file in the repo are byte-identical after a dry run. - **Size parity at the limit, growth:** at exactly 10 MiB, a longer portal description makes the dry run refuse `too_large` with the same failure document as the real publish that follows, compared whole, the portal's notice in `warnings` included. - **A pending attempt kept through a refusal:** with an attempt in the slot, a dry run of a repo over 10 MiB refuses `too_large` with the pending notice in `warnings`. A dry run whose portal read finds the patch gone refuses, exit 2, with the notice too. - **Size parity at the limit, shrink:** at 10 MiB plus one byte the dry run refuses. After the portal's description gets shorter, it passes, and the real publish that follows sends exactly the files and bytes the dry run reported. - With an older CLI's tier 0 attempt in the slot, a dry run exits 0, warns that it's pending and leaves the file. - With an 8.5 MiB file and a type error, publish exits 1 with the near-limit warning in `warnings`. - On a bound repo with no version, a dry run refuses with exactly the failure document a real publish gives, and `--dry-run --allow-behind` passes. - Locally, at `bf1e7d9`, with the machine heavily loaded by other worktrees: `pnpm vitest run` on `cliRepoPublish`, `cliRepoDescriptions`, `cliRepoBuild`, `cliRepoRecovery`, `repoBuild`, `repoSnapshot`, `State` and `Project` passed 64 of 65. The one failure, in `cliRepoRecovery`, was the local editor's port probe sending an extra `GET /` to a test that asserts an exact request list; it passed on three reruns. The new full-document parity and pending-notice tests fail at `a0fc92f` and pass at `bf1e7d9`. `pnpm lint`, `pnpm format:check` and `pnpm typecheck` (the workspace, tests included) are clean. I didn't run a full `pnpm verify` or the whole offline suite locally; CI runs them on this PR. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required A new flag and a new warning. Nothing that publishes today is refused or changed. The `too_large` message lists entries in a new format, but agents branch on its `code`, which is unchanged. - **What does a revert leave behind?** Nothing: no schema, rows or wire change. - **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]>
…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
Two CLI messages misled agents upgrading old patches.
Description. Refresh, dev and publish said "The description was changed in the portal to '…'; check it" when the text was identical and only its sync stamp had moved. They now record the stamp and say nothing.
Copied dev record. A copied repo carries the original's dev record, so
patchy dev,dev statusanddev resetrefused with "The dev record belongs to another repo or instance. It was left untouched." That message gave no next step, and four agents renamed the record by hand. The refusal now names the record file and the repo it belongs to, and says how to start fresh while keeping local rows and files:Closes #1169
Look at
syncDescriptioninpackages/patchy/src/Project.ts: the notice is skipped when the text matches, and the stamp is still recorded.recordedinpackages/patchy/src/devLifecycle.ts: the record isn't cleared automatically. The refusal still protects a record that really belongs elsewhere; it now just says what to do.Project.test.ts› "records a newer stamp over the same text without a notice" fails onmain(expected [ Array(1) ] to deeply equal []) and passes here.devLifecycle.test.ts› "a copied repo names the record it carried…" starts dev, writes a row, stops it, and copies the repo with the original's record. It asserts thatdev,dev statusanddev reseteach refuse with the message above and leave the record. It then deletes the named file and startspatchy devin the copy, which serves the copied row. It passes in 29 s.How it was verified
vitest run src/Project.test.ts: 4 passed. The new case was red before the change.vitest run src/devLifecycle.test.ts -t "copied repo"and-t "pulls a newer cloud description": both pass.vitest run packages/sdk/src/SdkApi.test.ts(it reads the patchy-loop skill): 22 passed.pnpm lint,effect-tsgoon the package andtsconfig.test.json,bun fmt: clean.pnpm verifyand a before/afterpnpm dev transcript. The shared machine's heavy-command lock had a queue hours long, and CI ran the same suites.Release impact
Only messages change: one notice is dropped when it said nothing, and one refusal gets a next step. Exit codes, JSON shapes and what is written are the same.
Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.