Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f4b35eb
build: build with Go 1.27.4 and golangci-lint v2.15.0
michaelsanford Nov 28, 2026
07778ae
build(deps): bump gopsutil, x/sys, x/ansi and indirect modules
michaelsanford Nov 28, 2026
9e32719
ci: bump pinned actions and release tooling
michaelsanford Nov 28, 2026
4965cbe
fix(ui): stop [d] and [g] moving the process selection
michaelsanford Nov 28, 2026
31a2aa4
fix(ui): keep the selection on the same process across ticks
michaelsanford Nov 28, 2026
b815bb4
fix(kill): refuse to kill a recycled PID or wtop itself
michaelsanford Nov 28, 2026
87cfc6a
fix(ui): show kill and search results for five seconds
michaelsanford Nov 28, 2026
4cd226c
fix(ui): name the real process in the kill confirmation
michaelsanford Nov 28, 2026
a7f69ec
fix(gpu): keep DXGI out-pointers alive across the COM call
michaelsanford Nov 28, 2026
7152c11
fix(mem): show the pagefile in Swap, not the commit charge
michaelsanford Nov 28, 2026
68e6421
fix(collector): don't report PDH rates from the priming sample
michaelsanford Nov 28, 2026
9ce71a2
fix(proc): ignore parent PIDs that were recycled
michaelsanford Nov 28, 2026
b1b442e
fix(gpu): clamp DXGI utilisation, fix LUID sign, widen NVML name
michaelsanford Nov 28, 2026
e3ad7ee
fix(proc): bound the process-table walk by the returned length
michaelsanford Nov 28, 2026
9667694
fix(gpu): run nvidia-smi from its driver path, not a PATH search
michaelsanford Nov 28, 2026
bd8d3d6
fix(search): start browsers at normal priority
michaelsanford Nov 28, 2026
45e5b18
fix(search): confine the browser profile path and cap its size
michaelsanford Nov 28, 2026
8548a76
fix(search): expand REG_EXPAND_SZ browser launch commands
michaelsanford Nov 28, 2026
2186c71
fix(ui): open one search per [?] press
michaelsanford Nov 28, 2026
6c026c9
fix(search): escape search terms for the path when they sit in it
michaelsanford Nov 28, 2026
c6c3f4e
ci: add govulncheck and dependency review
michaelsanford Nov 28, 2026
5701a7f
ci: least-privilege release jobs and no injectable tag names
michaelsanford Nov 28, 2026
071df1a
fix(docs): close the DOM-XSS sink on the site's release lookup
michaelsanford Nov 28, 2026
57cab07
fix(verify): pin attestations and cosign to release.yml at the tag
michaelsanford Nov 28, 2026
fe8f36c
ci: attest the SBOM to the binaries and publish attested SHA256SUMS
michaelsanford Nov 28, 2026
e03bedc
ci: move workflow permissions to the jobs that use them
michaelsanford Nov 28, 2026
36798db
ci: mirror only bot comments from the downstream winget PR
michaelsanford Nov 28, 2026
ae0b9cc
ci: give every job a timeout
michaelsanford Nov 28, 2026
60435d1
perf(ui): skip rendering the screen under the kill overlay
michaelsanford Nov 28, 2026
50eca55
perf(proc): cut per-tick process collection from 550 allocs to 11
michaelsanford Nov 28, 2026
8dded44
fix(mem): read the standby list, not the system cache working set
michaelsanford Nov 28, 2026
00a8e74
refactor(gpu): name the DXGI/PDH source for what it is
michaelsanford Nov 28, 2026
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
10 changes: 7 additions & 3 deletions .github/workflows/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ on:
pull_request_target:
types: [opened]

permissions:
issues: write
pull-requests: write
permissions: {}

# pull_request_target is safe here: nothing is checked out, and the only event
# data used is html_url, passed through env and quoted.
jobs:
auto-assign:
name: Assign to Maintainer
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
pull-requests: write
steps:
- name: Add assignee
env:
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ jobs:
changes:
name: Detect relevant changes
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Decide whether the rest of the workflow needs to run
id: filter
Expand Down Expand Up @@ -67,17 +69,20 @@ jobs:
if: needs.changes.outputs.code == 'true'
name: Build & Test
runs-on: windows-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0

- name: Verify golangci-lint config
run: golangci-lint config verify
Expand All @@ -88,6 +93,12 @@ jobs:
- name: go vet
run: go vet ./...

# Snyk was removed in #44; this is the dependency and stdlib vulnerability
# gate now. It reports only vulnerabilities whose code is reachable, and it
# runs on the Windows runner so the *_windows.go paths are what it analyses.
- name: govulncheck
run: go run golang.org/x/vuln/cmd/govulncheck@v1.10.0 ./...

# Generate the .syso files here too, so a malformed winres.json fails on the
# PR rather than on a pushed tag. Versions stay at 0.0.0.0 — only release.yml
# stamps the real ones. Keep the pin in sync with release.yml and the
Expand Down Expand Up @@ -116,3 +127,16 @@ jobs:
- name: go test
run: go test ./...

# Flags newly added dependencies with known vulnerabilities or disallowed
# licences in the PR diff itself, before they reach main.
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/dependency-review-action@bbc44d14a204704ccc493733616cd1e93a0321ec # v5.0.1
115 changes: 87 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ on:
permissions:
contents: read

# The tag reaches every shell step through $TAG rather than an inline
# ${{ github.ref_name }}, which would be pasted into the script text before
# bash parses it: git allows $, ( and backticks in tag names.
env:
TAG: ${{ github.ref_name }}

jobs:
build:
name: Build & Sign (${{ matrix.goarch }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
contents: read # only the release job writes; these upload artifacts
id-token: write # cosign OIDC token exchange + attestation
attestations: write # actions/attest-build-provenance

Expand All @@ -27,12 +34,23 @@ jobs:
suffix: windows-arm64.exe

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Reject non-release tags
run: |
[[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::tag '$TAG' is not vX.Y.Z"; exit 1; }

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true
# A tag build must not restore a cache written by a main-branch run:
# Go trusts its module and build caches without re-checking them.
cache: false

- name: Verify module checksums
run: go mod verify

- name: Install go-winres
run: go install github.com/tc-hib/go-winres@v0.3.3
Expand Down Expand Up @@ -62,26 +80,26 @@ jobs:
run: |
go build \
-trimpath \
-ldflags="-X github.com/michaelsanford/wtop/internal/version.Version=${{ github.ref_name }}" \
-o wtop-${{ github.ref_name }}-${{ matrix.suffix }} \
-ldflags="-X github.com/michaelsanford/wtop/internal/version.Version=${TAG}" \
-o wtop-${TAG}-${{ matrix.suffix }} \
./cmd/wtop/

- name: Attest build provenance
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: wtop-${{ github.ref_name }}-${{ matrix.suffix }}

- name: Install cosign
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
uses: sigstore/cosign-installer@881c63bd87e38389154debd8331404ce7ca8a3ab # v4.1.4

- name: Sign with cosign (keyless, GitHub OIDC)
run: |
cosign sign-blob --yes \
wtop-${{ github.ref_name }}-${{ matrix.suffix }} \
--bundle wtop-${{ github.ref_name }}-${{ matrix.suffix }}.bundle
wtop-${TAG}-${{ matrix.suffix }} \
--bundle wtop-${TAG}-${{ matrix.suffix }}.bundle

- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: binary-${{ matrix.goarch }}
path: |
Expand All @@ -91,48 +109,73 @@ jobs:
sbom:
name: Generate & Sign SBOM
runs-on: ubuntu-latest
timeout-minutes: 20
needs: build
permissions:
contents: write
contents: read # only the release job writes; these upload artifacts
id-token: write # cosign OIDC token exchange + attestation
attestations: write # actions/attest-build-provenance

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: go.mod
cache: true
# A tag build must not restore a cache written by a main-branch run:
# Go trusts its module and build caches without re-checking them.
cache: false

- name: Verify module checksums
run: go mod verify

- name: Install cyclonedx-gomod
run: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.9.0
run: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.12.0

- name: Generate CycloneDX SBOM
run: |
cyclonedx-gomod app \
-licenses \
-json \
-output wtop-${{ github.ref_name }}-sbom.cdx.json \
-output wtop-${TAG}-sbom.cdx.json \
-main ./cmd/wtop \
.

- name: Attest build provenance
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: wtop-${{ github.ref_name }}-sbom.cdx.json

# Provenance on the SBOM file says where it came from, not what it
# describes. An SBOM attestation binds it to the binaries themselves, so
# gh attestation verify --predicate-type https://cyclonedx.org/bom works
# on the .exe.
- name: Download the binaries the SBOM describes
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: binary-*
path: bin/
merge-multiple: true

- name: Attest SBOM against the binaries
uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
with:
subject-path: bin/*.exe
sbom-path: wtop-${{ github.ref_name }}-sbom.cdx.json

- name: Install cosign
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
uses: sigstore/cosign-installer@881c63bd87e38389154debd8331404ce7ca8a3ab # v4.1.4

- name: Sign with cosign (keyless, GitHub OIDC)
run: |
cosign sign-blob --yes \
wtop-${{ github.ref_name }}-sbom.cdx.json \
--bundle wtop-${{ github.ref_name }}-sbom.cdx.json.bundle
wtop-${TAG}-sbom.cdx.json \
--bundle wtop-${TAG}-sbom.cdx.json.bundle

- name: Upload SBOM artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sbom
path: |
Expand All @@ -143,43 +186,59 @@ jobs:
name: Create Draft Release
needs: [build, sbom]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
issues: write
id-token: write # attestation of SHA256SUMS
attestations: write

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download all artifacts
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: assets/
merge-multiple: true

- name: Create release zip archive
run: |
ZIP_NAME="wtop-${{ github.ref_name }}-windows.zip"
ZIP_NAME="wtop-${TAG}-windows.zip"
# Package all release artifacts (binaries, cosign bundles, SBOM), LICENSE, and README
zip -j "assets/${ZIP_NAME}" \
assets/* \
LICENSE \
README.md

# Written after the zip so it covers the zip too, which otherwise has no
# signature or attestation of its own. Attesting the checksum file gives
# every asset build provenance in one step.
- name: Write SHA256SUMS
working-directory: assets
run: sha256sum -- * > SHA256SUMS

- name: Attest every release asset
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-checksums: assets/SHA256SUMS

- name: Create draft GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
gh release create "${TAG}" \
assets/* \
--repo "${{ github.repository }}" \
--title "${{ github.ref_name }}" \
--title "${TAG}" \
--generate-notes \
--draft

- name: Open WDSI submission tracking issue
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
REPO: ${{ github.repository }}
run: |
RELEASE_URL="https://github.com/${REPO}/releases/tag/${TAG}"
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/winget-track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ on:
- cron: '0 * * * *' # hourly
workflow_dispatch:

permissions:
contents: read
issues: write
actions: write
permissions: {}

env:
PACKAGE_ID: michaelsanford.wtop
Expand All @@ -27,6 +24,11 @@ jobs:
close:
name: Reconcile winget trackers
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
issues: write # tracker comments and closes
actions: write # disables this workflow when no trackers remain
steps:
- name: Resolve, promote and close winget trackers
env:
Expand Down Expand Up @@ -167,7 +169,10 @@ jobs:
if [ -n "$PR_COMMENTS" ] && [ "$PR_COMMENTS" != "[]" ]; then
while read -r comment; do
CID=$(echo "$comment" | jq -r '.id')
C_BODY=$(echo "$comment" | jq -r '.body')
# Anyone can comment on a winget-pkgs PR; only the validation bots'
# comments are mirrored, with @-mentions defused, so a stranger
# cannot post phishing links or pings that appear to come from here.
C_BODY=$(echo "$comment" | jq -r '.body' | sed 's/@/@\​/g')

echo "$C_BODY" | grep -qiE "(Inconsistencies detected|Failed|Error|Reject|Missing|Validation Failed)" || continue
echo "$EXISTING_COMMENTS" | grep -Fq "Comment #$CID" && continue
Expand All @@ -180,7 +185,7 @@ jobs:
gh issue comment "$NUM" --repo "$REPO" --body "$FAILURE_COMMENT"
EXISTING_COMMENTS=$(printf '%s\n%s\n' "$EXISTING_COMMENTS" "$FAILURE_COMMENT")
echo "Issue #$NUM: forwarded downstream comment #$CID."
done < <(echo "$PR_COMMENTS" | jq -c '.[]')
done < <(echo "$PR_COMMENTS" | jq -c '.[] | select(.user.type == "Bot" or .user.login == "wingetbot")')
fi
done < <(echo "$TRACKERS")

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
winget-update:
name: Submit winget package update
runs-on: windows-latest
timeout-minutes: 30

steps:
- name: Submit to winget
uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e # v2
uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e # v2 branch, untagged commit of 2024-11-27
with:
identifier: ${{ env.PACKAGE_ID }}
installers-regex: '\.exe$'
Expand All @@ -31,6 +32,7 @@ jobs:
name: Draft downstream PR and open tracker
needs: winget-update
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.event_name == 'release' # tag_name only exists on release events
permissions:
contents: read # release compare API
Expand Down
2 changes: 1 addition & 1 deletion .run/Lint (golangci-lint).run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Lint (golangci-lint)" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 config verify &amp;&amp; go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run" />
<option name="SCRIPT_TEXT" value="go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 config verify &amp;&amp; go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 run" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand Down
Loading