Repository navigation
Conversation
Tests only: concurrent worker-publisher/supervisor-reader stress, numeric highest selection, corrupt/foreign highest refusal, bounded FileNotFound re-list, terminal verification, and real-command release cleanup proof. Production sources are unchanged so these fail against the check-then-open/Replace journal. Refs #826 Refs #822 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f32f381-95ba-4648-a71a-c021bcfa8aa3 Signed-off-by: Colin Neilens <coneilen@microsoft.com>
…removal The supervisor polled process-journal.json with Test-Path then Open while the worker replaced it with File.Replace, so the name could be briefly missing and the hosted UiCaptureDriver cases failed intermittently (49 run, 47 passed). The worker now writes each complete, hash-chained snapshot to a same-directory unique temporary and publishes it with a non-overwriting File.Move to process-journal.N.json. The supervisor lists the numeric snapshots, opens the highest directly, and re-lists within a bounded budget only for FileNotFoundException on the just-listed name; parse, binding, access and sequence failures never fall back to an older snapshot. After the worker exits with EOF it verifies the contiguous hash chain, binds the terminal snapshot (sequence, hash, count, identity, cleanup arrays) to the final manifest, preserves a pre-removal inventory, removes exactly the owned snapshots and proves their absence in the official release. Failures stay cleanup-unproven. Refs #826 Refs #822 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f32f381-95ba-4648-a71a-c021bcfa8aa3 Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Collaborator
Author
|
Superseded under the operator-directed fifth-failure escalation for #826. This PR is closed unmerged; its source, uncommitted review-fix candidate, failed and invalid runs, Sol rejection, and stopped-run handoff are preserved. No complete green local child or accepted corrected journal proof is claimed. A separately authorized fresh owner must first prove deterministic CIM attestation against main, then implement the mandatory immutable-snapshot protocol. No captures are authorized by this closure; #826 and the broader verifier remain open. |
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.
Summary
The capture supervisor polled the worker's
process-journal.jsonwith a check-then-open (Test-Path, thenFile.Open) while the worker published each update by replacing that same path (File.Replace). The name can be transiently absent or locked during a replacement, so hosted runs intermittently failedUiCaptureDriver(49 run, 47 passed) withCould not find file ...\process-journal.json(run 38673179020 attempt 2, job 116225253342) and, on another PR,being used by another process(run 38679005657, job 116239062659). This PR replaces the mutable path with immutable numbered snapshots, adds a bounded re-list for the one case that means "list again", binds the terminal snapshot to the final manifest, and has the supervisor remove and prove removal of exactly its snapshots at release.Refs #826
Refs #822
Changes
Invoke-UiCaptureWorker.ps1):Publish-CapJournalSnapshotwrites a complete, closed, hash-chained snapshot (sequence,previousSha256,terminal) to a same-directory uniqueprocess-journal.pending-GUID.tmpopenedCreateNew, flushes it, then publishes it with the non-overwritingFile.Movetoprocess-journal.N.json. No overwrite, replace or pre-delete. A collision throws and keeps the unpublished temporary. A terminal snapshot seals the journal.Write-CapTerminalProcessJournalreplaces the inline final write, and the final manifest carriesprocessJournal(terminal sequence, SHA-256, count).Invoke-UiCapture.ps1): the reader lists strict positive numeric names (so 10 sorts above 9), directly opens the highest listed snapshot (noTest-Pathbefore open), and re-lists within a bounded budget (8 attempts, 10 s, no sleeps) only forFileNotFoundExceptionon the just-listed name. Parse, encoding, access/sharing, hash, lease/job/module/worker binding, sequence/name mismatch and foreign names in the journal namespace all fail; a corrupt highest never falls back to an older snapshot; the observed highest sequence/hash never regresses or changes. Unpublished temporaries are never read as snapshots.journal-snapshot-inventory.json, createdCreateNew) before removing the exact owned snapshot files, then proves their absence. The official release gains ajournalrecord (state, positive inventory, terminal binding, removed and remaining names, failures). A no-worker refusal reportsNO_WORKER_STARTED; verification failures retain every snapshot as forensic evidence; any removal or verification failure staysCLEANUP_UNPROVEN.UiCaptureDriver.Tests.ps1): all 49 original case names are kept. The historical caseactual journal reader permits worker atomic replacement while retaining its snapshotkeeps its name and held-snapshot assertions but now exercises immutable publication (it no longer uses Replace). Eleven new real cases, no process, launch, lease, supervisor, worker or release mocks, cover: numeric highest selection, corrupt/foreign/mismatched highest refusal without fallback, controlled just-listed disappearance (supersede, sharing violation not treated as missing, vanish without successor, exhausted budget), a many-publication concurrent worker-publisher/supervisor-reader run with a held old reader and named-event barriers, terminal/manifest binding negatives, publisher collision and post-terminal sealing, and five real-command release cases (clean removal proof, no-worker refusal, planted corrupt highest, colliding foreign name, unremovable snapshot).UiCaptureDriver.psm1(byte-identical, native bindings still 16), the harmless-target hooks are test-only, no product, scene adapter, runner, workflow, budget, provider, pin, bootstrap, README, ledger, schema or WinApp changes. The legacy hash-pinnedactualSeedEvidenceReusejournal check is unchanged.Test plan
Root cause of the unknown part is not claimed: the exact blocker or writer state behind each hosted failure was never measured and no worker journal artifact exists. The reproduction below is against the frozen fde702b sources and shows the same message class.
RED: pwsh -NoProfile -File Tools\windows\Tests\UiCaptureDriver.Tests.ps1 -ScratchRoot C:\gcs\j3\red (test-only commit 39690e5, unfixed production) -> executed 59, passed 49, failed 10 including the concurrent publication case: the reader failed 25 of 217 reads with Could not find file process-journal.json and being used by another process
GREEN: pwsh -NoProfile -File Tools\windows\Tests\UiCaptureDriver.Tests.ps1 -ScratchRoot C:\gcs\j3\final4 (head 7b77706) -> executed 60, passed 59, failed 1; all 11 new cases and all original cases pass except the scene component case, which fails the same way on unmodified origin/main under current local load (48 of 49)
REGRESSION: pending hosted exact-head CI -> to be recorded
Not verified
Live PID has incomplete current CIM metadataon both this head and unmodified origin/main (C:\gcs\j3\baseline-load, 48 of 49) while the machine is under load. It passed in the RED run and in an earlier GREEN run. Hosted exact-head CI is the authority.Checklist
git commit -s) per the DCOmake test)make check)