Skip to content

test(scheduler): preserve ambiguous post-sync activity - #903

Merged
brokemac79 merged 1 commit into
mainfrom
codex/csw-071-bot-sync-reconciliation
Jul 29, 2026
Merged

brokemac79 merged 1 commit into
mainfrom
codex/csw-071-bot-sync-reconciliation

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebase CSW-071 scheduler reconciliation onto current main and lock in the safe ambiguity-preserving rule: activity one through five seconds after a comment or label synchronization remains due for review.

Problem

The original proposal suppressed every updated_at value in a five-second window after ClawSweeper synchronization. That is unsafe when human users and agents share the same GitHub identity: GitHub actor data cannot distinguish the automation write from a genuine nearby update.

Implementation

  • Keep current main runtime behavior; this PR deliberately adds no timestamp grace.
  • Replace the single one-second assertion with coverage for every one-through-five-second post-sync update.
  • Cover both reviewCommentSyncedAt and labelsSyncedAt.
  • Retain the existing at-or-before synchronization boundary coverage.

Validation

Executed from head e570452dbfa5392d38c94234c4519eb7fc5de59b:

pnpm run build:all
node --test test/scheduler-policy.test.ts
pnpm exec oxfmt --check test/scheduler-policy.test.ts
git diff --check
C:\Users\marti\.local\bin\crabbox.exe run --provider local-container --local-container-image mcr.microsoft.com/playwright:v1.60.0-noble --no-hydrate --timing-json --script C:\clawsweeper-work\orchestrator\CSW-071-PR903-crabbox-proof.sh

Build passed. The focused scheduler suite passed 14/14. Formatting and diff checks passed. The Docker-backed Crabbox proof passed with exit 0.

Real Behavior Proof

  • Claim: an ambiguous update at T+1 through T+5 after either recorded synchronization timestamp remains due; it is never silently treated as a bot write.
  • Surface: the actual scheduler-policy selection function imported from the built dist/scheduler-policy.js artifact inside a Docker-backed Crabbox Linux container.
  • Scenario / fixture: one completed current-policy review, each synchronization field, and timestamp offsets T+1 through T+5.
  • Command / environment: Docker Desktop local-container via Crabbox, image mcr.microsoft.com/playwright:v1.60.0-noble, lease cbx_ccbe68bdce7a; the ephemeral proof script installed dependencies with Corepack, ran pnpm run build:all, then invoked the built module directly. No GitHub credential, queue, state, workflow, or live-fixture mutation.
  • Observed result: all ten post-sync cases printed CSW071_SAFE_AMBIGUOUS_DUE; CSW071_CRABBOX_PROOF_PASS cases=10; exit 0.
  • Artifact / trace: provider local-container, lease cbx_ccbe68bdce7a, synced worktree e570452dbfa5392d38c94234c4519eb7fc5de59b, build 3.516s, policy proof 26ms, total 20.549s.
  • Limits: this is a deterministic scheduler contract proof in Linux Docker, not a live GitHub event run. It intentionally accepts an unnecessary re-review for delayed GitHub synchronization and does not claim to identify a bot account or label mutation.

Redacted terminal transcript from the successful built-artifact run:

CRABBOX_PHASE:build
CRABBOX_PHASE:policy-proof
CSW071_SAFE_AMBIGUOUS_DUE field=reviewCommentSyncedAt lag_seconds=1
CSW071_SAFE_AMBIGUOUS_DUE field=reviewCommentSyncedAt lag_seconds=2
CSW071_SAFE_AMBIGUOUS_DUE field=reviewCommentSyncedAt lag_seconds=3
CSW071_SAFE_AMBIGUOUS_DUE field=reviewCommentSyncedAt lag_seconds=4
CSW071_SAFE_AMBIGUOUS_DUE field=reviewCommentSyncedAt lag_seconds=5
CSW071_SAFE_AMBIGUOUS_DUE field=labelsSyncedAt lag_seconds=1
CSW071_SAFE_AMBIGUOUS_DUE field=labelsSyncedAt lag_seconds=2
CSW071_SAFE_AMBIGUOUS_DUE field=labelsSyncedAt lag_seconds=3
CSW071_SAFE_AMBIGUOUS_DUE field=labelsSyncedAt lag_seconds=4
CSW071_SAFE_AMBIGUOUS_DUE field=labelsSyncedAt lag_seconds=5
CSW071_CRABBOX_PROOF_PASS cases=10
run summary provider=local-container lease=cbx_ccbe68bdce7a exit=0

The one-shot Docker lease stopped automatically after this read-only proof; no public log URL exists.

Codex review closeout

  • codex review --uncommitted — clean; no accepted/actionable findings.
  • git fetch origin main --prune && codex review --base origin/main — clean; no accepted/actionable findings.

Scope and future work

This PR is a focused scheduler regression guard. It does not add durable operation provenance, alter canonical record schema/transport, or modify publication/lifecycle behavior. A future attempt to suppress delayed self-updates must be based on a durable exact-operation receipt and coordinated through the maintainer-owned lifecycle work in #898.

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 12:23 PM ET / 16:23 UTC.

ClawSweeper review

What this changes

The PR replaces narrow scheduler-policy assertions with coverage that keeps updates one through five seconds after either recorded synchronization timestamp due for review.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal maintainer merge review. The visible branch is a focused scheduler-policy regression guard, the supplied built-artifact terminal transcript directly exercises all ten post-sync cases, and no discrete correctness or security defect is evident in the provided patch context.

Priority: P3
Reviewed head: e570452dbfa5392d38c94234c4519eb7fc5de59b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, proof-backed regression-test PR with no supported blocking finding in the supplied diff context.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.
Evidence reviewed 3 items Focused policy-test change: The PR changes only the scheduler-policy test and replaces the prior grace-window expectation with assertions that post-sync activity remains reviewable for both recorded synchronization fields.
Built-artifact behavior proof: The PR body includes a redacted Crabbox terminal transcript from the built scheduler policy showing all ten field-and-offset cases as due, ending with CSW071_CRABBOX_PROOF_PASS cases=10 and exit 0.
Related lifecycle work remains separate: The PR explicitly leaves delayed self-update suppression to the broader durable-operation-receipt work tracked by #898; this branch preserves the existing conservative behavior rather than creating a parallel runtime policy.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s scheduler compares GitHub item activity with durable review metadata to decide whether an item should be reviewed again. Its decision feeds the sweep workflow, so conservative handling prevents a potentially human-authored update from being hidden as synchronization churn.

flowchart LR
  A[GitHub item update] --> C[Scheduler policy]
  B[Review record sync times] --> C
  C --> D[Due for review decision]
  D --> E[Sweep workflow]
  E --> F[Updated review result]
Loading

Before merge

  • Complete next step (P2) - No repair-lane task is indicated: the visible patch has no concrete mechanical defect, and the remaining action is normal maintainer merge review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Test surface 1 file changed; 31 additions, 49 deletions The branch is confined to scheduler-policy regression coverage and does not alter production runtime code.
Ambiguity cases 10 built-artifact cases The supplied proof covers five offsets for each of the two persisted synchronization timestamps.

Technical review

Best possible solution:

Keep the existing no-grace scheduler behavior and land this narrow regression coverage, while reserving any future delayed-self-update suppression for a durable exact-operation receipt through #898.

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

Not applicable as a standalone issue reproduction: this PR adds regression coverage for an existing scheduler policy. Its supplied terminal proof directly invokes the built policy for the ten intended timestamp cases.

Is this the best way to solve the issue?

Yes. Preserving the current conservative behavior and testing both synchronization timestamps is the narrow maintainable solution; attempting to suppress ambiguous delayed updates would require the durable provenance work tracked in #898.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1889fd334cb8.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a focused regression-test improvement that preserves existing conservative scheduler behavior without an active user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a redacted terminal transcript from a Docker-backed Crabbox run against the built scheduler-policy artifact, showing the ten changed cases and a successful exit; no private runtime data is exposed.

Evidence

What I checked:

  • Focused policy-test change: The PR changes only the scheduler-policy test and replaces the prior grace-window expectation with assertions that post-sync activity remains reviewable for both recorded synchronization fields. (test/scheduler-policy.test.ts:150, e570452dbfa5)
  • Built-artifact behavior proof: The PR body includes a redacted Crabbox terminal transcript from the built scheduler policy showing all ten field-and-offset cases as due, ending with CSW071_CRABBOX_PROOF_PASS cases=10 and exit 0. (e570452dbfa5)
  • Related lifecycle work remains separate: The PR explicitly leaves delayed self-update suppression to the broader durable-operation-receipt work tracked by Track exact-review publication, lifecycle telemetry, and OpenClaw Bay correctness #898; this branch preserves the existing conservative behavior rather than creating a parallel runtime policy. (e570452dbfa5)

Likely related people:

  • brokemac79: The available review context identifies this contributor as author of the current scheduler-policy commit and the adjacent lifecycle proposal; broader local history could not be inspected in this read-only environment. (role: recent scheduler-policy contributor; confidence: low; commits: e570452dbfa5; files: test/scheduler-policy.test.ts)

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-07-27T20:40:04.576Z sha f667ed8 :: needs real behavior proof before merge. :: [P2] Preserve human updates inside the grace window
  • reviewed 2026-07-29T15:48:14.252Z sha e570452 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T16:02:24.357Z sha e570452 :: needs real behavior proof before merge. :: none

@brokemac79 brokemac79 closed this Jul 29, 2026
@brokemac79
brokemac79 force-pushed the codex/csw-071-bot-sync-reconciliation branch from f667ed8 to 1889fd3 Compare July 29, 2026 15:29
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper could not start a re-review for this item.

Reason: re-review requires an open issue or PR.

@brokemac79 brokemac79 reopened this Jul 29, 2026
@brokemac79 brokemac79 changed the title fix(scheduler): absorb bot sync timestamp lag test(scheduler): preserve ambiguous post-sync activity Jul 29, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 29, 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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 Jul 29, 2026
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

1 similar comment
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added 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. and removed 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. labels Jul 29, 2026
@brokemac79
brokemac79 merged commit c7b0831 into main Jul 29, 2026
36 checks passed
@brokemac79
brokemac79 deleted the codex/csw-071-bot-sync-reconciliation branch July 29, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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