Skip to content

ateletpb: carry the Restore base snapshot as a typed source, dropping golden_snapshot_uri - #1602

Merged
Benjamin Elder (BenTheElder) merged 3 commits into
agent-substrate:mainfrom
dberkov:restore-source-proto
Sep 26, 2026
Merged

Benjamin Elder (BenTheElder) merged 3 commits into
agent-substrate:mainfrom
dberkov:restore-source-proto

Conversation

@dberkov

@dberkov Dmitry Berkovich (dberkov) commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Refactors the atelet Restore API so the DATA_ON_GOLDEN base snapshot travels as a typed restore source instead of a bare string, preparing for the node-local snapshot cache (#690, #1551): RestoreRequest gets its own external snapshot source message, and read-side attributes of a restore source have a home — today the URI, next (in the M2 cache work) a sharing property set by the control plane.

This change is not backward compatible. golden_snapshot_uri is removed from RestoreRequest with no transition: an ateapi from before this change sends a DATA_ON_GOLDEN restore an updated atelet rejects (no base_config), and an updated ateapi sends one an old atelet rejects (no golden_snapshot_uri). ateapi and atelet must be rolled together. Fresh starts, FULL/DATA restores of an actor's own snapshot, and local pause restores without a golden base are unaffected.

Three commits, each buildable and tested:

  1. ateletpb: give Restore its own external snapshot source message — ExternalRestoreConfiguration replaces ExternalCheckpointConfiguration in RestoreRequest's config oneof (same wire shape; the checkpoint-side write-destination message is untouched), and base_config is added for the DATA_ON_GOLDEN base. No behavior change: nothing sets or reads the new field yet.
  2. ateapi, atelet: carry the restore base snapshot in base_config — the cutover: ateapi sets base_config on both golden-data resume paths (external data snapshot, and local pause checkpoint combining with the golden); atelet reads and validates only base_config. The characteristic test of the ateapi→atelet request and the golden-data functional test pin the new field.
  3. ateletpb: remove golden_snapshot_uri from RestoreRequest — the old field is deleted and base_config takes its field number, keeping the numbering dense.

Tested: full ateapi + atelet suites including the controlapi functional tests; gofmt, golangci-lint, boilerplate clean.

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think I agree with the agent here, this could be a lot simpler if we leaned into the fact that currently we don't support rolling upgrades on a node.

Comment thread internal/proto/ateletpb/atelet.proto Outdated
Comment on lines +453 to +456
// Superseded by base_config. During the transition callers set both and
// atelet prefers base_config, so ateapi and atelet can roll in either
// order; removed (and reserved) in a follow-up once both sides have
// rolled.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 should-fix 🟡 – The transition isn't needed. Before 1.0 we don't keep cross-version wire compatibility: a release deploys as a unit (versioned atelet DaemonSet, version-labeled nodes), so a new ateapi never talks to an old atelet, or the other way round.

That means this PR can replace golden_snapshot_uri with base_config outright, and a lot goes away:

  • the dual-write on both resume paths in workflow_resume.go
  • restoreBaseConfig's fallback and the must-agree check in validateRestoreRequest (cmd/atelet/main.go:1735-1760)
  • the dual-field assertions in the new functional test
  • the follow-up PR to remove and reserve field 12
  • the "Must stay field 1" constraint on ExternalRestoreConfiguration.snapshot_uri

The refactor you're after, a restore-source type with a home for read-side attributes, stays exactly as it is.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done, it simplified code by a lot :)

@dberkov Dmitry Berkovich (dberkov) changed the title ateletpb: split the Restore snapshot source from the checkpoint destination ateletpb: carry the Restore base snapshot as a typed source, dropping golden_snapshot_uri Sep 25, 2026
RestoreRequest borrowed ExternalCheckpointConfiguration — a write
destination — for the snapshot it reads, leaving read-side attributes
of a restore source no place to live. Split the restore arm into its
own ExternalRestoreConfiguration; the oneof's type change is
wire-compatible (snapshot_uri keeps field number 1, and old peers
decode the message as before).

base_config supersedes golden_snapshot_uri, typing the DATA_ON_GOLDEN
base as a restore source too. The old field stays until both
components roll — callers set both and atelet prefers base_config —
and is removed (and reserved) in a follow-up.

Pure restructuring: no caller sets base_config yet, nothing reads it,
and the wire bytes of every current request are unchanged.
Move the DATA_ON_GOLDEN base snapshot from RestoreRequest's top-level
golden_snapshot_uri string to base_config, a typed restore source:
ateapi sets it on both golden-data resume paths (an external data
snapshot and a local pause checkpoint combining with the golden) and
atelet reads and validates only it. The characteristic test of the
ateapi to atelet request pins base_config accordingly.
Comment thread internal/proto/ateletpb/atelet.proto Outdated
Comment on lines +475 to +476
reserved 12;
reserved "golden_snapshot_uri";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 nit 🟢 – Same reasoning as the transition: before 1.0 there's no mixed-version pair to protect, so field 12 doesn't need reserving. base_config could take 12 directly instead of 17, which keeps the numbering dense. Not a blocker either way.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(we just did a cleanup pass of these)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

base_config now carries the DATA_ON_GOLDEN base snapshot; nothing sets
or reads the old string field. base_config takes its field number,
keeping the message's numbering dense.
@BenTheElder
Benjamin Elder (BenTheElder) added this pull request to the merge queue Sep 26, 2026
Merged via the queue into agent-substrate:main with commit 1d7ca8c Sep 26, 2026
10 of 11 checks passed
@dberkov
Dmitry Berkovich (dberkov) deleted the restore-source-proto branch September 26, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/node area/storage kind/cleanup Small fixes that are not bugs, for example a typo in a code comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants