feat: add deterministic PR dossier artifacts#378
Conversation
Findings
|
Findings
|
FindingsNo findings. The fixes address the architectural issues from the prior review: PR body is now kept out of existing selection and rollup prompt payloads, approval review content is excluded from the reviewer-facing discussion dossier while remaining available in raw artifacts, final discussion output is capped/excerpted, inline discussion ordering is deterministic, and dossier child paths reject traversal-like names. The remaining behavior is aligned with ticket #368’s boundary: persist raw context plus compact final dossier artifacts, without switching reviewer execution or durable summarization yet. |
|
Findings
|
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: e63664b
Approved with 4 non-blocking suggestions below. Address at your discretion.
Summary
| Reviewer | Findings |
|---|---|
| harness-engineering:harness-knowledge-reviewer | 3 |
| harness-engineering:harness-self-documenting-code-reviewer | 1 |
harness-engineering:harness-knowledge-reviewer (3 findings)
💡 Suggestion - internal/pipeline/pipeline.go:2584
The three-tier dossier structure (raw/summary/final) has no documentation of tier semantics or rationale. Future contributors extending the dossier won't know why raw vs. final are separated or what each tier is intended for. A brief docs/ entry capturing the artifact contract and tier semantics would make this discoverable.
💡 Suggestion - internal/pipeline/pipeline.go:2226
The
promptPRtype enforces a non-obvious invariant:gitprovider.PR.Bodymust not appear in selection or rollup prompt payloads. The type name doesn't convey this intent — a name likepromptPayloadPRorbodyExcludedPRwould signal the omission intentionally. A future contributor adding a field togitprovider.PRwon't know this exclusion exists or why, risking inadvertent prompt leakage. A short comment or docs/ pointer would make the contract discoverable. (Consolidates naming finding from harness-self-documenting-code-reviewer at the same line.)
💡 Suggestion - internal/pipeline/pipeline.go:2975
The approval-filtering behavior in
reviewerFacingTopLevelComments— approval reviews excluded from the final reviewer-facing dossier, retained in raw — is undocumented in code or docs/. The rationale (preventing approval state from influencing subsequent reviewers) lives only in PR discussion threads. If this invariant is load-bearing for the review system's correctness contract, a brief inline note or docs/ entry would prevent it from being accidentally reverted.
harness-engineering:harness-self-documenting-code-reviewer (1 findings)
💡 Suggestion - internal/pipeline/pipeline.go:3063
In
filePatchStatus, the 'added' case detects new files by scanning raw diff text for both"new file mode"and"--- /dev/null"— two distinct git diff header formats. A reader unfamiliar with git diff internals won't know why both strings are needed or what each covers. Extracting this to a named helper likeisNewFileInDiff(patch string) boolwould encapsulate the heuristic and make the switch case intent immediately clear.
1 info-level observations excluded. Run with --verbose to include.
4 PR discussion threads considered.
Completed in 4m 09s | $2.29 | sonnet | daemon 0.2.132 | Glorfindel
| Field | Value |
|---|---|
| Model | sonnet |
| Reviewers | hybrid-synthesis, harness-engineering:harness-architecture-reviewer, harness-engineering:harness-enforcement-reviewer, harness-engineering:harness-knowledge-reviewer, harness-engineering:harness-self-documenting-code-reviewer, security:security-code-auditor |
| Engine | claude · sonnet |
| Reviewed by | pr-review-daemon · monit-pr-reviewer |
| Duration | 4m 09s wall · 4m 05s compute (Reviewers: 2m 30s · Synthesis: 1m 35s) |
| Cost | $2.29 (estimated) |
| Tokens | 389.6k in / 26.8k out |
| Turns | 12 |
Per-workstream usage
| Workstream | Model | In | Out | Cache read | Cache create | Cost |
|---|---|---|---|---|---|---|
| hybrid-synthesis | sonnet | 40.8k | 5.5k | 13.1k | 27.6k (1h) | $0.25 |
| harness-engineering:harness-architecture-reviewer | sonnet | 66.9k | 1.7k | 13.1k | 53.7k (1h) | $0.35 |
| harness-engineering:harness-enforcement-reviewer | sonnet | 68.3k | 2.8k | 13.1k | 55.2k (1h) | $0.38 |
| harness-engineering:harness-knowledge-reviewer | sonnet | 68.4k | 3.0k | 13.1k | 55.2k (1h) | $0.38 |
| harness-engineering:harness-self-documenting-code-reviewer | sonnet | 76.6k | 10.4k | 13.1k | 63.5k (1h) | $0.54 |
| security:security-code-auditor | sonnet | 68.6k | 3.4k | 13.1k | 55.4k (1h) | $0.39 |
Re-reviews only run when @monit-reviewer is re-requested as a reviewer — push as many commits as you need, then re-request when ready. PRs targeting branches other than main, master are skipped, even when @monit-reviewer is re-requested.
| @@ -2491,6 +2584,601 @@ func writeArtifacts(paths ArtifactPaths, rawDiff string, patches []FilePatch, ca | |||
| return nil | |||
There was a problem hiding this comment.
🔵 Low (harness-engineering:harness-knowledge-reviewer): The three-tier dossier structure (raw/summary/final) has no documentation of tier semantics or rationale. Future contributors extending the dossier won't know why raw vs. final are separated or what each tier is intended for. A brief docs/ entry capturing the artifact contract and tier semantics would make this discoverable.
Reply to this thread when addressed.
| @@ -2155,6 +2226,28 @@ type selectionAgentPrompt struct { | |||
| NeedsFullFileContent bool `json:"needs_full_file_content"` | |||
There was a problem hiding this comment.
🔵 Low (harness-engineering:harness-knowledge-reviewer): The promptPR type enforces a non-obvious invariant: gitprovider.PR.Body must not appear in selection or rollup prompt payloads. The type name doesn't convey this intent — a name like promptPayloadPR or bodyExcludedPR would signal the omission intentionally. A future contributor adding a field to gitprovider.PR won't know this exclusion exists or why, risking inadvertent prompt leakage. A short comment or docs/ pointer would make the contract discoverable. (Consolidates naming finding from harness-self-documenting-code-reviewer at the same line.)
Reply to this thread when addressed.
| } | ||
| if comment.Author != "" { | ||
| out.WriteString("by ") | ||
| out.WriteString(comment.Author) |
There was a problem hiding this comment.
🔵 Low (harness-engineering:harness-knowledge-reviewer): The approval-filtering behavior in reviewerFacingTopLevelComments — approval reviews excluded from the final reviewer-facing dossier, retained in raw — is undocumented in code or docs/. The rationale (preventing approval state from influencing subsequent reviewers) lives only in PR discussion threads. If this invariant is load-bearing for the review system's correctness contract, a brief inline note or docs/ entry would prevent it from being accidentally reverted.
Reply to this thread when addressed.
| sort.Slice(files, func(i, j int) bool { return files[i].Path < files[j].Path }) | ||
| return dossierIndexArtifact{HashAlgorithm: "sha256", Files: files}, nil | ||
| } | ||
|
|
There was a problem hiding this comment.
🔵 Low (harness-engineering:harness-self-documenting-code-reviewer): In filePatchStatus, the 'added' case detects new files by scanning raw diff text for both "new file mode" and "--- /dev/null" — two distinct git diff header formats. A reader unfamiliar with git diff internals won't know why both strings are needed or what each covers. Extracting this to a named helper like isNewFileInDiff(patch string) bool would encapsulate the heuristic and make the switch case intent immediately clear.
Reply to this thread when addressed.
No description provided.