一键导入
htcc-output-permission-workflow
Work safely on htcc output replacement, fallback copy, file mode preservation, rollback, symlink, and hard-link behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Work safely on htcc output replacement, fallback copy, file mode preservation, rollback, symlink, and hard-link behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Keep htcc CI workflows aligned with the test runner command matrix, especially explicit self/components/subp/docker lists.
Fix htcc parser regressions with focused component tests, malformed-input QA, and nontermination safeguards.
Handle htcc review comments end-to-end: reproduce, judge validity, apply minimal fixes, verify, review, and prepare commit/push.
Choose and run the correct htcc verification commands for parser, CLI, CI, output permission, Docker, and documentation changes.
Expert Haskell engineer specializing in advanced type systems, pure
| name | htcc-output-permission-workflow |
| description | Work safely on htcc output replacement, fallback copy, file mode preservation, rollback, symlink, and hard-link behavior. |
| risk | safe |
| source | project |
| date_added | 2026-05-18 |
src/Htcc/Output.hs or code that writes -o outputs, visualization outputs, staging files, backups, or direct replacement paths.setFileMode, owner/group/other permissions, read-only directories, fallback copies, stale output, symlinks, hard links, or rollback.chmod when a write/copy could already succeed through group or other permissions.ensureInPlaceReplacementSafe.test/Tests/ComponentsTests/AsmOutput.hs near existing fallback/permission tests.copyReplacementOutput functions to assert ordering, mode at copy time, partial-write rollback, or failure surfacing.openTempFile, close handles before mode changes, and cleanup with catchIOError-guarded removal.fileMode <$> getFileStatus and intersectFileModes replacedMode 0o777..global main,Example shape:
tmpdir=$(mktemp -d /tmp/htcc-output-fallback.XXXXXX)
target="$tmpdir/out.s"
cleanup() {
chmod u+rw "$target" 2>/dev/null || true
chmod u+rwx "$tmpdir" 2>/dev/null || true
rm -rf -- "$tmpdir"
}
trap cleanup EXIT
printf 'stale output\n' > "$target"
chmod 444 "$target"
chmod 555 "$tmpdir"
printf 'int main(void) { return 0; }\n' | stack exec htcc -- -o "$target" /dev/stdin
Always restore permissions before cleanup; use a trap so interrupted QA does not leave read-only temp paths behind.
stylish-haskell -i src/Htcc/Output.hs test/Tests/ComponentsTests/AsmOutput.hslsp_diagnostics on both files when the diagnostics tool is available. If unavailable, state that and substitute stack build plus the relevant test command.stack test --test-arguments components.stack test when output replacement affects subprocess behavior.stack build.copy, chmod, restore, and rollback.