Title: 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 · Issue #809 · developing-today/code · GitHub
Open Graph Title: 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 · Issue #809 · developing-today/code
X Title: 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 · Issue #809 · developing-today/code
Description: Problem In the id web UI, any file whose name starts with auto- is classified as an auto-backup, even when the rest of the name is not a timestamp at all. A user's ordinary file named e.g. auto-notes.txt, auto-2026-report.md or auto-draf...
Open Graph Description: Problem In the id web UI, any file whose name starts with auto- is classified as an auto-backup, even when the rest of the name is not a timestamp at all. A user's ordinary file named e.g. auto-not...
X Description: Problem In the id web UI, any file whose name starts with auto- is classified as an auto-backup, even when the rest of the name is not a timestamp at all. A user's ordinary file named e.g. auto...
Opengraph URL: https://github.com/developing-today/code/issues/809
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"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","articleBody":"## Problem\n\nIn the id web UI, **any** file whose name starts with `auto-` is classified as an auto-backup, even when the rest of the name is not a timestamp at all. A user's ordinary file named e.g. `auto-notes.txt`, `auto-2026-report.md` or `auto-draft` is treated as `FileKind::Auto` instead of `FileKind::Primary`.\n\n## Evidence (verified on main aa853c40)\n\n`pkgs/id/src/web/routes.rs:150-157` — `classify_tag` returns Auto unconditionally on the prefix; the parsed timestamp is discarded-or-None with no gate:\n\n```rust\nfn classify_tag(name: &str) -> (FileKind, Option\u003cu64>) {\n // Check for auto-backup: \"auto-{ISO_DATE}\"\n if let Some(iso_str) = name.strip_prefix(\"auto-\") {\n // Try to parse the ISO date to extract a unix timestamp\n // Format: 2026-03-12T06:42:30.015Z\n let ts = parse_iso_timestamp(iso_str);\n return (FileKind::Auto, ts); // Auto even when ts is None\n }\n ...\n```\n\nThe doc comment on `FileKind::Auto` (routes.rs:114) defines the kind as matching `auto-{ISO_DATE}` — a name whose remainder does not parse as an ISO date does not match that pattern, yet is classified Auto anyway.\n\nExisting tests cover only the well-formed case (`test_classify_tag_auto`, routes.rs:2424-2428, `auto-2026-03-12T06:42:30.015Z`). There is no test for an `auto-` name with a non-date remainder. (Contrast the `.archive.` branch: its no-timestamp behavior is deliberate and pinned by `test_classify_tag_archive_no_timestamp`, routes.rs:2438-2443 — this issue is only about the `auto-` branch, which has no such pinning test or comment.)\n\n## Why it matters\n\nClassification drives user-visible behavior for a misclassified primary file:\n\n- **Sorting**: the file list sorts primaries first (alphabetically), then Auto files by timestamp descending (`get_file_list`, routes.rs ~786-806). A misclassified file drops out of the alphabetical primary list into the backup group, with `timestamp: None` sorting as 0.\n- **Badge**: the file list renders an `auto: {parent}` badge for Auto files (templates.rs:232-238); with no same-hash primary, `parent_name` is `None` and the badge renders literally as `auto: ?`.\n- **Parent resolution**: only Primary names populate the hash→primary map (routes.rs ~733-736), and `get_file_name` \"preferring primary names\" (routes.rs ~884-910) will not prefer the misclassified file's name for its hash.\n\n`auto-` is a plausible prefix for real user files (auto-generated reports, `auto-save` notes, vehicle/insurance documents, etc.), so this is not a theoretical name shape.\n\n## Suggested fix\n\nOnly classify as Auto when the remainder actually parses:\n\n```rust\nif let Some(iso_str) = name.strip_prefix(\"auto-\") {\n if let Some(ts) = parse_iso_timestamp(iso_str) {\n return (FileKind::Auto, Some(ts));\n }\n // fall through: an `auto-` name that is not an ISO date is a primary file\n}\n```\n\nNote: this composes with #756 — once `parse_iso_timestamp` validates ranges, names like `auto-2026-13-40T99:99:99Z` also stop being Auto, which is the correct outcome under the same rule.\n\n## Acceptance criteria\n\n- [ ] `classify_tag(\"auto-notes.txt\")`, `classify_tag(\"auto-2026-report.md\")` and `classify_tag(\"auto-\")` return `FileKind::Primary` with `None` timestamp.\n- [ ] `classify_tag(\"auto-2026-03-12T06:42:30.015Z\")` still returns `FileKind::Auto` with `Some(ts)` (existing test keeps passing).\n- [ ] New regression tests cover the non-date `auto-` shapes; the `.archive.` branch behavior is unchanged.\n- [ ] Web unit tests pass (`cargo test` for the web routes module).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-24T20:14:37Z","url":"https://github.com/developing-today/code/issues/809"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4da44cfc-439f-ee9f-667e-a346c47d2e04 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D512:4C535:5D8CB4:7DAF2C:6B06278B |
| html-safe-nonce | 387de0bc30d5df22ade79228b54122523be7e424d398ebddf5e05980628243a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTEyOjRDNTM1OjVEOENCNDo3REFGMkM6NkIwNjI3OEIiLCJ2aXNpdG9yX2lkIjoiNjg5MzE0NzczMjc1Mjg2OTI1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a35b4742aac5794b9e7322799c53b5edd1d13be407a0aeaa3d8fc29625ba94a |
| hovercard-subject-tag | issue:6017145530 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c09749ab0d440b1952ea45273d11304dfb027f140ef12388594bc34d237e611/developing-today/code/issues/809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c09749ab0d440b1952ea45273d11304dfb027f140ef12388594bc34d237e611/developing-today/code/issues/809 |
| og:image:alt | Problem In the id web UI, any file whose name starts with auto- is classified as an auto-backup, even when the rest of the name is not a timestamp at all. A user's ordinary file named e.g. auto-not... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32e57d5cc2ce6ce92ec6dceb65858344750c27c2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width