Complete the rules kernel milestone #2

Merged
fputs merged 19 commits from fputs/rules-kernel-milestone into master 2026-11-06 10:07:15 -08:00 AGit
Owner

Gates 3 through 18: checked arithmetic, dice, degree of success, modifiers, MAP, roster, initiative, damage, Strike, the encounter log, both golden logs, vendored yyjson 0.13.0, the JSON roster loader, and the fixture fight. Scripted faces reproduce the genesis log byte for byte. sh tests/milestone_check.sh passes with 17/17 tests under ASan and UBSan on GCC 16.2.1 and clang 23.1.4. Evidence for each gate is in hdae/gates-done/. 🤖 Generated with Claude Code

Gates 3 through 18: checked arithmetic, dice, degree of success, modifiers, MAP, roster, initiative, damage, Strike, the encounter log, both golden logs, vendored yyjson 0.13.0, the JSON roster loader, and the fixture fight. Scripted faces reproduce the genesis log byte for byte. sh tests/milestone_check.sh passes with 17/17 tests under ASan and UBSan on GCC 16.2.1 and clang 23.1.4. Evidence for each gate is in hdae/gates-done/. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wf_i32_add, wf_i32_sub, and wf_i32_mul map lf_i32_* onto WfStatus.
Overflow and a NULL out return WF_ERR_RANGE and leave *out unchanged.
The human accepted gate 3. Move its ledger file to gates-done.
WfDice is a tagged value. Seeded mode draws from an LfRng through
lf_rng_next_range. Scripted mode reads a caller-owned face queue.
A rejected roll leaves *out and the stream position unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The human accepted gate 4. Move its ledger file to gates-done.

The wf_dice_* functions now return WfStatus, and the architecture says
so for every public function that reports a code. A passed gate now stays
uncommitted until it is accepted.

Ignore .idea, and track the .claude skill links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_degree turns a total and a DC into one of four degrees, then applies
the natural 20 or natural 1 step without passing the ends. An overflowing
band or an out-of-range natural is WF_ERR_RANGE and leaves *out unchanged.

The human accepted gate 5, including the table correction: a total of
exactly DC - 10 is a critical failure. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_fold keeps the largest bonus and the worst penalty of each type, adds
them in a fixed order, then adds every untyped penalty. An illegal row or
an overflow at any step is WF_ERR_RANGE and leaves *out unchanged.

The human accepted gate 6. The architecture no longer sorts untyped
penalties, because their add order cannot change the total or the status.
Move the ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_map_penalty is a pure function of the prior attack count and the agile
flag. A count of 255 stays on the third-and-later penalty.

The human accepted gate 7. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A roster holds immutable builds and runtime state in two arrays of the
same length. wf_roster_add reserves both before pushing, so a rejected or
failed add leaves the roster unchanged.

The human accepted gate 8. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_initiative_order sorts by total, then enemy before PC, then lower id.
It does not roll or allocate, and a rejected list leaves ids_out unchanged.

The human accepted gate 9. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_roll_initiative draws one d20 per combatant in ascending id order and
publishes the totals, the faces, and the acting order. A failed roll keeps
the faces already drawn and leaves the outputs unchanged.

The human accepted gate 10. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_damage_roll sums the dice and the bonus, and a critical doubles that
total once. A failed roll leaves *out unchanged and keeps the faces drawn.

The human accepted gate 11. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_resolve_strike folds both modifier lists, rolls the d20, finds the
degree, rolls damage on a hit, and stops Hit Points at 0. A failure before
the d20 draws no die, and a later failure keeps the faces drawn.

The human accepted gate 12. The architecture now adds MAP to the folded
total, which equals one more untyped row and copies no list. Move the
ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Begin, start, strike, and end run one fight and render one ASCII log. The
scripted faces 4, 19, 4, 20, and 8 reproduce the genesis golden bytes. A
command's lines are committed only with a successful command.

The human accepted gate 13. The architecture now says start resets the
actor's attack count, and that commands format into the free log space.
Move the ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same lfrng seed and the same commands produce the same log, and seed 3
is now the committed seeded oracle. Only WF_UPDATE_GOLDEN=1 rewrites it.
Every roll line, damage dice included, is checked against the stream.

The human reviewed the generated file and accepted gate 14. Move its
ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yyjson 0.13.0 is vendored unedited and linked only by wayfinder_loader,
which has a stub wf_roster_parse until the next gate. link_boundary fails
if the rules side reaches a parser, a window library, or file I/O.

The human accepted gate 15. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wf_roster_parse turns one strict JSON document into a validated roster, or
leaves *out unchanged. Duplicate keys, unknown fields, non-integers, and
nesting past 32 levels are rejected. yyjson's depth limit is a build
definition, so the vendored source stays unedited.

The human accepted gate 16. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fixtures/golden-roster.json drives the scripted fight and matches the
genesis log byte for byte. A different loaded number changes the fight,
and a check pins the file's numbers the log cannot see.

The human accepted gate 17. Move its ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/milestone_check.sh reruns the suite under sanitizers, repeats it with
clang, and checks the boundary, the hashes, and the absence of raylib,
data/core, and media files.

The human accepted gate 18, which accepts the milestone result. Move its
ledger file to gates-done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fputs merged commit e1b08bf8fb into master 2026-11-06 10:07:15 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
fputs/wayfinder!2
No description provided.