Repository navigation
Description
This was generated by AI during work-loop execution.
Context
#1510 ("ci: enable staged shell-portability-lint classes") enables two of the three STAGED
shell-portability-lint classes (date -d, stat -c), fixing/annotating every corpus site each
touches. mktemp -p was deliberately left STAGED in that PR: unlike the other two classes, its
corpus (~24 files, ~56 call sites — scripts/shell-portability-tokens.txt's original "roughly 20
sites" estimate undercounted call sites vs. files) is all shared hook-test scaffolding across ~13
different plugins, none with a BSD-portable counterpart today (BSD mktemp has no -p). Migrating
it is a real, mechanical effort that touches every one of those plugins' release surface (a
plugin.json version bump + CHANGELOG entry per touched plugin under this repo's convention) — out
of scope for #1510's PR, which stays to check-shell-portability.sh/shell-portability-tokens.txt
plus the two dual-dialect script fixes.
Proposed work
- Migrate each
mktemp -p "$DIR" prefix.XXXXXXsite to the portable
mktemp "$DIR/prefix.XXXXXX"form (works identically on GNU and BSD mktemp — the directory rides
in the template instead of the-pflag). - Migrate each
mktemp -d -p "$DIR" prefix.XXXXXXsite tomktemp -d "$DIR/prefix.XXXXXX". - Migrate each bare
mktemp -p "$DIR"(no explicit template) site to an explicit-template form,
e.g.mktemp "$DIR/tmp.XXXXXXXXXX"— do not rely on TMPDIR-inheritance semantics, which differ
between GNU and BSD mktemp when no template is given. - Uncomment the
mktemp -ptoken inscripts/shell-portability-tokens.txt's ACTIVE section once
the corpus is clean, and update the STAGED section comment to drop the now-resolved entry. - Run
scripts/check-shell-portability.sh --allafter uncommenting and confirm it is clean (or
every remaining hit carries a reviewedportability-ok:). - Bump
plugin.json's version and add a CHANGELOG entry for every plugin whose test-scaffolding
files are touched.
Acceptance criteria
- Every
mktemp -p/mktemp -d -pcall site in the corpus (enumerate fresh via
grep -rn "mktemp[^\n]*-p" --include="*.sh"at execution time — the count above is a
snapshot, not a fixed list) is migrated to a portable form, or carries a reviewed
portability-ok:annotation with a stated reason. - The
mktemp -ptoken inscripts/shell-portability-tokens.txtis uncommented (moved to the
ACTIVE section). -
scripts/check-shell-portability.sh --allexits 0 against the full repo. -
bash scripts/check-shell-portability.test.shstill passes (the staged-classes-inactive test
at the bottom of that suite needs updating once all three classes are active). - Every touched plugin's
plugin.jsonversion is bumped with a matching CHANGELOG entry.
References
- ci: enable staged shell-portability-lint classes (date -d, stat -c, mktemp -p) #1510 — enables the sibling
date -d/stat -cclasses; leavesmktemp -pstaged for this item. - ci: no gate covers shell portability — a GNU-only \b nearly shipped a fail-open security predicate #1491 — original shell-portability-lint gate.
scripts/shell-portability-tokens.txtSTAGED section — themktemp -pentry this item resolves.
Metadata
| Field | Value |
|---|---|
| Category | unspecified |
| Area | security |
| Ecosystem | unspecified |
Activity
kyle-sexton commentedon Jul 26, 2026
This was generated by AI during triage.
Triage
Verification: confirmed by direct source read.
scripts/shell-portability-tokens.txt's STAGEDsection (current
main, post-#1511/#1519/#1533) still comments outmktemp -p, with the sectionheader pointing at #1510 as the enable trigger — matches the issue's premise. Corpus re-counted
fresh:
grep -rln 'mktemp[^\n]*-p' --include='*.sh' .finds 24 files / 63 call sites repo-wide —same order of magnitude as the issue's "~24 files, ~56 call sites" estimate (undercounted, as the
issue itself flagged).
Important correction to this issue's own premise, found while cross-checking #1510: #1510 has
not merged yet (still claimed/leased, no PR opened as of this triage pass) — this issue's
framing ("#1510... enables two of the three STAGED classes...
mktemp -pwas deliberately leftSTAGED in that PR") describes a PR that does not exist yet. #1510's own triage comment recorded a
different decision-defaulted plan than this issue assumes: uncomment all three STAGED
classes (including
mktemp -p) in the same pass, applyingportability-ok:annotations to themktemp -psites rather than migrating them — not leavingmktemp -pstaged. Whichever way #1510actually lands, this issue's underlying ask (real portable-form migration of the
mktemp -pcorpus,not just an annotation) is legitimate follow-up work either way — it is not blocked by or redundant
with #1510's resolution, since annotating now and migrating for real later are compatible, sequential
steps. Flagging this so the eventual implementer verifies the token-file's actual STAGED/ACTIVE and
annotation state fresh rather than assuming this issue's snapshot.
Classification
Task(native Issue Type set — mechanical migration, not a functional bug).priority: low(already applied) — test-scaffolding-only, no functional/consumer impact,matches sibling ci: enable staged shell-portability-lint classes (date -d, stat -c, mktemp -p) #1510's own assessed tier.
-p, fold thedirectory into the template) and mechanical; the version-bump/CHANGELOG convention is this repo's
documented, not a judgment call.
Agent Brief
Type: Task
Summary: Migrate every
mktemp -p/mktemp -d -pcall site in the shared hook-test scaffoldingcorpus to the portable templated form, then activate the shell-portability-lint gate's
mktemp -pdetection class.
Current behavior:
mktemp -p <dir> <template>and baremktemp -p <dir>are GNU-only forms withno BSD
mktempequivalent (BSDmktemphas no-pflag). The shell-portability-lint gate'smktemp -pdetection class is currently staged (inactive) pending this migration — or, if #1510 hasby then activated it with
portability-ok:annotations on these sites instead of migrating them,pending replacement of those annotations with real fixes.
Desired behavior: Every
mktemp -p "$DIR" prefix.XXXXXXsite becomesmktemp "$DIR/prefix.XXXXXX"; everymktemp -d -p "$DIR" prefix.XXXXXXsite becomesmktemp -d "$DIR/prefix.XXXXXX"; every baremktemp -p "$DIR"(no explicit template) site becomesan explicit-template form such as
mktemp "$DIR/tmp.XXXXXXXXXX"(do not rely on TMPDIR-inheritancesemantics, which differ between GNU and BSD
mktempwhen no template is given). This is a drop-inbehavioral equivalent on both GNU and BSD
mktemp— the directory rides in the template instead ofthe
-pflag. Once the corpus is migrated (not merely annotated), themktemp -ptoken in theshell-portability-lint token list is active (uncommented) with no outstanding STAGED comment for it,
and the gate exits clean against the full repo.
Key interfaces:
mktemp -pentry).mktemp -p.Acceptance criteria:
mktemp -p/mktemp -d -pcall site in the corpus (re-enumerate fresh at executiontime — the count here is a snapshot, not a fixed list) is migrated to a portable form, with no
reliance on a
portability-ok:annotation as the resolution.mktemp -ptoken is active (ACTIVE section) in the shell-portability-lint token list, withno STAGED comment remaining for it.
assertion that needs updating once all three classes are active).
plugin.jsonversion bump and amatching CHANGELOG entry, per this repo's convention.
Out of scope:
date -d/stat -cclass activation and any kindle-dedrmstat -cfix — tracked under ci: enable staged shell-portability-lint classes (date -d, stat -c, mktemp -p) #1510.token from STAGED to ACTIVE.
Labels applied:
agent-ready(autonomous-eligible role label),status: ready.priority: lowunchanged. Role label resolved from tracker defaults —
.work-item-tracker.jsoncarries norole_labelsremap.Related: #1510 (parent — enable trigger and sibling classes; verify its actual landed state before
starting this item), #1491 (origin gate), #1528 (closed duplicate of this issue).
kyle-sexton commentedon Jul 26, 2026
kyle-sexton commentedon Jul 26, 2026
This was generated by AI during work-loop execution.
Work-loop autonomous execution: claimed via the work-item-tracker seam, implemented on branch
chore/1527-mktemp-p-portable-migrationin an isolated worktree, opened PR #1543 (not merged — merge authority belongs to the babysit-loop lane or a human).Summary: migrated all 61
mktemp -p/mktemp -d -pcall sites (24 files, 13 plugins) to the portablemktemp [-d] "$DIR/template"form, activated themktemp -ptoken inscripts/shell-portability-tokens.txt, updated the staged-classes test, bumped plugin.json + CHANGELOG for all 13 touched plugins. Filed follow-up #1540 for 68 pre-existing, unrelated--all-mode findings that predate this change and are out of scope for a mktemp-only migration. Full detail in the PR description.fix(ci): scope mktemp's option scan and cover attached/long-form -p
ci: migrate mktemp -p test-scaffolding call sites to a portable form (#…
Merge origin/main into fix/1537-sort-v-operator-terminated-boundary
fix(plugins): make the ephemeral temp primitives portable and the ses…
fix(plugins): bring five ephemeral-file producers onto the tier contr…