Skip to content

Stop building Death in Space into the platform; make backtrack undo the turn's writes (RS-1, RS-2, P-7) - #135

Open
spuentesp wants to merge 3 commits into
masterfrom
fix/remove-bolted-ontology-and-backtrack-db
Open

spuentesp wants to merge 3 commits into
masterfrom
fix/remove-bolted-ontology-and-backtrack-db

Conversation

@spuentesp

Copy link
Copy Markdown
Owner

Summary

Death in Space is no longer built in (RS-1, RS-2). A named game should come from its ingested book, not from code.

  • Removes its builtin_systems.json entry, the two hand-written spec modules, the DEATH_IN_SPACE re-export, the name-based tags, and scripts/death_in_space_game_system.py, which seeded it as a builtin. The seeder only inserts, so existing databases keep their record until it is removed by hand.
  • The typed-sheet tools (rpg_character_create/update, rpg_validate_sheet) only accepted games with a hand-written class, which meant only Death in Space. They now validate against each system's spec, with the legacy class registry as fallback.
  • d20 systems stored as meet_or_beat now map to d20_over, and one whose formula rolls under maps to d20_under. D&D 5e, Mistlands Core and Narrative Weighted were all falling through to custom.
  • Tests that used Death in Space to exercise the generic factory and registry now use an invented system (_lantern_drift_spec.py), so their checks are unchanged.

Backtrack undoes what the turn wrote (P-7). It used to rewind only the checkpoint, so an undone turn's entries came back on the next load, its memories stayed searchable, its working-state changes stuck, and its pending proposals could still be accepted into canon.

  • New mongodb_rewind_scene removes what the scene wrote after the restore point:

    • turns
    • resolutions
    • proposals
    • memories, plus their Qdrant vectors
    • foreshadowing plants
    • payoffs, which are reopened

    Working state is restored from the earlier checkpoint's copy, or reported when there isn't one.

  • As P-7 says, it refuses if the turn had a proposal accepted into canon, and changes nothing. A database failure midway is reported as partly undone. Running /backtrack again finishes it.

  • Not undone yet: NPC profile updates the narrator makes during a turn.

Test plan

  • New data-layer tests for the rewind, using an in-memory fake, plus a manual run against a throwaway MongoDB 7.0 container
  • Scene-loop tests: rewind boundary, vector cleanup, working-state copy, refusal, partial failure
  • Full suite: 8,483 passed. 4 failures (test_chat_loops end-scene ×2, test_lorebook_api list/export) also fail on master
  • Sealed suites untouched, layer check, ruff
  • CI

The paste's _uses_roll_under change was skipped: success_type can't hold a roll-under value, and roll-under is already read from the formula text.

🤖 Generated with Claude Code

Sebastian and others added 3 commits November 6, 2026 20:08
A named game comes from its ingested book, not from code. Removes the Death
in Space builtin entry, the two hand-written spec modules and their package
re-export, and its name-based tags. The seeder only inserts, so an existing
database keeps the record it already has.

The typed-sheet tools only validated games with a hand-written class, which
meant only Death in Space. They now validate against each system's spec, so
every registered system works, with the legacy class registry as fallback.

d20 systems stored as meet_or_beat now map to roll-over, and one whose
formula rolls under a target maps to roll-under. D&D 5e, Mistlands Core and
Narrative Weighted were all falling through to custom.

Tests that used Death in Space to exercise the generic factory and registry
now use an invented system, so their checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… checkpoint

Backtrack rewound the scene loop's checkpoint but left the turn's database
writes in place: its turn entries came back on the next load, its memories
stayed searchable, its working-state changes stuck, and its pending
proposals could still be accepted into canon.

A new data-layer tool removes what the scene wrote after the restore point's
time: turns, resolutions, proposals, memories (and their vectors),
foreshadowing plants, and payoffs, which are reopened. Working state is
written in place, so it is put back from the restored checkpoint's copy;
when there is none, that is reported rather than claimed.

As P-7 says, a turn is undone only if it wasn't canonized: if any of its
proposals was accepted, nothing changes and backtrack says why. Rejected
ones never reached canon and are removed. The database is rewound before
the checkpoint. A refusal changes nothing; a database failure midway may
leave the turn partly undone, and backtrack says to run it again, which
finishes the job. The CLI lists anything not undone.

NPC profile updates the narrator makes during a turn are not undone yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a builtin

It wrote the game straight into game_systems with is_builtin set, another
way of building one named game into the platform. Nothing imports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant