Repository navigation
Conversation
…le on the line they post, and a rest's hit dice, the stable wait's d4, an item's charges at dawn and the dice a call rolls as it opens a fight are on that call's turn The opportunity, clock and initiative families of the roll-record ledger move onto recordRoll (issue Lebbitheplow#915, part four). An opportunity strike posts a line of its own in a GM call and out of one, as a death save does, and nothing draws cards from the short turn the strike opens. So the line is the home of the strike's cards: its attack and damage are recorded with home "line", and the line lists them and then the public rolls the blow went on to make on the short turn (a rider's save). A death save's line lists the save, and the die of the stable wait a third success or a Periapt of Wound Closure rolls. At a table a person runs, a roll that held its call is listed on the line the call posts once it lands. One that a line of its own already carries stays on that line alone (persons-record.ts, messages.ts lineCarriesRoll). A character's opportunity swing, death save and Stealth as an ambush opens come through rollCharacterD20, so dice the player entered at the table are on record and sent as theirs. The clock's dice (hit dice, the stable wait's d4 from stabilize, a knockout or a rage that ends at 0, an item's charges, a Ring of Regeneration) and a character's initiative and Stealth as a fight opens join the turn of the GM call that rolled them. On an AI's turn the custom rolls among them are stamped spent as that call ends, as every die of the engine's own is. Rolled where no call runs, they are on no turn, as before. The ledger reads 7 files (store 4, send 5, join 2). 14 sweep runs are struck from its rows: 69 are left, none failing "sent". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…card, where they read as the roll of the character they landed on, and every attack or damage roll says who or what made it Ruling 2 of issue Lebbitheplow#915: a roll nobody at the table made names its source, and the character it lands on is its target. A roll's attacker gains a fourth kind, "hazard", with no id, a name, and a field that says what it is: a fall, the GM's own dice for harm nothing names, a trap, an item, the effect of a spell or feature, or a hazard by the words the GM gave it. A hit's record already had that kind for a fall (last-hit.ts) and now carries the field too. Nothing reads what a source is from its name. A source that was given a name shows it in front of its rolls; a fall and the GM's own dice are worded there by the field, in the table's language. Every source is built in one module (src/lib/roll-sources.ts), and a test holds that no other file writes one out. A site that knows what its harm is hands that value on, so it is not read back from words further in: apply_hazard builds its source once and passes it to the save it asks of a character and to the trap it springs on a creature, and a trap's darts and its poison name the same trap. Where one site writes both a roll and the hit's record, the record is handed the roll's source; apply_damage's record is built by the same builder from the same arguments as its dice. A creature's save spell stays on record as that spell's effect, as it was, while its roll names the creature. A source's roll is put on record by five helpers in roll-card.ts (sourceDamage, sourceDamageThrown, sourceAttack, castDamage, castersDamage), which word it in one place from what was thrown and on whom, so the source goes in front of the card and is not said again: "Spiked Pit · Damage (2d10 piercing on Aria)", "The fall · Damage (30 ft, 3d6 bludgeoning on Aria)". Dice the GM sends for harm name the words given for it: "falling rubble · Damage (2d6 bludgeoning on Aria)", and name a creature they land on as the table may read it. The roll tools' free text keeps the words the GM typed. The type of an attack or damage roll no longer allows a missing attacker (insertRoll, recordRoll, rollCard), so the type checker listed every site: 47 in 36 files. A character's own feature or spell names the character, which reads as before; three of those cards no longer say the character's name twice. A roll card's own damage dice and the roll tools' free text name the character they were asked of, else the GM. Later damage of a spell is its caster's roll, a creature's as well as a character's, and the spell's own once neither is at the table. The Grasping Arrow's brambles are the archer's roll. The dice stage tells sources apart by what they are and their name, so a trap's damage joins that trap's attack and no other's. The dice-site sweep's "roller" check also holds every sourced roll it reaches: the source says what it is, is not said a second time, and the roll names the character it lands on; and a hazard's own row may not name that character as the roller. The 34 runs listed as failing "roller" pass and are struck from the ledger's rows: 35 are left, all "home", the requests family's. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 21, 2026
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part five of #915: your ruling 2. Built on #1063 (part four): this branch holds that pull request's commit and one more. Review the last commit, or wait for #1063 to merge and I will rebase.
What a table sees
A roll nobody at the table made was stored with no roller, so its card put the character it hurt in front. It now names its source, and the character is its target:
Five things to look at first
attackergains a fourth kind:{ kind: "hazard", id: null, name, hazard }.LastHitalready hadkind: "hazard"with no id for a fall. The new part ishazard, which says what the source is:fall,gm,trap,item,effectornamed. No migration: old rows are untouched, and old hit records without the field still read. I added the field becausetest-text-comparisonsrefused my first version, which told "The fall" from a trap by its name.RollInsert,recordRoll,rollCard). That is how the 47 sites in 36 files were found, and a branch in flight that passesnullfor one will stop compiling: it needssheetAttacker,enemyAttackeror a source fromsrc/lib/roll-sources.ts.insertRollhas no check at run time, so a test script can still write one.request_rollwith a character still names that character. That tool asks a roll of a character, and on real dice it parks as their own card. So a GM who rolls a trap's damage that way and then sendsapply_damagewith the amount still gets "Aria · Damage (falling rocks)". The roll cannot tell the two intents apart. I left it and would like your ruling: should a damage roll asked that way name the GM unless the call says whose it is?apply_damage's record is built by the same builder from the same arguments as its dice. Two cases still differ, both as before: a creature's save spell is on record as that spell's effect while its roll names the creature, and the two-call path in item 4.What changes in the code
src/lib/roll-sources.ts(new) builds every source. A test intest-roll-labels.mjsfails if any other file undersrc/writes one out.roll-card.tsput a source's roll on record (sourceDamage,sourceDamageThrown,sourceAttack,castDamage,castersDamage). They word it in one place from what was thrown and on whom (roll-labels.tsthrownOn,attackOn), so no site writes that sentence.apply_hazardbuilds its source once and passes it to the save it asks of a character (handleCastAtPlayer) and to the trap it springs on a creature (springOnEnemy). A test caught the reason: a trap's darts and its poison came out as two kinds of source.roll-labels.tswords a fall and the GM's dice by the field.rollerNamedoes the same in English for GAME STATE, the beats and the record line;ask.tsnow reads it.roll-stage-logic.tstells sources apart by what they are and their name, so a trap's damage joins that trap's attack and no other's.rollercheck also holds a sourced roll: its kind is a known one, the source is not said a second time, and it names the character it lands on. A hazard's own row may not name that character as the roller.The ledger
rollerhomeThe files and counts are unchanged (7 files, the
requestsfamily). The 35 runs left are that family's.Not covered
cast_at_playerwith source "the hag's Fireball" and spell "Fireball" reads "the hag's Fireball · Damage (Fireball, 8d6 fire on Aria)". Dropping it would mean reading the name, which the guards refuse. Issue Roll cards build their text from a sentence each site writes by hand: a proposal to store a roll's parts instead, and what ruling 2 of #915 will do until then #1064 is the real answer.apply_hazardleaves two open hit records for one save's damage. The damage it applies inside counts as called on its own, soapply_damagewrites a record, and the save path writes a second. I can open an issue or a pull request for it.castAtPetdoes not take the trap flag, so a trap at a pet is a hazard by its name.Tests
scripts/test-enforce-roll-attacker.mjs: 40 cases, 13 new and two rewritten. A trap's attacks and damage on a character and on a creature; a pit's fall and its spikes; one hazard naming one source for the character and the creature it catches, named, unnamed, and as a trap; a trapcast_at_playeris told of; a spell with no creature behind it, with and without a named source; a missile with no caster, whose hit record names the same source as its roll; dice the GM sends, whose hit record names the same source; an area with no creature; an improvised action; a damage card rolled on real dice; and the helpers' wording, case by case.scripts/test-enforce-damage-cards.mjs: five cases rewritten. They pinned "no attacker" for Overchannel, Contact Other Plane, a fall, a potion of poison and harm to an object.scripts/test-roll-labels.mjs: four new. The source in front on every surface; the two unnamed sources worded by the field in English and French, whatever their stored name says; the summary's natural 20; and the guard on who may write a source out.scripts/test-enforce-ai-gates.mjs,scripts/test-roll-stage.mjsandscripts/test-enforce-sweep-clauses-martial-fighter.mjs: one case each (the AI's dice, sources on the dice stage, the brambles).scripts/test-enforce-sweep-dice-sites.mjs: 34 runs are struck fromrows.test-text-comparisonsandtest-name-lookupspass with no entry added to either list.request_rollattack or damage with no character, a held roll card's own insert, the departed-caster branch at each of its seven sites (the helper is tested directly), and the roller at Violent Attraction, Counter Intrusion, the cyberpunk and horror features and Full Throttle. The type checker holds that each names someone; nothing holds that it is the right one.npm teston Windows: 1,262 of 1,268 files passed, run one line before this commit. The line it lacked: the sweep's own list still namedhurlReturnas a site that throws its own dice, which now go through a helper, sotest-enforce-sweep-dice-sitesfailed; with the entry struck it passes (550 enforced), run alone. Of the other five, four fail onmainon my machine for its own setup:test-backup-in-appandtest-backup-restore(Git Bash'starreadsC:as a host),test-enforce-last-combatandtest-enforce-monster-blocks(nosqlite3command).test-addons-partscould not rename a temporary file during the full run (EPERM) and passes alone.tsc, lint on the changed files andnpm run buildpass on this commit. The build ran against the Next.js my checkout has installed (16.4.1), not the 16.4.6 the repository pins.Related: #1064 proposes storing a roll's parts in place of a sentence each site writes, which would remove the wording limits above.
Checks
npm run lint,npm testandnpm run buildpass, and the change has a test that fails without it. (Lint on the changed files,tscand the build pass.npm test: see Tests.).envfiles or players' names in the code, the tests or this description.Settings, options and controls
🤖 Generated with Claude Code