Sonnet Review Bot sonnet-review-bot
  • Joined on 2026-04-24
sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:08:09 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MAJOR] The CONVENTIONS.md explicitly states the process for adding a new dependency: 'Open a PR that ONLY updates this table' and 'After merge, a separate PR may use the package.' This PR combines both the allowlist update AND the implementation in a single PR, directly violating the documented process. The dependency github.com/goccy/go-yaml should have been approved in a standalone PR first, then used in a follow-up PR.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:08:09 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] The TestYAMLEmptyFileRejection test uses tc.name (e.g., "completely empty") as the filename fragment but writes all files to the same dir. The test case names contain spaces which are valid in filenames but could cause issues on some filesystems. More importantly, the test writes files with names like completely empty.yaml — using spaces in filenames is unusual and could cause subtle test issues. Prefer replacing spaces with underscores or hyphens.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:08:09 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] The function comment for unmarshalYAMLWithDepthLimit says 'Multi-document YAML files are rejected to prevent silent data loss' but the primary motivation documented elsewhere is 'confusing behavior where users think their changes take effect.' The comment in the code body is more accurate — consider aligning the function-level doc comment.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] The nodeCount increment happens before the visiting and validated checks. This means nodes encountered in cycles (where visiting[node] is true and we return early) are still counted against the total, potentially causing false-positive node count limit errors for valid YAML with shared anchors referenced multiple times. The increment should ideally only count genuinely new work, or the behavior should be explicitly documented.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] The validated[node] = depth assignment stores the current depth as the 'minimum depth at which it was validated'. However the comment says 'maps each node to the minimum depth at which it was previously checked' and the short-circuit condition is depth <= prevDepth (skip if current depth is shallower or equal). This means validated stores the first depth seen (or the deepest so far), not the minimum. On the first visit validated[node] is set to depth, and subsequent visits only proceed if depth > prevDepth. So the map actually stores the shallowest depth visited. The comment is slightly confusing — 'minimum depth' is correct, but the explanation of re-checking logic could be clearer.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] The function comment for unmarshalYAMLWithDepthLimit still says 'Multi-document YAML files are rejected to prevent silent data loss' but the design doc says the library has built-in depth protection. The comment is still accurate for this function but could mention the two-pass design more clearly (AST parse for security checks, then decoder for struct mapping).

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] There is a spurious blank line between TestYAMLDeeplyNestedRejection and TestYAMLEmptyFileRejection (two consecutive blank lines). Minor style issue per gofmt conventions, but the diff shows it was introduced in this PR.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] The design doc still contains the old gopkg.in/yaml.v3-based code sample for unmarshalYAMLWithDepthLimit and checkYAMLDepth (using yaml.Node and yaml.AliasNode) from the original implementation. These code snippets now describe a design that was NOT implemented — the actual implementation uses the goccy/go-yaml AST approach. The design doc should be updated to reflect the actual implementation, or the code samples removed/replaced.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 21:06:41 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MAJOR] The CONVENTIONS.md process rule states: 'To request a new dependency: 1. Open a PR that ONLY updates this table. Requires explicit approval from Aaron. After merge, a separate PR may use the package.' This PR both updates the allowlist table AND uses the package in production code in the same PR. This violates the documented process — the allowlist change and the usage should be in separate PRs.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:58:43 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] GetPullRequest does not wrap the upstream error with context. All other error returns in the adapter do wrap (e.g., PostReview wraps diff-fetch errors), but this one just returns nil, err directly. For consistency and debuggability, consider return nil, fmt.Errorf("get pull request: %w", err).

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:58:43 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] PostReview does not wrap the final a.client.PostReview error with context. If the upstream call fails, the error message gives no indication that this came from the adapter's PostReview path. Consider return nil, fmt.Errorf("post review: %w", err) for consistency with other error wrapping in the file.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:58:43 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The comment on the +++ b/ check says 'non-overlapping' but the reasoning is slightly off: +++ /dev/null doesn't start with +++ b/ so the order doesn't matter for correctness. The comment is technically fine but slightly misleading — it implies order matters when it doesn't. A simpler comment would suffice.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:58:43 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The TestAdapter_PostReview_WithComments_PositionTranslation test comment says 'Position 4 in this diff is "+// new comment at line 3" → new line 3'. The diff has @@ -1,3 +1,4 @@ starting at new line 1, so: pos 1 = @@ header, pos 2 = package main (line 1), pos 3 = (blank, line 2), pos 4 = +// new comment at line 3 (line 3), pos 5 = func main() {} (line 4). The comment and assertion (new_position = 3) are correct, but the blank line between package main and the addition could cause confusion. The test is correct as written.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:53:26 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] Extra blank line between TestYAMLDeeplyNestedRejection closing brace and TestYAMLEmptyFileRejection. Minor style inconsistency — gofmt doesn't enforce single blank lines between top-level declarations, but two blank lines is unusual.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:53:26 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] The checkYAMLDepth function is exported via the test file (TestYAMLAliasCycleDetection calls it directly). Since checkYAMLDepth is unexported (lowercase), the test is in the same package (package review), which is fine. No issue here — just noting this is a white-box test of an internal function, which is appropriate given the security-critical nature of the cycle detection.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:53:26 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] The design doc (docs/DESIGN-57-yaml-persona.md) states the library 'provides built-in depth protection via MaxYAMLDepth/MaxYAMLNodes decoder options', implying these would be used. However, the actual implementation does NOT use those decoder options — instead it implements its own AST walk via checkYAMLDepth. The code is correct and the manual walk is arguably more robust (the design doc was aspirational), but the doc comment on unmarshalYAMLWithDepthLimit says 'The github.com/goccy/go-yaml library provides built-in depth protection via MaxYAMLDepth and MaxYAMLNodes decoder options. We use these instead of a manual depth-checking walk' — which is false. The actual implementation contradicts this comment. The design doc should be updated to reflect the actual approach.