Skip to content

claw: gates.t27 rows_filled compares strings to "", which gen-c lowers to a C pointer comparison #10696

Closed

Description

@gHashTag

What is missing

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

  1. Add EVENT_LENS : [67]usize, parallel to EVENTS, and pin each row to EVENTS[i].len in gates_pins.t27.
  2. Make rows_filled take the two length columns and test == 0. every_row_filled() keeps its signature.
  3. 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.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Oct 18, 2026
    9eef99d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions