Expand description
Windows rules that are pure text and path logic, compiled on every platform so the Linux and macOS
legs test them: the verbatim-prefix strip, the wt directory argument, PATHEXT resolution, the
cmd.exe /c wrap and the .ps1 wrapper.
Enums§
Constants§
- BOOT_
EXPR_ PS1 - The spec’s boot value:
LastBootUpTimeas epoch seconds truncated to the minute (the same expressionSystemProbe::boot_idruns). - DEFAULT_
PATHEXT 🔒 - START_
EXPR_ PS1 - The start time as FILETIME, the number
SystemProbe::starttimereads fromGetProcessTimes.
Functions§
- cmd_
line - The single command line
cmd.exe /creceives for a.cmdcontroller.cmd /cstrips the first and the last quote of a line that holds more than two, so a quoted executable followed by any quoted argument breaks (MEASURED, Task 25:'C:\Users\x' is not recognized, and a quoteda&echo INJECTEDran), hence the ONE outer pair. The executable is always quoted, an argument only when it is empty or has whitespace, and a backslash run at the end of a quoted argument is doubled so it cannot escape the closing quote. The launcher already refuses" % & | < > ^and newlines in controller arguments. - cmd_
wrap cmd.exe /c <exe> <args>(spec Launcher step 5: a.cmdcontroller).- controller_
command - The argv that starts the controller. Off Windows the bare name and the arguments (the OS finds
the executable). On Windows the executable is resolved through
PATHEXThere, and a.cmd/.batgoes throughcmd.exe /c;NoneisCONTROLLER_NOT_FOUND. - controller_
process - The process for an argv from
controller_command. Acmd.exe /c <script> <args>argv on Windows gets the raw command line ofcmd_line(the standard argument quoting breakscmd /c); anything else is the plain program and arguments. - is_
cmd_ 🔒ext - quote_
ps - Single-quote a value for PowerShell, doubling EVERY quote character it recognises: U+0027 and the typographic U+2018, U+2019, U+201A, U+201B (a lone one ends the string, or lets text after it run).
- resolve_
executable - The Windows lookup of a bare command name: every directory of
path(;-separated) in order, and in each, the name as is when it already ends in apathextextension, then the name plus eachpathextextension in order. The flag is true for a.cmd/.batscript, whichCreateProcesscannot start by bare name andcmd_wrapruns throughcmd.exe /c. - select_
windows_ shell pwshwhen it is on PATH, else the stockpowershell.exe.- strip_
verbatim \\?\C:\x->C:\xand\\?\UNC\server\share->\\server\share(whatstd::fs::canonicalizereturns on Windows); any other path is returned unchanged.- wrapper_
script_ ps1 - The
.ps1tab wrapper (UTF-8 text, no BOM:write_wrapperprepends it). The sentinels are written with[System.IO.File]::WriteAllText, which writes UTF-8 without a BOM and without a newline on both PowerShell editions;Out-File,>andSet-Contentdo not. - wt_
directory_ arg - The
-dargument ofwt, passed through unchanged. MEASURED on Windows 11 with wt: a bareC:\opens the drive root, while theC:this once produced opens the drive’s current directory (C:\WINDOWS\system32there). The trailing-backslash worry applies only to a hand-quoted"C:\", andCommandquotes only arguments that contain whitespace, which a drive root never does.