Skip to content

test(ui): extend app smoke test to PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost (#2496)#2504

Merged
alexey-pelykh merged 1 commit intomainfrom
test/2496-host-interface-coverage
Apr 23, 2026
Merged

test(ui): extend app smoke test to PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost (#2496)#2504
alexey-pelykh merged 1 commit intomainfrom
test/2496-host-interface-coverage

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Extends the host-interface smoke test added in #2495 to cover the five
additional interfaces flagged in #2496 — PollingHost, ChatHost, ScrollHost,
SettingsHost, and CompactionHost. No production code changes.

Audit result

All required fields of every audited interface are already present on
RemoteClawApp.
The class is structurally compliant — no field
initializers needed restoration.

Verification:

  • ./node_modules/.bin/tsgo -p tsconfig.json exits 0 with zero output on
    the current tree.
  • Sanity check: removing @state() chatMessage = ""; from app.ts:140
    triggered 30+ tsgo errors including
    Property 'chatMessage' is missing in type 'RemoteClawApp' but required in type 'ChatHost'
    across app-chat.ts and app-gateway.node.test.ts — confirming the
    structural checks enforced after refactor(ui): remove as unknown as Parameters<typeof X>[0] casts — restore structural type-checking #2494 are active.
  • Second sanity check: removing nodesPollInterval: number | null = null;
    from app.ts:312 was caught by the new PollingHost + SettingsHost
    smoke assertions with clear per-interface labels.

This matches the prediction in #2496's own note:

If Issue B is merged first, this issue may auto-close (the audit
becomes "fix the new tsc errors").

#2494 (Issue B) merged first. No tsc errors surfaced. The remaining
deliverable is AC #4 — extending the smoke test for defense-in-depth
against fixture-based regressions (the same motivation as #2495).

Findings per interface

Interface Required fields Missing on class Severity
PollingHost 4 0
ChatHost 11 0
ScrollHost 11 (incl. HTMLElement inherited) 0
SettingsHost PollingHost ∪ ScrollHost ∪ ChatHost + 8 own required 0
CompactionHost ToolStreamHost (all 4 own additions are ?: optional) 0

Optional fields excluded from assertions per issue guidance
(cosmetic-severity deferred): password, agentsList, agentsSelectedId,
agentsPanel, pendingGatewayUrl, pendingGatewayToken on SettingsHost;
compactionStatus, compactionClearTimer, fallbackStatus,
fallbackClearTimer on CompactionHost.

Changes

Only ui/src/ui/app.smoke.test.ts:

  • Header comment extended to reference audit(ui): missing field initializers across PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost on RemoteClawApp #2496's scope expansion.
  • Five new *_HOST_FIELDS constants: POLLING_HOST_FIELDS,
    CHAT_HOST_FIELDS, SCROLL_HOST_FIELDS, SETTINGS_HOST_FIELDS,
    COMPACTION_HOST_REQUIRED_FIELDS.
  • SETTINGS_HOST_FIELDS composed via spread over Polling/Scroll/Chat +
    own required members to mirror the interface's & composition.
  • COMPACTION_HOST_REQUIRED_FIELDS aliases TOOL_STREAM_HOST_FIELDS (all
    CompactionHost additions are optional); the separate test case documents
    the explicit audit and guards against future required additions.
  • Five new it(...) cases following the existing pattern.

Test count: 3 → 8 passing.

CI gates (local verification)

  • pnpm check → ✅ (format, tsgo, lint, script lints all clean)
  • pnpm test → ✅ 7014 pass / 3 skip across 800 files; UI suite 288 pass
    across 17 files
  • pnpm canvas:a2ui:bundle → ✅ 457 kB chunk generated

Test plan

Closes #2496.

🤖 Generated with Claude Code

…ScrollHost/CompactionHost — defense-in-depth against sync regressions (#2496)

Audit verdict: all required fields of the five additional host interfaces
are already present on RemoteClawApp — the class is structurally compliant.
Verified by a clean `tsgo` run plus a sanity check (removing chatMessage
triggered 30+ tsc errors via app-chat.ts / app-gateway.node.test.ts, and
removing nodesPollInterval was caught by the new PollingHost + SettingsHost
smoke assertions), confirming the structural checks enforced after #2494
removed the `as unknown as Parameters<typeof X>[0]` casts.

No production changes needed. The smoke test in #2495 is extended with five
additional cases mirroring the existing pattern:

- PollingHost (4 required fields)
- ChatHost (11 required fields)
- ScrollHost (11 required fields, incl. inherited HTMLElement members)
- SettingsHost (composed via spread over Polling/Scroll/Chat + 8 own)
- CompactionHost (all own additions optional — reuses ToolStreamHost list)

Optional fields (password, agentsList, agentsSelectedId, agentsPanel,
pendingGatewayUrl, pendingGatewayToken on SettingsHost; compactionStatus,
compactionClearTimer, fallbackStatus, fallbackClearTimer on CompactionHost)
are correctly excluded per the issue's cosmetic-deferral guidance.

Runtime coverage is redundant with tsc enforcement in the happy path, but
catches fixture-based regressions where synthetic plain-object hosts satisfy
the interface while the production class diverges — the same failure mode
#2493 exposed and #2495 defended against for the first three interfaces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 23, 2026 20:27
@alexey-pelykh alexey-pelykh merged commit 21eda60 into main Apr 23, 2026
15 checks passed
@alexey-pelykh alexey-pelykh deleted the test/2496-host-interface-coverage branch April 23, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audit(ui): missing field initializers across PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost on RemoteClawApp

1 participant