Skip to content

Phase 1: Establish WestCurrent product foundation - #1

Merged
Seckcey merged 8 commits into
mainfrom
phase-1-westcurrent-foundation
Jul 12, 2026
Merged

Seckcey merged 8 commits into
mainfrom
phase-1-westcurrent-foundation

Conversation

@Seckcey

@Seckcey Seckcey commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Product foundation summary

WestCurrent by 8 West Ventures, LLC — Phase 1 establishes a vendor-neutral Android pool-control foundation with ScreenLogic + in-process simulator, honest command lifecycle, SafetyPolicy, and SiteSession as the sole production path.

Head commit: c4abb2de7648912282dca6b322cecaa86da1c4c6
Branch: phase-1-westcurrent-foundation → main
Do not merge until independent human review.

Architecture

UI → PoolViewModel (viewModelScope) → SiteSession → SafetyPolicy + CommandOrchestrator → PoolSystemAdapter (ScreenLogic / Simulator)

Phase 1.1–1.3 (summary)

Vendor-neutral domain, capabilities, SentUnverified lights, real reconnect, light targets, adapter-owned connection targets, unit-aware temperatures, no system-code persistence, CI, ViewModel lifecycle, production multi-second reconnect policy, explicit retry, credential redaction.

Phase 1.4: Teardown and Retry Race Correction

Non-blocking teardown

  • Removed runBlocking from SiteSession.close().
  • close() synchronously: marks closed, bumps connection generation, cancels poll + reconnect/retry, clears target/factory/unit/receipts, detaches adapter, publishes Disconnected.
  • Best-effort adapter.disconnect() via per-session AdapterCleanupScheduler (IO, 5s timeout) — cannot reinstall adapters.
  • Safe from ViewModel.onCleared() without main-thread network waits.

Connection-generation + owned reconnect/retry

  • Monotonic generation bumped on new-target connect, disconnect, and close.
  • Auto reconnect and explicit retryConnection() share one reconnectJob (single-flight, cancelable).
  • Install only if generation + target identity still match; otherwise dispose stale adapter and leave state alone.

Race tests

  • Retry then disconnect → Disconnected, no install
  • Retry A then connect B → B wins
  • Auto-reconnect then disconnect → no install
  • Close during connect/retry/hanging disconnect → non-blocking, no install
  • Valid same-target reconnect still preserves confirmed temperature unit

Local verification

.\gradlew.bat clean testDebugUnitTest assembleDebug
→ BUILD SUCCESSFUL

75 unit tests, 0 failures

Live hardware

No live pool hardware was controlled.

Commits after f5306bf

  • c4abb2d Phase 1.4: non-blocking close and generation-guarded reconnect/retry

Explicit non-merge

PR #1 remains open for independent review. Not merged by this task.

Seckcey added 8 commits July 12, 2026 01:00
…r-owned targets

Implement real adapter reconnection with in-memory target/factory retention and bounded non-overlapping attempts. Coordinate light commands by LightTargetId. Replace shared ConnectionTarget sealed hierarchy with AdapterConnectionTarget owned by adapters. Make Temperature unit-explicit with F/C safety ranges. Stop persisting system codes and passwords.
…docs

Remove remember-system-code UI. Display explicit F/C temperatures and session unit confirmation. Add Phase12MergeReadinessTest coverage for reconnect, light targets, connection ownership, units, and prefs. Add android-ci workflow and document Phase 1.2 corrections.
…credential redaction

Bind SiteSession to viewModelScope and close on ViewModel clear. Use ReconnectPolicy production multi-second backoff with explicit post-exhaustion retry. Preserve confirmed temperature unit across reconnect in session memory. Redact passwords from connection target toString. Strengthen reconnect and remote-persistence tests; add simulator walkthrough and Phase 1.3 docs.
Remove runBlocking from SiteSession.close. Synchronously invalidate session state and schedule bounded async adapter cleanup. Unify automatic reconnect and explicit retry under one job. Bump connection generation on disconnect/close/new target and refuse stale installs. Add Phase14 race tests and docs.
@Seckcey
Seckcey merged commit 8051dfc into main Jul 12, 2026
1 check passed
@Seckcey
Seckcey deleted the phase-1-westcurrent-foundation branch July 12, 2026 16:05
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.

1 participant