# V1 Block 27 — Deployment & Dev Experience

**Purpose**: Dev scripts and packaging.

> **Note for Codex**: Follow tasks exactly; avoid exploratory calls when tasks specify names/files/tests.

## Chunk 27.1 — Dev/test scripts & CI
Recommended level: **HIGH**

Status: Complete on 2026-06-26.

### Tasks
1. Create `scripts/dev.dart` which executes `dart run build_runner watch` and launches Flutter desktop with hot reload pointing to local SQLite file.
2. Create `scripts/test.dart` running `dart pub global activate coverage`, `dart test --coverage=coverage`, then combine reports.
3. GitHub Actions YAML to run tests matrix {ubuntu-latest, windows-latest, macos-latest}.

### Acceptance criteria
1. Running `dart run scripts/dev.dart` starts app and prints sqlite path.
2. CI green on all platforms.

### Completed implementation
1. Added `scripts/dev.dart` that prints the SQLite path, starts `dart run build_runner watch --delete-conflicting-outputs`, and launches `flutter run` for the current/selected desktop device with `SCHEDULER_SQLITE_PATH`.
2. Added `scripts/test.dart` that runs `dart pub global activate coverage`, `dart test --coverage=coverage`, combines LCOV with `coverage:format_coverage`, and enforces the 80% threshold.
3. Updated `scripts/test.sh` to run analyzer plus `scripts/test.dart`.
4. Added GitHub Actions workflow `.github/workflows/ci.yml` with test matrix `ubuntu-latest`, `windows-latest`, and `macos-latest`.
5. Added `scripts/bootstrap_dev.sh` and `scripts/dev.sh` wrappers so the
   agent rule file has concrete shell entry points for setup and development.

### Verification
1. `dart pub get`: passed.
2. `dart format scripts/dev.dart scripts/test.dart`: passed.
3. `dart analyze`: passed, no issues found.
4. `dart run scripts/test.dart`: passed, coverage 83.27%.
5. `bash -n scripts/bootstrap_dev.sh scripts/dev.sh`: passed.
6. `scripts/test.sh`: passed.
7. `dart run scripts/dev.dart` and `scripts/dev.sh`: not executed locally because they launch a long-running Flutter desktop session and require the Flutter app/toolchain.

---

## Chunk 27.2 — Packaging scripts
Recommended level: **HIGH**

Status: Complete on 2026-06-26.

### Tasks
1. Add `scripts/build.dart` building Flutter macOS .app, Windows .exe + msix, Linux AppImage.
2. Document prerequisites in README.

### Acceptance criteria
1. Artifacts upload step in CI produces release binaries.

### Completed implementation
1. Added `scripts/build.dart` with platform targets `current`, `macos`, `windows`, and `linux`.
2. macOS target runs `flutter build macos --release` and copies `.app` artifacts.
3. Windows target runs `flutter build windows --release`, copies the release bundle, and runs `dart run msix:create`.
4. Linux target runs `flutter build linux --release` and `appimage-builder --recipe AppImageBuilder.yml --skip-test`.
5. Added tagged CI packaging job with matrix `linux`, `windows`, and `macos`, plus artifact upload from `build/releases/`.
6. Replaced README with workspace test, development, packaging, and prerequisite instructions.
7. Added `scripts/package_release.sh` wrapper for the release packaging runner
   named in the agent rule file.

### Verification
1. `dart format scripts/build.dart`: passed.
2. `dart analyze`: passed, no issues found.
3. `bash -n scripts/package_release.sh`: passed.
4. `scripts/test.sh`: passed.
5. Packaging commands were not executed locally because they require Flutter desktop toolchains, platform-specific packaging tools, and app packaging config.

---
