Repository navigation
fix: match owned security labels exactly - #1887
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR shares exact security-label matching across automation gates, preserves generic protections, and rechecks security signals before repair merges. Example: A repair PR gains the label
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes distinct close and merge guard failures, preserves existing protections, and has verified maintainer approval for the narrower security-signal contract; no actionable introduced code defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGitHub labels, review markers, and job metadata enter ClawSweeper's eligibility and authorization gates, which select work and permit or reject close and merge operations. flowchart TD
A[GitHub labels and comments] --> B[Shared security classifier]
C[Job security metadata] --> B
B --> D[Close authorization]
B --> E[Repair merge authorization]
B --> F[Finalizer selection]
D --> G[GitHub mutation boundary]
E --> G
Technical reviewBest possible solution: Retain the approved shared classifier, independent generic protections, final mutation reread, and restored automation-label freshness behavior. Do we have a high-confidence way to reproduce the issue? Current-main source exposes missing shared close-label coverage and the absent final security reread, and the supplied before/after CLI traces discriminate both failures without live GitHub writes. Is this the best way to solve the issue? Using the existing classifier at shared gates and rereading its full predicate before mutation addresses the demonstrated failures directly, with the broader classification change now approved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a3ac9853bee1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 10, 2026, 6:37 AM ET / 10:37 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer decision on the open question: approve the explicit-signal contract. The seven exact security labels and the scoped structured signals (supported review markers and explicit job metadata) are the only authoritative security holds. Label prefixes such as Every generic protection that held items before stays in place (CLOSE_PROTECTED_LABEL_NAMES), and the final mutation reread stays in place. So the change only narrows what counts as a security label. It does not remove any close or merge protection. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Summary
isSecurityLabelas the single classifier for the seven exact security labels, with existing case/whitespace normalization. Remove prose/advisory-ID and prefix classification.security. Keep every previous automation hold: the former extra protection labels live in the existingCLOSE_PROTECTED_LABEL_NAMESowner, separately from security classification. The separateimpact:securityadvisory exclusion also remains.Mutation-boundary proof
Candidate:
6088af72aad6749a7a683ecdb1f145a3fa7170f1. Environment: macOS arm64, Node 24; compiled production CLIs with synthetic reviewed reports/jobs and a stubghthat records every call and refuses every mutation. All authority, source-freshness, review-comment, and merge-preflight gates remain enabled. No live GitHub writes and no successful merge are claimed.The fixtures enter
apply-decisions(both dry-run and normal execution),repair:apply-result,repair:post-flightfor manual repair and automerge, andrepair:finalize-open-prs. An allowed normal-execution control reaches the actual close/merge call and is stopped by the stub, not by an earlier unrelated gate. Forbidden cases record zero mutation attempts.gh pr mergesecuritysecurity-sensitivesecurity sensitivetype: securitytype:securitykind: securitykind:securitysecurityishplus security/advisory proseprotected_label, notsecurity_holdRetained generic protections are
area: security,impact:security,security-review-required,security-sensitive-changed,merge-risk: 🚨 security-boundary, andclawsweeper:needs-security-review. Their existing holds are not removed by the exact-seven classification decision. Other existing protected labels and approval/preflight requirements remain in place.Observed candidate coverage: 44/44 apply-close scenarios; 17/17 repair apply-result merge scenarios; 44/44 post-flight repair merge scenarios; 44/44 post-flight automerge scenarios; 29/29 finalizer classification/selection scenarios — 178/178 expected outcomes.
Before / after discrimination
Pinned
origin/main(9e8717ba669e480507db031901d8787cf3d077e5), compiled in an isolated runtime with its own prompts/config, allowed the six non-securityexact labels through core close authorization and reached the real close PATCH. All 44 main comparison scenarios produced the expected outcomes, including preservation of the six pre-existing generic holds. The pre-fix reviewed head's post-flight final reread also reachedgh pr mergefor those six late labels in both manual repair and automerge (12 forbidden attempts). Every attempt was intercepted by the mutation-refusing stub. The candidate holds all seven and makes no forbidden mutation attempt. Core apply's existing source-revision drift check already rejected labels added during a run; the new classifier also protects targets whose labels were added after queueing but before apply began.Redacted traces
Targets and SHA values below are synthetic. Local paths are shortened; no tokens, environment credentials, or private payloads are included.
Reproduction drivers and complete call/response logs are retained outside the checkout under
/tmp/security1887:apply-proof.mts,apply-main-final/summary.json,apply-preserved/summary.json,repair-boundary-proof.mjs, andrepair-boundary-final/summary.json. The table and traces above are included here so review does not depend on access to those local files. The apply driver runsnode dist/clawsweeper.js apply-decisionswith temporary items/closed/plans/report paths,--skip-dashboard --item-number 321, and optional--dry-run. The repair driver runs the compiled apply-result, post-flight, and finalize-open-prs CLIs from an isolated copy of the built runtime/config. Heavy commands ran through Pueue.Limits: synthetic external GitHub responses, not live GitHub/Worker integration. Finalizer proof establishes classification and candidate selection, not execution of the dispatched workflow. Mutation stubs establish authorization and refusal ordering, not successful remote close/merge semantics.
Validation
pnpm run build:all— passed.pnpm run lintandpnpm run format:check— passed.codex review --base origin/mainon the final candidate tree — no actionable defects.No OpenClaw Bay change is needed: existing observer-only status/report rendering can display the protected-label blocker; no public action, navigation, queue API, or wire schema changes.
Source-revision regression repair
The CI failure exposed two effects of expanding
CLOSE_PROTECTED_LABEL_NAMES: the fixture incorrectly assumed every close-protected label changes the source revision (the existing advisory filter still ignoresimpact:securityand the security-boundary merge-risk label), and the hash actually regressed forclawsweeper:needs-security-review, which changed from ignored automation metadata to source content.Decouple source-revision freshness from close protection: preserve the existing human-review, manual-only, and bulk-filed exceptions while ignoring other automation status labels. Separate live close/merge guards still enforce every retained protection. The regression checks each automation label independently and derives the remaining human/protection cases from owner constants. Human label and comment edits still change the revision; bot comments and automation labels do not.
Repair head:
12c5e563c31e2377b57e50a8ea4a12df35f60bcf. On macOS arm64 / Node 24.21.0, Pueue task 1293 (bash /tmp/security1887/source-guard-checks.sh) passedpnpm run build:all, the source-guard file (2/2 tests), the existing focused security/apply/repair suite (359/359 tests),pnpm run lint, andpnpm run format:check. Full output was inspected withpueue log 1293 --full. Task 1294's incremental Codex review found no actionable defects. The mutation-boundary trace above remains evidence for its explicitly named earlier head; this narrow follow-up restores the pre-PR automation hash behavior and reruns the focused suite, rather than claiming those older traces were rerun on this head.The owner decision is now recorded: approve the explicit-signal contract. This resolves the prior review's maintainer-decision question without removing generic protections or the final mutation reread.
Merge risk
Two-way code change: reverting restores the previous classifiers/guards and requires no data migration. The blast radius is automated advisory eligibility, close authorization, and repair merge/finalizer selection. Classification is narrowed to exact labels, but existing automation holds are preserved and the six previously missing exact close labels are added. Incorrect guards could hold legitimate work or allow a protected target through; paired allowed/forbidden traces above exercise those boundaries. Do not merge or enable automerge as part of this request.