Skip to content

Workspaces: a late write from a renamed workspace lands in a new workspace created under its old name #798

Todo

Description

@harenome

Priority

P3

Components

app/nullius/workspace.py (_update_index, _write_cache, store_counts)

Evidence

A load paused after its index merge, while holding the old index lock. Another process renamed c to moved, created a new c with other roots and indexed new-job. On resume the loader replaced the new c's index with old-job. A reload returned only new-job but left both indexed. Reproduces on main.

Same boundary for the other writers:

  • an empty new c sharing the old root gets the late parse's cache and index before it loads a job;
  • with other roots, the Workspaces page's late counts write replaces the new c's counts.json.

The new workspace's manifest stays intact; strict load returns it.

Reproduction

  1. Workspace c, one job root.
  2. Pause a load after the index merge, holding the lock.
  3. In another process: rename c to moved, create c with other roots, load it.
  4. Resume the first load.
  5. Read c/jobs/index.json.

Expected

A late write from the old workspace never reaches a workspace created under its old name.

Acceptance

  • Cache, index and counts writes are tied to the workspace folder they started in, up to publication
  • Test: other roots, paused index write, the new c keeps only its own job

Dependencies and related

#758, #770

Activity

  1. added
    bug
    P3
    on Dec 3, 2026
  2. added theissue type on Dec 3, 2026
  3. self-assigned this
    on Dec 3, 2026
  4. harenome commented on Dec 3, 2026

    @harenome
    CollaboratorAuthor

    Status: a fix exists (branch harenome:fix/late-write-replacement, not opened). Two review rounds each found about five more cases, all reachable in one server, so this is paused for a design first.

    What the branch does: one lock outside every workspace folder (writes shared, rename and delete exclusive), and each cache, index and counts write checks the workspace's UID before writing. The three reported schedules pass.

    Still open on it, all in one server process:

    • The in-memory decoded cache can serve the old workspace's score after a same-name replacement (also on main).
    • Two overlapping renames can leave the server pointing at a vanished workspace.
    • Pruning can evict a newer result in the same workspace.
    • Refresh can report success while still serving the old reward if the lock is refused.
    • A lock refusal during Delete moves judgement records into the archive before failing.
    • A workspace Delete waiting behind a Rename removes the replacement, imports included (also on main).

    Next: one identity design for workspace rename, delete and caches, planned and reviewed before more code.

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

Metadata

Metadata

Assignees

Labels

P3bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions