Skip to content

fix(id): one archive-tag rule for writer and reader (#11790) - #11798

Merged
dezren39 merged 1 commit into
mainfrom
queue/20808-11790-archive-tag-classifier
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20808-11790-archive-tag-classifier

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes nothing automatically; refs #11790.

Problem

The FileOps writer (id-sync is_archive_tag_name) reserved any non-empty stem with an all-digit suffix. The reader (id-web classify_tag) required a u64-parseable suffix and accepted an empty stem. Result: .archive.5 was an archive to the reader but not the writer, and overflowing digit suffixes were reserved by the writer but primary to the reader.

Change

  • id-sync: new archive_tag_timestamp(name) -> Option<u64> (non-empty stem, unsigned decimal suffix that fits u64). The writer's predicate now delegates to it.
  • id-web: classify_tag uses the same function for the archive branch.
  • Tests: shared rule cases in id-sync; reader cases for .archive.5, u64 overflow and u64::MAX in id-web.

Behaviour note

A name with an overflowing all-digit suffix is no longer reserved by the writer; it is an ordinary file, matching the reader. No producer mints such a suffix.

Verification

  • rustfmt --check clean on both files.
  • Local cargo test -p id-sync --lib archive_tag_timestamp: running at PR open; CI is the merge gate.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The FileOps writer reserved any non-empty stem with an all-digit suffix,
while the reader required a parseable u64 suffix and accepted an empty
stem. So '.archive.5' was an archive to the reader only, and overflowing
digit suffixes were reserved by the writer but primary to the reader.

Both sides now use archive_tag_timestamp in id-sync: non-empty stem,
unsigned decimal suffix that fits in u64. Tests cover both shapes.
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 12:04
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aef13ab1-6551-49a5-953f-15a9baf4ea81
Commits

Reviewing files that changed from the base of the PR and between 6a87937 and 0ed88ab.

Files selected for processing: 2

  • pkgs/id/crates/id-sync/src/fileops.rs
  • pkgs/id/crates/id-web/src/routes.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T12:06:09.419969Z 0ed88ab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

Local: cargo test -p id-sync --lib archive_tag_timestamp passed (1 test). The id-web reader test is not run locally; CI is the gate for that crate.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ed88abe27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 196 to +197
fn is_archive_tag_name(name: &str) -> bool {
let Some((file_name, suffix)) = name.rsplit_once(".archive.") else {
return false;
};
!file_name.is_empty() && !suffix.is_empty() && suffix.bytes().all(|b| b.is_ascii_digit())
archive_tag_timestamp(name).is_some()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align archive deletion before admitting overflowing suffixes

With this change, users can create an ordinary file named report.archive.18446744073709551616, but deleting report also deletes that independent file and its metadata. FileOps::delete still collects every tag with the matching prefix and an all-digit suffix (fileops.rs:711–715), regardless of whether the suffix fits in u64 or the tag has archive ownership metadata. Update the deletion scan and ownership predicate to use the shared archive rule before relaxing the writer's reservation.

Useful? React with 👍 / 👎.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: parked
task: 20808
lane: code-i (OpenChamber scheduled lane, worker repo-worker-code)
stage: pr_opened -> awaiting_ci

Parked 20 min: CI checks have not registered on this PR. Resume will check PR state fresh and merge only if green.

@dezren39
dezren39 merged commit 03b73d9 into main Nov 18, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20808-11790-archive-tag-classifier branch November 18, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant