Skip to content

Commit 01c2454

Browse files
authored
Merge 70ec296 into 83cb99d
2 parents 83cb99d + 70ec296 commit 01c2454

6 files changed

Lines changed: 1369 additions & 0 deletions

File tree

‎.github/workflows/proof-nudges.yml‎

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: ClawSweeper Proof Nudges
2+
3+
run-name: ${{ github.event_name == 'schedule' && 'Scheduled proof nudges' || 'Manual proof nudges' }}
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
target_repo:
9+
description: "Repository to inspect for proof nudges"
10+
required: false
11+
default: "openclaw/openclaw"
12+
execute:
13+
description: "Post proof-nudge comments; false runs dry-run only"
14+
required: false
15+
default: "false"
16+
limit:
17+
description: "Maximum proof nudges to plan or post"
18+
required: false
19+
default: "10"
20+
min_age_days:
21+
description: "Minimum age in days since review/author activity before first proof nudge"
22+
required: false
23+
default: "5"
24+
cooldown_days:
25+
description: "Same-head cooldown in days between proof nudges"
26+
required: false
27+
default: "7"
28+
item_numbers:
29+
description: "Optional comma-separated PR numbers to inspect first"
30+
required: false
31+
default: ""
32+
schedule:
33+
- cron: "44 9 * * *"
34+
35+
permissions:
36+
contents: read
37+
issues: write
38+
pull-requests: read
39+
40+
env:
41+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
42+
CLAWSWEEPER_APP_CLIENT_ID: Iv23liOECG0slfuhz093
43+
44+
concurrency:
45+
group: ${{ format('clawsweeper-proof-nudges-{0}', github.event.inputs.target_repo || vars.CLAWSWEEPER_PROOF_NUDGES_TARGET_REPO || 'openclaw/openclaw') }}
46+
cancel-in-progress: false
47+
48+
jobs:
49+
proof-nudges:
50+
name: Proof nudges
51+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'schedule' && vars.CLAWSWEEPER_PROOF_NUDGES_SCHEDULED == '1') }}
52+
runs-on: ubuntu-latest
53+
timeout-minutes: 60
54+
steps:
55+
- uses: actions/checkout@v6
56+
with:
57+
filter: blob:none
58+
fetch-depth: 0
59+
60+
- name: Resolve target repository
61+
id: target
62+
env:
63+
TARGET_REPO_INPUT: ${{ github.event.inputs.target_repo || vars.CLAWSWEEPER_PROOF_NUDGES_TARGET_REPO || 'openclaw/openclaw' }}
64+
run: |
65+
target_repo="$TARGET_REPO_INPUT"
66+
if [[ ! "$target_repo" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then
67+
echo "::error::target_repo must be owner/repo with GitHub-safe characters"
68+
exit 1
69+
fi
70+
target_owner="${target_repo%%/*}"
71+
target_name="${target_repo#*/}"
72+
{
73+
echo "target_repo=$target_repo"
74+
echo "target_repo_owner=$target_owner"
75+
echo "target_repo_name=$target_name"
76+
} >> "$GITHUB_OUTPUT"
77+
78+
- name: Create target proof-nudge token
79+
id: target-proof-token
80+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
81+
with:
82+
client-id: ${{ env.CLAWSWEEPER_APP_CLIENT_ID }}
83+
private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
84+
owner: ${{ steps.target.outputs.target_repo_owner }}
85+
repositories: ${{ steps.target.outputs.target_repo_name }}
86+
permission-contents: read
87+
permission-issues: write
88+
permission-pull-requests: read
89+
90+
- name: Create state token
91+
id: state-token
92+
uses: ./.github/actions/create-state-token
93+
with:
94+
client-id: ${{ env.CLAWSWEEPER_APP_CLIENT_ID }}
95+
private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }}
96+
97+
- uses: ./.github/actions/setup-state
98+
with:
99+
token: ${{ steps.state-token.outputs.token }}
100+
101+
- uses: ./.github/actions/setup-pnpm
102+
with:
103+
build-script: build:all
104+
105+
- name: Run proof nudges
106+
env:
107+
GH_TOKEN: ${{ steps.target-proof-token.outputs.token }}
108+
TARGET_REPO: ${{ steps.target.outputs.target_repo }}
109+
PROOF_NUDGES_EXECUTE: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.execute == 'true') || (github.event_name == 'schedule' && vars.CLAWSWEEPER_PROOF_NUDGES_EXECUTE == '1') }}
110+
PROOF_NUDGES_ITEM_NUMBERS: ${{ github.event.inputs.item_numbers || '' }}
111+
PROOF_NUDGES_LIMIT: ${{ github.event.inputs.limit || vars.CLAWSWEEPER_PROOF_NUDGES_LIMIT || '10' }}
112+
PROOF_NUDGES_MIN_AGE_DAYS: ${{ github.event.inputs.min_age_days || vars.CLAWSWEEPER_PROOF_NUDGES_MIN_AGE_DAYS || '5' }}
113+
PROOF_NUDGES_COOLDOWN_DAYS: ${{ github.event.inputs.cooldown_days || vars.CLAWSWEEPER_PROOF_NUDGES_COOLDOWN_DAYS || '7' }}
114+
run: |
115+
set -euo pipefail
116+
for numeric_input in PROOF_NUDGES_LIMIT PROOF_NUDGES_MIN_AGE_DAYS PROOF_NUDGES_COOLDOWN_DAYS; do
117+
if [[ ! "${!numeric_input}" =~ ^[0-9]+$ ]]; then
118+
echo "::error::$numeric_input must be a non-negative integer"
119+
exit 1
120+
fi
121+
done
122+
123+
execute_arg=()
124+
if [ "$PROOF_NUDGES_EXECUTE" = "true" ]; then
125+
execute_arg=(--execute)
126+
fi
127+
item_numbers_arg=()
128+
if [ -n "$PROOF_NUDGES_ITEM_NUMBERS" ]; then
129+
if [[ ! "$PROOF_NUDGES_ITEM_NUMBERS" =~ ^[0-9]+([[:space:]]*,[[:space:]]*[0-9]+)*$ ]]; then
130+
echo "::error::item_numbers must be a comma-separated list of pull request numbers"
131+
exit 1
132+
fi
133+
item_numbers_arg=(--item-numbers "$PROOF_NUDGES_ITEM_NUMBERS")
134+
fi
135+
pnpm run proof-nudges -- \
136+
--target-repo "$TARGET_REPO" \
137+
--limit "$PROOF_NUDGES_LIMIT" \
138+
--min-age-days "$PROOF_NUDGES_MIN_AGE_DAYS" \
139+
--cooldown-days "$PROOF_NUDGES_COOLDOWN_DAYS" \
140+
--report-path proof-nudge-report.json \
141+
"${item_numbers_arg[@]}" \
142+
"${execute_arg[@]}"
143+
144+
- uses: actions/upload-artifact@v7
145+
if: ${{ always() }}
146+
with:
147+
name: proof-nudge-report
148+
path: proof-nudge-report.json
149+
if-no-files-found: ignore

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ proof, supplied-but-not-sufficient proof, mock-only proof, and proof label
259259
mismatches. See
260260
[`docs/pr-proof-triage-dashboard.md`](docs/pr-proof-triage-dashboard.md).
261261

262+
The optional proof-nudge lane can dry-run or post polite reminder comments for
263+
open PRs that remain blocked on `triage: needs-real-behavior-proof`. It uses
264+
comment-body cooldown markers, never closes PRs, and keeps scheduled operation
265+
behind default-off repository variables. See
266+
[`docs/proof-nudges.md`](docs/proof-nudges.md).
267+
262268
## How It Works
263269

264270
ClawSweeper is split into four operational lanes:

‎docs/proof-nudges.md‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# ClawSweeper Proof Nudges
2+
3+
Read when changing the ClawSweeper lane that reminds pull request authors to add real behavior proof.
4+
5+
## Scope
6+
7+
The proof-nudge lane is read-mostly triage hygiene. It can post a polite reminder comment on open pull requests that are stuck on `triage: needs-real-behavior-proof`, but it does not close pull requests, merge pull requests, change labels, request reviews, or modify review records.
8+
9+
The lane uses the latest ClawSweeper review report plus the live pull request state. It does not scrape the visible review comment for policy.
10+
11+
## Eligibility
12+
13+
A pull request is eligible only when all of these are true:
14+
15+
- The live item is an open pull request.
16+
- The live pull request still has `triage: needs-real-behavior-proof`.
17+
- The latest report still says real behavior proof blocks merge.
18+
- The report head SHA matches the live pull request head SHA.
19+
- The pull request is past the first-nudge age gate, defaulting to 5 days.
20+
- The author has not commented recently and the head commit is not recent.
21+
- There is no same-head proof nudge inside the cooldown window, defaulting to 7 days.
22+
23+
The lane skips maintainer-authored, bot-authored, security-sensitive, and release-style pull requests. It also skips pull requests with `proof: supplied`, `proof: sufficient`, or `proof: override`, because those need review or policy handling rather than another contributor reminder.
24+
25+
## Marker
26+
27+
Cooldown state lives in the reminder comment body:
28+
29+
```html
30+
<!-- clawsweeper-proof-nudge item="123" sha="abc123" at="2026-05-18T12:00:00.000Z" v="1" -->
31+
```
32+
33+
The marker records the pull request number, reviewed head SHA, timestamp, and marker version. This avoids label churn and keeps the reminder state tied to the exact head that was nudged.
34+
35+
## Command
36+
37+
Dry-run is the default:
38+
39+
```bash
40+
pnpm run proof-nudges -- --target-repo openclaw/openclaw
41+
```
42+
43+
Post comments only with an explicit execute flag:
44+
45+
```bash
46+
pnpm run proof-nudges -- --target-repo openclaw/openclaw --execute --limit 10
47+
```
48+
49+
Useful options:
50+
51+
- `--limit`: maximum nudges to plan or post, default `10`.
52+
- `--processed-limit`: maximum records to inspect in one run.
53+
- `--min-age-days`: first-nudge age gate, default `5`.
54+
- `--cooldown-days`: same-head cooldown, default `7`.
55+
- `--item-numbers`: comma-separated pull request numbers for a targeted dry-run or execute run.
56+
- `--report-path`: JSON output path, default `proof-nudge-report.json`.
57+
- `--max-runtime-ms`: optional hard runtime stop.
58+
59+
## Workflow Use
60+
61+
The `ClawSweeper Proof Nudges` workflow exposes this as a manual `workflow_dispatch` lane. It defaults to dry-run. Use `execute=true` only after reviewing a dry-run report.
62+
63+
The workflow also includes a daily scheduled lane at `44 9 * * *`, but it is off by default. This lets maintainers enable scheduled proof nudges later without another code change.
64+
65+
Scheduled operation uses repository variables:
66+
67+
- `CLAWSWEEPER_PROOF_NUDGES_SCHEDULED=1`: enable the scheduled lane. Without this, the daily schedule is skipped.
68+
- `CLAWSWEEPER_PROOF_NUDGES_EXECUTE=1`: allow the scheduled lane to post comments. Without this, scheduled runs remain dry-run only.
69+
- `CLAWSWEEPER_PROOF_NUDGES_TARGET_REPO`: optional target repo, default `openclaw/openclaw`.
70+
- `CLAWSWEEPER_PROOF_NUDGES_LIMIT`: optional scheduled batch size, default `10`.
71+
- `CLAWSWEEPER_PROOF_NUDGES_MIN_AGE_DAYS`: optional first-nudge age gate, default `5`.
72+
- `CLAWSWEEPER_PROOF_NUDGES_COOLDOWN_DAYS`: optional same-head cooldown, default `7`.
73+
74+
Suggested rollout:
75+
76+
1. Run the proof-nudge workflow manually with `execute=false`.
77+
2. Set `CLAWSWEEPER_PROOF_NUDGES_SCHEDULED=1` to collect scheduled dry-run reports.
78+
3. Set `CLAWSWEEPER_PROOF_NUDGES_EXECUTE=1` only after the scheduled reports look correct.
79+
80+
This first version intentionally has no auto-close behavior. Any escalation after repeated proof nudges needs a separate maintainer policy decision.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"review": "node dist/clawsweeper.js review",
1414
"apply-artifacts": "node dist/clawsweeper.js apply-artifacts",
1515
"apply-decisions": "node dist/clawsweeper.js apply-decisions",
16+
"proof-nudges": "node dist/clawsweeper.js proof-nudges",
1617
"audit": "node dist/clawsweeper.js audit",
1718
"reconcile": "node dist/clawsweeper.js reconcile",
1819
"status": "node dist/clawsweeper.js status",

0 commit comments

Comments
 (0)