Make the creation plan say what the run will actually do - #103
Merged
Conversation
Two mismatches, both seen in a live run that declined deduplication. The plan promised an initial optimization job whatever the answer, while an optimization job is a deduplication job: the work sits inside the block that declining deduplication skips. Somebody who chose "Neither" was told about a step that could not happen. The line moves inside that branch. The plan also listed marking the drive trusted second to last, after deduplication, while the run applies it straight after formatting and before BitLocker. Read before deciding whether to proceed, that put the trusted designation after the longest and most failure-prone step instead of before it. The line moves to where the work is. The test that covered both asserted their presence and nothing else, and its title called the optimization job one of "the two steps that always run" - which was the falsehood. It is replaced by assertions about position: within the plan, and against the order the body carries the steps out in, since those two lists drifting apart is the defect. Closes #101 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by free · Input: 41.9K · Output: 13.6K · Cached: 384.4K |
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.
Closes #101.
Both mismatches were seen in a live run creating a Dev Drive in a
.vhdxwith deduplication declined.AGENTS.mdsays the plan summary must say what will actually happen on this machine; in that run it did neither of these.The plan promised work that was skipped
The run answered "Neither" at the deduplication question. The plan said:
and the run ended:
An optimization job is a deduplication job — the work sits inside the block that declining deduplication skips — but the line promising it was added outside that branch, so it printed whatever the user chose. It is inside the branch now.
The plan listed one step in the wrong place
Marking the drive trusted was listed second to last, after deduplication. The run applies it straight after formatting, before BitLocker:
Read before deciding whether to proceed, that told the reader the trusted designation came after the longest and most failure-prone step in the run, when it comes before it. The line moved to where the work is.
The test that made both invisible
One assertion covered them, and it asserted their presence and nothing else:
It 'ends every mode with the two steps that always run' {Its title was itself the falsehood — the optimization job is not one of the steps that always run. It is replaced by four assertions about position:
Format-Volumecall, then thefsutilcall, then the BitLocker heading. Comparing the plan against a literal list is what let the two drift apart, so this compares it against the body insteadelsebody by syntax-tree containment, not by proximityThe
fsutilanchor is found as aCommandAst, not by text: two pieces of retry advice quote the same command line earlier in the file, and a text match found one of those first.Proved to have teeth
Each assertion was checked by reintroducing on a scratch copy the exact defect it exists to catch. The script was restored byte for byte.
Reviewed
An independent review of the commit raised one finding, applied: a two-line comment that said in two lines what one says. It also checked both relocated lines against the linear body and confirmed the new plan order matches the run step for step, and confirmed that the issue's aside about
$RunInitialJobis not a gap — that flag is a hardcoded$true, never a user answer, so there is nothing for the plan to key to.No change to what the run does. Only to what it says it will do.
🤖 Generated with Claude Code