Skip to content

feat!: rewrite getter as package-centric CLI core#54

Open
xz-dev wants to merge 27 commits into
masterfrom
rewrite/package-cli-spine
Open

feat!: rewrite getter as package-centric CLI core#54
xz-dev wants to merge 27 commits into
masterfrom
rewrite/package-cli-spine

Conversation

@xz-dev

@xz-dev xz-dev commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Rewrite getter as a reusable package-centric Rust core/CLI spine for the UpgradeAll Flutter app + Rust getter + Lua package repository architecture.
  • Add readable package IDs, repository layout loading, Lua JSON-like package evaluation/validation, SQLite main/cache storage, legacy Room/bridge import, sanitized migration report listing, repository overlay resolution, update selection helpers, and cache/version-baseline support.
  • Add ADR-0010 pin_version storage/update semantics: pin_version is an effective local comparison baseline, while legacy ignored_version / Room ignore_version_number / mark_version_number remain only at import/compatibility boundaries.
  • Add ADR-0011 in-memory runtime/task/action support: GetterRuntime, single-use opaque action_id, sealed action plans, bound package-version Lua object, mock download/install phases, user-result, package lock, task controls, remove/clean, and RuntimeNotification snapshots.
  • Expose shared JSON operation seams for legacy Room, installed autogen, read-model snapshots, offline/registered-package update action issuance, and runtime task controls without reintroducing persisted task state.
  • Add runtime script --script <script.json> as the single-process CLI debug harness for ADR-0011 runtime coverage, and move the old persisted fake downloader commands out of the public task ... namespace into development-only debug fake-task ....
  • Wrap static Lua updates candidates behind getter-providers::StaticPackageUpdatesProvider as a mock-provider boundary; live provider/network execution remains deferred.
  • Keep require("lib.xxx") constrained to repository lib/ modules without exposing repository root/current-directory modules.
  • Split feature flags so Android JNI/API proxy consumers can depend on getter without pulling unwanted Lua/domain dependencies when not requested.

Architecture notes

  • This branch intentionally moves toward the app-centric Lua package repository model consumed by DUpdateSystem/UpgradeAll.
  • The old hub-app model is not restored; compatibility commands remain compatibility-only.
  • Product task state is process-memory runtime state only per ADR-0011: no task SQLite persistence, no daemon, and no cross-invocation CLI task memory.
  • Public product task submission uses getter-issued opaque action_id; Flutter/native callers must not assemble action payloads.
  • Registered-package action issuance currently uses static Lua updates through a mock-provider boundary. Real live provider/downloader/installer semantics are deferred to later ADRs.
  • Migration reports returned by legacy report-list are sanitized summaries, not raw filesystem/report internals.

Validation

Recent local validation on the current branch head 60a6515 feat(operations): expose read model operations includes:

  • cargo fmt
  • cargo test -p getter-cli --lib
  • cargo test -p getter-cli --test bdd_cli
  • cargo test -p getter-core update
  • cargo test -p getter-storage
  • cargo test -p getter-providers
  • cargo test -p getter-operations --features lua
  • cargo test -p getter-operations --features lua runtime
  • cargo test -p getter-operations --features lua read_model
  • cargo test --manifest-path ../api_proxy/Cargo.toml --lib runtime_dispatcher
  • cargo test --manifest-path ../api_proxy/Cargo.toml --lib read_operation
  • cargo check -p getter-core --no-default-features
  • cargo check -p getter-operations
  • cargo check -p getter-operations --features lua
  • Android/API-proxy checks through the UpgradeAll superproject just verify-workspace-skeleton with JAVA_HOME=/opt/android-studio/jbr and ANDROID_NDK_HOME=/home/xz/.local/share/Google/Android/Sdk/ndk/29.0.14206865.

Consumed by

Deferred work / non-goals

  • Live HTTP/provider execution as product default.
  • Real downloader/background worker/restart/resume behavior.
  • Android installer/SAF/FileProvider/Shizuku/root/system-notification semantics.
  • Durable task event log or cross-process runtime task recovery.

Notes

  • Commits on this branch are intentionally unsigned for the current stage.

xz-dev added 6 commits June 22, 2026 08:58
Replace the old hub-app centered implementation with the reusable rewrite spine for the UpgradeAll architecture.

Add split core/storage/CLI crates, Lua repository evaluation, SQLite main/cache storage, repository overlay behavior, and legacy JSON bridge-bundle import coverage.
Add tokenized version comparison and selection policy that skips ignored versions while choosing the highest newer candidate.
Use sort_by_key for repository package ordering and elide needless lifetimes in highest_priority.
Preserve the documented require("lib.xxx") contract by extending the Lua package path while keeping unprefixed lib_dir lookups for compatibility.
Support the documented require("lib.*") contract with a constrained searcher instead of exposing the repository root through package.path.
Do not retain Lua's default package.path for package evaluation. Keep repository lib loading explicit and add coverage for root/template leakage when cwd is the repository root.
xz-dev added 21 commits June 22, 2026 11:26
Make getter domain crates an optional feature so the Android api_proxy facade can build without vendored Lua on armeabi-v7a.
Add a legacy report-list command so app and test adapters can consume sanitized migration reports through the getter JSON envelope instead of reading the data directory layout directly.
Do not expose getter data-directory report paths in legacy report-list output; callers only need the sanitized report fields.
Expose repo validate through the getter JSON envelope with structured getter-owned diagnostics for repository layout, Lua runtime, schema, and domain errors. Add BDD coverage and cache-key hashing for repository changes.
Populate the diagnostic location field for schema errors when getter can infer the failing field from validation messages.
Remove process/filesystem-sensitive Lua globals during package evaluation and assert the repo validator exposes full diagnostic shape for schema errors.
@xz-dev xz-dev force-pushed the rewrite/package-cli-spine branch from 4be8543 to 60a6515 Compare June 25, 2026 10:11
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