Skip to content

spec(claw): suggest.t27 -- one-click formatter suggestions, COMMENT only (Closes #10285) - #10286

Merged
gHashTag merged 1 commit into
masterfrom
claude/claw-suggest
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/claw-suggest

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #10285

Adds specs/claw/suggest.t27, the law behind the pr-files (pull_requests read) and pr-suggestions (pull_requests write) rows of the surface table in #10280. When a PR changes a .t27 file that the formatter would rewrite, TRI CLAW may post one review whose comments are suggestion blocks.

The law, each line pinned by a test:

  • The event is COMMENT and nothing else. APPROVE, approve, REQUEST_CHANGES, PENDING, empty and COMMENT all map to "post nothing" (test event_is_never_approve).
  • RIGHT side only.
  • A hunk outside the diff is skipped; a multi-line range across two diff hunks is skipped too, because GitHub rejects the whole review for one bad comment. Diff ranges are parsed from the @@ -a,b +c,d @@ headers of the patch field.
  • At most 20 comments per review, 40 lines per suggestion. A review with no comment is not posted.
  • An unreadable hunk (unknown kind, line 0, inconsistent count, overlap) withholds its whole file; other files are unaffected.

Verified on the Railway lab (t27c test-report specs/claw/suggest.t27): 16 tests, 16 pass, 0 FAIL, 0 vacuous; spec-status IMPLEMENTED. Negative control: a mutant where event_for returns its input fails event_is_never_approve.

Not in this PR:

  • The workflow that fetches the file list, runs t27c fmt, computes the replacement lines and POSTs the review is foreign YAML under the own-language gate. It needs an owner-approved offset; the token for it is pull_requests: write + contents: read only (the create-github-app-token permission inputs).
  • This spec decides placement, not text: it does not produce the formatter's replacement lines or JSON-escape them.
  • The rows stay PLANNED in github_surface.t27 (spec(claw): github_surface -- every GitHub API surface, its .t27 value, the narrow token it mints (Closes #10277) #10280, not merged yet); a row moves to LIVE in the PR that ships the workflow.

🤖 Generated with Claude Code

…nly, RIGHT side only (Closes #10285)

The law behind the pr-files and pr-suggestions rows of github_surface: the review
event is always COMMENT, comments anchor on the RIGHT side inside one diff hunk, at
most 20 per review, and an unreadable hunk withholds its file. Diff ranges are read
from the @@ headers of pr-files. 16 tests, 0 vacuous on the Railway lab; a mutant
that lets event_for return its input fails the suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 18, 2026 07:32
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 07:38:29 UTC

Summary

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

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=0f8c66b9ed0e != 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 1db9e27 into master Oct 18, 2026
28 of 30 checks passed
gHashTag added a commit that referenced this pull request Oct 18, 2026
…10288 (Closes #10311) (#10312)

duplicate-bodies has been red on master since the claw specs landed
without moving the ledger. Each new group and why it stays for now:

- buf_has, digit_byte, put_count, put_str (gates.t27 + sarif.t27,
  #10288): deliberate. sarif.t27 says so in its header: the writers are
  private in gates.t27 and sarif.t27 must lower alone under gen-c.
- bytes_eq 2 -> 3 (`same` in sarif_pins.t27, #10288): the test-only
  pins companion compares strings by .len, which gen-c cannot lower.
- str_eq (gates.t27 + suggest.t27, #10286) and has_prefix
  (service.t27 #10283, starts_with in preview.t27 #10287): same
  lower-alone constraint; sharing them into one claw helper module is
  a follow-up, not this commit.

The ledger is `python3 tools/dupe_scan.py --bless` output on master
238b6a9, run on the Railway lab; the gate exits 0 after it. Not
hand-edited.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

TRI CLAW: one-click formatter suggestions on PRs -- suggest.t27 law (lanes pr-files, pr-suggestions of #10277)

1 participant