Skip to content

Add Flutter integration packages, tests, and CI#24

Merged
kingwill101 merged 11 commits into
masterfrom
docs/dartdoc-cleanup-pr
Apr 23, 2026
Merged

Add Flutter integration packages, tests, and CI#24
kingwill101 merged 11 commits into
masterfrom
docs/dartdoc-cleanup-pr

Conversation

@kingwill101
Copy link
Copy Markdown
Owner

@kingwill101 kingwill101 commented Apr 22, 2026

Summary

  • add stem_flutter and stem_flutter_sqlite for Flutter-hosted Stem runtimes
  • add the mobile-oriented flutter_stem_example and supporting example package doc surfaces
  • add package tests and dedicated GitHub Actions workflows for the new Flutter packages
  • expand the package and example READMEs with mobile runtime guidance and troubleshooting notes

Testing

  • flutter analyze (packages/stem_flutter)
  • flutter test (packages/stem_flutter)
  • flutter analyze (packages/stem_flutter_sqlite)
  • flutter test (packages/stem_flutter_sqlite)
  • dart doc -o $(mktemp -d) for the updated package surfaces during the cleanup pass

Summary by CodeRabbit

  • New Features

    • Added Flutter packages for queue monitoring, worker supervision, and a SQLite-backed runtime; new Flutter example app demonstrating enqueueing and worker isolates.
  • Documentation

    • Added READMEs and getting-started guides for Flutter integration and SQLite usage.
  • Bug Fixes

    • Improved SQLite reliability (busy timeout and safer sweeper behavior).
  • Tests

    • Added unit/integration tests for monitor, worker host, signaling, and SQLite runtime.
  • Chores

    • Added CI workflows for Flutter packages, updated workspace config, and updated .gitignore.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@kingwill101 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 53 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 39 minutes and 53 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9f6d01a4-e2e3-444c-9674-9754a322ffab

📥 Commits

Reviewing files that changed from the base of the PR and between ce9afe9 and 776d743.

📒 Files selected for processing (43)
  • .github/workflows/dashboard.yaml
  • .github/workflows/stem.yaml
  • .github/workflows/stem_cli.yaml
  • .github/workflows/stem_flutter.yaml
  • .github/workflows/stem_flutter_sqlite.yaml
  • .github/workflows/stem_memory.yaml
  • .github/workflows/stem_postgres.yaml
  • .github/workflows/stem_redis.yaml
  • .github/workflows/stem_sqlite.yaml
  • README.md
  • packages/stem/CHANGELOG.md
  • packages/stem/README.md
  • packages/stem/example/flutter_stem_example/android/gradle.properties
  • packages/stem/example/flutter_stem_example/lib/main.dart
  • packages/stem/example/flutter_stem_example/pubspec.yaml
  • packages/stem/example/flutter_stem_example/web/index.html
  • packages/stem/pubspec.yaml
  • packages/stem_adapter_tests/CHANGELOG.md
  • packages/stem_adapter_tests/pubspec.yaml
  • packages/stem_flutter/README.md
  • packages/stem_flutter/lib/src/monitor/stem_flutter_queue_snapshot.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_dependency_bootstrap.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart
  • packages/stem_flutter/lib/stem_flutter.dart
  • packages/stem_flutter/pubspec.yaml
  • packages/stem_flutter/test/stem_flutter_queue_monitor_test.dart
  • packages/stem_flutter/test/stem_flutter_queue_snapshot_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_host_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_signal_test.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_runtime.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_worker_bootstrap.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_worker_launcher.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart
  • packages/stem_flutter_sqlite/pubspec.yaml
  • packages/stem_flutter_sqlite/test/stem_flutter_storage_layout_test.dart
  • packages/stem_postgres/lib/src/connection.dart
  • packages/stem_postgres/lib/src/database/postgres_migration_lock.dart
  • packages/stem_postgres/test/support/postgres_test_harness.dart
  • packages/stem_sqlite/CHANGELOG.md
  • packages/stem_sqlite/lib/src/connection.dart
  • packages/stem_sqlite/pubspec.yaml
  • pubspec.yaml
📝 Walkthrough

Walkthrough

Adds two Flutter packages (stem_flutter, stem_flutter_sqlite), a full multi-platform Flutter example app (Android/iOS/Linux/macOS/Windows), CI workflows for Flutter testing, numerous example library stubs, and SQLite connection/sweeper reliability fixes.

Changes

Cohort / File(s) Summary
CI / Workflows
.github/workflows/stem_flutter.yaml, .github/workflows/stem_flutter_sqlite.yaml, .github/workflows/*.yaml
Add dedicated Flutter CI for new packages and switch existing workflows to use subosito/flutter-action@v2 with flutter pub get.
Workspace manifest & gitignore
pubspec.yaml, .gitignore
Add new packages to workspace and force meta override; ignore Flutter plugin dependency files.
stem_flutter package
packages/stem_flutter/lib/..., packages/stem_flutter/pubspec.yaml, packages/stem_flutter/CHANGELOG.md, packages/stem_flutter/README.md, packages/stem_flutter/test/*
Introduce Flutter API: worker host, worker signals, queue monitor/snapshot models, dependency bootstrap; add tests, docs, and analysis config.
stem_flutter_sqlite package
packages/stem_flutter_sqlite/lib/..., packages/stem_flutter_sqlite/pubspec.yaml, packages/stem_flutter_sqlite/CHANGELOG.md, packages/stem_flutter_sqlite/README.md, packages/stem_flutter_sqlite/test/*
Add SQLite-backed Flutter runtime, storage layout, worker bootstrap/launcher, message serialization and tests.
Flutter example app (Dart & web)
packages/stem/example/flutter_stem_example/lib/main.dart, packages/stem/example/flutter_stem_example/pubspec.yaml, web/*, test/widget_test.dart, .metadata, analysis_options.yaml
Add a large Flutter example demonstrating runtime open, worker isolate spawn, queue monitoring, UI, tests and manifests.
Platform native projects for example
packages/stem/example/flutter_stem_example/android/*, ios/*, linux/*, macos/*, windows/*
Add full platform projects and native runners (Gradle/Kotlin, Xcode projects, CMake, Win32 integration) for the example across all desktop/mobile platforms.
Example library stubs
packages/stem/example/*/lib/*.dart
Add documentation-only library; entry files for many example packages (email_service, encrypted_payload, image_processor, microservice, mixed_cluster, monolith, otel_metrics, postgres_worker, redis_postgres_worker).
SQLite reliability changes
packages/stem_sqlite/lib/src/broker/sqlite_broker.dart, packages/stem_sqlite/lib/src/connection.dart
Disable sweeper when interval ≤ 0, add error handling/logging to sweeper cycles, set busy_timeout, and apply WAL/synchronous PRAGMA during migrations/connection open.
Small tooling / docs
assorted .gitignore, analysis options, CHANGELOGs, READMEs
Add per-package analysis configs, READMEs, changelogs, and .gitignore files for example subprojects.

Sequence Diagram(s)

sequenceDiagram
    participant UI as UI Isolate
    participant Host as StemFlutterWorkerHost
    participant Worker as Worker Isolate
    participant Broker as SqliteBroker
    participant Backend as SqliteResultBackend

    UI->>UI: preload assets & initialize deps
    UI->>Broker: open broker (file)
    UI->>Backend: open backend (file)
    UI->>Host: spawn(entrypoint, bootstrap message)
    Host->>Worker: spawn isolate with bootstrap
    Worker->>Worker: initialize background deps (TimeMachine)
    Worker->>Broker: open broker (worker-side)
    Worker->>Backend: open backend (worker-side)
    Worker->>Host: send ready signal (includes commandPort)
    Host-->>UI: emit ready via signals stream

    loop enqueue & monitoring
        UI->>Broker: enqueue task
        Host->>Broker: get pending/inflight counts
        Host->>Backend: list task statuses
        Host-->>UI: emit snapshot (via StemFlutterQueueMonitor)
    end

    UI->>Host: requestShutdown()
    Host->>Worker: send shutdown command (commandPort)
    Worker->>Backend: close backend
    Worker->>Broker: close broker
    Worker->>Host: send stopped signal
    Host-->>UI: emit stopped
Loading
sequenceDiagram
    participant Monitor as StemFlutterQueueMonitor
    participant Broker as Broker
    participant Backend as ResultBackend
    participant WorkerSignals as Worker Signal Stream

    Monitor->>Monitor: start() -> immediate refresh()
    loop every pollInterval
        Monitor->>Broker: pending/inflight counts
        Monitor->>Backend: list task statuses (limit)
        Monitor->>Backend: latest worker heartbeat
        Monitor->>Monitor: build/sort tracked jobs
        Monitor-->>UI: emit snapshot if changed
    end

    alt worker signal arrives
        WorkerSignals->>Monitor: status/warning/fatal
        Monitor->>Monitor: apply sticky signal state
        Monitor-->>UI: emit updated snapshot
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐇 I hopped a queue and hid a seed,

spawned an isolate — quick indeed.
SQLite burrow, signals bright,
monitors hum into the night.
Stem and Flutter — carrot flight! 🥕

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/dartdoc-cleanup-pr

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1891a1bdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

taskId: status.id,
label: _labelResolver(status),
state: status.state,
result: status.payloadValue<String>(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid hard-casting monitor payloads to String

StemFlutterQueueMonitor.refresh currently maps each task result with status.payloadValue<String>(), which is an unchecked cast in TaskStatus and throws when the stored payload is any non-string type (for example JSON/map results). In queues with mixed task result types, a single non-string payload causes refresh() to fail, and because periodic polling calls refresh() unawaited, this turns into recurring unhandled errors and stale UI snapshots.

Useful? React with 👍 / 👎.

Comment on lines +60 to +61
_started = true;
await refresh();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reset start state when initial refresh fails

start() sets _started = true before awaiting the first refresh(), so if that initial refresh throws (for example due to a transient backend/broker failure), the method exits before creating the timer but leaves _started latched to true. Subsequent start() calls then return immediately, so the monitor cannot recover unless callers construct a new instance.

Useful? React with 👍 / 👎.

Comment on lines +122 to +124
status: StemFlutterWorkerStatus.values.byName(
raw['state']?.toString() ?? StemFlutterWorkerStatus.starting.name,
),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard worker status parsing against unknown enum names

StemFlutterWorkerSignal.tryParse uses StemFlutterWorkerStatus.values.byName(...) directly for 'status' messages, which throws ArgumentError for unknown state strings. Any malformed or forward-compatible worker message with a new status value will raise during parsing instead of being ignored/fallback-handled, which can break signal processing in the host listener.

Useful? React with 👍 / 👎.

coderabbitai[bot]
coderabbitai Bot previously requested changes Apr 22, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 32

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart`:
- Around line 49-50: The forRoot async factory currently uses blocking
filesystem calls (root.existsSync() and root.createSync()), so replace the
check-and-sync creation with a single non-blocking call: call await
root.create(recursive: true) directly (remove existsSync/createSync) so
Directory creation is asynchronous and race-safe; update references in the
forRoot method where Directory root is used to reflect the awaited create.

In `@packages/stem_flutter_sqlite/pubspec.yaml`:
- Line 4: Update the pubspec.yaml metadata to point repository and issue_tracker
at the package subpath in the monorepo (change the repository key and
issue_tracker key in this package's pubspec.yaml to the package-specific URL,
e.g. use the GitHub URL with /tree/main/packages/stem_flutter_sqlite for
repository and the repo issues URL for issue_tracker) so pub.dev clearly links
to the stem_flutter_sqlite subpath (match the approach used in stem_flutter's
pubspec.yaml).
- Around line 14-16: The pubspec constraint for stem_sqlite is too high
(requires >=0.1.2) while the package is currently at 0.1.1; update the
dependency constraint in packages/stem_flutter_sqlite/pubspec.yaml to match the
published version (change stem_sqlite to ">=0.1.1 <0.2.0") or bump the
stem_sqlite package to 0.1.2 and keep the existing constraint, and also confirm
stem_flutter's constraint (">=0.1.0 <0.2.0") matches the actual stem_flutter
release (bump either the constraint or the package version so both stay in
lockstep).

In `@packages/stem_flutter_sqlite/README.md`:
- Around line 117-145: The README snippet must ensure worker and resource
cleanup by wrapping the lifecycle in a try/finally: after opening
StemFlutterSqliteWorkerStores.open and creating the Worker
(broker/backend/tasks/queue/consumerName), call worker.start() and send the
ready signal, then run the command handling loop inside a try block, and in the
finally block always call worker.shutdown(), await stores.close(), and
commands.close(); reference the symbols Worker.start,
StemFlutterSqliteWorkerStores.open, worker.shutdown, stores.close, and
commands.close to locate where to add the try/finally.

In `@packages/stem_flutter_sqlite/test/stem_flutter_sqlite_runtime_test.dart`:
- Around line 89-108: The test currently awaits host.signals.firstWhere for the
ready signal and only then subscribes for the running status, which can miss the
back-to-back status event; change the test to create both futures up-front by
capturing the two subscriptions on host.signals (filtering for
StemFlutterWorkerSignalType.ready and for the status ==
StemFlutterWorkerStatus.running) before awaiting either, then await both futures
(or await the ready future and then await the already-created running future);
reference host.signals, StemFlutterWorkerSignalType.ready,
StemFlutterWorkerSignalType.status, and StemFlutterWorkerStatus.running when
locating where to create the two futures so both listeners are active before the
worker sends signals.

In `@packages/stem_flutter/analysis_options.yaml`:
- Line 7: Remove the trailing blank line at the end of
packages/stem_flutter/analysis_options.yaml so the file ends immediately after
the final YAML content (no extra newline or blank line at EOF); simply delete
the extra empty line flagged by YAMLlint to resolve the lint error.

In `@packages/stem_flutter/lib/src/monitor/stem_flutter_queue_monitor.dart`:
- Around line 69-72: bindWorkerSignals currently calls
unawaited(_workerSignalsSub?.cancel()) which can allow the new subscription to
be created before the old one is fully cancelled; change bindWorkerSignals to
return Future<void> and make it async, await _workerSignalsSub?.cancel() before
assigning _workerSignalsSub = signals.listen(_applyWorkerSignal), and ensure you
still handle nulls safely so the previous subscription is awaited when present
(refer to bindWorkerSignals, _workerSignalsSub, and _applyWorkerSignal).

In `@packages/stem_flutter/lib/src/monitor/stem_flutter_queue_snapshot.dart`:
- Around line 72-91: The copyWith on StemFlutterQueueSnapshot only supports
clearing workerDetail via clearWorkerDetail, so add explicit clear flags for the
other nullable fields (for example clearLastHeartbeatAt, clearPendingCount,
clearInflightCount) to the copyWith signature and implementation so callers can
force those fields to null; update the assignments in copyWith to set
lastHeartbeatAt/pendingCount/inflightCount to null when their corresponding
clear* flag is true, otherwise fall back to the provided param or this.*. Also
update call sites (notably StemFlutterQueueMonitor._applyWorkerSignal handling
StemFlutterWorkerSignalType.status and any other callers) to pass the new clear
flags where invalidation is required so behavior is consistent with
clearWorkerDetail.

In
`@packages/stem_flutter/lib/src/runtime/stem_flutter_dependency_bootstrap.dart`:
- Around line 7-14: The current implementation caches the Future returned by
tm.TimeMachine.initialize in _foregroundInitialization which means a failed
initialization is permanently stored; change
ensureStemFlutterDependenciesInitialized so it does not memoize a failing Future
by performing the initialization into a local Future (or awaiting it inside a
try/catch) and only assign the successful completion to
_foregroundInitialization, and on error reset _foregroundInitialization to null
(or avoid assigning until success) then rethrow the error so transient failures
can be retried; update references to _foregroundInitialization and
tm.TimeMachine.initialize in ensureStemFlutterDependenciesInitialized
accordingly.
- Around line 42-69: Change _StemFlutterDependencyAssetBundle to extend
AssetBundle (or CachingAssetBundle) so it formally implements the asset bundle
interface: declare "class _StemFlutterDependencyAssetBundle extends AssetBundle"
(or extends CachingAssetBundle), keep the existing implementations of load,
loadString and loadStructuredBinaryData, and add/override the other AssetBundle
members (e.g., evict, clear, loadBuffer or loadStructuredData as required) to
delegate to the existing assets map or be no-ops if appropriate; ensure
signatures match AssetBundle so the class satisfies the interface and compiles.

In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart`:
- Around line 45-105: The host currently uses a broadcast StreamController
(StemFlutterWorkerHost._controller) and can lose the initial ready/status
signals before callers subscribe; add a Completable-backed accessor (e.g.,
Future<SendPort> get commandPortReady or Future<StemFlutterWorkerSignal> get
ready) on StemFlutterWorkerHost and complete its Completer when the messages
listener observes a ready signal (i.e., inside the messages.listen block where
you set host._commandPort), also complete immediately if _commandPort is already
set so late callers still get the value; ensure the Completer is completed with
an error or canceled in dispose to avoid leaks.

In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart`:
- Around line 121-126: The code calls StemFlutterWorkerStatus.values.byName(...)
which throws on unknown names and breaks the safe tryParse behavior; change the
lookup in StemFlutterWorkerSignal.status to perform a safe lookup (e.g., read
raw['state']?.toString() into a local string and resolve the enum via a
non-throwing search like values.firstWhere(..., orElse:
()=>StemFlutterWorkerStatus.starting) or catch ArgumentError and fall back) so
unknown/misspelled/newer enum names default to StemFlutterWorkerStatus.starting
instead of throwing; update the StemFlutterWorkerSignal.status construction to
use this safe lookup in place of values.byName.

In `@packages/stem_flutter/pubspec.yaml`:
- Line 4: Update the package metadata to point the repository field at the
package subpath and add an issue_tracker entry: change the repository value (the
repository key in pubspec.yaml) to
"https://github.com/kingwill101/stem/tree/master/packages/stem_flutter" and add
an issue_tracker key with "https://github.com/kingwill101/stem/issues" so the
pubspec (repository and issue_tracker) correctly reference the package directory
and issue tracker for this monorepo package.

In `@packages/stem_flutter/README.md`:
- Around line 75-92: The example drops the spawned host and monitor when
startMobileWorker returns, preventing callers from shutting down the worker or
disposing the monitor; change startMobileWorker to expose lifecycle handles by
returning (or accepting and storing) the StemFlutterWorkerHost returned by
StemFlutterWorkerHost.spawn and the StemFlutterQueueMonitor instance so callers
can call host.close()/host.signals and monitor.stop()/monitor.dispose() as
needed—update the startMobileWorker signature to return a struct/tuple/object
containing host and monitor (or accept an out/owner-owned storage) and propagate
those handles to callers.

In `@packages/stem_flutter/test/stem_flutter_queue_monitor_test.dart`:
- Around line 82-100: The test's fresh-heartbeat window is too narrow causing
flakiness; update the StemFlutterQueueMonitor instantiation(s) used for
fresh-heartbeat assertions (e.g., the monitor created with
StemFlutterQueueMonitor, properties broker, queueName 'jobs', workerId
'worker-a') to use a much larger heartbeatInterval (for example increase from 1s
to 5s or more) or, if the monitor supports it, inject a deterministic clock and
call refresh() with controlled time; apply the same change to the other test
block referenced (around the second occurrence at lines 157-175) so workerStatus
remains stable during CI scheduling.
- Around line 176-184: The test is racing on a fixed 10ms delay after
signals.add; make the StreamController synchronous or otherwise await a
deterministic monitor update to avoid flakiness: construct the controller with
sync behavior (e.g., StreamController.sync) so
monitor.bindWorkerSignals(signals.stream) receives the event synchronously when
you call signals.add(const StemFlutterWorkerSignal.fatal('database locked')), or
replace the arbitrary delay with awaiting a concrete monitor signal/update (a
Future that completes when the monitor processes the signal) to ensure the
snapshot reflects the posted signal.

In `@packages/stem_flutter/test/stem_flutter_worker_host_test.dart`:
- Around line 30-33: The parameter sendPort in _failingWorkerEntry is unused and
confuses readers; either rename the parameter to _ (i.e.,
_failingWorkerEntry(SendPort _)) or add a one-line comment inside
_failingWorkerEntry explaining that the function intentionally throws and the
host observes the failure via the isolate error port rather than using sendPort;
update the signature or add the comment in the _failingWorkerEntry function to
make the intent explicit.

In `@packages/stem_sqlite/lib/src/connection.dart`:
- Around line 119-123: Move the SchemaDriver type check before any SQLite PRAGMA
executeRaw calls: in connection.dart retrieve dataSource.connection.driver,
assert `driver is SchemaDriver` and throw the intended StateError if not before
calling `driver.executeRaw('PRAGMA busy_timeout = ...')`,
`driver.executeRaw('PRAGMA journal_mode=WAL')` and `driver.executeRaw('PRAGMA
synchronous=NORMAL')`; update the guard around `driver` (the `SchemaDriver`
check) so the PRAGMA statements only run when the driver is confirmed valid and
add a unit test that supplies a non-SchemaDriver to the connection
initialization to assert that the StateError is thrown.

In `@packages/stem/example/flutter_stem_example/android/app/build.gradle.kts`:
- Around line 22-39: The build.gradle.kts contains example-only placeholders:
defaultConfig.applicationId is set to "com.example.flutter_stem_example" and
buildTypes.release uses signingConfig = signingConfigs.getByName("debug"); if
you ever convert this example into a real CI/release flow, replace the
placeholder applicationId with your unique applicationId and configure a proper
release signingConfig (create or reference a release keystore and use that
signingConfig in buildTypes.release instead of
signingConfigs.getByName("debug")), ensuring keys are loaded from secure CI
secrets rather than checked-in files.

In `@packages/stem/example/flutter_stem_example/android/gradle.properties`:
- Around line 1-2: The gradle JVM args currently set via org.gradle.jvmargs use
excessively large heap values (-Xmx8G and -XX:MaxMetaspaceSize=4G); update the
org.gradle.jvmargs entry to use more conservative Flutter defaults (for example
-Xmx4G -XX:MaxMetaspaceSize=2G -XX:ReservedCodeCacheSize=512m
-XX:+HeapDumpOnOutOfMemoryError) or remove the custom sizing so CI and low-RAM
developer machines can build reliably.

In
`@packages/stem/example/flutter_stem_example/android/gradle/wrapper/gradle-wrapper.properties`:
- Around line 1-5: Add a distributionSha256Sum property to the Gradle wrapper
properties to pin the distribution zip integrity: compute the SHA-256 checksum
of the gradle distribution referenced by distributionUrl (gradle-8.14-all.zip)
and add a line distributionSha256Sum=<sha256> to the file so the Gradle wrapper
verifies the downloaded archive; ensure the checksum string matches the exact
zip referenced by distributionUrl.

In
`@packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md`:
- Line 5: The README.md in the LaunchImage.imageset is missing a trailing
newline; update the README.md (LaunchImage.imageset/README.md) to ensure the
file ends with exactly one newline character (add a single trailing newline and
remove any extra blank lines) to satisfy MD047.

In `@packages/stem/example/flutter_stem_example/lib/main.dart`:
- Around line 477-485: The finally block can call worker.shutdown() even if
worker.start() failed; modify the cleanup to track successful startup (e.g., set
a started boolean right after await worker.start() in the same scope where
worker is created) and only call worker.shutdown(mode: WorkerShutdownMode.warm)
if started is true, or alternatively wrap the shutdown call in its own try/catch
that logs errors (using stemLogger.warning/error) and does not rethrow so a
failed shutdown won't mask the original exception; reference the worker.start()
invocation and worker.shutdown(...) call as the points to change, and also
ensure eventsSub?.cancel(), stores?.close(), and commands?.close() remain in
finally regardless.
- Around line 149-190: The monitor may miss an early "ready" signal because
StemFlutterWorkerHost exposes signals via a plain broadcast StreamController;
update StemFlutterWorkerHost so its signals stream buffers and replays the
latest signal to new subscribers (e.g., keep a lastSignal/state and emit it
immediately when a listener subscribes), ensuring
bindWorkerSignals(workerHost.signals) receives any prior ready/status events;
adjust the StreamController/stream getter and any emit logic in
StemFlutterWorkerHost to maintain and replay the most recent signal while
preserving broadcast behavior.

In
`@packages/stem/example/flutter_stem_example/macos/Runner/MainFlutterWindow.swift`:
- Around line 1-15: The SwiftLint required_deinit warning on the generated
MainFlutterWindow subclass of NSWindow is a known false positive; suppress it
either globally by adding required_deinit to disabled_rules in the repo
.swiftlint.yml, or locally by adding an inline suppression directly above the
class declaration for MainFlutterWindow (e.g., a swiftlint:disable:next
required_deinit) so you don't modify the generated awakeFromNib or diverge from
the Flutter scaffold.

In `@packages/stem/example/flutter_stem_example/pubspec.yaml`:
- Around line 21-22: The SDK constraint in the pubspec.yaml environment block is
too strict (sdk: ^3.11.4) and should be aligned with workspace packages; update
the environment.sdk entry in this pubspec.yaml to use either ^3.9.2 or the range
>=3.9.2 <4.0.0 so it matches stem and other examples and avoids pub get failures
for users on Dart 3.9–3.10.
- Around line 55-66: Replace the exact pinned meta: 1.17.0 in the
dependency_overrides with a compatible range (e.g., meta: ^1.18.0) or remove the
meta override entirely so the workspace/transitive constraint can be satisfied,
and remove the redundant dependency_overrides entries for stem, stem_flutter,
and stem_flutter_sqlite (they are already declared as path: dependencies); keep
only the necessary overrides for stem_memory and stem_sqlite in the
dependency_overrides block.

In `@packages/stem/example/flutter_stem_example/README.md`:
- Around line 65-68: The README's example uses a non-repo-relative path ("cd
stem/packages/stem/example/flutter_stem_example") which breaks if the checkout
folder isn't named "stem"; update the command block in README.md to use a
repo-root relative path (e.g., "cd packages/stem/example/flutter_stem_example")
so the three-step sequence (cd, flutter pub get, flutter run -d android) is
copy-paste safe; locate the code block in the README.md file and replace the cd
line accordingly.

In `@packages/stem/example/flutter_stem_example/web/index.html`:
- Line 2: The <html> root element in index.html is missing a lang attribute;
update the opening <html> tag to include an appropriate language declaration
(e.g., lang="en" or the correct locale) so screen readers and i18n tools can
detect the page language—modify the <html> tag in the file accordingly.

In `@pubspec.yaml`:
- Line 21: Update the exact pin for the meta dependency to a caret constraint
for forward compatibility: replace the exact version entry "meta: 1.17.0" with a
caret range such as "meta: ^1.17.0" in the dependency_overrides (the meta entry
in pubspec.yaml) so the package can accept compatible future patch/minor
SDK-bundled updates without breaking.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 945f4292-ab2d-497b-a988-a7620c3a72b8

📥 Commits

Reviewing files that changed from the base of the PR and between e03d590 and f1891a1.

⛔ Files ignored due to path filters (36)
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/web/favicon.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/web/icons/Icon-192.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/web/icons/Icon-512.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/web/icons/Icon-maskable-192.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/web/icons/Icon-maskable-512.png is excluded by !**/*.png
  • packages/stem/example/flutter_stem_example/windows/runner/resources/app_icon.ico is excluded by !**/*.ico
📒 Files selected for processing (142)
  • .github/workflows/stem_flutter.yaml
  • .github/workflows/stem_flutter_sqlite.yaml
  • .gitignore
  • packages/stem/example/email_service/lib/stem_email_service_example.dart
  • packages/stem/example/encrypted_payload/enqueuer/lib/stem_encrypted_enqueuer.dart
  • packages/stem/example/encrypted_payload/worker/lib/stem_encrypted_worker.dart
  • packages/stem/example/flutter_stem_example/.gitignore
  • packages/stem/example/flutter_stem_example/.metadata
  • packages/stem/example/flutter_stem_example/README.md
  • packages/stem/example/flutter_stem_example/analysis_options.yaml
  • packages/stem/example/flutter_stem_example/android/.gitignore
  • packages/stem/example/flutter_stem_example/android/app/build.gradle.kts
  • packages/stem/example/flutter_stem_example/android/app/src/debug/AndroidManifest.xml
  • packages/stem/example/flutter_stem_example/android/app/src/main/AndroidManifest.xml
  • packages/stem/example/flutter_stem_example/android/app/src/main/kotlin/com/example/flutter_stem_example/MainActivity.kt
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/drawable-v21/launch_background.xml
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/drawable/launch_background.xml
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/values-night/styles.xml
  • packages/stem/example/flutter_stem_example/android/app/src/main/res/values/styles.xml
  • packages/stem/example/flutter_stem_example/android/app/src/profile/AndroidManifest.xml
  • packages/stem/example/flutter_stem_example/android/build.gradle.kts
  • packages/stem/example/flutter_stem_example/android/gradle.properties
  • packages/stem/example/flutter_stem_example/android/gradle/wrapper/gradle-wrapper.properties
  • packages/stem/example/flutter_stem_example/android/settings.gradle.kts
  • packages/stem/example/flutter_stem_example/ios/.gitignore
  • packages/stem/example/flutter_stem_example/ios/Flutter/AppFrameworkInfo.plist
  • packages/stem/example/flutter_stem_example/ios/Flutter/Debug.xcconfig
  • packages/stem/example/flutter_stem_example/ios/Flutter/Release.xcconfig
  • packages/stem/example/flutter_stem_example/ios/Runner.xcodeproj/project.pbxproj
  • packages/stem/example/flutter_stem_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  • packages/stem/example/flutter_stem_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • packages/stem/example/flutter_stem_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  • packages/stem/example/flutter_stem_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  • packages/stem/example/flutter_stem_example/ios/Runner.xcworkspace/contents.xcworkspacedata
  • packages/stem/example/flutter_stem_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • packages/stem/example/flutter_stem_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  • packages/stem/example/flutter_stem_example/ios/Runner/AppDelegate.swift
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  • packages/stem/example/flutter_stem_example/ios/Runner/Base.lproj/LaunchScreen.storyboard
  • packages/stem/example/flutter_stem_example/ios/Runner/Base.lproj/Main.storyboard
  • packages/stem/example/flutter_stem_example/ios/Runner/Info.plist
  • packages/stem/example/flutter_stem_example/ios/Runner/Runner-Bridging-Header.h
  • packages/stem/example/flutter_stem_example/ios/Runner/SceneDelegate.swift
  • packages/stem/example/flutter_stem_example/ios/RunnerTests/RunnerTests.swift
  • packages/stem/example/flutter_stem_example/lib/main.dart
  • packages/stem/example/flutter_stem_example/linux/.gitignore
  • packages/stem/example/flutter_stem_example/linux/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/linux/flutter/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/linux/flutter/generated_plugin_registrant.cc
  • packages/stem/example/flutter_stem_example/linux/flutter/generated_plugin_registrant.h
  • packages/stem/example/flutter_stem_example/linux/flutter/generated_plugins.cmake
  • packages/stem/example/flutter_stem_example/linux/runner/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/linux/runner/main.cc
  • packages/stem/example/flutter_stem_example/linux/runner/my_application.cc
  • packages/stem/example/flutter_stem_example/linux/runner/my_application.h
  • packages/stem/example/flutter_stem_example/macos/.gitignore
  • packages/stem/example/flutter_stem_example/macos/Flutter/Flutter-Debug.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Flutter/Flutter-Release.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Flutter/GeneratedPluginRegistrant.swift
  • packages/stem/example/flutter_stem_example/macos/Runner.xcodeproj/project.pbxproj
  • packages/stem/example/flutter_stem_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • packages/stem/example/flutter_stem_example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  • packages/stem/example/flutter_stem_example/macos/Runner.xcworkspace/contents.xcworkspacedata
  • packages/stem/example/flutter_stem_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • packages/stem/example/flutter_stem_example/macos/Runner/AppDelegate.swift
  • packages/stem/example/flutter_stem_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
  • packages/stem/example/flutter_stem_example/macos/Runner/Base.lproj/MainMenu.xib
  • packages/stem/example/flutter_stem_example/macos/Runner/Configs/AppInfo.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Runner/Configs/Debug.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Runner/Configs/Release.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Runner/Configs/Warnings.xcconfig
  • packages/stem/example/flutter_stem_example/macos/Runner/DebugProfile.entitlements
  • packages/stem/example/flutter_stem_example/macos/Runner/Info.plist
  • packages/stem/example/flutter_stem_example/macos/Runner/MainFlutterWindow.swift
  • packages/stem/example/flutter_stem_example/macos/Runner/Release.entitlements
  • packages/stem/example/flutter_stem_example/macos/RunnerTests/RunnerTests.swift
  • packages/stem/example/flutter_stem_example/pubspec.yaml
  • packages/stem/example/flutter_stem_example/test/widget_test.dart
  • packages/stem/example/flutter_stem_example/web/index.html
  • packages/stem/example/flutter_stem_example/web/manifest.json
  • packages/stem/example/flutter_stem_example/windows/.gitignore
  • packages/stem/example/flutter_stem_example/windows/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/windows/flutter/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/windows/flutter/generated_plugin_registrant.cc
  • packages/stem/example/flutter_stem_example/windows/flutter/generated_plugin_registrant.h
  • packages/stem/example/flutter_stem_example/windows/flutter/generated_plugins.cmake
  • packages/stem/example/flutter_stem_example/windows/runner/CMakeLists.txt
  • packages/stem/example/flutter_stem_example/windows/runner/Runner.rc
  • packages/stem/example/flutter_stem_example/windows/runner/flutter_window.cpp
  • packages/stem/example/flutter_stem_example/windows/runner/flutter_window.h
  • packages/stem/example/flutter_stem_example/windows/runner/main.cpp
  • packages/stem/example/flutter_stem_example/windows/runner/resource.h
  • packages/stem/example/flutter_stem_example/windows/runner/runner.exe.manifest
  • packages/stem/example/flutter_stem_example/windows/runner/utils.cpp
  • packages/stem/example/flutter_stem_example/windows/runner/utils.h
  • packages/stem/example/flutter_stem_example/windows/runner/win32_window.cpp
  • packages/stem/example/flutter_stem_example/windows/runner/win32_window.h
  • packages/stem/example/image_processor/lib/stem_image_processor_example.dart
  • packages/stem/example/microservice/beat/lib/stem_microservice_beat.dart
  • packages/stem/example/microservice/enqueuer/lib/stem_microservice_enqueuer.dart
  • packages/stem/example/microservice/worker/lib/stem_microservice_worker.dart
  • packages/stem/example/mixed_cluster/enqueuer/lib/stem_mixed_enqueuer.dart
  • packages/stem/example/mixed_cluster/postgres_worker/lib/stem_mixed_postgres_worker.dart
  • packages/stem/example/mixed_cluster/redis_worker/lib/stem_mixed_redis_worker.dart
  • packages/stem/example/monolith_service/lib/stem_monolith_example.dart
  • packages/stem/example/otel_metrics/lib/stem_otel_metrics_example.dart
  • packages/stem/example/postgres_worker/enqueuer/lib/stem_postgres_enqueuer.dart
  • packages/stem/example/postgres_worker/worker/lib/stem_postgres_worker.dart
  • packages/stem/example/redis_postgres_worker/enqueuer/lib/stem_redis_postgres_enqueuer.dart
  • packages/stem/example/redis_postgres_worker/worker/lib/stem_redis_postgres_worker.dart
  • packages/stem_cli/lib/stem_cli.dart
  • packages/stem_flutter/CHANGELOG.md
  • packages/stem_flutter/README.md
  • packages/stem_flutter/analysis_options.yaml
  • packages/stem_flutter/lib/src/monitor/stem_flutter_queue_monitor.dart
  • packages/stem_flutter/lib/src/monitor/stem_flutter_queue_snapshot.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_dependency_bootstrap.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart
  • packages/stem_flutter/lib/stem_flutter.dart
  • packages/stem_flutter/pubspec.yaml
  • packages/stem_flutter/test/stem_flutter_queue_monitor_test.dart
  • packages/stem_flutter/test/stem_flutter_queue_snapshot_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_host_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_signal_test.dart
  • packages/stem_flutter_sqlite/CHANGELOG.md
  • packages/stem_flutter_sqlite/README.md
  • packages/stem_flutter_sqlite/analysis_options.yaml
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_runtime.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_worker_bootstrap.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_sqlite_worker_launcher.dart
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart
  • packages/stem_flutter_sqlite/lib/stem_flutter_sqlite.dart
  • packages/stem_flutter_sqlite/pubspec.yaml
  • packages/stem_flutter_sqlite/test/stem_flutter_sqlite_runtime_test.dart
  • packages/stem_flutter_sqlite/test/stem_flutter_sqlite_worker_bootstrap_test.dart
  • packages/stem_flutter_sqlite/test/stem_flutter_storage_layout_test.dart
  • packages/stem_sqlite/lib/src/broker/sqlite_broker.dart
  • packages/stem_sqlite/lib/src/connection.dart
  • pubspec.yaml
📜 Review details
🧰 Additional context used
🪛 Clang (14.0.6)
packages/stem/example/flutter_stem_example/ios/Runner/Runner-Bridging-Header.h

[error] 1-1: 'GeneratedPluginRegistrant.h' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/linux/flutter/generated_plugin_registrant.h

[error] 10-10: 'flutter_linux/flutter_linux.h' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/linux/runner/main.cc

[warning] 3-3: use a trailing return type for this function

(modernize-use-trailing-return-type)

packages/stem/example/flutter_stem_example/linux/runner/my_application.h

[error] 4-4: 'gtk/gtk.h' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/windows/runner/main.cpp

[error] 1-1: 'flutter/dart_project.h' file not found

(clang-diagnostic-error)


[warning] 8-8: variable 'APIENTRY' is non-const and globally accessible, consider making it const

(cppcoreguidelines-avoid-non-const-global-variables)

packages/stem/example/flutter_stem_example/windows/runner/utils.h

[error] 4-4: 'string' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/windows/flutter/generated_plugin_registrant.h

[error] 10-10: 'flutter/plugin_registry.h' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/linux/runner/my_application.cc

[warning] 10-10: declaration uses identifier '_MyApplication', which is a reserved identifier

(bugprone-reserved-identifier)


[warning] 10-10: constructor does not initialize these fields: parent_instance, dart_entrypoint_arguments

(cppcoreguidelines-pro-type-member-init)


[warning] 15-15: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 18-18: 2 adjacent parameters of 'first_frame_cb' of similar type ('int *') are easily swapped by mistake

(bugprone-easily-swappable-parameters)


[note] 18-18: the first parameter in the range is 'self'

(clang)


[note] 18-18: the last parameter in the range is 'view'

(clang)


[warning] 24-24: variable 'self' is not initialized

(cppcoreguidelines-init-variables)


[warning] 25-25: variable 'window' is not initialized

(cppcoreguidelines-init-variables)


[warning] 35-35: variable 'use_header_bar' is not initialized

(cppcoreguidelines-init-variables)


[warning] 46-46: variable 'header_bar' is not initialized

(cppcoreguidelines-init-variables)


[warning] 61-61: variable 'view' is not initialized

(cppcoreguidelines-init-variables)


[warning] 62-62: variable 'background_color' is not initialized

(cppcoreguidelines-init-variables)


[warning] 82-82: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 85-85: variable 'self' is not initialized

(cppcoreguidelines-init-variables)


[warning] 122-122: variable 'self' is not initialized

(cppcoreguidelines-init-variables)


[warning] 138-138: use a trailing return type for this function

(modernize-use-trailing-return-type)

packages/stem/example/flutter_stem_example/windows/runner/flutter_window.cpp

[warning] 7-7: constructor does not initialize these fields: project_, flutter_controller_

(cppcoreguidelines-pro-type-member-init)


[warning] 10-10: use '= default' to define a trivial destructor

(modernize-use-equals-default)


[warning] 12-12: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 17-17: variable 'frame' is not initialized

(cppcoreguidelines-init-variables)


[warning] 25-25: redundant boolean literal in conditional return statement

(readability-simplify-boolean-expr)


[warning] 51-51: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 51-51: 2 adjacent parameters of 'MessageHandler' of similar type ('const int') are easily swapped by mistake

(bugprone-easily-swappable-parameters)


[note] 51-51: the first parameter in the range is 'message'

(clang)


[note] 52-52: the last parameter in the range is 'wparam'

(clang)

packages/stem/example/flutter_stem_example/windows/runner/utils.cpp

[warning] 5-5: inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead

(modernize-deprecated-headers)


[warning] 12-12: variable 'unused' is not initialized

(cppcoreguidelines-init-variables)


[warning] 24-24: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 26-26: variable 'argc' is not initialized

(cppcoreguidelines-init-variables)


[warning] 27-27: variable 'argv' is not initialized

(cppcoreguidelines-init-variables)


[warning] 39-39: variable 'argv' is not initialized

(cppcoreguidelines-init-variables)


[warning] 44-44: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 48-48: variable 'target_length' is not initialized

(cppcoreguidelines-init-variables)


[warning] 53-53: variable 'utf8_string' is not initialized

(cppcoreguidelines-init-variables)


[warning] 58-58: variable 'converted_length' is not initialized

(cppcoreguidelines-init-variables)

packages/stem/example/flutter_stem_example/windows/runner/win32_window.cpp

[warning] 16-16: macro 'DWMWA_USE_IMMERSIVE_DARK_MODE' used to declare a constant; consider using a 'constexpr' constant

(cppcoreguidelines-macro-usage)


[warning] 19-19: do not declare C-style arrays, use std::array<> instead

(modernize-avoid-c-arrays)


[warning] 25-25: do not declare C-style arrays, use std::array<> instead

(modernize-avoid-c-arrays)


[warning] 27-27: do not declare C-style arrays, use std::array<> instead

(modernize-avoid-c-arrays)


[warning] 30-30: variable 'g_active_window_count' is non-const and globally accessible, consider making it const

(cppcoreguidelines-avoid-non-const-global-variables)


[warning] 30-30: 'g_active_window_count' is a static definition in anonymous namespace; static is redundant here

(readability-static-definition-in-anonymous-namespace)


[warning] 36-36: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 43-43: variable 'user32_module' is not initialized

(cppcoreguidelines-init-variables)


[warning] 64-64: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 65-65: implicit conversion 'WindowClassRegistrar *' -> bool

(readability-implicit-bool-conversion)


[warning] 73-73: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 82-82: variable 'instance_' is non-const and globally accessible, consider making it const

(cppcoreguidelines-avoid-non-const-global-variables)


[warning] 82-82: variable 'instance_' provides global access to a non-const object; consider making the pointed-to data 'const'

(cppcoreguidelines-avoid-non-const-global-variables)


[warning] 87-87: variable 'instance_' is non-const and globally accessible, consider making it const

(cppcoreguidelines-avoid-non-const-global-variables)


[warning] 87-87: variable 'instance_' provides global access to a non-const object; consider making the pointed-to data 'const'

(cppcoreguidelines-avoid-non-const-global-variables)


[warning] 89-89: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 91-91: variable 'window_class' is not initialized

(cppcoreguidelines-init-variables)


[warning] 123-123: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 131-131: variable 'target_point' is not initialized

(cppcoreguidelines-init-variables)


[warning] 133-133: variable 'monitor' is not initialized

(cppcoreguidelines-init-variables)


[warning] 134-134: variable 'dpi' is not initialized

(cppcoreguidelines-init-variables)


[warning] 135-135: variable 'scale_factor' is not initialized

(cppcoreguidelines-init-variables)


[warning] 137-137: variable 'window' is not initialized

(cppcoreguidelines-init-variables)


[warning] 152-152: use a trailing return type for this function

(modernize-use-trailing-return-type)


[warning] 157-157: variable 'CALLBACK' is non-const and globally accessible, consider making it const

(cppcoreguidelines-avoid-non-const-global-variables)

packages/stem/example/flutter_stem_example/windows/runner/flutter_window.h

[error] 4-4: 'flutter/dart_project.h' file not found

(clang-diagnostic-error)

packages/stem/example/flutter_stem_example/windows/runner/win32_window.h

[error] 4-4: 'windows.h' file not found

(clang-diagnostic-error)

🪛 Cppcheck (2.20.0)
packages/stem/example/flutter_stem_example/windows/flutter/generated_plugin_registrant.cc

[style] 10-10: The function 'RegisterPlugins' is never used.

(unusedFunction)

packages/stem/example/flutter_stem_example/linux/flutter/generated_plugin_registrant.cc

[style] 10-10: The function 'fl_register_plugins' is never used.

(unusedFunction)

packages/stem/example/flutter_stem_example/linux/runner/main.cc

[error] 6-6: There is an unknown macro here somewhere. Configuration is required. If G_DECLARE_FINAL_TYPE is a macro then please configure it.

(unknownMacro)

packages/stem/example/flutter_stem_example/windows/runner/main.cpp

[style] 8-8: The function 'wWinMain' is never used.

(unusedFunction)

packages/stem/example/flutter_stem_example/linux/runner/my_application.cc

[error] 6-6: There is an unknown macro here somewhere. Configuration is required. If G_DECLARE_FINAL_TYPE is a macro then please configure it.

(unknownMacro)

packages/stem/example/flutter_stem_example/windows/runner/utils.cpp

[style] 10-10: The function 'CreateAndAttachConsole' is never used.

(unusedFunction)


[style] 24-24: The function 'GetCommandLineArguments' is never used.

(unusedFunction)

packages/stem/example/flutter_stem_example/windows/runner/win32_window.cpp

[style] 123-123: The function 'Create' is never used.

(unusedFunction)


[style] 152-152: The function 'Show' is never used.

(unusedFunction)


[style] 241-241: The function 'SetChildContent' is never used.

(unusedFunction)


[style] 258-258: The function 'GetHandle' is never used.

(unusedFunction)


[style] 262-262: The function 'SetQuitOnClose' is never used.

(unusedFunction)

🪛 HTMLHint (1.9.2)
packages/stem/example/flutter_stem_example/web/index.html

[warning] 2-2: An lang attribute must be present on elements.

(html-lang-require)

🪛 markdownlint-cli2 (0.22.0)
packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

[warning] 5-5: Files should end with a single newline character

(MD047, single-trailing-newline)

🪛 SwiftLint (0.63.2)
packages/stem/example/flutter_stem_example/ios/RunnerTests/RunnerTests.swift

[Warning] 5-5: Classes should have an explicit deinit method

(required_deinit)

packages/stem/example/flutter_stem_example/ios/Runner/SceneDelegate.swift

[Warning] 4-4: Classes should have an explicit deinit method

(required_deinit)

packages/stem/example/flutter_stem_example/macos/RunnerTests/RunnerTests.swift

[Warning] 5-5: Classes should have an explicit deinit method

(required_deinit)

packages/stem/example/flutter_stem_example/macos/Runner/MainFlutterWindow.swift

[Warning] 4-4: Classes should have an explicit deinit method

(required_deinit)

packages/stem/example/flutter_stem_example/macos/Runner/AppDelegate.swift

[Warning] 5-5: Classes should have an explicit deinit method

(required_deinit)

packages/stem/example/flutter_stem_example/ios/Runner/AppDelegate.swift

[Warning] 8-8: Prefer empty collection over optional collection

(discouraged_optional_collection)


[Warning] 5-5: Classes should have an explicit deinit method

(required_deinit)

🪛 YAMLlint (1.38.0)
packages/stem_flutter/analysis_options.yaml

[error] 7-7: too many blank lines (1 > 0)

(empty-lines)

Comment thread packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart Outdated
Comment thread packages/stem_flutter_sqlite/pubspec.yaml Outdated
Comment thread packages/stem_flutter_sqlite/pubspec.yaml Outdated
Comment thread packages/stem_flutter_sqlite/README.md
Comment thread packages/stem_flutter_sqlite/test/stem_flutter_sqlite_runtime_test.dart Outdated
Comment thread packages/stem/example/flutter_stem_example/pubspec.yaml Outdated
Comment thread packages/stem/example/flutter_stem_example/pubspec.yaml
Comment thread packages/stem/example/flutter_stem_example/README.md
Comment thread packages/stem/example/flutter_stem_example/web/index.html Outdated
Comment thread pubspec.yaml Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Package publishing

Package Version Status Publish tag (post-merge)
package:stem 0.2.1 already published at pub.dev
package:stem_adapter_tests 0.1.2 already published at pub.dev
package:stem_builder 0.2.0 already published at pub.dev
package:stem_cli 0.1.0 already published at pub.dev
package:stem_flutter 0.1.0 ready to publish stem_flutter-v0.1.0
package:stem_flutter_sqlite 0.1.0 ready to publish stem_flutter_sqlite-v0.1.0
package:stem_memory 0.1.0 already published at pub.dev
package:stem_postgres 0.1.1 already published at pub.dev
package:stem_redis 0.1.1 already published at pub.dev
package:stem_sqlite 0.1.3 ready to publish stem_sqlite-v0.1.3

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

coderabbitai[bot]
coderabbitai Bot previously requested changes Apr 23, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

♻️ Duplicate comments (1)
packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart (1)

135-147: ⚠️ Potential issue | 🟡 Minor

Fixed 400 ms grace before Isolate.immediate kill is still insufficient for SQLite cleanup.

dispose() unconditionally kills the isolate with Isolate.immediate after the default 400 ms requestShutdown delay. Warm shutdown (worker.shutdown, backend.close, broker.close, in-flight job teardown) on mobile SQLite routinely exceeds this, risking truncated writes and lost heartbeats on teardown. Prefer awaiting a stopped/exit signal up to a longer timeout before falling back to kill.

🔧 Suggested direction
   Future<void> dispose() async {
     if (_disposed) return;
     _disposed = true;
-    await requestShutdown();
-    _isolate.kill(priority: Isolate.immediate);
+    await requestShutdown();
+    // Give the worker a chance to finish warm shutdown before killing.
+    try {
+      await _exit.first.timeout(const Duration(seconds: 5));
+    } on TimeoutException {
+      _isolate.kill(priority: Isolate.immediate);
+    }
     await _messagesSub.cancel();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart` around
lines 135 - 147, dispose() currently kills the isolate immediately after
requestShutdown() and the default 400ms grace, which is insufficient for mobile
SQLite cleanup; modify dispose() (the method using requestShutdown(),
_isolate.kill, _exitSub and the _exit stream/controller) to instead await a
stop/exit signal from the worker (e.g., listen for an exit/stopped event on the
_exit stream or _exit controller or wait on _exitSub) with a longer configurable
timeout (several seconds), and only call _isolate.kill(Isolate.immediate) as a
fallback after that timeout elapses; ensure subscriptions (_messagesSub,
_errorsSub, _exitSub) and stream/controller closures remain properly cleaned up
whether the isolate exits gracefully or is force-killed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/stem_flutter.yaml:
- Around line 28-36: The cache key in the "Get Dart packages cache" step uses
hashFiles('**/pubspec.lock') which is ineffective because pubspec.lock is
gitignored; update the cache key to hash the committed files instead (e.g.,
hashFiles('**/pubspec.yaml') or combine both hashFiles('**/pubspec.yaml') and
hashFiles('**/pubspec.lock')) so dependency changes invalidate the cache;
specifically modify the key expression used in the Get Dart packages cache step
to reference pubspec.yaml (or both files) instead of only pubspec.lock.

In
`@packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart`:
- Around line 46-55: Before returning the StemFlutterStorageLayout, validate
that the broker and backend files do not collide: after constructing the File
objects (brokerFile and backendFile) or by comparing brokerFileName vs
backendFileName (and resolving with root.path/Platform.pathSeparator) ensure the
two paths are distinct and if they are equal throw/raise an ArgumentError (or
similar) with a clear message rejecting identical broker/backend filenames; add
this check in the same factory function that builds and returns
StemFlutterStorageLayout so callers cannot create a layout that points both
stores at the same SQLite file.

In `@packages/stem_flutter_sqlite/pubspec.yaml`:
- Line 15: The private import
stem_flutter/src/runtime/stem_flutter_dependency_bootstrap.dart creates a semver
break risk because stem_flutter_sqlite declares stem_flutter: ">=0.1.0 <0.2.0";
either pin the dependency to the exact intended workspace version (e.g., change
the version string in packages/stem_flutter_sqlite/pubspec.yaml from ">=0.1.0
<0.2.0" to the specific version you control, e.g., "0.1.0") or instead make the
bootstrap helper a public export in stem_flutter (move or re-export the symbol
from src/runtime in stem_flutter's public API) and update the import in
stem_flutter_sqlite to the public path; reference the private import path
stem_flutter/src/runtime/stem_flutter_dependency_bootstrap.dart and the pubspec
dependency entry when making the change.

In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart`:
- Around line 84-104: The existing non-standard inline ignores on the three
subscriptions (messagesSub, errorsSub, exitSub) use a `reason:` field which Dart
ignores; update each to follow the document_ignores convention by placing a
normal comment with the justification immediately above the subscription, then
put a standalone `// ignore: cancel_subscriptions` on its own line directly
above the subscription declaration; apply this pattern to the messagesSub,
errorsSub, and exitSub declarations and remove the `reason:` text from the
ignore lines.

In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart`:
- Around line 117-127: The ready branch in tryParse uses a checked cast
'raw['sendPort'] as SendPort?' which will throw if the payload contains a
non-SendPort value; change it to a safe runtime-type check and only accept a
SendPort when it actually is one (e.g., extract raw['sendPort'] into a local,
check 'is SendPort', and pass the SendPort or null into
StemFlutterWorkerSignal.ready), updating the ready mapping in tryParse
accordingly so malformed payloads don't raise TypeError.

In `@packages/stem/example/flutter_stem_example/lib/main.dart`:
- Around line 201-211: In _shutdownResources: change the teardown order so you
cancel the monitor subscription (_monitorSub?.cancel()) and dispose the monitor
(_monitor?.dispose()) before disposing the worker host (_workerHost?.dispose())
and closing the runtime (_runtime?.close()) to avoid the monitor firing
refresh() while the runtime is closing; also simplify awaits by removing the
redundant "?? Future<void>.value()" and just await the nullable futures
directly, and finally null out _workerHost, _monitor, _runtime, and _monitorSub
as before.

In `@packages/stem/example/flutter_stem_example/web/index.html`:
- Around line 19-32: Add a mobile viewport meta (e.g., meta name="viewport"
content="width=device-width, initial-scale=1") to the head to ensure proper
mobile rendering, and replace placeholder project labels used in the page
metadata and PWA fields—specifically update the title element, the meta
name="apple-mobile-web-app-title" value, and the meta name="description" to a
concise, user-facing app name/description (for example "Stem Example" or
"Flutter Stem Example") so the browser and PWA UI no longer show the default
project-id placeholder.

---

Duplicate comments:
In `@packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart`:
- Around line 135-147: dispose() currently kills the isolate immediately after
requestShutdown() and the default 400ms grace, which is insufficient for mobile
SQLite cleanup; modify dispose() (the method using requestShutdown(),
_isolate.kill, _exitSub and the _exit stream/controller) to instead await a
stop/exit signal from the worker (e.g., listen for an exit/stopped event on the
_exit stream or _exit controller or wait on _exitSub) with a longer configurable
timeout (several seconds), and only call _isolate.kill(Isolate.immediate) as a
fallback after that timeout elapses; ensure subscriptions (_messagesSub,
_errorsSub, _exitSub) and stream/controller closures remain properly cleaned up
whether the isolate exits gracefully or is force-killed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 676e8769-5a5d-4b49-ab4e-ffe7f2343308

📥 Commits

Reviewing files that changed from the base of the PR and between f1891a1 and ce9afe9.

📒 Files selected for processing (31)
  • .github/workflows/dashboard.yaml
  • .github/workflows/publish.yaml
  • .github/workflows/stem.yaml
  • .github/workflows/stem_cli.yaml
  • .github/workflows/stem_flutter.yaml
  • .github/workflows/stem_flutter_sqlite.yaml
  • .github/workflows/stem_memory.yaml
  • .github/workflows/stem_postgres.yaml
  • .github/workflows/stem_redis.yaml
  • .github/workflows/stem_sqlite.yaml
  • packages/stem/example/flutter_stem_example/README.md
  • packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  • packages/stem/example/flutter_stem_example/lib/main.dart
  • packages/stem/example/flutter_stem_example/pubspec.yaml
  • packages/stem/example/flutter_stem_example/web/index.html
  • packages/stem_flutter/CHANGELOG.md
  • packages/stem_flutter/README.md
  • packages/stem_flutter/analysis_options.yaml
  • packages/stem_flutter/lib/src/monitor/stem_flutter_queue_monitor.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart
  • packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart
  • packages/stem_flutter/pubspec.yaml
  • packages/stem_flutter/test/stem_flutter_queue_monitor_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_host_test.dart
  • packages/stem_flutter/test/stem_flutter_worker_signal_test.dart
  • packages/stem_flutter_sqlite/CHANGELOG.md
  • packages/stem_flutter_sqlite/README.md
  • packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart
  • packages/stem_flutter_sqlite/pubspec.yaml
  • packages/stem_flutter_sqlite/test/stem_flutter_sqlite_runtime_test.dart
  • pubspec.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test
🔇 Additional comments (24)
packages/stem_flutter_sqlite/CHANGELOG.md (1)

1-5: LGTM!

The initial changelog entry is clear and aligned with the new Flutter SQLite adapter package.

packages/stem_flutter/CHANGELOG.md (1)

1-7: LGTM!

The changelog accurately summarizes the initial stem_flutter integration surface.

packages/stem_flutter/analysis_options.yaml (1)

1-6: LGTM!

The package analyzer config cleanly inherits the shared rules and excludes generated sources.

packages/stem/example/flutter_stem_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (1)

1-5: LGTM!

The launch image customization instructions are clear and fit this generated Flutter asset directory.

pubspec.yaml (2)

10-11: LGTM!

Adding both Flutter packages to the workspace is consistent with the new package manifests and CI direction.


21-21: Align the meta override with package constraints.

The root pubspec.yaml allows meta: ^1.17.0 in dependency_overrides (line 21), but packages/stem/pubspec.yaml, packages/stem_sqlite/pubspec.yaml, and packages/dashboard/pubspec.yaml all declare meta: ^1.18.0. This permits CI to resolve a version incompatible with those packages' declared constraints.

.github/workflows/stem_postgres.yaml (1)

31-43: LGTM!

Using Flutter for workspace dependency resolution while keeping the package’s dart test flow is appropriate here.

.github/workflows/stem.yaml (1)

29-41: LGTM!

This correctly resolves the workspace with Flutter while preserving the pure Dart test execution for packages/stem.

.github/workflows/stem_redis.yaml (1)

31-43: LGTM!

The Flutter-based dependency resolution is consistent with the mixed workspace, and the existing Dart test flow remains intact.

packages/stem_flutter_sqlite/pubspec.yaml (1)

16-16: stem_sqlite version bound now matches the package version.

The constraint accepts 0.1.1, which aligns with the local packages/stem_sqlite/pubspec.yaml version shown in the provided context.

.github/workflows/publish.yaml (1)

23-24: LGTM — publish validation now has Flutter available.

use-flutter: true is the expected input for the reused Dart ecosystem publisher and is currently declared by the upstream workflow: https://raw.githubusercontent.com/dart-lang/ecosystem/main/.github/workflows/publish.yaml

.github/workflows/stem_sqlite.yaml (1)

31-43: LGTM — workspace resolution uses the Flutter SDK now.

This matches the new Flutter package requirements while keeping the package’s existing Dart test command unchanged.

.github/workflows/stem_memory.yaml (1)

26-38: LGTM — Flutter setup is consistent with the workspace change.

Using flutter pub get at the workspace root should unblock resolution for Flutter SDK dependencies while preserving the existing dart test flow.

.github/workflows/stem_cli.yaml (1)

33-45: LGTM — dependency resolution now supports Flutter packages.

The workflow still runs the existing CLI tests after resolving the workspace through Flutter.

.github/workflows/dashboard.yaml (1)

29-41: LGTM — dashboard CI follows the workspace toolchain migration.

Even though the dashboard package is pure Dart, resolving from the root with Flutter is consistent with the new Flutter packages in the workspace.

.github/workflows/stem_flutter_sqlite.yaml (1)

36-44: Same pubspec.lock cache-key caveat as stem_flutter.yaml.

If lock files aren't committed, hashFiles('**/pubspec.lock') evaluates to a constant and the cache never invalidates on dependency changes. Apply the same fix here for consistency.

packages/stem/example/flutter_stem_example/pubspec.yaml (1)

55-64: Redundant dependency_overrides for stem and stem_flutter.

Both are already declared as path: dependencies above (lines 33-36), so repeating them in dependency_overrides adds no value and risks drift if the top-level paths ever change. Keep only meta, stem_memory, and stem_sqlite here.

♻️ Proposed diff
 dependency_overrides:
   meta: ^1.17.0
-  stem:
-    path: ../..
-  stem_flutter:
-    path: ../../../stem_flutter
   stem_memory:
     path: ../../../stem_memory
   stem_sqlite:
     path: ../../../stem_sqlite
packages/stem_flutter/README.md (1)

75-93: startMobileWorker still drops host/monitor handles.

The example returns Future<void> and loses both the spawned StemFlutterWorkerHost and the StemFlutterQueueMonitor, so a reader copying this cannot shut the worker down or stop polling. Return a small struct (or accept owner-owned storage) so the lifecycle is obvious to readers of the README.

📝 Suggested shape
-Future<void> startMobileWorker({
+class MobileWorkerHandles {
+  MobileWorkerHandles(this.host, this.monitor);
+  final StemFlutterWorkerHost host;
+  final StemFlutterQueueMonitor monitor;
+}
+
+Future<MobileWorkerHandles> startMobileWorker({
   required Broker broker,
   required ResultBackend backend,
 }) async {
   ...
   await monitor.start();
+  return MobileWorkerHandles(host, monitor);
 }
packages/stem_flutter/test/stem_flutter_worker_host_test.dart (1)

35-105: LGTM — good coverage of ready/shutdown, fatal, and replay semantics.

Timeouts are bounded (2s), teardown disposes the host, and the three scenarios (signal forwarding, error surfacing, late-subscriber replay) cleanly exercise StemFlutterWorkerHost.

packages/stem_flutter/pubspec.yaml (1)

5-5: Root workspace correctly includes this package and sibling.

Confirmed: the root pubspec.yaml lists packages/stem_flutter and packages/stem_flutter_sqlite in the workspace: array, so resolution: workspace will resolve correctly.

packages/stem_flutter/test/stem_flutter_queue_monitor_test.dart (1)

63-279: LGTM.

Fake broker/backend are deterministic, heartbeat freshness uses heartbeatInterval * 3 = 3s against a 200ms offset so the window is stable under CI scheduling, and the sticky/lifecycle transitions exercise the monitor’s error-recovery path well.

packages/stem_flutter_sqlite/test/stem_flutter_sqlite_runtime_test.dart (1)

89-111: LGTM.

Both futures are subscribed before either is awaited, so the back-to-back ready/status(running) emission on the broadcast stream is no longer racy. Pipe-delimited detail decoding is also robust against the fixed encoding in _sqliteLauncherEntry.

packages/stem_flutter_sqlite/README.md (1)

105-149: LGTM.

The worker-isolate snippet now wraps lifecycle inside try/finally so worker.shutdown(), stores.close(), and commands.close() always run. Example also correctly mirrors StemFlutterSqliteWorkerStores.open and command-port usage from the actual launcher.

packages/stem_flutter/lib/src/monitor/stem_flutter_queue_monitor.dart (1)

59-163: LGTM.

start() now rolls back _started on refresh failure so the monitor can be retried, bindWorkerSignals awaits the old subscription before installing the new one, and refresh() surfaces I/O failures via _applyRefreshFailure while still rethrowing for direct callers. Sticky worker-status handling correctly suppresses heartbeat-based overrides after a fatal signal.

Comment thread .github/workflows/stem_flutter.yaml
Comment thread packages/stem_flutter_sqlite/lib/src/runtime/stem_flutter_storage_layout.dart Outdated
Comment thread packages/stem_flutter_sqlite/pubspec.yaml
Comment thread packages/stem_flutter/lib/src/runtime/stem_flutter_worker_host.dart Outdated
Comment thread packages/stem_flutter/lib/src/runtime/stem_flutter_worker_signal.dart Outdated
Comment thread packages/stem/example/flutter_stem_example/lib/main.dart
Comment thread packages/stem/example/flutter_stem_example/web/index.html Outdated
@kingwill101
Copy link
Copy Markdown
Owner Author

Addressed the remaining actionable CodeRabbit feedback in 723162c. A few generated/example scaffold notes are intentionally left unchanged: Android example app id/debug signing, optional Gradle wrapper checksum hardening, and the generated macOS window scaffold. The Flutter example keeps the first-party path overrides for local workspace resolution; removing the stem/stem_flutter overrides makes pub get resolve those transitive first-party packages from hosted pub instead of the local checkout. The meta override is now ^1.18.0.

@kingwill101 kingwill101 dismissed stale reviews from coderabbitai[bot] and coderabbitai[bot] April 23, 2026 08:44

Stale automated review; all non-outdated review threads are resolved and the latest CodeRabbit check passed.

@kingwill101 kingwill101 merged commit aa61a32 into master Apr 23, 2026
12 checks passed
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