Skip to content

test: move core coverage to owner boundaries - #124184

Merged
steipete merged 2 commits into
mainfrom
test/remove-core-test-wrappers
Aug 15, 2026
Merged

steipete merged 2 commits into
mainfrom
test/remove-core-test-wrappers

Conversation

@steipete

@steipete steipete commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes obsolete core test helpers and direct private-helper tests after their behavior moved to stronger owner boundaries.

The cleanup covers four connected patterns:

  • usage date parsing helpers retained only through testApi after production range resolution moved to calendar-part logic;
  • a diagnostic traceparent wrapper and WeakSet provenance mechanism with no production caller;
  • a Gateway timeout testing property whose regression belongs at the CLI command boundary;
  • an exported Docker port resolver used only by its own tests instead of the health probe that owns the behavior.

Why This Change Was Made

The meaningful regressions remain protected at the boundaries that can actually affect users:

  • impossible dates, leap days, fixed offsets, invalid offsets, DST transitions, skipped civil days, and day-count clamping remain covered through resolveDateRange and Gateway handlers;
  • trusted trace propagation remains covered through exporter-owned propagation and the outbound model-request header boundary;
  • oversized agent timeouts are now exercised through agentCliCommand and the actual Gateway request;
  • Docker lock/config/environment precedence is now observed through the /healthz probe URL.

Removing the orphan traceparent export shrinks the public Plugin SDK by one export and one callable export, so the matching hard ceilings are reduced rather than preserving dead API or raising an allowance.

User Impact

No behavior change. Core production/test APIs are smaller, and tests are less coupled to private implementation details while preserving the original calendar, timeout, tracing, and Docker health regressions.

Evidence

  • Usage, diagnostics, outbound model trace propagation, agent CLI, shared timer coercion, Docker healthcheck, Dockerfile, and tsdown owners: 285 tests passed across 5 Vitest shards; one unrelated test remained skipped.
  • Plugin SDK surface report: 10 tests passed and the canonical check reports 4,329 public exports / 2,576 callable exports, matching the reduced ceilings.
  • The unrelated config-reload timing failure from the first hosted attempt passed on focused rerun.
  • The core, coreTests, scripts, and tooling changed gate passed through the documented trusted-source local fallback because no Crabbox/Testbox provider was ready. Typechecks, formatting, lint, dead-export scans, Plugin SDK surface/export checks, plugin boundaries, import cycles, database/sidecar/security guards, and architecture checks passed.
  • git diff --check passed.
  • Fresh structured autoreview reported no accepted/actionable findings on the final rebased branch.

Production/tooling delta: +6/-40, net -34. Tests: +46/-120, net -74. Total: +52/-160, net -108. No docs, config, schema, protocol, dependency, or changelog change.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: M maintainer Maintainer-authored PR labels Aug 15, 2026
@steipete
steipete marked this pull request as ready for review August 15, 2026 14:15
@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 Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 10:37 AM ET / 14:37 UTC.

ClawSweeper review

What this changes

Moves regression coverage from test-only helper exports to the CLI, Gateway usage, Docker health-probe, and model-request boundaries that own the behavior.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for maintainer review: the cleanup is coherent and no correctness or security defect was found, but exact-head checks are still running and the PR carries the protected maintainer label.

Priority: P3
Reviewed head: ba4db4b8aae200bb62ac652d026859ad6137cba2

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch cleanly replaces implementation-coupled tests with coverage at the owning runtime boundaries.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral test cleanup is not subject to the external contributor real-behavior-proof gate.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, behavior-neutral test cleanup is not subject to the external contributor real-behavior-proof gate.
Evidence reviewed 6 items Owner-boundary coverage: The model-call owner derives the propagated trace header at the outbound request boundary, and its regression test verifies the resulting headers without mutating caller input.
Usage validation remains at the owner: Explicit date validation and calendar interpretation remain in resolveDateRange, while the retained tests cover invalid dates, leap days, offsets, DST, and skipped civil days through that boundary.
Docker behavior is exercised through the probe: The health check resolves the authoritative active-lock or configured port and immediately fetches /healthz; the revised tests assert the request URL and health result rather than the private resolver.
Findings None None.
Security None None.

How this fits together

This touches core test seams around Gateway usage ranges, CLI-to-Gateway timeout conversion, Docker liveness probing, and diagnostic trace propagation. Runtime inputs flow through these owners to user-visible requests and health checks, while the tests assert their observable outputs rather than private helpers.

flowchart LR
  A[Runtime inputs] --> B[Owner boundaries]
  B --> C[Usage range and CLI timeout]
  B --> D[Docker health and model tracing]
  C --> E[Gateway and CLI outcomes]
  D --> E
  E --> F[Boundary regression tests]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress, so this PR should not land until the remaining required checks succeed.
  • Complete next step (P2) - The protected maintainer label and incomplete exact-head CI call for a maintainer look, not an automated repair job.
Agent review details

Security

None.

PR surface

Source -36, Tests -74, Other +2. Total -108 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 2 38 -36
Tests 4 46 120 -74
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 2 +2
Total 9 52 160 -108

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +6/-40 (net -34); tests +46/-120 (net -74) The cleanup removes more production/test-support surface than it adds while retaining coverage at observable owner boundaries.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/infra/diagnostic-events.test.ts, vector/embedding metadata: src/infra/diagnostic-events.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the smaller owner-boundary tests and land once the current head is green and receives the required maintainer look.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the smaller owner-boundary tests and land once the current head is green and receives the required maintainer look.

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

Not applicable: this PR is behavior-neutral cleanup, and the relevant evidence is owner-boundary regression coverage rather than a reported user failure.

Is this the best way to solve the issue?

Yes. Deleting test-only seams while asserting the CLI, Gateway, health-probe, and outbound-request outcomes is the most maintainable test shape.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9663cc7edcc3.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is behavior-neutral test and API-surface cleanup rather than an urgent user-facing defect.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, behavior-neutral test cleanup is not subject to the external contributor real-behavior-proof gate.

Evidence

What I checked:

  • Owner-boundary coverage: The model-call owner derives the propagated trace header at the outbound request boundary, and its regression test verifies the resulting headers without mutating caller input. (src/agents/embedded-agent-runner/run/attempt.model-diagnostic-lifecycle.ts:369, ba4db4b8aae2)
  • Usage validation remains at the owner: Explicit date validation and calendar interpretation remain in resolveDateRange, while the retained tests cover invalid dates, leap days, offsets, DST, and skipped civil days through that boundary. (src/gateway/server-methods/usage.ts:597, ba4db4b8aae2)
  • Docker behavior is exercised through the probe: The health check resolves the authoritative active-lock or configured port and immediately fetches /healthz; the revised tests assert the request URL and health result rather than the private resolver. (src/docker-healthcheck.ts:20, ba4db4b8aae2)
  • Current SDK boundary: The public diagnostic runtime exposes the supported diagnostic trace formatter and selected event APIs; the removed dispatcher wrapper is not among its runtime exports. (src/plugin-sdk/diagnostic-runtime.ts:42, 9663cc7edcc3)
  • History provenance: Current-line blame attributes the existing Docker, CLI timeout, usage-range, and diagnostics implementations to the current source baseline commit, so this PR is removing test seams around recently consolidated owner code rather than replacing an older public contract. (src/docker-healthcheck.ts:20, 2d322d1ae761)
  • Diff accounting: The reviewed diff is net-negative: production/tooling is +6/-40 and tests are +46/-120. (scripts/plugin-sdk-surface-report.mts:287, ba4db4b8aae2)

Likely related people:

  • steipete: Feature-history shortlog identifies Peter Steinberger as the largest human contributor across these central files, and this PR continues that owner-boundary cleanup. (role: recent area contributor; confidence: medium; commits: 2827c62677d7, ba4db4b8aae2; files: src/commands/agent-via-gateway.ts, src/docker-healthcheck.ts, src/gateway/server-methods/usage.ts)
  • openclaw-mantis[bot]: Blame attributes the consolidated current implementations in the affected owner modules to commit 2d322d1. (role: current-line provenance; confidence: medium; commits: 2d322d1ae761; files: src/docker-healthcheck.ts, src/commands/agent-via-gateway.ts, src/gateway/server-methods/usage.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 (1 earlier review cycle)
  • reviewed 2026-08-15T14:21:57.859Z sha 32e349f1bb0ca3cfb864434871833a0b2bc07918 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the test/remove-core-test-wrappers branch from 32e349f to ba4db4b Compare August 15, 2026 14:32
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 15, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for ba4db4b8aae200bb62ac652d026859ad6137cba2:

  • Usage, diagnostics, outbound model trace propagation, agent CLI, shared timer coercion, Docker healthcheck, Dockerfile, and tsdown owners: 285 tests passed across 5 Vitest shards; one unrelated test remained skipped.
  • Plugin SDK surface report: 10 tests passed; the canonical check reports 4,329 public exports and 2,576 callable exports, matching the reduced ceilings.
  • The first hosted attempt exposed two independent issues: an unrelated config-reload watcher timing miss and the pre-rebase SDK budget/source mismatch. The watcher test passed focused reruns; rebasing onto current main and lowering the ceilings with the removed diagnostic export fixed the SDK gate.
  • The core, coreTests, scripts, and tooling changed gate passed through the documented trusted-source local fallback because no Crabbox/Testbox provider was ready. Typechecks, formatting, lint, dead-export scans, Plugin SDK export/surface checks, plugin boundaries, import cycles, database/sidecar/security guards, and architecture checks passed.
  • git diff --check passed.
  • Fresh structured autoreview reported no accepted/actionable findings on the final rebased branch.
  • Updated exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/31890195941
  • ClawSweeper found no actionable correctness or security findings: test: move core coverage to owner boundaries #124184 (comment). Its remaining checklist items were exact-head CI and ordinary maintainer review, both now satisfied. The stored-data note is a diagnostic filename/token false positive; no persistent model, vector metadata, migration, schema, or storage path changed.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 124184 passed by reusing hosted exact-head gates; no Testbox lease was required.

Production/tooling delta: +6/-40, net -34. Tests: +46/-120, net -74. Total: +52/-160, net -108. No behavior, docs, config, schema, protocol, dependency, or changelog change.

@steipete
steipete merged commit b365f7e into main Aug 15, 2026
193 of 195 checks passed
@steipete
steipete deleted the test/remove-core-test-wrappers branch August 15, 2026 14:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
* test: move core coverage to owner boundaries

* ci: lower plugin SDK surface budget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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