Add the monthly refresh process as a project skill, with its tool
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / history (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

`/refresh-trails` starts a runbook an agent follows to check every record
against the pages it cites, re-check the trails that were left out, search
for missing trails and routes, update tracks and emblems, have every
proposal reviewed independently, and apply what the owner accepts.
`/refresh-trails light` verifies and re-checks only.

- Runbook, shared rules, eight worker briefs and the staged proposal
  format in `.claude/skills/refresh-trails/`.
- `tools/refresh.py`: preflight, slices, a polite link check, collect and
  apply, with tests. Workers stage proposals in `refresh/<date>/`, which
  git ignores; only the apply step edits records.
- `CONTRIBUTING.md` describes the refresh.

No trail record and nothing on the site changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-16 14:08:39 -07:00
1 parent 24bfbb2fa8
commit a46338afd5
18 files changed
+3446

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
---
name: refresh-trails
description: Run the monthly refresh of the trail dataset. Checks every record against the pages it cites, re-checks the trails that were left out, searches for missing trails and routes, updates tracks and emblems, has everything reviewed independently, and applies what the owner accepts. Use when the owner asks to refresh or update all trails, or to verify the database against current published data. Pass `light` for the cheap version (verify and re-check only).
argument-hint: "[light]"
disable-model-invocation: true
---
# Refresh the trail dataset
This is the runbook for the orchestrating agent. Once a month the whole dataset is checked against what its holders and authors publish now, and the web is searched for trails that should be in it. The work is done by many workers at once, each given one slice. They never edit the repository. They stage proposals in a directory that git ignores, a reviewer who did not write them checks them against the pages, the owner rules on what is borderline, and one worker applies what was accepted. You plan, dispatch, check and decide when to stop for the owner.
Read these first, once: `rules.md` (what every worker must follow), `proposal-format.md` (the staged format that `tools/refresh.py` collects and applies), and the briefs in `briefs/` as you reach each phase. The mechanical steps are in `tools/refresh.py`; `python3 tools/refresh.py --help` lists them.
## How to dispatch
A worker starts with nothing from this session. Give it one line and let the brief carry the rest: "Read `.claude/skills/refresh-trails/briefs/<brief>.md` and follow it. Staging directory: `<absolute path>`. Worker name: `<name>`. Slice: `<absolute path of the slice file>`." Use the most capable model you have for searching, verifying and reviewing: those fail quietly when done fast, because a cheap worker opens one page, sees nothing wrong and gives up. Cheap fast models are fine for `slices`, `links` and `collect`, which need no model at all, and for the mechanical parts of `apply`. Review is done by a different model family from the one that wrote what it reviews. Send independent work out in one message so it runs at the same time; two workers that would both use Overpass do not run at the same time. Do not poll: wait for each to finish.
## Modes
- **Full**: phases 0 to 9. Worth it about quarterly, after a big addition, when many records were written in a hurry, or when a visitor or a holder reports that something is stale.
- **Light** (`/refresh-trails light`): phases 0, 1 and 2, with `slices --since 30` so that only records not verified in the last 30 days are taken. It finds drift and dead links cheaply. Run it in the months between full runs. Its changes still go through phases 6, 7 and 8.
## Phases
**0. Preflight.** Run `python3 tools/refresh.py preflight`. It checks that the tree is clean (work on a branch, never directly on `main`), runs the validator and the tools tests, and creates `refresh/<today>/`. Then `python3 tools/refresh.py links` fetches every address in every record and in `left-out.toml` once, politely, into `links.csv` (it takes a while: it waits between requests to one site; start it in the background). *Check yourself:* preflight ends `preflight OK`; `links.csv` exists; you know which hosts refused. Refusals are never worked around, and they go to the owner in phase 7 if a record rests on a refusing site.
**1. Verify every record.** `python3 tools/refresh.py slices --n 6` (about 35 records each; `--since DAYS` keeps only records whose `hike.checked` is older than that). Dispatch one `briefs/verify-records.md` worker per `trails-NN` slice. Give each worker the rows of `links.csv` for its ids by telling it where the file is. *Check yourself:* `python3 tools/refresh.py collect` shows no problems; every id has a report row; ids marked `not-reached` go to a new worker; the warnings that a `verified` record's cited pages were not all opened are sent back to a worker, because a verification that skipped the cited pages is not one.
**2. Re-check what was left out.** The same `slices` run made `left-out-NN` slices. Dispatch `briefs/recheck-left-out.md` workers, at the same time as phase 1. Entries with reason `waiting` are the ones most likely to have changed: they are checked against their `waiting_for`. *Check yourself:* every entry has a row; read each `candidate` the workers recommend, because it may become a record.
**3. Search for missing trails and routes.** Split the continent into regions of five to eight states or provinces (for example US West, Mountain West, Central, Northeast, Southeast, Canada West, Canada East) and dispatch a `briefs/find-missing-trails.md` worker for each. Dispatch one or two `briefs/find-routes.md` workers for authors' routes. Run it at the same time as phases 1 and 2. *Check yourself:* for every region that reports `not-found`, or finds fewer than two candidates, send a second worker of a different model family, the same brief, with the first worker's list of places searched, and tell it that a quiet first pass is a reason to look harder. A search that finds nothing is common and is not proof. Every `not-found` row must say where it looked; `collect` refuses one that does not.
**4. Tracks.** Gather the ids of official trails with no track (`source.line_file = ""` and no `kind = "route"`) and of records whose track source may have changed (the source's `discovery` field says how to tell). Dispatch one `briefs/tracks.md` worker for the work that uses Overpass, one request at a time, and a second for holder data and licence reading that uses no Overpass. These are existing records. A new record from phase 3 has no track yet and cannot be given one before it exists: after phase 8 has applied it, run this phase again for the new ids, review that, and apply once more. *Check yourself:* a track more than 15% off the published length has a `length_gap_note` that explains it with facts; a route's author's terms allowing it are quoted before any route track is staged; the licence on each is what the page says.
**5. Emblems.** `grep -l 'status = "logo-not-found"' */trail.toml` lists records whose emblem was not found. Write their ids into slice files in the staging directory (about 10 to 20 each) and dispatch `briefs/emblems.md` workers. *Check yourself:* open three staged emblem files yourself or have the reviewer do it: one emblem, whole, not an organisation's lockup.
**6. Independent review.** When the workers of phases 1 to 5 are done, run `collect`. Every `change`, `declined`, `new-record`, `left-out-add` and `left-out-remove` proposal goes to a `briefs/review.md` reviewer, with about one in ten of the `verified` records as a check on the verifiers. Split the list across reviewers by worker or by region, so none reviews its own area's writer. This is not optional: in the first run a reviewer found must-fix defects in about one new record in three. Workers whose proposals are rejected revise them and the reviewer reads the revision. Run `collect` again after each round. *Check yourself:* every proposal has a decision; the `must fix` list is empty or fixed; read the rejections yourself, because a reviewer that rejects everything is as useless as one that accepts everything.
**7. Stop: the owner decides.** Put one list in front of the owner, with your recommendation on each item: borderline candidates (trails near the floor, partly built, networks, routes with thin author pages), the trails 40 to 50 miles that are well known, every `hold`, every record a verifier found closed, merged or no longer walkable (workers never propose removing one), every `declined` request and every change a holder might dispute, the changes that touch a length, an end or a track licence, and any track that is more than 15% off without a settled explanation. Decisions about what belongs are the owner's: the inclusion rule is in `README.md`, and the reasons already given are in `left-out.toml`. The owner's answers go into `<staging>/owner.csv`. An approved candidate is written up by a `briefs/find-missing-trails.md` worker, reviewed as in phase 6, and joins the list. Nothing is applied before this stop.
**8. Apply and rebuild.** Dispatch one `briefs/apply.md` worker, and only one. It applies the accepted proposals by targeted edits with their history entries, runs `tools/elevation.py` for new tracks, adds the `SOURCES.md` rows, rebuilds the shared files with `tools/build_index.py`, and runs the validator, `tools/check_history.py`, `python3 -m unittest discover tools/tests` and the web tests, and it writes the `CHANGELOG.md` entry. *Check yourself:* `git diff --stat` matches the accepted list; read the hunks yourself for anything that touches a length, an end, a licence or a track; read the changelog entry and fix its wording; rerun the validator and the history check with your own hands; no `trail.toml` outside the accepted ids changed. A change to a fact with no history entry, or a ship with no changelog entry in the same commit, is not done.
**9. Build, check, ship, follow up.** Build the site (`python3 web/build.py --out _site`) and read the built HTML for three trails that changed, one new trail, the "Considered and left out" page and the home page counts. Then commit on the branch, with the changelog entry in the same commit. Pushing to `main` starts the deploy, which publishes to the public. Ship only if the owner has said, in this run or as a standing instruction, that a finished refresh may go out; otherwise show them the branch and stop. Afterwards, go through the open issues on the project's tracker (https://github.com/swaits/longhikes/issues): answer those the refresh settled, warmly and without making the person do more work. A holder's or author's own statement in an issue is enough to rely on, quoted with its address.
## Rules for you, with the reasons
- Staging is `refresh/<date>/` at the top of the checkout, listed in `.gitignore`. It is inside the checkout so that a fresh session finds it by a relative path and every command defaults to the newest one, and ignored so nothing staged can reach a commit. A path outside the checkout would have to be told to every worker each time.
- Workers do not edit the repository, because many at once on one checkout is how work gets lost. Only phase 8 writes records.
- Every brief that may start a process says never to stop one by name or pattern. A worker once killed the owner's browser that way.
- A site that refuses automated reads is never worked around. The refusal is recorded and another source used. Requests use a plain User-Agent and carry no personal or project details.
- Overpass takes one request at a time from one worker, or it stops answering for everyone.
- The holder's or author's current page wins any disagreement, and a request that loses is recorded as `declined` in the history.
- A fact that changes needs a `[[history]]` entry and every ship needs a `CHANGELOG.md` entry in the same commit, so that the reason for a change can be found later.
- Workers propose; the owner decides what belongs.
- The staged format and every command are in `proposal-format.md` and `tools/refresh.py`. When a worker's output does not collect cleanly, send it back, rather than fixing it by hand.
@@ -0,0 +1,29 @@
# 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
1. `python3 tools/refresh.py collect`, then read `<staging>/summary.md`. The count of proposals with status `accepted` must match what the orchestrator told you. Anything with the status `proposed`, `held`, `rejected` or `invalid` is not applied.
2. `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.
3. `python3 tools/refresh.py apply`. It changes the named lines and adds the history entries.
4. For each new track (a proposal with a track file), `python3 tools/elevation.py <id>`: it writes `elevation.json` from the track. For a replaced track, `--force`.
5. Add the rows named in `sources_md` fields to `SOURCES.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.
6. `python3 tools/build_index.py` rebuilds `trails.csv`, `index.geojson` and the counts in `README.md`. Do not edit those files by hand.
7. `python3 tools/validate.py` must end `OK <n> trails`. `python3 tools/check_history.py` must end `OK 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.
8. Run all the test suites: `python3 -m unittest discover tools/tests` and `python3 -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.
9. 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.
@@ -0,0 +1,53 @@
# Find the trail's own emblem
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (for example `emblems-1`) and a slice file `<staging>/slices/<worker>.txt` of trail ids, one per line, normally records whose `shield.status` is `logo-not-found`. Stage your work in `<staging>/staged/<worker>/`.
## What this is for
The site shows each trail's own emblem beside its name, and most long trails have a single crest-style marker. A record that says "emblem not found" is a gap the site shows to the reader. Earlier "not found" and "no emblem" verdicts were often reached without a real search, so do not trust them: search again. Done means that for every id there is either a clean emblem file that came from an allowed source, or a note that says exactly which pages were looked at and what marks were seen.
## What counts as the emblem
The trail's own crest, shield, badge, roundel, blaze-shaped marker or trail-sign symbol, alone. For a US National Scenic Trail, the official rounded-triangle trail marker; for a club trail, its blaze badge or roundel; for an author's route, the emblem the author uses for it, if there is one.
Not wanted: the holding organisation's lockup (an emblem with the organisation's name set beside it as type), a wordmark alone, a banner, a photo, a map, or an agency's logo standing in for the trail (the Forest Service shield, the National Park Service arrowhead, the Parks Canada beaver, a state parks logo). If the emblem inside an organisation's lockup is the trail's crest, crop it out. If the only mark is the organisation's and it does not stand for the trail, the trail has no emblem of its own. Text that is part of the emblem (the trail's name around a roundel) is fine; a tagline or organisation name outside it is cropped off.
## Where it may come from, in order
1. The holder's or author's own site: page header, footer, about page, media or press kit, brand page, map PDFs. Look at the page source for the largest version: an SVG first, then the biggest PNG (check `srcset`, the media library path, linked "logo" or "brand" files). Photos of a trail marker on a tree are not acceptable; artwork files are. A favicon or touch icon is a last resort, and only if it is the emblem at 180 px or more.
2. The managing agency's official page for the trail.
3. Wikimedia Commons, only when the file's page identifies it as the trail's official emblem and gives its origin, and it matches what the holder's own site shows. Record the Commons page as the source.
Never: social media, shops, apps (AllTrails, FarOut), fan redraws, stock sites, image-search thumbnails, or anything you cannot trace to the holder.
## Making the file
One file per trail, `shield.svg` (an SVG of the emblem alone, or one that can be reduced to it by deleting extra elements) or `shield.png`. Crop tight to the emblem with a small even margin. Trimming a uniform border is allowed; nothing else: no redrawing, recolouring, upscaling, sharpening, AI editing or background removal. Keep transparency if the source has it. Never enlarge; take the largest original and leave it at its size (reduce only if it is over 1024 px on the long side). ImageMagick (`magick`) is installed. After making the file, open it and look at it: one emblem, whole, legible, and not blank on a white page or on a dark page. If it is white-on-transparent or black-on-transparent, say so in the note. Aim for at least 256 px on the long side; smaller only when nothing larger exists at an allowed source, and the note says so.
## For each id
Read the record (name, holder or author, official site, the `[shield]` table and its note) and look at any existing file. Then decide:
- `kept`: the existing file is already the emblem alone at 256 px or more. Stage nothing but a report row.
- `replaced`: you found the emblem alone, or a larger or cleaner version.
- `cropped`: the best art is a composite and you cropped the emblem out.
- `new`: the trail had no file and you found its emblem.
- `none-exists`: you looked at the holder's or author's site and the agency page, and the trail has no emblem of its own. Say what marks you did see and why they do not count.
- `logo-not-found`, reported as `not-found`: an emblem seems to exist (seen on a sign in a photo, mentioned in text) but no usable artwork is at an allowed source. Say where it was seen.
- `refused`: every allowed source refused automated reads.
Staged, for every outcome except `kept`: the untouched download as `original.<ext>` in `<staging>/staged/<worker>/<id>/`, the logo file for `replaced`, `cropped` and `new`, and a `change` proposal with edits for `shield.status` (`use-real-logo`, `no-logo-exists` or `logo-not-found`), `shield.logo_source` (the exact address the artwork was downloaded from), `shield.contact`, `shield.logo_file`, `shield.logo_owner` and `shield.note`, a `[[proposal.file]]` for the logo (with `old_sha256` when replacing an existing one), and `[proposal.history]`. The note says, in short plain sentences, what the emblem is, which page shows it in use, what was done to the file ("Cropped from the association's header logo; the wordmark beside the crest was cut off."), any terms the holder states about its logo, and for a trail with no file, every address you looked at.
## The hard part
Deciding what counts as the trail's own emblem when the holder shows only its organisation's mark, and finding the largest original rather than the page's thumbnail. When you are torn, say so in the report and describe both candidates; the owner decides. Do not take the quick answer from the first page: look at the page source and the media library for a larger file, and at the holder's map and brochure PDFs for the emblem in artwork form.
## Time
About 10 minutes per id; at most 90 minutes for a slice. Stop at the budget plus a third and mark the rest `not-reached`.
## Report
`report.csv` with a row per id: outcome, the file, its width and height in `remark`, the source address. Reply with under 120 words: staging path, counts by outcome, and any trail where you were torn.
@@ -0,0 +1,40 @@
# Search for trails the dataset is missing, by region
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (for example `region-us-west`) and a region: a group of states or provinces. Stage your work in `<staging>/staged/<worker>/`. Your task may also say it is a second pass and give you the list of places the first pass searched.
## What this is for
The dataset should hold every trail that meets its inclusion rule. It was built from other sites' lists, and every earlier search by list missed trails that a plain look at a state agency's pages found. One such search for a whole country once reported nothing missing, and a second worker with a different approach found seven. Done means that for your region you have searched widely and deeply, every candidate is confirmed on its holder's page, and every place you looked is listed, including the places that gave nothing.
## The inclusion rule, short
A named long-distance walking trail or route in the US or Canada, 50 miles (80 km) or longer as one continuous walk. Loops count. A trail that is partly built counts if its holder publishes it as one trail and it can be walked through, with road links allowed. A trail has a holder (agency, association or club) that names it and states its length. A route was worked out by an author, and counts only if the author has a page or book of their own that describes it as a route with a stated length; one person's trip report is not a route. The full rule is in `README.md`. Left out on purpose: gravel rail trails and canal towpaths, paved greenways, trails mainly for horses, bikes, motor vehicles or paddling, mainly driving historic trails, networks that are not one continuous trail, trails closed for good, proposed trails with nothing on the ground. Everything already decided against is in `left-out.toml` with the reason: do not propose it again unless the page now shows that the deciding fact has changed. Trails between 40 and 50 miles are not candidates.
## How to search
- Go wide first. Use many varied words: "long trail", "long-distance trail", "thru-hike", "backpacking trail", "backpacking route", "multi-day", "100-mile", "end to end", "traverse", "high route", "loop", "wilderness trail", "footpath", "state trail", and in French "sentier de longue randonnée" where it applies. Combine each with every state or province, mountain range, national forest, national park, large state park or forest, river, lake shore, coast and desert in your region.
- Then go deep on the places that list trails officially: each state or provincial agency's trail pages and trail lists, the National Recreation Trails database, trail associations and hiking clubs, guidebook publishers' catalogues, regional hiking magazines, and articles on the best long trails of a place.
- Whole-country lists were already swept and are leads only for a single trail: Wikipedia's long-distance trail lists, ALDHA-West, The Trek, thru-hiking.com, Backpacking Routes, HikeBikeTravel and LongTrailsWiki.
- For every name, check the dataset before spending time: search `trails.csv`, the `name` and any other-name fields of `*/trail.toml`, and `left-out.toml`. Many trails are in under another spelling or inside a longer trail.
- A candidate counts only after you read its holder's or author's own page and saw the length stated there (or, failing that, a government page). Apps, forums, Reddit and wikis are leads, never evidence.
## The hard part
Searching is where cheap, quick attempts fail: a few queries, a page or two per state, and "nothing found". Do the dull part: walk each state's agency trail list to the end, not just the first search page. When a state seems empty, check it from a second direction (the national forests in it, its long-distance hiking club, its National Recreation Trails) before you say so. If this is a second pass, the places listed as already searched are not a reason to skip a state; use different questions and different sources, and treat a quiet first pass as a reason to look harder, not as evidence.
## What to stage
- For a candidate that clearly meets the rule: a `new-record` proposal, with the complete record staged as `staged/<worker>/<id>/trail.toml` written as `../records.md` says. A new official trail gets no track now: write the honest absent reason ("No track has been added yet" in substance). Do not fetch any track and do not call Overpass: a later serial pass does that. If you can find the trail's OpenStreetMap route relation number through the openstreetmap.org search page or Nominatim (one light request per trail), put it in the record's `[osm]` note and in your report.
- For a candidate that is doubtful (length near the floor, partly built, a network or a loop of linked trails, a route with a thin author page, an owner who might dispute it): a `candidate` proposal with `borderline = true`, the length as stated, the page, and a recommendation (`add`, `owner` or `decline`) with the specific doubt in `summary`.
- Trails of 40 to 50 miles that are well known: a `candidate` proposal with `recommendation = "decline"` and `reason = "below-floor"`, so the owner can see them.
- `report.csv` with one row per state or province in your region: `found` (with the ids), or `not-found`, with `pages` listing every place you looked for that state: the agency pages, the lists, the queries by kind. "Not found" without where you looked is not accepted.
## Time
About 60 minutes for a region of 5 to 8 states or provinces. Stop at 80.
## Report
Reply with under 150 words: staging path, number of new records and candidates, the two or three strongest, and the states or provinces where you found nothing and how sure you are.
@@ -0,0 +1,35 @@
# Search for routes published by their authors
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (for example `routes-1`) and optionally a part of the country. Stage your work in `<staging>/staged/<worker>/`.
## What this is for
Some of the best long walks are not designated trails. A hiker or a guidebook author worked a high route, a traverse or a loop of linked trails out and published it with a stated length. The dataset lists these as routes when the author has a page or book of their own that describes the route with a length. They are missed by agency searches, because no agency holds them, and they are easy to over-count, because a trip report looks like a route. Done means you have searched the places routes are published, and each route you found is confirmed on its author's page.
## The rule, short
A route counts when its author has their own page or a published book that describes it as a route and states its length, and the length is 50 miles (80 km) or more as one continuous walk (loops count). A trip report of one person's walk is not a route. The author's name is the author the page names. Check `trails.csv`, the `name` fields of the records (`kind = "route"` ones especially) and `left-out.toml` first: the dataset already holds many routes and has decided against others, and the same route often goes under two names or sits inside a longer one.
## How to search
Search for the kinds of things authors publish: "high route", "traverse", "alternate route", "thru-hiking route", "loop", "off-trail route", "link-up", "cross-country route", with each mountain range, wilderness area, national park, desert, island, coast and territory in the US and Canada (or in your part). Look at guidebook publishers (the regional mountaineering and outdoor presses), the authors' own sites, hiker association pages that link to routes, and regional hiking magazines. A guidebook's own publisher page counts as the author's page for a book route. Routes already in the dataset have their author, year and `[[guide]]` in the record: read two to see how they are described.
## The hard part
Telling a route from a trip report, and telling the author's page from someone's summary of it. Read the author's own page, find the stated length and the sentence that calls it a route, and note whether the track is free, sold, withheld or unsettled (the record needs `[route]` and `line_policy`). Never include a track for a route. If the author's page states terms that allow passing a track on, quote them; otherwise there is no track, and the record says so. A route whose length is only given in someone else's article is a lead, not a candidate.
As with other searches, a quiet result needs a second look from another direction before you call a region empty, and "not found" must say where you looked.
## What to stage
The same as `find-missing-trails.md`: a `new-record` proposal with a staged `trail.toml` for each route that clearly meets the rule, `candidate` proposals for doubtful ones and for well-known routes under 50 miles, and a `report.csv`. Its rows are the mountain ranges, regions or sources you covered, each `found` (with ids) or `not-found` with the places looked. For a new route record, `kind = "route"`, `[route]` with the author and `line_policy`, at least one `[[guide]]`, and no track.
## Time
About 60 minutes. Stop at 80.
## Report
Reply with under 150 words: staging path, number of new records and candidates, the strongest, and where you found nothing.
@@ -0,0 +1,37 @@
# Re-check the trails that were left out
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (for example `left-out-01`) and a slice file `<staging>/slices/<worker>.txt` listing ids of entries in `left-out.toml`, one per line. Stage your work in `<staging>/staged/<worker>/`.
## What this is for
`left-out.toml` lists trails that were looked at and left out, each with the specific fact that decided it. It is shown to the public as "Considered and left out", so that a trail is not suggested and argued over again from nothing. A decision can go stale: a trail that was too short gains miles, a proposed trail gets built, a National Scenic Trail is designated, a closed trail reopens, a page the decision rests on moves. Done means that for every entry in your slice you know whether the deciding fact still holds on the page, and every entry that has changed has a proposal.
## What to do for each entry
1. Read the entry (`left-out.toml`, found by `id`), and `docs/schema.md`, section "left-out.toml", for the reasons. Note `reason`, `note`, `source_url`, `decided`, and for `waiting` entries `waiting_for`.
2. Open `source_url`. Then open the holder's or author's current page for the trail, and one government page where there is one. Check that the deciding fact is still what the entry says it is: the length against the 50 mile floor, the surface, the owner or purpose, the state of construction, whether it can be walked through.
3. For an entry whose `reason` is `waiting`, `waiting_for` is the one condition that would change the decision. Look specifically for whether that has happened: a designation made, a length settled, a gap closed, a route published. Say what you found and where, even when nothing has changed.
4. A trail the dataset now lists (look in `trails.csv` by id and name) must not stay in this file. Report it.
5. Decide:
- Still holds: stage a `verified` proposal for the entry (`target = "left-out"`) with the pages opened. Nothing is applied for it; it records that the check happened.
- The page says something different but the decision stands: a `change` proposal with `target = "left-out"` and edits to `note`, `length_mi` and `length_km` (they must agree), `source_url`. `decided` is left alone because the decision has not changed.
- The fact that decided it no longer holds, or the `waiting_for` has happened: a `candidate` proposal with your recommendation (`add` if it now clearly meets the inclusion rule, otherwise `owner`) and the sentence that changed. Do not write the record and do not remove the entry. That is the owner's decision.
- The entry's page is gone and no other page shows the fact: `could-not-check`.
## The hard part
For `waiting` entries a quick look at the trail's home page is not enough. "Waiting for designation" is answered by the agency's page, not by the advocacy group's. "Waiting for a settled length" is answered by the holder's current length, which may be in a map, a PDF or a news release. Read the whole page and say where on it the fact sits. Treat a hopeful announcement (a bill introduced, a section planned, a ribbon cutting scheduled) as not yet meeting the condition, and quote it so the owner can judge.
## What to stage
Per entry, `<staging>/staged/<worker>/<id>/proposal.toml`. For the slice, `<staging>/staged/<worker>/report.csv` with a row for every id: `verified`, `changed`, `could-not-check`, `refused` or `not-reached`, with the pages opened. Entries you recommend to the owner have outcome `changed` and a `candidate` proposal.
## Time
About 5 minutes per entry; at most 90 minutes for a slice. Stop at the budget plus a third and mark the rest `not-reached`.
## Report
Reply with under 120 words: staging path, counts, and every entry where the deciding fact has changed.
@@ -0,0 +1,44 @@
# Review proposals and new records against their pages
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a reviewer name (for example `review-1`) and a list of proposal ids (`pid`) from `<staging>/summary.md`, or the name of a worker whose proposals you review. Your work is read-only: change nothing in the repository or in anyone's staged files. You write two files, `<staging>/review/<reviewer>.md` and `<staging>/review/<reviewer>.csv`.
## What this is for
The workers who wrote the proposals meant well and are sometimes wrong. A review of freshly written records by a second reader, opening the cited pages, once found seven must-fix defects in twenty-three records: facts that the cited page did not support, a wrong start point, allowed uses left out. A record goes to the public only after someone who did not write it has opened its pages. You are that reader, and a different one from the writer, ideally from a different model family. Done means every proposal you were given has a decision and the reasons are written down.
## What to do
For each proposal, read it in `summary.md` and in its `proposal.toml`, and for a new record read the whole staged `trail.toml`. Do not read the writer's conclusions first and then look for support. Open the pages and read them. For each edit or fact:
1. Open the page named. Find the quote. Is it there, word for word, and does it say what the proposal says it does?
2. Is the page the right source? The holder's or author's own page beats everything else. If another page disagrees, which one is current?
3. Does the record, after the change, say anything the pages do not? Read every sentence of a new record's `summary`, `designation`, `length_note`, `caution` and `[route]` text for claims such as "the Forest Service describes it as" or "the association maintains it" that no cited page makes. The summary is our wording but not our invention.
4. The facts that hikers act on: the start and end (is the length the one that belongs to those ends?), allowed uses (every use the page lists is in the record), permits and fees, season, closures that affect walking through.
5. Is a cited address a page that opens and says what the record claims (not a redirect to a general page that never mentions the trail)?
6. Is the length source right: which figure belongs to which definition (built or planned, with or without side trails)?
7. Words: "track" and not "line", "author" and not "creator" in text, miles first, plain sentences, no dashes as punctuation, no private person's name, no marketing words.
8. History: is `[proposal.history]` present for every changed fact, with a role in `asked_by`, a basis and an address that does open? Was an earlier `declined` entry about the same field passed over?
9. Is the proposal narrower or wider than its summary says? Did the writer quietly drop a part of the task?
10. For a track: does the licence in `source.licence` match the terms on the page, is a route's track (`kind = "route"`) included without the author's stated terms?
## The hard part
Agreeing is easy and wrong. When a quote is there, check that the sentence is about this trail and this fact (a nearby trail, an older edition, a segment and not the whole). When the page cannot be opened, say it is unchecked; do not accept on trust and do not reject for it. Where you cannot tell which of two pages is right, say so and let the owner rule.
## What to write
`<staging>/review/<reviewer>.csv`, header `pid,digest,decision,note`, one row for every proposal you were given. `digest` is the one in `summary.md`. `decision` is `accept` (every fact supported, nothing to fix), `reject` (not supported, or wrong, with the fix described in the report), or `hold` (needs the owner: the holder might dispute it, the sources conflict, or it is a matter of what belongs). A proposal with a small fix is a `reject` and the fix is written out, so it comes back as a new proposal and is read again. `note` is the reason, with the page and the sentence.
`<staging>/review/<reviewer>.md`, compact, no preamble, in this order:
1. `## Must fix`: numbered; each names the trail id and the fields, what is wrong, the page and the sentence that shows it, and the exact replacement text.
2. `## Should fix`: the same for lesser defects.
3. `## Answers`: for each question you were asked, the evidence and the conclusion.
4. `## Checked and sound`: one line per proposal, saying what you confirmed (for example: "ends, 54.7 mi, uses, archive copy read").
5. `## Could not check`: what you could not open or read, and why.
## Report
Reply with under 120 words: the two file paths, the number of accepts, rejects and holds, and the most serious defect.
@@ -0,0 +1,43 @@
# Tracks: trails that have none, and tracks whose source has changed
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (for example `tracks-1`) and a list of trail ids in two groups: A, records that have no track, and B, records whose track source may have changed. Stage your work in `<staging>/staged/<worker>/`. If your task has you using Overpass, you are the only worker that does.
## What this is for
A track is what lets a hiker see where a trail goes. A record without one says why (`source.line_absent_reason`), and often the reason has passed: a relation has since been added to OpenStreetMap, or the holder has published open data. A track that came from a source goes stale when the source is edited. Done means that for each id you either have a staged track with the figures that go with it, or an honest statement of why none can be included.
## Group A: records with no track
1. Read the record: `source.line_absent_reason`, `[osm]`, `kind`. A route worked out by an author (`kind = "route"`) never gets a track unless the author's own page states terms that allow passing it on; quote them if they exist, and otherwise move on.
2. Look for a track that may lawfully be included, in this order: the holder's own open data under a stated open licence (or a US federal government work), the holder's written permission (the holder's statement in the public issue tracker counts, quoted with its address), then an OpenStreetMap route relation (ODbL). Read the data source's terms. If they forbid redistribution or commercial use, do not use it, and say so.
3. For an OpenStreetMap relation, first run `python3 tools/osm_track.py --id <id> <relation> --dry` and read the figures: the number of ways, the measured length, the parts. Compare with the published `length_km`. If it is within 15% and the ways are the trail (no other trail's name among them), run it again without `--dry`, with `--out <staging>/staged/<worker>`, so the files land beside your proposal. A way that carries another trail's name is excluded with `--exclude-name`, and the exclusion is said in the record.
4. Beyond 15%, find out why before staging anything: sum the length by way name, look at which parts are missing or extra, and write `source.length_gap_note` with facts. If the track is mostly another trail, or mostly unbuilt, do not stage it and say why.
## Group B: tracks whose source has changed
`source.discovery` says how to tell whether the source has a newer release. For an OpenStreetMap relation, read the relation's version and timestamp (`rel(ID); out meta;`) and compare with `release.txt` and `[osm]`. If it has not changed, stage a `verified` proposal. If it has, fetch it with `osm_track.py --force --out <staging>/staged/<worker>`, compare the new figures with the old (`verification.measured_km`, `parts`), and look at what moved: a track that has doubled or lost a third is more often an editing accident than a change in the trail. Stage a change only where the new track is the better description of the same trail. For a track from a holder, check that the holder's page and its terms still say what the record says.
## What to stage
For each track you propose, a `change` proposal for the record (or a `new-record` if it is staged with a new record) that has:
- `[[proposal.file]]` entries for `line.geojson`, `alternates.geojson` where the tool wrote it, and `release.txt`, with `source_url` and, for a file that already exists, `old_sha256` (`sha256sum <id>/line.geojson`). Do not stage `elevation.json`: it is computed from the track in the apply phase.
- edits for the fields the track changes: `source.status`, `source.licence`, `source.licence_text`, `source.attribution`, `source.osm_only`, `source.line_source`, `source.line_file`, `source.source_checked`, `source.redistributable`, `source.length_gap_note` where needed, `source.line_absent_reason` removed where a track now exists, `osm.relation` and `osm.note`, and the `[verification]` figures (`verified`, `date`, `measured_km`, `difference_percent`, `parts`, `note`) as the tool printed them. For a field the tool computes, `page` is the relation or data page and `quote` is the line of tool output.
- `[proposal.history]`, because a track change is a change to `source.line_file`.
- `sources_md`: the row `SOURCES.md` needs.
Records are copied for form from existing ones with the same kind of track (`../records.md`). Report with `report.csv`: for each id `new` (a track is staged), `replaced` (a changed track), `verified`, `none-exists` (no lawful track is available, with the pages looked at), `refused`, `could-not-check` or `not-reached`.
## The hard part
Overpass overloads easily. `osm_track.py` tries several endpoints by itself, one request at a time. Never run two fetches at once, and do not start another tool that calls Overpass while one runs. If all endpoints are down, say so and stop the track work. Do not build a track by hand and do not trace one from an app or a map. A track you cannot source is a record with an honest absent reason, which is a perfectly good record.
## Time
About 10 minutes per id. Stop at the budget plus a third.
## Report
Reply with under 150 words: staging path, counts by outcome, any track beyond 15% of the published length and what explains it, and whether Overpass was down.
@@ -0,0 +1,49 @@
# Verify records against the pages they cite
Read `../rules.md`, `../proposal-format.md` and `../records.md` first. You do this task yourself and start no subagents.
You receive a staging directory `<staging>`, a worker name (the slice name, for example `trails-03`) and a slice file `<staging>/slices/<worker>.txt` listing trail ids, one per line. Stage your work in `<staging>/staged/<worker>/`.
## What this is for
Trail pages change: a holder renames a trail, a section closes, a length is revised, a permit rule changes, a page moves. A record that was right when it was written drifts out of date, and a hiker who relies on it is the one who pays. Once a month every record is checked again against the pages it cites and against the holder's current site, so that what the dataset says is what the holder says today. Done means that for every id in your slice the record is either marked verified, with the pages you opened, or has proposals that say exactly what changed and where that is written.
## What to do for each id
1. Read `<id>/trail.toml` whole, including its `[[history]]`. Note every earlier `declined` entry and every entry asked for by someone other than the dataset's own check: those are decisions you must not quietly reverse.
2. Open every page the record cites: each `[[hike.source]]` url, `hike.official_url`, `source.publisher_url`, `source.url` and `source.permission_url` where present, the `[[guide]]` pages, and the pages named in `short_name_url` and `length_note`. Then open the holder's or author's current official site for the trail, even if the record does not cite its current address, and follow a moved page to where it went. `links.csv` in the staging directory says which of the record's addresses are dead, redirected or refused; use it to find where to start, and still read the page itself.
3. Check each of these against what the pages say now:
- the name, and the holder or author
- the length, and what it counts (built or planned, with or without side trails)
- both ends (and for a loop the usual trailhead), by place name
- allowed uses: hiking, bicycles, horses, dogs, motor vehicles
- permits, reservations and fees for walking the whole trail
- the season and the usual time to walk it
- closures or reroutes that affect walking through (a loss of access the holder has reported in writing may be recorded; day to day conditions may not)
- the official links: do the record's addresses still reach the right page
- the track's source: is the source page still there, does it still state its terms, has the relation or layer been replaced? You do not fetch tracks here. Record only whether the source and its terms still say what the record says.
- `short_name`, if present: is it still the holder's own or established use?
4. Decide:
- Nothing changed: stage a `verified` proposal naming every page you opened.
- Something changed: stage a `change` proposal with one `[[proposal.edit]]` per field, each with the `page` and the `quote` that support it, a `[proposal.history]`, and also a `verified` proposal for what you checked and found unchanged.
- Pages disagree with each other, or with the record, and you cannot tell which is right: do not edit. Write a `could-not-check` proposal that says what disagrees and which pages say what.
- A request recorded in the history is contradicted by the holder's page: a `declined` proposal, not a change.
- The pages say the trail no longer exists, has been merged into another, or can no longer be walked through: never propose removing it. Stage a `could-not-check` proposal with the pages and sentences, because whether a trail still belongs is the owner's decision.
## The hard part
A cheap read finds nothing wrong. One page per trail, a glance at the length, and a verdict of "unchanged" is how drift survives. The checks above are meant to be done on pages you actually read to the end: the length is often in a paragraph, a table or a PDF, and the permit rule is often on a separate page from the trail page. When a page offers more than one figure, say which one you used and why in `quote`. Equally, never "fix" a record from a third-party page when the holder's own page disagrees. A hiking site, a map or an app that gives a different length is a lead. The holder's page decides. If the holder's page is missing or refuses automated reads, that is `could-not-check` for that fact, not a reason to take the third-party figure.
The second trap is changing wording that is merely different. The record's wording is ours. Propose an edit only where a fact is different, not where the page words the same fact differently.
## What to stage
For each id: `<staging>/staged/<worker>/<id>/proposal.toml` in the format of `../proposal-format.md`. For your slice: `<staging>/staged/<worker>/report.csv` with a row for every id: `verified`, `changed`, `declined`, `could-not-check`, `refused` or `not-reached`, and in `pages` every address you opened. Do not touch the record.
## Time
About 6 to 8 minutes per record on average, and no more than an hour and a half for a slice of about 35. Stop at the budget plus a third and mark what is left `not-reached`.
## Report
Reply with under 150 words: your staging path, the count of each outcome, the three most important changes you propose, and any site that refused.
@@ -0,0 +1,126 @@
# The staged proposal format
Workers never edit the repository. They stage what they found as files in the staging directory, `tools/refresh.py collect` gathers and checks them, a reviewer and the owner decide, and `tools/refresh.py apply` makes the accepted changes. This file is the one place the format is defined; the briefs point here, and `collect` and `apply` enforce it.
## Layout
```
refresh/<YYYY-MM-DD>/ the staging directory, ignored by git
slices/<slice>.txt ids for each slice, one per line (written by `slices`)
links.csv written by `links`
staged/<worker>/ one directory per worker; <worker> is the slice or region name
report.csv one row for every id (or region) the worker was given
<id>/proposal.toml every proposal about that id
<id>/<files> staged files: a new record's trail.toml, tracks, an emblem
review/<reviewer>.csv a reviewer's decisions
owner.csv the owner's rulings
collected.toml, summary.md written by `collect`
apply-log.csv written by `apply`
```
`<worker>` is the slice name (`trails-03`, `left-out-01`) or, for work that is not sliced, a short name the orchestrator gives (`region-us-west`, `tracks-1`, `emblems-2`). Two workers never share a directory, so two workers can propose the same new trail without overwriting each other. `collect` reports the duplicate.
## report.csv
Header: `id,outcome,pages,remark`. One row for every id or region the worker was given, so that nothing is silently skipped.
| Column | Content |
| --- | --- |
| `id` | The trail id, the left-out id, or the region searched. |
| `outcome` | One word from the list below. |
| `pages` | The addresses opened, or for a search the places looked, separated by semicolons. Required for `verified`, `not-found`, `none-exists`, `refused` and `could-not-check`. |
| `remark` | One plain sentence. Required for `could-not-check`, `refused` and `not-found`. |
Outcomes: `verified` (every check passed; nothing to change), `changed` (at least one proposal; the pages are those opened), `declined` (a request was recorded as declined), `could-not-check` (say what and why), `refused` (every allowed source refused automated reads), `not-reached` (out of time), `found` and `not-found` (searches), `none-exists`, `kept`, `replaced`, `cropped`, `new` (emblems and tracks), `accepted` and `rejected` (review).
A `verified` row needs a `verified` proposal as well, and the pages listed should include every page the record cites. `collect` warns for each cited page that was not listed.
## proposal.toml
A file holds one or more `[[proposal]]` tables. Strings and arrays stay on one line, because `apply` replaces whole lines. Every proposal has these fields:
| Field | Meaning |
| --- | --- |
| `kind` | One of the kinds below. |
| `id` | The trail id (the directory name), or the left-out id. For a candidate, the id it would have. It must equal the directory `<id>` the file sits in. |
| `target` | `"left-out"` to change an entry of `left-out.toml`. Omitted for a record. |
| `date` | `YYYY-MM-DD`, the day the pages were read. |
| `summary` | One plain sentence saying what is proposed. |
### `verified`
The record was checked against its pages and still says what they say. Fields: `pages` (array of addresses opened). `apply` sets `hike.checked` to `date` (for a record with no `[hike]`, `source.source_checked`). These are not facts, so no history entry is added. A trail with `change` proposals also gets a `verified` proposal: it says that everything not named in a change was checked and stands.
```toml
[[proposal]]
kind = "verified"
id = "long-trail"
date = "2026-12-03"
summary = "Name, length, ends, uses, permit and season checked against the club's pages."
pages = ["https://www.greenmountainclub.org/the-long-trail/", "https://www.greenmountainclub.org/hike/"]
```
### `change`
Changes fields of a record, or of a left-out entry (`target = "left-out"`). It holds any of `[[proposal.edit]]`, `[[proposal.append]]` and `[[proposal.file]]`, and a `[proposal.history]`.
```toml
[[proposal]]
kind = "change"
id = "long-trail"
date = "2026-12-03"
summary = "The permit sentence changed."
[[proposal.edit]]
field = "hike.permit"
old = "No permit is needed."
new = "A free permit is needed for groups of ten or more."
page = "https://www.greenmountainclub.org/hike/"
quote = "Groups of ten or more need a free permit."
[proposal.history]
change = "The permit sentence now says groups of ten or more need a free permit."
basis = "The club's page says groups of ten or more need a free permit."
basis_url = "https://www.greenmountainclub.org/hike/"
asked_by = "the dataset's own check"
```
**`[[proposal.edit]]`** changes one field. `field` is named as `docs/schema.md` names it: `length_km`, `source.licence`, `hike.permit`. For an entry of an array of tables, add its position, counting from 0: `guide[0].price`, `hike.source[1].facts`. `old` is the current value, copied from the record as it stands when you read it; `apply` refuses if the record no longer has exactly that value. Leave `old` out to add a field that is absent. Leave `new` out to remove a field. `page` and `quote` are the page and the sentence on it that support the change. They are required for every edit. A number is copied as the page writes it, and `quote` is copied exactly.
**`[[proposal.append]]`** adds an entry to `hike.source`, `guide` or `link`: `table`, `page`, `quote`, and a `[proposal.append.entry]` table holding the new entry's fields. It is added after the last entry of that table. An entry whose `url` is already there is refused.
**`[[proposal.file]]`** puts a file into the record's directory: `to` (one of `line.geojson`, `alternates.geojson`, `line-<source>.geojson`, `release.txt`, `elevation.json`, `shield.svg`, `shield.png`), `from` (a path inside the proposal's own directory), `source_url` (where the file came from), and `old_sha256` (required when `to` already exists; it must match, so a file that changed meanwhile is never overwritten). `remove = true` in place of `from` deletes `to`. Track files carry no `old` and `new`; the fields that describe them (`source.status`, `source.licence`, `source.line_file`, `verification.*`) are ordinary edits in the same proposal.
**`[proposal.history]`** is the `[[history]]` entry `apply` appends: `change`, `basis`, `basis_url`, `asked_by`, and optionally `fields`. `date` is the day `apply` runs, and `outcome` is `applied`. Without `fields`, they are worked out from the edits (`hike.source[1].facts` becomes `hike.source.facts`; a track file becomes `source.line_file`; an emblem file `shield.logo_file`). The entry is required whenever a fact changes; `python3 tools/check_history.py --facts` lists what counts as a fact. `asked_by` is a role, never a person's name: `the dataset's own check`, `a hiker`, `the trail association's president`, `the route's author`.
### `declined`
A request, usually from the issue tracker, that the holder's or author's own current page contradicts. Nothing in the record changes except that a history entry with the outcome `declined` is added. It has no edits. `[proposal.history]` must name `fields`, and `basis` says which page wins and why.
### `new-record`
A new trail. The complete record is staged as `staged/<worker>/<id>/trail.toml`, with its track files and emblem beside it. Its own first `[[history]]` entry has `fields = ["record"]`. Fields: `basis_url` (the page that shows the trail meets the inclusion rule). A new record is one the worker recommends adding; a doubtful one is a `candidate` instead. `sources_md` is one line for the `SOURCES.md` row that must change: publisher, source page, licence, and `track` or `record only`. `apply` copies the directory (without `proposal.toml`) into the repository and refuses if the id exists. If the trail is in `left-out.toml`, a `left-out-remove` proposal must accompany it.
### `left-out-add`, `left-out-remove`
Adds an entry to `left-out.toml` (a `[proposal.entry]` table with the fields in `docs/schema.md`; `apply` puts it in name order), or removes the entry for `id` (`why` says why; `basis_url` is the page). A change to an existing entry is a `change` with `target = "left-out"`; its edits name plain fields (`note`, `decided`, `reason`) without a table.
### `candidate`
A trail that might belong, for the owner to decide. It is never applied. Fields: `name`, `country`, `regions`, `length_mi`, `source_url` (the holder's or author's page where the length was read), `recommendation` (`add`, `owner` or `decline`), `reason` (the left-out reason when the recommendation is `decline`), `borderline` (true when it needs the owner), and `summary` (which says what is doubtful).
### `could-not-check`
Something that could not be checked: `what` and `why`, and `tried` (the pages opened). It is never applied and is listed in the summary, so the owner sees what was not verified.
### `sources_md`
Any proposal may carry `sources_md`, a one-line note about `SOURCES.md` (that file is written by hand): the id, the publisher, the page, the licence, and `track` or `record only`. `collect` lists them.
## Decisions
A reviewer writes `review/<reviewer>.csv`, and the owner `owner.csv`, with the header `pid,digest,decision,note`. `pid` and `digest` are the ones in `summary.md` for that proposal. `decision` is `accept`, `reject` or `hold`. An `accept` counts only if its `digest` matches the proposal as it is now, so a proposal that changed after review has to be reviewed again. The owner's row wins; otherwise a `reject` or `hold` from any reviewer blocks, and an `accept` from at least one reviewer accepts. `note` gives the reason: for a `reject`, the page and the sentence that do not support the proposal.
## collected.toml and apply
`collect` writes every proposal, with its `pid` (`<worker>:<id>:<n>`), `digest`, `status` (`proposed`, `accepted`, `rejected`, `held`, `invalid`, or `info` for candidates and unchecked items) and the problems it found. Never edit it; record decisions in the CSV files and collect again. `apply` applies the `accepted` proposals only, by changing the named line, adding a line at the end of the field's table, or adding a block. It never re-serialises a record, so hand formatting and comments stay. It refuses a proposal whose `old` value no longer matches, whose staged file changed after `collect`, or whose target file changed (`sha256`), and it says so; `apply --dry-run` shows what would happen. Running it twice is safe: a proposal already applied is reported as such.
+33
View File
@@ -0,0 +1,33 @@
# Writing and changing records
Read this when a brief has you propose a change to a record, or write a new one. `docs/schema.md` is the schema: read it whole before writing, because the validator is strict and unknown fields are errors. `CONTRIBUTING.md` explains the tracks and the history.
## Copy an existing record of the same kind
Open two or three records that match what you are writing, and copy their field names, wording patterns and the order of tables. At the time of writing, `tonto-trail` is an official trail with a track from OpenStreetMap, `black-canyon` an official trail with its holder's track, and `hayduke-trail` and `across-utah-route` are routes with no track. If any of them is gone, pick another of the same kind.
## Rules that decide what a record may say
- Every fact comes from a page you read, named in a source entry with the facts it supports (`[[hike.source]]` for the hiker facts). The holder's or author's page is first choice, then a government page, then an established hiking reference named as the publisher. Leave a field out rather than guess it.
- Where sources disagree on a length, the record gives the holder's or author's figure, and `length_note` says what the others give. `length_km` is the published length, not a measurement of the track.
- A route (`kind = "route"`) worked out by an author gets no track unless the author's own page states terms that allow passing it on. An official trail's track may come from its holder under a stated open licence, from a US federal government work, from the holder's written permission (`stated-permission`, see `CONTRIBUTING.md`), or from OpenStreetMap (ODbL) with `tools/osm_track.py`. Read a data source's terms before using it. If they forbid redistribution, do not use it, and say so in `source.line_absent_reason`.
- A track that differs from the published length by more than 15% needs `source.length_gap_note` that explains the difference with facts: which parts are missing or extra. Summing the length by way name usually shows where it sits.
- `short_name` only with prior art: the holder's or author's own use, or established use among hikers, with the page named in `short_name_url`. Never invent one.
- `start_lonlat` and `end_lonlat` for a trail with no track only from a source that gives or pins the place (a government place-name record, the land manager's trailhead page, the author's page), to three decimals. If you cannot source a point, leave it out.
- Allowed uses (hiking, bicycles, horses, dogs), permits, fees and seasons are facts hikers rely on. Where a page lists uses, the record must not leave one out.
- Words, as in `rules.md`: "track", never "line"; "author"; miles first; short plain sentences; no dashes as punctuation.
## History
Every changed fact needs a `[proposal.history]` (see `proposal-format.md`), and a new record has its own first `[[history]]` entry. Before you propose a change to a field, look at the record's `[[history]]`: an earlier `declined` entry about the same field, or one asked for by the holder, is a decision you must not quietly reverse. The holder's or author's current page wins; a request that loses is proposed as `declined`.
## Shared files
Do not edit `README.md`, `trails.csv`, `index.geojson`, `SOURCES.md`, anything under `web/`, `tools/` or `docs/`. The orchestrator rebuilds the shared files after the proposals are applied. Where `SOURCES.md` needs a row, put it in `sources_md` on the proposal.
## Tools
- `python3 tools/osm_track.py --id <id> <relation> --dry` prints the figures for an OpenStreetMap route relation and writes nothing. Without `--dry` it writes `line.geojson`, `alternates.geojson` and `release.txt` into `<out>/<id>/`. Use `--out <staging>/staged/<worker>` so they land beside your `proposal.toml`; the directory `<staging>/staged/<worker>/<id>/` must exist first. Read `--help` and the header of the file.
- `python3 tools/gpx_track.py` does the same for a GPX file that a holder or hiker has sent.
- `python3 tools/elevation.py` writes `elevation.json` from a record's track inside the repository, so it runs in the apply phase and not in a worker's staging directory.
- `python3 tools/validate.py` checks the repository as it is, so it cannot check your staged work. To test a new record, copy it into a scratch copy of the repository (a plain `cp -r` into the temporary directory) and run the validator there. Errors that name your id are yours. Stale counts in shared files are not.
+49
View File
@@ -0,0 +1,49 @@
# Rules for every worker
You are a worker on the monthly refresh of this dataset. Do the task yourself and start no subagents. The orchestrator gives you a brief, a staging directory and a slice or region. Read this file and `proposal-format.md` first, then the brief.
## What the work is for
The dataset is a public list of long-distance hiking trails in the United States and Canada, one directory per trail with a `trail.toml`, and the site built from it (longhikes.org). Hikers read it critically and trail holders read it too. A record is worth having only if each fact in it can be checked on a page, so the whole refresh comes down to opening pages and writing down exactly what they say.
## Where you may write
Do not change anything in the repository, and do not commit, push or switch branches. Many workers run at the same time on one checkout, and edits to shared files collide. Read the repository freely. Everything you produce goes under `<staging>/staged/<worker>/`, in the layout in `proposal-format.md`. The orchestrator names `<staging>` (a directory such as `refresh/2026-12-01`, which git ignores) and your `<worker>` name. Never write outside it, except scratch files under the temporary directory your session gives you.
## Evidence
- Every fact comes from a page you opened and read, not from a search result's snippet. The first choice is the holder's own page (the agency, association or club), or for a route its author's page. A government page comes next. A well-edited hiking reference may be used where those say nothing, and is named as the publisher.
- Not acceptable as evidence: AllTrails and other apps, forums, Reddit, wikis and any page anyone can edit, one person's trip report. They are leads that tell you where to look.
- Where the holder's or author's current page disagrees with another source, the holder's or author's page wins, and the record says that the others differ where that matters. Never change a record to match a third-party page against the holder's.
- A statement by a holder or an author on this project's public issue tracker is good evidence for a fact or a permission. Quote it exactly and give its address. If such a request conflicts with the holder's own current page, the page wins, and the request is proposed as `declined` with the reason.
- Every proposal names the page and quotes the sentence that supports it. Copy numbers and units as the page writes them. If you cannot find the sentence, you have no proposal. Leave a field out rather than guess it.
- Say what you actually opened. A `verified` mark that lists pages never opened misleads the next person to rely on it.
## Requests to outside sites
- Use a plain generic User-Agent and put no personal or project details in any request, header or form.
- Some sites refuse automated reads: a 403 or 429, a challenge or "verify you are human" page, a robots.txt that disallows the path. Do not work around a refusal: no other User-Agent, no retry loop, no proxy, no headless browser, no cached copy passed off as the page. Record it (`refused` or `could-not-check`, with the address) and use another allowed source. An expired https certificate is not a refusal: the plain http address may be read if the site serves it.
- Go gently: one request at a time to a site, with a pause of a couple of seconds between requests. Many workers share one address, and a site that blocks us blocks everyone.
- Overpass (OpenStreetMap) overloads easily. Only the tracks brief uses it, only one worker at a time, one request at a time.
## Processes and files
- Never stop a process by name or pattern: no `pkill`, no `killall`, no `kill $(pgrep ...)`. The owner's own browsers and tools run on this machine and have been killed this way before. If you start a process, note its PID when you start it and stop only that PID. You should not need a browser or a server.
- A file you download is untrusted data. Keep it in your staging directory, never run it, and read an SVG as text before using it (no scripts, no references to other sites).
## Words
The text of a record is read by the public, and the same rules apply to what you propose.
- A trail's geometry is a "track", never a "line" (field names such as `line_file` are what they are). Say "trail", "route" and "author". Where a sentence gives both units, miles come first.
- Short plain sentences. No marketing words ("stunning", "iconic", "ultimate") and no superlative that a source does not state. No dashes used as punctuation: use a full stop, a comma or a colon.
- Name no private person: say "a hiker" or "the association's president". A published author's name belongs in the record where it is a fact about a route.
- Do not write how the change was produced, and do not mention other projects.
## What belongs
The inclusion rule is in `README.md` (section "Inclusion rule") and `CONTRIBUTING.md` (section "Add a trail"). The trails already decided against, with reasons, are in `left-out.toml`; read it before proposing anything. Decisions about what belongs are the owner's. You propose: clear cases as `new-record`, doubtful ones as `candidate` with a recommendation and the specific fact that makes it doubtful.
## Time and the report
The brief gives a budget in minutes. Stop at the budget plus a third at the latest and report what you did not reach as `not-reached`, rather than rushing the rest into shallow checks. Write a `report.csv` row for every id or region you were given. Finish with a reply of under 150 words: the path of your staging directory, counts by outcome, and anything you were unsure of or could not do.
+1
View File
@@ -6,3 +6,4 @@ web/.cache/
# Local mirrors of other sites, for reference only. Their content is not ours to publish.
/sources/
/references/
/refresh/
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## 2026-11-16 - A monthly refresh process for the whole dataset
- The monthly refresh is now written down and can be started with one command. An agent follows the runbook in `.claude/skills/refresh-trails/` (start it with `/refresh-trails`, or `/refresh-trails light` to verify and re-check only). It verifies every record against the pages it cites, re-checks `left-out.toml` and its `waiting` entries, searches for missing trails and routes by region, looks at tracks and emblems, has every proposed change reviewed by a second reader who opens the cited pages, and stops for the maintainer's ruling on borderline trails before anything is applied.
- Eight briefs, one for each kind of work, and two shared files hold the rules the workers follow: evidence from the holder's or author's own page, no work around a site that refuses automated reads, no stopping a process by name, one Overpass request at a time. The staged proposal format is defined once, in `proposal-format.md`.
- A new tool, `tools/refresh.py`, does the mechanical parts with the standard library only. `slices` splits the trails and the left-out entries into balanced slices (`--since DAYS` takes only records whose `hike.checked` is older). `links` fetches every address in every record once, with a plain User-Agent, a delay per site and no retry of a refusal, into a CSV. `collect` gathers what the workers staged into one summary. `apply` makes the accepted proposals by targeted edits to the named fields, adds the `[[history]]` entry, and refuses a proposal whose old value no longer matches. It never rewrites a record.
- Staged work lives in `refresh/<date>/`, which `.gitignore` lists. Workers do not edit the repository; only the apply step does.
- `CONTRIBUTING.md` has a short section on the refresh. There is no change to any trail record or to the site.
## 2026-11-16 - Emblems for 81 trails, a history on every record, and a page of what was left out
- 81 trails now show an emblem, up from 41. Each is the trail's own crest, badge or roundel, alone. Where the holder only publishes a larger logo, the emblem was cropped out of it and the lettering or organisation name beside it was cut off. Where the emblem sat on a white surround that could be removed cleanly, the surround was made transparent. 72 are PNG and 9 are SVG.
+8
View File
@@ -65,6 +65,14 @@ To add one:
5. If the measured length differs from `length_km` by more than 15%, explain why in `source.length_gap_note` (for example: the trail is partly unbuilt, or the published length counts side trails).
6. Add a `[[history]]` entry saying the track was refreshed and from what. Run `python3 tools/build_index.py`, then `python3 tools/validate.py` and `python3 tools/check_history.py`.
## The monthly refresh
About once a month the maintainer runs a refresh of the whole dataset. Every record is checked again against the pages it cites and against its holder's or author's current site, the trails in `left-out.toml` are checked against the reason they were left out, and the web is searched for trails and routes that are missing. Tracks whose source has changed and emblems that were not found are looked at again. Nothing it proposes reaches a record until a second reader has opened the cited pages and the maintainer has ruled on what belongs.
It is run by an agent, started with `/refresh-trails` in Claude Code (`/refresh-trails light` for the short version that only verifies records and left-out entries). The runbook, the briefs given to each worker, the rules they follow and the format they stage proposals in are in `.claude/skills/refresh-trails/`. The mechanical steps are in `tools/refresh.py`: `preflight`, `slices`, `links`, `collect` and `apply`. Staged work lives in `refresh/<date>/`, which git ignores, so that none of it can reach a commit.
You do not need any of this to report something. A trail's page has a "Report a problem" link, and a request from a holder or author on the issue tracker is read in the next refresh and sooner if it is simple.
## Style
- Plain, short English. No sales talk.
+1582
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+140
View File
@@ -0,0 +1,140 @@
"""Tests that the refresh runbook is whole: the skill's frontmatter parses, every file it
points to exists, the briefs point at the shared rules, the examples in the proposal format
are valid proposals, the commands it names exist, and the text keeps the house wording.
Run from the repository root:
python3 -m unittest discover tools/tests
"""
import os
import re
import sys
import tomllib
import unittest
sys.dont_write_bytecode = True
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import refresh as R # noqa: E402
SKILL_DIR = os.path.join(R.ROOT, ".claude", "skills", "refresh-trails")
BRIEFS = ("verify-records", "recheck-left-out", "find-missing-trails", "find-routes", "tracks",
"emblems", "review", "apply")
def text_of(*parts):
with open(os.path.join(SKILL_DIR, *parts), encoding="utf-8") as f:
return f.read()
def frontmatter(text):
m = re.match(r"^---\n(.*?)\n---\n", text, re.S)
assert m, "no frontmatter"
out = {}
for line in m.group(1).split("\n"):
k, _, v = line.partition(":")
out[k.strip()] = v.strip().strip('"')
return out
def all_docs():
names = ["SKILL.md", "rules.md", "records.md", "proposal-format.md"] + [f"briefs/{b}.md" for b in BRIEFS]
return {n: text_of(*n.split("/")) for n in names}
class SkillTest(unittest.TestCase):
def test_frontmatter(self):
fm = frontmatter(text_of("SKILL.md"))
self.assertEqual(fm["name"], "refresh-trails")
self.assertEqual(os.path.basename(SKILL_DIR), fm["name"])
self.assertGreater(len(fm["description"]), 60)
self.assertIn("Use when", fm["description"])
def test_every_file_it_points_to_exists(self):
skill = text_of("SKILL.md")
for rel in sorted(set(re.findall(r"`((?:briefs/)?[a-z\-]+\.md)`", skill))):
self.assertTrue(os.path.isfile(os.path.join(SKILL_DIR, rel)), rel)
for b in BRIEFS:
self.assertIn(f"briefs/{b}.md", skill)
self.assertTrue(os.path.isfile(os.path.join(SKILL_DIR, "briefs", b + ".md")))
for n, t in all_docs().items():
base = os.path.dirname(os.path.join(SKILL_DIR, n))
for rel in set(re.findall(r"`(\.\./[a-z\-]+\.md)`", t)):
self.assertTrue(os.path.isfile(os.path.normpath(os.path.join(base, rel))), f"{n}: {rel}")
def test_repository_files_it_names_exist(self):
for n, t in all_docs().items():
for rel in set(re.findall(r"`((?:tools|docs|web)/[A-Za-z0-9_./\-]+\.(?:py|md))`", t)):
self.assertTrue(os.path.isfile(os.path.join(R.ROOT, rel)), f"{n}: {rel}")
for rel in ("README.md", "CONTRIBUTING.md", "left-out.toml", "CHANGELOG.md", "SOURCES.md"):
self.assertTrue(os.path.isfile(os.path.join(R.ROOT, rel)))
def test_briefs_point_at_the_shared_files(self):
for b in BRIEFS:
t = text_of("briefs", b + ".md")
self.assertTrue("../rules.md" in t, b)
self.assertTrue("../proposal-format.md" in t, b)
self.assertTrue(t.startswith("# "), b)
self.assertTrue("## What this is for" in t, b)
self.assertTrue("## Report" in t, b)
def test_phases_are_in_order(self):
skill = text_of("SKILL.md")
found = re.findall(r"^\*\*(\d)\. ", skill, re.M)
self.assertEqual(found, [str(i) for i in range(10)])
self.assertIn("light", skill.lower())
def test_commands_named_exist(self):
parser = R.build_parser()
names = set(parser._subparsers._group_actions[0].choices)
skill = text_of("SKILL.md")
for cmd in re.findall(r"tools/refresh\.py (\w+)", skill + text_of("briefs", "apply.md")):
self.assertIn(cmd, names)
self.assertEqual(names, {"preflight", "slices", "links", "collect", "apply"})
def test_staging_is_ignored_by_git(self):
with open(os.path.join(R.ROOT, ".gitignore"), encoding="utf-8") as f:
lines = [l.strip() for l in f]
self.assertIn("/refresh/", lines)
def test_examples_in_the_proposal_format_are_valid(self):
doc = text_of("proposal-format.md")
blocks = re.findall(r"```toml\n(.*?)```", doc, re.S)
self.assertGreaterEqual(len(blocks), 2)
kinds = set()
for block in blocks:
data = tomllib.loads(block)
for p in data["proposal"]:
kinds.add(p["kind"])
self.assertEqual(R.validate_proposal(p, {}), [], p)
self.assertTrue({"verified", "change"} <= kinds)
def test_every_kind_and_outcome_is_documented(self):
doc = text_of("proposal-format.md")
for kind in R.KINDS:
self.assertIn(f"`{kind}`", doc)
for outcome in R.OUTCOMES:
if outcome != "not-found-emblem":
self.assertIn(f"`{outcome}`", doc)
def test_house_wording(self):
for n, t in all_docs().items():
body = re.sub(r"```.*?```", "", t, flags=re.S)
self.assertNotIn("—", body, f"{n}: em dash")
self.assertNotIn("–", body, f"{n}: en dash")
self.assertIsNone(re.search(r"\S - \S", body), f"{n}: dash used as punctuation")
for word in ("MUST", "NEVER", "ALWAYS", "CRITICAL", "IMPORTANT"):
self.assertIsNone(re.search(rf"\b{word}\b", body), f"{n}: {word}")
self.assertNotRegex(body, r"(?i)you are an? (expert|senior|world)")
self.assertNotRegex(body, r"/tmp/|/home/")
self.assertNotRegex(body, r"(?i)\bpurple\b|\bphrp\b")
def test_briefs_that_may_start_a_process_forbid_killing_by_name(self):
rules = text_of("rules.md")
self.assertIn("pkill", rules)
self.assertIn("killall", rules)
for b in BRIEFS:
self.assertIn("../rules.md", text_of("briefs", b + ".md"))
if __name__ == "__main__":
unittest.main()