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
refactor(app): drop CLI fake task adapter APIs
  • Loading branch information
xz-dev committed Jun 25, 2026
commit 1530a425ec9b9e02cc2662891ee3241a37d407c7
58 changes: 0 additions & 58 deletions app_flutter/dev_test/cli_getter_adapter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void main() {
final repoDir = _createFixtureRepository(temp, 'official');
final bundle = _createLegacyBundle(temp);
final legacyDb = _createLegacyRoomDatabase(temp);
final taskRequest = _createDownloadTaskRequest(temp);
final adapter =
CliGetterAdapter(executable: getterCli, dataDir: dataDir.path);

Expand All @@ -71,20 +70,6 @@ void main() {
'import-room-bundle',
bundle.path,
]);
_runGetter(getterCli, dataDir.path, <String>[
'debug',
'fake-task',
'submit',
'--request',
taskRequest.path,
]);
_runGetter(getterCli, dataDir.path, <String>[
'debug',
'fake-task',
'run',
'task-1',
]);

final repositories = adapter.listRepositories();
expect(repositories.map((repo) => repo.id), contains('official'));
expect(
Expand Down Expand Up @@ -120,26 +105,6 @@ void main() {
contains('android/org.fdroid.fdroid'),
);

final tasks = adapter.listDownloadTasks();
final task = tasks.singleWhere((task) => task.id == 'task-1');
expect(task.packageId, 'android/org.fdroid.fdroid');
expect(task.status, 'succeeded');
expect(task.downloadFileName, 'app.apk');
expect(task.installHandoffId, 'handoff-1');

final eventPage = adapter.listTaskEvents(after: 0, limit: 10);
expect(eventPage.hasMore, isFalse);
expect(eventPage.nextCursor, greaterThanOrEqualTo(4));
expect(
eventPage.events.map((event) => event.kind),
containsAll(<String>[
'task_created',
'task_started',
'task_succeeded',
'install_handoff_requested',
]),
);

final snapshot = adapter.loadSnapshot();
expect(snapshot.status, 'Getter CLI ready');
expect(snapshot.repositories.map((repo) => repo.id), contains('official'));
Expand Down Expand Up @@ -229,29 +194,6 @@ conn.close()
return db;
}

File _createDownloadTaskRequest(Directory temp) {
return File('${temp.path}/download-request.json')..writeAsStringSync('''
{
"format": "getter-download-request",
"version": 1,
"package_id": "android/org.fdroid.fdroid",
"executor": "fake",
"actions": [
{
"type": "download",
"url": "https://example.invalid/app.apk",
"file_name": "app.apk"
},
{
"type": "install",
"installer": "android_package",
"file": "app.apk"
}
]
}
''');
}

void _runGetter(String getterCli, String dataDir, List<String> args) {
final result = Process.runSync(
getterCli,
Expand Down
130 changes: 0 additions & 130 deletions app_flutter/lib/cli_getter_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,6 @@ class CliGetterAdapter implements GetterAdapter {
return LegacyMigrationImportResult.fromJson(_data(json));
}

/// Development-only accessor for the persisted `debug fake-task` scaffold.
List<DownloadTaskSummary> listDownloadTasks() {
final json = _runGetter(const <String>['debug', 'fake-task', 'list']);
final tasks = _asList(_data(json)['tasks'], 'tasks');
return tasks
.map((task) => _downloadTaskFromJson(_asMap(task, 'task')))
.toList(growable: false);
}

/// Development-only accessor for the persisted `debug fake-task` scaffold.
TaskEventPage listTaskEvents({required int after, required int limit}) {
final json = _runGetter(<String>[
'debug',
'fake-task',
'events',
'--after',
after.toString(),
'--limit',
limit.toString(),
]);
return _taskEventPageFromJson(_data(json));
}

@override
Future<InstalledAutogenPreview> previewInstalledAutogen({
InstalledAutogenScanOptions options = const InstalledAutogenScanOptions(),
Expand Down Expand Up @@ -260,58 +237,6 @@ class CliGetterAdapter implements GetterAdapter {
}
}

class DownloadTaskSummary {
const DownloadTaskSummary({
required this.id,
required this.packageId,
required this.status,
required this.executor,
required this.actions,
required this.downloadFileName,
required this.downloadedFile,
required this.failureMessage,
required this.installHandoffId,
});

final String id;
final String packageId;
final String status;
final String executor;
final List<Map<String, Object?>> actions;
final String downloadFileName;
final String? downloadedFile;
final String? failureMessage;
final String? installHandoffId;
}

class TaskEventPage {
const TaskEventPage({
required this.events,
required this.nextCursor,
required this.hasMore,
});

final List<TaskEventSummary> events;
final int nextCursor;
final bool hasMore;
}

class TaskEventSummary {
const TaskEventSummary({
required this.cursor,
required this.taskId,
required this.kind,
required this.status,
required this.message,
});

final int cursor;
final String taskId;
final String kind;
final String? status;
final String? message;
}

Map<String, Object?> _data(Map<String, Object?> envelope) {
return _asMap(envelope['data'], 'data');
}
Expand Down Expand Up @@ -362,54 +287,6 @@ PackageEvaluation _packageEvaluationFromJson(Object? value) {
);
}

DownloadTaskSummary _downloadTaskFromJson(Map<String, Object?> json) {
return DownloadTaskSummary(
id: _asString(json['id'], 'task.id'),
packageId: _asString(json['package_id'], 'task.package_id'),
status: _asString(json['status'], 'task.status'),
executor: _asString(json['executor'], 'task.executor'),
actions: _asList(json['actions'], 'task.actions')
.map((action) => _asMap(action, 'task.action'))
.toList(growable: false),
downloadFileName: _asString(
json['download_file_name'],
'task.download_file_name',
),
downloadedFile: _asOptionalString(
json['downloaded_file'],
'task.downloaded_file',
),
failureMessage: _asOptionalString(
json['failure_message'],
'task.failure_message',
),
installHandoffId: _asOptionalString(
json['install_handoff_id'],
'task.install_handoff_id',
),
);
}

TaskEventPage _taskEventPageFromJson(Map<String, Object?> json) {
return TaskEventPage(
events: _asList(json['events'], 'task.events')
.map((event) => _taskEventFromJson(_asMap(event, 'task.event')))
.toList(growable: false),
nextCursor: _asInt(json['next_cursor'], 'task.next_cursor'),
hasMore: _asBool(json['has_more'], 'task.has_more'),
);
}

TaskEventSummary _taskEventFromJson(Map<String, Object?> json) {
return TaskEventSummary(
cursor: _asInt(json['cursor'], 'task.event.cursor'),
taskId: _asString(json['task_id'], 'task.event.task_id'),
kind: _asString(json['kind'], 'task.event.kind'),
status: _asOptionalString(json['status'], 'task.event.status'),
message: _asOptionalString(json['message'], 'task.event.message'),
);
}

Map<String, Object?> _asMap(Object? value, String name) {
if (value is Map<String, Object?>) {
return value;
Expand Down Expand Up @@ -437,13 +314,6 @@ String _asString(Object? value, String name) {
throw FormatException('$name should be a string');
}

String? _asOptionalString(Object? value, String name) {
if (value == null || value is String) {
return value as String?;
}
throw FormatException('$name should be a string or null');
}

int _asInt(Object? value, String name) {
if (value is int) {
return value;
Expand Down
42 changes: 21 additions & 21 deletions docs/architecture/adr/0007-flutter-getter-bridge-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,15 @@ readMigrationReports()
loadSnapshot()
```

The second accepted API surface adds read-only task lifecycle DTO consumption for the already accepted offline/fake getter lifecycle:

```text
listDownloadTasks()
listTaskEvents(after, limit)
```

The third accepted API surface adds the first legacy migration action boundary:
The second accepted API surface adds the first legacy migration action boundary:

```text
importLegacyRoomDatabase(databasePath)
```

The Android platform adapter may prepare a copied/checkpointed legacy Room SQLite file and return its path to Flutter, but getter still owns the actual `legacy import-room-db` import semantics. The production Android bridge exposes `importLegacyRoomDatabase` and `legacyReportList` through JNI/MethodChannel by delegating to getter-owned `getter-operations` legacy Room code. Flutter starts the flow and renders getter reports; it must not inspect or map Room tables directly.

The fourth accepted API surface adds the production installed-autogen bridge boundary and must follow ADR-0009's Rust-active platform adapter direction rather than a Flutter-led inventory scan:
The third accepted API surface adds the production installed-autogen bridge boundary and must follow ADR-0009's Rust-active platform adapter direction rather than a Flutter-led inventory scan:

```text
previewInstalledAutogen(scanOptions)
Expand All @@ -56,7 +49,7 @@ The Android product APK packages a slim `:getter_bridge` library under `app_flut

Internally, Rust/native bridge code scans Android inventory through the platform adapter, then asks getter-owned shared autogen operations to plan/apply `local_autogen`. `MethodChannelGetterAdapter` consumes the returned getter-style JSON envelopes. Flutter renders getter-owned preview/apply DTOs and scan diagnostics, then passes the package ids from displayed accepted preview candidates back to getter on apply; it must not expose a product Dart `InstalledInventoryPlatform` scanner or convert Android package names into package ids.

`loadSnapshot()` composes the smaller getter-owned operations into the UI shell's first snapshot DTO. It must not perform repository resolution, 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. `listDownloadTasks()` and `listTaskEvents()` render getter-owned task/event DTOs; Flutter must not synthesize task states, retry policy, installer behavior, or update decisions.
`loadSnapshot()` composes the smaller getter-owned operations into the UI shell's first snapshot DTO. It must not perform repository resolution, 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.

## Flutter DTOs

Expand All @@ -72,9 +65,16 @@ MigrationReportSummary
LegacyMigrationImportResult
MigrationWarningSummary
MigrationSourceCounts
DownloadTaskSummary
TaskEventPage
TaskEventSummary
RuntimeUpdateCheckResult
RuntimePackageSummary
RuntimeUpdateSummary
RuntimeIssuedAction
RuntimeTaskSnapshot
RuntimeTaskPhase
RuntimeTaskProgress
RuntimeTaskCapabilities
RuntimeTaskDiagnostic
RuntimeNotificationEnvelope
GetterError
InstalledAutogenPreview
InstalledAutogenCandidate
Expand Down Expand Up @@ -179,15 +179,15 @@ If a feature requires one of these decisions, add or extend a getter operation i

Positive:

- The first bridge is executable in CI without waiting for full mobile FFI.
- CLI output remains the headless test oracle.
- Flutter can start consuming real getter data while preserving the Rust-owned domain boundary.
- Future native bridge work has a concrete DTO/error contract to preserve.
- The early bridge was executable in CI before the native bridge stabilized.
- CLI output remains a headless oracle for storage/repository/migration coverage.
- Flutter can consume real getter data while preserving the Rust-owned domain boundary.
- The native bridge now has a concrete DTO/error/runtime notification contract to preserve.

Costs:

- The CLI adapter is development/test infrastructure, not the final mobile path.
- Snapshot-only UI cannot yet represent long-running update/download/install flows.
- Runtime task UI still exposes only the first read-only snapshot rendering slice until live provider/downloader/installer ADRs are accepted.
- Getter output schemas must evolve carefully because they are now a cross-boundary contract.

## Validation
Expand All @@ -196,13 +196,13 @@ The first implementation slice must provide:

- Flutter widget tests that continue to use `FakeGetterAdapter`.
- Flutter widget tests for the migration flow using fake platform/getter adapters.
- A Flutter/Dart integration test that builds or receives a real `getter-cli` binary, initializes a real getter data directory, and reads repositories, tracked packages, package evaluation output, migration reports, direct Room import output, and task lifecycle DTOs through `CliGetterAdapter`.
- A Flutter/Dart integration test that builds or receives a real `getter-cli` binary, initializes a real getter data directory, and reads repositories, tracked packages, package evaluation output, migration reports, and direct Room import output through `CliGetterAdapter`.
- `just verify` coverage for the bridge integration test.

## Non-goals

- No full FFI/native bridge implementation beyond the first direct legacy Room import/report-list and installed-autogen preview/apply JNI/MethodChannel operation slices.
- No update/download/install event stream.
- No product-complete live provider/downloader/installer execution beyond the ADR-0011 in-memory runtime operation and notification skeleton.
- No durable update/download/install event log or cross-process task recovery.
- No Android-owned legacy Room mapping/import semantics; Android only prepares a copied DB file for getter.
- No product-complete Flutter UI.
- No product/domain decisions in Dart.
8 changes: 4 additions & 4 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ Completed additional UI/bridge slice:
13. Add native bridge process-lifetime runtime singleton, runtime operation dispatcher, bounded best-effort notification drain, Kotlin EventChannel, and Dart runtime notification stream primitive.
14. Add typed Dart runtime/update methods for package update-check action issuance, action-id submission, task query/control/user-result/remove/clean, typed runtime notifications, and runtime task snapshot rendering on the Downloads route.
15. Add `runtime script --script <script.json>` as a single-process CLI debug harness over `getter-operations::runtime`, including task remove/clean coverage, and move the old persisted fake downloader scaffold out of the public `task` namespace to `debug fake-task ...`.
16. Remove remaining `debug fake-task` DTO accessors from `CliGetterAdapter` and keep fake-task coverage inside getter CLI BDD/dev scaffolding only, so Flutter product/development adapters no longer expose the old persisted task/event DTO surface.

Remaining tasks:

1. Replace the current static `updates` package seam with live provider update-check action issuance that materializes sealed action plans and returns opaque `action_id` to Flutter; keep Dart from constructing action payloads.
2. Continue retiring old fake-task scaffolding from product-facing adapters/docs as newer runtime/native flows cover those cases; the remaining `debug fake-task ...` commands are development-only.
3. Implement live provider/downloader behavior beyond the fake/offline proof after a later ADR accepts real side-effect details.
4. Define Android production install handoff URI/SAF/permission/notification details and wire platform adapter execution after later ADRs.
5. Add product-level Flutter BDD for full update/download/install user flows after live/provider/background/installer decisions are accepted; the current slice covers typed runtime DTO methods and read-only runtime task snapshot rendering.
2. Implement live provider/downloader behavior beyond the fake/offline proof after a later ADR accepts real side-effect details.
3. Define Android production install handoff URI/SAF/permission/notification details and wire platform adapter execution after later ADRs.
4. Add product-level Flutter BDD for full update/download/install user flows after live/provider/background/installer decisions are accepted; the current slice covers typed runtime DTO methods and read-only runtime task snapshot rendering.

Acceptance progress:

Expand Down