Repository navigation
claw: control grammar for @tri-claw comment commands (Closes #10395) - #10427
Merged
Merged
Conversation
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>
gHashTag
enabled auto-merge (squash)
October 18, 2026 11:29
This was referenced Oct 18, 2026
Merged
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10395 (lane 2 of epic #10393).
What
specs/claw/control.t27(module ClawControl): the grammar of@tri-clawcomment 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 fromcontrol.c.command_of(text, len) -> u8: the word after the first@tri-claw. The words arestatus, land, batch, refresh, rerun, pause, resume, budget, help. An unknown word, or no mention, givesCMD_NONE. A word ends at a space, LF, CR or the end of the text.association_of(s, len) -> u8: GitHubauthor_associationstring toAS_*code. Unknown strings giveAS_UNKNOWN.allowed(command, association, from_a_bot) -> bool: a bot gets nothing. OWNER, MEMBER and COLLABORATOR get every command. Anyone else getshelpandstatusonly.answer_offolds these rules into ignore / act / help.surface_of(command) -> u8:merge-prupdate-branchrerun-failedcontrol-commentsput_surfacewrites the row name.acts_on_this_pris true for land, refresh and rerun.batch_numbers(text, len, out, cap) -> usize: reads up to 100 PR numbers afterbatchand stops at the first non-number.specs/claw/control_pins.t27(module ClawControlPins): a test-only companion, the same pattern asgates_pins.t27. It walks lane 1's github_surface table and checks two things:SF_*row name of control.t27 is exactly one row of the table, and that row is mintable (row_mintable(i, false));This cannot live in control.t27 because gen-c lowers test blocks too, and the table's
STATUSrow andstr.lendo not lower to C.gen/c/claw/control.c: fromt27c gen-c(not hand-edited). It compiles withcc -std=c11.Seals:
.trinity/seals/claw_ClawControl.jsonand.trinity/seals/claw_ClawControlPins.json.pause / resume -> control-comments
control-commentsis the issues-write row, and a pause flag belongs on the queue dashboard issue as a label. A repo variable would needactions_variableswrite, and no row of the table grants that, socontrol-commentsis the right row. The reasoning is also in the spec header.Numbers
t27c test-report, Railway lab).tri mutate spec --file specs/claw/control.t27killed 94 of 96. The 2 survivors are equivalent, and each is explained at its line::118at < len->at <= leninmention_end. Atat == lenthe remaining-length check fails first, so the extra iteration never matches.:211cap < most->cap <= mostinbatch_numbers. Whencap == most, both branches leavemostwith the same value.tools/dupe_scan.pyreports "no new duplicate body, and none of the known groups grew". Helpers come in viause policy::l2_generation.Left out on purpose
spec-guards.ymlfreshness step does not yet listgen/c/claw/control.c; lane 7 adds it when it wirescontrol.c.github_surface.t27is untouched.Resolver notes (t27c follow-ups, not fixed here)
use_resolvecollects 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 itsrecipes.str_eqcall became an undeclared identifier. I reworded the comment and noted the trap in the file.COUNTis 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 onSURFACES[i]).🤖 Generated with Claude Code