Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,48 @@ and the project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/v
> Tags prior to **v0.4.0** were cut in the private repository and produced no
> public artifacts; the first publicly released version is v0.4.0.

## [1.2.1]

### Fixed
- **`commitbrief remote pr` no longer mis-places inline comments.**
Comments are now anchored to the diff side each finding's line lives on
— `RIGHT` (new file) for added/context lines, `LEFT` (old file) for
removed lines — instead of unconditionally posting `side=RIGHT`. A
finding whose line falls outside the diff (or whose POST GitHub rejects)
is appended to the review summary under a "Findings that could not be
attached to a specific line" heading rather than being silently dropped.
### Changed
- **Line-numbered diffs for more accurate finding locations.** Every
review (local and `remote pr`) now sends the model a diff with each
changed line prefixed by the line number a comment would anchor to
(`<n>| <marker><text>`), so the model copies line numbers instead of
counting them from the `@@` hunk header. This sharply reduces findings
landing on the wrong line (closing braces, blank lines). The on-disk
cache is rebuilt once on upgrade because the system prompt changed; the
diff component of the cache key is unaffected (the numbered form is a
deterministic function of the plain diff).
- **`remote pr` prints the standard review context lines.** The same
header (`commitbrief vX · provider · cache`), `analyzing N files · …`
status line, and `✓ Done in … · N findings · tokens · $cost` footer the
local `review` shows now surround the remote run too, so the
informational lines are consistent across every review command type.
They are exposed as reusable `render.HeaderLine` / `StatusLine` /
`FooterLine` to keep one implementation.
- **Staged-tree progress display extended to `remote pr`, `compress`, and
`providers test`.** All long-running/stepped operations now render
through the same animated tree the local `review` command uses (one line
per stage in non-TTY/CI; suppressed by `--quiet`) instead of flat stderr
lines — `remote pr` shows fetch → review → post → submit. The finished
tree stays on screen (it is not cleared) for these commands since no
rich card output replaces it.
- **Startup banner tweaks.** The footer links now point to the repo
**Issues** page (replacing the GitHub link) and drop the Author link;
the license tag reads `GNU GPL v3` instead of `GNU-GPL3.0`.
- **`remote pr` suggestion lines are prefixed with `💡`.** The remediation
line in both inline comments and the review-summary fallback now starts
with `💡 ` so it reads distinctly from the description. The signature was
also lowercased to `by #commitbrief`.

## [1.2.0]

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ sets the severity at or above which the verdict becomes request-changes;
provider. `--fail-on` is ignored here — the GitHub verdict replaces the
exit-code gate.

Each comment is anchored to the diff side its line lives on — `RIGHT`
(new file) for added/context lines, `LEFT` (old file) for removed ones.
A finding whose line falls outside the diff (or whose POST is rejected)
is not dropped: it is appended to the review summary so nothing is lost.

## Continuous integration

Run CommitBrief on pull requests with the **[CommitBrief Review GitHub
Expand Down
11 changes: 10 additions & 1 deletion internal/cli/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ func newCompressCmd() *cobra.Command {
model = prov.DefaultModel()
}

infof("%s", app.Catalog.T("compress.compressing", rulesPath, prov.Name(), model, level))
// Same staged-tree progress as review / remote pr. compress
// is a single long provider call, so it is one stage; we Close
// (not Clear) to keep the finished stage line on screen above
// the result block, and stop the animation before the stdout
// report and the interactive replace prompt take the terminal.
prog := ui.NewProgress(cmd.ErrOrStderr(), ui.ParseColorMode(global.color), global.quiet)
defer prog.Close()
prog.Start(app.Catalog.T("compress.compressing", rulesPath, prov.Name(), model, level))

start := time.Now()
result, err := compress.Run(cmd.Context(), prov, compress.Request{
Expand All @@ -72,9 +79,11 @@ func newCompressCmd() *cobra.Command {
Model: model,
})
if err != nil {
prog.Fail(err)
return err
}
latency := time.Since(start)
prog.Close()

percent, deltaTokens := result.Savings()
pricing := resolvePricing(app.Config, prov, model)
Expand Down
5 changes: 4 additions & 1 deletion internal/cli/dryrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func newDryRunCmd() *cobra.Command {
// need it and Diff.String() rewalks the file tree on
// every call.
diffText := parsed.String()
p := prompt.Build(loaded, app.Lang, diffText)
// Estimate against the line-numbered diff the review will
// actually send (see review.go); the cache key still keys on
// the plain diffText so dry-run and the real run collide.
p := prompt.Build(loaded, app.Lang, parsed.NumberedString())

// UC-19: surface output-tokens / context-window / cost
// alongside the input-tokens estimate so dry-run answers
Expand Down
13 changes: 12 additions & 1 deletion internal/cli/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/CommitBrief/commitbrief/internal/config"
"github.com/CommitBrief/commitbrief/internal/provider"
"github.com/CommitBrief/commitbrief/internal/setup"
"github.com/CommitBrief/commitbrief/internal/ui"
)

// newProvidersCmd is the `commitbrief providers` subtree. It exposes
Expand Down Expand Up @@ -162,11 +163,21 @@ func newProvidersTestCmd() *cobra.Command {
return errors.New(app.Catalog.T("providers.test.unknown", name, provider.Names()))
}
pc := app.Config.Providers[name]
// Single network step, shown through the shared staged-tree
// progress (a spinner while the ping is in flight). Close keeps
// the finished stage line above the stdout success summary.
prog := ui.NewProgress(cmd.ErrOrStderr(), ui.ParseColorMode(global.color), global.quiet)
defer prog.Close()
prog.Start(app.Catalog.T("providers.test.pinging", name))
start := time.Now()
if err := setup.TestConnection(cmd.Context(), name, pc); err != nil {
return errors.New(app.Catalog.T("providers.test.failed", name, err.Error()))
e := errors.New(app.Catalog.T("providers.test.failed", name, err.Error()))
prog.Fail(e)
return e
}
elapsed := time.Since(start)
prog.Finish()
prog.Close()
if _, err := fmt.Fprintln(cmd.OutOrStdout(), app.Catalog.T("providers.test.success", name, elapsed.Round(time.Millisecond).String())); err != nil {
return err
}
Expand Down
Loading
Loading