Skip to content

Commit 653eb5d

Browse files
committed
fix: limit feature documentation to matching protocols
Merge upstream main and regenerate the capability table. Address review feedback by decoding V1 flags only for V1 and legacy entries, selecting declared boolean fields, and covering family overrides and nonzero flags.
2 parents cf86bc3 + 321c6d5 commit 653eb5d

73 files changed

Lines changed: 3954 additions & 334 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/code-review/SKILL.md‎

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ All reviews are evaluated against the engineering conventions defined in [AGENTS
1313

1414
## Review Workflow
1515

16-
1. **Classify Changed Files & Scope**:
17-
Group changed files according to the 3-tier architectural hierarchy and evaluate PR scoping:
18-
- **Priority 1: Public Trait APIs & Consumer Contracts** (`roborock/devices/traits/`, `roborock/data/containers.py`)
19-
- **Priority 2: Data Lifecycle & State Management** (trait state, callbacks, `RoborockDevice.close()`, map/render pipelines)
20-
- **Priority 3: Wire Protocols, Codecs & Cryptography** (`roborock/protocols/`, `roborock/devices/transport/`, `roborock/devices/rpc/`)
16+
1. **Fetch PR Context & Classify Scope**:
17+
- **Fetch Metadata & Prior Thread History**: Fetch PR metadata, diff, and all prior reviews and inline threads (`gh pr view <N> -R Python-roborock/python-roborock --json ...` and `gh api repos/Python-roborock/python-roborock/pulls/<N>/comments --paginate`). Note that `gh pr checks <N>` exits non-zero when a first-time contributor's workflow awaits approval—treat that as pending CI approval rather than a failure. When cleaning up or re-reviewing an existing PR, also inspect GraphQL `reviewThreads` to verify and resolve addressed threads (including Copilot comments).
18+
- **Classify Changed Files**: Group changed files according to the 3-tier architectural hierarchy and evaluate PR scoping:
19+
- **Priority 1: Public Trait APIs & Consumer Contracts** (`roborock/devices/traits/`, `roborock/data/containers.py`)
20+
- **Priority 2: Data Lifecycle & State Management** (trait state, callbacks, `RoborockDevice.close()`, map/render pipelines)
21+
- **Priority 3: Wire Protocols, Codecs & Cryptography** (`roborock/protocols/`, `roborock/devices/transport/`, `roborock/devices/rpc/`)
2122
- **PR Scoping**: Flag PRs that mix unrelated subsystems or combine large protocol/parser additions with trait consumption when they should be split into focused PRs.
2223
- **Automated Conformance**: Structural invariants (`RoborockBase` inheritance, `RoborockEnum` fallback members, `RoborockException` rooting, and trait boundary types) are enforced in `tests/conformance/`. Flag any unjustified allowlist exemptions added to `tests/conformance/` and focus deeper review energy on semantic, lifecycle, and design issues.
2324

@@ -47,22 +48,25 @@ All reviews are evaluated against the engineering conventions defined in [AGENTS
4748
5. **Evaluate Tests & Fixtures**:
4849
- **Test Mirroring & Colocation**: Are tests colocated in the matching mirror path under `tests/` for the module being tested (e.g., tests for `roborock/devices/traits/v1/status.py` in `tests/devices/traits/v1/test_status.py`; new modules have corresponding new test suites under the mirror directory)?
4950
- **No One-Off Bugfix Test Files**: Flag any fragmented single-bug or single-PR test files (e.g., `tests/test_battery_low_voltage_fix.py`). Tests must be integrated into the module's corresponding test suite.
50-
- Are tests using `fake_channel` and `@pytest.mark.parametrize` rather than hand-rolled mocks or duplicate methods?
51+
- Are tests reusing shared module fixtures (`mock_rpc_channel`, `fake_channel`, `device_fixture`), `roborock.testing` simulators (`V1VacuumSimulator`, `Q10VacuumSimulator`, `DyadSimulator`, `ZeoSimulator`), and `@pytest.mark.parametrize` rather than hand-rolled inline command-dict fakes or duplicate test methods?
5152
- Do assertions verify public behavior rather than private `_state` variables?
5253

5354
6. **Adversarial Self-Check on Candidate Findings**:
5455
Before presenting or posting any review comment, subject every candidate finding and suggested diff to hostile adversarial scrutiny and discard any that fail:
5556
- **Baseline & History Check**: Trace concrete inputs across `upstream/main`, the PR, and your proposed fix (inspecting `git log` / blame when existing test or helper intent is non-obvious). Discard suggestions that silently regress `main` behavior on valid inputs or introduce magic-number/boundary duplication.
56-
- **Verify Rationale Against Peer Cases**: Check sibling functions and enum codes in the same module to confirm your stated invariant actually holds across the codebase rather than inventing a stricter rule for the touched lines alone.
57-
- **Independent Check of Prior Reviews**: When comparing competing PRs or prior review comments (human or AI), evaluate those claims with the same adversarial skepticism instead of carrying them forward uncritically.
57+
- **Verify Rationale Against Peer Cases**: Check sibling functions, traits, and enum codes in the same module to confirm your stated invariant actually holds across the codebase rather than inventing a stricter rule for the touched lines alone.
58+
- **Prior Review Continuity & Independent Check**: On re-reviews, verify candidate findings against earlier maintainer comments on the PR—never move the goalposts by flagging a pattern the maintainer previously asked the author to adopt (unless explicitly noting why we are reconsidering earlier guidance), and check whether prior maintainer questions were answered. Conversely, evaluate third-party or competing-PR claims with adversarial skepticism instead of carrying them forward uncritically.
5859
- **Drop Low-Value Nits & Allow Zero-Defect Approvals**: Drop trivial docstring or comment wording nits (especially in tests) unless factually harmful, and verify any suggested replacement text accurately reflects what the code/test asserts. If no findings survive adversarial scrutiny, report that the PR is clean and ready to approve rather than manufacturing filler comments.
5960

60-
7. **Format Review Output**:
61-
Structure review comments with clear rationale and actionable code recommendations:
62-
- **Priority Level & File Reference**
63-
- **Issue / Anti-Pattern Identified**
64-
- **Grounded Rationale** (citing protocol resilience, consumer stability, or maintainability)
65-
- **Concrete Before / After Diff or Suggested Fix**
66-
Keep feedback high-signal: focus on architectural violations, state/concurrency bugs, protocol safety, and test gaps; avoid nitpicking formatting or style already enforced by Ruff and Mypy.
67-
- **Interactive / Summary Reviews**: Group findings by Priority Layer (1 → 3) with file references, the anti-pattern identified, grounded rationale (citing protocol resilience, consumer stability, or maintainability), and a concrete before/after diff or suggested fix.
68-
- **Inline PR Review Comments**: State the issue, grounded rationale (citing `AGENTS.md` conventions), and suggested fix concisely right on the affected lines.
61+
7. **Format Review Output & Calibrate Delivery**:
62+
- **Lead with Verdict & Clickable Link**: Always open interactive and subagent review reports with a clickable PR link (`[#N](https://github.com/Python-roborock/python-roborock/pull/N)`) and an explicit 1-line bottom-line verdict (**Approve / LGTM — no changes needed**, **Comment with non-blocking question/simplification**, or **Request Changes**).
63+
- **Structure Actionable Findings**:
64+
- **Priority Level & File Reference**
65+
- **Issue / Anti-Pattern Identified**
66+
- **Grounded Rationale** (citing protocol resilience, consumer stability, or maintainability)
67+
- **Concrete Before / After Diff or Suggested Fix**
68+
Keep feedback high-signal: focus on architectural violations, state/concurrency bugs, protocol safety, and test gaps; avoid nitpicking formatting or style already enforced by Ruff and Mypy.
69+
- **Calibrate GitHub Comment Style**:
70+
- **Simplifications & Design Questions**: Frame optional simplifications as collaborative questions with a proposed `diff` (`COMMENT` review) rather than rigid blockers.
71+
- **Fundamental Design Pushback**: When a PR addresses a real problem with an over-complicated design, prefer **one high-level review comment** acknowledging the real problem, listing the core failure modes, and sketching a simpler alternative instead of leaving inline nits on code that shouldn't stay.
72+
- **Unanswered Prior Questions**: Restate unanswered questions from earlier reviews concisely in 2–3 sentences focused on the core consumer/design question rather than pasting long verbatim self-quotes.

‎.agents/skills/pr-triage/SKILL.md‎

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,48 @@
11
---
22
name: pr-triage
33
description: >-
4-
Assess open pull requests and review queue state in python-roborock, optionally syncing the local workspace with upstream/main. Use when asked what needs to be reviewed, to triage open PRs, or to sync and check the review backlog.
4+
Assess open pull requests, incoming issues, and review queue state in python-roborock, optionally syncing the local workspace with upstream/main. Use when asked what needs to be reviewed, to triage open PRs or incoming issues, or to sync and check the review backlog.
55
---
66

7-
# PR Triage & Review Queue Skill
7+
# PR & Issue Triage Skill
88

9-
Use this skill when assessing open pull requests, checking which PRs need initial review or re-review, or syncing the workspace before starting a review session.
9+
Use this skill when assessing open pull requests, triaging incoming issues, checking which PRs need initial review or re-review, or syncing the workspace before starting a review session.
1010

1111
Once the user selects a specific PR to review, switch to the [Code Review Skill](../code-review/SKILL.md).
1212

1313
---
1414

1515
## Workflow
1616

17-
1. **Optional Workspace Sync**:
18-
If the user asks to sync (e.g., "sync and check reviews") or the workspace is a clean review branch behind `upstream/main`:
17+
1. **Workspace Fetch & Optional Sync**:
18+
Always `git fetch upstream main` so local context reflects current `upstream/main`. If the user asks to sync (e.g., "sync and check reviews") or the workspace is a clean review branch behind `upstream/main`:
1919
- Verify clean working tree (`git status --short`). Do **not** fast-forward or rebase if uncommitted local changes exist unless asked.
2020
- Fetch remotes (`git fetch --all --prune`).
2121
- Fast-forward the local tracking branch to `upstream/main` (or `origin/main` if `upstream` is absent): `git merge --ff-only upstream/main`.
2222

23-
2. **Query Open PR & Review Metadata**:
24-
Identify the current GitHub user and fetch open PR state in a single `gh` pass so no per-PR polling is needed:
23+
2. **Run the Single-Pass Triage Script**:
24+
Execute [`scripts/triage.py`](scripts/triage.py) with `prs`, `issues`, or `all` depending on what the user asked to triage. Each subcommand runs a single GraphQL call (up to 100 open PRs / 50 open issues) without hitting `gh pr list` node-count limits:
2525
```bash
26-
REVIEWER=$(gh api user --jq .login)
27-
gh pr list --repo Python-roborock/python-roborock --state open --limit 30 \
28-
--json number,title,author,isDraft,createdAt,updatedAt,additions,deletions,mergeable,reviewDecision,headRefOid,reviews,commits,comments \
29-
| jq --arg me "$REVIEWER" '
30-
sort_by(.number) | reverse | .[] | .author.login as $pr_author | {
31-
number,
32-
title,
33-
author: $pr_author,
34-
isDraft,
35-
mergeable,
36-
size: "+\(.additions)/-\(.deletions)",
37-
reviewDecision,
38-
headRefOid,
39-
lastCommit: (.commits | last | .committedDate),
40-
myLastReview: ([.reviews[] | select(.author.login == $me)] | last | {state, submittedAt, commitOid: .commit.oid}),
41-
otherLastReview: ([.reviews[] | select(.author.login != $me and .author.login != $pr_author and .author.login != "copilot-pull-request-reviewer")] | last | {author: .author.login, state, submittedAt}),
42-
lastAuthorReplyAt: (
43-
[
44-
(.comments[] | select(.author.login == $pr_author) | .createdAt),
45-
(.reviews[] | select(.author.login == $pr_author) | .submittedAt)
46-
] | max
47-
)
48-
}'
26+
# Triage open PRs only (review buckets + suggested 5-PR batch)
27+
python3 .agents/skills/pr-triage/scripts/triage.py prs
28+
29+
# Triage incoming open issues only (still cross-linking open PRs without dumping the PR queue)
30+
python3 .agents/skills/pr-triage/scripts/triage.py issues
31+
32+
# Triage both open PRs and open issues in a single pass
33+
python3 .agents/skills/pr-triage/scripts/triage.py all
4934
```
50-
*(Note: GitHub's GraphQL `reviews` array includes `COMMENTED` entries whenever an author replies in an inline review thread, so combining `.comments[]` and `.reviews[]` filtered to `$pr_author` captures both top-level PR comments and inline review-thread replies without extra API calls.)*
35+
*(Pass `--json` if structured output is needed for custom filtering.)*
5136

52-
3. **Classify PRs into Actionable Buckets**:
53-
Group open PRs in priority order for the reviewer (`$REVIEWER`):
54-
- **1. New PRs Awaiting Initial Review**:
55-
Non-draft PRs not authored by `$REVIEWER` where `myLastReview.submittedAt == null`. Flag competing/overlapping PRs targeting the same module/issue and note if another maintainer already commented/approved.
56-
- **2. Re-reviews Needed (Updated Since Last Review)**:
57-
Non-draft PRs not authored by `$REVIEWER` where `myLastReview.submittedAt != null` AND (`headRefOid != myLastReview.commitOid` OR `(lastAuthorReplyAt != null and lastAuthorReplyAt > myLastReview.submittedAt)`). Comparing `headRefOid != myLastReview.commitOid` catches amended, rebased, or cherry-picked commits whose `committedDate` precedes `myLastReview.submittedAt`.
58-
- **3. Approved & Ready to Merge / Own PR Updates**:
59-
- Non-draft PRs (authored by `$REVIEWER` or contributors) that are `APPROVED` (`reviewDecision == "APPROVED"`), `MERGEABLE`, and have no unreviewed commits since approval (`headRefOid == myLastReview.commitOid` or authored by `$REVIEWER`).
60-
- Non-draft PRs authored by `$REVIEWER` with new review feedback or merge conflicts requiring action.
61-
- **4. Waiting on Author / Drafts (Compact Summary)**:
62-
- Non-draft PRs with `CHANGES_REQUESTED` or `COMMENTED` where `headRefOid == myLastReview.commitOid` and no new author replies (`lastAuthorReplyAt <= myLastReview.submittedAt`) have arrived.
63-
- Draft PRs (`isDraft == true`), summarized compactly on 1–2 lines unless a draft has notable recent maintainer discussion.
64-
- Conflicting (`mergeable == "CONFLICTING"`) or stale backlog items.
37+
3. **Verify Actionable Buckets**:
38+
The script classifies open PRs for the authenticated reviewer into four priority buckets:
39+
- **1. New PRs Awaiting Initial Review**: Non-draft contributor PRs you have not yet reviewed, annotated with file overlaps (`overlaps #...`), referenced issues, CI state (`SUCCESS`, `FAILURE`, `PENDING_APPROVAL`), and other maintainer reviews.
40+
- **2. Re-reviews Needed**: Non-draft PRs where `headRefOid != myLastReview.commitOid` (catches amended/rebased commits) or the author replied after `myLastReview.submittedAt`.
41+
- **3. Ready to Merge / Own PRs**: Approved, mergeable PRs with no unreviewed commits, plus your own open PRs (highlighting merge conflicts or unresolved Copilot/review threads).
42+
- **4. Waiting on Author & Drafts**: Compact summary of PRs awaiting contributor changes and draft PRs.
6543

6644
4. **Present Concise Triage Report**:
6745
- Report sync status in one line if a sync was performed (commit hash + any new release tags).
68-
- List actionable PRs (`#number`, title, `@author`, `+additions/-deletions`, and why it needs attention—e.g., *opened Oct 31* or *updated Oct 22 after your Oct 17 review*).
69-
- Keep "Waiting on Author / Drafts" brief so actionable reviews stand out.
70-
- Ask which PR the user wants to review first.
46+
- **Always preserve clickable Markdown links** (`[#number](url)`) for every PR and issue mentioned.
47+
- Highlight high-signal relationships (e.g., competing PRs touching the same module, stacked PR series from the same author, or issues already addressed by an open PR).
48+
- Conclude with the **Suggested Next Review Batch (3–5 non-overlapping PRs)** ordered from quick green-CI wins to high-impact bugfixes, noting any PRs awaiting first-time contributor CI approval.

0 commit comments

Comments
 (0)