Skip to content

windows core tests - #64

Merged
rgdevment merged 4 commits into
mainfrom
rgdevment/windows-audit-core-tests
Sep 14, 2026
Merged

rgdevment merged 4 commits into
mainfrom
rgdevment/windows-audit-core-tests

Conversation

@rgdevment

Copy link
Copy Markdown
Owner

No description provided.

  The workspace did not build on Windows at all. Now 290 tests, 97.77%
  coverage and zero surviving mutants, with the format catalogue derived
  from seventeen real copies rather than from assumption.

  The sequence counter does not count copies here: it climbs 5 to 15 per
  copy depending on how it was made, so the watcher declares its cadence
  instead of defaulting to the macOS one and inventing lost copies.
…pboard

A format promised with no data blocks GetClipboardData for 30 seconds
exactly — measured with the owning process suspended, which is rdpclip
with the session gone. What is already in the clipboard answers in 1.5 ms
even then, so every read runs under a 100 ms ceiling and what does not
arrive is recorded as absent rather than waited for.

Capture refuses before asking for a byte, notes the whole set while
copying only the whitelist, and transcodes DIB to PNG as a synthetic
format while recording the original and its size. Restore writes images
twice: the PNG for modern targets and a rebuilt CF_DIBV5 for Paint, which
does not read PNG.

This gives cp_core::dib and Catalog::declines their first production
caller; declines was the only privacy rule in the catalogue with no path
to execution. Paste adds Failure::TargetElevated, which Windows needs and
macOS does not: UIPI drops injected input at a higher integrity level and
SendInput still reports the full count.

The probe stopped being observational now that Windows can write. One of
its cases caught the battery leaving a secrecy marker behind, which made
the next run fail — it now cleans up, and a case checks that it did.

Mutants run over the crates without a system call, as macOS already did:
cp-win-sys is verified by the probe, not by mutation.

376 tests, 25 system cases, cp-win-sys behind the same unsafe rule as
cp-mac-sys.
@rgdevment
rgdevment force-pushed the rgdevment/windows-audit-core-tests branch from 031c85e to c781a57 Compare September 14, 2026 19:47
@rgdevment rgdevment changed the title Rgdevment/windows audit core tests windows core tests Sep 14, 2026
Paste is verified end to end: the probe creates its own target window,
brings it forward, sends the nine-event batch and reads what arrived in
the control. The other half is verified too — against a dead target it
degrades to TargetGone and the text stays in the clipboard, so the worst
outcome is still "paste it yourself".

Polling the sequence number costs 267 ns, so the watcher polls instead of
registering a message-only window: AddClipboardFormatListener would have
bought nothing measurable.

OCR reads the shared fixture in 35 ms against Vision's 180 on macOS. The
decision does not change — it still runs after capture, never during.

windows-future 0.3 dropped synchronous waiting, so completion is awaited
by polling status under a five second ceiling rather than pulling in an
executor.

Tests that touch the clipboard moved to the probe: it is a single global
resource, so they raced each other under cargo test's parallelism. That is
the same split macOS reached from the other side, where NSPasteboard
demands the main thread.

388 tests, 34 system cases.
The 2.x thumbnail rule throws away wide images. It calls anything with
*either* side under 64 px a generic icon, and this project's own fixture
comes back from the shell at 256x57, so its thumbnail was discarded. A
generic icon is small *and* square; a thumbnail keeps the source ratio, so
the test is both sides, not one. It now yields 5,895 bytes against 126,497
of the original, in 32 ms.

Media metadata arrives through IPropertyStore and thumbnails through
IShellItemImageFactory, both behind a COM apartment and a path the shell
accepts — canonicalize hands back a \\?\ prefix that it refuses.

Windows now matches macOS piece for piece: catalogue, fourteen-class
classification, watcher, capture, restore, paste, permissions, bounded
reads, copy-vs-cut, DIB to PNG and back, OCR, media metadata and shell
thumbnails.

402 tests, 37 system cases, 95.10% coverage with the harness included,
zero surviving mutants. The Windows coverage gate moves from 90 to 95.
@rgdevment
rgdevment merged commit c6c3a5a into main Sep 14, 2026
9 of 14 checks passed
@rgdevment
rgdevment deleted the rgdevment/windows-audit-core-tests branch September 14, 2026 20:22
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.

1 participant