Repository navigation
Description
id(web): classify_tag treats any '.archive.' filename as an archive — notes.archive.txt renders with an 'archive: ?' badge, sorts out of the primary list, and links by hash instead of by name
Evidence (main da42bfe7)
-
pkgs/id/src/web/routes.rs:165-169(classify_tag): the archive branch returnsFileKind::Archivefor any name containing.archive., whether or not the suffix after it parses as a unix timestamp:if let Some(pos) = name.rfind(".archive.") { let ts_str = &name[pos + ".archive.".len()..]; let ts = ts_str.parse::<u64>().ok(); return (FileKind::Archive, ts); // Archive even when ts is None }
-
The sibling
auto-branch directly above it was fixed for exactly this flaw in id(web): classify_tag treats any 'auto-' filename as an auto-backup — auto-notes.txt renders with an 'auto: ?' badge and sorts out of the primary list #809/fix(id/web): classify_tag only treats auto-{ISO_DATE} names as auto-backups #810: it only returnsFileKind::Autowhen the remainder actually parses as an ISO date, andtest_classify_tag_auto_prefix_non_date_is_primary(routes.rs:3119) pins that ordinary files likeauto-notes.txtstay Primary. The archive branch never got the same treatment —test_classify_tag_archive_no_timestamp(routes.rs:3142) instead enshrines the loose behavior ("Even without a valid timestamp, .archive. pattern is recognized"). -
No producer creates a non-numeric archive suffix: archives are minted as
{name}.archive.{unix-ts}(pkgs/id/src/fileops.rs:99-115,free_archive_name), and fileops itself documents "Archive tags are named<name>.archive.<unix-ts>; match the numeric …" (fileops.rs:413-415). A non-numeric suffix is therefore never a real archive.
Verified behavior (probe, laptop ~/git/fleet/probe-2026-10-30-laneA-archiveclass/)
classify_tag + parse_iso_timestamp copied verbatim from main, run over sample names:
notes.md.archive.1711000000 -> (Archive, Some(1711000000)) // genuine archive
notes.archive.txt -> (Archive, None) // ordinary file
meeting.archive.notes -> (Archive, None) // ordinary file
backup.archive.draft -> (Archive, None) // ordinary file
x.archive. -> (Archive, None) // empty suffix
photo.archive.2024-01-01 -> (Archive, None) // date suffix, not a unix ts
auto-notes.txt -> (Primary, None) // #809 control
my-document.md -> (Primary, None)
Why it matters
An ordinary user file whose name merely contains .archive. (a file about archives is the obvious case) is misrendered in the file list, in the same ways #809 fixed for auto-:
pkgs/id/src/web/templates.rs:239-245: it gets anarchive: ?badge (parent?when no primary shares its hash; a fabricated parent link when one coincidentally does).templates.rs:308-310: its row links to/hash/{hash}instead of/edit/{name}.routes.rs:897-916: it sorts after every primary file (timestampunwrap_or(0)), androutes.rs:844-847excludes it fromhash_to_primary, so genuine auto/archive files sharing its hash lose their parent resolution andget_file_name(routes.rs:1027) won't prefer it.
Acceptance criteria
classify_tagreturnsFileKind::Archiveonly when the suffix after the last.archive.parses as au64unix timestamp; otherwise the name falls through toFileKind::Primary.test_classify_tag_archive_no_timestampis replaced with regression tests mirroringtest_classify_tag_auto_prefix_non_date_is_primary: e.g.notes.archive.txt,meeting.archive.notes,x.archive.classify as Primary with no timestamp, whilenotes.md.archive.1711000000still classifies as Archive with its timestamp.- Existing genuine-archive behavior is unchanged: rename/save archive naming (
free_archive_name), sorting, badges, and parent resolution for numeric-suffix archives.
Dedup: #809/#810 cover the auto- prefix only; no open or recently closed issue covers the .archive. branch of classify_tag.
Activity
dezren39 commentedon Oct 30, 2026
🤖 Agent note · picked up
.archive.suffix parses as a u64; replace the loose-behavior test with id(web): classify_tag treats any 'auto-' filename as an auto-backup — auto-notes.txt renders with an 'auto: ?' badge and sorts out of the primary list #809-style regression tests.creator-a/2793-archive-classify(to come)dezren39 commentedon Oct 30, 2026
🤖 Agent note · handed off
.archive.suffix parses as a u64; loose-behavior test rewritten as the id(web): classify_tag treats any '.archive.' filename as an archive — notes.archive.txt renders with an 'archive: ?' badge, sorts out of the primary list, and links by hash instead of by name #2793 regression test.creator-a/2793-archive-classify, commit 20d2a19). Verified on the laptop with the pinned 1.99 toolchain:cargo test --features web classify_tag— 8 passed, 0 failed.Merge pull request #2794 from developing-today/creator-a/2793-archive…
dezren39 commentedon Oct 30, 2026
🤖 Agent note · done
cargo test --features web classify_tag8/8 passed with the pinned 1.99 toolchain. No Actions runs were created for the PR (only CodeRabbit), the same pattern as merged fix(id/web): Go to Line accepts only decimal digits (#2776) #2777/fix(id/web): detectLanguage own-key guards — prototype names are not languages (#2787) #2788; merged under the standing directive on the laptop verification.