Skip to content

feat(Daylight): capture bay light with RAW preservation and Mastodon publishing - #312

Open
kyleve wants to merge 7 commits into
mainfrom
codex/daylight
Open

feat(Daylight): capture bay light with RAW preservation and Mastodon publishing#312
kyleve wants to merge 7 commits into
mainfrom
codex/daylight

Conversation

@kyleve

@kyleve kyleve commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Created by an AI agent on Kyle's behalf.

Summary

Add Daylight, a dedicated foreground iPhone camera for sunrise and sunset sequences. The default schedule takes 13 photos per event at five-minute intervals. Each supported shutter capture preserves RAW/Apple ProRAW and a JPEG companion in one Photos asset. JPEG-only configurations are identified in history.

The app includes live framing, rear-camera lens selection, zoom and exposure compensation, manual test shots, editable coordinates/time zone/windows, sequence history, and a dark unattended screen. Photographic editing is deferred; originals remain available for future transformations.

Architecture

  • DaylightCore owns NOAA scheduling, the serial-executor camera service, Photos archival, Vision ranking, atomic versioned storage, and capture/delivery orchestration.
  • DaylightMastodon owns account configuration, account-bound Keychain credentials, JPEG upload limits, metadata removal, retries, durable media checkpoints, and post receipts.
  • Compiled adapters register at the app root and receive typed captured-image or sequence-highlight events, including both source resources when available. Capture and scheduling do not switch on destination names.
  • DaylightUI uses Broadway, localized strings, main-actor observable models, and the shared snapshot harness. New unit bundles join Stuff-iOS-Tests; one image bundle joins StuffSnapshotTests.

Recovery and review focus

Capture must remain foreground. Arming disables automatic locking and dims the display; disarming and backgrounding restore the prior settings. Missed slots are recorded without catch-up bursts. RAW/JPEG bytes are staged before Photos and publishing. Pending, failed, and ambiguous work retains its files; Photos assets are never automatically deleted.

Mastodon receives one selected non-utility image after each sequence closes. Test shots never publish. Uncertain status submissions stop for reconciliation before the one-hour idempotency window expires. Review the camera delegate's paired callbacks, Photos resource transaction/receipt, and persisted submission checkpoint boundaries.

Foreground runs own their state updates and camera cleanup. A completed capture cycle cannot undo a stop request, and old run cleanup cannot stop a newer session. Highlight delivery registration completes before selection permits staged-file cleanup.

Photos permission failures retry after a persisted delay. Unknown outcomes retain receipts for reconciliation. History includes explicit Photos and publishing recovery, including recording an existing post URL without submitting again. Replacement posts retain their original account binding, delivery identity, and prior checkpoints.

Mastodon retries validate wall time and uptime immediately before submission. Clock discontinuities, reboot, and unverifiable older submissions require reconciliation. Damaged Mastodon configuration disables publishing while local capture remains available; reconnecting preserves the damaged file.

Compatibility

Captures from the early pre-RAW build retain their Photos identifiers when format and delivery checkpoints are absent. Live framing requests camera access independently of archive loading, with cancellation checked before preview startup.

Testing

  • ./test --all: 2,050 tests passed, including the app build, architecture checks, and backup-upgrader regressions.
  • Deterministic regressions cover stop during capture processing, stale foreground cleanup, cleanup during highlight registration, permission restoration across relaunch, retained Photos receipts, post reconciliation, clock changes, and original-account binding.
  • ./test --no-generate --no-build --snapshots --only DaylightUISnapshotTests --record never: six suites and fourteen reviewed image references passed. Recovery forms include standard and accessibility text sizes.
  • ./swiftformat --lint, ./sf-symbols --lint, ./xcstrings --lint, ./shellcheck, and ./attribution --check: passed.
  • Regenerated through ./ide --no-open and synchronized agent instructions.
  • Built and installed commit 71ad15b2 on the paired iPhone 17 Pro Max with --no-launch.

Device acceptance and follow-ups

The paired iPhone is not the eventual camera device. Real RAW/Photos capture, sustained thermal behavior, a complete sunrise/sunset cycle, and live Mastodon delivery still require physical acceptance and account credentials. The installer and device checklist are included. Website/kve.me, Instagram, and optional editing are tracked in Daylight/TODOs.md.

Groundwork for the dedicated camera app. Adds offline solar scheduling, immutable sequence settings, local staging, image selection, and adapter interfaces. Validated with ./test DaylightCoreTests (passed).
Adds a serial AVFoundation camera, bounded filtered preview, shared Core Image recipes, local Vision scoring, and original-plus-adjustment Photos transactions. Validated with ./test DaylightCoreTests.
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