{
 "notes": "EPISODE 4. WHERE IT STOOD: trunk null, no batch ever ran, 0 of 50 items used, stalled 3 of 4. The spawns of episodes 1, 2 and 3 (usaciv-targets-1, -2, -3) were all refused when their briefs were screened: episode 1 \"asked about the worker's machine\"; episodes 2 and 3 because item imp-docs, variable task, \"asks for a command's verbatim output\". Nothing of the goal has been built; earlier notes that speak of items used are wrong.\n\nDECIDED: one target batch, usaciv-targets-4 (code, attempts 3, no minutes), 26 targets = the objective's 24 + fix-tests + export-base. Read all 26 results. Wake when it settles, no timer. finish false.\nThe objective says episode 4 re-sends export alone if unlanded; that assumed the batch had run. On an empty trunk export alone ships nothing, so this episode does episode 1's work with the fallback built in: export-base (needs only imp-web, imp-rest) makes dist/ from the original web/ early, so dist/ exists even if map or game targets stick; export (needs ui, g-docs, g-layer, export-base) refreshes it at the end.\n\nHOW THE BRIEF WAS WORDED TO PASS SCREENING (keep it if anything is sent again): no variable asks for anything a tool shows, for a digest, a transcript or anything about the worker's computer. The result is \"a short report in your own words, in four parts: Files, Checks (whether the target's check passes; tests added), Gaps, For later targets\". A script scanned the brief and every variable and found none of: output, print, verbatim, paste, stdout, log, transcript, machine, command, environment, version. Import tasks say only: download the archive into .cache/, confirm its SHA-256 equals the pinned value before using it, unzip, copy byte for byte; if it differs copy nothing and stop. Game commands are called actions. Variables name, context, task, scope, done, net: each at most 1,000 characters, filled brief at most 2,800.\n\nCHECKED ON THE SOURCE THIS EPISODE: https://karpathy.ai/usaciv/usaciv-source.zip has SHA-256 52b3b2c3cf189b8ceff2376c48188db7ec88634d6a0f73ae254077ed50306314, 8,008,568 bytes, 189 files under usaciv/. `python3 -m unittest discover -s tests` runs 176 tests and 1 fails: PlanningTest.test_staleness in tests/test_builders.py gets ['b','c','cat'] instead of ['cat']. So fix-tests exists: without it no default check passes. The three import checks exit 0 on the unpacked archive and 1 on a changed copy.\n\nTARGETS: key (needs) [scope] check. D = python3 -m unittest discover -s tests. G = web/js/ext/game/. Game check = node --test G test/<key>.test.js; every game scope also holds that test file.\nimp-rest () [README.md LICENSE pyproject.toml uv.lock .gitignore pipeline/** tests/**]; imp-docs (imp-rest) [docs/**]; imp-web (imp-rest) [web/**]. imp-rest goes first so the root configuration files are in the trunk's first commit. Import checks are python3 one-liners: sha256 over the sorted files on disk (path, NUL, bytes, NUL). docs skips ARCHITECTURE.md and REBUILD.md; rest skips tests/test_builders.py and __pycache__; web takes all. They hold only until later targets change those trees: never send an import again once anything else has landed.\nfix-tests (imp-rest) [tests/test_builders.py] D. doc (imp-*, fix-tests) [docs/ARCHITECTURE.md] test -s that file && D.\nMap, all D: regions (doc) [pipeline/core/regions.py, build/{world,cities,trade,military}.py, check.py, six tests]; insets (regions) [core/geo.py, core/regions.py, web/js/render/art/terrain.js, tests/test_insets.py]; etopo, natural-earth, nlcd (doc) [own source file + own test]; ak-fixes (insets) [build/disasters.py, sources/openfema.py, sources/msha_mines.py, core/ak_fema.py, two tests]; cities (regions) [build/cities.py, two tests]; world (insets, etopo, natural-earth, nlcd) [build/world.py, check.py, three tests].\nrebuild (all eight map targets) [pipeline/**, tests/**, web/data/**, docs/REBUILD.md] python3 -m pipeline check.\ng-seams (doc) [web/js/ext/index.js, web/js/ui/pedia.js, web/js/app/help.js, G index.js, G state.js, G README.md]; g-config (g-seams) [G rules/config.js, rules/rng.js]; g-tiles (g-config) [rules/tiles.js]; g-cities (g-config) [rules/cities.js]; g-units (g-tiles, g-cities) [rules/units.js]; g-turn (g-units) [rules/turn.js]; g-layer (g-units) [G layer.js]; g-hud (g-turn) [G hud.js, save.js, game.css]; g-docs (g-hud) [G docs.js].\nui (rebuild, g-seams) [web/index.html, web/css/**, web/js/{main,camera,world,hex,terrain}.js, web/js/{render,ui,app}/**, web/js/ext/{advisors,cityView,layers}/**] node --check on every web/js file outside G.\nexport-base (imp-web, imp-rest) and export (ui, g-docs, g-layer, export-base): [dist/**, .gitignore] test -f dist/index.html.\nEvery two targets whose scopes can reach one file are ordered, and the later one also names the earlier in its needs (checked by script), so the needs sent are longer than those above.\n\nCONTRACTS THE BRIEFS FIX: pipeline/core/regions.py is the one definition: lower48 + DC, ak 02, hi 15, pr 72 on the map; GU 66, VI 78, AS 60, MP 69 off; regions finishes trade.py, military.py and check.py and leaves a named lower-48 filter in world.py and cities.py for those targets. MapProjection stays call-compatible and exact for the lower 48; true-scale Albers per inset, right of or below the lower-48 rectangle; Alaska lon > 0 becomes lon - 360; to_dict adds insets; terrain.js mirrors it and keeps SHIPPED_PROJ. etopo, natural_earth and nlcd keep the lower-48 window, URL, file and keys and add data tagged by region; PRI and VIR are US, VIR off the map; NLCD AK 2016, HI 2001, PR 2001, own projection each, unconfirmed ids marked UNVERIFIED for rebuild. world: grid grows right and down, lower-48 cells keep centre and owner id, new states and counties last, sources clipped by region, projection written to _world and world.json. cities: AK/HI/PR metros kept, snapped inside their own first state, DC the only capital. ak-fixes: pipeline/core/ak_fema.py used by disasters.py as ct_crosswalk is; msha_mines keeps 172 to 180 E for Alaska. Game: G index.js exports install(app), makes {state, subscribe, dispatch(action)} and loads rules/turn.js, layer.js, hud.js, docs.js when present (install(app, game)); addPage(title, render) from ui/pedia.js, addSection(title, rows) from app/help.js; pure rules, seeded generator in the state, every invented number in RULES (rules/config.js); yields = real city yields times constants, null = 0 and named; capture needs strictly greater strength; win by the largest city of 10 states, the science target, or top score at turn 100. export: dist/ = web/ without web/dev/, the `dist/` line removed from .gitignore.\n\nRISKS TO READ FOR IN THE RESULTS: the plane may refuse a change to a root configuration file once the trunk has files (.gitignore in export-base and export; dist/ then stays ignored: say so). rebuild downloads many public sources and may land in part. Game tests are ES modules in .js files, which an older node cannot run. ui's check is syntax only. Items: 26 of 50 before any target splits.\n\nNEXT, EPISODE 5 (the last): read goal.json's trunk, board and handed results; trust them, not these notes. If this spawn was refused, read why, mend that wording and send the same 26 targets as usaciv-targets-5 with a wake on it; do not finish on an empty trunk. If targets landed and nothing can move, set finish true. If export is stuck while export-base landed, dist/ is an older copy of web/: say so. The write-up gives the trunk URL and commit from goal.json (never made up), each target landed, each stuck with its reason, what was only syntax-checked, the data gaps, that fix-tests and export-base were added and why, and how to run: python3 -m pipeline serve then http://127.0.0.1:8765, or python3 -m http.server inside dist/; tests python3 -m unittest discover -s tests and node --test web/js/ext/game/test/<key>.test.js; data check python3 -m pipeline check; rebuild python3 -m pipeline all. Claim nothing that did not land.",
 "spawn": [
  {
   "name": "usaciv-targets-4",
   "mode": "code",
   "targets": {
    "attempts": 3
   },
   "brief": "usaciv (MIT, by Andrej Karpathy) is a browser hex map of the United States from public data: a Python pipeline (pipeline/, tests/) writes web/data/*.json and a static site (web/, plain ES modules) draws it. This goal adds docs, Alaska, Hawaii and Puerto Rico as insets, and a turn-based game. You do ONE target of it, on the goal's repository as it stands; other workers do the rest.\n\nTarget: {{name}}.\nBackground: {{context}}\nYour work: {{task}}\nChange only: {{scope}}. Scratch files go under .cache/ only.\nDone when: {{done}}\n\nRules: read docs/ARCHITECTURE.md first when it exists. Run Python as python3, never uv. No npm, frameworks or new packages. {{net}} Missing data stays null and flagged, never invented. GU, VI, AS and MP stay off the map. Keep existing behaviour, exports, shortcuts and the #turn element working. If the whole target cannot be finished, deliver the part that works and passes the check, and say what is left.\n\nYour result is a short report in your own words, in four parts. (1) Files: each file added or changed and what it does. (2) Checks: whether the target's check passes; tests added. (3) Gaps: what is unfinished, null or flagged, and why. (4) For later targets: names, signatures and data shapes to rely on.",
   "items": [
    {
     "key": "imp-rest",
     "vars": {
      "name": "import the pipeline, tests and root files",
      "context": "The repository does not hold the project yet. The original usaciv source is one public archive, https://karpathy.ai/usaciv/usaciv-source.zip, whose SHA-256 is 52b3b2c3cf189b8ceff2376c48188db7ec88634d6a0f73ae254077ed50306314. It unpacks to one folder, usaciv/, with 189 files.",
      "task": "Download the archive into .cache/, confirm its SHA-256 equals the value above before using it, and unzip it inside .cache/. Copy from its usaciv/ folder to the repository root: README.md, LICENSE, pyproject.toml, uv.lock, .gitignore and the folders pipeline/ and tests/ (81 files in all), leaving out any __pycache__ folder. Use the same names and the same bytes; add, edit or reformat nothing, and copy nothing else. If the SHA-256 differs, copy nothing and stop. One copied test, test_staleness in tests/test_builders.py, fails as shipped: copy it as it is, another target repairs it.",
      "scope": "README.md, LICENSE, pyproject.toml, uv.lock, .gitignore, pipeline/**, tests/**",
      "done": "the target's check exits 0. It fingerprints the copied files and compares them with the archive's.",
      "net": "Download the one pinned archive and nothing else."
     },
     "scope": [
      "README.md",
      "LICENSE",
      "pyproject.toml",
      "uv.lock",
      ".gitignore",
      "pipeline/**",
      "tests/**"
     ],
     "check": "python3 -c \"import hashlib as H,os;h=H.sha256();R=['README.md','LICENSE','pyproject.toml','uv.lock','.gitignore']+[os.path.join(d,f).replace(os.sep,'/') for t in('pipeline','tests') for d,_,fs in os.walk(t) for f in fs];[h.update(p.encode()+bytes(1)+open(p,'rb').read()+bytes(1)) for p in sorted(R) if '__pycache__' not in p and p!='tests/test_builders.py'];raise SystemExit(h.hexdigest()!='0972c971de5e71e4822ad76b6882b2a2cb4944ad521478c5eac637c018e28e9d')\"",
     "needs": []
    },
    {
     "key": "imp-docs",
     "vars": {
      "name": "import the docs folder",
      "context": "The repository does not hold the project yet. The original usaciv source is one public archive, https://karpathy.ai/usaciv/usaciv-source.zip, whose SHA-256 is 52b3b2c3cf189b8ceff2376c48188db7ec88634d6a0f73ae254077ed50306314. It unpacks to one folder, usaciv/, with 189 files.",
      "task": "Download the archive into .cache/, confirm its SHA-256 equals the value above before using it, and unzip it inside .cache/. Copy its usaciv/docs/ folder to docs/ at the repository root (6 files: DATA_CONTRACTS.md and the five pictures in images/). Use the same names and the same bytes; add, edit or reformat nothing, and copy nothing else. If the SHA-256 differs, copy nothing and stop.",
      "scope": "docs/**",
      "done": "the target's check exits 0. It fingerprints the copied files and compares them with the archive's.",
      "net": "Download the one pinned archive and nothing else."
     },
     "scope": [
      "docs/**"
     ],
     "check": "python3 -c \"import hashlib as H,os;h=H.sha256();[h.update(p.encode()+bytes(1)+open(p,'rb').read()+bytes(1)) for p in sorted(os.path.join(d,f).replace(os.sep,'/') for d,_,fs in os.walk('docs') for f in fs if f not in('ARCHITECTURE.md','REBUILD.md'))];raise SystemExit(h.hexdigest()!='4df0f40f0fc446db21cafee89c2493c355d1bf27ac1af1c99104432e0e36aec9')\"",
     "needs": [
      "imp-rest"
     ]
    },
    {
     "key": "imp-web",
     "vars": {
      "name": "import the web folder",
      "context": "The repository does not hold the project yet. The original usaciv source is one public archive, https://karpathy.ai/usaciv/usaciv-source.zip, whose SHA-256 is 52b3b2c3cf189b8ceff2376c48188db7ec88634d6a0f73ae254077ed50306314. It unpacks to one folder, usaciv/, with 189 files.",
      "task": "Download the archive into .cache/, confirm its SHA-256 equals the value above before using it, and unzip it inside .cache/. Copy its usaciv/web/ folder to web/ at the repository root (102 files: index.html, og-image.png, css/, js/, dev/ and the fifteen data files in data/). Use the same names and the same bytes; add, edit or reformat nothing, and copy nothing else. If the SHA-256 differs, copy nothing and stop.",
      "scope": "web/**",
      "done": "the target's check exits 0. It fingerprints the copied files and compares them with the archive's.",
      "net": "Download the one pinned archive and nothing else."
     },
     "scope": [
      "web/**"
     ],
     "check": "python3 -c \"import hashlib as H,os;h=H.sha256();[h.update(p.encode()+bytes(1)+open(p,'rb').read()+bytes(1)) for p in sorted(os.path.join(d,f).replace(os.sep,'/') for d,_,fs in os.walk('web') for f in fs)];raise SystemExit(h.hexdigest()!='2f3e28235cafe56f835bb9593080fc588afd3fe7000069b4f276ddeae4cf0ee4')\"",
     "needs": [
      "imp-rest"
     ]
    },
    {
     "key": "fix-tests",
     "vars": {
      "name": "repair the one failing test",
      "context": "As copied, one of the 176 tests fails: PlanningTest.test_staleness in tests/test_builders.py expects its second build to run only ['cat'] and gets ['b', 'c', 'cat']. Its fake builders write their files within one clock tick, and is_stale() in pipeline/__main__.py counts an input as newer when its modification time equals that of the file built from it (>=). Until this is repaired no other target's check can pass.",
      "task": "Repair only that test's fixture so it stops depending on timing: give the files the fake builders write explicit modification times (os.utime), each result later than what it was built from, so the test's assertions hold as written. Do not sleep, do not skip or weaken an assertion, and do not change pipeline/. Then run the whole suite.",
      "scope": "tests/test_builders.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "tests/test_builders.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "imp-rest"
     ]
    },
    {
     "key": "doc",
     "vars": {
      "name": "write docs/ARCHITECTURE.md",
      "context": "The project has a README and docs/DATA_CONTRACTS.md but no account of how its parts fit. Every later target (the map insets and the game) reads this file first, so it must be exact about names and files.",
      "task": "Write docs/ARCHITECTURE.md from the code as it is. Cover: the pipeline's stages (sources that fetch and process, builders, check, serve, package) and how each is run with python3 -m pipeline; the map space (Albers km, MapProjection in pipeline/core/geo.py, the hex grid in pipeline/core/hexgrid.py, the fields of world.json); each file in web/data/ with what writes it and what reads it (link docs/DATA_CONTRACTS.md instead of repeating it); the browser app (web/js/main.js and its app object, camera.js, render/, ui/, app/, and the extension loader web/js/ext/index.js with install(app)); how the tests run. End with 'Planned extensions': where the Alaska, Hawaii and Puerto Rico insets and the game in web/js/ext/game/ will attach. Describe only what the code does and mark anything you could not confirm.",
      "scope": "docs/ARCHITECTURE.md",
      "done": "docs/ARCHITECTURE.md is not empty and python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "docs/ARCHITECTURE.md"
     ],
     "check": "test -s docs/ARCHITECTURE.md && python3 -m unittest discover -s tests",
     "needs": [
      "imp-docs",
      "imp-web",
      "imp-rest",
      "fix-tests"
     ]
    },
    {
     "key": "regions",
     "vars": {
      "name": "one definition of the map's regions",
      "context": "Which states are off the map is written several times: CONUS_EXCLUDE in pipeline/build/world.py and pipeline/check.py, NON_CONUS in pipeline/build/cities.py, OFF_MAP in pipeline/build/trade.py, and lower-48 tests inside pipeline/build/military.py. Later targets draw Alaska, Hawaii and Puerto Rico as insets; this one gives the code a single definition first.",
      "task": "Add pipeline/core/regions.py: the regions, each with a key, a name and its state FIPS codes (lower48 = the 48 states and DC; ak = 02; hi = 15; pr = 72), and ONE off-map set (GU 66, VI 78, AS 60, MP 69), with helpers such as region_of(fips) and is_on_map(fips), also by postal abbreviation. Make the four builders and check.py import it in place of their own sets. In trade.py, military.py and check.py finish the change: Alaska, Hawaii and Puerto Rico count as on the map, only the four territories are off it; update their tests. In world.py and cities.py only swap the constant for a named lower-48 filter from regions.py that keeps today's results, because the world and cities targets do the real work there. Add tests/test_regions.py.",
      "scope": "pipeline/core/regions.py, pipeline/build/world.py, pipeline/build/cities.py, pipeline/build/trade.py, pipeline/build/military.py, pipeline/check.py, tests/test_regions.py, tests/test_check.py, tests/test_trade.py, tests/test_military.py, tests/test_city_view.py, tests/test_builder_checks.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/core/regions.py",
      "pipeline/build/world.py",
      "pipeline/build/cities.py",
      "pipeline/build/trade.py",
      "pipeline/build/military.py",
      "pipeline/check.py",
      "tests/test_regions.py",
      "tests/test_check.py",
      "tests/test_trade.py",
      "tests/test_military.py",
      "tests/test_city_view.py",
      "tests/test_builder_checks.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "doc",
      "imp-rest"
     ]
    },
    {
     "key": "insets",
     "vars": {
      "name": "composite MapProjection with insets",
      "context": "MapProjection in pipeline/core/geo.py turns lon/lat into map km with one Albers projection of the lower 48: fields min_x, max_y, margin; __call__(lon, lat), inverse(x, y), to_dict(). pipeline/build/world.py stores to_dict() as `projection` and other code rebuilds it with MapProjection(**projection). web/js/render/art/terrain.js mirrors the maths in its ALBERS and SHIPPED_PROJ block. Inset parameters belong in pipeline/core/regions.py.",
      "task": "Make MapProjection composite; callers stay unchanged. Lower-48 points give exactly today's values. Alaska, Hawaii and Puerto Rico each get their own Albers projection at true scale (the same km as the lower 48, no shrinking), placed in an inset rectangle right of or below the lower-48 rectangle and never over it; add a helper that lays the insets out from the lower-48 rectangle's width and height, for the world target to call. Route a point by region; an Alaska longitude above 0 becomes lon - 360 first, so the Aleutians stay in one piece. inverse(x, y) picks the inset by position. to_dict() keeps min_x, max_y, margin and adds `insets`; MapProjection(**that) rebuilds it, and a dict without insets still works. Mirror it in terrain.js, reading `insets` from world.json's projection and keeping the SHIPPED_PROJ fallback. tests/test_insets.py: old values unchanged, round trips, no overlap, 179.5 E near 179.5 W.",
      "scope": "pipeline/core/geo.py, pipeline/core/regions.py, web/js/render/art/terrain.js, tests/test_insets.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/core/geo.py",
      "pipeline/core/regions.py",
      "web/js/render/art/terrain.js",
      "tests/test_insets.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "regions",
      "imp-rest",
      "imp-web"
     ]
    },
    {
     "key": "etopo",
     "vars": {
      "name": "elevation windows for the new regions",
      "context": "pipeline/sources/etopo.py asks NOAA ERDDAP for one ETOPO1 window (lat 22 to 56, lon -131 to -60, every 5th point) as CSV and processes it into the interim lists lat, lon and alt, which pipeline/build/world.py reads for relief and sea depth.",
      "task": "Add windows for Alaska (with the Aleutians on both sides of the 180 degree meridian, which takes two requests), Hawaii and Puerto Rico, each in its own file beside the existing one. Keep the lower-48 window, URL, file name and the lat, lon and alt keys exactly as they are, so cached data stays valid; put the new samples under a new key tagged by region, for example regions: {ak: {lat, lon, alt}, hi: ..., pr: ...}. A coarser stride for Alaska is fine: say which you chose. Update the source's description. Test the URL building and the parsing in tests/test_etopo.py with a few made-up CSV lines; a region whose file is absent is left out and named, not an error.",
      "scope": "pipeline/sources/etopo.py, tests/test_etopo.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/sources/etopo.py",
      "tests/test_etopo.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "doc",
      "imp-rest"
     ]
    },
    {
     "key": "natural-earth",
     "vars": {
      "name": "Natural Earth for the new regions",
      "context": "pipeline/sources/natural_earth.py keeps, inside one lon/lat window (BBOX, around the lower 48), every country that is not the USA as foreign land, plus lakes and rivers. It tests ADM0_A3 == 'USA', so Puerto Rico (PRI) and the U.S. Virgin Islands (VIR), which Natural Earth lists as units of their own, would count as foreign land.",
      "task": "Add windows for Alaska (both sides of the 180 degree meridian), Hawaii and Puerto Rico, and give their foreign land (Canada and Russia near Alaska, the neighbouring islands near Puerto Rico), lakes and rivers tagged by region, leaving the lower-48 keys and content as they are. Treat PRI and VIR as United States, never foreign. VIR stays off the map, so it is neither foreign land nor a state: say how you mark it. Keep the pinned release tag and the file names. tests/test_natural_earth.py uses a few made-up GeoJSON features.",
      "scope": "pipeline/sources/natural_earth.py, tests/test_natural_earth.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/sources/natural_earth.py",
      "tests/test_natural_earth.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "doc",
      "imp-rest"
     ]
    },
    {
     "key": "nlcd",
     "vars": {
      "name": "land cover for the new regions",
      "context": "pipeline/sources/nlcd.py asks the MRLC GeoServer (WCS) for NLCD 2021 land cover of the lower 48 at about 2 km pixels (coverage mrlc_download__NLCD_2021_Land_Cover_L48) and stores each raster row as a string of class letters; pipeline/build/world.py looks cells up in it through AlbersEllipsoid (EPSG:5070).",
      "task": "Add the three other NLCD products: Alaska 2016, Hawaii 2001 and Puerto Rico 2001. Each has its own coverage on the same server and its own projection: record for each region the year, coverage id, projection parameters, extent, pixel size and rows under a key tagged by region, with a lookup from lon/lat to class that the world target can call. Keep the lower-48 coverage, URL, file name and keys as they are. A coverage id or projection parameter you cannot confirm from the code is written as a named constant marked UNVERIFIED, for the rebuild target to confirm against the server. tests/test_nlcd.py uses a tiny made-up raster per region, each in its own projection.",
      "scope": "pipeline/sources/nlcd.py, tests/test_nlcd.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/sources/nlcd.py",
      "tests/test_nlcd.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "doc",
      "imp-rest"
     ]
    },
    {
     "key": "ak-fixes",
     "vars": {
      "name": "Alaska fixes for FEMA and mines",
      "context": "Two sources mishandle Alaska. OpenFEMA files Alaska declarations under FEMA's own place codes (old boroughs, census areas, regional names) that do not match today's county GEOIDs; pipeline/build/disasters.py already bridges Connecticut with ct_crosswalk from pipeline/sources/openfema.py. pipeline/sources/msha_mines.py turns every positive longitude negative, which is wrong for Alaska mines in the Aleutians east of 180 degrees (172 to 180 E).",
      "task": "Add pipeline/core/ak_fema.py: a crosswalk from FEMA's Alaska place codes to current Alaska county-equivalent GEOIDs, written as a table in code with a comment saying where each row comes from; one code may map to several areas (the former Valdez-Cordova area is now Chugach and Copper River). Use it in pipeline/build/disasters.py as ct_crosswalk is used, so an Alaska declaration counts for every current area it maps to; a code with no row counts for the state only and is named in the builder's notes. In msha_mines.py keep a positive longitude when the mine is in Alaska and lies between 172 and 180; turn the others negative as now. tests/test_ak_fixes.py covers both; keep tests/test_county_lenses.py passing.",
      "scope": "pipeline/build/disasters.py, pipeline/sources/openfema.py, pipeline/sources/msha_mines.py, pipeline/core/ak_fema.py, tests/test_ak_fixes.py, tests/test_county_lenses.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/build/disasters.py",
      "pipeline/sources/openfema.py",
      "pipeline/sources/msha_mines.py",
      "pipeline/core/ak_fema.py",
      "tests/test_ak_fixes.py",
      "tests/test_county_lenses.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "insets",
      "imp-rest"
     ]
    },
    {
     "key": "cities",
     "vars": {
      "name": "keep the Alaska, Hawaii and Puerto Rico metros",
      "context": "pipeline/build/cities.py makes one city per Census metro area from ACS data and drops every metro whose first state is AK, HI or PR. Each city is snapped to a land hex of the world grid, and CAPITAL_CBSA marks Washington as the capital. The regions target left a named lower-48 filter here for this target to replace.",
      "task": "Keep the Alaska, Hawaii and Puerto Rico metros that ACS reports (Anchorage, Fairbanks, Honolulu, San Juan and the rest). Snap each city to a hex owned by its own first-listed state, never to a nearer hex of another state or region; when that state has no hex in the world file (a world built before the insets), leave the city out and name it in the builder's notes instead of failing. Washington, DC stays the only capital. A yield or field that a source lacks for these metros (Puerto Rico is absent from several) stays null and flagged, never filled with zero. Add tests/test_cities.py with a small made-up world and ACS records for all four regions; keep tests/test_city_view.py passing.",
      "scope": "pipeline/build/cities.py, tests/test_cities.py, tests/test_city_view.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/build/cities.py",
      "tests/test_cities.py",
      "tests/test_city_view.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "regions",
      "imp-rest"
     ]
    },
    {
     "key": "world",
     "vars": {
      "name": "build the world grid with insets",
      "context": "pipeline/build/world.py fits the lower 48 into a rectangle, covers it with 25 km hexes (117 x 90 today) and gives each cell an owner (a state index, water or foreign), county, elevation, water and land cover from the census boundaries, Natural Earth, ETOPO and NLCD interims. Earlier targets added a composite MapProjection and data tagged by region. The shipped web/data/world.json has no `projection` key.",
      "task": "Add Alaska, Hawaii and Puerto Rico as insets. The grid grows only to the right and down: every lower-48 cell keeps its centre and its owner id, existing states and counties keep their order, and the new states and counties come last. Clip every source by region: a lower-48 cell reads only lower-48 data, an inset cell only its own region's elevation, land cover, lakes, rivers and foreign land, and cells between insets are empty sea. Write the projection's to_dict() as `projection` in both the _world interim and web/data/world.json. When a region's data is absent from the interims, build the lower 48 as before, leave that region's values null and name it in the notes. Update pipeline/check.py for the larger grid and the new states. Add tests/test_world.py on a small made-up country; keep tests/test_gdp_fill.py and tests/test_check.py passing.",
      "scope": "pipeline/build/world.py, pipeline/check.py, tests/test_world.py, tests/test_gdp_fill.py, tests/test_check.py",
      "done": "python3 -m unittest discover -s tests exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "pipeline/build/world.py",
      "pipeline/check.py",
      "tests/test_world.py",
      "tests/test_gdp_fill.py",
      "tests/test_check.py"
     ],
     "check": "python3 -m unittest discover -s tests",
     "needs": [
      "insets",
      "etopo",
      "natural-earth",
      "nlcd",
      "imp-rest",
      "regions"
     ]
    },
    {
     "key": "rebuild",
     "vars": {
      "name": "run the pipeline and commit the data",
      "context": "The eight map targets changed the sources and builders but ran none of them: web/data/ still holds the lower-48 data that came with the project. `python3 -m pipeline all` downloads every source (kept under data/raw/, which is not committed), processes them, builds web/data/*.json and checks the result.",
      "task": "Run the whole pipeline and commit the rebuilt web/data/. Fix what the real data breaks anywhere under pipeline/ and tests/, and settle the constants earlier targets marked UNVERIFIED. If a source is down or lacks a region, keep going: keep the committed data for what cannot be rebuilt, leave the new regions' values null and flagged, and never make up data or loosen a check to hide a gap. Write docs/REBUILD.md: the steps to repeat the rebuild, each source with its date and whether it covered Alaska, Hawaii and Puerto Rico, every fix you made and why, and every gap that is left. The unit tests must still pass.",
      "scope": "pipeline/**, tests/**, web/data/**, docs/REBUILD.md",
      "done": "python3 -m pipeline check exits 0 on the committed web/data/.",
      "net": "This target alone may download the pipeline's datasets."
     },
     "scope": [
      "pipeline/**",
      "tests/**",
      "web/data/**",
      "docs/REBUILD.md"
     ],
     "check": "python3 -m pipeline check",
     "needs": [
      "regions",
      "insets",
      "etopo",
      "natural-earth",
      "nlcd",
      "ak-fixes",
      "cities",
      "world",
      "imp-rest",
      "imp-docs",
      "imp-web",
      "fix-tests"
     ]
    },
    {
     "key": "g-seams",
     "vars": {
      "name": "seams for the game extension",
      "context": "web/js/ext/index.js lists extension folders in MODULES and calls each one's install(app) with the app object from web/js/main.js. The Almanac (web/js/ui/pedia.js) and the help sheet (web/js/app/help.js, ROWS) give an extension no way to add content. The game will live in web/js/ext/game/, always on, not a mode (no registerMode). Later targets fill it in without editing your files.",
      "task": "(1) Add './game/index.js' to MODULES. (2) Export addPage(title, render) from pedia.js and addSection(title, rows) from help.js; each works before and after initPedia/initHelp, and changes nothing when unused. (3) game/index.js exports install(app): it makes the game object {state, subscribe(fn), dispatch(action)}, then loads ./rules/turn.js, ./layer.js, ./hud.js and ./docs.js when they exist (a missing one is skipped) and calls install(app, game) on the last three; dispatch hands the action to applyAction from rules/turn.js and tells subscribers. (4) state.js: JSDoc typedefs for the game state (player state, turn, seeded generator state, cities with owner, population, food store, build queue, districts, wonders; units; score; victory) and the actions (queue, move, attack, endTurn, newGame), and createState(). (5) README.md: the file map and each module's planned exports. Test with node:test, no DOM.",
      "scope": "web/js/ext/index.js, web/js/ui/pedia.js, web/js/app/help.js, web/js/ext/game/index.js, web/js/ext/game/state.js, web/js/ext/game/README.md, web/js/ext/game/test/g-seams.test.js",
      "done": "node --test web/js/ext/game/test/g-seams.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/index.js",
      "web/js/ui/pedia.js",
      "web/js/app/help.js",
      "web/js/ext/game/index.js",
      "web/js/ext/game/state.js",
      "web/js/ext/game/README.md",
      "web/js/ext/game/test/g-seams.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-seams.test.js",
     "needs": [
      "doc",
      "imp-web"
     ]
    },
    {
     "key": "g-config",
     "vars": {
      "name": "game constants and seeded generator",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. City yields in web/data/cities.json are real figures under the keys food, production, gold, science and culture, and span many orders of magnitude.",
      "task": "Write rules/config.js: one frozen RULES object holding EVERY invented number of the game, each with a one-line comment: the constants that turn a city's real yields into per-turn game yields (say how you compress their range; null counts as 0); the food needed to grow; the costs of districts, wonders, scouts and armies; movement costs by water, relief and cover; unit strengths and sight; rival growth; score weights; the science target; the states needed to win (10); the turn limit (100). Write rules/rng.js: a small seeded generator whose whole state is plain data kept in the game state, next(state) returning [value, newState]. Tests: RULES is frozen and has every group above; the generator repeats for the same seed and differs for another.",
      "scope": "web/js/ext/game/rules/config.js, web/js/ext/game/rules/rng.js, web/js/ext/game/test/g-config.test.js",
      "done": "node --test web/js/ext/game/test/g-config.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/rules/config.js",
      "web/js/ext/game/rules/rng.js",
      "web/js/ext/game/test/g-config.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-config.test.js",
     "needs": [
      "g-seams",
      "imp-web"
     ]
    },
    {
     "key": "g-tiles",
     "vars": {
      "name": "yields, movement cost and A* paths",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. world.json describes the hex grid (grid.cols, grid.rows, owner, water, relief, cover per cell); web/js/hex.js holds the app's hex geometry, which you may read for the offset convention.",
      "task": "Write rules/tiles.js. cityYields(city, RULES): a city's per-turn food, production, gold, science and culture from its real yields and the constants, a null yield counted as 0 and named in a `missing` list. moveCost(world, cell, RULES): the cost to enter a hex from its water, relief and cover; water and foreign cells cannot be entered. neighbors(world, cell): the up to six neighbours, in the app's offset convention. findPath(world, from, to, RULES): A* returning the cheapest list of cells and its cost, or null when there is none. Tests on a small made-up world: yields with nulls, a wall of water, a cheaper detour around hills, no path, and that the path found is the cheapest one.",
      "scope": "web/js/ext/game/rules/tiles.js, web/js/ext/game/test/g-tiles.test.js",
      "done": "node --test web/js/ext/game/test/g-tiles.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/rules/tiles.js",
      "web/js/ext/game/test/g-tiles.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-tiles.test.js",
     "needs": [
      "g-config",
      "imp-web"
     ]
    },
    {
     "key": "g-cities",
     "vars": {
      "name": "city growth, build queue and rivals",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. This module takes per-turn yields as an argument; it does not import rules/tiles.js.",
      "task": "Write rules/cities.js. assignOwners(cities, playerState): a city belongs to the state its `states` list names first; the player's state gives 'player', the others a rival named by state. growCity(city, yields, RULES): food fills a store and raises the game population when it reaches the RULES threshold, which rises with size. enqueue(city, item) and advanceQueue(city, production, RULES): production is spent on the first item and completes districts, wonders (each wonder once in the whole game), scouts and armies; a finished unit is returned for the units module to place. rivalTurn(city, RULES): a passive rival only grows and adds defence at RULES rates; it never builds units or attacks. cityStrength(city, RULES) from population, districts and garrison. Everything returns new objects. Tests: growth across a threshold, a queue finishing two items in one turn, the one-wonder rule, a rival's turn.",
      "scope": "web/js/ext/game/rules/cities.js, web/js/ext/game/test/g-cities.test.js",
      "done": "node --test web/js/ext/game/test/g-cities.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/rules/cities.js",
      "web/js/ext/game/test/g-cities.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-cities.test.js",
     "needs": [
      "g-config",
      "imp-web"
     ]
    },
    {
     "key": "g-units",
     "vars": {
      "name": "scouts, armies and capture",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. rules/tiles.js (findPath, moveCost) and rules/cities.js (cityStrength) have landed; use them as they are.",
      "task": "Write rules/units.js. createUnit(kind, owner, cell) for 'scout' and 'army', with movement points, sight and strength from RULES. moveUnit(state, unitId, toCell, world): the unit follows findPath as far as this turn's movement points allow and keeps the rest of the route for the next turn. Scouts reveal the cells within RULES sight. attackCity(state, unitId, cityId, RULES): an army beside a city takes it only when the army's strength is strictly greater than cityStrength(city); the city then changes owner and the army becomes its garrison; otherwise the army is lost and the city keeps its owner; equal strength does not capture. resetMoves(state) at the start of a turn. Any randomness comes from the state's seeded generator. Tests: a move over several turns, a target that cannot be entered, a capture, a failed attack, equal strength.",
      "scope": "web/js/ext/game/rules/units.js, web/js/ext/game/test/g-units.test.js",
      "done": "node --test web/js/ext/game/test/g-units.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/rules/units.js",
      "web/js/ext/game/test/g-units.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-units.test.js",
     "needs": [
      "g-tiles",
      "g-cities",
      "imp-web"
     ]
    },
    {
     "key": "g-turn",
     "vars": {
      "name": "turn order, victory and a 100-turn test",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. The other rule modules have landed. game/index.js loads rules/turn.js when it exists and hands every dispatched action to its applyAction.",
      "task": "Write rules/turn.js. newGame(data, playerState, seed) builds the state from the cities and world data. endTurn(state, world, RULES) runs one turn in a fixed order (player yields, growth, build queues, new units placed, the rivals' turn, science and score totals, victory, turn + 1) and returns a new state. applyAction(state, action, world) is the one reducer for the actions state.js documents (queue, move, attack, endTurn, newGame). score(state, owner) from RULES weights. victory(state): the player wins by owning the largest city of each of 10 different states, or by reaching the RULES science target, or by holding the top score when turn 100 ends; otherwise the top rival wins. Test: a seeded 100-turn game on a made-up map with a scripted player ends decided and replays identically from the same seed; each of the three victories can be reached; a null yield adds 0.",
      "scope": "web/js/ext/game/rules/turn.js, web/js/ext/game/test/g-turn.test.js",
      "done": "node --test web/js/ext/game/test/g-turn.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/rules/turn.js",
      "web/js/ext/game/test/g-turn.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-turn.test.js",
     "needs": [
      "g-units",
      "imp-web"
     ]
    },
    {
     "key": "g-layer",
     "vars": {
      "name": "draw the game on the map",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. game/index.js calls install(app, game) of layer.js. The app's own extensions show how to draw on the map and take clicks: web/js/ext/layers/ and web/js/ext/cityView/mapLayer.js.",
      "task": "Write layer.js exporting install(app, game). Draw the game with the app's existing drawing hooks: a tint or border for the player's cities and for each rival's, units as simple markers on their hexes, and the selected unit's reachable hexes and planned path. A click on one's own unit selects it; a click on a reachable hex dispatches a move action; a click on another owner's city beside the selected army dispatches an attack action. Leave the app's own clicks alone when nothing of the game is selected, and redraw when the game state changes (game.subscribe). Keep the geometry and the hit-testing in pure exported functions and test those without a DOM. In your report, say whether the drawing was seen in a browser or only tested through those functions.",
      "scope": "web/js/ext/game/layer.js, web/js/ext/game/test/g-layer.test.js",
      "done": "node --test web/js/ext/game/test/g-layer.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/layer.js",
      "web/js/ext/game/test/g-layer.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-layer.test.js",
     "needs": [
      "g-units",
      "imp-web"
     ]
    },
    {
     "key": "g-hud",
     "vars": {
      "name": "game panel, End Turn and saving",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. game/index.js calls install(app, game) of hud.js. addSection(title, rows) is exported by web/js/app/help.js, whose ROWS list the keys the app already uses.",
      "task": "Write hud.js exporting install(app, game): a small always-there panel clear of the top bar and the panels, and leaves #turn alone. Before a game: a state picker and Start. During one: the turn, the player's per-turn yields, score and progress toward each victory, the player's cities with their build queue (add a district, wonder, scout or army), End Turn (button and an unused key), and at the end a result banner with New Game. hud.js adds its own stylesheet link to game.css and edits neither index.html nor the app's CSS. save.js: save(state) and load() on localStorage under one key that carries a format number, including the seeded generator's state; save after every turn, restore on start, and ignore a broken or older save. List the keys with addSection. Test save.js with a fake storage object, and the pure view functions.",
      "scope": "web/js/ext/game/hud.js, web/js/ext/game/save.js, web/js/ext/game/game.css, web/js/ext/game/test/g-hud.test.js",
      "done": "node --test web/js/ext/game/test/g-hud.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/hud.js",
      "web/js/ext/game/save.js",
      "web/js/ext/game/game.css",
      "web/js/ext/game/test/g-hud.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-hud.test.js",
     "needs": [
      "g-turn",
      "imp-web"
     ]
    },
    {
     "key": "g-docs",
     "vars": {
      "name": "the game's rules in the Almanac",
      "context": "The game is the always-on extension in web/js/ext/game/, not a mode. The player picks a state and owns the cities whose `states` list names it first; other states are passive rivals. Rules are pure ES modules in rules/ (no DOM, no Math.random). README.md and state.js there hold the agreed names. Tests are ES modules for node --test on made-up fixtures, never web/data. game/index.js calls install(app, game) of docs.js. addPage(title, render) is exported by web/js/ui/pedia.js; the rules and the panel have landed.",
      "task": "Write docs.js exporting install(app, game): add an Almanac page, 'The Game', with addPage. From the code as it landed, it explains how to start, what each yield does, growth, the build queue, districts, wonders, scouts and armies, taking weaker cities, passive rivals, the three ways to win, the score and saving. Every number on the page is read from RULES when the page is drawn, never typed into the text. The page says plainly that these constants are invented for the game, that city yields are real data scaled by them, and that a missing yield counts as 0. Keep the text builder a pure function (RULES in, HTML text out) and test that it covers every group of RULES and that changing a RULES value changes the text.",
      "scope": "web/js/ext/game/docs.js, web/js/ext/game/test/g-docs.test.js",
      "done": "node --test web/js/ext/game/test/g-docs.test.js exits 0.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/js/ext/game/docs.js",
      "web/js/ext/game/test/g-docs.test.js"
     ],
     "check": "node --test web/js/ext/game/test/g-docs.test.js",
     "needs": [
      "g-hud",
      "imp-web"
     ]
    },
    {
     "key": "ui",
     "vars": {
      "name": "show the insets in the app",
      "context": "After the rebuild target, web/data/ holds Alaska, Hawaii and Puerto Rico in inset rectangles right of and below the lower 48, and world.json carries `projection` with an `insets` list (see docs/REBUILD.md). The app still assumes one lower-48 rectangle: home view, minimap, camera limits, and texts and counts ('contiguous United States', 'lower 48', '#3 of 49'). Leave web/js/ext/index.js and web/js/ext/game/ alone; keep addPage and addSection.",
      "task": "Make the app show the insets. Draw each inset with a thin frame and a label, and nothing between insets; the minimap shows the whole grid; the camera can pan and zoom to them, and state selection, search and fly-to work for the three new states. landBox and fitScale in web/js/main.js keep their lower-48 meaning, so the home view and saved links stay as they are. Correct every text and count that says or assumes the lower 48 or 49 states where that is now wrong (index.html, the Almanac in ui/pedia.js, advisor notes and averages, rank denominators), taking counts from the data. A value that is null for a new region shows as 'no data', not 0. Without insets in web/data the app works as before. Say which views were seen in a browser and which only syntax-checked.",
      "scope": "web/index.html, web/css/**, web/js/main.js, web/js/camera.js, web/js/world.js, web/js/hex.js, web/js/terrain.js, web/js/render/**, web/js/ui/**, web/js/app/**, web/js/ext/advisors/**, web/js/ext/cityView/**, web/js/ext/layers/**",
      "done": "node --check passes for every .js file under web/js outside web/js/ext/game/.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "web/index.html",
      "web/css/**",
      "web/js/main.js",
      "web/js/camera.js",
      "web/js/world.js",
      "web/js/hex.js",
      "web/js/terrain.js",
      "web/js/render/**",
      "web/js/ui/**",
      "web/js/app/**",
      "web/js/ext/advisors/**",
      "web/js/ext/cityView/**",
      "web/js/ext/layers/**"
     ],
     "check": "find web/js -name '*.js' -not -path 'web/js/ext/game/*' -print0 | xargs -0 -n1 node --check",
     "needs": [
      "rebuild",
      "g-seams",
      "imp-web",
      "insets"
     ]
    },
    {
     "key": "export-base",
     "vars": {
      "name": "first copy of dist/",
      "context": "The site is static: web/ served as it is. The goal wants that folder committed as dist/, equal to web/ without the dev-only folder web/dev/. The .gitignore copied from the original has a line `dist/` that hides it. pipeline/package.py makes a zip for upload; that is not what is asked here. This target makes a first copy early, so the repository always has a dist/ that runs; the export target refreshes it once the insets and the game have landed.",
      "task": "From web/ as it stands now, copy everything under web/ except web/dev/ into dist/ under the same relative paths and with the same bytes (dist/index.html, dist/og-image.png, dist/css/, dist/js/, dist/data/). No zip, no source archive, no build step, no minifying. Remove only the `dist/` line from .gitignore and keep its other lines. dist/ must run when served by any static file server, for example python3 -m http.server started inside dist/. In your report, say whether dist/ matches web/ without web/dev/.",
      "scope": "dist/**, .gitignore",
      "done": "dist/index.html exists.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "dist/**",
      ".gitignore"
     ],
     "check": "test -f dist/index.html",
     "needs": [
      "imp-web",
      "imp-rest"
     ]
    },
    {
     "key": "export",
     "vars": {
      "name": "final dist/ with insets and game",
      "context": "The site is static: web/ served as it is. The goal wants that folder committed as dist/, equal to web/ without the dev-only folder web/dev/. The .gitignore copied from the original has a line `dist/` that hides it. pipeline/package.py makes a zip for upload; that is not what is asked here. An earlier target, export-base, already made dist/ from the original web/; since then the insets, the rebuilt data and the game have landed in web/.",
      "task": "Refresh dist/: empty it, then from web/ as it stands now, copy everything under web/ except web/dev/ into dist/ under the same relative paths and with the same bytes (dist/index.html, dist/og-image.png, dist/css/, dist/js/, dist/data/). No zip, no source archive, no build step, no minifying. Remove only the `dist/` line from .gitignore and keep its other lines. dist/ must run when served by any static file server, for example python3 -m http.server started inside dist/. In your report, say whether dist/ matches web/ without web/dev/ and whether web/js/ext/game/ is in it.",
      "scope": "dist/**, .gitignore",
      "done": "dist/index.html exists.",
      "net": "Download nothing: work from the repository's files."
     },
     "scope": [
      "dist/**",
      ".gitignore"
     ],
     "check": "test -f dist/index.html",
     "needs": [
      "ui",
      "g-docs",
      "g-layer",
      "export-base",
      "imp-rest"
     ]
    }
   ]
  }
 ],
 "read": [
  "usaciv-targets-4/imp-rest",
  "usaciv-targets-4/imp-docs",
  "usaciv-targets-4/imp-web",
  "usaciv-targets-4/fix-tests",
  "usaciv-targets-4/doc",
  "usaciv-targets-4/regions",
  "usaciv-targets-4/insets",
  "usaciv-targets-4/etopo",
  "usaciv-targets-4/natural-earth",
  "usaciv-targets-4/nlcd",
  "usaciv-targets-4/ak-fixes",
  "usaciv-targets-4/cities",
  "usaciv-targets-4/world",
  "usaciv-targets-4/rebuild",
  "usaciv-targets-4/g-seams",
  "usaciv-targets-4/g-config",
  "usaciv-targets-4/g-tiles",
  "usaciv-targets-4/g-cities",
  "usaciv-targets-4/g-units",
  "usaciv-targets-4/g-turn",
  "usaciv-targets-4/g-layer",
  "usaciv-targets-4/g-hud",
  "usaciv-targets-4/g-docs",
  "usaciv-targets-4/ui",
  "usaciv-targets-4/export-base",
  "usaciv-targets-4/export"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "usaciv-targets-4"
  ]
 },
 "finish": false
}
