The star-map family was the last unported part of the tree, and it never had a ticket. Two of its scripts become `reach atlas map` verbs, nested under atlas like planet (D-243: the Reach map is the ladder's top rung): - `reach atlas map data [--check]` regenerates client/data/star_map_data.json. The regenerated file differs by one line: `_meta.note`, which named the old script's path. - `reach atlas map svg` renders the concentric SVG (+ PNG), byte-identical to the old script's output on the same data. make check-star-map and star-map-data stay as one-line delegates, because pre-pr-client and pre-pr-validate depend on check-star-map. generate-star-map.py, its seed, sculpt-star-map.py and tune-star-map-topology.py are archived, not ported. The generator rewrites docs/design/star-map.json unconditionally from an S-NNN-keyed seed, so re-running it would erase the GJ migration and every hand edit since; sculpt and tune only understand S-NNN edges. .claude/rules/diagrams.md was telling agents to "edit the generator and re-run it". It now distinguishes the live concentric render, the seven frozen S-keyed sector .d2 files (T-1294), and the two SVGs that never had a generator in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.9 KiB
Python
55 lines
1.9 KiB
Python
"""Transport for `atlas map` — the Reach map, the ladder's top rung (D-191, D-243).
|
|
|
|
Two verbs, both RENDERS of the committed star-map.json. What does not appear
|
|
here is deliberate: the generator that produced star-map.json in the first
|
|
place, and the sculpt/tune passes that shaped its topology, are archived
|
|
(tooling/archive/map-bootstrap/). They are keyed on the retired S-NNN ids, and
|
|
the generator overwrites docs/design/star-map.json unconditionally from its
|
|
seed — re-running it would replace the GJ-keyed, hand-maintained map (T-1293).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from pathlib import Path
|
|
|
|
import typer
|
|
|
|
from tooling.core import cli, console
|
|
from tooling.core.command import command
|
|
|
|
app = cli.domain("map", "The Reach map — client star-map data and the concentric SVG.")
|
|
|
|
|
|
@app.callback()
|
|
def _rung() -> None:
|
|
"""Keeps `map` a group (Typer collapses a single-command app)."""
|
|
|
|
|
|
@app.command("data")
|
|
@command
|
|
def data(
|
|
check: bool = typer.Option(False, "--check", help="Fail if the committed JSON is stale; write nothing."),
|
|
) -> None:
|
|
"""Regenerate client/data/star_map_data.json from star-map.json + systems.db + wiki."""
|
|
from tooling.domains.atlas.map import data as service
|
|
|
|
result = service.run(check=check)
|
|
if check:
|
|
console.verdict(f"star-map data: {result['path']} is up to date")
|
|
else:
|
|
console.out(json.dumps(result))
|
|
console.verdict(f"star-map data: wrote {result['nodes']} nodes, {result['edges']} edges")
|
|
|
|
|
|
@app.command("svg")
|
|
@command
|
|
def svg(
|
|
output: Path = typer.Argument(None, help="SVG path (default: docs/diagrams/design/star-map-concentric.svg)."),
|
|
) -> None:
|
|
"""Render the concentric-ring Reach map SVG (and a PNG beside it)."""
|
|
from tooling.domains.atlas.map import svg as service
|
|
|
|
result = service.render(str(output) if output else service.DEFAULT_OUTPUT)
|
|
console.out(json.dumps(result))
|