Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6461120
docs: add rewrite architecture records
xz-dev Jun 22, 2026
9527287
chore: add rewrite agent guardrails
xz-dev Jun 22, 2026
ae0d72c
feat(app): add Flutter shell scaffold
xz-dev Jun 22, 2026
4756f7c
feat(getter): wire package-centric getter submodule
xz-dev Jun 22, 2026
a5730a9
ci: add rewrite validation workflow
xz-dev Jun 22, 2026
59c1a0d
fix(getter): keep Android proxy off Lua deps
xz-dev Jun 22, 2026
3201d92
fix(app): use Flutter-compatible Gradle wrapper
xz-dev Jun 22, 2026
35e6c3d
ci: restrict Telegram notifications to master pushes
xz-dev Jun 22, 2026
80e1eb6
fix(app): use Flutter-compatible AGP
xz-dev Jun 22, 2026
384aee6
docs: add rewrite next-step audit plan
xz-dev Jun 22, 2026
a1c43f4
fix(app): use Flutter-compatible Kotlin plugin
xz-dev Jun 22, 2026
c6838b5
docs: update rewrite next-step completion status
xz-dev Jun 22, 2026
76f771a
feat(app): add getter bridge contract
xz-dev Jun 22, 2026
47f5811
feat(getter): add offline repo validation
xz-dev Jun 22, 2026
0976844
feat(getter): import legacy Room databases
xz-dev Jun 22, 2026
81a5dec
feat(getter): add installed app autogen
xz-dev Jun 22, 2026
8f3ca13
feat(getter): add offline update check
xz-dev Jun 22, 2026
9bb18f2
feat(getter): add offline task lifecycle
xz-dev Jun 23, 2026
1ba7614
feat(app): render getter task DTOs
xz-dev Jun 23, 2026
aed83cb
ci(app): publish Flutter APK artifacts
xz-dev Jun 23, 2026
2e22767
feat(app): add legacy Room migration adapter
xz-dev Jun 23, 2026
39af4c7
feat(app): add Android platform adapter spine
xz-dev Jun 23, 2026
3a5a602
feat(app): add Android installed inventory provider
xz-dev Jun 23, 2026
dd94154
feat(app): bridge installed autogen to Flutter
xz-dev Jun 23, 2026
8a6ac21
feat(app): bridge legacy room import
xz-dev Jun 24, 2026
044ca72
ci: set Android ar for cargo checks
xz-dev Jun 24, 2026
65df6ab
test(app): cover legacy room preparation
xz-dev Jun 24, 2026
c0f6752
test(app): validate native bridge on device
xz-dev Jun 24, 2026
d392b5c
docs(architecture): accept runtime task ADRs
xz-dev Jun 25, 2026
dba34ec
feat(app): bridge runtime task operations
xz-dev Jun 25, 2026
108625a
feat(app): stream runtime notifications
xz-dev Jun 25, 2026
2b98939
docs(todo): update runtime bridge progress
xz-dev Jun 25, 2026
ced8576
feat(app): issue runtime actions from update checks
xz-dev Jun 25, 2026
5061d20
docs(todo): note offline action issuance
xz-dev Jun 25, 2026
71c71c9
docs(lua): document static update candidates
xz-dev Jun 25, 2026
75b9f65
feat(app): issue actions from registered packages
xz-dev Jun 25, 2026
2aad93f
docs(todo): note registered package action issuance
xz-dev Jun 25, 2026
7ebf9be
feat(app): adopt pin version DTOs
xz-dev Jun 25, 2026
c1f7126
feat(app): add typed runtime task APIs
xz-dev Jun 25, 2026
b2c03b7
chore(app): point CLI debug tasks at runtime script
xz-dev Jun 25, 2026
3897038
refactor(app): drop fake task DTOs from product adapter
xz-dev Jun 25, 2026
dd9115c
docs(lua): describe static mock provider boundary
xz-dev Jun 25, 2026
1530a42
refactor(app): drop CLI fake task adapter APIs
xz-dev Jun 25, 2026
7bcaa0b
ci: install multilib for Android LuaJIT builds
xz-dev Jun 25, 2026
4e6274a
chore(app): update Flutter toolchain baseline
xz-dev Jun 25, 2026
25af79c
feat(app): load snapshots from native getter read model
xz-dev Jun 25, 2026
1a5d822
feat(app): submit update checks to runtime
xz-dev Jun 25, 2026
239f98f
docs(architecture): define provider autogen repository model
xz-dev Jun 26, 2026
4d65323
feat(app): use ADR-0012 autogen repository defaults
xz-dev Jun 26, 2026
03cb206
feat(getter): use package directory discovery
xz-dev Jun 26, 2026
4dea731
feat(app): consume package-directory autogen previews
xz-dev Jun 26, 2026
346636f
feat(getter): evaluate package directories
xz-dev Jun 26, 2026
aa3fdbb
fix(getter): update clippy-clean gitlink
xz-dev Jun 26, 2026
a8739cc
feat(getter): expose package-local file reads
xz-dev Jun 26, 2026
1ce7701
fix(getter): hash package-local file inputs
xz-dev Jun 26, 2026
175ae4c
feat(getter): add provider cache primitives
xz-dev Jun 26, 2026
e0673f2
feat(getter): add F-Droid provider fixtures
xz-dev Jun 26, 2026
1a13cbd
feat(getter): cache F-Droid catalog fixtures
xz-dev Jun 26, 2026
728cff6
feat(getter): add F-Droid autogen CLI slice
xz-dev Jun 27, 2026
dddce32
feat(getter): match F-Droid installed inventory
xz-dev Jun 27, 2026
b35b7c4
feat(getter): add GitHub release fixtures
xz-dev Jun 27, 2026
416075e
refactor(getter): remove flat Lua repository layout
xz-dev Jun 27, 2026
80df257
feat(app): expose F-Droid autogen bridge
xz-dev Jun 27, 2026
eb1719d
feat(getter): add GitHub latest commit fixtures
xz-dev Jun 27, 2026
be6f4b3
test(getter): cover F-Droid luaclass shape
xz-dev Jun 27, 2026
526e5d4
test(getter): cover GitHub luaclass shape
xz-dev Jun 27, 2026
cb74bba
feat(getter): add Lua host binding seam
xz-dev Jun 27, 2026
2f6585e
feat(getter): add dev Lua provider host eval
xz-dev Jun 27, 2026
345ef45
feat(getter): add F-Droid dev Lua provider host eval
xz-dev Jun 27, 2026
4e06159
feat(getter): add builtin luaclass fallback
xz-dev Jun 27, 2026
b8e929a
feat(getter): add Lua HTTP host seam
xz-dev Jun 27, 2026
64e2fb4
feat(getter): add dev provider luaclass modules
xz-dev Jun 27, 2026
dd1c259
feat(getter): add Lua HTTP policy harness
xz-dev Jun 27, 2026
8942c7f
feat(getter): add runtime hook harness
xz-dev Jun 27, 2026
19f2fd9
docs(architecture): design provider host API v1
xz-dev Jun 28, 2026
016f977
feat(getter): add stable provider host harness
xz-dev Jun 28, 2026
561d0e7
feat(getter): store provider response provenance
xz-dev Jun 28, 2026
b20fb0a
feat(getter): promote standard provider luaclasses
xz-dev Jun 28, 2026
c86c894
fix(getter): validate provider endpoint ids
xz-dev Jun 28, 2026
9e2be1e
test(getter): lock fdroid generated script boundary
xz-dev Jun 28, 2026
3b70b92
docs(plan): defer fdroid generated provider adoption
xz-dev Jun 28, 2026
0bb0c77
test(getter): cover configured provider endpoints
xz-dev Jun 28, 2026
236794e
feat(getter): use provider-backed update checks
xz-dev Jun 28, 2026
e1993f2
feat(getter): use F-Droid provider module autogen output
xz-dev Jun 28, 2026
67e99a8
feat(app): add installed F-Droid autogen flow
xz-dev Jun 29, 2026
1f7773b
feat(app): refresh F-Droid catalog cache
xz-dev Jun 29, 2026
4fbb6ca
feat(getter): add GitHub standard module runtime slice
xz-dev Jul 2, 2026
a1cdee6
feat(getter): add GitHub autogen product seam
xz-dev Jul 2, 2026
31ab0f9
feat(getter): add GitHub releases live transport slice
xz-dev Jul 2, 2026
5a380f6
feat(app): add GitHub autogen product bridge
xz-dev Jul 2, 2026
1b49340
feat(app): run getter-owned download bytes
xz-dev Jul 2, 2026
ea26f3e
feat(app): load getter startup snapshot
xz-dev Jul 14, 2026
c1f79c1
docs(cli): document app inspect and check
xz-dev Jul 14, 2026
171fb8e
docs(architecture): define artifact staging and installers
xz-dev Jul 16, 2026
0cd8a4b
feat(app): guide fresh package setup
xz-dev Jul 17, 2026
2369bcc
feat(app): bridge Android APK install preparation
xz-dev Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(getter): use provider-backed update checks
  • Loading branch information
xz-dev committed Jun 28, 2026
commit 236794ed58f981add0fe245473519761ce5fc04a
2 changes: 1 addition & 1 deletion CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ A getter-owned notification boundary used by native/Flutter UI to learn that run

### Provider host API

A getter-owned API exposed to package Lua for requesting provider/source data. Lua packages should call getter host APIs rather than using any Lua-native network library or Flutter/Kotlin HTTP path. Getter-shipped standard provider modules use provider-specific host functions under `getter.provider.*`, such as `getter.provider.fdroid.update_candidates(...)` and `getter.provider.github.release_candidates(...)`, so Rust owns provider parsing, cache consistency, diagnostics, and candidate normalization. Generic/custom HTTP remains exposed as a getter-managed host function such as `http_get(url, { headers = ..., cache = true|false })`; `cache` defaults to `false`, and Lua actively opts a generic request into HTTP/source caching with `cache = true`. Getter owns execution, cache key construction, persistence, revalidation, stale diagnostics, permissions, secret redaction, and output validation. For package scripts without `allow_free_network`, provider host calls must not bypass package `Manifest`: refreshed source response bodies must match Manifest SHA-512 entries, and parsed provider cache hits are usable only when their provider cache provenance records source response digest(s) and a compatible provenance schema proving Manifest compatibility. Getter-shipped provider modules such as `luaclass.fdroid_android` and `luaclass.github_android_apk` are built-in fallback modules over this host API, not independent provider implementations. The provider executor behind the host API can be fake during early runtime development and live later.
A getter-owned API exposed to package Lua for requesting provider/source data. Lua packages should call getter host APIs rather than using any Lua-native network library or Flutter/Kotlin HTTP path. Getter-shipped standard provider modules use provider-specific host functions under `getter.provider.*`, such as `getter.provider.fdroid.update_candidates(...)` and `getter.provider.github.release_candidates(...)`, so Rust owns provider parsing, cache consistency, diagnostics, and candidate normalization. Generic/custom HTTP remains exposed as a getter-managed host function such as `http_get(url, { headers = ..., cache = true|false })`; `cache` defaults to `false`, and Lua actively opts a generic request into HTTP/source caching with `cache = true`. Getter owns execution, cache key construction, persistence, revalidation, stale diagnostics, permissions, secret redaction, and output validation. For package scripts without `allow_free_network`, provider host calls must not bypass package `Manifest`: refreshed source response bodies must match Manifest SHA-512 entries, and parsed provider cache hits are usable only when their provider cache provenance records source response digest(s) and a compatible provenance schema proving Manifest compatibility. Getter-shipped provider modules such as `luaclass.fdroid_android` and `luaclass.github_android_apk` are built-in fallback modules over this host API, not independent provider implementations. Plain read-model package evaluation does not install this host API, but the product runtime update-check operation does: `update_check_package_issue_action` installs the stable provider host and runtime hooks, evaluates package Lua, then compares normalized candidates and issues getter-owned opaque actions. The bridge request remains package/update oriented (`package_id`, optional `repository_id`, `installed_version`, and `pin_version`); provider fixture bodies, cache mode, endpoint URLs, and live transport controls are not Flutter/native payload fields. Until live provider transport is accepted and implemented, runtime update-check provider calls use existing provider cache rows and fail on cache miss or Manifest-incompatible provenance. The provider executor behind the host API can be fake during early runtime development and live later.

### Provider cache provenance

Expand Down
26 changes: 18 additions & 8 deletions PLAN/provider-host-api-v1.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PLAN: Stable Lua provider host API v1

> Status: implementation plan with stable host, provenance, and provider module promotion slices validated; generated-output migration pending
> Status: stable host, provenance, provider module promotion, and cache-backed product runtime update-check slices validated; generated-output migration pending
> Scope: ADR-0012 provider-host API design for F-Droid and GitHub standard Lua modules
> Current boundary: provider modules are promoted to built-in fallbacks; generated F-Droid output has not yet been migrated to require them
> Current boundary: provider modules are promoted to built-in fallbacks, and `update_check_package_issue_action` can evaluate provider-backed packages against Manifest-compatible provider cache entries; generated F-Droid output has not yet been migrated to require them

## Progress

Expand All @@ -15,7 +15,8 @@
- [x] Implement and validate Slice 2 provider cache provenance storage and Manifest-compatible cache hits.
- [x] Implement and validate Slice 4 standard provider module promotion tests.
- [x] Add pre-adoption regression coverage locking generated F-Droid output as self-contained/plain-evaluable.
- [ ] Next slice: product provider-backed package evaluation/update-check operation before generated F-Droid provider-module adoption.
- [x] Add product provider-backed package evaluation/update-check operation before generated F-Droid provider-module adoption.
- [ ] Next slice: generated F-Droid provider-module adoption, keeping generated packages usable through the provider-backed update-check path.

## Current evidence and constraints

Expand All @@ -26,6 +27,8 @@
- Runtime hooks live under `<data-dir>/rc/hook/*.lua`, load after host functions are installed in the current operation harness, and call originals through `getter_builtin.*`.
- Package `Manifest` constrains external network/dynamic response bodies for scripts without `allow_free_network`; missing `Manifest` means an empty allow-list. Hooks and cache must not bypass this.
- Current provider-named modules `luaclass.fdroid_android` and `luaclass.github_android_apk` are always-on getter-shipped built-in fallback modules that call operation-installed `getter.provider.*` host functions. Plain package evaluation still does not install provider APIs and fails with a stable host-unavailable error if a package calls a provider module there.
- Product runtime update checks deliberately install the stable provider host and runtime hooks before package evaluation. The bridge request shape remains narrow (`package_id`, optional `repository_id`, `installed_version`, and `pin_version`); provider fixture bodies, cache mode, endpoint URLs, and live transport controls are not Flutter/native request fields in this slice.
- Until live provider transport is accepted and implemented, the product runtime path is cache-backed: provider-backed packages can use existing provider cache rows only when Manifest-compatible provenance permits them, while cache miss/refresh remains a later provider operation concern.
- Repository-local `luaclass/` modules must continue to override getter-shipped built-ins; cross-repository `luaclass` lookup stays unsupported.

## Design goals
Expand Down Expand Up @@ -340,7 +343,7 @@ The operation evaluating package Lua decides the cache mode:
- normal update/read: use cached provider facts when valid, refresh on cache miss or stale according to provider policy;
- forced refresh: bypass cached reads for the requested provider/package scope, replace cache on success, and use stale cache only with explicit diagnostics on refresh failure.

Lua package authors do not pass `mode = "force_refresh"` to stable provider host functions.
Lua package authors do not pass `mode = "force_refresh"` to stable provider host functions. The first product runtime slice keeps `update_check_package_issue_action` in normal cache-backed mode only and does not add provider fixture/cache-mode fields to the Flutter/native bridge payload. Live refresh and user-triggered force-refresh semantics remain separate provider-operation work.

### Provider cache contents

Expand Down Expand Up @@ -467,11 +470,18 @@ Done in the implementation branch:
- Plain package evaluation resolves the built-in provider modules, but calling them without operation-installed provider host functions fails with a stable host-unavailable diagnostic.
- Provider modules are always-on built-in fallback modules; `getter_dev.*` remains only a private compatibility shim in operation tests.

### Slice 5: docs and generated output migration
### Slice 5: product runtime adoption and generated output migration

Done in the implementation branch:

- Updated ADR-0012, `CONTEXT.md`, and this plan with stable provider module/product runtime status.
- Added pre-adoption regression coverage that generated F-Droid output remains self-contained, does not require `luaclass.fdroid_android`, and does not call `getter.provider.*` while normal package evaluation remains plain.
- Added a product-facing provider-backed package evaluation/update-check operation by routing only `update_check_package_issue_action` through the stable provider host; read-model `package_eval` remains plain.
- Kept the Flutter/native bridge request shape narrow: no provider fixture body, cache mode, endpoint URL, or live transport fields are added to the product payload.
- Added runtime tests proving static packages still work, F-Droid/GitHub provider modules work from Manifest-compatible provider cache entries, Manifest-incompatible cache fails closed, and no-update checks do not issue actions.

Still pending:

- Update ADR-0012, ADR-0005, `docs/lua-api/permissions.md`, `docs/lua-api/repository-layout.md`, and `CONTEXT.md` with stable provider module status.
- Add pre-adoption regression coverage that generated F-Droid output remains self-contained, does not require `luaclass.fdroid_android`, and does not call `getter.provider.*` while normal package evaluation remains plain.
- Before changing generated output, add a product-facing provider-backed package evaluation/update-check operation (not the fixture/dev-hidden harness) and route only intended update-check callers through it.
- Update generated F-Droid output to use `luaclass.fdroid_android` only after the product provider-backed operation exists and tests prove generated packages remain usable through that operation.
- Add generator tests proving generated output does not depend on `getter_dev.*` or repository-local copied modules.

Expand Down
4 changes: 3 additions & 1 deletion core-getter/src/main/rust/api_proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,9 @@ fn runtime_operation_with_runtime(
)
})?;
let db = open_main_db(data_dir)?;
runtime_operations::issue_action_from_registered_package_json(runtime, &db, &payload)
runtime_operations::issue_action_from_registered_package_json(
runtime, data_dir, &db, &payload,
)
}
"task_submit" => runtime_operations::submit_action_json(runtime, &payload),
"task_get" => runtime_operations::task_get_json(runtime, &payload),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Internally, Rust/native bridge code scans Android inventory through the platform

`loadSnapshot()` composes smaller getter-owned read-model operations into the UI shell's first snapshot DTO. In the Android/native product path, `MethodChannelGetterAdapter` calls `readOperation` for `repository_list`, `tracked_package_list`, and `package_eval`; Rust getter reads SQLite repository/tracked-package state and evaluates registered Lua packages. Flutter may parse and combine those returned DTOs for rendering, but must not perform repository resolution, Lua validation/evaluation, version comparison, migration mapping, or update selection in Dart. `readMigrationReports()` must go through a getter operation such as `legacy report-list`; Flutter must not inspect getter's data-directory layout directly. Runtime task rendering must use ADR-0011 runtime task snapshot APIs and opaque action/task controls; Flutter must not synthesize task states, retry policy, installer behavior, or update decisions.

The first product click-through update flow is: App detail calls a typed getter update-check operation, receives a getter-issued `action_id`, submits only that `action_id` to the process-lifetime runtime, and opens Downloads to query authoritative task snapshots. Flutter may refresh the Downloads page after `RuntimeNotification.task_changed`, but the notification is only a trigger; `task_list`/equivalent runtime queries remain the source of truth.
The first product click-through update flow is: App detail calls a typed getter update-check operation, receives a getter-issued `action_id`, submits only that `action_id` to the process-lifetime runtime, and opens Downloads to query authoritative task snapshots. The update-check operation may evaluate package Lua through the stable provider host for provider-backed packages, but provider/cache/Manifest logic stays in getter and the Flutter/native request remains package/update oriented: `package_id`, optional `repository_id`, `installed_version`, and `pin_version`. Flutter must not pass provider fixture bodies, cache-mode controls, endpoint URLs, raw provider payloads, or action/download details as product update-check input. Until live provider transport is accepted, provider-backed runtime checks use Manifest-compatible provider cache entries produced by getter provider operations. Flutter may refresh the Downloads page after `RuntimeNotification.task_changed`, but the notification is only a trigger; `task_list`/equivalent runtime queries remain the source of truth.

## Flutter DTOs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Package version Lua resolves `require("luaclass.<name>")` in this order:

Repository-local modules deliberately win over getter-shipped modules. This gives trusted repositories and `local` overlays a normal source-level override path while keeping generated repositories boring: generated package directories do not need to copy shared standard modules, and `.autogen.jsonc` remains package-local ownership proof rather than a repository-root ownership system. Built-in modules are part of the getter binary/source distribution and are not repository source files; repository trust/signing still applies only to repository-provided files. Cross-repository module lookup is not accepted in this slice because it would make package behavior depend on unrelated repository priority and trust boundaries.

Implementation status: getter ships `luaclass.android`, `luaclass.fdroid_android`, and `luaclass.github_android_apk` as built-in fallback modules. The provider-named modules call the stable `getter.provider.*` host namespace and require a provider-backed operation to install those host functions; plain package evaluation does not install them and fails with a stable host-unavailable error if a package calls a provider module there. Generated F-Droid output does not depend on provider modules yet; switching generated output to `luaclass.fdroid_android` remains a later generator migration after this stable host/module behavior is validated.
Implementation status: getter ships `luaclass.android`, `luaclass.fdroid_android`, and `luaclass.github_android_apk` as built-in fallback modules. The provider-named modules call the stable `getter.provider.*` host namespace and require a provider-backed operation to install those host functions; plain package evaluation does not install them and fails with a stable host-unavailable error if a package calls a provider module there. The product runtime update-check operation `update_check_package_issue_action` installs the stable provider host and runtime hooks, then evaluates package Lua before update selection, so provider-backed packages can issue normal getter-owned update actions from Manifest-compatible provider cache entries. The Flutter/native payload remains package/update oriented (`package_id`, optional `repository_id`, `installed_version`, and `pin_version`); provider fixture bodies, cache mode, endpoint URLs, and live transport controls are not bridge request fields in this slice. Generated F-Droid output does not depend on provider modules yet; switching generated output to `luaclass.fdroid_android` remains a later generator migration after this stable host/module behavior is validated.

### Stable provider host API v1 direction

Expand All @@ -108,7 +108,7 @@ Candidate-returning provider functions return an envelope containing non-empty `

The GitHub `latest_commit` host shape is reserved because latest-commit checks are live/floating behavior. The default GitHub release/APK helper must not install or call it by default, and latest-commit results must not be silently treated as ordinary release candidates. A later explicit live operation/helper may install and use it after live-version UI/CLI semantics are implemented.

Provider functions must not bypass Manifest policy. For package scripts without `allow_free_network`, every external response body used to produce provider facts must match a package `Manifest` SHA-512 entry. Parsed provider cache hits are usable for non-free scripts only when cache provenance records the source response digest(s) and proves Manifest compatibility; missing provenance must fail closed or refetch/revalidate. The initial fixture-backed provenance slice stores source response SHA-512 digest(s), a provenance schema version, and freshness metadata placeholders with parsed provider cache entries so Manifest-compatible cache hits can be accepted while legacy/missing-provenance rows still fail closed.
Provider functions must not bypass Manifest policy. For package scripts without `allow_free_network`, every external response body used to produce provider facts must match a package `Manifest` SHA-512 entry. Parsed provider cache hits are usable for non-free scripts only when cache provenance records the source response digest(s) and proves Manifest compatibility; missing provenance must fail closed or refetch/revalidate. The initial fixture-backed provenance slice stores source response SHA-512 digest(s), a provenance schema version, and freshness metadata placeholders with parsed provider cache entries so Manifest-compatible cache hits can be accepted while legacy/missing-provenance rows still fail closed. Until live provider transport is accepted and implemented, the product runtime update-check path is cache-backed: provider refresh/cache population remains the responsibility of provider operations rather than Flutter/Kotlin or the runtime update-check bridge payload.

### F-Droid reusable module

Expand Down