Skip to content

fix(sdlc): no temp-file deletions on the hot paths (v2.24.1) - #88

Merged
cskwork merged 1 commit into
mainfrom
fix/no-tempfile-herestrings
Nov 10, 2026
Merged

cskwork merged 1 commit into
mainfrom
fix/no-tempfile-herestrings

Conversation

@cskwork

@cskwork cskwork commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Problem

On a machine where every file deletion took 5.4 s, sdlc.sh status took 18 to 48 s while using 0.18 s of CPU, and one to-do write took 14 to 22 s. The to-do CLI runs status for every open item, so with 41 open items a call ran for minutes and callers with a 20 s limit failed.

  • sdlc.sh read its state with here-strings; bash 3.2 (macOS /bin/bash) writes each to a temp file and deletes it. status ran eight.
  • Every to-do write made and deleted two marker files, then deleted the lock file.

Changes

  • sdlc.sh: the nine here-strings read from < <(printf '%s\n' ...) (same bytes through a pipe).
  • To-do lock markers are empty directories (mkdir/rmdir). A marker left by an older kit is a file and is still removed.
  • Selftest fails if sdlc.sh contains a here-string; a to-do test checks the commit marker held during a save is a directory.
  • VERSION 2.24.1, log/changelog-v2.24.1.md.

Verification (local, on the affected machine)

Check Result
status <slug> --json, old vs new, 3 real slugs output identical
status wall time 18–48 s → about 1.7 s
to-do write (add/note/done, scratch file) 14–22 s → 11 s
marker tests (--test-name-pattern=marker) 3 of 3 pass, including the older-kit file marker cleanup
bash -n sdlc.sh, bash -n tests/selftest.sh, node --check todo/core.mjs pass

The full selftest was not run locally: the slow deletions make the suite time out there. CI on the three platforms is the full run.

Upgrade

Restart a running to-do app (todo.mjs serve) after upgrading.

bash 3.2는 here-string을 임시 파일로 만들고 지운다. 파일 삭제가 느린 기기에서 sdlc.sh status가 18~48초, 할 일 쓰기가 14~22초 걸렸다. sdlc.sh의 here-string 9곳을 프로세스 치환으로 바꾸고, 할 일 잠금 표시를 빈 디렉터리로 바꿨다. 출력은 같다.
@cskwork
cskwork merged commit d9d47d5 into main Nov 10, 2026
3 checks passed
@cskwork
cskwork deleted the fix/no-tempfile-herestrings branch November 10, 2026 07:07
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.

1 participant