stale-base-drops-rows-from-a-shared-ledger

Detects and repairs stale-tree merges that silently drop rows from shared hand-edited ledger files.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill stale-base-drops-rows-from-a-shared-ledger-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stale-base-drops-rows-from-a-shared-ledger
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/stale-base-drops-rows-from-a-shared-ledger
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill stale-base-drops-rows-from-a-shared-ledger-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When multiple parallel sessions append rows to one shared ledger file (a tracker data.js, CHANGELOG, registry, or manifest), a branch whose tree is stale can silently delete other sessions' rows on merge — with no file deletion, no merge conflict, an ordinary-looking diffstat, and passing validators. File-level deletion gates (git diff --diff-filter=D) never fire, and id-only checks miss rows whose bodies were rolled back while their ids survived. ## Core Features & Use Cases - Row-level audit against current origin/main: Parse both sides of the ledger and compare entries by id AND body, reporting REMOVED rows and CHANGED BUT NOT MINE rows that an id-only check cannot see. - Rebuild-based recovery: Take main's ledger wholesale and replay your own scripted edits onto it, rather than hand-resolving interleaved JSON conflicts — additive by construction so it cannot revert anyone. - Post-merge verification: Re-read main after merging to confirm your rows are present and current, and re-audit because the staleness window reopens with every sibling merge. - Use Case: Before merging a long-open PR that edits a shared data.js tracker, run the audit script against origin/main; it names the 3 tasks, 2 decisions, and 8 artifacts your branch would have deleted, then you rebuild by re-running your splicing script on main's file. ## Quick Start Ask the AI to audit whether your current branch would drop or roll back any rows in the shared ledger file compared to origin/main before merging.

Frequently Asked Questions about stale-base-drops-rows-from-a-shared-ledger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my git branch will delete other sessions' changes on merge?▼

Diff against current origin/main, not your own base — a diff against your base is clean by construction. For shared ledger files, parse both sides with git show and compare rows by id and body to find removals and rollbacks.

Why does git merge lose data with no conflict and no deleted files?▼

A stale tree (from git reset --soft or committing an old worktree with git add -A) makes your commit literally record removing other sessions' rows, so git applies it cleanly. File-level deletion gates stay empty because no file was deleted — only content was reverted.

Does git diff --diff-filter=D catch stale branch data loss?▼

No. That gate only detects whole-file deletions. When a stale tree reverts content inside a shared ledger, the filter output is empty and the diffstat looks like an ordinary large edit, so the loss passes undetected.

How do I recover a branch that is about to revert upstream ledger rows?▼

Rebuild rather than merge-and-resolve: check out main's version of the ledger file, then re-run your own scripted splicing edits onto it. This is additive by construction and cannot revert anyone else's rows.

Why is an id-only check not enough for shared ledger integrity?▼

A row can survive with its id intact while its body is rolled back to an older version. Comparing only ids misses reverted edits, so the audit must compare full row bodies and flag entries changed by someone else.

When should I run the stale-base ledger audit?▼

Run it immediately before merging, not at wrap-up, because the staleness window reopens every time another PR lands. Re-run after rebuilding and verify again on main after the merge completes.