From 8a5072dcbdcd10b3ece91f833ca9e372b72cacc0 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Thu, 25 Jun 2026 08:33:48 +0200 Subject: [PATCH] drop turn_reaction.md: store_turn.py takes no args, outcome captured in next turn description --- AGENTS.md | 6 ++---- session/turn_reaction.md | 1 - tools/store_turn.py | 36 ++++++++---------------------------- 3 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 session/turn_reaction.md diff --git a/AGENTS.md b/AGENTS.md index 56b17db..7bcf500 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,6 @@ the-chaos/ ├── log/ # Raw session logs by date ├── turn_description.md # DM narrative for current turn ├── turn_prompt.md # "What do you do?" prompt for current turn - └── turn_reaction.md # Player's raw reaction (filled, then rewritten) ``` ## First Steps (Fresh Session) @@ -67,10 +66,9 @@ The core loop for every turn: 2. **Ask the player** in the chat to act — they read the scene in the TUI, type their action, and come back here with the result. 3. **Process the turn:** a. Resolve outcomes mechanically — update `character.md`, `world.md`, `journal.md`, and append to `session/log/.md`. - b. Rewrite `session/turn_reaction.md` as a coherent narrative continuation of the turn description using full markdown — reads like a book. - c. Run `python3 tools/store_turn.py ""` to append both description and reaction to `session/book.md` and clear all turn temp files. + b. Run `python3 tools/store_turn.py` to archive the turn description to `session/book.md` and clear turn temp files. 4. **Generate a new turn:** - a. Populate `session/turn_description.md` with the next scene's narrative using full markdown — **bold** for emphasis, *italic* for thoughts or sounds, `---` for scene breaks, lists for options or details, and quotes for dialogue. + a. Populate `session/turn_description.md` with the next scene's narrative using full markdown — naturally narrating what happened in the previous turn as context. Use **bold** for emphasis, *italic* for thoughts or sounds, `---` for scene breaks, lists for options or details, and quotes for dialogue. b. Populate `session/turn_prompt.md` with "What do you do?". c. Update `session/ambience.md` if the mood has changed. diff --git a/session/turn_reaction.md b/session/turn_reaction.md deleted file mode 100644 index 9eed877..0000000 --- a/session/turn_reaction.md +++ /dev/null @@ -1 +0,0 @@ -While he is busy, we should find a good hiding spot in the room, wait and see what happens. diff --git a/tools/store_turn.py b/tools/store_turn.py index 79e82b5..edf8418 100755 --- a/tools/store_turn.py +++ b/tools/store_turn.py @@ -1,12 +1,10 @@ #!/usr/bin/env python3 -"""Append a turn to the story book and clear turn temp files. +"""Archive the current turn to the story book and clear turn temp files. Usage: - python3 scripts/store_turn.py "Dillion stepped into the chamber..." - python3 scripts/store_turn.py < reaction.txt + python3 tools/store_turn.py """ -import sys from pathlib import Path from datetime import date @@ -14,39 +12,21 @@ SESSION = Path(__file__).resolve().parent.parent / 'session' BOOK = SESSION / 'book.md' TURN_DESC = SESSION / 'turn_description.md' TURN_PROMPT = SESSION / 'turn_prompt.md' -TURN_REACTION = SESSION / 'turn_reaction.md' -CLEAR_FILES = [TURN_DESC, TURN_PROMPT, TURN_REACTION] - - -def get_reaction() -> str: - if len(sys.argv) > 1: - return sys.argv[1] - if not sys.stdin.isatty(): - return sys.stdin.read().strip() - return '' +CLEAR_FILES = [TURN_DESC, TURN_PROMPT] def main(): - reaction = get_reaction() - if not reaction: - print("No reaction text provided. Pass as argument or pipe stdin.") - sys.exit(1) - description = TURN_DESC.read_text().strip() if TURN_DESC.exists() else '' + if not description: + print("Nothing to store — turn_description.md is empty.") + return + timestamp = date.today().isoformat() - - entry_parts = [] - if description: - entry_parts.append(description) - if reaction: - entry_parts.append(reaction) - - entry = '\n\n'.join(entry_parts) heading = f'\n\n## Turn — {timestamp}\n\n' BOOK.parent.mkdir(parents=True, exist_ok=True) with open(BOOK, 'a') as f: - f.write(heading + entry + '\n') + f.write(heading + description + '\n') for fpath in CLEAR_FILES: if fpath.exists():