Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Removing the three-argument Backup method breaks existing compiled consumers, while consumed attempt-ID reuse blocks later polling updates and interrupted backups can leave unbounded partial snapshots.
3 open issues
What changed in this PR
Adds an opt-in attempt journal alongside #549’s durable startup handoff, binding each update attempt to the exact backup used by ClientStrategy. File restoration, recovery ownership, and application-readiness confirmation remain outside this layer.
Changes:
- Adds checksummed journal records, staged backup publication, and retention pins.
- Carries and validates attempt metadata across the process contract, with legacy rollback suppression for cooperating consumers.
- Adds workflow, process-restart, and Bowl tests, plus documentation of reliability boundaries.
| File | Description |
|---|---|
tests/StartupHealthProbe/Program.cs |
Adds cross-process journal probes. |
tests/CoreTest/StartupHealth/DurableUpdateAttemptStoreTests.cs |
Covers binding, retention, claims, restart, and invalid state. |
tests/CoreTest/Configuration/UpdateRequestBuilderTests.cs |
Tests attempt-ID configuration and validation. |
tests/BowlTest/Integration/BowlCrashPipelineTests.cs |
Tests durable-attempt crash restore suppression. |
tests/BowlTest/BowlContextTests.cs |
Tests suppression during context normalization. |
src/GeneralUpdate.Core/Strategy/ClientStrategy.cs |
Creates attempts and reserves and binds workflow backups. |
src/GeneralUpdate.Core/Strategy/AbstractStrategy.cs |
Honors the legacy rollback suppression flag. |
src/GeneralUpdate.Core/StartupHealth/DurableUpdateAttemptStore.cs |
Implements persistent state, recovery claims, and retention locking. |
src/GeneralUpdate.Core/FileSystem/StorageManager.cs |
Adds staged backups and pin-aware retention. |
src/GeneralUpdate.Core/Configuration/UpdateRequestBuilder.cs |
Exposes caller-owned attempt-ID configuration. |
src/GeneralUpdate.Core/Configuration/UpdateContext.cs |
Adds journal location and rollback suppression state. |
src/GeneralUpdate.Core/Configuration/UpdateConfiguration.cs |
Adds the optional durable attempt ID. |
src/GeneralUpdate.Core/Configuration/ProcessContract.cs |
Carries attempt metadata between processes. |
src/GeneralUpdate.Core/Configuration/ConfigurationMapper.cs |
Propagates attempt configuration into context and IPC. |
src/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs |
Validates received metadata against the bound snapshot. |
src/GeneralUpdate.Bowl/BowlContext.cs |
Disables automatic restore when an attempt ID is present. |
docs/durable-update-attempts.md |
Documents usage, guarantees, and recovery and health limitations. |
Review effort: Balanced
| /// </para> | ||
| /// </remarks> | ||
| public static void Backup(string sourcePath, string backupPath, IReadOnlyList<string> directoryNames) | ||
| public static void Backup(string sourcePath, string backupPath, IReadOnlyList<string> directoryNames, bool createOnly = false) |
Comment on lines
+539
to
+542
| var stagingPath = Path.Combine( | ||
| Path.GetDirectoryName(backupPath)!, | ||
| AttemptDirectoryName, | ||
| ".staging-" + Guid.NewGuid().ToString("N")); |
| if (attemptStore != null) | ||
| { | ||
| var attemptId = _configInfo.DurableUpdateAttemptId!.Value; | ||
| attemptStore.Begin(attemptId); |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
JusterZhu
force-pushed
the
justerzhu-persist-attempt-snapshot-binding
branch
from
November 23, 2026 05:01
d14210f to
afc5845
Compare
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Status: DRAFT — NOT DEPLOYABLE
This opt-in layer is not a production recovery/readiness closure. There is no verified, fenced recovery owner, trusted producer/consumer version handshake, or application-owned readiness check.
Scope and trust boundary
GetLatestBackup()fallback. Attempt-specific create-only paths and a cooperating lock protect retention from participating calls only.ControlledRecovery/ControlledLease, or recovery-owner claim is introduced. GeneralLibrary/Bowl#3 remains fail-closed and is not a production recovery consumer.Latest validation at the fixed #551 head
At
afc584562b01117c2ed64bbd92a5c42990a798f2, the released shared validation window was used serially after the #557 focused run. The actual full Core runner passed 1016/1016, zero skipped, in 27 seconds:Raw console and TRX evidence are preserved as
coretest-afc58456-serial.logandcoretest-afc58456-serial.trx; TRX counters confirmtotal=executed=passed=1016,failed=0. No other test/vstest was active at startup. The later observed unrelated runner was created after this run's recorded finish. All test/probe processes owned by the two serial runs exited; no unrelated process was stopped. The worktree remains clean at the fixed head. Restore/build emitted existing dependency-advisory and SourceLink warnings; this run is not a vulnerability or deployment clearance.Historical evidence and diagnostic fix isolation
The original runner outputs at
e92bd9f2were actual executions: Core 1016/1016 and Bowl 154/154. A previous shared-load full Core run executed 1016 tests but reported 1015 passed/1 failed:StartupHealthHandoffTests.Competing_launcher_processes_cannot_both_starthit its 15-second assertion. Its isolated single-test rerun passed 1/1, and the latest full serial run above also passes without changing the assertion. The prior failure's root cause is not established; a later pass does not erase it. Its one leftoverStartupHealthProbe.dll waitprocess was identified as owned by that completed run, terminated specifically and verified gone.A full Bowl run before extracting the independent fix reported 153 passed/1 failed: cleanup hit a locked
driverInfo.txtafter Windows diagnostics export exceeded its 30-second wait. Timeout had returned without ending the export process tree. The fix was removed from #551 and is isolated in draft PR #555, based onmaster, head88e86345c7129b9ed70f755f70fbb05ebcf9715f. Its full standalone BowlTest run passed 152/152 (the #551 tree has two additional durable-attempt tests); the timeout/termination path executed, the unique directory was removed and no exporter remained. #551 intentionally contains no Bowl diagnostic-fix files.The original three-argument
StorageManager.Backupbinary overload remains. Core multi-target build/trim analysis passed historically with an existingGeneralTracerIL2026 warning; that is not Native AOT runtime or business-readiness evidence.Durable tests and remaining proof
Client_strategy_creates_and_binds_the_backup_used_by_its_update_workflowcovers the real Client backup/contract producer.Child_process_requires_the_matching_attempt_contract_and_rejects_missing_or_corrupt_ipccovers a real child Core bootstrap and ZIP Full apply from a pre-created attempt/contract; rejects missing, corrupt, wrong-attempt and Bowl IPC, and observes no Success.AbstractStrategy/ClientStrategyneeded conflict resolution; the fallback covered-chain batch-success case remains unverified.Independent follow-up
The content-identity layer is draft PR #557, head
ba572f3c5bd1935984ced3ebfd4564919e9d03fb, based on this PR's fixedafc58456head. It addsSnapshotManifestHash, attempt/install/exact-snapshot manifest verification, fail-closed v1 pinning and real Client → IPC → child apply coverage. Its latest focused managed runner passed 16/16 in 27.19 seconds in the released serial window, with no other test/vstest at startup and no owned test/probe processes left. The earlier 16/16 shared-load result remains recorded separately in #557. An initial--no-restoreretry after AOT publication hitNETSDK1005; the successful test command restored multi-target assets and executed the tests.Native AOT CI run 45116763509 succeeded at that follow-up SHA. The logs confirm native code generation, one executable process reopening/verifying the bound snapshot, and another rejecting equal-length tampering. This smoke exercises
snapshot-createandVerifySnapshotContentAPIs, not native ProcessContract JSON/bootstrap or the full Client → native updater pipeline. Managed tests cover Client → IPC → child apply. Local AOT publication failed withPlatform linker not found; no local native executable ran. These are follow-up results, not extra tests executed at the #551 head or production readiness/recovery evidence.Content hashes do not establish authorization, immutable content, portable no-follow semantics or a write fence. Unix FIFO/device handling and check/open TOCTOU remain unresolved. Keep durable Success suppressed and both durable PRs non-deployable until trusted handshake/tenant-record authorization, a real fenced recovery owner and application-owned readiness are independently implemented and tested. No
ControlledRecovery/ControlledLease, automatic restore or recovery-owner authority is enabled.