You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
claw: gates.t27 rows_filled compares strings to "", which gen-c lowers to a C pointer comparison #10696
rows_filled in specs/claw/gates.t27 (added in #10691) checks for an empty row with names[i] == "" and events[i] == "". gates.t27 is lowered by t27c gen-c into the committed gen/c/claw/gates.c, and gen-c lowers s == "" to a C pointer comparison (#8013). So in the C build, the empty-row check compares addresses, not contents: an empty row whose literal is not pooled with the comparison literal would pass as filled.
On the lab, cc -Wall gives 18 "comparison with string literal" warnings on the committed gates.c. Two of them are in rows_filled, the only production function among them. The other 16 are in test functions.
The module already has the remedy for names: NAME_LENS, pinned to NAMES[i].len in specs/claw/gates_pins.t27. EVENTS has no length column.
Plan
Add EVENT_LENS : [67]usize, parallel to EVENTS, and pin each row to EVENTS[i].len in gates_pins.t27.
Make rows_filled take the two length columns and test == 0. every_row_filled() keeps its signature.
Regenerate gen/c/claw/gates.c, run the gate-topology harness on the real workflow directory, and reseal.
User Scenarios
Given a row's trigger set is emptied, when every_row_filled runs in the C build, then it returns false, because it reads a length, not an address.
Given EVENT_LENS is miscounted by one byte for a row, when gates_pins runs, then the pin fails.
Requirements
FR-001: No production function in the regenerated gates.c MAY compare a string to a literal.
FR-002: every_row_filled() MUST keep its signature. service, preview and verified/gen_file_check MUST pass unchanged.
FR-003: Each EVENT_LENS row MUST be pinned to EVENTS[i].len outside gen-c.
Success Criteria
gates: 23 tests pass and gates_pins: 6 tests pass (5 before, 1 new), in t27c and t27b, with 0 vacuous passes.
8 mutants (6 on rows_filled, 2 on EVENT_LENS values): 8 caught.
cc -Wall string-literal warnings on gates.c drop from 18 to 16, and all 16 are in test functions.
seal --verify matches for 32 files.
Boundary
specs/claw/gates.t27
specs/claw/gates_pins.t27
gen/c/claw/gates.c
.trinity/seals/claw_ClawGates.json
.trinity/seals/claw_ClawGatesPins.json
Not in scope: the 16 test-only literal comparisons. In C they are never run, but they are the same defect, so they get their own issue.
Activity
claw: gates.t27 rows_filled reads length columns, not s == "" (a C po…
claw: gates.t27 compares strings with str_eq and lengths, so gates.c …