Skip to content

Stop sheet commands when a guard fails inside braces, and clear empty values - #20

Merged
HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-uebao0
Nov 1, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-uebao0

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Two bugs in the sheets from #16, #17 and #18, found while testing another sheet.

  1. A failed guard inside @if braces didn't stop the command. @assert in an @included routine ends only the braces it runs in. So +sheet Nobody from a keeper drew a sheet of #-1 errors, +sheet/set Nobody/iron=3 went on to "There is no stat ''", and in FitD +sheet/coin Bob=5 from a non-keeper got past INCNEEDKEEPER. Each such @if (19 in d20, Fate, PbtA, FitD, BRP, Ironsworn) is now followed by the same check at the top level.
  2. attrib_set(x, if(...)) stored an empty attribute where it meant to clear, and default() reads that as empty. Ironsworn momentum showed blank after reset, FitD stress/coin at 0, BRP HP at full. These writes now clear with attrib_set(x).

Each changed sheet goes to 1.0.1.

Testing

On a local server, before the fix: +sheet Nobody as a keeper drew the #-1 sheet, and +sheet/momentum reset left IRONSWORNMETERMOMENTUM present and empty. After it:

  • +sheet Nobody, /set Nobody/..., meters, +vow/mark Nobody/x, +vow Nobody, /harm, /hp, /coin all stop at "There is no player called 'Nobody'." in all six sheets.
  • Alice's +sheet/coin Bob=5 → "Only sheet keepers do that."; +sheet/stress Bob=1 → "Only sheet keepers change another character's sheet."
  • Momentum reset, stress clear, coin to 0 and HP full leave no attribute (hasattr 0).
  • tools/PackageValidator --strict: PASSED.

Generated by Claude Code

… values

An @Assert in a routine @included inside @if braces ends only those
braces, so a missing player (and, for +sheet/coin <name>=<n> in FitD, a
non-keeper) carried on with an empty or unchecked target. Each such @if
in the d20, Fate, PbtA, FitD, BRP and Ironsworn sheets is now followed by
the same check at the top level.

attrib_set() with an empty value stores an empty attribute, which
default() reads as empty rather than the default: Ironsworn momentum
after a reset, FitD stress and coin at 0, BRP hit points at full. Those
writes now clear the attribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqqt7SvmwqfPpiD52tHtJw
@HarryCordewener HarryCordewener self-assigned this Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 8 billable files and costs up to $2.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 53 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 96adc25b-3a8f-4fa9-86b3-f78adfa1d061
Commits

Reviewing files that changed from the base of the PR and between 9e0a965 and 53ee9b2.

Files selected for processing: 8
  • README.md
  • index.yaml
  • sheet-brp/package.yaml
  • sheet-d20/package.yaml
  • sheet-fate/package.yaml
  • sheet-fitd/package.yaml
  • sheet-ironsworn/package.yaml
  • sheet-pbta/package.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@HarryCordewener
HarryCordewener marked this pull request as ready for review November 1, 2026 03:18
@HarryCordewener
HarryCordewener merged commit 38b3fdf into main Nov 1, 2026
3 checks passed
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.

2 participants