Sweep: assessed all 7 active openspec changes against the codebase. Five had landed implementations (bounded-text, org-label, org-management, code-review-skill, list-milestones-labels) — archived under openspec/changes/archive/2026-05-12-* and their deltas folded into openspec/specs/. Two remain unimplemented: add-releases-support (operation/release/ missing despite proposal PR #129) and forgejo-action-code-review (.forgejo/workflows/claude-code-review.yml missing despite spec deltas). Beads: reopened forgejo-mcp-0ep (releases impl) with notes on actual status; created forgejo-mcp-673 for the action workflow impl.
2.1 KiB
2.1 KiB
bounded-pr-diff Specification
Purpose
TBD - created by archiving change add-bounded-text-responses. Update Purpose after archive.
Requirements
Requirement: Per-file slicing of pull-request diff
The get_pull_request_diff MCP tool SHALL accept an optional string parameter file_path. When file_path is omitted or empty, the tool SHALL return the full unified diff (current behavior). When file_path is set, the tool SHALL return only the diff hunks belonging to that file, identified by the diff --git a/<file_path> b/<file_path> boundary in the unified diff. Match SHALL succeed on either the pre-rename path (a/) or post-rename path (b/).
If file_path is set and no matching file is found in the diff, the tool SHALL return an MCP error result identifying the missing path; the tool MUST NOT silently return the full diff or an empty string.
Scenario: Omitting file_path returns full diff
- WHEN the tool is called with
owner,repo,index, and nofile_path - THEN the system SHALL return the unified diff for the entire pull request
Scenario: file_path selects a single file's hunks
- WHEN the tool is called with
file_path="cmd/main.go"against a PR that touchescmd/main.goand other files - THEN the system SHALL return only the
diff --git a/cmd/main.go b/cmd/main.gosection and its hunks, terminating at the nextdiff --gitline or end of input
Scenario: Renamed file matches either side
- WHEN the diff contains
diff --git a/old.go b/new.go - AND the tool is called with either
file_path="old.go"orfile_path="new.go" - THEN the system SHALL return the rename section in both cases
Scenario: Binary-file diff section
- WHEN
file_pathpoints at a binary file whose section isBinary files a/img.png and b/img.png differ - THEN the system SHALL return that section unchanged
Scenario: file_path not in diff
- WHEN
file_pathdoes not appear in anydiff --githeader in the response - THEN the system SHALL return an MCP error naming the missing
file_path - AND the system SHALL NOT return the full diff as a fallback