Skip to content

feat(tooling): adopt noUncheckedIndexedAccess via a strict-ratchet lane (phase 1) - #104577

Merged
steipete merged 3 commits into
mainfrom
claude/nuia-ratchet-phase1
Jul 11, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/nuia-ratchet-phase1

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #104558

What Problem This Solves

noUncheckedIndexedAccess is off, so arr[i]/record[key] reads typecheck as always-defined; a fresh probe counts 1,750 would-be errors repo-wide, including real crash paths behind regex-group indexing. Flipping globally is intractable in one change, and an unguided migration would degenerate into ! spam (~1,200 non-null assertions already exist unenforced).

Why This Change Was Made

Phase 1 of an include-list ratchet:

  • tsconfig.strict-ratchet.json compiles seven packages (markdown-core, net-policy, media-understanding-common, terminal-core, normalization-core, model-catalog-core, web-content-core) with noUncheckedIndexedAccess: true. Wired into tsgo:strict-ratchet, check.mjs, the CI test-types shard (with a historical-target guard matching existing patterns), tsgo:all project references, and check:changed routing (new strictRatchet lane); a sync test pins the tsconfig include list, the changed-lanes constant, and routing together so they cannot drift.
  • memory-host-sdk was planned for phase 1 but excluded with a documented reason: it re-exports core src/** directly, so the flag would apply transitively to all of core (1,267 errors); it migrates together with src/. Its 5 index-safety fixes are kept — they are valid improvements under the core lane.
  • All 65 in-scope errors fixed, behavior-identical: iteration over index loops (.entries(), toReversed()), charAt/slice for character access, regex-group guards, and a validated fixed-length hextet tuple in net-policy/ip.ts. In that security-relevant file, impossible invariant violations now throw loudly instead of failing open (a silent undefined would have skipped SSRF embedded-IPv4 blocking).
  • New invariant helpers @openclaw/normalization-core/expect (expectDefined, first, last) with subpath export, build entry, and tests; expectDefined has three production call sites in this diff. getOrCreate was deliberately omitted (no call sites yet — helpers must pay rent).
  • typescript/no-non-null-assertion: error scoped to the seven migrated packages (they contain zero ! today), so fixed code cannot regress into assertion spam.

No any, no casts, no @ts-expect-error, no fabricated defaults. Later phases: packages/ai + agent-core (196 errors), ui/ (304), src/ dir-by-dir; the lane is deleted when the base flag flips.

User Impact

No runtime behavior change. Index/lookup reads in the migrated packages are now compile-time-proven defined or explicitly handled, and the pattern for the remaining phases is established.

Evidence

  • node scripts/run-tsgo.mjs -p tsconfig.strict-ratchet.json → 0 errors (failed with 65 before the burn-down); all existing lanes (core, ui, extensions, scripts, core-test, root-test) fresh non-incremental → 0 errors.
  • Blacksmith Testbox (Linux Node 24): pnpm build (new package export packaged), full pnpm check, pnpm check:test-types, package test suites for all eight touched packages plus the ratchet sync, oxlint-config, changed-lanes, and ci-workflow-guards tests — run link in PR checks.
  • node scripts/run-oxlint.mjs packages clean with the new override; node scripts/check-tsgo-core-boundary.mjs pass.
  • Fresh autoreview on the final tree with no accepted findings.

steipete added 2 commits July 11, 2026 18:09
Burns down all 65 noUncheckedIndexedAccess errors in the seven ratchet
packages with behavior-identical restructuring (iteration, charAt/slice,
regex-group guards, validated hextet tuple). net-policy invariant
violations now throw instead of failing open. Adds
@openclaw/normalization-core/expect (expectDefined/first/last) with
subpath export and tests. memory-host-sdk fixes kept but the package
stays out of the lane: it re-exports core src/** so the flag would apply
transitively to all of core.
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 060ca42217

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .oxlintrc.json Outdated
"**/node_modules/**"
],
"overrides": [
// Keep these package globs aligned with the noUncheckedIndexedAccess ratchet lane.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep .oxlintrc.json parseable by extension lint

When CI runs the extension-channels or extension-bundled additional-check groups, lint:extensions:channels/lint:extensions:bundled go through scripts/lib/run-extension-oxlint.mjs, whose writeTempOxlintConfig() still reads this file with JSON.parse(...). This new // comment makes .oxlintrc.json invalid JSON, so those lint lanes fail before oxlint runs (locally, JSON.parse(fs.readFileSync('.oxlintrc.json','utf8')) throws Unexpected token '/'). Either keep this config strict JSON or update that runner to parse JSONC/JSON5 as well.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 11, 2026, 1:24 PM ET / 17:24 UTC.

Summary
The PR adds a seven-package noUncheckedIndexedAccess ratchet, integrates it with compiler, lint, CI, and changed-file routing, exports normalization invariant helpers, and updates indexed-access handling in affected packages.

PR surface: Source +72, Tests +75, Config +40, Other +39. Total +226 across 35 files.

Reproducibility: yes. for the review finding: source inspection shows that adding a package to the tsconfig and routing constant while omitting .oxlintrc.json still satisfies both current tests.

Review metrics: 2 noteworthy metrics.

  • Ratchet scope: 7 packages added. Each package now relies on the compiler, changed-file routing, and lint enforcement scopes expanding together.
  • Synchronized policy surfaces: 2 of 3 directly compared. The compiler includes and routing constant are compared, but the oxlint package scope remains outside the invariant.

Stored data model
Persistent data-model change detected: persistent cache schema: package.json, persistent cache schema: tsconfig.strict-ratchet.json, serialized state: test/scripts/oxlint-config.test.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/embeddings.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104558
Summary: This PR is the direct implementation candidate for the still-open phase-one strict-ratchet issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Fix the three-way package-scope synchronization guard.

Risk before merge

  • [P1] A later ratchet phase can expand compiler and changed-file routing coverage while silently omitting the non-null-assertion lint restriction, undermining the PR's stated anti-assertion guarantee.

Maintainer options:

  1. Close the synchronization gap (recommended)
    Extend the ratchet guard to compare compiler, changed-file routing, and oxlint package scopes before merging.
  2. Accept manual scope maintenance
    Merge while explicitly accepting that future phases must manually keep three independent package lists synchronized.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Update the strict-ratchet synchronization test to parse `.oxlintrc.json`, normalize the `typescript/no-non-null-assertion` override globs to package directories, compare them with the tsconfig includes and `STRICT_RATCHET_PACKAGE_DIRS`, preserve strict-JSON compatibility, and run the focused tooling tests.

Next step before merge

  • [P2] The remaining blocker is a narrow mechanical synchronization-test repair on a known file; the key exact-head validation paths are otherwise green.

Security
Cleared: The diff adds no dependency, permission, secret, artifact-download, or third-party execution surface; the security-sensitive IPv6 invariant matches the inspected ipaddr.js constructor contract and exact-head security checks are green.

Review findings

  • [P2] Synchronize the oxlint package list in the ratchet guard — test/scripts/strict-ratchet-sync.test.ts:22-24
Review details

Best possible solution:

Use one focused guard to parse and normalize the package scopes from tsconfig.strict-ratchet.json, STRICT_RATCHET_PACKAGE_DIRS, and the oxlint override, assert all three are identical, and retain the now-green exact-head validation evidence.

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

Yes for the review finding: source inspection shows that adding a package to the tsconfig and routing constant while omitting .oxlintrc.json still satisfies both current tests.

Is this the best way to solve the issue?

No, not quite as submitted. The staged ratchet is a sound bounded approach, but its stated compiler, routing, and lint alignment must be enforced by one shared invariant before merge.

Full review comments:

  • [P2] Synchronize the oxlint package list in the ratchet guard — test/scripts/strict-ratchet-sync.test.ts:22-24
    The guard only compares tsconfig includes with STRICT_RATCHET_PACKAGE_DIRS, while the oxlint test independently snapshots whatever list is currently present. A later phase can therefore expand compiler and routing coverage without extending typescript/no-non-null-assertion, and both tests still pass. Parse that override here and compare all three normalized lists.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 702ba19e3aba.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports after-fix strict-ratchet and Blacksmith Testbox execution, corroborated on the final head by successful lint, typecheck, extension-wrapper, guard, and security checks.

Label justifications:

  • P3: This is low-urgency internal type-safety and tooling hardening rather than a current user-facing regression.
  • merge-risk: 🚨 automation: The PR changes CI and changed-file validation while leaving one promised enforcement scope outside its synchronization guard.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body reports after-fix strict-ratchet and Blacksmith Testbox execution, corroborated on the final head by successful lint, typecheck, extension-wrapper, guard, and security checks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports after-fix strict-ratchet and Blacksmith Testbox execution, corroborated on the final head by successful lint, typecheck, extension-wrapper, guard, and security checks.
Evidence reviewed

PR surface:

Source +72, Tests +75, Config +40, Other +39. Total +226 across 35 files.

View PR surface stats
Area Files Added Removed Net
Source 19 127 55 +72
Tests 5 77 2 +75
Docs 0 0 0 0
Config 6 41 1 +40
Generated 0 0 0 0
Other 5 40 1 +39
Total 35 285 59 +226

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs test/scripts/strict-ratchet-sync.test.ts test/scripts/oxlint-config.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-workflow-guards.test.ts.
  • [P1] git diff --check.

What I checked:

  • Remaining synchronization defect: The new guard compares the tsconfig package includes with STRICT_RATCHET_PACKAGE_DIRS, but it never reads the oxlint override; the separate oxlint snapshot only pins its present literal, so later compiler and routing expansion can omit lint enforcement without failing either test. (test/scripts/strict-ratchet-sync.test.ts:22, 26b72f0ae459)
  • Prior parser finding resolved: The only commit after the previously reviewed head removes the comment that made .oxlintrc.json invalid for existing strict-JSON consumers. (.oxlintrc.json:231, 26b72f0ae459)
  • Exact-head validation: The exact-head check-test-types, check-lint, check-additional-extension-channels, check-additional-extension-bundled, and check-guards runs completed successfully with no observed failing check. (.github/workflows/ci.yml:1472, 26b72f0ae459)
  • Current-main comparison: None of the PR's touched files changed between its base and current main, so the branch-behind state does not indicate supersession or a concrete three-way merge regression. (702ba19e3aba)
  • IPv6 dependency contract: The upstream ipaddr.js IPv6 constructor accepts sixteen bytes or exactly eight 16-bit parts and rejects other lengths, supporting the new eight-hextet invariant used by the SSRF classification path. (packages/net-policy/src/ip.ts:22, 26b72f0ae459)
  • Adjacent tooling provenance: Recent merged commits by Peter Steinberger introduced the adjacent typecheck lane and changed-routing patterns extended by this PR. (scripts/check.mjs:121, fe261b0f59aa)

Likely related people:

  • steipete: Prior merged work introduced the typecheck lane, project-reference, and changed-routing patterns extended by this PR, independently of authorship of the current branch. (role: introduced adjacent tooling architecture; confidence: high; commits: ae12413ee29c, fe261b0f59aa; files: package.json, scripts/check.mjs, scripts/changed-lanes.mjs)
  • qingminlong: Current main history includes recent work in the surrounding check orchestration and changed-lane modules, making this contributor relevant for integration review. (role: recent adjacent contributor; confidence: medium; commits: 02560243f3ca; files: scripts/check.mjs, scripts/changed-lanes.mjs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-11T17:16:37.141Z sha 060ca42 :: needs real behavior proof before merge. :: [P2] Keep the shared oxlint config valid for its existing parser | [P2] Synchronize the oxlint package list in the ratchet guard

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 11, 2026
@steipete
steipete merged commit e686693 into main Jul 11, 2026
113 checks passed
@steipete
steipete deleted the claude/nuia-ratchet-phase1 branch July 11, 2026 17:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…ne (phase 1) (openclaw#104577)

* feat(tooling): add noUncheckedIndexedAccess strict-ratchet lane

* fix(packages): make indexed access explicit across ratchet packages

Burns down all 65 noUncheckedIndexedAccess errors in the seven ratchet
packages with behavior-identical restructuring (iteration, charAt/slice,
regex-group guards, validated hextet tuple). net-policy invariant
violations now throw instead of failing open. Adds
@openclaw/normalization-core/expect (expectDefined/first/last) with
subpath export and tests. memory-host-sdk fixes kept but the package
stays out of the lane: it re-exports core src/** so the flag would apply
transitively to all of core.

* fix(lint): keep .oxlintrc.json strict-JSON parseable for extension lint wrappers
steipete added a commit that referenced this pull request Oct 14, 2026
…le B) (#171920)

* fix(google): report the operation that supplied fallback video

An empty SDK video result can fall back to a distinct REST operation. Capture
its name after that fallback so returned metadata identifies the delivered video.
Keep the SDK error check before fallback and preserve requests and media limits.

Parameterize the existing fallback regression for SDK 404 and SDK empty results.
The real provider entry probe fails on the original empty-result metadata and
passes both scenarios with this fix, using synthetic SDK and HTTP responses.

* refactor(providers): consolidate old provider and protocol helpers

Share exact Gateway schema fields without changing public shapes. Consolidate
tool-payload classification, catalog responses, device polling, media formatting,
and speech format selection. Remove the Mantle factory's test-only injection seam.

Best-effort tradeoffs accepted:
- OpenRouter equivalent nested request policies reordered during configuration
  edits may cause another bounded catalog GET. #102062 supplies synthetic key
  equivalence, not a human incident; full auth/network policy stays in the key.
- Warm Anthropic scans may discover more history than cold scans. #109309/#115259
  establish synthetic frontier equality, not a human pagination incident. Charge
  actual I/O only, retaining the 64MiB read and bounded file/cache limits.
- A complete Anthropic read exactly at the I/O cap can now be cached. The former
  fence supported synthetic cold/warm cost equality; incomplete reads stay out.
- Deleted transcript metadata can remain in the bounded cache until eviction.
  #109309's eager sweeps duplicate current-candidate visibility and bounded
  retention; no current file means no visible cached row.
- A manually sparse single-audio-item array yields empty text rather than an
  invariant error. #104577/#104558 introduced the throw for a compiler ratchet;
  the real caller supplies a dense filter result, not a reported runtime failure.

Standalone session-memory backend and its registry/factory/tests are untouched.

* refactor(qa-lab): consolidate older harness paths

Share manifest discovery/linking, bus parser construction, Matrix device
verification, registration-local fault history, FIFO starts and mock answers.
Remove type-laundering and duplicate work on trusted internal facts.

Best-effort tradeoffs accepted

- Heap-capture PID fences came from synthetic replacement tests in #137860,
  not a human actual-use report. A coincident restart may fail or omit this
  optional diagnostic; the snapshot-writer health barrier remains.
- Failed-realpath lexical guessing came from synthetic execution validation
  in #116912. A disappearing/inaccessible test now fails existing evidence
  verification instead of guessing its identity; real symlink paths still work.
- #143976 introduced duplicate taxonomy parsing alongside both production
  callers' canonical identity guarantees. Untyped invalid internal build calls
  omitting required identity are unsupported; external artifact validation stays.
- Manifest discovery is invocation-local. A source catalog changed during
  staging is best-effort and is rescanned on the next invocation, rather than
  repeatedly scanning the same catalog for each selected plugin.
- The search fixture's fixed hostname (8288b4d) needs no URL-parser fallback.
  No runtime hostname input exists; a future fixture URL rewrite must update
  its hostname field too. Current output is unchanged.
- db4ad84 projected hit objects to hide registration IDs. Those IDs are now
  gone, and all private callers only read hit facts. Unexpected future internal
  object mutation may alter QA diagnostics; stable array snapshots remain.

Focused owner tests, canonical QA production/test typechecks, syntax lint,
formatting, suppression tests, zero runtime/madge cycles and independent
P0-P2 review cover the retained cut. No SDK/config/protocol/schema changes.

Local broad-proof gaps are recorded in .local/q04-ledger.md: SDK boundary
declaration preparation exceeded its existing 300000ms deadline before typed
lint ran; the repo-wide SQLite worker scanner was interrupted after more than
25 minutes on an overloaded host. Neither is attributed as inherited CI red.
The production, full-tree and script Knip scans also exceeded their existing
600-605s deadlines without a code verdict. Bundled exact-head CI must provide
the missing broad proof; no timeout/skip/retry policy was changed.

* refactor(android): simplify legacy native owners

Use platform accessibility nodes and canonical coroutine cancellation. Remove duplicate sheet validation and unreachable mascot clamps while retaining security, resource bounds and normal lifecycle behavior.

Fix DNS-SD display names by preserving advertised UTF-8 text and decoding instance names once. Both Android APK variants, 260 focused native test cases, lint, cycle checks and independent review validate the candidate.

* refactor: keep round-3 bundle within old-code scope

Drop all hunks in files touched on main within seven days, plus dependent Mantle, Anthropic cache, and QA assertion cuts. Preserve current main tests and baseline without allowances or shims. Keep Google SDK errors in the typed SDK owner and REST errors in its existing helper, without adding assertions. Retain one full mock ask-user roundtrip contract and the two distinct precedence cases.

* refactor(anthropic): preserve fresh hosts without map spread

* refactor(qa-lab): drop Gateway startup cleanup from bundle

Restore the q04 startup import closure and direct tests to main for Telegram menu E2E attribution. Keep Matrix/profile-evidence, provider, and Android changes unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…le B) (openclaw#171920)

* fix(google): report the operation that supplied fallback video

An empty SDK video result can fall back to a distinct REST operation. Capture
its name after that fallback so returned metadata identifies the delivered video.
Keep the SDK error check before fallback and preserve requests and media limits.

Parameterize the existing fallback regression for SDK 404 and SDK empty results.
The real provider entry probe fails on the original empty-result metadata and
passes both scenarios with this fix, using synthetic SDK and HTTP responses.

* refactor(providers): consolidate old provider and protocol helpers

Share exact Gateway schema fields without changing public shapes. Consolidate
tool-payload classification, catalog responses, device polling, media formatting,
and speech format selection. Remove the Mantle factory's test-only injection seam.

Best-effort tradeoffs accepted:
- OpenRouter equivalent nested request policies reordered during configuration
  edits may cause another bounded catalog GET. openclaw#102062 supplies synthetic key
  equivalence, not a human incident; full auth/network policy stays in the key.
- Warm Anthropic scans may discover more history than cold scans. openclaw#109309/openclaw#115259
  establish synthetic frontier equality, not a human pagination incident. Charge
  actual I/O only, retaining the 64MiB read and bounded file/cache limits.
- A complete Anthropic read exactly at the I/O cap can now be cached. The former
  fence supported synthetic cold/warm cost equality; incomplete reads stay out.
- Deleted transcript metadata can remain in the bounded cache until eviction.
  openclaw#109309's eager sweeps duplicate current-candidate visibility and bounded
  retention; no current file means no visible cached row.
- A manually sparse single-audio-item array yields empty text rather than an
  invariant error. openclaw#104577/openclaw#104558 introduced the throw for a compiler ratchet;
  the real caller supplies a dense filter result, not a reported runtime failure.

Standalone session-memory backend and its registry/factory/tests are untouched.

* refactor(qa-lab): consolidate older harness paths

Share manifest discovery/linking, bus parser construction, Matrix device
verification, registration-local fault history, FIFO starts and mock answers.
Remove type-laundering and duplicate work on trusted internal facts.

Best-effort tradeoffs accepted

- Heap-capture PID fences came from synthetic replacement tests in openclaw#137860,
  not a human actual-use report. A coincident restart may fail or omit this
  optional diagnostic; the snapshot-writer health barrier remains.
- Failed-realpath lexical guessing came from synthetic execution validation
  in openclaw#116912. A disappearing/inaccessible test now fails existing evidence
  verification instead of guessing its identity; real symlink paths still work.
- openclaw#143976 introduced duplicate taxonomy parsing alongside both production
  callers' canonical identity guarantees. Untyped invalid internal build calls
  omitting required identity are unsupported; external artifact validation stays.
- Manifest discovery is invocation-local. A source catalog changed during
  staging is best-effort and is rescanned on the next invocation, rather than
  repeatedly scanning the same catalog for each selected plugin.
- The search fixture's fixed hostname (34f2850) needs no URL-parser fallback.
  No runtime hostname input exists; a future fixture URL rewrite must update
  its hostname field too. Current output is unchanged.
- 2f4f28f projected hit objects to hide registration IDs. Those IDs are now
  gone, and all private callers only read hit facts. Unexpected future internal
  object mutation may alter QA diagnostics; stable array snapshots remain.

Focused owner tests, canonical QA production/test typechecks, syntax lint,
formatting, suppression tests, zero runtime/madge cycles and independent
P0-P2 review cover the retained cut. No SDK/config/protocol/schema changes.

Local broad-proof gaps are recorded in .local/q04-ledger.md: SDK boundary
declaration preparation exceeded its existing 300000ms deadline before typed
lint ran; the repo-wide SQLite worker scanner was interrupted after more than
25 minutes on an overloaded host. Neither is attributed as inherited CI red.
The production, full-tree and script Knip scans also exceeded their existing
600-605s deadlines without a code verdict. Bundled exact-head CI must provide
the missing broad proof; no timeout/skip/retry policy was changed.

* refactor(android): simplify legacy native owners

Use platform accessibility nodes and canonical coroutine cancellation. Remove duplicate sheet validation and unreachable mascot clamps while retaining security, resource bounds and normal lifecycle behavior.

Fix DNS-SD display names by preserving advertised UTF-8 text and decoding instance names once. Both Android APK variants, 260 focused native test cases, lint, cycle checks and independent review validate the candidate.

* refactor: keep round-3 bundle within old-code scope

Drop all hunks in files touched on main within seven days, plus dependent Mantle, Anthropic cache, and QA assertion cuts. Preserve current main tests and baseline without allowances or shims. Keep Google SDK errors in the typed SDK owner and REST errors in its existing helper, without adding assertions. Retain one full mock ask-user roundtrip contract and the two distinct precedence cases.

* refactor(anthropic): preserve fresh hosts without map spread

* refactor(qa-lab): drop Gateway startup cleanup from bundle

Restore the q04 startup import closure and direct tests to main for Telegram menu E2E attribution. Keep Matrix/profile-evidence, provider, and Android changes unchanged.
steipete added a commit that referenced this pull request Oct 15, 2026
* refactor(packages): consolidate protocol and stream ownership

Use one tuple-preserving ordered literal-union constructor without changing
Gateway protocol JSON, exported shapes, or static inference. Share Anthropic
request, refusal, reducer, compaction and terminal ownership while preserving
the SDK/fetch adapters and their error profiles. Reuse the existing abort race.

Reuse prepared compaction details and table widths, trust typed internal file
metadata inputs, and leave the Agent loop as the sole message-snapshot owner.
Replace the primitive-only session-options deep clone with a shallow copy.
Remove write-only transport scratch indices and duplicate outer cleanup; reuse
prepared Markdown token projections. Route Completions context budgeting through
the shared calibrated CJK estimator, correcting underestimated rare/halfwidth
and supplementary input. Add request-budget regression cases.

Best-effort tradeoffs accepted:
- Malformed internal assistant/tool-name values violating AgentMessage can
  throw instead of being silently omitted. The guards came from extractions
  #85341/#123467, with no cited human malformed-message incident. External
  tool arguments and patch-result metadata remain validated.
- An impossible table column/width mismatch no longer gets a custom error.
  The removed throw came from strict-index ratchet #104577, not an actual-use
  report; columns and widths still come from the same ordered allocation.

No Phase E standalone session-memory backend, security authority, public
protocol/config/SDK contract, schema, dependency or durability change.

* test(plugins): make cancellation ownership fixture deterministic

Hold the Anthropic fixture's second pull on its existing cleanup gate so the
custom cancellation work is actually admitted before testing its ownership.
An upstream fetch abort may otherwise error the wrapper before cancel runs,
making the test demand settlement of work that was never accepted.

Keep every origin-context, drainage, lifetime and reuse assertion unchanged.
No production behavior, timeout, retry or skip changes.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…aw#172991)

* refactor(packages): consolidate protocol and stream ownership

Use one tuple-preserving ordered literal-union constructor without changing
Gateway protocol JSON, exported shapes, or static inference. Share Anthropic
request, refusal, reducer, compaction and terminal ownership while preserving
the SDK/fetch adapters and their error profiles. Reuse the existing abort race.

Reuse prepared compaction details and table widths, trust typed internal file
metadata inputs, and leave the Agent loop as the sole message-snapshot owner.
Replace the primitive-only session-options deep clone with a shallow copy.
Remove write-only transport scratch indices and duplicate outer cleanup; reuse
prepared Markdown token projections. Route Completions context budgeting through
the shared calibrated CJK estimator, correcting underestimated rare/halfwidth
and supplementary input. Add request-budget regression cases.

Best-effort tradeoffs accepted:
- Malformed internal assistant/tool-name values violating AgentMessage can
  throw instead of being silently omitted. The guards came from extractions
  openclaw#85341/openclaw#123467, with no cited human malformed-message incident. External
  tool arguments and patch-result metadata remain validated.
- An impossible table column/width mismatch no longer gets a custom error.
  The removed throw came from strict-index ratchet openclaw#104577, not an actual-use
  report; columns and widths still come from the same ordered allocation.

No Phase E standalone session-memory backend, security authority, public
protocol/config/SDK contract, schema, dependency or durability change.

* test(plugins): make cancellation ownership fixture deterministic

Hold the Anthropic fixture's second pull on its existing cleanup gate so the
custom cancellation work is actually admitted before testing its ownership.
An upstream fetch abort may otherwise error the wrapper before cancel runs,
making the test demand settlement of work that was never accepted.

Keep every origin-context, drainage, lifetime and reuse assertion unchanged.
No production behavior, timeout, retry or skip changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt noUncheckedIndexedAccess via a ratchet lane (phase 1: eight small packages)

1 participant