Skip to content

refactor(normalization): deslop string and URL helpers - #164269

Merged
steipete merged 4 commits into
mainfrom
deslop/x08-string-normalize-format-20261002
Oct 4, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/x08-string-normalize-format-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes repeated string, list, ID, formatting, and URL-parsing scaffolding through existing normalization owners across core, packages, plugins, and the Control UI.

User Impact

Existing normalization, Unicode, empty-value, protocol, credential, rounding, and output contracts are preserved. The relative-time formatter now retains future wording when calendar formatting fails. Bundled plugins share ASCII-control detection through the existing private-local SDK subpath; the public SDK surface is unchanged.

Simplifications

  • Replace syntax-only URL exception wrappers with URL.parse or URL.canParse, retaining catches that also own decoding, callbacks, or network failures.
  • Reuse canonical string/list/ID normalization and remove private ACP and OAuth forwarding helpers.
  • Replace duplicate ASCII-control scans while preserving C0/DEL rejection and C1/Unicode behavior.
  • Share duration-part rendering and marker truncation while preserving verbose output, rounding, and marker budgets.
  • Simplify terminal OSC-8 envelope parsing and redundant width validation.

The original batch removed 1,001 net production lines. After conflict-only refreshes onto current main, the remaining diff removes 995 net production lines across 198 production files. Main independently retired Telegram's runtime API-root repair and simplified TTS auto-mode parsing; both overlapping hunks were dropped. The remaining patches retain their earlier review.

Fixes Found Along the Way

When calendar formatting rejected its timezone, a timestamp eight days in the future incorrectly fell back to 8d ago. The direction-aware relative label now produces in 8d. The regression failed on the original implementation. It belongs to the existing formatter suite and adds no process fixture, real timer, retry, or worker configuration.

Evidence

Current candidate: 41c1728628046eefc1e20ece6fca1b832ccbfb89, based on main 1836ae2146443e952337bce1bccb41c524ea0639.

Exact-head hosted CI 37171670932 completed with one inherited failing test: the ACPX process fixture still expects shared-project instead of the canonical agent:main:shared-project now returned by main's Doctor migration #162920. Clean checkouts of the exact tested main parent and synthetic merge reproduce the identical assertion (1 failed / 2 passed each). All other checks passed or were skipped. The node-worker launch-wire e2e passed (1/1, 122.05 seconds), as did the Meet/Copilot shard. Pinned attribution evidence records the producer, exact output, and the named-key assertions not reached by the stale fixture. No authority refusal or owner collision was observed.

On AWS Linux lease cbx_46b89728ea2f, run run_7a36b059f9ec5f262b43d31704779755, the exact candidate commit/tree was verified before execution. Node 24.19.0 and frozen pnpm 12.5.1 were used for both head and main:

  • Both import-cycle checks: zero cycles.
  • Core and extension typechecks: passed.
  • 410 focused tests across 13 files: passed, including TTS, Telegram, the previously conflicted core graphs, and all 120 Google Meet/Copilot cases. Six focused shards completed in 137.17 seconds.
  • Full plugin contracts on candidate and clean pinned main: 1,131/1,132 passed on each, with the identical type-configuration failure described below.

The original batch also passed 4,903 focused tests, a full build, changed-file lint, SDK API comparison, and independent review. The earlier SDK budget regression was repaired by keeping ASCII-control detection on the private-local subpath, without raising budgets. Conflict refreshes preserve main's configured GitHub-host checks, extracted credential parser, private URI helper, Doctor-owned Telegram migration, and TTS schema owner. Range-diffs show only the dropped overlapping Telegram and TTS hunks after the previously reviewed resolutions.

The formatter suite's initial measured run took 18.51 seconds wall on the loaded Mac (about 1.94 seconds of test work). Remote proof supplements the required exact-head hosted CI gate.

Independently attributed main failure

Both current candidate and clean main fail src/plugins/contracts/extension-package-project-boundaries.test.ts:300, keeps xai's boundary-specific path overrides derived from the shared package boundary map, with:

AssertionError: expected { …(317) } to deeply equal { …(319) }

The missing entries are @openclaw/gateway-protocol and @openclaw/gateway-protocol/*. The test derives the expected xAI TypeScript path map from the shared package map; this PR changes neither JSON map nor the test. This is a type-project configuration mismatch, not a runtime authority, permission, approval, or sandbox failure. No assertion or baseline was changed in this PR.

Earlier failure investigation retained

The refresh incorporates the coordinator's Copilot fixture repair af10ddf84e6, Google Meet native-identity fixture repair 71772d690c4, and knip entry repair bf4fe3ace57. Main separately fixed the Feishu expectation in a6357978b73. The grouped Meet/Copilot run now passes all 120 cases on both the Mac refresh and Linux candidate proof.

On the earlier rebased head 1394ab7e0e4, local contracts twice hit PluginInstanceUnavailableError in the admitted-registry session-patch case. The stack reached the fulfilled completion mapper after callback assertions and lease release, with the existing five-second retirement fence active. A clean-base single-file run passed all 52 cases but failed temporary-directory teardown with ENOTEMPTY; a full-base attempt aborted with exit 137. These local attempts did not establish a current-main red or a fixed flake. The current Linux comparison passes the same retirement case on both head (726 ms) and main (723 ms). No timer, assertion, or authority guard was changed, and no authority-related admin exception is claimed.

The earlier node-worker wire e2e returned Shared-state read and cleanup failed; later local attempts stalled before that assertion. Current main's prebuilt-Gateway fixture change is incorporated; the wire case passed on the exact hosted head as recorded above.

Blacksmith lease tbx_01m42450ga6emw9vc5nav6v8s7 remained queued and was stopped without executing proof. Required local fallback commands ran sequentially with nice -n 15. Protected staging and recovery state were preserved.

Review tooling qualification

ClawSweeper's automated review did not run because its input scanner held an existing synthetic credential-bearing URI example in a comment at extensions/elevenlabs/shared.ts:22. A private diagnostic used the pinned TruffleHog 3.97.4 archive/checksum with external verification disabled on both the original and current patches. Each patch produced only that identical comment finding (line digest f0fe8e6ce48d44762445ed1ddf3e1571a919d5ac1525fb4916080aec10760481); no additional credential material was reported. The example uses placeholder credentials and host. Scanner policy and the bot's hold were not changed, and no automated bot review verdict is claimed. Independent autoreview remains the code-review evidence.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: device-pair channel: irc extensions: anthropic extensions: qa-lab plugin: google-meet extensions: gradium extensions: deepinfra extensions: oc-path extensions: elevenlabs labels Oct 3, 2026
Reuse canonical string, list, ID and truncation helpers; remove parse-only URL exception scaffolding while preserving each callers validation and fallback contract. Share duration rendering and remove redundant private normalization wrappers. No user-visible configuration, persisted-data, protocol, CLI or UI output changes intended.
Reuse the relative label for both normal display and the calendar-date fallback. The regression returns in 8d instead of 8d ago when Intl rejects the timezone. Document intentional OSC 8 control delimiters for the lint rule.
@steipete
steipete force-pushed the deslop/x08-string-normalize-format-20261002 branch from 1394ab7 to 41c1728 Compare October 4, 2026 02:38
@steipete
steipete enabled auto-merge (squash) October 4, 2026 02:40
@steipete
steipete disabled auto-merge October 4, 2026 02:50
@steipete

steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head CI 37171670932 tested 41c1728628046eefc1e20ece6fca1b832ccbfb89 in merge a17715374bb36cfd0daf56797d81de585a883a92, whose main parent is 7e0f4c0088dcd41ea399d2f3670fea4a77a1930f. The only failing non-aggregate job is changed extensions bundle 7-2; the CI gate fails downstream of it. All other checks have completed successfully or were skipped.

The failing case is extensions/acpx/src/runtime-owner.process.test.ts:112, isolates real ACPX histories for two owners of shared-project across restart and controls:

AssertionError: expected 'agent:main:shared-project' to be 'shared-project'

I reproduced the same file sequentially on clean checkouts of the exact CI main parent and exact tested merge, on AWS lease cbx_46b89728ea2f (run run_f8affcd2b4678b9c80fed35f1df8e42b). Both produced the identical assertion with 1 failed / 2 passed. The global two-owner history/restart/control case and the oneshot identity case passed on both.

The producer is main commit 12c5644ad78 / #162920: resolveSessionStorePathForAcp now applies resolveSqliteSessionKey to the session key, and the session manager returns that canonical key in its handle. The documented Doctor cutover requires canonical runtime metadata. The process fixture still asserts the bare input alias. This PR does not change that fixture or the key producer. The observed failure is the stale scalar representation assertion, not an authority refusal or an observed owner collision. The later named-key history assertions are not reached; their fixture needs a main follow-up, and I am not claiming that unexecuted coverage passed.

The previously failing node-worker launch-wire e2e passed on this exact CI head (1/1, 122.05 seconds). The Google Meet/Copilot shard also passed. Both cycle checks, both typechecks, and all 410 focused cases passed for the pushed head on Linux.

Separately, the local full-contract proof reproduced xAI's two missing TypeScript path aliases identically on candidate and pinned main. Independent main CI evidence confirms that mismatch, and #164714 owns its six-line configuration fix. It is not an additional failing job in this PR's hosted run.

No assertion, timeout, authority check, or baseline was weakened in this PR.

Manual review-tool qualification: the old ClawSweeper input hold is a synthetic URI comment example, not an identified live credential. A private pinned-version diagnostic with verification disabled found only that identical comment on original/current patches. No scanner policy or bot hold was cleared, and no ClawSweeper review verdict is claimed; independent autoreview is the code-review evidence.

@steipete
steipete merged commit 4fa6901 into main Oct 4, 2026
226 of 229 checks passed
@steipete
steipete deleted the deslop/x08-string-normalize-format-20261002 branch October 4, 2026 03:52
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Consolidate duplicated string, list, ID, formatting, truncation, and syntax-only URL helpers through canonical owners while preserving Unicode, empty-value, protocol, credential, rounding, and output contracts. Keep ASCII-control detection private to bundled plugins without expanding the public SDK.

Preserve future direction in the relative-time fallback when calendar formatting fails. Retain main semantics through conflict-only refreshes, dropping cleanup hunks already handled by main.

Validation includes independent review, zero import cycles, core and extension typechecks, 410 focused tests, and paired candidate/main plugin contracts. The sole shared contract failure is the unchanged xAI TypeScript path-map mismatch documented in the PR.

Hosted CI passed every non-aggregate job except main's stale ACPX process-fixture canonical-key assertion, reproduced identically on the exact clean main parent and tested merge. The node-worker wire e2e passed. Landed under the maintainer-authorized inherited-main exception; details and remaining fixture coverage are recorded in the PR.
vincentkoc added a commit that referenced this pull request Oct 16, 2026
Integrate main after the normalization owner landed in #164269. The remaining contribution is 22 route-level normalization cases; production matches main. Preserve the original PR ancestry and historical proof. Current-head review and hosted CI remain required before landing.
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* refactor(channels): reuse conversation id normalization

* chore(channels): retain route normalization coverage on current main

Integrate main after the normalization owner landed in #164269. The remaining contribution is 22 route-level normalization cases; production matches main. Preserve the original PR ancestry and historical proof. Current-head review and hosted CI remain required before landing.

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
)

* refactor(channels): reuse conversation id normalization

* chore(channels): retain route normalization coverage on current main

Integrate main after the normalization owner landed in openclaw#164269. The remaining contribution is 22 route-level normalization cases; production matches main. Preserve the original PR ancestry and historical proof. Current-head review and hosted CI remain required before landing.

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: buzz channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: imessage Channel integration: imessage channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: slack Channel integration: slack channel: sms Channel integration: sms channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: active-memory extensions: alibaba extensions: anthropic extensions: browser extensions: clawrouter Extension: clawrouter extensions: clickclack extensions: deepgram extensions: deepinfra extensions: device-pair extensions: elevenlabs extensions: gradium extensions: oc-path extensions: perplexity extensions: policy extensions: qa-lab gateway Gateway runtime plugin: google-meet security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant