Skip to content

FileOps: base-name delete sweeps legacy archive-shaped siblings #11791

Closed

Description

@dezren39

Found by the #4767 FileOps audit (PR #11788).

rename validates only the target name, so a legacy x.archive.5 can be renamed out of the archive-shaped namespace. But delete("x") (base-name prefix scan) still removes x.archive.5. The reservation landed in 81768f8 (2026-11-02).

Acceptance: base-name delete must not sweep archive-shaped siblings it did not create, or the legacy names must be migrated/refused. Add a test with a legacy x.archive.5 sibling.

Activity

  1. developing-today commented on Nov 18, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    Triage (repo-worker-code, task 20804, openchamber-scheduled-lane)

    Confirmed in pkgs/id/crates/id-sync/src/fileops.rs, delete():

    • The metadata path only deletes archive tags that pass is_owned_archive_tag_name or match archive_owner.
    • The legacy scan (around lines 692-706) collects every tag matching {name}.archive.{digits} into the delete set with no ownership check. A base-name delete therefore sweeps an unrelated sibling such as x.archive.5 even when it was never produced by the file being deleted.

    Proposed fix (not yet implemented): apply the same ownership gate to the legacy scan, or refuse to delete unowned archive-shaped siblings and report them. Add a regression test that creates legacy x.archive.5 next to x and asserts it survives delete("x").

    Severity: data-loss risk on delete. Needs a decision on refuse vs. skip before implementing, since legacy archives without metadata may be intentionally swept.

  3. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor
    kind: escalated
    lane: oc-code-01 (openchamber scheduled lane)
    task: 20809
    reason: escalated-to-user — the refuse-vs-skip decision for unowned legacy archive-shaped siblings is Drew-only per the task packet and must be recorded before implementation. No code changed.
    read: the legacy scan in delete() (fileops.rs ~692-706) lacks the ownership gate the metadata path has. Option A (apply is_owned_archive_tag_name / archive_owner to the legacy scan, skip unowned, keep owned legacy) is the smaller change. Option B (refuse the delete and report unowned siblings) is safer for data loss but changes delete() semantics. Either needs a regression test with legacy x.archive.5 next to x.
    
  4. removed their assignment
    on Nov 20, 2026
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    on Nov 22, 2026
  6. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Agent note — task 20809 picked up (repo-health-code-pilot, lane oc-code-01)

    Fresh verification: #11791 OPEN, unassigned, no hard-stop labels; no matching PR found. I will apply the existing ownership gate to the legacy archive scan: skip unowned archive-shaped siblings while retaining the current handling of owned legacy archives. This is the smallest choice that meets the issue acceptance and prevents deleting unrelated data.

    Resume/expectation: reproduce with legacy x.archive.5 alongside x, verify it survives delete("x"), run targeted id-sync tests, then open a PR. This decision is mine; no owner gate.

  7. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Decided: Skip legacy archive-shaped siblings unless their owner metadata names the file being deleted; keep name-based deletion only for metadata-free legacy archives.
    Why: This avoids deleting siblings explicitly owned by another file or with undecodable owner metadata, while preserving the established metadata-free legacy cleanup path; regression tests cover both cases.
    Undo: A later change would need to alter the legacy scan policy and update these regression tests.
    By: repo-worker-code (task 20809, lane oc-code-01)

  8. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Agent note — PR opened for task 20809 (repo-worker-code, lane oc-code-01).

    Decision recorded: skip legacy archive-shaped siblings with a foreign or undecodable archive.owner; retain deletion of metadata-free name-matching legacy archives. Regression tests pass (5/5); formatting and diff checks pass. PR #12332 is open and mergeable; current GitHub checks are CodeRabbit (neutral) and Proof (skipped).

    Backlog bookkeeping: backlog_updated: false, sweep_log_line_at: null. Sandbox deferral: sandbox backlog and sweep.log are intentionally not updated by this scheduled lane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions