Repository navigation
[CTX-1916] fix(release,ci): accept the .com console shim and drop the preview newline anchor - #3278
Conversation
… preview newline anchor Windows Scoop (R2) CDN E2E (release.yml): `scoop which bitty` resolves to the bitty.com console companion - bitty#3224 states the manifest deliberately shims bitty.com and a bare `bitty` must resolve .COM first - so the executable-shim allowlist gains '.com'. preview.yml smoke-windows: the version tail was newline-anchored (`(?:\r\n|\n)\z`), which passed the raw exe capture but failed the .Trim()-ed `$viaProxy` capture (#3276). Use the `\)\s*\z` class tail that #3275 already applied to release.yml.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…he .com allowlist
Xuepoo
left a comment
There was a problem hiding this comment.
Independent content review — PR #3278, reviewed head 25daa80 (branch ctx-1916/fix-cdn-shim-preview-pattern; base f854d5a = origin/main).
-
Diff scope: PASS — exactly the three declared files and nothing else: .github/workflows/release.yml +2/-1, .github/workflows/preview.yml +1/-1, scripts/tests/check-release-smoke-fail-closed.test.sh +2/-1; total +5/-3 (git diff --stat origin/main...HEAD).
-
release.yml Scoop CDN step: PASS — line 2652 now reads
if ([IO.Path]::GetExtension($shim) -notin @('.exe', '.cmd', '.bat', '.ps1', '.com')) {with the one-line bitty#3224 comment at 2651. The-notinthrow at 2653 is intact, so any genuinely non-executable extension (.dll, .txt, .scr, ...) still fails the leg; only the console companion.comis admitted. Adjacent preconditions are byte-identical to main (the only hunk is 2651-2652): Test-Path shim check 2648-2650, scoop prefix extraction 2639-2641, and the\s*\z-anchored version pattern at 2658 (from #3275) untouched. -
preview.yml smoke-windows, both capture paths: PASS — the pattern tail at 557 is now
\)\s*\z. Direct path:$output(554,& $exe --version 2>&1 | Out-String) keeps its trailing newline and\s*absorbs it before\z. Proxy path:$viaProxy(564) is.Trim()-ed, so\s*matches the empty tail at\z; the-cnotmatchat 566 reuses the same$pattern.\A+ [regex]::Escape($env:BASE_VERSION) +(preview [^\s()]+)keep the assertion fail-closed for wrong versions/channels on both paths. -
Same-class sweep: PASS —
grep -nF '(?:\r\n|\n)\z'over BOTH release.yml and preview.yml returns zero hits (exit 1); preview.yml carries exactly one\zanchor (557); release.yml's four assertion sites already use\s*\zvia #3275. -
Re-pointed guard: PASS — scripts/tests/check-release-smoke-fail-closed.test.sh:153 expect_contains matches the new allowlist literal verbatim (
GetExtension($shim) -notin @('.exe', '.cmd', '.bat', '.ps1', '.com')), the assertion label at 154 ("Scoop smoke requires an executable shim extension") is preserved, and no assertion was deleted or weakened — the only hunk in the file replaces the old literal with a strictly longer one plus the bitty#3224 comment. Run in the lane worktree: exit 0, 33 PASS / 0 FAIL. Independent discrimination re-proof on a scratch copy (/tmp/hermes/scratch-3278b/discrim): with only'.com'removed from the copied release.yml allowlist, the guard exits 1 with exactly one failing assertion — "Scoop smoke requires an executable shim extension" (32 PASS / 1 FAIL). The re-pointed guard genuinely discriminates this PR's release.yml change. -
Hygiene: PASS — both new comments are English; both commit subjects carry literal [CTX-1916] (e1174f6, 25daa80); the PR body carries Closes #3276 plus the run-44741426851 forensics quoting the exact
scoop which bitty did not resolve to an executable shim: ~\scoop\apps\bitty\current\bitty.comthrow; labels fix/P1/area:release and milestone v0.1.0 are set. gh pr checks on this head at review time: 12 pass / 4 pending / 3 skipping / 0 fail (19 total).
Both fixes are minimal, correctly scoped to the class defect, and guarded. The fail-closed contracts (shim extension allowlist, anchored version assertions) remain enforceable and the static guard now pins the new allowlist literal while still failing on any regression of it.
VERDICT: APPROVE
Xuepoo
left a comment
There was a problem hiding this comment.
Verdict: NEEDS-FIX
One tracking/scope item blocks (finding 3); the two runtime changes are correct and need no code change. Reviewed head 25daa80c in a detached review worktree.
What is confirmed working
.comis the shipped shim.scripts/render-package-manifests.sh:198,204emit"bin": [["bitty.com", "bitty"]]for both architectures, and the publishedbitty-terminal/scoop-bucketmanifest for the shippedv0.0.46carries exactly that. Soscoop which bittyresolving to~\scoop\apps\bitty\current\bitty.comis the intended result, andrelease.yml:2651-2652is the right place to admit it. The leg still fails a release whose ZIP lacks the companion:$appComat:2641-2646is required to exist. Rejection of genuinely non-executable extensions (.dll,.txt,.scr) is unchanged.- Preview change is the same class fix as #3275.
preview.yml:557is now\)\s*\z, matching release.yml's four sites (:1014,:1273,:2615,:2658). Sweep for the old shape —grep -nE '(?:\r\n|\n)\z|\r?\n\z' .github/workflows/release.yml .github/workflows/preview.yml→ no hits (exit 1). - No assertion is weakened. Both captures are compared with
-cnotmatchagainst a\A ... \zpattern whose version is[regex]::Escaped, so a wrong version, a wrong channel token, or any trailing non-whitespace line still throws on both the raw$outputpath and the.Trim()ed$viaProxypath.\s*tolerates only trailing whitespace, which the old(?:\r\n|\n)\zalready tolerated for the raw capture; the net change is that a trimmed capture is now accepted, which is the bug being fixed. - Nothing lets a broken release through. A missing
bitty.comfails at:2641-2646; a shim that does not forward fails at:2652(& $shimthrows/returns non-zero) or at the anchored version compare; a preview build with wrong channel/version still failspreview.yml:558-566. - Commands:
bash scripts/tests/check-release-smoke-fail-closed.test.sh→ 33 PASS, exit 0;bash scripts/check-release-windows-verify.shon this head → PASS;bash scripts/tests/check-release-windows-verify.test.sh→ all cases pass;actionlint .github/workflows/release.yml .github/workflows/preview.yml→ exit 0;shellcheck -S warning/shfmt -don the changed test script → exit 0. Scope is exactly the three declared files (+5/-3).
Findings
1. Minor — the assertion now proves "a file with an allowed extension", not "the shipped shim" (release.yml:2648-2652)
With '.com' admitted, the extension predicate no longer distinguishes the installed companion from any other .com scoop which might report; only Test-Path -Leaf and the version output constrain it. The leg already knows the shipped path ($appCom, :2641), so assert it directly — if ($shim -ne $appCom) { throw ... } (or $shim.StartsWith($appDir.Trim())) — and keep the extension allowlist as the secondary guard. That makes the "executable shim" check fail closed on a shim resolving outside the installed prefix instead of relying on the runnable-output check.
2. Minor — the static pin does not carry that intent (scripts/tests/check-release-smoke-fail-closed.test.sh:152-153)
The updated expect_contains pins the allowlist literal verbatim, so any reflow of the release.yml line fails the test, while a shim-path tightening (finding 1) would need a second pin. Consider one assertion on the shipped-path comparison next to this one.
3. Medium — Closes #3276 closes an issue whose second half is not done (scripts/check-release-windows-verify.sh / .github/workflows/preview.yml)
#3276 asks for two things: relax the pattern, and cover preview.yml in the static gate ("either extend it ... or add a sibling static gate"). This PR does the first only, and defers the guard to #3277's lane, while #3277 explicitly excludes preview.yml — a circular deferral. I found no open follow-up issue or CarryCtx task tracking it. Consequence if merged as-is: after the merge no PR-CI check guards the preview.yml version pattern, so the next edit that reintroduces a newline anchor is discovered only on a preview dispatch — the same cost profile as the v0.0.46 run. Fix: file the follow-up (issue + CTX task) and switch the body to Refs #3276, or extend the gate to scan both workflows before closing.
4. Nit — cross-reference the manifest source (release.yml:2651)
bitty#3224: the manifest deliberately shims bitty.com is accurate; citing scripts/render-package-manifests.sh (the file that writes the bin entry) would point the next reader at the source of truth.
Reviewer: independent subagent (CTX-1916 follow-up)
Xuepoo
left a comment
There was a problem hiding this comment.
Verdict: NEEDS-FIX
Delta review at head e665a186 (delta 25daa80c..e665a186: release.yml:+11/-1, body edit).
Item 1 — tracking — resolved. Body now ends Part of #3276; the guard-coverage half is #3281, the out-of-scope section names #3281 as the tracker, Closes #3276 is gone, and no other paragraph claims the guard is covered. Both #3276 and #3281 are open. $appCom is genuinely the manifest-declared member: scripts/render-package-manifests.sh:198,204 and the published v0.0.46 bucket manifest both carry "bin": [["bitty.com", "bitty"]], and $appCom (release.yml:2641) is scoop prefix bitty + /bitty.com, i.e. that target through current. Allowlist unchanged at :2652; preview change and gate unaffected.
Findings
1. Critical — the new equality check can never pass on the real channel layout, so the leg still fails (release.yml:2658-2660)
[IO.Path]::GetFullPath is a plain .NET API and does not expand ~. scoop which prints a home-abbreviated path: libexec/scoop-which.ps1 ends with friendly_path $path, and lib/core.ps1:663-672 rewrites the filesystem home prefix to ~\. scoop prefix (libexec/scoop-prefix.ps1 → currentdir) prints the raw absolute path. The failing run proves the asymmetry on the runner: job 136322523377 (run 44741426851) threw scoop which bitty did not resolve to an executable shim: ~\scoop\apps\bitty\current\bitty.com, and that step only gets there because Test-Path -LiteralPath succeeded — PowerShell providers expand ~, [IO.Path] does not. So:
$shimFull=<step cwd>\~\scoop\apps\bitty\current\bitty.com(e.g.D:\a\bitty\bitty\~\scoop\...)$appComFull=C:\Users\runneradmin\scoop\apps\bitty\current\bitty.com
These are always unequal, for any install under $HOME (i.e. every default Scoop install), so this turns the fixed leg back into a failure with a more misleading message ("resolved to '~\scoop...', not the manifest shim 'C:...'") that reads as a wrong-directory bug. Fix: normalize through the provider — $shimFull = (Resolve-Path -LiteralPath $shim).ProviderPath (and the same for $appCom), or compare file identities with (Get-Item -LiteralPath $shim).FullName -eq (Get-Item -LiteralPath $appCom).FullName; both expand ~ and normalize separators, and -eq is already case-insensitive. The comparison logic itself is right: with ~ expanded, current\bitty.com on both sides is the same file.
2. Minor — the new assertion is unpinned by the static suite (scripts/tests/check-release-smoke-fail-closed.test.sh:152-153)
The suite still only pins the allowlist literal; grep for GetFullPath / OrdinalIgnoreCase in the test finds nothing, which is why 33/33 stayed green while finding 1 landed. Add one expect_contains on the normalized comparison.
3. Nit — PR-body evidence is two commits stale (body, "Local evidence" section)
It cites worktree/head e1174f6d; refresh to e665a186 so the quoted gate/actionlint output matches the reviewed head.
Verification run on this head
actionlint .github/workflows/release.yml .github/workflows/preview.yml → exit 0; bash scripts/tests/check-release-smoke-fail-closed.test.sh → 33 PASS, exit 0; bash scripts/check-release-windows-verify.sh → PASS (4 assertions); bash scripts/tests/check-release-windows-verify.test.sh → all cases pass. Nothing beyond the two declared files plus the test literal changed (git diff --stat origin/main...HEAD: 3 files, +16/-3). The static suite cannot see finding 1 — it is a runtime path-normalization defect, so this needs a fix plus, ideally, a Windows re-run of the leg before merge.
Reviewer: independent subagent (CTX-1916 follow-up)
Xuepoo
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Delta review at head 61dacdfe. No verdict had been posted for this head yet (the earlier ones were content review on 25daa80c and NEEDS-FIX on e665a186, review 5994715447), so this covers the e665a186..61dacdfe delta: release.yml:+8/-3, check-release-smoke-fail-closed.test.sh:+8. Mergeable from a review standpoint.
1. Provider resolution and the secondary guard — confirmed
release.yml:2660-2662 resolves both sides with (Get-Item -LiteralPath …).FullName and keeps Equals(…, [StringComparison]::OrdinalIgnoreCase). The extension allowlist is still the first gate at :2652 (.exe/.cmd/.bat/.ps1/.com), with $appCom's existence check at :2642-2644 ahead of it, so Get-Item can only ever see paths that already passed both checks; a vanished file throws rather than skips.
2. Equality for the real layout — reasoned and consistent
$appCom is Join-Path (scoop prefix bitty) 'bitty.com' (:2641); scoop prefix prints the raw absolute path (libexec/scoop-prefix.ps1 → currentdir → $scoopdir\apps\bitty\current), while scoop which prints friendly_path-abbreviated output (libexec/scoop-which.ps1, lib/core.ps1:663-672), i.e. the ~\scoop\apps\bitty\current\bitty.com seen in the failing run. Get-Item -LiteralPath goes through the FileSystem provider, which expands ~; .FullName then yields the normalized absolute path. Both values are therefore …\apps\bitty\current\bitty.com, equal under ordinal-ignore-case. A different companion (…\current\bitty2.com), another app's copy (…\apps\other\current\bitty.com) or a shim outside the prefix (~\scoop\shims\…) all normalize to different strings and throw. .FullName is the path as accessed, so the current junction is not rewritten to a versioned directory — and both sides contain current, so even symmetric junction resolution would keep them equal.
3. Mismatch message — confirmed
:2663 interpolates $shimFull and $appComFull, so a real directory mismatch prints two comparable absolute paths instead of one abbreviated and one absolute; this is what distinguishes it from the previous ~-expansion false failure.
4. Static pin — discriminates on the comparison, only partially on the message
- Discriminates on the code: I reverted the two
Get-Itemlines to[IO.Path]::GetFullPathin the review worktree and the suite failed withFAIL: Scoop smoke resolves the shim path through the provider; restored, 36/36 PASS, exit 0. - Minor — the message pin is fragment-only (
scripts/tests/check-release-smoke-fail-closed.test.sh:161-162):expect_contains … 'not the manifest shim'survives a revert of the message to the unresolved'$shim'/'$appCom'— I applied exactly that mutation and the suite still passed (exit 0). Item 3's contract is implemented but not protected; pinningresolved to '$shimFull', not the manifest shim '$appComFull'would close it. Non-blocking.
5. Evidence boundary
The container proof is adequate for the tilde-expansion defect class: [IO.Path]::GetFullPath never expands ~ on any platform (it is a pure .NET path combinator), and ~ expansion lives in the PowerShell FileSystem provider, which is the same code path on Linux and Windows — so GetFullPath('~/…') failing while (Get-Item -LiteralPath '~/…').FullName succeeds is a platform-independent property, and the container observed exactly the two behaviours the fix relies on. It also matches what the real run already proved: in job 136322523377 the step passed Test-Path -LiteralPath '~\scoop\apps\bitty\current\bitty.com' before throwing on the extension, so provider-side ~ expansion for -LiteralPath happened on the actual Windows runner.
What remains unproven until the Windows leg runs: (a) that scoop which and scoop prefix on the runner produce that exact ~-vs-absolute pair in the same step (each half is evidenced separately, not jointly); (b) that Get-Item.FullName on Windows keeps …\apps\bitty\current\… unexpanded and does not resolve the current junction to a versioned directory, nor normalize case/separators asymmetrically; (c) that Scoop does not report its own shim wrapper (…\shims\bitty.exe) on some version, which would be a legitimate install failing the new equality. The container says nothing about junctions, backslashes, .COM execution or Scoop itself, so it is not end-to-end evidence. I also note that the Windows check and test job on this head is still pending (everything else is green: Quality gates 1/2, MSRV, macOS, CodeQL, AUR, wayland/X11), so CI has not yet exercised the workflow under review either.
6. Body — confirmed
The only heads cited are f854d5a9 (the release run that failed, correctly historical) and 61dacdfe ("Local evidence … head 61dacdfe"); no stale head remains.
Verification run on this head
check-release-smoke-fail-closed.test.sh → 36 PASS / 0 FAIL, exit 0; actionlint on release.yml + preview.yml → exit 0; check-release-windows-verify.sh → PASS (4 assertions); its fixture suite → exit 0; shellcheck -S warning and shfmt -d on the changed test script → exit 0. Mutations were applied only in the disposable review worktree and reverted (git diff --quiet clean).
Windows-only residual risk: if the Windows runner's Scoop reports the versioned app directory (or its own shims wrapper) instead of …\apps\bitty\current\bitty.com, or if Get-Item expands the current junction, the equality throws despite a correct install — only the Windows leg of the next release/preview run can settle that.
Reviewer: independent subagent (CTX-1916 follow-up)
Xuepoo
left a comment
There was a problem hiding this comment.
Reviewer: independent subagent, CTX-1916 guard gap-fill, round-2 verdict.
Reviewed head: 61dacdfe (61dacdfebc3ebaed30f2e2c714860dc89a8735e9), branch ctx-1916/fix-cdn-shim-preview-pattern, merge-base f854d5a9. origin/main has since advanced to f4d76f6d via #3277 — composition against that new main is re-proved below (check 7). This comment exists because the prior reviews on this head are COMMENTED-state with prose "Verdict:" lines the merge gate cannot read; everything below was re-derived independently (fresh gh api pulls/3278/files, fresh scratch runs), not copied from them.
The diff under review (git diff f854d5a9..61dacdfe, identical to the API patch)
diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml
index c01e6a04..aad18390 100644
--- a/.github/workflows/preview.yml
+++ b/.github/workflows/preview.yml
@@ -554,7 +554,7 @@ jobs:
$output = (& $exe --version 2>&1 | Out-String)
$code = $LASTEXITCODE
if ($code -ne 0) { throw "bitty --version exited $code" }
- $pattern = '\Abitty ' + [regex]::Escape($env:BASE_VERSION) + ' \(preview [^\s()]+\)(?:\r\n|\n)\z'
+ $pattern = '\Abitty ' + [regex]::Escape($env:BASE_VERSION) + ' \(preview [^\s()]+\)\s*\z'
Write-Host "bitty --version => $($output.TrimEnd())"
if ($output -cnotmatch $pattern) {
throw "version/channel mismatch: '$output'"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 67d84f62..fdf64da3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2648,9 +2648,20 @@ jobs:
if (-not (Test-Path -LiteralPath $shim -PathType Leaf)) {
throw "scoop which bitty did not resolve to an existing file: $shim"
}
- if ([IO.Path]::GetExtension($shim) -notin @('.exe', '.cmd', '.bat', '.ps1')) {
+ # bitty#3224: the manifest deliberately shims bitty.com, so '.com' is an intended shim.
+ if ([IO.Path]::GetExtension($shim) -notin @('.exe', '.cmd', '.bat', '.ps1', '.com')) {
throw "scoop which bitty did not resolve to an executable shim: $shim"
}
+ # bitty#3224: the '.com' allowlist admits any console companion, so
+ # also require the resolved shim to be the manifest-declared
+ # `bitty.com` member of the installed app (under `current`).
+ # Resolve through the provider: `scoop which` prints a `~\`-relative
+ # path, which [IO.Path] cannot expand.
+ $shimFull = (Get-Item -LiteralPath $shim).FullName
+ $appComFull = (Get-Item -LiteralPath $appCom).FullName
+ if (-not $shimFull.Equals($appComFull, [StringComparison]::OrdinalIgnoreCase)) {
+ throw "scoop which bitty resolved to '$shimFull', not the manifest shim '$appComFull'"
+ }
$out = (& $shim --version 2>&1 | Out-String)
$code = $LASTEXITCODE
if ($code -ne 0) { throw "bitty --version exited $code" }
diff --git a/scripts/tests/check-release-smoke-fail-closed.test.sh b/scripts/tests/check-release-smoke-fail-closed.test.sh
index ac7e48fe..87110292 100755
--- a/scripts/tests/check-release-smoke-fail-closed.test.sh
+++ b/scripts/tests/check-release-smoke-fail-closed.test.sh
@@ -149,8 +149,17 @@ expect_count "$SMOKE" '2>&1 | Out-String' 3 \
"PowerShell post-release legs capture native stdout and stderr"
expect_contains "$SMOKE" 'Test-Path -LiteralPath $shim -PathType Leaf' \
"Scoop smoke requires an existing shim file"
-expect_contains "$SMOKE" "GetExtension(\$shim) -notin @('.exe', '.cmd', '.bat', '.ps1')" \
+# bitty#3224: the Scoop shim allowlist includes '.com' for the bitty.com console companion.
+expect_contains "$SMOKE" "GetExtension(\$shim) -notin @('.exe', '.cmd', '.bat', '.ps1', '.com')" \
"Scoop smoke requires an executable shim extension"
+# bitty#3224: '.com' alone admits any console companion, so the leg must resolve
+# the provider path (`scoop which` prints `~\...`) and compare it with the target.
+expect_contains "$SMOKE" '(Get-Item -LiteralPath $shim).FullName' \
+ "Scoop smoke resolves the shim path through the provider"
+expect_contains "$SMOKE" 'if (-not $shimFull.Equals($appComFull, [StringComparison]::OrdinalIgnoreCase)) {' \
+ "Scoop smoke compares the resolved shim with the manifest target"
+expect_contains "$SMOKE" 'not the manifest shim' \
+ "Scoop smoke reports both resolved paths on a shim mismatch"
expect_contains "$SMOKE" 'Test-Path -LiteralPath $exe -PathType Leaf' \
"native Windows smoke requires an existing executable file"
expect_contains "$RELEASE" 'prerelease: false' \Numbered checks
1. Diff and head confirmed — PASS. gh api repos/bitty-terminal/bitty/pulls/3278/files on head 61dacdfebc3ebaed30f2e2c714860dc89a8735e9, quoted in full above: exactly the three declared files — preview.yml +1/-1, release.yml +12/-1, check-release-smoke-fail-closed.test.sh +10/-1; git diff --stat f854d5a9..61dacdfe agrees (+23/-3 total, no fourth file). The lane worktree HEAD is the same commit.
2. .com acceptance is bound to the installed app member — PASS. release.yml:2639-2641 derive $appCom from scoop prefix bitty + the manifest-declared bitty.com member; :2642-2644 throw if the install did not extract it; :2651-2654 admit .com into the extension allowlist (every other extension still throws — .dll/.txt/.scr rejection unchanged); :2660-2661 resolve both sides through the provider ((Get-Item -LiteralPath …).FullName, which expands the ~\ abbreviation scoop which prints and [IO.Path] cannot); :2662-2664 require [StringComparison]::OrdinalIgnoreCase equality with $appComFull, else throw naming both resolved paths. A different .com (…\current\bitty2.com, another app's …\apps\other\current\bitty.com), a shim outside the installed prefix (…\shims\…), or Scoop's own .exe wrapper all normalize to different strings and fail the leg. Naming clarification for the PR title: the Scoop channel runs inside the Test installation from CDN (Windows) step; the other Windows channel (install.ps1) already asserts the companion directly at :2622-2626 and is untouched — the extension allowlist only ever existed in the Scoop leg.
3. preview.yml keeps fail-closed semantics — PASS. :557 is now \)\s*\z, the file's only \z anchor. Both consumers are -cnotmatch throws: :559-561 on the raw $output capture (trailing newline absorbed by \s*), :566 on the .Trim()ed $viaProxy. \A + [regex]::Escape($env:BASE_VERSION) + the literal (preview channel token keep a wrong version, wrong channel, or trailing non-whitespace junk failing on both paths — an unparsed output throws, it never silently passes. This is the same contract #3275 put on release.yml's four sites and that main's gate (from #3277) enforces as exactly \s*\z.
4. Suite pins the new literals and fails on the old shapes — PASS. check-release-smoke-fail-closed.test.sh:153-154 re-points the allowlist literal (assertion label unchanged), :157-158 pin provider resolution, :159-160 the equality, :161-162 the mismatch message. Empirical discrimination: with the OLD (pre-PR) release.yml restored in a scratch copy, the suite exits 1 with 32 PASS / 4 FAIL — the failures are exactly those four pins. Known boundary (pre-existing on main too, non-blocking): the suite reads release.yml only, so the preview.yml anchor has no static pin; it is covered by the same-class sweep (grep -F '(?:\r\n|\n)\z' over both workflows at this head → zero hits) and by preview-isolation / preview-preflight passing (exit 0 each).
5. Gates run from a scratch copy — PASS (lane worktree read-only throughout; copied files verified git hash-object-identical to the head blobs):
scripts/tests/check-release-smoke-fail-closed.test.sh→ exit 0, 36 PASS / 0 FAIL;actionlint .github/workflows/release.yml .github/workflows/preview.yml→ exit 0;shellcheck -S warningon the changed test script → exit 0;shfmt -don the changed test script → exit 0.
6. Tautology mutation is caught — PASS. In the scratch copy only, weakening the new binding to a tautology ($shimFull.Equals($shimFull, …) — the check can never throw) makes the suite exit 1: 35 PASS / 1 FAIL, failing precisely "Scoop smoke compares the resolved shim with the manifest target". Second discrimination: reverting the two Get-Item lines to [IO.Path]::GetFullPath (the e665a18 defect shape) exits 1 on "Scoop smoke resolves the shim path through the provider". Mutated copies were discarded after the run.
7. Composition against new main (f4d76f6d) — PASS. git log f854d5a9..origin/main is exactly f4d76f6 (#3277), and its diff-tree touches none of the three PR files (justfile, check-release-windows-verify.sh, its harness + fixtures), so the composition is a clean 3-file apply. In a scratch tree from git archive origin/main: git apply --check clean, applied, combined files hash-identical to the head blobs. Gates on the combined content:
- main's
scripts/check-release-windows-verify.sh→ exit 0: "4 version assertion(s) tolerate trimmed output", "portable ZIP directories match the loop: aarch64, x86_64", PASS — identical counts to the unpatched-main baseline (4), i.e. the new Scoop-leg lines add no unparseable pattern and leave rule-1/rule-2 intact; - the smoke fail-closed suite (PR version) on combined content → exit 0, 36 PASS / 0 FAIL (33 on unpatched main);
- main's
scripts/tests/check-release-windows-verify.test.shharness → exit 0, all cases; actionlinton the combined workflows → exit 0.
8. No new hardcoded host/environment values — PASS. The added lines introduce no URL, absolute path, $env: reference, runner username, or version literal; the only names are the manifest-declared bitty.com member (joined at release.yml:2641) and bitty#3224 comment references. The pre-existing cdn.bitty.run / get.scoop.sh lines are untouched by the hunks.
CI on this head
18 pass / 3 skip, including Windows check and test, which was still pending when the prior review was posted. The two workflow legs this PR changes execute only on a release tag, so CI here is static-suite coverage, not end-to-end — exactly the accepted-risk boundary below.
Prior review's (a)(b)(c) residuals — disposition
- (a)
scoop which/scoop prefixpair within one step — statically evidenced; accepted-risk. Run 44741426851 (job 136322523377, quoted in the PR body) proves the joint pair in the very step being patched: that step tookscoop prefix→ the$appComexistence check passed (the throw happened later, at the extension gate) andscoop whichreturned~\scoop\apps\bitty\current\bitty.com. The fix changes only how the two values are compared, not what Scoop prints, so what remains is run-to-run variance — settled by the next Windows leg. - (b)
Get-Item.FullNamekeepingcurrentunexpanded — statically sound; accepted-risk..FullNameis the path as accessed (no junction rewrite), and both sides containcurrent, so even a symmetric junction resolution would preserve equality;OrdinalIgnoreCaseabsorbs case differences. Asymmetric normalization has no known mechanism; only the Windows leg settles it end-to-end. - (c) Scoop reporting its own
…\shims\bitty.exewrapper — accepted-risk, and a deliberate tightening.scoop whichresolves through the shim to its target (its documented semantics; the observed run returned the.comtarget, not a wrapper). A future Scoop whosewhichreported the wrapper would now fail the equality — where the old allowlist would have waved the wrapper.exethrough. Failing there is the intended fail-closed direction.
Carried forward unchanged from the prior review (non-blocking, on record): the mismatch-message pin is fragment-only (not the manifest shim survives a message revert), and preview.yml's anchor is pinned by no static suite. Neither weakens the legs' fail-closed posture.
VERDICT: APPROVE
…s in the static gate (#3283) bitty#3281: the #3275/#3278 repairs fixed the newline-anchored version assertions in release.yml and preview.yml, but the static gate only parsed release.yml, so a fresh newline-anchored pattern in preview.yml would land with CI green. scripts/check-release-windows-verify.sh now scans BOTH workflows: - Rule 1 stays release-only (portable-ZIP lookup vs download paths). - Rule 2 runs per workflow: every \Abitty version/channel assertion must end in \s*\z with no mandatory newline before it; an assertion the scan cannot parse (here-string, non-assignment, unterminated) fails closed; a match operand no assignment defines fails closed; and a pattern DERIVED from another assertion variable ($proxyPattern = $pattern + ...) fails closed instead of passing as "some other variable". - A workflow without a single parseable version assertion is itself a failure, so the gate cannot pass vacuously on one clean file. - Both .github/workflows/release.yml and preview.yml must exist under the scanned root; a missing file is a hard failure. Fixtures: every fixture directory now carries both workflow files (release variants pair with the clean preview.yml copy and vice versa), plus a new preview family — preview-clean (pass), preview-newline, preview-here-string, preview-pattern-variable-name, preview-undefined-operand, preview-derived- pattern (all rule-2 rejects). The pre-change gate (mutant copy with the preview scan removed) accepts preview-newline; the suite driven by that mutant fails with five unexpected passes — the family discriminates. Also pins the Scoop shim-mismatch message by its resolved-path interpolation in check-release-smoke-fail-closed.test.sh, and states the both-workflow coverage in the justfile recipe comment.
…op E2E leg (#3280) The v0.0.46 post-release run (44741426851) installed Scoop's manifest, verified the hash, extracted the ZIP, linked `current`, and created the shim and shortcut, then failed the leg because `scoop which bitty` resolved to `~\scoop\apps\bitty\current\bitty.com` and the executor allowlist listed only `.exe`, `.cmd`, `.bat`, and `.ps1`. The channel and manifest are correct: `bucket/bitty.json` maps `bin: [["bitty.com", "bitty"]]`, so a bare `bitty` intentionally resolves to the console companion. The workflow-side acceptance — '.com' in the extension allowlist plus the resolved-shim binding to the installed app's `bitty.com` member — already landed on main via #3278, so this commit pins that acceptance instead of re-deriving it: rule 3 of the CTX-1916 static gate requires '.com' in the allowlist, both sides resolved through the provider, and the case-insensitive companion comparison, alongside the existing `scoop which bitty` and resolved-shim `--version` probes, and it fails closed when the post-release-smoke job, the Windows Scoop (R2) leg, or any of those pieces is missing. The pre-fix leg is pinned as the `scoop-shim` fixture: the gate must reject it with rule-3 naming the omitted '.com' and nothing else. The clean, correct-with-comment, and preview-clean fixtures carry the accepted leg so the fail-closed rule holds for every must-pass case, and every fixture directory keeps both workflow files per the CTX-1918 corpus shape. The v0.0.46 release itself is unaffected: this is a verification-script defect, not a packaging or publication failure.
Priority: P1 | Area: release | Labels: fix,P1,area:release | Milestone: v0.1.0 | RFC: none | Task: CTX-1916
Summary
Two surgical workflow fixes so Windows release verification stops failing a correct install:
release.yml — Post-release E2E,
Windows Scoop (R2)/Test installation from CDN (Windows):scoop which bittyresolves to~\scoop\apps\bitty\current\bitty.com, and the.COMconsole companion IS the intended shim (bitty#3224: the manifest deliberately shimsbitty.com, and a barebittymust resolve.COMfirst). The executable-shim allowlist[IO.Path]::GetExtension($shim) -notin @('.exe', '.cmd', '.bat', '.ps1')rejected it and threw. This adds'.com'to the allowlist, with a one-line comment referencing bitty#3224. Because'.com'alone would admit any console companion rather than the one the manifest declares, the leg now also asserts that the resolved shim equals the installed app'sbitty.commember ($appCom, already derived fromscoop prefix bitty). Both sides are resolved through the provider ((Get-Item -LiteralPath …).FullName), which expands Scoop's~\abbreviation, and compared case-insensitively.preview.yml —
smoke-windows: the version pattern'\Abitty ' + [regex]::Escape($env:BASE_VERSION) + ' \(preview [^\s()]+\)(?:\r\n|\n)\z'is newline-anchored. The direct exe capture (Out-String, keeps the newline) passes, but$viaProxyis.Trim()-ed and fails — issue [release] preview.yml smoke-windows: same newline-anchored version pattern as #3274 - bitty.com check fails on correct output #3276 documents this exact defect. This changes the tail to\)\s*\z, the class fix [CTX-1916] fix(release): repair the Windows release verification scripts #3275 already applied to release.yml's four assertion sites.Forensics
Release run 44741426851 (v0.0.46 re-run, head
f854d5a9) failed at exactly one step — Post-release E2E (Windows Scoop (R2)) / Test installation from CDN (Windows):#3276 evidence (preview.yml at origin/main):
:557$pattern = '\Abitty ' + [regex]::Escape($env:BASE_VERSION) + ' \(preview [^\s()]+\)(?:\r\n|\n)\z'— the tail anchor requires the newline.:554$output = (& $exe --version 2>&1 | Out-String)keeps the trailing newline, so the directbitty.execheck at:559passes.:564$viaProxy = ([string](& $com --version 2>&1 | Out-String)).Trim()strips it, and:566reuses the SAME$patternon the trimmed string — a correctbitty.com --versionoutput fails withbitty.com --version mismatch: '...'.Local evidence (worktree ctx-1916-cdn-preview, head
61dacdfe)bash scripts/tests/check-release-smoke-fail-closed.test.sh→ 36 PASS, exit 0, including the three new Scoop pins (provider resolution, case-insensitive comparison, mismatch message)bash scripts/check-release-windows-verify.sh→4 version assertion(s) tolerate trimmed output/portable ZIP directories match the loop: aarch64, x86_64/ PASSbash scripts/tests/check-release-windows-verify.test.sh→all cases passedactionlint 1.7.12 .github/workflows/release.yml .github/workflows/preview.yml→ clean, exit 0shfmt -d/shellcheck -S warningon the changed test script → exit 0pwshrun in a container; the host has nopwsh), feeding the same file first as Scoop'sscoop whichoutput and then as the rawscoop prefixtarget:grep -nF '(?:\r\n|\n)\z' .github/workflows/release.yml .github/workflows/preview.yml→ no matches (exit 1): no remaining newline-anchored version tails. Pre-edit the same search hit exactly one line — preview.yml:557, fixed by this PR.Out of scope (deliberately untouched)
scripts/check-release-windows-verify.sh,scripts/tests/**and its fixtures,.github/workflows/ci.yml— PR [CTX-1916] fix(release): derive ZIP gate from the loop lookup and reject newline suffixes #3277's lane, which excludespreview.yml. [release] preview.yml smoke-windows: same newline-anchored version pattern as #3274 - bitty.com check fails on correct output #3276's guard-coverage ask (extend the static gate to preview.yml) is tracked separately as [release] Guard the preview workflow version assertions in PR CI #3281.Part of #3276; the guard-coverage half is #3281