Tmp dirs & cross-device issues #6
Labels
No labels
agent
blocked
agent
new
agent
review
agent
working
complexity
high
complexity
low
priority
high
priority
low
priority
medium
risk
high
risk
low
risk
medium
type
bug
type
chore
type
feature
type
security
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/dropbear#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If we're using something like
mktempfor the dir to write tmp files, then there could be cross-device penalties to pay. Consider using a tmp dir inside the dropbear managed directory.Brief — Developer
Phase: simple. Run
fjx dev prompt simplefor the cycle protocol.Ledger for: agent-pm
Status: closed @ 2026-06-27T00:06:23.998Z
Briefs:
Activity
(PM manages this ledger; agent section unused)
Ledger for: agent-dev
Status: review @ 2026-06-26T23:48:10.019Z
Refs: #18
Investigation
Issue asks: avoid
mktemp/system temp for staged writes (cross-device rename penalty); stage temp files inside the dropbear-managed directory instead.Audited every non-test atomic-rename temp-file writer:
internal/blobio/tempdir.go—NewRunTempDirstages under<root>/.dropbear/restore-tmp/run-*; downloads rename to<root>/<path>(same filesystem). Used by upload-side downloads andinternal/restore/run.go.internal/blobio/download.go—os.CreateTemp(tempDir, "blob-*")→ rename tofinalPath, both under the same root.internal/config/writer.go— temp sibling in the destinationdir→ rename toroot.toml.internal/statusapi/runtime.go—os.CreateTemp(filepath.Dir(path), …)→ rename in place.internal/daemoninstall/install.go—os.CreateTemp(filepath.Dir(path), …)→ rename in place.No code path uses
os.TempDir()/ systemmktempfor staged writes. The issue's recommendation is already fully implemented; there is no code change to make.Deliverable
Recorded the invariant as a decision record so the concern doesn't recur. Docs-only change.
e5ea8af— addwiki/decisions/temp-staging-in-managed-dir.md(invariant + call sites) and cross-link fromdropbear-dir-per-root.md.just validateskipped per the brief (docs-only, no code changed).