Repository navigation
perf(validation): Collect moves its payload in one guest agent call, gzipped - #9
Merged
Merged
Conversation
…gzipped The payload went through 179 guest exec calls of 100,000 characters at about 6 seconds each, 25 minutes for one Collect. The device now gzips the JSON (13.4 MB to 380 KB) and the driver reads it with the agent's file-read call in one reply; scripts go in through file-write, 30,000 characters per call instead of 1,200. Both checked by SHA-256. Collect -Since keeps only the probe records from a time on. 3.9 minutes for the same run, 2 with -Since. REM-INSTALL-MODULE hangs for its 60-minute timeout every hour and held round 10's seven detections for 70 minutes; its assignment is removed, the policy stays.
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
Collectin the validation kit took 25 minutes on the lab device, almost all of it moving the payload: 18 MB of base64 read through 179 guest exec calls of 100,000 characters at about 6 seconds each. The same run now takes 3.9 minutes, and 2 minutes with-Since. Scripts going into the VM move the same way, 30,000 characters per call instead of 1,200.Only the validation kit changes, plus one tenant object: the round-7 experiment
REM-INSTALL-MODULEis no longer assigned, since it hangs for its full 60-minute timeout every hourly cycle and holds the lab's remediation runner for every experiment queued behind it.Changes
GuestAgent.ps1:Send-GuestFile. Writes a file into the VM through the guest agent'sfile-writecall, as base64 part files of 30,000 characters on the host's command line (under the 32,767 Windows allows), joined and decoded by one guest command; the VM's SHA-256 of the result is compared with the local one. Replaces the loop that wrote 1,200 characters per guest exec in both the driver andInvoke-LabGuestScript.ps1.GuestAgent.ps1:Receive-GuestFile. Reads a file from the VM through the agent'sfile-readcall, one reply of up to 16 MB, refused when the agent marks it truncated or the hash is not the VM's. ReplacesRead-GuestPayloadand its chunk loop.file-readreturned in 2 seconds. The driver inflates it (Expand-GzipText).Collect -Since <datetime>. Keeps only the probe records written from that time on. Record times are ISO 8601 in UTC, so the device compares them as strings. Every record is kept when the parameter is omitted, as before.REM-INSTALL-MODULE's assignment removed through Graph; the policy stays in the tenant soDeployskips it and its evidence stands. Noted in Findings and the README.Send-GuestFile(part size, call shape, join and hash check, a refused write, a hash mismatch),Receive-GuestFile(call shape, truncated reply, hash mismatch, failed call),Expand-GzipTextround trip, andInvoke-GuestScriptFileover the new delivery.Verification
Validation/; no line over 115 characters.Invoke-LabGuestScript.ps1delivered and ran a script in 16 seconds end to end.Collectwithout-Since: 3.9 minutes, 45 remediations, 11 platform scripts, 6,152 probe records, payload hash matched.Collect -Since 2026-10-05: 2 minutes, 181 probe records, oldest 2026-10-05 00:18 UTC. The previous run on the same device with the chunked transport took 25.2 minutes.collect.b64from the earlier run, 13,410,018 bytes of JSON, packed to 379,989 bytes in 0.7 seconds on the device.Notes
file-readreturns at most 16 MB. A payload that large after gzip would need the chunked path back; at today's 380 KB that is 40 times away.