Skip to content

fix(workflow): scope comment-only reconciliation - #1040

Merged
vincentkoc merged 1 commit into
mainfrom
fix/scope-comment-only-reconciliation
Aug 6, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/scope-comment-only-reconciliation

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where comment-only apply runs could perform redundant broad
reconciliation before selecting their bounded item batch, and explicit
comment-only selections were not guaranteed to constrain execution
reconciliation to those items.

Why This Change Was Made

Comment-only schedules, cursor runs, and manual comment-sync runs now share the
existing read-only preselection skip gate. Once the bounded selection exists,
execution reconciliation adds --only-item-numbers for every non-empty
comment-only selection.

Explicit close runs remain broadly reconcilable, and an empty selector remains
unscoped. This changes only the internal apply workflow reconciliation path; it
does not change public schemas, status payloads, observer surfaces, or release
publishing.

User Impact

Comment synchronization no longer scans or rewrites unrelated durable records
before or during a selected batch. Normal closure reconciliation behavior is
unchanged.

Evidence

  • Exact changed-surface proof passed: 9 tests, 9 passed, 0 failed.
  • The exact-base Codex review against
    0588bda948653c59a60b65c01d9ff3ce1f780df4 found no regressions.
  • Targeted formatting and git diff --check passed.
  • Production TypeScript delta: 0 lines. The workflow/helper production diff is
    net negative.
  • The prior ClawSweeper P2 is resolved: the release-owned CHANGELOG.md edit
    was removed while rebasing onto the exact main SHA above.

Real Behavior Proof

Claim

Every comment-only apply run skips redundant broad preselection
reconciliation. After selection, a non-empty comment-only batch reconciles only
the selected items, while explicit close runs remain broad and an empty
selection remains unscoped.

Exercised surface

The proof executes the real Bash workflow helper, parses the checked-in GitHub
Actions workflow, and runs the compiled reconciliation CLI against filesystem
records and a controlled GitHub CLI fixture.

Scenario or fixture

  • Selected manual comment sync: item 119890,
    sync_comments_only=true, sync_open_pr_batch=false.
  • Explicit close: item 119890, sync_comments_only=false.
  • Empty comment-only selector.
  • Scoped reconciliation: item 2 closes while open item 1 and an unrelated
    closed-item plan remain unchanged.

Command and environment

node --test --test-concurrency=1 \
  --test-name-pattern='comment-only apply|apply workflow scopes cursor|sweep workflow coalesces durable issue and PR comment sync batches|scoped reconciliation|reconcile reports every changed record tuple' \
  test/sweep-workflow.test.ts test/reconcile.test.ts

Executed on macOS with Node 26.5.0 from head
69edd98eb250a406d223c211371dc2c822581281, based on
0588bda948653c59a60b65c01d9ff3ce1f780df4.

Observed result

  • Selected comment sync produced:
    --item-numbers 119890 --only-item-numbers.
  • Explicit close produced: --item-numbers 119890 without
    --only-item-numbers.
  • Empty selection produced only the base reconciliation arguments.
  • Scoped reconciliation reported pagesScanned=0, changed only item 2, and
    preserved unrelated records and sidecars.
  • The apply preselection step uses the same comment-only skip expression as the
    read-only proof reconciliation step.

Artifact or trace

The executable assertions are in test/sweep-workflow.test.ts and
test/reconcile.test.ts; reviewed head is
69edd98eb250a406d223c211371dc2c822581281.

Limits

  • No live workflow, apply, comment, or recovery dispatch was performed.
  • The referenced public item was not mutated.
  • The complete local workflow test file hit a pre-existing Homebrew Bash
    heredoc deadlock in an unrelated publication-batching test. The exact changed
    surface passed, and fresh Linux CI remains the full gate for this head.
  • No npm publishing or release action was performed.

@vincentkoc vincentkoc self-assigned this Aug 6, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 7:42 AM ET / 11:42 UTC.

ClawSweeper review

What this changes

The PR skips broad reconciliation before comment-only apply selection and scopes the later reconciliation to the selected item numbers.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for maintainer handling: the author is a repository member, so this PR is non-closeable under repository policy. The current head resolves the prior release-owned changelog finding and source review found no new actionable defect.

Priority: P2
Reviewed head: 69edd98eb250a406d223c211371dc2c822581281

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, source-consistent workflow fix with concrete after-fix behavior evidence and no actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body records an after-fix run of the real Bash helper and compiled reconciliation CLI over selected, explicit-close, empty-selector, and scoped-record scenarios.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body records an after-fix run of the real Bash helper and compiled reconciliation CLI over selected, explicit-close, empty-selector, and scoped-record scenarios.
Evidence reviewed 6 items Shared skip gate: The apply preselection step now uses the identical comment-only skip condition as the read-only proof reconciliation step, covering scheduled, manual comment-only, and cursor selections.
Scoped execution reconciliation: Once a comment-only selection is non-empty, the helper adds --only-item-numbers; ordinary explicit-close selections retain their prior unscoped reconciliation behavior.
Focused regression coverage: The added tests compare the two workflow gates and exercise selected comment-only, explicit-close, and empty-selection helper arguments.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s apply workflow reconciles durable review records before it syncs comments or closes eligible items. This patch changes the handoff from apply-trigger selection to reconciliation so comment-only batches do not touch unrelated records.

flowchart LR
  A[Apply trigger] --> B[Comment-only detection]
  B --> C[Bounded item selection]
  C --> D[Reconciliation arguments]
  D --> E[Durable record reconciliation]
  E --> F[Comment synchronization]
Loading

Before merge

  • Resolve merge risk (P1) - This changes apply-workflow reconciliation sequencing; the supplied real-behavior proof is intentionally fixture-based rather than a live mutating apply run, so current-head workflow checks should complete before merge.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change footprint workflow/helper +2, -13; tests +46, -8 The implementation is narrowly contained and the added coverage exceeds the production workflow change.

Merge-risk options

Maintainer options:

  1. Confirm the current-head workflow checks (recommended)
    Keep the narrow reconciliation change and merge after the current head’s workflow validation completes successfully.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Wait for the current-head workflow checks to succeed while retaining the focused reconciliation proof.

Technical review

Best possible solution:

Retain the shared skip gate and selected-item reconciliation boundary, then land only after current-head workflow validation confirms the same behavior in Actions.

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

Yes—source and focused tests provide a high-confidence path: execute the real helper for comment-only, explicit-close, and empty selections, then run scoped reconciliation against fixture records.

Is this the best way to solve the issue?

Yes—the patch reuses the existing proof skip gate and scopes only comment-only batches, preserving explicit-close and empty-selector behavior without adding configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0588bda94865.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an after-fix run of the real Bash helper and compiled reconciliation CLI over selected, explicit-close, empty-selector, and scoped-record scenarios.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The patch affects bounded durable-record reconciliation in the apply workflow, with limited but meaningful operational blast radius.
  • merge-risk: 🚨 automation: The diff changes GitHub Actions step gating and reconciliation arguments during apply runs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an after-fix run of the real Bash helper and compiled reconciliation CLI over selected, explicit-close, empty-selector, and scoped-record scenarios.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix run of the real Bash helper and compiled reconciliation CLI over selected, explicit-close, empty-selector, and scoped-record scenarios.

Evidence

What I checked:

  • Shared skip gate: The apply preselection step now uses the identical comment-only skip condition as the read-only proof reconciliation step, covering scheduled, manual comment-only, and cursor selections. (.github/workflows/sweep.yml:5803, 69edd98eb250)
  • Scoped execution reconciliation: Once a comment-only selection is non-empty, the helper adds --only-item-numbers; ordinary explicit-close selections retain their prior unscoped reconciliation behavior. (scripts/apply-workflow-helpers.sh:605, 69edd98eb250)
  • Focused regression coverage: The added tests compare the two workflow gates and exercise selected comment-only, explicit-close, and empty-selection helper arguments. (test/sweep-workflow.test.ts:2080, 69edd98eb250)
  • Existing scoped reconciliation contract: Current reconciliation tests show --only-item-numbers scans no pages and preserves records and sidecars outside the selected batch. (test/reconcile.test.ts:10, 0588bda94865)
  • Feature provenance: The durable comment-sync area appears to date to the merged change titled “fix: stop durable comment sync from starving automatic closures.”. (scripts/apply-workflow-helpers.sh:47, 353948c0849c)
  • Diff hygiene: The exact-base diff is limited to one workflow gate, one helper condition, and focused tests; git diff --check produced no errors. (.github/workflows/sweep.yml:5803, 69edd98eb250)

Likely related people:

  • Peter Steinberger: History attributes the durable comment-sync behavior to the merged feature commit and shows extensive ownership of the workflow/helper surfaces. (role: feature introducer and recent area contributor; confidence: high; commits: 353948c0849c, 480d56953f38; files: .github/workflows/sweep.yml, scripts/apply-workflow-helpers.sh)
  • Vincent Koc: History shows prior queue/apply work on the workflow surface, and the current PR provides the focused reconciliation correction. (role: recent adjacent contributor; confidence: medium; commits: 2a61adcc1f06, 69edd98eb250; files: .github/workflows/sweep.yml, scripts/apply-workflow-helpers.sh, test/sweep-workflow.test.ts)

Rank-up moves

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

  • Let the current-head Actions checks finish before changing draft or merge state.

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 (1 earlier review cycle)
  • reviewed 2026-08-06T10:55:21.664Z sha 454e680 :: needs changes before merge. :: [P2] Remove the release-owned changelog edit

@vincentkoc
vincentkoc force-pushed the fix/scope-comment-only-reconciliation branch from 454e680 to 69edd98 Compare August 6, 2026 11:38
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 6, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 6, 2026 11:46
@vincentkoc
vincentkoc requested a review from a team as a code owner August 6, 2026 11:46
@vincentkoc
vincentkoc merged commit daf339e into main Aug 6, 2026
20 of 21 checks passed
@vincentkoc
vincentkoc deleted the fix/scope-comment-only-reconciliation branch August 6, 2026 11:47
ostehost pushed a commit to ostehost/clawsweeper that referenced this pull request Aug 7, 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. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant