Skip to content

feat(client-state): add bounded host snapshot#5554

Draft
MADPANDA3D wants to merge 1 commit into
odysseus-dev:devfrom
MADPANDA3D:codex/upstream-client-state
Draft

feat(client-state): add bounded host snapshot#5554
MADPANDA3D wants to merge 1 commit into
odysseus-dev:devfrom
MADPANDA3D:codex/upstream-client-state

Conversation

@MADPANDA3D

Copy link
Copy Markdown

Summary

Adds a bounded, versioned client-state snapshot for in-tree consumers. Core-owned providers expose only logical Calendar and Document state: visible/minimized status, Calendar view/date, active document ID, and the foreground view.

The host owns fixed schemas, validates exact types/enums, caps snapshots at 1 KiB, drops unknown provider fields without invoking their getters, and fails unavailable providers closed. It does not serialize DOM, event content, document content, selectors, URLs, or arbitrary module state. No endpoint, Voice Orb UI, or external plugin compatibility promise is added.

Foreground resolution is global before request scoping, so omitting the real foreground never promotes a background view. Existing Calendar Agenda and minimized-state semantics are covered.

Target branch

  • This PR targets dev, not main.

Linked Issue

Part of #5549. Related to #4118 and discussion #4439.

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and pull requests; no existing bounded host snapshot duplicates this proposal.
  • This PR targets dev.
  • Only fixed Calendar and Document schemas are exposed.
  • Unknown slices, duplicate requests, invalid enums, contradictory state, oversized snapshots, and provider failures fail closed.
  • The new static module is included in the service-worker precache with a cache-version bump.

How to Test

  1. Run: python -m pytest -q tests/test_client_state_js.py
  2. Open Calendar in month, week, year, and Agenda views; inspect getClientStateSnapshot().
  3. Open and minimize Calendar and a document; confirm open means visibly open and minimized is reported separately.
  4. Request only the background slice; confirm active_view is chat rather than a promoted background view.

Local validation passed 4 focused tests, 12 neighboring Calendar/document tests, and the full JavaScript lane at 333 passed with 4,294 deselected. Node syntax and diff checks passed. Real-browser E2E verified omitted-foreground scoping, actual Agenda, minimized Calendar/document state with an opaque document ID, and zero console errors.

Visual / UI changes

No visible component or styling is added. Existing Calendar and Document modules only register logical state providers and foreground markers.

  • Screenshot or short clip attached — no visible pixels change.
  • Style match — no new styling or component values.
  • No new component pattern — this is a bounded host-state seam only.
  • I am not an LLM agent submitting a bulk PR — this contribution is coding-agent assisted, disclosed in Proposal: bounded in-tree host seams for voice and UI composition #5549, and intentionally split into an independent seam.

@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant