test(installer): the PowerShell sanitiser's SS3 + floor behaviour had no test - #743
Merged
Merged
Conversation
… no test #736 extended ConvertTo-SanitizedInput with the SS3 family and the unknown-family floor, and shipped both with zero PowerShell coverage. The four cases in that Describe block are all CSI, so on Windows the entire SS3 half and the whole floor were unverified while bash and Go both had cases. That asymmetry is the mechanism behind the bug it was fixing. The rule is hand-copied into three languages, only one shape was ever tested in one of them, and SS3 went missing from all three at once (tracebloc/cli#516) — exactly as the CSI gap had before it (cli#364 / client#362). A rule with coverage in two of three implementations is a rule that drifts in the third. Eight It blocks, mirroring the bats corpus in install-client-helm.bats case-for-case: SS3 around content, SS3-only (arrows, Home/End, F1/F2) to empty, SS3+CSI mixed, a bare O is not an escape, truncated ESC O, the unknown family alone and beside content, and the floor counting non-Latin letters as content. The non-Latin case is asserted as a PAIR with the ASCII one. Either alone proves nothing: the point is that keep-vs-reject does not depend on the script a name is written in (Bugbot, #736), and only the two together say that. Mutation-proven, each anchor confirmed to apply, 12 cases in the block: drop SS3 from the strip (the cli#516 bug) -> 2 fail remove the floor entirely -> 2 fail floor uses [A-Za-z] instead of \p{L} -> 1 fail match O<final> without requiring ESC -> 4 fail Full Pester suite: 671 passed, 0 failed, 13 skipped. This is backend#2084's carved-out sub-task, not the ticket. The structural half — one corpus file all three suites derive from, with a cross-repo drift check — is untouched here, and deliberately: a fixture wired into two of the three implementations is the same defect wearing a different hat. Refs backend#2084
aptracebloc
approved these changes
Aug 19, 2026
Contributor
Author
|
/fr-pass Best-effort functional review passed (triage: merged clean, non-interactive; behavioral evidence limited while e2e journey is red — backend#2206). Advancing to Ready for prod. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs tracebloc/backend#2084 — its carved-out sub-task, not the ticket itself.
The gap
client#736 extended
ConvertTo-SanitizedInputwith the SS3 family (ESC O <final>) and the unknown-family floor, and shipped both with zero PowerShell coverage. The four cases in thatDescribeblock are all CSI — so on Windows the entire SS3 half and the whole floor were unverified, while the bash and Go copies each had cases.That asymmetry is the mechanism behind the bug #736 was fixing. The rule is hand-copied into three languages; only one shape was ever tested in one of them; SS3 went missing from all three at once (tracebloc/cli#516) — exactly as the CSI gap had before it (cli#364 / client#362). A rule covered in two of three implementations is a rule that drifts in the third.
What's here
Eight
Itblocks, mirroring the bats corpus ininstall-client-helm.batscase-for-case:Ois not an escape (OPTIMUS-01survives)ESC Owith no final byte → emptyESC N, SS2 — deliberately not in the strip list) alone → refusedThe non-Latin case is asserted as a pair with the ASCII one. Either alone proves nothing: the point is that keep-vs-reject must not depend on the script a name is written in (Bugbot, #736), and only the two together say that.
Mutation-proven
Each anchor confirmed to apply, against the 12 cases in the block:
[A-Za-z]instead of\p{L}O<final>without requiring ESC (the obvious wrong fix)Full Pester suite: 671 passed, 0 failed, 13 skipped.
gen-manifest.sh --checkpasses (test-only change, no lib touched).What this deliberately does not do
backend#2084's structural half — one canonical corpus file that all three suites derive from, plus a cross-repo drift check — is untouched. Splitting it out was the point: a fixture wired into two of the three implementations is the same defect wearing a different hat, and the corpus genuinely spans two repos, so it needs a vendoring + fail-closed drift mechanism (
scripts/tests/check-drift.shis the shape) rather than being tacked onto a test PR.Until that lands, matching case lists across the three suites are the only thing making them comparable by reading — hence mirroring the bats corpus one-for-one rather than inventing a different set here.
🤖 Generated with Claude Code
Note
Low Risk
Test-only change with no production code touched; risk is limited to CI/test maintenance.
Overview
Adds eight Pester cases to the
ConvertTo-SanitizedInputDescribeininstall-k8s.Tests.ps1, filling a gap where only CSI-shaped inputs were tested after #736.The new tests align with the bats corpus in
install-client-helm.bats: SS3 stripping and SS3-only → empty (re-prompt contract), mixed SS3/CSI,OPTIMUS-01surviving (no bare-Ofalse match), truncatedESC O, unknown escape family (SS2) refused vs content preserved, and non-Latin + ASCII pairs for the floor’s\p{L}rule.No changes to
ConvertTo-SanitizedInputor other libs—test-only.Reviewed by Cursor Bugbot for commit d7f8b5c. Bugbot is set up for automated code reviews on this repo. Configure here.