originals/ and derived/, because the names are the rule

media/
    originals/   nothing regenerates these
    derived/     rebuildable from originals/, safe to wipe

a pure rename: nothing had been created yet — checked the real root on fofos, only
`website/` was there — so there is no directory to move and no file to lose. that
is the last moment this was free, which is why it happened now.

`user/` and `treated/` both named the wrong thing. `user` said who put the file
there, which stops distinguishing anything the moment a job writes one, and reads
like it should hold a folder per person. `treated` said what had happened to it,
which stops being informative as soon as there is more than one kind of treatment.

these two say which one you can afford to lose. that is the only property that
matters about the pair, and it is the one that decides every rule anybody writes
about them later — what a cleanup job may delete, what a backup must never skip,
what a conversion may overwrite without asking. a name that carries it is a rule
that cannot be forgotten, which is more than the comment above it can promise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-29 01:14:47 +01:00
co-authored by Claude Opus 5
parent 86e18fc7bf
commit b9f8ce4ee4
3 changed files with 22 additions and 17 deletions
+17 -11
View File
@@ -10,8 +10,8 @@ import { readSettings } from './settings';
* <root>/ * <root>/
* website/ the checkout * website/ the checkout
* media/ * media/
* user/ what people upload, untouched * originals/ what people upload, untouched. nothing regenerates these
* treated/ what comes back out of conversion * derived/ made from originals/, and safe to wipe
* *
* ── BESIDE the checkout, never inside it ── * ── BESIDE the checkout, never inside it ──
* *
@@ -25,16 +25,22 @@ import { readSettings } from './settings';
* The two live under one root so a backup of the root is the whole site — the code and the things it * The two live under one root so a backup of the root is the whole site — the code and the things it
* serves — which is the property that makes the root worth being a setting at all. * serves — which is the property that makes the root worth being a setting at all.
* *
* ── The asymmetry between the two halves ── * ── The names ARE the asymmetry, and that is the whole reason for them ──
* *
* `user/` is ORIGINAL. Nothing regenerates it; if it is lost, somebody has to be asked for the file * `originals/` cannot be regenerated. If it is lost, somebody has to be asked for the file again, and
* again, and they may not have it. * they may not have it.
* *
* `treated/` is DERIVED. Every file in it can be made again from the one it came from, so it is the * `derived/` can. Every file in it is reproducible from the one it came from, so it is the half that is
* half that is safe to delete, safe to rebuild, and safe for a job to overwrite without asking. * safe to delete, safe to rebuild, and safe for a job to overwrite without asking.
* *
* Nothing here enforces that yet — no code deletes either — but it is the fact that should decide * They were called `user/` and `treated/` for about an hour. Both named the wrong thing: `user` said
* every rule written about them later, so it is recorded before the first one is. * who put the file there, which stops distinguishing anything the moment a job writes one, and read
* like it should hold a folder per person. `treated` said what had happened to it, which stops being
* informative as soon as there is more than one kind of treatment.
*
* These say which one you can afford to lose. Nothing enforces it yet — no code here deletes anything —
* but every rule written about these two later should start from that sentence, and a name that carries
* it is a rule that cannot be forgotten.
*/ */
const DIR_NAME = 'media'; const DIR_NAME = 'media';
@@ -46,8 +52,8 @@ const DIR_NAME = 'media';
* "ready" about a structure that is missing a folder the creator stopped making. * "ready" about a structure that is missing a folder the creator stopped making.
*/ */
export const MEDIA_CHILDREN = [ export const MEDIA_CHILDREN = [
{ name: 'user', hint: 'What people upload, untouched' }, { name: 'originals', hint: 'Uploaded, untouched — nothing regenerates these' },
{ name: 'treated', hint: 'What comes back out of conversion' }, { name: 'derived', hint: 'Made from originals — safe to wipe and rebuild' },
] as const; ] as const;
export type MediaChildStatus = { export type MediaChildStatus = {
+1 -1
View File
@@ -35,7 +35,7 @@ import type { PluginManifest } from '@@/plugins/manifest';
*/ */
export const manifest: PluginManifest = { export const manifest: PluginManifest = {
publisher: 'officerdev', publisher: 'officerdev',
version: '2026.08.29.15', version: '2026.08.29.16',
platform: '>=1.0.0', platform: '>=1.0.0',
label: 'Fofos', label: 'Fofos',
+4 -5
View File
@@ -15,8 +15,8 @@ import { readableError } from './errors';
* *
* ── The children are listed, and the button repairs ── * ── The children are listed, and the button repairs ──
* *
* `user/` and `treated/` are shown whether or not they are there, so a structure that is missing one * `originals/` and `derived/` are shown whether or not they are there, so a structure that is missing
* reads as INCOMPLETE rather than as fine. The button follows: "Create" when there is nothing, "Create * one reads as INCOMPLETE rather than as fine. The button follows: "Create" when there is nothing, "Create
* missing" when part of it exists. It is `mkdir -p` on every path either way, so pressing it can only * missing" when part of it exists. It is `mkdir -p` on every path either way, so pressing it can only
* add and can never fail on something already correct. * add and can never fail on something already correct.
*/ */
@@ -93,9 +93,8 @@ export const MediaFolder = ({ rootPath }: { rootPath: string }) => {
<p className="text-xs text-muted-foreground">Not created yet.</p> <p className="text-xs text-muted-foreground">Not created yet.</p>
)} )}
{/* The structure, always — the folders that are missing are the point of showing it. Named {/* The structure, always — the missing folders are the point of showing it. The hint beside
with what they hold, because "user" and "treated" say who and what happened rather than each name carries the one distinction that matters: which of the two can be rebuilt. */}
what goes in them. */}
<ul className="pt-1"> <ul className="pt-1">
{status.children.map((child) => ( {status.children.map((child) => (
<li key={child.name} className="flex items-baseline gap-2 text-xs"> <li key={child.name} className="flex items-baseline gap-2 text-xs">