Skip to content

claw: control grammar for @tri-claw comment commands (Closes #10395) - #10427

Merged
gHashTag merged 1 commit into
masterfrom
claude/claw-control-10395-6088a2
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/claw-control-10395-6088a2

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #10395 (lane 2 of epic #10393).

What

  • specs/claw/control.t27 (module ClawControl): the grammar of @tri-claw comment commands, with plain signatures (byte buffers, lengths, u8 codes) for lane 7 (claw: the control job and the pinned TRI CLAW queue dashboard #10400) to call from control.c.

    • command_of(text, len) -> u8: the word after the first @tri-claw. The words are status, land, batch, refresh, rerun, pause, resume, budget, help. An unknown word, or no mention, gives CMD_NONE. A word ends at a space, LF, CR or the end of the text.
    • association_of(s, len) -> u8: GitHub author_association string to AS_* code. Unknown strings give AS_UNKNOWN.
    • allowed(command, association, from_a_bot) -> bool: a bot gets nothing. OWNER, MEMBER and COLLABORATOR get every command. Anyone else gets help and status only. answer_of folds these rules into ignore / act / help.
    • surface_of(command) -> u8:
      • land and batch -> merge-pr
      • refresh -> update-branch
      • rerun -> rerun-failed
      • pause and resume -> control-comments
      • help, status and budget -> none
    • put_surface writes the row name. acts_on_this_pr is true for land, refresh and rerun.
    • batch_numbers(text, len, out, cap) -> usize: reads up to 100 PR numbers after batch and stops at the first non-number.
  • specs/claw/control_pins.t27 (module ClawControlPins): a test-only companion, the same pattern as gates_pins.t27. It walks lane 1's github_surface table and checks two things:

    • every SF_* row name of control.t27 is exactly one row of the table, and that row is mintable (row_mintable(i, false));
    • every command that mints lands on exactly one mintable row.

    This cannot live in control.t27 because gen-c lowers test blocks too, and the table's STATUS row and str.len do not lower to C.

  • gen/c/claw/control.c: from t27c gen-c (not hand-edited). It compiles with cc -std=c11.

  • Seals: .trinity/seals/claw_ClawControl.json and .trinity/seals/claw_ClawControlPins.json.

pause / resume -> control-comments

control-comments is the issues-write row, and a pause flag belongs on the queue dashboard issue as a label. A repo variable would need actions_variables write, and no row of the table grants that, so control-comments is the right row. The reasoning is also in the spec header.

Numbers

  • Tests: 14 in control.t27 and 2 in control_pins.t27. All pass, 0 vacuous (t27c test-report, Railway lab).
  • Mutation: tri mutate spec --file specs/claw/control.t27 killed 94 of 96. The 2 survivors are equivalent, and each is explained at its line:
    • :118 at < len -> at <= len in mention_end. At at == len the remaining-length check fails first, so the extra iteration never matches.
    • :211 cap < most -> cap <= most in batch_numbers. When cap == most, both branches leave most with the same value.
  • duplicate-bodies: tools/dupe_scan.py reports "no new duplicate body, and none of the known groups grew". Helpers come in via use policy::l2_generation.

Left out on purpose

  • No workflow change. The spec-guards.yml freshness step does not yet list gen/c/claw/control.c; lane 7 adds it when it wires control.c.
  • github_surface.t27 is untouched.

Resolver notes (t27c follow-ups, not fixed here)

  • use_resolve collects identifiers from ; comments as well as code. A pins header that named a github_surface helper pulled that function's body into the splice, and its recipes.str_eq call became an undeclared identifier. I reworded the comment and noted the trap in the file.
  • The bare name COUNT is declared in both github_surface and recipes, so it is ambiguous and not spliced. The pins walk bounds on the literal 27 instead (a shorter table panics on SURFACES[i]).
  • Qualified calls inside spliced bodies are not rewritten; only the importer's own text is.

🤖 Generated with Claude Code

specs/claw/control.t27 reads a comment: command_of takes the word after
the first @tri-claw (status, land, batch, refresh, rerun, pause, resume,
budget, help; anything else is none), association_of maps the GitHub
author_association string to a u8 code, allowed() gives a bot nothing,
OWNER/MEMBER/COLLABORATOR everything, anyone else help and status, and
surface_of names the github_surface row each command mints. batch_numbers
reads up to 100 PR numbers and stops at the first non-number.

specs/claw/control_pins.t27 is the test-only cross-check against the
github_surface table (gen-c lowers tests, and the table does not lower).

14 + 2 tests, 0 vacuous; mutation 94/96 killed, 2 equivalent survivors
explained in place. gen/c/claw/control.c from t27c gen-c; both sealed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 11:35:38 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=fad12492937a != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 9d268b1 into master Oct 18, 2026
25 of 32 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.

claw: control.t27 -- the @tri-claw command grammar, who may say each command, which surface it mints

1 participant