Skip to content
C.W.K.
Stream
Lesson 05 of 05 · published

Never Overwrite, Never Delete

~11 min · immutability, append-only, revisions, safety

Level 0Kindling
0 XP0/32 lessons0/10 achievements
0/100 XP to next level100 XP to go0% complete

The two commands an archive never runs

For working directories, overwriting and deleting are ordinary hygiene. For an archive, they are the two ways to destroy the thing the archive exists to hold. The discipline is blunt: never overwrite, never delete. New things land beside their predecessors; disk is spent on history; and when space truly runs out, removal is an explicit, recorded decision — never a silent side effect of an update or a cleanup script.

Why so absolute? Because every casual overwrite story ends the same way. The upstream repo "fixed" its files, and syncing the fix destroyed the revision you had pinned and verified. A cleanup script removed "duplicates" that were actually the only copy of a variant. A re-download landed over the verified original because the filename matched. Each seemed reasonable at the keystroke; each destroyed evidence.

Revision directories make immutability natural

The layout from lesson two carries this: each acquisition lands in its own variant-revision directory. A new revision is a new directory — the old one untouched, still pinned, still digest-verified against its NOTES. "Updating" a model in the archive is addition, not mutation. When you compare two revisions later (did the refresh change tensors? did the license file change?), the comparison is possible precisely because neither side was overwritten.

The same rule scales down to files: .part files never wear final names; digests are recorded in files that are appended to, not edited; the walk-away log only grows. An append-shaped archive is an auditable archive — every fact in it is either an addition or still true.

Correction is an explicit, recorded action — never a side effect. If something must change, the change lands as a new entry and the reason is written beside it. The archive may contain mistakes; it must never contain cover-ups.

The honest exceptions

Two cases deserve honest treatment rather than dogma. Genuinely wrong acquisitions — a file that should never have landed (license bomb, mislabeled derivative) — can be removed, but as a recorded event: a walk-away-style entry saying what left and why, so the refusal survives the removal. Disk exhaustion — when the budget genuinely cannot hold both history and future — forces triage; the triage decisions (what left, what justified it) belong in the catalog, because a shrunk archive with silent deletions is just a slower junk drawer. In both cases the principle survives intact: the action is explicit, reasoned, and visible in the records.

Guarding the discipline mechanically

Discipline decays; permissions don't. The strongest guard is making the archive's canonical copy hard to write casually: a read-only share for everything except the acquisition process, or a sync tool running one direction (source → archive) so nothing in the archive ever propagates backward into overwrite positions. Belt: the periodic digest sweep — which is also your tripwire, because an overwrite or deletion shows up as a FAILED or missing entry, and then the records tell you whether it was ever a decision.

Code

Mechanical guards for the never-never rule·bash
# 1) Land new revisions beside their predecessors — never into them:
NEW=bf16-250301          # new revision directory
mkdir -p "archive/$MAKER/$MODEL/$NEW"
# (the OLD revision directory stays exactly where it was)

# 2) Make the canonical copy read-only for everything but acquisition:
chmod -R a-w archive/  # after landing + verification; re-enable per-run
#   or export the NAS share read-only and give the acquisition
#   process its own writable staging root.

# 3) One-directional sync (source -> archive), never bidirectional:
rsync -a --ignore-existing staging/ archive/
#   --ignore-existing: files already in the archive are never
#   touched, no matter what the source says now.

# 4) The tripwire sweep (from the integrity track) — an overwrite
#    or silent deletion appears here first:
shasum -a 256 -c SHA256SUMS | grep -v ': OK$' || echo "archive clean"
find archive -name '*.safetensors' | wc -l   # count should only grow

External links

Exercise

Install the permission guard this week: make the canonical copy read-only (re-enabled per acquisition), and optionally add a one-directional sync or an append-only log on top. Then test it: attempt a casual overwrite of an archived file and document what happened. Finish by writing your two honest-exception policies (wrong acquisitions, disk exhaustion) in two sentences each.
Hint
The overwrite attempt should fail — that is the point. If it succeeds, the guard is decorative; fix it before continuing. The two policies should both end with '...and the removal is recorded in the catalog with a reason.'

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.