Skip to content

feat(controller): live rootfs sizes via layered Clean Architecture pilot#6

Merged
luisguzman-adfa merged 1 commit into
mainfrom
feat/k1-extrakeys-in-app
Jun 17, 2026
Merged

feat(controller): live rootfs sizes via layered Clean Architecture pilot#6
luisguzman-adfa merged 1 commit into
mainfrom
feat/k1-extrakeys-in-app

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Replace the hardcoded OS rootfs sizes in InstallationPlanner with sizes fetched live from the Deploy server (latest__.meta4), with a per-ABI hardcoded byte fallback for offline/error. Built as the reference Clean Architecture slice across domain/data/presentation under org.iiab.controller.rootfs, plus a shared util/ByteFormatter.

  • domain: Rootfs, RootfsTier, RootfsAbi, RootfsRepository (port) and GetRootfsSizeUseCase (validation + fallback rule). Pure JVM, no Android/net.
  • data: RootfsRemoteDataSource (parses meta4 , in-memory cache), RootfsCatalog (URL convention + fallback bytes + ABI detection), RootfsRepositoryImpl (DTO -> entity, live-then-fallback).
  • presentation: RootfsViewModel + RootfsUiState + RootfsViewModelFactory.
  • seam: InstallationPlanner.resolveOsSizeGb() routes the OS size through the use case instead of the OS_*_GB constants (called on its existing worker).
  • build.gradle: add androidx.lifecycle viewmodel/livedata (Java, no Kotlin).
  • .gitattributes: normalize text files to LF.
  • tests: GetRootfsSizeUseCaseTest + ByteFormatterTest (8 JVM tests, green).

Replace the hardcoded OS rootfs sizes in InstallationPlanner with sizes
fetched live from the Deploy server (latest_<tier>_<abi>.meta4), with a
per-ABI hardcoded byte fallback for offline/error. Built as the reference
Clean Architecture slice across domain/data/presentation under
org.iiab.controller.rootfs, plus a shared util/ByteFormatter.

- domain: Rootfs, RootfsTier, RootfsAbi, RootfsRepository (port) and
  GetRootfsSizeUseCase (validation + fallback rule). Pure JVM, no Android/net.
- data: RootfsRemoteDataSource (parses meta4 <size>, in-memory cache),
  RootfsCatalog (URL convention + fallback bytes + ABI detection),
  RootfsRepositoryImpl (DTO -> entity, live-then-fallback).
- presentation: RootfsViewModel + RootfsUiState + RootfsViewModelFactory.
- seam: InstallationPlanner.resolveOsSizeGb() routes the OS size through the
  use case instead of the OS_*_GB constants (called on its existing worker).
- build.gradle: add androidx.lifecycle viewmodel/livedata (Java, no Kotlin).
- docs: CLAUDE.md layering guardrails + ROOTFS_SIZE_PILOT_ANALYSIS.md.
- .gitattributes: normalize text files to LF.
- tests: GetRootfsSizeUseCaseTest + ByteFormatterTest (8 JVM tests, green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@luisguzman-adfa luisguzman-adfa merged commit da89959 into main Jun 17, 2026
2 checks passed
@luisguzman-adfa luisguzman-adfa deleted the feat/k1-extrakeys-in-app branch June 17, 2026 22:13
luisguzman-adfa added a commit to luisguzman-adfa/iiab-android that referenced this pull request Jun 18, 2026
Continue the rootfs Clean Architecture slice (appdevforall#6). The install storage
projection now resolves the OS size through the presentation layer, and the
install screen handles the offline state. The radial gauge is left untouched.

- DeployFragment observes RootfsViewModel and feeds the resolved OS size (live,
  with offline fallback) into the projection instead of going through
  InstallationPlanner.resolveOsSizeGb().
- Offline: disable the install button ("No connection") with a snackbar on tap,
  show an "Estimated sizes (offline)" caption when the size is a fallback, and
  skip the live fetch via a new attemptLive flag on GetRootfsSizeUseCase /
  RootfsViewModel (avoids the ~6s timeout). Addresses the connectivity-gating
  tech-debt item.
- Add strings (en + es), a unit test (skipsLiveWhenOffline), and update
  CLAUDE.md (design map + new "Working in parallel" section) and
  controller/docs/TECH_DEBT_PLAN.md.
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