ctworldgen

module
v1.0.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT

README

ctworldgen

A Go CLI that generates rules-accurate Classic Traveller subsectors from Book 3 Worlds and Adventures, the Worlds chapter (pp. 1-12, © 1977 text). It writes a JSON record and renders it as a Markdown listing a referee can run from.

Status

All four milestones are complete. The engine walks the whole of Book 3 pp. 1-12 -- the eighty-hex occurrence scan, starport types, naval and scout bases, commercial space lanes, and the eight characteristics of every world -- all from a recorded seed. render turns a record into the Markdown listing a referee can run from, and batch produces a sector's worth of subsectors at a time.

docs/COVERAGE.md is the current map of rule to code to test.

Use

ctworldgen new   [--seed N] [--name X] [--occurrence-dm N] [-o file] [--force]
ctworldgen batch --count N [--seed N] [--name X] [--occurrence-dm N] [-o dir|file.jsonl] [--force]
ctworldgen render [-o file] [--force] subsector.json
ctworldgen version

batch emits JSONL to stdout; given a directory it writes one file per subsector, named for the subsector and its index -- aramis-00.json. Members are numbered from zero, so batch --count 1 --seed N produces exactly the subsector new --seed N produces.

--occurrence-dm takes -1, 0 or +1 and nothing else, and defaults to 0. Without --seed, a seed is drawn from OS entropy and written into the record, so a run is reproducible after the fact; --seed 0 is therefore an explicit and distinct choice rather than a request for a random one. Existing files are never overwritten without --force, and flags precede any filename.

$ go run ./cmd/ctworldgen new --seed 1977 --name Aramis --occurrence-dm -1

The documents

docs/PRD.md is the contract: the authority model, the requirements, the determinism rules, the record shape and the milestones. docs/ERRATA.md records every reading of an ambiguous or silent page, with its page cite and the condition under which a record stamps it. docs/COVERAGE.md maps the rules to the implementation. docs/subsector.schema.json is the record's schema, with a minimal and a complete example beside it.

Rules come only from the held PDFs of the FFE reprints. Training-data Traveller is mostly the 1981 revision and later editions, and the held page governs even where it differs — most visibly in the string of digits, which carries no hyphen (A867A698, not A867A69-8).

Development

task              # the whole gate: tidy, vet, lint (formatting included), nilaway, test -race, coverage ratchet
task regenerate   # rewrite the golden fixtures and the complete example, then read the diff

CI runs exactly task. The toolchain is deliberately unpinned: the gate is meant to fail when a tool moves rather than drift behind it, so a red gate on code you did not touch is the signal working. Answer the finding; do not pin a tool or add a linter disable to silence it.

Licence

MIT. See LICENSE. Traveller is © Far Future Enterprises; this tool implements the rules and reproduces none of the text beyond the table labels a listing needs.

Directories

Path Synopsis
cmd
ctworldgen command
Command ctworldgen generates rules-accurate Classic Traveller subsectors from Book 3's Worlds chapter (pp.
Command ctworldgen generates rules-accurate Classic Traveller subsectors from Book 3's Worlds chapter (pp.
Package dice implements the die roll conventions of Book 1 Characters and Combat pp.
Package dice implements the die roll conventions of Book 1 Characters and Combat pp.
Package gen walks the star mapping and world creation procedure of Book 3 pp.
Package gen walks the star mapping and world creation procedure of Book 3 pp.
internal
audit
Package audit holds the checks that read the repository itself rather than a package's behaviour: that every record the engine writes matches the published schema, and that the readings cited in the code and the documents are exactly the readings ERRATA.md records.
Package audit holds the checks that read the repository itself rather than a package's behaviour: that every record the engine writes matches the published schema, and that the readings cited in the code and the documents are exactly the readings ERRATA.md records.
cmd/ratchet command
Command ratchet compares uncovered statements per package against a checked-in baseline.
Command ratchet compares uncovered statements per package against a checked-in baseline.
cmd/regenerate command
Command regenerate rewrites the golden fixtures, and the complete example record shipped beside the schema, from the roster in internal/fixture.
Command regenerate rewrites the golden fixtures, and the complete example record shipped beside the schema, from the roster in internal/fixture.
fixture
Package fixture holds the one definition of the golden-fixture roster, so that two golden trees cannot come to describe different subsectors under the same name.
Package fixture holds the one definition of the golden-fixture roster, so that two golden trees cannot come to describe different subsectors under the same name.
Package render writes the subsector listing: the Markdown a referee can run from.
Package render writes the subsector listing: the Markdown a referee can run from.
Package subsector holds the domain types a record is written in and the record itself.
Package subsector holds the domain types a record is written in and the record itself.
Package tables holds the charts of Book 3 pp.
Package tables holds the charts of Book 3 pp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL