Skip to content

Commit 474a03d

Browse files
committed
📝 State the review components' GitHub mutations accurately (#83)
Five descriptions promised less than their components do, and three of them hid a mutation of the pull request entirely. `<SuggestRemoval>` does not simply replace the previous bot review: it deletes earlier ones only where GitHub permits deletion, so a submitted review can remain and the old wording's promise that reviews never stack was not one the component keeps. It now says what it does — delete where allowed, acknowledge declined suggestions and resolve their threads, then post pending findings as a new review. `<CommentReview>` reconciles inline removal suggestions when findings remain and the GitHub environment is present, and said nothing about it. `<SlopPolicy>` and `<PrPolicyReport>` compose it, so an author reading either of them was told they render a section and not that running one writes to the pull request. All three now disclose it. `<RepoPolicyReport>` stated the cleanup issues unconditionally, but `<CleanupIssues>` does nothing without `GITHUB_TOKEN` and `GITHUB_REPOSITORY`. `Sample.md` and `Instruction.md` each carried a second copy of one metadata key at the top level, left behind when the prose moved into their `meta:` blocks. `parseMeta()` treats an explicit `meta:` block as the complete metadata object, so those copies were read by nobody — `<Sample>` still reports its `as` and `context` and `<Instruction>` its `context` with them gone. Both pairs stay byte-equivalent. The `unused-in-diff` comment still named `.reviews` as the source it reads. Descriptive metadata and one comment only: no body, schema, form or return moves, and nothing asserts on this wording.
1 parent f31c2ac commit 474a03d

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎packages/code-review-agent/src/documents/components/CommentReview.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ props:
88
additionalProperties: false
99
description: >-
1010
Review the pull request's code comments for ones that only restate the code.
11-
`<CommentReview pr={pr} />` asks the model in scope which are redundant, reads the
12-
replies to earlier suggestions to see which a person rejected, and renders what is
13-
still outstanding.
11+
`<CommentReview pr={pr} />` asks the model in scope which are redundant, reads
12+
replies to earlier suggestions, and renders what remains outstanding. When findings
13+
remain and the required GitHub environment is present, it also reconciles inline
14+
removal suggestions on the pull request.
1415
---
1516

1617
<CommentReviewData pr={props.pr} as="reviewData" />

‎packages/code-review-agent/src/documents/components/Instruction.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ props:
2222
from enclosing scopes appear first, inner instructions are appended.
2323
required: [system]
2424
additionalProperties: false
25-
context: >-
26-
The Markdown whose samples carry this instruction.
2725
---
2826

2927
```js persist eval

‎packages/code-review-agent/src/documents/components/PrPolicyReport.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ props:
1313
description: >-
1414
Compose the whole pull-request review. `<PrPolicyReport pr={pr}
1515
diagnostics={diagnostics} doctor={doctor} />` renders the scope, structural, slop,
16-
static-analysis and correctness sections under one heading.
16+
static-analysis and correctness sections under one heading. When redundant comments
17+
remain and the required GitHub environment is present, it also reconciles inline
18+
removal suggestions on the pull request.
1719
---
1820

1921
## PR #{props.pr.meta.number}: {props.pr.meta.title}

‎packages/code-review-agent/src/documents/components/RepoPolicyReport.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ props:
1919
description: >-
2020
Compose the whole repository analysis. `<RepoPolicyReport diagnostics={diagnostics}
2121
doctor={doctor} fileList={files} fileCount={count} lineCount={lines} />` renders the
22-
static-analysis and cleanup sections and files the cleanup issues they justify.
22+
static-analysis and cleanup sections. With the configured GitHub environment, it
23+
also creates, updates and closes cleanup issues for the five highest-ranked file
24+
clusters.
2325
---
2426

2527
## Repository Analysis

‎packages/code-review-agent/src/documents/components/Sample.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ props:
3636
as SampleContext.params. Providers can use this for custom behavior
3737
(e.g., "brief", "json", "classify").
3838
additionalProperties: false
39-
as: >-
40-
The model's reply.
4139
---
4240

4341
```js persist eval

‎packages/code-review-agent/src/documents/components/SuggestRemoval.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ props:
1010
required: [findings]
1111
additionalProperties: false
1212
description: >-
13-
Leave the review's removal suggestions on the pull request. `<SuggestRemoval
13+
Reconcile the review's removal suggestions on the pull request. `<SuggestRemoval
1414
findings={state.pendingFindings} dismissedReplies={state.newDismissReplies} />`
15-
replaces the previous bot review rather than stacking another, and answers the
16-
suggestions a person already declined. It does nothing without the GitHub
17-
environment.
15+
deletes previous bot reviews when GitHub permits it, acknowledges declined
16+
suggestions and resolves their threads, then posts pending findings as a new review.
17+
It does nothing without the required GitHub environment.
1818
---
1919

2020
```ts eval

‎packages/code-review-agent/src/documents/policies/SlopPolicy.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ props:
1111
description: >-
1212
Report verbosity indicators in a pull request. `<SlopPolicy pr={pr}
1313
diagnostics={diagnostics} />` renders a Slop section covering comment ratio,
14-
comments that restate the code, and the sensor's verbosity signals.
14+
comments that restate the code, and the sensor's verbosity signals. When redundant
15+
comments remain and the required GitHub environment is present, it also reconciles
16+
inline removal suggestions on the pull request.
1517
---
1618

1719
<ReviewSection heading="Slop" clean="✅ Slop indicators look low.">

‎packages/core/components/Instruction.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ props:
2222
from enclosing scopes appear first, inner instructions are appended.
2323
required: [system]
2424
additionalProperties: false
25-
context: >-
26-
The Markdown whose samples carry this instruction.
2725
---
2826

2927
```js persist eval

‎packages/core/components/Sample.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ props:
3636
as SampleContext.params. Providers can use this for custom behavior
3737
(e.g., "brief", "json", "classify").
3838
additionalProperties: false
39-
as: >-
40-
The model's reply.
4139
---
4240

4341
```js persist eval

‎packages/core/tests/unused-in-diff.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ function doc(lines: AddedLine[], construct: string): string {
3333
}
3434

3535
// The real component is read before useStubFs replaces the filesystem, so the
36-
// tests exercise the shipped .reviews source rather than a copy. Its `<If>` is
37-
// a native directive, so the stub filesystem supplies no component for it.
36+
// tests exercise the packaged review source rather than a test-owned copy. Its
37+
// `<If>` is a native directive, so the stub filesystem supplies no component for
38+
// it.
3839
function* render(lines: AddedLine[], construct: string): Operation<string> {
3940
const unusedInDiff = yield* readTextFile(
4041
"packages/code-review-agent/src/documents/components/UnusedInDiff.md",

0 commit comments

Comments
 (0)