Skip to content

fix(claws): compare cron definitions without response metadata - #139018

Merged
steipete merged 1 commit into
mainfrom
codex/sqlite-goal-claw-read-view
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/sqlite-goal-claw-read-view

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Claw updates, removal, and completed-install reconciliation can reject unchanged scheduled jobs as “changed after planning.” The real Gateway response includes a revision token and flattened run/delivery status, while the comparison incorrectly hashes those response fields as part of the stored definition.

Why This Change Was Made

Move the unchanged read-view producer into the cron owner and co-locate the projection that removes exactly its declared response metadata. The shared Claw matcher uses that projection once. Arbitrary definition fields remain hash-significant; stored revisions, codecs, private-field redaction, API output, CAS, and lifecycle ordering stay unchanged. Existing consumer fixtures now use the actual producer.

User Impact

An unchanged scheduled job can be reconciled and updated using the normal Claw flow. Actual operator edits still stop Claw mutation. The separate system-monitor removal policy is unchanged.

Evidence

  • Before the fix, realistic Gateway fixtures caused seven existing update/removal failures and one completed-install reconciliation failure.
  • Focused consumer/revision/privacy tests: 58 passed; corrected closed-enum fixture: 13 passed. Gateway validation and CAS: 248 passed.
  • Native SQLite proof: rich views fail before/pass after; eight definition drifts rejected; unknown fields preserved; private creator removed; exact rows and revisions retained after physical close/reopen.
  • Final full changed gate: exit 0. One qaRuntime build: 48.7 seconds. Actual CLI add/consented update/status/offline reopen/Gateway restart passed; an ordinary operator edit was refused by the next Claw mutation and exact job/provenance rows were preserved. All owned processes joined; synthetic state removed.
  • Independent Codex review completed five passes with no P0–P2 findings. The native and live controllers retained source hashes, and the Gateway producer moved unchanged.

Production +25 lines (including the moved producer; inverse boundary is the justified growth); tests +32 lines. No schema/config/protocol changes. Failed attempts are retained in the local evidence pack.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 6:43 AM ET / 10:43 UTC.

ClawSweeper review

What this changes

The PR separates scheduled-job definitions from Gateway response metadata so unchanged Claw jobs can reconcile, update, and remove successfully.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still contains the false-drift comparison, and this focused repair has no blocking findings.

Priority: P2
Reviewed head: 016929f51befb321375fe0f636b7cef9c7eb7a69

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with meaningful regression coverage and no blocking correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this PR from the external-contributor proof gate, and no material authority change triggers an exception. The body reports CLI and SQLite exercises of the repaired matcher, but their local evidence pack was not independently inspected.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this PR from the external-contributor proof gate, and no material authority change triggers an exception. The body reports CLI and SQLite exercises of the repaired matcher, but their local evidence pack was not independently inspected.
Evidence reviewed 10 items Verified introduced scope: The pinned introduction and verified test-merge result contain the same six paths. The test merge has the pinned base followed by the exact PR head as its recorded parents; unrelated base changes are excluded from this review.
Current-main defect remains: Current main passes the complete Gateway response into definition hashing. Its configRevision and flattened status fields survive the storage projection, whereas the expected declaration lacks those fields.
Narrow owner-boundary repair: The inverse removes exactly the 12 metadata fields added by the relocated producer, retaining all remaining definition fields. The producer remains unchanged, including privacy projection and revision generation. This behavior belongs to OpenClaw’s cron implementation and does not depend on a Codex runtime or protocol contract.
Findings None None.
Security None None.

How this fits together

Claws are packaged agent setups that register scheduled jobs with OpenClaw’s Gateway. Their lifecycle checks compare live jobs with recorded declarations to preserve operator edits.

flowchart TD
  A[Recorded Claw declaration] --> E[Compare job definitions]
  B[Gateway scheduled job] --> C[Public response with status]
  C --> D[Remove response metadata]
  D --> E
  E --> F[Continue when unchanged]
  E --> G[Refuse definition drift]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +32. Total +57 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 46 21 +25
Tests 3 67 35 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 113 56 +57

Review metrics

Metric Value Why it matters
Production versus test growth Production net +25 lines; tests net +32 lines Discounting the unchanged producer move, growth implements the explicit inverse boundary without broadening stored revision semantics.

Technical review

Best possible solution:

Keep the explicit response-to-definition projection beside its cron producer, preserving storage hashing, public output, and operator-drift protection.

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

Yes, from source: current-main cron.get/list responses include metadata that the matcher hashes against a metadata-free declaration. No runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes. The explicit inverse fixes all shared consumers; changing the storage codec or global revision algorithm would unnecessarily broaden token semantics, so the small production increase is justified.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 41651036f27f.

Labels

Label changes:

  • add P2: This repairs blocked lifecycle operations in the explicitly enabled experimental Claws workflow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from the external-contributor proof gate, and no material authority change triggers an exception. The body reports CLI and SQLite exercises of the repaired matcher, but their local evidence pack was not independently inspected.

Label justifications:

  • P2: This repairs blocked lifecycle operations in the explicitly enabled experimental Claws workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from the external-contributor proof gate, and no material authority change triggers an exception. The body reports CLI and SQLite exercises of the repaired matcher, but their local evidence pack was not independently inspected.

Evidence

What I checked:

  • Verified introduced scope: The pinned introduction and verified test-merge result contain the same six paths. The test merge has the pinned base followed by the exact PR head as its recorded parents; unrelated base changes are excluded from this review. (e491379bb897)
  • Current-main defect remains: Current main passes the complete Gateway response into definition hashing. Its configRevision and flattened status fields survive the storage projection, whereas the expected declaration lacks those fields. (src/claws/cron.ts:253, 41651036f27f)
  • Narrow owner-boundary repair: The inverse removes exactly the 12 metadata fields added by the relocated producer, retaining all remaining definition fields. The producer remains unchanged, including privacy projection and revision generation. This behavior belongs to OpenClaw’s cron implementation and does not depend on a Codex runtime or protocol contract. (src/cron/job-read-view.ts:26, 016929f51bef)
  • Entry points and sibling consumers: CLI add uses Gateway inventory, while update and removal use cron.get. Completed-install reconciliation, cron-update.ts:123, and lifecycle-state.ts:538 all use the repaired matcher; Gateway add/get/list/update continue using the same public response producer. (src/claws/cron.ts:254, 016929f51bef)
  • Regression and preservation coverage: The new reconciliation case uses the actual response producer, checks input immutability, and rejects malformed jobs. Adjacent cases reject message changes and unknown definition fields. Updated lifecycle fixtures also exercise removal ordering, scheduler defaults, lost responses, and operator-edited schedules. (src/claws/cron.test.ts:194, 016929f51bef)
  • Revision and privacy contracts preserved: The storage-backed revision algorithm is unchanged. Existing tests cover runtime-state independence, SQLite round trips, stale-write rejection, and private creator/runtime-authority redaction; the patch changes neither those contracts nor authorization guards. (src/cron/config-revision.ts:33, 016929f51bef)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Gio Della-Libera: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 49ecde8 into main Sep 5, 2026
183 checks passed
@steipete
steipete deleted the codex/sqlite-goal-claw-read-view branch September 5, 2026 11:01
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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