Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 11 additions & 31 deletions .claude/skills/run-socktuner/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: run-socktuner
description: Build, launch, drive, screenshot and probe the SockTuner WPF desktop app on Windows. Use when asked to run, start, open, screenshot, inspect the UI of, or capture an inventory from SockTuner, or to verify a change in the real app rather than in tests.
description: Build, launch, drive and screenshot the SockTuner WPF desktop app on Windows. Use when asked to run, start, open, screenshot, inspect the UI of, or verify a change in the real app rather than in tests.
---

# Run SockTuner
Expand Down Expand Up @@ -33,7 +33,6 @@ powershell.exe -NoProfile -File .claude/skills/run-socktuner/driver.ps1 <command
| `tabs` | Lists the navigation entries; `*` marks the selected one |
| `select "<name>"` | Selects a tab by name (substring match) |
| `shot [path]` | PNG of the window → `.claude/skills/run-socktuner/shots/` |
| `probe` | Read-only inventory dump to JSON on the Desktop |
| `stop` | Kills the process |

A full verified cycle:
Expand Down Expand Up @@ -82,41 +81,32 @@ the saved position no longer lands on an attached monitor.
`Tuning plan` used to be last; it now sits with the other surfaces that act. The reference
links moved out of `Preferences` into `Tools & references`.

## Inventory without the GUI
## Compatibility reports

`probe` runs the app's own `--probe` mode: a read-only capture of the whole inventory,
redacted (`machineName` masked, no addresses), written as JSON to the Desktop. It changes
nothing on the machine. This is the fastest way to inspect what the app *sees* without
touching the UI:

```bash
powershell.exe -NoProfile -File .claude/skills/run-socktuner/driver.ps1 probe
# OK probe -> C:\Users\<user>\Desktop\socktuner-probe-20260828-022443.json (410.4 KB)
```

Committed probe corpora live in `alpha-tester-output/`.
Compatibility reports are intentionally created only through the visible UI flow under
**Preferences → Help improve SockTuner**. The user reviews the complete JSON before saving
and explicitly chooses whether to open the GitHub issue form. The agent driver does not
bypass that consent flow.

## Tests

```bash
dotnet test SockTuner.sln
```

659 pass, 12 skipped. The 12 skipped are read-only live-inventory checks against the real
adapters and the two device-level settings; they are safe on a normal desktop and mutate
The default suite reports its current pass/skip counts. Skipped tests are read-only
live-inventory checks against real adapters; they are safe on a normal desktop and mutate
nothing:

```bash
SOCKTUNER_LIVE_INVENTORY=1 dotnet test SockTuner.sln
```

671 pass, 0 skipped.

## Never run these on a real machine

`--verify-tcp-writes` **writes to the live TCP stack** and `--verify-device-writes`
**enables and disables a real adapter, writes PnPCapabilities and creates a QoS policy**.
Both are gated behind `SOCKTUNER_VM_WRITE_TEST=1` so a mistyped `--probe` cannot trigger
Both are gated behind `SOCKTUNER_VM_WRITE_TEST=1`, so an argument alone cannot trigger
them, and both belong in a disposable VM only. The driver deliberately exposes no command
for either.

Expand Down Expand Up @@ -161,13 +151,6 @@ path is skipped — the run refuses to disable the adapter carrying the default
- **Screenshot tooling downscales.** A desktop-capture MCP may return an image scaled from
3640x2144 to ~1833x1080, so coordinates read off that image are wrong by a ~1.99 factor.
`driver.ps1 shot` captures the window rect at native size and sidesteps this.
- **`--probe` used to end on a modal.** It now attaches to the calling console, prints the
report path there and exits on its own; the message box is kept only for someone who
double-clicked the exe and has no console to read. The driver still waits for the file
before returning, which is what makes it reliable, but it no longer has to kill a process
left holding a dialog nobody could dismiss.
- **Probe takes longer than you expect.** A full inventory capture exceeded 6 s here, so a
fixed sleep is not enough; the driver polls for up to 120 s.
- **`pwsh` 7 cannot load `UIAutomationClient`.** Use `powershell.exe`.
- **A stale VM registration breaks every `-Name` Hyper-V cmdlet on this host.** `Get-VM`,
`Checkpoint-VM -Name`, `Copy-VMFile -Name` and friends enumerate all VMs first, hit the
Expand All @@ -176,10 +159,9 @@ path is skipped — the run refuses to disable the adapter carrying the default
- **PowerShell Direct runs over VMBus, not the network.** That is what makes it safe to
disable an adapter in the guest from the host: the session survives losing all guest
networking. It does need guest credentials; there is no passwordless path.
- **A console-mode run has no console over PowerShell Direct.** `--probe` and the verify
- **A verification-mode run has no console over PowerShell Direct.** The verification
modes attach to the caller's console when there is one and fall back to a message box when
there is not — and over PSDirect there is not, so the modal blocks forever. Start the
process detached and poll for the JSON, which is written before the message appears.
there is not. Start them detached in the disposable VM and poll for their JSON result.

## Troubleshooting

Expand All @@ -188,6 +170,4 @@ path is skipped — the run refuses to disable the adapter carrying the default
| `SockTuner window not found. Run "launch" first.` | The app is not running, or it was started as a shell child and already died. Re-run `launch`. |
| `Not built. Run: driver.ps1 build` | The Release exe is missing. Run `build`. |
| `No tab matching '<x>'` | Run `tabs` for the exact names; matching is substring, case-insensitive. |
| `Probe produced no JSON on the Desktop within 120s.` | Check for a stuck `SockTuner probe` process: `Get-Process SockTuner`. Kill it and retry. |
| `Could not raise the SockTuner window; another window is on top…` | Something is covering the app and Windows refused the foreground handover. Minimise it, or click the SockTuner window once, then re-run `shot`. |
| A leftover window titled `SockTuner probe` | An earlier probe attempt was interrupted. `powershell.exe -NoProfile -File .claude/skills/run-socktuner/driver.ps1 stop` clears all SockTuner processes. |
28 changes: 0 additions & 28 deletions .claude/skills/run-socktuner/driver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -152,33 +152,6 @@ switch ($Command) {
"OK shot ${w}x${ht} -> $path"
}

# Read-only inventory dump to JSON. Ends on a modal this driver cannot click, so the
# process is stopped once the file lands. Nothing on the machine is changed.
'probe' {
if (-not (Test-Path $Exe)) { throw "Not built. Run: driver.ps1 build" }
$before = Get-Date
$desktop = [Environment]::GetFolderPath('Desktop')
$proc = Start-Process -FilePath $Exe -ArgumentList '--probe' -WorkingDirectory (Split-Path $Exe) -PassThru
# The JSON is written BEFORE the modal appears, so wait for the file and then close
# that exact process. Do not try to click the dialog: it is a Win32 #32770 whose
# buttons this build does not expose to UI Automation, so a UIA click never lands
# and the process is left alive holding a modal on the user's desktop.
$json = $null
$deadline = (Get-Date).AddSeconds(120)
while ((Get-Date) -lt $deadline) {
Start-Sleep -Milliseconds 750
$json = Get-ChildItem $desktop -Filter 'socktuner-probe-*.json' -ErrorAction SilentlyContinue |
Where-Object { $_.LastWriteTime -ge $before } |
Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($json) { break }
if ($proc.HasExited) { break }
}
if (-not $json) { throw 'Probe produced no JSON on the Desktop within 120s.' }
Start-Sleep -Milliseconds 500
if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue }
"OK probe -> $($json.FullName) ($([math]::Round($json.Length/1KB,1)) KB)"
}

'stop' {
Get-Process SockTuner -ErrorAction SilentlyContinue | Stop-Process -Force
'OK stopped'
Expand All @@ -193,7 +166,6 @@ SockTuner driver — commands:
tabs list navigation tabs, * marks the selected one
select "<name>" select a tab by name (substring match)
shot [path] PNG of the window -> .claude/skills/run-socktuner/shots/
probe --probe read-only inventory dump to JSON on the Desktop
stop kill the process
'@
}
Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/compatibility-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Hardware compatibility report
description: Share a privacy-safe SockTuner capability report from real hardware.
title: "Compatibility: "
body:
- type: markdown
attributes:
value: |
Thank you for helping validate SockTuner on real hardware.

In SockTuner, open **Preferences → Help improve SockTuner → Create compatibility report**. Review the plain-text JSON file, then drag it into the field below. The report excludes all current setting values, persistent device identifiers, network addresses, paths, machine name, and exact timestamps.
- type: textarea
id: report
attributes:
label: Compatibility report
description: Drag the generated SockTuner-compatibility.json file here.
placeholder: Drag and drop SockTuner-compatibility.json here.
validations:
required: true
- type: checkboxes
id: consent
attributes:
label: Consent
options:
- label: I reviewed the generated JSON and consent to publishing it in this GitHub issue.
required: true
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
- name: Verify formatting
run: dotnet format SockTuner.sln --no-restore --verify-no-changes

- name: Verify capability archive
run: |
python -m unittest tools/test_build_probe_archive.py
python tools/build-probe-archive.py --check

- name: Build
run: dotnet build SockTuner.sln -c Release --no-restore -p:ContinuousIntegrationBuild=true

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
**/obj/
artifacts/
TestResults/
__pycache__/
*.py[cod]

# IDE and user state
.vs/
Expand Down
57 changes: 14 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,22 @@
</p>

> [!WARNING]
> **SockTuner is in active development (alpha) and is NOT ready for production use.**
> The project is at **Step 7b of 10: NIC and driver controls**. This build **can change live network settings**. Applying a NIC property restarts that adapter and briefly drops its link — never apply over a remote session on the adapter you are changing, and be able to recover the machine's network without remote access. Every change is snapshotted, verified by read-back, and reversible from the audit history, but treat it as alpha software.
> **SockTuner is a community diagnostic alpha, not production software.** Read-only inventory and diagnostics are the primary public surface. Tuning is experimental and can change live network settings. Applying a NIC property restarts that adapter and briefly drops its link — never do this through the connection being changed. Every write requires consent and elevation, is snapshotted, verified by read-back, audited, and reversible.

SockTuner is intended for tweakers, technicians, competitive gamers, system integrators, and power users who need one place to inspect and control the Windows networking stack, network adapters, and NIC driver settings.

It is not a generic “make my ping lower” button. SockTuner will show the current value, proposed value, scope, expected trade-off, restart requirement, and rollback data for every change.

## Help wanted: hardware capability probe
## Help improve hardware compatibility

SockTuner exposes only settings that the NIC driver actually advertises. Virtual machines do not expose real driver properties, so we are collecting capability reports from real hardware — especially **Intel I219/I225/I226** and **Realtek RTL8111/RTL8125** adapters.
SockTuner exposes only settings that the installed NIC driver actually advertises. We need reports from real hardware — especially **Intel I219/I225/I226**, **Realtek RTL8111/RTL8125**, Killer/Qualcomm, Broadcom, and Marvell adapters.

If you have one of these NICs, you can contribute in two minutes with the built-in read-only probe. **The probe changes nothing on your PC** — it only reads the same inventory the app already displays.
1. Download and extract the latest Windows x64 build from [Releases](https://github.com/PrimeBuild-pc/SockTuner/releases).
2. Refresh the inventory, then open **Preferences → Help improve SockTuner**.
3. Choose **Create compatibility report**, review the plain-text JSON, and let SockTuner open the dedicated GitHub issue form.
4. Attach the JSON file to the issue.

### How to run the probe

1. Download the latest `SockTuner-*-win-x64.zip` from [Releases](https://github.com/PrimeBuild-pc/SockTuner/releases) and extract it.
2. The build is currently **unsigned**, so Windows SmartScreen will warn you: click **More info → Run anyway**. You can inspect the source and build it yourself with `dotnet publish` if you prefer.
3. Open a terminal in the extracted folder (File Explorer address bar → type `cmd` → Enter) and run:
```
SockTuner.exe --probe
```
4. A dialog confirms the report location: `socktuner-probe-<timestamp>.json` on your **Desktop**.

### What the probe collects

| Included (hardware identity) | Masked (personal data) |
| --- | --- |
| NIC description, driver provider/version/date, INF name | Machine name |
| PCI vendor/device ID, reported as the driver's component ID (`PCI\VEN_xxxx&DEV_xxxx`) | IP addresses, gateways, DNS servers, routes |
| NDIS advanced properties: keyword, current value, default, type, valid ranges/enums | MAC address (only the vendor OUI prefix is kept) |
| OS version, admin state, CPU count | User-assigned values (e.g. a custom `NetworkAddress` MAC) |

The report is a plain-text JSON file — open it in any editor and check it yourself before sending.

### How to send your report

- **GitHub:** open an [issue](https://github.com/PrimeBuild-pc/SockTuner/issues/new) titled `Probe report: <your NIC model>` and attach the JSON file.
- **Discord:** open a ticket on our Discord server (invite link in the repository sidebar) and attach the JSON file.

Include your Windows version if you know it. Thank you!
The report contains the adapter model, driver version, OS version, and driver-advertised keywords and constraints. It excludes all current setting values, persistent adapter/PNP identifiers, MAC and IP addresses, routes, DNS servers, INF and user paths, machine name, and exact timestamps. Creating it is read-only and changes nothing on the PC.

## Product goals

Expand Down Expand Up @@ -104,16 +80,11 @@ The reference scripts in this private workspace are research inputs, not product

## Current stage

- Architecture and product scope approved.
- Step 1 is complete: the dark Metro shell, application icon, OS/adapter inventory, driver-advertised NDIS discovery, filtering/copy, and DPI validation pass.
- Native IPv4/IPv6 routes and metrics, interface indexes/MTU/DNS, network profiles and bindings, NIC counters, TCP templates, QoS policies, global/RSS/RSC/LSO/checksum/USO/URO offload state, Winsock catalog, bounded structured logs, full/redacted snapshot export, retention preferences, and log export provide the Step 2 inventory.
- Steps 1–2 now pass inventory, export, search/copy, dark-theme, and 100–200% WPF DPI validation.
- Step 3 adds explicit quick/standard/extended diagnostics, concurrent boundary probes, full statistics/timelines, route/MTU/counter evidence, and bounded continuous monitoring.
- Step 4 includes versioned JSON, self-contained offline HTML, bounded local history, redacted history export, identical-parameter before/after comparison, and multi-run trends.
- Step 5 is complete with an allowlisted dry-run cart, exact rollback preview, bounded audit history, deterministic transactions, failure injection, and a strict typed elevated-worker protocol.
- Step 6 is complete: the first two low-disruption MMCSS settings passed direct and published-worker apply/read/rollback/read gates on disposable Windows 10 22H2 and Windows 11 VMs. NIC/driver writes and the normal UI remain locked while Step 7 starts.
- Step 7a added a read-only `--probe` mode: it writes a redacted capability report (`socktuner-probe-<timestamp>.json` on the Desktop) that collaborators with real Intel/Realtek NICs can share. Personal data is masked; driver identity, NDIS keywords, defaults, and valid ranges/enums are preserved. The probe changes nothing on the machine.
- Step 7b unlocks live writes. The **Tuning plan** tab lists the properties the selected driver actually advertises, filtered by intent preset — latency, bandwidth, power and wake, Wi-Fi radio, VLAN and identity — with preview, apply, and exact rollback from the audit history. Capability reports so far cover Intel I226-V and Wireless-AC 3168, Realtek RTL8125, 8852CE and 8922AE, and MediaTek MT7925; the generated [capability archive index](alpha-tester-output/INDEX.md) is the authoritative list.
- Native read-only inventory covers adapters, routes, interfaces, DNS, profiles, bindings, NIC counters, TCP templates, QoS, offloads, interrupts, Winsock, driver identity, and driver-advertised properties.
- The complete network check measures each path boundary, latency/loss/jitter, DNS and TCP timing, path MTU, route quality, counter deltas, and game-specific playability; loaded-latency and throughput traffic remain separate opt-in tests.
- Versioned reports, bounded local history, redacted exports, before/after comparison, trends, monitoring, and imported capture reports are available.
- Experimental writes use one allowlisted tuning plan with dry run, consent, elevation, stale-state refusal, read-back verification, audit, visible recovery, and exact rollback.
- Real-hardware coverage is crowdsourced through the in-app compatibility report. The generated [capability archive index](alpha-tester-output/INDEX.md) lists current Intel, Realtek, and MediaTek coverage.

## How a change is applied

Expand All @@ -127,4 +98,4 @@ The reference scripts in this private workspace are research inputs, not product

Changing network, registry, adapter, or driver settings can interrupt connectivity or reduce stability and throughput. Applying a NIC property restarts that adapter, which briefly drops the link — do not apply over a remote session on the adapter being changed. Test on a machine you can recover without remote access. SockTuner never invents a value or a range: it exposes only what the installed driver advertises, and treats any keyword it has not characterised as high risk.

SockTuner is released under the [MIT License](LICENSE). The public contribution policy is still being defined; probe reports via issues or Discord are the best way to help right now.
SockTuner is released under the [MIT License](LICENSE). Compatibility reports and bug reports are welcome through the dedicated GitHub issue forms.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The privilege boundary is the interesting part, and it is the part worth attacki
or driver advertises.
- Anything that turns imported, untrusted data — a capture report, an exported diagnostic, a probe
report — into code execution, a file path, or a write.
- Anything that causes an exported report or a probe report to contain data the redaction claims to
- Anything that causes an exported report or compatibility report to contain data the redaction claims to
have removed.
- Anything that leaves the machine unable to reach the network with no path back to the captured
state.
Expand Down
Loading