Skip to content

chore: item_done: unowned claim must not fall through silently after a Failed push outcome (follow-up to #406) - #963

Merged
getappz merged 3 commits into
masterfrom
task/407-item-done-unowned-claim-must-not-fall-th
Oct 26, 2026
Merged

getappz merged 3 commits into
masterfrom
task/407-item-done-unowned-claim-must-not-fall-th

Conversation

@getappz

@getappz getappz commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Auto-opened on item done for zRlNt-we3FSzAXcKck55K.


Opened by claude-code on i-flare-51bb8de6c33b (flared:51bb8de6c33b) for item #407 via agentflare.

Finding (#407)

The reported path (!owns_claim + PrOutcome::Failed/diverged) is unreachable in item_done: a non-owner either steals a stale claim (so owns_claim becomes true) or hits the "refusing to complete someone else's live claim" error before any push/PR. A guard in item_merged_pr.rs was written and reverted as dead code. This PR only adds a regression test pinning that a non-owner done errors and never completes the item; it is a guard on existing behavior, not a behavior change.

Summary by CodeRabbit

  • Tests
    • Expanded automated coverage for item completion when another session holds an active claim. The checks confirm that the operation returns an error and that the item remains incomplete. These tests help verify consistent behavior in this scenario and guard against unintended changes to item status.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0c52d93 and 7917ecc.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between db903a6 and 0c52d93.

Files selected for processing: 1
  • src/mcp_server/tests/item_pr_failure_tests.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

Adds a test for done when a different session owns an item’s live claim. The test checks for an ownership error and verifies that the item remains incomplete.

Changes: Item completion ownership

Layer / File(s) Summary
Live-claim ownership check
src/mcp_server/tests/item_pr_failure_tests.rs
Adds a test that calls done from a non-owner session, expects an error identifying someone else’s live claim, and verifies that the item remains incomplete.

Priority: Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Possibly related issues

Possibly related PRs

  • getappz/agentflare#960 — Both changes cover done calls from a caller that does not own the item’s claim.
  • getappz/agentflare#954 — This test checks the ownership rejection before the push and pull-request flow described in that PR.
Merge Risk: Minimal · up to 0c52d

This test-only change has no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the finding and intended regression coverage, but it does not follow the required template. It omits the Summary, Test plan, and Notes for reviewers sections. Rewrite the description using the repository template. Add a Summary section, include the completed test-plan checks with commands and results, and document risk areas and backwards compatibility under Notes for reviewers.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the item_done behavior and the regression-test follow-up. It is specific and related to the main change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…ndows-latest)`, `Analyze (rust)` and `CI Green`.

- **Formatting:** `cargo fmt --check` exited 0 (I printed `FMT_OK`).
- **Tests:** `cargo test --bin agentflare mcp_server::tests::item` ran the wider item tests, not just `item_pr_failure`. Result: 167 passed, 0 failed, 2 ignored.
- **CI:** `gh pr checks 963 --watch` ended with every check green. `cla` is skipping, and `CodeRabbit` reports "Review skipped: draft pull request".
- **PR body:** I added a section to PR #963 saying the reported path is unreachable in `item_done`. A non-owner either steals a stale claim, so `owns_claim` becomes true, or gets the "refusing to complete someone else's live claim" error before any push or PR.
- **Test:** `item_done_errors_when_another_session_holds_a_live_claim` only guards existing behavior, and it would pass without this PR. The PR body now says so.
- **Reverted guard:** the guard I first wrote in `item_merged_pr.rs` was dead code, so the reverted state has no behavior change and no regression risk.

PR #963 is still a draft. The task's premise doesn't match the current code, so a reviewer should confirm that no guard is the right outcome.

Agentflare-Branch: task/407-item-done-unowned-claim-must-not-fall-th
Agentflare-Item: 407
@getappz
getappz force-pushed the task/407-item-done-unowned-claim-must-not-fall-th branch from d586cb8 to 0c52d93 Compare October 24, 2026 18:12
@getappz
getappz marked this pull request as ready for review October 24, 2026 18:12
@getappz
getappz merged commit c56843f into master Oct 26, 2026
16 checks passed
@getappz
getappz deleted the task/407-item-done-unowned-claim-must-not-fall-th branch October 26, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant