No description
  • Go 88.7%
  • Python 6.7%
  • Shell 2.3%
  • HTML 1.1%
  • JavaScript 0.8%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rafael Stauffer 29cd6e5c41
Some checks failed
CI / gates (push) Has been cancelled
forge/content: metaprose toolchain M0-M3
Author a tree of scene frames and prose leaves above the engine tables and
compile it down, so prose is generated coherently per branch and grounded in
the corpus, while the engine keeps no LLM path and stays deterministic.

M0 - forge inventory: a repeatable enumeration of every pool/variant and the
sibling voice tables (origin, register, slots, includes), with ProseStatus-parity
coverage (variant floor, kink-free anchor, main-act phase pools, staged-act
fragment voices), the act x phase x tier option matrix, and an advisory
placeholder worklist. --mods is base-only unless passed; --all-mods expands
mods/*; --check and --fail-on make it a CI gate. Deterministic JSON + markdown.

M1 - metaprose IR (content/metaprose/, tracked, not a pack) and
forge metaprose compile|check. A frame compiles to scene_templates; a leaf to
prose/fragments/style_lines/journal_lines/thoughts. Prose leaves emit a
kink-free willing anchor first (coerced-only leaves carry register: [coerced]).
The sample tree content/metaprose/base_union.yaml compiles and passes forge check.

M2 - tools/lora: segments.py (scene-break segmentation), skeleton.py (Pass A
scene skeleton, normalized to the engine vocabulary), archetypes.py (cluster by
shape; --emit-ir writes a metaprose document), judge.py (rubric quality gate),
and test_m2.py. prosegen-run.sh gains --judge; the judge runs inside the retry
loop after forge check.

M3 - whole-pack regeneration: forge brief --all emits one brief per existing
leaf (including phase/frame pools and the voice tables); forge integrate now
replaces a non-append row by id (matching load semantics); tools/metaprose-run.sh
orchestrates compile-brief-fill-gates; tools/rebaseline.sh (+ make rebaseline)
runs validate, golden, TUI goldens, replay-check on three hulls, and inventory.
Content-coupled tests now resolve fixtures from loaded content
(internal/sim/content_fixture_test.go) or inject probes, so a regeneration does
not churn them.

Docs: docs/METAPROSE.md operator guide; PROSE_PIPELINE 7-10, README, lora README
updated. The engine, save format and determinism are unchanged.

Verified: go build/vet green; forge/content/cmd tests and full internal/sim
green; make prose-test green (sanitizer + M2 tools); offline end-to-end
forge metaprose check + metaprose-run --no-fill (15 briefs). The teacher-driven
fill and final rebaseline are host-side runs.

Phases M0-M3 (metaprose toolchain).
2026-09-19 22:25:45 +02:00
.github/workflows forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
.harness chore: track the harness doc store; ignore the LoRA venv 2026-09-17 20:52:00 +02:00
.opencode/agent sim: ceremony frame binding and live transition conditions (decision 26) 2026-09-15 13:03:34 +02:00
cmd forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
content forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
docs forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
internal forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
mods sim/content: Pax-9 compliance and substance tolerance (R2, save v17) 2026-09-19 16:47:41 +02:00
res add art base ressources 2026-09-18 23:46:19 +02:00
tests forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
tools forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
.gitignore add art base ressources 2026-09-18 23:46:19 +02:00
AGENTS.md ui/sim: two-trace reconstruction, fate picker, retention and art (UI T-6, save v18) 2026-09-19 18:45:21 +02:00
go.mod tui: high-detail image rendering at a fixed footprint 2026-09-19 11:23:58 +02:00
go.sum docs: H3 identity gap and TUI spec; tui: colors, images, templates, screens 2026-09-13 16:28:50 +02:00
Makefile forge/content: metaprose toolchain M0-M3 2026-09-19 22:25:45 +02:00
README.md ui/sim: two-trace reconstruction, fate picker, retention and art (UI T-6, save v18) 2026-09-19 18:45:21 +02:00

Long March (Go)

A dwarf-fortress-inspired, dark-and-adult management simulation set aboard a generation ship crossing the void. You are the ship's intelligence — the Overseer — thrown into a spiral between helpless onlooker and omnipotent control-freak as you wrangle a doomed voyage in which every concept is tested and perverted: upstanding people eroded into maniacs, order falling into chaos, religion splintering into cults, the ship itself decaying. The challenge is not grind and not systems — it is people. Hard limits can be set in the configuration; the game itself does not hold back. Light is contrast — the warmth, love, and belonging aboard are what make the dark hit home.

Top-down ASCII / TUI, deeply simulated, highly immersive and customizable.

Adults only (18+). Explicit text content; granular content controls including a fade-to-black mode and configurable hard limits. Fully offline, no telemetry, no network.

Status: engine + TUI built; content authoring underway. Phases 0–9 of docs/IMPLEMENTATION_PLAN.md landed the deterministic simulation (world, agents, needs/utility AI, social, intimacy, the Helm, story engine, lifecycle, faith, raveling, crime, items, runtime hulls) and the internal/tui terminal front end. Phases 10–12 closed the identity vocabulary, the Content Forge, and the base anchor pack; Phase 13.0 opened the cross-cutting engine seams; Phase 20 landed the erotic parity program (E1–E8); Phase 21 landed the Rust-parity register (P21-A–H, with PG5/PG8/PG11 deferred by owner decision, docs/GAPS.md §4); the TUI stages T-1–T-7 are landed, including T-5 (golden render corpus, accessibility, --export-journal, make dist). Content is underway: mods/society and a data-only xenobiology proof of concept (mods/uplift, mods/companion, mods/cephalid) land the first module packs; Phase 22 adds a full organ model (region-mapped, installable/removable, role-scoped act gates; save v34) (docs/CONTENT_FORGE.md, docs/CONTENT_CAPABILITIES.md). See docs/ARCHITECTURE.md for the architecture.

The canonical target specification lives in docs/spec/, with binding decisions in docs/spec/10_DECISIONS.md; docs/REFACTOR_PLAN.md tracks the Phases 0–7 normalization of the code to that spec. See docs/README.md for the doc index.


Why a rewrite

The Rust implementation reached a working M4.8 build but accumulated a large migration program (unified event pipeline, templating engine, one outcome vocabulary, one use program, one body resolver, one scene tree, runtime hulls, data-driven jobs). Its own architecture docs specify that target state, but only via a long strangler-fig migration. This project builds the target state directly in Go and skips the migration entirely.

Fresh decisions locked for this rewrite:

Decision Choice
Language Go (single module, internal/ packages)
Simulation core Explicit typed world keyed by stable IDs; no generic ECS
Content & user config YAML (strict, validated, merged packs)
Saves Fresh versioned binary format; Rust LMSV saves are not imported
Scope All planned tracks (H3–H9), including the previously held items reopened in Phase 21 (conversion, forced upload, Theft/justice, worldgen depth, item quality/relics)
TUI tcell + a custom diffing cell grid and map widget
Prose Deterministic local template grammar; no LLM, no scripting, ever

Documentation

Doc Contents
docs/DESIGN.md Vision, pillars, core loops, scope, decisions log, glossary
docs/ARCHITECTURE.md Target Go architecture — packages, the unification cores, formats, determinism, TUI
docs/SYSTEMS.md Consolidated system specs (ship, agents, needs, social, erotic, crime, faith, decay, items, story…)
docs/CONTENT.md Content policy, taxonomy, YAML schema conventions, pack merge/validation
docs/CONTENT_FORGE.md The authoring method: derive rows from the engine contract; lints, gates, provenance
docs/SCENECHECK.md Dev-only external scene decision-graph viewer (cmd/scenecheck)
docs/TEMPLATING.md Prose template grammar, filters, includes, and render-context reference
docs/GAPS.md Content gap register: what the engine must provide for the module packs
docs/FORCE_AND_BREACH.md Forced item use, the bounded check, and personality-redefining breach scenes (Phase 27)
docs/RECONSTRUCTION.md Memory reconstruction: two-trace puzzle, voices, scope, and retention
docs/PROSE_PIPELINE.md Offline prose generation loop: briefs, local model, validation gates
docs/MINING.md Corpus mining method, source→system map, motif provenance, exclusions
docs/PROSE_FORGE_SKILL.md The prose-generation system skill (for the local model)
docs/ROADMAP.md Ordered rewrite phases (0–9) with exit criteria; appended Phases 10–21; H3–H9 mapping
docs/TESTING.md Determinism replay, world-hash coverage, golden prose, content-matrix leaks, soak
docs/UI.md Terminal front-end spec: screens, templates, themes, images, input contract, stages
docs/IMPLEMENTATION_PLAN.md Module-support plan: engine additions, phase slots, Stage M content packs

Repository layout (target)

longmarch_go/
  cmd/longmarch/        CLI, flags, headless, --replay-check, packaging
  internal/domain/      pure types + vocabulary (no io/behavior)
  internal/rng/         xoshiro256**; scoped Stream(seed,domain,slot)
  internal/text/        deterministic jinja-subset template engine
  internal/content/     YAML pack load -> merge -> validate -> index
  internal/sim/         world, schedule, worldgen, systems, facade
  internal/save/        versioned snapshot codec, migration, autosave ring
  internal/tui/         screens, one Action input contract, T1/T2, art
  internal/mods/        pack discovery, precedence, worldgen report
  content/              base content pack (YAML)
  mods/                 example content packs (YAML)
  tests/                determinism corpus, golden prose, matrix, soak
  docs/                 this documentation

Dependency rule: cmd → tui → sim → content → domain. The simulation never imports the TUI or any IO, so headless replay and CI runs stay possible.


Building & running

go build ./...                  # or: make build
go run ./cmd/longmarch          # interactive TUI
go run ./cmd/longmarch --headless --ticks 259200 --seed 1234
go run ./cmd/longmarch --headless --replay-check --seed 1234 --ticks 259200
go run ./cmd/longmarch --export-journal run.txt --ticks 259200 --seed 1234
go run ./cmd/longmarch --print-config
make dist                       # bundle binary + content/ + README into a tarball

Testing

go test ./...                   # or: make test
go vet ./...                    # or: make vet
go test -bench . ./internal/sim

The flagship gate is replay determinism: the same seed, parameters, and content-pack IDs must produce byte-identical world hashes. See docs/TESTING.md.


Non-negotiable invariants

  1. Determinism — same seed + params + pack IDs ⇒ identical sim.
  2. Engine-authoritative gates — adult gate, hard limits, kink/body/tier gates are engine checks, never fiction.
  3. Everything is data — packs are YAML data; no scripting, no LLM, no network, no telemetry. Saves stay local.
  4. Single-threaded simulation — no goroutines in the sim; the TUI is a separate consumer that only exchanges commands and snapshots at tick boundaries.
  5. Covenant — adults only, fictional people only; coercion exists only through the gated register; conversion drift is engine-gated (Phase 21 PF1) and its content ships with the faith modules. E-tier erotic and horror/gore detail is in scope (the "darkest valleys", DESIGN §10 #18), always coerced-register-only and gated by the player's tier ceiling, fade-to-black, forbidden_acts, and hard limits.

License

UNLICENSED (private project).