Skip to content

Conversation

@sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Nov 7, 2025

Add an operation log to the simulator, as well as ways to undo, redo and restore to the last operation. Modeled pretty directly after how Jujutsu's operation log works.

The biggest change here is that the current pointer is now managed by the simulator rather than reconfigurator-cli, so that it can be versioned as part of the operation.

Depends on:

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the title [3/n] [reconfigurator-cli] add an operation log [3/n] [reconfigurator-sim] add an operation log Nov 7, 2025
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.3n-reconfigurator-cli-add-an-operation-log to main December 1, 2025 20:41
Created using spr 1.3.6-beta.1
@sunshowers sunshowers requested a review from jgallagher December 1, 2025 22:08
Created using spr 1.3.6-beta.1
///
/// Clears all operation history and resets to just the root operation.
/// This is the only operation that violates the append-only principle.
Wipe,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking my understanding: Is the difference between op wipe and wipe {system,all} that the latter two are themselves operations appended to the log (that wipe the simulated state but can be undone/redone), and the former erases the log itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, yeah. The operation log is the root of everything so this is a higher-level wipe.

}

// Invariant: the ID should be not present in the store, having been
// generated by next_sim_uuid.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still required, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, good catch.

Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) December 24, 2025 02:04
@sunshowers sunshowers merged commit 408f043 into main Dec 24, 2025
16 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/3n-reconfigurator-cli-add-an-operation-log branch December 24, 2025 05:28
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.

3 participants