Skip to content

refactor(ui): reuse JSON validation for cron event arguments - #177473

Merged
steipete merged 1 commit into
mainfrom
solid2/w-deslop-app-lib
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-deslop-app-lib

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cron event-argument validation duplicated the shared JSON parser's invalid-input handling.

User Impact

No user-visible change. JSON objects remain valid; malformed JSON, arrays, null, and primitive values retain the existing field error.

Why This Change Was Made

Use the existing safeParseJsonRecord owner through its focused package subpath. This removes a local parse/catch branch without changing the cron editor, mutation lifecycle, lazy boundaries, or rendering. The schedule comparator keeps its catch because it also contains deep value comparison.

Evidence

Check Result
pnpm tsgo:ui Pass
pnpm test ui/src/pages/cron/event-source.test.ts --maxWorkers=1 6 tests pass; existing Solid untracked-read warnings in editor rendering
Targeted oxlint and git diff --check Pass
pnpm deadcode:knip (production) Pass
Independent Codex review (P0–P2), including helper/export contract Pass; no actionable findings

Touched production LOC: 645 → 642 (−3). Tests: unchanged. Solid refactor checklist: controllers, effects, render effects, untrack, listeners, DOM queries, class-string composition, flush, and owner escapes all 0 → 0 in the touched module. This is a plain TypeScript refactor; no screenshot or local UI rebuild is needed under the lane's compute budget. No dependency or boot import boundary changes.

CI run 39284651423 reports an inherited mock-export ratchet failure: src/infra/openclaw-process-census.missing-command.test.ts:12: ./container-environment.js. The exact diagnostic reproduces against the complete base tree 8b78b230a1c109fe6456964e59cb0eeefe63b7e5 using an isolated Git index and pnpm check:test-mock-exports --staged --base 8b78b230a1c109fe6456964e59cb0eeefe63b7e5 --no-merge-base. CI tested merge 831cac23d6c412a357e062f41a17adfc55d610a3 has that base and this PR head as its ordered parents. The changed-file line cap and all other reported ratchet subchecks passed. The native inherited-failure route will verify complete CI/security state before landing; this does not relabel the failed check as green.

@clawsweeper

clawsweeper Bot commented Oct 19, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T16:28:14.661013Z 5bad510 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces local cron event-argument parsing and exception handling with the shared safeParseJsonRecord helper.

Example: Enter event arguments in the Automation editor.

  • Before: {"project":"website"} is accepted; [] receives the invalid-arguments field error.
  • After: The same inputs produce the same results through the shared parser.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is source-equivalent and has reported supporting checks; supplied validation remains test-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary proof gate; supplied evidence covers tests and static checks, while source inspection confirms the unchanged parser contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction removes duplicate parsing with negligible scope and preserves existing behavior.

Merge readiness

✅ Ready for maintainer review

This PR makes a focused, behavior-preserving simplification using the existing JSON parser; no actionable correctness or security defect was found.

Priority: P3
Reviewed head: 5bad5104c6c2c3850ef35faecddaeaa8b8405289

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence reports existing tests and static checks, without a shipped-browser run; this maintainer-authored refactor is outside the ordinary contributor proof gate.
Agent review details

How this fits together

The Control UI validates Automation form values before building a schedule and sending a Gateway mutation; this change affects only JSON-object validation.

flowchart LR
  A[Automation editor] --> B[Cron form validation]
  B --> C[Shared JSON record parser]
  C --> D[Field errors]
  B --> E[Schedule builder]
  E --> F[Gateway mutation]
Loading

Technical review

Best possible solution:

Reuse the existing JSON-record parser while preserving the Automation form’s validation contract.

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

This is a refactor without a reported behavioral bug; source inspection establishes equivalent validation, and no target code was executed.

Is this the best way to solve the issue?

The change is the smallest complete simplification: it removes duplicated parsing mechanics without adding state, wrappers, or alternate policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Cron event-argument validation keeps the original intent (e210870: MCP event authoring requires object arguments and rejects invalid JSON before saving.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 140b2ab adds ui/src/lib/cron/index.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 140b2abccc97; files: ui/src/lib/cron/index.ts)

PR surface

Source -3. Total -3 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 5 -3
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 5 -3

Labels

Label changes:

  • add P3: This is a small internal cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a small internal cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 12:34 PM ET / 16:34 UTC.

@steipete
steipete merged commit 4ba34fd into main Oct 19, 2026
94 of 97 checks passed
@steipete
steipete deleted the solid2/w-deslop-app-lib branch October 19, 2026 16:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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

Labels

app: web-ui App: web-ui P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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