feat: land tested IPC error hardening, auth hydration retry, and sidecar health monitoring - #16
Merged
Merged
Conversation
…lpers Add isSuccess/isFailure type guards, unwrapSuccessData/ unwrapFailureError accessors, and schema-based validateResponseEnvelope for validating outbound IPC payloads at the boundary, with unit coverage for classification, narrowing, unwrapping, valid/invalid/no-schema paths.
… hydration ensureInitialized now retries retryable bridge failures and thrown bridge errors up to three attempts with exponential backoff while preserving existing semantics: non-retryable typed failures hydrate immediately and thrown errors still reject after the final attempt. Adds initializationError signal for UI feedback, reset() for recovery/testing, and an AUTH_BRIDGE_PROVIDER injection token so the desktop bridge is injectable. Covered by unit tests using fake timers.
Introduce PythonSidecarHealthMonitor decoupled from PythonSidecar via structural probe/stop typing with an injected logger. Consecutive failures beyond a threshold schedule a cooldown-guarded restart; recovery resets the streak; dispose is idempotent. The monitor runs in non-packaged builds only and is disposed on window-all-closed. Covered by unit tests using fake timers.
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
isSuccess,isFailure), unwrap helpers, and schema-basedvalidateResponseEnvelopeto shared contracts with unit coverage.initializationErrorsignal,reset(), and an injectableAUTH_BRIDGE_PROVIDERtoken using Angularinject()style.PythonSidecarHealthMonitorin desktop-main: structural probe/stop decoupling fromPythonSidecar, cooldown-guarded automatic restart after consecutive health-check failures, dev-build-only enablement, idempotent dispose wired intowindow-all-closed.Change Groups
error-envelope.spec.tscoverage.AuthSessionStateServiceretry/backoff/error-surfacing + TestBed-based spec with fake timers.python-sidecar-health.tsmonitor + spec; minimalmain.tswiring (module-scoped instance, non-packaged start, dispose on close).error-wrappers.ts(did not compile; duplicated validated-handler factory responsibilities from BL-018/BL-032) — dropped.runtime-migration.ts(dead code, zero imports) — dropped by decision.Validation
pnpm nx run contracts:testpnpm nx run renderer:testpnpm nx run desktop-main:testpnpm lintpnpm typecheckpnpm unit-testpnpm integration-testpnpm runtime:smokeprettier --check ./nx format:checkEngineering Checklist
Security (Required For Sensitive Changes)
Security Notes
retryableflag from typed error envelopes; fail-closed behavior preserved.