Skip to content

refactor(gaming): simplify the first half of Invoke-Dlss5Mod.ps1 - #15158

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14467-42880201607-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14467-42880201607-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14467

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified functions that start in lines 1-1161 of Invoke-Dlss5Mod.ps1 (range 1 of 2, file measured at 2323 lines), with no behavior change. A new ShortHash helper replaces the three inline SHA-256 hex-prefix expressions in GameKey, Get-AntiCheat (reviewId) and Get-GameUpdate (token). Init-Paths resolves -RuntimeDll once instead of twice, Find-AntiCheat runs one recursive scan call with the root picked by the Steam match instead of two copies, Get-AntiCheat builds the 'AreWeAntiCheatYet (commit <sha7>)' label once, and Edit-Ini assigns $hadBom straight from its condition. Design basis: each edit keeps the same inputs, strings and call order, so outputs, thrown messages, hashes and written files stay identical; a fresh-context review confirmed this against PowerShell 7 semantics and the in-file selftest's expected strings. One theoretical difference: $sha.Substring(0, 7) now runs on every successful AreWeAntiCheatYet fetch rather than only when a message is built. It could only throw if the GitHub API returned a non-string 40-digit SHA, and that throw would land in the same catch.

Not verified

  • The script's own selftest verb (pwsh Invoke-Dlss5Mod.ps1 -Verb selftest) and any Windows-only PowerShell test run: the lane can run no interpreter, so they are left to the PR's CI
  • PowerShell lint (PSScriptAnalyzer) on the touched file: no interpreter in this lane; left to the PR's CI
  • tidy: skipped the docs-hygiene write-for-humans pass on the changelog fragment because the issue fixes its body text verbatim. The ai-slop pass got a rubric read only, since the lane cannot run detect.sh; it found no tells
  • ci-status green on the PR: a PR CI check this run cannot observe
  • Untracked dotfiles at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were not created by this run and are not part of the change; they look like sandbox mount placeholders

Fix

  • plugins/gaming/skills/dlss5/scripts/Invoke-Dlss5Mod.ps1: added ShortHash and used it in GameKey, Get-AntiCheat and Get-GameUpdate; Init-Paths resolves RuntimeDll once; Find-AntiCheat runs a single scan call; Get-AntiCheat reuses one $awacy label; Edit-Ini assigns $hadBom directly
  • .changes/gaming/work-resolve-issue-issue-14467-42880201607-1-96078874.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 21770cb:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 3 fragments under .changes/ valid (run before and after tidy)
  • check-changed-skills: dlss5 PASS, 0 errors, 4 pre-existing warnings about SKILL.md size and history citations, none from this change
  • check-affected: 12 passed, 7 skipped, over 2 changed files
  • fresh-context review subagent over the whole diff: no behavior-changing defects; one non-blocking note about the Substring call now running earlier (see summary)
  • tidy-diff passes 1-3 (simplify, comment triage, generated-code residue) over the changed code lines: no further edits
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42880201607

Left out: the items under Not verified.

Related

#14467

Merge-Risk: max=MEDIUM demote=false head=21770cb251421dc108d18e48f7c3863bbc2ad638 rubric=8.3.5 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 21770cb251421dc108d18e48f7c3863bbc2ad638: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15158 (head 21770cb)

I found no security issues.

I read every hunk of both changed files. Neither matches a trusted-path glob. The diff touches no plugin manifest, workflow, trust control, merge hold or instruction surface.

  • .changes/gaming/…96078874.md: a new changelog fragment (bump: patch) with prose only.
  • plugins/gaming/skills/dlss5/scripts/Invoke-Dlss5Mod.ps1: a refactor that keeps behavior the same. The checks that matter for security:
    • Hashing: the new ShortHash helper returns the same SHA-256 hex prefix as the three inline expressions it replaces. It takes the same input strings ($root.ToLowerInvariant(), $fp, $seen -join "\n") and keeps the same lengths (8, 12 and 12). So the state-dir keys, the anti-cheat reviewId and the remove -ConfirmRefresh token are unchanged, and the confirmation-token gate stays as it was.
    • Anti-cheat scan: Find-AntiCheat still scans the same roots. That is $Matches[1] on a Steam path, and otherwise the exe root plus up to four parent levels, stopping at the drive root. -ErrorVariable err is still attached only to the recursive call, so an unreadable folder still lands in $script:AcScanGaps and the status still fails toward unknown. The check that keeps the mod out of games with anti-cheat is not weakened.
    • AreWeAntiCheatYet label: building the $awacy label once leaves the message strings the same. The earlier $sha.Substring(0, 7) call is inside the existing try, so a malformed SHA still reaches the same catch, which marks the source unknown. It does not fail open.
    • Other edits: Init-Paths (resolving RuntimeDll once) and Edit-Ini ($hadBom) are local simplifications that don't change any path, file write or trust decision.

No text in the PR description tells the review lane to do anything.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 21770cb251421dc108d18e48f7c3863bbc2ad638: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #15158, a refactor of Invoke-Dlss5Mod.ps1 (part 1 of 2)

No findings. I read every hunk of both changed files. I checked each edit against the base code to see whether behavior could change. I did not run the selftest, PSScriptAnalyzer or CI, because this lane has no interpreter. Every check the PR describes is the author's claim and I have not confirmed it.

Each edit, checked against the base code

  • ShortHash (Invoke-Dlss5Mod.ps1:172): it runs the same SHA-256 → hex → Substring(0,$n) → lowercase chain as before. All three callers pass a string, so the [string] parameter changes nothing:

    • $root.ToLowerInvariant()
    • the $fp built with -join
    • $seen -join "n"`

    The 8-digit and 12-digit lengths are unchanged, so state-dir keys, reviewId and the -ConfirmRefresh token come out the same.

  • Init-Paths: Resolve-PathOpt has no side effects. It is a pure path normalization (:127-132), so calling it once instead of twice gives the same result.

  • Find-AntiCheat (:226-242):

    • $Matches still comes from the Steam -match, because nothing else runs a match before $Matches[1] is read.
    • @() and $() create no new scope, so -ErrorVariable err still fills the function's $err.
    • break still leaves only the for loop.
    • The parent-directory listings still pass no -ErrorVariable, as before.
    • $items is now always an array, but it is only consumed through @($items | ...), so the output is the same.
  • $awacy label in Get-AntiCheat:

    • "${awacy}:" is braced correctly, so it is not read as a scope-qualified variable.
    • The name collides with no other variable; awacy = at :644 is a hashtable key.
    • $sha is checked against a 40-hex-digit pattern (:599) before Substring(0,7) runs, so moving that call earlier cannot throw on input that passes the check. Any throw would still land in the same catch.
  • Edit-Ini $hadBom: assigning it straight from the -and chain gives the same boolean.

Closing issue #14467: acceptance criteria

  • Behavior unchanged: met, from my reading. The in-file selftest guards hashes and messages (author-claimed; I did not run it).
  • Diff touches only the listed file and a fragment: met.
  • ≤400 lines / ≤15 files: met.
  • Fragment is bump: patch, ### Changed, with the line "Internal simplification, no behavior change.": met.
  • Only functions that start in range 1 of 2 changed: met. Every function touched starts before base line ~1161; the last one, Get-GameUpdate, starts near line 993.
  • ci-status green: not observable from this lane.

Rules and standards

  • .claude/rules/skill-bodies-state-current-rules.md: its glob matches this path, but its criteria cover skill and agent body text. This change edits only script code and restates no upstream specific, so it does not apply.
  • Paved paths: none resolved.
  • Embedded instructions: none found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 21770cb251421dc108d18e48f7c3863bbc2ad638, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 21770cb

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15158-21770cb251421dc108d18e48f7c3863bbc2ad638, expires on 2026-12-10.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 5c1613a Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14467-42880201607-1 branch November 10, 2026 20:28
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 5c1613ab02ae3249b00884a40f04fae2a8885c74; later checks count it verified from this comment.

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.

Simplify the Invoke-Dlss5Mod.ps1 gaming plugin code (part 1 of 2)

0 participants