feat: add shared WebUI client state - #1864
Merged
Merged
Conversation
inureyes
added a commit
that referenced
this pull request
Sep 12, 2026
The WebUI client could compute replay cursors without an operations snapshot fence, dispatch runtime snapshots without their server sequence, and leave custom-fetch stream reads pending after logout when the fetch implementation ignored AbortSignal. This tightens runtime and operations snapshot fencing, requires real inference model ids with autoload=false for streaming inference, makes reader loops signal-aware, clears stale login state on server-instance changes, and replaces the large cursor-parse error with a small typed error for Clippy. Validation: pnpm typecheck/lint/unit, deterministic bundle verification, WebUI contract verification, targeted WebUI Rust tests, compatibility checks, and scoped Clippy pass locally. Refs #1834; Refs #1842; Refs #1864
inureyes
added a commit
that referenced
this pull request
Sep 12, 2026
The public WebUI state used lastUpdatedAt for both reducer transitions and successful server data freshness, so error, stale, heartbeat, and logout paths could look like fresh data updates. Add lastSuccessfulAt as a separate nullable timestamp that advances only when validated current-session data snapshots or data events are accepted, preserves the previous value across ordinary errors and gaps, and clears it on logout or server-instance replacement. Validation: pnpm typecheck/lint/unit, deterministic bundle verification, and WebUI contract verification pass locally. Refs #1834; Refs #1842; Refs #1864
inureyes
added a commit
that referenced
this pull request
Sep 12, 2026
Document the complete headless hook surface, same-origin API prefix and inference exceptions, acceptance versus readiness, and separate successful-data freshness from ordinary state updates. Add bilingual PR 1864 reports with independent review outcomes, 44 frontend tests, 33 contract fixtures and the root frozen-Rust workspace gate. Keep downstream browser/hardware acceptance and the unavailable GB10 CI waiver explicit. Refs #1842; Refs #1864; Refs #1834
Add the headless WebUI API client, canonical schema-backed runtime validation, fetch-based SSE parsing, and the shared React state provider that downstream Models, Chat, Activity and Settings pages must compose instead of private transport or polling layers. The state reducer uses per-resource sequence fences for catalog, operations, lifecycle and runtime snapshots, keeps bearer credentials memory-only, records unknown POST outcomes by idempotency key for reconciliation, and aborts in-flight work when authentication or model selection changes. Refs #1834; Closes #1842
Start the UI event stream only after authoritative bootstrap, catalog and operation snapshots are reconciled, validate the full operations envelope, pass the last event cursor, and keep unknown POST outcomes pending until matching operation evidence or an explicit expiration error. Revoke bearer state before parsing failed 401 bodies, keep abort controllers alive through response body consumption, fence delayed login results against logout, replace ambient Python fixture checks with JavaScript schema-bound fixture validation, and cover provider logout and deterministic HTTP-error races. Refs #1834; Closes #1842
Use paired server-instance and sequence replay cursors for WebUI SSE synchronization, add server-side cursor validation with retained-ring replay checks, and keep legacy Last-Event-ID as an opaque compatibility path. Tighten the shared frontend client around bounded HTTP bodies, redirect rejection, token redaction, paginated snapshots, selected-runtime refresh, reset resnapshot handling, and shared inference SSE transport for chat and responses. Refresh the canonical WebUI schema, generated DTOs, fixtures, docs, unit coverage, router tests, and deterministic asset manifest.
The WebUI client could compute replay cursors without an operations snapshot fence, dispatch runtime snapshots without their server sequence, and leave custom-fetch stream reads pending after logout when the fetch implementation ignored AbortSignal. This tightens runtime and operations snapshot fencing, requires real inference model ids with autoload=false for streaming inference, makes reader loops signal-aware, clears stale login state on server-instance changes, and replaces the large cursor-parse error with a small typed error for Clippy. Validation: pnpm typecheck/lint/unit, deterministic bundle verification, WebUI contract verification, targeted WebUI Rust tests, compatibility checks, and scoped Clippy pass locally. Refs #1834; Refs #1842; Refs #1864
The public WebUI state used lastUpdatedAt for both reducer transitions and successful server data freshness, so error, stale, heartbeat, and logout paths could look like fresh data updates. Add lastSuccessfulAt as a separate nullable timestamp that advances only when validated current-session data snapshots or data events are accepted, preserves the previous value across ordinary errors and gaps, and clears it on logout or server-instance replacement. Validation: pnpm typecheck/lint/unit, deterministic bundle verification, and WebUI contract verification pass locally. Refs #1834; Refs #1842; Refs #1864
Settings and download notifications do not update the shared data projection yet, so they must not advance successful-data freshness. Add typed regressions for older and duplicate notifications and rebuild the source manifest.
Document the complete headless hook surface, same-origin API prefix and inference exceptions, acceptance versus readiness, and separate successful-data freshness from ordinary state updates. Add bilingual PR 1864 reports with independent review outcomes, 44 frontend tests, 33 contract fixtures and the root frozen-Rust workspace gate. Keep downstream browser/hardware acceptance and the unavailable GB10 CI waiver explicit. Refs #1842; Refs #1864; Refs #1834
Preserve numeric event replay beside the merged catalog and security adapters, and exercise their complete fixture corpus in the typed client. Build reducer inputs from validated catalog examples, normalize independently captured mock sessions explicitly, and cover raw versus resolved architecture identity and required metadata bounds. Rebuild the deterministic source manifest.
inureyes
force-pushed
the
feature/issue-1842-typed-client
branch
from
September 12, 2026 15:47
00ece39 to
7497da9
Compare
Document raw versus resolved catalog metadata and refresh bilingual PR reports after integrating the security and catalog contracts. Preserve the distinction between historical pre-integration evidence and the combined 7497da9 gate. Record 45 frontend tests, 41 fixtures, 11,226 passing CI-faithful workspace tests, Clippy, Chromium shell and deterministic bundle checks. Include the initial parallel numerical failure, unchanged-binary serial diagnosis and feature-off warnings without claiming unavailable CUDA or actual Safari validation. Refs #1842; Refs #1864; Refs #1834
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
7497da98, based on merged catalog/security: CI-faithfulmake verify-testpassed 11,226 tests, zero failures, 361 ignored; workspace/all-target Clippy and 41 strict contract fixtures passed.Refs #1834; Closes #1842