Skip to content

feat(ios): log typed sleep marks through Shortcuts - #2651

Open
kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/ios-sleep-mark-shortcut-2266
Open

kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/ios-sleep-mark-shortcut-2266

Conversation

@kavemang

@kavemang kavemang commented Oct 3, 2026 •

Copy link
Copy Markdown

What this PR does

Adds Log Sleep Mark to iOS Shortcuts with a Bedtime default and a Wake choice. Running it captures the invocation time without opening NOOP. The existing active-scene drain saves the typed mark when NOOP next becomes active, even after midnight; the reply explicitly says it is queued. This is logging only and does not set sleep bounds or feed detection.

The existing string-array queue format and keys stay compatible with queued moment, buzz and Coach requests. A shared, directly tested helper handles the timestamp/type projection; malformed entries cannot turn into a new mark at drain time or overflow its integer timestamp. Queue callers are serialized on MainActor within the app process. The shared mark path keeps its bedtime default for wrist gestures and uses the canonical typed log line.

This addresses only sleep-mark actions from the issue. Caffeine and water Shortcuts remain outstanding. Android is unchanged because App Intents are an Apple framework; the existing sleep_mark representation (bedtime 0 / wake 1) and sleep algorithms are unchanged.

Type of change

  • New feature

How it was tested

  • Six committed queue tests passed in a temporary Linux Swift package using the exact helper/test files and extracted production SleepMark timestamp/type/metric projection. Only unchanged MetricPoint fields stand in for the storage module. Coverage: capture-time retention after queue reload, bedtime/wake 0/1 values, legacy requests, ordering, one-shot drain, colon-containing Coach question, malformed/non-finite/out-of-range timestamps, unavailable queue.
  • All 338 Tools tests and 50 parity acceptance tests passed; Swift syntax parse, global doc-comment lint, i18n audit against origin/main and whitespace checks passed.
  • New intent copy has translations in all ten existing Apple catalog locales. No UI colors/fonts/spacing changed.
  • Exact-head upstream CI passed all six checks: universal macOS app + StrandTests, iOS simulator app, Android, Tools Python, i18n and hygiene. The macOS test log confirms all six new queue regressions executed and passed; the full suite ran 2,275 tests with zero failures and two skips. Android source is unchanged; its unit-test task was served from CI cache. Linux parse and the pure harness do not validate SDK typing. XcodeGen is unavailable on this server; CI ran xcodegen generate and compiled both targets from the existing source folder rules.

No iPhone, Siri, locked-device/App Group protection or strap behavior tested. Draft pending manual Shortcut invocation, selecting both kinds, and verifying the captured timestamp/type after resuming NOOP. Persistence retains the existing Phase-1 one sleep_mark value per source/day and timestamp/log history; this does not add a sleep-boundary timeline.

Checklist

  • No Swift package changes; pure queue tests passed
  • No Android changes
  • Both app targets compiled with Apple SDKs; StrandTests passed
  • No warnings in local changed helper/tests
  • UI changes use existing localization/design conventions
  • No hardcoded frames or BLE commands added
  • Follows docs/CONTRIBUTING.md
  • No generated projects, secrets or build output committed

Related issues

Refs #2266

@kavemang
kavemang marked this pull request as ready for review October 3, 2026 06:09
DX23876 added a commit to DX23876/noop that referenced this pull request Oct 7, 2026
Adds Log Sleep Mark to Shortcuts with a Bedtime default and a Wake
choice. It captures the invocation time without opening NOOP and queues
the mark in the App Group; the existing active-scene drain saves it with
the captured time. The intent queue moves into PendingIntentQueue, a
shared helper tested directly, and malformed entries cannot become a mark.

From upstream PR ryanbr#2651 by @kavemang. The fork's goals intent
flag stays beside the new queue. The PR's paragraph for docs/IOS.md is not
taken: the fork's iOS guide has no Shortcuts section to hold it.

Analysis migration required: no
Retain the sleep mark intent translations alongside current main catalog
additions. Preserve the typed queue and invocation-time projection.

Refs #2266
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