Repository navigation
Description
Design: one name, one owner — a file's name is canonical, its archive namespace is reserved, and its archives belong to exactly one file (pkgs/id FileOps)
Design doc: files/designs/code-id-fileops-name-archive-ownership.md in the keep-the-four-repos-healthy goal workspace. Grounded at origin/main a8aa52dc.
Problem
A "file" in pkgs/id is a name (an iroh-blobs tag) plus metadata tags, and FileOps (pkgs/id/src/fileops.rs) is the single implementation every surface calls — built so the operations could not drift apart (module doc, fileops.rs:1-10). Inside that single implementation, three things about a name were never stated as one contract, on top of a five-fix history (#1612, #2462, #2856, #2862, #4574 — closed today) in which every archive defect was patched at the site that exposed it:
- What a name may be.
validate_name(fileops.rs:221) refuses empty/rooted/traversal names, butputstores a padded name verbatim whilevalidate_target(:240) trims — padded twins that rename/copy can never target (id(fileops): put stores names verbatim while rename/copy targets are trimmed — padded names create untargetable twin files #4102) — and the archive shape<name>.archive.<digits>that FileOps itself mints (claim_archive_name, :166) is not reserved, so a user file with that shape is classified as an archive, hard-deleted by deleting a different file, and can silently overwrite a genuine archive (id(fileops): archive tag namespace is not reserved — a user file named <name>.archive.<digits> is misclassified as an archive, hard-deleted by delete(<name>), and a put to an existing archive's name silently overwrites it #4720). - What an archive reference is.
archive.rename/archive.replacevalues are ownership records:delete(:496) follows them and hard-deletes every archive they name. The codebase already knows they must not travel carelessly —ARCHIVE_IDENTITY_TAG_KEYS(:32-44) keeps them off an archive subject duringarchive_existing, because letting one travel "orphans every earlier archive from the live file's delete (id(fileops): repeated-replacement archive removal test fails — delete reports 1 archive instead of 2 #4574)". - Who may own one. That reasoning was never applied to
copy:FileOps::copy(:443) duplicates all source metadata viacopy_all_tags(:465) with no exclusions, so a copy becomes a second owner of the source's archives and deleting the copy hard-deletes the source's archived versions while the source still exists (id(fileops): copy inherits the source's archive references — deleting the copy hard-deletes the source's archives #4761, probe-verified).
The contract (recorded decisions)
- Rule 1 — one canonical name. Every entry point resolves names through the same validation, and a stored name is never padded: leading/trailing whitespace is refused with
InvalidName, not trimmed (pinning id(fileops): put stores names verbatim while rename/copy targets are trimmed — padded names create untargetable twin files #4102's open choice — trimming at the store silently renames a user's file; surfaces that want to be forgiving trim before calling, as the web handlers already do).validate_targetstops trimming. - Rule 2 — the archive namespace is reserved at the writer.
validate_name/validate_targetrefuse any name whereis_archive_tag_name(:155 — the readers' existing spelling, unsigned ASCII digits per id(web): classify_tag timestamp parsers accept non-canonical spellings — non-padded, '+'-signed and over-wide components classify as Auto/Archive with the canonical instant #4329) is true, with a distinguishable error (pinning id(fileops): archive tag namespace is not reserved — a user file named <name>.archive.<digits> is misclassified as an archive, hard-deleted by delete(<name>), and a put to an existing archive's name silently overwrites it #4720's primary acceptance over its metadata-only alternative: the prefix scan andclassify_tagare load-bearing readers, and reservation is one check at the one gate every surface funnels through). Non-numeric lookalikes (a.archive.notes) remain valid user files. - Rule 3 — archive references are ownership, and ownership moves only when the source name ceases to exist.
archive_existingkeeps them off the archive and restores them to the live name (landed, id(fileops): repeated-replacement archive removal test fails — delete reports 1 archive instead of 2 #4574);renamemoves them (source name gone — correct, unchanged);copyexcludes them — the destination starts with no archive references except thearchive.replacefor a file the copy itself replaced (:480). The exclusion sits next toARCHIVE_IDENTITY_TAG_KEYSso the next metadata-duplicating operation inherits the question, not the bug.
Phases (adopted origins — no parallel issues filed)
- Phase 1 = id(fileops): archive tag namespace is not reserved — a user file named <name>.archive.<digits> is misclassified as an archive, hard-deleted by delete(<name>), and a put to an existing archive's name silently overwrites it #4720 — reserved namespace at the writer.
- Phase 2 = id(fileops): copy inherits the source's archive references — deleting the copy hard-deletes the source's archives #4761 — copy owns nothing it did not archive (independent).
- Phase 3 = id(fileops): put stores names verbatim while rename/copy targets are trimmed — padded names create untargetable twin files #4102 — one canonical name: padding refused at FileOps, surface inventory for trim-at-the-surface (independent).
- Phase 4 = closing audit (filed with this design) —
classify_tagspelling vsis_archive_tag_name; delete's two archive-collection paths agreeing; any other metadata-duplicating operation's disposition; the legacy archive-shaped user-file disposition; the contract statement in fileops.rs's module doc. Gated on Phases 1–3.
Open questions (in the design doc, not phases)
Deleting an archive by its exact name (legitimate today, unfiled as misused); writer/reader agreement for archives of names containing .archive. in a non-numeric position (Phase 4 probes it); a first-class archive listing (feature, no consumer filed).
Activity
dezren39 commentedon Nov 3, 2026
Design architect, pass 42 (2026-11-02): this issue is the design of record for the pkgs/id FileOps name/archive-ownership contract. Design doc:
files/designs/code-id-fileops-name-archive-ownership.md(keep-the-four-repos-healthy goal workspace); central register entry added infiles/potential-projects.md(status: proposed).Phases are the ADOPTED origin issues, linked as sub-issues (verified count=4): Phase 1 = #4720 (reserved archive namespace at the writer), Phase 2 = #4761 (copy excludes the source's archive references), Phase 3 = #4102 (one canonical name — padding refused at FileOps), Phase 4 = #4767 (closing audit, gated on Phases 1–3, triage packet enqueued this run). No parallel implementation issues were filed.
Recorded decisions the phases inherit: padding is REFUSED at FileOps, not trimmed (surfaces trim before calling); the namespace is RESERVED at the writer using the readers' existing
is_archive_tag_namespelling, not replaced by metadata-only archives; archive references move only when the source name ceases to exist (rename moves them, copy never inherits them). Triage: do not re-scope or split the origins against these pins — flag genuine blockers here instead.dezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
19 remaining items
dezren39 commentedon Nov 8, 2026
Partial verification — staying open (2026-11-07 done-task-only audit, tracking: #7016).
Queue task(s) [8432] were marked done, and some work did land:
No merged change closes this issue's full scope, so the done status is not treated as completion. Remainder re-queued as triage task 11703.
dezren39 commentedon Nov 8, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 8, 2026
🤖 Agent note · done — triage verdict (task 12699)
Fresh re-verification this shift (all reads this run, current GitHub state):
queue/queued(andqueue/parked), so its fix route is live in the queue.queue/parkedwithwork/assigned.Verdict: issue #4766 is not fully satisfied, confirming the task 12177 verdict, but the entire remainder is already routed through its adopted origin issues (issue #4761 / PR #4764, and issue #4767). Creating a new small_fix packet scoped to this issue's remainder would duplicate that live work, so no new packet is filed. Issue #4766 stays open as the design of record until issue #4761 lands and the Phase 4 audit (issue #4767) completes. Task 12699 completes as
triaged.dezren39 commentedon Nov 12, 2026
Program tending — epic completion (tracking: #1352)
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged — correction to the closure proposal: Phase 4 child #4767 is still open
dezren39 commentedon Nov 19, 2026
Program tending — epic completion (tracking: #1352)