Seven copies of the temp-file-plus-rename atomic write helper #1266

Open
opened 2026-10-27 13:39:42 +00:00 by sam · 0 comments
Owner

The same write-temp/chmod/write/sync/close/rename sequence is implemented seven times: internal/tools/builtin/fsutil.go writeFileAtomic, internal/pairing/atomic.go, internal/releaseupdate/service.go, internal/infrastructure/configuration/setup/envsink.go writeEnvFileAtomic, internal/infrastructure/memory/builtin/store.go, internal/app/archied/setup.go writeFileAtomicMode, internal/app/prbench/prbench.go writeJSON. Consolidate into one package under internal/ (cross-cutting packages there import zero internal packages) unless a second consumer needs a format-specific behaviour. Not filed against the static-analysis gate: no gosec rule reports it.


Imported from beads archie-core-co4p · GitHub #1379 · type chore · priority P3 · created 2026-10-02

The same write-temp/chmod/write/sync/close/rename sequence is implemented seven times: internal/tools/builtin/fsutil.go writeFileAtomic, internal/pairing/atomic.go, internal/releaseupdate/service.go, internal/infrastructure/configuration/setup/envsink.go writeEnvFileAtomic, internal/infrastructure/memory/builtin/store.go, internal/app/archied/setup.go writeFileAtomicMode, internal/app/prbench/prbench.go writeJSON. Consolidate into one package under internal/ (cross-cutting packages there import zero internal packages) unless a second consumer needs a format-specific behaviour. Not filed against the static-analysis gate: no gosec rule reports it. --- _Imported from beads `archie-core-co4p` · GitHub #1379 · type chore · priority P3 · created 2026-10-02_
sam added the lowchore labels 2026-10-27 13:39:42 +00:00
sam self-assigned this 2026-10-27 13:39:42 +00:00
sam added the deferred label 2026-11-15 17:26:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1266