asterism branch worktree-today-release-shelf commits 4 + review fixes files 32 touched lines +2687 / -438

Pre-push review: worktree-today-release-shelf

Today v2 (release shelf, catch-up card, noted timeline) plus the catch-up-progress spec, reviewed against main at d9d10208.

At a glance

  • Today gains a serif date header (with the Settings gear), a dot-free week strip, a horizontal releasing shelf, a one-card Catching up section and a noted timeline.

  • No schema change: the progress part (latest released chapter) is specified in specs/catch-up-progress/ and not built.

  • Review fixes: past-day badges, the timeline's attention mark, one checked work URL, shared entry-row pills, honest Next capsule label.

Verdict

Ready to push

Four review passes raised seven major findings; all are fixed with tests where behaviour changed. Core (2,996 tests), the app unit bundle and the Mac build pass after the fixes. Remaining items are skipped minors and UI-coverage follow-ups listed below.

Review findings

22 raised · 16 fixed · 6 skipped

Jump to findings →

Tests

Pass rate: 100% (3210 of 3210)

New tests: 24

Diff coverage: 100% (229 of 229 added lines)

Jump to tests →

Commits

Three-level explanation

What changed

The app's Today screen was redesigned. The day you are looking at is now a large title you can tap to jump back to today. Works releasing that day appear as a row of book covers you swipe sideways; ones you have not read yet glow and show the next chapter number. Works you are behind on sit together in one card, each on one line. Your notes for the day hang on a timeline with the full note text.

Why it matters

The old screen repeated the same information in several places and spent a lot of space on each work. The new one shows more at once and makes "what should I read next" the obvious thing.

Key concepts

  • Shelf: a sideways-scrolling row, like books on a shelf.
  • Accessibility sizes: very large text settings; there the shelf falls back to a vertical list, because a narrow cover cannot hold large text.

Changes overview

  • TodaySections.swift (new): TodayHeader, ReleaseShelf, CatchUpCard, NotedTimelineRow, plus shared TodayEntryPills/TodayWarningLine.
  • TodayText.swift: pure, nonisolated wording and ordering helpers (ReleaseShelfText, CatchUpText, ChapterNumberText, TodayHeaderText), unit-tested.
  • TodayDayPlan.swift (Core): ReleaseRow carries last chapter, last-noted day, releases since and the work URL, all derived in the existing locked read.
  • CompactRootView: gear moves into the header; Today's nav bar is hidden on the phone.

Approach

Views only draw; every decision (ordering, badges, labels, visibility) is a pure function in TodayText or Core so it can be tested without a view. The header and week strip are list rows, so they scroll with the day.

Trade-offs

The Next capsule opens the work page rather than a chapter, because no site rule can build a chapter URL; its spoken label says so. Show all expands in place because the Library filter is per-visit state with no route into it.

Deep dive

  • Chapter numbers go through ChapterKeyDerivation.key and only single-component keys count, so 5.07 (volume.chapter) gets no badge rather than a wrong one.
  • releaseCount counts whole weeks arithmetically and the remainder by weekday number from one calendar lookup, in calendar days, so DST weeks count once; tested in Amsterdam and Sydney.
  • A past day's badge uses the newest note on or before that day; the "Last noted" line keeps Q16's newest-overall by design.
  • WorkSnapshot.primaryURL is now the single scheme-checked spelling of "the work's page" (Today and Series).

Architecture impact

No schema, marker or archive change. The share extension is untouched. Several update-schedule and catch-up-mode decisions are superseded and marked as such. ReleaseRow gained fields that catch-up-progress will redefine (R, the highest chapter read).

Potential issues

  • Expanded Show all draws every catch-up row in one List cell.
  • Episode vs chapter wording depends on reader-named work types (whole-word match).
  • The accessibility-size fallback and Show all have no UI test yet.

Completeness against the handover

Done: §2, §3, §4, §8, §5 unknown state. Deferred: §5 exact/estimated/caught-up, §6, §7 — specified in specs/catch-up-progress/. Recorded deviations are in the handover's status section.

Important changes — detailed

TodaySections: new Today building blocks

Asterism/Asterism/Views/TodaySections.swift

Why it matters. All new UI lives here; it replaces the release rows, catch-up rows and entry cards on the day list.

What to look at. TodayHeader, ReleaseShelf, CatchUpCard, NotedTimelineRow, TodayEntryPills

Takeaway. Keep views as pure drawing and push every decision into a nonisolated text/ordering type that tests can call.
Rationale. The handover specifies the visuals; the repo convention (Q26) is that no view branch goes untested.

TodayDayPlan: rows carry chapter, day, releases-since and URL

Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift

Why it matters. Derived in the existing locked read, so Today stays one observation; past days now use notes up to that day.

What to look at. ScheduledWork.notedDays, row(for:on:calendar:countsReleases:), releaseCount

Takeaway. Count weekdays in a span with whole-week arithmetic plus a mod-7 remainder from one weekday lookup.
Rationale. Calendar-day arithmetic survives DST; the old per-day walk cost several Calendar calls per row.

Snapshots: one checked work URL

Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift

Why it matters. Two surfaces open this URL; only one checked the scheme.

What to look at. WorkSnapshot.primaryURL

Takeaway. Put a "safe to open" check on the snapshot, not at each call site.
Rationale. Found in review: the new code skipped the http/https check SeriesDetailView already had.

CompactRootView: header owns Settings, nav bar hidden

Asterism/Asterism/Layout/CompactRootView.swift

Why it matters. Changes where UI tests and readers find Settings on the phone.

What to look at. todayScreen

Takeaway. Hide the bar per root screen with a platform-seam modifier so macOS stays untouched.
Rationale. Handover §3: header with a 36 pt glass gear; the wide tree keeps Settings in its sidebar.

TodayText: wording and ordering helpers

Asterism/Asterism/Views/TodayText.swift

Why it matters. Every visible and spoken string of the new sections is decided here.

What to look at. ReleaseShelfText, CatchUpText, ChapterNumberText, TodayHeaderText

Takeaway. Spoken labels must name the destination of a tap, not what the visual label suggests.
Rationale. Review found the Next capsule claiming to open a chapter it cannot build a URL for.

Key decisions

Schema part deferred to a full spec.

§6/§7 add Work columns; CLAUDE.md makes a schema bump a full spec. Built everything schema-free first; specs/catch-up-progress/ holds the rest.

Chrome scrolls at every size.

Handover §3 has the header scroll with content, so the week strip scrolls too (supersedes update-schedule Q69).

Next capsule opens the work page.

No site rule builds a chapter URL; the label shows the next chapter, VoiceOver names the page.

Show all expands in place.

The Library filter is per-visit state with no route into a Catching up list.

Time on the timeline follows the locale.

Text(_, style: .time) rather than fixed HH:mm, matching every other date on the screen.

Review findings

SeverityAreaFindingResolution
majorTodayDayPlan.row(for:on:)A past day's shelf badge, last-read day and release count came from the newest note overall, so a day could name a chapter read after it.Take them from the newest note on or before the day shown; the "Last noted" line keeps Q16's newest-overall. Test added.
majorNotedTimelineRowDropped the amber attention mark (Q38) and the shared selected-row style, while its comment claimed it kept every affordance.Dot turns amber where TodayEntryRow.needsAttention holds; selected rows take selectedCardFill inside selectedCardBorder; comment rewritten.
majorNotedTimelineRow / TodayEntryRowResolve/Teach pills and the amber warning line were copy-pasted between the two entry rows.Extracted TodayEntryPills and TodayWarningLine; both rows use them.
majorprimaryURLScheduledWork parsed any work URL string, so the Next capsule and shelf menu could openURL a non-web scheme; SeriesDetailView already had a checked helper.WorkSnapshot.primaryURL with the http/https check, used by Today and the Series screen. Test added.
majorCatchUpRowView Next capsuleSpoken label said "Open episode 27" while the tap opens the work page.Spoken label is "Open work page, next is episode 27" (or "Open {title}" with no page); recorded in the handover status table. Test updated.
majorDecision logsupdate-schedule Q15, Q34, Q69, Q80, Q81 and catch-up-mode Q4 were superseded without being marked.Each row now names its supersession by Today v2; OVERVIEW rows marked partly superseded.
majorChapterNumberTextSubstring match on the reader's type name ("cartoon" counted episodes).Whole-word match against a fixed word set. Test added.
minorreleaseCountRemainder walk made several Calendar calls per day.Weekday-number arithmetic from one weekday lookup. DST remainder test added.
minorTodayDayPlan.buildreleasesSince was computed for release rows that never show it.Computed for catch-up rows only. Test added.
minorReleaseShelfItemTitle width re-derived the cover scale by hand.Uses CoverSlotGeometry, the cover's own geometry.
minorAccessibility.accessibilityElement(children: .ignore) plus .isButton on Buttons duplicated what Button provides.Removed; the explicit label stays.
minorReleaseRowViewDead identifierPrefix parameter and a private isNotedOnDay duplicating ReleaseRow.isNotedOnDay.Removed; uses the static prefix and the row's flag.
minorCatch-up cardShow all threshold lived in the view, untested; header hint untested.CatchUpText.visible/toggleLabel and TodayHeaderText.hint with tests.
minorTimeline railFixed 44 pt rail could clip a 12-hour time at accessibility sizes.@ScaledMetric rail width, floored at 44 pt.
minorComments and docsStale comments (TodayView, WideRootView, two test files); style guide still described the range pill and dots; no CHANGELOG entry.Rewritten; style guide gains header, shelf, card and timeline recipes and the shelf glow; CHANGELOG entry added.
minorNext capsule style / chapterLine / shelf identifier / insets nameHand-rolled capsule; reimplemented ReleaseLineText.spelled; inline shelf identifier; chromeRowInsets reused for non-chrome.constellationPill(.count); spelled made internal; ReleaseShelfText.shelfIdentifier; zeroRowInsets.
minorTodayCover vs WorkThumbnailViewTwo placeholder-over-cover wrappers.Kept separate: TodayCover scales with Dynamic Type through CoverSlotGeometry, WorkThumbnailView uses a fixed frame; merging changes other screens.
minorHairline dividerThird spelling of the cardBorder hairline.A kit-wide modifier is outside this change.
minor"read" vs "noted" wordingShelf and card say read; accessibility-size rows say noted.The handover chose "read"; the rows keep update-schedule's wording.
minorTodayView init / ReleaseRow defaultsParameter sprawl; defaulted ReleaseRow fields.No behaviour change; defaults keep test fixtures short.
minorUI coverageNo UI test of the accessibility-size shelf fallback, Show all, or a shelf tap on the phone.Listed under double-check; the logic behind Show all is now unit-tested.
minorShow all performanceExpanded card draws every catch-up row in one List cell.Acceptable at current backlog sizes; revisit if the card grows past ~30 rows.

Tests

Source: local run at 2026-09-27T09:08:00+10:00 · snapshot 494b062f (dirty working tree)

Baseline: none

Execution: passed · JUnit: 1 file · Coverage: 1 file · Baseline: absent

Coverage scope: every test in the repository

Totals: 3210 passed · 0 failed · 55 skipped · 0 errored · 0 flaky

New and removed tests

Derived by declaration name, from the diff (no baseline run).

Diff coverage

FileAdded linesCoveredDiff coverage
Asterism/Asterism/Layout/AppScreens.swift6—no coverage data
Asterism/Asterism/Layout/CompactRootView.swift6—no coverage data
Asterism/Asterism/Layout/WideRootView.swift4—no coverage data
Asterism/Asterism/Support/PlatformModifiers.swift10—no coverage data
Asterism/Asterism/ViewModels/Pluralisation.swift1—no coverage data
Asterism/Asterism/Views/SeriesDetailView.swift1—no coverage data
Asterism/Asterism/Views/TodaySections.swift573—no coverage data
Asterism/Asterism/Views/TodayText.swift190—no coverage data
Asterism/Asterism/Views/TodayView.swift145—no coverage data
Asterism/Asterism/Views/WeekStripView.swift12—no coverage data
Asterism/AsterismTests/TodayDisplayPlanTests.swift35—no coverage data
Asterism/AsterismTests/TodayShelfTextTests.swift202—no coverage data
Asterism/AsterismUITests/AccessibilityJourneyUITests.swift6—no coverage data
Asterism/AsterismUITests/AnnouncementUITests.swift2—no coverage data
Asterism/AsterismUITests/SearchUITests.swift1—no coverage data
Asterism/AsterismUITests/TodayUITests.swift51—no coverage data
Asterism/AsterismUITests/WideLayoutUITests.swift5—no coverage data
CHANGELOG.md7—no coverage data
Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift116100%
Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift10855100%
Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift200168100%
docs/Asterism-Today-v2.md202—no coverage data
docs/asterism-style-guide.md7—no coverage data
specs/OVERVIEW.md16—no coverage data
specs/catch-up-mode/decision_log.md1—no coverage data
specs/catch-up-progress/decision_log.md215—no coverage data
specs/catch-up-progress/design.md230—no coverage data
specs/catch-up-progress/prerequisites.md7—no coverage data
specs/catch-up-progress/requirements.md165—no coverage data
specs/catch-up-progress/runbook.md28—no coverage data
specs/catch-up-progress/tasks.md235—no coverage data
specs/update-schedule/decision_log.md5—no coverage data

Aggregate diff coverage: 100% (229 of 229 measurable added lines).

Overall coverage

Head 94.0% (103742 of 110340 lines)

3 of 32 changed files matched coverage data.

Blast radius

Files that import a changed file on the left, changed files in the centre, files a changed file imports on the right. Snapshot working-tree against base d9d10208.

Dependents none found Changed Dependencies none found Asterism/Asterism/Layout Asterism/Asterism/Support Asterism/Asterism/ViewModels Asterism/Asterism/Views Asterism/AsterismTests Asterism/AsterismUITests …rismCore/Sources/AsterismCore …mCore/Tests/AsterismCoreTests Asterism/Asterism/Layout/AppScreens.swift…erism/Layout/AppScreens.swift Asterism/Asterism/Layout/CompactRootView.swift…/Layout/CompactRootView.swift Asterism/Asterism/Layout/WideRootView.swift…ism/Layout/WideRootView.swift Asterism/Asterism/Support/PlatformModifiers.swift…pport/PlatformModifiers.swift Asterism/Asterism/ViewModels/Pluralisation.swift…iewModels/Pluralisation.swift Asterism/Asterism/Views/SeriesDetailView.swift…/Views/SeriesDetailView.swift Asterism/Asterism/Views/TodaySections.swift…ism/Views/TodaySections.swift Asterism/Asterism/Views/TodayText.swift…sterism/Views/TodayText.swift Asterism/Asterism/Views/TodayView.swift…sterism/Views/TodayView.swift Asterism/Asterism/Views/WeekStripView.swift…ism/Views/WeekStripView.swift Asterism/AsterismTests/TodayDisplayPlanTests.swift…s/TodayDisplayPlanTests.swift Asterism/AsterismTests/TodayShelfTextTests.swift…sts/TodayShelfTextTests.swift Asterism/AsterismUITests/AccessibilityJourneyUITests.swift…ssibilityJourneyUITests.swift Asterism/AsterismUITests/AnnouncementUITests.swift…sts/AnnouncementUITests.swift Asterism/AsterismUITests/SearchUITests.swift…smUITests/SearchUITests.swift Asterism/AsterismUITests/TodayUITests.swift…ismUITests/TodayUITests.swift Asterism/AsterismUITests/WideLayoutUITests.swift…Tests/WideLayoutUITests.swift Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift…/AsterismCore/Snapshots.swift Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift…terismCore/TodayDayPlan.swift Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift…Tests/TodayDayPlanTests.swift
addedmodifieddeletedrenamedunchangedcollapsed package group or +N more⚑N test files with an edge to the node

Per-file diffs

32 files: 20 code · 12 docs. Click to expand.

Code (20)

Asterism/Asterism/Layout/AppScreens.swift Modified +6 / -3
diff --git a/Asterism/Asterism/Layout/AppScreens.swift b/Asterism/Asterism/Layout/AppScreens.swiftindex 38731125..a5969c81 100644--- a/Asterism/Asterism/Layout/AppScreens.swift+++ b/Asterism/Asterism/Layout/AppScreens.swift@@ -54,7 +54,9 @@ struct AppScreens {      // MARK: - Today -    func today() -> some View {+    /// `onShowSettings` is the header's Settings button, which the compact+    /// tree passes and the wide tree does not: its sidebar carries Settings.+    func today(onShowSettings: (() -> Void)? = nil) -> some View {         TodayView(             presentation: model.todayPresentation,             // Q28: derived in Core from the same cycle's works snapshot, so a@@ -107,7 +109,7 @@ struct AppScreens {                 navigation.pageTodayWeek(                     by: $0, currentDay: model.currentDay, calendar: model.calendar)             },-            // Q80: the range line's tap is a cell tap on the current day —+            // Q80, now the header title's tap: a cell tap on the current day —             // the same route, so `.current` is stored and the widget derives             // the current week from it (Q32).             onSelectToday: {@@ -126,7 +128,8 @@ struct AppScreens {                     navigation.pruneTodaySelection(                         visibleEntryIDs: visibility.entries, visibleWorkIDs: visibility.works)                 }-                : nil+                : nil,+            onShowSettings: onShowSettings         )     } 
Asterism/Asterism/Layout/CompactRootView.swift Modified +6 / -20
diff --git a/Asterism/Asterism/Layout/CompactRootView.swift b/Asterism/Asterism/Layout/CompactRootView.swiftindex bf4218f0..64716ae0 100644--- a/Asterism/Asterism/Layout/CompactRootView.swift+++ b/Asterism/Asterism/Layout/CompactRootView.swift@@ -96,28 +96,14 @@ struct CompactRootView: View {     // MARK: - Today      private var todayScreen: some View {-        // Q76: **an empty title, set here.** A title set outside the screen is-        // the one closest to the stack and wins, which is why this is where the-        // phone's answer belongs — the screen sets none of its own any more, and-        // the wide tree heads its list column separately. Empty and inline-        // rather than absent: the bar then collapses to its chrome instead of-        // leaving a large-title gap above the search field.-        screens.today()+        // Today v2 §3: the screen draws its own header — the selected day as+        // a title and the Settings button — so the bar is hidden on this tab's+        // root. Screens pushed onto the stack show theirs as before. The empty+        // inline title stays for the moment the bar reappears on a push.+        screens.today(onShowSettings: showSettings)             .navigationTitle("")             .inlineNavigationTitle()-            .toolbar {-                ToolbarItem(placement: .trailingBar) {-                    Button(action: showSettings) {-                        Image(systemName: "gearshape")-                            .frame(-                                minWidth: AsterismLayout.minHitTarget,-                                minHeight: AsterismLayout.minHitTarget-                            )-                    }-                    .accessibilityIdentifier("settings-button")-                    .accessibilityLabel("Settings")-                }-            }+            .hidesNavigationBar()             // One typed destination for this stack, as Works has — the same             // vocabulary, a stack of its own.             .navigationDestination(for: WorksRoute.self) { route in
Asterism/Asterism/Layout/WideRootView.swift Modified +4 / -4
diff --git a/Asterism/Asterism/Layout/WideRootView.swift b/Asterism/Asterism/Layout/WideRootView.swiftindex 9b53a642..7fbf0546 100644--- a/Asterism/Asterism/Layout/WideRootView.swift+++ b/Asterism/Asterism/Layout/WideRootView.swift@@ -115,10 +115,10 @@ struct WideRootView: View {     private var todayPane: some View {         ListDetailPane(             navigation: navigation,-            // Q76: the **tab's** name, the way the Works column is headed-            // `Works` — a column heading names the place, not the day. The day-            // is the strip inside the column (Q78), which is where it moves as-            // the reader pages.+            // Q76: the **tab's** name, the way the Library column is headed — a+            // column heading names the place, not the day. The day is the+            // header's serif title inside the column (Today v2 §3), which moves+            // with the selection as the reader pages.             title: AppTab.today.title,             selection: navigation.detailSubject(on: .today),             detailAnnouncement: { announcement(on: .today) }
Asterism/Asterism/Support/PlatformModifiers.swift Modified +10 / -0
diff --git a/Asterism/Asterism/Support/PlatformModifiers.swift b/Asterism/Asterism/Support/PlatformModifiers.swiftindex 0b9788ed..8ad91a83 100644--- a/Asterism/Asterism/Support/PlatformModifiers.swift+++ b/Asterism/Asterism/Support/PlatformModifiers.swift@@ -68,6 +68,16 @@ extension View {         #endif     } +    /// Hides the navigation bar on a stack's root screen that draws its own+    /// header (Today). macOS has no navigation bar to hide.+    func hidesNavigationBar() -> some View {+        #if os(iOS)+        return toolbar(.hidden, for: .navigationBar)+        #else+        return self+        #endif+    }+     /// Hides the navigation bar's back chevron (edit modes with exactly one way     /// out per direction). macOS has no back chevron in the window toolbar.     func hidesBackButton(_ hidden: Bool) -> some View {
Asterism/Asterism/ViewModels/Pluralisation.swift Modified +1 / -1
diff --git a/Asterism/Asterism/ViewModels/Pluralisation.swift b/Asterism/Asterism/ViewModels/Pluralisation.swiftindex 5927a800..0096f92b 100644--- a/Asterism/Asterism/ViewModels/Pluralisation.swift+++ b/Asterism/Asterism/ViewModels/Pluralisation.swift@@ -5,7 +5,7 @@ import Foundation /// Two view models word counts for the reader — the diagnosis screen and the /// Settings iCloud section — and each carried a byte-identical private copy of /// this. It is one sentence-building rule, so it lives in one place.-enum Pluralisation {+nonisolated enum Pluralisation {     static func count(_ count: Int, _ singular: String, _ plural: String) -> String {         "\(count) \(noun(count, singular, plural))"     }
Asterism/Asterism/Views/SeriesDetailView.swift Modified +1 / -3
diff --git a/Asterism/Asterism/Views/SeriesDetailView.swift b/Asterism/Asterism/Views/SeriesDetailView.swiftindex 930ad693..511e3a47 100644--- a/Asterism/Asterism/Views/SeriesDetailView.swift+++ b/Asterism/Asterism/Views/SeriesDetailView.swift@@ -294,9 +294,7 @@ struct SeriesDetailView: View {     private func continueURL(_ work: WorkSnapshot) -> URL? {         // Extraction rules are not reversible URL templates. Use the handover's         // primary-URL fallback until a next-chapter URL builder is available.-        guard let raw = work.memberships.first?.workURLString, let url = URL(string: raw),-              ["https", "http"].contains(url.scheme?.lowercased() ?? "") else { return nil }-        return url+        work.primaryURL     }      private func memberStatus(_ work: WorkSnapshot) -> String {
Asterism/Asterism/Views/TodaySections.swift Added +573 / -0
diff --git a/Asterism/Asterism/Views/TodaySections.swift b/Asterism/Asterism/Views/TodaySections.swiftnew file mode 100644index 00000000..1078c3ab--- /dev/null+++ b/Asterism/Asterism/Views/TodaySections.swift@@ -0,0 +1,573 @@+import AsterismCore+import ConstellationKit+import SwiftUI++// The Today screen's v2 pieces (`docs/Asterism-Today-v2.md`): the date header,+// the releasing shelf, the catching-up card and the noted timeline. `TodayView`+// decides which of them is drawn; these only draw.++// MARK: - Header (§3)++/// The selected day as a serif title, and the Settings button beside it.+///+/// The title is the way back to the current day — the job the week-range pill+/// had under Q80. It is never disabled: on the current day the tap is a no-op,+/// and the return glyph that makes the route discoverable is hidden there.+struct TodayHeader: View {+    /// Nil while the screen spans every day, where no one day is shown.+    let title: String?+    /// The full date, for VoiceOver.+    let fullDate: String+    let isOnCurrentDay: Bool+    let onSelectToday: () -> Void+    /// Nil in the wide tree, whose sidebar carries Settings.+    let onShowSettings: (() -> Void)?++    var body: some View {+        HStack(alignment: .center, spacing: 8) {+            if let title {+                Button(action: onSelectToday) {+                    HStack(alignment: .firstTextBaseline, spacing: 8) {+                        Text(title)+                            .font(AsterismTypography.serif(.title))+                            .tracking(-0.28)+                            .foregroundStyle(AsterismColors.primaryText)+                        if !isOnCurrentDay {+                            Image(systemName: "arrow.uturn.backward")+                                .font(.subheadline.weight(.semibold))+                                .foregroundStyle(AsterismColors.cyan)+                                .accessibilityHidden(true)+                        }+                    }+                    .frame(minHeight: AsterismLayout.minHitTarget)+                    .contentShape(Rectangle())+                }+                .buttonStyle(.plain)+                .accessibilityIdentifier(TodayHeaderText.identifier)+                .accessibilityLabel(fullDate)+                .accessibilityHint(TodayHeaderText.hint(isOnCurrentDay: isOnCurrentDay) ?? "")+            }+            Spacer(minLength: 0)+            if let onShowSettings {+                Button(action: onShowSettings) {+                    Image(systemName: "gearshape")+                        .font(.body.weight(.medium))+                        .foregroundStyle(AsterismColors.primaryText)+                        .frame(width: 36, height: 36)+                        .glassEffect(.regular, in: .circle)+                        // The glass circle is 36 pt; the target stays 44.+                        .frame(+                            minWidth: AsterismLayout.minHitTarget,+                            minHeight: AsterismLayout.minHitTarget)+                        .contentShape(Rectangle())+                }+                .buttonStyle(.plain)+                .accessibilityIdentifier("settings-button")+                .accessibilityLabel("Settings")+            }+        }+        .padding(.leading, 20)+        .padding(.trailing, 12)+        .padding(.top, 4)+    }+}++// MARK: - Covers++/// A work's cover at a given slot size, over a placeholder that holds the slot+/// when there is no cover or it will not load.+///+/// `ThumbnailSlot` gives its space back when the bytes are missing, which is+/// right in a row and wrong on a shelf: a row of covers with a hole in it reads+/// as a layout fault. The placeholder is the work's site glyph on a card.+struct TodayCover: View {+    let workID: UUID+    let thumbnail: ThumbnailIdentity?+    let hostname: String+    let baseSize: CGSize+    let cornerRadius: CGFloat++    /// The same Dynamic Type probe `ThumbnailSlot` sizes itself by, so the+    /// placeholder and the picture agree on the slot.+    @ScaledMetric(relativeTo: .body) private var typeSizeProbe: CGFloat = 100+    @Environment(\.displayScale) private var displayScale+    @State private var isCoverDrawn = false++    private var size: CGSize {+        CoverSlotGeometry(+            shape: .portrait, baseSize: baseSize, typeSizeProbe: typeSizeProbe,+            displayScale: displayScale+        ).drawnSize+    }++    var body: some View {+        let shape = RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)+        ZStack {+            if !(thumbnail != nil && isCoverDrawn) {+                shape.fill(AsterismColors.cardFill)+                    .overlay { shape.strokeBorder(AsterismColors.cardBorder, lineWidth: 1) }+                    .overlay {+                        SiteGlyph(hostname: hostname, size: min(size.width * 0.4, 36))+                    }+            }+            if let thumbnail {+                ThumbnailSlot(+                    workID: workID, identity: thumbnail, baseSize: baseSize,+                    cornerRadius: cornerRadius, trailingGap: 0, isDrawn: $isCoverDrawn)+            }+        }+        .frame(width: size.width, height: size.height)+        .accessibilityHidden(true)+    }+}++// MARK: - Releasing shelf (§4)++/// The day's releases as a horizontal row of covers: unread first, with a cyan+/// ring and the next chapter; read dimmed, with a check.+struct ReleaseShelf: View {+    /// Already in shelf order (`ReleaseShelfText.ordered`).+    let rows: [ReleaseRow]+    let onSelect: (UUID) -> Void++    var body: some View {+        ScrollView(.horizontal, showsIndicators: false) {+            LazyHStack(alignment: .top, spacing: 14) {+                ForEach(rows) { row in+                    ReleaseShelfItem(row: row, onSelect: onSelect)+                }+            }+            .scrollTargetLayout()+            .padding(.horizontal, 20)+            // Room for the unread ring's glow, which a scroll view clips.+            .padding(.vertical, 12)+        }+        .scrollTargetBehavior(.viewAligned)+        .accessibilityElement(children: .contain)+        .accessibilityIdentifier(ReleaseShelfText.shelfIdentifier)+    }+}++struct ReleaseShelfItem: View {+    static let coverSize = CGSize(width: 98, height: 140)+    static let coverRadius: CGFloat = 12++    let row: ReleaseRow+    let onSelect: (UUID) -> Void++    @Environment(\.openURL) private var openURL+    @Environment(\.displayScale) private var displayScale+    @ScaledMetric(relativeTo: .body) private var typeSizeProbe: CGFloat = 100++    /// The title's width is the cover's, from the geometry the cover itself is+    /// drawn by, so the two cannot drift.+    private var width: CGFloat {+        CoverSlotGeometry(+            shape: .portrait, baseSize: Self.coverSize, typeSizeProbe: typeSizeProbe,+            displayScale: displayScale+        ).drawnSize.width+    }++    var body: some View {+        Button {+            onSelect(row.id)+        } label: {+            VStack(alignment: .leading, spacing: 8) {+                cover+                Text(row.title)+                    .font(AsterismTypography.serif(.footnote))+                    .foregroundStyle(AsterismColors.primaryText)+                    .lineLimit(2)+                    .multilineTextAlignment(.leading)+                    .frame(width: width, alignment: .leading)+            }+            .contentShape(Rectangle())+        }+        .buttonStyle(.plain)+        .contextMenu {+            if let url = row.primaryURL {+                Button("Open Work Page", systemImage: "safari") { openURL(url) }+            }+            Button("Go to Work", systemImage: "book") { onSelect(row.id) }+        }+        .accessibilityLabel(ReleaseShelfText.label(row))+        .accessibilityIdentifier(ReleaseShelfText.itemIdentifier(row.id))+    }++    private var cover: some View {+        let shape = RoundedRectangle(cornerRadius: Self.coverRadius, style: .continuous)+        let isRead = row.isNotedOnDay+        return TodayCover(+            workID: row.id, thumbnail: row.thumbnail, hostname: row.primaryHostname,+            baseSize: Self.coverSize, cornerRadius: Self.coverRadius+        )+        .opacity(isRead ? 0.62 : 1)+        .overlay {+            if !isRead {+                shape.strokeBorder(AsterismColors.cyan, lineWidth: 1.5)+            }+        }+        // §5: glow marks what wants the reader's attention, and an unread+        // release is that on this screen. 22 pt at .35, with the 1.3× glow+        // multiplier, as a SwiftUI radius.+        .shadow(color: isRead ? .clear : AsterismColors.cyan.opacity(0.35), radius: 14)+        .overlay(alignment: .topTrailing) {+            if isRead {+                Image(systemName: "checkmark")+                    .font(.caption.weight(.bold))+                    .foregroundStyle(AsterismColors.cyan)+                    .frame(width: 24, height: 24)+                    .background(Circle().fill(Color.black.opacity(0.55)))+                    .overlay(Circle().strokeBorder(Color.white.opacity(0.15), lineWidth: 1))+                    .padding(6)+            }+        }+        .overlay(alignment: .bottomTrailing) {+            if let badge = ReleaseShelfText.badge(row) {+                Text(badge)+                    .font(.caption2.weight(.semibold))+                    .foregroundStyle(AsterismColors.cyan)+                    .padding(.horizontal, 7)+                    .padding(.vertical, 3)+                    .background(Capsule().fill(Color.black.opacity(0.6)))+                    .padding(6)+            }+        }+    }+}++// MARK: - Catching up (§5)++/// Every work the reader is behind on, in one card: one compact row each, up to+/// `CatchUpText.collapsedLimit` before `Show all`.+///+/// `Show all` expands the card in place rather than routing to the Works list:+/// the Works filter is per-visit state, so there is no Catching up list to route+/// to.+struct CatchUpCard: View {+    /// Already in card order (`CatchUpText.ordered`).+    let rows: [ReleaseRow]+    let selectedDay: CivilDay+    let currentDay: CivilDay+    let calendar: Calendar+    let onSelect: (UUID) -> Void++    @State private var showsAll = false++    private var visibleRows: ArraySlice<ReleaseRow> {+        CatchUpText.visible(rows, showsAll: showsAll)+    }++    var body: some View {+        VStack(spacing: 0) {+            ForEach(Array(visibleRows.enumerated()), id: \.element.id) { index, row in+                if index > 0 { hairline }+                CatchUpRowView(+                    row: row, selectedDay: selectedDay, currentDay: currentDay,+                    calendar: calendar, onSelect: onSelect)+            }+            if let toggle = CatchUpText.toggleLabel(rowCount: rows.count, showsAll: showsAll) {+                hairline+                Button(toggle) {+                    showsAll.toggle()+                }+                .font(.subheadline.weight(.semibold))+                .foregroundStyle(AsterismColors.cyan)+                .frame(maxWidth: .infinity, minHeight: AsterismLayout.minHitTarget)+                .buttonStyle(.plain)+                .accessibilityIdentifier(CatchUpText.showAllIdentifier)+            }+        }+        .constellationCard()+    }++    private var hairline: some View {+        Rectangle()+            .fill(AsterismColors.cardBorder)+            .frame(height: 1)+            .accessibilityHidden(true)+    }+}++struct CatchUpRowView: View {+    static let coverSize = CGSize(width: 36, height: 50)++    let row: ReleaseRow+    let selectedDay: CivilDay+    let currentDay: CivilDay+    let calendar: Calendar+    let onSelect: (UUID) -> Void++    @Environment(\.openURL) private var openURL+    @Environment(\.dynamicTypeSize) private var dynamicTypeSize++    var body: some View {+        // At the accessibility sizes the capsule goes under the text rather+        // than squeezing the title to nothing beside it.+        let layout =+            dynamicTypeSize.isAccessibilitySize+            ? AnyLayout(VStackLayout(alignment: .leading, spacing: 8))+            : AnyLayout(HStackLayout(spacing: 12))+        layout {+            Button {+                onSelect(row.id)+            } label: {+                HStack(spacing: 12) {+                    TodayCover(+                        workID: row.id, thumbnail: row.thumbnail,+                        hostname: row.primaryHostname, baseSize: Self.coverSize,+                        cornerRadius: 6)+                    VStack(alignment: .leading, spacing: 3) {+                        Text(row.title)+                            .font(AsterismTypography.serif(.subheadline))+                            .foregroundStyle(AsterismColors.primaryText)+                            .lineLimit(dynamicTypeSize.isAccessibilitySize ? 3 : 1)+                        Text(status(spoken: false))+                            .font(.caption)+                            .foregroundStyle(AsterismColors.secondaryText)+                            .lineLimit(dynamicTypeSize.isAccessibilitySize ? nil : 2)+                    }+                    Spacer(minLength: 0)+                }+                .contentShape(Rectangle())+            }+            .buttonStyle(.plain)+            .accessibilityLabel("\(row.title), \(status(spoken: true))")+            .accessibilityIdentifier(CatchUpText.rowIdentifier(row.id))++            nextButton+        }+        .padding(.horizontal, 12)+        .padding(.vertical, 10)+        .frame(minHeight: 70)+    }++    private func status(spoken: Bool) -> String {+        CatchUpText.status(+            row, selectedDay: selectedDay, currentDay: currentDay, calendar: calendar,+            spoken: spoken)+    }++    /// Opens the work's page where it has one, the work otherwise. No chapter+    /// URL is built: nothing in the library can build one from a site's rules,+    /// so the spoken label says where the tap goes and names the chapter as+    /// what to read next.+    private var nextButton: some View {+        Button {+            if let url = row.primaryURL {+                openURL(url)+            } else {+                onSelect(row.id)+            }+        } label: {+            Text(CatchUpText.nextLabel(row)).constellationPill(.count)+        }+        .buttonStyle(.plain)+        .accessibilityLabel(CatchUpText.nextAccessibilityLabel(row))+        .accessibilityIdentifier(CatchUpText.nextIdentifier(row.id))+    }+}++// MARK: - Noted timeline (§8)++/// One note on the selected day: a dot and its time on a vertical rule, then the+/// work, the chapter and the note in full.+///+/// Keeps `TodayEntryRow`'s affordances and test handles — the Teach, Re-teach+/// and Resolve pills, the attention and candidate lines, the actionable title —+/// through the same `TodayEntryPills` and `TodayWarningLine`. Where the card row+/// marks a row needing attention with an amber edge (Q38), this one turns its+/// dot amber; a selected row takes the selected-card fill and border+/// (`ipad-and-mac-layouts` Req 1.5). It drops the card, the cover and the site+/// glyph: the rule groups the day's notes, and the note text gets the width.+struct NotedTimelineRow: View {+    @Environment(\.siteNames) private var siteNames++    let row: TodayPresentationRow+    let isFirst: Bool+    let isLast: Bool+    let isSelected: Bool+    let onSelect: (UUID) -> Void+    let onTeach: ((UUID) -> Void)?+    let onResolveDuplicate: ((DuplicateSetKey) -> Void)?+    let resolutionKey: DuplicateSetKey?++    private static let dotSize: CGFloat = 9+    /// The rail holds the time; it widens with the text so a 12-hour time at an+    /// accessibility size still fits.+    @ScaledMetric(relativeTo: .caption2) private var railWidth = AsterismLayout.minHitTarget++    var body: some View {+        HStack(alignment: .top, spacing: 8) {+            rail+            VStack(alignment: .leading, spacing: 8) {+                Button {+                    onSelect(row.id)+                } label: {+                    content+                        .frame(maxWidth: .infinity, alignment: .leading)+                        .contentShape(Rectangle())+                }+                .buttonStyle(.plain)+                .accessibilityIdentifier("recent-entry-\(row.id.uuidString)")+                .accessibilityLabel(+                    "Open entry \(TodayEntryRow.accessibilityTitle(row)) from \(siteNames.label(for: row.hostname))"+                )+                HStack(spacing: 8) {+                    TodayEntryPills(+                        row: row, onTeach: onTeach, onResolveDuplicate: onResolveDuplicate,+                        resolutionKey: resolutionKey)+                }+            }+            .padding(.vertical, 10)+            .padding(.trailing, 12)+        }+        .background {+            if isSelected {+                let shape = RoundedRectangle(cornerRadius: 12, style: .continuous)+                shape.fill(AsterismColors.selectedCardFill)+                    .overlay { shape.strokeBorder(AsterismColors.selectedCardBorder, lineWidth: 1) }+            }+        }+        .accessibilityAddTraits(isSelected ? [.isSelected] : [])+    }++    /// The dot and its time, on a rule that joins this row to its neighbours:+    /// the rule stops at the dot on the first row and at the time on the last.+    private var rail: some View {+        VStack(spacing: 4) {+            Rectangle()+                .fill(isFirst ? .clear : AsterismColors.cardBorder)+                .frame(width: 1, height: 12)+            Circle()+                .fill(+                    TodayEntryRow.needsAttention(row) ? AsterismColors.amber : AsterismColors.cyan)+                .frame(width: Self.dotSize, height: Self.dotSize)+            Text(row.lastSharedAt, style: .time)+                .font(.caption2.monospacedDigit())+                .foregroundStyle(AsterismColors.secondaryText)+                .lineLimit(1)+                .minimumScaleFactor(0.8)+                .accessibilityIdentifier("entry-time")+            Rectangle()+                .fill(isLast ? .clear : AsterismColors.cardBorder)+                .frame(width: 1)+                .frame(maxHeight: .infinity)+        }+        .frame(width: max(railWidth, AsterismLayout.minHitTarget))+    }++    private var content: some View {+        VStack(alignment: .leading, spacing: 4) {+            Text(row.workDisplayTitle ?? row.captureTitle)+                .font(AsterismTypography.serif(.subheadline))+                .lineLimit(1)+                .foregroundStyle(+                    row.isActionable ? AsterismColors.amberText : AsterismColors.primaryText)+                .accessibilityIdentifier("entry-title")++            // The attention line replaces the chapter line: a row the app+            // cannot resolve has no chapter it can vouch for.+            if let attention = row.attention {+                TodayWarningLine(text: TodayEntryRow.attentionLabel(attention), lineLimit: 2)+                    .accessibilityIdentifier("entry-attention")+            } else if row.chapterTitle != nil || row.rating != nil {+                HStack(spacing: 6) {+                    if let chapterTitle = row.chapterTitle {+                        Text(chapterTitle)+                            .font(.caption)+                            .foregroundStyle(AsterismColors.cyan)+                            .lineLimit(1)+                            .accessibilityIdentifier("entry-chapter")+                    }+                    // §5: rating glyphs in rows never glow — plain accent text.+                    if let rating = row.rating {+                        Text(rating == .up ? "▲" : "▼")+                            .font(.caption)+                            .foregroundStyle(+                                rating == .up ? AsterismColors.cyan : AsterismColors.violet)+                            .accessibilityIdentifier("entry-rating")+                    }+                }+            }++            if row.isActionable, let candidate = row.unresolvedCandidateTitle {+                TodayWarningLine(text: candidate, lineLimit: 1)+                    .accessibilityIdentifier("entry-unresolved-candidate")+            }++            if !row.note.isEmpty {+                Text(row.note)+                    .font(.subheadline)+                    .foregroundStyle(AsterismColors.noteText)+                    .fixedSize(horizontal: false, vertical: true)+                    .accessibilityIdentifier("entry-note-preview")+            }+        }+    }+}++// MARK: - Shared by both entry rows++/// A row's Resolve and Teach/Re-teach pills (Req 9.2, Decision 1), drawn by the+/// card row beside its content and by the timeline row under it.+///+/// Sibling buttons of the row's own, never nested in it: SwiftUI routes a tap+/// on a nested button to the outer action. Resolve sits *beside* Teach rather+/// than replacing it, because a row can be unparsed and duplicated at once.+struct TodayEntryPills: View {+    let row: TodayPresentationRow+    let onTeach: ((UUID) -> Void)?+    let onResolveDuplicate: ((DuplicateSetKey) -> Void)?+    let resolutionKey: DuplicateSetKey?++    var body: some View {+        if let resolutionKey, let onResolveDuplicate {+            Button {+                onResolveDuplicate(resolutionKey)+            } label: {+                Text("Resolve").constellationPill(.attention)+            }+            .buttonStyle(.plain)+            .accessibilityIdentifier("resolve-duplicate-pill")+            .accessibilityLabel(+                row.duplicateRoute?.blockingWorkSet == nil+                    ? "Resolve duplicate copies"+                    : "Resolve the duplicate work this is waiting on")+        }+        if row.isActionable, row.actionType != .none, row.actionType != .resolveDuplicate,+            let onTeach+        {+            Button {+                onTeach(row.id)+            } label: {+                Text(row.actionType == .teach ? "Teach" : "Re-teach")+                    .constellationPill(.attention)+            }+            .buttonStyle(.plain)+            .accessibilityIdentifier("teach-pill")+            .accessibilityLabel(+                row.actionType == .teach ? "Teach title pattern" : "Re-teach title pattern")+        }+    }+}++/// The amber triangle-and-caption line an entry row uses for what it cannot+/// resolve (Req 2.2) and for an unresolved candidate title.+struct TodayWarningLine: View {+    let text: String+    let lineLimit: Int++    var body: some View {+        HStack(spacing: 4) {+            Image(systemName: "exclamationmark.triangle")+                .font(.caption2)+                .foregroundStyle(AsterismColors.amberText)+                .accessibilityHidden(true)+            Text(text)+                .font(.caption)+                .foregroundStyle(AsterismColors.amberText)+                .lineLimit(lineLimit)+        }+    }+}
Asterism/Asterism/Views/TodayText.swift Modified +190 / -20
diff --git a/Asterism/Asterism/Views/TodayText.swift b/Asterism/Asterism/Views/TodayText.swiftindex 72049b4f..29299774 100644--- a/Asterism/Asterism/Views/TodayText.swift+++ b/Asterism/Asterism/Views/TodayText.swift@@ -39,6 +39,16 @@ nonisolated enum TodayDateText {         day.date(in: calendar).formatted(stamped(abbreviatedStyle, with: calendar))     } +    /// The header title's shape: weekday, day and month, abbreviated —+    /// `Wed 23 Sep` under `en_AU`. The field order and punctuation are the+    /// locale's.+    static func header(_ day: CivilDay, calendar: Calendar) -> String {+        day.date(in: calendar).formatted(stamped(headerStyle, with: calendar))+    }++    private static let headerStyle = Date.FormatStyle()+        .weekday(.abbreviated).day().month(.abbreviated)+     /// The calendar's system, its zone, and its locale where it carries one. A     /// nil locale states nothing about language and keeps the formatter's own.     private static func stamped(@@ -130,7 +140,7 @@ nonisolated enum ReleaseLineText {     /// The chapter line if there is one to show. An entry with neither a chapter     /// title nor a chapter sequence has none, and an empty string is the same     /// absence spelled differently.-    private static func spelled(_ chapterLine: String?) -> String? {+    static func spelled(_ chapterLine: String?) -> String? {         guard let chapterLine, !chapterLine.isEmpty else { return nil }         return chapterLine     }@@ -175,21 +185,19 @@ nonisolated enum WeekStripText {     static let previousIdentifier = "today-week-previous"     static let nextIdentifier = "today-week-next" -    /// Req 4.5: the full date, whether the cell is the current day, whether it-    /// is selected, and whether releases are due. The violet dot is described-    /// here rather than exposed as an element of its own (Req 10.3).+    /// Req 4.5: the full date, whether the cell is the current day and whether+    /// it is selected. No releases clause since the cells lost their dot+    /// (Today v2 §2): the releasing shelf says what is due on the selected day.     static func label(-        day: CivilDay, isCurrent: Bool, isSelected: Bool, hasReleases: Bool,-        calendar: Calendar+        day: CivilDay, isCurrent: Bool, isSelected: Bool, calendar: Calendar     ) -> String {         var clauses = [TodayDateText.complete(day, calendar: calendar)]         if isCurrent { clauses.append("today") }         if isSelected { clauses.append("selected") }-        if hasReleases { clauses.append("releases due") }         return clauses.joined(separator: ", ")     } -    /// The displayed week's date range, between the two chevrons (Req 4.3).+    /// The displayed week's date range — what a paging control's label names.     ///     /// The strip already holds the week it is drawing, so this takes it rather     /// than re-deriving it; only its first day is needed, because a week is@@ -199,18 +207,6 @@ nonisolated enum WeekStripText {         return rangeOfWeek(containing: first, calendar: calendar)     } -    /// Q80: the range line is a **control** — tapping it returns the selection-    /// to the current day, and the widget follows it to the current week. The-    /// label names the week first, because saying which week is showing is-    /// still the line's job; the action is the clause after it.-    static func rangeLabel(of week: [CivilDay], calendar: Calendar) -> String {-        let range = range(of: week, calendar: calendar)-        return range.isEmpty ? "Back to today" : "\(range), back to today"-    }--    /// What that tap does, for the reader who cannot see which cell is filled.-    static let rangeHint = "Selects the current day"-     /// The same range for a day rather than a built week.     ///     /// `StatsPeriodNaming.weekText` is the interval this range always was, done@@ -237,3 +233,177 @@ nonisolated enum WeekStripText {         return "\(weeks < 0 ? "Previous" : "Next") week, \(range)"     } }++/// The header's date title (Today v2 §3): the selected day, and the way back to+/// the current one — the job the week-range pill had under Q80.+nonisolated enum TodayHeaderText {+    static let identifier = "today-header-date"++    /// What tapping the title does, said only where it does something.+    static func hint(isOnCurrentDay: Bool) -> String? {+        isOnCurrentDay ? nil : "Returns to today"+    }+}++/// How a chapter number is spelled on Today's shelf and catch-up card.+///+/// The prefix follows the work's type, which is a reader-owned name: a comic+/// type counts episodes and anything else counts chapters. An untyped work+/// counts chapters.+nonisolated enum ChapterNumberText {+    /// Whole words only, so `cartoon novel` is not a comic.+    private static let episodeTypeWords: Set<String> = [+        "webtoon", "toon", "manga", "manhwa", "manhua", "comic", "comics",+    ]++    static func countsEpisodes(_ type: WorkTypeDisplay) -> Bool {+        guard let name = type.name?.lowercased() else { return false }+        return name.split { !$0.isLetter }.contains { episodeTypeWords.contains(String($0)) }+    }++    /// `Ep 32` / `Ch 687`.+    static func short(_ number: Int, type: WorkTypeDisplay) -> String {+        "\(countsEpisodes(type) ? "Ep" : "Ch") \(number)"+    }++    /// `episode 32` / `chapter 687`, for VoiceOver.+    static func spoken(_ number: Int, type: WorkTypeDisplay) -> String {+        "\(countsEpisodes(type) ? "episode" : "chapter") \(number)"+    }+}++/// The releasing shelf's words and order (Today v2 §4).+nonisolated enum ReleaseShelfText {+    static let shelfIdentifier = "today-releases-shelf"++    static func itemIdentifier(_ id: UUID) -> String {+        "today-release-shelf-item-\(id.uuidString)"+    }++    /// The section header's trailing summary: `2 of 5 read`.+    static func summary(_ rows: [ReleaseRow]) -> String {+        "\(rows.count(where: \.isNotedOnDay)) of \(rows.count) read"+    }++    /// The badge on an unread cover: the next chapter, where there is a whole+    /// number to add one to. Never guessed otherwise.+    static func badge(_ row: ReleaseRow) -> String? {+        guard !row.isNotedOnDay, let next = row.nextChapter else { return nil }+        return ChapterNumberText.short(next, type: row.typeDisplay)+    }++    static func label(_ row: ReleaseRow) -> String {+        if row.isNotedOnDay { return "\(row.title), read" }+        if let next = row.nextChapter {+            return "\(row.title), \(ChapterNumberText.spoken(next, type: row.typeDisplay)), not read yet"+        }+        return "\(row.title), not read yet"+    }++    /// Unread first, then read; each half keeps the order it arrived in, which+    /// is `titleOrder`.+    static func ordered(_ rows: [ReleaseRow]) -> [ReleaseRow] {+        rows.filter { !$0.isNotedOnDay } + rows.filter(\.isNotedOnDay)+    }+}++/// The catching-up card's words and order (Today v2 §5), for the one state+/// the library can answer today: what was last read, when, and how many+/// release days have passed since. The handover's exact and estimated states+/// need a latest-released chapter, which no work records yet.+nonisolated enum CatchUpText {+    /// Rows the card shows before `Show all`.+    static let collapsedLimit = 5++    static func rowIdentifier(_ id: UUID) -> String { "today-catchup-row-\(id.uuidString)" }++    /// The rows the card draws: the first `collapsedLimit` until `Show all`.+    static func visible(_ rows: [ReleaseRow], showsAll: Bool) -> ArraySlice<ReleaseRow> {+        showsAll ? rows[...] : rows.prefix(collapsedLimit)+    }++    /// The expand/collapse button's title, or nil where every row already fits.+    static func toggleLabel(rowCount: Int, showsAll: Bool) -> String? {+        guard rowCount > collapsedLimit else { return nil }+        return showsAll ? "Show fewer" : "Show all \(rowCount)"+    }+    static func nextIdentifier(_ id: UUID) -> String { "today-catchup-next-\(id.uuidString)" }+    static let showAllIdentifier = "today-catchup-show-all"++    /// Stalest first: never read, then the oldest last-read day. Ties keep the+    /// order they arrived in, which is `titleOrder`.+    static func ordered(_ rows: [ReleaseRow]) -> [ReleaseRow] {+        rows.enumerated().sorted { lhs, rhs in+            switch (lhs.element.lastNotedDay, rhs.element.lastNotedDay) {+            case (nil, nil): return lhs.offset < rhs.offset+            case (nil, _): return true+            case (_, nil): return false+            case let (left?, right?):+                return left != right ? left < right : lhs.offset < rhs.offset+            }+        }.map(\.element)+    }++    /// `Last read Ep 9 · 5 days ago · ~2 releases since`.+    ///+    /// The chapter falls back to the note's own chapter line where it has no+    /// whole number, and the release count is left off where the work has no+    /// release days or none have passed.+    /// `spoken` spells the chapter out (`episode 9`) for VoiceOver.+    static func status(+        _ row: ReleaseRow, selectedDay: CivilDay, currentDay: CivilDay, calendar: Calendar,+        spoken: Bool = false+    ) -> String {+        let chapter =+            row.lastChapter.map {+                spoken+                    ? ChapterNumberText.spoken($0, type: row.typeDisplay)+                    : ChapterNumberText.short($0, type: row.typeDisplay)+            }+            ?? chapterLine(row.line)+        var parts: [String]+        switch row.line {+        case .notNotedYet:+            return "Not read yet"+        case .notedOnDay:+            parts = [+                chapter.map { "Read \($0)" } ?? "Read",+                selectedDay == currentDay+                    ? "today" : TodayTitleText.weekday(selectedDay, calendar: calendar),+            ]+        case .lastNoted(_, let when):+            parts = [+                chapter.map { "Last read \($0)" } ?? "Last read",+                ReleaseLineText.relativeDay(when, calendar: calendar),+            ]+        }+        if let since = row.releasesSince, since > 0 {+            parts.append("~\(Pluralisation.count(since, "release", "releases")) since")+        }+        return parts.joined(separator: " · ")+    }++    /// The `Next` capsule's label: the next chapter where there is a whole+    /// number to add one to, `Open` otherwise.+    static func nextLabel(_ row: ReleaseRow) -> String {+        row.nextChapter.map { ChapterNumberText.short($0, type: row.typeDisplay) } ?? "Open"+    }++    /// Where the tap goes: the work's page, or the work in the app where it+    /// has no page. The next chapter is named as what to read, never as the+    /// destination, because no chapter URL is built.+    static func nextAccessibilityLabel(_ row: ReleaseRow) -> String {+        let destination = row.primaryURL == nil ? "Open \(row.title)" : "Open work page"+        guard let next = row.nextChapter else { return destination }+        return "\(destination), next is \(ChapterNumberText.spoken(next, type: row.typeDisplay))"+    }++    private static func chapterLine(_ line: ReleaseRow.Line) -> String? {+        switch line {+        case .notedOnDay(let chapterLine), .lastNoted(let chapterLine, _):+            ReleaseLineText.spelled(chapterLine)+        case .notNotedYet:+            nil+        }+    }+}
Asterism/Asterism/Views/TodayView.swift Modified +145 / -162
diff --git a/Asterism/Asterism/Views/TodayView.swift b/Asterism/Asterism/Views/TodayView.swiftindex 993a718a..be779adf 100644--- a/Asterism/Asterism/Views/TodayView.swift+++ b/Asterism/Asterism/Views/TodayView.swift@@ -69,9 +69,13 @@ struct TodayView: View {     let onSelectDay: (CivilDay) -> Void     /// Req 4.3: the week controls, in weeks, either direction.     let onPageWeek: (Int) -> Void-    /// Q80: the range line's tap — back to the current day, and to its week-    /// with it.+    /// The header title's tap (Today v2 §3, taking over Q80 from the removed+    /// range pill) — back to the current day, and to its week with it.     let onSelectToday: () -> Void+    /// The header's Settings button. Nil in the wide tree, whose sidebar+    /// carries Settings; the phone's navigation bar is hidden on this tab, so+    /// the header is where the button lives there.+    let onShowSettings: (() -> Void)?     /// Req 5.3: a release row opens the work — on Today's own stack (Q38), which     /// is the caller's business and not this screen's.     let onSelectWork: (UUID) -> Void@@ -110,9 +114,9 @@ struct TodayView: View {     /// `AppNavigation` (Q22).     let onOpenAnnouncement: (TodayAnnouncement) -> Void -    /// Q69: at an accessibility size the day chrome scrolls with the list-    /// instead of standing fixed above it. The same branch `WeekWidget` reads for-    /// its 4 + 3 wrap, so one setting decides both.+    /// At an accessibility size the releases section draws its vertical rows+    /// instead of the shelf (Today v2 §4) — the same branch `WeekWidget` reads+    /// for its 4 + 3 wrap, so one setting decides both.     @Environment(\.dynamicTypeSize) private var dynamicTypeSize     /// `today-announcements` Q22: the one seen state, written at the top of the     /// window. Optional so a preview or a test that does not write it draws no@@ -152,7 +156,8 @@ struct TodayView: View {         onPageWeek: @escaping (Int) -> Void = { _ in },         onSelectToday: @escaping () -> Void = {},         onSelectWork: @escaping (UUID) -> Void = { _ in },-        onPruneSelection: ((TodayVisibility) -> Void)? = nil+        onPruneSelection: ((TodayVisibility) -> Void)? = nil,+        onShowSettings: (() -> Void)? = nil     ) {         self.presentation = presentation         self.schedule = schedule@@ -180,6 +185,7 @@ struct TodayView: View {         self.onSelectToday = onSelectToday         self.onSelectWork = onSelectWork         self.onPruneSelection = onPruneSelection+        self.onShowSettings = onShowSettings     }      /// Which day is shown (Q32), resolved by the selection itself so that this@@ -213,33 +219,29 @@ struct TodayView: View {      var body: some View {         let plan = displayPlan-        // Req 4.1's order as Q76 and Q78 left it, top to bottom: the week-        // widget, the banners, then the sections — the search field that led-        // them went with `launch-to-today` Req 5.1. No page title and no date-        // caption — the strip names the day.+        // Top to bottom: the header naming the selected day (Today v2 §3), the+        // week widget, the banners, then the sections — the search field that+        // led them went with `launch-to-today` Req 5.1.         //         // The banner region sits **above** the empty-library branch (Q15). Two         // Site rows with no Entries yet — the first-sync shape — produce a         // diagnosis and zero groups, so a banner living in the non-empty branch         // would leave that library with no route to Req 4.1's screen at all.         VStack(spacing: 0) {-            // Q69: fixed above the list at the sizes it fits in, and the list's-            // own top content at the accessibility sizes, where it does not.+            // Today v2 §3: the chrome is the list's own top content, so the+            // header scrolls with the day. Fixed above it only on the+            // search-miss branch, which has no list to scroll with.             if !scrollsChrome(plan) {+                header(plan)                 if plan.showsDayChrome { dayChrome }                 banners             }             content(plan)         }-        // Q76: **the screen sets no title.** The day was on screen four times —-        // as the page title, in the caption, in the strip and in both section-        // headers — and the strip is the one that shows it in place, so the-        // title and the headers lose it (and the caption went with Q78). What-        // each tree puts on its own chrome is the tree's: the compact one sets-        // an empty inline title so the bar collapses rather than leaving a-        // large-title gap above the week widget, and the wide one heads its-        // list column with the tab's name. Neither is derived from a day any-        // more.+        // The screen sets no navigation title: its own header names the day+        // (Today v2 §3). The compact tree hides the bar on this root; the wide+        // tree heads its list column with the tab's name, as the Works column is+        // headed.         // Requirement 8.1's fixed layer. On the screen's own root rather than         // on the enclosing `NavigationStack`: a background applied outside the         // stack renders *behind* the stack's own opaque backing, and the sky@@ -280,76 +282,81 @@ struct TodayView: View {     // MARK: - The day's chrome (Reqs 4.1, 4.4)      /// Whether the chrome is drawn as the list's top content rather than fixed-    /// above it (Q69).+    /// above it.     ///-    /// The accessibility sizes, and only there: at `AccessibilityXXXL` the-    /// week row, the wrapped strip and a banner want more-    /// height than the window has, so a fixed `VStack` compresses them into-    /// each other and leaves the `List` a sliver no gesture can empty. Below-    /// that the chrome fits, and staying fixed is what keeps the day selector-    /// permanent (Req 4.1).+    /// At every size since Today v2 §3, which has the header scroll with the+    /// content; Q69 did this at the accessibility sizes only, and the week+    /// strip below the header scrolls with it rather than pinning under a+    /// header that has gone.     ///     /// Not on the search-miss branch, which draws a `ContentUnavailableView`     /// rather than a `List`: there is nothing there for the chrome to scroll-    /// with, and that branch shows no day chrome anyway — only the banners,-    /// which stay above it.+    /// with, and that branch shows no day chrome anyway — only the header and+    /// the banners, which stay above it.     private func scrollsChrome(_ plan: TodayDisplayPlan) -> Bool {-        dynamicTypeSize.isAccessibilitySize && plan.branch != .searchMiss+        plan.branch != .searchMiss     } -    /// The chrome as list rows, for the accessibility sizes (Q69).+    /// The chrome as list rows.     ///     /// Zero insets, no separator and no row background, so the pieces keep the-    /// padding they carry themselves and the screen looks exactly as it does-    /// above the list at the sizes that fit.+    /// padding they carry themselves.     @ViewBuilder     private func chromeRows(_ plan: TodayDisplayPlan) -> some View {         if scrollsChrome(plan) {             Section {+                header(plan)+                    .constellationListRow(insets: Self.zeroRowInsets)                 if plan.showsDayChrome {                     dayChrome                         // A `List` row takes its content's ideal height, so the-                        // compression that overlapped the range line and the cells-                        // in the fixed `VStack` cannot happen here — §10's wrap,-                        // never shrink (Reqs 10.2, 10.4).+                        // wrapped strip is never compressed — §10's wrap, never+                        // shrink (Reqs 10.2, 10.4).                         .fixedSize(horizontal: false, vertical: true)-                        .constellationListRow(insets: Self.chromeRowInsets)+                        .constellationListRow(insets: Self.zeroRowInsets)                 }                 banners-                    .constellationListRow(insets: Self.chromeRowInsets)+                    .constellationListRow(insets: Self.zeroRowInsets)             }         }     } -    private static let chromeRowInsets = EdgeInsets(+    private static let zeroRowInsets = EdgeInsets(         top: 0, leading: 0, bottom: 0, trailing: 0)      /// The week widget — drawn only while the screen is showing one day     /// (Reqs 3.3, 3.4).     ///-    /// **No caption row** (Q78, superseding Req 4.1's): once Q76 took the page-    /// title and the dated headers, the full date under the search field was a-    /// third spelling of a day the widget's selected cell and its range line-    /// already name, and those two name it where the reader changes it.+    /// The day itself is named once, by the header above it (Today v2 §3); the+    /// widget carries no range line since then.     ///-    /// **One block, not two rows** (Q79): the chevrons span the range line and-    /// the cells both, and the widget carries its own padding — a horizontal-    /// inset here would be width taken off the cells, which is the thing the-    /// owner asked for more of.+    /// **One block** (Q79): the chevrons span the cells' full height, and the+    /// widget carries its own padding — a horizontal inset here would be width+    /// taken off the cells, which is the thing the owner asked for more of.     private var dayChrome: some View {-        // Bound once, the way `body` binds the plan: `week` walks a calendar-        // interval and seven `adding(days:)` behind it.-        let selectedDay = selectedDay-        let week = week-        return WeekWidget(+        WeekWidget(             week: week,             selectedDay: selectedDay,             currentDay: currentDay,-            dueWeekdays: schedule.dueWeekdays,             calendar: calendar,             onPage: onPageWeek,-            onSelect: onSelectDay,-            onSelectToday: onSelectToday)+            onSelect: onSelectDay)+    }++    /// The selected day as a title and the Settings button (Today v2 §3).+    ///+    /// The title goes while the screen spans every day — no one day is shown+    /// then — and the button stays, because on the phone it is the only route+    /// to Settings.+    private func header(_ plan: TodayDisplayPlan) -> some View {+        let selectedDay = selectedDay+        return TodayHeader(+            title: plan.showsDayChrome+                ? TodayDateText.header(selectedDay, calendar: calendar) : nil,+            fullDate: TodayDateText.complete(selectedDay, calendar: calendar),+            isOnCurrentDay: selectedDay == currentDay,+            onSelectToday: onSelectToday,+            onShowSettings: onShowSettings)     }      // MARK: - The list@@ -384,9 +391,8 @@ struct TodayView: View {             placement: plan.day.placement, drawsNotedHeader: plan.drawsNotedHeader)         return List {             chromeRows(plan)-            // Q24: directly after the chrome and before every content section.-            // Above the chrome it would sit over the search field, and at the-            // accessibility sizes the chrome *is* the list's first section.+            // Q24: directly after the chrome and before every content section,+            // so it never sits above the header and the week widget.             announcementSection(plan)             switch plan.day.placement {             case .releasesFirst:@@ -454,17 +460,31 @@ struct TodayView: View {                     .foregroundStyle(AsterismColors.secondaryText)                     .constellationListRow()                     .accessibilityIdentifier("today-releases-empty")+            } else if dynamicTypeSize.isAccessibilitySize {+                // Today v2 §4: a 98 pt cover cannot hold an accessibility-size+                // title, so the shelf falls back to the vertical rows.+                releaseRows(plan.day.releases, selectedDay: plan.day.day)             } else {-                releaseRows(-                    plan.day.releases, identifierPrefix: ReleaseRowView.releasePrefix,-                    selectedDay: plan.day.day)+                ReleaseShelf(+                    rows: ReleaseShelfText.ordered(plan.day.releases),+                    onSelect: onSelectWork)+                    .constellationListRow(insets: Self.zeroRowInsets)             }         } header: {-            ConstellationSectionHeader(-                TodayTitleText.releasesHeader,-                accent: accent-            )-            .accessibilityIdentifier("today-section-releases")+            HStack {+                ConstellationSectionHeader(+                    TodayTitleText.releasesHeader,+                    accent: accent+                )+                .accessibilityIdentifier("today-section-releases")+                Spacer()+                if !plan.day.releases.isEmpty {+                    Text(ReleaseShelfText.summary(plan.day.releases))+                        .font(.caption)+                        .foregroundStyle(AsterismColors.secondaryText)+                        .accessibilityIdentifier("today-releases-summary")+                }+            }         }     } @@ -485,9 +505,14 @@ struct TodayView: View {     private func catchingUpSection(_ plan: TodayDisplayPlan) -> some View {         if !plan.day.catchingUp.isEmpty {             Section {-                releaseRows(-                    plan.day.catchingUp, identifierPrefix: ReleaseRowView.catchUpPrefix,-                    selectedDay: plan.day.day)+                // Today v2 §5: one card, one compact row per work.+                CatchUpCard(+                    rows: CatchUpText.ordered(plan.day.catchingUp),+                    selectedDay: plan.day.day,+                    currentDay: currentDay,+                    calendar: calendar,+                    onSelect: onSelectWork)+                    .constellationListRow()             } header: {                 ConstellationSectionHeader(                     TodayTitleText.catchingUpHeader,@@ -498,17 +523,13 @@ struct TodayView: View {         }     } -    /// The rows both release-shaped sections draw. They are the same row and-    /// read the same second line (Q13); only the identifier prefix differs, so-    /// there is one `ReleaseRowView` call site rather than two that can drift.+    /// The releases section's vertical rows, drawn at the accessibility sizes+    /// where a 98 pt shelf cover cannot hold the title (Today v2 §4).     @ViewBuilder-    private func releaseRows(-        _ rows: [ReleaseRow], identifierPrefix: String, selectedDay: CivilDay-    ) -> some View {+    private func releaseRows(_ rows: [ReleaseRow], selectedDay: CivilDay) -> some View {         ForEach(rows) { row in             ReleaseRowView(                 row: row,-                identifierPrefix: identifierPrefix,                 selectedDay: selectedDay,                 currentDay: currentDay,                 calendar: calendar,@@ -538,8 +559,9 @@ struct TodayView: View {                             .constellationListRow()                             .accessibilityIdentifier("today-noted-empty")                     } else {-                        ForEach(noted.rows) { row in-                            entryRow(row)+                        // Today v2 §8: a timeline rather than cards.+                        ForEach(Array(noted.rows.enumerated()), id: \.element.id) { index, row in+                            timelineRow(row, isFirst: index == 0, isLast: index == noted.rows.count - 1)                         }                     }                 } header: {@@ -588,6 +610,24 @@ struct TodayView: View {         .accessibilityIdentifier("recent-list")     } +    private func timelineRow(+        _ row: TodayPresentationRow, isFirst: Bool, isLast: Bool+    ) -> some View {+        NotedTimelineRow(+            row: row,+            isFirst: isFirst,+            isLast: isLast,+            isSelected: row.id == selectedEntryID,+            onSelect: onSelect,+            onTeach: onTeach,+            onResolveDuplicate: onResolveDuplicate,+            resolutionKey: duplicateSetKey(for: row)+        )+        // No vertical insets, so each row's rule meets the next row's.+        .constellationListRow(+            insets: EdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 16))+    }+     private func entryRow(_ row: TodayPresentationRow) -> some View {         TodayEntryRow(             row: row,@@ -1359,7 +1399,7 @@ struct TodayEntryRow: View {     /// causes teaching is refused, and the route is the diagnosis screen     /// (Req 4.1). `citationUnresolved` is the exception — its hostname is     /// teachable, so the row keeps the Re-teach pill beside this label.-    private static func attentionLabel(_ attention: RecentRowAttention) -> String {+    static func attentionLabel(_ attention: RecentRowAttention) -> String {         switch attention {         case .siteMissing: "No site record for this address"         case .siteDuplicated: "This site is stored more than once"@@ -1369,7 +1409,11 @@ struct TodayEntryRow: View {         }     } -    private var accessibilityTitle: String {+    private var accessibilityTitle: String { Self.accessibilityTitle(row) }++    /// The work and chapter a row names, for its button's spoken label. Shared+    /// with the noted timeline's row, which names the same entry.+    static func accessibilityTitle(_ row: TodayPresentationRow) -> String {         let workTitle = row.workDisplayTitle ?? row.unresolvedCandidateTitle         switch (workTitle, row.chapterTitle) {         case let (work?, chapter?):@@ -1400,39 +1444,9 @@ struct TodayEntryRow: View {             .accessibilityLabel(                 "Open entry \(accessibilityTitle) from \(siteNames.label(for: row.hostname))") -            // Req 9.2: the same pill shape as Teach, deliberately — one inline-            // affordance pattern, so a reader who has learned one has learned-            // the other. It sits *beside* the teaching pill rather than-            // replacing it: a row can be unparsed and duplicated at once, and-            // those are two different actions.-            if let resolutionKey, let onResolveDuplicate {-                Button {-                    onResolveDuplicate(resolutionKey)-                } label: {-                    // §7's pill recipe, shared with Teach per Decision 1.-                    Text("Resolve")-                        .constellationPill(.attention)-                }-                .buttonStyle(.plain)-                .accessibilityIdentifier("resolve-duplicate-pill")-                .accessibilityLabel(-                    row.duplicateRoute?.blockingWorkSet == nil-                        ? "Resolve duplicate copies"-                        : "Resolve the duplicate work this is waiting on")-            }--            if row.isActionable, row.actionType != .none, row.actionType != .resolveDuplicate,-               let onTeach {-                Button {-                    onTeach(row.id)-                } label: {-                    Text(row.actionType == .teach ? "Teach" : "Re-teach")-                        .constellationPill(.attention)-                }-                .buttonStyle(.plain)-                .accessibilityIdentifier("teach-pill")-                .accessibilityLabel(row.actionType == .teach ? "Teach title pattern" : "Re-teach title pattern")-            }+            TodayEntryPills(+                row: row, onTeach: onTeach, onResolveDuplicate: onResolveDuplicate,+                resolutionKey: resolutionKey)         }         .padding(.vertical, 10)         .padding(.horizontal, 12)@@ -1452,7 +1466,12 @@ struct TodayEntryRow: View {         .accessibilityAddTraits(isSelected ? [.isSelected] : [])     } -    private var needsAttention: Bool {+    private var needsAttention: Bool { Self.needsAttention(row) }++    /// Q38: the amber edge follows `attention`, not `isActionable` alone — an+    /// attention row's action was withdrawn because it could not succeed.+    /// Shared with the noted timeline row, which marks its rail instead.+    static func needsAttention(_ row: TodayPresentationRow) -> Bool {         row.isActionable || row.attention != nil || row.duplicateRoute != nil     } @@ -1500,32 +1519,14 @@ struct TodayEntryRow: View {             // says what the app cannot resolve. The amber edge is shared with             // actionable rows; the label is what tells them apart.             if let attention = row.attention {-                HStack(spacing: 4) {-                    Image(systemName: "exclamationmark.triangle")-                        .font(.caption2)-                        .foregroundStyle(AsterismColors.amberText)-                        .accessibilityHidden(true)-                    Text(Self.attentionLabel(attention))-                        .font(.caption)-                        .foregroundStyle(AsterismColors.amberText)-                        .lineLimit(2)-                }-                .accessibilityIdentifier("entry-attention")+                TodayWarningLine(text: Self.attentionLabel(attention), lineLimit: 2)+                    .accessibilityIdentifier("entry-attention")             }              // Actionable unresolved candidate             if row.isActionable, let candidate = row.unresolvedCandidateTitle {-                HStack(spacing: 4) {-                    Image(systemName: "exclamationmark.triangle")-                        .font(.caption2)-                        .foregroundStyle(AsterismColors.amberText)-                        .accessibilityHidden(true)-                    Text(candidate)-                        .font(.caption)-                        .foregroundStyle(AsterismColors.amberText)-                        .lineLimit(1)-                }-                .accessibilityIdentifier("entry-unresolved-candidate")+                TodayWarningLine(text: candidate, lineLimit: 1)+                    .accessibilityIdentifier("entry-unresolved-candidate")             }              HStack(spacing: 6) {@@ -1584,37 +1585,18 @@ struct ReleaseRowView: View {     /// reader reads it. The row draws no site text of its own.     @Environment(\.siteNames) private var siteNames -    /// What the releases section's rows are addressed by.+    /// What the releases section's rows are addressed by. Drawn at the+    /// accessibility sizes only since Today v2 §4, where the shelf falls back+    /// to them; the catch-up section has a card of its own (§5).     static let releasePrefix = "today-release-"-    /// What the catch-up section's rows are addressed by (`catch-up-mode` Q4).-    ///-    /// Two prefixes rather than one, because the two sections draw the same row-    /// for two different reasons and a **UI journey** has to be able to tell-    /// "due today" from "behind on it": a counted set of release rows must not-    /// quietly grow catch-up ones. An accessibility identifier is never spoken,-    /// so this does nothing for a VoiceOver reader — they tell the two apart by-    /// the section header they are under, which is what the header is for.-    static let catchUpPrefix = "today-catch-up-"      let row: ReleaseRow-    /// Which section's row this is: `releasePrefix` or `catchUpPrefix`. The-    /// row's own identifier is the prefix and the work's id, and the line's is-    /// the prefix and `line`.-    let identifierPrefix: String     /// The day the screen is showing, which is what the line is relative to.     let selectedDay: CivilDay     let currentDay: CivilDay     let calendar: Calendar     let onSelect: (UUID) -> Void -    /// Req 5.2: the cyan accent for a note taken on the day being shown, and-    /// secondary text for everything else — "you read this one today" is the-    /// state worth an accent.-    private var isNotedOnDay: Bool {-        if case .notedOnDay = row.line { return true }-        return false-    }-     private var line: String {         ReleaseLineText.line(             row.line, selectedDay: selectedDay, currentDay: currentDay, calendar: calendar)@@ -1641,9 +1623,10 @@ struct ReleaseRowView: View {                     Text(line)                         .font(.caption)                         .foregroundStyle(-                            isNotedOnDay ? AsterismColors.cyan : AsterismColors.secondaryText)+                            // Req 5.2: cyan for a note taken on the day shown.+                            row.isNotedOnDay ? AsterismColors.cyan : AsterismColors.secondaryText)                         .lineLimit(2)-                        .accessibilityIdentifier("\(identifierPrefix)line")+                        .accessibilityIdentifier("\(Self.releasePrefix)line")                 }             )             .frame(maxWidth: .infinity, alignment: .leading)@@ -1654,7 +1637,7 @@ struct ReleaseRowView: View {         .padding(.horizontal, 12)         .constellationCard()         .accessibilityElement(children: .combine)-        .accessibilityIdentifier("\(identifierPrefix)\(row.id.uuidString)")+        .accessibilityIdentifier("\(Self.releasePrefix)\(row.id.uuidString)")         .accessibilityLabel(             "\(row.title), \(line), from \(siteNames.label(for: row.primaryHostname))")     }
Asterism/Asterism/Views/WeekStripView.swift Modified +12 / -82
diff --git a/Asterism/Asterism/Views/WeekStripView.swift b/Asterism/Asterism/Views/WeekStripView.swiftindex a0a8bb89..2953a6b7 100644--- a/Asterism/Asterism/Views/WeekStripView.swift+++ b/Asterism/Asterism/Views/WeekStripView.swift@@ -4,7 +4,13 @@ import SwiftUI  // The Today screen's day navigation (`update-schedule` Reqs 4.1–4.5, 10.2, // 10.4): **one widget**, a chevron at each end spanning its full height, with-// the displayed week's range over the seven day cells between them (Q79).+// the seven day cells between them (Q79).+//+// The week-range pill that sat over the cells is gone (Today v2 handover §2,+// `docs/Asterism-Today-v2.md`): the header's date title is the route back to+// today now, and the cells carry no release dot — the releasing shelf says what+// is due on the selected day, and a dot on every due weekday said it seven+// times over. // // Q25's separate week row above the strip is superseded: seen on the phone, two // stacked rows spent a whole line on two chevrons while the cells sat narrow in@@ -63,16 +69,9 @@ struct WeekWidget: View {     let week: [CivilDay]     let selectedDay: CivilDay     let currentDay: CivilDay-    /// Req 4.2: the weekdays at least one scheduled work is due on, on every-    /// displayed week, past weeks included (Q15).-    let dueWeekdays: Set<ReleaseDay>     let calendar: Calendar     let onPage: (Int) -> Void     let onSelect: (CivilDay) -> Void-    /// Q80: the range line's own tap — the selection returns to the current-    /// day, and the week follows it, because the widget derives the week it-    /// draws from the day that is selected.-    let onSelectToday: () -> Void      /// Reqs 10.2 and 10.4. **The wrap branch is on the content size, not on     /// fit** (Q35): a layout that depends on measurement differs between two@@ -112,21 +111,7 @@ struct WeekWidget: View {         HStack(spacing: 0) {             chevron(weeks: -1, systemImage: "chevron.left", metrics: metrics) -            VStack(spacing: 2) {-                // Req 4.3's range, over the cells rather than beside the-                // chevrons: the chevrons now span both, so the line that names-                // what they move costs no row of its own.-                //-                // Q80: it is also the way **back**. A reader who has paged three-                // weeks out has two chevrons and no shortcut; the line naming-                // the week they are on is where they look for one. Nothing is-                // disabled on the current week — the tap is a no-op there, and a-                // control that greys out on the screen it opens on reads as-                // broken rather than as unnecessary.-                rangeLine--                cells(metrics)-            }+            cells(metrics)              chevron(weeks: 1, systemImage: "chevron.right", metrics: metrics)         }@@ -134,57 +119,11 @@ struct WeekWidget: View {         .padding(.vertical, 4)     } -    /// The displayed week's range (Req 4.3), and Q80's route back to the-    /// current day.-    ///-    /// Q81: a **neutral pill**, because as a bare caption it read as one — the-    /// genre-tag recipe of §7, `cardFill` inside a 1 pt `cardBorder` at the tag-    /// radius, with the label a step up at `.subheadline`. Neutral rather than-    /// the cells' cyan: cyan means *selected* on this widget, and the range is-    /// not one of the seven things that can be chosen. Amber is out for the same-    /// kind of reason — nothing here needs clearing.-    ///-    /// The recipe is **borrowed** rather than used through `constellationPill`,-    /// exactly as the cells borrow the segmented capsule's selected colours-    /// (Q18): that modifier carries its own `.caption` type and a 44 pt minimum-    /// frame, and the frame alone would spend the height Q79 bought back. What-    /// the widget does grow by is measured: 12.3 pt, the pill's 10 pt of-    /// vertical padding plus the ~2.3 pt the type step adds to the line.-    ///-    /// `.plain`, as the chevrons and the cells are: the fill and the border are-    /// what say "tappable", and a button tint would say it in a second voice.-    /// Nothing dims on the current week (Q80) — a no-op is still a control.-    private var rangeLine: some View {-        let shape = RoundedRectangle(cornerRadius: AsterismLayout.tagRadius, style: .continuous)-        return Button(action: onSelectToday) {-            Text(WeekStripText.range(of: week, calendar: calendar))-                .font(.subheadline)-                .foregroundStyle(AsterismColors.secondaryText)-                // §10: a date range wraps rather than truncating, and the pill-                // hugs however many lines that takes.-                .multilineTextAlignment(.center)-                .fixedSize(horizontal: false, vertical: true)-                .padding(.horizontal, 12)-                .padding(.vertical, 5)-                .background { shape.fill(AsterismColors.cardFill) }-                .overlay {-                    shape-                        .strokeBorder(AsterismColors.cardBorder, lineWidth: 1)-                        .allowsHitTesting(false)-                }-                .contentShape(shape)-        }-        .buttonStyle(.plain)-        .accessibilityIdentifier("today-week-range")-        .accessibilityLabel(WeekStripText.rangeLabel(of: week, calendar: calendar))-        .accessibilityHint(WeekStripText.rangeHint)-    }-     /// Req 4.3's control, labelled with the week it moves to (Req 4.5).     ///-    /// Q79: it is a **column**, not a 44 × 44 square — it spans the range line-    /// and the cells both, so the target is at least as tall as the 44 pt-    /// minimum whatever the chevron column narrows to in a 320 pt list.+    /// Q79: it is a **column**, not a 44 × 44 square — it spans the cells'+    /// full height, so the target is at least as tall as the 44 pt minimum+    /// whatever the chevron column narrows to in a 320 pt list.     private func chevron(         weeks: Int, systemImage: String, metrics: WeekWidgetMetrics     ) -> some View {@@ -239,7 +178,6 @@ struct WeekWidget: View {                     weekdayLetter: ReleaseDaysText.symbol(weekday, in: letters),                     isSelected: day == selectedDay,                     isCurrent: day == currentDay,-                    hasReleases: dueWeekdays.contains(weekday),                     minWidth: metrics.minCellWidth,                     calendar: calendar,                     onSelect: onSelect)@@ -259,7 +197,6 @@ struct WeekStripCell: View {     let weekdayLetter: String     let isSelected: Bool     let isCurrent: Bool-    let hasReleases: Bool     /// Q79: the width the cell never goes below. Above it the cell **fills**     /// its share of what the chevrons leave, so the seven of them span the     /// widget rather than huddling in the middle of it.@@ -283,13 +220,6 @@ struct WeekStripCell: View {                     .font(.title3.weight(isCurrent || isSelected ? .semibold : .regular))                     .foregroundStyle(                         isSelected ? AsterismColors.cyan : AsterismColors.primaryText)-                // Req 4.2's dot, and Req 10.3: it is described by this cell's-                // label rather than exposed as an element of its own.-                Circle()-                    .fill(hasReleases ? AsterismColors.violet : .clear)-                    .frame(width: 4, height: 4)-                    .padding(.top, 2)-                    .accessibilityHidden(true)             }             .padding(.vertical, 2)             .frame(@@ -318,7 +248,7 @@ struct WeekStripCell: View {         .accessibilityLabel(             WeekStripText.label(                 day: day, isCurrent: isCurrent, isSelected: isSelected,-                hasReleases: hasReleases, calendar: calendar))+                calendar: calendar))         .accessibilityAddTraits(isSelected ? [.isSelected] : [])     } }
Asterism/AsterismTests/TodayDisplayPlanTests.swift Modified +35 / -18
diff --git a/Asterism/AsterismTests/TodayDisplayPlanTests.swift b/Asterism/AsterismTests/TodayDisplayPlanTests.swiftindex 175e826c..7da721d5 100644--- a/Asterism/AsterismTests/TodayDisplayPlanTests.swift+++ b/Asterism/AsterismTests/TodayDisplayPlanTests.swift@@ -602,14 +602,18 @@ struct TodayTitleTextTests {         #expect(TodayTitleText.catchingUpHeader == "Catching up")     } -    /// `catch-up-mode` Q4: the two sections draw the same row, so their-    /// identifiers are what tells them apart — for a journey and for the prune-    /// that counts one of the two sets.-    @Test("The two row prefixes are distinct and neither contains the other")+    /// `catch-up-mode` Q4: the releasing and catching-up sections are told+    /// apart by their identifiers — for a journey and for the prune that counts+    /// one of the two sets. Since Today v2 the catch-up rows are the card's own+    /// and the releases are shelf items, falling back to release rows at the+    /// accessibility sizes.+    @Test("The release and catch-up identifiers are distinct and neither contains the other")     @MainActor func theRowPrefixesTellTheSectionsApart() {+        let id = UUID()         #expect(ReleaseRowView.releasePrefix == "today-release-")-        #expect(ReleaseRowView.catchUpPrefix == "today-catch-up-")-        #expect(!ReleaseRowView.catchUpPrefix.hasPrefix(ReleaseRowView.releasePrefix))+        #expect(ReleaseShelfText.itemIdentifier(id) == "today-release-shelf-item-\(id.uuidString)")+        #expect(CatchUpText.rowIdentifier(id) == "today-catchup-row-\(id.uuidString)")+        #expect(!CatchUpText.rowIdentifier(id).hasPrefix(ReleaseRowView.releasePrefix))     }      /// Q76's other half: the **row** line still names the day, because a row is@@ -788,15 +792,14 @@ struct WeekStripTextTests {         #expect(WeekStripText.nextIdentifier == "today-week-next")     } -    /// Req 4.5: the full date, then whichever of the three marks applies — and-    /// the violet dot is described here rather than exposed as an element of its-    /// own (Req 10.3).+    /// Req 4.5: the full date, then whichever of the two marks applies. The+    /// cells carry no release dot since Today v2 §2, so nothing names releases.     ///     /// The date is the calendar's own locale's, not the host's (Q73) — pinned as     /// a literal for the reason `aDistantDayIsADate` is: an expectation built     /// with `Date.formatted(date:time:)` reads the ambient region and would     /// agree with the code by repeating its mistake.-    @Test("A cell's label names the date and every mark it carries")+    @Test("A cell's label names the date and every mark it carries, and no releases")     func theCellLabelNamesEveryMark() {         let calendar = Self.calendar(firstWeekday: 1)         let day = Self.civilDay(2025, 6, 15, in: calendar)@@ -804,20 +807,34 @@ struct WeekStripTextTests {          #expect(             WeekStripText.label(-                day: day, isCurrent: false, isSelected: false, hasReleases: false,-                calendar: calendar) == date)+                day: day, isCurrent: false, isSelected: false, calendar: calendar) == date)         #expect(             WeekStripText.label(-                day: day, isCurrent: true, isSelected: true, hasReleases: true,-                calendar: calendar) == "\(date), today, selected, releases due")+                day: day, isCurrent: true, isSelected: true, calendar: calendar)+                == "\(date), today, selected")         #expect(             WeekStripText.label(-                day: day, isCurrent: false, isSelected: true, hasReleases: false,-                calendar: calendar) == "\(date), selected")+                day: day, isCurrent: false, isSelected: true, calendar: calendar)+                == "\(date), selected")         #expect(             WeekStripText.label(-                day: day, isCurrent: true, isSelected: false, hasReleases: true,-                calendar: calendar) == "\(date), today, releases due")+                day: day, isCurrent: true, isSelected: false, calendar: calendar)+                == "\(date), today")+    }++    /// Today v2 §3: the header title is the selected day, abbreviated, in the+    /// calendar's own locale.+    @Test("The header title is the selected day's weekday, day and month")+    func theHeaderTitleIsTheSelectedDay() {+        var calendar = Self.calendar(firstWeekday: 2)+        calendar.locale = Locale(identifier: "en_AU")+        let day = Self.civilDay(2026, 9, 23, in: calendar)++        let title = TodayDateText.header(day, calendar: calendar)+        #expect(title.contains("Wed"))+        #expect(title.contains("23"))+        #expect(title.contains("Sep"))+        #expect(!title.contains("2026"))     }      /// Req 4.5: a week control is labelled with the week it moves **to**.
Asterism/AsterismTests/TodayShelfTextTests.swift Added +202 / -0
diff --git a/Asterism/AsterismTests/TodayShelfTextTests.swift b/Asterism/AsterismTests/TodayShelfTextTests.swiftnew file mode 100644index 00000000..deef4bda--- /dev/null+++ b/Asterism/AsterismTests/TodayShelfTextTests.swift@@ -0,0 +1,202 @@+import AsterismCore+import Foundation+import Testing+@testable import Asterism++// The releasing shelf's and the catching-up card's words and order (Today v2+// §4, §5, `docs/Asterism-Today-v2.md`). The views only draw what these decide.+@Suite("Today shelf and catch-up text")+struct TodayShelfTextTests {++    // MARK: - Fixtures++    nonisolated private static func calendar() -> Calendar {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = TimeZone(identifier: "UTC") ?? .gmt+        calendar.locale = Locale(identifier: "en_US_POSIX")+        return calendar+    }++    nonisolated private static func civilDay(_ year: Int, _ month: Int, _ day: Int) -> CivilDay {+        let calendar = calendar()+        guard let date = calendar.date(from: DateComponents(year: year, month: month, day: day))+        else { fatalError("\(year)-\(month)-\(day) does not resolve") }+        return CivilDay(date, calendar: calendar)+    }++    private static let webtoon = WorkTypeDisplay(+        assignment: .configured(UUID()), name: "webtoon", kind: .active)++    private func row(+        _ title: String, line: ReleaseRow.Line = .notNotedYet,+        type: WorkTypeDisplay = .untyped, lastChapter: Int? = nil,+        lastNotedDay: CivilDay? = nil, releasesSince: Int? = nil, primaryURL: URL? = nil+    ) -> ReleaseRow {+        ReleaseRow(+            id: UUID(), title: title, primaryHostname: "example.com", typeDisplay: type,+            thumbnail: nil, line: line, lastChapter: lastChapter, lastNotedDay: lastNotedDay,+            releasesSince: releasesSince, primaryURL: primaryURL)+    }++    private var today: CivilDay { Self.civilDay(2026, 9, 23) }++    // MARK: - Shelf++    @Test("The shelf puts unread works first and keeps title order within each half")+    func shelfOrdersUnreadFirst() {+        let readA = row("A", line: .notedOnDay(chapterLine: nil))+        let unreadB = row("B")+        let readC = row("C", line: .notedOnDay(chapterLine: nil))+        let unreadD = row("D", line: .lastNoted(chapterLine: nil, when: .yesterday))++        #expect(+            ReleaseShelfText.ordered([readA, unreadB, readC, unreadD]).map(\.title)+                == ["B", "D", "A", "C"])+        #expect(ReleaseShelfText.summary([readA, unreadB, readC, unreadD]) == "2 of 4 read")+    }++    @Test("An unread cover's badge is the next whole chapter, spelled for the work's type")+    func shelfBadgeIsTheNextChapter() {+        #expect(ReleaseShelfText.badge(row("Novel", lastChapter: 686)) == "Ch 687")+        #expect(ReleaseShelfText.badge(row("Comic", type: Self.webtoon, lastChapter: 31)) == "Ep 32")+        // Never guessed: no whole chapter number, no badge.+        #expect(ReleaseShelfText.badge(row("Unnumbered")) == nil)+        // A read cover wears the check instead.+        #expect(+            ReleaseShelfText.badge(+                row("Read", line: .notedOnDay(chapterLine: "31"), lastChapter: 31)) == nil)+    }++    @Test("A shelf item says whether it has been read and, if not, what comes next")+    func shelfItemLabel() {+        #expect(+            ReleaseShelfText.label(row("Comic", type: Self.webtoon, lastChapter: 31))+                == "Comic, episode 32, not read yet")+        #expect(ReleaseShelfText.label(row("Plain")) == "Plain, not read yet")+        #expect(+            ReleaseShelfText.label(row("Done", line: .notedOnDay(chapterLine: nil)))+                == "Done, read")+    }++    // MARK: - Catching up++    @Test("The catch-up card lists the stalest first, never-read at the top")+    func catchUpOrdersStalestFirst() {+        let recent = row("Recent", lastNotedDay: Self.civilDay(2026, 9, 20))+        let never = row("Never")+        let old = row("Old", lastNotedDay: Self.civilDay(2026, 8, 1))+        let alsoRecent = row("Also recent", lastNotedDay: Self.civilDay(2026, 9, 20))++        #expect(+            CatchUpText.ordered([recent, never, old, alsoRecent]).map(\.title)+                == ["Never", "Old", "Recent", "Also recent"])+    }++    @Test("A catch-up row says what was read last, when, and how many releases since")+    func catchUpStatusLine() {+        let calendar = Self.calendar()+        let behind = row(+            "Behind", line: .lastNoted(chapterLine: "9", when: .daysAgo(5)),+            type: Self.webtoon, lastChapter: 9, releasesSince: 2)+        #expect(+            CatchUpText.status(behind, selectedDay: today, currentDay: today, calendar: calendar)+                == "Last read Ep 9 · 5 days ago · ~2 releases since")+        #expect(+            CatchUpText.status(+                behind, selectedDay: today, currentDay: today, calendar: calendar, spoken: true)+                == "Last read episode 9 · 5 days ago · ~2 releases since")++        // No release days to count, or none passed: no count.+        let unscheduled = row(+            "Unscheduled", line: .lastNoted(chapterLine: "Interlude", when: .lastWeek))+        #expect(+            CatchUpText.status(+                unscheduled, selectedDay: today, currentDay: today, calendar: calendar)+                == "Last read Interlude · last week")++        #expect(+            CatchUpText.status(row("New"), selectedDay: today, currentDay: today, calendar: calendar)+                == "Not read yet")++        let readToday = row(+            "Today", line: .notedOnDay(chapterLine: "12"), lastChapter: 12, releasesSince: 0)+        #expect(+            CatchUpText.status(+                readToday, selectedDay: today, currentDay: today, calendar: calendar)+                == "Read Ch 12 · today")+    }++    @Test("The Next capsule names the next chapter, or Open where there is none")+    func catchUpNextCapsule() {+        let numbered = row("Numbered", type: Self.webtoon, lastChapter: 26)+        #expect(CatchUpText.nextLabel(numbered) == "Ep 27")+        #expect(+            CatchUpText.nextAccessibilityLabel(numbered) == "Open Numbered, next is episode 27",+            "No work page: the tap opens the work in the app")++        let unnumbered = row("Unnumbered")+        #expect(CatchUpText.nextLabel(unnumbered) == "Open")+        #expect(CatchUpText.nextAccessibilityLabel(unnumbered) == "Open Unnumbered")+    }++    @Test("Comic types count episodes and everything else counts chapters")+    func chapterPrefixFollowsTheType() {+        #expect(ChapterNumberText.countsEpisodes(Self.webtoon))+        #expect(+            ChapterNumberText.countsEpisodes(+                WorkTypeDisplay(assignment: .configured(UUID()), name: "Manga", kind: .active)))+        #expect(+            !ChapterNumberText.countsEpisodes(+                WorkTypeDisplay(assignment: .configured(UUID()), name: "novel", kind: .active)))+        #expect(!ChapterNumberText.countsEpisodes(.untyped))+    }++    @Test("The Next capsule's spoken label names the work page as the destination")+    func nextCapsuleNamesTheWorkPage() {+        let withPage = row(+            "Paged", type: Self.webtoon, lastChapter: 26,+            primaryURL: URL(string: "https://example.com/story"))+        #expect(CatchUpText.nextAccessibilityLabel(withPage) == "Open work page, next is episode 27")+        #expect(+            CatchUpText.nextAccessibilityLabel(+                row("Paged", primaryURL: URL(string: "https://example.com/story")))+                == "Open work page")+    }++    @Test("Episode words match whole words only")+    func episodeWordsAreWholeWords() {+        func type(_ name: String) -> WorkTypeDisplay {+            WorkTypeDisplay(assignment: .configured(UUID()), name: name, kind: .active)+        }+        #expect(ChapterNumberText.countsEpisodes(type("Korean webtoon")))+        #expect(ChapterNumberText.countsEpisodes(type("web-comic")))+        #expect(!ChapterNumberText.countsEpisodes(type("cartoon novel")))+        #expect(!ChapterNumberText.countsEpisodes(type("mangaesque")))+    }++    @Test("The catch-up card shows five rows until Show all, and no toggle when all fit")+    func catchUpCardCollapses() {+        let six = (1...6).map { row("Work \($0)") }+        #expect(CatchUpText.visible(six, showsAll: false).count == 5)+        #expect(CatchUpText.visible(six, showsAll: true).count == 6)+        #expect(CatchUpText.toggleLabel(rowCount: 6, showsAll: false) == "Show all 6")+        #expect(CatchUpText.toggleLabel(rowCount: 6, showsAll: true) == "Show fewer")+        #expect(CatchUpText.toggleLabel(rowCount: 5, showsAll: false) == nil)+    }++    @Test("The header hints at the way back only away from the current day")+    func headerHint() {+        #expect(TodayHeaderText.hint(isOnCurrentDay: true) == nil)+        #expect(TodayHeaderText.hint(isOnCurrentDay: false) == "Returns to today")+    }++    @Test("A note on a selected day other than today names that weekday")+    func notedOnAnotherDay() {+        let calendar = Self.calendar()+        let yesterday = Self.civilDay(2026, 9, 22)+        let noted = row("Noted", line: .notedOnDay(chapterLine: "12"), lastChapter: 12)+        #expect(+            CatchUpText.status(noted, selectedDay: yesterday, currentDay: today, calendar: calendar)+                == "Read Ch 12 · Tuesday")+    }+}
Asterism/AsterismUITests/AccessibilityJourneyUITests.swift Modified +6 / -5
diff --git a/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift b/Asterism/AsterismUITests/AccessibilityJourneyUITests.swiftindex b582fd71..a80be832 100644--- a/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift+++ b/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift@@ -1204,10 +1204,11 @@ final class AccessibilityJourneyUITests: XCTestCase {     /// split is a guarantee and not a measurement, and this is the case that     /// fails if the branch ever goes back to `ViewThatFits`.     ///-    /// **Horizontal containment only.** At this size the widget's range pill-    /// alone wraps to two lines (Q81), so "inside the window" vertically is a-    /// claim about how much of the screen the chrome has taken, not about the cells — the-    /// same reading `WorkDetailStatusUITests` applies to the toggles.+    /// **Horizontal containment only.** At this size the header's date title+    /// above the widget takes much of the screen, so "inside the window"+    /// vertically is a claim about how much of the screen the chrome has taken,+    /// not about the cells — the same reading `WorkDetailStatusUITests` applies+    /// to the toggles.     @MainActor     func testTheWeekStripWrapsFourAndThreeAtLargestDynamicType() {         launchSeeded(@@ -1220,7 +1221,7 @@ final class AccessibilityJourneyUITests: XCTestCase {             app.collectionViews["recent-list"].waitForExistence(timeout: 60),             "The today fixture opens")         XCTAssertTrue(-            app.anyElement("today-week-range").waitForExistence(timeout: 15),+            app.anyElement("today-header-date").waitForExistence(timeout: 15),             "…on a day, so the strip is drawn")          // Sorted by identifier, which is `today-strip-yyyy-MM-dd` and therefore
Asterism/AsterismUITests/AnnouncementUITests.swift Modified +2 / -2
diff --git a/Asterism/AsterismUITests/AnnouncementUITests.swift b/Asterism/AsterismUITests/AnnouncementUITests.swiftindex a56fd0a7..dea657b4 100644--- a/Asterism/AsterismUITests/AnnouncementUITests.swift+++ b/Asterism/AsterismUITests/AnnouncementUITests.swift@@ -109,7 +109,7 @@ final class AnnouncementUITests: XCTestCase {         XCTAssertFalse(             app.anyElement("recent-empty").exists,             "Req: the noted section's message is replaced, not doubled")-        waitFor(app.anyElement("today-week-range"), "…and the day around it is untouched")+        waitFor(app.anyElement("today-header-date"), "…and the day around it is untouched")          row.tap()         waitFor(app.anyElement("announcement-document"), "The row opens the guide")@@ -218,7 +218,7 @@ final class AnnouncementUITests: XCTestCase {     func testASeededLaunchWithNoOverrideShowsNoRow() {         launch(lastSeenVersion: nil) -        waitFor(app.anyElement("today-week-range"), "Today is showing one day")+        waitFor(app.anyElement("today-header-date"), "Today is showing one day")         XCTAssertFalse(             releaseNoteRow.exists,             "A device that has already seen this version is shown nothing")
Asterism/AsterismUITests/SearchUITests.swift Modified +1 / -1
diff --git a/Asterism/AsterismUITests/SearchUITests.swift b/Asterism/AsterismUITests/SearchUITests.swiftindex 5e479ab3..7ff3e133 100644--- a/Asterism/AsterismUITests/SearchUITests.swift+++ b/Asterism/AsterismUITests/SearchUITests.swift@@ -59,7 +59,7 @@ final class SearchUITests: XCTestCase {         launch("seeded-composed")         let list = waitFor(             app.collectionViews["recent-list"], "Today publishes the seeded library", timeout: 60)-        waitFor(app.anyElement("today-week-range"), "…on a day, with its chrome")+        waitFor(app.anyElement("today-header-date"), "…on a day, with its chrome")          list.swipeDown()         XCTAssertEqual(
Asterism/AsterismUITests/TodayUITests.swift Modified +51 / -86
diff --git a/Asterism/AsterismUITests/TodayUITests.swift b/Asterism/AsterismUITests/TodayUITests.swiftindex c890c8d7..a4145e0b 100644--- a/Asterism/AsterismUITests/TodayUITests.swift+++ b/Asterism/AsterismUITests/TodayUITests.swift@@ -74,23 +74,26 @@ final class TodayUITests: XCTestCase {     private func launchToday() {         launch("seeded-today")         waitFor(app.collectionViews["recent-list"], "The today fixture opens", timeout: 60)-        // Q78: the day chrome is the week row and the strip, and the caption-        // that used to be this landmark is gone.-        waitFor(app.anyElement("today-week-range"), "…on a day rather than on every day")+        // Today v2 §3: the header's date title is the landmark for "one day",+        // as the week-range pill was before it.+        waitFor(app.anyElement("today-header-date"), "…on a day rather than on every day")     }      private var recentRows: XCUIElementQuery {         app.elements(withIdentifierPrefix: "recent-entry-")     } +    /// The releasing shelf's covers (Today v2 §4). The vertical release rows+    /// they fall back to are drawn at the accessibility sizes only.     private var releaseRows: XCUIElementQuery {-        app.elements(withIdentifierPrefix: "today-release-")+        app.elements(withIdentifierPrefix: "today-release-shelf-item-")     } -    /// The other section's rows (`catch-up-mode` Q4). The two prefixes are-    /// disjoint, which is why the counts above are unmoved by a catch-up work.+    /// The catching-up card's rows (`catch-up-mode` Q4, Today v2 §5). The two+    /// prefixes are disjoint, which is why the counts above are unmoved by a+    /// catch-up work.     private var catchUpRows: XCUIElementQuery {-        app.elements(withIdentifierPrefix: "today-catch-up-")+        app.elements(withIdentifierPrefix: "today-catchup-row-")     }      // MARK: - Days, and reaching them@@ -453,20 +456,12 @@ final class TodayUITests: XCTestCase {      /// Seven cells for the displayed week, each labelled with its full date and     /// with whatever else is true of it; the selected cell carrying the trait as-    /// well as the word; and the violet dot described by the label rather than-    /// exposed as an element of its own (Req 10.3).-    ///-    /// The two days with releases are found by **weekday** rather than by date:-    /// Req 4.2's dots are drawn on every displayed week, past weeks included-    /// (Q15), so which cells carry one is a fact about the weekday and not about-    /// the week showing.+    /// well as the word. Since Today v2 §2 no cell carries a release dot, so no+    /// label names releases and the strip publishes nothing but its seven days.     func testTheStripDrawsTheWeekAndSaysWhatIsTrueOfEachDay() {         launchToday()          let calendar = Calendar.current-        let currentWeekday = calendar.component(.weekday, from: launchDay)-        let previousWeekday = calendar.component(.weekday, from: date(daysFromLaunch: -1))-        var withReleases = 0          for day in week(containing: launchDay) {             let cell = waitFor(@@ -476,16 +471,11 @@ final class TodayUITests: XCTestCase {                 label.contains("\(calendar.component(.day, from: day))"),                 "Req 4.5: the cell's label names the date — was \"\(label)\"") -            let weekday = calendar.component(.weekday, from: day)-            let dueHere = weekday == currentWeekday || weekday == previousWeekday-            XCTAssertEqual(-                label.contains("releases due"), dueHere,-                "Req 4.2: a dot is drawn exactly where a scheduled work is due — \"\(label)\"")-            if dueHere { withReleases += 1 }+            XCTAssertFalse(+                label.contains("releases"),+                "Today v2 §2: the cells carry no release dot, so no label names one — "+                    + "\"\(label)\"")         }-        XCTAssertEqual(-            withReleases, 2,-            "The fixture schedules the current weekday and the one before it, and no other")          let today = waitFor(stripCell(daysFromLaunch: 0), "The current day has a cell")         XCTAssertTrue(today.label.contains("today"), "Req 4.5: the current day says so")@@ -510,29 +500,16 @@ final class TodayUITests: XCTestCase {     func testThePreviousAndNextControlsPageTheWeek() {         launchToday() -        let range = waitFor(app.anyElement("today-week-range"), "Req 4.3: the week names itself")-        let thisWeek = range.label-        XCTAssertFalse(thisWeek.isEmpty, "The week row carries its range")-         let previous = waitFor(             app.anyElement("today-week-previous"), "Req 4.3: the week row pages backwards")         XCTAssertTrue(             previous.label.hasPrefix("Previous week, "),             "Req 4.5: the control names where it goes — was \"\(previous.label)\"")-        let promised = String(previous.label.dropFirst("Previous week, ".count))          previous.tap()         shownDay = date(daysFromLaunch: -7)-        // `hasPrefix`, not equality: Q80 made the range a control, so its label-        // is the range the chevron promised followed by what tapping it does.-        let paged = XCTNSPredicateExpectation(-            predicate: NSPredicate { _, _ in range.exists && range.label.hasPrefix(promised) },-            object: nil)-        XCTAssertEqual(-            XCTWaiter().wait(for: [paged], timeout: 15), .completed,-            "Q6: the strip pages back, onto the week the control named")         waitFor(-            stripCell(daysFromLaunch: -7), "…and the previous week's days are the cells now")+            stripCell(daysFromLaunch: -7), "Q6: the strip pages back — the previous week's days are the cells now")          let next = waitFor(app.anyElement("today-week-next"), "Req 4.3: and forwards")         XCTAssertTrue(@@ -540,49 +517,42 @@ final class TodayUITests: XCTestCase {             "Req 4.5: the forward control names where it goes — was \"\(next.label)\"")         next.tap()         shownDay = launchDay-        let returned = XCTNSPredicateExpectation(-            predicate: NSPredicate { _, _ in range.exists && range.label == thisWeek }, object: nil)-        XCTAssertEqual(-            XCTWaiter().wait(for: [returned], timeout: 15), .completed,-            "…and paging forward comes back to the week it started on")-        waitFor(stripCell(daysFromLaunch: 0), "The current day is on the strip again")+        waitFor(stripCell(daysFromLaunch: 0), "…and paging forward comes back to the current week")     } -    /// Q80: the line naming the displayed week is also the way back to the-    /// current one. Paging out leaves a reader with two chevrons and no-    /// shortcut; tapping the range returns the selection to the current day,-    /// and the widget follows it because it draws the week the selection is in.-    func testTheWeekRangeReturnsToTheCurrentDay() {+    /// Today v2 §3, taking over Q80: the header's date title is the way back to+    /// the current day. Paging out leaves a reader with two chevrons and no+    /// shortcut; tapping the title returns the selection to the current day, and+    /// the widget follows it because it draws the week the selection is in.+    func testTheHeaderDateReturnsToTheCurrentDay() {         launchToday() -        let range = waitFor(app.anyElement("today-week-range"), "Q80: the week names itself")-        let thisWeek = range.label-        XCTAssertTrue(-            thisWeek.hasSuffix(", back to today"),-            "Q80: the range line says what tapping it does — was \"\(thisWeek)\"")+        let title = waitFor(app.anyElement("today-header-date"), "Today v2 §3: the header names the day")+        let currentDayLabel = title.label+        XCTAssertFalse(currentDayLabel.isEmpty, "The title is labelled with the full date")          page(-1)         let paged = XCTNSPredicateExpectation(-            predicate: NSPredicate { _, _ in range.exists && range.label != thisWeek },+            predicate: NSPredicate { _, _ in title.exists && title.label != currentDayLabel },             object: nil)         XCTAssertEqual(             XCTWaiter().wait(for: [paged], timeout: 15), .completed,-            "Req 4.3: the strip is on the previous week before the tap")+            "The title follows the selection onto the previous week")         XCTAssertTrue(             waitFor(stripCell(daysFromLaunch: -7), "…and its days are the cells").isSelected,             "Req 4.3: paging selects the same weekday in the week it moves to") -        range.tap()+        title.tap()         shownDay = launchDay         let returned = XCTNSPredicateExpectation(-            predicate: NSPredicate { _, _ in range.exists && range.label == thisWeek },+            predicate: NSPredicate { _, _ in title.exists && title.label == currentDayLabel },             object: nil)         XCTAssertEqual(             XCTWaiter().wait(for: [returned], timeout: 15), .completed,-            "Q80: tapping the range brings the widget back to the current week")+            "Today v2 §3: tapping the title brings the screen back to the current day")          let today = waitFor(stripCell(daysFromLaunch: 0), "…and the current day has a cell again")-        XCTAssertTrue(today.isSelected, "Q80: the selection returns to the current day")+        XCTAssertTrue(today.isSelected, "The selection returns to the current day")         XCTAssertTrue(today.label.contains("today"), "…which is the day the strip calls today")     } @@ -607,15 +577,12 @@ final class TodayUITests: XCTestCase {          XCTAssertEqual(releaseRows.count, 1, "Only Kite Season is due on the current weekday")         let release = releaseRows.firstMatch-        XCTAssertTrue(-            release.label.hasPrefix("Kite Season, Noted today"),-            "Req 5.2: the row names the work and the note taken on the day shown — "-                + "was \"\(release.label)\"")-        XCTAssertTrue(-            release.label.contains("Chapter 12"),-            "Req 5.2: …with the chapter line the taught site gives it")-        waitFor(-            app.anyElement("today-release-line"), "Req 5.2: the line is an element of the row")+        XCTAssertEqual(+            release.label, "Kite Season, read",+            "Today v2 §4: the cover names the work and that it was read on the day shown")+        XCTAssertEqual(+            waitFor(app.anyElement("today-releases-summary"), "The shelf counts what was read").label,+            "1 of 1 read")          // Req 6.1: scheduled by its days, excluded by its status.         XCTAssertFalse(@@ -651,15 +618,14 @@ final class TodayUITests: XCTestCase {         XCTAssertEqual(catchUpRows.count, 1, "Only Ember Road is being caught up on")         let catchUp = catchUpRows.firstMatch         XCTAssertTrue(-            catchUp.label.hasPrefix("Ember Road, Last noted"),-            "Q13: the catch-up row reads with the release row's second line — "-                + "was \"\(catchUp.label)\"")+            catchUp.label.hasPrefix("Ember Road, Last read"),+            "Today v2 §5: the card row says what was read last — was \"\(catchUp.label)\"")         XCTAssertTrue(             catchUp.label.contains("yesterday"),             "…measured against the day being shown — was \"\(catchUp.label)\"")-        waitFor(-            app.anyElement("today-catch-up-line"),-            "Q4: the line carries the section's own identifier prefix")+        XCTAssertEqual(+            app.elements(withIdentifierPrefix: "today-catchup-next-").count, 1,+            "Today v2 §5: each card row carries its own Next button")         XCTAssertEqual(             releaseRows.count, 1,             "Q8: a catch-up work lights no release row, and the prefixes are disjoint")@@ -750,7 +716,7 @@ final class TodayUITests: XCTestCase {     func testABannerFilterHidesTheDayChromeAndClearingBringsItBack() {         launch("seeded-tolerated-divergentEntrySet")         waitFor(app.collectionViews["recent-list"], "The library opens", timeout: 60)-        waitFor(app.anyElement("today-week-range"), "The day opens with its week row")+        waitFor(app.anyElement("today-header-date"), "The day opens with its week row")         waitFor(app.anyElement("today-section-releases"), "…and its releases section")          let banner = waitFor(app.buttons["duplicate-banner"], "Today shows the duplicate banner")@@ -761,7 +727,7 @@ final class TodayUITests: XCTestCase {         XCTAssertFalse(             app.anyElement("today-section-catching-up").exists, "Req 5.3: both of them")         XCTAssertFalse(-            app.anyElement("today-week-range").exists, "Req 5.3: the week row goes with them")+            app.anyElement("today-header-date").exists, "Req 5.3: the week row goes with them")         XCTAssertFalse(             stripCell(daysFromLaunch: 0).exists, "Req 5.3: and the strip")         waitFor(@@ -771,7 +737,7 @@ final class TodayUITests: XCTestCase {         // The banner is its own clear: it reads `Show All` while it filters.         banner.tap()         waitFor(-            app.anyElement("today-week-range"), "Req 5.3: clearing brings the day back",+            app.anyElement("today-header-date"), "Req 5.3: clearing brings the day back",             timeout: 15)         waitFor(stripCell(daysFromLaunch: 0), "…with its strip")         waitFor(app.anyElement("today-section-releases"), "…and its releases section")@@ -800,7 +766,7 @@ final class TodayUITests: XCTestCase {             XCTWaiter().wait(for: [settled], timeout: 60), .completed,             "Req 5.8: a library with nothing captured says so") -        waitFor(app.anyElement("today-week-range"), "Req 5.8: the week row stays")+        waitFor(app.anyElement("today-header-date"), "Req 5.8: the week row stays")         waitFor(stripCell(daysFromLaunch: 0), "Req 5.8: the strip stays")         assertHeader(             "today-section-releases", says: "Releasing",@@ -833,10 +799,9 @@ final class TodayUITests: XCTestCase {             app.anyElement("works-group-allWorks").exists, "…and the Works list is not what opened")          app.goBack()-        // Q76 took the title and Q78 the caption, so the claim is made against-        // the strip's **selected cell** — the one place the day is named, and-        // the thing that moves when the day changes.-        waitFor(app.anyElement("today-week-range"), "Req 3.6: Back returns to the day's chrome")+        // The claim is made against the strip's **selected cell** — the thing+        // that moves when the day changes.+        waitFor(app.anyElement("today-header-date"), "Req 3.6: Back returns to the day's chrome")         // Read as "not the selected one" rather than "selected == false", for         // the reason `testTheTabIsTodayAndTheScreenCarriesNoDayTitle` records:         // on the calendar's first weekday the strip has paged back a week and@@ -890,7 +855,7 @@ final class TodayUITests: XCTestCase {         app.goBack()         waitFor(app.anyElement("work-detail-pulse"), "Back returns to the work", timeout: 20)         app.goBack()-        waitFor(app.anyElement("today-week-range"), "…and Back again to the day and its chrome")+        waitFor(app.anyElement("today-header-date"), "…and Back again to the day and its chrome")     }      // MARK: - The seeder
Asterism/AsterismUITests/WideLayoutUITests.swift Modified +5 / -5
diff --git a/Asterism/AsterismUITests/WideLayoutUITests.swift b/Asterism/AsterismUITests/WideLayoutUITests.swiftindex cc8a584e..d81d93c1 100644--- a/Asterism/AsterismUITests/WideLayoutUITests.swift+++ b/Asterism/AsterismUITests/WideLayoutUITests.swift@@ -463,7 +463,7 @@ final class WideLayoutUITests: XCTestCase {             app.anyElement("works-group-allWorks").exists,             "…so the Works pane is not selected behind it")         waitFor(-            app.anyElement("today-week-range"),+            app.anyElement("today-header-date"),             "…and the list column is still the day the entry was read on")     } @@ -989,7 +989,7 @@ final class WideLayoutUITests: XCTestCase {         waitForLibrary()         // Q78: the caption that used to be this landmark is gone; the week         // widget is the day chrome now (Q79).-        waitFor(app.anyElement("today-week-range"), "…on a day rather than on every day")+        waitFor(app.anyElement("today-header-date"), "…on a day rather than on every day")     }      /// `yyyy-MM-dd`, the spelling `CivilDay.description` gives a strip cell's@@ -1014,13 +1014,13 @@ final class WideLayoutUITests: XCTestCase {     }      private var releaseRows: XCUIElementQuery {-        app.elements(withIdentifierPrefix: "today-release-")+        app.elements(withIdentifierPrefix: "today-release-shelf-item-")     }      /// The catch-up section's rows (`catch-up-mode` Q4), whose prefix is     /// deliberately not the releases one.     private var catchUpRows: XCUIElementQuery {-        app.elements(withIdentifierPrefix: "today-catch-up-")+        app.elements(withIdentifierPrefix: "today-catchup-row-")     }      private var stripCells: XCUIElementQuery {@@ -1075,7 +1075,7 @@ final class WideLayoutUITests: XCTestCase {             app.anyElement("wide-detail-placeholder").exists,             "…and the placeholder gives way to it")         waitFor(app.collectionViews["recent-list"], "The day stays beside the column")-        waitFor(app.anyElement("today-week-range"), "…with its chrome, since nothing was pushed")+        waitFor(app.anyElement("today-header-date"), "…with its chrome, since nothing was pushed")          // Req 10.1: selecting the other kind clears the first.         let noted = waitFor(recentRows.element(boundBy: 0), "The day lists a note too")
Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift Modified +11 / -0
diff --git a/Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift b/Packages/AsterismCore/Sources/AsterismCore/Snapshots.swiftindex bdeeb9b9..681be7ee 100644--- a/Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/Snapshots.swift@@ -200,6 +200,17 @@ public struct WorkSnapshot: Equatable, Sendable {     /// none.     public var primaryHostname: String { memberships.first?.hostname ?? "" } +    /// The first membership's work URL, where it parses as an `http` or `https`+    /// URL. The one spelling of "the work's page" the surfaces that open it use+    /// (the series screen's Continue, Today's shelf and catch-up card), so a+    /// stored value with another scheme is never handed to `openURL`.+    public var primaryURL: URL? {+        guard let raw = memberships.first?.workURLString, let url = URL(string: raw),+            ["https", "http"].contains(url.scheme?.lowercased() ?? "")+        else { return nil }+        return url+    }+     /// Every site this Work is on, in membership order (Req 1.2) — the list half     /// of `primaryHostname`, and the one spelling of `memberships.map(\.hostname)`     /// the surfaces that need the whole set read.
Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift Modified +108 / -16
diff --git a/Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift b/Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swiftindex f6a0a3cc..284a5e8c 100644--- a/Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift@@ -186,9 +186,12 @@ public struct TodaySchedule: Equatable, Sendable {     /// ([6.2](../../../../specs/update-schedule/requirements.md#6.2)) carrying     /// the representative row's days, inherited rather than re-derived here.     public let works: [ScheduledWork]-    /// The weekdays at least one scheduled work is due on — the strip's dots-    /// ([4.2](../../../../specs/update-schedule/requirements.md#4.2)), which mark-    /// the weekly pattern on every displayed week, past weeks included (Q15).+    /// The weekdays at least one scheduled work is due on+    /// ([4.2](../../../../specs/update-schedule/requirements.md#4.2), Q15).+    ///+    /// No longer drawn: the strip lost its dots in the Today v2 redesign+    /// (`docs/Asterism-Today-v2.md` §2), which kept this in Core because it is+    /// cheap, tested and the schedule's own summary of itself.     public let dueWeekdays: Set<ReleaseDay>     /// The works the reader is behind on, in the same collation as `works`     /// (`catch-up-mode`).@@ -283,10 +286,16 @@ public struct ScheduledWork: Equatable, Sendable, Identifiable {         /// ([5.2](../../../../specs/update-schedule/requirements.md#5.2)). Nil is         /// the case the row omits its ` · ` separator around.         public let chapterLine: String?+        /// The note's chapter number where `ChapterKeyDerivation` reads a+        /// single whole number from it, nil otherwise. A multi-part key+        /// (`5.07`, volume and chapter) is nil too: adding one to it would be a+        /// guess at what the next chapter is called.+        public let chapterNumber: Int? -        public init(day: CivilDay, chapterLine: String?) {+        public init(day: CivilDay, chapterLine: String?, chapterNumber: Int? = nil) {             self.day = day             self.chapterLine = chapterLine+            self.chapterNumber = chapterNumber         }     } @@ -299,10 +308,13 @@ public struct ScheduledWork: Equatable, Sendable, Identifiable {     /// Newest day first, one per day: the entry a release row names for a day is     /// the same entry Today's noted section shows first for it.     public let notedDays: [NotedDay]+    /// The first membership's work URL, where it has one and it parses.+    public let primaryURL: URL?      public init(         id: UUID, title: String, primaryHostname: String, typeDisplay: WorkTypeDisplay,-        thumbnail: ThumbnailIdentity?, releaseDays: [ReleaseDay], notedDays: [NotedDay]+        thumbnail: ThumbnailIdentity?, releaseDays: [ReleaseDay], notedDays: [NotedDay],+        primaryURL: URL? = nil     ) {         self.id = id         self.title = title@@ -311,6 +323,7 @@ public struct ScheduledWork: Equatable, Sendable, Identifiable {         self.thumbnail = thumbnail         self.releaseDays = releaseDays         self.notedDays = notedDays+        self.primaryURL = primaryURL     }      /// The scheduled form of a snapshot the filter has already accepted.@@ -322,7 +335,8 @@ public struct ScheduledWork: Equatable, Sendable, Identifiable {             typeDisplay: snapshot.typeDisplay,             thumbnail: snapshot.thumbnail,             releaseDays: snapshot.releaseDays,-            notedDays: Self.notedDays(of: snapshot.entries, calendar: calendar))+            notedDays: Self.notedDays(of: snapshot.entries, calendar: calendar),+            primaryURL: snapshot.primaryURL)     }      /// One `NotedDay` per civil day, newest first, each naming the day's most@@ -345,10 +359,22 @@ public struct ScheduledWork: Equatable, Sendable, Identifiable {             let day = CivilDay(entry.lastSharedAt, calendar: calendar)             guard seen.insert(day).inserted else { continue }             result.append(-                NotedDay(day: day, chapterLine: entry.chapterTitle ?? entry.chapterSequence))+                NotedDay(+                    day: day, chapterLine: entry.chapterTitle ?? entry.chapterSequence,+                    chapterNumber: chapterNumber(of: entry)))         }         return result     }++    /// A single whole chapter number, or nil (see `NotedDay.chapterNumber`).+    private static func chapterNumber(of entry: EntrySnapshot) -> Int? {+        guard+            let key = ChapterKeyDerivation.key(+                chapterSequence: entry.chapterSequence, chapterTitle: entry.chapterTitle),+            key.components.count == 1+        else { return nil }+        return key.components[0]+    } }  // MARK: - One day's plan@@ -425,7 +451,7 @@ public struct TodayDayPlan: Equatable, Sendable {         let releases = schedule.works             .filter { $0.releaseDays.contains(weekday) }             .map { work in-                row(for: work, on: day, calendar: calendar)+                row(for: work, on: day, calendar: calendar, countsReleases: false)             }         // No weekday filter: a work the reader is behind on is listed every day         // from the current one on, whatever days its author publishes on (Q5,@@ -433,7 +459,9 @@ public struct TodayDayPlan: Equatable, Sendable {         let catchingUp =             day < currentDay             ? []-            : schedule.catchingUp.map { row(for: $0, on: day, calendar: calendar) }+            : schedule.catchingUp.map {+                row(for: $0, on: day, calendar: calendar, countsReleases: true)+            }          return TodayDayPlan(             day: day,@@ -447,16 +475,56 @@ public struct TodayDayPlan: Equatable, Sendable {             catchingUp: catchingUp)     } -    /// One row, for a release and for a catch-up work alike: the two sections-    /// draw the same shape and read the same second line (Q13), and only the-    /// identifier prefix the app gives them differs.+    /// One row, for a release and for a catch-up work alike: both carry the same+    /// second line (Q13), and the app draws them as a shelf item and a card row.+    ///+    /// The chapter, day and release count come from the newest note **on or+    /// before** the day shown, so a past day's badge never names a chapter read+    /// after it. `line` keeps Q16's newest-note-overall, which is a sentence+    /// about the work rather than about that day. `countsReleases` is false for+    /// the releases section, which never shows the count.     private static func row(-        for work: ScheduledWork, on day: CivilDay, calendar: Calendar+        for work: ScheduledWork, on day: CivilDay, calendar: Calendar, countsReleases: Bool     ) -> ReleaseRow {-        ReleaseRow(+        let latest = work.notedDays.first { $0.day <= day }+        return ReleaseRow(             id: work.id, title: work.title, primaryHostname: work.primaryHostname,             typeDisplay: work.typeDisplay, thumbnail: work.thumbnail,-            line: line(for: work, on: day, calendar: calendar))+            line: line(for: work, on: day, calendar: calendar),+            lastChapter: latest?.chapterNumber,+            lastNotedDay: latest?.day,+            releasesSince: countsReleases+                ? latest.flatMap {+                    releaseCount(+                        of: work.releaseDays, after: $0.day, through: day, calendar: calendar)+                } : nil,+            primaryURL: work.primaryURL)+    }++    /// How many of `releaseDays` fall after `start` and on or before `end`, or+    /// nil where the work has no release days to count.+    ///+    /// Whole weeks are counted arithmetically and the remainder by weekday+    /// number, so the calendar is asked for one day count and one weekday+    /// whatever the span. Calendar days, not seconds, so a 23- or 25-hour day+    /// counts once.+    static func releaseCount(+        of releaseDays: [ReleaseDay], after start: CivilDay, through end: CivilDay,+        calendar: Calendar+    ) -> Int? {+        guard !releaseDays.isEmpty else { return nil }+        let span = end.days(since: start, calendar: calendar)+        guard span > 0 else { return 0 }+        // `calendarWeekday` is 1…7 from Sunday; offsets are taken mod 7 from the+        // start day's own number.+        let due = Set(releaseDays.map { $0.calendarWeekday - 1 })+        let startIndex = start.weekday(calendar: calendar).calendarWeekday - 1+        var count = (span / 7) * due.count+        for offset in stride(from: span - span % 7 + 1, through: span, by: 1)+        where due.contains((startIndex + offset) % 7) {+            count += 1+        }+        return count     }      /// [5.2](../../../../specs/update-schedule/requirements.md#5.2)'s three arms,@@ -522,10 +590,20 @@ public struct ReleaseRow: Equatable, Sendable, Identifiable {     public let typeDisplay: WorkTypeDisplay     public let thumbnail: ThumbnailIdentity?     public let line: Line+    /// The chapter number of the work's newest note, where it reads as one+    /// whole number.+    public let lastChapter: Int?+    /// The day of the work's newest note, nil where it has none.+    public let lastNotedDay: CivilDay?+    /// Release days after that note, up to and including the day being shown.+    /// Nil where the work has no release days or no note.+    public let releasesSince: Int?+    public let primaryURL: URL?      public init(         id: UUID, title: String, primaryHostname: String, typeDisplay: WorkTypeDisplay,-        thumbnail: ThumbnailIdentity?, line: Line+        thumbnail: ThumbnailIdentity?, line: Line, lastChapter: Int? = nil,+        lastNotedDay: CivilDay? = nil, releasesSince: Int? = nil, primaryURL: URL? = nil     ) {         self.id = id         self.title = title@@ -533,6 +611,20 @@ public struct ReleaseRow: Equatable, Sendable, Identifiable {         self.typeDisplay = typeDisplay         self.thumbnail = thumbnail         self.line = line+        self.lastChapter = lastChapter+        self.lastNotedDay = lastNotedDay+        self.releasesSince = releasesSince+        self.primaryURL = primaryURL+    }++    /// The chapter after the newest note's, where that note has a whole+    /// chapter number. Never guessed from anything else.+    public var nextChapter: Int? { lastChapter.map { $0 + 1 } }++    /// Whether the work carries a note on the day being shown.+    public var isNotedOnDay: Bool {+        if case .notedOnDay = line { return true }+        return false     } } 
Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift Modified +200 / -0
diff --git a/Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift b/Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swiftindex 3cc754ec..8fe61fc4 100644--- a/Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift+++ b/Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift@@ -725,4 +725,204 @@ struct TodayDayPlanTests {         #expect(ReleaseDay.ordered(for: sundayFirst).first == .sunday)         #expect(ReleaseDay.ordered(for: mondayFirst).first == .monday)     }++    // MARK: - Today v2: the shelf's and the catch-up card's inputs++    @Test("A release row carries the newest note's whole chapter number and the next one")+    func releaseRowCarriesTheLastChapter() {+        let calendar = Self.calendar()+        let work = Self.work(entries: [+            Self.entry(sharedAt: Self.instant(2026, 3, 4), chapterSequence: "30"),+            Self.entry(sharedAt: Self.instant(2026, 3, 11), chapterTitle: "Chapter 31: Home"),+        ])+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.releases.first?.lastChapter == 31)+        #expect(plan.releases.first?.nextChapter == 32)+        #expect(plan.releases.first?.lastNotedDay == Self.day(2026, 3, 11))+        #expect(plan.releases.first?.isNotedOnDay == false)+    }++    @Test("A chapter that is not one whole number has no next chapter")+    func multiPartChapterHasNoNextChapter() {+        let calendar = Self.calendar()+        let work = Self.work(entries: [+            Self.entry(sharedAt: Self.instant(2026, 3, 11), chapterSequence: "5.07"),+        ])+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.releases.first?.lastChapter == nil)+        #expect(plan.releases.first?.nextChapter == nil)+    }++    @Test("A catch-up row counts the release days since its last note")+    func catchUpRowCountsReleasesSince() {+        let calendar = Self.calendar()+        // Noted Wednesday 4 March; Thursday 12 March is shown. Mondays and+        // Thursdays in between: 5, 9 and 12 March.+        let work = Self.work(+            releaseDays: [.monday, .thursday], workStatus: .finished,+            readingStatus: .catchingUp,+            entries: [Self.entry(sharedAt: Self.instant(2026, 3, 4), chapterSequence: "9")])+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.catchingUp.first?.releasesSince == 3)+        #expect(plan.catchingUp.first?.lastChapter == 9)+    }++    @Test("No release days, or no note, leaves the release count unknown")+    func releaseCountNeedsDaysAndANote() {+        let calendar = Self.calendar()+        let noDays = Self.work(+            id: Self.id(1), title: "No days", releaseDays: [], workStatus: .finished,+            readingStatus: .catchingUp,+            entries: [Self.entry(sharedAt: Self.instant(2026, 3, 4))])+        let noNote = Self.work(+            id: Self.id(2), title: "No note", releaseDays: [.monday], workStatus: .finished,+            readingStatus: .catchingUp)+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [noDays, noNote], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.catchingUp.map(\.releasesSince) == [nil, nil])+    }++    @Test(+        "Release days are counted in calendar days, across a daylight-saving change",+        arguments: [+            // Amsterdam springs forward on Sunday 29 March 2026.+            ("Europe/Amsterdam", 2026, 3, 25, 2026, 4, 8),+            // Sydney falls back on Sunday 5 April 2026.+            ("Australia/Sydney", 2026, 4, 1, 2026, 4, 15),+        ])+    func releaseCountSurvivesDST(+        zone: String, fromYear: Int, fromMonth: Int, fromDay: Int,+        toYear: Int, toMonth: Int, toDay: Int+    ) throws {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: zone))+        func day(_ year: Int, _ month: Int, _ dayOfMonth: Int) throws -> CivilDay {+            CivilDay(+                try #require(+                    calendar.date(+                        from: DateComponents(year: year, month: month, day: dayOfMonth, hour: 12))),+                calendar: calendar)+        }+        let start = try day(fromYear, fromMonth, fromDay)+        let end = try day(toYear, toMonth, toDay)++        // Two whole weeks: each weekday exactly twice, DST or not.+        #expect(+            TodayDayPlan.releaseCount(+                of: [.monday, .friday], after: start, through: end, calendar: calendar) == 4)+        #expect(+            TodayDayPlan.releaseCount(+                of: ReleaseDay.allCases, after: start, through: end, calendar: calendar) == 14)+        #expect(+            TodayDayPlan.releaseCount(+                of: [.monday], after: end, through: end, calendar: calendar) == 0)+    }++    @Test("A scheduled work carries its first membership's work URL")+    func scheduledWorkCarriesThePrimaryURL() {+        let calendar = Self.calendar()+        let work = WorkSnapshot(+            id: Self.id(1), displayTitle: "A Serial", lastParsedTitle: nil,+            memberships: [+                WorkSiteMembershipSnapshot(+                    id: UUID(), hostname: "example.test",+                    workURLString: "https://example.test/fiction/1")+            ],+            genericNotes: "", genreTags: [], titleProvenance: .parsed,+            createdAt: .distantPast, modifiedAt: .distantPast, entries: [],+            workStatus: .ongoing, readingStatus: .reading, releaseDays: [.thursday])+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.releases.first?.primaryURL == URL(string: "https://example.test/fiction/1"))+    }++    @Test("A past day's release row takes its chapter from notes up to that day")+    func pastDayIgnoresLaterNotes() {+        let calendar = Self.calendar()+        // Noted chapter 30 on Wednesday 4 March and chapter 31 on Wednesday+        // 11 March; Thursday 5 March is shown.+        let work = Self.work(entries: [+            Self.entry(sharedAt: Self.instant(2026, 3, 4), chapterSequence: "30"),+            Self.entry(sharedAt: Self.instant(2026, 3, 11), chapterSequence: "31"),+        ])+        let plan = TodayDayPlan.build(+            day: Self.day(2026, 3, 5), currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.releases.first?.lastChapter == 30)+        #expect(plan.releases.first?.nextChapter == 31)+        #expect(plan.releases.first?.lastNotedDay == Self.day(2026, 3, 4))+    }++    @Test("A release row carries no release count; only catch-up rows do")+    func releaseRowsCountNothing() {+        let calendar = Self.calendar()+        let work = Self.work(entries: [+            Self.entry(sharedAt: Self.instant(2026, 3, 4), chapterSequence: "9")+        ])+        let plan = TodayDayPlan.build(+            day: Self.thursday, currentDay: Self.thursday,+            schedule: TodaySchedule.build(works: [work], calendar: calendar),+            presentation: Self.presentation([], calendar: calendar), calendar: calendar)++        #expect(plan.releases.first?.releasesSince == nil)+    }++    @Test("The remainder of a span is counted by weekday across a daylight-saving change")+    func releaseCountRemainderAcrossDST() throws {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: "Europe/Amsterdam"))+        func day(_ month: Int, _ dayOfMonth: Int) throws -> CivilDay {+            CivilDay(+                try #require(+                    calendar.date(+                        from: DateComponents(year: 2026, month: month, day: dayOfMonth, hour: 12))),+                calendar: calendar)+        }+        // Friday 27 March to Monday 6 April: ten days across Sunday 29 March's+        // spring-forward. After the Friday: Mon 30, Fri 3 and Mon 6.+        #expect(+            TodayDayPlan.releaseCount(+                of: [.monday, .friday], after: try day(3, 27), through: try day(4, 6),+                calendar: calendar) == 3)+    }++    @Test("A snapshot's primary URL is its first membership's web URL, and nothing else")+    func primaryURLIsAWebURL() {+        func snapshot(_ url: String?) -> WorkSnapshot {+            WorkSnapshot(+                id: Self.id(1), displayTitle: "A Serial", lastParsedTitle: nil,+                memberships: [+                    WorkSiteMembershipSnapshot(+                        id: UUID(), hostname: "example.test", workURLString: url)+                ],+                genericNotes: "", genreTags: [], titleProvenance: .parsed,+                createdAt: .distantPast, modifiedAt: .distantPast, entries: [],+                workStatus: .ongoing, readingStatus: .reading, releaseDays: [.thursday])+        }+        #expect(snapshot("https://example.test/fiction/1").primaryURL != nil)+        #expect(snapshot("HTTP://example.test/fiction/1").primaryURL != nil)+        #expect(snapshot("javascript:alert(1)").primaryURL == nil)+        #expect(snapshot("ftp://example.test/file").primaryURL == nil)+        #expect(snapshot(nil).primaryURL == nil)+    } }

Docs (12)

CHANGELOG.md Modified +7 / -0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 11144b27..cbb5d54e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).  ### Changed +- **Today redesign:** the header names the selected day as a serif title that+  returns to today, with the Settings gear beside it; the week strip loses its+  release dots and range pill; releases are a horizontal cover shelf (unread+  first, next-chapter badge); catch-up works share one card of compact rows;+  noted entries are a timeline with the full note text+  (`docs/Asterism-Today-v2.md`).+ - **Device installation tooling:** use Xcode MCP for agent-driven iPhone and   iPad installs while retaining Makefile device selection. Refresh the string   catalog with Xcode's extracted app strings.
docs/Asterism-Today-v2.md Added +202 / -0
diff --git a/docs/Asterism-Today-v2.md b/docs/Asterism-Today-v2.mdnew file mode 100644index 00000000..6071af5d--- /dev/null+++ b/docs/Asterism-Today-v2.md@@ -0,0 +1,202 @@+# Handover: Today screen — option 1b ("Release shelf")++Target mockup: `Asterism Rethink.dc.html` → sections **1b** (screen) and **4a/4b** (Catching up states + Set latest sheet). The visual language (colours, glass, type) follows `asterism-style-guide.md` / ConstellationKit; nothing here introduces new tokens.++Scope: iPhone Today tab. iPad/Mac inherit the same view in whatever layout option is chosen later (not in scope).++---++## 1. What changes, at a glance++| Area | Today (current) | 1b |+|---|---|---|+| Header | Date pill + oversized gear | Serif date title "Wed 23 Sep" (`.title` Newsreader) + standard 36 pt glass gear button |+| Week strip | Cells with violet release dot | **Cells without any dot**. Letter + day number only. Selected = fill, current = ring (unchanged) |+| Releasing | Vertical list of release rows, each ~150 pt | **Horizontal cover shelf**; unread = cyan ring + chapter badge, read = dimmed + ✓ |+| Catching up | Vertical release-shaped rows | **One grouped card, one compact row per work**, with progress bar / behind count / "Next" link button |+| Noted | Row cards repeating "Noted today" | **Timeline** (dot + time on a vertical rule), note text in full |+| De-duplication | A work can appear in Catching up *and* Noted | Unchanged data-wise (both are true) but the Noted row no longer repeats the type tag / "Noted today" noise |++Section order stays as `TodayDayPlan.placement` decides (releases first for today/future, noted first for past days). Catching up stays empty on past days (`TodayDayPlan.catchingUp` Q5) — keep that.++---++## 2. Week strip (`WeekStripView.swift`)++- Remove the dot from `WeekStripCell` entirely (the `Circle()` and its `padding(.top, 2)`).+- Remove `hasReleases` from `WeekStripCell` and `dueWeekdays` from `WeekWidget`. `TodaySchedule.dueWeekdays` can stay in Core (cheap, tested) — just stop passing it to the view.+- Accessibility: remove the `hasReleases` parameter from `WeekStripText.label(...)` and drop the "has releases" phrase. VoiceOver no longer announces releases per day. Update `TodayUITests` accordingly.+- Cell height shrinks by ~6 pt; keep `minHeight: AsterismLayout.minHitTarget`.+- Range pill: **remove it** (`rangeLine`, `today-week-range` identifier). The header date title (§3) replaces it as the route back to today (Q80).++## 3. Header++- Replace the date pill with a plain `Text` in Newsreader, `.title` (28 pt), `-0.01em` tracking: `"EEE d MMM"` for the **selected** day (locale-formatted via `Date.FormatStyle`, not hardcoded).+- **The title is the way back to today** (takes over Q80 from the removed range pill): a `.plain` `Button` wrapping the title that calls the existing `onSelectToday` path (selection returns to the current day, the week follows).+  - Always enabled, no visual change on the current day (a no-op there, same reasoning as Q80).+  - When the selected day is **not** the current day, show a small cyan `arrow.uturn.backward` glyph (or "Today" caption) trailing the title so the affordance is discoverable; hide it on the current day.+  - Accessibility: identifier `today-header-date`; label = full date; hint "Returns to today" only when not on the current day.+  - Move `WeekStripText.rangeLabel` / `rangeHint` usage here or delete them if unused.+- Settings: 36 pt circular glass button (`ConstellationButtonStyles` icon style), `gearshape` symbol, trailing.+- Header scrolls with content (not pinned). Nav bar title hidden on this tab.++## 4. Releasing shelf++Data: `TodayDayPlan.releases: [ReleaseRow]` — no model changes.++Layout:+- Section header: `ConstellationSectionHeader("Releasing")` with trailing summary "`n` of `m` read" (`n` = rows whose `line` is `.notedOnDay`).+- `ScrollView(.horizontal, showsIndicators: false)` + `LazyHStack(spacing: 14)`, content inset 20 pt leading/trailing, `.scrollTargetBehavior(.viewAligned)`.+- Item: cover 98 × 140 pt, radius 12, title below (Newsreader 13.5 pt, 2 lines max).+- Cover source: `ReleaseRow.thumbnail`; fallback = the existing initials/gradient placeholder used by `WorkThumbnailView`.+- **Sort**: unread first, then read; within each, keep `titleOrder`.++States (by `ReleaseRow.Line`):+| Line | Cover | Badge |+|---|---|---|+| `.notedOnDay` (read) | opacity 0.62 | top-trailing 24 pt dark glass circle with cyan ✓ |+| `.lastNoted` / `.notNotedYet` (unread) | full opacity + 1.5 pt cyan ring + cyan glow (`0 0 22 cyan/35%`, scaled by the 1.3× glow multiplier) | bottom-trailing dark capsule with **next chapter** label, cyan text |++Next chapter label for unread: derive from the latest noted chapter + 1 when `ChapterKeyDerivation` yields a numeric sequence ("Ep 32", "Ch 687"). If not numeric, omit the badge (never guess). Prefix ("Ep"/"Ch") from `WorkTypeDisplay` (webtoon/manga → "Ep", novel → "Ch").++Interaction:+- Tap → Work detail (same destination as the current release row).+- Context menu: "Open next chapter" (primary URL), "Go to work", "Mark read" is **not** added (reading is recorded by noting, per current model).+- Accessibility: each item one element, label "Title, Ep 32, not read yet" / "Title, read"; the shelf is a list for rotor purposes (`.accessibilityElement(children: .contain)`).+- Dynamic Type: at accessibility sizes fall back to the existing vertical release rows — a 98 pt-wide shelf can't hold AX5 titles. Branch on `dynamicTypeSize.isAccessibilitySize` (same approach as `WeekWidget`).+- Empty: no releases on the day → hide the section (current behaviour; keep).++## 5. Catching up card (multiple works)++Data today: `TodayDayPlan.catchingUp: [ReleaseRow]`. That's enough for the "unknown" state only. The progress/behind states need the model additions in §7.++Layout:+- Section header "Catching up" (no count needed; trailing "See all" → Works › Catching up when > 5 rows).+- **One** grouped glass card (`ConstellationSurfaces` card recipe, radius 20), rows separated by 1 pt `cardBorder` hairlines. Show up to 5 rows; the rest via "See all".+- Row (≈70 pt): 36 × 50 cover · title (Newsreader 15, 1 line) · progress line · status line · trailing "Next" capsule.+- Sort: exact/estimated by most behind desc, then unknown rows by last-read date asc (stalest first).++Row states (see mockup 4a):++| State | Condition | Progress line | Status line (12 pt) |+|---|---|---|---|+| Exact | `latestReleased` set and `latestConfirmedAt` ≥ last auto-increment | 4 pt cyan bar + "26/40" | "14 episodes behind" cyan semibold |+| Estimated | `latestReleased` includes auto-increments since last confirm | bar + "42/~68" | "~26 chapters behind · estimated" cyan semibold |+| Unknown | no `latestReleased`, or last chapter not numeric | *(no bar)* | "Last read Ep 9 · 5 days ago · ~2 releases since" secondary. "releases since" only if the work has release days |+| Caught up | behind == 0 | — | Row leaves the card; a banner appears above the card: "Caught up on X. Move it back to Reading?" [Move to Reading] [Not yet, more is out]. **Never auto-change status.** "Not yet" opens the Set latest sheet (§6) |++"Next" capsule: label = next chapter ("Ep 27"), opens the chapter URL if the site's URL rule can build it, else the work's primary URL. If no numeric chapter, label "Open".++Row tap → Work detail. Long-press context menu: "Set latest…", "Open next chapter", "Move to Reading".++Accessibility: row label "Title, 14 episodes behind, episode 26 of 40" / "…estimated" / "…last read episode 9, 5 days ago"; Next capsule is a separate button "Open episode 27".++## 6. Set latest sheet (mockup 4b)++- Presented as `.sheet` with `.presentationDetents([.medium, .large])`, glass background.+- Toolbar: Cancel · "Latest released" · Save.+- Work header (cover + title + "Royal Road · releases Mon, Fri").+- Big stepper: − / number (56 pt, cyan, glow) / +, prefilled with current (estimated) value. Also directly editable via tap → numeric keyboard.+- Live caption: "Estimated 68 · you're **29 behind**".+- Grouped rows:+  - Toggle "Count up on release days" (`autoIncrementOnReleaseDays`, default on when the work has release days; hidden when it has none).+  - "Your last chapter · 42 · Edit" → inline number field; stores `lastChapterOverride`. Footnote shows the note title it was parsed from.+- Button "Check on {site}" → opens primary URL in Safari (`openURL`).+- Save: sets `latestReleased`, `latestConfirmedAt = now`, clears the "estimated" state.++## 7. Model additions (AsterismCore)++Add to the Work record (SwiftData/CloudKit — all optional, so migration is lightweight and old clients ignore them):++```swift+var latestReleasedChapter: Int?        // reader-set or auto-incremented+var latestConfirmedAt: Date?           // last time the reader set it+var latestAutoIncrementedAt: Date?     // last auto-increment applied+var autoIncrementOnReleaseDays: Bool   // default true+var lastChapterOverride: Int?          // cleared when a newer note parses numerically+```++Derived (pure, in a new `CatchUpProgress.swift`, unit-tested like `TodayDayPlan`):++```swift+public struct CatchUpProgress: Equatable, Sendable {+  public enum State: Equatable, Sendable {+    case exact(read: Int, latest: Int)+    case estimated(read: Int, latest: Int, addedSince: Int, since: CivilDay)+    case unknown(lastChapterLine: String?, lastRead: RelativeDay?, releasesSince: Int?)+    case caughtUp(latest: Int)+  }+  public let state: State+  public var behind: Int? { … }+  public static func build(work: WorkSnapshot, currentDay: CivilDay, calendar: Calendar) -> CatchUpProgress+}+```++Rules:+- **Last chapter read** = `lastChapterOverride` if set, else the numeric value of the newest entry's `chapterSequence` via `ChapterKeyDerivation`. Non-numeric (interludes, "S2 E85" if the season can't be stripped, ".5" chapters → floor) → `unknown`.+- **Auto-increment** is *derived, not written on a timer*: `effectiveLatest = latestReleasedChapter + count(release weekdays in (latestConfirmedAt, currentDay])` when `autoIncrementOnReleaseDays`. This avoids a background task and stays correct across devices. `estimated` iff that count > 0.+- `releasesSince` for unknown = count of release weekdays since the last note's day.+- Clear `lastChapterOverride` when a newer entry parses numerically.+- Build `CatchUpProgress` inside the same locked read that builds `TodaySchedule` (Decision 2 of `launch-to-today`) so Today stays one observation; carry it on `ScheduledWork` (`catchUp: CatchUpProgress?`) → `ReleaseRow`.++## 8. Noted timeline++Data: `TodayDayPlan.noted` (unchanged).++- Section header "Noted".+- Each row: leading 44 pt column with a 9 pt cyan dot on a 1 pt vertical rule (`cardBorder`), time (`HH:mm`, monospaced 10.5 pt, secondary) under the dot. Content: work title (Newsreader 14, 1 line), chapter line (cyan 12 pt), note text (15 pt body, secondary-primary, **not truncated**).+- Remove "Noted today" / type tag from these rows.+- Keep all existing row affordances: teach / re-teach / resolve duplicate pills (`RecentRowActionType`) appear under the note text; attention states (`RecentRowAttention`) replace the chapter line with the existing warning line. Amber stays reserved for teaching UI.+- Empty day: keep the existing single dim line (Req 5.6).++## 9. Out of scope / follow-ups++- RSS/auto-fetch of latest chapters (future; the sheet's "Check on {site}" is the manual stand-in).+- 1a/1c ideas, Works redesign (2x), iPad/Mac layouts (3x).+- Light mode: apply the same structure with the existing light tokens; no bespoke light treatment.++## 10. Acceptance checklist++- [ ] Week strip has no dots and no range pill; selection/current marks unchanged; VoiceOver labels no longer mention releases.+- [ ] Header shows selected day as serif title; tapping it returns to today (with a return glyph when off today); gear is a 36 pt glass button.+- [ ] Releasing shows a horizontal shelf; unread first with ring + next-chapter badge; read dimmed with ✓; AX sizes fall back to vertical rows.+- [ ] Catching up shows **all** catching-up works in one card (≤5, then "See all"), each in exact / estimated / unknown state; caught-up banner never changes status on its own.+- [ ] Set latest sheet saves, confirms, and clears "estimated"; auto-increment is derived, not scheduled.+- [ ] Noted is a timeline with full note text; teach/duplicate pills and attention states still work.+- [ ] `CatchUpProgress` unit tests: exact, estimated (with DST week), unknown (non-numeric, no latest), caught-up, override cleared by newer numeric note.+- [ ] `TodayUITests` updated for new identifiers: `today-header-date` (replaces `today-week-range`), `today-release-shelf-item-<id>`, `today-catchup-row-<id>`, `today-catchup-next-<id>`, `today-set-latest-sheet`.++---++## Implementation status (2026-09-24)++Built on branch `worktree-today-release-shelf`: every part that needs no+schema change. §6 and §7 are **not** built: they add five columns to `Work`,+which is a V16 → V17 schema bump, and CLAUDE.md requires a full spec for that+(schema, frozen snapshot, readiness marker and archive generation move+together).++| § | State | Notes |+|---|---|---|+| 2 Week strip | Done | No dot, no `hasReleases`/`dueWeekdays` on the view, no range pill. `TodaySchedule.dueWeekdays` stays in Core. |+| 3 Header | Done | `TodayHeader` in `Views/TodaySections.swift`. System serif (New York) at `.title`, since the app has no Newsreader. The gear moved from the phone's toolbar into the header and the nav bar is hidden on Today's root; the wide tree passes no gear (its sidebar has Settings). The header and strip now scroll with the list at every size (Q69's accessibility-size path, taken always). |+| 4 Shelf | Done, with changes | "Open next chapter" is **"Open Work Page"**: it opens the first membership's work URL, and nothing in the library can build a chapter URL, so the old label would have been wrong. Empty day keeps the dim `Nothing releasing` line (Req 5.6): that, not a hidden section, is the current behaviour the handover asks to keep. No `WorkThumbnailView` exists; `TodayCover` draws the site glyph on a card when there is no cover. |+| 5 Catching up | Partly | One card, compact rows, `unknown` state only ("Last read Ep 9 · 5 days ago · ~2 releases since"). "See all" expands the card in place (`Show all n`): the Works filter is per-visit state with no route into it. No context menu: "Set latest…" and "Move to Reading" belong with §6/§7, and "Open next chapter" duplicates the Next capsule. The caught-up banner needs §7. |+| 6 Set latest sheet | Not started | Needs §7. |+| 7 Model additions | Not started | Needs a full spec (schema bump). |+| 8 Noted timeline | Done | `NotedTimelineRow`. The rating glyph is kept beside the chapter line; the cover and site glyph are dropped. The spanning list (banner filters) keeps the card rows. A row needing attention turns its dot amber (the card row's amber edge, Q38). The time is `Text(_, style: .time)` in the locale's own format rather than a fixed `HH:mm`, and the rail widens with the text size. |++Further deviations found in review:++- **Next capsule (§5)**: its label reads the next chapter (`Ep 27`), but the tap opens the work's page, so VoiceOver hears `Open work page, next is episode 27`; with no page it opens the work in the app.+- **Shelf (§4)**: a shelf item says read or not read and the next chapter; it no longer spells update-schedule Req 5.2's noted-chapter line, which the accessibility-size rows still do.+- **Past days (§4)**: a past day's badge comes from notes up to that day, never one taken later.+- **Catching up order (§5)**: a work never read sorts first, as the stalest.+- **Wide layout (§3)**: the list column keeps its `Today` column title above the header's date.++Superseded earlier decisions: `specs/update-schedule/` Q80, Q81, Q69 (chrome now scrolls at every size), Q15 and Req 4.2 (dots), Req 4.3's range, Req 10.3's dot, Q34 and Req 5.2 at non-accessibility sizes; `specs/catch-up-mode/` Q4's shared row shape and `today-catch-up-` prefix. Each is marked in its own decision log.++Next chapter numbers come from `ChapterKeyDerivation.key` on the newest note,+and only when it is one whole number (`5.07` gets no badge). "Ep" versus "Ch"+follows the work type's name: a whole word `webtoon`, `toon`, `manga`, `manhwa`,+`manhua`, `comic` or `comics` in it counts episodes.
docs/asterism-style-guide.md Modified +7 / -2
diff --git a/docs/asterism-style-guide.md b/docs/asterism-style-guide.mdindex 921b2046..ae7cc940 100644--- a/docs/asterism-style-guide.md+++ b/docs/asterism-style-guide.md@@ -71,6 +71,7 @@ Glow marks *identity and primary action*, nothing else: - Site glyphs (colored ones): `0 0 21px` at ~.45 alpha of the glyph's own color (dark); soft drop shadow in the glyph color (light). - Primary buttons: `0 2px 26px oklch(0.7 0.13 262 / .5)` dark / `0 4px 21px … / .4` light. - Active tab icon: `drop-shadow(0 0 8px cyan @ .7)` (dark only).+- Unread cover on Today's releasing shelf: cyan at .35, radius 14 (Today v2 §4) — the one release the reader has yet to read is what that screen asks them to act on. - Selected teach chip: `0 0 18px` at .2 in the chip color.  No glow on: text, cards, dim glyphs (`?`, ✎), rating triangles, the spine's rating dots and the selected cast pill on work detail (`specs/work-detail-reading-redesign/`, Q11 — a selected state is neither identity nor a primary action), banners (banner gets at most a whisper, ≤.08).@@ -128,9 +129,13 @@ Concentric radius system, outside-in: sheet 44 → banner/card 20–22 → field - **Selected pill**: a pill that has been opened — work detail's cast pill, with its chevron pointing up — takes the type-tag recipe lifted: violet .26 fill, violet .6 border, no glow (`ConstellationPillKind.selectedTypeTag`, Q11/Q14). The neutral family has the same distinction: a genre-tag pill that is currently in force takes `selectedCardFill` inside `selectedCardBorder` with its label in primary text (`ConstellationPillKind.selectedGenreTag`), which is the selected-row recipe of §12 at pill size — selection keeps one spelling, and violet is not borrowed for it, because violet means work *type*. Neither variant glows (§5). Selection changes no other pill. - **Spine row** (work detail's chapter notes): no card. A gutter (≥ 44 pt, growing with its label) holds a 10 pt rating dot — cyan filled for ▲, violet for ▼, a 1.5 pt dim ring when unrated — over the chapter number in SF Mono dim (nothing beneath the dot where the note has no number — an interlude, or a site whose URL carries only an id, Q25), and a 1 pt `cardBorder` rail runs through the dots from the first row's to the last row's. Beside it: the row title (13 pt semibold, one line, truncating) with the date trailing in `.caption2` dim, then the whole note at 15 pt with no line limit. The rail is drawn in the row container's background, outside the row's button, so pressing a row does not dim it. - **Segmented capsule (two or three short labels), or a menu**: use a **capsule** when a choice has two or three short labels and all of them must stay visible, so the reader sees the state instead of opening something to read it — work detail's `Newest | Chapter` sort (`specs/work-detail-reading-redesign/`, Decision 1) and Stats' `Week | Month | All time` unit (`specs/stats-period-navigation/`, Q11). Recipe: `cardFill` fill with a 1 pt `cardBorder`; selected segment cyan .14 fill, cyan .4 border, cyan text; unselected dim; `.caption` semibold; a 32 pt visual (scaled with Dynamic Type via `@ScaledMetric`, so the segment grows with its label) inside a 44 pt target. Placement follows what the control governs: **beside its section header** where it has one, dropping to its own line beneath that header where the two do not fit — work detail's sort (Q21) — and **centred above what it governs** where it stands alone, with no header to sit beside, which is Stats' unit toggle and its chevron row (`specs/stats-period-navigation/`, Q33). Either way, at the largest accessibility sizes it stacks its segments full width in a card-radius rectangle rather than hyphenate a label (Q21). **One implementation, not a copy per screen**: `ConstellationSegmentedControl` in `ConstellationKit` — values, a selection binding, a title and an accessibility identifier per value, and a required container label naming what the segments choose (`stats-period-navigation`, Q28). The review sheet's per-row Character/Place control is another user of it (`place-extraction` Q79), and the rule that made it one is exactly this bullet: a `.segmented` `Picker` there would have been a second spelling of the same shape, and one that hyphenates instead of stacking. Use a **`Menu`** instead when the choice has more than three options or long ones, where no segmented shape fits at the accessibility sizes — Stats' five periods before this control replaced them (`specs/stats-page/`, Q31). **Give the capsule a visible caption where the segment names alone are ambiguous**: work detail's edit mode stacks two of these controls in one `constellationCaptionedCard("Status")`, and both contain a segment called "Finished", so each sits under a `.caption` semibold `secondaryText` caption — "Work status", "Reading status" — inside that card, with the same text as the control's `containerLabel` (`specs/work-and-reading-status/`, Q26; `specs/work-creators/`, Decision 7). The verdict field below them takes the same caption recipe for its prompt ("How was it?" / "Why did you stop?") rather than as the placeholder, because a placeholder vanishes the moment the reader types and the prompt is the only thing that tells the two verdicts apart (Q16).-- **Week widget** (Today): **one block**, not a row of controls over a strip (`specs/update-schedule/`, Q79, superseding Q25). A chevron at each end spanning the widget's **full height** — the range line and the cells both — as a single tappable column with its glyph vertically centred and labelled with the week it moves *to*; between them the displayed week's date range as a **neutral pill** — the genre-tag recipe of §7, `cardFill` inside a 1 pt `cardBorder` at the tag radius, its label `.subheadline` `secondaryText`, 12 pt of horizontal and 5 pt of vertical padding, centred and hugging its text, wrapping rather than truncating — which is a `.plain` button that returns the selection to the current day and the widget with it to the current week, labelled `{range}, back to today` and a no-op where it already is, never dimmed there (Q80, Q81). Neutral rather than the cells' cyan, which on this widget means *selected*, and never the amber attention treatment, which means something needs clearing; the recipe is borrowed the way the cells borrow the segmented capsule's colours, not taken through `constellationPill`, whose own `.caption` type and 44 pt frame would spend the height Q79 bought. Over the week's seven day cells. The cells **fill the width the chevrons leave**, equal shares of it, so the weekday's one-letter abbreviation sits at `.subheadline` over the day of the month at `.title3` over a 4 pt violet dot where at least one scheduled work is due that weekday — bigger type in a **shorter** widget, because the two stacked rows it replaces spent a whole line on two chevrons. **36 pt is now a floor, not the width** (Q26 as Q79 amends it): a cell is `minWidth: 36, maxWidth: .infinity` and measures ~42 pt on a 402 pt phone. Where seven of those and two 44 pt chevrons do not fit, the widget trades the chevron column and the gap away in that order — 44/2 pt with 4 pt of outer padding, then 36/2 pt, then 28/1 pt with none — through a `ViewThatFits`, and the narrowest arm is what the Mac's and the iPad's 320 pt list column gets: ~37 pt cells inside 28 pt chevrons. The height stays at least 44 pt everywhere, and every accessibility size gets the full 44 in both dimensions, in two rows of four cells over three — the second row carrying one empty column so its cells are as wide as the first's — read left to right then down, with the chevrons spanning both rows. **It borrows the segmented capsule's selected colours and is not a use of `ConstellationSegmentedControl`** (Q18): the shared control stacks its segments full width at the accessibility sizes, and the widget has to wrap 4 + 3 instead, which the control cannot do. The two marks it carries are different shapes so they compose — the **selected** day is a filled cell (cyan .14 in an 8 pt rounded rectangle, its number cyan and semibold), the **current** day is a **ring** (cyan .4, 1 pt, no fill), and the day that is both wears the fill *and* the ring, which neither alone does. Cells are `.plain` buttons. **The wrap branch is on the content size, not on fit** (Q35): a layout that depends on measurement differs between two devices at the same setting. The width arm above is a different question and is measured, because a 320 pt column and a 402 pt phone are not the same width. The dot is drawn inside the cell and described by the cell's own label rather than exposed as an element (Req 10.3).+- **Week widget** (Today): **one block** (`specs/update-schedule/`, Q79): a chevron at each end spanning the widget's **full height** as a single tappable column, labelled with the week it moves *to*, and the week's seven day cells between them. **No range pill and no release dot** since the Today v2 redesign (`docs/Asterism-Today-v2.md` §2, superseding Q80, Q81 and Req 4.2's dot): the header's date title is the way back to today, and the releasing shelf says what is due on the selected day. The cells **fill the width the chevrons leave**: the weekday's one-letter abbreviation at `.subheadline` over the day of the month at `.title3`. **36 pt is a floor, not the width** (Q26 as Q79 amends it): where seven cells and two 44 pt chevrons do not fit, the widget trades the chevron column and the gap away in that order — 44/2 pt with 4 pt of outer padding, then 36/2 pt, then 28/1 pt with none — through a `ViewThatFits`. The height stays at least 44 pt everywhere, and every accessibility size gets two rows of four cells over three, the second row carrying one empty column, with the chevrons spanning both. **It borrows the segmented capsule's selected colours and is not a use of `ConstellationSegmentedControl`** (Q18). The **selected** day is a filled cell (cyan .14 in an 8 pt rounded rectangle, its number cyan and semibold), the **current** day is a **ring** (cyan .4, 1 pt, no fill), and a day that is both wears both. Cells are `.plain` buttons. **The wrap branch is on the content size, not on fit** (Q35).+- **Today header** (Today v2 §3): the selected day as a serif `.title` (`AsterismTypography.serif(.title)`, -0.28 tracking), `Wed 23 Sep` in the locale's field order, as a `.plain` button returning to the current day, with a cyan `arrow.uturn.backward` after it on any other day; the Settings gear trails it as a 36 pt `glassEffect` circle inside a 44 pt target (phone only — the wide tree's sidebar carries Settings). It scrolls with the list; Today's navigation bar is hidden on the phone.+- **Releasing shelf** (Today v2 §4): a horizontal row of 98 × 140 pt covers (radius 12, scaling with Dynamic Type as the cover slot does), title under each in serif `.footnote`, two lines. **Unread** covers carry a 1.5 pt cyan ring, a cyan glow (§5) and a bottom-trailing dark capsule with the next chapter in cyan; **read** ones sit at .62 opacity under a top-trailing 24 pt dark circle with a cyan check. Unread first. A cover with no picture shows the site glyph on a card. At the accessibility sizes the shelf gives way to the release rows below.+- **Catching up card** (Today v2 §5): one `constellationCard`, one compact row per work (36 × 50 cover, serif title on one line, status caption, a `constellationPill(.count)` Next capsule), rows split by 1 pt `cardBorder` hairlines, five rows before `Show all`.+- **Noted timeline** (Today v2 §8): each note hangs on a 1 pt `cardBorder` rule with a 9 pt dot — cyan, or amber where the row needs attention — and its time under the dot in monospaced `.caption2`, in a rail that widens with the text; then the work in serif, the chapter in cyan and the note text in full. Pills and warning lines are the card row's. A selected row takes the selected-card fill and border. - **Release-day toggles** (work editor's Status card, last field): seven round buttons in the region's weekday order, one per day, each the weekday's one-letter abbreviation in a **40 pt circle inside a 44 pt target** (§10's own recipe) — on: cyan .15 fill, cyan .55 1.5 pt border, cyan text; off: field fill, `secondaryText`; no glow. A row of circles rather than seven `Toggle`s, because a week is seven things seen at once and seven switches stacked down a card is a form; the on/off recipe is the segmented capsule's selected colours, which is what the reader already reads as "this one is chosen" on the two status capsules directly above it. An `HStack` at every non-accessibility size and the meta line's own `FlowLayout` at the accessibility sizes, where wrapping is what keeps every target at 44 pt (Req 10.4). The visible letter is neither a word nor a state, so each toggle speaks its full weekday name and "on"/"off". Nothing here writes: the binding is the editor's draft and the reader's confirmation commits it with the rest of the work's metadata.-- **Release row** (Today's releases section) is a **sibling of the works-list row, not a mode of it** (`specs/update-schedule/`, Q34): both draw `WorkRowHeader` — cover slot, serif title, site glyph, type pill — and differ only in the line under it. The works row says series and status; the release row says the schedule: `Noted today · {chapter}` — or `Noted {weekday} · {chapter}` on another day, the one place on the screen that still names the day in a sentence (Q76) — in the **cyan** accent where the work has a note on the day being shown, `Last noted {chapter} · {when}` or `Not noted yet` in `secondaryText` otherwise. A flag on the works row would have put two unrelated second lines behind one boolean. The row draws the same cover the works list does (Q37) — a release row and a works row are the same work, and a cover on one and not the other reads as two.+- **Release row** (Today's releases section, **at the accessibility sizes only** since the shelf took the other sizes, Today v2 §4) is a **sibling of the works-list row, not a mode of it** (`specs/update-schedule/`, Q34): both draw `WorkRowHeader` — cover slot, serif title, site glyph, type pill — and differ only in the line under it. The works row says series and status; the release row says the schedule: `Noted today · {chapter}` — or `Noted {weekday} · {chapter}` on another day, the one place on the screen that still names the day in a sentence (Q76) — in the **cyan** accent where the work has a note on the day being shown, `Last noted {chapter} · {when}` or `Not noted yet` in `secondaryText` otherwise. A flag on the works row would have put two unrelated second lines behind one boolean. The row draws the same cover the works list does (Q37) — a release row and a works row are the same work, and a cover on one and not the other reads as two. - **Provenance disclosure**: quieter-than-card fill (.035), SF Mono 11 pt, dim, labels slightly brighter. Collapsed by default. *(No longer used on entry detail — the block was removed from that screen entirely, `specs/polish-and-export/` Q52. The recipe stands for any diagnostics surface that needs it.)*  ## 8. Iconography
specs/OVERVIEW.md Modified +16 / -2
diff --git a/specs/OVERVIEW.md b/specs/OVERVIEW.mdindex 442a15a9..3cd13aa9 100644--- a/specs/OVERVIEW.md+++ b/specs/OVERVIEW.md@@ -44,8 +44,8 @@ | [Place Extraction](#place-extraction) | 2026-09-09 | Done | Full spec (T-2276). Places as a second record kind beside characters: the same model request returns both, one review list decides both with a per-row kind switch, a kept record converts between kinds in the editor, and places rank, cite entries and sync as characters do. `Place` and `PlaceSuppression` under schema V13 with markers `"12"` → `"13"` and the archive at 12/13; the character store code becomes generic over a record row. | | [Work Thumbnails](#work-thumbnails) | 2026-09-11 | Done — all 40 tasks implemented; `make test-core`, `make test-quick`, `make build-mac` and `make build-ios` green with no new warnings, `WorkCoverUITests` green and the `WorkDetailCreditsUITests` case re-run green (`verification-run.md` §2, §3 and §4). The store-shape probe passed on the phone on 2026-09-12 (§1). Open: `make test-performance-m4` has no quiet-host band — the runs on this branch were made on a machine at load 3–412 and disagree with each other by 1.7× — the owner's device steps in `prerequisites.md` (the two-install sync check, the Mac checklist, the `PasteButton` check), and Q80's decision on the export's peak, which the review's archive work cut from ~464 MB to ~418 MB but did not bring under 400 MB | Full spec (T-2330). A reader-chosen cover image per work: bytes in an external-storage column beside a shape and a digest under schema V14 with markers `"13"` → `"14"` and the archive at 13/14; set from the work editor by Find cover — head sources, a page-body `<img>` arm with a Scan page action, and a query-less sibling for every candidate URL — or Photos, file or paste, cropped to portrait or square with the zoom floor at the fit scale and the gap stored out, saved with the work, shown in 56×84 row slots and a 160×240 header with a long-press viewer, carried by the archive. No on-device model ranks candidates. | | [Entry to Work Link](#entry-to-work-link) | 2026-09-14 | Done — all 5 tasks implemented 2026-09-14 to 2026-09-16; `make test-quick` green with no new warnings; every phone UI suite green on the branch across three partial `make test-ui` runs plus per-suite runs (the M4Scale trio excepted); `make test-ui-ipad` ran all 25 cases twice with the new case green both times and one different runner-crash failure each time, no single exit 0 (`verification-run.md`) | Smolspec. The work name on the entry detail screen becomes a control that opens the work's detail screen. One navigation-owned route: from a chapter on top of the Works path it drops the chapter and keeps what is beneath the work; from any other tab it shows that one work with nothing beneath it. Plain text stays for an unresolved or blank name and inside the Merge sheet. App-layer only; no Core, schema or repository change. |-| [Update Schedule](#update-schedule) | 2026-09-15 | Done — all 30 tasks implemented 2026-09-16; `make test-core` (3,013 tests, zero known issues), `make test-quick`, `make test-ui-ipad` (27/27) green, `make test-performance-m4 RUNS=3` with the ten documented known issues and `todayPublication` at 0.80–0.88 s under a 2 s budget; the owner's device steps in `prerequisites.md` remain | Full spec. A reader-set list of release weekdays on every work under schema V15 with markers `"14"` → `"15"` and the archive at 14/15, set by seven toggles in the editor's Status card and shown on the meta line; the Recent tab becomes **Today**, a week strip over the day's releases and notes with its own typed route stack, inheriting Recent's banners, duplicate sections and search and superseding the 100-row cap; a Works filter finds works with no days. Manual only, no model. |-| [Catch-Up Mode](#catch-up-mode) | 2026-09-16 | Done — both phases landed 2026-09-17; four pre-existing UI-test failures recorded in its verification run. Open: the full `make test-performance-m4` has not been run against the fixture with its 66 catch-up works | Smolspec. A fourth reading status, `catchingUp`, for a work the reader is behind on: it shows in a `Catching up` section on Today on the current day and future days whatever its work status or release days, while its release days are parked; no schema bump and no archive generation bump. |+| [Update Schedule](#update-schedule) | 2026-09-15 | Done — all 30 tasks implemented 2026-09-16; `make test-core` (3,013 tests, zero known issues), `make test-quick`, `make test-ui-ipad` (27/27) green, `make test-performance-m4 RUNS=3` with the ten documented known issues and `todayPublication` at 0.80–0.88 s under a 2 s budget; the owner's device steps in `prerequisites.md` remain — **partly superseded** by the Today v2 redesign (`docs/Asterism-Today-v2.md`) | Full spec. A reader-set list of release weekdays on every work under schema V15 with markers `"14"` → `"15"` and the archive at 14/15, set by seven toggles in the editor's Status card and shown on the meta line; the Recent tab becomes **Today**, a week strip over the day's releases and notes with its own typed route stack, inheriting Recent's banners, duplicate sections and search and superseding the 100-row cap; a Works filter finds works with no days. Manual only, no model. |+| [Catch-Up Mode](#catch-up-mode) | 2026-09-16 | Done, **partly superseded** by the Today v2 redesign (`docs/Asterism-Today-v2.md`) — both phases landed 2026-09-17; four pre-existing UI-test failures recorded in its verification run. Open: the full `make test-performance-m4` has not been run against the fixture with its 66 catch-up works | Smolspec. A fourth reading status, `catchingUp`, for a work the reader is behind on: it shows in a `Catching up` section on Today on the current day and future days whatever its work status or release days, while its release days are parked; no schema bump and no archive generation bump. | | [Empty Library](#empty-library) | 2026-09-17 | Done | Full spec (T-2118). A `Development`-only Settings row that exports a backup, waits for the share to complete, then deletes every row, Site rows included, through the mirrored per-row path so every device on the account ends up empty and the archive is the way back. Compiled out of `Personal`, the pass included. | | [Share Sheet Character Chips](#share-sheet-character-chips) | 2026-09-18 | In Progress | Smolspec (T-2317). The share sheets' cast text row becomes name-only chips; tapping one opens an inline card with that character's aliases and note, never facts. A cast past two chip rows collapses behind a `+N more` chip (Decision 1). Read-only, no schema change; `FlowLayout` moves into ConstellationKit. Supersedes `share-sheet-characters` Q2 (notes) and Q6 (no pills). | | [Launch to Today](#launch-to-today) | 2026-09-19 | Done | Full spec. Today appears without waiting for the works snapshot: its schedule is built inside the Today read (superseding `update-schedule` Q28), the works snapshot loads in the background behind a gate on Works and Stats, and the launch reconcile follows that load. Adds a launch-to-Today measurement with no budget yet, and removes the search field from Today while keeping the filter for T-2347. No schema change. |@@ -55,6 +55,7 @@ | [New Work URL Field](#new-work-url-field) | 2026-09-22 | Done | Smolspec (T-2365). The New Work form's site field accepts a bare hostname or an HTTP(S) URL with the scheme optional; a URL reduces to the host capture derives and is stored as that site's Work URL after the validator's on-host check. The field is relabelled with the URL keyboard, and `LibraryRepositoryError` becomes `LocalizedError` so every form shows a readable message. No schema change. The confirm-same-story dedup prompt is T-2366. | | [To-Read Capture Match](#to-read-capture-match) | 2026-09-23 | Done | Full spec (T-2366). Pairs a to-read work with another work on a shared site whose Work URL or normalised title matches, derived in Today's publication, and asks the reader on a card sheet from the duplicate review surfaces. Confirming opens the merge preview with a `.toReadMatch` request that keeps the to-read UUID and takes the captured work's titles and statuses; declining records every listed pair as a synced `WorkDistinctPair`. No schema change. | | [App Intents](#app-intents) | 2026-09-23 | Done | Full spec (T-2367). Siri and Shortcuts answer which chapters release today and which notes were made today, add a web page as a to-read work, and open Today or a work. Intents run in the app process; a cold step opens the library as the share extension does and leaves an `ExportOwed` marker after a write. `Development` is renamed Devsterism so the two apps' phrases differ. No schema change. |+| [Catch-up Progress](#catch-up-progress) | 2026-09-25 | Planned | Reader-set latest released chapter with a derived estimate, exact/estimated/unknown/caught-up states on Today's Catching up card, a Set latest sheet and a caught-up banner. Schema V16 → V17 (two blob columns on `Work`), archive 16/17, V15 retired. |  --- @@ -906,3 +907,16 @@ Full spec (T-2367). Five App Intents, a `WorkEntity` with a Find Works action, a - [prerequisites.md](app-intents/prerequisites.md) - [runbook.md](app-intents/runbook.md) - [implementation.md](app-intents/implementation.md)++## Catch-up Progress++**Created:** 2026-09-25 · **Status:** Planned — 25 tasks in eight phases and three streams. Decisions 1–5 and Q1–Q33 in the log; one owner step, the two-device check in `runbook.md`.++Full spec for §6 and §7 of `docs/Asterism-Today-v2.md`. The reader sets a work's latest released chapter in a Set latest sheet (from Today's catch-up rows, the caught-up banner and the work page); Today derives exact, estimated, unknown and caught-up states from it, the work's release days and its notes, with nothing written on read, capture or reconcile. The confirmed set and the last-chapter override are two Codable blob columns so a concurrent edit keeps each tuple whole (Decision 5); copies converge on the newest confirmation through one fold on every multi-copy path (Decisions 2, 4). The work editor rebases the estimate when a work's status crosses ongoing or its release days change. Schema V16 → V17, marker "17", archive 16/17, V15 retired.++- [requirements.md](catch-up-progress/requirements.md)+- [design.md](catch-up-progress/design.md)+- [tasks.md](catch-up-progress/tasks.md)+- [decision_log.md](catch-up-progress/decision_log.md)+- [prerequisites.md](catch-up-progress/prerequisites.md)+- [runbook.md](catch-up-progress/runbook.md)
specs/catch-up-mode/decision_log.md Modified +1 / -1
diff --git a/specs/catch-up-mode/decision_log.md b/specs/catch-up-mode/decision_log.mdindex 05c56697..7fc3cf54 100644--- a/specs/catch-up-mode/decision_log.md+++ b/specs/catch-up-mode/decision_log.md@@ -7,7 +7,7 @@ | Q1 | 2026-09-16 | Smolspec, with the decisions settled before the spec was written | Owner's call at the scope assessment; the assessment had recommended a full spec because the shape, the work-status gate and the presentation were open, and the owner answered all three up front instead | | Q2 | 2026-09-16 | Catch-up is a fourth reading status, `catchingUp`, not a boolean column on `Work` | Owner's pick. Catching up is mutually exclusive with being done, which a status expresses and a flag cannot; the raw-string column with its tolerant read means no schema bump, and the picker and filter menu iterate the enum's cases already. A column would move V16, the frozen snapshot, the readiness marker and the archive generation together | | Q3 | 2026-09-16 | No work-status gate: a catch-up work is listed whatever its work status | Owner's pick; a finished or hiatus story the reader is behind on is exactly the catch-up case |-| Q4 | 2026-09-16 | An own `Catching up` section directly after the releases section, same row shape and second-line rule as a release row, with its own row identifier prefix | Owner's pick of the section; the `Releasing` header stays true, and the plan-then-record ordering of `update-schedule` Req 5.5 is kept. The prefix is what lets a UI journey tell the two sections' rows apart; an identifier is never spoken, so VoiceOver tells them apart by the section header it reads on the way in (corrected at the phase 2 review) |+| Q4 | 2026-09-16 | An own `Catching up` section directly after the releases section, same row shape and second-line rule as a release row, with its own row identifier prefix | Owner's pick of the section; the `Releasing` header stays true, and the plan-then-record ordering of `update-schedule` Req 5.5 is kept. The prefix is what lets a UI journey tell the two sections' rows apart; an identifier is never spoken, so VoiceOver tells them apart by the section header it reads on the way in (corrected at the phase 2 review) **Row shape superseded 2026-09-27** by Today v2 §5: the section is one card of compact rows (`today-catchup-row-` identifiers); its place after the releases section stands. | | Q5 | 2026-09-16 | The section appears on the current day and future days only, never on a past day; and it is hidden entirely, header included, when no work is catching up | Owner's pick on both. Catch-up is a standing reminder, not a weekly pattern, so a past day has nothing to record; a future day is a plan (`update-schedule` Req 5.5's releases-first placement) and a work being caught up on is part of every plan ahead. Most days hold no catch-up work, so an always-present empty block would be noise. The second is a deliberate deviation from `update-schedule` Q9, for this section only | | Q6 | 2026-09-16 | The archive writes `catchingUp` under the current 14/15 pair with no generation bump | The wire field is already the typed enum, so a pre-feature build refuses the archive as malformed, which is the standing rule for any unknown value; the generation moves for structural changes, not vocabulary. The same rule means a pre-feature build refuses to *export* a library holding the value, background export included, until it is updated | | Q7 | 2026-09-16 | A pre-feature build sharing the iCloud account reads the value as `reading`, lists a catch-up work with days in its own releases section, and may write `reading` back on its next Save of the work; accepted | Last-writer-wins for a single-reader library, the stance `work-and-reading-status` and `update-schedule` take for their fields; the owner updates every device, and both configurations mirror |
specs/catch-up-progress/decision_log.md Added +215 / -0
diff --git a/specs/catch-up-progress/decision_log.md b/specs/catch-up-progress/decision_log.mdnew file mode 100644index 00000000..de2d0c52--- /dev/null+++ b/specs/catch-up-progress/decision_log.md@@ -0,0 +1,215 @@+# Decision Log: Catch-up Progress++## Quick Decisions++| ID | Date | Decision | Rationale |+|----|------|----------|-----------|+| Q1 | 2026-09-25 | Full spec, in `specs/catch-up-progress/` on branch `worktree-today-release-shelf` | Schema bump (CLAUDE.md: never a smolspec), owner-owned behaviour questions, and a contested override design; builds on `19d879b5` |+| Q2 | 2026-09-25 | No `latestAutoIncrementedAt` column | The count-up is derived at read time, so nothing would write it; a column exists only if the current build uses it |+| Q3 | 2026-09-25 | Effective latest rises to meet what the reader has read, with no write | promoted to Decision 3 |+| Q4 | 2026-09-25 | The Set latest sheet is reachable from Today and from the work page (reading or catching-up works) | Owner choice: lets a work being read on schedule be tracked before it falls behind |+| Q5 | 2026-09-25 | Count-up counts only while the work status is `ongoing` | Owner choice: a finished or paused story publishes nothing, so counting its weekdays would inflate "behind" |+| Q6 | 2026-09-25 | Caught up on a `finished` work offers `Mark Finished`; `ongoing` or `hiatus` offers `Move to Reading` | Owner choice: moving a completed story to Reading puts it on nothing and asks for a second edit |+| Q7 | 2026-09-25 | V15 is retired at the V16 freeze; every device confirmed on marker `"16"` by the owner on 2026-09-25 | `retire-migration-chain` Decision 6's population precondition, met before the freeze as in the last six bumps |+| Q8 | 2026-09-25 | "Last chapter read" is the **highest** whole chapter number among the work's notes, with the override bounded below by notes first captured after it | Owner choice after review: a re-share re-stamps `lastSharedAt` (`LibraryRepository+Capture.swift`), so "newest note" would drop a reader from 42 to 10 for re-opening chapter 10; `firstCapturedAt` never moves. An interlude after chapter 41 leaves 41 |+| Q9 | 2026-09-25 | A chapter numbered in parts (`12.5`, `5.07`) is not a numbered note; no flooring | `5.07` is volume 5 chapter 7 on The Wandering Inn, and flooring it to 5 is wrong; the release shelf's badge already uses this rule |+| Q10 | 2026-09-25 | Saving the sheet always writes a new confirmation time, even if only the count-up switch or the override changed | Save confirms the number shown; a single stamp keeps the three values one set for [7.1](requirements.md#7.1). The prefill is marked `estimated` ([4.3](requirements.md#4.3)) so confirming a guess is never silent |+| Q11 | 2026-09-25 | Emptying the latest field and saving clears the latest | The edit-views rule forbids a per-field Clear button, so the field itself is the way back to unknown |+| Q12 | 2026-09-25 | The caught-up banner is neutral, not amber | Amber is reserved for teaching and duplicate review (style guide, `polish-and-export` Decision 1) |+| Q13 | 2026-09-25 | The work editor's Save rebases the count (L = E under the old settings, new confirmation time, estimate flag on) when it changes the status to or from `ongoing` or changes the release days, inside the metadata commit from entries read under the lock | Owner choice after two reviews: without it a hiatus → ongoing change counts every weekday of the hiatus, and ongoing → hiatus wipes releases already counted; re-stamping alone would drop them too. A refused metadata commit rebases nothing |+| Q14 | 2026-09-25 | Banners and the row menu appear on the current day only; a later day shows forecast rows, caught-up works as a `Caught up` row | Owner choice after review: a banner asking to change a status on a day that has not come is acting on a forecast |+| Q15 | 2026-09-25 | Archive pair moves 15/16 → 16/17 and a 15/16 archive is refused by version | Repo convention: one supported pair per build, the older importer deleted (`schema-migration.md`, `series-and-related-works` Q13) |+| Q16 | 2026-09-25 | An exact row confirmed more than 7 days before the day shown appends ` · as of {when}` | With count-up off, a year-old confirmation would otherwise read as a current fact |+| Q17 | 2026-09-25 | Clearing the override is stored as *cleared* with its moment, not as nothing | A tombstone lets a newer clear win [7.2](requirements.md#7.2); nothing-with-no-moment would let an older override from another device return. A value without a moment reads as no override, so no new diagnosis is added to the closed tolerated set |+| Q18 | 2026-09-25 | Performance asserts only the 2 s budget, plus a recorded same-host before/after pair of three runs or more | CLAUDE.md: single runs of these suites are not reproducible (0.74–1.28 s on unchanged code), so a 50 ms delta criterion would be noise |+| Q19 | 2026-09-25 | Determinism is claimed for devices in the same time zone | Release weekdays and the confirmation day are local calendar facts; engineering a zone-free count buys nothing a reader would see |+| Q20 | 2026-09-25 | Derived values are capped at 9,999, the numbered-note ceiling | Keeps E inside the range the field accepts |+| Q21 | 2026-09-25 | An estimate flag in the confirmed set, set by a rebase and cleared by a sheet Save; a row with it on reads estimated | Owner choice: otherwise a schedule edit silently turns `~52` into an exact `52`, which Q10's rule forbids. Folded with L, count-up and confirmation time under [7.1](requirements.md#7.1) |+| Q22 | 2026-09-25 | Duplicate merge, import and synced edits never rebase | Owner choice: the reconcile may not read the clock ([7.6](requirements.md#7.6)); the mismatch lasts until the next sheet or editor Save, recorded as a non-goal |+| Q23 | 2026-09-25 | L without a confirmation time cannot be stored; an archive record holding one imports as no confirmation | The confirmed set is one value (Decision 5), so the state Req's N definition guards against is unreachable in the store; the archive mapping drops it rather than inventing a moment |+| Q24 | 2026-09-25 | The read day is the earliest candidate, and only counted notes are candidates | Deterministic when the override equals the highest counted note; a note excluded from R by the override cannot set r |+| Q25 | 2026-09-25 | `updateWork` takes a required `calendar:` for the rebase | Owner choice: the repository never reads an ambient calendar (update-schedule Q39/Q44); `AppLibraryModel` passes the one it publishes |+| Q26 | 2026-09-25 | The release shelf's next-chapter badge uses the last chapter read (R) | Owner choice: one definition across shelf, card and sheet; a re-share no longer moves the badge |+| Q27 | 2026-09-25 | The banner writes through a narrow `setReadingStatus(id:expected:to:)`, not `updateWork` | `updateWork` needs a full draft and basis for one field; the narrow call refuses if the status moved underneath the banner |+| Q28 | 2026-09-25 | The progress columns stay out of `WorkEditBasis.matches`, `WorkMetadataDraft` and every authored-content type | The editor does not edit them and the rebase re-derives under the lock; keeping them out of authored content leaves variant IDs unchanged (Req 7.5) |+| Q29 | 2026-09-25 | A cleared override is the `.cleared(at:)` case of the override value | An explicit case rather than a sentinel number; the archive maps it to a moment with no number (Q31) |+| Q30 | 2026-09-25 | The Set latest sheet is presented from `ContentView` through `AppNavigation` | Every sheet in the window lives there so a size-class crossing cannot dismiss it (`ipad-and-mac-layouts` Req 1.7) |+| Q31 | 2026-09-26 | The archive carries six flat fields on the `seriesID` precedent: four optional keys omitted when nil, `countsUpOnReleaseDays` and `latestIsEstimate` required | The archive codec is synthesized `Codable`, which omits nil optionals; "required key, null value" would refuse the app's own archives. `supportedVersions` already refuses a pre-feature archive, so a required optional would guard nothing |+| Q32 | 2026-09-26 | The import fold runs before `commitWorks`' torn and `modifiedAt` guards, bumps no `modifiedAt` and does not enter `applied` | Owner choice: progress is not authored, so a torn title must not block it (Req 8.2); no bump keeps the fold clock-free and a second import a no-op (8.4); staying out of `applied` leaves memberships untouched. Recorded in CLAUDE.md's Sync section as the one import exception to the whole-record gate |+| Q33 | 2026-09-26 | A multi-copy fold may overwrite a blob that will not decode | It reads as absent everywhere else; the only source is a future build's shape reaching an older device, which the marker already treats as unsupported. Progress is re-enterable in one sheet Save |++## Decision 1: The last-chapter override stops applying by timestamp, not by being cleared++**Date**: 2026-09-25+**Status**: accepted++### Context++The handover (§7) stores `lastChapterOverride` and clears it "when a newer entry parses numerically". Captures are written by the app and by the share extension, and the extension writes entries only: it never changes a Work, never reconciles, and must stay that way. A clearing write would also be a second writer of a Work field on the capture path, which the repo's convergence rules avoid.++### Decision++Store the override with the moment it was set (one `LastChapterOverride` value, stored as a blob per Decision 5). With an override set, the last chapter read is the larger of the override and the highest number among notes first captured after its moment. The reader can clear it from the sheet, which stores *cleared* with a new moment (Q17); nothing else clears it.++### Rationale++The rule is a pure function of synced values, so every device agrees without coordination, capture paths stay entries-only, and a note taken on another device takes effect the moment it syncs.++### Alternatives Considered++- **Clear on capture**: the handover's rule - Rejected: needs a Work write from the share extension, and two devices can race the clear against a new override.+- **Override without a timestamp, newest note always wins when numeric**: one column - Rejected: an override set after the newest note (the usual case: "I read 42 on the site, not in the app") would be ignored immediately.++### Consequences++**Positive:**+- No new writer on the capture path; the extension is untouched.+- Deterministic across devices.++**Negative:**+- One more stored value than the handover.+- A stale override stays in the store after notes pass it (harmless: the larger value wins, and the sheet shows which source is in use).++---++## Decision 2: Progress fields converge by newest confirmation, not as reader-authored content++**Date**: 2026-09-25+**Status**: accepted++### Context++Two copies of one work can disagree on the new fields after a sync race or when duplicates are merged. The repo has two answers for disagreement: reader-authored content goes to the reader, and other fields resolve by a deterministic rule on synced content.++### Decision++Latest, count-up, confirmation time and the estimate flag (Q21) move as one set, taken from the copy with the later confirmation time; the override pair is taken from the copy with the later override moment. Neither counts as reader-authored content.++### Rationale++The fields are a record of when the reader last looked, so the newest look is the right answer, and a timestamp already on the row decides it. Treating them as authored would let a number typed on two devices block a duplicate merge over a fact that is out of date within a week anyway.++### Alternatives Considered++- **Reader-authored content**: disagreements go to the reader - Rejected: turns a routine race into a blocking question.+- **Plain last-writer-wins per row**: CloudKit's default - Rejected: collapse and import need an explicit rule, and per-row LWW is not defined across distinct-UUID duplicates.++### Consequences++**Positive:**+- Merges and imports never stop on these fields.+- A fixed point dirties nothing.++**Negative:**+- A value set on a device with a skewed clock can win or lose unfairly.+- Adds a fold rule to the convergence, collapse and import paths.++---++## Decision 3: Effective latest takes the larger of two counted lower bounds++**Date**: 2026-09-25+**Status**: accepted++### Context++Q3 had the effective latest rise to meet what the reader has read: `max(latest + releases since confirmation, last read)`. Both reviews showed it stalls: with latest 40 confirmed Monday and chapter 45 read on Wednesday, a release on Friday leaves the estimate at 45, although 46 is out.++### Decision++Effective latest = `max(latest + releases since the confirmation day, last read + releases since the later of the read day and the confirmation day)`, capped at 9,999. A row is exact when this equals the stored latest and the estimate flag (Q21) is off, estimated otherwise.++*Amended 2026-09-25 after the second review*: the read-day term originally counted from the read day alone. Then a Save could not pin a number: with a 30-day-old note at chapter 45 and daily releases, saving 45 showed `45/~75`. Counting from the later of the two days leaves every case where the reader read after confirming unchanged, and drops only extrapolation from before a confirmation, which the confirmation supersedes.++### Rationale++Each term is a lower bound on the story's position: what the reader confirmed, and what they have proved exists by reading it, each carried forward by the releases since the later of that evidence and the reader's last confirmation. Taking the larger never adds the two, and the result keeps moving after the reader passes a stale confirmation.++### Alternatives Considered++- **Q3 as it stood**: `max(latest + counted, last read)` - Rejected: stalls until the counted releases pass the chapter read.+- **Write a new latest when a note passes it**: keeps one base - Rejected: a write on the capture path, which Decision 1 already rules out.+- **Apply the read-day term only when the read day is after the confirmation**: simpler - Rejected: saving a latest below the last read then gives a negative "behind", and flooring it at the last read brings the stall back.++### Consequences++**Positive:**+- The estimate never stalls behind the reader's own notes.+- Still derived: no write, deterministic from synced values.++**Negative:**+- Needs the read day, so the derivation reads every entry of each catch-up work, not only the newest (covered by [10](requirements.md#10.1)).+- A misparsed high chapter number inflates the estimate until the reader corrects it with the override.++---++## Decision 4: Progress columns converge by an elected record written beside the carrier copy++**Date**: 2026-09-25+**Status**: accepted++### Context++Work has no per-field timestamps. Same-UUID convergence, collapse and reader resolution copy the carrier row's values, and import is all-or-nothing per record behind a `modifiedAt` gate. Decision 2 needs the newest confirmation to win instead, in every one of those paths and on the read side, and CLAUDE.md forbids a new reconciler outside the ordered pass without a decision.++### Decision++A pure `CatchUpFold.elect` chooses the record from all rows involved; a value-guarded `CatchUpWriter` writes it. It runs inside the existing Work duplicate pass beside the carrier copy (convergence and collapse), in `resolveWorkSet`, in the work-merge commit and in import outside the `modifiedAt` gate. Group snapshots elect the same record rather than reading the carrier's.++### Rationale++Every multi-row UUID group already reaches the Work duplicate pass, so no new phase or trigger is needed, and the read side agrees with what convergence will write before it runs.++### Alternatives Considered++- **Per-field timestamps with `DirectoryFold`**: the directory-table shape - Rejected: one more timestamp column per field for a set that is always edited together.+- **A separate progress reconciler in the ordered pass**: - Rejected: duplicates the Work pass's grouping and needs its own gating counter.+- **Carrier wins, like other Work fields**: - Rejected: contradicts Decision 2; the carrier is chosen by authored content, not by recency.++### Consequences++**Positive:**+- No new reconciler, trigger or diagnosis.+- Read side and write side use one function.++**Negative:**+- Five call sites carry the fold, each needing its own test.+- Import gains a write path that ignores the record-level gate for these columns.++---++## Decision 5: The confirmed set and the override are two blob columns++**Date**: 2026-09-26+**Status**: accepted++### Context++A mirrored work is normally one row, and CloudKit mirroring merges concurrent edits per property by arrival, not by `confirmedAt`. With six flat columns, and writes that assign only changed values, two devices confirming at once could leave a row with one device's latest and the other's count-up, or an override number from one device with another's moment: combinations no device saved. The fold in Decision 4 only runs where there are several copies, so it cannot prevent this.++### Decision++Store `CatchUpConfirmation` (latest, confirmation time, count-up, estimate flag) as one optional `Data` column and `LastChapterOverride` as a second. On one row, concurrent confirmations resolve by later arrival (Req 7.7); between copies, Decision 4's fold still elects by timestamp.++### Rationale++A `Data` attribute is one mirrored property, so each tuple arrives whole whatever the merge granularity. CLAUDE.md sanctions a `Codable` blob for a closed typed value the store never queries, which these are.++### Alternatives Considered++- **Six flat columns**: the first design - Rejected: tuples can tear under per-property merge.+- **Write every column on every confirmation**: - Rejected: relies on Core Data marking a same-value assignment as changed, which it does not reliably do.+- **Immutable confirmation records in a join table**: strictly newest-wins - Rejected for now: a new table inherits dedupe, cascade, re-pointing and an archive kind for a single-reader library. It is the fallback if the two-device check shows blobs merging unexpectedly.++### Consequences++**Positive:**+- No torn tuples; two columns instead of six.+- Optional columns: the lightweight stage writes nothing.++**Negative:**+- The blobs cannot be queried (nothing needs to).+- The Codable shapes are frozen with the schema, like `JunkSuffixRule`.+- On one row, the later arrival wins even when it carries the older confirmation.++---
specs/catch-up-progress/design.md Added +230 / -0
diff --git a/specs/catch-up-progress/design.md b/specs/catch-up-progress/design.mdnew file mode 100644index 00000000..508b1b25--- /dev/null+++ b/specs/catch-up-progress/design.md@@ -0,0 +1,230 @@+# Design: Catch-up Progress++## Overview++Two Codable blob columns on `Work` hold what the reader confirmed (latest, confirmation time, count-up, estimate flag) and their own last chapter (a value or a clear, with its moment). Everything the card shows is derived from those, the work's entries and its schedule at read time, inside the read `todayPresentation` already makes. The schema moves V16 → V17 and the archive pair 15/16 → 16/17.++## Architecture++```mermaid+flowchart LR+  subgraph Store+    W[Work rows<br/>2 blob columns]+    E[Entry rows]+  end+  W -->|CatchUpFold.elect over group rows| S[WorkSnapshot.catchUp]+  E -->|NumberedNote.from| N[numbered notes]+  S --> SW[ScheduledWork]+  N --> SW+  SW -->|TodayDayPlan.build, day d| P[CatchUpProgress]+  P --> RR[ReleaseRow.progress]+  RR --> UI[card rows · banner · shelf badge]+  Sheet[SetLatestSheet] -->|commitCatchUpProgress| W+  Banner -->|setReadingStatus| W+  Editor[Work editor Save] -->|updateWork: rebase| W+```++**Invariants**++- Nothing derived is stored. `CatchUpProgress` is recomputed per publication and per selected day.+- Each blob is one CloudKit-mirrored property, so a concurrent edit on one row keeps one device's whole tuple (Req 7.7, Decision 5).+- Two reader actions write a blob (the sheet and the rebase); those two and the banner are the only callers of `clock.now()` for this feature. Convergence, collapse, resolution, merge and import never read the clock (Req 7.6).+- The silent paths (convergence, collapse, import fold) write a blob only when its **decoded** value differs, never comparing bytes, so a fixed point dirties nothing. The reader-action writes always stamp `confirmedAt` and `modifiedAt`.+- The blobs are not reader-authored content: absent from `WorkAuthoredContent`, `isBare`, `orderComponents`, `differingWorkFields`, `WorkMergeField` and `WorkEditBasis.matches` (Q28). Variant IDs do not move.+- The share extension never builds a `WorkSnapshot` (none of `AsterismShareExtension*`, `ShareWorkContext` or `CaptureViewModel` references one), so it never reads the new columns (Req 9.3); nothing here adds a snapshot read to the capture path.++### Parity audit++Every site a `Work` status or `releaseDaysRaw` column reaches, and whether the new columns need an equivalent. Line numbers are at `19d879b5`.++| Site | Equivalent | Note |+|---|---|---|+| `Models.swift` `Work` and the top-level typealiases | yes | two columns ([Data Models](#data-models)); typealiases onto `AsterismSchemaV17` |+| `AsterismSchemaV15.swift`, `V15RecordedStoreFixture/Tests` | delete | V15 retired (Q7) |+| `AsterismSchemaV16.swift` | freeze | becomes the frozen snapshot; the live version and `AsterismV17MigrationPlan` move to `AsterismSchemaV17.swift` |+| `LibraryRepository+Bootstrap.swift` markers (:617–629) and the lagging arm in `act(on:)` | yes | app `["16","17"]`, lagging `"16"`, extension `"17"`; the arm moves from `"15"` to `"16"` |+| `LibraryRepository+BootstrapState.swift` | wording | the lagging generation is a payload |+| `LibraryRepository+BackupImportGates.swift` scratch schema | yes | names live V17 |+| `LibraryRepository+EmptyLibrary.swift:98,136` | yes | `AsterismSchemaV17.models` |+| `ModelContractTests`, `MarkerContractTests`, `MarkerGenerationSixteenTests` | yes | delta pin (V17 `Work` = V16 + two optional `Data` columns); `MarkerGenerationSeventeenTests` |+| `FrozenLibraryPathTests` | unchanged | file names do not move; run as a guard |+| `specs/retire-migration-chain/library-graph-baseline.txt`, `LibraryGraphBaselineTests` | yes | hand-edited: new format line, two fields on every work line |+| ~34 Core test files naming `AsterismSchemaV15`/`V16` | rename | in the freeze commit, so every commit compiles |+| `WorkSnapshot` | yes | `catchUp: CatchUpRecord`, defaulted init parameter |+| `LibraryRepository.snapshot(_:)` (:2032) | yes | decodes the row's blobs |+| `LibraryRepository+Groups.swift` rebuilds (:414, :433) | yes, **elected** | `CatchUpFold.elect(rows)`, never the carrier's |+| `LibraryRepository+TodayPresentation.todaySchedule` (:311) | yes | record, numbered notes and work status into `ScheduledWork` |+| `updateWork` (:1343) | yes | required `calendar:` and the rebase (Q25) |+| `WorkMetadataDraft`, `WorkEditBasis`, `matches` | no | Q28 |+| `DuplicateReconciler` Work pass, `apply(carrier, to:survivor, types:)` (:568) | yes, **elected** | `CatchUpWriter.apply(elect(allRows), to: survivor)` beside it; covers same-UUID convergence and collapse |+| `DuplicateReconciler` Work deletion commit (:1291–1308, beside `carrySeries`/`carryThumbnail`) | yes, **elected** | `carryCatchUp(from: losers, to: survivor)`: re-elects over losers and survivor at deletion, because `workFingerprint` does not see the blobs and a confirmation can arrive on a loser after the write phase |+| `DuplicateReconciler` Entry pass (:989) | no | entries carry no progress |+| `resolveWorkSet` (DuplicateResolution :842–857) | yes, **elected** | the only fold for a set the silent pass does not take (`:538` passes only `.silentlyResolvable`) |+| `differingWorkFields`, `DuplicateField`, `WorkVariantSide` | no | not authored; never shown |+| Work merge commit (`LibraryRepository+WorkMerge`) | yes, **elected** | across both works' rows; covers the to-read match, which merges through it |+| `WorkMergeView`, `DuplicateResolutionView` | no | never shown |+| `BackupV15Types/Codec/Exporter` | replace | `BackupV16*`, six flat fields (Q31) |+| `BackupArchiveProjection` (:746) | yes | from the elected record |+| `ConfirmImport.commitWorks` (:534–581) and `apply` (:1023) | yes | fold runs before both guards (Q32) |+| `ArchiveRecordBuilders.makeWork` | yes | sets the blobs on insert |+| `BackupImporter.supportedVersions` | yes | `(16, 17)` |+| Golden and wire fixtures | yes | `backup-16-17-golden.json` via `ASTERISM_RECORD_GOLDEN=1`; `BackupV16Fixtures` |+| `envelopeVersionsFollowTheLiveSchema` | yes | self-clearing `withKnownIssue` between the schema commit and the archive commit, removed by the latter |+| `LibraryValidator` | no | an undecodable blob is a tolerated read, not a diagnosis |+| `TodayFixture`, `seedTodayWork`, `seedM4ScheduleLayer` | yes | via `CatchUpFixtureWriter` |+| `WorkDetailView` status line (:712–757) | yes | `Latest released` row |+| `WorksListOptions` filters | no | Non-Goal |+| `CLAUDE.md` live-schema paragraph and Sync › Conflicts | yes | V17 / 16/17; the import fold line (Q32) |++## Components and Interfaces++### Core (`Packages/AsterismCore/Sources/AsterismCore/`)++**`CatchUpRecord.swift`** — the stored values, their codec, fold and writer.++```swift+public struct CatchUpConfirmation: Codable, Equatable, Sendable {+  public var latest: Int?                  // nil: cleared by an empty Save+  public var confirmedAtMilliseconds: Int64+  public var countsUp: Bool+  public var isEstimate: Bool+}+public enum LastChapterOverride: Codable, Equatable, Sendable {+  case value(Int, atMilliseconds: Int64)+  case cleared(atMilliseconds: Int64)+}+public struct CatchUpRecord: Equatable, Sendable {+  public var confirmation: CatchUpConfirmation?   // nil: never confirmed+  public var override: LastChapterOverride?+  public var latest: Int? { confirmation?.latest }+  public var countsUp: Bool { confirmation?.countsUp ?? true }+  public static let pristine = CatchUpRecord(confirmation: nil, override: nil)+}+```++- Moments are stored and compared as integer milliseconds since 1970. `MillisecondInstant` gains `milliseconds(_: Date) -> Int64` and `date(fromMilliseconds:)`, using `quantize`'s snap-then-floor rule, and these are the only conversion — at the sheet writer, the rebase and the archive encode and decode; a `Date` is never compared after a round trip, so the archive's RFC 3339 dates and the blob agree exactly (Req 8.4). Accessors return `Date` for display and day arithmetic.+- Codec: through `JSONBlob` (`Models.swift:115`), the one place a JSON blob column becomes a value. `LastChapterOverride` hand-writes `init(from:)` and `encode(to:)` over the flat keys `kind` (`"value"` or `"cleared"`, pinned), `number` and `atMilliseconds`; an unknown `kind` fails the decode. A blob that will not decode reads as nil (tolerated); export refuses the work by name, as `definitionData` does (`BackupArchiveProjection.swift:358`). A multi-copy fold may overwrite an undecodable blob with the elected value (Q33).+- `CatchUpFold.elect(_ records:) -> CatchUpRecord` elects `confirmation` by greatest `confirmedAtMilliseconds` (nil loses to any value) and `override` by greatest moment, independently. Ties: the **greater** of the tuples `(latest ?? -1, countsUp ? 1 : 0, isEstimate ? 1 : 0)` wins; for the override, `.value` beats `.cleared`, then the greater number. The result does not depend on input order (Req 7.3).+- `CatchUpWriter.apply(_:to rows: [Work]) -> Bool` encodes and assigns each blob only where the row's decoded value differs.++**`CatchUpFixtureWriter.swift`** — `#if DEBUG || ASTERISM_PERFORMANCE_TESTING`, like the other fixtures: writes a `CatchUpRecord` onto a work's rows with a caller-given confirmation time, so `TodayFixture` and `seedM4ScheduleLayer` can hold past confirmations. Never compiled into `Personal`.++**`CatchUpProgress.swift`**++```swift+public struct NumberedNote: Equatable, Sendable {+  public let number: Int+  public let firstCapturedAt: Date+  public let title: String          // chapterTitle ?? captureTitle, for Req 4.6+  public static func from(_ entries: [EntrySnapshot]) -> [NumberedNote]+}+public struct CatchUpProgress: Equatable, Sendable {+  public enum State: Equatable, Sendable { case unknown, exact, estimated, caughtUp }+  public let state: State+  public let lastRead: Int?          // R+  public let lastReadSource: LastReadSource?  // .note(title) or .override+  public let readDay: CivilDay?      // r+  public let effectiveLatest: Int?   // E+  public let confirmedDay: CivilDay? // c+  public var behind: Int? { … }+  public static func build(record:notes:releaseDays:workStatus:day:calendar:) -> CatchUpProgress+  public static func build(work: WorkSnapshot, day: CivilDay, calendar: Calendar) -> CatchUpProgress+  public static func rebased(record:notes:releaseDays:workStatus:now:calendar:) -> CatchUpRecord?+}+```++- `NumberedNote.from` is the one builder, fed `EntrySnapshot`s in all three consumers (the Today walk, `build(work:)`, the rebase). It uses `ChapterNumber.whole(chapterSequence:chapterTitle:)`, which wraps `ChapterKeyDerivation.key` and applies the single-component and 0…9,999 bounds; `TodayDayPlan`'s private `chapterNumber(of:)` is deleted in its favour.+- `build` implements the requirements' Definitions: R and r (Q8, Q24), N via `TodayDayPlan.releaseCount` (made `internal static` if it is not), zero unless count-up is on, the work has days and `workStatus == .ongoing`, and zero when the start day is on or after `day`; E capped at 9,999. O(notes).+- `rebased` returns nil when `latest` is nil; otherwise a confirmation with `latest = E` for `now`'s day under the passed (stored) settings, `confirmedAt = now`, `isEstimate = true`, override untouched.++**`TodayDayPlan.swift`**++- `ScheduledWork` gains `catchUp`, `numberedNotes` and `workStatus`.+- `ReleaseRow` gains `progress: CatchUpProgress`; `lastChapter` becomes `progress.lastRead` (Q26). The unknown line reads R and r where R is known (Req 2.3).+- `CatchUpText.ordered`: exact and estimated by behind descending, then `Caught up` rows, then unknown by read day (else newest noted day) ascending; ties keep the incoming `titleOrder` (Req 2.4).++**Repository** — new `LibraryRepository+CatchUpProgress.swift`:++```swift+public struct CatchUpSheetState: Sendable { work: WorkSnapshot; record: CatchUpRecord; progress: CatchUpProgress }+public func catchUpSheetState(workID: UUID, day: CivilDay, calendar: Calendar) async throws -> CatchUpSheetState+public struct CatchUpDraft: Sendable { latest: Int?; countsUp: Bool; override: OverrideEdit } // .unchanged | .set(Int) | .clear+public func commitCatchUpProgress(id: UUID, basis: CatchUpRecord, draft: CatchUpDraft) async throws -> LibraryWriteOutcome+public func setReadingStatus(id: UUID, expected: ReadingStatus, to: ReadingStatus) async throws -> LibraryWriteOutcome+```++- `catchUpSheetState` is a fresh locked read at sheet open; its `record` is the conflict basis and its `progress` the prefill (Req 4.3, 4.6).+- `commitCatchUpProgress` and `setReadingStatus` resolve the target through `resolveWorkWriteTarget` and refuse a torn group with `tornRefusal`, as `updateWork` does (:1370–1375).+- `commitCatchUpProgress`: refuses `.conflict` when `elect(rows) != basis`; validates 0…9,999; writes a new confirmation (`confirmedAtMilliseconds = MillisecondInstant.milliseconds(clock.now())`, `isEstimate = false`) and, unless `.unchanged`, the override with the same moment, to every row of the group; bumps `modifiedAt`; one `saveStrategy.save`.+- `setReadingStatus`: refuses `.conflict` when the group's reading status is not `expected`; writes `readingStatusRaw` and `modifiedAt`.+- `updateWork(id:basis:draft:calendar:)`: when the elected record has a latest, and the representative row's tolerant `workStatus` and the draft's are on opposite sides of `.ongoing`, or its canonical `releaseDays` differs from `draft.releaseDays`, it builds the work's entry snapshots with the same bucketing `todaySchedule` uses (entries whose `work?.id` is the group's id, through `entryGroups(canonicalWorkIDs:)`), computes `rebased` under the stored settings, and writes it with `CatchUpWriter` in the same save. A refused save rolls it back (Req 5.3). The entry fetch is one predicate fetch on the work's id, paid only when the trigger fires.++**The fold on every multi-copy path** (`CatchUpFold.elect` over every row involved, `CatchUpWriter` onto the survivor rows):++| Path | Behaviour |+|---|---|+| Same-UUID convergence and collapse | `DuplicateReconciler` Work pass: the write phase (:568) elects over `allRows`; the deletion commit (:1291–1308) re-elects over losers and survivor through `carryCatchUp` before any loser is deleted, so a confirmation that arrived in between is carried (write-before-delete). |+| Divergent sets | `resolveWorkSet`, for these columns only. Until the reader resolves, the read-side election shows the elected record. |+| Work merge | the merge commit, across both works' rows |+| Import | in `commitWorks`, **before** the torn and `modifiedAt` guards: elect(local group rows + archive record) and write. A fold-only write bumps no `modifiedAt` and does not enter `applied`, so memberships are untouched and a second import is a no-op (Q32). New works get the record through `makeWork`. |++### App (`Asterism/Asterism/`)++| Component | File | Behaviour |+|---|---|---|+| `CatchUpText` additions | `Views/TodayText.swift` | status lines with singular/plural chapter word, `as of` (relative day as the unknown line spells it), accessibility labels (Req 2.1–2.3, 2.7) |+| `CatchUpCard` / `CatchUpRowView` | `Views/TodaySections.swift` | 4 pt bar (cyan on `cardBorder`, hidden from VoiceOver); `contextMenu` on the current day only; `Caught up` rows on later days; wraps at accessibility sizes as the row does today (6.3) |+| `CatchUpBanner` | `Views/TodaySections.swift` | neutral `constellationCard()`; primary `.constellationSecondary`, `Not yet, more is out` `.constellationTertiary`; current day only; when every work is caught up the section draws header and banners, no card (3.5) |+| `SetLatestModel` | `ViewModels/SetLatestModel.swift` | `@Observable @MainActor`; loads `catchUpSheetState` at open; drafts, `estimated` mark (4.3), behind caption (4.4), count-up switch shown only when the work has days (4.5), source line from `lastReadSource` (4.6); Save → `AppLibraryModel.commitCatchUpProgress`; a `.conflict` keeps the sheet and its drafts (4.10) |+| `SetLatestSheet` | `Views/SetLatestSheet.swift` | Cancel/Save toolbar; header uses `WorkRowHeader`'s cover and site label; `−`/field/`+` with `.accessibilityAdjustableAction` (6.2); `.presentationDetents([.medium, .large])` |+| Route | `Layout/AppNavigation.swift`, `ContentView.swift` | `presentedSetLatest: SetLatestRoute?` presented on `ContentView` beside `presentedAnnouncement` (Q30); the model is owned by the sheet content, so backgrounding keeps its drafts (4.7) |+| Work page row | `Views/WorkDetailView.swift` (:712–757) | `Latest released` row from `CatchUpProgress.build(work:day:calendar:)`, hidden in edit mode (5.1, 5.2) |+| `AppLibraryModel` | `ViewModels/AppLibraryModel.swift` | `commitCatchUpProgress`, `setReadingStatus`, `calendar` passed to `updateWork`; each refreshes Today as the existing write helpers do |++## Data Models++`AsterismSchemaV17.Work` adds, after `releaseDaysRaw`:++```swift+var catchUpConfirmationData: Data? = nil   // JSON CatchUpConfirmation+var lastChapterOverrideData: Data? = nil   // JSON LastChapterOverride+```++- Optional, so the lightweight stage writes nothing into existing rows and every work reads as `CatchUpRecord.pristine` (Req 9.1). The `@Model` stores only `Data`, so a later freeze of V17 copies no Swift type; what is frozen is the JSON wire shape, pinned by a golden-bytes test.+- `AsterismSchemaV16` is frozen verbatim, carrying across what the V16 header declares frozen (`ThumbnailShape`'s spellings, the SHA-256 digest, `.externalStorage`, `ReleaseDay`'s spellings, `JunkSuffixRule`, `SegmentPositionSpec`). `JunkSuffixRule` and `SegmentPositionSpec` stay in `ValueObjects.swift` while V16 is frozen.+- `AsterismV17MigrationPlan = [V16, V17]`, one `.lightweight` stage, no data pass.+- Archive `BackupV16Work` carries six flat fields on the `seriesID` precedent (Q31): optional keys `latestReleasedChapter`, `latestConfirmedAt`, `lastChapterOverride`, `lastChapterOverrideAt`, omitted when nil; required non-optional `countsUpOnReleaseDays` and `latestIsEstimate`. Mapping: no `latestConfirmedAt` → no confirmation (a `latestReleasedChapter` without it is dropped); `lastChapterOverrideAt` with a number → `.value`, without → `.cleared`; no `lastChapterOverrideAt` → no override, whatever `lastChapterOverride` holds. Dates are quantized to milliseconds on decode. `formatVersion = 16`, `schemaVersion = 17`.++## Error Handling++| Failure | Response |+|---|---|+| Sheet Save: group changed since open (`.conflict`) | sheet stays open with the reader's values and says `Changed on another device. Close and reopen to see it.`; drafts are not reloaded |+| Sheet Save or banner on a torn group | refused with the torn-group message the work page shows |+| Sheet Save: number outside 0…9,999 | Save disabled while the field does not parse; `.invalidInput` if reached |+| Banner: reading status no longer `expected` | nothing written; the next publication redraws the section |+| Editor Save refused | rebase rolled back with the metadata commit |+| Undecodable blob | reads as absent; export refuses the work by name |+| 15/16 archive | refused by `supportedVersions` before any write |++## Risks and Assumptions++- Risk: deriving R, r and E for every catch-up and release work on every selected day adds measurable time to `todayPublication` | Verify: the M4 before/after pair (Req 10.2) in the performance task | If wrong: pre-reduce `numberedNotes` in `ScheduledWork` to a suffix maximum over `firstCapturedAt` so each `build` is O(log notes).+- Risk: CloudKit mirroring merges an optional `Data` attribute differently from other attributes under concurrent edits | Verify: the runbook's two-device check (Testing Strategy) | If wrong: split into immutable confirmation rows (Decision 5's third alternative) in a follow-up spec before shipping to `Personal`.++## Testing Strategy++| Layer | What | Covers |+|---|---|---|+| `CatchUpProgressTests` | table: each state; override value/cleared/half-absent; re-share moves `lastSharedAt` not R; note above R after override; latest < R; Decision 3's stall case; "save 45 sees 75" case; clock ahead; count-up off; not ongoing; no days; cap; DST weeks in Amsterdam and Sydney; read-day ties | 1.1–1.7 |+| `CatchUpRecordTests` | codec round-trip and determinism; `MillisecondInstant.milliseconds` agrees with `quantize` at the floating-point edges; undecodable reads nil; fold: every permutation of 2–4 generated records elects the same result, `elect([elect(x)]) == elect(x)`, nil loses, newer clear wins, tie direction | 7.1–7.3, 7.7 |+| Repository | `catchUpSheetState`; commit writes, conflicts, torn refusal, `.unchanged`; `setReadingStatus` conflict and torn refusal; rebase fires on each trigger, not on others, not on raw-only day differences, rolled back with a refused commit | 3.2, 4.x, 5.3 |+| Reconcile | progress-only divergence converges and a second pass writes nothing; collapse, including a confirmation written to a loser, and one written to the survivor, between the write phase and deletion, and equal timestamps across them; `resolveWorkSet`; merge; variant IDs unchanged | 7.4–7.6 |+| Archive | round-trip; import older/newer/equal/torn; import twice; 15/16 refused; golden; envelope test | 8.1–8.4 |+| Schema | `V16RecordedStoreTests` asserts the raw columns after conversion; older refused; `MarkerGenerationSeventeenTests`; `ModelContractTests` delta pin; `LibraryGraphBaselineTests`; golden bytes of both blob shapes | 9.1–9.3 |+| Manual | `specs/catch-up-progress/runbook.md`: two `Development` installs on one account confirm the same work concurrently; each tuple arrives whole. The owner's to run | 7.7 |+| App unit | `CatchUpText` lines, plurals, labels, ordering; `SetLatestModel` prefill, mark, caption, switch visibility, draft mapping, conflict keeps drafts | 2.x, 4.x, 6.2 |+| UI | Today fixture: exact, estimated, unknown rows; banner Move to Reading and Not yet; sheet Save and Cancel; work page row; no banner on another day; accessibility sizes | 2–6 |+| Performance | `todayPublication` with the M4 layer seeded; before/after ≥3 runs each, recorded | 10.1–10.2 |++The fold's order independence and idempotence are checked by enumerating permutations of generated record sets in parameterised Swift Testing tests; the input space is small enough to enumerate, and the package has no property-testing library.
specs/catch-up-progress/prerequisites.md Added +7 / -0
diff --git a/specs/catch-up-progress/prerequisites.md b/specs/catch-up-progress/prerequisites.mdnew file mode 100644index 00000000..dce0a99b--- /dev/null+++ b/specs/catch-up-progress/prerequisites.md@@ -0,0 +1,7 @@+# Prerequisites for Catch-up Progress++These tasks must be completed by the user before or during implementation.++## Before Testing++- [ ] Run the two-device check in `runbook.md` on `Development` builds after task 24, before this branch is merged. It is the only verification of Req 7.7 and of the design's second risk; nothing on the simulator or host mirrors.
specs/catch-up-progress/requirements.md Added +165 / -0
diff --git a/specs/catch-up-progress/requirements.md b/specs/catch-up-progress/requirements.mdnew file mode 100644index 00000000..4a6bce7f--- /dev/null+++ b/specs/catch-up-progress/requirements.md@@ -0,0 +1,165 @@+# Requirements: Catch-up Progress++## Introduction++Today's Catching up card can say what a reader last read and when, but not how far behind they are, because no work records how far its story has got. This feature lets the reader set a work's latest released chapter, estimates it forward on the work's release days, and shows each catch-up work as exact, estimated, unknown or caught up. It is §5's remaining states, §6 and §7 of `docs/Asterism-Today-v2.md`, amended by this spec's decision log, and it moves the store schema from V16 to V17.++## Non-Goals++- No automatic lookup of a work's latest chapter (RSS, scraping, site APIs); the reader sets it, and `Check on {site}` opens the page for them to look.+- No write on a timer, in the background or on capture: the estimate is derived at read time from synced values.+- No reading-status change the reader did not tap; caught up never moves a work on its own.+- No chapter URL built from a site's rules; `Next` opens the work's page as it does now.+- No progress for a chapter numbered in parts (`5.07`) or not numbered at all.+- No progress on the Works list, in Stats, in the markdown export or in the share sheet.+- No notifications or badges when a work falls behind.+- No merge of two devices' independent edits to one work's progress: between copies the newer confirmation wins ([7.1](#7.1)), and on one row the later arrival wins ([7.7](#7.7)).+- No support commitment for a device still on a V16 build: it syncs the added columns without reading them, and a duplicate collapse it runs can keep a copy without the progress.+- No rebase when a work's status or release days change through a duplicate merge, a backup import or an edit synced from another device; the count can be off until the next sheet Save or a work-editor Save that rebases ([5.3](#5.3)).+- No import of a 15/16 archive; one supported archive pair per build stands (`specs/rule-citation-by-uuid/` Q8), and a fresh export after updating is the restorable one.++## Relationship to Existing Specs++- Extends the schema-free Today v2 work (branch `worktree-today-release-shelf`, `19d879b5`): the Catching up card's `Show all` and its `Next` capsule stand as built, and its unknown state takes its chapter from R ([2.3](#2.3)); this spec adds the other three states, the row menu and the banner.+- Extends `specs/catch-up-mode/`: which works are listed under Catching up, and on which days, is unchanged.+- Extends `specs/update-schedule/`: a work's release days are the only input to the estimate. The work editor's Save gains one extra effect ([5.3](#5.3)).+- Extends `specs/work-and-reading-status/`: the banner's two actions set the reading status with a write of their own that changes nothing else (decision log Q27).++## Definitions++- **Latest** (L): a whole number from 0 to 9,999 the reader sets on a work, or nothing. Default nothing.+- **Confirmation time**: the moment the reader last saved the Set latest sheet for the work, or the moment a rebase ([5.3](#5.3)) wrote it; nothing by default. Its local calendar day is the **confirmation day** (c).+- **Estimate flag**: an on/off value on a work, default off. A rebase ([5.3](#5.3)) turns it on; a sheet Save turns it off.+- **Count-up**: a per-work on/off setting, default on.+- **Releases between** a day a and the day being shown d, written N(a, d): the number of the work's release days falling after a and on or before d. Zero when count-up is off, when the work has no release days, when its work status is not `ongoing`, or when a is on or after d. A release on day a itself is not counted. Where L is set but no confirmation time is, N(c, d) is 0.+- **Numbered note**: an entry of the work whose chapter reads as one whole number from 0 to 9,999, under the rule the release shelf's next-chapter badge uses.+- **Last-chapter override**: either a whole number from 0 to 9,999 or *cleared*, together with the moment the reader set it; nothing by default. A number or a clear without a moment reads as no override.+- **Last chapter read** (R): with no override, or a cleared one, the highest numbered note's number. With an override O set at moment t, the larger of O and the highest number among numbered notes first captured after t. Nothing when neither exists.+- **Read day** (r): the earliest of the candidate days for R: the local day of the earliest first capture among the counted notes carrying R's number, and, where the override equals R, the local day of the override's moment. Counted notes are all numbered notes with no override or a cleared one, and those first captured after the override's moment otherwise.+- **Effective latest** (E): the larger of L + N(c, d) and R + N(r′, d), where r′ is the later of r and c (r where c is nothing), capped at 9,999. Defined only when L is set; where R is nothing, E is L + N(c, d).+- **Behind**: E − R.+- **Chapter word**: `episode`/`Ep` or `chapter`/`Ch`, chosen by the work's type exactly as the release shelf's badge chooses it; singular when the count is 1.++## Requirements++### 1. Progress state++**User Story:** As a reader catching up on a work, I want to see how many chapters I am behind, so that I know how much is left.++**Acceptance Criteria:**++1. <a name="1.1"></a>A catch-up work SHALL read as **unknown** WHEN L or R is nothing; **caught up** WHEN behind is 0; **exact** WHEN behind is above 0, E equals L and the estimate flag is off; and **estimated** otherwise.  +2. <a name="1.2"></a>The state SHALL be derived for the day being shown from the work's stored values, release days, statuses and entries, and SHALL be identical on two devices holding the same synced content, in the same time zone, showing the same day.  +3. <a name="1.3"></a>N SHALL count calendar days, so a week containing a daylight-saving change counts each release weekday in it once.  +4. <a name="1.4"></a>Deriving the state SHALL write nothing to the library.  +5. <a name="1.5"></a>Re-sharing a chapter that is already noted SHALL NOT change R or the read day.  +6. <a name="1.6"></a>WHEN a note first captured after the override's moment (or with no override) has a higher number than R, THEN R SHALL follow it with no further action from the reader.  +7. <a name="1.7"></a>WHILE the confirmation day is after the current day (a device clock set ahead), N(c, d) SHALL be 0.  ++### 2. Catching up card rows++**User Story:** As a reader, I want each catch-up row to show my progress in the form it can be known, so that an estimate is never mistaken for a fact.++**Acceptance Criteria:**++1. <a name="2.1"></a>An exact row SHALL show a progress bar with `{R}/{L}` and the status line `{behind} {chapter word} behind` in cyan, followed by ` · as of {when}` WHEN the confirmation day is more than 7 days before the day shown, where `{when}` is spelled as the unknown row spells its relative day.  +2. <a name="2.2"></a>An estimated row SHALL show a progress bar with `{R}/~{E}` and the status line `~{behind} {chapter word} behind · estimated` in cyan.  +3. <a name="2.3"></a>An unknown row SHALL show the status line `Last read {chapter} · {when} · ~{n} releases since` with no progress bar; WHERE R is known, `{chapter}` SHALL be R and `{when}` and `{n}` SHALL be taken from the read day, and otherwise the line SHALL be as the card shows it today.  +4. <a name="2.4"></a>The card SHALL list exact and estimated rows first, most behind first, then `Caught up` rows, then unknown rows stalest first; ties SHALL keep the Works list's title order.  +5. <a name="2.5"></a>On the current day a caught-up work SHALL NOT appear as a row; it SHALL appear in a banner ([3](#3.1)). On a later day it SHALL appear as a row reading `Caught up`.  +6. <a name="2.6"></a>WHEN the reader long-presses a row on the current day, THEN the menu SHALL offer `Set latest…`, `Open Work Page` (where the work has a URL) and `Move to Reading`; on any other day there SHALL be no menu.  +7. <a name="2.7"></a>A row's accessibility label SHALL state the title and progress in words: `{title}, {behind} {chapter word} behind, {chapter word} {R} of {E}` for exact, the same with `, estimated` appended for estimated, `{title}, caught up` for a `Caught up` row, and the unknown row's status line for unknown.  ++### 3. Caught-up banner++**User Story:** As a reader who has caught up, I want to be asked whether to move the work back, so that I decide what happens to it.++**Acceptance Criteria:**++1. <a name="3.1"></a>WHEN a catch-up work is caught up on the current day, THEN a banner above the card SHALL say `Caught up on {title}.` with two buttons; one banner per caught-up work, in title order. No banner SHALL be shown on any other day.  +2. <a name="3.2"></a>The primary button SHALL read `Move to Reading` for a work whose status is `ongoing` or `hiatus`, and `Mark Finished` for a work whose status is `finished`; tapping it SHALL set the reading status to `reading` or `finished` respectively.  +3. <a name="3.3"></a>The second button SHALL read `Not yet, more is out` and SHALL open the Set latest sheet for that work.  +4. <a name="3.4"></a>No reading status SHALL change without the reader tapping the primary button.  +5. <a name="3.5"></a>WHEN every catch-up work is caught up on the current day, THEN the section SHALL show its header and the banners with no card.  +6. <a name="3.6"></a>The banner SHALL use the neutral card recipe, not amber.  ++### 4. Set latest sheet++**User Story:** As a reader, I want to record the latest released chapter and my own last chapter, so that the card shows my real progress.++**Acceptance Criteria:**++1. <a name="4.1"></a>The sheet SHALL be reachable from a catch-up row's menu, from the banner's `Not yet, more is out`, and from the work page ([5.1](#5.1)); it SHALL NOT be reachable while the work page is in edit mode.  +2. <a name="4.2"></a>The sheet SHALL show the work's cover, title, primary site's display name and release days, with `Cancel` and `Save` in its toolbar.  +3. <a name="4.3"></a>The latest field SHALL be prefilled with E if L is set, else R, else empty, and SHALL be marked `estimated` WHILE its value is E, E differs from L or the estimate flag is on, and the reader has not changed it; it SHALL be changed by `−` and `+` buttons and by typing, and SHALL accept only whole numbers from 0 to 9,999.  +4. <a name="4.4"></a>WHILE the field holds a number and R is known, the sheet SHALL show `{field − R} behind`, `Caught up` when the field equals R, or `Below your last chapter ({R}); progress will show {R}` when it is less, updated as the field changes.  +5. <a name="4.5"></a>The count-up switch SHALL be shown only for a work with at least one release day.  +6. <a name="4.6"></a>The sheet SHALL show R with its source — the title of the earliest note carrying that number, or `set by you` — and an override field the reader can fill to set the override or empty to clear it.  +7. <a name="4.7"></a>WHERE the work has a URL, the sheet SHALL offer `Check on {site}`, which opens that URL, and the sheet's unsaved values SHALL survive the app going to the background and returning.  +8. <a name="4.8"></a>WHEN the reader taps `Save`, THEN the latest (empty clears it), the count-up setting, a confirmation time of now and the estimate flag off SHALL be written together; the override and its moment SHALL be written only if the reader changed the override field; and the sheet SHALL close.  +9. <a name="4.9"></a>WHEN the reader taps `Cancel` or dismisses the sheet, THEN nothing SHALL be written.  +10. <a name="4.10"></a>IF a save is refused, THEN the sheet SHALL stay open with the reader's values and say why.  ++### 5. Work page and work editor++**User Story:** As a reader, I want to see and change a work's latest from its page, and not have an edit to its schedule distort the count, so that I can track any work I am reading.++**Acceptance Criteria:**++1. <a name="5.1"></a>WHILE the page is not in edit mode, the work page SHALL show a `Latest released` row for a work whose reading status is `reading` or `catchingUp`, reading `{E}` or `Not set`, which opens the Set latest sheet; `{E}` SHALL carry a leading `~` WHEN E differs from L or the estimate flag is on.  +2. <a name="5.2"></a>The row SHALL NOT be shown while the page is in edit mode.  +3. <a name="5.3"></a>WHEN the work editor's Save changes the work status to or from `ongoing`, or changes the release days, of a work with L set, THEN the commit that writes the status or the release days SHALL also write L = E as computed under the settings before the save for the current day from the work's entries as stored at that commit, a confirmation time of now and the estimate flag on; IF that commit is refused, THEN L, the confirmation time and the flag SHALL be unchanged.  ++### 6. Accessibility and Dynamic Type++**User Story:** As a reader using VoiceOver or large text, I want the progress and the sheet to work the same way, so that no state is visual only.++**Acceptance Criteria:**++1. <a name="6.1"></a>The progress bar SHALL be hidden from VoiceOver; the row's label ([2.7](#2.7)) carries its content.  +2. <a name="6.2"></a>The latest field SHALL be adjustable with VoiceOver's increment and decrement gestures and SHALL be read as `Latest released, {n}`, with `, estimated` while [4.3](#4.3)'s mark is shown.  +3. <a name="6.3"></a>At the accessibility text sizes the card row, the banner and the sheet SHALL wrap rather than truncate the title or the status line, and every control SHALL keep a 44 pt target.  ++### 7. Sync and duplicates++**User Story:** As a reader with more than one device, I want every device to settle on the same progress, so that the card agrees everywhere.++**Acceptance Criteria:**++1. <a name="7.1"></a>WHEN copies of one work disagree on L, count-up, confirmation time or the estimate flag, THEN every copy SHALL take all four from the copy with the later confirmation time, where a copy with no confirmation time is older than any copy with one, and a later confirmation with no L clears L.  +2. <a name="7.2"></a>WHEN copies disagree on the override, THEN every copy SHALL take the override and its moment from the copy with the later moment, a later clear included.  +3. <a name="7.3"></a>Where two confirmation times or two override moments are equal, the choice SHALL be deterministic from the synced values alone.  +4. <a name="7.4"></a>[7.1](#7.1) to [7.3](#7.3) SHALL apply wherever copies of a work are reconciled: sync convergence, duplicate merge and backup import.  +5. <a name="7.5"></a>A disagreement in these fields SHALL NOT be reported to the reader as a conflict, SHALL NOT block a duplicate merge, and SHALL NOT make a work count as carrying reader-authored content.  +6. <a name="7.6"></a>A library at its fixed point SHALL be left unchanged by another reconcile pass, and the reconcile SHALL NOT read the clock.+7. <a name="7.7"></a>WHEN two devices change one work's progress concurrently, THEN the work SHALL end with one device's complete set of L, count-up, confirmation time and estimate flag, and one device's complete override with its moment, never a mix of the two devices' values within either set.  ++### 8. Backup archive++**User Story:** As a reader, I want a backup to keep my progress, so that a restore does not lose it.++**Acceptance Criteria:**++1. <a name="8.1"></a>An exported archive SHALL carry every work's L, count-up, confirmation time, estimate flag, override and override moment, and SHALL be marked archive pair 16/17.  +2. <a name="8.2"></a>Importing a 16/17 archive SHALL apply these fields under [7](#7.1) and SHALL NOT replace a local value with an older one.  +3. <a name="8.3"></a>A 15/16 archive SHALL be refused by its version before anything is written.  +4. <a name="8.4"></a>Importing the same archive twice SHALL change nothing the second time.  ++### 9. Schema conversion++**User Story:** As a reader updating the app, I want my library carried across unchanged, so that nothing is lost when the schema moves.++**Acceptance Criteria:**++1. <a name="9.1"></a>A library last opened by a V16 build SHALL open under this build with every row and field it held intact, and every work SHALL read as no L, count-up on, no confirmation time, estimate flag off and no override.  +2. <a name="9.2"></a>A library last opened by a build older than V16 SHALL be refused, as today, without being changed.  +3. <a name="9.3"></a>The share extension SHALL open a converted library and capture into it, and SHALL NOT read or write any field this spec adds.  ++### 10. Performance++**User Story:** As a reader opening Today, I want the progress to cost nothing I can notice, so that Today stays quick.++**Acceptance Criteria:**++1. <a name="10.1"></a>On the M4 performance fixture, with every catch-up work carrying an L and an override, the `todayPublication` arm's median SHALL stay under its 2 s budget.  +2. <a name="10.2"></a>The change in that arm SHALL be measured as a before/after pair on one host, at least three runs each, and recorded in the feature's verification run.  
specs/catch-up-progress/runbook.md Added +28 / -0
diff --git a/specs/catch-up-progress/runbook.md b/specs/catch-up-progress/runbook.mdnew file mode 100644index 00000000..9270a1ea--- /dev/null+++ b/specs/catch-up-progress/runbook.md@@ -0,0 +1,28 @@+# Runbook: Catch-up Progress two-device check++Verifies Req 7.7 and the design's second risk: a concurrent edit to one work's progress on two devices leaves one device's whole confirmed set and one device's whole override, never a mix.++`Development` only. Both installs join the shared dev library through CloudKit.++## Setup++1. Two devices signed into the same iCloud account, each with a `Development` build of this branch installed (an agent can do the installs; they need no approval).+2. On one device, pick a work on Catching up with release days, and let both devices show it on Today.++## Steps++1. Put both devices in airplane mode.+2. Device A: open the work's `Set latest…`, set latest **50**, leave count-up **on**, set your last chapter to **30**, Save.+3. Device B: open the same sheet, set latest **40**, turn count-up **off**, clear your last chapter, Save.+4. Take both devices off airplane mode and leave both in the foreground for two minutes.+5. On each device, open the sheet for the work and note latest, count-up and last-chapter source.++## Pass++- Both devices show the same values.+- Latest and count-up come from the same device: 50 with count-up on, or 40 with count-up off. Never 50 with off, or 40 with on.+- The last chapter is either A's 30 (`set by you`) or B's clear (a note's title), never 30 with B's timing or a mix.++## If it fails++Record what each device showed and stop: the design's fallback is immutable confirmation records (Decision 5's third alternative), which is a follow-up spec before this ships to `Personal`.
specs/catch-up-progress/tasks.md Added +235 / -0
diff --git a/specs/catch-up-progress/tasks.md b/specs/catch-up-progress/tasks.mdnew file mode 100644index 00000000..84a448fd--- /dev/null+++ b/specs/catch-up-progress/tasks.md@@ -0,0 +1,235 @@+---+references:+    - specs/catch-up-progress/requirements.md+    - specs/catch-up-progress/design.md+    - specs/catch-up-progress/decision_log.md+---+# Catch-up Progress++## Baseline++- [ ] 1. Record the before measurement of the todayPublication arm <!-- id:9jd85vl -->+  - Run `make test-performance-m4` filtered to `M4ToleratedScalePerformanceTests` todayPublication, at least three runs, on this branch before any Core change lands+  - Record medians and spread in `specs/catch-up-progress/verification-run.md`, not in this file+  - Host only: no device, no Personal build+  - Stream: 1+  - Requirements: [10.2](requirements.md#10.2)+  - References: CLAUDE.md, docs/agent-notes/testing.md++## Core values++- [ ] 2. Write tests for millisecond conversion, the progress record codec and the fold <!-- id:9jd85vm -->+  - `CatchUpRecordTests`: `MillisecondInstant.milliseconds` and `date(fromMilliseconds:)` agree with `quantize` at floating-point edges+  - Codec round-trip through `JSONBlob`; `LastChapterOverride` wire keys `kind`, `number`, `atMilliseconds` pinned by golden bytes; unknown `kind` and garbage decode to nil+  - Fold: every permutation of 2 to 4 generated records elects the same result; `elect([elect(x)]) == elect(x)`; nil confirmation loses; newer clear beats older value; tie direction per design+  - Stream: 1+  - Requirements: [7.1](requirements.md#7.1), [7.2](requirements.md#7.2), [7.3](requirements.md#7.3), [7.7](requirements.md#7.7), [8.4](requirements.md#8.4)+  - References: specs/catch-up-progress/design.md++- [ ] 3. Implement MillisecondInstant helpers and CatchUpRecord with its codec and fold <!-- id:9jd85vn -->+  - `RepositoryClock.swift`: `milliseconds(_:)` and `date(fromMilliseconds:)` with `quantize`'s snap-then-floor rule, the only conversion anywhere+  - New `CatchUpRecord.swift`: `CatchUpConfirmation`, `LastChapterOverride` with hand-written coding, `CatchUpRecord` with `pristine`, `CatchUpFold.elect`+  - Encode and decode through `JSONBlob` in `Models.swift`+  - Blocked-by: 9jd85vm (Write tests for millisecond conversion, the progress record codec and the fold)+  - Stream: 1+  - Requirements: [7.1](requirements.md#7.1), [7.2](requirements.md#7.2), [7.3](requirements.md#7.3), [7.7](requirements.md#7.7)+  - References: Packages/AsterismCore/Sources/AsterismCore/RepositoryClock.swift, Packages/AsterismCore/Sources/AsterismCore/Models.swift++- [ ] 4. Write tests for ChapterNumber, NumberedNote and CatchUpProgress <!-- id:9jd85vo -->+  - `CatchUpProgressTests` table: each state; override value, cleared and none; re-share moves `lastSharedAt` but not R; note above R after the override; latest below R+  - Decision 3 stall case and the save-45-sees-75 case; clock ahead; count-up off; status not ongoing; no release days; cap at 9,999; read-day ties per Q24+  - DST weeks in Europe/Amsterdam and Australia/Sydney; `rebased` returns nil without a latest and sets the estimate flag otherwise+  - `ChapterNumber.whole` rejects multi-part and out-of-range numbers+  - Blocked-by: 9jd85vn (Implement MillisecondInstant helpers and CatchUpRecord with its codec and fold)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.2](requirements.md#1.2), [1.3](requirements.md#1.3), [1.4](requirements.md#1.4), [1.5](requirements.md#1.5), [1.6](requirements.md#1.6), [1.7](requirements.md#1.7)+  - References: Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift++- [ ] 5. Implement ChapterNumber, NumberedNote and CatchUpProgress <!-- id:9jd85vp -->+  - New `ChapterNumber.swift`; delete `TodayDayPlan`'s private `chapterNumber(of:)` and call the new one+  - New `CatchUpProgress.swift`: `NumberedNote.from([EntrySnapshot])` carrying the source title, `build(record:notes:releaseDays:workStatus:day:calendar:)`, `build(work:day:calendar:)`, `rebased`+  - Reuse `TodayDayPlan.releaseCount`, widening its access if needed+  - Blocked-by: 9jd85vo (Write tests for ChapterNumber, NumberedNote and CatchUpProgress)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.2](requirements.md#1.2), [1.3](requirements.md#1.3), [1.4](requirements.md#1.4), [1.5](requirements.md#1.5), [1.6](requirements.md#1.6), [1.7](requirements.md#1.7)+  - References: Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift++## Schema V17++- [ ] 6. Freeze V16, add V17 with the two blob columns and retire V15 <!-- id:9jd85vq -->+  - One commit, every commit compiling: freeze `AsterismSchemaV16` verbatim with its frozen referents; add `AsterismSchemaV17.swift` and `AsterismV17MigrationPlan` `[V16, V17]`; point the `Models.swift` extension and typealiases at V17+  - `Work` adds `catchUpConfirmationData: Data? = nil` and `lastChapterOverrideData: Data? = nil` after `releaseDaysRaw`+  - Delete `AsterismSchemaV15.swift`, `V15RecordedStoreFixture`, `V15RecordedStoreTests`; add `V16RecordedStoreFixture/Tests` asserting the raw columns are nil after conversion; rename every test `Schema(versionedSchema:)` reference and grep-gate the rest+  - Markers: app `[16, 17]`, lagging `16`, extension `17`; move the lagging arm in `act(on:)`; `MarkerGenerationSeventeenTests`; `MarkerContractTests`; `BackupImportGates` scratch schema; `LibraryRepository+EmptyLibrary` models list+  - `ModelContractTests` delta pin: V17 `Work` is V16 plus exactly the two optional `Data` columns; hand-edit `library-graph-baseline.txt` and pass `LibraryGraphBaselineTests`; `FrozenLibraryPathTests` unchanged+  - Open the self-clearing `withKnownIssue` on `envelopeVersionsFollowTheLiveSchema`; update the CLAUDE.md live-schema paragraph+  - Blocked-by: 9jd85vn (Implement MillisecondInstant helpers and CatchUpRecord with its codec and fold)+  - Stream: 1+  - Requirements: [9.1](requirements.md#9.1), [9.2](requirements.md#9.2), [9.3](requirements.md#9.3)+  - References: docs/agent-notes/schema-migration.md, specs/retire-migration-chain/library-graph-baseline.txt++- [ ] 7. Write tests for CatchUpWriter and the elected snapshot record <!-- id:9jd85vr -->+  - `CatchUpWriter.apply` writes only where the decoded value differs and reports whether it wrote; a second apply writes nothing+  - A split same-UUID group presents the elected record, not the carrier's; `snapshot(_:)` decodes the row's blobs; an undecodable blob reads as pristine+  - `WorkAuthoredContent` and variant IDs are unchanged by progress-only differences+  - Blocked-by: 9jd85vq (Freeze V16, add V17 with the two blob columns and retire V15)+  - Stream: 1+  - Requirements: [7.1](requirements.md#7.1), [7.5](requirements.md#7.5), [7.6](requirements.md#7.6)++- [ ] 8. Implement CatchUpWriter, WorkSnapshot.catchUp and elected group rebuilds <!-- id:9jd85vs -->+  - `WorkSnapshot.catchUp` as a defaulted init parameter+  - `LibraryRepository.snapshot(_:)` near :2032; both rebuilds in `LibraryRepository+Groups.swift` near :414 and :433 elect over the group's rows+  - Blocked-by: 9jd85vr (Write tests for CatchUpWriter and the elected snapshot record)+  - Stream: 1+  - Requirements: [7.1](requirements.md#7.1), [7.5](requirements.md#7.5), [7.6](requirements.md#7.6)+  - References: Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Groups.swift++## Repository writes++- [ ] 9. Write tests for catchUpSheetState, commitCatchUpProgress and setReadingStatus <!-- id:9jd85vt -->+  - Sheet state is a fresh read: record, progress for the given day, R's source title+  - Commit writes the confirmation with the clock's milliseconds and the flag off, the override only when edited, to every row; bumps `modifiedAt`; refuses `.conflict` on a changed record, torn groups, and numbers outside 0 to 9,999; `.clear` stores a cleared override+  - `setReadingStatus` refuses when the status is not the expected one and on torn groups; writes nothing else+  - Blocked-by: 9jd85vp (Implement ChapterNumber, NumberedNote and CatchUpProgress), 9jd85vs (Implement CatchUpWriter, WorkSnapshot.catchUp and elected group rebuilds)+  - Stream: 1+  - Requirements: [3.2](requirements.md#3.2), [3.4](requirements.md#3.4), [4.3](requirements.md#4.3), [4.6](requirements.md#4.6), [4.8](requirements.md#4.8), [4.9](requirements.md#4.9), [4.10](requirements.md#4.10)++- [ ] 10. Implement the catch-up repository calls <!-- id:9jd85vu -->+  - New `LibraryRepository+CatchUpProgress.swift`; resolve targets through `resolveWorkWriteTarget` and `tornRefusal` as `updateWork` does+  - One locked context and one `saveStrategy.save` per call+  - Blocked-by: 9jd85vt (Write tests for catchUpSheetState, commitCatchUpProgress and setReadingStatus)+  - Stream: 1+  - Requirements: [3.2](requirements.md#3.2), [3.4](requirements.md#3.4), [4.3](requirements.md#4.3), [4.6](requirements.md#4.6), [4.8](requirements.md#4.8), [4.9](requirements.md#4.9), [4.10](requirements.md#4.10)+  - References: Packages/AsterismCore/Sources/AsterismCore/LibraryRepository.swift++- [ ] 11. Write tests for the rebase in updateWork <!-- id:9jd85vv -->+  - Fires when status crosses ongoing in either direction and when canonical release days change; not on raw-only spelling differences, not without a latest+  - Stores E under the pre-save settings for the calendar's current day, confirmation now, estimate flag on+  - A refused metadata commit leaves the record unchanged+  - Blocked-by: 9jd85vu (Implement the catch-up repository calls)+  - Stream: 1+  - Requirements: [5.3](requirements.md#5.3)++- [ ] 12. Implement the rebase and the required calendar parameter on updateWork <!-- id:9jd85vw -->+  - `updateWork(id:basis:draft:calendar:)`; update every call site in Core, the app and both test targets+  - Entry snapshots built with the same bucketing `todaySchedule` uses; the fetch runs only when the trigger fires; write with `CatchUpWriter` in the same save+  - `AppLibraryModel` passes its published calendar+  - Blocked-by: 9jd85vv (Write tests for the rebase in updateWork)+  - Stream: 1+  - Requirements: [5.3](requirements.md#5.3)+  - References: Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+TodayPresentation.swift++## Convergence and archive++- [ ] 13. Write tests for the fold on convergence, collapse, resolution and merge <!-- id:9jd85vx -->+  - Progress-only divergence in a same-UUID group converges and a second pass writes nothing+  - Collapse carries the elected record; a confirmation written to a loser and one written to the survivor between the write phase and deletion both survive; equal timestamps+  - `resolveWorkSet` and the work-merge commit carry the elected record whatever variant the reader chose+  - Blocked-by: 9jd85vs (Implement CatchUpWriter, WorkSnapshot.catchUp and elected group rebuilds)+  - Stream: 2+  - Requirements: [7.1](requirements.md#7.1), [7.2](requirements.md#7.2), [7.3](requirements.md#7.3), [7.4](requirements.md#7.4), [7.5](requirements.md#7.5), [7.6](requirements.md#7.6)++- [ ] 14. Implement the fold in the Work pass, the deletion commit, resolveWorkSet and the merge commit <!-- id:9jd85vy -->+  - `DuplicateReconciler` beside `apply(carrier, to: survivor, types:)` near :568, and `carryCatchUp` beside `carrySeries`/`carryThumbnail` near :1305+  - `LibraryRepository+DuplicateResolution.resolveWorkSet` and `LibraryRepository+WorkMerge` commit+  - Blocked-by: 9jd85vx (Write tests for the fold on convergence, collapse, resolution and merge)+  - Stream: 2+  - Requirements: [7.1](requirements.md#7.1), [7.2](requirements.md#7.2), [7.3](requirements.md#7.3), [7.4](requirements.md#7.4), [7.5](requirements.md#7.5), [7.6](requirements.md#7.6)+  - References: Packages/AsterismCore/Sources/AsterismCore/DuplicateReconciler.swift++- [ ] 15. Write tests for the 16/17 archive <!-- id:9jd85vz -->+  - Round-trip of all six flat fields; mapping of cleared override, missing confirmation time, missing override moment+  - Import older, newer, equal and torn: the fold runs before both guards, bumps no `modifiedAt`, does not enter `applied`; importing twice changes nothing+  - A 15/16 archive is refused before any write; golden `backup-16-17-golden.json`; undecodable blob refuses export by name+  - Blocked-by: 9jd85vs (Implement CatchUpWriter, WorkSnapshot.catchUp and elected group rebuilds)+  - Stream: 2+  - Requirements: [7.4](requirements.md#7.4), [8.1](requirements.md#8.1), [8.2](requirements.md#8.2), [8.3](requirements.md#8.3), [8.4](requirements.md#8.4)+  - References: Packages/AsterismCore/Tests/AsterismCoreTests/BackupGoldenExportTests.swift++- [ ] 16. Implement BackupV16 and the import fold, and close the envelope window <!-- id:9jd85w0 -->+  - Replace the `BackupV15` types, codec and exporter with `BackupV16`; `formatVersion 16`, `schemaVersion 17`; `supportedVersions (16, 17)`+  - Fold in `ConfirmImport.commitWorks` before the torn and `modifiedAt` guards; `ArchiveRecordBuilders.makeWork` sets the blobs+  - Re-record the golden with `ASTERISM_RECORD_GOLDEN=1`; remove the envelope `withKnownIssue`; add the import-fold line to CLAUDE.md Sync and the 16/17 archive generation+  - Blocked-by: 9jd85vz (Write tests for the 16/17 archive)+  - Stream: 2+  - Requirements: [7.4](requirements.md#7.4), [8.1](requirements.md#8.1), [8.2](requirements.md#8.2), [8.3](requirements.md#8.3), [8.4](requirements.md#8.4)+  - References: Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+ConfirmImport.swift++## Today derivation++- [ ] 17. Write tests for progress on release and catch-up rows <!-- id:9jd85w1 -->+  - `ReleaseRow.progress` for the selected day; `lastChapter` is R so the shelf badge follows the override and ignores re-shares+  - The unknown line's chapter and day come from R and r where R is known+  - Future days compute estimates for that day+  - Blocked-by: 9jd85vp (Implement ChapterNumber, NumberedNote and CatchUpProgress), 9jd85vs (Implement CatchUpWriter, WorkSnapshot.catchUp and elected group rebuilds)+  - Stream: 1+  - Requirements: [1.2](requirements.md#1.2), [2.3](requirements.md#2.3), [2.5](requirements.md#2.5)+  - References: Packages/AsterismCore/Tests/AsterismCoreTests/TodayDayPlanTests.swift++- [ ] 18. Implement progress in todaySchedule, ScheduledWork and ReleaseRow <!-- id:9jd85w2 -->+  - `ScheduledWork` gains `catchUp`, `numberedNotes`, `workStatus`, built in the same walk as `notedDays` inside the locked read+  - Blocked-by: 9jd85w1 (Write tests for progress on release and catch-up rows)+  - Stream: 1+  - Requirements: [1.2](requirements.md#1.2), [2.3](requirements.md#2.3), [2.5](requirements.md#2.5)++- [ ] 19. Write tests for the catch-up fixture writer and the seeded fixtures <!-- id:9jd85w3 -->+  - `TodayFixtureTests`: one exact, one estimated and one caught-up catch-up work with past confirmation times+  - `M4ScaleFixtureTests`: every catch-up work in the schedule layer carries a latest and an override+  - Blocked-by: 9jd85w2 (Implement progress in todaySchedule, ScheduledWork and ReleaseRow)+  - Stream: 1+  - Requirements: [10.1](requirements.md#10.1)++- [ ] 20. Implement CatchUpFixtureWriter and seed TodayFixture and the M4 schedule layer <!-- id:9jd85w4 -->+  - `#if DEBUG || ASTERISM_PERFORMANCE_TESTING`; writes a record with a caller-given confirmation time+  - `AppLibraryModel.seedTodayWork` and `seedM4ScheduleLayer`+  - Blocked-by: 9jd85w3 (Write tests for the catch-up fixture writer and the seeded fixtures)+  - Stream: 1+  - Requirements: [10.1](requirements.md#10.1)+  - References: Packages/AsterismCore/Sources/AsterismCore/M4PerformanceFixture.swift++## App++- [ ] 21. Write tests for CatchUpText states, plurals, labels and ordering <!-- id:9jd85w5 -->+  - Singular and plural chapter words; the `as of` suffix only after 7 days; exact, estimated, caught-up and unknown labels+  - Ordering: exact and estimated by behind, then caught up, then unknown by read day, ties in title order+  - Banner text and primary button label per work status+  - Blocked-by: 9jd85w2 (Implement progress in todaySchedule, ScheduledWork and ReleaseRow)+  - Stream: 3+  - Requirements: [2.1](requirements.md#2.1), [2.2](requirements.md#2.2), [2.3](requirements.md#2.3), [2.4](requirements.md#2.4), [2.5](requirements.md#2.5), [2.7](requirements.md#2.7), [3.1](requirements.md#3.1)+  - References: Asterism/AsterismTests/TodayShelfTextTests.swift++- [ ] 22. Implement the card rows, row menu and caught-up banner <!-- id:9jd85w6 -->+  - `TodayText.swift` and `TodaySections.swift`; 4 pt bar hidden from VoiceOver; menu and banner on the current day only+  - Banner uses `constellationCard` with secondary and tertiary button styles; Move to Reading and Mark Finished go through `AppLibraryModel.setReadingStatus`+  - Blocked-by: 9jd85w5 (Write tests for CatchUpText states, plurals, labels and ordering), 9jd85vu (Implement the catch-up repository calls)+  - Stream: 3+  - Requirements: [2.1](requirements.md#2.1), [2.2](requirements.md#2.2), [2.3](requirements.md#2.3), [2.4](requirements.md#2.4), [2.5](requirements.md#2.5), [2.6](requirements.md#2.6), [2.7](requirements.md#2.7), [3.1](requirements.md#3.1), [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [3.4](requirements.md#3.4), [3.5](requirements.md#3.5), [3.6](requirements.md#3.6), [6.1](requirements.md#6.1), [6.3](requirements.md#6.3)+  - References: Asterism/Asterism/Views/TodaySections.swift++- [ ] 23. Write SetLatestModel unit tests and the Today and work page UI tests <!-- id:9jd85w7 -->+  - Model: prefill E, R or empty; estimated mark while E differs from L or the flag is on and untouched; behind caption including equal and below; switch hidden without release days; override edit maps to set or clear; conflict keeps drafts+  - UI on the seeded Today fixture: exact, estimated and unknown rows; banner Move to Reading and Not yet; sheet Save and Cancel; work page row and its absence in edit mode; no banner on another day; accessibility text size+  - Identifiers: `today-set-latest-sheet`, `today-catchup-banner-<id>`, `work-detail-latest-released`+  - Blocked-by: 9jd85w6 (Implement the card rows, row menu and caught-up banner), 9jd85w4 (Implement CatchUpFixtureWriter and seed TodayFixture and the M4 schedule layer), 9jd85vw (Implement the rebase and the required calendar parameter on updateWork)+  - Stream: 3+  - Requirements: [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [4.1](requirements.md#4.1), [4.3](requirements.md#4.3), [4.4](requirements.md#4.4), [4.5](requirements.md#4.5), [4.6](requirements.md#4.6), [4.7](requirements.md#4.7), [4.8](requirements.md#4.8), [4.9](requirements.md#4.9), [4.10](requirements.md#4.10), [5.1](requirements.md#5.1), [5.2](requirements.md#5.2), [6.2](requirements.md#6.2), [6.3](requirements.md#6.3)+  - References: Asterism/AsterismUITests/TodayUITests.swift++- [ ] 24. Implement SetLatestModel, SetLatestSheet, its route, the work page row and the AppLibraryModel calls <!-- id:9jd85w8 -->+  - `ViewModels/SetLatestModel.swift`, `Views/SetLatestSheet.swift`; `presentedSetLatest` on `AppNavigation`, presented on `ContentView` beside `presentedAnnouncement`+  - Work page row in the status line near `WorkDetailView.swift:712`, hidden in edit mode+  - `AppLibraryModel.commitCatchUpProgress` and `setReadingStatus` refresh Today like the existing write helpers+  - Blocked-by: 9jd85w7 (Write SetLatestModel unit tests and the Today and work page UI tests)+  - Stream: 3+  - Requirements: [4.1](requirements.md#4.1), [4.2](requirements.md#4.2), [4.3](requirements.md#4.3), [4.4](requirements.md#4.4), [4.5](requirements.md#4.5), [4.6](requirements.md#4.6), [4.7](requirements.md#4.7), [4.8](requirements.md#4.8), [4.9](requirements.md#4.9), [4.10](requirements.md#4.10), [5.1](requirements.md#5.1), [5.2](requirements.md#5.2), [6.2](requirements.md#6.2), [6.3](requirements.md#6.3)+  - References: Asterism/Asterism/ContentView.swift++## Verification++- [ ] 25. Record the after measurement and compare it with the baseline <!-- id:9jd85w9 -->+  - Same filter and host conditions as task 1, at least three runs, with the seeded M4 layer+  - The arm stays under its 2 s budget; record both sets and the delta in `verification-run.md`+  - If the delta is material, apply the design's suffix-maximum fallback and re-measure+  - Blocked-by: 9jd85vl (Record the before measurement of the todayPublication arm), 9jd85w2 (Implement progress in todaySchedule, ScheduledWork and ReleaseRow), 9jd85w4 (Implement CatchUpFixtureWriter and seed TodayFixture and the M4 schedule layer)+  - Stream: 1+  - Requirements: [10.1](requirements.md#10.1), [10.2](requirements.md#10.2)
specs/update-schedule/decision_log.md Modified +5 / -5
diff --git a/specs/update-schedule/decision_log.md b/specs/update-schedule/decision_log.mdindex f1dc3715..1d020796 100644--- a/specs/update-schedule/decision_log.md+++ b/specs/update-schedule/decision_log.md@@ -18,7 +18,7 @@ | Q12 | 2026-09-15 | Today's publication inherits Recent's 2 s host budget over the M4 fixture, which gains release days on a third of its works | The same screen's replacement over the same rows; a fixture with no release days would pass the arm without exercising the feature | | Q13 | 2026-09-15 | The bump opens markers `14` and `15` only; the owner confirms every device on `14` before the freeze commit | One frozen snapshot and a `[V(n-1), V(n)]` plan is the standing rule; keeping `13` openable would need a second snapshot and a two-stage chain, which `retire-migration-chain` removed. `work-creators` Q15, `place-extraction` Q48 and `work-thumbnails` verified first and substituted; V9→V10 retired one commit late and the note records it as the trap | | Q14 | 2026-09-15 | Noted day is the `lastSharedAt` day, as Recent groups today; a re-share moves an entry to the day it was re-shared | Inherited deliberately: the design document's "lastSharedAt drives Recent — re-reads are reading activity". Grouping on `firstCapturedAt` would change Recent's semantics too and is a separate decision if ever wanted |-| Q15 | 2026-09-15 | Strip dots mark the weekly pattern on every displayed week, past weeks included, and the past-day header reads `Releasing {weekday}` rather than `Released` | Nothing records that a release happened (Non-Goals); a dot suppressed in past weeks, or a header in the past tense, would assert an event the app never observed |+| Q15 | 2026-09-15 | Strip dots mark the weekly pattern on every displayed week, past weeks included, and the past-day header reads `Releasing {weekday}` rather than `Released` | Nothing records that a release happened (Non-Goals); a dot suppressed in past weeks, or a header in the past tense, would assert an event the app never observed **Dots superseded 2026-09-27** by the Today v2 redesign (`docs/Asterism-Today-v2.md` §2): the strip carries no dots. | | Q16 | 2026-09-15 | `{when}` on a release row is a closed table: `yesterday`, `{n} days ago` (2–6), `last week` (7–13), `{n} weeks ago` (14–27, whole weeks), the abbreviated date beyond, and the abbreviated date whenever the noted day is later than the selected day | No relative-date formatter exists to point at, and a forward-relative phrase on a past day reads as nonsense | | Q17 | 2026-09-15 | The strip narrows its cells so seven fit the 320 pt list column, and wraps only at the accessibility sizes | Restated with the hit-target deviation made explicit in Q26 | | Q18 | 2026-09-15 | The strip is a component of its own borrowing the segmented capsule's selected colours, not a use of `ConstellationSegmentedControl` | The shared control stacks full width at accessibility sizes; the strip wraps into two rows, which the control cannot do |@@ -37,7 +37,7 @@ | Q31 | 2026-09-15 | No count on a releases header | Owner's pick; `ConstellationSectionHeader` is one static text for the UI suites' sake, and a count folded into the string bought little | | Q32 | 2026-09-15 | The selected day lives in `AppNavigation` as `TodaySelection`, `.current` or `.day(Date)`, not as view state | It must survive a push and a tab switch, and `.current` is Req 3.7's "was the day that had been current" with no clock bookkeeping: a day change has nothing to move | | Q33 | 2026-09-15 | The 100-row cap, its footer and `RecentRowCap` are deleted outright, not bypassed | The cap is app-layer presentation logic over a DTO that already carries every day; a Today screen has no capped view to fall back to |-| Q34 | 2026-09-15 | The release row is a sibling of `WorkRow`, sharing its glyph, title, type-tag and knock-down assembly through one extracted `WorkRowHeader`, not a `WorkRow` mode | Its second line is the schedule line, not series and status; an extracted header keeps the two rows from drifting without a flag on `WorkRow` |+| Q34 | 2026-09-15 | The release row is a sibling of `WorkRow`, sharing its glyph, title, type-tag and knock-down assembly through one extracted `WorkRowHeader`, not a `WorkRow` mode | Its second line is the schedule line, not series and status; an extracted header keeps the two rows from drifting without a flag on `WorkRow` **Narrowed 2026-09-27** by Today v2 §4: the release row is drawn at the accessibility sizes only; the releasing shelf takes the others. | | Q35 | 2026-09-15 | Weekday toggles and the strip cells wrap through the existing `FlowLayout` at accessibility sizes | It is the layout the meta line already wraps with | | Q36 | 2026-09-15 | The archive decodes the day list into the typed `[ReleaseDay]`, so an unknown spelling fails decoding and the archive is refused as malformed | Req 8.1 asks for exactly that, and it is how `workStatus` is typed on the wire already | | Q37 | 2026-09-15 | Release rows draw the work's cover through the shared `WorkRowHeader` | A release row and a Works row are the same work; a cover on one and not the other would read as two different works |@@ -72,7 +72,7 @@ | Q66 | 2026-09-16 | The day chrome (caption, week row, 4 + 3 strip) stays **fixed** above the `List` at every text size, and the accessibility journeys reach a noted row by scrolling **inside the list** rather than asserting it above the fold | The chrome is the screen's day selector: a reader at `AccessibilityXXXL` who scrolled it away could no longer change the day, and Req 4.3's controls would be reachable only by scrolling back up. So "the rows are reachable" at an accessibility size means reachable by scrolling, which is the house rule for every lazy `List` already (`docs/agent-notes/testing.md`), and the two journeys that counted rows without scrolling — `WideLayoutAccessibilityUITests.testAccessibilityXXXLOpensCollapsedWithTheWiderListColumn` and `AccessibilityJourneyUITests.testDarkReduceTransparencyLargestDynamicTypeKeepsPrimaryJourneysReachable` — were asserting where the fold is. **Measured while fixing them**, on a 402 × 874 phone window at `AccessibilityXXXL`: the large title, the search field, the two-line caption, the week row, the wrapped strip and the untaught banner leave the `List` a sliver at the foot of the screen, so `app.swipeUp()` starts inside the *fixed* chrome and scrolls nothing at all — the gesture has to be the list's own (`recent-list` on the phone, the list column on the iPad), and with it the row is reached in one swipe. Three things the same measurement showed and that this decision does **not** settle: at that size the week row's date range and the strip's cells are drawn overlapping each other, because the `VStack` compresses a chrome that wants more height than the window has; the day's releases section is then behind the floating tab bar; and in the *wide* tree, where a 1210 × 834 landscape window leaves `recent-list` a **186.5 pt** viewport inside the 420 pt column, one noted row is taller than that viewport, so the list bottoms out with the row's Teach pill above its top edge and no gesture brings the pill on screen — `WideLayoutAccessibilityUITests.testAccessibilityXXXLOpensCollapsedWithTheWiderListColumn` is red on exactly that assertion and is left red rather than weakened. The alternative — letting the chrome scroll with the list, so none of the three happens — is the owner's call: it costs the day selector its permanence and nothing in the requirements asks for it, so it was not taken unilaterally. **Superseded by Q69**, which is that call made: at the accessibility sizes the chrome scrolls with the list and all three of the unsettled things above go with it; at every other size this row still describes what ships | | Q67 | 2026-09-16 | The compact Today tab is asserted by its **label**, and `sidebar-today` carries the wide half | An `.accessibilityIdentifier` on a SwiftUI `Tab` never reaches the tab-bar button XCUI sees (`docs/agent-notes/testing.md`), so `tab-today` as declared in `CompactRootView` is inert on the phone and a journey asserting it would fail for a reason that says nothing about the tab. The identifier is left in place — it costs nothing and documents the intent — and the sidebar row, which is an ordinary `Button` and does carry its identifier, is asserted by `WideLayoutUITests` where a sidebar exists | | Q68 | 2026-09-16 | Task 26's "a related-work tap inside that work stays on Today" is exercised through a **chapter** tap | The `today` fixture seeds no `WorkLink` — one capture and one work each — and a work with no links draws no related-works section at all (`series-and-related-works`), so the row the task names is unreachable from that launch. Both routes go through one mechanism: `AppScreens.route(_:on:)` captures `.today` at construction and every work-page callback (`showChapter`, `pushWork`, `showSeries`, `showCreator`) appends to that stack's path through the captured value, so the chapter arm asserts the same claim. Seeding a link instead would move the row and release counts the other cases assert, which is task 25's shape rather than task 26's |-| Q69 | 2026-09-16 | The day chrome (caption, week row, 4 + 3 strip) and the banners are **fixed above the `List` at every non-accessibility size and drawn as the list's own top content at every accessibility size**, so the whole screen scrolls as one exactly where the chrome no longer fits | Q66 left the fixed composition in place and named three things it costs, all measured again here on `Development` launches of `seeded-m1` at `UICTContentSizeCategoryAccessibilityXXXL`: on a 402 × 874 phone the `VStack` compressed a chrome that wanted more height than the window had, so the week row's date range and the strip's cells were drawn overlapping each other and the releases header sat partly behind the tab bar; on a 1210 × 834 landscape iPad the list column ran y 157–814 with the chrome to y 478, leaving `recent-list` a **186.5 pt** viewport — shorter than one noted row — so the row's Teach pill stayed above the viewport's top edge through eight swipes and `WideLayoutAccessibilityUITests.testAccessibilityXXXLOpensCollapsedWithTheWiderListColumn` was red on that assertion. Overlapping text and an unreachable control are Req 10.2 and 10.4 failures — wrap, never shrink or truncate — and no gesture cleared either, so the permanence of the day selector is what had to give, and only where it cannot be had: the branch is `dynamicTypeSize.isAccessibilitySize`, the same one `WeekStrip` already wraps 4 + 3 on, so one setting decides both and every non-accessibility size draws exactly what it drew before (Req 4.1). A `List` row takes its content's ideal height, so nothing compresses once the chrome is inside the list and the overlap is gone with it; the rows are `constellationListRow` with zero insets and no separator, so each piece keeps the padding it already carried. Every identifier and label is unchanged, and the two journeys that scroll inside `recent-list` still scroll it — it is now the thing the chrome lives in, which is why one swipe reaches the row and the pill both. The search-miss branch draws a `ContentUnavailableView` rather than a `List`, so its banners stay fixed: there is nothing there to scroll with |+| Q69 | 2026-09-16 | The day chrome (caption, week row, 4 + 3 strip) and the banners are **fixed above the `List` at every non-accessibility size and drawn as the list's own top content at every accessibility size**, so the whole screen scrolls as one exactly where the chrome no longer fits | Q66 left the fixed composition in place and named three things it costs, all measured again here on `Development` launches of `seeded-m1` at `UICTContentSizeCategoryAccessibilityXXXL`: on a 402 × 874 phone the `VStack` compressed a chrome that wanted more height than the window had, so the week row's date range and the strip's cells were drawn overlapping each other and the releases header sat partly behind the tab bar; on a 1210 × 834 landscape iPad the list column ran y 157–814 with the chrome to y 478, leaving `recent-list` a **186.5 pt** viewport — shorter than one noted row — so the row's Teach pill stayed above the viewport's top edge through eight swipes and `WideLayoutAccessibilityUITests.testAccessibilityXXXLOpensCollapsedWithTheWiderListColumn` was red on that assertion. Overlapping text and an unreachable control are Req 10.2 and 10.4 failures — wrap, never shrink or truncate — and no gesture cleared either, so the permanence of the day selector is what had to give, and only where it cannot be had: the branch is `dynamicTypeSize.isAccessibilitySize`, the same one `WeekStrip` already wraps 4 + 3 on, so one setting decides both and every non-accessibility size draws exactly what it drew before (Req 4.1). A `List` row takes its content's ideal height, so nothing compresses once the chrome is inside the list and the overlap is gone with it; the rows are `constellationListRow` with zero insets and no separator, so each piece keeps the padding it already carried. Every identifier and label is unchanged, and the two journeys that scroll inside `recent-list` still scroll it — it is now the thing the chrome lives in, which is why one swipe reaches the row and the pill both. The search-miss branch draws a `ContentUnavailableView` rather than a `List`, so its banners stay fixed: there is nothing there to scroll with **Superseded 2026-09-27** by Today v2 §3: the header and the chrome scroll with the list at every size. | | Q70 | 2026-09-16 | `ToleratedStateFixture` dates every row it seeds **on the seeding day**, from the repository's own clock, instead of the fixed `1_700_000_000` epoch (2023-11-14) it used before | Task 30's run found four deterministic UI failures with one root cause: the fixture's rows are on a day no launch ever opens, because Today lists one civil day and opens on the current one (Q24, Req 3.1) while Recent listed the whole history. Two fixes were available. **Teaching the four journeys to reach the rows another way** — the duplicate banner or a search, both of which span all days (Q10) — was rejected: it fixes four cases and leaves every other `seeded-tolerated-*` launch showing an empty day, so the next journey written over one of these shapes hits the same wall, and two of the four (`DuplicateResolutionUITests`' torn-group pair) are *about* a row being listed in the day's list, which no filter detour asserts. Moving the origin fixes the shape once, for every present and future journey, and is what `TodayFixture` already does with `backdateEntry`. The blast radius was checked rather than assumed: three Core tests seed this fixture (`WriteSiteRelationshipTests`' relationship, identity and orphan cases) and none of them reads a date, so there was no fixed epoch left to keep — a UI-test-only seeding seam would have been a second code path for no remaining caller. Every offset is unchanged, so the relative order inside each shape is exactly what it was; only the origin moved, and the two-minute lead keeps the whole fixture inside the day it is seeded on | | Q71 | 2026-09-16 | The two `M4ScaleTodayPerformanceUITests` seed-timeout breaches are **not** a budget problem: `seedM4PerformanceFixture` guarded on `capabilities == .m4` and has thrown on every app launch since `multi-site-works` moved `AsterismCapabilities.current` to `.multiSite`. The guard now asks for the feature (`supportsComposedForms`), and `seedTimeout` goes **down**, from 210 s to **90 s** | Measured rather than widened, as task 30 asked. With the timeout temporarily raised to 600 s both cases still failed, at 604.5 s and 604.2 s — so nothing was ever a few seconds short. The simulator's own log named it in one line: `Library bootstrap failed: Invalid input while seeding M4 performance fixture: the composed teaching fixture requires the M4 capability gate`. That is exactly T-1947's lesson, recorded in `docs/agent-notes/testing.md` and then re-committed here — a seeder must guard on the *features* it writes, never on a gate identity — and the Core suites never caught it because they build the repository with `.m4` by hand while only the app reads `.current`. The history is legible in the numbers once you know: 180 s budget → 184 s failure, 210 s budget → 213.9 s and 212.8 s failures. Budget plus the launch, every time; every reading of those as "the seed got slower" (Q81 of `work-thumbnails` included) was measuring the timeout. **With the guard fixed the pair passes in 16.449 / 16.289 s and 14.877 / 14.933 s** over two runs on a quiet host, so the real seed is ~15–16 s and the 195-second seed the old arithmetic reasoned about never existed. 90 s is 5.5× the slowest measured launch — room for the ~4× a contended host has cost individual cases here, and four minutes less wasted when a seeder does throw. The alternative, raising the budget to ~230 s on the theory that `seedM4ScheduleLayer` had cost a few seconds, would have been a number invented to cover a bug: the layer costs **0.68 s** of a 10.9-second host seed (3 samples, 0.678–0.698 s), 6% of it, and nothing like the 4 s the failures appeared to show | | Q72 | 2026-09-16 | `updateWork` writes `work.releaseDays = draft.releaseDays` **unconditionally**, not guarded on the raw column differing from the draft's canonical form | The design's parity table asked for the guard, and it buys nothing: `modifiedAt` is stamped on every row of the group whatever changed, so a Save on a work whose days are untouched dirties the row either way and the guard could only skip one array write. It also costs the clarity of the rule beside it — every other field in that loop lands unconditionally, and a single exception invites the reader to ask which fields are conditional. The Req 1.6 behaviour the guard was reached for holds without it: the draft has no representation for a spelling the toggles cannot draw, so writing through the accessor rewrites a row carrying an unknown value, which is what the requirement asks for. The parity table row is amended to match the code |@@ -83,8 +83,8 @@ | Q77 | 2026-09-16 | `AppNavigation.openWork(_:fromEntry:)` from the Today tab replaces Today's stack with the work at its root, tab unchanged, through `showWork(_:on: .today)`; the Works-tab chapter push and the out-of-tab Works replace from `entry-to-work-link` Q2/Q7 are unchanged | Merged from `main` after the branch: Q2 was written when Recent had no stack of its own, so its "everywhere else replaces the Works stack" sent a reader who opened a note from Today across to the Works tab. A noted row's entry is the whole content of Today's pane, so its work takes the route a release row takes (Q59): the entry clears with the stack and Back returns to the selected day | | Q78 | 2026-09-16 | The Today screen's **date caption** goes: the row between the search field and the week row that spelled the selected day's full date is removed, with `TodayTitleText.caption` and the `today-caption` identifier behind it. The day is named by the **strip's selected cell** and by the **week row's range**, and the week row and the strip are otherwise unchanged. [4.1](requirements.md#4.1)'s caption row is superseded by this row | Owner's decision on the device. Q76 had already taken the page title and the dated section headers on the reasoning that the caption and the strip name the day *in place*; seen on the phone with those gone, the caption was a third spelling of a day the cell marks and the range dates one line below it, and the one of the three that is not also a control. Removing it costs no information — the strip's cell carries the full date in its accessibility label (Req 4.5), so nothing is lost to VoiceOver either — and buys back a row at the top of every day, which is worth most at the accessibility sizes where the caption alone ran to several lines above a strip that already wraps 4 + 3 | | Q79 | 2026-09-16 | The **week row and the strip are one widget**: a chevron at each end spanning its **full height** as a single tappable column, and between them the week's range over seven cells that **fill the width the chevrons leave**. The weekday letter goes from `.caption2` to `.subheadline` and the day number from `.caption` to `.title3`, the vertical padding halves, and Q26's 36 × 44 pt cell becomes a **36 pt floor** with the cell otherwise flexible. Q25's separate week row, the design's `WeekRow`/`WeekStrip` pair and [4.3](requirements.md#4.3)'s 44 × 44 chevron *square* are superseded by this row; the identifiers, labels, traits, both marks and the 4 + 3 accessibility wrap are unchanged | Owner's decision on the device: "the week widget is both taking up too much space and too small. The letters should be bigger and wider. The navigation carets should span the height of the widget as well." Both halves of that are the same fact. Two stacked rows spent a whole line on two chevrons and 16 pt of side padding on a strip that then sat 241 pt wide in the middle of a 402 pt screen, so the cells were pinned at their 36 pt minimum with 80 pt of empty margin either side of them. Folding the range line in beside the cells and giving the chevrons the height instead buys that line back, and letting the cells take the width the chevrons leave spends the margin on them. Measured on `seeded-today` at `iPhone 17 Pro`: the block goes from **112 pt tall with 36 × 44 pt cells** to **≈78 pt tall with 42 × 49 pt cells** — a third shorter with a 15 pt letter over a 20 pt number where it had an 11 pt letter over a 12 pt one. The floor is the thing that needed encoding, because seven 36 pt cells and two 44 pt chevrons want 364 pt and the Mac's and the iPad's list column is 320. A `ViewThatFits` of three arms trades the chevron column and the gap away in that order — 44 pt/2 pt gap inside 4 pt of padding, then 36/2 with none, then 28/1 — and the last one is the fallback whether or not it fits, so nothing below 36 pt is reachable by narrowing alone. Verified on the simulator rather than reasoned: the collapsed iPad column measures 320 pt and takes the third arm, 28 pt chevrons around seven **36.9 pt** cells spanning 264 pt, inside the 288 pt `WideLayoutUITests` asserts and above the 36 pt it asserts per cell. The chevron column narrowing below 44 pt is a smaller deviation than Q26's was and in the other dimension: it spans the whole widget's height, so what it loses at 320 pt is width on a target that is ~50 pt tall, not the target. The wrap branch is untouched and still reads `dynamicTypeSize.isAccessibilitySize` (Q35) — the *width* arm is measured because 320 pt and 402 pt are genuinely different widths, which is not what Q35 refused; at every accessibility size the cells are 44 pt floored and wrap 4 + 3 with the chevrons spanning both rows, the second row carrying one empty column so its three cells are as wide as the first row's four |-| Q80 | 2026-09-16 | The week widget's **range line is a control**: tapping `14 – 20 Sep 2026` returns the selection to the current day, and the widget follows it to the current week, because the week it draws is derived from the day that is selected. It keeps its `.footnote` `secondaryText` typography, its `today-week-range` identifier and its place over the cells; what it gains is a `.plain` `Button`, the accessibility label `{range}, back to today` and the hint `Selects the current day`. Nothing is disabled: on the current week with today selected the tap is a no-op | Owner's decision on the device. Q79 left the widget with two chevrons and no way home — a reader three weeks out pages back three times, and a reader who has lost count has no landmark at all. The line naming the week they are on is where they look for one, and it was the only part of the widget that was not already a control. It costs no space, which is the whole point after Q79 and Q78 spent two rows buying it back, and it needs no new route: `AppScreens` calls the same `selectToday(_:currentDay:)` a cell tap calls, with the current day, so `.current` is stored (Q32) and the widget re-derives the current week from it — the state a launch already opens in. **Disabling it on the current week was rejected**: a control that greys out on the screen it opens on reads as broken rather than as unnecessary, and the reader who taps it there has asked for the state they are in. Putting the range *after* the action in the accessibility label was rejected too — the line's first job is still to say which week is showing, so the action is the clause after it |-| Q81 | 2026-09-16 | The week widget's range line wears a **neutral pill**: §7's genre-tag recipe — `cardFill` inside a 1 pt `cardBorder` at `AsterismLayout.tagRadius` — with 12 pt of horizontal and 5 pt of vertical padding and the label raised one step, `.footnote` → `.subheadline`, still `secondaryText`, still centred and hugging its text. The identifier, the `{range}, back to today` label, the hint and Q80's no-op-undimmed rule are unchanged | Owner's decision on the device: "make the range line look more like something you can click. give it a pill or something as background. you can make it a bit bigger if that works better for the goal." Q80 made the line a control and deliberately left it looking like the caption it had been; on the phone that reads as a caption, because nothing on the screen says a bare line of secondary text can be tapped. **Neutral is the point of the recipe chosen**: cyan is the widget's own *selected* mark, worn by the chosen day one line below, and a cyan range would claim the range is one of the seven things chosen; amber means the reader has something to clear, which a week range never does. The genre tag is the design language's neutral pill and already means "a small thing with a tap on it". It is **borrowed** rather than used through `constellationPill`, exactly as the cells borrow the segmented capsule's selected colours (Q18): that modifier carries its own `.caption` type and a 44 pt minimum frame, and the frame alone would have spent ~28 pt of the height Q79 bought back. Measured on `seeded-today` at `iPhone 17 Pro`: everything below the widget moved down **37 px = 12.3 pt** — the pill's 10 pt of vertical padding plus the ~2.3 pt the type step adds to the line, and nothing else. The type step fits in one line at the default size, and at `AccessibilityXXXL` the pill wraps to two lines and grows with them while the cells still wrap 4 + 3 |+| Q80 | 2026-09-16 | The week widget's **range line is a control**: tapping `14 – 20 Sep 2026` returns the selection to the current day, and the widget follows it to the current week, because the week it draws is derived from the day that is selected. It keeps its `.footnote` `secondaryText` typography, its `today-week-range` identifier and its place over the cells; what it gains is a `.plain` `Button`, the accessibility label `{range}, back to today` and the hint `Selects the current day`. Nothing is disabled: on the current week with today selected the tap is a no-op | Owner's decision on the device. Q79 left the widget with two chevrons and no way home — a reader three weeks out pages back three times, and a reader who has lost count has no landmark at all. The line naming the week they are on is where they look for one, and it was the only part of the widget that was not already a control. It costs no space, which is the whole point after Q79 and Q78 spent two rows buying it back, and it needs no new route: `AppScreens` calls the same `selectToday(_:currentDay:)` a cell tap calls, with the current day, so `.current` is stored (Q32) and the widget re-derives the current week from it — the state a launch already opens in. **Disabling it on the current week was rejected**: a control that greys out on the screen it opens on reads as broken rather than as unnecessary, and the reader who taps it there has asked for the state they are in. Putting the range *after* the action in the accessibility label was rejected too — the line's first job is still to say which week is showing, so the action is the clause after it **Superseded 2026-09-27** by Today v2 §3: the range pill is gone and the header's date title is the way back to today. |+| Q81 | 2026-09-16 | The week widget's range line wears a **neutral pill**: §7's genre-tag recipe — `cardFill` inside a 1 pt `cardBorder` at `AsterismLayout.tagRadius` — with 12 pt of horizontal and 5 pt of vertical padding and the label raised one step, `.footnote` → `.subheadline`, still `secondaryText`, still centred and hugging its text. The identifier, the `{range}, back to today` label, the hint and Q80's no-op-undimmed rule are unchanged | Owner's decision on the device: "make the range line look more like something you can click. give it a pill or something as background. you can make it a bit bigger if that works better for the goal." Q80 made the line a control and deliberately left it looking like the caption it had been; on the phone that reads as a caption, because nothing on the screen says a bare line of secondary text can be tapped. **Neutral is the point of the recipe chosen**: cyan is the widget's own *selected* mark, worn by the chosen day one line below, and a cyan range would claim the range is one of the seven things chosen; amber means the reader has something to clear, which a week range never does. The genre tag is the design language's neutral pill and already means "a small thing with a tap on it". It is **borrowed** rather than used through `constellationPill`, exactly as the cells borrow the segmented capsule's selected colours (Q18): that modifier carries its own `.caption` type and a 44 pt minimum frame, and the frame alone would have spent ~28 pt of the height Q79 bought back. Measured on `seeded-today` at `iPhone 17 Pro`: everything below the widget moved down **37 px = 12.3 pt** — the pill's 10 pt of vertical padding plus the ~2.3 pt the type step adds to the line, and nothing else. The type step fits in one line at the default size, and at `AccessibilityXXXL` the pill wraps to two lines and grows with them while the cells still wrap 4 + 3 **Superseded 2026-09-27** by Today v2 §2: the range pill is gone. | ## Decision 1: Disagreeing release-day sets go to review, not to a set union  **Date**: 2026-09-15

Things to double-check

Mac layout.

The Development Mac app was built and launched but not seen: screenshots need Screen Recording permission. The wide column keeps a Today title above the date header.

Accessibility-size fallback and Show all.

No UI test covers the vertical release rows at AX sizes or the expanded catch-up card.

Today UI suite after the fixes.

Re-run on the simulator after the fixes: 21 of 21 passed. The other UI suites (Announcement, AccessibilityJourney, Search, SitesSettings, iPad) passed before the rebase and review fixes and were not re-run.