Skip to content

release: keep the legacy schema marker at 4 so older Cores update - #1306

Merged
frahlg merged 4 commits into
masterfrom
1302-legacy-schema-marker
Sep 18, 2026
Merged

frahlg merged 4 commits into
masterfrom
1302-legacy-schema-marker

Conversation

@frahlg

@frahlg frahlg commented Sep 18, 2026

Copy link
Copy Markdown
Member

Refs #1302. Pairs with #1304; both must be in the next beta.

Problem

#1304 stops new Cores from copying history into the update rollback point. It cannot help a box that is still on v3.5.3-beta.1 or older: that box runs the old code when it updates. The old code reads <!-- ftw-state-schema:N --> from the target's release notes and, whenever N differs from its own schema (4), runs the paced full-history export first. On a Raspberry Pi with a large history that export cannot finish, so no such box can reach any release with a newer schema through the UI. Asking every tester to update over SSH is not acceptable.

Change

Release notes carry two markers from now on:

Marker Value Read by
<!-- ftw-state-schema:N --> fixed at state-schema.json legacy_marker (4) Cores before v3.6.0-beta.1 only
<!-- ftw-state-schema-v2:N --> the release's real state schema (state-schema.json version) Cores from this change on
  • Old Cores see 4 == 4, report "schema unchanged", skip the export and update straight through pull and restart. Their downgrade check also passes (4 is not below 4).
  • New Cores read the v2 marker first and fall back to the legacy one, so downgrade refusal between new versions keeps working. Both markers are stripped from the release notes shown in the UI.
  • beta.yml and release.yml read legacy_marker from state-schema.json and publish both markers.
  • scripts/check-stable-release.py requires exactly one legacy marker with the floor value and exactly one v2 marker with the expected schema.
  • state.LegacyReleaseMarker and a Go test pin the floor to 4; changing it trips the test and its comment explains why.

Why this is safe now

v3.6.0-beta.1 was the only release whose Core reads the legacy marker with a schema above 4. It was withdrawn to a draft on 2026-09-17 and, as far as the owner knows, no box installed it. A box that did would refuse this update ("newer history format") and needs a manual image change; that is documented in the PR for #1302.

Old Cores take no local rollback point on this transition. They never had a usable one from the UI: the updater restores only state.db, and the rollback handler refuses points that predate a history-format change. Going back still means a full backup made before the update, as before.

Evidence

  • go test ./internal/selfupdate/ ./internal/state/ pass, including the new parser test that checks what an old Core sees (4) and what a new Core sees (7) in the exact body the workflows publish.
  • make release-workflow-test passes. scripts/test-exact-image-promotion.sh now also rejects notes with the legacy marker at the current schema (which would send old Cores back into the copy) and notes without the v2 marker.

🤖 Generated with Claude Code

Cores before v3.6.0-beta.1 read the release-notes marker
<!-- ftw-state-schema:N --> and copy their whole history before any
update whose N differs from their own schema, 4. On a Raspberry Pi with
a large history that copy cannot finish (#1302), so no such box could
ever reach a release with a newer schema through the UI.

Release notes now carry two markers. The legacy one stays at
state-schema.json's legacy_marker (4), so older Cores skip the copy and
update. The new <!-- ftw-state-schema-v2:N --> carries the real schema;
Cores from this change on read it first and use it to refuse a
downgrade. The stable release guard requires exactly one of each, a Go
test pins legacy_marker to 4, and the promotion test rejects notes that
would send old Cores back into the copy.

Refs #1302

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T03:58:02.940786Z e9ae4bf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9ae4bfba7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread state-schema.json
{
"version": 7
"version": 7,
"legacy_marker": 4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve a rollback snapshot across schema-changing updates

For a legacy Core on schema 4, this marker makes the schema-7 release appear schema-compatible: its old parser reads 4, sets FullBackupRequired to false, and runVersionUpdate skips createPreUpdateSnapshot. If the new Core fails after changing state.db, reverting the image leaves no schema-4 snapshot even though SchemaVersion explicitly denotes a format the prior Core cannot safely reopen. Avoid representing a schema-changing update as unchanged; resolve the backup timeout without removing the rollback safety net.

AGENTS.md reference: AGENTS.md:L24-L25

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 6af12e8 into master Sep 18, 2026
16 checks passed
@frahlg
frahlg deleted the 1302-legacy-schema-marker branch September 18, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant