Skip to content

feat(cli): accept quote and quote_offset in crit comment --json - #1013

Merged
tomasz-tomczyk merged 1 commit into
mainfrom
feat/comment-json-quote
Oct 2, 2026
Merged

tomasz-tomczyk merged 1 commit into
mainfrom
feat/comment-json-quote

Conversation

@tomasz-tomczyk

Copy link
Copy Markdown
Owner

What

crit comment --json entries can now set quote and quote_offset on a line comment. These are the same fields the web UI saves when you comment on a text selection.

[{"file": "plan.md", "line": "2-3", "body": "why?", "quote": "read a.go\n2. patch", "quote_offset": 3}]

Why

Before this, a CLI comment always covered whole lines. A tool that lets you select part of a line (a terminal review UI, or an agent) had no way to record the exact text, so the review sent to the agent quoted the whole lines.

Rules

  • quote / quote_offset are stored on line comments. The whole-line anchor is still filled in as before.
  • Either field on a review- or file-level comment is an error (quote needs a line comment). Nothing from the batch is written.
  • quote_offset needs a quote and must be >= 0. It means the same as in the web UI: where the quote starts in the lines' text, with whitespace collapsed.

Also

  • Two new rows in the JSON table of every crit-cli skill (all integrations, including the codex plugin copy).
  • integration_hashes_gen.go regenerated with go generate.

Testing

  • Unit tests: quote stored, quote + offset stored, offset without quote rejected, negative offset rejected, quote on review/file-level rejected, raw JSON decode through the custom unmarshaller.
  • go test ./..., gofmt, golangci-lint: clean.
  • By hand: built the binary, added a quoted comment in a throwaway repo; crit comments shows the quote and anchor, and the review file has quote and quote_offset.

🤖 Generated with Claude Code

A line comment from `crit comment --json` could only cover whole lines.
The web UI already saves a comment on part of the lines as `quote` (and
`quote_offset`); bulk entries can now set the same two fields, so a tool
that selects text (a terminal UI, an agent) records exactly what the
comment is about.

- quote and quote_offset are stored on line comments
- either one on a review- or file-level comment is an error
- quote_offset needs a quote and must be >= 0
- documented in every crit-cli skill; integration hashes regenerated

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

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.56%. Comparing base (bb3d0b1) to head (802cc33).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   75.52%   77.56%   +2.03%     
==========================================
  Files         161      168       +7     
  Lines       23440    23595     +155     
==========================================
+ Hits        17704    18301     +597     
+ Misses       4327     3885     -442     
  Partials     1409     1409              
Flag Coverage Δ
e2e 27.04% <56.52%> (?)
unit 75.55% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk
tomasz-tomczyk merged commit 7950653 into main Oct 2, 2026
17 checks passed
@tomasz-tomczyk
tomasz-tomczyk deleted the feat/comment-json-quote branch October 2, 2026 14:47
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.

1 participant