The Saved page's short links will be bit sets over these numbers, so a number must never change or be reused. The registry is one id per line, seeded alphabetically; build_index appends new records; the validator fails on a record with no line, a repeated id or a malformed line; check_history fails when an earlier line is changed, moved or removed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3.9 KiB
Apply the accepted proposals and rebuild
Read ../rules.md and ../proposal-format.md first. You do this task yourself and start no subagents. This is the one brief that changes the repository: it is the only worker allowed to, and only one runs at a time.
You receive a staging directory <staging>, on a branch the orchestrator has checked out, and a clean tree. You do not commit, push or switch branches.
What this is for
Everything staged so far was written without touching the repository, so that many workers could run at once. This step brings the accepted proposals in, in one place, one by one, and leaves the repository in a state the orchestrator can commit: records changed, shared files rebuilt, every check green. Done means all accepted proposals are applied or reported as refused with the reason, the validator, all test suites and the history check pass, and CHANGELOG.md has an entry for the work.
Steps
python3 tools/refresh.py collect, then read<staging>/summary.md. The count of proposals with statusacceptedmust match what the orchestrator told you. Anything with the statusproposed,held,rejectedorinvalidis not applied.python3 tools/refresh.py apply --dry-run. Read what would be refused. A refusal means the record no longer says what the proposal expects (someone changed it, or two proposals touch the same field), and it is reported, not worked around. Never edit a record by hand to make a proposal fit.python3 tools/refresh.py apply. It changes the named lines and adds the history entries.- For each new track (a proposal with a track file),
python3 tools/elevation.py <id>: it writeselevation.jsonfrom the track. For a replaced track,--force. - Add the rows named in
sources_mdfields toSOURCES.md, by hand, in the existing form and place. Where a record was removed or a track dropped, take the row's counts and lists with it. python3 tools/build_index.pyrebuildstrails.csv,index.geojsonand the counts inREADME.md. Do not edit those files by hand. It also appends any new record to the end oftrail-numbers.txt(a trail's permanent number); commit that line with the record and never change, remove or reorder the lines already there.python3 tools/validate.pymust endOK <n> trails.python3 tools/check_history.pymust endOK history. A failure that names a record you changed is yours: find the cause, and if it is a proposal that was wrong, say so in your report and revert that record from git (git checkout -- <id>, then apply the rest without it, by--only). A failure in a record you did not touch is reported.- Run all the test suites:
python3 -m unittest discover tools/testsandpython3 -m unittest discover -s web/tests. The web tests hold counts of trails, tracks and emblems; if one fails only because a count moved with the change, update that count. Any other failure is a real failure: stop and report it. - Write the entry at the top of
CHANGELOG.md, in the voice of the entries already there (read the top two): a dated heading with a short title, then plain bullets saying what changed for contributors and, where a visitor can see it, what a visitor will see. State the counts that changed (trails, tracks, emblems). Say what was checked and left unchanged only where it matters. The orchestrator reads and edits it.
The hard part
Order and exactness. A proposal applied against a record that changed in the meantime is the way a good record gets damaged, which is why apply refuses it; do not defeat that check. Rebuild the shared files after the last apply, not before. And the history check compares your work with the base branch, so run it with the base the orchestrator names (--base REV), not by guess.
Report
Reply with under 200 words: the counts (applied, refused with reasons, already applied), the ids with a new or replaced track, the validator and test tails, and anything you did that the proposals did not say.