Skip to content

refactor(pixel-art): simplify the campfire, tileset, vfx and walker example code - #15076

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14668

Summary

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

Simplified four of the five listed pixel-art examples without changing what they write or print. hero_mz.py now looks up palette letters with a reverse dict instead of a linear search per color, takes the first outline neighbor lazily, and folds the repeated direction tuple and torso widths into one place each. a2_ground.py and spark_mz.py build rows and frames with comprehensions; spark_mz also computes the squared radii once per frame and uses SIZE // 2 for the center instead of a literal 96. blacksmith.py builds RAMPS in one dict literal, with the same key order. window_mz.py was left unchanged: it is already a straight list of region fills, and removing the clipping in fill() or blank() would change its exported helpers.

Not verified

  • pixel-art Python tests (scripts/test_examples.py, test_kit.py, test_capture.py) and a byte-for-byte compare of the written JSON were not run here: this lane cannot run Python. Left to the PR's CI.
  • tidy: passes 4-5 (docs-hygiene and ai-slop) not run on the changelog fragment, whose single line is the exact text the issue requires; passes 1-3 ran and changed nothing
  • plugins/pixel-art/examples/ui/window_mz.py left unchanged: no simplification found that keeps its exported helpers (blank, fill with clipping, text_hex) and output identical
  • Untracked runner files at the checkout root (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were not created by this run and are not part of the change

Fix

  • plugins/pixel-art/examples/campfire/hero_mz.py: reverse color->key dict replaces the per-color linear palette search; lazy first-neighbor lookup in to_rows; bob = abs(step); one (tx, tw) pair for the torso; directions tuple shared by the frame loop and animations; right-facing frame drawn as…
  • plugins/pixel-art/examples/tileset/a2_ground.py: per-pixel helper pixel(); block() and build() written as comprehensions
  • plugins/pixel-art/examples/vfx/spark_mz.py: squared core and rim radii computed once per frame; center from SIZE // 2; frame() and build() written as comprehensions
  • plugins/pixel-art/examples/walker/blacksmith.py: RAMPS as one dict literal over kit.DEFAULT_RAMPS (same key order, hair keeps its position); build() returns the Walker spec directly
  • .changes/pixel-art/work-resolve-issue-issue-14668-42795344225-1-d34e66d7.md: patch fragment, ### Changed, 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against e65a11f:

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

The run reports:

  • check-changelog-fragments: all 1 fragment valid (run before and after tidy)
  • check-changed-skills: no changed skills, nothing to gate (run before and after tidy)
  • check-affected: 13 passed, 6 skipped (none failed) over 5 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: no correctness bugs; confirmed identical palette and RAMPS key order, abs(step) equals the old bob for every step draw() receives (-1, 0, 1), filter/next returns the same first truthy neighbor, spark center 96 and squared radii unchanged, frame…
  • code-tidying:tidy-diff over the 17 changed hunks: no further edits; the one comment in a listed line (hero_mz.py bottom-heavy rationale) kept as load-bearing
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42795344225

Left out: the items under Not verified.

Related

#14668

Merge-Risk: max=MEDIUM demote=false head=e65a11f501971dfbe8840536517abd95084061a4 rubric=8.3.3 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 e65a11f501971dfbe8840536517abd95084061a4: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15076

I found no security issues. The change has no security-relevant surface, so skip gate 2 applies.

I read every hunk of all 5 changed files:

  • The four example scripts (plugins/pixel-art/examples/campfire/hero_mz.py, tileset/a2_ground.py, vfx/spark_mz.py, walker/blacksmith.py): the changes are local refactors of offline pixel-art generators. They add comprehensions, a reverse lookup dict, a shared directions tuple and a dict-literal RAMPS. None of them adds or changes:
    • input handling or file paths;
    • subprocess calls, network access or credentials.
  • .changes/pixel-art/...md: a patch-bump changelog fragment containing only prose.

Other checks:

  • Trusted paths: none of the changed files matches one.
  • Trust controls: nothing touches trust controls, merge holds, workflows, plugin manifests or standing instructions.
  • PR context: contains no embedded instructions aimed at this lane.
  • Spend: none beyond this review run.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15076, refactor(pixel-art) example simplification

No findings. I read every hunk of all 5 changed files. I checked each rewrite against the base code by reading it, not by running it: this lane has no shell. CI runs the tests.

Checks on whether behavior stays the same

  • hero_mz.py
    • Outline neighbor: next(filter(None, ...), None) returns the same first non-None neighbor, in the same order, that nb[0] returned. if nb: still works because materials are non-empty strings.
    • bob = abs(step): this equals the old 0 if step == 0 else 1 for every step build() passes (-1, 0, 1).
    • Palette: key_of maps each color to its letter, and colors are added in the order they first appear. So palette = {key: color ...} gives the same letters, in the same insertion order, as the old search over palette.values(). Each char_of entry also gets the same letter.
    • Right-facing frames: draw("left", step).mirrored() matches the old src/mirrored path.
    • Torso: the (tx, tw) pair is unchanged.
  • a2_ground.py: the new module-level pixel() holds the same branches as before. Frame names and their order are unchanged. Adding a name does not change any existing exported name.
  • spark_mz.py: SIZE // 2 is 96 because SIZE = 192. max(2, radius // 3) ** 2 equals core * core. Zipping order with CELLS keeps the frame-to-cell pairing.
  • blacksmith.py: kit.DEFAULT_RAMPS is a dict (kit.py#L37), so ** unpacking works. hair is overridden where it already sits and apron is added at the end. Key order is the same as with the old assignments.

Closing issue #14668 acceptance criteria

  • Behavior unchanged: met, as far as reading the code shows. Existing tests could fail if it broke:
    • test_examples.py checks pixels in a2_ground and spark_mz and compares their rendered output across backends byte for byte.
    • test_kit.py builds the blacksmith sheet.
    • test_capture.py runs hero_mz.py.
  • Only listed files plus a fragment edited: met. window_mz.py was left alone, which is allowed.
  • Within 400 lines and 15 files: met.
  • Changelog fragment: met. It has bump: patch, ### Changed, and the exact line the issue requires.
  • ci-status green: not known from this lane.

The PR body says tests and a byte-for-byte JSON compare were not run. Its verification list (check-affected, the subagent review) is the author's claim and I have not confirmed it.

Other checks

  • No plugin manifest changed, so there are no manifest checks.
  • None of the changed files match a trusted path.
  • The PR text contains no embedded instructions.
  • This was a full review, not blocking-only: there were no prior findings and no earlier heads.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for e65a11f

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-15076-e65a11f501971dfbe8840536517abd95084061a4, 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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@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 ffa99a3 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14668-42795344225-1 branch November 10, 2026 12:37
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 1, survived 6, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 14%; mutation score 14%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/pixel-art/examples/campfire/hero_mz.py 1 3 0 0 0 0
plugins/pixel-art/examples/tileset/a2_ground.py 0 1 0 0 0 0
plugins/pixel-art/examples/vfx/spark_mz.py 0 1 0 0 0 0
plugins/pixel-art/examples/walker/blacksmith.py 0 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/pixel-art/examples/campfire/hero_mz.py:85 other productive no-assertion
plugins/pixel-art/examples/campfire/hero_mz.py:68 other productive no-assertion
plugins/pixel-art/examples/campfire/hero_mz.py:151 ROR productive no-assertion
plugins/pixel-art/examples/tileset/a2_ground.py:28 ROR productive no-assertion
plugins/pixel-art/examples/vfx/spark_mz.py:24 ROR productive input-gap
plugins/pixel-art/examples/walker/blacksmith.py:20 SBR productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit ffa99a31bba9226aee3c8efd459c0bed623fd569; 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 campfire, tileset, ui and 2 more pixel-art plugin code

0 participants