Skip to content

A local video studio for your coding agent. Describe a video in one sentence: your agent directs, your machine renders. Claude Code, Codex, Cursor, Devin and more. No API keys, no uploads.

Store files byte-exact: no line-ending conversion at checkout

Favio Vázquezd1676f4a6e04
diff --git a/.gitattributes b/.gitattributes
index 8860e49..77cd9d1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,23 +1,6 @@
-# Line endings are fixed per file type so a checkout behaves the same on every OS.
-* text=auto eol=lf
-
-# POSIX shell entry points and every source/doc file: LF everywhere (a CR breaks `#!/bin/sh`).
-*.sh text eol=lf
-*.py text eol=lf
-*.mjs text eol=lf
-*.js text eol=lf
-*.cjs text eol=lf
-*.md text eol=lf
-*.json text eol=lf
-*.yml text eol=lf
-*.html text eol=lf
-*.css text eol=lf
-skills/showtime/bin/showtime text eol=lf
-
-# Windows shims: CRLF (cmd.exe mis-parses labels in LF batch files).
-*.cmd text eol=crlf
-*.bat text eol=crlf
-*.ps1 text eol=crlf
+# Every file is stored exactly as it is checked out: LF everywhere, CRLF in the bytes of the Windows launchers.
+# Nothing here converts content at checkout.
+* -text
# Binary assets: never touch.
*.png binary
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6150bf6..55bf1ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,13 @@ All notable changes to showtime. Each entry says what changed and why, so this f
`skills/showtime/lib/st/__init__.py` and `python3 scripts/check_release.py` keeps the plugin manifests, the registry files and
`setup/package.json` in sync with it.
+## 0.4.6 (unreleased)
+
+- **Fixed: the repository stores files exactly as they are installed.** `.gitattributes` is now `* -text`, so nothing is
+ converted at checkout, and the Windows launchers (`.cmd`, `.bat`, `.ps1`) are committed with CRLF; installed files
+ match the repository byte for byte on every OS. `scripts/check_release.py` now fails on any attribute that converts
+ content, on a Windows launcher with LF-only lines and on a shell script with CR bytes.
+
## 0.4.5 (2026-10-14)
- **New: X-ray events from a data stream.** `showtime xray import <events.csv|json> --job <job> --time-map SLOW,T0`
diff --git a/scripts/check_release.py b/scripts/check_release.py
index 94c4990..b838382 100755
--- a/scripts/check_release.py
+++ b/scripts/check_release.py
@@ -46,7 +46,9 @@ Checks:
directory the plugin directory's limits for the published repository: under 10,000 files, 256 MiB
unpacked and 50 MiB zipped, every file under 5 MiB, no symlinks, submodules or LFS, no OS
junk files, names valid on Windows (no reserved characters or names, no case-only
- duplicates), no export-ignore/filter in .gitattributes, README of 40+ words, a LICENSE,
+ duplicates), no .gitattributes attribute that rewrites files at checkout (filter, ident,
+ working-tree-encoding, eol, text, export-ignore, export-subst), CRLF in the Windows shims
+ (*.cmd, *.bat, *.ps1) and no CR in *.sh and the POSIX launcher, README of 40+ words, a LICENSE,
plugin.json name/description/author/version, a default for every userConfig option, no
top-level bin/. Warnings for what makes a review slower (over 512 files, non-image
binaries over 256 KiB). Runs by default where there is no examples/ folder (the plugin
@@ -943,6 +945,44 @@ def directory_stats(files: Sequence[Path]) -> Dict[str, Any]:
"largest": max(sizes.items(), key=lambda kv: kv[1]) if sizes else (None, 0), "sizes": sizes}
+_REWRITING_ATTRS = re.compile(r"^(?:-?filter\b.*|filter=.*|ident|-ident|working-tree-encoding=.*|eol=.*|!?text|text=.*|"
+ r"!?crlf(?:=.*)?|-crlf(?:=.*)?|export-ignore|-export-ignore|export-subst|-export-subst)$")
+
+
+def checkout_rewrites(line: str) -> List[str]:
+ """The attributes on one .gitattributes line that change files at checkout (or archive): filter (LFS), ident,
+ working-tree-encoding, eol, text (set, auto, unspecified or re-enabled after `* -text`; only `-text` and `binary`
+ leave bytes alone), the legacy crlf, export-ignore/-subst. A `#` starts a comment only at the line start or after
+ whitespace."""
+ parts = re.split(r"(?:^|\s)#", line, 1)[0].split()
+ return [a for a in parts[1:] if _REWRITING_ATTRS.match(a) and a != "-text"] if len(parts) > 1 else []
+
+
+def check_checkout_bytes(f: Findings, files: Sequence[Path]) -> None:
+ """Files are stored byte-exact: no .gitattributes attribute (root or nested) rewrites them at checkout, the root has
+ `* -text`, the Windows shims carry CRLF in their bytes and the POSIX scripts carry no CR."""
+ ga = REPO / ".gitattributes"
+ attr_files = [ga] + [p for p in files if p.name == ".gitattributes" and p != ga]
+ if not ga.is_file() or not re.search(r"(?m)^\*[ \t]+-text[ \t]*(?:[ \t]#.*)?$", read(ga)):
+ f.add("directory", "error", "the root .gitattributes needs a `* -text` line (store files byte-exact)", ".gitattributes")
+ for g in attr_files:
+ if not g.is_file():
+ continue
+ for i, line in enumerate(read(g).splitlines(), 1):
+ for bad in checkout_rewrites(line):
+ f.add("directory", "error", "%s rewrites files at checkout (store them byte-exact): %s" % (bad, line.strip()), "%s:%d" % (rel(g), i))
+ for p in files:
+ r = rel(p)
+ crlf_shim = Path(r).suffix.lower() in (".cmd", ".bat", ".ps1")
+ if not (crlf_shim or r.endswith(".sh") or r == "skills/showtime/bin/showtime"):
+ continue
+ data = p.read_bytes()
+ if crlf_shim and re.search(rb"(?<!\r)\n", data):
+ f.add("directory", "error", "Windows shim has LF-only lines (commit it with CRLF; nothing converts it at checkout)", r)
+ elif not crlf_shim and b"\r" in data:
+ f.add("directory", "error", "has CR bytes (a POSIX script must be LF; a CR breaks the shebang)", r)
+
+
def check_directory(f: Findings, files: Sequence[Path]) -> Dict[str, Any]:
"""The plugin directory's submission limits, on the files git would publish."""
st = directory_stats(files)
@@ -982,11 +1022,7 @@ def check_directory(f: Findings, files: Sequence[Path]) -> Dict[str, Any]:
f.add("directory", "error", "symlink", rel(Path(d) / n))
if (REPO / ".gitmodules").exists():
f.add("directory", "error", "git submodules are not allowed", ".gitmodules")
- ga = REPO / ".gitattributes"
- if ga.is_file():
- for i, line in enumerate(read(ga).splitlines(), 1):
- if re.search(r"(?:^|\s)(export-ignore|export-subst|filter=|-?filter\b)", line.split("#", 1)[0]):
- f.add("directory", "error", "no export-ignore/filter (LFS) attributes: %s" % line.strip(), ".gitattributes:%d" % i)
+ check_checkout_bytes(f, files)
readme = REPO / "README.md"
if not readme.is_file():
f.add("directory", "error", "README.md is missing")
diff --git a/scripts/e2e-windows.ps1 b/scripts/e2e-windows.ps1
index 527b0f6..3d64745 100644
--- a/scripts/e2e-windows.ps1
+++ b/scripts/e2e-windows.ps1
@@ -1,128 +1,128 @@
-<#
-showtime end-to-end test on Windows 10/11 desktop, run as a standard (non-administrator) user.
-
-From a clone of the repository, in a normal (not "Run as administrator") PowerShell window:
-
- powershell -NoProfile -ExecutionPolicy Bypass -File scripts\e2e-windows.ps1
-
-Needs uv and Node.js 22 or 24 (README "Requirements"); no Python install is needed (uv provides one).
-It records the machine, checks the Windows entry points (showtime.cmd; showtime.ps1 under this machine's
-execution policy; a UTF-8-with-BOM script as Windows PowerShell 5.1 writes it), then runs scripts\e2e.py:
-a fresh `showtime setup` (default tier), doctor, a short voiced render with qa, HTML export, transcription,
-captions, the MCP server handshake and the fast test suite. Setup downloads about 3 GB the first time.
-Results go to "%USERPROFILE%\showtime e2e" (a path with a space on purpose) and showtime-e2e.zip next to
-it: summary.md, logs\, the render and the HTML export. Exit code 0 when everything passed.
-
- -SkipSetup use the runtime already in %USERPROFILE%\.showtime
- -NoSuite skip the fast test suite (it takes 20-40 minutes on a 4-core laptop)
- -AllowAdmin run elevated anyway (CI runners are administrators)
-#>
-param(
- [string]$Out = (Join-Path $env:USERPROFILE 'showtime e2e'),
- [switch]$SkipSetup,
- [switch]$NoSuite,
- [string]$SuiteArgs = '-j auto',
- [switch]$AllowAdmin
-)
-$ErrorActionPreference = 'Continue'
-$repo = Split-Path -Parent $PSScriptRoot
-$bin = Join-Path $repo 'skills\showtime\bin'
-New-Item -ItemType Directory -Force -Path (Join-Path $Out 'logs') | Out-Null
-$facts = Join-Path $Out 'windows-facts.txt'
-
-# 1. the machine
-$os = Get-CimInstance Win32_OperatingSystem
-$cpu = Get-CimInstance Win32_Processor | Select-Object -First 1
-$elevated = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(
- [Security.Principal.WindowsBuiltInRole]::Administrator)
-$uv = Get-Command uv -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
-$node = Get-Command node -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
-$lines = @(
- "os: $($os.Caption) $($os.Version) build $($os.BuildNumber) ($($os.OSArchitecture))",
- "edition: $((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -ErrorAction SilentlyContinue).EditionID)",
- "cpu: $($cpu.Name) ($($cpu.NumberOfLogicalProcessors) threads); PROCESSOR_ARCHITECTURE=$env:PROCESSOR_ARCHITECTURE",
- "ram GB: $([math]::Round($os.TotalVisibleMemorySize / 1MB, 1))",
- "user: $(whoami) elevated: $elevated",
- "execution policy: $(Get-ExecutionPolicy) ($((Get-ExecutionPolicy -List | ForEach-Object { "$($_.Scope)=$($_.ExecutionPolicy)" }) -join ', '))",
- "powershell: $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition)",
- "uv: $uv $(if ($uv) { & $uv --version })",
- "node: $node $(if ($node) { & $node --version })",
- "repo: $repo",
- "out: $Out"
-)
-function Note([string[]]$text) { $text | ForEach-Object { Write-Host $_ }; Add-Content -Path $facts -Value $text -Encoding utf8 }
-Set-Content -Path $facts -Value '' -Encoding utf8
-Note $lines
-if ($elevated -and -not $AllowAdmin) {
- Write-Host "This test is for a standard user: open a normal PowerShell window (not 'Run as administrator'), or pass -AllowAdmin."
- exit 2
-}
-if (-not $uv -or -not $node) {
- Write-Host "Install the prerequisites first (README 'Requirements'), then open a new PowerShell window:"
- Write-Host " winget install --id=astral-sh.uv -e"
- Write-Host " winget install OpenJS.NodeJS.LTS --source winget"
- exit 2
-}
-
-# 2. Windows entry points
-$winSteps = @()
-function Step([string]$name, [scriptblock]$block, [string]$expectText = '') {
- $log = Join-Path $Out "logs\windows-$name.txt"
- $t = Get-Date
- $text = (& $block 2>&1 | Out-String -Width 300)
- $rc = $LASTEXITCODE
- Set-Content -Path $log -Value $text -Encoding utf8
- # an exception printed by an exit hook leaves the exit code at 0: a traceback fails the step too
- $ok = ($rc -eq 0) -and ((-not $expectText) -or $text.Contains($expectText)) -and
- (-not $text.Contains('Traceback (most recent call last)'))
- $sec = [math]::Round(((Get-Date) - $t).TotalSeconds, 1)
- $script:winSteps += [pscustomobject]@{ step = $name; ok = $ok; rc = $rc; seconds = $sec }
- "{0,-5} {1,-22} rc={2,-3} {3,6}s" -f $(if ($ok) { 'PASS' } else { 'FAIL' }), $name, $rc, $sec
-}
-Step 'cmd-shim' { & (Join-Path $bin 'showtime.cmd') --version } 'showtime'
-# showtime.ps1 runs only where the execution policy allows scripts (Windows 10/11 desktop default: Restricted).
-$ps1 = Join-Path $bin 'showtime.ps1'
-$log = Join-Path $Out 'logs\windows-ps1-shim.txt'
-# without the -ExecutionPolicy this script was started with (a child inherits it through the environment)
-$inherited = $env:PSExecutionPolicyPreference
-Remove-Item Env:PSExecutionPolicyPreference -ErrorAction SilentlyContinue
-$text = (powershell -NoProfile -Command "& '$ps1' version" 2>&1 | Out-String -Width 300)
-$ps1Rc = $LASTEXITCODE
-if ($inherited) { $env:PSExecutionPolicyPreference = $inherited }
-Set-Content -Path $log -Value $text -Encoding utf8
-$ps1Result = if ($ps1Rc -eq 0) { 'runs' } elseif ($text -match 'running scripts is disabled|cannot be loaded') { 'blocked by the execution policy; showtime.cmd is the entry point' } else { "failed (rc $ps1Rc)" }
-Note "info ps1-shim $ps1Result"
-
-# 3. the end-to-end run (scripts\e2e.py through uv's Python; the showtime calls go through showtime.cmd)
-$e2eArgs = @('run', '--no-project', '--python', '3.12', 'python', (Join-Path $repo 'scripts\e2e.py'), '--out', $Out,
- '--suite-args', $SuiteArgs)
-if ($SkipSetup) { $e2eArgs += '--skip-setup' }
-if ($NoSuite) { $e2eArgs += '--no-suite' }
-& $uv @e2eArgs
-$e2eRc = $LASTEXITCODE
-
-# 4. a narration file written the way Windows PowerShell 5.1 writes UTF-8 (with a byte-order mark)
-$job = Get-ChildItem (Join-Path $Out 'work\showtime-out') -Directory -Filter 'e2e-*' -ErrorAction SilentlyContinue |
- Sort-Object LastWriteTime | Select-Object -Last 1 -ExpandProperty FullName
-if ($job) {
- $bom = Join-Path $job 'narration-bom.md'
- $cafe = 'Caf' + [char]0xE9 # this file stays ASCII: Windows PowerShell 5.1 reads BOM-less scripts as ANSI
- [IO.File]::WriteAllText($bom, "## hero`r`n$cafe-quality narration, written with a byte-order mark.`r`n", (New-Object Text.UTF8Encoding $true))
- Step 'bom-narration' { & (Join-Path $bin 'showtime.cmd') voice script $bom -o (Join-Path $job 'voice-bom') } 'timeline.json'
-}
-
-# 5. results
-$ok = ($e2eRc -eq 0) -and -not ($winSteps | Where-Object { -not $_.ok })
-Note ($winSteps | Format-Table -AutoSize | Out-String)
-$zip = Join-Path (Split-Path -Parent $Out) 'showtime-e2e.zip'
-$pack = @(@((Join-Path $Out 'summary.md'), (Join-Path $Out 'summary.json'), $facts, (Join-Path $Out 'logs')) |
- Where-Object { Test-Path $_ })
-if ($job) {
- $pack += @(@('final.mp4', 'final.captioned.mp4', 'subs.srt', 'exports') | ForEach-Object { Join-Path $job $_ } |
- Where-Object { Test-Path $_ })
-}
-Compress-Archive -Force -Path $pack -DestinationPath $zip
-Write-Host ""
-Write-Host $(if ($ok) { "ALL PASSED" } else { "SOMETHING FAILED: see $Out\summary.md and $Out\logs" })
-Write-Host "results: $zip"
-if ($ok) { exit 0 } else { exit 1 }
+<#
+showtime end-to-end test on Windows 10/11 desktop, run as a standard (non-administrator) user.
+
+From a clone of the repository, in a normal (not "Run as administrator") PowerShell window:
+
+ powershell -NoProfile -ExecutionPolicy Bypass -File scripts\e2e-windows.ps1
+
+Needs uv and Node.js 22 or 24 (README "Requirements"); no Python install is needed (uv provides one).
+It records the machine, checks the Windows entry points (showtime.cmd; showtime.ps1 under this machine's
+execution policy; a UTF-8-with-BOM script as Windows PowerShell 5.1 writes it), then runs scripts\e2e.py:
+a fresh `showtime setup` (default tier), doctor, a short voiced render with qa, HTML export, transcription,
+captions, the MCP server handshake and the fast test suite. Setup downloads about 3 GB the first time.
+Results go to "%USERPROFILE%\showtime e2e" (a path with a space on purpose) and showtime-e2e.zip next to
+it: summary.md, logs\, the render and the HTML export. Exit code 0 when everything passed.
+
+ -SkipSetup use the runtime already in %USERPROFILE%\.showtime
+ -NoSuite skip the fast test suite (it takes 20-40 minutes on a 4-core laptop)
+ -AllowAdmin run elevated anyway (CI runners are administrators)
+#>
+param(
+ [string]$Out = (Join-Path $env:USERPROFILE 'showtime e2e'),
+ [switch]$SkipSetup,
+ [switch]$NoSuite,
+ [string]$SuiteArgs = '-j auto',
+ [switch]$AllowAdmin
+)
+$ErrorActionPreference = 'Continue'
+$repo = Split-Path -Parent $PSScriptRoot
+$bin = Join-Path $repo 'skills\showtime\bin'
+New-Item -ItemType Directory -Force -Path (Join-Path $Out 'logs') | Out-Null
+$facts = Join-Path $Out 'windows-facts.txt'
+
+# 1. the machine
+$os = Get-CimInstance Win32_OperatingSystem
+$cpu = Get-CimInstance Win32_Processor | Select-Object -First 1
+$elevated = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(
+ [Security.Principal.WindowsBuiltInRole]::Administrator)
+$uv = Get-Command uv -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
+$node = Get-Command node -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
+$lines = @(
+ "os: $($os.Caption) $($os.Version) build $($os.BuildNumber) ($($os.OSArchitecture))",
+ "edition: $((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -ErrorAction SilentlyContinue).EditionID)",
+ "cpu: $($cpu.Name) ($($cpu.NumberOfLogicalProcessors) threads); PROCESSOR_ARCHITECTURE=$env:PROCESSOR_ARCHITECTURE",
+ "ram GB: $([math]::Round($os.TotalVisibleMemorySize / 1MB, 1))",
+ "user: $(whoami) elevated: $elevated",
+ "execution policy: $(Get-ExecutionPolicy) ($((Get-ExecutionPolicy -List | ForEach-Object { "$($_.Scope)=$($_.ExecutionPolicy)" }) -join ', '))",
+ "powershell: $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition)",
+ "uv: $uv $(if ($uv) { & $uv --version })",
+ "node: $node $(if ($node) { & $node --version })",
+ "repo: $repo",
+ "out: $Out"
+)
+function Note([string[]]$text) { $text | ForEach-Object { Write-Host $_ }; Add-Content -Path $facts -Value $text -Encoding utf8 }
+Set-Content -Path $facts -Value '' -Encoding utf8
+Note $lines
+if ($elevated -and -not $AllowAdmin) {
+ Write-Host "This test is for a standard user: open a normal PowerShell window (not 'Run as administrator'), or pass -AllowAdmin."
+ exit 2
+}
+if (-not $uv -or -not $node) {
+ Write-Host "Install the prerequisites first (README 'Requirements'), then open a new PowerShell window:"
+ Write-Host " winget install --id=astral-sh.uv -e"
+ Write-Host " winget install OpenJS.NodeJS.LTS --source winget"
+ exit 2
+}
+
+# 2. Windows entry points
+$winSteps = @()
+function Step([string]$name, [scriptblock]$block, [string]$expectText = '') {
+ $log = Join-Path $Out "logs\windows-$name.txt"
+ $t = Get-Date
+ $text = (& $block 2>&1 | Out-String -Width 300)
+ $rc = $LASTEXITCODE
+ Set-Content -Path $log -Value $text -Encoding utf8
+ # an exception printed by an exit hook leaves the exit code at 0: a traceback fails the step too
+ $ok = ($rc -eq 0) -and ((-not $expectText) -or $text.Contains($expectText)) -and
+ (-not $text.Contains('Traceback (most recent call last)'))
+ $sec = [math]::Round(((Get-Date) - $t).TotalSeconds, 1)
+ $script:winSteps += [pscustomobject]@{ step = $name; ok = $ok; rc = $rc; seconds = $sec }
+ "{0,-5} {1,-22} rc={2,-3} {3,6}s" -f $(if ($ok) { 'PASS' } else { 'FAIL' }), $name, $rc, $sec
+}
+Step 'cmd-shim' { & (Join-Path $bin 'showtime.cmd') --version } 'showtime'
+# showtime.ps1 runs only where the execution policy allows scripts (Windows 10/11 desktop default: Restricted).
+$ps1 = Join-Path $bin 'showtime.ps1'
+$log = Join-Path $Out 'logs\windows-ps1-shim.txt'
+# without the -ExecutionPolicy this script was started with (a child inherits it through the environment)
+$inherited = $env:PSExecutionPolicyPreference
+Remove-Item Env:PSExecutionPolicyPreference -ErrorAction SilentlyContinue
+$text = (powershell -NoProfile -Command "& '$ps1' version" 2>&1 | Out-String -Width 300)
+$ps1Rc = $LASTEXITCODE
+if ($inherited) { $env:PSExecutionPolicyPreference = $inherited }
+Set-Content -Path $log -Value $text -Encoding utf8
+$ps1Result = if ($ps1Rc -eq 0) { 'runs' } elseif ($text -match 'running scripts is disabled|cannot be loaded') { 'blocked by the execution policy; showtime.cmd is the entry point' } else { "failed (rc $ps1Rc)" }
+Note "info ps1-shim $ps1Result"
+
+# 3. the end-to-end run (scripts\e2e.py through uv's Python; the showtime calls go through showtime.cmd)
+$e2eArgs = @('run', '--no-project', '--python', '3.12', 'python', (Join-Path $repo 'scripts\e2e.py'), '--out', $Out,
+ '--suite-args', $SuiteArgs)
+if ($SkipSetup) { $e2eArgs += '--skip-setup' }
+if ($NoSuite) { $e2eArgs += '--no-suite' }
+& $uv @e2eArgs
+$e2eRc = $LASTEXITCODE
+
+# 4. a narration file written the way Windows PowerShell 5.1 writes UTF-8 (with a byte-order mark)
+$job = Get-ChildItem (Join-Path $Out 'work\showtime-out') -Directory -Filter 'e2e-*' -ErrorAction SilentlyContinue |
+ Sort-Object LastWriteTime | Select-Object -Last 1 -ExpandProperty FullName
+if ($job) {
+ $bom = Join-Path $job 'narration-bom.md'
+ $cafe = 'Caf' + [char]0xE9 # this file stays ASCII: Windows PowerShell 5.1 reads BOM-less scripts as ANSI
+ [IO.File]::WriteAllText($bom, "## hero`r`n$cafe-quality narration, written with a byte-order mark.`r`n", (New-Object Text.UTF8Encoding $true))
+ Step 'bom-narration' { & (Join-Path $bin 'showtime.cmd') voice script $bom -o (Join-Path $job 'voice-bom') } 'timeline.json'
+}
+
+# 5. results
+$ok = ($e2eRc -eq 0) -and -not ($winSteps | Where-Object { -not $_.ok })
+Note ($winSteps | Format-Table -AutoSize | Out-String)
+$zip = Join-Path (Split-Path -Parent $Out) 'showtime-e2e.zip'
+$pack = @(@((Join-Path $Out 'summary.md'), (Join-Path $Out 'summary.json'), $facts, (Join-Path $Out 'logs')) |
+ Where-Object { Test-Path $_ })
+if ($job) {
+ $pack += @(@('final.mp4', 'final.captioned.mp4', 'subs.srt', 'exports') | ForEach-Object { Join-Path $job $_ } |
+ Where-Object { Test-Path $_ })
+}
+Compress-Archive -Force -Path $pack -DestinationPath $zip
+Write-Host ""
+Write-Host $(if ($ok) { "ALL PASSED" } else { "SOMETHING FAILED: see $Out\summary.md and $Out\logs" })
+Write-Host "results: $zip"
+if ($ok) { exit 0 } else { exit 1 }
diff --git a/skills/showtime/bin/showtime.cmd b/skills/showtime/bin/showtime.cmd
index 86c6eda..a9c3e08 100644
--- a/skills/showtime/bin/showtime.cmd
+++ b/skills/showtime/bin/showtime.cmd
@@ -1,47 +1,47 @@
-@echo off
-rem showtime: Windows cmd entry point. Finds Python and runs lib\st\launcher.py.
-rem Override the interpreter with SHOWTIME_PYTHON. Safe for install paths with
-rem spaces and parentheses (no parenthesised blocks around expanded paths).
-setlocal
-set "ST_LAUNCHER=%~dp0..\lib\st\launcher.py"
-set "ST_HOME=%USERPROFILE%\.showtime"
-if defined SHOWTIME_HOME set "ST_HOME=%SHOWTIME_HOME%"
-if defined SHOWTIME_PYTHON goto custom
-rem setup may rebuild the venv, and Windows cannot delete a running python.exe: run it with a Python outside the venv
-if /i "%~1"=="setup" goto findpy
-if exist "%ST_HOME%\venv\Scripts\python.exe" goto venv
-:findpy
-where py >nul 2>nul && py -3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)" >nul 2>nul && goto pylauncher
-where python >nul 2>nul && python -c "import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)" >nul 2>nul && goto python
-where uv >nul 2>nul && goto uv
-rem a fresh uv install is not on this app's PATH until it restarts: try the installers' folders
-set "ST_UV=%USERPROFILE%\.local\bin\uv.exe"
-if exist "%ST_UV%" goto uvpath
-set "ST_UV=%USERPROFILE%\.cargo\bin\uv.exe"
-if exist "%ST_UV%" goto uvpath
-set "ST_UV=%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe"
-if exist "%ST_UV%" goto uvpath
-if exist "%ST_HOME%\venv\Scripts\python.exe" goto venv
-echo showtime: no Python 3.8+ found. 1>&2
-echo Install uv: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" 1>&2
-echo or Python 3 from https://www.python.org/downloads/ , then run: showtime setup 1>&2
-echo If you just installed one, restart your coding agent (or open a new terminal) so it sees the new PATH. 1>&2
-exit /b 127
-:uvpath
-"%ST_UV%" run --no-project --python 3.12 python "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
-:custom
-"%SHOWTIME_PYTHON%" "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
-:venv
-"%ST_HOME%\venv\Scripts\python.exe" "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
-:pylauncher
-py -3 "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
-:python
-python "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
-:uv
-uv run --no-project --python 3.12 python "%ST_LAUNCHER%" %*
-exit /b %ERRORLEVEL%
+@echo off
+rem showtime: Windows cmd entry point. Finds Python and runs lib\st\launcher.py.
+rem Override the interpreter with SHOWTIME_PYTHON. Safe for install paths with
+rem spaces and parentheses (no parenthesised blocks around expanded paths).
+setlocal
+set "ST_LAUNCHER=%~dp0..\lib\st\launcher.py"
+set "ST_HOME=%USERPROFILE%\.showtime"
+if defined SHOWTIME_HOME set "ST_HOME=%SHOWTIME_HOME%"
+if defined SHOWTIME_PYTHON goto custom
+rem setup may rebuild the venv, and Windows cannot delete a running python.exe: run it with a Python outside the venv
+if /i "%~1"=="setup" goto findpy
+if exist "%ST_HOME%\venv\Scripts\python.exe" goto venv
+:findpy
+where py >nul 2>nul && py -3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)" >nul 2>nul && goto pylauncher
+where python >nul 2>nul && python -c "import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)" >nul 2>nul && goto python
+where uv >nul 2>nul && goto uv
+rem a fresh uv install is not on this app's PATH until it restarts: try the installers' folders
+set "ST_UV=%USERPROFILE%\.local\bin\uv.exe"
+if exist "%ST_UV%" goto uvpath
+set "ST_UV=%USERPROFILE%\.cargo\bin\uv.exe"
+if exist "%ST_UV%" goto uvpath
+set "ST_UV=%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe"
+if exist "%ST_UV%" goto uvpath
+if exist "%ST_HOME%\venv\Scripts\python.exe" goto venv
+echo showtime: no Python 3.8+ found. 1>&2
+echo Install uv: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" 1>&2
+echo or Python 3 from https://www.python.org/downloads/ , then run: showtime setup 1>&2
+echo If you just installed one, restart your coding agent (or open a new terminal) so it sees the new PATH. 1>&2
+exit /b 127
+:uvpath
+"%ST_UV%" run --no-project --python 3.12 python "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
+:custom
+"%SHOWTIME_PYTHON%" "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
+:venv
+"%ST_HOME%\venv\Scripts\python.exe" "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
+:pylauncher
+py -3 "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
+:python
+python "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
+:uv
+uv run --no-project --python 3.12 python "%ST_LAUNCHER%" %*
+exit /b %ERRORLEVEL%
diff --git a/skills/showtime/bin/showtime.ps1 b/skills/showtime/bin/showtime.ps1
index 8bc4c3c..34fd12a 100644
--- a/skills/showtime/bin/showtime.ps1
+++ b/skills/showtime/bin/showtime.ps1
@@ -1,51 +1,51 @@
-# showtime: PowerShell entry point. Finds Python and runs lib/st/launcher.py.
-# Override the interpreter with $env:SHOWTIME_PYTHON.
-$ErrorActionPreference = 'Stop'
-$launcher = Join-Path $PSScriptRoot '..\lib\st\launcher.py'
-$stHome = if ($env:SHOWTIME_HOME) { $env:SHOWTIME_HOME } else { Join-Path $HOME '.showtime' }
-
-function Test-Python([string]$exe, [string[]]$pre) {
- try {
- & $exe @pre -c 'import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)' *> $null
- return ($LASTEXITCODE -eq 0)
- } catch { return $false }
-}
-
-if ($env:SHOWTIME_PYTHON) {
- & $env:SHOWTIME_PYTHON $launcher @args; exit $LASTEXITCODE
-}
-$venvPy = Join-Path $stHome 'venv\Scripts\python.exe'
-if (-not (Test-Path $venvPy)) { $venvPy = Join-Path $stHome 'venv/bin/python' }
-# setup may rebuild the venv, and Windows cannot delete a running python.exe: run it with a Python outside the venv
-$isSetup = ($args.Count -gt 0 -and "$($args[0])" -eq 'setup')
-if ((Test-Path $venvPy) -and -not $isSetup) {
- & $venvPy $launcher @args; exit $LASTEXITCODE
-}
-if ((Get-Command py -ErrorAction SilentlyContinue) -and (Test-Python 'py' @('-3'))) {
- & py -3 $launcher @args; exit $LASTEXITCODE
-}
-foreach ($name in @('python3', 'python')) {
- if ((Get-Command $name -ErrorAction SilentlyContinue) -and (Test-Python $name @())) {
- & $name $launcher @args; exit $LASTEXITCODE
- }
-}
-$uv = Get-Command uv -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
-if (-not $uv) {
- # a fresh uv install is not on this app's PATH until it restarts: try the installers' folders
- $uvHome = if ($env:USERPROFILE) { $env:USERPROFILE } else { $HOME }
- $cands = @((Join-Path $uvHome '.local\bin\uv.exe'), (Join-Path $uvHome '.cargo\bin\uv.exe'),
- (Join-Path $HOME '.local/bin/uv'), (Join-Path $HOME '.cargo/bin/uv'))
- if ($env:LOCALAPPDATA) { $cands += (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Links\uv.exe') }
- $uv = $cands | Where-Object { Test-Path $_ -PathType Leaf } | Select-Object -First 1
-}
-if ($uv) {
- & $uv run --no-project --python 3.12 python $launcher @args; exit $LASTEXITCODE
-}
-if (Test-Path $venvPy) {
- & $venvPy $launcher @args; exit $LASTEXITCODE
-}
-Write-Error ("showtime: no Python 3.8+ found. Install uv: " +
- 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"' +
- " (or Python 3 from https://www.python.org/downloads/), then run: showtime setup. " +
- "If you just installed one, restart your coding agent (or open a new terminal) so it sees the new PATH.")
-exit 127
+# showtime: PowerShell entry point. Finds Python and runs lib/st/launcher.py.
+# Override the interpreter with $env:SHOWTIME_PYTHON.
+$ErrorActionPreference = 'Stop'
+$launcher = Join-Path $PSScriptRoot '..\lib\st\launcher.py'
+$stHome = if ($env:SHOWTIME_HOME) { $env:SHOWTIME_HOME } else { Join-Path $HOME '.showtime' }
+
+function Test-Python([string]$exe, [string[]]$pre) {
+ try {
+ & $exe @pre -c 'import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)' *> $null
+ return ($LASTEXITCODE -eq 0)
+ } catch { return $false }
+}
+
+if ($env:SHOWTIME_PYTHON) {
+ & $env:SHOWTIME_PYTHON $launcher @args; exit $LASTEXITCODE
+}
+$venvPy = Join-Path $stHome 'venv\Scripts\python.exe'
+if (-not (Test-Path $venvPy)) { $venvPy = Join-Path $stHome 'venv/bin/python' }
+# setup may rebuild the venv, and Windows cannot delete a running python.exe: run it with a Python outside the venv
+$isSetup = ($args.Count -gt 0 -and "$($args[0])" -eq 'setup')
+if ((Test-Path $venvPy) -and -not $isSetup) {
+ & $venvPy $launcher @args; exit $LASTEXITCODE
+}
+if ((Get-Command py -ErrorAction SilentlyContinue) -and (Test-Python 'py' @('-3'))) {
+ & py -3 $launcher @args; exit $LASTEXITCODE
+}
+foreach ($name in @('python3', 'python')) {
+ if ((Get-Command $name -ErrorAction SilentlyContinue) -and (Test-Python $name @())) {
+ & $name $launcher @args; exit $LASTEXITCODE
+ }
+}
+$uv = Get-Command uv -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty Source
+if (-not $uv) {
+ # a fresh uv install is not on this app's PATH until it restarts: try the installers' folders
+ $uvHome = if ($env:USERPROFILE) { $env:USERPROFILE } else { $HOME }
+ $cands = @((Join-Path $uvHome '.local\bin\uv.exe'), (Join-Path $uvHome '.cargo\bin\uv.exe'),
+ (Join-Path $HOME '.local/bin/uv'), (Join-Path $HOME '.cargo/bin/uv'))
+ if ($env:LOCALAPPDATA) { $cands += (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Links\uv.exe') }
+ $uv = $cands | Where-Object { Test-Path $_ -PathType Leaf } | Select-Object -First 1
+}
+if ($uv) {
+ & $uv run --no-project --python 3.12 python $launcher @args; exit $LASTEXITCODE
+}
+if (Test-Path $venvPy) {
+ & $venvPy $launcher @args; exit $LASTEXITCODE
+}
+Write-Error ("showtime: no Python 3.8+ found. Install uv: " +
+ 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"' +
+ " (or Python 3 from https://www.python.org/downloads/), then run: showtime setup. " +
+ "If you just installed one, restart your coding agent (or open a new terminal) so it sees the new PATH.")
+exit 127
diff --git a/skills/showtime/tests/test_skill_structure.py b/skills/showtime/tests/test_skill_structure.py
index 6db454d..d67d76a 100644
--- a/skills/showtime/tests/test_skill_structure.py
+++ b/skills/showtime/tests/test_skill_structure.py
@@ -100,11 +100,76 @@ class TestRepoHygiene(unittest.TestCase):
bad.append("%s: %s" % (page.relative_to(SKILL), url))
self.assertEqual(bad, [])
- def test_gitattributes_line_endings(self):
+ def test_gitattributes_rewrites_nothing_at_checkout(self):
+ """The plugin directory refuses checkout rewrites: no text/eol/filter/ident/encoding attribute, shims stored with CRLF."""
text = (REPO / ".gitattributes").read_text(encoding="utf-8")
- for pat, eol in (("*.sh", "lf"), ("*.py", "lf"), ("*.mjs", "lf"), ("*.md", "lf"),
- ("*.cmd", "crlf"), ("*.ps1", "crlf")):
- self.assertRegex(text, r"(?m)^%s\s+.*eol=%s\b" % (pat.replace("*", r"\*").replace(".", r"\."), eol))
+ self.assertRegex(text, r"(?m)^\*\s+-text\s*$")
+ for line in text.splitlines():
+ self.assertEqual(cr.checkout_rewrites(line), [], line)
+ import subprocess
+ tracked = subprocess.run(["git", "ls-files", "-z"], cwd=str(REPO), stdout=subprocess.PIPE, check=True).stdout.decode("utf-8").split("\0")
+ tracked = [t for t in tracked if t and (REPO / t).is_file()]
+ shims = [t for t in tracked if t.lower().endswith((".cmd", ".bat", ".ps1"))]
+ posix = [t for t in tracked if t.endswith(".sh") or t == "skills/showtime/bin/showtime"]
+ self.assertTrue(shims and posix)
+ for name in shims:
+ data = (REPO / name).read_bytes()
+ self.assertNotRegex(data, rb"(?<!\r)\n", "%s must be stored with CRLF" % name)
+ for name in posix:
+ self.assertNotIn(b"\r", (REPO / name).read_bytes(), "%s must be stored with LF only" % name)
+
+ def test_checkout_rewrite_check_and_mutants(self):
+ import shutil
+ import tempfile
+ for line in ("*.cmd text eol=crlf", "* text=auto eol=lf", "*.a filter=lfs diff=lfs merge=lfs", "*.b ident",
+ "*.c working-tree-encoding=UTF-16", "d export-ignore", "e export-subst", "*.f eol=lf", "*.g text=auto",
+ "*.i crlf", "*.j -crlf", "*.k crlf=input", "*.l !text", "*.m text", "*.n !crlf", "a#b text eol=lf"):
+ self.assertNotEqual(cr.checkout_rewrites(line), [], line)
+ for line in ("* -text", "*.png binary", "# *.cmd text eol=crlf", "", "*.h -text # eol=lf", "a#b -text", "*.png binary # text"):
+ self.assertEqual(cr.checkout_rewrites(line), [], line)
+ d = Path(tempfile.mkdtemp(prefix="st-ga-"))
+ real = cr.REPO
+ try:
+ (d / "skills" / "showtime" / "bin").mkdir(parents=True)
+ files = {"a.cmd": b"@echo off\r\nexit /b 0\r\n", "b.ps1": b"x\r\n", "run.sh": b"#!/bin/sh\n", "skills/showtime/bin/showtime": b"#!/bin/sh\n"}
+ for n, data in files.items():
+ (d / n).write_bytes(data)
+ (d / ".gitattributes").write_text("# stored byte-exact\n* -text\n*.png binary\n", encoding="utf-8")
+ cr.REPO = d
+ paths = [d / n for n in files]
+
+ def errors():
+ f = cr.Findings()
+ cr.check_checkout_bytes(f, paths)
+ return [i["message"] for i in f.errors()]
+
+ self.assertEqual(errors(), [])
+ # mutant 1: the old attributes come back
+ (d / ".gitattributes").write_text("* -text\n*.cmd text eol=crlf\n", encoding="utf-8")
+ self.assertTrue(any("rewrites files at checkout" in m for m in errors()), errors())
+ (d / ".gitattributes").write_text("* -text\n", encoding="utf-8")
+ # mutant 2: a shim stored with LF
+ (d / "a.cmd").write_bytes(b"@echo off\nexit /b 0\n")
+ self.assertTrue(any("LF-only" in m for m in errors()), errors())
+ (d / "a.cmd").write_bytes(files["a.cmd"])
+ # mutant 3: a POSIX script with CR
+ (d / "run.sh").write_bytes(b"#!/bin/sh\r\n")
+ self.assertTrue(any("CR bytes" in m for m in errors()), errors())
+ (d / "run.sh").write_bytes(files["run.sh"])
+ # mutants 4-5: no `* -text` in the root, and a nested .gitattributes
+ (d / ".gitattributes").write_text("*.png binary\n", encoding="utf-8")
+ self.assertTrue(any("needs a `* -text`" in m for m in errors()), errors())
+ (d / ".gitattributes").write_text("* -text\n", encoding="utf-8")
+ (d / "sub").mkdir()
+ (d / "sub" / ".gitattributes").write_text("*.x text\n", encoding="utf-8")
+ paths.append(d / "sub" / ".gitattributes")
+ self.assertTrue(any("rewrites files" in m for m in errors()), errors())
+ paths.pop()
+ (d / "skills" / "showtime" / "bin" / "showtime").write_bytes(b"#!/bin/sh\r\n")
+ self.assertTrue(any("CR bytes" in m for m in errors()), errors())
+ finally:
+ cr.REPO = real
+ shutil.rmtree(str(d), ignore_errors=True)
def test_every_test_file_takes_fast(self):
"""run_all.py --fast (the CI fast tier) passes --fast to every file; a bare unittest.main() exits 2 on it."""