Skip to content

refactor(cron): share paired payload field normalization - #146971

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/cron-payload-field-normalization-20260913
Sep 13, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/cron-payload-field-normalization-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Cron payload normalization repeats four pairs of identical field policies.

User Impact

No changes to accepted values, clear signals, payload-kind inference or stored payload shape.

Why This Change Was Made

Use four fixed-key loops while retaining field order, the own-property snapshot, separate timeout policies and kind-specific pruning. Production changes: −33 lines; tests: +86 lines.

Evidence

  • Actual normalization code matched 12,354 before/after payload cases, including inherited fields and error forwarding, plus all 14 public patch table rows. This uses recording schema-result seams; it does not claim execution of the pinned Zod dependency.
  • Public patch tests cover omitted, null, undefined, malformed, blank, numeric and fractional inputs, along with inference after normalization.
  • At exact current head 100e0b0cd5e89c6bf0d56f9ce1a8cf10e9d5db77, normal hosted CI attempt 1 and aggregate gate passed. The actual cron test job executed all 79 normalization cases; its complete descriptor passed 835 tests across 57 files. Selected lint, formatting and type checks passed.
  • Root and independent source reviews and final P2 autoreview are clean. The latest exact-head ClawSweeper review has no findings or before-merge requests.
  • Local comparison proof and hosted suite execution have distinct boundaries; no live scheduler, gateway or migration exercise is claimed. The accepted input and persisted payload contracts are unchanged.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 11:19
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 10:57 AM ET / 14:57 UTC (Revision 3).

ClawSweeper review

What this changes

Consolidates four pairs of scheduled-job payload normalization rules into shared loops and adds tests for partial updates without changing accepted values or clear signals.

Merge readiness

✅ Ready for maintainer review

No actionable defects found. This remains a focused, behavior-preserving cleanup absent from current main; the member-authored, protected PR is not eligible for automatic closure.

Priority: P3
Reviewed head: 100e0b0cd5e89c6bf0d56f9ce1a8cf10e9d5db77

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable refactor with useful boundary coverage, successful hosted validation, and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored internal refactor is exempt from external-contributor live proof, and no material authority change triggers additional proof. Public patch tests and successful exact-head hosted validation support normalization parity; live scheduler behavior is not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored internal refactor is exempt from external-contributor live proof, and no material authority change triggers additional proof. Public patch tests and successful exact-head hosted validation support normalization parity; live scheduler behavior is not claimed.
Evidence reviewed 7 items Introduced production change: The verified merge-base-to-head diff replaces repeated branches with fixed-key loops while preserving processing order, parser calls, explicit nulls, deletion behavior, and numeric flooring. Timeout handling and kind-specific pruning remain unchanged.
Production boundary and test value: normalizeCronJobInput calls the payload owner for both create and patch requests; Gateway cron.add and cron.update normalize before protocol validation. The added 14-row table exercises the public patch normalizer, including omitted fields, explicit clears, malformed inputs, fractional limits, and inference after normalization, without adding a production test seam.
Current-main necessity: The fetched main revision still contains the separate normalization branches; comparison against the pinned merge base showed no changes to this production file. The consolidation remains distinct work.
Findings None None.
Security None None.

How this fits together

Cron payload normalization prepares scheduled-job create and update requests before validation and storage. It trims text, normalizes overrides and limits, and removes fields inappropriate for the selected payload kind.

flowchart LR
 A[Create or update request] --> B[Copy own payload fields]
 B --> C[Normalize paired fields]
 C --> D[Infer kind and prune fields]
 D --> E[Validate request]
 E --> F[Store scheduled job]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -33, Tests +86. Total +53 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 31 64 -33
Tests 1 86 0 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 117 64 +53

Review metrics

None.

Technical review

Best possible solution:

Keep the shared field policies in the existing payload normalizer while preserving its own-field boundary and create-versus-patch semantics.

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

Not applicable: this PR claims a behavior-preserving refactor, not a bug fix; source comparison supports equivalence, and no local execution was performed.

Is this the best way to solve the issue?

Yes. Fixed-key loops remove repeated policies at their existing owner without introducing another abstraction or changing the normalization contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fe3b2891fdea.

Labels

Label justifications:

  • P3: This is internal maintenance with unchanged user-facing behavior and no identified regression.
  • 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: This member-authored internal refactor is exempt from external-contributor live proof, and no material authority change triggers additional proof. Public patch tests and successful exact-head hosted validation support normalization parity; live scheduler behavior is not claimed.

Evidence

What I checked:

  • Introduced production change: The verified merge-base-to-head diff replaces repeated branches with fixed-key loops while preserving processing order, parser calls, explicit nulls, deletion behavior, and numeric flooring. Timeout handling and kind-specific pruning remain unchanged. (src/cron/normalize-payload.ts:83, 100e0b0cd5e8)
  • Production boundary and test value: normalizeCronJobInput calls the payload owner for both create and patch requests; Gateway cron.add and cron.update normalize before protocol validation. The added 14-row table exercises the public patch normalizer, including omitted fields, explicit clears, malformed inputs, fractional limits, and inference after normalization, without adding a production test seam. (src/cron/normalize.test.ts:524, 100e0b0cd5e8)
  • Current-main necessity: The fetched main revision still contains the separate normalization branches; comparison against the pinned merge base showed no changes to this production file. The consolidation remains distinct work. (src/cron/normalize-payload.ts:83, fe3b2891fdea)
  • Latest-release comparison: The supplied latest release, v2026.9.4, also contains separate branches rather than the proposed loops. No implementation-based closure is established. (src/cron/normalize-payload.ts:83, 3a9d69db306c)
  • Preserved prior normalization repair: GitHub commit metadata identifies bladin and shows the own-field snapshot change associated with merged fix(cron): ignore inherited normalization fields #111728. This PR retains that snapshot. Local raw commit inspection confirmed a recorded parent; broader blame inspection encountered unavailable historical objects, so no additional introduction claim is made. (src/cron/normalize-payload.ts:70, 7bd0903f7a23)
  • Exact-head hosted validation: GitHub reports run 34754768969 attempt 1 and cron shard job 103717263151 successful at the reviewed head, including the Run Node test shard step. The captured PR body reports 79 normalization cases and 835 tests across 57 files; direct log retrieval was blocked by the artifact-host allowlist, so those detailed counts remain contributor-reported. (100e0b0cd5e8)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-13T11:28:11.934Z sha d5a959b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T11:38:26.606Z sha 100e0b0 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 100e0b0cd5e89c6bf0d56f9ce1a8cf10e9d5db77. The follow-up only changes the test fixture from NaN to equivalent Number.NaN to satisfy the diagnosed lint rule. Production is unchanged; the PR records all 79 tests passing at the prior head and pending current-head CI.

@clawsweeper

clawsweeper Bot commented Sep 13, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@vincentkoc
vincentkoc merged commit 90f67e1 into main Sep 13, 2026
189 of 191 checks passed
@vincentkoc
vincentkoc deleted the refactor/cron-payload-field-normalization-20260913 branch September 13, 2026 15:17
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…6971)

* refactor(cron): share paired payload field normalization

* test(cron): use the canonical NaN property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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