Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
7c11d56
native/ude: define architecture and versioned broker ABI
hbashton Aug 9, 2026
e1f2d0e
native/ude: add installable controller and owner lifecycle
hbashton Aug 9, 2026
733eaf7
native/ude: add exclusive Windows broker handshake
hbashton Aug 9, 2026
a782386
ci: expose restored WDK build tools
hbashton Aug 9, 2026
58e0e5a
native/ude: create broker-owned dynamic USB devices
hbashton Aug 10, 2026
703f6d4
native/ude: isolate kernel ABI from CRT headers
hbashton Aug 10, 2026
59da0a4
native/ude: complete broker client lifecycle API
hbashton Aug 10, 2026
3bd2536
native/ude: include WDK capability declarations
hbashton Aug 10, 2026
1a99aaf
native/ude: broker bounded cancellable USB operations
hbashton Aug 10, 2026
a13391b
native/ude: add ordered host transport and exact cancellation
hbashton Aug 10, 2026
e9dccf8
native/ude: honor chained MDLs and transactional removal
hbashton Aug 10, 2026
0605991
Order UDE lifecycle events with endpoint traffic
hbashton Aug 10, 2026
6534e41
Wire native UDE transport into VIIPER service
hbashton Aug 10, 2026
cffbce3
Validate native isochronous completion directions
hbashton Aug 10, 2026
c6caca8
Honor UdeCx queue and interface lifecycle contracts
hbashton Aug 10, 2026
c76a33b
Define the UDE host-controller reference string
hbashton Aug 10, 2026
983850d
Register virtual USB descriptors with UdeCx
hbashton Aug 10, 2026
ac599a8
Drain endpoint queues before acknowledging UdeCx purge
hbashton Aug 10, 2026
8da8ca9
Complete native URBs on a dedicated DPC
hbashton Aug 10, 2026
48c1380
Separate broker cleanup from host controller I/O
hbashton Aug 10, 2026
934c425
Add transactional native UDE devnode installer
hbashton Aug 10, 2026
cb9aa26
Expose the canonical UdeCx host interface
hbashton Aug 10, 2026
43a7875
Link devnode helper token APIs
hbashton Aug 10, 2026
63d1b51
Harden native device reconnect and link-power state
hbashton Aug 10, 2026
2522a74
Fail native UDE sessions closed on protocol corruption
hbashton Aug 10, 2026
644d5ef
Make native UDE devnode installation transactional
hbashton Aug 10, 2026
418501a
Separate USB failures from native broker failures
hbashton Aug 10, 2026
17ab4a7
Instantiate setup property key in devnode helper
hbashton Aug 10, 2026
ff5336f
Expand native UDE release validation
hbashton Aug 10, 2026
7c967fb
Order native device unregister behind lane teardown
hbashton Aug 10, 2026
9a4479f
Hold native device tombstones through teardown
hbashton Aug 10, 2026
dcc9973
Route native UDE I/O through one completion port
hbashton Aug 10, 2026
281fe2f
Gate native UDE with race and CodeQL analysis
hbashton Aug 10, 2026
a79256d
Fail native sessions on lifecycle queue loss
hbashton Aug 10, 2026
d6564cd
Retry failed UdeCx owner teardown without orphaning
hbashton Aug 10, 2026
39a3546
Exercise native IOCP completion routing
hbashton Aug 10, 2026
ed5b23b
Validate native UDE negotiation and device topology
hbashton Aug 10, 2026
0f8d645
Complete interrupt input through a native UDE fast lane
hbashton Aug 10, 2026
6d65d69
Remove input-report wire copies from the hot path
hbashton Aug 10, 2026
db2effd
Prove native input lifecycle recovery
hbashton Aug 10, 2026
e05613c
Isolate native input from broker head-of-line stalls
hbashton Aug 10, 2026
06f8a8c
Make the native IOCP pump handle immutable
hbashton Aug 10, 2026
47f4953
Serialize direct input per native endpoint
hbashton Aug 10, 2026
eb6872e
Preserve native endpoint admission order
hbashton Aug 10, 2026
0e39f06
Harden native UDE protocol boundaries
hbashton Aug 10, 2026
0043856
Make native cancellation ownership final
hbashton Aug 10, 2026
a24bca8
Invalidate UDE handles before asynchronous removal
hbashton Aug 10, 2026
f55426a
Close broker admission before owner cleanup
hbashton Aug 10, 2026
214f315
Validate native transfer completions by outcome
hbashton Aug 10, 2026
7091dd2
Make UdeCx removal ownership irreversible
hbashton Aug 10, 2026
fd07a2f
Make native UDE owner sessions one-shot
hbashton Aug 10, 2026
f9e8c74
Survive dynamic endpoint cleanup races
hbashton Aug 10, 2026
7b89143
Preserve host-owned isochronous packet geometry
hbashton Aug 10, 2026
28feeb7
Preserve Microsoft OS descriptor parity on native UDE
hbashton Aug 10, 2026
8b47f6b
Make native child publication transactional
hbashton Aug 10, 2026
6721869
Verify native controller topology and control parity
hbashton Aug 10, 2026
4b37f19
Honor URB transfer capacity in native UDE
hbashton Aug 10, 2026
1079a9e
Return canonical ISO start frames from native UDE
hbashton Aug 10, 2026
50c0c0d
Complete native UDE host capability and reset contracts
hbashton Aug 10, 2026
d0d9ef3
Prove native transport parity with production controllers
hbashton Aug 10, 2026
546dc9c
Close native UDE sessions without handle races
hbashton Aug 10, 2026
21b89e4
Derive native audio lifecycle from endpoint identity
hbashton Aug 10, 2026
45bba16
Drain forwarded URBs before endpoint purge completes
hbashton Aug 10, 2026
f1dac78
Soak native lifecycle and generation cleanup
hbashton Aug 10, 2026
fe197aa
Acknowledge native UDE reset and configuration lifecycle
hbashton Aug 10, 2026
800fec6
Gate native UDE signing package and media allocations
hbashton Aug 10, 2026
edda2a3
Harden native UDE mapped buffers and cleanup ownership
hbashton Aug 10, 2026
4ee9f6e
Close native child creation against owner cleanup
hbashton Aug 10, 2026
cf512af
Preserve native IOCTL outcomes across cancellation races
hbashton Aug 10, 2026
424703a
Order native power transitions across endpoint lanes
hbashton Aug 10, 2026
0196777
Close direct input at the UdeCx D0 boundary
hbashton Aug 10, 2026
de06c32
Enforce native UDE per-device backpressure
hbashton Aug 10, 2026
9fda57c
Gate native input across USB device reset
hbashton Aug 10, 2026
aa12d3b
Open native endpoint admission before resume notification
hbashton Aug 10, 2026
9f55533
Serialize native device reset admission
hbashton Aug 10, 2026
a9c1cb6
Soak concurrent DualSense native media lanes
hbashton Aug 10, 2026
8dba58b
Fault-close native direct input after lifecycle loss
hbashton Aug 10, 2026
562826b
Soak concurrent DualShock 4 native media lanes
hbashton Aug 10, 2026
6fef455
Fail native sessions on direct input loss
hbashton Aug 10, 2026
0fdb56b
Register the native UDE preview explicitly
hbashton Aug 10, 2026
d0f0436
Align native UDE with the Windows 10 driver floor
hbashton Aug 10, 2026
c5774bf
Gate native input across endpoint recovery
hbashton Aug 10, 2026
07c73d1
Serialize native controller lifecycle mutations
hbashton Aug 10, 2026
2f91342
Fix native input admission context scope
hbashton Aug 10, 2026
3587494
Scope native lifecycle synchronization per controller
hbashton Aug 10, 2026
23d3979
Add signed native UDE live validation gate
hbashton Aug 10, 2026
70e9088
Remove cross-controller host lifecycle blocking
hbashton Aug 10, 2026
c4719db
Exercise concurrent native production controllers
hbashton Aug 10, 2026
efdd5e2
Validate native owner crash recovery
hbashton Aug 10, 2026
312156a
Rollback native registration across host shutdown
hbashton Aug 10, 2026
771dac2
Gate native UDE under one-boot Driver Verifier
hbashton Aug 10, 2026
8dc5b75
Add native UDE full-duplex CoreAudio gate
hbashton Aug 10, 2026
02017d1
Validate active native root restart recovery
hbashton Aug 10, 2026
c984a98
Exercise CoreAudio helper with a real CI snapshot
hbashton Aug 10, 2026
0eceb8f
Cache native UDE input until Windows polls
hbashton Aug 10, 2026
7379dd4
Align live input assertions with cached polling
hbashton Aug 10, 2026
ff1e33f
Gate native UDE input latency through HIDClass
hbashton Aug 10, 2026
fd83ecd
Fix strict HID latency probe build
hbashton Aug 10, 2026
1ea520b
Isolate native input sequencing per endpoint
hbashton Aug 10, 2026
c8e2b70
Make native input benchmarking transport-honest
hbashton Aug 10, 2026
638ba39
Defer cached UDE input off the submitter thread
hbashton Aug 10, 2026
be6a94a
Make transport latency observation event driven
hbashton Aug 10, 2026
54e5e9b
Capture native UDE scheduler evidence with WPR
hbashton Aug 10, 2026
9517179
Eliminate native controller input heap churn
hbashton Aug 10, 2026
b3386a8
Remove input heap churn from every native HID engine
hbashton Aug 10, 2026
71b3fa3
Keep allocation assertions out of race instrumentation
hbashton Aug 10, 2026
58f14f1
Eliminate native microphone packet jitter
hbashton Aug 10, 2026
0231b8e
Correct native driver production signing gate
hbashton Aug 10, 2026
f1057af
Complete native input writes inline when possible
hbashton Aug 10, 2026
24177d5
Fix native completion ABI and remove media buffer churn
hbashton Aug 10, 2026
bc5606e
Reject pre-fix native completion drivers
hbashton Aug 10, 2026
54c3fa6
Report native driver ABI mismatches explicitly
hbashton Aug 10, 2026
0bf42d3
Repair native preview ABI mismatches deterministically
hbashton Aug 10, 2026
c6ce82b
Pin every native wire field offset
hbashton Aug 10, 2026
da1d54e
Cancel superseded native driver builds
hbashton Aug 10, 2026
1bdfb36
Bind native driver packages to source revisions
hbashton Aug 10, 2026
6860b85
Prove native HID feedback end to end
hbashton Aug 10, 2026
982f406
Fix native driver INF release contract
hbashton Aug 10, 2026
098408e
Bind signed native packages to their catalog
hbashton Aug 10, 2026
c766ef2
Harden native broker API defaults
hbashton Aug 10, 2026
cfb56b6
Gate releases on native driver validation
hbashton Aug 10, 2026
64a8f18
Fence saturated native UDE endpoint lanes
hbashton Aug 10, 2026
0e1eec2
Expose negotiated native backend health
hbashton Aug 10, 2026
30bdd94
Host native broker as a managed Windows service
hbashton Aug 10, 2026
15fbefd
Report native broker service readiness accurately
hbashton Aug 10, 2026
a4824e5
Fix native UDE callback and teardown lifetime contracts
hbashton Aug 10, 2026
6427a73
Fence native UDE device lifecycle generations
hbashton Aug 10, 2026
cc3dd51
Make native driver setup transactional
hbashton Aug 10, 2026
0d58330
Fix transactional setup MSVC conversion
hbashton Aug 10, 2026
8b68c3d
Fence PlayStation media publication revisions
hbashton Aug 10, 2026
eb51788
Require clean concurrent native media soak
hbashton Aug 10, 2026
3dd2ea5
Normalize native validation source contracts
hbashton Aug 10, 2026
543fbcc
Define Windows device property keys in setup helper
hbashton Aug 10, 2026
5f7af61
Install native broker through transactional SCM service
hbashton Aug 10, 2026
54e86ac
Stress native Windows IOCP client lifecycle
hbashton Aug 10, 2026
9053531
ci: pin native release actions
hbashton Aug 10, 2026
977468b
Harden native UDE operation ABI validation
hbashton Aug 10, 2026
f84e550
Retry native controller acquisition safely
hbashton Aug 10, 2026
5928e13
Accept canonical Microsoft OS 1.0 descriptor
hbashton Aug 10, 2026
5ee3b8b
Observe stalled native I/O cancellation
hbashton Aug 10, 2026
0410d9f
Replay native input at USB service cadence
hbashton Aug 10, 2026
0ccbb17
Honor native ISO endpoint schedules
hbashton Aug 10, 2026
66fe039
Install native UDE package transactionally
hbashton Aug 10, 2026
c593545
Decouple native owner from child cleanup
hbashton Aug 10, 2026
78a8ef4
Harden native release provenance gates
hbashton Aug 10, 2026
79498dd
Separate certification symbols from runtime package
hbashton Aug 11, 2026
0e27580
Make native protocol contract tests line-ending neutral
hbashton Aug 11, 2026
6294cdf
Fix UdeCx URB completion execution contract
hbashton Aug 11, 2026
685b292
Harden native release package gates
hbashton Aug 11, 2026
9a46d74
Decouple controller engines from USB-IP directions
hbashton Aug 11, 2026
920b586
Fence stale UdeCx lifecycle notifications
hbashton Aug 11, 2026
88f1ac4
Prove native PlayStation transport parity
hbashton Aug 11, 2026
cb19f16
Normalize native UDE transfer scheduling metadata
hbashton Aug 11, 2026
f760901
Implement exact native package uninstall transaction
hbashton Aug 11, 2026
a86d186
Remove native UDE broker dispatch scans
hbashton Aug 11, 2026
7172e54
Make native UDE live evidence fail closed
hbashton Aug 11, 2026
880178a
Wake native dispatch after publishing cancellation
hbashton Aug 11, 2026
ff28968
Adapt full-speed endpoints for native UdeCx
hbashton Aug 11, 2026
c0b1244
Preserve native ISO tail on rejected explicit frames
hbashton Aug 11, 2026
0435d14
Remove redundant native input queue hop
hbashton Aug 11, 2026
402d133
Deliver cached native input without worker latency
hbashton Aug 11, 2026
fa4f02f
Gate native PlayStation transport against dropout races
hbashton Aug 11, 2026
790cec0
Fence native broker terminal scheduling
hbashton Aug 11, 2026
d9096c7
Make native latency benchmark production-authentic
hbashton Aug 11, 2026
630270d
Bump native driver contract and serialize mutex owners
hbashton Aug 11, 2026
d65d0f2
Remove native input and auth hot-path allocations
hbashton Aug 11, 2026
ce51a3e
Separate authenticated stream nonce domains
hbashton Aug 11, 2026
74abace
Add source-bound controller latency gate
hbashton Aug 11, 2026
7519c6b
Clear authenticated record slabs on close
hbashton Aug 11, 2026
2c6d940
Remove native input lookup serialization
hbashton Aug 11, 2026
cebc88e
Bump native driver contract for input hot path
hbashton Aug 11, 2026
c6d2394
fix(udecx): close endpoint lifecycle admission races
hbashton Aug 11, 2026
6732592
test(udecx): assert pre-drain device snapshot
hbashton Aug 11, 2026
ef22938
feat(native): bind broker to loaded driver identity
hbashton Aug 11, 2026
4648447
Harden source-bound controller latency evidence
hbashton Aug 11, 2026
e1deabc
docs: record native UDE lifecycle invariants
hbashton Aug 11, 2026
8f45acd
fix(udecx): satisfy warning-clean driver build
hbashton Aug 11, 2026
d777a6a
Harden native package transaction recovery
hbashton Aug 11, 2026
4415425
Add source-bound native UDE local test route
hbashton Aug 11, 2026
3e89c0b
Harden native UDE local test installation
hbashton Aug 11, 2026
3e2be1b
Preserve native controller transitions at host cadence
hbashton Aug 11, 2026
96612fe
Fix native package CI contracts
hbashton Aug 11, 2026
184aa66
Retain native mutex namespace for process lifetime
hbashton Aug 11, 2026
54949b2
Fix native helper identity self-test vector
hbashton Aug 11, 2026
6974e00
Fix recovery journal self-test fixture
hbashton Aug 11, 2026
1b45d77
Bind local test package to WDK signer
hbashton Aug 11, 2026
a987d55
Make WDK test trust import noninteractive
hbashton Aug 11, 2026
6edb7b5
Bound native signature validation tools
hbashton Aug 11, 2026
7c02eb2
Bound native Authenticode validation
hbashton Aug 11, 2026
6203a6d
Bound native validation process trees
hbashton Aug 12, 2026
aedb155
Fix native local test deployment preflight
hbashton Aug 13, 2026
75ffda4
Scope native INF contract assertion
hbashton Aug 13, 2026
d85a58a
Fix trusted local driver signature verification
hbashton Aug 13, 2026
9402ad2
Use Authenticode policy for catalog membership
hbashton Aug 13, 2026
f1fa037
Fix singleton local package validation
hbashton Aug 13, 2026
987b7c9
Gate local deployment with PowerShell preflight
hbashton Aug 13, 2026
8684d8e
Harden local test staging ACL verification
hbashton Aug 13, 2026
8cc6152
Fix native ACL object mapping validation
hbashton Aug 13, 2026
0bc65bc
Fix native controller device security initialization
hbashton Aug 13, 2026
e144525
Fix nested native broker commit contract
hbashton Aug 13, 2026
ca1132c
Harden native broker failure diagnostics
hbashton Aug 13, 2026
9f0fac2
Fix nested native transaction sealing
hbashton Aug 13, 2026
353b51d
Create native broker credentials protected
hbashton Aug 13, 2026
9c4dcf5
Fix native lifecycle notification framing
hbashton Aug 13, 2026
dea5bdc
Replace native root bus without reboot loop
hbashton Aug 13, 2026
164b1b4
Quiesce broker for native root bus upgrades
hbashton Aug 13, 2026
27f06bb
Update helper identity vector for driver 0.1.0.19
hbashton Aug 13, 2026
8ab5b71
Handle identical live probe manifests under strict mode
hbashton Aug 13, 2026
d286318
Acknowledge initial UdeCx endpoint publication
hbashton Aug 13, 2026
f96007b
Number UdeCx SuperSpeed ports globally
hbashton Aug 13, 2026
2062576
Require pristine UdeCx runtime before upgrades
hbashton Aug 13, 2026
11d104b
Clean interrupted local test staging after reboot
hbashton Aug 13, 2026
7799402
Validate local test installer on Windows PowerShell 5.1
hbashton Aug 13, 2026
1ca3110
Keep UdeCx root hub powered through enumeration
hbashton Aug 14, 2026
065a0d4
Repair upgrades from a stopped UdeCx root
hbashton Aug 14, 2026
51c0c21
Let UdeCx own the enumeration reset
hbashton Aug 14, 2026
ff9b795
Fix UdeCx endpoint queue lifecycle
hbashton Aug 14, 2026
5b69d90
Repair noncanonical broker upgrades
hbashton Aug 14, 2026
2f3c383
Start selected UdeCx endpoints without reset
hbashton Aug 14, 2026
b430265
Activate initially configured UdeCx endpoints
hbashton Aug 14, 2026
e2dd76a
Complete native Xbox input initialization
hbashton Aug 14, 2026
3aeb7df
Keep installer identity self-test in lockstep
hbashton Aug 14, 2026
9e25f14
Add source-level UdeCx lifecycle diagnostics
hbashton Aug 14, 2026
16fb390
Accept pinned WDK catalog output casing
hbashton Aug 14, 2026
1c4e7b1
Report packaged ABI from manifest
hbashton Aug 14, 2026
7799347
Validate local test signatures without trust prompts
hbashton Aug 14, 2026
0406334
Verify local test packages before trust install
hbashton Aug 14, 2026
3a660e8
Support pristine upgrades from ABI 1.10
hbashton Aug 14, 2026
dc9ce3a
Update local test signature contract
hbashton Aug 14, 2026
0770049
Fix precise ISO clock output pointer
hbashton Aug 14, 2026
27fb398
Harden native UDE lifecycle and diagnostics
hbashton Aug 15, 2026
3ca7e07
Fix native broker symbol validation
hbashton Aug 15, 2026
abefabb
Fix native purge teardown and diagnostics
hbashton Aug 15, 2026
aca9d69
Harden native driver upgrade transaction
hbashton Aug 15, 2026
a9b99f3
Make driver install switch crash recoverable
hbashton Aug 15, 2026
f3b694f
Strengthen latency evidence and priority matrix
hbashton Aug 15, 2026
f36dd00
Pin official native UDE source contracts
hbashton Aug 15, 2026
ac3c61f
Harden native UDE lifecycle and recovery
hbashton Aug 15, 2026
7270672
Update native UDE compatibility gate
hbashton Aug 15, 2026
cece307
feat(native-ude): publish exact device correlation receipts
hbashton Aug 15, 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
248 changes: 248 additions & 0 deletions .github/scripts/Test-WorkflowSecurity.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
[CmdletBinding()]
param()

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

$repositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
$workflowDirectory = Join-Path $repositoryRoot '.github\workflows'
$workflowFiles = @(Get-ChildItem -LiteralPath $workflowDirectory -File -Filter '*.yml')

foreach ($workflow in $workflowFiles) {
$source = Get-Content -LiteralPath $workflow.FullName -Raw
foreach ($match in [regex]::Matches($source, '(?m)^\s*uses:\s*(?<reference>[^\s#]+)')) {
$reference = $match.Groups['reference'].Value
if ($reference.StartsWith('./', [StringComparison]::Ordinal)) {
continue
}
if ($reference -notmatch '^[^@\s]+@[0-9a-f]{40}$') {
throw "$($workflow.Name) uses mutable or malformed action reference '$reference'. External actions must use a full commit SHA."
}
}
if ($source -match '(?m)^\s*go-version\s*:') {
throw "$($workflow.Name) selects a floating Go toolchain. Use the exact version declared by go.mod."
}
if ($source -match '(?m)^\s*runs-on:\s*(?:ubuntu|windows|macos)-latest\s*$') {
throw "$($workflow.Name) selects a floating hosted-runner generation. Pin the OS generation."
}
if ($source -match '(?mi)vswhere\.exe[^\r\n]*\s-latest(?:\s|$)') {
throw "$($workflow.Name) selects a floating Visual Studio toolchain with vswhere -latest."
}
foreach ($pattern in @(
'(?mi)^\s*(?:python|node|dotnet|cmake|nuget|just)-version:\s*["'']?(?:latest|stable|\d+(?:\.\d+)*\.x)["'']?\s*$',
'(?mi)^\s*toolchain:\s*["'']?(?:stable|beta|nightly)["'']?\s*$')) {
if ($source -match $pattern) {
throw "$($workflow.Name) selects a floating release toolchain: '$($Matches[0].Trim())'."
}
}
$justSetups = [regex]::Matches($source, 'extractions/setup-just@[0-9a-f]{40}').Count
$justPins = [regex]::Matches($source, '(?m)^\s*just-version:\s*"1\.58\.0"\s*$').Count
if ($justSetups -ne $justPins) {
throw "$($workflow.Name) must pin just 1.58.0 for every setup-just action."
}
$msbuildSetups = [regex]::Matches($source, 'microsoft/setup-msbuild@[0-9a-f]{40}').Count
$msbuildPins = [regex]::Matches($source, '(?m)^\s*vs-version:\s*"\[18\.0,19\.0\)"\s*$').Count
if ($msbuildSetups -ne $msbuildPins) {
throw "$($workflow.Name) must constrain every MSBuild setup to the Visual Studio 2026 generation."
}
}

$releaseSource = Get-Content -LiteralPath (Join-Path $workflowDirectory 'release.yml') -Raw
foreach ($required in @(
'native-validation',
'native-package-transaction',
'native-production-provenance',
'native-user-mode-signing',
'Protect-ViiperWindowsReleaseBinaries.ps1',
'Test-ViiperUdeReleaseBundle.ps1',
'-RequireAuthenticode',
'viiper-native-udecx-windows-amd64.zip',
'Test-WorkflowSecurity.ps1',
'actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a')) {
if (-not $releaseSource.Contains($required)) {
throw "The release workflow is missing required gate '$required'."
}
}
if ($releaseSource -notmatch '(?ms)^\s{4}create-release:\s.*?^\s{8}needs:\s*\[[^\]]*native-validation[^\]]*native-package-transaction[^\]]*\]') {
throw 'create-release must depend on both native validation and package-transaction gates.'
}
if ($releaseSource -notmatch '(?ms)^\s{4}create-release:\s.*?^\s{8}needs:\s*\[[^\]]*native-production-provenance[^\]]*\]') {
throw 'create-release must depend on an accepted Microsoft production-package artifact.'
}
if ($releaseSource -notmatch '(?ms)^\s{4}create-release:\s.*?^\s{8}needs:\s*\[[^\]]*native-user-mode-signing[^\]]*\]') {
throw 'create-release must depend on the fail-closed broker/helper Authenticode signing gate.'
}
if ($releaseSource -notmatch '(?ms)^\s{4}release-policy:\s.*?current origin/main tip') {
throw 'Release tags must be constrained to the workflow-protected current main tip.'
}
if ($releaseSource.Contains('ViiperUde-x64-test-signed')) {
throw 'The production release workflow must never consume the native test-signed artifact.'
}
if ([regex]::Matches($releaseSource, 'pattern:\s*"\*-Release"').Count -ne 2) {
throw 'Release artifact downloads must use the explicit *-Release artifact allowlist.'
}
foreach ($requiredProductionBinding in @(
'.github/workflows/native-production-package.yml',
'.head_branch == "main"',
'.head_sha == $sha',
'artifact-ids: ${{ needs.native-production-provenance.outputs.artifact_id }}',
'ViiperUdeCtl-windows-amd64-${{ github.sha }}')) {
if (-not $releaseSource.Contains($requiredProductionBinding)) {
throw "The release workflow is missing production provenance binding '$requiredProductionBinding'."
}
}
if ($releaseSource -notmatch "(?ms)\`$expectedProduction\s*=\s*@\(\s*'submission-manifest\.json',\s*'ViiperUde/ViiperUde\.cat',\s*'ViiperUde/ViiperUde\.inf',\s*'ViiperUde/ViiperUde\.pdb',\s*'ViiperUde/ViiperUde\.sys'\)") {
throw 'Release composition must allowlist the exact validated Microsoft-returned package.'
}
if ($releaseSource -notmatch '(?ms)expected_runtime=\(\s*ViiperUde\.cat\s*ViiperUde\.inf\s*ViiperUde\.sys\s*ViiperUdeCtl\.exe\s*submission-manifest\.json\s*viiper\.exe\s*\)') {
throw 'The public native runtime archive must contain exactly broker, helper, INF, SYS, CAT, and manifest.'
}

$signingJob = [regex]::Match(
$releaseSource,
'(?ms)^\s{4}native-user-mode-signing:\s.*?(?=^\s{4}build:)').Value
if ([string]::IsNullOrWhiteSpace($signingJob)) {
throw 'The release workflow is missing the mandatory native user-mode signing job.'
}
foreach ($requiredSigningGate in @(
'WINDOWS_SIGNING_PFX_BASE64',
'WINDOWS_SIGNING_PFX_PASSWORD',
'WINDOWS_SIGNING_CERTIFICATE_SHA256',
'Protect-ViiperWindowsReleaseBinaries.ps1',
'ViiperUdeCtl.exe verify',
'VIIPER-windows-amd64-authenticode-${{ github.sha }}',
'VIIPER-windows-arm64-authenticode-${{ github.sha }}',
'VIIPER-native-udecx-authenticode-${{ github.sha }}')) {
if (-not $signingJob.Contains($requiredSigningGate)) {
throw "The native signing job is missing fail-closed contract '$requiredSigningGate'."
}
}
if ([regex]::Matches($signingJob, '-RequireAuthenticode').Count -lt 2 -or
[regex]::Matches($signingJob, '-ExpectedSignerCertificateSHA256').Count -lt 2) {
throw 'The native signing job must Authenticode-validate both composition and archive roundtrip with the pinned signer fingerprint.'
}

$createReleaseJob = [regex]::Match(
$releaseSource,
'(?ms)^\s{4}create-release:\s.*?(?=^\s{4}publish-client-registries:)').Value
foreach ($signedArtifact in @(
'VIIPER-windows-amd64-authenticode-${{ github.sha }}',
'VIIPER-windows-arm64-authenticode-${{ github.sha }}',
'VIIPER-native-udecx-authenticode-${{ github.sha }}')) {
if (-not $createReleaseJob.Contains($signedArtifact)) {
throw "create-release must consume the exact signed artifact '$signedArtifact'."
}
}
if ($createReleaseJob.Contains('path: native-helper') -or
$createReleaseJob.Contains('path: native-production')) {
throw 'create-release must not reconstruct the public package from unsigned helper or production-intake inputs.'
}

$nativeWorkflow = Get-Content -LiteralPath (Join-Path $workflowDirectory 'native-ude.yml') -Raw
if ($nativeWorkflow -notmatch '(?m)^\s*if:\s*\$\{\{\s*inputs\.upload_artifacts\s*==\s*true\s*\}\}\s*$') {
throw 'Native test-signed artifacts may upload only through the explicit Boolean test-artifact input.'
}
foreach ($requiredNativeGate in @(
'branches: [main, "feature/**"]',
'tags: ["v*.*.*"]',
'VIIPER_NATIVE_SOURCE_REVISION: ${{ github.sha }}',
'Get-ViiperUdeBuildIdentity.ps1',
'180003f7b141c8015c29e7b3dcb6d252601ca6e82e6cc43b4480db31e167a660',
'Test-ViiperUdeVersionMonotonicity.ps1',
'x64/Release/ViiperUde/ViiperUde.inf',
'inputs.upload_release_helper == true',
'New-ViiperUdeLocalTestPackage.ps1',
'ViiperUde-x64-local-test-${{ github.sha }}',
'native/udecx/x64/Release/ViiperUdeLocalTest/**',
'retention-days: 7',
'internal/transport/udecx.nativeSourceRevision=$env:GITHUB_SHA')) {
if (-not $nativeWorkflow.Contains($requiredNativeGate)) {
throw "The native build workflow is missing gate '$requiredNativeGate'."
}
}
if ($nativeWorkflow.Contains('native/udecx/x64/Release/**') -or
$nativeWorkflow.Contains('native/udecx/driver/x64/Release/**') -or
$nativeWorkflow.Contains('native/udecx/package/x64/Release/**')) {
throw 'The local-test artifact must not upload broad compiler output trees.'
}

$baseBuildWorkflow = Get-Content -LiteralPath (Join-Path $workflowDirectory 'build_base.yml') -Raw
if (-not $baseBuildWorkflow.Contains('VIIPER_NATIVE_SOURCE_REVISION: ${{ github.sha }}')) {
throw 'Production broker builds must inject the exact workflow source SHA.'
}
$justfile = Get-Content -LiteralPath (Join-Path $repositoryRoot 'justfile') -Raw
foreach ($requiredBuildIdentityGate in @(
'Release builds require explicit VIIPER_NATIVE_SOURCE_REVISION.',
'internal/transport/udecx.nativeSourceRevision=')) {
if (-not $justfile.Contains($requiredBuildIdentityGate)) {
throw "The release broker build is missing identity gate '$requiredBuildIdentityGate'."
}
}

$transactionWorkflow = Get-Content -LiteralPath (Join-Path $workflowDirectory 'native-package-transaction.yml') -Raw
foreach ($requiredTransactionTrigger in @(
'branches: [main, "feature/**"]',
'tags: ["v*.*.*"]',
'pull_request:')) {
if (-not $transactionWorkflow.Contains($requiredTransactionTrigger)) {
throw "The native transaction workflow is missing trigger '$requiredTransactionTrigger'."
}
}
if ($transactionWorkflow.Contains('paths:')) {
throw 'Native transaction simulations must not be bypassable through a path filter.'
}

$productionWorkflow = Get-Content -LiteralPath (Join-Path $workflowDirectory 'native-production-package.yml') -Raw
foreach ($required in @(
'Test-ViiperUdeSignedPackage.ps1',
'-ValidationMode Production',
'Microsoft-signed',
'signingRoute',
"POLICY_REF -cne 'refs/heads/main'",
'Test-ViiperUdeTargetCompatibility.ps1')) {
if (-not $productionWorkflow.Contains($required)) {
throw "The production-native workflow is missing required validation contract '$required'."
}
}

$justfileSource = Get-Content -LiteralPath (Join-Path $repositoryRoot 'justfile') -Raw
if ($justfileSource.Contains('@latest') -or
$justfileSource -notmatch 'goversioninfo/cmd/goversioninfo@v1\.7\.0' -or
$justfileSource -notmatch 'go-licenses/v2@v2\.0\.1') {
throw 'Release build helper dependencies in justfile must remain exactly pinned.'
}
if ($productionWorkflow -match '(?m)^\s{2}(?:push|pull_request):') {
throw 'Production Microsoft-signed package acceptance must remain an explicit manual intake path.'
}

$goDirective = Get-Content -LiteralPath (Join-Path $repositoryRoot 'go.mod') -TotalCount 3 |
Where-Object { $_ -match '^go\s+' } |
Select-Object -First 1
if ($goDirective -notmatch '^go\s+\d+\.\d+\.\d+$') {
throw "go.mod must pin a complete Go toolchain version; found '$goDirective'."
}

$packagesPath = Join-Path $repositoryRoot 'native\udecx\driver\packages.config'
[xml]$packages = Get-Content -LiteralPath $packagesPath -Raw
$expectedWdkVersion = '10.0.28000.1839'
$expectedPackages = @(
'Microsoft.Windows.SDK.CPP',
'Microsoft.Windows.SDK.CPP.x64',
'Microsoft.Windows.WDK.x64'
)
foreach ($packageId in $expectedPackages) {
$matches = @($packages.packages.package | Where-Object { $_.id -ceq $packageId })
if ($matches.Count -ne 1 -or $matches[0].version -cne $expectedWdkVersion) {
throw "Native package '$packageId' must be pinned exactly to $expectedWdkVersion."
}
}

$projectSource = Get-Content -LiteralPath (Join-Path $repositoryRoot 'native\udecx\driver\ViiperUde.vcxproj') -Raw
foreach ($packageId in $expectedPackages) {
$escapedPath = [regex]::Escape("$packageId.$expectedWdkVersion")
if ($projectSource -notmatch $escapedPath) {
throw "The native project does not import exact package '$packageId.$expectedWdkVersion'."
}
}

Write-Host 'Workflow action pins, release gates, provenance, and native toolchain contracts are deterministic.'
Loading
Loading