Skip to content
tishad.net
SearchCtrl K

Lessons / Part 10. Coding agents, commands and skills

75 Two copies kept in step need a rule for which one wins

An authority rule written and tested on a scratch copy comes before any sync script touches the real files.

What people usually ask

Keep my task CSV and my task notes in sync.

What comes back

A script that runs both ways on every change, and the first time it meets a task edited in both places it writes last week’s status over this morning’s.

Ask this instead

Before writing any sync: write sync_rule.md stating which copy wins. Proposed rule: tasks.csv is the authority for status and due date; the note is the authority for the description; when both hold a value for the same field and disagree, the copy with the later modified time wins, and a tie goes to tasks.csv.
Then copy both to scratch/ and make two tasks disagree on status, one with the note newer and one with the CSV newer. Show the rule applied to each by hand, before any code.
Then write sync.py with a --dry-run flag that prints every change it would make as one line each (file, task id, field, old value, new value) and writes nothing. Run the dry run on scratch/ and paste the output.
Do not run it on the real files until I say so.

Attach: Both copies, as they stand today.

Why it works: the disagreeing case is the one that loses data, so it is written down and tried on a scratch copy before the script exists.

Drafted with Fable 5.1 from my notes; chosen and edited by me.