Repository navigation
fix(ci): preserve Periphery findings after delayed draft events - #138665
Conversation
Record producer publication intent and admit matching runs in the shared iOS/macOS commenter. Preserve useful findings across passive draft callbacks while retaining explicit draft and no-scope cleanup. Related: #138571 (ancillary validation follow-up), #138572 (merged concurrency admission repair).
|
🦞👀 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. |
|
Exact-head pre-land verification for The shared commenter now uses producer-recorded intent for both admission and supersession, then revalidates the live PR before writing. The original synthetic ordering is repaired for both iOS and macOS: ready run 201 publishes its useful finding, and later passive run 202 neither supersedes it nor erases the comment. Explicit draft cleanup, real scope loss, newer eligible runs/attempts, and artifact/permission boundaries remain protected. Operational production delta is +46/−33 (net +13), supplying the missing cross-workflow fact while consolidating validation; tests are +388/−206. Hosted proof at this head:
Local integrated proof: 281 tests passed, including the landed concurrency regressions. Original red proof was 40 failures/49 passes; expanded commenter/scope proof was 119 passes, with broader 571-test routing/sibling coverage and 36 official expression-evaluator cases. Fresh independent Codex autoreview was scoped-clean through P2. Complete changed checks, workflow sanity, and whitespace validation passed. node scripts/run-vitest.mjs test/scripts/ios-periphery-comment-workflow.test.ts test/scripts/periphery-scope-workflows.test.ts test/scripts/ancillary-workflow-concurrency.test.tsnode scripts/check-changed.mjs -- .github/workflows/ios-periphery-comment.yml .github/workflows/ios-periphery.yml .github/workflows/macos-periphery.yml docs/ci.md test/scripts/ios-periphery-comment-workflow.test.tsnode --import ./scripts/tsx.mjs scripts/check-workflows.mtsProof limits remain explicit: the delayed ordering is synthetic, not observed webhook attribution; the unmerged privileged commenter cannot execute as the default-branch workflow. Unrecognized historical/transient titles are no-ops, and REST revalidation/write is not atomic. The existing first-associated-PR selection remains a separate investigation. Native review artifacts are validated for this exact head. ClawSweeper has now published its exact-head review; its merge-risk items are addressed below. No review or CI enforcement bypass is requested. Published ClawSweeper review: risk resolutionReviewed the completed exact-head ClawSweeper review. It reports no correctness or security findings and recommends retaining the producer-owned design. Its three merge-risk items are addressed as follows; no code change or review-enforcement bypass is needed.
{
"id": 33924804972,
"head_sha": "5a84a4308a0053d04b8e8c6b3b38b9937020a2dd",
"run_attempt": 1,
"status": "queued",
"display_title": "iOS Periphery Dead Code [report]"
}The required CI gate remains green at the reviewed/prepared head. The completed bot review now satisfies the native completion-receipt guard; normal native merge checks will be revalidated before any merge. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 7:54 PM ET / 23:54 UTC. ClawSweeper reviewWhat this changesRecords why each iOS or macOS dead-code workflow started, then uses that information to prevent delayed passive draft runs from suppressing or replacing useful PR findings. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, distinct publication fix: current main and v2026.9.1 retain the faulty supersession path, while the earlier merged concurrency repair explicitly excluded it. No introduced blocking correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe native dead-code workflows produce scan artifacts, and a separate GitHub Actions workflow publishes their findings as PR comments. The change connects producer event intent to comment publication while checking the PR’s current head and draft state. flowchart TD
A[PR event] --> B[Native scan workflow]
B --> C[Recorded publication intent]
B --> D[Scan report artifact]
C --> E[Comment publication checks]
D --> E
F[Live PR and newer eligible runs] --> E
E --> G[Update findings or cleanup comment]
E --> H[Logged no-op]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +182, Docs +4, Config +13. Total +199 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep producer-recorded intent and one shared live-PR predicate with the documented fresh-event rollout; the small workflow growth supplies information that ambiguous job conclusions cannot recover. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a same-head ready report followed by a higher-numbered passive draft run reaches both faulty main-branch paths. The supplied red/green results and inspected shared-state regressions support that synthetic ordering; this review did not execute it. Is this the best way to solve the issue? Yes. Recording intent at the producers repairs the information loss, and the consumer reuses it for admission and supersession without duplicating the already-merged concurrency fix; the historical-run cutoff is explicit rather than hidden behind a fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c7dc2c68e246. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…claw#138665) Record producer publication intent and admit matching runs in the shared iOS/macOS commenter. Preserve useful findings across passive draft callbacks while retaining explicit draft and no-scope cleanup. Related: openclaw#138571 (ancillary validation follow-up), openclaw#138572 (merged concurrency admission repair).
Related: #138571 — passive draft events displacing useful ancillary validation; this completes the separately recorded Periphery publication follow-up.
Related: #138572 — merged concurrency-admission repair. Its group-key behavior is preserved, not duplicated here.
Additional instructions
This is a same-repository branch that maintainers can push to.
What Problem This Solves
Resolves a problem where contributors and maintainers can lose useful iOS or macOS Periphery findings after a delayed passive draft event. In the reproduced same-head ordering, a completed ready run with a valid unused-function report is suppressed solely because a passive draft run has a higher run number. The passive callback then replaces existing findings with a draft-or-out-of-scope message even though the live pull request is non-draft.
The ordering is a synthetic feasible counterexample, not recovered webhook attribution or a claim about the cause of a particular production cancellation.
Why This Change Was Made
The source workflows now record a closed publication intent through GitHub's existing
run-name/display_titlecontract: report, explicit draft cleanup, passive draft, or manual. The shared commenter uses that same producer-owned fact for both publication admission and supersession. It no longer reconstructs draft intent from ambiguous job conclusions or treats every newer run as a publisher.One canonical live-PR predicate checks open state, repository, exact head, and draft state before artifact work and immediately before writing. Explicit
converted_to_draftcleanup remains eligible only while the PR is draft. A report-admitted run that successfully detects no native scope still clears stale findings, with a reason that does not falsely claim draft status. Eligible newer runs and attempts still supersede, including pending runs whose admission metadata is available.This removes undifferentiated newer-run supersession, the ambiguous draft-or-scope cleanup message, and duplicated live-PR validation. A consumer-only skipped-job exception would lose intentional cleanup and still lack the original admission fact. No new job, artifact, dependency, configuration option, runner, permission, or concurrency-group change is introduced. ZIP/report bounds, rendering sanitization, bot ownership, action pins, and comment-write/403 handling are preserved.
User Impact
Useful Periphery findings survive delayed passive draft callbacks for both native apps. Intentional draft and no-scope cleanup still work, and stale-head, newer-attempt, and changed-live-state protections remain intact.
Rollout: runs without recognized admission metadata are logged no-ops and cannot publish or supersede. A new source event after updating the workflow is needed; rerunning an old unmarked run cannot recover its original admission intent. CI documentation explains this boundary and rollout behavior.
Evidence
Red/green publication proof
The original actual embedded commenter reproduction used ready run
201/ number10, passive run202/ number11, an open non-draft same-head PR fixture, fake GitHub APIs, and real ZIP bytes containing a valid Periphery JSON unused-function finding. Before repair, run 201 wrote nothing and run 202 replaced the existing report with the incorrect skip message.New regressions against unchanged production produced 40 failures / 49 passes. The expanded final commenter/scope suites passed 119 tests, and broader commenter/scope/shared-intersection/test-routing proof passed 571 tests. Red and final totals differ because producer-expression and additional boundary cases were added after the initial red pass.
Integration on current main, including the already-landed concurrency change, passed 281 tests:
The tests execute the actual producer YAML expressions and embedded commenter, exercise both callback orders with shared comment state for iOS and macOS, preserve explicit and delayed draft cleanup, genuine later/pending runs and attempts, exact-head and final live-state validation, scope cleanup, missing metadata, unavailable reports, artifact limits, and token/ownership behavior.
An independent integrity-verified
@actions/[email protected]evaluator passed 36 producer-title cases. It was temporary proof tooling, not a new repository dependency. Parsed producer YAML is unchanged apart fromrun-name; the commenter's permissions, trigger, runner, source guard, and action pin are unchanged. The existing archive parsing/bounds, finding escaping, comment size cap, bot ownership, and write/403 handling were also compared byte-for-byte.Local gates
Complete changed-scope checks passed, including root test types, script/test lint, formatting, and repository guards:
Workflow sanity passed, including actionlint, Zizmor, Git-owner consistency, composite-action interpolation, and conflict markers:
git diff --checkpassed. Fresh independent Codex autoreview of the integrated candidate was scoped-clean through P2. Exact-head hosted CI and the native landing gates are checked before merge.Proof limits and ownership
The publication-order proof is synthetic and makes zero live GitHub requests. It does not establish historical webhook ordering, GitHub-server execution of the candidate commenter, or globally atomic comment writes. The privileged
workflow_runcommenter executes its default-branch definition, so the unmerged candidate cannot be exercised there merely by opening this PR; no delayed-webhook injection or manual workflow dispatch is claimed. Automatic PR runs can verify the producer metadata separately.GitHub documents
run-nameand itsdisplay_titlerepresentation, but does not explicitly guarantee immediate populated metadata for queued runs. Unknown titles remain no-ops rather than guessed intent. Final PR revalidation narrows races; separate REST calls remain non-atomic.Shared OpenClawKit has no consumer in this commenter and is unchanged. No restricted CODEOWNERS path was needed. The pre-existing associated-PR selection is not redesigned: GitHub's run
pull_requestsarray describes matching head/branch associations, not necessarily the triggering PR. Source-bound triggering-PR identity remains a separate investigation; no live wrong-PR publication is asserted here.Size: operational production workflow YAML +46/−33 (net +13); tests +388/−206 (net +182); docs +6/−2. Production growth supplies the missing cross-workflow admission contract while consolidating repeated validation. Runtime application code, dependencies, and changelog are unchanged.