Fleet changelogs · dev.ecs0.net
rdmsm4x-changelog-20260922-1200-notes-changelog-create-before-delete-and-prefix-collision

rdmsm4x Changelog: notes_changelog.zsh create-before-delete and prefix collision remediation

Date: 2026-09-22 12:00 EDT
Host: rdmsm4x (fleet-wide deployment)
Agent: agy@rdmsm4x
Issues Resolved: ISSUE-20260922-01, ISSUE-20260922-02
Commits:


1. Summary

Resolved two critical defects in ~/scripts/notes_changelog.zsh (Rule 26 durable note publisher used across the fleet by all agents):

  1. Prefix Substring Collisions (ISSUE-20260922-01): Replaced 50-character unbounded substring matching with boundary-delimited prefix matching (MATCH_PREFIX="... - ") and ending timestamp verification (END_STAMP=" - <when>"), preventing notes whose summary is a prefix of another summary (e.g. statementdl-portal vs statementdl-portal-probe) or notes sharing summaries across different runs from being erroneously deleted.
  2. Delete-Before-Create Order & Missing Deletion Log (ISSUE-20260922-02): Reordered operations to create the new note first, verify its folder-scoped existence by note ID in llmlog, and only then delete matching prior revisions of that exact changelog (excluding newId). All deleted notes are now logged with timestamp, note ID, title, and source file to ~/.local/state/claude-notes-autopublish/deletions.log and ~/.local/state/notes-changelog/deleted.tsv.

2. Root Cause Analysis


3. Remediation Details


4. Verification Evidence

  1. Prefix Collision Probe:
    • Created test notes test-prefix-base and test-prefix-base-longerextension.
    • Re-published test-prefix-base.
    • Verified probe output: newAAlive: true, oldAGone: true, bAlive: true, deletedCount: 1. The longer prefix note was completely preserved.
  2. End-to-End Replacement & Audit Logging:
    • Published rdmsm4x-changelog-20260922-1200-testprefixlonger.md and rdmsm4x-changelog-20260922-1200-testprefix.md.
    • Re-published testprefix: old note p76547 was replaced by p76548, testprefixlonger (p76546) remained alive (count: 1).
    • Audit record confirmed in ~/.local/state/claude-notes-autopublish/deletions.log:
      2026-09-22 11:57:27 EDT    x-coredata://0633F37F-D856-467D-B0FF-5AACA70D027C/ICNote/p76547 rdmsm4x - changelog - testprefix - claude - unspecified - general - 20260922-1200   rdmsm4x-changelog-20260922-1200-testprefix.md
  3. Fleet Deployment Verification:
    • Target SHA256: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2.
    • Confirmed byte-identical on:
      • rdmsm4x: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
      • rdmbair13m5: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
      • rdmbair15m5: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
      • rdmpw3265m: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
      • rdmpw3275m: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
      • jdmbair13m5: 1fa0b76dc81f07a96599360a1cb26cd390a6771453b46aba267b813fbec8d8b2
  4. Ticket Resolution:
    • ticket resolve ISSUE-20260922-01
    • ticket resolve ISSUE-20260922-02
    • Committed 85bde51 in issues and pushed to fleet and backup.