Skip to content

feat(cursor-approve): show each axis's full first sentence and its full reasoning on the card (BE-20249) - #413

Merged
mattmillerai merged 2 commits into
mainfrom
matt/be-20249-card-why-full-sentence
Oct 12, 2026
Merged

mattmillerai merged 2 commits into
mainfrom
matt/be-20249-card-why-full-sentence

Conversation

@mattmillerai

@mattmillerai mattmillerai commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

ELI-5

The approve bot keeps one status card on each PR. The card has a table with a row per reviewer axis (correctness, conformance, …) and a short reason for each verdict. That reason was chopped at 100 characters, so it usually stopped mid-sentence ("… the cache is still not wired into…"). The full explanation was only in the Actions run.

Now the row shows the whole sentence. Under the result there is a collapsed "full reasoning" section for each axis, which you can open right on the PR.

What changed

  • aggregate.py
    • The headline cap goes from 100 to 240 characters.
    • Past the cap, the clamp keeps every whole sentence that fits, with no "…".
      • ., ! or ? followed by whitespace ends a sentence, including after a closing quote or bracket.
      • Common abbreviations (e.g., i.e., vs., …), initialisms (U.S.), one-character initials and list numbers (J., 2.) and ellipses do not. Neither does a decimal or a mid-word dot, since no space follows it. etc. ends a sentence only before a capital.
      • A sentence cut that keeps fewer than four words ("OK.") is not taken.
    • Otherwise (a first sentence longer than 240 characters, or too short a lead), the headline is word-cut with "…". The old hard-cut fallback is unchanged.
    • A headline with no word character is rejected at any length, not only past the cap.
  • card.py
    • The Why cell renders the whole clamped headline. It is sanitised as before, with a cell limit WHY_LIMIT that a test pins equal to HEADLINE_MAX. A headline that is missing or that the clamp rejects falls back to the summary's first sentence.
    • Under the result, there is one collapsed <details> block per axis that reported a summary. It holds the sanitised full summary and the confidence.
    • The decide card now links "workflow run" on the reviewed-commit line, like every other card. Before, the rule line carried the link and the line under it printed an unlinked "workflow run".
    • The job summary's headline is the card's Why text (why_text), so the two always match.
  • prompt-common.md: the headline is ONE sentence, aiming for about 120 characters and never more than 240. The summary is now described as shown collapsed on the card.
  • Docs and comments: docs/callers/cursor-approve.md (the headline/card passage and the 240 cap), the .github/cursor-approve/README.md field table, and the header comments in cursor-approve.yml and cursor-axis-base.yml.

Why

BE-20249.

  • Clipped reasons. On a real round-5 card in a private consumer repo, both rows (correctness and conformance) were clipped mid-sentence. The models write one-sentence reasons of 110–140 characters, and the 100-character cap cut every one of them.
  • Buried detail. The only way to the reasoning was the Actions run.

Design notes

  • Whole headline, not "first sentence only". A headline that fits is shown whole. Cutting one that fits down to its first sentence would drop information, and a first-sentence splitter stops at "e.g.". The sentence rule only matters past the cap, and there it guarantees at least the full first sentence.
  • The agent contract is unchanged.
    • The first three lines and the | Axis | Verdict | Why | rows are as before. Only the cell text can be longer.
    • The blocks sit below the table and the result.
    • Model text goes through sanitize, which folds it to one line and escapes every | and <.
    • A test ports the agent fleet's awk -F'|' row parser line for line. It proves a summary that carries a forged row, a forged state marker, </details>, a heading, a mention or the card marker changes nothing an agent reads.
  • No new exposure.
    • The summary already reached the run's job summary. That has the same audience as the PR comment, on public and private repos alike.
    • With prior_rounds on, the summary was also already in the card's base64 sentinel.
    • The context axes' Linear/Notion/Slack sources stay private-repo only.

Coordination

This touches .github/cursor-approve/card.py alongside #412 (BE-20246).

Testing

  • python3 -m unittest discover -s .github/cursor-approve/tests -p 'test_*.py': 267 OK on the current head. New cases:
    • the sentence-preferring clamp (whole sentences, ?, abbreviations, initialisms, initials and list numbers, ellipses, closing quotes and brackets, etc. before a capital, decimals and file names, a short lead, a cut that keeps no word, a word-less headline within the cap, and decide end to end);
    • the Why cell's summary fallback for a rejected headline, and the job summary showing the card's headline;
    • the full-sentence cell, and the pin between WHY_LIMIT and HEADLINE_MAX;
    • the blocks: one per axis, placement, no summary or verdict, no confidence, none on superseded or start cards;
    • inert model text, checked with the fleet's parser port;
    • the run link on every card state.
  • .github/cursor-review/tests: 1527 OK.
  • .github/workflow-pins/tests: 551 OK (43 skipped). check_workflow_pins.py OK.
  • .github/agents-md-integrity/tests: 62 OK. check_agents_md.py passed, with the same 2 warnings as main (line count, no CODEOWNERS).
  • .github/public-repo-hygiene/tests: 204 OK. check-org-repo-literals.sh OK. shellcheck OK.
Sample: a two-axis pass card as rendered (markdown)
<!-- cursor-approve-card -->
<!-- cursor-approve-state: pass -->
<!-- cursor-approve-next: none -->
### Cursor approve · round 5 of 5 · `e9ece9c`

| Axis | Verdict | Why |
|---|---|---|
| correctness | 🟢 green | Round\-4 changes hold up and each new test fails without its fix; the cache is still not wired into the request path. |
| conformance | 🟢 green | Flag bound via envconfig and documented in this PR; the service stays build\-isolated, with tests beside the code. |

**Result: ✅ Approved.**

<details>
<summary>correctness — full reasoning (confidence 0.86)</summary>

Rebuild now keeps a charge recorded after its cut\-off, rejects a cut\-off later than the clock, and resets a key on every tier change. Each new test fails with its fix reverted. Nothing calls the cache yet; the flag is read only in config.

</details>

<details>
<summary>conformance — full reasoning (confidence 0.91)</summary>

Standard: the root AGENTS.md and the service's own AGENTS.md. Logging uses the context\-first form, there are no new cross\-module imports, and the flag has a default tag.

</details>

_Rule: no red, at most 0 yellow; every axis must report (⚪ n/a counts as reporting and does not block, but all-n/a withholds)._

_Reviewed commit: `e9ece9ca341ba9ed1d7c1ae302152d7aef895418` · [workflow run](https://github.com/o/r/actions/runs/1)_

Rollout

Callers get this on their next SHA bump. There are no new inputs. The 240 cap and the prompt wording apply from the next round.

Provenance

  • Authored by: agent-work loop
  • Verified:
    • .github/cursor-approve/tests: 267 OK on the current head.
    • .github/workflow-pins/tests OK; check_workflow_pins.py, check_agents_md.py (same 2 warnings as main) and check-org-repo-literals.sh pass.
    • The cursor-review panel's findings were addressed: 6 fixed in code with tests, 2 answered on their threads with no change.
  • Deviations:
    • The review asked for a half-cap floor on the sentence cut. A four-word floor is used instead, so a short first sentence is still kept whole, which is the point of this PR.

🤖 Generated with Claude Code

…ll reasoning on the card (BE-20249)

The status card's Why cell showed the axis headline clamped at 100
characters, which cut the models' ordinary one-sentence reasons
mid-thought; the full summary sat only in the run's job summary.

- aggregate.py: HEADLINE_MAX 100 -> 240. The clamp keeps every whole
  sentence that fits (no "…"; abbreviations such as "e.g." are not
  sentence ends) and only word-cuts a first sentence longer than the cap.
- card.py: the Why cell renders the whole clamped headline; under the
  result, one collapsed <details> block per axis carries its sanitised
  full summary and confidence; the decide card links "workflow run" on
  the reviewed-commit line like every other card (the rule line no
  longer carries the link).
- prompt-common.md: one sentence, aim for ~120 characters, never more
  than 240; the summary is now shown collapsed on the card.
- Docs and workflow header comments updated; tests cover the clamp,
  the cell, the blocks (including a port of the fleet's row parser to
  prove model text cannot add an axis row) and the run link.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 9 billable files and costs up to $2.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 33 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 117 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: ee5417f2-e36a-40f3-a5bb-df93b76362ea

📥 Commits

Reviewing files that changed from the base of the PR and between 095550c and 3a49fdd.


📒 Files selected for processing (9)
  • .github/cursor-approve/README.md
  • .github/cursor-approve/aggregate.py
  • .github/cursor-approve/card.py
  • .github/cursor-approve/prompt-common.md
  • .github/cursor-approve/tests/test_aggregate.py
  • .github/cursor-approve/tests/test_card.py
  • .github/workflows/cursor-approve.yml
  • .github/workflows/cursor-axis-base.yml
  • docs/callers/cursor-approve.md

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mattmillerai mattmillerai added the cursor-review Multi-model cursor review label Oct 12, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 8 finding(s).

Severity Count
🟡 Medium 2
🟢 Low 3
⚪ Nit 3

Panel: 5/6 reviewers contributed findings.

Reviewers that did not contribute: kimi-k3-max:adversarial (error)

Comment thread .github/cursor-approve/card.py Resolved
Comment thread .github/cursor-approve/aggregate.py Resolved
Comment thread .github/cursor-approve/aggregate.py Resolved
Comment thread .github/cursor-approve/aggregate.py Resolved
Comment thread .github/cursor-approve/card.py Resolved
Comment thread .github/cursor-approve/aggregate.py Resolved
Comment thread .github/cursor-approve/card.py Resolved
Comment thread .github/cursor-approve/card.py Resolved
…Why fallbacks (BE-20249)

Review round on #413:
- a sentence cut keeping fewer than four words ("OK.") falls through to
  the word cut instead of leaving a reason-free headline;
- initialisms, one-character initials/list numbers and ellipses no longer
  end a sentence; a closing quote/bracket after the mark does; `etc.`
  ends one before a capital;
- a word-less headline is rejected at any length, not only past the cap;
- the Why cell falls back to the summary's first sentence when the clamp
  rejects the headline, and the job summary reuses why_text so both
  surfaces show the same headline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmillerai
mattmillerai merged commit 2a26f44 into main Oct 12, 2026
8 checks passed
@mattmillerai
mattmillerai deleted the matt/be-20249-card-why-full-sentence branch October 12, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Multi-model cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants