Skip to content

Add PR review slash command#774

Merged
huangruiteng merged 1 commit into
mainfrom
codex/pr-review-command-20260627
Jun 27, 2026
Merged

Add PR review slash command#774
huangruiteng merged 1 commit into
mainfrom
codex/pr-review-command-20260627

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add the read-only /loopx-pr-review slash command to the command catalog.
  • Add loopx pr-review [--repo owner/repo] to build a guided review queue for the caller's current GitHub project by default, or an explicit repository target.
  • Keep LoopX itself as dogfood/public fixture only; the packet title, protocol docs, help text, and area classifier now use generic project-review language.
  • Include protocol docs, a public fixture, and smoke coverage for the PR review packet.

Validation

  • python3 -m py_compile loopx/pr_review.py loopx/cli_commands/pr_review.py loopx/cli.py loopx/cli_commands/__init__.py loopx/slash_commands.py
  • python3 examples/pr-review-command-smoke.py
  • python3 examples/slash-command-catalog-smoke.py
  • python3 examples/global-manager-command-protocol-smoke.py
  • python3 examples/global-manager-command-cli-smoke.py
  • git diff --check
  • python3 -m loopx.cli --format json check --scan-path loopx/pr_review.py --scan-path loopx/cli_commands/pr_review.py --scan-path loopx/slash_commands.py --scan-path docs/reference/protocols/pr-review-command-v0.md --scan-path docs/reference/protocols/global-manager-command-v0.md --scan-path examples/pr-review-command-smoke.py --scan-path examples/slash-command-catalog-smoke.py
  • python3 -m loopx.cli --format json pr-review --limit 1

@huangruiteng huangruiteng force-pushed the codex/pr-review-command-20260627 branch from ef6ed89 to 15357b7 Compare June 27, 2026 13:01
@huangruiteng huangruiteng force-pushed the codex/pr-review-command-20260627 branch from 15357b7 to b041152 Compare June 27, 2026 13:03
@huangruiteng

Copy link
Copy Markdown
Owner Author

Findings: none blocking.

Review notes:

  • The command is correctly scoped as read-only: it builds a public-safe PR review queue and does not comment, approve, merge, or spend LoopX quota.
  • The implementation keeps the public/private boundary explicit: source surfaces are limited to GitHub PR metadata/body summary/files/commit headlines/check rollup, and the fixture smoke scans for local path leakage.
  • I specifically checked the review ordering path: draft PRs are covered by the fixture/smoke so a newer draft does not jump ahead of ready review items.

Validation performed:

  • pr-review-command-smoke ok
  • slash-command-catalog-smoke ok
  • {
    "ok": true,
    "schema_version": "loopx_pr_review_command_response_v0",
    "request": {
    "schema_version": "loopx_pr_review_command_request_v0",
    "command": "/loopx-pr-review",
    "cli_command": "loopx pr-review [--repo owner/repo]",
    "repository": "huangruiteng/loopx",
    "limit": 3,
    "source": "github_cli",
    "include": [
    "motivation",
    "change_scope",
    "checks",
    "risk_notes",
    "review_sequence"
    ],
    "privacy_mode": "public_safe_github_metadata",
    "dry_run": true
    },
    "generated_at": "2026-06-27T13:04:39Z",
    "summary": {
    "headline": "3 open PR(s) found; 3 need review attention.",
    "open_pr_count": 3,
    "review_attention_count": 3,
    "draft_count": 0,
    "source_surfaces": [
    "GitHub pull request metadata",
    "GitHub pull request body summary",
    "GitHub pull request changed-file list",
    "GitHub pull request commit headlines",
    "GitHub pull request status check rollup"
    ],
    "recommended_first_pr": {
    "rank": 1,
    "number": 774,
    "title": "Add PR review slash command",
    "url": "Add PR review slash command #774",
    "review_depth": "runtime_behavior_review",
    "why_now": "Open and awaiting reviewer decision."
    }
    },
    "review_sequence": [
    {
    "rank": 1,
    "number": 774,
    "title": "Add PR review slash command",
    "url": "https://github.com/Add PR review slash command #774",
    "review_depth": "runtime_behavior_review",
    "why_now": "Open and awaiting reviewer decision."
    },
    {
    "rank": 2,
    "number": 775,
    "title": "Fix profile-scoped side-agent handoff routing",
    "url": "https://github.com/Fix profile-scoped side-agent handoff routing #775",
    "review_depth": "runtime_behavior_review",
    "why_now": "Open and awaiting reviewer decision."
    },
    {
    "rank": 3,
    "number": 771,
    "title": "docs: add public showcase pages and experimental value path",
    "url": "https://github.com/docs: add public showcase pages and experimental value path #771",
    "review_depth": "presentation_or_policy_review",
    "why_now": "Open and awaiting reviewer decision."
    }
    ],
    "pull_requests": [
    {
    "number": 774,
    "title": "Add PR review slash command",
    "url": "https://github.com/Add PR review slash command #774",
    "author": "huangruiteng",
    "updated_at": "2026-06-27T13:03:59Z",
    "base_ref": "main",
    "head_ref": "codex/pr-review-command-20260627",
    "is_draft": false,
    "review_decision": "REVIEW_REQUIRED",
    "merge_state": "BLOCKED",
    "motivation": "Add the read-only /loopx-pr-review slash command to the command catalog. Add loopx pr-review [--repo owner/repo] to build a guided review queue for the caller's current GitHub project by default, or an explicit repository target.",
    "scale": {
    "changed_files": 11,
    "additions": 1016,
    "deletions": 0
    },
    "areas": {
    "public_docs": 3,
    "test_or_example": 3,
    "product_runtime": 5
    },
    "key_files": [
    {
    "path": "docs/reference/protocols/README.md",
    "area": "public_docs",
    "additions": 1,
    "deletions": 0
    },
    {
    "path": "docs/reference/protocols/global-manager-command-v0.md",
    "area": "public_docs",
    "additions": 6,
    "deletions": 0
    },
    {
    "path": "docs/reference/protocols/pr-review-command-v0.md",
    "area": "public_docs",
    "additions": 115,
    "deletions": 0
    },
    {
    "path": "examples/fixtures/pr-review.public.json",
    "area": "test_or_example",
    "additions": 88,
    "deletions": 0
    },
    {
    "path": "examples/pr-review-command-smoke.py",
    "area": "test_or_example",
    "additions": 79,
    "deletions": 0
    },
    {
    "path": "examples/slash-command-catalog-smoke.py",
    "area": "test_or_example",
    "additions": 3,
    "deletions": 0
    },
    {
    "path": "loopx/cli.py",
    "area": "product_runtime",
    "additions": 11,
    "deletions": 0
    },
    {
    "path": "loopx/cli_commands/init.py",
    "area": "product_runtime",
    "additions": 3,
    "deletions": 0
    },
    {
    "path": "loopx/cli_commands/pr_review.py",
    "area": "product_runtime",
    "additions": 84,
    "deletions": 0
    },
    {
    "path": "loopx/pr_review.py",
    "area": "product_runtime",
    "additions": 618,
    "deletions": 0
    }
    ],
    "commit_headlines": [
    "Add PR review slash command"
    ],
    "checks": {
    "total": 0,
    "counts": {},
    "summary": "No status-check rollup was available from the source.",
    "failures": [],
    "pending": []
    },
    "review_depth": "runtime_behavior_review",
    "risk_notes": [
    "Merge state is BLOCKED; check conflict or branch-protection details.",
    "Touches runtime, app, CLI, or automation paths; review behavior and compatibility before merge.",
    "Large review surface; split the review by area before approving."
    ],
    "review_prompts": [
    "What user or maintainer value does this PR unlock now?",
    "Do the touched files match that stated scope?",
    "Are validation evidence and risk boundaries strong enough for merge?"
    ],
    "evidence_commands": [
    "gh pr view 774 --json title,body,files,commits,statusCheckRollup",
    "gh pr diff 774 --stat"
    ]
    },
    {
    "number": 775,
    "title": "Fix profile-scoped side-agent handoff routing",
    "url": "https://github.com/Fix profile-scoped side-agent handoff routing #775",
    "author": "huangruiteng",
    "updated_at": "2026-06-27T12:50:03Z",
    "base_ref": "main",
    "head_ref": "codex/handoff-route-drift-repair-20260627",
    "is_draft": false,
    "review_decision": "REVIEW_REQUIRED",
    "merge_state": "BLOCKED",
    "motivation": "Resolve side-agent completion handoff owners from the completing agent's coordination.agent_profiles.<agent_id>.review_policy.handoff_agent before falling back to goal-level coordination.side_agent_handoff_agent. Make heartbeat-prompt --agent-id render the same profile-scoped handoff owner that todo complete --claimed-by enforces.",
    "scale": {
    "changed_files": 7,
    "additions": 193,
    "deletions": 15
    },
    "areas": {
    "public_docs": 2,
    "test_or_example": 2,
    "product_runtime": 3
    },
    "key_files": [
    {
    "path": "docs/product/agent-profile-contract.md",
    "area": "public_docs",
    "additions": 6,
    "deletions": 0
    },
    {
    "path": "docs/project-agent-todo-contract.md",
    "area": "public_docs",
    "additions": 13,
    "deletions": 10
    },
    {
    "path": "examples/heartbeat-prompt-smoke.py",
    "area": "test_or_example",
    "additions": 66,
    "deletions": 0
    },
    {
    "path": "examples/todo-lifecycle-cli-smoke.py",
    "area": "test_or_example",
    "additions": 65,
    "deletions": 0
    },
    {
    "path": "loopx/agent_registry.py",
    "area": "product_runtime",
    "additions": 33,
    "deletions": 3
    },
    {
    "path": "loopx/cli_commands/support_control.py",
    "area": "product_runtime",
    "additions": 5,
    "deletions": 1
    },
    {
    "path": "loopx/todos.py",
    "area": "product_runtime",
    "additions": 5,
    "deletions": 1
    }
    ],
    "commit_headlines": [
    "Support profile-scoped side-agent handoff",
    "Document profile handoff routing"
    ],
    "checks": {
    "total": 0,
    "counts": {},
    "summary": "No status-check rollup was available from the source.",
    "failures": [],
    "pending": []
    },
    "review_depth": "runtime_behavior_review",
    "risk_notes": [
    "Merge state is BLOCKED; check conflict or branch-protection details.",
    "Touches runtime, app, CLI, or automation paths; review behavior and compatibility before merge."
    ],
    "review_prompts": [
    "What user or maintainer value does this PR unlock now?",
    "Do the touched files match that stated scope?",
    "Are validation evidence and risk boundaries strong enough for merge?"
    ],
    "evidence_commands": [
    "gh pr view 775 --json title,body,files,commits,statusCheckRollup",
    "gh pr diff 775 --stat"
    ]
    },
    {
    "number": 771,
    "title": "docs: add public showcase pages and experimental value path",
    "url": "https://github.com/docs: add public showcase pages and experimental value path #771",
    "author": "huangruiteng",
    "updated_at": "2026-06-27T12:18:59Z",
    "base_ref": "main",
    "head_ref": "codex/hardware-canonical-showcases",
    "is_draft": false,
    "review_decision": "REVIEW_REQUIRED",
    "merge_state": "BLOCKED",
    "motivation": "Review the intent described by the title: docs: add public showcase pages and experimental value path",
    "scale": {
    "changed_files": 25,
    "additions": 808,
    "deletions": 124
    },
    "areas": {
    "public_entry_or_policy": 3,
    "app_or_ui_surface": 1,
    "public_docs": 19,
    "test_or_example": 2
    },
    "key_files": [
    {
    "path": "AGENTS.md",
    "area": "public_entry_or_policy",
    "additions": 15,
    "deletions": 0
    },
    {
    "path": "README.md",
    "area": "public_entry_or_policy",
    "additions": 17,
    "deletions": 0
    },
    {
    "path": "README.zh-CN.md",
    "area": "public_entry_or_policy",
    "additions": 15,
    "deletions": 0
    },
    {
    "path": "apps/dashboard/src/views/frontstage-page.tsx",
    "area": "app_or_ui_surface",
    "additions": 63,
    "deletions": 0
    },
    {
    "path": "docs/showcases/cases/0617-blocked-p0-safe-rotation.en.html",
    "area": "public_docs",
    "additions": 14,
    "deletions": 4
    },
    {
    "path": "docs/showcases/cases/0617-blocked-p0-safe-rotation.html",
    "area": "public_docs",
    "additions": 14,
    "deletions": 4
    },
    {
    "path": "docs/showcases/cases/0619-dynamic-workflow-hardware-agent.en.html",
    "area": "public_docs",
    "additions": 12,
    "deletions": 2
    },
    {
    "path": "docs/showcases/cases/0619-loopx-self-iteration.en.html",
    "area": "public_docs",
    "additions": 12,
    "deletions": 2
    },
    {
    "path": "docs/showcases/cases/0619-loopx-self-iteration.html",
    "area": "public_docs",
    "additions": 12,
    "deletions": 2
    },
    {
    "path": "docs/showcases/cases/0620-creator-operator-case-spec.en.html",
    "area": "public_docs",
    "additions": 14,
    "deletions": 4
    }
    ],
    "commit_headlines": [
    "Add public showcase case pages",
    "docs: require first-screen owner review",
    "docs: add experimental today value path",
    "Merge main into hardware canonical showcases"
    ],
    "checks": {
    "total": 2,
    "counts": {
    "success": 2
    },
    "summary": "2 successful check(s).",
    "failures": [],
    "pending": []
    },
    "review_depth": "presentation_or_policy_review",
    "risk_notes": [
    "Merge state is BLOCKED; check conflict or branch-protection details.",
    "Touches runtime, app, CLI, or automation paths; review behavior and compatibility before merge.",
    "Large review surface; split the review by area before approving."
    ],
    "review_prompts": [
    "What user or maintainer value does this PR unlock now?",
    "Do the touched files match that stated scope?",
    "Are validation evidence and risk boundaries strong enough for merge?"
    ],
    "evidence_commands": [
    "gh pr view 771 --json title,body,files,commits,statusCheckRollup",
    "gh pr diff 771 --stat"
    ]
    }
    ],
    "actions": [
    {
    "action_id": "act_review_next_pr",
    "kind": "review",
    "requires_user_approval": false,
    "requires_primary_agent": false,
    "preview": "Start with the first PR in review_sequence, read its motivation, inspect key files, then decide approve/request changes/defer."
    },
    {
    "action_id": "act_merge_after_review",
    "kind": "merge_or_publish",
    "requires_user_approval": false,
    "requires_primary_agent": true,
    "preview": "Merge only after repository policy, validation, and public/private boundary checks pass."
    }
    ],
    "omissions": [
    "Raw logs, private connector payloads, credentials, local paths, and private source bodies were intentionally omitted.",
    "The command summarizes public PR metadata and does not post review comments, approve, merge, or spend quota."
    ],
    "boundary": {
    "raw_logs_recorded": false,
    "raw_transcripts_recorded": false,
    "raw_connector_payloads_recorded": false,
    "credential_values_recorded": false,
    "absolute_paths_recorded": false,
    "private_source_bodies_recorded": false
    }
    }
  • public/private scan over changed files; only intentional boundary-policy strings and smoke regexes matched.

Merge decision: hold for primary/owner merge. This PR touches runtime/CLI behavior and adds a large new command surface (~1k LOC), so I am not self-merging it from the product-capability side-agent lane even though the focused validation passed.

@huangruiteng

Copy link
Copy Markdown
Owner Author

Owner authorized self-merge in chat. Normal merge is blocked only by branch policy (reviewDecision=REVIEW_REQUIRED); PR is otherwise mergeable and has no remote checks reported.

Findings: none blocking.

Validation rerun before merge:

  • python3 -m py_compile loopx/pr_review.py loopx/cli_commands/pr_review.py loopx/cli.py loopx/cli_commands/__init__.py loopx/slash_commands.py
  • python3 examples/pr-review-command-smoke.py
  • python3 examples/slash-command-catalog-smoke.py
  • python3 examples/global-manager-command-protocol-smoke.py
  • python3 examples/global-manager-command-cli-smoke.py
  • git diff --check origin/main...HEAD
  • python3 -m loopx.cli --format json check --scan-path loopx/pr_review.py --scan-path loopx/cli_commands/pr_review.py --scan-path loopx/cli.py --scan-path loopx/cli_commands/__init__.py --scan-path loopx/slash_commands.py --scan-path examples/pr-review-command-smoke.py --scan-path examples/slash-command-catalog-smoke.py --scan-path examples/fixtures/pr-review.public.json --scan-path docs/reference/protocols/pr-review-command-v0.md --scan-path docs/reference/protocols/README.md --scan-path docs/reference/protocols/global-manager-command-v0.md
  • python3 -m loopx.cli --format json pr-review --limit 1

Boundary: public/private scan is clean for touched paths. Existing LoopX history duplicate-index warning is unrelated. Merge decision: self-merged with owner authorization.

@huangruiteng huangruiteng merged commit db2905f into main Jun 27, 2026
@huangruiteng huangruiteng deleted the codex/pr-review-command-20260627 branch June 27, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant