Skip to content

fix: preserve file modes during template substitution - #1820

Draft
alloutflo wants to merge 1 commit into
danielmiessler:mainfrom
alloutflo:codex/issue-1803-preserve-file-modes
Draft

fix: preserve file modes during template substitution#1820
alloutflo wants to merge 1 commit into
danielmiessler:mainfrom
alloutflo:codex/issue-1803-preserve-file-modes

Conversation

@alloutflo

Copy link
Copy Markdown

Summary

  • preserve each template file's original mode on the temporary file before the atomic rename
  • keep the source InstallEngine.ts and shipped skill copy synchronized
  • add a Bun regression test proving an executable hook remains executable after substitution

Closes #1803

Root cause

substituteTree() wrote replacement content to a new temporary inode. That inode inherited the process umask (typically 0644), and the subsequent rename replaced the executable source file together with its mode.

Validation

  • bun test LifeOS/test/skills/LifeOS/Tools/InstallEngine.test.ts — 1 passed
  • bun build LifeOS/Tools/InstallEngine.ts --target=bun — successful
  • verified both distributed InstallEngine.ts copies are byte-identical
  • git diff --check

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.

substituteTree strips the exec bit, silently disabling 10 wired hooks on every install

1 participant