Repository navigation
fix(patchy): editing a shared fixture no longer wipes an unpublished patch's own rows - #364
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. The fix lifts the existing owned-schema hash into a local variable and compares that value directly. It preserves the persisted state format and reuses the existing per-source refresh path; there is no new abstraction or state framework. The regression test exercises real PGlite persistence and runtime handlers across separately scoped preparations. SpecNo merge-blocking intent findings. The change implements the requested scope: "Use the owned schema portion for the unpublished full-reset decision." Shared fixture edits no longer trigger the whole-database reset, while owned-schema changes, identity changes and missing database storage retain their reset conditions. Published-baseline behavior is unchanged. The new regression proves that a fixture row edit updates the shared contact without deleting the owned note, then proves that an owned column retype still resets the data. Failed-fixture recovery remains outside this change, as requested. Verification: Summary: Standards 0 blockers; Spec 0 blockers. No worst issue on either axis. |
|
Reviewed StandardsNo documented-standard violations. The edit stays inside The copied SpecThe production change matches the scope in #322: "Use the owned schema portion for the unpublished full-reset decision. Retain the existing resets for real schema changes, identity changes and missing storage. Let changedSources refresh only affected shared sources. No new state framework is needed."
The first assertion is the bug. A title edit in A comment-only fixture edit takes that same path. The second assertion does not lock "Retain the existing resets for real schema changes." Changing An additive change is the case this condition owns. An optional column is compatible, so without MethodThis is the method the issue named. The owned digest was already A fixture-only edit leaves An unpublished column retype does change Identity change, missing YAGNIThe production diff is the small version. No new type, helper, field, or branch. The comment on the condition should stay. It is what stops the next edit from comparing The test is three Swap the retype for an optional column and keep Summary: Standards 0 hard findings, no worst issue. Spec 1 partial, and that partial is the retype assertion, which does not isolate the owned-schema reset. |
|
Review follow-up, pushed as df13176. Fixed:
Kept as is:
|
758edc8 to
bce61da
Compare
…patch's own rows Before the first publish, dev compared the whole stamp, including shared fixture contents, to decide on a full local reset. Now only the owned schema portion drives that reset; a fixture edit refreshes just its source. Closes #322 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e change A retype is refused as not additive and dropped on its own path, so it did not prove the owned-hash reset. An added optional column only loses rows when that reset runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
df13176 to
483a491
Compare
…ack (#365) Stacked on #364 (branch fix/322-fixture-owned-data). If you broke a shared-table fixture in `patchy dev` and then put the original back, that source's local rows stayed empty across every restart. Dev had already recreated the source when the fixture failed, but its stamp still recorded the last good fixture, so restoring those bytes looked like "nothing changed" and the INSERT never ran again. Now dev removes the changed sources' entries from the stamp before it recreates them. A fixture that fails to seed counts as changed on the next start and gets another try. Other sources' entries and the patch's own rows stay as they are. Test evidence: - New `devResources.test.ts` case follows the ticket's steps against a published consumer with one owned row: seed, typo the column (`SharedFixtureInvalid`), restore, restart twice. Before the fix: `contacts: []`. After: the contact is back on both restarts and the owned row is kept. It also passes with the baseline removed (never-published path). - `pnpm typecheck` and `pnpm lint` are clean. `pnpm test`: 952 passed, 3 hit 5s timeouts in untouched packages (`company-database`, `integrations/postgres`) while other test runs loaded the machine. All 3 pass when re-run alone. Closes #318 Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).
Stacked on #363 (branch fix/330-dev-stop).
Before a patch's first publish, editing a shared fixture (even a single row or a comment) wiped the patch's own local rows on the next
patchy devstart. Only owned schema changes are supposed to reset local data.The full-reset check compared the whole local stamp, and that stamp includes the hashes of the shared fixtures. It now compares only the owned-schema part. A fixture edit goes through the existing per-source refresh, which reseeds only the changed shared source. Identity changes, missing storage and real owned-schema changes still reset everything.
Closes #322
Test evidence:
packages/patchy/src/devResources.test.ts, built from the issue's reproduction with real PGlite state in a temp dir. It failed before the fix (notes: []) and passes after it. The same case checks that an owned column retype still recreates local data.pnpm typecheckandpnpm lintpass.pnpm test: 953/954 passed. The one failure was a 5s timeout inpackages/integrations/src/postgres/Runtime.test.tswhile the full suite ran under load. That file passes on its own.Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).