Scripts: hash the game folder name on the smoke block's title line #1472

Closed
ORKHANALIYEV27 wants to merge 1 commit from upstream-pr/1482 into main
ORKHANALIYEV27 commented 2026-11-24 16:47:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ORKHANALIYEV27 on 2026-11-24T16:47:23Z.


Scripts: hash the game folder name on the smoke block's title line

Fixes #677. scripts/smoke.ps1 printed the game folder's name on the title: line
of every xcl-smoke block, which leaked retail title names (and scene release tags)
into public PR descriptions. Print the first 8 hex chars of SHA-256 of the folder's
leaf name (lowercased) instead. Add an optional -Title <label> parameter for a
readable label.

What is in it

  • scripts/smoke.ps1: hash-based title label; new -Title parameter; updated usage comment

Tested

  • PowerShell parser check on the modified script
  • Hash computation verified against SHA-256 of a sample folder name

Not tested

  • End-to-end run of smoke.ps1 (no release build / title available in this environment)

AI use

  • Claude Code (Beam) wrote the change and this description
<!-- greyfinch-sync:ivall/xcl:issue:6586864528 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1482). Originally posted by [ORKHANALIYEV27](https://github.com/ORKHANALIYEV27) on 2026-11-24T16:47:23Z. --- Scripts: hash the game folder name on the smoke block's title line Fixes #677. `scripts/smoke.ps1` printed the game folder's name on the `title:` line of every `xcl-smoke` block, which leaked retail title names (and scene release tags) into public PR descriptions. Print the first 8 hex chars of SHA-256 of the folder's leaf name (lowercased) instead. Add an optional `-Title <label>` parameter for a readable label. **What is in it** - `scripts/smoke.ps1`: hash-based title label; new `-Title` parameter; updated usage comment **Tested** - PowerShell parser check on the modified script - Hash computation verified against SHA-256 of a sample folder name **Not tested** - End-to-end run of `smoke.ps1` (no release build / title available in this environment) **AI use** - Claude Code (Beam) wrote the change and this description
gut0to commented 2026-11-24 19:05:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:51:18Z.

Review: COMMENTED


AI-assisted review; I checked the label construction and the stated privacy goal.

<!-- greyfinch-sync:ivall/xcl:review:6045359003 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1482#pullrequestreview-6045359003). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T18:51:18Z. **Review:** COMMENTED --- AI-assisted review; I checked the label construction and the stated privacy goal.
DavidM1911 commented 2026-11-24 19:07:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:53:24Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7141294497 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1482#issuecomment-7141294497). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:53:24Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
gut0to commented 2026-11-24 19:08:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:51:18Z.

Code review location: scripts/smoke.ps1; line 32

@@ -17,6 +18,23 @@ $root = Split-Path $PSScriptRoot -Parent
 $commit = (git -C $root rev-parse HEAD).Trim()
 $dirty = [bool](git -C $root status --porcelain --untracked-files=no -- crates Cargo.toml Cargo.lock)
 
+# Print a stable, non-identifying label for the title instead of its folder name
+# (issue #677): folder names leak the retail title. A caller may pass -Title to
+# use a readable label of their own.
+if ($Title) {
+    $titleLabel = $Title
+} else {
+    $leaf = Split-Path $Game -Leaf
+    $sha = [System.Security.Cryptography.SHA256]::Create()
+    try {
+        $bytes = [System.Text.Encoding]::UTF8.GetBytes($leaf.ToLowerInvariant())
+        $hash = $sha.ComputeHash($bytes)
+        $titleLabel = ([BitConverter]::ToString($hash) -replace '-', '').Substring(0, 8).ToLowerInvariant()

This is deterministic, unsalted, and only 32 bits, so a public smoke block can be matched against a dictionary of likely retail folder names and release tags. That makes the default label identifying despite the comment calling it non-identifying. Could the script emit a neutral label by default and leave readable labels to the explicit -Title option, or use a per-user secret mapping? AI-assisted review; I verified the hash input and truncation.

<!-- greyfinch-sync:ivall/xcl:review-comment:4684935595 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1482#discussion_r4684935595). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T18:51:18Z. **Code review location:** `scripts/smoke.ps1`; line 32 ~~~~diff @@ -17,6 +18,23 @@ $root = Split-Path $PSScriptRoot -Parent $commit = (git -C $root rev-parse HEAD).Trim() $dirty = [bool](git -C $root status --porcelain --untracked-files=no -- crates Cargo.toml Cargo.lock) +# Print a stable, non-identifying label for the title instead of its folder name +# (issue #677): folder names leak the retail title. A caller may pass -Title to +# use a readable label of their own. +if ($Title) { + $titleLabel = $Title +} else { + $leaf = Split-Path $Game -Leaf + $sha = [System.Security.Cryptography.SHA256]::Create() + try { + $bytes = [System.Text.Encoding]::UTF8.GetBytes($leaf.ToLowerInvariant()) + $hash = $sha.ComputeHash($bytes) + $titleLabel = ([BitConverter]::ToString($hash) -replace '-', '').Substring(0, 8).ToLowerInvariant() ~~~~ --- This is deterministic, unsalted, and only 32 bits, so a public smoke block can be matched against a dictionary of likely retail folder names and release tags. That makes the default label identifying despite the comment calling it non-identifying. Could the script emit a neutral label by default and leave readable labels to the explicit `-Title` option, or use a per-user secret mapping? AI-assisted review; I verified the hash input and truncation.
upstream-sync closed this pull request 2026-11-24 21:06:13 +00:00
ivall commented 2026-11-24 21:09:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T20:50:07Z.


Closing this as a duplicate of #689 (group D15 in #1607): both print a hash of the game folder's name on the title: line and add -Title, and only one can land. #689 was opened first, validates the label, has a test and both checks green.

This says nothing about the quality of the code here. If this PR covers a case the other one does not, or #689 is closed without being merged, say so and I'll reopen it.

Thank you for the work.

AI use: Claude Code (Claude Opus 5.5) read the diffs and the checks in #1607 and wrote this comment, on the maintainer's behalf.

<!-- greyfinch-sync:ivall/xcl:comment:7144119174 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1482#issuecomment-7144119174). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T20:50:07Z. --- Closing this as a duplicate of #689 (group D15 in #1607): both print a hash of the game folder's name on the `title:` line and add `-Title`, and only one can land. #689 was opened first, validates the label, has a test and both checks green. This says nothing about the quality of the code here. If this PR covers a case the other one does not, or #689 is closed without being merged, say so and I'll reopen it. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) read the diffs and the checks in #1607 and wrote this comment, on the maintainer's behalf.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1472
No description provided.