Skip to content

feat(tooling): enforce indexed access checks in extension tests - #105343

Merged
steipete merged 1 commit into
mainfrom
codex/nuia-extensions-test
Jul 12, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/nuia-extensions-test

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Follow-up to #105239 and #104600.

What Problem This Solves

The shared test TypeScript config still opts out of noUncheckedIndexedAccess, leaving the extension test lane's indexed-access assumptions outside the production safety baseline. The July inventory counted 1,126 diagnostics; current main had drifted to 1,136.

Why This Change Was Made

  • Enables noUncheckedIndexedAccess explicitly in test/tsconfig/tsconfig.extensions.test.json, overriding the temporary shared test opt-out.
  • Burns the lane from 1,136 diagnostics to zero using iteration where practical, boundary guards where absence is real, and contextual expectDefined checks for genuine fixture invariants.
  • Preserves optional-chain spreads, tail lookaheads, first-time paths, and other legitimate absence behavior.
  • Changes test code and test configuration only; no product runtime or dependencies change.

User Impact

No runtime impact. Future extension tests now fail typechecking when they assume an indexed value exists without proving that invariant.

Evidence

  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental false --pretty false — clean on Blacksmith Testbox; 1,136 diagnostics to zero.
  • pnpm check:changed — clean on Blacksmith Testbox, including extension production/test typechecks, formatting, extension and script lint, import cycles, and policy guards.
  • pnpm test:extensions — broad Testbox attempt exercised the extension matrix; it exposed 9 failures in pre-existing memory export/index test cases outside the changed hunks. The changed QMD query-argument assertions passed, and the repository-native exact-head gates remain the merge authority.
  • git diff --check and targeted oxfmt — pass.
  • Fresh structured autoreview — four safety-bounded bundles, all clean with no accepted/actionable findings.

Testbox lease tbx_01kxayd6558vyham2c3sxe67jj; backing run: https://github.com/openclaw/openclaw/actions/runs/29189409636

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat 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: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb channel: feishu Channel integration: feishu channel: twitch Channel integration: twitch extensions: device-pair extensions: phone-control extensions: acpx extensions: anthropic extensions: openai extensions: byteplus extensions: huggingface extensions: venice extensions: deepseek labels Jul 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for f6ac34ddef8be9b58560dbbaf66fbfc71fcc239d:

  • Native scripts/pr review artifacts validate with zero findings and READY FOR /prepare-pr.
  • Fresh structured autoreview covered the full diff in four bounded groups: no accepted/actionable findings.
  • Strict lane compiler: node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental false --pretty false — pass on Testbox.
  • Changed-surface gate: corepack pnpm check:changed through the trusted Testbox wrapper — pass.
  • Exact-head hosted CI: run 29191265030 — pass.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 105343 — pass; prepared SHA matches the PR head.

Supplemental pnpm test:extensions exercise found nine memory-core failures outside the indexed-access fixes; the required exact-head CI/Testbox gates are green. No production behavior, package surface, or changelog entry is involved.

@steipete
steipete merged commit 81941f2 into main Jul 12, 2026
470 of 486 checks passed
@steipete
steipete deleted the codex/nuia-extensions-test branch July 12, 2026 11:48
@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 13, 2026
masatohoshino added a commit to masatohoshino/openclaw that referenced this pull request Jul 29, 2026
Rebasing onto main picked up openclaw#105343's stricter indexed-access checks, which
surfaced two unsound spots in the ordered-receipt path: pairing a sent id with
messages[index] typed the message as possibly undefined, and reading the primary
id off parts[0] assumed a non-empty list.

Pair via a single-element slice so the kind resolver keeps its array contract,
and destructure the primary with an explicit contract-violation throw rather
than fabricating a placeholder id. The LINE SDK contract requires a non-empty
sentMessages response, so an empty list on a resolved send is a broken
invariant, not a state to paper over.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat 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: qqbot channel: signal Channel integration: signal channel: slack Channel integration: slack channel: sms Channel integration: sms channel: synology-chat channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo extensions: acpx extensions: amazon-bedrock extensions: anthropic extensions: byteplus extensions: chutes extensions: clawrouter Extension: clawrouter extensions: codex extensions: copilot extensions: deepseek extensions: device-pair extensions: diagnostics-prometheus extensions: diffs extensions: firecrawl extensions: github-copilot extensions: google extensions: huggingface extensions: inworld Extension: inworld extensions: llama-cpp extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: memory-wiki extensions: oc-path extensions: ollama extensions: openai extensions: openshell extensions: parallel extensions: phone-control extensions: qa-lab extensions: thread-ownership extensions: venice maintainer Maintainer-authored PR plugin: file-transfer plugin: logbook Logbook automatic work journal plugin plugin: workboard plugin: workspaces Agent-composable Workspaces plugin size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant