Commit graph

23 commits

Author SHA1 Message Date
4bacb8100a Merge branch 'worktree-agent-a7e728aefe5051670' into boards-v2 2026-11-08 17:53:44 -06:00
dbbb9750eb Conditional pipes and router cards
Pipes can carry "when" (Only if) and "otherwise". When an entry is
chosen, its effects run, its text expands, then every pipe condition and
count is evaluated once as a snapshot before any pipe runs; when pipes
run if true, otherwise pipes if no when pipe was true, plain pipes
always. Condition errors count as false and show as error lines.

New router card (kind "router"): its entries are cases with an
entry-level "when"; the first true case is chosen (empty = Otherwise),
and "No case matched" stops the node. One action. JSON round trip for
entry/pipe when and pipe otherwise, including JsonIO.canonical and
edge labels. Roller.lint_pipes() and Roller.lint_router() for board
checks. A pick choice's save_as is now stored before the snapshot.

UI: Only if / Otherwise in the pipe popover with live validation, pipe
labels ("if @str >= 8", "otherwise") and a source-end diamond on
conditional pipes, router card with fork icon, per-case condition rows,
case editing / reordering in Build, router settings, "+ Table" entry,
router cases in table previews. Logic demo now routes through a router.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:53:00 -06:00
be75723aef Test board: BoardTester class, Build-mode dialog, README section
Moves the simulator into core/board_tester.gd (static checks, sliced runs on
fresh variables and decks), keeps tools/simulate_board.gd as a thin wrapper,
adds the Test board dialog with a Build tools button and Board menu item.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 17:49:35 -06:00
d29c09a679 Merge branch 'worktree-agent-a9067d487b0c63a09' into groups-templates 2026-11-08 17:08:59 -06:00
9fdf65c00b Group cards and templates
Groups: an optional groups list on a collection (frame rect, collapsed,
members, details), saved by TowerBoard and kept by JsonIO. Expanded groups
draw a frame behind their cards with a title bar; collapsed ones become one
compact card that lists the members' lit results, with pipes re-routed to
its inlet and right edge. Build mode adds multi-select (Ctrl/Shift-click,
Ctrl-drag), Group (Ctrl+G), drop in/out of frames, rename, ungroup, delete
with undo and a details editor.

Templates: TemplateKit saves cards, groups or selections with relative
positions, internal pipes and outside pipes by name, detects {$name}
parameters and inserts with fresh ids. TemplateLibrary keeps user templates
in user://templates and lists the built-in ones in templates/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:01:34 -06:00
6e69b64385 Choice pop-up: minimize pill, option preview panel, reusable TablePreview
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 16:39:56 -06:00
2ddf8c7c42 Add if(condition, then, else) and refuse the broken inline ternary
Godot's Expression parses "a if c else b" but returns the wrong branch,
so boards silently computed nonsense. Expressions now offer a
spreadsheet-style if() and reject the inline form with a hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:20:05 -06:00
8feaf2f217 Merge branch 'worktree-agent-acd18b8074059cf4a' into logic-cards 2026-11-08 14:17:55 -06:00
82d46b927d Add a headless board simulator tool and its test
tools/simulate_board.gd rolls a collection N times with a random (or
regex-preferred) player answering every choice card, each run on fresh
board variables, and reports completions, halt reasons, action stats,
effect/expression errors with table and entry, dead ends, unset or
failed markers in text and prompts, unreached tables, never-chosen
entries, tracked variable ranges, the longest run's busiest tables and
a sample final sheet. tests/test_simulate.gd runs it on an inline board.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:15:21 -06:00
38e66501b3 Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray
- ChoiceDialog: card-styled pop-up for pick (option rows with details, Random,
  1-9 / R keys), number (spin box with min/max/default, Enter) and text.
  Cancel, Esc, freeing the dialog, a new roll or a collection switch all
  answer null through a separate Reply object, so a roll never hangs.
- Main: real prompt hook; the steps so far light on the board and in the
  tray before each question; a roll with questions shows the rest at once;
  a new roll cancels an open question cleanly; refresh_live() re-renders
  variable, sheet and question text only after rolls and edits.
- TableCard: "?" badge and question for choice cards, loop icon, rule chip
  and Each time / Afterwards rows, compact live variable cards (reset in
  Build), live sheet cards with one outlet, expression-dice subtitles,
  effect chips in Play and a validated effects editor in Build.
- Build: "+ Table" menu for every kind; kind-specific settings (choice type,
  question, save as, min/max; loop mode and rule; variable name, type,
  starting value; sheet template) checked with Expr.check; expression pipe
  counts in the pipe popover and on pipe labels.
- Tray: effect lines under chips, last 12 steps behind "+N earlier steps",
  sheet headline, Cancelled / action-limit pill, capped indents and Earlier
  rows; Variables tab lists every board variable with Reset all.
- RichText: error markers in red; previews show {@x_*} and {= expr}.
- examples/logic_demo.json and tests/test_logic_ui.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
85b8a99ef5 Logic cards engine: expressions, effects, choice/loop/variable/sheet cards, coroutine roller
- Expr: @vars, chain vars, dice tokens, dm/has/count, lone = as ==, errors as values, parse cache
- Effects: = += -= *= /= and reset (with prefix), number vs list semantics, logs, validation
- RollTable kinds and per-kind fields with factories; expression dice with end clamping
- TableEntry effects and expression pipe counts; JSON round trip through JsonIO
- TextExpander: {@prefix_*}, {= expr}, number display, expand_async and live render()
- Roller: coroutine with an explicit work stack, prompts for choice cards, loops,
  10,000-action limit, partial tree on ctx.root, iterative flatten/collect_lit
- Variables keep numbers as numbers through StateStore
- Main: awaits the roll with a default (headless) prompt hook, iterative playback,
  long chains show at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:38:42 -06:00
2a79640c9d Add fast roll: Shift-click a die to skip the animation
Holding Shift while clicking a table's die (or "Roll again") skips the
flicker and the beads and shows the whole result at once: every result
and pipe on the path lit, long lists scrolled to their result, and the
full chain in the tray without the chip fade-in. A fast roll started
mid-animation takes over cleanly. The Play hint and roll tooltips
mention Shift-click, and --fast pairs with --roll for screenshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:53:39 -06:00
667ee1d9f0 Merge play-side UI; connect it to the collection switcher
Combines the play-side integration (refs and variables through the
roller, BBCode rendering, hover details, card decks, variables panel,
copy, reference pipes, pipe options, Build card editors) with the app
shell. Switching collections now loads that collection's decks,
variables and history and relights its last roll. Adds a Quest Hooks
and Towns table to the sample so references and variables show by
default, and updates the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:45:34 -06:00
38e3819898 Roller: expand refs and variables through RollContext, save pipe results
Entry text is expanded by TextExpander with a shared RollContext; inline
reference rolls become children marked inline, pipes with save_as save the
child's export BBCode. MAX_DEPTH is 32. Steps carry BBCode text, depth and
inline/reshuffle flags. Adds tests/test_integration.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:26:33 -06:00
2e353224ab Add app-shell UI: table settings, collection switcher, import/export, endless-loop chip
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:23:21 -06:00
f3a6964044 Merge branch 'worktree-agent-a605529cce27c4de2' into pipe-board 2026-11-08 12:15:32 -06:00
cd4e13c85a Add import/export converters: JSON, JSON Canvas, Mermaid, DOT, GraphML
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:14:56 -06:00
51f2cc9e6d Merge branch 'worktree-agent-a0e26080a92828227' into pipe-board 2026-11-08 12:14:05 -06:00
29ab755a3e Add RollContext, TextExpander and Formatter for inline references and BBCode
RollContext holds chain and persistent variables, depth and the
resolve/roll hooks for one top-level roll. TextExpander expands [[Table]],
[[Table -> var]], [[3x T]], [[1d4 T]], {var}, {@var} and {@var|Table} left to
right, wrapping inserted pieces in internal [url=table:/var:/missing:/unset:/deep:]
meta tags for hover pop-ups. Formatter closes open tags, strips tags for plain
text, exports BBCode without internal markers and filters imported tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:13:25 -06:00
6a873810b0 Merge branch 'worktree-agent-a2900db2ff6409443' into pipe-board 2026-11-08 12:12:16 -06:00
388759f5b6 Add weights, dice expressions, pipe options, card mode and cycle check to the model
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:11:43 -06:00
6f29e9373d Add collection storage: LibraryStore, StateStore, format version 2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:11:26 -06:00
60c2d03147 Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.

- core/: data model (RollTable, TableEntry, TowerBoard), sample board
  with a d100 table of 100 trinkets and a weighted d100 range table,
  and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
  cards, result tray with earlier rolls, undo toasts, and a Collapse all
  / Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00