Skip to content

refactor(config): derive tool contracts from schemas - #155484

Merged
RomneyDa merged 1 commit into
mainfrom
refactor/b22-tools-contracts
Sep 22, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
refactor/b22-tools-contracts

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • derive media-understanding scope from the schema input contract
  • derive normalized web configuration from the parsed tools schema output
  • document and compile-prove the partial web authoring contract
  • remove manual type mirrors and their unused imports

Production delta: −52 LOC

Validation

  • 123 focused config tests passed
  • pnpm check:changed passed
  • exact-head P0–P2 autoreview clean
  • live open-PR collision scan clean
  • new compile-time contract test: 1 test in 973 ms Vitest duration; 2.57 s wall time with --maxWorkers=1
  • hosted CI does not expose per-file timing for this test

Compatibility

No runtime schema, default, persisted value, or validation behavior changes. The derived types preserve existing partial web authoring inputs and parsed media-scope output, so no config migration or upgrade action is required.

@clawsweeper

clawsweeper Bot commented Sep 22, 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 size: S maintainer Maintainer-authored PR labels Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 8f4d0abc0ebf58ff48bc683546431af82be78e7b
  • Maintainer: @RomneyDa
  • Repository role: maintain

These security sensitive changes were made:

  • src/config/types.tools.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 22, 2026, 3:05 AM ET / 07:05 UTC (Revision 4).

ClawSweeper review

What this changes

Derive media-scope and web-tool configuration types from existing validation schemas and add compile-time coverage for partial web configuration.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open as a useful maintainer-authored cleanup. No blocking patch defect was found, and the prior test-timing follow-up is resolved.

Priority: P3
Reviewed head: 8f4d0abc0ebf58ff48bc683546431af82be78e7b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused schema-ownership cleanup with useful compile-time coverage and the prior evidence follow-up completed.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored change affects configuration type inference only; the contract fixture and reported focused checks are appropriate supplemental validation. No runtime authority or stored-data contract changes require live or migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored change affects configuration type inference only; the contract fixture and reported focused checks are appropriate supplemental validation. No runtime authority or stored-data contract changes require live or migration proof.
Evidence reviewed 7 items Pinned introduced change: The introduced delta changes type declarations and type-only imports, plus one contract test; runtime parsing, defaults, persistence, and execution remain unchanged.
Web authoring compatibility: The search preprocessor obscures input inference, while its output retains optional search fields and extension-owned entries. Fetch fields remain optional. The new satisfies expression covers empty web/search objects, unnormalized domain strings, and fetch headers. These are OpenClaw configuration contracts; the test does not invoke or assert compatibility with the Codex runtime.
Scope contract and consumers: The existing shared schema defines optional defaults and ordered rules with required allow/deny actions. The media evaluator remains unchanged. Searches found no consumers of the removed match/rule aliases, and the SDK explicitly exports different, unaffected tool-policy types.
Findings None None.
Security None None.

How this fits together

OpenClaw’s configuration schemas validate operator settings used by media processing and web tools. These TypeScript contracts let callers author and consume those settings without maintaining separate copies of their shapes.

flowchart LR
  A[Operator settings] --> B[Configuration schemas]
  B --> C[Validated configuration]
  B --> D[Derived TypeScript contracts]
  E[Configuration authors] --> D
  C --> F[Media and web tools]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

Source -52, Tests +15. Total -37 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 57 -52
Tests 1 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 57 -37

Review metrics

Metric Value Why it matters
Contract-test cost 973 ms Vitest duration; 2.57 s wall time The reported measurement resolves the previous timing follow-up and stays below the documented per-file test-time target.

Technical review

Best possible solution:

Keep configuration shapes owned by the canonical schemas while preserving optional authoring inputs and existing runtime validation.

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

Not applicable: this PR removes manual type mirrors rather than fixing a reported runtime failure; source inspection found no introduced defect.

Is this the best way to solve the issue?

Yes. Deriving contracts from existing schemas removes competing declarations, and the compile-time fixture protects partial web authoring without changing the parser.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded type-maintenance cleanup with no runtime behavior change.
  • 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 maintainer-authored change affects configuration type inference only; the contract fixture and reported focused checks are appropriate supplemental validation. No runtime authority or stored-data contract changes require live or migration proof.

Evidence

What I checked:

  • Pinned introduced change: The introduced delta changes type declarations and type-only imports, plus one contract test; runtime parsing, defaults, persistence, and execution remain unchanged. (src/config/types.tools.ts:12, 8f4d0abc0ebf)
  • Web authoring compatibility: The search preprocessor obscures input inference, while its output retains optional search fields and extension-owned entries. Fetch fields remain optional. The new satisfies expression covers empty web/search objects, unnormalized domain strings, and fetch headers. These are OpenClaw configuration contracts; the test does not invoke or assert compatibility with the Codex runtime. (src/config/zod-schema.agent-runtime.ts:192, 8f4d0abc0ebf)
  • Scope contract and consumers: The existing shared schema defines optional defaults and ordered rules with required allow/deny actions. The media evaluator remains unchanged. Searches found no consumers of the removed match/rule aliases, and the SDK explicitly exports different, unaffected tool-policy types. (src/config/zod-schema.allowdeny.ts:10, 8f4d0abc0ebf)
  • Current-main necessity: Fetched main still contains the manual media-scope and web-search declarations replaced by this branch, so this cleanup is not already implemented there. (src/config/types.tools.ts:20, b75538b72121)
  • Prior follow-up completed: The captured PR body reports 973 ms Vitest duration and 2.57 s wall time for the new test with --maxWorkers=1, and explicitly states that hosted CI exposes no per-file timing. This addresses the previous completed review’s sole rank-up move. The body also reports 123 focused tests and check:changed passing; these were not rerun during this read-only review. (src/config/types.tools-schema-inference.test.ts:5, 8f4d0abc0ebf)
  • Area history and routing: Current-main path history records Peter Steinberger’s canonical-schema authoring refactor and Dallin Romney’s related memory-search schema refactor. GitHub maps the latter commit to RomneyDa. Deeper pickaxe/blame inspection encountered unavailable historical objects, so no source-line introduction attribution is asserted. (src/config/zod-schema.agent-runtime.ts, 9530f19b0c80)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: 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 (3 earlier review cycles)
  • reviewed 2026-09-22T05:40:11.731Z sha 20b7e10 :: blocked before merge. :: none
  • reviewed 2026-09-22T06:49:30.246Z sha 16ab9f31c04f34dcad69d88f7b82c5e464a754bd :: blocked before merge. :: none
  • reviewed 2026-09-22T06:57:57.022Z sha 8f4d0ab :: blocked before merge. :: none

@RomneyDa
RomneyDa force-pushed the refactor/b22-tools-contracts branch from 20b7e10 to 16ab9f3 Compare September 22, 2026 06:35
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

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

Re-review progress:

@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 22, 2026
@RomneyDa
RomneyDa force-pushed the refactor/b22-tools-contracts branch from 16ab9f3 to 8f4d0ab Compare September 22, 2026 06:51
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

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

Re-review progress:

@RomneyDa
RomneyDa merged commit 1b2c512 into main Sep 22, 2026
327 of 329 checks passed
@RomneyDa
RomneyDa deleted the refactor/b22-tools-contracts branch September 22, 2026 16:22
vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit 'f3327bde3c6052a4ed6d487bb09fbe1e11c0cd35': (25 commits)
  fix(test): pass the fixture lifetime to launcher fixtures (#155825)
  fix(test): prepare history benchmark before child deadlines (#155780)
  refactor(config): derive tool contracts from schemas (#155484)
  chore(deps): update fs-safe to 0.18.1 (#155771)
  fix(doctor): allow repair with retained deleted-agent sessions (#155752)
  fix(setup): await inference probe cleanup (#155407)
  fix(mcp): recover expired SSE sessions and speed up parsing (#155497)
  fix(release): forward the stable soak waiver through the candidate helper (#155798)
  feat: calibrate Gateway plugin resources through retirement (#155792)
  fix: preserve the invoked launcher when restarting Node (#147621)
  fix(sessions): stop repeated failed worker exit cleanup (#154720)
  fix(ui): preserve active replies and tools after failed steering (#155746)
  fix(ci): retain missing-load-path baseline diagnostics (#154861)
  fix(gateway): keep session lists responsive during activity updates (#155767)
  fix: keep plugin queues bound to their selected session (#155714)
  chore(i18n): refresh native locales (#155571)
  fix(ci): wait for reset hook entry and join fixture cleanup (#155770)
  test: move subagent fixtures to module boundaries (#155727)
  fix(gateway): retain question requester authority through settlement (#155335)
  perf(gateway): move progress-card reads off the main thread (#153857)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
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. security-sensitive-changed 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