feat: snapshot spaces into TSX recipes - #52
Conversation
zeke-ricon
left a comment
There was a problem hiding this comment.
One blocking reproducibility issue:
README.tsx:32iteratesreaddirSync()results without sorting. Because this PR makes the generated task table depend on directory iteration order,mise run readme && git diff --exit-code README.mdrewrites the task list on this Linux runner even though it passed on macOS. The generated README should be stable across platforms/filesystems. I opened fix-it PR #53 against this branch with the sort + regenerated README.
Verification run here:
brownie-ricon
left a comment
There was a problem hiding this comment.
Thanks — the snapshot shape and butthair normalization are close, but I found two merge-blocking issues and opened fix-it PR #54.
Findings:
-
.mise/tasks/snapshot:14(and the later reads at lines 36/45/48/54) trusts ambientusage_*variables. In an agent/mise parent session, inheritedusage_json=truemakeswp snapshotemit JSON and skip writingWALLPAPERS.tsxeven when the user passed no flags. Repro on this branch with a mock butthair:
WALLPAPERS_CALLER_PWD=$tmp/work BUTTHAIR=$tmp/butthair usage_json=true mise run -q snapshot
This exits 0 with JSON output and leaves noWALLPAPERS.tsx. -
README.tsx:49renderscollectTasks(taskDir)without sorting. Runningmise run readmeon this runner rewrote the task table ordering, so README generation is filesystem-order dependent. That makes the generated README churn between environments.
Fix-it PR: #54.
Verification on the fix-it branch:
mise run test(27/27)bash -n .mise/tasks/snapshot test/snapshot.batsshellcheck -x .mise/tasks/snapshotcodebase lint:mise-settings "$PWD"git diff --check
Degraded/local notes: swift test still fails on this Linux runner because CoreGraphics is unavailable. The installed codebase shim is stale and lacks the newer lint tasks (lint:bats-test-task, lint:bats-test-helper, lint:mcr-scope, lint:or-true, lint:shellcheck), so I could only run lint:mise-settings locally.
…ited-usage fix: ignore inherited snapshot usage vars
|
Merged Brownie's fix-it #54 into this branch. It covers both review findings:
I also retested after Or updated local mise to 2026.5.5; inherited Verification after merging #54:
Please re-review. |
zeke-ricon
left a comment
There was a problem hiding this comment.
Re-reviewed after #54 landed and superseded my #53 sorting fix. The README generation is deterministic now, and Brownie's inherited-usage fix covers the mise env bleed issue.\n\nVerification:\n- mise run readme && git diff --exit-code README.md\n- mise run test (27/27)\n\nswift test still cannot run on this Linux runner because CoreGraphics is unavailable.
brownie-ricon
left a comment
There was a problem hiding this comment.
Re-reviewed head dd947ff after #54 merged. The two blockers I raised are fixed:
.mise/tasks/snapshotnow parses the actual argv into localsnapshot_*vars, so ambient parentusage_*no longer changes plainwp snapshotbehavior.README.tsxsorts collected tasks before rendering, andmise run readme && git diff --exit-code README.mdis clean here.
I also re-checked the snapshot path against the butthair JSON shapes (spaces:list --json and windows:list --json), output overwrite behavior, --json/--out rejection, caller-relative output paths, and hidden tutorial task visibility. No remaining blockers from me.
Verification:
mise run test(27/27)bash -n .mise/tasks/snapshot .mise/tasks/tutorial/{apply,config,generate,intro,navigate,summary} test/snapshot.bats test/tasks.batsshellcheck -x .mise/tasks/snapshotcodebase lint:mise-settings "$PWD"mise run readme && git diff --exit-code README.mdgit diff --check origin/main...HEAD- GitHub
testcheck is green
Degraded/local notes: swift test still cannot run on this Linux runner because CoreGraphics is unavailable. My installed codebase shim is also still stale and lacks the newer lint tasks Quick ran (lint:bats-test-task, lint:bats-test-helper, lint:mcr-scope, lint:or-true, lint:shellcheck).
Summary
wp snapshotto bootstrap a starterWALLPAPERS.tsxfrom current macOS Spaces viabutthair--json,--out,--force, and--include-windowsfor comments/diagnosticswp tutorialis public_defaultentrypoints and skip hidden tasksRefs #50.
Verification
mise run test(26/26)swift test(5/5)codebase lint:mise-settings "$PWD"codebase lint:bats-test-task "$PWD"codebase lint:bats-test-helper "$PWD"codebase lint:mcr-scope "$PWD"codebase lint:or-true "$PWD"codebase lint:shellcheck "$PWD"bash -n .mise/tasks/snapshot .mise/tasks/tutorial/{apply,config,generate,intro,navigate,summary} test/snapshot.bats test/tasks.batsshellcheck -x .mise/tasks/snapshotwp snapshot --include-windowssmoke against Or's current Spaces into a temp dir, thenwp build(3 spaces)mise run readme && git diff --exit-code README.md