Skip to content

Tracking fws U9: task-history delete takes the canonical lock #2024

Open

Description

@easonLiangWorldedtech

What this unit delivers: the task-history delete path takes the same canonical lock every other writer to the file uses, and reports per-id failures honestly: failed ids stay in the cache and the store never reports a deletion it did not perform.

Why it matters: a delete racing a write through a symlink alias could resurrect or corrupt history entries; this is the last writer in the chain to join the lock discipline.

Implemented by: PR #1917 (branch fws/u9-task-history-delete).

Acceptance:

  • TaskHistoryStore.deleteMany() resolves each id's file through the canonical key and takes the per-path file lock before unlinking.
  • Per-id failure accounting; the write-through is skipped when the whole batch failed.
  • The approved outside-workspace identity binding compares against the identity captured before the approval.

Part of the file-write-safety epic #1375, landed as a nine-PR chain tracked on #1991. Merge order: U1 -> U2 -> U3 -> U4 -> U5 -> U8 -> U6 -> U7 -> U9.

Activity

  1. easonLiangWorldedtech commented on Nov 23, 2026

    @easonLiangWorldedtech
    ContributorAuthor

    Measurement notes for #2452 (moved out of the PR body on review)

    The PR body now carries only the shape from the pull object: 9 files, +4,739 and -30 against base f015dae53265 at head a3bc3ab40b54. The numbers below were the body's measurement notes; they belong here. The earlier body sentence 'nine paths, 3160 insertions, 28 deletions' counted an older footing and is retired: the pull object against f015dae53265 is the figure to quote.

    • Mutation pricing, measured with scripts/stryker-diff.mjs own functions against merge base f98fcf7d86534d730de936637c9cb35936461c00: 379 changed executable lines over 2 counted files (safeWriteText.ts 266, safeWriteJson.ts 113) of the 500 ceiling. Its parent is the merge base, so its own footing and its cumulative charge are the same 379. Spec paths cost nothing, so the seven tests travel at no counted lines.
    • Fidelity: every blob in this half is byte equal to the campaign revision it was cut from; content is unchanged, only the cut changed.
    • Verification on this tree: seven test files printed 141 passed and 4 skipped of 145, exit 0. ESLint at --max-warnings=0 --no-warn-ignored exits 0 with no output over all nine paths, and the pinned prettier (3.9.10 per this tree's package.json) reports all nine already formatted. The suppression registry is byte identical to its head blob and --prune-suppressions moves 0 entries and 0 counts. The commit ran the hooks: lint-staged eslint and prettier both completed.
    • Later halves, priced twice (own footing, then cumulative from the named merge base), all plan prices rather than runs: guard 3ca89927e01c 416 own / 795 cumulative; publisher 3ba91778b7bf 492 / 1287; history ceddcdd46f15 463 / 1750. A later half charged against main while it sits open carries everything below it, because the workflow step bases on HEAD^1 and the tool resolves against the merge base with main. That is a property of merge order, not a claim that the half is over on its own footing. A running leg is not a pass.
    • Order is fixed by imports, not preference: guardedWrite.ts:27 and :30 import safeWriteText and resolveLockKey from safeWriteText.ts, and jsonFileRecovery.ts:8 imports resolveLockKey from the same file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions