Skip to content

chore: refine agent skills, add triage CLI, and disable benchmarks by default - #1073

Merged
Lash-L merged 3 commits into
Python-roborock:mainfrom
allenporter:docs-trajectory-improvements
Nov 22, 2026
Merged

Lash-L merged 3 commits into
Python-roborock:mainfrom
allenporter:docs-trajectory-improvements

Conversation

@allenporter

@allenporter allenporter commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Reviewing recent coding-agent and maintainer review trajectories surfaced several recurring efficiency and quality bottlenecks:

  1. Triage token & API overhead: Inline gh pr list | jq pipelines in pr-triage/SKILL.md truncated queues past 30 PRs, hit GitHub's GraphQL 500,000-node cap when raised to 100 (commits author traversal), dumped ungrouped JSON into context, and didn't support standalone incoming-issue triage.
  2. Benchmark overhead on every test run: pytest ran multi-round calibration/timing loops across all 11 map benchmarks on every uv run pytest and CI invocation (~15s+ overhead).
  3. Environment & review friction: Shared-container VIRTUAL_ENV / UV_PROJECT_ENVIRONMENT collisions, missing roborock.testing simulator references, and re-reviews occasionally moving goalposts against prior maintainer requests.

Summary

  • Single-pass triage CLI (.agents/skills/pr-triage/scripts/triage.py & SKILL.md):
    • Add a zero-dependency stdlib GraphQL helper with separate prs, issues, and all subcommands (plus --json) that fetches up to 100 open PRs / 50 open issues in one call without hitting GraphQL node caps.
    • triage.py prs pre-buckets open PRs into the 4 review queues, detects changed-file overlaps across PRs, counts unresolved review threads (including Copilot), and recommends up to 5 non-overlapping PRs.
    • triage.py issues triages incoming open issues and cross-links any open PRs addressing them without dumping the PR queue into context.
  • Disable benchmarks by default (pyproject.toml & tests/map/test_benchmarks.py):
    • Add --benchmark-disable to default pytest addopts so benchmark functions still run once as smoke tests (0.9s vs. 15s+), with --benchmark-enable to run full benchmarks on demand.
  • Engineering & review guidelines (AGENTS.md & .agents/skills/code-review/SKILL.md):
    • Document isolated UV_PROJECT_ENVIRONMENT usage in shared/worktree containers, roborock.testing simulators, reproduce-first bugfix tests, write-then-refresh trait setter conventions, declarative payload dicts, and minimal-diff/concise-comment standards.
    • Add a Prior Review Continuity check on re-reviews (avoiding goalpost-moving on previously requested patterns), unresolved reviewThreads checks, upfront clickable link + 1-line verdict headers, and calibrated comment delivery.

Test Plan

  • python3 .agents/skills/pr-triage/scripts/triage.py prs
  • python3 .agents/skills/pr-triage/scripts/triage.py issues
  • python3 .agents/skills/pr-triage/scripts/triage.py all --json
  • uv run pytest tests/map/test_benchmarks.py (11 passed in 0.92s)
  • uv run pre-commit run --all-files (Ruff, Mypy, Codespell)

Copilot AI balanced review requested due to automatic review settings November 22, 2026 01:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@allenporter
allenporter marked this pull request as draft November 22, 2026 02:07
@allenporter
allenporter force-pushed the docs-trajectory-improvements branch from 92a42e5 to da09078 Compare November 22, 2026 02:17
@allenporter
allenporter force-pushed the docs-trajectory-improvements branch from da09078 to e32ed8c Compare November 22, 2026 02:37
@allenporter allenporter changed the title docs: refine agent guidelines, code-review, and pr-triage skills chore: refine agent skills, add triage CLI, and disable benchmarks by default Nov 22, 2026
@allenporter
allenporter marked this pull request as ready for review November 22, 2026 02:41
@allenporter
allenporter requested a review from Lash-L November 22, 2026 02:47

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated code review by Gemini 4 Neon in Antigravity using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).

Verdict: LGTM (Comment with 1 minor non-blocking suggestion) — passes /review.

Summary of Verification

  • Triage CLI (.agents/skills/pr-triage/scripts/triage.py): Verified prs and issues subcommands live against the repository; single-pass GraphQL query, bucket classification (including headRefOid != myLastReview.commitOid re-review detection), file-overlap detection, and batch recommendation all behave as expected.
  • Pytest benchmarks (pyproject.toml, tests/map/test_benchmarks.py): Verified --benchmark-disable in addopts still allows running benchmarks explicitly with --benchmark-enable (including --benchmark-enable --benchmark-only without triggering pytest-benchmark's mutual-exclusion error), and all CI jobs pass.
  • Docs & skills (AGENTS.md, .agents/skills/*/SKILL.md): Verified all referenced paths, relative links, .claude/skills symlink, tests/devices/traits/v1/fixtures.py fixture names, and roborock.testing simulator exports exist and match.

One minor non-blocking suggestion inline on triage.py error surfacing when gh api graphql exits non-zero.

Comment on lines +500 to +504
proc = subprocess.run(cmd, check=True, capture_output=True, text=True)
payload: dict[str, Any] = json.loads(proc.stdout)
if payload.get("errors"):
raise RuntimeError(f"GraphQL errors: {payload['errors']}")
return payload["data"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: subprocess.run(..., check=True, capture_output=True) raises CalledProcessError before lines 501–503 run whenever gh api graphql exits non-zero (including auth failures, bad --repo, or GraphQL errors). Because CalledProcessError.__str__ omits stderr and prints the full cmd list, failures swallow gh's error message and dump the entire ~100-line GRAPHQL_QUERY into the traceback.

Consider surfacing proc.stderr (or parsed GraphQL errors) cleanly instead:

proc = subprocess.run(cmd, check=False, capture_output=True, text=True)
if proc.returncode != 0:
    detail = proc.stderr.strip() or proc.stdout.strip() or f"exit code {proc.returncode}"
    raise RuntimeError(f"gh api graphql failed: {detail}")
payload: dict[str, Any] = json.loads(proc.stdout)
if payload.get("errors"):
    raise RuntimeError(f"GraphQL errors: {payload['errors']}")
return payload["data"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer to you if you want to do this post merge. Low stakes

@Lash-L Lash-L added /review run Code review skill (/review) has been run Passed /review Passed the /review skill check labels Nov 22, 2026
@Lash-L
Lash-L merged commit bddf50c into Python-roborock:main Nov 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Passed /review Passed the /review skill check /review run Code review skill (/review) has been run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants