Skip to content

chore: automate safe repository triage - #1261

Merged
shanselman merged 5 commits into
mainfrom
shanselman-automate-repository-triage
Aug 28, 2026
Merged

shanselman merged 5 commits into
mainfrom
shanselman-automate-repository-triage

Conversation

@shanselman

@shanselman shanselman commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Recurring repository triage requires manually correlating PR mergeability, base freshness, checks, proof state, authorship, ownership, routing lanes, and linked issue ownership. Active landing labels can also outlive real maintainer activity without a narrowly guarded cleanup path.

Why This Change Was Made

Adds a deterministic daily report workflow and checked-in Node report engine. Scheduled runs are read-only. An explicit manual operation can remove only status: 🚢 actively landing after a fresh API re-check and a documented seven-day inactivity window. It never merges or closes items.

User Impact

Maintainers receive Markdown and JSON triage artifacts that classify docs-only, dependency, bot/repo-assist, platform, release/package, and stale/no-repro lanes. Issues with a current explicit open-PR reference are routed to that PR to discourage duplicate fixes. Legal null GraphQL connections and isolated API failures produce partial-data warnings instead of aborting the whole report.

Evidence

Sample output and the full permissions model are documented in docs/REPOSITORY_TRIAGE.md.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Validation

  • node --test .github/scripts/repository-triage.test.cjs: 14 passed
  • ./scripts/validate-docs.ps1: 47 Markdown files passed
  • ./build.ps1: passed
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 3,819 passed, 32 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --blame-hang-timeout 3m: blocked on the current host. The pre-existing BrowserProxyEndpointScopingTests.Diagnostics_NoOverride_TunnelWithoutBrowserProxyForward_DoesNotProbeTunnelLocalPlusTwo hung after 2,275 passing tests, and the isolated testhost was stopped by the bounded hang timeout.
  • PYTHONUTF8=1 python .agents/skills/autoreview/scripts/autoreview --mode local --parallel-tests "node --test .github/scripts/repository-triage.test.cjs": clean, no accepted or actionable findings on the final contracted-negation patch.
  • Security specialist re-review: clean after audit-array ownership, timeline trust, and linkage sanitization were corrected.

Real Behavior Proof

  • Environment tested: Windows 11, .NET SDK 10.0.303, Node.js 24.14.0
  • PR head or commit tested: eb45070fa1de1932e11984e11d66ab283605ae8a
  • Exact steps or command run: node --test .github/scripts/repository-triage.test.cjs
  • Evidence after fix: 14 deterministic tests passed, covering nullable connections, per-item API failures, bounded merge-state refresh, CLEAN stale-base behavior, issue routing, full-word and contracted negated close/fix/resolve forms with straight and curly apostrophes, positive linkage controls, backtick and tilde fences including unclosed fences, trusted actor provenance, cleanup safeguards, caller-owned audit durability, top-level failure artifacts, verification 404s, workflow permissions, and untrusted Markdown escaping.
  • Observed result: stale base reports yes only for GitHub BEHIND, with lazy status refreshed once and unresolved state reported unknown. Issue ownership ignores quoted, indented, inline-code, fenced-code, and negated linkage text. Report-only is the default; cleanup is manual, default-branch-pinned, exact-label-only, idempotent, and audited even when a later cleanup step fails.
  • Screenshot or artifact links verified? N/A
  • Not verified or blocked: live Actions execution is running on this new head; full Tray suite blocker noted above.

Security Impact

  • New permissions or capabilities? Yes
  • Secrets or tokens handling changed? No
  • New or changed network calls? Yes
  • Command or tool execution surface changed? No
  • Data access scope changed? Yes
  • If any answer is Yes, explain the risk and mitigation: The scheduled report job has only contents, checks, issues, pull-requests, and statuses read access. A separate manually gated cleanup job adds issues: write and pull-requests: write only because GitHub labels use those resources. Cleanup checks out the default branch with persisted credentials disabled and reruns deterministic tests before mutation. The implementation exposes no merge, close, comment, branch-update, or label-add operation and removes only the exact active-ownership label after a fresh item and timeline re-check. Bot, app, external, or unidentified activity cannot incorrectly qualify as trusted maintainer activity. The output directory exists before collection, top-level failures emit minimal durable artifacts, and uploads warn rather than masking an earlier root error. It does not execute pull request code.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 7:25 AM ET / 11:25 UTC.

ClawSweeper review

What this changes

The PR adds a daily GitHub triage report and a manually dispatched cleanup path that can remove an expired active-ownership label after fresh checks.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep open for maintainer authorization and current-head authority-chain proof. This fresh collaborator PR adds a narrowly scoped label-removal capability, but its supplied evidence is mocked rather than a real GitHub Actions final-effect run.

Priority: P2
Reviewed head: eb45070fa1de1932e11984e11d66ab283605ae8a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has focused safeguards and extensive deterministic coverage, but mocked tests cannot satisfy proof for its new write-authority boundary.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: deterministic mocked API tests do not show a current-head GitHub Actions run rejecting the nearest ineligible item before the label-removal request. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: deterministic mocked API tests do not show a current-head GitHub Actions run rejecting the nearest ineligible item before the label-removal request. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Restricted mutation path: The cleanup job is manually gated and is the only job granted issue and pull-request write permissions; it invokes the cleanup operation after checking out the default branch and running its deterministic tests.
Final side effect is narrowly allowlisted: The implementation selects candidates only after ownership safeguards, freshly retrieves each item and timeline, and calls the GitHub label-removal endpoint with the exact active-ownership label.
Current proof is mock-only: The focused tests construct mocked GitHub REST and pagination clients for label removal and workflow checks; they do not exercise a real Actions token or GitHub label endpoint.
Findings None None.
Security None None.

How this fits together

The repository workflow reads open issues and pull requests from GitHub to produce triage artifacts. A separate manually selected path rechecks ownership activity and may remove one operational status label.

flowchart TD
  A[Open issues and pull requests] --> B[Repository triage workflow]
  B --> C[Read-only report collection]
  C --> D[Markdown and JSON artifacts]
  B --> E{Manual cleanup selected?}
  E -->|Yes| F[Fresh ownership checks]
  F --> G[Remove expired active-ownership label]
Loading

Decision needed

Question Recommendation
Should this repository authorize the manually dispatched write-token cleanup after a real current-head run demonstrates its final-effect rejection and removal boundaries? Require final-effect proof: Keep the cleanup path pending until a redacted manual Actions run proves eligible removal and protected or recent-activity rejection before the removal call.

Why: The code introduces an authority-bearing GitHub token path that can mutate issue and pull-request labels; source review cannot establish its real endpoint behavior or the repository’s desired operational policy.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: deterministic mocked API tests do not show a current-head GitHub Actions run rejecting the nearest ineligible item before the label-removal request. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The manually dispatched cleanup gains GitHub label-write authority. Deterministic mocks do not prove that the nearest ineligible item is rejected before a real label-removal request.
  • Resolve merge risk (P1) - The required Tray validation recorded in the PR body did not complete, while the current CI run was still pending at review time.
  • Complete next step (P2) - A maintainer must authorize the new label-write policy and review real current-head final-effect proof before this collaborator PR can proceed.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change size non-test +1,349, tests +1,063 The new repository-wide automation is substantial enough to warrant final-effect proof beyond source-level unit coverage.
Write operations 1 label-removal operation The implementation confines mutation to the exact active-ownership label, which is the critical authority boundary to validate.

Merge-risk options

Maintainer options:

  1. Capture real cleanup authorization proof (recommended)
    Run the manually gated workflow from the current head against controlled eligible and ineligible items, publish redacted logs and audit output, and show rejection occurs before any label mutation.
  2. Accept the write-path risk
    Maintainers may explicitly accept the mocked-only evidence if they are comfortable authorizing this exact label-removal policy.
  3. Defer label cleanup
    Keep reporting and revisit the mutation path when a controlled real Actions proof environment is available.

Technical review

Best possible solution:

Retain the read-only reporting design and land cleanup only after a redacted current-head Actions run proves both an eligible removal and rejection of a protected or recently active item before mutation.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction. The relevant outstanding check is a controlled current-head GitHub Actions execution of the new label-removal authority path.

Is this the best way to solve the issue?

Unclear. The read-only report plus narrowly allowlisted manual cleanup is a maintainable shape, but real final-effect proof and maintainer authorization are still required for the write path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6b23db113918.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: deterministic mocked API tests do not show a current-head GitHub Actions run rejecting the nearest ineligible item before the label-removal request. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: needs maintainer proof decision: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a bounded repository-operations change with meaningful but non-emergency maintainer impact.
  • merge-risk: 🚨 automation: The PR adds scheduled and manual GitHub Actions automation that collects data and uploads triage artifacts.
  • merge-risk: 🚨 security-boundary: The manual cleanup job receives write permissions and can remove a label after interpreting GitHub activity.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: deterministic mocked API tests do not show a current-head GitHub Actions run rejecting the nearest ineligible item before the label-removal request. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Restricted mutation path: The cleanup job is manually gated and is the only job granted issue and pull-request write permissions; it invokes the cleanup operation after checking out the default branch and running its deterministic tests. (.github/workflows/repository-triage.yml:66, eb45070fa1de)
  • Final side effect is narrowly allowlisted: The implementation selects candidates only after ownership safeguards, freshly retrieves each item and timeline, and calls the GitHub label-removal endpoint with the exact active-ownership label. (.github/scripts/repository-triage.cjs:916, eb45070fa1de)
  • Current proof is mock-only: The focused tests construct mocked GitHub REST and pagination clients for label removal and workflow checks; they do not exercise a real Actions token or GitHub label endpoint. (.github/scripts/repository-triage.test.cjs:732, eb45070fa1de)
  • Feature provenance: The current branch contains five commits for this new automation, all authored by Scott Hanselman; no prior implementation history was found for the added workflow paths. (.github/scripts/repository-triage.cjs:1, eb45070fa1de)
  • Repository policy applied: The checked-in repository policy requires direct current-head proof for permissions-sensitive PR work and mandatory validation reporting; the supplied PR body records a blocked Tray suite and an Actions run still in progress. (AGENTS.md:45, eb45070fa1de)

Likely related people:

  • shanselman: The PR commits are authored by Scott Hanselman, the active-ownership label was applied by this collaborator, and nearby existing automation history includes their agentic-workflow updates. (role: active ownership actor and adjacent workflow contributor; confidence: high; commits: eb45070fa1de, b077078ccca1; files: .github/workflows/repository-triage.yml, .github/scripts/repository-triage.cjs, .github/workflows/ci.yml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Publish redacted current-head Actions evidence showing one eligible removal and one protected or recently active item rejected before mutation.
  • Complete the required Tray validation or provide a current host-specific blocker with a follow-up validation result.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-28T08:44:19.194Z sha db74a49 :: needs real behavior proof before merge. :: [P2] Restrict ownership activity to trusted actors | [P2] Ignore explicitly negated related references
  • reviewed 2026-08-28T09:36:46.013Z sha 555952d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-28T10:45:13.725Z sha 75c4181 :: needs real behavior proof before merge. :: none

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 05c0be01-cea5-4583-a975-a8f81048a3e2
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 28, 2026
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 05c0be01-cea5-4583-a975-a8f81048a3e2
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 28, 2026
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 05c0be01-cea5-4583-a975-a8f81048a3e2
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 05c0be01-cea5-4583-a975-a8f81048a3e2
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 28, 2026
@shanselman
shanselman marked this pull request as ready for review August 28, 2026 11:51
@shanselman shanselman added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 28, 2026
@shanselman
shanselman merged commit 56a169f into main Aug 28, 2026
23 checks passed
@shanselman
shanselman deleted the shanselman-automate-repository-triage branch August 28, 2026 11:51
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant