Skip to content

test(installer): the PowerShell sanitiser's SS3 + floor behaviour had no test - #743

Merged
LukasWodka merged 1 commit into
developfrom
test/2084-ps-ss3-floor-cases
Aug 19, 2026
Merged

test(installer): the PowerShell sanitiser's SS3 + floor behaviour had no test#743
LukasWodka merged 1 commit into
developfrom
test/2084-ps-ss3-floor-cases

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Refs tracebloc/backend#2084 — its carved-out sub-task, not the ticket itself.

The gap

client#736 extended ConvertTo-SanitizedInput with the SS3 family (ESC O <final>) 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 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 It blocks, mirroring the bats corpus in install-client-helm.bats case-for-case:

  • SS3 around real content → stripped
  • SS3-only (arrows, Home/End, F1/F2) → empty, so the caller re-prompts
  • SS3 + CSI mixed in one value
  • a bare O is not an escape (OPTIMUS-01 survives)
  • truncated ESC O with no final byte → empty
  • an unknown family (ESC N, SS2 — deliberately not in the strip list) alone → refused
  • the same family beside content → content kept
  • the floor counts 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 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:

mutation reddens
drop SS3 from the strip (the cli#516 bug itself) 2
remove the floor entirely 2
floor uses [A-Za-z] instead of \p{L} 1
match O<final> without requiring ESC (the obvious wrong fix) 4

Full Pester suite: 671 passed, 0 failed, 13 skipped. gen-manifest.sh --check passes (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.sh is 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-SanitizedInput Describe in install-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-01 surviving (no bare-O false match), truncated ESC 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-SanitizedInput or other libs—test-only.

Reviewed by Cursor Bugbot for commit d7f8b5c. Bugbot is set up for automated code reviews on this repo. Configure here.

… 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
@LukasWodka LukasWodka self-assigned this Aug 17, 2026
@LukasWodka
LukasWodka requested a review from aptracebloc August 19, 2026 09:57
@LukasWodka
LukasWodka merged commit b7894f9 into develop Aug 19, 2026
39 of 40 checks passed
@LukasWodka
LukasWodka deleted the test/2084-ps-ss3-floor-cases branch August 19, 2026 11:36
@LukasWodka

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants