Only-changed releases, first increment: reuse unchanged versions (#5) #11

Closed
rhelwig wants to merge 0 commits from feat/only-changed-versioning into main
Owner

First increment of #5 (only-changed releases), per the design in docs/SPECS.md (merged in #10).

What changes

  • Release-request version 2: unchanged page/post/asset/theme/aside records reuse the parent release's version verbatim (original publishBatchId, sequence, previousVersionId). Changed or new records get new versions as before. Release and site records are always new.
  • validateReleaseRequest: a record from another batch is only allowed in version 2 with a parent release. Unknown future versions fail with a clear "update Auth" message.
  • inspectReleaseRequest: a reused record must equal the parent's version for the same logical key and already exist on Platform. Otherwise it fails closed and nothing is written.
  • Admin prepareTabletReleaseRequest: compares each record with the parent (ignoring bookkeeping and CIDs; blobs compared by hash). Reused blobs are not uploaded again but are still read back and verified. Uses version 1 when nothing is reused.
  • A null draft publishedAt now keeps the parent's date instead of "now", so republishing never moves a post.
  • Timing log: reusedCount, and reused blobs are flagged (#6).
  • Auth bumped to 0.1.20 (versionCode 21) so it bundles the new validator (APK not built in this PR).

Safety / rollout

  • Opt-in: reuse is off unless Admin runs with DECENT_RELEASE_REUSE_UNCHANGED=1. Auth 0.1.19 and older reject version 2, so turn it on only after Auth 0.1.20 is installed on the approving device.
  • No contract or schema change, and existing Platform data is not rewritten.

Tests: tests/only-changed-release.test.ts (7 new tests: full reuse leaves only the release record to write, a single edit, a blob change by hash, default/first-release version 1, fail-closed tampering/missing/foreign records, the future-version message, and Auth review showing Unchanged/Updated). Full suite: 176/176 pass.

Remaining for #5: an Admin setting instead of the environment variable (default on once Auth 0.1.20+ is installed), "unchanged (already on Platform)" wording in Auth plus a count on the fee screen, and rollback by reference.

Refs #5

First increment of #5 (only-changed releases), per the design in docs/SPECS.md (merged in #10). **What changes** - Release-request **version 2**: unchanged page/post/asset/theme/aside records reuse the parent release's version verbatim (original publishBatchId, sequence, previousVersionId). Changed or new records get new versions as before. Release and site records are always new. - `validateReleaseRequest`: a record from another batch is only allowed in version 2 with a parent release. Unknown future versions fail with a clear "update Auth" message. - `inspectReleaseRequest`: a reused record must equal the parent's version for the same logical key **and** already exist on Platform. Otherwise it fails closed and nothing is written. - Admin `prepareTabletReleaseRequest`: compares each record with the parent (ignoring bookkeeping and CIDs; blobs compared by hash). Reused blobs are not uploaded again but are still read back and verified. Uses version 1 when nothing is reused. - A null draft `publishedAt` now keeps the parent's date instead of "now", so republishing never moves a post. - Timing log: `reusedCount`, and reused blobs are flagged (#6). - Auth bumped to **0.1.20** (versionCode 21) so it bundles the new validator (APK not built in this PR). **Safety / rollout** - **Opt-in:** reuse is off unless Admin runs with `DECENT_RELEASE_REUSE_UNCHANGED=1`. Auth 0.1.19 and older reject version 2, so turn it on only after Auth 0.1.20 is installed on the approving device. - No contract or schema change, and existing Platform data is not rewritten. **Tests:** `tests/only-changed-release.test.ts` (7 new tests: full reuse leaves only the release record to write, a single edit, a blob change by hash, default/first-release version 1, fail-closed tampering/missing/foreign records, the future-version message, and Auth review showing Unchanged/Updated). Full suite: 176/176 pass. **Remaining for #5:** an Admin setting instead of the environment variable (default on once Auth 0.1.20+ is installed), "unchanged (already on Platform)" wording in Auth plus a count on the fee screen, and rollback by reference. Refs #5
- Release-request version 2: unchanged records reuse the parent release's
  version verbatim (original batch); version 1 stays the default and is used
  whenever nothing is reused.
- validateReleaseRequest: foreign-batch records allowed only in version 2
  with a parent; unknown future versions ask for an Auth update.
- inspectReleaseRequest: reused records must equal the parent's version for
  the same logical key and exist on Platform; fail closed otherwise.
- Admin: compare with parent (ignore bookkeeping/CIDs, blobs by hash), skip
  upload for reused blobs but read them back; opt-in via
  DECENT_RELEASE_REUSE_UNCHANGED=1. Null draft publishedAt keeps the
  parent's date. Timing logs record reusedCount.
- Auth 0.1.20 (versionCode 21) bundles the new validator.
- Tests: tests/only-changed-release.test.ts (7 tests).
Author
Owner

Merged to main as merge commit 745c57ed08 (--no-ff, pushed over SSH). Forgejo doesn't allow the manually-merged style on this repo, so I'm closing this PR by hand.

  • Full test suite on the merge result: 176 passed, 0 failed.
  • Auth 0.1.20-mainnet debug APK built from the merge (versionCode 21, same debug signer as 0.1.19). Installed on the Galaxy Tab A7 Lite with adb install -r, and app data was kept.
Merged to `main` as merge commit 745c57ed0850aeee60d3cb890233450c4d137bae (`--no-ff`, pushed over SSH). Forgejo doesn't allow the manually-merged style on this repo, so I'm closing this PR by hand. - Full test suite on the merge result: 176 passed, 0 failed. - Auth **0.1.20-mainnet** debug APK built from the merge (versionCode 21, same debug signer as 0.1.19). Installed on the Galaxy Tab A7 Lite with `adb install -r`, and app data was kept.
rhelwig closed this pull request 2026-10-10 18:59:24 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
feature request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rhelwig/DecentSite!11
No description provided.