Asterism base main 3cd0ebc runtime source d0e4b065 current iPad 29/29 pass final targeted phone 5/5 pass

Pre-push review: selected-day notes export (T2404)

Reuse existing Markdown export for the day selected in Today. Current feature proof is complete under the explicit owner exception.

At a glance

  • Selected capture-day membership uses normalized original capture timestamps and current saved notes/ratings.
  • Existing entry blocks, metadata lookup, staging and native Share/Save adapters are reused.
  • Remote default main verified and preserving rebase completed with identical source and a backup ref.
  • Exact unrelated torn-group retry passed; no unrelated fixture or Environment fix was added.

Verdict

Ready for PR workflow under owner exception

Four independent source reviews found no material issue. Current full iPad 29 and targeted phone 5 pass; all 819 source/build inputs match. The owner forbids another full UI run and explicitly authorizes PR-based merge. The earlier stopped full phone result stays failed/incomplete; manual Mac Save/Cancel is unrun and older full Core/native/Mac results remain source-qualified history.

Review findings

4 raised · 2 fixed · 2 skipped

Jump to findings →

Tests

Pass rate: 100% (34 of 34)

New tests: 30

Diff coverage: n/a

Jump to tests →

Commits

Three-level explanation

Select a date in Today, then choose **Export notes for {date}** in its header menu. A single Markdown file contains saved notes and ratings originally captured on that date. A rating counts even without written text. An empty day shows a dated notice.

The chosen date stays fixed while the export is prepared. Editing or sharing an older capture later does not move it into another day's export. Sharing uses the existing platform surface, and cancellation preserves the library.

`TodayView.startDayExport` synchronously copies its resolved selection, published calendar/timezone, and `calendar.locale ?? Locale.current` before starting an asynchronous task. A retained `MarkdownExportModel` receives that immutable context through `AppLibraryModel`'s day factory.

`LibraryRepository.dayExportInput` performs one shared locked read. It normalizes physical rows by logical UUID, selects the minimum original capture date and current presented content, filters for note text or rating, and sorts by capture descending/UUID ascending. Work/type/Site lookups are cached within the read. `MarkdownExport.renderDay` composes the familiar standalone blocks under a dated heading and filename.

The day subject reuses the existing exporter/share lifecycle. Each invocation owns a directory inside its process-session directory, so same-date exports cannot overwrite each other. Delivered outcomes clean only that invocation; stale former sessions can be scavenged while the current session stays protected. Repeated taps stay suppressed through preparation, presentation and pending outcome.

Membership is exact `CivilDay(firstCapturedAt, calendar: frozenCalendar) == selectedDay` after UUID grouping. It does not use Today row projections, `lastSharedAt`, `modifiedAt`, or future folding. The date heading is localized using explicit frozen context; the filename uses the selected day's Gregorian components independently of that display format.

The provider gains one batch method and the exporter subject gains one case; there is no persistence, migration, dependency or reconciliation change. Daily read errors use the existing privacy-safe retry message, while empty results create no file. The header action follows `showsDayChrome`, including the existing ready empty-library exception. Keyboard export routing remains limited to selected notes/works.

The native compiler required explicit types for the composed header inputs/action. Scoped tests cover frozen context, locale divergence, eligibility/order/DST, normalization without mutation, overlapping handoffs, cleanup and error recovery. UI journeys verify historical sharing/cancel, dated empty output and action visibility on phone/iPad.

Important changes — detailed

Repository reads selected-day notes once

Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift

Why it matters. A consistent normalized read keeps physical copies and later re-shares from changing membership.

What to look at. dayExportInput / exportInput metadata cache

Takeaway. Normalize before date selection and reuse read-side values.
Rationale. Approved requirements select original capture day and current saved content; one locked batch avoids repeated reads.

Markdown reuses familiar entry blocks

Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift

Why it matters. Ratings, note formatting and work context remain compatible with per-note export.

What to look at. DayExportInput / renderDay / filename

Takeaway. Add a container format around the existing per-entry renderer.
Rationale. Approved minimal scope reuses existing Markdown behavior without a new format or schema.

Today freezes the selected date before export

Asterism/Asterism/Views/TodayView.swift

Why it matters. Navigation, midnight and timezone changes cannot retarget an in-flight document.

What to look at. startDayExport / day chrome menu

Takeaway. Capture displayed context synchronously before awaiting.
Rationale. Selected-day requirement and explicit frozen locale decision.

Exporter owns independent temporary files

Asterism/Asterism/ViewModels/MarkdownExportModel.swift

Why it matters. Overlapping same-date handoffs cannot overwrite or prematurely delete another file.

What to look at. day subject / session invocation lifecycle

Takeaway. Tie cleanup to the delivered outcome and exact invocation owner.
Rationale. Accepted staging design and existing platform exporter lifecycle.

iPad retains unfinished editors across host replacement

Asterism/Asterism/ViewModels/AppLibraryModel.swift

Why it matters. The independently reviewed rotation repair preserves unsaved title, notes and status.

What to look at. active editor registry / bootstrap fence / teardown

Takeaway. Retain active state with an existing owner and release the exact instance.
Rationale. Observed draft loss required a separate bounded lifetime repair;9 native cases and full iPad verify it.

Key decisions

Reuse selected-date navigation and existing export adapters

No new date picker, persistence, App Intent or format. T2428 owns the chosen-day shortcut enhancement.

Owner exception controls final verification

Decision 6 quotes the instructions to stop broad UI, retry unrelated failures once and finish PR-based merge. Missing/full phone and unrun Mac are disclosed, not reported as passes.

Review findings

SeverityAreaFindingResolution
majorWork metadata readsAn early metadata read projected unused Work entry history.Reuse the existing snapshot overload with entryRows: []; verified by historical full gates and source review.
majorUnfinished iPad editor ownershipPortrait host replacement discarded active edits in the original acceptance run.Existing library owner retains active editors with exact release and teardown fencing; current full iPad 29 and focused native 9 pass.
minorUnrelated torn-group UI fixtureOriginal exact case failed at 00:00:31; inherited rows are seeded 70/69 seconds earlier. Midnight attribution remains unproven.One exact owner-directed retry passed 42.538s; preserved as a separate follow-up candidate, no test/fixture change.
minorInherited Works Environment warningsCurrent full iPad recorded 12 runtime warnings; stopped phone 66. Source points to an unchanged helper outside mounted view context, without a proving runtime backtrace.Preserve separate diagnosis; final targeted 5 recorded no warnings; no unrelated source change.

Tests

Source: local run at 2026-10-07T13:25:56.963868+00:00 · snapshot d0e4b0652343030912ae2c3883f396d3b9866ec0 (dirty working tree)

Baseline: none

Execution: passed · JUnit: 2 files · Coverage: none · Baseline: absent

Coverage scope: as the project configures it

Totals: 34 passed · 0 failed · 0 skipped · 0 errored · 0 flaky

New and removed tests

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

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 3cd0ebc0eeb861e534803e932176c676f27910a5.

Dependents none found Changed Dependencies none found Asterism/Asterism Asterism/Asterism/Layout Asterism/Asterism/ViewModels Asterism/Asterism/Views Asterism/AsterismTests Asterism/AsterismTests/Helpers Asterism/AsterismUITests …rismCore/Sources/AsterismCore …/Sources/AsterismPresentation …mCore/Tests/AsterismCoreTests Asterism/Asterism/ContentView.swift…sm/Asterism/ContentView.swift Asterism/Asterism/Layout/AppScreens.swift…erism/Layout/AppScreens.swift Asterism/Asterism/ViewModels/AppLibraryModel.swift…wModels/AppLibraryModel.swift Asterism/Asterism/ViewModels/MarkdownExportModel.swift…els/MarkdownExportModel.swift Asterism/Asterism/ViewModels/WorkDetailModel.swift…wModels/WorkDetailModel.swift Asterism/Asterism/Views/TodaySections.swift…ism/Views/TodaySections.swift Asterism/Asterism/Views/TodayView.swift…sterism/Views/TodayView.swift Asterism/AsterismTests/AppLibraryModelTests.swift…ts/AppLibraryModelTests.swift Asterism/AsterismTests/AppNavigationTests.swift…ests/AppNavigationTests.swift Asterism/AsterismTests/MarkdownExportModelTests.swift…arkdownExportModelTests.swift Asterism/AsterismTests/WorkEditSessionTests.swift…ts/WorkEditSessionTests.swift Asterism/AsterismTests/Helpers/MockLibraryProvider.swift…ers/MockLibraryProvider.swift Asterism/AsterismUITests/AccessibilityJourneyUITests.swift…ssibilityJourneyUITests.swift Asterism/AsterismUITests/TodayUITests.swift…ismUITests/TodayUITests.swift Asterism/AsterismUITests/UIJourneySupport.swift…ITests/UIJourneySupport.swift Asterism/AsterismUITests/WideLayoutUITests.swift…Tests/WideLayoutUITests.swift Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift…smCore/LibraryProviding.swift Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift…ibraryRepository+Export.swift Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift…rismCore/MarkdownExport.swift Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift…mPresentation/TodayText.swift Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift…ts/ExportInputReadTests.swift Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift…sts/MarkdownExportTests.swift
addedmodifieddeletedrenamedunchangedcollapsed package group or +N more⚑N test files with an edge to the node

Per-file diffs

33 files: 25 code · 8 docs. Click to expand.

Code (25)

Asterism/Asterism/ContentView.swift Modified
diff --git a/Asterism/Asterism/ContentView.swift b/Asterism/Asterism/ContentView.swiftindex f81d9598..efa02278 100644--- a/Asterism/Asterism/ContentView.swift+++ b/Asterism/Asterism/ContentView.swift@@ -978,6 +978,9 @@ struct ContentView: View {         switch subject {         case .entry(let entryID): exportModel = model.markdownExportModel(forEntry: entryID)         case .work(let workID): exportModel = model.markdownExportModel(forWork: workID)+        case .day(let day, let calendar):+            exportModel = model.markdownExportModel(+                forDay: day, calendar: calendar, locale: calendar.locale ?? .current)         case nil: exportModel = nil         }         guard let exportModel else { return }
Asterism/Asterism/Layout/AppScreens.swift Modified
diff --git a/Asterism/Asterism/Layout/AppScreens.swift b/Asterism/Asterism/Layout/AppScreens.swiftindex 5874b310..9deac48f 100644--- a/Asterism/Asterism/Layout/AppScreens.swift+++ b/Asterism/Asterism/Layout/AppScreens.swift@@ -135,7 +135,10 @@ struct AppScreens {             // The inspector follows visible notes; pushed work pages remain             // open independently of the dashboard's filtering and membership.             onPruneSelection: isWide ? { navigation.pruneTodayInspector(visibleEntryIDs: $0.entries) } : nil,-            onShowSettings: onShowSettings+            onShowSettings: onShowSettings,+            makeDayExportModel: model.canExportDayNotes ? { day, calendar, locale in+                model.markdownExportModel(forDay: day, calendar: calendar, locale: locale)+            } : nil         )     } @@ -279,10 +282,7 @@ struct AppScreens {     /// sky-cleared one in the wide detail column.     @ViewBuilder     func workDetail(_ workID: UUID, on stack: RouteStack) -> some View {-        if let detailModel = model.workDetailModel(-            for: workID,-            preservingEditorSession: !RuntimePlatform.isMac && !RuntimePlatform.isPhone-        ) {+        if let detailModel = routedWorkDetailModel(for: workID, on: stack) {             WorkDetailView(                 model: detailModel,                 focusedEntryID: stack == .today ? navigation.todayFocusedEntryID : nil,@@ -324,6 +324,13 @@ struct AppScreens {         }     } +    private func routedWorkDetailModel(for workID: UUID, on stack: RouteStack) -> WorkDetailModel? {+        if !RuntimePlatform.isMac && !RuntimePlatform.isPhone {+            return model.workDetailModel(for: workID, on: stack)+        }+        return model.workDetailModel(for: workID)+    }+     // MARK: - Series      /// Req 1.6's list. A row appends the series route rather than pushing a
Asterism/Asterism/ViewModels/AppLibraryModel.swift Modified
diff --git a/Asterism/Asterism/ViewModels/AppLibraryModel.swift b/Asterism/Asterism/ViewModels/AppLibraryModel.swiftindex 152dc55c..c38abcde 100644--- a/Asterism/Asterism/ViewModels/AppLibraryModel.swift+++ b/Asterism/Asterism/ViewModels/AppLibraryModel.swift@@ -125,10 +125,6 @@ public final class AppLibraryModel {     /// previous one. It mirrors `snapshotGeneration` below, which is what lets a     /// slot ask again for bytes that arrived after their record did (Req 1.8).     let thumbnailLoader = ThumbnailImageCache()-    /// The current work and unfinished editors survive a Library layout crossing.-    /// Inactive models for other works are released on the next request; closing-    /// the repository releases every session.-    @ObservationIgnored private var workDetailSessions: [UUID: WorkDetailModel] = [:]     /// How many refresh cycles have completed, bumped once per cycle with the     /// snapshots it publishes (`stats-page` Q27, Q29, Q37).     ///@@ -337,6 +333,13 @@ public final class AppLibraryModel {     /// class-bound, and teardown clears the reference only after awaiting the     /// shutdown, where the counter moves before that suspension.     private var repositoryEpoch = 0+    private struct WorkEditorRoute: Hashable {+        let stack: RouteStack+        let workID: UUID+    }+    /// Only unfinished editors, including destinations beneath a pushed work.+    /// Read-only models remain view-owned; cancel and Save release each session.+    @ObservationIgnored private var activeWorkEditors: [WorkEditorRoute: WorkDetailModel] = [:]     /// Retains the concrete repository for backup export (conforms to BackupV18SnapshotProviding).     private var backupRepository: (any BackupV18SnapshotProviding)?     /// A pre-bootstrap failure used to fail closed on invalid debug launch input.@@ -758,6 +761,9 @@ public final class AppLibraryModel {         // still reading the repository this releases finds its epoch stale at         // the publish gate, however the awaits here interleave with it.         repositoryEpoch &+= 1+        let editors = Array(activeWorkEditors.values)+        activeWorkEditors.removeAll()+        for editor in editors { editor.cancelEditing() }         // Defensive (Decision 1). A pass releases its own session on every path,         // so this can only find one if the model was torn down between an         // `acquire()` and its `release()`; `release()` is idempotent, so a@@ -858,7 +864,6 @@ public final class AppLibraryModel {         // not count as one. Clearing here closes that window: such a cycle         // stops at its own `guard let` instead, and the local below still holds         // what has to be shut down.-        workDetailSessions.removeAll()         self.repository = nil         self.backupRepository = nil         await repository.shutdown()@@ -1563,16 +1568,35 @@ public final class AppLibraryModel {      /// Provides a detail model for a specific work. Same trigger as     /// `entryDetailModel`, for the same reason.-    public func workDetailModel(-        for id: UUID, preservingEditorSession: Bool = false+    public func workDetailModel(for id: UUID) -> WorkDetailModel? {+        makeWorkDetailModel(for: id)+    }++    /// The route retains a model only after Edit. Asking for a different work+    /// can be SwiftUI rebuilding a destination beneath a push, so it does not+    /// retire the current session. Sheets and previews use the uncached factory.+    func workDetailModel(for id: UUID, on stack: RouteStack) -> WorkDetailModel? {+        guard !bootstrapInFlight, repository != nil else { return nil }+        let route = WorkEditorRoute(stack: stack, workID: id)+        if let editor = activeWorkEditors[route], editor.isEditing {+            return editor+        }+        let epoch = repositoryEpoch+        return makeWorkDetailModel(for: id, onEditingChange: { [weak self] editor in+            guard let self, !self.bootstrapInFlight,+                  self.repositoryEpoch == epoch, self.repository != nil else { return }+            if editor.isEditing {+                self.activeWorkEditors[route] = editor+            } else if self.activeWorkEditors[route] === editor {+                self.activeWorkEditors[route] = nil+            }+        })+    }++    private func makeWorkDetailModel(+        for id: UUID, onEditingChange: (@MainActor (WorkDetailModel) -> Void)? = nil     ) -> WorkDetailModel? {         guard let repo = repository else { return nil }-        // Sheets own independent drafts. Only a routed screen may keep its-        // model when the iPad's Library changes navigation containers.-        if preservingEditorSession {-            workDetailSessions = workDetailSessions.filter { $0.key == id || $0.value.isEditing }-            if let existing = workDetailSessions[id] { return existing }-        }         #if DEBUG || ASTERISM_PERFORMANCE_TESTING         let coverFetcher: any CoverFetching =             UITestLaunchSupport.coverFetcher() ?? CoverCandidateFetcher()@@ -1580,7 +1604,7 @@ public final class AppLibraryModel {         let coverFetcher: any CoverFetching = CoverCandidateFetcher()         #endif         let initialCalendar = calendar-        let detail = WorkDetailModel(+        return WorkDetailModel(             workID: id, library: repo, calendar: initialCalendar,             currentDaySource: { [weak self] in self?.currentDay ?? CivilDay(Date(), calendar: initialCalendar) },             calendarSource: { [weak self] in self?.calendar ?? initialCalendar },@@ -1593,9 +1617,8 @@ public final class AppLibraryModel {             },             onConflict: { [weak self] conflict in                 await self?.recordConflict(conflict, recordType: .work)-            })-        if preservingEditorSession { workDetailSessions[id] = detail }-        return detail+            },+            onEditingChange: onEditingChange)     }      func setLatestModel(@@ -2931,15 +2954,28 @@ public final class AppLibraryModel {         markdownExportModel(subject: .work(workID))     } +    /// Accept the context Today actually displays. Sampling a live clock or+    /// calendar here could export a different date during a pending refresh.+    public var canExportDayNotes: Bool {+        state == .ready && repository != nil && resolvedConfiguration != nil+    }++    public func markdownExportModel(+        forDay day: CivilDay, calendar: Calendar, locale: Locale+    ) -> MarkdownExportModel? {+        guard canExportDayNotes else { return nil }+        return markdownExportModel(subject: .day(day: day, calendar: calendar), locale: locale)+    }+     private func markdownExportModel(-        subject: MarkdownExportModel.Subject+        subject: MarkdownExportModel.Subject, locale: Locale = .current     ) -> MarkdownExportModel? {         guard let repo = repository, let config = resolvedConfiguration else { return nil }         return MarkdownExportModel(             subject: subject,             library: repo,             stagingDirectory: MarkdownExportModel.stagingDirectory(-                inRoot: config.rootDirectory))+                inRoot: config.rootDirectory), locale: locale)     }      /// Provides a settings backup import model for restoring into a ready library.
Asterism/Asterism/ViewModels/MarkdownExportModel.swift Modified
diff --git a/Asterism/Asterism/ViewModels/MarkdownExportModel.swift b/Asterism/Asterism/ViewModels/MarkdownExportModel.swiftindex 692f015f..32c0fabb 100644--- a/Asterism/Asterism/ViewModels/MarkdownExportModel.swift+++ b/Asterism/Asterism/ViewModels/MarkdownExportModel.swift@@ -2,7 +2,7 @@ import AsterismCore import Foundation import OSLog -/// Drives a per-entry or per-work markdown export (Reqs 1.5, 2.4).+/// Drives a per-entry, per-work or selected-day markdown export. /// /// The third layer of the export split (Q17): the repository resolves the input, /// `MarkdownExport` renders it, and this model stages the result as a `.md` file@@ -21,6 +21,7 @@ public final class MarkdownExportModel {     public enum Subject: Equatable, Sendable {         case entry(UUID)         case work(UUID)+        case day(day: CivilDay, calendar: Calendar)     }      public enum State: Equatable, Sendable {@@ -33,12 +34,17 @@ public final class MarkdownExportModel {     public private(set) var state: State = .idle     public private(set) var exportedFileURL: URL?     public private(set) var errorMessage: String?+    public private(set) var noticeMessage: String?      private let subject: Subject     private let library: any LibraryProviding     private let stagingDirectory: URL     private let locale: Locale     private var isExporting = false+    /// One process session protects simultaneous and long-lived day handoffs+    /// from both overwrites and scavenging by other invocations (T2404).+    private static let daySessionID = UUID().uuidString+    private var ownedInvocationDirectory: URL?      /// True from the sharing surface's dismissal until its outcome is     /// delivered (T-2346, mirrors `SettingsBackupModel`).@@ -90,10 +96,12 @@ public final class MarkdownExportModel {     /// Reads the input, renders it, stages the file, and hands it to the share     /// sheet. Suppresses a second submission while one is in flight.     public func startExport() async {-        guard !isExporting, !isAwaitingShareOutcome else { return }+        guard !isExporting, state != .sharing, !isAwaitingShareOutcome else { return }         isExporting = true+        defer { isExporting = false }         state = .exporting         errorMessage = nil+        noticeMessage = nil         exportedFileURL = nil         // Clears anything a previous session abandoned. Here rather than in         // `init`, which the wide layouts run on every body pass (see the note@@ -102,23 +110,25 @@ public final class MarkdownExportModel {         scavengeStaleFiles()          do {-            let (document, filename) = try await renderDocument()+            guard let (document, filename) = try await renderDocument() else {+                state = .idle+                return+            }             exportedFileURL = try stage(document, as: filename)             state = .sharing             Self.logger.debug("Markdown export staged")         } catch {+            removeOwnedInvocation()             state = .failed-            errorMessage = Self.privacySafeMessage(for: error)+            errorMessage = Self.privacySafeMessage(for: error, subject: subject)             Self.logger.error(                 "Markdown export failed: \(Self.diagnosticCategory(for: error), privacy: .public)")         }--        isExporting = false     }      /// Rendering never fails — the inputs are total and escaping is total — so     /// the only thing that can throw here is the read.-    private func renderDocument() async throws -> (document: String, filename: String) {+    private func renderDocument() async throws -> (document: String, filename: String)? {         switch subject {         case .entry(let id):             let input = try await library.entryExportInput(entryID: id, locale: locale)@@ -126,13 +136,27 @@ public final class MarkdownExportModel {         case .work(let id):             let input = try await library.workExportInput(workID: id, locale: locale)             return (MarkdownExport.renderWork(input), MarkdownExport.filename(for: input))+        case .day(let day, let calendar):+            let input = try await library.dayExportInput(day: day, calendar: calendar, locale: locale)+            guard !input.blocks.isEmpty else {+                noticeMessage = "There are no notes from \(input.dateText) to export."+                return nil+            }+            return (MarkdownExport.renderDay(input), MarkdownExport.filename(for: input))         }     }      private func stage(_ document: String, as filename: String) throws -> URL {+        let destination: URL+        if case .day = subject {+            destination = daySessionDirectory.appending(path: UUID().uuidString, directoryHint: .isDirectory)+            ownedInvocationDirectory = destination+        } else {+            destination = stagingDirectory+        }         try FileManager.default.createDirectory(-            at: stagingDirectory, withIntermediateDirectories: true)-        let fileURL = stagingDirectory.appending(path: filename)+            at: destination, withIntermediateDirectories: true)+        let fileURL = destination.appending(path: filename)         try ExportStaging.write(Data(document.utf8), to: fileURL)         return fileURL     }@@ -177,7 +201,8 @@ public final class MarkdownExportModel {         isAwaitingShareOutcome = false         state = .idle         if let exportedFileURL {-            try? FileManager.default.removeItem(at: exportedFileURL)+            if ownedInvocationDirectory != nil { removeOwnedInvocation() }+            else { try? FileManager.default.removeItem(at: exportedFileURL) }         }         exportedFileURL = nil     }@@ -189,6 +214,23 @@ public final class MarkdownExportModel {     /// (Q11) and share no prefix, and this directory holds nothing else (Q40).     private func scavengeStaleFiles() {         ExportStaging.scavenge(directory: stagingDirectory) { $0.pathExtension == "md" }+        if case .day = subject {+            ExportStaging.scavenge(directory: daySessionDirectory.deletingLastPathComponent()) {+                $0.lastPathComponent != Self.daySessionID+                    && (try? $0.resourceValues(forKeys: [.isDirectoryKey]).isDirectory) == true+            }+        }+    }++    private var daySessionDirectory: URL {+        stagingDirectory.appending(path: "Day", directoryHint: .isDirectory)+            .appending(path: Self.daySessionID, directoryHint: .isDirectory)+    }++    private func removeOwnedInvocation() {+        guard let directory = ownedInvocationDirectory else { return }+        try? FileManager.default.removeItem(at: directory)+        ownedInvocationDirectory = nil     }      // MARK: - Messages@@ -196,7 +238,12 @@ public final class MarkdownExportModel {     /// Never a title, a URL, a path, or an identifier — the same rule     /// `SettingsBackupModel` holds to, for the same reason: an export failure is     /// reported on screen and must not be a way for content to leak out of it.-    private static func privacySafeMessage(for error: Error) -> String {+    private static func privacySafeMessage(for error: Error, subject: Subject) -> String {+        // A daily collection's read failure never means the selected day's+        // notes are gone: retry it rather than using the single-note notice.+        if case .day = subject {+            return "The markdown export could not be prepared. Please try again."+        }         if let repositoryError = error as? LibraryRepositoryError,            case .recordNotFound = repositoryError {             return "This note is no longer in your library, so there was nothing to export."
Asterism/Asterism/ViewModels/WorkDetailModel.swift Modified
diff --git a/Asterism/Asterism/ViewModels/WorkDetailModel.swift b/Asterism/Asterism/ViewModels/WorkDetailModel.swiftindex eae706e5..734d9309 100644--- a/Asterism/Asterism/ViewModels/WorkDetailModel.swift+++ b/Asterism/Asterism/ViewModels/WorkDetailModel.swift@@ -463,6 +463,7 @@ public final class WorkDetailModel {     /// Where a refused write goes (Req 2.10, Q47): the draft stays here, the     /// conflict goes to the model that owns the banner and the listing.     private let onConflict: @Sendable (WriteConflict) async -> Void+    private let onEditingChange: (@MainActor (WorkDetailModel) -> Void)?     private var isSubmitting = false      public init(@@ -479,7 +480,8 @@ public final class WorkDetailModel {         /// a test or a UI-test launch ever states it.         coverFetcher: any CoverFetching = CoverCandidateFetcher(),         onMutation: @escaping @Sendable () async -> Void,-        onConflict: @escaping @Sendable (WriteConflict) async -> Void = { _ in }+        onConflict: @escaping @Sendable (WriteConflict) async -> Void = { _ in },+        onEditingChange: (@MainActor (WorkDetailModel) -> Void)? = nil     ) {         self.workID = workID         self.library = library@@ -492,6 +494,7 @@ public final class WorkDetailModel {         self.coverFetcher = coverFetcher         self.onMutation = onMutation         self.onConflict = onConflict+        self.onEditingChange = onEditingChange     }      public func load(preservingDrafts: Bool = true) async {@@ -2099,6 +2102,7 @@ public final class WorkDetailModel {         restoreThumbnailDraft(from: work)         if let work { seedPublicationDraft(from: work) }         isEditing = true+        onEditingChange?(self)     }      /// Drops the last refusal: the sentence, the position field's own, and the@@ -2142,6 +2146,7 @@ public final class WorkDetailModel {         // explanation of why this Work has no suggestion is not a refusal, and         // stays.         refreshWorkURLStatusFromCandidate()+        onEditingChange?(self)     }      /// The editor's confirmation: saves where a draft differs, then leaves.@@ -2218,6 +2223,7 @@ public final class WorkDetailModel {         // candidate sheet over view mode, on a work the reader has already         // saved.         cancelCoverFetch()+        onEditingChange?(self)         if hasRecordChanges || hasConnectionChanges {             // `place-extraction` Q55: the app is told **before** the reload. The             // coordinator's `reconcile()` is reached only through
Asterism/Asterism/Views/TodaySections.swift Modified
diff --git a/Asterism/Asterism/Views/TodaySections.swift b/Asterism/Asterism/Views/TodaySections.swiftindex df747756..ebf90d27 100644--- a/Asterism/Asterism/Views/TodaySections.swift+++ b/Asterism/Asterism/Views/TodaySections.swift@@ -24,6 +24,10 @@ struct TodayHeader: View {     /// Nil in the wide tree, whose sidebar carries Settings.     let onShowSettings: (() -> Void)?     var titlePointSize: CGFloat? = nil+    var exportDateText: String? = nil+    var onExportNotes: (() -> Void)? = nil+    var exportBusy = false+    var exportPreparing = false     @ScaledMetric(relativeTo: .largeTitle) private var titleScale: CGFloat = 1      var body: some View {@@ -51,6 +55,35 @@ struct TodayHeader: View {                 .accessibilityHint(TodayHeaderText.hint(isOnCurrentDay: isOnCurrentDay) ?? "")             }             Spacer(minLength: 0)+            if let exportDateText, let onExportNotes {+                let label = "Export notes for " + exportDateText+                Menu {+                    Button(action: onExportNotes) {+                        Label(label, systemImage: "square.and.arrow.up")+                    }+                    .accessibilityIdentifier("today-export-button")+                    .accessibilityLabel(label)+                } label: {+                    Image(systemName: "square.and.arrow.up")+                        .font(.body.weight(.medium))+                        .foregroundStyle(AsterismColors.primaryText)+                        .frame(width: 36, height: 36)+                        .glassEffect(.regular, in: .circle)+                        .frame(minWidth: AsterismLayout.minHitTarget, minHeight: AsterismLayout.minHitTarget)+                        .contentShape(Rectangle())+                }+                .disabled(exportBusy)+                .accessibilityIdentifier("today-export-menu")+                .accessibilityLabel(label)+                .overlay(alignment: .trailing) {+                    if exportPreparing {+                        ProgressView()+                            .controlSize(.small)+                            .accessibilityIdentifier("today-export-busy")+                            .accessibilityLabel("Preparing notes export")+                    }+                }+            }             if let onShowSettings {                 Button(action: onShowSettings) {                     Image(systemName: "gearshape")
Asterism/Asterism/Views/TodayView.swift Modified
diff --git a/Asterism/Asterism/Views/TodayView.swift b/Asterism/Asterism/Views/TodayView.swiftindex 9f146454..41a96d5d 100644--- a/Asterism/Asterism/Views/TodayView.swift+++ b/Asterism/Asterism/Views/TodayView.swift@@ -139,6 +139,11 @@ struct TodayView: View {     @State private var noEpisodeActionsInFlight: Set<UUID> = []     @State private var noEpisodeActionError: String?     @State private var showingNoEpisodeActionError = false+    /// Build only on activation, retaining the exporter through its delivered+    /// outcome even when the selected day changes meanwhile (T2404).+    let makeDayExportModel: ((CivilDay, Calendar, Locale) -> MarkdownExportModel?)?+    @State private var dayExportModel: MarkdownExportModel?+    @State private var dayExportSubmissionPending = false      init(         presentation: TodayPresentation,@@ -177,7 +182,8 @@ struct TodayView: View {         onSetReadingStatus: @escaping (UUID, ReadingStatus) async throws -> LibraryWriteOutcome = { _, _ in .committed },         onSetNoEpisode: @escaping (UUID, CivilDay, Bool) async throws -> LibraryWriteOutcome = { _, _, _ in .committed },         onPruneSelection: ((TodayVisibility) -> Void)? = nil,-        onShowSettings: (() -> Void)? = nil+        onShowSettings: (() -> Void)? = nil,+        makeDayExportModel: ((CivilDay, Calendar, Locale) -> MarkdownExportModel?)? = nil     ) {         self.presentation = presentation         self.schedule = schedule@@ -212,6 +218,7 @@ struct TodayView: View {         self.onSetNoEpisode = onSetNoEpisode         self.onPruneSelection = onPruneSelection         self.onShowSettings = onShowSettings+        self.makeDayExportModel = makeDayExportModel     }      /// Which day is shown (Q32), resolved by the selection itself so that this@@ -274,6 +281,7 @@ struct TodayView: View {         .frame(minWidth: 0, maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)         .onGeometryChange(for: CGFloat.self) { $0.size.width } action: { paneWidth = $0 }         .screenSky(showsSky)+        .markdownExportShare(model: dayExportModel, sheetIdentifier: "today-export-share-sheet")         .alert("Couldn’t update reading status", isPresented: $showingCatchUpActionError) {             Button("OK", role: .cancel) { catchUpActionError = nil }         } message: {@@ -430,14 +438,63 @@ struct TodayView: View {     /// to Settings.     private func header(_ plan: TodayDisplayPlan) -> some View {         let selectedDay = selectedDay-        return TodayHeader(-            title: plan.showsDayChrome-                ? (isWide ? TodayDateText.wideHeader(selectedDay, calendar: calendar) : TodayDateText.header(selectedDay, calendar: calendar)) : nil,+        let offersExport = plan.showsDayChrome && makeDayExportModel != nil+        let title: String? = plan.showsDayChrome+            ? (isWide ? TodayDateText.wideHeader(selectedDay, calendar: calendar) : TodayDateText.header(selectedDay, calendar: calendar)) : nil+        let titlePointSize: CGFloat? = isWide ? (RuntimePlatform.isMac ? 32 : 34) : nil+        let exportDateText: String? = offersExport+            ? TodayDateText.long(selectedDay, calendar: calendar, locale: calendar.locale ?? .current) : nil+        let onExportNotes: (() -> Void)?+        if offersExport {+            onExportNotes = { startDayExport() }+        } else {+            onExportNotes = nil+        }+        let exportPreparing: Bool = dayExportSubmissionPending || dayExportModel?.state == .exporting+        let header = TodayHeader(+            title: title,             fullDate: TodayDateText.complete(selectedDay, calendar: calendar),             isOnCurrentDay: selectedDay == currentDay,             onSelectToday: onSelectToday,             onShowSettings: onShowSettings,-            titlePointSize: isWide ? (RuntimePlatform.isMac ? 32 : 34) : nil)+            titlePointSize: titlePointSize,+            exportDateText: exportDateText,+            onExportNotes: onExportNotes,+            exportBusy: dayExportBusy,+            exportPreparing: exportPreparing)+        return VStack(alignment: .leading, spacing: 8) {+            header+            if let message = dayExportModel?.noticeMessage ?? dayExportModel?.errorMessage {+                Text(message)+                    .font(.callout)+                    .foregroundStyle(dayExportModel?.errorMessage == nil+                        ? AsterismColors.secondaryText : AsterismColors.amberText)+                    .frame(maxWidth: .infinity, alignment: .leading)+                    .padding(.horizontal, 20)+                    .accessibilityIdentifier("today-export-notice")+            }+        }+    }++    private var dayExportBusy: Bool {+        dayExportSubmissionPending || dayExportModel?.state == .exporting+            || dayExportModel?.state == .sharing || dayExportModel?.isAwaitingShareOutcome == true+    }++    private func startDayExport() {+        guard !dayExportBusy, let makeDayExportModel else { return }+        // These values are the same publication that names the header, copied+        // synchronously before the task can suspend or navigation can move.+        let day = selectedDay+        let calendar = calendar+        let locale = calendar.locale ?? Locale.current+        guard let exporter = makeDayExportModel(day, calendar, locale) else { return }+        dayExportModel = exporter+        dayExportSubmissionPending = true+        Task {+            await exporter.startExport()+            dayExportSubmissionPending = false+        }     }      // MARK: - The list
Asterism/AsterismTests/AppLibraryModelTests.swift Modified
diff --git a/Asterism/AsterismTests/AppLibraryModelTests.swift b/Asterism/AsterismTests/AppLibraryModelTests.swiftindex 25a9887f..46901438 100644--- a/Asterism/AsterismTests/AppLibraryModelTests.swift+++ b/Asterism/AsterismTests/AppLibraryModelTests.swift@@ -14,6 +14,66 @@ struct AppLibraryModelTests {     /// project; nothing in a test may restate one (lint check 5).     private static let fixtureAppGroup = "group.example.fixture" +    @Test("Daily exporter factory freezes the displayed date, calendar and explicit locale")+    @MainActor func selectedDayExportFactoryFreezesDisplayedContext() async throws {+        let root = FileManager.default.temporaryDirectory.appending(path: "day-export-factory-\(UUID())")+        defer { try? FileManager.default.removeItem(at: root) }+        var displayed = Calendar(identifier: .gregorian)+        displayed.timeZone = try #require(TimeZone(identifier: "Pacific/Auckland"))+        displayed.locale = Locale(identifier: "en_AU")+        var liveCalendar = displayed+        let now = try #require(displayed.date(from: DateComponents(year: 2026, month: 10, day: 6)))+        var liveNow = now+        var sourceReads = 0+        let mock = MockLibraryProvider()+        let model = AppLibraryModel(+            readyRepository: mock, configuration: LibraryConfiguration(rootDirectory: root),+            calendarSource: { sourceReads += 1; return liveCalendar }, nowSource: { liveNow })+        let selected = TodaySelection.day(model.currentDay.adding(days: -1, calendar: displayed))+            .day(currentDay: model.currentDay)+        mock.dayExportInputResult = .success(DayExportInput(day: selected, dateText: "5 October 2026", blocks: []))+        // The live sources moved without publishing to Today; the factory must+        // accept what that screen still displays and not re-sample either one.+        liveCalendar.timeZone = try #require(TimeZone(identifier: "America/Los_Angeles"))+        liveCalendar.locale = Locale(identifier: "en_US")+        liveNow = now.addingTimeInterval(48 * 3_600)+        let readsBefore = sourceReads+        let exporter = try #require(model.markdownExportModel(+            forDay: selected, calendar: displayed, locale: displayed.locale ?? .current))++        await exporter.startExport()++        #expect(mock.lastExportDay == selected)+        #expect(mock.lastExportCalendar == displayed)+        #expect(mock.lastExportLocale == Locale(identifier: "en_AU"))+        #expect(sourceReads == readsBefore)+        #expect(exporter.noticeMessage == "There are no notes from 5 October 2026 to export.")+    }++    @Test("Current daily export uses the published current day; unavailable factories offer no action")+    @MainActor func selectedDayExportFactoryCurrentAndUnavailable() async throws {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: "UTC"))+        let now = try #require(calendar.date(from: DateComponents(year: 2026, month: 10, day: 6)))+        let day = CivilDay(now, calendar: calendar)+        let root = FileManager.default.temporaryDirectory.appending(path: "day-export-current-\(UUID())")+        defer { try? FileManager.default.removeItem(at: root) }+        let config = LibraryConfiguration(rootDirectory: root)+        #expect(AppLibraryModel(configuration: config).markdownExportModel(+            forDay: day, calendar: calendar, locale: Locale(identifier: "en_AU")) == nil)+        let mock = MockLibraryProvider()+        let model = AppLibraryModel(+            readyRepository: mock, configuration: config, calendarSource: { calendar }, nowSource: { now })+        let resolved = TodaySelection.current.day(currentDay: model.currentDay)+        mock.dayExportInputResult = .success(DayExportInput(day: resolved, dateText: "6 October 2026", blocks: []))+        let exporter = try #require(model.markdownExportModel(+            forDay: resolved, calendar: model.calendar, locale: Locale(identifier: "en_AU")))+        await exporter.startExport()+        #expect(mock.lastExportDay == day)+        #expect(AppLibraryModel(readyRepository: mock).markdownExportModel(+            forDay: day, calendar: calendar, locale: Locale(identifier: "en_AU")) == nil)+    }+      @Test("Independent status Save and Cancel preserve an unfinished routed work editor")     @MainActor func independentStatusDoesNotConsumeTheRoutedEditor() async throws {@@ -22,14 +82,14 @@ struct AppLibraryModelTests {         mock.workResult = .success(work)         mock.workDetailResult = .success(TestFixtures.makeWorkDetail(work: work))         let model = AppLibraryModel(readyRepository: mock)-        let editor = try #require(model.workDetailModel(for: work.id, preservingEditorSession: true))+        let editor = try #require(model.workDetailModel(for: work.id, on: .works))         await editor.load()         editor.beginEditing()         editor.draftTitle = "Unsaved title"         editor.setDraftReadingStatus(.catchingUp)          // The layout's new screen receives the same session and reloads it.-        let crossed = try #require(model.workDetailModel(for: work.id, preservingEditorSession: true))+        let crossed = try #require(model.workDetailModel(for: work.id, on: .works))         #expect(crossed === editor)         await crossed.load()         #expect(crossed.draftTitle == "Unsaved title")
Asterism/AsterismTests/AppNavigationTests.swift Modified
diff --git a/Asterism/AsterismTests/AppNavigationTests.swift b/Asterism/AsterismTests/AppNavigationTests.swiftindex 02b73861..b494dba3 100644--- a/Asterism/AsterismTests/AppNavigationTests.swift+++ b/Asterism/AsterismTests/AppNavigationTests.swift@@ -16,6 +16,21 @@ import Testing @Suite("AppNavigation routes and restore") @MainActor struct AppNavigationTests {+    @Test("Selecting a Today date adds no keyboard export subject; selected notes still route normally")+    func selectedDayDoesNotAddKeyboardExport() throws {+        let calendar = Calendar(identifier: .gregorian)+        let date = try #require(calendar.date(from: DateComponents(year: 2026, month: 10, day: 5)))+        let navigation = AppNavigation()+        navigation.todaySelection = .day(CivilDay(date, calendar: calendar))+        #expect(NavigationActions.exportSubject(+            tab: navigation.selectedTab, todayEntryID: nil, todayWorkID: nil,+            todayChapterEntryID: nil, workID: nil, worksEntryID: nil, workChapterEntryID: nil) == nil)+        let entryID = UUID()+        #expect(NavigationActions.exportSubject(+            tab: .today, todayEntryID: entryID, todayWorkID: nil,+            todayChapterEntryID: nil, workID: nil, worksEntryID: nil, workChapterEntryID: nil) == .entry(entryID))+    }+     // MARK: - Fixtures      private static func workSet(_ members: [UUID]) -> DuplicateSetKey {
Asterism/AsterismTests/Helpers/MockLibraryProvider.swift Modified
diff --git a/Asterism/AsterismTests/Helpers/MockLibraryProvider.swift b/Asterism/AsterismTests/Helpers/MockLibraryProvider.swiftindex 00c56bab..21feda1d 100644--- a/Asterism/AsterismTests/Helpers/MockLibraryProvider.swift+++ b/Asterism/AsterismTests/Helpers/MockLibraryProvider.swift@@ -267,6 +267,7 @@ final class MockLibraryProvider: LibraryProviding, @unchecked Sendable {     var workDetailCallCount = 0     var entryExportInputCallCount = 0     var workExportInputCallCount = 0+    var dayExportInputCallCount = 0     var projectWorkDeletionCallCount = 0     var commitWorkDeletionCallCount = 0 @@ -275,14 +276,20 @@ final class MockLibraryProvider: LibraryProviding, @unchecked Sendable {     var workDetailResult: Result<WorkDetailPresentation, Error> = .failure(MockError.notConfigured)     var entryExportInputResult: Result<EntryExportInput, Error> = .failure(MockError.notConfigured)     var workExportInputResult: Result<WorkExportInput, Error> = .failure(MockError.notConfigured)+    var dayExportInputResult: Result<DayExportInput, Error> = .failure(MockError.notConfigured)     var projectWorkDeletionResult: Result<WorkDeletionContract, Error> = .failure(         MockError.notConfigured)     var commitWorkDeletionResult: Result<WorkDeletionCommitOutcome, Error> = .success(.committed)      var lastExportLocale: Locale?+    var lastExportDay: CivilDay?+    var lastExportCalendar: Calendar?     /// Holds an export-input read open, so a second submission can be observed     /// arriving while the first is still in flight.     var exportInputDelay: Duration?+    /// Deterministically hold a daily read open for frozen-context and+    /// duplicate-submission tests, without timing assumptions.+    var dayExportInputHold: (@Sendable () async -> Void)?     var lastWorkDeletionDisposition: WorkDeletionDisposition?     /// Doubly optional for `deleteEntry`'s reason: the outer level says whether     /// the commit was called, the inner one carries what it was passed — and@@ -519,6 +526,17 @@ final class MockLibraryProvider: LibraryProviding, @unchecked Sendable {         return try workExportInputResult.get()     } +    func dayExportInput(day: CivilDay, calendar: Calendar, locale: Locale) async throws -> DayExportInput {+        dayExportInputCallCount += 1+        callLog.append("dayExportInput")+        lastExportDay = day+        lastExportCalendar = calendar+        lastExportLocale = locale+        await dayExportInputHold?()+        if let exportInputDelay { try? await Task.sleep(for: exportInputDelay) }+        return try dayExportInputResult.get()+    }+     func projectWorkDeletion(workID: UUID) async throws -> WorkDeletionContract {         projectWorkDeletionCallCount += 1         return try projectWorkDeletionResult.get()
Asterism/AsterismTests/MarkdownExportModelTests.swift Modified
diff --git a/Asterism/AsterismTests/MarkdownExportModelTests.swift b/Asterism/AsterismTests/MarkdownExportModelTests.swiftindex 3d27dc39..7f934c6b 100644--- a/Asterism/AsterismTests/MarkdownExportModelTests.swift+++ b/Asterism/AsterismTests/MarkdownExportModelTests.swift@@ -11,6 +11,182 @@ import Testing @Suite("Markdown export view model") struct MarkdownExportModelTests { +    // MARK: - Selected-day exports (T2404)++    private func dayContext() throws -> (CivilDay, Calendar) {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: "Pacific/Auckland"))+        calendar.locale = Locale(identifier: "en_AU")+        let date = try #require(calendar.date(from: DateComponents(year: 2026, month: 10, day: 6)))+        return (CivilDay(date, calendar: calendar), calendar)+    }++    @Test("Daily export makes one batch call and stages its dated document in an owned invocation")+    @MainActor func selectedDayStagesOneBatch() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        let (day, calendar) = try dayContext()+        let input = DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput()])+        let (model, mock) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(input)+        }++        await model.startExport()++        #expect(model.state == .sharing)+        #expect(mock.dayExportInputCallCount == 1)+        #expect(mock.entryExportInputCallCount == 0 && mock.workExportInputCallCount == 0)+        #expect(mock.lastExportDay == day && mock.lastExportCalendar == calendar)+        #expect(mock.lastExportLocale == Locale(identifier: "en_AU"))+        let url = try #require(model.exportedFileURL)+        #expect(url.lastPathComponent == "Asterism Notes 2026-10-06.md")+        #expect(try String(contentsOf: url, encoding: .utf8) == MarkdownExport.renderDay(input))+        let session = url.deletingLastPathComponent().deletingLastPathComponent()+        #expect(session.deletingLastPathComponent() == dir.appending(path: "Day", directoryHint: .isDirectory))+        #expect(UUID(uuidString: session.lastPathComponent) != nil)+        #expect(UUID(uuidString: url.deletingLastPathComponent().lastPathComponent) != nil)+    }++    @Test("An empty daily input stays idle with a frozen-date notice and creates no file")+    @MainActor func selectedDayEmptyNotice() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        let (day, calendar) = try dayContext()+        let (model, mock) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: []))+        }+        await model.startExport()+        #expect(model.state == .idle)+        #expect(model.noticeMessage == "There are no notes from 6 October 2026 to export.")+        #expect(model.errorMessage == nil && model.exportedFileURL == nil)+        #expect(try FileManager.default.contentsOfDirectory(atPath: dir.path).isEmpty)++        mock.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput()]))+        await model.startExport()+        #expect(model.state == .sharing)+        #expect(model.noticeMessage == nil, "Retrying clears the earlier empty notice")+    }++    @Test("Daily context stays frozen while a held read spans navigation, midnight and zone changes")+    @MainActor func selectedDayContextAndSubmissionGuard() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        var (displayedDay, displayedCalendar) = try dayContext()+        let frozenDay = displayedDay+        let frozenCalendar = displayedCalendar+        let held = SubmissionGate()+        let (model, mock) = makeSUT(subject: .day(day: displayedDay, calendar: displayedCalendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: frozenDay, dateText: "6 October 2026", blocks: []))+            $0.dayExportInputHold = { await held.wait() }+        }+        let task = Task { await model.startExport() }+        defer { held.open(); task.cancel() }+        await yieldUntil { mock.dayExportInputCallCount == 1 }+        try #require(mock.dayExportInputCallCount == 1)+        displayedDay = displayedDay.adding(days: 1, calendar: displayedCalendar)+        displayedCalendar.timeZone = try #require(TimeZone(identifier: "America/Los_Angeles"))+        displayedCalendar.locale = Locale(identifier: "en_US")+        await model.startExport()+        #expect(mock.dayExportInputCallCount == 1)+        held.open()+        await task.value+        #expect(mock.lastExportDay == frozenDay && mock.lastExportCalendar == frozenCalendar)+        #expect(mock.lastExportLocale == Locale(identifier: "en_AU"))+        #expect(model.noticeMessage == "There are no notes from 6 October 2026 to export.")+        #expect(displayedDay != frozenDay && displayedCalendar != frozenCalendar)+    }++    @Test("Daily handoffs suppress sharing and pending-outcome re-entry, retaining only their own files")+    @MainActor func selectedDayConcurrentHandoffs() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        let (day, calendar) = try dayContext()+        let (first, firstMock) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput(note: "First")]))+        }+        let (second, _) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput(note: "Second")]))+        }+        await first.startExport()+        let firstURL = try #require(first.exportedFileURL)+        await first.startExport()+        #expect(firstMock.dayExportInputCallCount == 1, "Sharing also suppresses repeat activation")+        await second.startExport()+        let secondURL = try #require(second.exportedFileURL)+        #expect(firstURL != secondURL && firstURL.lastPathComponent == secondURL.lastPathComponent)+        #expect(try String(contentsOf: firstURL, encoding: .utf8).contains("First"))+        #expect(try String(contentsOf: secondURL, encoding: .utf8).contains("Second"))+        first.shareDismissed()+        await first.startExport()+        #expect(firstMock.dayExportInputCallCount == 1)+        #expect(FileManager.default.fileExists(atPath: firstURL.path))+        first.handleShareOutcome(.completed)+        #expect(!FileManager.default.fileExists(atPath: firstURL.deletingLastPathComponent().path))+        #expect(FileManager.default.fileExists(atPath: secondURL.path))+        second.handleShareOutcome(.cancelled)+        #expect(!FileManager.default.fileExists(atPath: secondURL.deletingLastPathComponent().path))+    }++    @Test("Daily scavenging removes stale former sessions but preserves old current-session handoffs")+    @MainActor func selectedDayScavengesFormerSessions() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        let (day, calendar) = try dayContext()+        let (first, _) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput()]))+        }+        await first.startExport()+        let url = try #require(first.exportedFileURL)+        let session = url.deletingLastPathComponent().deletingLastPathComponent()+        let old = Date().addingTimeInterval(-48 * 3_600)+        let dayRoot = session.deletingLastPathComponent()+        let stale = dayRoot.appending(path: UUID().uuidString, directoryHint: .isDirectory)+        let fresh = dayRoot.appending(path: UUID().uuidString, directoryHint: .isDirectory)+        for directory in [stale, fresh] {+            try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)+            try Data("Other session".utf8).write(to: directory.appending(path: "notes.md"))+        }+        for item in [url, url.deletingLastPathComponent(), session, stale] {+            try FileManager.default.setAttributes([.modificationDate: old], ofItemAtPath: item.path)+        }+        let (second, _) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: []))+        }+        #expect(FileManager.default.fileExists(atPath: stale.path), "Construction does no scavenging")+        await second.startExport()+        #expect(!FileManager.default.fileExists(atPath: stale.path))+        #expect(FileManager.default.fileExists(atPath: fresh.path))+        #expect(FileManager.default.fileExists(atPath: url.path))+        first.handleShareOutcome(.cancelled)+    }++    @Test("Daily read or staging failures disclose no content, stage no document, and allow retry")+    @MainActor func selectedDayFailures() async throws {+        let dir = makeStagingDirectory()+        defer { try? FileManager.default.removeItem(at: dir) }+        let (day, calendar) = try dayContext()+        let (model, mock) = makeSUT(subject: .day(day: day, calendar: calendar), stagingDirectory: dir) {+            $0.dayExportInputResult = .failure(MockLibraryProvider.MockError.simulatedFailure("Private https://example.test/note"))+        }+        await model.startExport()+        #expect(model.state == .failed)+        #expect(model.errorMessage == "The markdown export could not be prepared. Please try again.")+        #expect(model.noticeMessage == nil && model.exportedFileURL == nil)+        #expect(try FileManager.default.contentsOfDirectory(atPath: dir.path).isEmpty)+        mock.dayExportInputResult = .failure(LibraryRepositoryError.recordNotFound(type: "Entry", id: UUID()))+        await model.startExport()+        #expect(model.errorMessage == "The markdown export could not be prepared. Please try again.")+        mock.dayExportInputResult = .success(DayExportInput(day: day, dateText: "6 October 2026", blocks: [entryInput()]))+        try FileManager.default.removeItem(at: dir)+        try Data("Blocks staging".utf8).write(to: dir)+        await model.startExport()+        #expect(model.state == .failed && model.exportedFileURL == nil)+        try FileManager.default.removeItem(at: dir)+        await model.startExport()+        #expect(model.state == .sharing && model.errorMessage == nil)+        model.handleShareOutcome(.cancelled)+    }+     // MARK: - Helpers      private func makeStagingDirectory() -> URL {
Asterism/AsterismTests/WorkEditSessionTests.swift Added
diff --git a/Asterism/AsterismTests/WorkEditSessionTests.swift b/Asterism/AsterismTests/WorkEditSessionTests.swiftnew file mode 100644index 00000000..792ff6d6--- /dev/null+++ b/Asterism/AsterismTests/WorkEditSessionTests.swift@@ -0,0 +1,224 @@+import AsterismTestSupport+import AsterismCore+import Foundation+import Testing+@testable import Asterism++@Suite("Work editor ownership")+struct WorkEditSessionTests {+    @MainActor private func fixture() -> (AppLibraryModel, MockLibraryProvider, WorkSnapshot) {+        let work = TestFixtures.makeWork(displayTitle: "Original", genreTags: ["fantasy"], genericNotes: "Stored notes")+        let mock = MockLibraryProvider()+        mock.workDetailResult = .success(TestFixtures.makeWorkDetail(work: work))+        return (AppLibraryModel(readyRepository: mock), mock, work)+    }++    @Test("A replacement layout host receives the entire unsaved work editor")+    @MainActor func replacementHostRetainsDrafts() async throws {+        let (app, mock, work) = fixture()+        let editor = try #require(app.workDetailModel(for: work.id, on: .works))+        await editor.load()+        editor.beginEditing()+        editor.draftTitle = "Entered title"+        editor.draftAssignment = .configured(UUID())+        editor.draftTags = ["mystery", "science fiction"]+        editor.draftNotes = "Entered notes\nSecond line"+        editor.draftVerdict = "Worth continuing"+        editor.draftReleaseDays = [.monday, .friday]+        editor.draftWorkURL = "https://example.com/entered"+        editor.draftPositionText = "2.5"+        editor.setDraftReadingStatus(.toRead)+        editor.setDraftWorkStatus(.hiatus)+        let returnDay = editor.currentDay.adding(days: 7, calendar: editor.publicationCalendar)+        editor.setReturnDate(returnDay)+        let linkedID = UUID()+        editor.addLink(to: linkedID, type: "Sequel")+        let assignment = editor.draftAssignment+        let link = try #require(editor.links.first)++        let replacement = try #require(app.workDetailModel(for: work.id, on: .works))+        #expect(replacement === editor)+        // A rebuilt WorkDetailView runs its existing load task again.+        await replacement.load()+        #expect(replacement.isEditing)+        #expect(replacement.draftTitle == "Entered title")+        #expect(replacement.draftAssignment == assignment)+        #expect(replacement.draftTags == ["mystery", "science fiction"])+        #expect(replacement.draftNotes == "Entered notes\nSecond line")+        #expect(replacement.draftVerdict == "Worth continuing")+        #expect(replacement.draftReleaseDays == [.monday, .friday])+        #expect(replacement.draftWorkURL == "https://example.com/entered")+        #expect(replacement.draftPositionText == "2.5")+        #expect(replacement.draftReadingStatus == .toRead)+        #expect(replacement.draftWorkStatus == .hiatus)+        #expect(replacement.draftReturnDate == returnDay)+        #expect(replacement.links.first?.id == link.id)+        #expect(replacement.links.first?.otherWorkID == linkedID)+        #expect(replacement.links.first?.linkType == "Sequel")+        #expect(mock.updateWorkCallCount == 0, "Host replacement never commits drafts")+        #expect(mock.commitWorkURLCallCount == 0)+    }++    @Test("Cancel and successful Save release the active editor", arguments: [false, true])+    @MainActor func exitReleasesEditor(save: Bool) async throws {+        let (app, mock, work) = fixture()+        var editor = app.workDetailModel(for: work.id, on: .works)+        try #require(editor != nil)+        weak let retained = editor+        await editor?.load()+        editor?.beginEditing()+        editor?.draftNotes = "Entered notes"+        editor = nil+        #expect(retained != nil, "The scene owns a draft while its view host is absent")+        var replacement = app.workDetailModel(for: work.id, on: .works)+        try #require(replacement != nil)+        #expect(replacement === retained)+        if save { await replacement?.commitEditing() } else { replacement?.cancelEditing() }+        #expect(replacement?.isEditing == false)+        #expect(mock.updateWorkCallCount == (save ? 1 : 0))+        if save {+            let write = try #require(mock.updateWorkCalls.first)+            #expect(write.id == work.id)+            #expect(write.draft.genericNotes == "Entered notes")+            #expect(write.draft.displayTitle == "Original")+        }+        let next = try #require(app.workDetailModel(for: work.id, on: .works))+        #expect(next !== replacement)+        await next.load()+        #expect(!next.isEditing)+        #expect(next.draftNotes == "Stored notes")+        replacement = nil+        #expect(retained == nil, "Finished sessions are not retained as read-only history")+    }++    @Test("Today, Library, replacement works and unscoped previews keep separate editors")+    @MainActor func slotsAndReplacementStayIsolated() async throws {+        let (app, mock, work) = fixture()+        var library = app.workDetailModel(for: work.id, on: .works)+        try #require(library != nil)+        weak let retainedLibrary = library+        await library?.load()+        library?.beginEditing()+        library?.draftTitle = "Library draft"+        let today = try #require(app.workDetailModel(for: work.id, on: .today))+        await today.load()+        today.beginEditing()+        today.draftTitle = "Today draft"+        #expect(library !== today)+        #expect(app.workDetailModel(for: work.id) !== today, "Status and merge sheets are unscoped")+        library = nil // The earlier destination's host is gone before the pushed lookup.+        #expect(retainedLibrary != nil)++        let other = TestFixtures.makeWork(displayTitle: "Another work")+        mock.workDetailResult = .success(TestFixtures.makeWorkDetail(work: other))+        let replacement = try #require(app.workDetailModel(for: other.id, on: .works))+        #expect(retainedLibrary?.isEditing == true && retainedLibrary?.draftTitle == "Library draft")+        #expect(app.workDetailModel(for: work.id, on: .works) === retainedLibrary,+            "Rendering a different read-only destination is not a navigation or discard")+        await replacement.load()+        replacement.beginEditing()+        replacement.draftTitle = "Other draft"+        #expect(retainedLibrary?.isEditing == true && retainedLibrary?.draftTitle == "Library draft",+            "A pushed editor does not discard an earlier unfinished editor")+        #expect(app.workDetailModel(for: work.id, on: .works) === retainedLibrary)+        retainedLibrary?.cancelEditing() // An old host's exit cannot release a newer session.+        #expect(app.workDetailModel(for: other.id, on: .works) === replacement)+        #expect(replacement.workID == other.id)+        #expect(replacement.draftTitle == "Other draft")+        #expect(app.workDetailModel(for: work.id, on: .today) === today)+        #expect(today.isEditing && today.draftTitle == "Today draft")+        #expect(mock.updateWorkCallCount == 0)+    }++    @Test("Failed and refused Save keep the same owned draft", arguments: [false, true])+    @MainActor func unsuccessfulSaveRetainsEditor(refused: Bool) async throws {+        let (app, mock, work) = fixture()+        mock.updateWorkResult = refused+            ? .success(.conflict(.torn(recordID: work.id, variants: [])))+            : .failure(MockLibraryProvider.MockError.simulatedFailure("update failed"))+        let editor = try #require(app.workDetailModel(for: work.id, on: .works))+        await editor.load()+        editor.beginEditing()+        editor.draftTitle = "Unwritten title"+        editor.draftNotes = "Unwritten notes"++        await editor.commitEditing()++        #expect(editor.isEditing)+        #expect(editor.draftTitle == "Unwritten title")+        #expect(editor.draftNotes == "Unwritten notes")+        #expect(editor.errorMessage != nil)+        #expect(mock.updateWorkCallCount == 1)+        #expect(app.workDetailModel(for: work.id, on: .works) === editor)+    }++    @Test("A stale same-work exit cannot release a newer editor instance")+    @MainActor func staleExitKeepsNewerEditor() async throws {+        let (app, _, work) = fixture()+        let first = try #require(app.workDetailModel(for: work.id, on: .works))+        let second = try #require(app.workDetailModel(for: work.id, on: .works))+        #expect(first !== second, "Read-only requests are not retained")+        await first.load()+        await second.load()+        first.beginEditing()+        first.draftNotes = "Earlier draft"+        second.beginEditing()+        second.draftNotes = "Current draft"+        first.cancelEditing()+        #expect(app.workDetailModel(for: work.id, on: .works) === second)+        #expect(second.isEditing && second.draftNotes == "Current draft")+    }++    @Test("A suspended bootstrap admits neither new editors nor late registration")+    @MainActor func bootstrapFencesEditorAdmission() async throws {+        let (app, _, work) = fixture()+        var offered = app.workDetailModel(for: work.id, on: .works)+        try #require(offered != nil)+        weak let released = offered+        await offered?.load()+        let gate = SubmissionGate()+        let heldTurn = Task { await app.intentBroker.holdingTurn { await gate.wait() } }+        defer { gate.open(); heldTurn.cancel() }+        await yieldUntil { app.intentBroker.isBusy }+        try #require(app.intentBroker.isBusy)+        // Bootstrap waits at intentBroker.drain(), before teardown advances+        // the epoch or clears the old repository. This exercises admission+        // during that suspension, rather than a factory with no repository.+        let bootstrap = Task { await app.bootstrap() }+        defer { bootstrap.cancel() }+        await yieldUntil { app.bootstrapInFlight }+        try #require(app.bootstrapInFlight)++        #expect(app.workDetailModel(for: work.id) != nil, "The old repository is still available")+        #expect(app.workDetailModel(for: work.id, on: .works) == nil)+        offered?.beginEditing() // An old destination may finish its event while bootstrap waits.+        offered = nil+        #expect(released == nil, "The closing library cannot gain retained editors")++        gate.open()+        await heldTurn.value+        await bootstrap.value+        #expect(app.workDetailModel(for: work.id, on: .works) == nil)+    }++    @Test("Library teardown discards retained drafts and rejects stale registration")+    @MainActor func teardownRetiresEditor() async throws {+        let (app, mock, work) = fixture()+        var editor = app.workDetailModel(for: work.id, on: .works)+        try #require(editor != nil)+        weak let retained = editor+        await editor?.load()+        editor?.beginEditing()+        editor?.draftTitle = "Old library draft"+        // Like the existing teardown tests, no configuration means this reopen+        // releases the injected repository and cannot open another library.+        await app.bootstrap()+        #expect(editor?.isEditing == false)+        #expect(editor?.draftTitle == "Original")+        editor?.beginEditing() // A late old-host callback has the previous epoch.+        #expect(app.workDetailModel(for: work.id, on: .works) == nil)+        editor = nil+        #expect(retained == nil)+        #expect(mock.updateWorkCallCount == 0)+    }+}
Asterism/AsterismUITests/AccessibilityJourneyUITests.swift Modified
diff --git a/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift b/Asterism/AsterismUITests/AccessibilityJourneyUITests.swiftindex 88e5dcd5..3b09d847 100644--- a/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift+++ b/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift@@ -1176,9 +1176,11 @@ final class AccessibilityJourneyUITests: XCTestCase {             NSPredicate(                 format: "identifier BEGINSWITH 'recent-entry-' AND label CONTAINS[c] 'Real Work'")         ).firstMatch-        XCTAssertTrue(chapter.waitForExistence(timeout: 20), "Recent lists a taught chapter")-        scrollToElement(chapter, attempts: 8)-        chapter.tap()+        // At this text size a lazy Today list may not build the chapter until+        // it scrolls into view, as in openSeededEntry above.+        scrollUntilTappableAndTap(+            chapter, in: app, "Recent lists a taught chapter",+            scroll: { $0.collectionViews["recent-list"].swipeUp() })          // The card is the first thing on the screen, so this is a content         // control at the top of a `Form` rather than one below a fold — but at@@ -1597,7 +1599,27 @@ final class WideLayoutAccessibilityUITests: XCTestCase {         ).tap()         waitFor(app.anyElement("work-detail-pulse"), "The work fills the detail column")         waitFor(app.buttons["work-detail-edit-button"], "The work page offers the editor").tap()-        waitFor(app.textFields["work-detail-title-field"], "The editor is open", timeout: 20)+        let title = waitFor(+            app.textFields["work-detail-title-field"], "The editor is open", timeout: 20)+        title.tap()+        let previousTitle = title.value as? String ?? ""+        title.typeText(String(repeating: XCUIKeyboardKey.delete.rawValue, count: previousTitle.count + 2))+        let enteredTitle = "Zephyr Court Draft"+        title.typeText(enteredTitle + "\n")+        XCTAssertEqual(title.value as? String, enteredTitle, "The title input landed before rotation")+        let notes = app.anyElement("work-detail-notes-field")+        revealInEditor(notes, "The notes draft is reachable before the turn")+        notes.tap()+        let previousNotes = notes.value as? String ?? ""+        notes.typeText(String(repeating: XCUIKeyboardKey.delete.rawValue, count: previousNotes.count + 2))+        let enteredNotes = "Unsaved rotation notes"+        notes.typeText(enteredNotes)+        XCTAssertEqual(notes.value as? String, enteredNotes, "The notes input landed before rotation")+        // Return to the header before the original capsule walk. Submitting+        // this single-line field dismisses typing without pressing Save.+        revealInEditor(title, "The title remains reachable", scrollDown: true)+        title.tap()+        title.typeText("\n")          assertTheFiveSegmentsAreOperable(choosing: "toRead", layout: "landscape") @@ -1612,6 +1634,12 @@ final class WideLayoutAccessibilityUITests: XCTestCase {         XCTAssertTrue(app.buttons["work-detail-reading-status-toRead"].isSelected,             "The unsaved reading-status choice survives the layout crossing")         assertTheFiveSegmentsAreOperable(choosing: "catchingUp", layout: "portrait")+        revealInEditor(title, "The entered title survives the turn", scrollDown: true)+        XCTAssertEqual(title.value as? String, enteredTitle,+            "The replacement host keeps the entered title without saving")+        revealInEditor(notes, "The entered notes survive the turn")+        XCTAssertEqual(notes.value as? String, enteredNotes,+            "The replacement host keeps the entered notes without saving")     }      /// Every segment of the reading-status capsule is present, hittable, named@@ -1665,13 +1693,15 @@ final class WideLayoutAccessibilityUITests: XCTestCase {     /// land on the Works list after the columns resize.     private func revealInEditor(         _ element: XCUIElement, _ message: String,+        scrollDown: Bool = false,         file: StaticString = #filePath, line: UInt = #line     ) {         _ = element.waitForExistence(timeout: 15)         for _ in 0..<8 {             if element.exists, element.isHittable { return }             let detail = app.anyElement("wide-detail-column")-            (detail.exists ? detail : app.anyElement("work-detail-scroll")).swipeUp()+            let scroll = detail.exists ? detail : app.anyElement("work-detail-scroll")+            if scrollDown { scroll.swipeDown() } else { scroll.swipeUp() }             _ = element.waitForExistence(timeout: 2)         }         XCTFail(message, file: file, line: line)
Asterism/AsterismUITests/TodayUITests.swift Modified
diff --git a/Asterism/AsterismUITests/TodayUITests.swift b/Asterism/AsterismUITests/TodayUITests.swiftindex ece1455c..37bb74e8 100644--- a/Asterism/AsterismUITests/TodayUITests.swift+++ b/Asterism/AsterismUITests/TodayUITests.swift@@ -329,6 +329,47 @@ final class TodayUITests: XCTestCase {         shownDay = target     } +    // MARK: - Selected-day export (T2404)++    func testSelectedDayNotesExportAndCancel() {+        launchToday()+        selectDay(daysFromLaunch: -1, "The previous capture day is selected")+        // The existing fixture starts with blank notes. Saving a rating makes+        // one eligible without a new fixture or changing its original date.+        waitFor(recentRows.firstMatch, "A historical capture opens").tap()+        waitFor(app.anyElement("entry-detail-rating-up"), "Rating-only content can be saved").tap()+        waitFor(app.buttons["entry-detail-update-button"], "Save keeps the original capture date").tap()+        waitUntilGone(app.buttons["entry-detail-update-button"], "The editor returns to the selected day")+        let expected = "Export notes for " + date(daysFromLaunch: -1).formatted(date: .long, time: .omitted)+        let menu = waitFor(app.anyElement("today-export-menu"), "The selected day offers export")+        XCTAssertEqual(menu.label, expected)+        menu.tap()+        waitFor(app.buttons.matching(NSPredicate(+            format: "identifier == %@ OR label == %@", "today-export-button", expected)).firstMatch,+            "The menu visibly names the selected date").tap()+        let appeared = app.anyElement("today-export-share-sheet").waitForExistence(timeout: 30)+            || app.otherElements["ActivityListView"].waitForExistence(timeout: 5)+        XCTAssertTrue(appeared, "The historical rating-only note reaches native sharing")+        cancelDocumentShare(in: app, sheetIdentifier: "today-export-share-sheet")+        XCTAssertEqual(app.anyElement("today-export-menu").label, expected)+        XCTAssertEqual(recentRows.count, 2, "Cancellation preserves the captured entries")+        XCTAssertFalse(app.anyElement("today-export-notice").exists)+    }++    func testSelectedEmptyDayExportShowsDatedNotice() {+        launchToday()+        selectDay(daysFromLaunch: -3, "A day without original captures is selected")+        let dateText = date(daysFromLaunch: -3).formatted(date: .long, time: .omitted)+        waitFor(app.anyElement("today-export-menu"), "The empty day still offers export").tap()+        waitFor(app.buttons.matching(NSPredicate(+            format: "identifier == %@ OR label == %@", "today-export-button", "Export notes for " + dateText)).firstMatch,+            "The empty-day action names its date").tap()+        XCTAssertEqual(waitFor(app.anyElement("today-export-notice"), "An empty day explains its result").label,+            "There are no notes from \(dateText) to export.")+        XCTAssertFalse(app.anyElement("today-export-share-sheet").exists)+        XCTAssertFalse(app.otherElements["ActivityListView"].exists)+    }+     /// One weekday's full name, as the device's region spells it — read from     /// `Calendar.current` rather than written out in English, for     /// `WorkDetailStatusUITests`' reason: the headers are built from@@ -997,6 +1038,7 @@ final class TodayUITests: XCTestCase {         waitFor(app.collectionViews["recent-list"], "The library opens", timeout: 60)         waitFor(app.anyElement("today-header-date"), "The day opens with its week row")         waitFor(app.anyElement("today-section-releases"), "…and its releases section")+        waitFor(app.anyElement("today-export-menu"), "Single-day chrome offers export")          let banner = waitFor(app.buttons["duplicate-banner"], "Today shows the duplicate banner")         banner.tap()@@ -1009,6 +1051,7 @@ final class TodayUITests: XCTestCase {             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")+        XCTAssertFalse(app.anyElement("today-export-menu").exists, "All-days results hide daily export")         waitFor(             app.anyElement("recent-section-header"),             "Req 5.3: the filtered rows are grouped and headed as Recent groups them")@@ -1020,6 +1063,7 @@ final class TodayUITests: XCTestCase {             timeout: 15)         waitFor(stripCell(daysFromLaunch: 0), "…with its strip")         waitFor(app.anyElement("today-section-releases"), "…and its releases section")+        waitFor(app.anyElement("today-export-menu"), "Clearing the filter restores daily export")     }      // MARK: - Req 5.8 — the empty library keeps the day@@ -1047,6 +1091,14 @@ final class TodayUITests: XCTestCase {          waitFor(app.anyElement("today-header-date"), "Req 5.8: the week row stays")         waitFor(stripCell(daysFromLaunch: 0), "Req 5.8: the strip stays")+        let dateText = date(daysFromLaunch: 0).formatted(date: .long, time: .omitted)+        waitFor(app.anyElement("today-export-menu"), "A ready empty library still offers daily export").tap()+        waitFor(app.buttons.matching(NSPredicate(+            format: "identifier == %@ OR label == %@", "today-export-button", "Export notes for " + dateText)).firstMatch,+            "The empty-library export action is available").tap()+        XCTAssertEqual(waitFor(app.anyElement("today-export-notice"), "The empty library explains its result").label,+            "There are no notes from \(dateText) to export.")+        XCTAssertFalse(app.anyElement("today-export-share-sheet").exists)         assertHeader(             "today-section-releases", says: "Releasing",             "Req 5.8: and the releases section stays, so a schedule is listable without notes")
Asterism/AsterismUITests/UIJourneySupport.swift Modified
diff --git a/Asterism/AsterismUITests/UIJourneySupport.swift b/Asterism/AsterismUITests/UIJourneySupport.swiftindex 93ec2c7c..8ed75aef 100644--- a/Asterism/AsterismUITests/UIJourneySupport.swift+++ b/Asterism/AsterismUITests/UIJourneySupport.swift@@ -73,6 +73,26 @@ extension XCUIApplication { }  extension XCTestCase {+    /// The native activity sheet publishes its close control from another+    /// process. Use its stable identifier/label instead of a scrolling gesture.+    func cancelDocumentShare(in app: XCUIApplication, sheetIdentifier: String) {+        let close = app.descendants(matching: .button).matching(+            NSPredicate(format: "identifier == %@", "header.closeButton")+        ).firstMatch+        if close.waitForExistence(timeout: 10) {+            close.tap()+            waitUntilGone(close, "The export surface closes", timeout: 30)+        } else {+            let identifiedSurface = app.anyElement(sheetIdentifier)+            let surface = identifiedSurface.exists ? identifiedSurface : app.otherElements["ActivityListView"]+            let scopedClose = surface.descendants(matching: .button).matching(+                NSPredicate(format: "label == %@", "Close")).firstMatch+            waitFor(scopedClose, "The sharing surface offers Close", timeout: 15).tap()+            waitUntilGone(surface, "The sharing surface closes", timeout: 30)+        }+        waitUntilGone(app.anyElement(sheetIdentifier), "The staged document's sheet closes", timeout: 30)+    }+     /// Waits for whichever control selects `tab` in the layout on screen, taps     /// it, and returns it.     ///
Asterism/AsterismUITests/WideLayoutUITests.swift Modified
diff --git a/Asterism/AsterismUITests/WideLayoutUITests.swift b/Asterism/AsterismUITests/WideLayoutUITests.swiftindex d2d09197..4dcd1f35 100644--- a/Asterism/AsterismUITests/WideLayoutUITests.swift+++ b/Asterism/AsterismUITests/WideLayoutUITests.swift@@ -481,6 +481,49 @@ final class WideLayoutUITests: XCTestCase {             "today-strip-\(Self.dayIdentifier.string(from: todayDate(daysFromLaunch: days)))")     } +    func testSelectedDayNotesExportAndCancelInWideLayout() {+        launchToday()+        if !stripCell(daysFromLaunch: -1).exists { app.anyElement("today-week-previous").tap() }+        waitFor(stripCell(daysFromLaunch: -1), "The historical day is selected").tap()+        waitFor(recentRows.firstMatch, "A historical capture opens in the inspector").tap()+        waitFor(app.buttons["Edit"].firstMatch, "Inspector Edit opens the existing note editor").tap()+        waitFor(app.anyElement("entry-detail-rating-up"), "Save rating-only content for export").tap()+        let update = waitFor(app.buttons["entry-detail-update-button"], "The editor saves the rating")+        update.tap()+        let saved = expectation(for: NSPredicate(format: "isEnabled == true"), evaluatedWith: update)+        XCTAssertEqual(XCTWaiter().wait(for: [saved], timeout: 15), .completed, "The save finishes")+        waitFor(app.navigationBars.buttons["Back"].firstMatch, "The wide editor returns through Back").tap()+        returnToTodayHeader()+        let expected = "Export notes for " + todayDate(daysFromLaunch: -1).formatted(date: .long, time: .omitted)+        let menu = waitFor(app.anyElement("today-export-menu"), "The wide header offers daily export")+        XCTAssertEqual(menu.label, expected)+        menu.tap()+        waitFor(app.buttons.matching(NSPredicate(+            format: "identifier == %@ OR label == %@", "today-export-button", expected)).firstMatch,+            "The wide menu names its selected date").tap()+        let appeared = app.anyElement("today-export-share-sheet").waitForExistence(timeout: 30)+            || app.otherElements["ActivityListView"].waitForExistence(timeout: 5)+        XCTAssertTrue(appeared)+        cancelDocumentShare(in: app, sheetIdentifier: "today-export-share-sheet")+        XCTAssertEqual(app.anyElement("today-export-menu").label, expected)+        XCTAssertEqual(recentRows.count, 2)+        XCTAssertFalse(app.anyElement("wide-list-column").exists, "Today retains its full-width layout")+    }++    func testSelectedEmptyDayExportInWideLayout() {+        launchToday()+        if !stripCell(daysFromLaunch: -3).exists { app.anyElement("today-week-previous").tap() }+        waitFor(stripCell(daysFromLaunch: -3), "An empty historical day is selected").tap()+        let dateText = todayDate(daysFromLaunch: -3).formatted(date: .long, time: .omitted)+        waitFor(app.anyElement("today-export-menu"), "The wide empty day offers export").tap()+        waitFor(app.buttons.matching(NSPredicate(+            format: "identifier == %@ OR label == %@", "today-export-button", "Export notes for " + dateText)).firstMatch,+            "The empty-day menu names its date").tap()+        XCTAssertEqual(waitFor(app.anyElement("today-export-notice"), "The wide notice names the empty day").label,+            "There are no notes from \(dateText) to export.")+        XCTAssertFalse(app.anyElement("today-export-share-sheet").exists)+    }+     private var releaseRows: XCUIElementQuery {         app.elements(withIdentifierPrefix: "today-release-shelf-item-")     }@@ -508,6 +551,7 @@ final class WideLayoutUITests: XCTestCase {         XCTAssertTrue(             waitFor(app.buttons["sidebar-today"], "Today remains in the sidebar").isSelected,             "The work route stays on Today")+        XCTAssertFalse(app.anyElement("wide-list-column").exists, "Today keeps its single pane")         waitFor(app.buttons["BackButton"], "The work offers the way back to Today").tap()         waitFor(app.anyElement("recent-list"), "Back returns to the Today pane")         waitFor(
Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift b/Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swiftindex 303ada39..6ea15a35 100644--- a/Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift@@ -139,6 +139,10 @@ public protocol LibraryProviding: Sendable {     /// function (Q17). Call the `.current` overloads in production.     func entryExportInput(entryID: UUID, locale: Locale) async throws -> EntryExportInput     func workExportInput(workID: UUID, locale: Locale) async throws -> WorkExportInput+    /// The selected date and displayed formatting context, frozen by the+    /// caller before awaiting; unlike the single-record convenience overloads,+    /// this read never substitutes a current calendar or locale (T2404).+    func dayExportInput(day: CivilDay, calendar: Calendar, locale: Locale) async throws -> DayExportInput      // MARK: - Diagnoses 
Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift b/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swiftindex efcc5a29..9d418acb 100644--- a/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift@@ -30,6 +30,37 @@ extension LibraryRepository {         }     } +    /// Original captures on the selected civil day, carrying their current+    /// presented content. Selection and every block share one locked read;+    /// normalization precedes filtering so a later physical copy cannot move+    /// an older logical capture into the day (T2404, requirements 1.1–1.4).+    public func dayExportInput(+        day: CivilDay, calendar: Calendar, locale: Locale+    ) async throws -> DayExportInput {+        try await withLockedContext(+            mode: .shared, operation: "building selected-day export input"+        ) { context in+            let rows = try context.fetch(FetchDescriptor<Entry>())+            let canonicalWorkIDs = try Self.canonicalWorkIDs(normalising: rows, context: context)+            let entries = try Self.entryGroups(rows, canonicalWorkIDs: canonicalWorkIDs).values+                .map { try Self.snapshot($0) }+                .filter { DayExportRules.includes($0, day: day, calendar: calendar) }+                .sorted(by: DayExportRules.precedes)+            let dateText = Self.exportDateText(day.date(in: calendar), locale: locale, calendar: calendar)+            guard !entries.isEmpty else {+                return DayExportInput(day: day, dateText: dateText, blocks: [])+            }+            var sites = SiteLookupCache()+            let noEpisode = try NoEpisodeIndex(context: context)+            let blocks = try entries.map {+                try Self.exportInput(+                    for: $0, includingWork: true, sites: &sites, context: context,+                    locale: locale, noEpisode: noEpisode, calendar: calendar)+            }+            return DayExportInput(day: day, dateText: dateText, blocks: blocks)+        }+    }+     /// One work as an export input: its identity, its notes, and one block per     /// logical record, oldest-first by `firstCapturedAt` (Req 2, Decision 2).     public func workExportInput(workID: UUID, locale: Locale) async throws -> WorkExportInput {@@ -130,7 +161,8 @@ extension LibraryRepository {      // MARK: - Shared derivation -    /// The Site rows each hostname presents through, resolved once per read.+    /// The Site rows each hostname presents through, resolved once per read,+    /// plus standalone blocks' Work title/type lookups for batch exports.     ///     /// A per-hostname lookup, not a per-record one: presentation follows the     /// hostname winner (Decision 5 of `specs/relational-references`), and a@@ -139,6 +171,20 @@ extension LibraryRepository {     /// reads every row (Q6).     internal struct SiteLookupCache {         private var cache: [String: [Site]] = [:]+        private var types: WorkTypeDirectory?+        private var works: [UUID: WorkLine] = [:]++        private enum WorkLine {+            case missing+            case resolved(title: String, typeLabel: String?)++            var fields: (title: String, typeLabel: String?)? {+                switch self {+                case .missing: nil+                case .resolved(let title, let typeLabel): (title, typeLabel)+                }+            }+        }          /// Every row for the hostname, winner first.         mutating func rows(@@ -155,6 +201,39 @@ extension LibraryRepository {         ) throws -> Site? {             try rows(for: hostname, context: context).first         }++        /// Cache resolved and absent Work IDs explicitly. A dictionary's nil+        /// assignment would remove an absent lookup instead of remembering it.+        mutating func workLine(+            for workID: UUID, context: ModelContext, noEpisode: NoEpisodeIndex+        ) throws -> (title: String, typeLabel: String?)? {+            if let cached = works[workID] { return cached.fields }+            let directory: WorkTypeDirectory+            if let types { directory = types }+            else {+                directory = try LibraryRepository.workTypeDirectory(context: context)+                types = directory+            }+            let group: WorkGroup+            do {+                group = try LibraryRepository.fetchWorkGroup(+                    id: workID, context: context, types: directory)+            } catch let error as LibraryRepositoryError {+                guard case .recordNotFound = error else { throw error }+                works[workID] = .missing+                return nil+            }+            // Existing standalone block derivation: presented title/type only,+            // with no series or credit table reads and no appended work prose.+            // The fields-only path avoids traversing unrelated historical+            // entries while retaining the group's presented metadata/validation.+            let work = try LibraryRepository.snapshot(+                group, entryRows: [], canonicalWorkIDs: [:], types: directory, series: .empty,+                credits: .empty, history: try noEpisode.history(for: group.id))+            let resolved = WorkLine.resolved(title: work.displayTitle, typeLabel: work.typeDisplay.name)+            works[workID] = resolved+            return resolved.fields+        }     }      internal static func exportInput(@@ -163,7 +242,8 @@ extension LibraryRepository {         sites: inout SiteLookupCache,         context: ModelContext,         locale: Locale,-        noEpisode: NoEpisodeIndex+        noEpisode: NoEpisodeIndex,+        calendar: Calendar? = nil     ) throws -> EntryExportInput {         // The chapter title where there is one, the cleaned capture title         // otherwise (Req 1.2) — the same `presentationTitle` path Recent and@@ -180,42 +260,9 @@ extension LibraryRepository {             // no Site row exports its title uncleaned. Every other failure is the             // store not answering, and swallowing it would hand back a block             // silently missing the line it should have carried.-            // One directory for both reads below: the convenience-            // `fetchWorkGroup(id:context:)` fetches its own, so calling it and-            // then fetching another for `snapshot` would fold the type table-            // twice per exported entry.-            let types = try workTypeDirectory(context: context)-            let group: WorkGroup?-            do { group = try fetchWorkGroup(id: workID, context: context, types: types) }-            catch let error as LibraryRepositoryError {-                guard case .recordNotFound = error else { throw error }-                group = nil-            }-            if let group {-                // The group's carrier content, so a split work presents the same-                // title in the export as on its own screen (Req 1.9).-                // An **empty** series directory, for `mapV18WorkRecord`'s-                // reason: the two fields read off this snapshot are the title-                // and the type label, and the directory only ever fills-                // `series` — the membership label, which an entry block does not-                // carry. Folding the whole `Series` table per exported entry to-                // compose a label nothing reads is a read this path can skip.-                let work = try snapshot(-                    group, canonicalWorkIDs: [:], types: types, series: .empty,-                    // An empty credit index for the empty series directory's-                    // reason: an entry block carries a work's title and type-                    // label, never its credits.-                    credits: .empty,-                    history: try noEpisode.history(for: group.id))-                workTitle = work.displayTitle-                // The resolved display name, whatever kind of type it is: a-                // rename reaches the next export (Req 4.1), a removed or legacy-                // type still labels its works (Req 5.1), and untyped and-                // unresolved both omit the label — the first because there is-                // nothing to say, the second because saying anything would be-                // inventing it (Req 8.2, 8.6).-                workTypeLabel = work.typeDisplay.name-            }+            let work = try sites.workLine(for: workID, context: context, noEpisode: noEpisode)+            workTitle = work?.title+            workTypeLabel = work?.typeLabel         }          return EntryExportInput(@@ -223,7 +270,7 @@ extension LibraryRepository {             rawURLString: entry.rawURLString,             workTitle: workTitle,             workTypeLabel: workTypeLabel,-            dateText: exportDateText(entry.firstCapturedAt, locale: locale),+            dateText: exportDateText(entry.firstCapturedAt, locale: locale, calendar: calendar),             rating: entry.rating,             note: entry.note)     }@@ -255,7 +302,14 @@ extension LibraryRepository {     /// The date line's text (Req 1.3, Q8): `firstCapturedAt` in the given     /// locale's long style. The one place the export touches a locale, which is     /// what keeps the renderer pure and its goldens stable.-    internal static func exportDateText(_ date: Date, locale: Locale) -> String {-        date.formatted(Date.FormatStyle(date: .long, time: .omitted).locale(locale))+    internal static func exportDateText(+        _ date: Date, locale: Locale, calendar: Calendar? = nil+    ) -> String {+        var style = Date.FormatStyle(date: .long, time: .omitted).locale(locale)+        if let calendar {+            style.calendar = calendar+            style.timeZone = calendar.timeZone+        }+        return date.formatted(style)     } }
Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift b/Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swiftindex ef11b887..76c0f358 100644--- a/Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift@@ -47,6 +47,37 @@ public struct EntryExportInput: Sendable, Equatable {     } } +/// One selected civil day's notes, resolved under one repository observation.+/// Blocks already use newest original capture first, with UUID ties (T2404).+/// Date text is frozen upstream so rendering reads neither a clock nor locale.+public struct DayExportInput: Sendable, Equatable {+    public let day: CivilDay+    public let dateText: String+    public let blocks: [EntryExportInput]++    public init(day: CivilDay, dateText: String, blocks: [EntryExportInput]) {+        self.day = day+        self.dateText = dateText+        self.blocks = blocks+    }+}++/// Small value rules over normalized snapshots, independent of Today's+/// latest-share grouping and future folding (T2404, requirements 1.1–1.3).+internal enum DayExportRules {+    static func includes(_ entry: EntrySnapshot, day: CivilDay, calendar: Calendar) -> Bool {+        CivilDay(entry.firstCapturedAt, calendar: calendar) == day+            && (entry.rating != nil || !entry.note.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)+    }++    static func precedes(_ lhs: EntrySnapshot, _ rhs: EntrySnapshot) -> Bool {+        if lhs.firstCapturedAt != rhs.firstCapturedAt {+            return lhs.firstCapturedAt > rhs.firstCapturedAt+        }+        return lhs.id.uuidString.lowercased() < rhs.id.uuidString.lowercased()+    }+}+ /// Everything a per-work document needs (Req 2.1). /// /// `blocks` are already one per logical record and ordered oldest-first by@@ -215,6 +246,15 @@ public enum MarkdownExport {         document(entryParagraphs(input, includingWorkLine: true))     } +    /// Selected-day collection with the same blocks as standalone exports.+    public static func renderDay(_ input: DayExportInput) -> String {+        var paragraphs = ["# Notes — " + escape(collapsed(input.dateText))]+        for block in input.blocks {+            paragraphs.append(contentsOf: entryParagraphs(block, includingWorkLine: true))+        }+        return document(paragraphs)+    }+     /// One work as a document (Req 2): H1, site line, generic notes where     /// non-empty, then one block per entry — none of which carries a work line,     /// because the H1 already names the work (1.9).@@ -353,6 +393,11 @@ public enum MarkdownExport {         filename(title: input.headingText, fallback: "Entry")     } +    /// The selected Gregorian date, independent of the formatting locale.+    public static func filename(for input: DayExportInput) -> String {+        "Asterism Notes \(input.day).md"+    }+     /// The share sheet's filename for a per-work export (Req 2.4, Q11).     public static func filename(for input: WorkExportInput) -> String {         filename(title: input.titleText, fallback: "Work")
Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift b/Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swiftindex 77a0755d..85d6d7f2 100644--- a/Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift+++ b/Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift@@ -28,6 +28,14 @@ public nonisolated enum TodayDateText {     private static let completeStyle = Date.FormatStyle(date: .complete, time: .omitted)     private static let abbreviatedStyle = Date.FormatStyle(date: .abbreviated, time: .omitted) +    /// Export action text uses the same long date as its heading and empty+    /// notice; the explicit locale is frozen from the displayed calendar.+    public static func long(_ day: CivilDay, calendar: Calendar, locale: Locale) -> String {+        var style = stamped(Date.FormatStyle(date: .long, time: .omitted), with: calendar)+        style.locale = locale+        return day.date(in: calendar).formatted(style)+    }+     /// The full date, weekday included — a strip cell's accessibility label.     public static func complete(_ day: CivilDay, calendar: Calendar) -> String {         day.date(in: calendar).formatted(stamped(completeStyle, with: calendar))
Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift Modified
diff --git a/Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift b/Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swiftindex c79fa55d..61734761 100644--- a/Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift+++ b/Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift@@ -1,4 +1,5 @@ import Foundation+import SwiftData import Testing  @testable import AsterismCore@@ -12,6 +13,208 @@ import Testing struct ExportInputReadTests {     private let auLocale = Locale(identifier: "en_AU") +    // MARK: - Selected-day batch input (T2404)++    @Test("Daily input selects original capture day with current saved prose and ratings, without mutation")+    func selectedDayCurrentContent() async throws {+        let calendar = try dayExportCalendar(timeZone: "America/Los_Angeles")+        let selected = try dayExportDate(2026, 10, 6, calendar: calendar)+        let day = CivilDay(selected, calendar: calendar)+        let previous = day.adding(days: -1, calendar: calendar).date(in: calendar)+        let following = day.adding(days: 1, calendar: calendar).date(in: calendar)+        let fixture = try await M5Fixture(clock: FixedRepositoryClock(selected.addingTimeInterval(3_600)))+        let current = UUID()+        let ratingOnly = UUID()+        let oldReshared = UUID()+        let oldEdited = UUID()+        let future = UUID()+        let blank = UUID()+        let ids = [current, ratingOnly, oldReshared, oldEdited, future, blank]+        try await fixture.repository.seedM5Rows(entries: [+            M5SeedEntry(+                id: current, captureTitle: "Current", hostname: "example.test", path: "current",+                note: "Before editing", firstCapturedAt: selected, lastSharedAt: selected),+            M5SeedEntry(+                id: ratingOnly, captureTitle: "Rating only", hostname: "example.test", path: "rating",+                rating: .up, firstCapturedAt: selected.addingTimeInterval(1), lastSharedAt: selected),+            M5SeedEntry(+                id: oldReshared, captureTitle: "Old re-share", hostname: "example.test", path: "reshare",+                note: "Old capture", firstCapturedAt: previous, lastSharedAt: selected),+            M5SeedEntry(+                id: oldEdited, captureTitle: "Old edit", hostname: "example.test", path: "edit",+                note: "Old prose", firstCapturedAt: previous, lastSharedAt: previous),+            M5SeedEntry(+                id: future, captureTitle: "Future", hostname: "example.test", path: "future",+                note: "Future capture", firstCapturedAt: following, lastSharedAt: following),+            M5SeedEntry(+                id: blank, captureTitle: "Blank", hostname: "example.test", path: "blank",+                note: " \t\n", firstCapturedAt: selected, lastSharedAt: selected),+        ])+        try await fixture.repository.updateEntry(id: current, note: "  Saved **prose**.  ", rating: .down)+        try await fixture.repository.updateEntry(id: oldEdited, note: "Edited on selected day", rating: .up)+        var before: [EntrySnapshot] = []+        for id in ids { before.append(try await fixture.repository.entry(id: id)) }+        let countsBefore = try await fixture.repository.recordCounts()++        let input = try await fixture.repository.dayExportInput(day: day, calendar: calendar, locale: auLocale)++        #expect(input.day == day)+        #expect(input.dateText == "6 October 2026")+        #expect(input.blocks.map(\.headingText) == ["Rating only", "Current"])+        #expect(input.blocks.map(\.note) == ["", "  Saved **prose**.  "])+        #expect(input.blocks.map(\.rating) == [.up, .down])+        #expect(input.blocks.map(\.dateText) == ["6 October 2026", "6 October 2026"])+        #expect(try await fixture.repository.recordCounts() == countsBefore)+        var after: [EntrySnapshot] = []+        for id in ids { after.append(try await fixture.repository.entry(id: id)) }+        #expect(after == before)+    }++    @Test("Daily selection normalizes UUID rows before testing earliest capture and presented content")+    func selectedDayNormalizesBeforeFiltering() async throws {+        let calendar = try dayExportCalendar()+        let selected = try dayExportDate(2026, 10, 6, calendar: calendar)+        let day = CivilDay(selected, calendar: calendar)+        let earlier = day.adding(days: -1, calendar: calendar).date(in: calendar)+        let later = day.adding(days: 1, calendar: calendar).date(in: calendar)+        let fixture = try await M5Fixture()+        let offDay = UUID()+        let onDay = UUID()+        let torn = UUID()+        try await fixture.repository.seedM5Rows(entries: [+            // Selecting physical rows first would wrongly include this group's+            // later carrier instead of the group's off-day original capture.+            M5SeedEntry(+                id: offDay, captureTitle: "Off-day group", hostname: "example.test", path: "off",+                firstCapturedAt: earlier, lastSharedAt: earlier),+            M5SeedEntry(+                id: offDay, captureTitle: "Off-day group", hostname: "example.test", path: "off",+                note: "Later authored carrier", firstCapturedAt: selected, lastSharedAt: selected),+            // Conversely this carrier arrives with tomorrow's timestamp while+            // the original bare copy establishes the selected capture day.+            M5SeedEntry(+                id: onDay, captureTitle: "On-day group", hostname: "example.test", path: "on",+                firstCapturedAt: selected, lastSharedAt: selected),+            M5SeedEntry(+                id: onDay, captureTitle: "On-day group", hostname: "example.test", path: "on",+                note: "Current carrier", rating: .up, firstCapturedAt: later, lastSharedAt: later),+            M5SeedEntry(+                id: torn, captureTitle: "Torn group", hostname: "example.test", path: "torn",+                note: "Device A", firstCapturedAt: selected.addingTimeInterval(1), lastSharedAt: later),+            M5SeedEntry(+                id: torn, captureTitle: "Torn group", hostname: "example.test", path: "torn",+                note: "Device B", firstCapturedAt: selected.addingTimeInterval(2), lastSharedAt: later),+        ])+        let presented = try await fixture.repository.entry(id: torn)+        let counts = try await fixture.repository.recordCounts()+        let physicalBefore = try await fixture.repository.withLockedContext(+            mode: .shared, operation: "counting physical export fixture entries before export"+        ) { try $0.fetchCount(FetchDescriptor<Entry>()) }++        let input = try await fixture.repository.dayExportInput(day: day, calendar: calendar, locale: auLocale)++        #expect(input.blocks.map(\.headingText) == ["Torn group", "On-day group"])+        #expect(input.blocks.map(\.note) == [presented.note, "Current carrier"])+        #expect(input.blocks.map(\.dateText) == ["6 October 2026", "6 October 2026"])+        #expect(try await fixture.repository.recordCounts() == counts)+        #expect(counts.entries == 3, "Each application UUID remains one logical record")+        let physicalAfter = try await fixture.repository.withLockedContext(+            mode: .shared, operation: "counting physical export fixture entries after export"+        ) { try $0.fetchCount(FetchDescriptor<Entry>()) }+        #expect(physicalBefore == 6)+        #expect(physicalAfter == physicalBefore, "The read must not reconcile or collapse either group")+    }++    @Test("A future-selected day has exact frozen-zone boundaries and an empty day keeps its own date")+    func selectedDayBoundariesAndEmptyInput() async throws {+        let calendar = try dayExportCalendar(timeZone: "America/New_York")+        let day = CivilDay(+            try dayExportDate(2026, 11, 1, calendar: calendar), calendar: calendar)+        let start = day.date(in: calendar)+        let end = day.adding(days: 1, calendar: calendar).date(in: calendar)+        let fixture = try await M5Fixture(clock: FixedRepositoryClock(+            try dayExportDate(2026, 10, 6, calendar: calendar)))+        try await fixture.repository.seedM5Rows(entries: [+            M5SeedEntry(+                id: UUID(), captureTitle: "Before", hostname: "example.test", path: "before",+                note: "Excluded", firstCapturedAt: start.addingTimeInterval(-1)),+            M5SeedEntry(+                id: UUID(), captureTitle: "Start", hostname: "example.test", path: "start",+                note: "Included", firstCapturedAt: start),+            M5SeedEntry(+                id: UUID(), captureTitle: "End", hostname: "example.test", path: "end",+                rating: .down, firstCapturedAt: end.addingTimeInterval(-1)),+            M5SeedEntry(+                id: UUID(), captureTitle: "After", hostname: "example.test", path: "after",+                note: "Excluded", firstCapturedAt: end),+        ])++        let input = try await fixture.repository.dayExportInput(day: day, calendar: calendar, locale: auLocale)++        #expect(input.blocks.map(\.headingText) == ["End", "Start"])+        #expect(input.dateText == "1 November 2026")+        #expect(input.blocks.map(\.dateText) == ["1 November 2026", "1 November 2026"])+        let emptyDay = day.adding(days: 2, calendar: calendar)+        let empty = try await fixture.repository.dayExportInput(+            day: emptyDay, calendar: calendar, locale: Locale(identifier: "en_US"))+        #expect(empty.blocks.isEmpty)+        #expect(empty.day == emptyDay)+        #expect(empty.dateText == "November 3, 2026")+    }++    @Test("Daily input keeps distinct duplicate UUIDs and uses presented Work and Site metadata")+    func selectedDayDistinctRecordsAndMetadata() async throws {+        let calendar = try dayExportCalendar()+        let selected = try dayExportDate(2026, 10, 6, calendar: calendar)+        let day = CivilDay(selected, calendar: calendar)+        let fixture = try await M5Fixture()+        let workID = UUID()+        let lower = try #require(UUID(uuidString: "00000000-0000-0000-0000-00000000000a"))+        let higher = try #require(UUID(uuidString: "00000000-0000-0000-0000-00000000000b"))+        try await fixture.repository.seedM5Rows(+            sites: [M5SeedSite(+                hostname: "taught.test", mode: .taught, wholeTitleRule: true, trimPrefix: "Read: ")],+            works: [+                M5SeedWork(+                    id: workID, displayTitle: "Parsed Title", hostname: "taught.test",+                    titleProvenance: .parsed, lastParsedTitle: "Parsed Title"),+                M5SeedWork(+                    id: workID, displayTitle: "Reader Title", hostname: "taught.test",+                    workTypeID: WorkTypeSeeding.seeds[0].id),+            ], entries: [+                M5SeedEntry(+                    id: higher, captureTitle: "Read: Shared URL", hostname: "taught.test", path: "same",+                    note: "B", firstCapturedAt: selected, workID: workID, workRowIndex: 0),+                M5SeedEntry(+                    id: lower, captureTitle: "Read: Shared URL", hostname: "taught.test", path: "same",+                    note: "A", firstCapturedAt: selected, workID: workID, workRowIndex: 1),+                M5SeedEntry(+                    id: UUID(), captureTitle: "Raw missing-site title", hostname: "missing.test", path: "loose",+                    note: "Unattached", firstCapturedAt: selected.addingTimeInterval(1)),+            ])++        let input = try await fixture.repository.dayExportInput(day: day, calendar: calendar, locale: auLocale)++        #expect(input.blocks.map(\.note) == ["Unattached", "A", "B"])+        #expect(input.blocks.map(\.headingText) == ["Raw missing-site title", "Shared URL", "Shared URL"])+        #expect(input.blocks.map(\.workTitle) == [nil, "Reader Title", "Reader Title"])+        #expect(input.blocks.map(\.workTypeLabel) == [nil, "novel", "novel"])+        #expect(try await fixture.repository.recordCounts().entries == 3)+    }++    private func dayExportCalendar(timeZone: String = "UTC") throws -> Calendar {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: timeZone))+        calendar.locale = auLocale+        return calendar+    }++    private func dayExportDate(+        _ year: Int, _ month: Int, _ day: Int, calendar: Calendar+    ) throws -> Date {+        try #require(calendar.date(from: DateComponents(year: year, month: month, day: day)))+    }+     @Test("A torn identity group exports one block of the content the app presents (1.8, 2.5)")     func splitGroupExportsOnce() async throws {         let fixture = try await M5Fixture()
Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift Modified
diff --git a/Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift b/Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swiftindex 84e64510..38e2660d 100644--- a/Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift+++ b/Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift@@ -11,6 +11,150 @@ import Testing @Suite("Markdown export rendering") struct MarkdownExportTests { +    // MARK: - Selected-day documents (T2404)++    @Test("A selected-day document keeps standalone work lines, rating-only blocks and literal notes")+    func selectedDayDocument() throws {+        let calendar = try dayCalendar()+        let day = CivilDay(try dayDate(2026, 10, 6, calendar: calendar), calendar: calendar)+        let note = "  First line.\n\n*Reader's own markdown.*  "+        let input = DayExportInput(+            day: day, dateText: "6 October 2026", blocks: [+                EntryExportInput(+                    headingText: "Chapter [12]", rawURLString: "https://example.test/a (12)",+                    workTitle: "Ember *Road*", workTypeLabel: "novel",+                    dateText: "6 October 2026", rating: .up, note: note),+                EntryExportInput(+                    headingText: "An article", rawURLString: "https://example.test/article",+                    dateText: "6 October 2026", rating: .down),+            ])++        #expect(MarkdownExport.renderDay(input) == """+            # Notes — 6 October 2026++            ## [Chapter \\[12\\]](https://example.test/a%20%2812%29)++            *Ember \\*Road\\** (novel)++            ▲ · 6 October 2026++            \(note)++            ## [An article](https://example.test/article)++            ▼ · 6 October 2026++            """)+        #expect(MarkdownExport.filename(for: input) == "Asterism Notes 2026-10-06.md")+    }++    @Test("The selected-day filename is Gregorian and independent of its displayed date text")+    func selectedDayFilename() throws {+        let calendar = try dayCalendar()+        for (year, month, date, expected) in [+            (2020, 1, 2, "Asterism Notes 2020-01-02.md"),+            (2030, 12, 31, "Asterism Notes 2030-12-31.md"),+        ] {+            let day = CivilDay(+                try dayDate(year, month, date, calendar: calendar), calendar: calendar)+            let input = DayExportInput(day: day, dateText: "A different locale's date", blocks: [])+            #expect(MarkdownExport.filename(for: input) == expected)+            #expect(MarkdownExport.renderDay(input) == "# Notes — A different locale's date\n")+        }+    }++    @Test("Selected-day membership uses original capture, regardless of later shares and edits")+    func selectedDayCaptureMembership() throws {+        let calendar = try dayCalendar()+        let dates = try [5, 6, 7].map { try dayDate(2026, 10, $0, calendar: calendar) }+        let entries = dates.map {+            dayEntry(capturedAt: $0, note: "Saved note", activityAt: dates[2])+        }+        // Past, current and future selections have exactly the same equality+        // rule; there is no clock-dependent or future-folding branch.+        for (index, date) in dates.enumerated() {+            let day = CivilDay(date, calendar: calendar)+            #expect(entries.map { DayExportRules.includes($0, day: day, calendar: calendar) }+                == entries.indices.map { $0 == index })+        }+    }++    @Test("Blank unrated captures are excluded while either rating counts without prose")+    func selectedDayContentMembership() throws {+        let calendar = try dayCalendar()+        let date = try dayDate(2026, 10, 6, calendar: calendar)+        let day = CivilDay(date, calendar: calendar)+        let cases: [(String, Rating?, Bool)] = [+            ("", nil, false), (" \t\n", nil, false), ("Kept", nil, true),+            ("", .up, true), (" \n", .down, true),+        ]+        for (note, rating, expected) in cases {+            #expect(DayExportRules.includes(+                dayEntry(capturedAt: date, note: note, rating: rating),+                day: day, calendar: calendar) == expected)+        }+    }++    @Test("Selected-day blocks sort by newest capture then UUID rather than activity")+    func selectedDayOrdering() throws {+        let calendar = try dayCalendar()+        let date = try dayDate(2026, 10, 6, calendar: calendar)+        let lower = try #require(UUID(uuidString: "00000000-0000-0000-0000-00000000000a"))+        let higher = try #require(UUID(uuidString: "00000000-0000-0000-0000-00000000000b"))+        let newest = try #require(UUID(uuidString: "00000000-0000-0000-0000-00000000000c"))+        let entries = [+            dayEntry(id: higher, capturedAt: date, note: "B", activityAt: date.addingTimeInterval(999)),+            dayEntry(id: newest, capturedAt: date.addingTimeInterval(1), note: "C"),+            dayEntry(id: lower, capturedAt: date, note: "A"),+        ]+        #expect(entries.sorted(by: DayExportRules.precedes).map(\.id) == [newest, lower, higher])+    }++    @Test("Frozen-zone membership honors both short and long DST calendar days")+    func selectedDayDSTBoundaries() throws {+        let calendar = try dayCalendar(timeZone: "America/New_York")+        for (month, date, hours) in [(3, 8, 23), (11, 1, 25)] {+            let day = CivilDay(+                try dayDate(2026, month, date, calendar: calendar), calendar: calendar)+            let start = day.date(in: calendar)+            let end = day.adding(days: 1, calendar: calendar).date(in: calendar)+            #expect(end.timeIntervalSince(start) == Double(hours * 3_600))+            for (capture, expected) in [+                (start.addingTimeInterval(-1), false), (start, true),+                (end.addingTimeInterval(-1), true), (end, false),+            ] {+                #expect(DayExportRules.includes(+                    dayEntry(capturedAt: capture, note: "Boundary"),+                    day: day, calendar: calendar) == expected)+            }+        }+    }++    private func dayCalendar(timeZone: String = "UTC") throws -> Calendar {+        var calendar = Calendar(identifier: .gregorian)+        calendar.timeZone = try #require(TimeZone(identifier: timeZone))+        calendar.locale = Locale(identifier: "en_AU")+        return calendar+    }++    private func dayDate(_ year: Int, _ month: Int, _ day: Int, calendar: Calendar) throws -> Date {+        try #require(calendar.date(from: DateComponents(year: year, month: month, day: day)))+    }++    private func dayEntry(+        id: UUID = UUID(), capturedAt: Date, note: String = "", rating: Rating? = nil,+        activityAt: Date? = nil+    ) -> EntrySnapshot {+        EntrySnapshot(+            id: id, captureTitle: "A note", captureTitleSource: .manual,+            rawURLString: "https://example.test/note", canonicalURLString: nil,+            hostname: "example.test", entryIdentityKey: "note", identityKeyVersion: 1,+            chapterTitle: nil, chapterTitleProvenance: .absent, note: note, rating: rating,+            firstCapturedAt: capturedAt, lastSharedAt: activityAt ?? capturedAt,+            modifiedAt: activityAt ?? capturedAt, workID: nil,+            workAssignmentProvenance: .absent, intentionallyUnattached: false)+    }+     // MARK: - Entry blocks (Req 1)      @Test("A rated, attached entry renders heading, work line, date and note as distinct paragraphs")
specs/export-todays-notes/gate-evidence.json Added
diff --git a/specs/export-todays-notes/gate-evidence.json b/specs/export-todays-notes/gate-evidence.jsonnew file mode 100644index 00000000..2b477bd6--- /dev/null+++ b/specs/export-todays-notes/gate-evidence.json@@ -0,0 +1,461 @@+{+  "ticket": "T2404",+  "branch": "T-2404/export-selected-day-notes",+  "base": "917037176c8e1fa440c4d36916d92bd99f14032c",+  "app_checkpoint": "10491a20ef7a762a6244449c6ef6d44fe80154d3",+  "recorded_date_utc": "2026-10-07",+  "purpose": "Durable local review checkpoint: preserve observed passes and original failures. Raw logs/results remain at the hashed local paths; no full-gate acceptance or publication approval is inferred.",+  "source_at_checkpoint": {+    "Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift": {+      "sha256": "4c10ffd35996613d8a1df020799616b5213e70a02b78cfa37528325749b93303",+      "change": "Reviewed Work metadata lookup uses existing snapshot overload with empty entryRows; verified by full Core/native."+    },+    "Asterism/AsterismUITests/AccessibilityJourneyUITests.swift": {+      "sha256": "ee6257463a9796da6997222d3acb3875db4b48799ee11cb30cb75d9446a57771",+      "change": "Reviewed lazy-row chapter journey reuses existing bounded list-scroll helper; exact case and second broad-run case passed."+    },+    "Asterism/AsterismUITests/AnnouncementUITests.swift": {+      "sha256": "6f29c8d1dbceec8afd733608a244a6720b8d5dada35f6683a7698c07d0c06704",+      "change": "Restored to exact app checkpoint bytes; temporary diagnostic instrumentation removed."+    }+  },+  "source_inventory": {+    "counts": {+      "core": 3404,+      "native": 2000,+      "phone_ui": 209,+      "ipad_ui": 26+    },+    "groups": {+      "core": {+        "count": 3404,+        "ordered_json_sha256": "01d076b9291b877e7a84cb08692b98d48be32a8d86bf67bffdea840a810e20f3"+      },+      "native": {+        "count": 2000,+        "ordered_json_sha256": "9a756e39d043a460f0536e84f9c37363f618eb26a30aa0f747c9ffc60c182e9a"+      },+      "phone_ui": {+        "count": 209,+        "ordered_json_sha256": "d76437bbcaef94efa1031eac288c3c55eff21a46486bc44085b6dbcc6edfd876"+      },+      "ipad_ui": {+        "count": 26,+        "ordered_json_sha256": "d4e5396e39f34ce05cfa26a3813d3e24fd00295980934f4ab1bd8150e04e7a17"+      }+    },+    "artifact": {+      "path": "/tmp/t2404-prepush/source-inventory.json",+      "sha256": "7c7c1c492c32ff9c31acaa83d0d03362cff0fed99f5cd06507abe2b13f9204cd"+    },+    "hash_encoding": "UTF-8 JSON, ensure_ascii=false, compact separators, original array order"+  },+  "runs": [+    {+      "gate": "core-full",+      "attempt": 1,+      "exit_code": 2,+      "log": "/tmp/t2404-prepush/core-full-1.log",+      "junit": "/tmp/t2404-prepush/review-inputs/core-full-1-swift-testing.xml",+      "test_declarations": 3404,+      "failed": 3,+      "skipped": 55,+      "failures": [+        {+          "classname": "AsterismCoreTests.RepositoryBootstrapTests",+          "name": "storeWithoutMarker()",+          "message": {+            "message": "Caught error: Error Domain=NSCocoaErrorDomain Code=4 \"The file “AsterismStoreTestHelper” doesn’t exist.\" UserInfo={NSFilePath=/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/Packages/AsterismCore/.build/debug/AsterismStoreTestHelper} (error)"+          }+        },+        {+          "classname": "AsterismCoreTests.RepositoryBootstrapTests",+          "name": "processDeathReleasesLock()",+          "message": {+            "message": "Caught error: Error Domain=NSCocoaErrorDomain Code=4 \"The file “AsterismStoreTestHelper” doesn’t exist.\" UserInfo={NSFilePath=/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/Packages/AsterismCore/.build/debug/AsterismStoreTestHelper} (error)"+          }+        },+        {+          "classname": "AsterismCoreTests.RepositoryBootstrapTests",+          "name": "helperBootstrapRace()",+          "message": {+            "message": "Caught error: Error Domain=NSCocoaErrorDomain Code=4 \"The file “AsterismStoreTestHelper” doesn’t exist.\" UserInfo={NSFilePath=/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/Packages/AsterismCore/.build/debug/AsterismStoreTestHelper} (error)"+          }+        }+      ],+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-core-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-core-swift-module-cache make test-core CORE_TEST='' XCBEAUTIFY= 'SWIFT_TEST_FLAGS=--scratch-path /tmp/t2404-core-build --cache-path /tmp/t2404-core-cache --config-path /tmp/t2404-core-config --security-path /tmp/t2404-core-security --xunit-output /tmp/t2404-prepush/review-inputs/core-full.xml' > /tmp/t2404-prepush/core-full-1.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/core-full-1.sh",+        "sha256": "d63f19356daef075e6d94a7113a04907e9bf33de8cabf5009f9fc07a092ca808"+      }+    },+    {+      "gate": "core-full",+      "attempt": 2,+      "exit_code": 0,+      "log": "/tmp/t2404-prepush/core-full-2.log",+      "log_sha256": "aac5525f050900b0b12afbe6bf84c0a58ae9ee4303c5959e451856d994b8860a",+      "junit": "/tmp/t2404-prepush/review-inputs/core-full-2-swift-testing.xml",+      "test_declarations": 3404,+      "passed_declarations": 3349,+      "failed": 0,+      "skipped_declarations": 55,+      "skip_reason": "Existing source-declared opt-in M4 performance/fixture generators; no extra filter or exception",+      "actual_inventory_source_matches_exactly": true,+      "actual_declaration_ids": {+        "count": 3404,+        "ordered_json_sha256": "5874fe317fa952d65248d6e5d8f0e3cdb688a979a0f811b6d29c0bdf521588d9",+        "full_inventory_source": "/tmp/t2404-prepush/gate-results.json"+      },+      "raw_parameter_argument_starts": 2394,+      "nonparameter_passed_declarations": 3155,+      "identity": "passed",+      "tracked_changes_during_run": [],+      "verified_review_fix_sha256": "4c10ffd35996613d8a1df020799616b5213e70a02b78cfa37528325749b93303",+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-core-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-core-swift-module-cache make test-core CORE_TEST='' XCBEAUTIFY= 'SWIFT_TEST_FLAGS=--scratch-path /tmp/t2404-core-build --cache-path /tmp/t2404-core-cache --config-path /tmp/t2404-core-config --security-path /tmp/t2404-core-security --xunit-output /tmp/t2404-prepush/review-inputs/core-full-2.xml' > /tmp/t2404-prepush/core-full-2.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/core-full-2.sh",+        "sha256": "9bab0e4b07ab3313c0497efd538815a340be128b2ea8c30a73a1ac98d1cd1f6c"+      }+    },+    {+      "gate": "native-full-and-signed-mac",+      "attempt": 1,+      "exit_code": 0,+      "result": "passed",+      "head": "10491a20ef7a762a6244449c6ef6d44fe80154d3",+      "source_review_fix_sha256": "4c10ffd35996613d8a1df020799616b5213e70a02b78cfa37528325749b93303",+      "command_script": "/tmp/t2404-prepush/native-full-and-signed-mac-1.sh",+      "log": "/tmp/t2404-prepush/native-full-and-signed-mac-1.log",+      "xcresult": "/tmp/t2404-prepush/native-full-1.xcresult",+      "summary": "/tmp/t2404-prepush/review-inputs/native-full-1-summary.json",+      "tests": "/tmp/t2404-prepush/review-inputs/native-full-1-tests.json",+      "declared": 2000,+      "passed_declarations": 2000,+      "passed_execution_cases": 2122,+      "dynamic_parameter_declarations": 28,+      "dynamic_parameter_runs": 150,+      "skipped": 0,+      "failed": 0,+      "exact_source_inventory_match": true,+      "missing": [],+      "unexpected": [],+      "actual_test_ids": {+        "count": 2000,+        "ordered_json_sha256": "4743f88cf5b7eb7da8ed319fa1acb4e75768b3a2fd55d6376a56153a1ad7677a",+        "full_inventory_source": "/tmp/t2404-prepush/gate-results.json"+      },+      "signed_mac_build": {+        "passed": true,+        "signed": true,+        "embedded_extension_assertion": "build-mac prerequisite passed; command exit0 proceeded to native",+        "installed_or_launched": false+      },+      "tracked_source_changes": [],+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-quick SKIP_MAC=0 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/native-full-1.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/native-full-and-signed-mac-1.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/native-full-and-signed-mac-1.sh",+        "sha256": "83542b725cf6cb9cda319dfbb27d659211909e00b371a97015bd3abd06588a27"+      }+    },+    {+      "gate": "phone-ui-full",+      "attempt": 1,+      "exit_code": 2,+      "result": "failed_partial",+      "partial": true,+      "interrupted_after_concrete_failure": true,+      "head": "10491a20ef7a762a6244449c6ef6d44fe80154d3",+      "script": "/tmp/t2404-prepush/phone-ui-full-1.sh",+      "log": "/tmp/t2404-prepush/phone-ui-full-1.log",+      "xcresult": "/tmp/t2404-prepush/phone-ui-full-1.xcresult",+      "finished_from_log": 9,+      "passed_from_log": 8,+      "failed_from_log": 1,+      "skipped_from_log": 0,+      "executed_case_log_inventory": {+        "count": 9,+        "ordered_json_sha256": "0118009bde16e81a42047460e90b29e87f7b886e99b470bf07bfba1062116cbf",+        "full_inventory_source": "/tmp/t2404-prepush/gate-results.json"+      },+      "expected_source_declarations": 209,+      "exact_full_inventory_match": false,+      "diagnostic_before_drain": "/tmp/t2404-prepush/review-inputs/phone-ui-full-1-before-drain.json",+      "drain_sample": "/tmp/t2404-prepush/review-inputs/phone-ui-full-1-drain-sample.txt",+      "bundle_read_error": "Error: Failed to create a new result bundle reader, underlying error: Info.plist at /tmp/t2404-prepush/phone-ui-full-1.xcresult/Info.plist does not exist, the result bundle might be corrupted or the provided path is not a result bundle\nUsage: xcresulttool <subcommand>\n  See 'xcresulttool --help' for more information.\n",+      "failure": "AccessibilityJourneyUITests/testTheEntryTitleCardsWorkNameOpensTheWorkAtLargestDynamicType at unchanged test1179: Recent lists a taught chapter",+      "triage": "Waits for lazy row before bounded scroll; same suite documents/handles that behavior in openSeededEntry. Correct actual test bug via existing helper, preserve assertion and fixture. Geometry not yet runtimeconfirmed.",+      "xcode_drain": "SIGINT then bounded diagnostics and scoped SIGTERM after Xcode internal finalisation error; process drained exit2. Owned phone shut down.",+      "tracked_source_changes": [],+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-ui 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/phone-ui-full-1.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/phone-ui-full-1.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/phone-ui-full-1.sh",+        "sha256": "8dfaadd8072cf4d2d089ad8394f2d76ca1f3342415d3b7d3544ba1265db7d79b"+      },+      "original_assertion_log_lines": [+        "/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/Asterism/AsterismUITests/AccessibilityJourneyUITests.swift:1179: error: -[AsterismUITests.AccessibilityJourneyUITests testTheEntryTitleCardsWorkNameOpensTheWorkAtLargestDynamicType] : XCTAssertTrue failed - Recent lists a taught chapter"+      ]+    },+    {+      "gate": "phone-ui-lazy-row-fix",+      "attempt": 1,+      "result": "passed",+      "exit_code": 0,+      "passed": 1,+      "failed": 0,+      "skipped": 0,+      "actual_test_ids": [+        "AccessibilityJourneyUITests/testTheEntryTitleCardsWorkNameOpensTheWorkAtLargestDynamicType()"+      ],+      "snapshot": "/tmp/t2404-prepush/review-inputs/pre-ui-fix-snapshot.json",+      "source_sha256": "ee6257463a9796da6997222d3acb3875db4b48799ee11cb30cb75d9446a57771",+      "log": "/tmp/t2404-prepush/phone-ui-lazy-row-fix-1.log",+      "xcresult": "/tmp/t2404-prepush/phone-ui-lazy-row-fix-1.xcresult",+      "summary": "/tmp/t2404-prepush/review-inputs/phone-ui-lazy-row-fix-1-summary.json",+      "tests": "/tmp/t2404-prepush/review-inputs/phone-ui-lazy-row-fix-1-tests.json",+      "tracked_source_changes": [],+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-only 'TEST=AsterismUITests/AccessibilityJourneyUITests/testTheEntryTitleCardsWorkNameOpensTheWorkAtLargestDynamicType' 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/phone-ui-lazy-row-fix-1.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/phone-ui-lazy-row-fix-1.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/phone-ui-lazy-row-fix-1.sh",+        "sha256": "4af5544f10f3a118069c299ee0bf785eb099a45c51bf6013d4f8e36fbde6d263"+      }+    },+    {+      "gate": "phone-ui-full",+      "attempt": 2,+      "exit_code": 2,+      "result": "failed_partial",+      "partial": true,+      "interrupted_after_concrete_failure": true,+      "log": "/tmp/t2404-prepush/phone-ui-full-2.log",+      "xcresult": "/tmp/t2404-prepush/phone-ui-full-2.xcresult",+      "summary": "/tmp/t2404-prepush/review-inputs/phone-ui-full-2-summary.json",+      "bundle_read_error": "Error: Failed to create a new result bundle reader, underlying error: Info.plist at /tmp/t2404-prepush/phone-ui-full-2.xcresult/Info.plist does not exist, the result bundle might be corrupted or the provided path is not a result bundle\nUsage: xcresulttool <subcommand>\n  See 'xcresulttool --help' for more information.\n",+      "finished_execution_cases_from_log": 33,+      "finished_distinct_declarations_from_log": 30,+      "passed_cases_from_log": 32,+      "failed_cases_from_log": 1,+      "actual_execution_inventory": {+        "count": 33,+        "ordered_json_sha256": "753c3715967523f45832e85ba6e5a0d847b4ce35bad2387a9defbb3e7ab4c336",+        "full_inventory_source": "/tmp/t2404-prepush/gate-results.json"+      },+      "expected_declarations": 209,+      "exact_full_inventory_match": false,+      "diagnostic": "/tmp/t2404-prepush/review-inputs/phone-ui-full-2-before-drain.json",+      "source_snapshot": "/tmp/t2404-prepush/review-inputs/pre-ui-fix-snapshot.json",+      "failure": "AnnouncementUITests/testTheRowStaysHittableAtLargestDynamicType at165: original isHittable assertion; ≥44 height assertion not yet reached.",+      "triage": "Row exists initially; one-direction app swipes later remove it from query. Exact frame/screenshot diagnosis required; no semantic weakening or productionbug claim.",+      "drain": "Guarded SIGTERM only to owned xcodebuild37462. Natural shell drainexit2; raw log BUILD INTERRUPTED, makeError143.",+      "tracked_changes_during_gate": [],+      "post_drain_diagnostic_edits": [+        "Asterism/AsterismUITests/AnnouncementUITests.swift"+      ],+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-ui 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/phone-ui-full-2.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/phone-ui-full-2.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/phone-ui-full-2.sh",+        "sha256": "84d7f9ec9ecf37dbb51c8404b2bfe32d7d8ee2131ce4da486442f3be153e222c"+      },+      "original_assertion_log_lines": [+        "/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/Asterism/AsterismUITests/AnnouncementUITests.swift:165: error: -[AsterismUITests.AnnouncementUITests testTheRowStaysHittableAtLargestDynamicType] : XCTAssertTrue failed - Req 3: the row keeps a hit target at the largest Dynamic Type size"+      ]+    },+    {+      "gate": "announcement-geometry-diagnostic",+      "attempt": 1,+      "exit_code": 0,+      "result": "passed",+      "passed": 1,+      "failed": 0,+      "skipped": 0,+      "xcresult": "/tmp/t2404-prepush/announcement-geometry-1.xcresult",+      "log": "/tmp/t2404-prepush/announcement-geometry-1.log",+      "summary": "/tmp/t2404-prepush/review-inputs/announcement-geometry-1-summary.json",+      "tests": "/tmp/t2404-prepush/review-inputs/announcement-geometry-1-tests.json",+      "diagnostic_source_sha256": "984dbc61cdcec709314f9f64a3bf4eaacb4e76dd9baf824fcd18c743dac15162",+      "instrumentation_branch_executed": false,+      "geometry_evidence": "No diagnostic lines: original row alreadyhittable; loopnotentered. Originalassertions passed but transient fullrun failure cause remains unproven.",+      "required_full_gate": false,+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-only 'TEST=AsterismUITests/AnnouncementUITests/testTheRowStaysHittableAtLargestDynamicType' 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/announcement-geometry-1.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/announcement-geometry-1.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/announcement-geometry-1.sh",+        "sha256": "e984da8daa2ef3e582c2e96512ff833640d13d2d7688a2fafa5b291a00b4c7c6"+      }+    },+    {+      "gate": "announcement-geometry-diagnostic",+      "attempt": 2,+      "exit_code": 2,+      "xcode_test_exit": 65,+      "result": "infrastructure_failed",+      "passed": 0,+      "failed_test_cases": 0,+      "executed": 0,+      "expected_declarations": 1,+      "inventory_complete": false,+      "required_full_gate": false,+      "log": "/tmp/t2404-prepush/announcement-geometry-2.log",+      "xcresult": "/tmp/t2404-prepush/announcement-geometry-2.xcresult",+      "source_sha256": "2cbdb5718fd68e1236c3f92ed7a4dbd55e77642666547b0841e13e5be90e4a54",+      "blocker": "AsterismUITests-Runner failed to prepare owned simulator: Unable to boot Simulator; launchd failed to respond; launchd_sim could not bind to session, may have crashed or quit responding.",+      "bounded_diagnostics": {+        "sample_seconds": 3,+        "sample": "/tmp/t2404-prepush/review-inputs/announcement-geometry-2-hang-sample.txt",+        "process_tree": "/tmp/t2404-prepush/review-inputs/announcement-geometry-2-owned-process-tree.json",+        "finding": "Xcode waited for its own simctl diagnose collector (--udid ownedphone, --timeout=600). Terminated only verified collector50870 after sample to flush primary failure; xcode50429 naturally drained.",+        "elapsed_to_drain_seconds": 352.67+      },+      "queue_instruction": "Parent explicitly requestsrelease aftercurrentboundedcommand andno broadretry inreservation; not anacceptancewaiver.",+      "exact_command_script": "set -o pipefail\nCLANG_MODULE_CACHE_PATH=/tmp/t2404-native-clang-module-cache SWIFTPM_MODULECACHE_OVERRIDE=/tmp/t2404-native-swift-module-cache make test-only 'TEST=AsterismUITests/AnnouncementUITests/testTheRowStaysHittableAtLargestDynamicType' 'DESTINATION=platform=iOS Simulator,id=8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B' DERIVED_DATA=/tmp/t2404-native-derived-data XCBEAUTIFY= 'XCODE_TEST_FLAGS=-resultBundlePath /tmp/t2404-prepush/announcement-geometry-2.xcresult -clonedSourcePackagesDirPath /tmp/t2404-native-source-packages' > /tmp/t2404-prepush/announcement-geometry-2.log 2>&1",+      "command_script_artifact": {+        "path": "/tmp/t2404-prepush/announcement-geometry-2.sh",+        "sha256": "c1affa6be801a966351ad294203dab937e2dda2bf78f1fc85f3b3a54367785ad"+      }+    }+  ],+  "artifact_hashes": [+    {+      "path": "/tmp/t2404-prepush/core-full-1.log",+      "sha256": "1d648511d96eb1d26ee54da79f4464b790b9a6dab89156036aa2d0759d761024"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/core-full-1-swift-testing.xml",+      "sha256": "4e28968afbf8e452288b0fa7ea68826e68b2b86d035d09cec6dbfaa056049998"+    },+    {+      "path": "/tmp/t2404-prepush/core-full-2.log",+      "sha256": "aac5525f050900b0b12afbe6bf84c0a58ae9ee4303c5959e451856d994b8860a"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/core-full-2-swift-testing.xml",+      "sha256": "0927a47a650921be9de3bc1e7f7adc7ab4d38ca3dcdf9fbd24aedd27601efad5"+    },+    {+      "path": "/tmp/t2404-prepush/native-full-and-signed-mac-1.log",+      "sha256": "80a186f28b1015581f7d74c86c76b2c18080ff68b132966d75992ff382df93c1"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/native-full-1-summary.json",+      "sha256": "51a50595b74305c32b202dae9a7b32763e5057a3b5eaa5a20f89ec8bec16fea4"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/native-full-1-tests.json",+      "sha256": "03e730f350a0da0b5147de748fdd3e87d77199623242dffcebfdcc848e5b44b9"+    },+    {+      "path": "/tmp/t2404-prepush/phone-ui-full-1.log",+      "sha256": "3bc3f670277402b5e589724a8c0ef775ebb1fc2f84edf5e0a6387c29fbf9e461"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-full-1-before-drain.json",+      "sha256": "63f9cd065f9017216beca1b7bc12764009116e0966d353fb9de670bcf421b8d0"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-full-1-drain-sample.txt",+      "sha256": "1866fa39dd48ac5862904460bdf855bfdc650b23b0a58c7ccfccb7b1a9d3a02a"+    },+    {+      "path": "/tmp/t2404-prepush/phone-ui-lazy-row-fix-1.log",+      "sha256": "587805ee46dfd35f992940aa20e694c2a9c46954c8917e965783818d40c698aa"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-lazy-row-fix-1-summary.json",+      "sha256": "2c100390131c7052abfb6b73638209402f3a1fcfc75c0cb4a534a48e86ea4229"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-lazy-row-fix-1-tests.json",+      "sha256": "200fcceb986da4c0b76ca4ec0adb34c0e3d2140d7144f8a2bfa06a1356a0a4cd"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/pre-ui-fix-snapshot.json",+      "sha256": "982aaf6935a54d21bf0e86425557f75b15729d5b21ddfd647670f1391a2d26c6"+    },+    {+      "path": "/tmp/t2404-prepush/phone-ui-full-2.log",+      "sha256": "9ce0c9a2cb994cf1ff420d7d56bd1e1e6a01dd97d31844cd30318937f2868a02"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-full-2-summary.json",+      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/phone-ui-full-2-before-drain.json",+      "sha256": "9732204fd5e10226913e8caa0a66a9cbfb7953f8aa3f2de45a1d6e031b4cb2f2"+    },+    {+      "path": "/tmp/t2404-prepush/announcement-geometry-1.log",+      "sha256": "09a3ea05cb3c5e2f4c9ab9c8123367c9565d2a1ef99bf82414017f8671c46abc"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/announcement-geometry-1-summary.json",+      "sha256": "a8df5003035a771fda4f1e45a8f3be4db5ab1bbd85f91d9f0b5eba5101730768"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/announcement-geometry-1-tests.json",+      "sha256": "bb2f8b3df00855b2fe816bafd7d8e2e7349a1726941ea61709bd1e647b0b65fc"+    },+    {+      "path": "/tmp/t2404-prepush/announcement-geometry-2.log",+      "sha256": "9dbf17dbf5e9c3ee12f24535f6e5f289f1e6719647d19bad305afae67867de0a"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/announcement-geometry-2-hang-sample.txt",+      "sha256": "4e568593ac66528ded0ad6de7f9e75d0db9051bfb5ebb8e42836331a41e847fd"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/announcement-geometry-2-owned-process-tree.json",+      "sha256": "4cf6062a9fc61c5466db0913e99b050d53d780c589290aa16a02046e9e9f6c20"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/reuse-review.json",+      "sha256": "a3bc54f767bd14917bdf4a2f0db6e501dcaa88ffd48c6fee9bb3e9ecf0ee1a9e"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/quality-review.json",+      "sha256": "8ad9bee4e421c7a3ac0e9d9d6f8eaa93e26c1ef3d4ef148e9fa032f4662695e7"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/efficiency-review.json",+      "sha256": "27d98912d6e3acc17be64661d78efea18d4257138df9bedc477924ce937d9132"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/spec-review.json",+      "sha256": "a81592a527e867e428943c13c8aaeff71911e8db0126b43192c29110c8ff344b"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/lazy-row-fix-review.json",+      "sha256": "32b743813d503932f7d0b7fc0d71f03d101d195162e5093f6ba93c8b62f02356"+    },+    {+      "path": "/tmp/t2404-prepush/review-inputs/native-full-1-warnings.json",+      "sha256": "ccd0040788f99d24d850d5ebdafe9d15ce784bc9a982ba9348e061a879ef8296"+    }+  ],+  "original_manifest_artifact": {+    "path": "/tmp/t2404-prepush/gate-results.json",+    "sha256": "0c97ab71d5476ccb2e3936d553c68681f63eef824f763b3aee212c6d516e57d3"+  },+  "pending": {+    "full_phone": {+      "required_declarations": 209,+      "status": "Incomplete; two assertion failures retained. Targeted passes do not replace the complete gate."+    },+    "full_ipad": {+      "required_declarations": 26,+      "status": "Not run in this reservation; no pass claimed.",+      "prepared_script": {+        "path": "/tmp/t2404-prepush/ipad-ui-full-1.sh",+        "sha256": "c6f1666081fd1fe7e1c45e8051b74f90bae62d149c0f239a83aeaf66c834891e"+      }+    },+    "manual_mac": "Development selected-day save/cancel interaction has no recorded result. Signed build establishes compilation only.",+    "task_9": "In Progress",+    "publication": "No branch push or PR; required full gates and final review outstanding."+  },+  "heavy_slot": {+    "released": true,+    "new_app_job_authorized": false,+    "instruction": "Halo, then Transit Mac, then MeddyPR1UI own queued checks. Await a new slot before another app job. No PR102 waiver."+  },+  "diagnostic_limit": "Phone full attempts were drained after concrete failures; their xcresult Info.plist is absent. Raw log inventories are partial. Exact Announcement diagnostic 1 passed without entering instrumentation; diagnostic 2 executed zero tests due to launchd_sim session bind failure. Geometry cause remains unproven."+}
specs/export-todays-notes/ui-acceptance-follow-up.json Added
diff --git a/specs/export-todays-notes/ui-acceptance-follow-up.json b/specs/export-todays-notes/ui-acceptance-follow-up.jsonnew file mode 100644index 00000000..33a23d70--- /dev/null+++ b/specs/export-todays-notes/ui-acceptance-follow-up.json@@ -0,0 +1,194 @@+{+  "ticket": "T-2404",+  "created_at_utc": "2026-10-07T10:35:21.308146+00:00",+  "runtime_base_head": "02a0cdcae24cb8606deeb43ed227122d8f66e091",+  "branch": "T-2404/export-selected-day-notes",+  "acceptance_complete": false,+  "task9": "InProgress; no waiver",+  "slot_released_at_utc": "2026-10-07T10:32:42.799278+00:00",+  "remaining_owned_heavy_jobs": [],+  "source_scope": {+    "production_and_build_inputs": "unchanged; prior fullCore/native/signedMac receipts remain attributed to unchanged production inputs",+    "reviewed_UI_test_changes": {+      "Asterism/AsterismUITests/AccessibilityJourneyUITests.swift": {+        "before_sha256": "ee6257463a9796da6997222d3acb3875db4b48799ee11cb30cb75d9446a57771",+        "after_sha256": "36b3a57f3b5b8c3e360c41743af198fcfa3b86ed6efe3ed71b6150debd430d7c",+        "change": "Only revealInEditor swipe target: app -> wide-detail-column;8 attempts/waits/all assertions retained"+      },+      "Asterism/AsterismUITests/WideLayoutUITests.swift": {+        "before_sha256": "e3ca92add6230bc7c5189b0abac92fe4ccb81f21e501c2b2e0213bd7d0867763",+        "after_sha256": "ef86274e8fcd6ce78d097b7146539f2cca2e741e4455b7125562529f6f86d15c",+        "change": "NoEpisode stale detail-column wait replaced with current approved Today-stack work/title/selection/singlepane assertions; original selector/fixture/menujourney retained"+      }+    },+    "strict_guards": "791 source/build hashes with exactly reviewed1 then2 overlays;235 exactdisjoint IDs206phone+29iPad; no addedskip/filter/fixture/timeout or production edit"+  },+  "outcomes": {+    "original_phone_exact_one": {+      "passed": 0,+      "failed": 1,+      "skipped": 0,+      "runner_exit": 2,+      "line": 120,+      "message": "Future months are available",+      "prior_line87_failed_picker_opening": "Did not reproduce exactly; picker existence returned, final saved hierarchy has no picker; cause unproven; no correction"+    },+    "original_full_ipad": {+      "passed": 27,+      "failed": 2,+      "skipped": 0,+      "unique_declarations": 29,+      "missing": [],+      "unexpected": [],+      "runner_exit": 2,+      "T2404_export_cases": "Both passed: selected-day export/cancel and selected-empty-day export",+      "failures": [+        "reading-status landscape toRead offscreen after wholeappswipes",+        "NoEpisode stale side-by-side-column expectation"+      ],+      "diagnostics": "All tests finished; blocking ownedcollector38189 interrupted after two observations76s apart+3ssamples; Xcode finalized normally; failed tests preserved"+    },+    "reading_status_corrected_exact_one": {+      "passed": 0,+      "failed": 1,+      "skipped": 0,+      "runner_exit": 2,+      "landscape": "Allfive originallabels/frame/selection assertions passed after revieweddriver correction",+      "later_failure": "Line1611 portrait rotation replaced editor by readpage; test not weakened; model-lifetime cause unproven, no product fix",+      "diagnostics": "Only verifiedcollector40847 interrupted after two observations66s apart+3ssamples; final original1casefailure preserved"+    },+    "NoEpisode_corrected_exact_one": {+      "passed": 1,+      "failed": 0,+      "skipped": 0,+      "runner_exit": 0,+      "source_ids_match_exactly": true,+      "all_case_and_run_statuses_checked": true,+      "postsourceguard": true,+      "seconds": 27.03+    },+    "mac_synthetic": {+      "performed": false,+      "blocker": "Existing Devsterism Development PID29406 from another checkout; preserve current instance and reserved unlaunched UUID",+      "bundle_identifier": "me.nore.ig.Asterism.dev",+      "GUI_TCC_probe_or_launch": false+    }+  },+  "runtime_access_notes": {+    "defaultphoneattempt": "Before tests, SwiftPM cache diagnostics emission Operationnotpermitted; originalfailedattempt retained under publication-picker-original-reproduction-1.default-sandbox-denial",+    "retry": "One identical unchanged command retry with parentexclusivebatchauthorization andrequire_escalated; no authority workaround",+    "processinspection": "Initial readonly ps denied; one identical authorizedreadonly retry succeeded",+    "autoreview_rejections": 0,+    "simulators": "Both owned shutdowncalls reported alreadyShutdown149; no retry or otherdevicechange"+  },+  "remaining_acceptance": [+    "Full206 phone remains failed/incomplete; unchanged exactpicker1 failed later120, no permanent fix",+    "Full29 iPad original27pass2fail; NoEpisodeexactfix1passed, readingcase now fails later1611 actualportraiteditorloss; futurefull29required after fix",+    "SyntheticMacSave/Cancel unexecuted because existingDevsterismPID29406; no close/reuse/GUI/probe"+  ],+  "no_full_phone_restart": true,+  "no_full_ipad_retry": true,+  "no_push_PR_merge_or_tracker_mutation": true,+  "evidence": [+    {+      "path": "/tmp/t2404-prepush/next-acceptance/publication-picker-original-reproduction-1.verdict.json",+      "bytes": 5045,+      "sha256": "80be2ad3af4feda122561ee3dcc7547eceb634d22d47af43d862921d1a46ec85"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/publication-picker-original-reproduction-1.log",+      "bytes": 141733,+      "sha256": "a10a13717db2d1b7a12b1c40d105e247184ac39efde3b90a7a8ebcf5d7551e3b"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/ipad-ui-full-1.inventory-result.json",+      "bytes": 6585,+      "sha256": "71f2e7643df5aecb1b84dc2d41db31197cbbf15cd1ddcf0fce9f745f792b7e2a"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/ipad-ui-full-1.combined-gate.json",+      "bytes": 7551,+      "sha256": "cec4fd42f23ed8aabeb94e2b7029ea51ad60183cfd519bbd8ccbe46ddc5588eb"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/ipad-ui-full-1.log",+      "bytes": 314975,+      "sha256": "43d89483931308650100c327569e1ccba4a254304828b30c37035cdacfc532a1"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/ipad-ui-full-1.collector-stop.json",+      "bytes": 858,+      "sha256": "be44222e3db1c3bb190199a736fde8004dd1b8751a78b975a47b28b3078ea6b3"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-reading-status-driver-apply-evidence.json",+      "bytes": 1618,+      "sha256": "2b11842259b2f7f8ae235b45167a3222364266c36ef0438228d91fef2e234eba"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-reading-status-driver-targeted-1.verdict.json",+      "bytes": 1173,+      "sha256": "0fd64ed06c42be24ac47b9430d1b7924529378d2320d5967937d32ce9432c276"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-reading-status-driver-targeted-1.post-source-check.json",+      "bytes": 722,+      "sha256": "1ef07665502ba9a57169872e678aecc28cbfa53adfa24c993ac4536195ad531d"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-reading-status-driver-targeted-1.collector-stop.json",+      "bytes": 815,+      "sha256": "698466c1217e031522d44f375f4744a42d2e75d49b2c2feba4878266e501c845"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/reading-status-portrait-source-diagnosis.json",+      "bytes": 9034,+      "sha256": "8d51edaad960a97812e6188787a127dc8842027ba83c6b38d5c1fb2fc0e4d94a"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/phone-picker-ipad-driver-review.json",+      "bytes": 10873,+      "sha256": "e14fa459f81d8026f0beebaca10a31f236b1fd53dc15698ad5b72d6f6cc8ad66"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-no-episode-apply-evidence.json",+      "bytes": 1805,+      "sha256": "abe25fa0fdf8ba0b7c00df851856d41735b52f0d2ab233d37f8ec62254da13a5"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-no-episode-targeted-1.verdict.json",+      "bytes": 619,+      "sha256": "a0cfa4ad1702b181ed8fb17ff75017802cb616e0489e6b6f81d83e234146d5e2"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/scoped-no-episode-targeted-1.post-source-check.json",+      "bytes": 984,+      "sha256": "75f609911f1658aaf1e3db82d4f7e5ebb3f62c02a1d94edfbf8fc6bfdda6e035"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/ipad-no-episode-source-review.json",+      "bytes": 8164,+      "sha256": "e951284ac71d91eae04db720aa8a4d7a786340d509204bbe0fa5c45abd19cd4e"+    },+    {+      "path": "/tmp/t2404-prepush/next-acceptance/mac-synthetic-existing-instance-blocker.json",+      "bytes": 891,+      "sha256": "1f593bc07747fdcf91589a45386148d3dba610c104e98d6c40b4398f9cb7da26"+    }+  ],+  "original_sealed_gate_evidence_sha256": "05e3e8e18a0b85a15e2baa8a1583b41d823bc1b651e08f2011934b1e6b161043",+  "prior_fullphone3_preserved": {+    "path": "/tmp/t2404-prepush/acceptance-batch-20261007.json",+    "sha256": "3507f2e40e82d4ba8f275530c916b57d1a8f991cb707659a3ae39d1f609af41a",+    "passed_execution_cases": 93,+    "failed": 1,+    "allowed_skips": 2,+    "finished_execution_cases": 96,+    "actual_unique_completed_source_ids": 93,+    "required_phone_source_ids": 206,+    "missing_source_ids": 113,+    "unexpected_source_ids": 0,+    "all6_Announcement_cases_passed": true,+    "failure": "PublicationReturnDate largesttextline87 nativepickeropening failed; owningPID26570 UIKitpresentationconflict; stopped/drained, fullgateincomplete"+  }+}
specs/export-todays-notes/final-verification.json Added
diff --git a/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/specs/export-todays-notes/final-verification.json b/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/specs/export-todays-notes/final-verification.jsonnew file mode 100644index 00000000..bd7feac3--- /dev/null+++ b/Users/arjen/Documents/Codex/2026-10-07/task-2/asterism-t2404/specs/export-todays-notes/final-verification.json@@ -0,0 +1,95 @@+{+  "ticket": "T2404",+  "runtime_checkpoint": "d0e4b0652343030912ae2c3883f396d3b9866ec0",+  "verified_remote_default": "main",+  "verified_remote_main": "3cd0ebc0eeb861e534803e932176c676f27910a5",+  "backup_ref": "backup/T-2404-before-owner-rebase-d0e4b065",+  "rebase_completed": true,+  "rebase_source_changed": false,+  "source_build_inputs_checked": 819,+  "owner_exception_references": [+    "Sentinel_eb92e0de2fec8191b14cad8eeb6dfd46",+    "Sentinel_b5d42e361ac481918cc9d16c93e8aa5a",+    "Sentinel_880e2afbf24c8191a12484f23ed90e63"+  ],+  "current_iPad": {+    "passed": 29,+    "failed": 0,+    "skipped": 0,+    "runtime_warnings": 12+  },+  "current_targeted_phone": {+    "passed": 5,+    "failed": 0,+    "skipped": 0,+    "runtime_warnings": 0,+    "export_journeys": 4,+    "unrelated_exact_retry": 1+  },+  "interrupted_full_phone": {+    "status": "FAILED/INCOMPLETE",+    "completed_passes": 73,+    "genuine_assertion_failures": 1,+    "cancelled_inflight_case": 1,+    "missing_declarations": 134,+    "runtime_warnings": 66,+    "repeated_launch_configurations": "four intentional executions folded into one declaration by structured metadata"+  },+  "full_current_phone_green": false,+  "focused_editor_source_equivalent": {+    "declarations": 7,+    "executions": 9,+    "passed": 9+  },+  "historical_only": [+    "55 focused export Core tests",+    "28 focused export native cases",+    "3349 full Core passes plus55 existing opt-in skips",+    "2000 native declarations /2122 cases passed",+    "signed Mac app and embedded extension compile passed"+  ],+  "manual_Mac_Save_Cancel": "NOT RUN: shared Development identity/preferences; no launch or preferences operations",+  "heavy_slot_released_utc": "2026-10-07T13:18:46.480389+00:00",+  "owned_jobs_remaining": [],+  "owned_simulators": "both Shutdown",+  "unrelated_followups": [+    "Torn fixture midnight boundary candidate; exact retry passed; causality unproven",+    "Inherited Works Environment warnings; source candidate lacks runtime first-emission backtrace"+  ],+  "sealed_prior_evidence_unchanged": true,+  "evidence": {+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/ipad-ui-full-d0e4b065-1.verdict.json": {+      "sha256": "e21a25c213ff9d2f5ff6caa91eaa4d03f26e46cbf4d040082a28a8f4f4e38183"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/ipad-ui-full-d0e4b065-1.independent-review.json": {+      "sha256": "6e5955c44d199d1cc906573e203282657ddc81f1cf6ceb79a611273db175cfb9"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/phone-ui-full-d0e4b065-1.verdict.json": {+      "sha256": "e29a2c2ed3976e79e3936b29bdc24fc84be87e6a237474fa4a6470d65ba8f24e"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/phone-owned-interruption.json": {+      "sha256": "6ce0956a27d8ba8ff3c5b5d16fda73133623c6b3032cd136fa37d37e4020c10f"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/phone-targeted-final-d0e4b065-1.verdict.json": {+      "sha256": "81271f12e72d6fa8070bd729dc12965daa977c2ce6462fb1f43490c0feae873c"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/duplicate-torn-midnight-source-diagnosis.json": {+      "sha256": "f343861ff875c94653833a1f1ed850a933a7cfad8213ad61a5d5e83e066407d7"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/final-owned-cleanup.json": {+      "sha256": "af5b97a3f21cf40e02b334b70c2f265773e7b2aa5ae4f7de45f0c7757cf3add2"+    },+    "/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065/source-inventory-d0e4b065.json": {+      "sha256": "79ad0b8c8fb87eb1970cff1faa8f963f419b811941e8001fba0a1d10fab65d29"+    },+    "/tmp/t2404-prepush/final-review-d0e4b065/export-source-qualification.json": {+      "sha256": "21665c708b9469ff27b1a69de4d2a704c85849efa5013ce457c400f98c60a28c"+    },+    "/tmp/t2404-prepush/final-review-d0e4b065/rebase-input-equivalence.json": {+      "sha256": "2e28faaaeed807bc52dde56fbb34155c00c9548c8d21d65c405d6af27dc069ce"+    },+    "/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/integration/native-c3eaf74f-warning-cleanup-1.independent-final-review.json": {+      "sha256": "47ea52ff5a363ffb419f8bd5cd83c648e020f476f6d6de87dc98a53071c863d6"+    }+  }+}

Docs (8)

CHANGELOG.md Modified
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e948d4b5..87b528ba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).  ### Added +- **Export selected day's notes — App increment (T-2404):** add a dated+  export action to Today's single-day header, using the displayed date, calendar+  and locale. Reuse native Markdown sharing, explain empty days, suppress+  overlapping handoffs, and isolate temporary files until their outcomes arrive.+  All 28 selected native cases and six affected phone/iPad journeys pass.+  Historical full Core, signed Mac and native results retain their source.+  Current iPad acceptance passes 29/29 and final targeted phone checks pass 5/5;+  the owner waived another full UI run. Manual Mac Save/Cancel remains unrun.++- **Export selected day's notes — Core increment (T-2404):** add an immutable+  selected-day input, exact original-capture/content selection, deterministic+  ordering, one normalized repository read, and familiar Markdown blocks with+  a dated filename. Reuse and cache existing Work/Site metadata; update the+  provider test double for the new read. All 55 focused renderer/repository+  tests pass, including ten new cases. Native compilation and affected app/UI+  checks subsequently passed, followed by full Core, signed Mac and native gates.+  Current integrated iPad acceptance passes 29/29; final targeted phone checks+  pass 5/5 under the owner exception to another full UI run.++- **Export selected day's notes — Approved plan (T-2404):** add+  requirements, design, and decisions for exporting notes originally captured+  on the date selected in Today as Markdown, including rating-only entries.+  Freeze the displayed date/calendar, reuse existing note blocks and sharing,+  show a dated empty notice, and isolate temporary files. User approved the+  requirements/design; nine incremental Rune tasks cover Core, app integration,+  and current-tree verification. Implementation starts on an isolated branch.+ - **Shared presentation tests:** run the same Works, Stats and Today value rules   in a native host product, preserving 304 test declarations and 765 assertions.   Reuse the app fixture factory through a test-only product, retain native Stats@@ -73,6 +100,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).  ### Fixed +- **iPad editor preservation — Focused verification (T-2404):** retain unfinished+  work drafts across layout host replacement, with exact-instance Save/Cancel+  release and bootstrap/epoch guards. On the reconciled main source, all seven+  native declarations/nine cases and the original iPad rotation journey pass,+  including entered title, notes and status. Remove nine new native test warning+  sites and pass all nine cases again. Full iPad acceptance subsequently passes+  29/29; the owner directs targeted completion without another full UI run.++- **iPad UI verification (T-2404):** scope reading-status editor swipes to the+  detail column and align the No Episode test with the approved Today work route.+  The exact No Episode and draft-survival cases pass inside full iPad acceptance.+  Historical failures remain recorded; full phone acceptance stays incomplete+  under the owner's explicit exception.++- **Selected-day export review (T-2404):** avoid projecting unused Work entry+  history through the existing metadata snapshot overload. Correct a lazy-row+  accessibility journey with its existing bounded scrolling helper. Full Core,+  signed Mac and native gates pass; retain the original incomplete phone runs+  and Announcement startup diagnostic failure in+  `specs/export-todays-notes/gate-evidence.json`. These full gates retain their+  historical source. Current iPad29 and targeted phone5 pass; full phone remains+  incomplete and manual Mac Save/Cancel is unrun under the owner exception.+ - **UI acceptance failures (T2418):** restore stored covers inside Today timeline   entry buttons and present the hiatus return-date sheet from the stable Work   Detail view. Correct UI queries for combined entry titles and distinguish a
specs/OVERVIEW.md Modified
diff --git a/specs/OVERVIEW.md b/specs/OVERVIEW.mdindex 9b774e18..8b3146d8 100644--- a/specs/OVERVIEW.md+++ b/specs/OVERVIEW.md@@ -2,6 +2,7 @@  | Name | Creation Date | Status | Summary | |------|---------------|--------|---------|+| [Export Selected Day's Notes](#export-selected-days-notes) | 2026-10-06 | Complete — scoped checks passed; full phone UI exception recorded; manual Mac check unrun | T2404. Export notes and ratings originally captured on the day selected in Today, with frozen displayed context, existing Markdown blocks and native sharing. | | [Wide Layouts Rethink](#wide-layouts-rethink) | 2026-10-01 | Done — full 2,112-test pre-push unit gate, final MCP Mac/iOS builds and targeted iPad UI checks passed | Implements the section 6 handover: Library destinations in the sidebar, full-width adaptive Today, note inspector, responsive work detail, and shared navigation across window widths. | | [Immutable Capture Safety Net](#immutable-capture-safety-net) | 2026-07-17 | Done | Establishes durable local capture, curation, and self-validating backup foundations. | | [Title Teaching Retroactive Parsing](#title-teaching-retroactive-parsing) | 2026-07-21 | Done | Adds reader-taught title parsing, retroactive organization, provenance, and actionable capture workflows. |@@ -965,3 +966,17 @@ The section 6 handover builds on the existing iPad and Mac layout architecture. - [decision_log.md](wide-layouts-rethink/decision_log.md) - [implementation.md](wide-layouts-rethink/implementation.md) - [verification-run.md](wide-layouts-rethink/verification-run.md)++## Export Selected Day's Notes++**Created:** 2026-10-06 · **Status:** Complete — selected-day behavior and scoped verification are complete under the owner acceptance exception. Current full iPad passed 29/29 and final targeted phone passed 5/5; historical Core/native/Mac gates retain their recorded source. Full phone acceptance is incomplete and manual Mac Save/Cancel remains unrun.++T2404. Today's selected date controls one Markdown document of notes and ratings originally captured that day. The action freezes the displayed calendar/timezone and locale, uses normalized logical notes and existing export blocks, and reuses native sharing with independent temporary-file ownership. No schema or App Intent changes; the chosen-day intent enhancement is T2428.++- [requirements.md](export-todays-notes/requirements.md)+- [design.md](export-todays-notes/design.md)+- [tasks.md](export-todays-notes/tasks.md)+- [decision_log.md](export-todays-notes/decision_log.md)+- [verification-run.md](export-todays-notes/verification-run.md)+- [gate-evidence.json](export-todays-notes/gate-evidence.json)+- [implementation.md](export-todays-notes/implementation.md)
specs/export-todays-notes/decision_log.md Added
diff --git a/specs/export-todays-notes/decision_log.md b/specs/export-todays-notes/decision_log.mdnew file mode 100644index 00000000..aa60fae5--- /dev/null+++ b/specs/export-todays-notes/decision_log.md@@ -0,0 +1,260 @@+# Decision Log: Export Selected Day's Notes (T2404)++## Quick Decisions++Original-capture-date/rating-only membership in Decision 3 and selected-day scope in Decision 4 are accepted from the user's direct clarifications. Decision 4 supersedes the today-only target. Decision 5 records approval of the complete `87a7756d` requirements/design and authorisation to create tasks and implement without another approval round. Earlier pending-review notes below describe historical states.++| ID | Date | Decision | Rationale |+| --- | --- | --- | --- |+| Q1 | 2026-10-06 | Use `export-todays-notes` and docs branch `specs/T-2404-export-todays-notes`. | Descriptive ticket scope; name remains overridable. |+| Q2 | 2026-10-06 | Draft requirements and design together; stop before tasks or implementation. | Explicit delegated instruction overrides interim workflow questions/gates. |+| Q3 | 2026-10-06 | One UTF-8 `.md` named `Asterism Notes YYYY-MM-DD.md`. | Existing export format plus a stable date-based daily identity. |+| Q4 | 2026-10-06 | Use Today header action and existing platform handoff. | Small UI extension available on compact and wide screens. |+| Q5 | 2026-10-06 | Keep the existing first-capture date in note blocks; freeze the daily export timezone. | Preserves the note format; collection membership follows the accepted original-capture-day choice in Decision 3. |+| Q6 | 2026-10-06 | Empty daily input produces an informational notice and no file. | An empty collection offers nothing to share. |+| Q7 | 2026-10-06 | No live tracker mutations or build/test jobs; initial delivery used local repository drafts. | Ticket evidence and existing work are preserved; the later authorised Library delivery is recorded in Q12. |+| Q8 | 2026-10-06 | Apply recalled Asterism test-tier and accessibility knowledge after code verification. | Keep pure checks cheap, sharing/runtime checks native, and progress separately accessible; no unrelated-app rules. |+| Q9 | 2026-10-06 | Stage daily invocations under one current-process session directory; keep the dated visible filename. | Separate invocation URLs prevent cross-scene collisions; excluding the current session from scavenging also protects handoffs open longer than 24 hours. Abandoned current-session files are reclaimed after a later launch. |+| Q10 | 2026-10-06 | Cache work type/title resolution within the batch read. | Existing standalone input resolves a Work per entry; daily export should resolve each Work once. |+| Q11 | 2026-10-06 | Initially put the explicit today-only action name in a header share menu; superseded by Q17–Q19. | The initial proposal disclosed its current-day target; the selected-day revision instead names the selected date. |+| Q12 | 2026-10-06 | Prepare requirements/design Library attachments and a local docs-only commit; do not push. | Explicit follow-up delegation authorises spec-phase delivery and commit. Clarify future-dated inclusion and capture/share/edit dates without changing the proposed scope. |+| Q13 | 2026-10-06 | Apply the user's capture-day and rating-only clarification; do not infer final spec approval. | Decision 3 supersedes the earlier Today-collection proposal. |+| Q14 | 2026-10-06 | Proposed default: exclude an entry with both blank/whitespace-only text and no rating. | It has no authored note or rating to export; no new option or setting is needed. |+| Q15 | 2026-10-06 | Proposed default: newest original capture first, UUID ascending for ties. | Ordering follows the same immutable capture timestamp as membership; re-sharing/edits do not rearrange the collection. |+| Q16 | 2026-10-06 | Run the existing `send-md-to-phone` helper for the revised requirements/design after a local docs-only commit. | User explicitly authorises this spec-phase delivery; no Library workaround or implementation is needed. |+| Q17 | 2026-10-06 | Use the date selected in Today instead of always exporting today. | Direct scope change in Decision 4; capture-date/rating-only membership stays accepted. |+| Q18 | 2026-10-06 | Freeze the resolved date and the screen's published calendar/timezone, plus `calendar.locale ?? Locale.current` at activation. | Match the displayed locale rule and pass it explicitly; fresh clock/calendar sampling or the export model's default locale could mix display and export contexts. |+| Q19 | 2026-10-06 | Proposed default: offer a date-labelled header action only while the single-day header is visible. | All-days views hide date chrome; the existing empty-library exception keeps it and still permits an empty notice. |+| Q20 | 2026-10-06 | Keep T2404, the spec folder, branch, and delivered filenames stable; revise document titles and planned day-export API names. | No duplicate specs or deliveries; ongoing phone-helper authorisation covers these two revised files. |+| Q21 | 2026-10-07 | Requirements/design at `87a7756d` approved; create tasks and immediately start implementation. | Direct instruction overrides the task workflow's additional approval gate; final verification/review remain required. |+| Q22 | 2026-10-07 | Implement on `T-2404/export-selected-day-notes` in an isolated worktree based on main `91703717` plus the approved spec. | Remote main verified unchanged; PR102 remains a separate draft. Main supports filtered Core tests, so no refactor dependency or acceptance waiver is needed. |+| Q23 | 2026-10-07 | Keep chosen-day App Intent/Shortcuts enhancement outside T2404; parent-created follow-up is T2428 (`C44D6B28-45C2-4FE5-B13A-771C42D82AFF`). | Creation receipt and readback verified in `/tmp/asterism-export-start-and-intent/`; the user's approval covers UI/export implementation here. |+| Q24 | 2026-10-07 | One sequential implementation stream; coordinate targeted test/build slots with Halo. | Repository, export model, and UI wiring depend on one another. No heavy jobs while Halo owns the slot; required current-tree pre-push gates still apply. |+| Q25 | 2026-10-07 | Core source prepared; tasks 1–4 remain in progress until runtime verification. | Static review found no blocker against the approved normalization, capture-day/content, ordering, formatting, and cache contracts; both provider conformances were updated and `git diff --check` passed. Six value/renderer and four repository tests were written before production edits but have not run. Await one targeted Core slot; no phase-completion or passing-test claim is made. |+| Q26 | 2026-10-07 | Continue app integration and fixture preparation while the targeted Core batch is queued. | Explicit follow-up delegation authorises independent source work before observed runtime results. Prepared tasks stay incomplete; no compiler/test/build/simulator jobs run before release of the shared slot. |+| Q27 | 2026-10-07 | App source and focused native/UI fixtures prepared; tasks 1–8 remain in progress. | Preliminary source review checked frozen context before awaiting, action visibility, retained handoff, dated empty/error paths, and owned session/invocation cleanup. Review fixes bounded the held-read test wait, followed the real wide inspector/Edit/Back flow, and scoped sharing Close lookup to the presented surface. Nine native tests and four UI journeys were added, with two existing journeys extended. `git diff --check` passes; compilation, sharing selectors/save timing, and all runtime gates remain unverified. |+| Q28 | 2026-10-07 | Focused Core batch passed; release the exclusive slot for Halo. | Authorized `make test-core CORE_TEST='(MarkdownExportTests\|ExportInputReadTests)'` with isolated caches exits 0: 35 renderer and 20 repository tests, including all 10 selected-day cases; actual runner inventory matches source declarations. Identity checks pass. Corrected two test provenance values to `.absent` and replaced a mistaken physical interpretation of logical counts with explicit before/after six-row checks. Tasks 1–3 complete; task 4 retains pending native mock conformance, tasks 5–8 remain in progress, and 9 is pending. Evidence: `/tmp/t2404-core-result.json` and `/tmp/t2404-core-targeted.log`. No further heavy job, native/UI run, code commit, push, or PR in this batch. |+| Q29 | 2026-10-07 | Preserve the tested Core increment as a local commit with explicit native/UI limitations. | Follow-up delegation requests local preservation if repository rules permit. `CLAUDE.md:81–85` states a clean `make test-core` without new compiler warnings as the local bar; `Makefile:109–110` supports `CORE_TEST`, and no active commit hook imposes another gate. The 55-test filtered target passed; retained cold-build warning origins are unchanged files. Commit Core input/read/render/tests and the provider test-double conformance plus bookkeeping; leave app/UI implementation unstaged. Native compilation and all required full pre-push gates remain owed. No heavy command while Halo holds the slot. |+| Q30 | 2026-10-07 | Targeted app batch passed: 28 native cases, four phone and two iPad journeys; preserve the app increment locally and release the heavy slot. | Actual result-bundle inventories match the planned 27 native declarations plus the second share-outcome argument case and all six UI selectors, with no failures or skips. Explicit TodayHeader input/action types resolve the initial compiler failure; individual Swift Testing selectors require `()`. Both owned simulators are shut down; Core `64a3e599` and its tested source hashes remain unchanged. Full mandatory pre-push gates are still owed. |+| Q31 | 2026-10-07 | Perform source-only pre-push review while Transit owns the next heavy slot; publish the feature branch and draft PR only after required review/gates pass. | Direct follow-up delegation confirms existing implementation/feature-branch PR approval. Review includes the complete branch diff against main; PR102 provides no incomplete-test exception. No main push, merge, installation, or production-data access is added. |+| Q32 | 2026-10-07 | Four source reviewers completed; the bounded Work metadata efficiency correction is verified by full Core and native gates. | Reuse, quality and spec review found no material source issue. `entryRows: []` avoids projecting unused Work entry history while preserving validation/title/type; 3,349 Core declarations passed plus 55 existing opt-in skips, and all 2,000 native declarations passed. Full phone/iPad acceptance and manual Mac interaction remain pending. |+| Q33 | 2026-10-07 | Preserve the reviewed lazy-row journey correction; do not speculate about the remaining Announcement failure. | The chapter journey now uses its existing bounded list-scroll helper and passed its exact case and broad rerun. The Announcement original assertions remain unchanged; its exact diagnostic passed once, then zero tests ran because the owned simulator could not boot (`launchd_sim` session bind failure). Raw/structured evidence and bounded sample are retained under `/tmp/t2404-prepush/`. |+| Q34 | 2026-10-07 | Release the drained heavy reservation for queued Halo/Transit checks; no further broad retry in this reservation. | Explicit parent queue instruction is not an acceptance waiver. Task 9 and feature publication remain pending required full phone/iPad gates and final pre-push review. No main push, merge or physical/Mac installation occurred. |+| Q35 | 2026-10-07 | Preserve a local review checkpoint and prepare source-only Announcement diagnosis while the heavy slot belongs to queued checks. | Direct parent instruction authorises local preservation. `gate-evidence.json` retains all eight observed attempts, original failures, exact commands and hashes; the two reviewed source corrections match their tested bytes. Announcement source remains at the app checkpoint. No new app job or broad retry occurs; a focused geometry capture is prepared for a later slot before choosing any permanent correction. |+| Q36 | 2026-10-07 | Finish using targeted proof under the explicit owner exception; rebase onto actual default and merge through a reviewed PR. | `Sentinel_eb92e0de2fec8191b14cad8eeb6dfd46` forbids another full UI run. `Sentinel_b5d42e361ac481918cc9d16c93e8aa5a` directs one targeted retry of unrelated failures, then a separate flag if persistent. `Sentinel_880e2afbf24c8191a12484f23ed90e63` explicitly requests Asterism merged. Remote default `main` was fetched and a preserving rebase completed with identical source. Current iPad29 and final targeted phone5 pass; the torn retry passed. Historical full gates and unrun manual Mac remain disclosed; no direct main push or unrelated feature expansion. |++## Decision 1: Match Today's Current Collection and Ordering++**Date:** 2026-10-06  +**Status:** superseded by Decision 3++### Context++Today identifies notes by latest share, folds future-dated entries into its current-day Noted section, and shows entries with blank prose. Existing entry/work exports include those blank entries, while the Notes From Today shortcut drops them. The ticket does not choose between these interpretations.++### Decision++Export the unfiltered current-day Today collection, including blank/rating-only and future-dated entries. Use newest-share-first timeline order with UUID ties, one day heading, and each entry's existing standalone block. Always export today at activation, including while another day is browsed.++### Rationale++This gives the daily action the same content identity as the Today screen and the same block content as existing exports. It avoids a new text-only definition of a note or a work grouping that rearranges the timeline.++### Alternatives Considered++- **Only nonblank prose strictly within today's midnight boundaries:** Fits the shortcut's blank filtering but omits entries visible in Today and rating-only notes.+- **Export the selected/filtered day:** More general, but changes the ticket's scope and makes one action mean different collections.+- **Group by work in oldest-capture order:** Fits work export's history order but rearranges a daily timeline and introduces group/fallback rules.++### Consequences++**Positive:** Existing Today and standalone-export behavior explains inclusion and content; no new selection settings.++**Negative:** A future timestamp can put a note in this document; older first-capture dates can appear under today's heading. Users wanting prose-only or selected-day export must revise this default before implementation.++---++## Decision 2: Extend the Existing Export Pipeline++**Date:** 2026-10-06  +**Status:** proposed++### Context++Existing exports resolve store data under a repository lock, render immutable values, and retain staged files until native handoff completes. A daily collection must preserve that lifecycle across multiple entries.++### Decision++Add a small daily batch input/read and renderer to the existing pipeline. Reuse normalization, entry-block rendering, export staging, and native sharing; freeze day/calendar at activation and read all included content in one shared-lock operation.++### Rationale++One batch read prevents an export assembled across different library observations. Existing rendering and handoff already cover title escaping, temporary files, and delayed share completion.++### Alternatives Considered++- **Loop over public per-entry exports:** Reads/stages separate documents and can mix observations or fail after partial progress.+- **Render directly from visible UI rows:** Couples the export to filters and lacks the full existing export block fields.+- **Build a general range/export service:** Adds architecture and options beyond this feature.++### Consequences++**Positive:** Existing block goldens and native cleanup remain applicable; no persistent state or migration.++**Negative:** The provider and Subject enum gain a case, requiring mock conformance and exhaustive-switch handling; small capture-day/content/order checks are needed.++---++## Decision 3: Select the Original Local Capture Day++**Date:** 2026-10-06  +**Status:** original-capture-date/rating-only membership accepted; today-only target superseded by Decision 4++### Context++The user answered the Today-screen versus original-capture-day choice with: “Only notes from today, including rating only ones.” Clarification reference: `Sentinel_9ed3aa9a69908191bdf657533af6c053`. The delegation explicitly resolves this to the current local calendar day's original capture date. The complete drafts will be reviewed later.++### Decision++Select logical entries whose original `firstCapturedAt` falls on today's local calendar day. Include rating-only entries. Exclude future original capture dates and older entries merely re-shared or edited today. This accepts the date/rating choice without approving the complete spec or implementation.++### Rationale++The exported collection now corresponds to the day of original capture. `lastSharedAt` places entries in the Today screen, and `modifiedAt` records edits; neither answers the user's chosen date criterion.++### Alternatives Considered++- **Match Today's latest-share collection:** Superseded; it can include older re-shared and future-dated entries.+- **Select entries edited today:** Excluded; an edit is not an original capture.+- **Require note prose:** Excluded; the user explicitly includes rating-only entries.++### Consequences++**Positive:** Every eligible entry's original capture date belongs to the exported day; ratings survive without prose.++**Negative:** The export can differ from the Today screen's visible collection. Empty-unrated exclusion and newest-capture-first ordering remain proposed defaults (Q14–Q15) for full-spec review.++---++## Decision 4: Export the Day Selected in Today++**Date:** 2026-10-06  +**Status:** accepted scope change; complete drafts and interaction defaults remain proposed++### Context++The user requested: “Regarding the today export for Asterism, let's change it so it will export the selected day's notes instead.” Clarification reference: `Sentinel_4a5acea8f840819195382446c11fb2f4`. Existing Today navigation already selects a `CivilDay`, resolves the default current selection against the published current day, and uses one published calendar for the header and week strip.++### Decision++Export the day named in Today's single-day header. Preserve original-capture-date membership and rating-only inclusion: the group's minimum `firstCapturedAt` must equal that selected civil day in the captured timezone. Dates before or after the selection stay excluded regardless of re-share/edit times. Existing unbounded navigation can select past, current, or future days; a future selection uses exact equality, never Today-style folding.++Proposed interaction defaults freeze the resolved displayed day/calendar and its `calendar.locale ?? Locale.current` formatting locale synchronously at activation, label the action `Export notes for {long local date}`, and hide it whenever all-days results hide the date header. The empty-library exception retains the date header/action. Heading, filename, and empty notice name the frozen selected date. Empty-unrated exclusion, newest-capture-first order, shared rendering/handoff, and independent staging remain the existing proposed defaults.++### Rationale++The existing date controls provide the requested selection without another picker or option screen. Copying the displayed day and calendar avoids exporting a different context during a pending midnight/timezone refresh. Reading original capture timestamps preserves the user's earlier membership choice instead of exporting latest-share UI rows.++### Alternatives Considered++- **Always export today:** Superseded by the direct selected-day request.+- **Export visible/filtered Noted rows:** Rejected; their latest-share and future-fold semantics do not match original capture membership.+- **Use a fresh clock/calendar or another export date picker:** Rejected; either can disagree with the displayed selection or duplicate the existing date controls.+- **Keep export visible while the screen spans all days:** Possible later, but adds date disclosure while the selected-day header is hidden; Q19 keeps the initial interaction small.++### Consequences++**Positive:** Historical notes can be exported using existing navigation, with a stable named date and the familiar Markdown blocks. Captures re-shared on another day remain attached to their original selected capture day.++**Negative:** All-days views require returning to the day view before exporting. A deliberately selected future date can contain saved future-dated captures, but they are never imported into another day. These interaction defaults and the complete files still require review; no task planning or implementation approval is inferred.++## Decision 5: Approve the Spec and Start Implementation++**Date:** 2026-10-07  +**Status:** accepted++### Context++The user said: “This is approved. Create the tasks and start implementation. Also, create a separate ticket to update the existing notes from today app intent/shortcuts action to be able to work for different days.” Clarification reference: `Sentinel_342bcdc72fb0819186b0baf7a0c28d06`. The delegation explicitly authorises task planning and implementation without another approval round.++### Decision++Treat the selected-day requirements/design at `87a7756d` and their interaction defaults as approved. Create incremental Rune tasks and implement T2404 UI/export in the isolated `T-2404/export-selected-day-notes` worktree. The parent created the separate chosen-day App Intent/Shortcuts ticket T2428; no intent implementation is added here. Preserve the existing refactor checkout, coordinate runtime work with the shared heavy-job slot, review increments, and run required current-tree gates before a draft PR. No main push, merge, or device installation is authorised.++### Rationale++Approval is direct rather than inferred from a narrow choice. Remote main remains `91703717`; PR102 at `2c0bfb8f` is an open draft and is not needed for filtered Core feedback. Basing T2404 on main avoids importing unrelated test architecture or its acceptance exceptions.++### Alternatives Considered++- **Ask for another task approval:** Rejected by the explicit delegation; perform task consistency checks and proceed.+- **Stack on or cherry-pick the test refactor:** Unnecessary; main already has a filtered Core target and the export can be implemented independently.+- **Extend the App Intent in this feature:** Rejected; it is explicitly a separate ticket.++### Consequences++**Positive:** Coding can start with an approved, bounded scope and an isolated branch, while user work and unrelated capability changes stay separate.++**Negative:** Existing native/runtime and broad acceptance gates still need slot time. Until those run, source changes and static reviews are implementation progress rather than verified completion.++## Initial Draft Validation — 2026-10-06++- Design-critic review led to Q9–Q11: independent temporary URLs, cached Work/type resolution, and a visible current-day action label.+- Peer validation used two independent local reviewers (technical/edge cases and scope/UX). External Codex/Kiro tools were unavailable; no external-model consultation is claimed. Both confirmed the current-session scavenging exclusion closes the remaining handoff-retention gap; no material finding or unresolved divergence remains.+- Three-level explanation check: **beginner** — collect today's entries in one familiar document without changing the library; **intermediate** — one locked batch read, shared block renderer, existing share model; **expert** — normalize before filtering, freeze calendar context, and isolate concurrent files through delivered outcomes. The plan stays consistent across these levels.+- Static checks passed: local evidence links, 12 unique EARS acceptance anchors, required Markdown line breaks, and docs-only working-tree scope. No implementation or runtime verification occurred.+- Active refactor status/staged-diff fingerprints remained unchanged; canonical `main` and its untracked `specs/general/` were preserved. Local delivery commits only these three spec files and their documentation changelog entry in the isolated worktree.+- The initial delivery clarification was rechecked by design-critic, then both reused peer reviewers under Decision 1: ordinary edits did not change that proposal's membership, re-shares did, and first-capture dates remained distinct. Decision 3 supersedes that selection proposal. Attachment copies use descriptive filenames and source links pinned to the inspected canonical commit.+- Final user review of requirements, design, and proposed product defaults remains pending. No tasks or implementation are authorized by this record.++## Capture-Day Clarification Validation — 2026-10-06++- Design-critic rechecked the original-capture-day predicate, logical-group normalization, frozen calendar, and rating-only output. Its single finding was an empty unrated example; the example now has a rating and satisfies requirement 1.3.+- Subsequent peer validation reused two independent local reviewers for technical/edge cases and scope/UX. Both found the revised requirements, design, and Decision 3 consistent, with no material finding or unresolved divergence. Review used static source inspection, not runtime tests or external models.+- Three-level explanation check: **beginner** — export notes and ratings originally captured today; **intermediate** — select by original capture day and reuse each familiar note block; **expert** — normalize physical copies first, use the group's minimum capture timestamp in a frozen local calendar, then filter current presented content and order by capture timestamp. Re-shares and edits cannot make an older capture eligible.+- Static checks passed for local source links, 12 unique EARS anchors and intentional Markdown line breaks, and the four-file documentation-only change. Canonical `main` and its existing `specs/general/` remain preserved; the active refactor checkout was only read.+- That capture-day revision was committed locally as `dd8753b3`; the existing phone helper returned exit `0` for the two revised requirements/design files sent to its configured `iphone181` target. Decision 3 accepted only the user's date/rating choice; full-file approval, task planning, and implementation remained pending. Decision 4 subsequently changed the target day.++## Selected-Day Revision Validation — 2026-10-06++- Design-critic confirmed selected-day capture membership, exact past/current/future equality, frozen displayed context, and header/all-days/empty-library behavior. Its one finding was an implicit live-locale default; the design now explicitly captures `calendar.locale ?? Locale.current` and plans a cheap locale-divergence unit case.+- Subsequent peer validation reused the two independent local technical and scope/UX reviewers. Both confirmed the fix and found no material inconsistency or unresolved divergence. These were read-only source reviews, not runtime or external-model verification.+- Three-level explanation check: **beginner** — select a day in Today and export its originally captured notes and ratings; **intermediate** — reuse existing date controls, snapshot the displayed date/calendar, then share familiar Markdown blocks; **expert** — freeze the resolved `CivilDay`, calendar/timezone, and explicit locale before awaiting one normalized repository read. Navigation or context changes cannot retarget the document or its dated notice.+- Local source links, 12 EARS anchors and intentional Markdown line breaks, and documentation-only scope passed static checks. Canonical `main` with its existing `specs/general/` and the active refactor checkout remain untouched by this work. No implementation, tests, builds, or tracker mutations occurred.+- Existing T2404 paths and delivery filenames are retained. The user authorised a docs-only commit and resending the two revised requirements/design files with the existing phone helper; full-file review and approval of the remaining defaults are still pending.++## Decision 6: Finish With Targeted Proof and the Owner Acceptance Exception++**Date:** 2026-10-07++**Status:** accepted++### Context++The owner said: “The Asterism day notes export is taking a while, even though most of the functionality should have already existed. Make sure to rebase it onto master before you merge, but let’s not do another full UI run please.” Reference: `Sentinel_eb92e0de2fec8191b14cad8eeb6dfd46`.++The owner then said: “Some of those findings might have been fixed in the other work or are intermittent, so let’s not waste time on running tests over and over again. Next time, if you find unrelated UI test failures, retry them targeted and if they’re still real, flag them.” Reference: `Sentinel_b5d42e361ac481918cc9d16c93e8aa5a`.++The latest priority explicitly requests “Asterism merged” after Transit. Reference: `Sentinel_880e2afbf24c8191a12484f23ed90e63`. The delegated instruction authorizes publishing, marking ready and merging through a PR after rebase, targeted checks and current review.++### Decision++Stop the active full phone run, preserve actual results, and start no further full UI run. Verify the actual remote default (`main`, not `master`), fetch it, create `backup/T-2404-before-owner-rebase-d0e4b065`, and complete `git rebase --rebase-merges origin/main`. This completed without conflicts or source changes at `d0e4b065` on remote main `3cd0ebc`.++Reuse source-qualified existing export, editor and iPad evidence. Run the exact unrelated torn-group case once plus the four affected phone export journeys: all five passed with no skips or runtime warnings. Preserve the original assertion and the interrupted run's incompleteness. Keep the midnight fixture candidate and inherited Environment warnings separate; do not add unrelated fixes to export. Complete current four-way review and publish/merge through the feature PR, with no direct main push.++### Rationale++The owner exception supersedes the ordinary broad UI acceptance gate. The rebase changes no source, six direct export source/test files match the earlier checkpoint exactly, and the exporter difference is comment-only. New integrated phone wiring proof and full iPad29 cover the affected rendered behavior. Repeating unchanged Core/native/build or broad UI results would not resolve a new feature uncertainty.++### Alternatives Considered++- Repeat full phone acceptance or chase every unrelated UI issue: rejected by direct owner instruction.+- Change the torn-group test/fixture here: unnecessary after its one exact retry passed; retain a separate midnight candidate.+- Launch another Development Mac instance or reset shared preferences: rejected; disclose manual Save/Cancel as unrun and reuse existing adapter/model proof.++### Consequences++**Positive:** Export can finish with reviewable feature proof, preserved source/evidence and an authorized PR workflow.++**Negative:** Full phone acceptance is not green or complete. Current integrated full Core/native/Mac gates were not repeated; earlier passes remain historical. Manual Mac Save/Cancel is unrun, and Environment warnings remain visible. The owner exception does not convert those limits into passing results.
specs/export-todays-notes/design.md Added
diff --git a/specs/export-todays-notes/design.md b/specs/export-todays-notes/design.mdnew file mode 100644index 00000000..f551f015--- /dev/null+++ b/specs/export-todays-notes/design.md@@ -0,0 +1,100 @@+# Design: Export Selected Day's Notes (T2404)++**Status:** Approved for implementation on 2026-10-07 (`Sentinel_342bcdc72fb0819186b0baf7a0c28d06`). This design is the approved target; implementation progress is tracked in `tasks.md`.++## Integration++Extend the existing repository → pure Markdown renderer → `MarkdownExportModel` → `markdownExportShare` path. Keep all library access in the repository and add no persistent model, migration, dependency, or export subsystem.++| Location | Planned change / contract | Requirements |+| --- | --- | --- |+| `LibraryProviding.swift`, `LibraryRepository+Export.swift` | Add `dayExportInput(day:calendar:locale:) async throws -> DayExportInput`. One shared-lock read; return empty blocks for an empty day, throw on read failure. | 1.1–1.4 |+| `MarkdownExport.swift` | Add a value input containing the civil day, preformatted heading date, and ordered `[EntryExportInput]`; add `renderDay` and its filename overload. Reuse `entryParagraphs(..., includingWorkLine: true)` and `document`. | 2.1–2.3 |+| `MarkdownExportModel.swift` | Add `.day(day: CivilDay, calendar: Calendar)` to `Subject`; dispatch to the batch read/render path. Empty input returns to idle with an informational message naming that day before staging; use the existing failure state for errors. Isolate daily staged files by invocation. | 3.2–3.5 |+| `AppLibraryModel.swift`, `AppScreens.today` | Add a factory accepting the resolved selected day, displayed calendar, and formatting locale from Today; freeze the day/calendar in the subject and pass the locale explicitly to the model's existing immutable locale property. Supply this factory to Today rather than sampling a fresh clock/calendar. | 1.1, 1.4, 3.1 |+| `TodayView.swift`, `TodaySections.swift:TodayHeader` | Own the active exporter in view state; add a header share menu while the single-day header is visible, with `Export notes for {long local date}`, progress, a dated empty notice, and existing export error treatment. Attach `markdownExportShare` to the root. | 3.1–3.4 |++### Selected Date and Calendar Snapshot++Reuse `TodayView.selectedDay`, which resolves `TodaySelection.current` against the screen's published `currentDay` or returns its explicit `.day(CivilDay)`. The existing week strip, paging, and return-to-today control are the only date-selection surfaces. At the action's activation, synchronously copy this resolved day and the view's `calendar` from the same displayed publication. Resolve the formatting locale as `calendar.locale ?? Locale.current`, matching `TodayDateText`'s displayed calendar locale with a current-locale fallback; explicitly pass it to the exporter before the first await. Use that same locale rule for the menu date, then the frozen locale for heading, block dates, and empty message. Do not re-resolve `.current` from `Date()`, read `calendarSource()` again, or rely on the export model's default locale. If a midnight or timezone refresh has not yet reached the screen, export the date still named in its header under that screen's calendar.++Membership uses the captured calendar's timezone and Gregorian `CivilDay` semantics, with ordinary calendar-day boundaries and no fixed 24-hour arithmetic or custom cutoff. Explicit past or future selections are supported by existing navigation: exact capture-day equality applies to all of them, with no future folding. Subsequent navigation or calendar publication changes affect the next invocation only; heading, filename, block dates, and empty message all continue to name or use the frozen export context.++### Batch Read++Use the repository's existing `entryGroups`, canonical Work assignment mapping, and snapshot machinery before filtering: physical rows sharing an UUID must not be filtered individually. The logical group's original capture date is its earliest `firstCapturedAt`, already supplied by its snapshot. Select snapshots where `CivilDay(firstCapturedAt, calendar:) == day` and either the note is nonblank after whitespace/newline trimming or a rating is present. Trimming is only an eligibility check; rendered note text stays verbatim. Order by original capture descending and lowercased UUID ascending. Do not read the UI's filtered Noted rows or use its future-folding rule.++Reuse `exportInput(for:includingWork:sites:context:locale:noEpisode:)` within that same lock, with `includingWork: true`. Extend its per-read lookup cache to hold the work type directory and resolved Work title/type values, including missing Work IDs, alongside Site lookups; each Work's metadata is resolved once. Add an optional explicit calendar argument to its date-formatting path: the daily path supplies the frozen calendar, while existing entry/work callers keep their current behavior. Reuse existing normalization and UUID tie-break conventions; do not build the full Today schedule or call a public locked read recursively. Keep the capture-date/content predicate and ordering as small value rules in the existing export module for cheap direct tests.++The returned value is immutable; rendering and staging occur after releasing the lock. `firstCapturedAt` controls membership, order, and the block's original capture date. `lastSharedAt` and `modifiedAt` do not affect membership or order: an entry captured on a different day stays excluded even if re-shared or edited on the selected day, while an entry originally captured on the selected day exports its current saved text and rating. A future-selected day includes only saved captures dated exactly that day, never entries folded into another day's Today display. No read triggers preparation, reconciliation, or a library write.++### Markdown Shape++```markdown+# Notes — 6 October 2026++## [Chapter 12](https://example.test/chapter-12)++*Ember Road* (novel)++▲ · 6 October 2026++The reader's note, verbatim.++## [An unattached article](https://example.test/article)++▲ · 6 October 2026+```++The example selects 6 October 2026; the app's actual current date is irrelevant. The H1 is the only collection grouping; retain each block's work line so notes stay in capture order. Rating-only entries render the existing heading/work/date-and-rating paragraphs without a placeholder note. Format the H1 using the captured selected day, calendar, timezone, and locale; construct the filename from that `CivilDay.description`. Work generic notes, site/series/credit appendices, and cover bytes never enter this input.++### Interaction and Lifecycle++The action targets the selected date at activation. Use the Work toolbar's menu/action pattern with a header share glyph and visible menu item `Export notes for {long local date}`; use the same date-specific accessibility label. Offer it only when `plan.showsDayChrome` is true, so its date matches the visible header. Search/actionable/duplicate views spanning all days hide the action with the date chrome; clearing those filters restores the existing selection. The empty-library exception already keeps the date chrome, so a ready empty library still offers the action and can explain its empty result. Filters do not restrict batch membership. Omit the action until an exporter can be created; disable it during exporting, sharing, and the pending share-outcome grace period.++Create an exporter only after that guard, once per tap rather than on every body pass. Retain it until `handleShareOutcome` completes, including across date navigation. Reuse atomic staging and the dismissal/outcome lifecycle. Empty results clear any previous message and show `There are no notes from {long local date} to export.` using the frozen selected day, even if navigation has since moved, with no staged file; failures use the existing retry message. Put `today-export-menu` on the menu and `today-export-button` on its action button, with accessible progress outside the menu label as an overlay matching `ComposedTeachingView`; add `today-export-share-sheet` and `today-export-notice` to their surfaces. These identifiers continue to name the host screen, not a today-only scope.++Stage daily files at `Library/Caches/MarkdownExports/Day/<process-session UUID>/<invocation UUID>/Asterism Notes YYYY-MM-DD.md`. All daily exporters in one app process share one session token; each invocation owns a distinct directory and stable selected-date filename. Create it only for nonempty input and remove only that invocation's directory after its delivered outcome or failed staging. At export activation, use `ExportStaging.scavenge` to remove other session directories older than its existing 24-hour cutoff, always excluding the current session. This protects long-lived or suspended iPad handoffs; abandoned current-session files wait for a later app launch to become scavenging candidates. Entry/work staging stays unchanged; no coordinator or owner registry is needed.++### Export Pattern Parity Audit++All production references to the existing export types/functions were searched in app and Core sources.++| Existing call site | Needs equivalent? | Action |+| --- | --- | --- |+| `LibraryProviding`, `LibraryRepository+Export`, `MarkdownExport`, `MarkdownExportModel` | Yes | Add daily input/read/render dispatch, preserving existing contracts. |+| `AppLibraryModel` factories, `AppScreens` wiring | Yes | Add a Today factory/action alongside entry/work wiring. |+| `MarkdownExportShare` / `documentExporter` / `ExportStaging` | No | Reuse adapters, atomic writer, and age-based directory scavenge. |+| `ContentView.startCommandExport` subject switch | Yes | Handle the new enum case through the same factory for exhaustive compilation; do not make keyboard routing return it. |+| `NavigationActions.exportSubject`, `EntryDetailRoute`, `EntryDetailView`, `WorkDetailView` | No | Keep selected-entry/work routing and exports unchanged. |+| `SeriesModels`, `WorkDetailModel` | No | Matches are comments only. |+| `MockLibraryProvider`, export/input/renderer tests | Yes | Extend provider conformance and focused tests; retain all existing expectations. |++## Validation Plan++No builds or tests were run during the documentation-only planning stage. Implementation uses the smallest affected suites and isolated temporary data, followed by required current-tree gates, following `AGENTS.md` and `docs/agent-notes/testing.md`; the later owner acceptance exception is recorded in Decision 6.++| Layer | Focused coverage |+| --- | --- |+| Core values: `MarkdownExportTests` | Golden selected-date output and filename, work/unattached/rating-only blocks, exclusion of blank unrated entries, literal title/URL handling and verbatim notes; capture-day calendar/DST boundaries, exact selected-day equality for past/current/future dates, newest-capture-first/UUID ties. |+| Repository: `ExportInputReadTests` | Tiny real store with off-day captures re-shared or edited on the selected day (excluded), selected-day capture with current saved text or rating, captures immediately before/after that day (excluded), future-selected capture without folding, same-UUID/torn rows with earliest capture date, distinct duplicate-set members, missing Work/Site fallback, and empty input; one batch read preserves library content. |+| Model / factory: focused `MarkdownExportModelTests`, `AppLibraryModelTests`, `AppNavigationTests` | One daily provider call; content/selected-date filename staging, dated empty/error no-file paths, explicit versus current selection resolved against the displayed publication, and frozen context across navigation/midnight/zone changes even when the live calendar or locale differs. One cheap case verifies the displayed calendar locale overrides the live locale. Duplicate activation and delayed-outcome cleanup; two exporters retain separate files when one finishes. Age-based cleanup removes stale former-session directories and skips the current session even after 24 hours. |+| UI: `TodayUITests` / focused `WideLayoutUITests` | One populated past-day export/cancel journey and one dated empty notice; visible/accessibly named action and date in compact and wide layouts, all-days action hiding/restoration and empty-library exception. Reuse existing share lifecycle checks; Mac selected-day save/cancel gets a small manual Development check. |++## Source Evidence++Initial reads used canonical main `917037176c8e1fa440c4d36916d92bd99f14032c` and the active refactor at `56afde43247770ca95ba1bd4a6bbab69caf099a4`, including staged Today/header wiring. The selected-day revision also checked the active checkout at `2c0bfb8fa2df4c71650947677bc0631ffbcc3b66`, now clean, with the same selected-date/calendar contract. These checkouts were inspected read-only; implementation must accommodate the refactor's eventual merge before touching these call sites.++- [AppNavigation.swift](../../Asterism/Asterism/Layout/AppNavigation.swift): `TodaySelection.current` resolves against the published current day; explicit `CivilDay` dates survive timezone changes, and week paging is unbounded (lines 87–108, 822–862).+- [AppScreens.swift](../../Asterism/Asterism/Layout/AppScreens.swift) and [TodayView.swift](../../Asterism/Asterism/Views/TodayView.swift): pass the published `currentDay`/calendar/selection together, resolve the selected day for header/week strip, and hide date chrome in all-days views with an empty-library exception (lines 63–68; 218, 430–440, 1266, 1312).+- [TodayText.swift](../../Packages/AsterismCore/Sources/AsterismPresentation/TodayText.swift): `TodayDateText` formats under the supplied calendar, including its locale when present (now in the shared presentation target); the export factory must pass this locale explicitly rather than use `MarkdownExportModel`'s `.current` default.++- [TodayDayPlan.swift](../../Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift): reuse `CivilDay` timezone/Gregorian semantics; the screen's latest-share/future-fold policy remains independent of this export (lines 30, 613).+- [LibraryRepository+Groups.swift](../../Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Groups.swift): logical original capture date is the group's minimum `firstCapturedAt`, carried into `EntrySnapshot` (lines 79, 345–363).+- [LibraryRepository+Export.swift](../../Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift) and [MarkdownExport.swift](../../Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift): batch-read precedent, block fields, formatting/escaping, first-capture dates.+- [MarkdownExportModel.swift](../../Asterism/Asterism/ViewModels/MarkdownExportModel.swift), [MarkdownExportShare.swift](../../Asterism/Asterism/Views/MarkdownExportShare.swift): staging, reentry guard, deferred cleanup, platform handoff.+- [AsterismApp.swift](../../Asterism/Asterism/AsterismApp.swift) permits iPad scenes via `WindowGroup` (line 127); [ExportStaging.swift](../../Packages/AsterismCore/Sources/AsterismCore/ExportStaging.swift) scavenges matching URL children by age, including directories.+- [IntentAnswers.swift](../../Packages/AsterismCore/Sources/AsterismCore/IntentAnswers.swift): the shortcut filters blank notes; this is distinct from Today/export entry semantics (line 72).+- [LibraryRepository.swift](../../Packages/AsterismCore/Sources/AsterismCore/LibraryRepository.swift): ordinary `updateEntry` changes note/rating and `modifiedAt`, not the share/capture dates (line 1090); [LibraryRepository+Capture.swift](../../Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Capture.swift): re-share updates advance `lastSharedAt` while preserving `firstCapturedAt` (lines 428, 458).+- Recalled [test-tier guidance](</Users/arjen/Documents/Obsidian/Main/03-Notes/Generated/How to make Swift test feedback faster without weakening regression checks.md>) was verified against the active checkout's `docs/agent-notes/testing.md`; [SwiftUI accessibility guidance](</Users/arjen/Documents/Obsidian/Main/03-Notes/Generated/SwiftUI accessibility identifiers swallowed by Button labels and DisclosureGroup.md>) was verified against `ComposedTeachingView.swift:265–273`. These inform test placement, stable-root sharing, and the accessible progress overlay. No unrelated-app day or ownership rules were adopted.+- Ticket snapshot: `/tmp/transit-t2404-read/ticket.json`, read at `2026-10-06T13:34:18.642Z`, revision `r1:2bd867030f3cd54371e000f00f03150e68c5df6236853d8ea17e4ea779b46408`. The ticket requests an export similar to note/work export and supplies no further behavior choices.
specs/export-todays-notes/implementation.md Added
diff --git a/specs/export-todays-notes/implementation.md b/specs/export-todays-notes/implementation.mdnew file mode 100644index 00000000..f0b387c1--- /dev/null+++ b/specs/export-todays-notes/implementation.md@@ -0,0 +1,37 @@+# Selected-day export implementation++## Beginner++Select a date in Today, then choose **Export notes for {date}** in its header menu. A single Markdown file contains saved notes and ratings originally captured on that date. A rating counts even without written text. An empty day shows a dated notice.++The chosen date stays fixed while the export is prepared. Editing or sharing an older capture later does not move it into another day's export. Sharing uses the existing platform surface, and cancellation preserves the library.++## Intermediate++`TodayView.startDayExport` synchronously copies its resolved selection, published calendar/timezone, and `calendar.locale ?? Locale.current` before starting an asynchronous task. A retained `MarkdownExportModel` receives that immutable context through `AppLibraryModel`'s day factory.++`LibraryRepository.dayExportInput` performs one shared locked read. It normalizes physical rows by logical UUID, selects the minimum original capture date and current presented content, filters for note text or rating, and sorts by capture descending/UUID ascending. Work/type/Site lookups are cached within the read. `MarkdownExport.renderDay` composes the familiar standalone blocks under a dated heading and filename.++The day subject reuses the existing exporter/share lifecycle. Each invocation owns a directory inside its process-session directory, so same-date exports cannot overwrite each other. Delivered outcomes clean only that invocation; stale former sessions can be scavenged while the current session stays protected. Repeated taps stay suppressed through preparation, presentation and pending outcome.++## Expert++Membership is exact `CivilDay(firstCapturedAt, calendar: frozenCalendar) == selectedDay` after UUID grouping. It does not use Today row projections, `lastSharedAt`, `modifiedAt`, or future folding. The date heading is localized using explicit frozen context; the filename uses the selected day's Gregorian components independently of that display format.++The provider gains one batch method and the exporter subject gains one case; there is no persistence, migration, dependency or reconciliation change. Daily read errors use the existing privacy-safe retry message, while empty results create no file. The header action follows `showsDayChrome`, including the existing ready empty-library exception. Keyboard export routing remains limited to selected notes/works.++The native compiler required explicit types for the composed header inputs/action. Scoped tests cover frozen context, locale divergence, eligibility/order/DST, normalization without mutation, overlapping handoffs, cleanup and error recovery. UI journeys verify historical sharing/cancel, dated empty output and action visibility on phone/iPad.++## Completeness assessment++Implementation and scoped verification are complete under the owner's final acceptance exception. The selected-day Core reader/renderer/provider and their direct tests retain the verified source; `MarkdownExportModel` differs from the earlier full-gate checkpoint only in an inherited comment. Earlier focused export checks passed 55 Core tests and 28 native cases. Earlier unfiltered Core, native and signed Mac/embedded-extension results remain historical evidence for their recorded source, rather than a full-gate result on the integrated tree.++On integrated `d0e4b065`, full iPad acceptance passed **29/29** and the final targeted phone selection passed **5/5**: four export journeys and one exact retry of an unrelated failure. Seven editor-ownership declarations/nine cases also passed on source equivalent to this tree. The verified remote default is `main` at `3cd0ebc`; a preserving rebase completed without conflicts or changed source, with a backup ref retained. All 819 source/build inputs were checked before and after the current runs.++The owner explicitly requested no further full UI runs and authorized PR-based merge. The interrupted phone run retains 73 completed passes, one genuine torn-group assertion, one cancelled in-flight case and 134 missing declarations. Its exact torn-group retry passed; the inherited fixture's midnight boundary is a separate candidate, not proven causality. This is not a complete passing phone result. Full iPad recorded 12 Environment runtime warnings, and the interrupted phone run recorded 66; the final targeted run recorded none. See [verification-run.md](verification-run.md) and [Decision 6](decision_log.md#decision-6-finish-with-targeted-proof-and-the-owner-acceptance-exception).++The manual Mac Save/Cancel check remains unrun because the prepared and existing Development apps share identity/preferences. Essential export behavior has repository/model and real native-sharing UI coverage; the manual Mac interaction is a disclosed coverage limit. No Mac launch or preference mutation was performed. All owned runners drained and both dedicated simulators are Shutdown; the heavy slot was released.++The separately reviewed iPad editor repair retains unfinished title/notes/status drafts across host replacement. It uses the existing library owner, exact-instance Save/Cancel release, bootstrap fencing and teardown retirement. The original rotation assertions remain and passed inside full iPad acceptance. This repair is distinct from selected-day export.++The chosen-day App Intent/Shortcuts action remains the separate feature T2428. No feature requirement remains partially implemented or missing; the remaining limits concern broad phone acceptance, manual Mac execution and unrelated UI follow-up.
specs/export-todays-notes/requirements.md Added
diff --git a/specs/export-todays-notes/requirements.md b/specs/export-todays-notes/requirements.mdnew file mode 100644index 00000000..3a59494f--- /dev/null+++ b/specs/export-todays-notes/requirements.md@@ -0,0 +1,74 @@+# Requirements: Export Selected Day's Notes (T2404)++**Status:** Approved for implementation on 2026-10-07 (`Sentinel_342bcdc72fb0819186b0baf7a0c28d06`).  +**Ticket:** A3FBB206-963F-4061-BA64-86BF7A93E6DE · Idea / Feature / Medium.++## Introduction++Asterism needs a single document containing notes originally captured on the day selected in Today for sharing or keeping outside the app. The export extends the existing note/work Markdown export with a daily collection. The user approved the selected-day requirements/design at `87a7756d` and authorised tasks and implementation. The existing spec folder and ticket identity stay unchanged.++## What “Selected Day's Notes” Means++The selected day is the single date named in the Today header, chosen through the existing week strip, week paging, or return-to-today control. The default current-day selection resolves against the screen's published current day. At activation, freeze this resolved calendar date, the calendar/timezone used by that screen, and the formatting locale before any asynchronous work. Later navigation, midnight, or timezone changes cannot retarget that invocation.++An entry belongs when its original capture date falls on that selected local calendar day and it contains note text or a rating. Rating-only entries count as notes. Re-sharing or editing an entry captured on another day does not make it eligible. Entries before or after the selected day are excluded; a future-selected day includes only saved entries originally dated that day. Included entries export their current saved text and rating.++This selection is independent of the Today screen's latest-share grouping and future-folding policy. The day begins at the captured calendar's start of day, with no custom cutoff. The approved default excludes entries whose text is blank and whose rating is absent. When filters make Today span all days and hide its date header, the export action stays hidden until a single day is displayed again.++## Approved Defaults++| Decision | Default |+| --- | --- |+| Day | User choice: the date selected in Today. Freeze the resolved date and the screen's published calendar/timezone at activation; use the existing current-day selection when no other date was chosen. |+| Included notes | User choice: original capture date equals the selected day, with note text or a rating. Default: exclude empty unrated entries. |+| Document | One `.md` file, one day heading, existing standalone note blocks ordered newest original capture first; no regrouping by work. |+| Entry dates | Existing first-capture date lines; the collection heading names the exported day. |+| Empty day | Informational notice; no empty document or share surface. |+| Entry point | Date-labelled Today header menu action while a single day is displayed; no additional date picker or filter-specific export. |++## Non-Goals++- Date-range, filtered-result, or whole-library export.+- Work/series/creator generic notes, release schedules, cover images, or backup data.+- Additional formats, preview/options screens, scheduled exports, or new keyboard shortcuts.+- Date selection in the existing notes-from-today App Intent/Shortcuts action; this is a separate follow-up ticket.+- Changes to existing per-note/per-work export behavior or Today day boundaries.++## Requirements++### 1. Daily Selection++**User Story:** As a reader, I want notes originally captured on my selected day together, so that I can share that day's notes and ratings.++**Acceptance Criteria:**++1. <a name="1.1"></a>WHEN the reader invokes daily export, the system SHALL freeze the date selected in Today and its displayed calendar/timezone and locale, then select entries whose original `firstCapturedAt` falls on that local calendar day; active filters SHALL NOT narrow the collection.  +2. <a name="1.2"></a>The collection SHALL exclude entries originally captured before or after the selected day; re-sharing or editing an entry captured on another day SHALL NOT make it eligible, and future dates SHALL NOT be folded into a different day's export.  +3. <a name="1.3"></a>The export SHALL include eligible entries with nonblank note text or a rating, including rating-only entries, and exclude blank unrated entries; each application UUID SHALL export once using the deterministic content the app presents, while distinct UUIDs awaiting duplicate resolution SHALL remain distinct blocks.  +4. <a name="1.4"></a>The selection and document SHALL describe one coherent library observation with the resolved date, calendar/timezone, and locale fixed for the invocation despite later navigation, midnight, or timezone changes; cancellation or export SHALL NOT change library content.  ++### 2. Markdown Document++**User Story:** As a reader, I want the familiar note format in a daily document, so that the export stays readable and identifiable.++**Acceptance Criteria:**++1. <a name="2.1"></a>WHEN notes exist, the system SHALL produce UTF-8 Markdown with an H1 `Notes — {long local date}` naming the frozen selected day and one existing standalone note block per entry, ordered by `firstCapturedAt` descending with lowercased UUID ascending for ties.  +2. <a name="2.2"></a>Each block SHALL retain the existing heading link/fallback, optional work/type line, first-capture date/rating line, literal title escaping, URL encoding, and verbatim nonblank note text; the date SHALL be formatted in the invocation's timezone and locale.  +3. <a name="2.3"></a>The filename SHALL be `Asterism Notes YYYY-MM-DD.md`, using the frozen selected day's Gregorian date independent of locale.  ++### 3. Export Interaction++**User Story:** As a reader, I want a daily export action in Today, so that I can share the collection without opening each note.++**Acceptance Criteria:**++1. <a name="3.1"></a>WHEN the library is ready and Today displays a single day's header, including its empty-library state, Today SHALL offer a header action visibly named `Export notes for {long local date}` on iPhone, iPad, and Mac using the selected day; while that header is hidden for all-days results the action SHALL be hidden, and its affordance and progress/error treatment SHALL follow existing note/work export patterns.  +2. <a name="3.2"></a>WHEN a document is prepared, the system SHALL present the existing platform export surface: the system share sheet on iOS/iPadOS and save panel on macOS; repeat activation SHALL be suppressed until the preceding export and handoff finish.  +3. <a name="3.3"></a>IF no eligible entries exist, THEN the system SHALL show `There are no notes from {long local date} to export.` naming the frozen selected day, without staging a file or opening the export surface.  +4. <a name="3.4"></a>IF reading or staging fails, THEN the system SHALL present a content-free retryable error and SHALL NOT offer a partial document; closing the export surface SHALL preserve the library and follow the existing temporary-file cleanup lifecycle.  +5. <a name="3.5"></a>WHILE daily exports are active in separate app scenes, each export SHALL retain its own document until its handoff finishes; finishing one SHALL NOT overwrite or remove another's document.  ++## Approval++The user approved these requirements and design and requested task creation followed by implementation without another approval round. This includes empty-unrated exclusion, newest-capture-first order, the date-labelled entry point, and hiding it in all-days views. Verification and review remain required; the separate App Intent enhancement is outside T2404.
specs/export-todays-notes/tasks.md Added
diff --git a/specs/export-todays-notes/tasks.md b/specs/export-todays-notes/tasks.mdnew file mode 100644index 00000000..96ee95a9--- /dev/null+++ b/specs/export-todays-notes/tasks.md@@ -0,0 +1,93 @@+---+references:+    - specs/export-todays-notes/requirements.md+    - specs/export-todays-notes/design.md+    - specs/export-todays-notes/decision_log.md+---+# Export selected day's notes (T2404)++## Core export++- [x] 1. Write failing tests for selected-day values and Markdown output <!-- id:ocmt3wd -->+  - Extend Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift: exact capture-day equality for past/current/future dates, blank-unrated exclusion, rating-only blocks, newest capture/UUID ties, frozen-zone DST boundaries, selected-date heading/filename, escaping and verbatim note text.+  - Use explicit calendars/timezones/locales and cheap value fixtures; existing note/work golden expectations remain unchanged.+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.2](requirements.md#1.2), [1.3](requirements.md#1.3), [2.1](requirements.md#2.1), [2.2](requirements.md#2.2), [2.3](requirements.md#2.3)+  - References: Packages/AsterismCore/Tests/AsterismCoreTests/MarkdownExportTests.swift++- [x] 2. Implement the selected-day value rules and reusable Markdown renderer <!-- id:ocmt3we -->+  - Add DayExportInput and small eligibility/order rules in Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift; add renderDay and selected-date filename using existing document/entryParagraphs including work lines.+  - Keep values immutable and rendering free of I/O; reuse CivilDay and existing escaping, URL encoding, and first-capture/rating block shape.+  - Blocked-by: ocmt3wd (Write failing tests for selected-day values and Markdown output)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.2](requirements.md#1.2), [1.3](requirements.md#1.3), [2.1](requirements.md#2.1), [2.2](requirements.md#2.2), [2.3](requirements.md#2.3)+  - References: Packages/AsterismCore/Sources/AsterismCore/MarkdownExport.swift, Packages/AsterismCore/Sources/AsterismCore/TodayDayPlan.swift++- [x] 3. Write failing tests for normalized selected-day repository input <!-- id:ocmt3wf -->+  - Extend ExportInputReadTests.swift with a tiny retained-container store: same-UUID earliest capture/carrier content, off-day re-share/edit exclusion, future-selected exact equality, rating-only/blank filtering, distinct duplicate UUIDs, missing metadata, empty day, and no mutation.+  - Pin locale and timezone; include boundary captures and selected-day current saved note/rating. Do not trigger reconciliation or duplicate repair from the read.+  - Blocked-by: ocmt3we (Implement the selected-day value rules and reusable Markdown renderer)+  - 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), [2.2](requirements.md#2.2)+  - References: Packages/AsterismCore/Tests/AsterismCoreTests/ExportInputReadTests.swift++- [x] 4. Implement one locked selected-day batch read and provider conformance <!-- id:ocmt3wg -->+  - Add dayExportInput(day:calendar:locale:) to LibraryProviding.swift and LibraryRepository+Export.swift. Normalize logical entry groups before selecting/sorting; use minimum firstCapturedAt and presented carrier content.+  - Reuse exportInput under one shared lock with includingWork true and an explicit calendar for daily date formatting. Cache Work/type/Site metadata per batch, including missing Work IDs; preserve existing entry/work call behavior.+  - Extend MockLibraryProvider conformance and selected-day recording/fixtures needed by following model tests; no App Intent changes.+  - Blocked-by: ocmt3wf (Write failing tests for normalized selected-day repository input)+  - 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), [2.2](requirements.md#2.2)+  - References: Packages/AsterismCore/Sources/AsterismCore/LibraryProviding.swift, Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Export.swift, Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+Groups.swift, Asterism/AsterismTests/Helpers/MockLibraryProvider.swift++## App export++- [x] 5. Write failing tests for selected-day exporter context and file lifecycle <!-- id:ocmt3wh -->+  - Extend MarkdownExportModelTests and focused AppLibraryModelTests/AppNavigationTests: one batch call, explicit/current displayed selection, displayed calendar.locale overriding live locale, frozen context across midnight/navigation/zone changes, dated empty/error no-file paths and re-entry guard.+  - Use deterministic existing submission gates for delayed outcomes; two exporters retain independent same-date files. Check cleanup of own invocation, stale former sessions and current-session exclusion even after 24 hours.+  - Blocked-by: ocmt3wg (Implement one locked selected-day batch read and provider conformance)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.4](requirements.md#1.4), [2.1](requirements.md#2.1), [2.3](requirements.md#2.3), [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [3.4](requirements.md#3.4), [3.5](requirements.md#3.5)+  - References: Asterism/AsterismTests/MarkdownExportModelTests.swift, Asterism/AsterismTests/AppLibraryModelTests.swift, Asterism/AsterismTests/AppNavigationTests.swift++- [x] 6. Implement selected-day exporter, immutable context factory and staging <!-- id:ocmt3wi -->+  - Extend MarkdownExportModel.Subject with day and dispatch the single batch read/render path. Return empty input to idle with the frozen-date notice before staging; preserve privacy-safe failure and delivered-outcome lifecycle.+  - Add AppLibraryModel factory accepting resolved selected day, published calendar, and explicit locale. Stage under Day/process-session/invocation with stable selected-date filename; scavenge only stale other sessions and clean only owned invocation.+  - Update exhaustive ContentView subject handling without adding keyboard routing; preserve existing entry/work behavior.+  - Blocked-by: ocmt3wh (Write failing tests for selected-day exporter context and file lifecycle)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.4](requirements.md#1.4), [2.1](requirements.md#2.1), [2.3](requirements.md#2.3), [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [3.4](requirements.md#3.4), [3.5](requirements.md#3.5)+  - References: Asterism/Asterism/ViewModels/MarkdownExportModel.swift, Asterism/Asterism/ViewModels/AppLibraryModel.swift, Asterism/Asterism/ContentView.swift, Packages/AsterismCore/Sources/AsterismCore/ExportStaging.swift++- [x] 7. Write minimal selected-day export UI journeys <!-- id:ocmt3wj -->+  - Add focused TodayUITests and WideLayoutUITests journeys for past-day export/cancel, dated empty notice, accessible dated menu action, all-days hiding/restoration and the ready empty-library exception.+  - Use existing stable fixture and week-navigation helpers; assert selected date and share lifecycle rather than platform-dependent menu container types. Keep development selection limited to affected journeys.+  - Blocked-by: ocmt3wi (Implement selected-day exporter, immutable context factory and staging)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.4](requirements.md#1.4), [3.1](requirements.md#3.1), [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [3.4](requirements.md#3.4)+  - References: Asterism/AsterismUITests/TodayUITests.swift, Asterism/AsterismUITests/WideLayoutUITests.swift++- [x] 8. Wire the selected-day header action and existing platform export surface <!-- id:ocmt3wk -->+  - Pass the export factory through AppScreens.today into TodayView; at activation copy resolved selectedDay and published calendar, resolve calendar.locale ?? Locale.current, then create one retained exporter before awaiting.+  - Add TodayHeader share menu only when showsDayChrome is true, including empty-library exception. Label it Export notes for the selected long local date; retain exporter across navigation and suppress overlap through delivered outcome.+  - Attach markdownExportShare to stable TodayView root, expose dated empty/error notice and accessible progress outside the menu label, and retain planned today-export identifiers. No extra picker, shortcut or App Intent extension.+  - Blocked-by: ocmt3wj (Write minimal selected-day export UI journeys)+  - Stream: 1+  - Requirements: [1.1](requirements.md#1.1), [1.4](requirements.md#1.4), [3.1](requirements.md#3.1), [3.2](requirements.md#3.2), [3.3](requirements.md#3.3), [3.4](requirements.md#3.4)+  - References: Asterism/Asterism/Layout/AppScreens.swift, Asterism/Asterism/Views/TodayView.swift, Asterism/Asterism/Views/TodaySections.swift, Asterism/Asterism/Views/MarkdownExportShare.swift++## Verification++- [x] 9. Verify affected export behavior for the reviewed PR under the owner exception <!-- id:ocmt3wl -->+  - Decision 6 records explicit owner no-further-full-UI and PR-merge authorization; no acceptance is inferred+  - Verified remote default main3cd0ebc; backup ref retained and preserving rebase completed without conflicts or source changes at d0e4b065+  - Current full iPad29 passed with no failures or skips; 12 Environment runtime warnings remain disclosed+  - Final targeted phone5 passed with no failures or skips or runtime warnings; four export journeys plus one exact unrelated torn-group retry+  - Original phone result remains FAILED/INCOMPLETE: 73 completed passes /1 genuine assertion /1 cancelled in-flight case /134 missing declarations; midnight fixture candidate stays separate+  - Focused editor7 declarations /9 cases passed on source equivalent to current tree; historical focused export55Core /28native and full Core/native/Mac results retain exact source qualifications+  - Manual Mac Save/Cancel remains unrun due shared Development identity/preferences; no Mac launch or settings mutation; essential export behavior has repository/model/native-sharing proof+  - All owned jobs drained and both dedicated simulators Shutdown; heavy slot released at2026-10-07T13:18:46.480389+00:00; four final reviewers and light doc checks support the PR workflow with no direct main push+  - Blocked-by: ocmt3wk (Wire the selected-day header action and existing platform export surface)+  - 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), [2.1](requirements.md#2.1), [2.2](requirements.md#2.2), [2.3](requirements.md#2.3), [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)+  - References: Makefile, AGENTS.md, docs/agent-notes/testing.md
specs/export-todays-notes/verification-run.md Added
diff --git a/specs/export-todays-notes/verification-run.md b/specs/export-todays-notes/verification-run.mdnew file mode 100644index 00000000..926230f7--- /dev/null+++ b/specs/export-todays-notes/verification-run.md@@ -0,0 +1,155 @@+# T2404 selected-day export verification++**Current status:** scoped verification is complete under the owner exception. Current full iPad passes 29/29 and final targeted phone passes 5/5; full phone acceptance remains incomplete and manual Mac Save/Cancel is unrun. See [final verification and PR workflow](#final-owner-directed-verification-and-pr-workflow--2026-10-07). The records below are historical until that final section; their earlier gate/publication restrictions are superseded by Decision 6.++The targeted batches below passed. Full Core, signed Mac and native gates subsequently passed; full phone/iPad acceptance remains incomplete. This record grants no exception to required gates. Branch: `T-2404/export-selected-day-notes`, based on main `91703717`. Core is preserved in `64a3e599`; this app increment contains the same tested Core source.++| Batch | Executed / passed | Evidence |+| --- | --- | --- |+| Core renderer/repository | 55 / 55, including 10 new selected-day tests | `make test-core CORE_TEST='(MarkdownExportTests\|ExportInputReadTests)'`; `/tmp/t2404-core-result.json` |+| Export model | 25 / 25 argument cases across 24 declarations | `make test-only TEST=AsterismTests/MarkdownExportModelTests`; `/tmp/t2404-native-2.xcresult` |+| Factory/navigation | 3 / 3 | Exact `selectedDayExportFactoryFreezesDisplayedContext()`, `selectedDayExportFactoryCurrentAndUnavailable()`, `selectedDayDoesNotAddKeyboardExport()` selectors; `/tmp/t2404-native-3.xcresult` |+| Phone UI | 4 / 4 | `/tmp/t2404-phone-ui-1.xcresult` |+| iPad UI | 2 / 2 | `/tmp/t2404-ipad-ui-1.xcresult` |++All inventories were compared with the intended source declarations/selectors. Native totals are **27 declarations / 28 argument cases**, including nine new tests. No final failures or skips. The aggregate result, commands, log hashes and verified source hashes are in `/tmp/t2404-app-result.json`; the prepared handoff is `/tmp/t2404-app-slot-request.json`.++Phone journeys cover historical rating-only export/cancel, dated empty-day notice, all-days hiding/restoration, and the ready empty-library exception. The iPad journeys cover historical export/cancel and an empty selected day in the wide layout.++The first native attempt failed to compile the composed `TodayView.header` expression, executing zero tests (`/tmp/t2404-native-1.xcresult`). Explicit header value/action types resolve the failure without changing behavior. The first successful exporter run omitted the three individual selectors without their `()` suffixes; those three cases then ran separately on the unchanged source. No missing selection is counted as a pass.++Six primary warnings in the first compile and seventeen in the subsequent compile originate at unchanged warning sites. One warning is in an unchanged existing test inside the extended `AppLibraryModelTests` file (line 1210 at the Core checkpoint, 1270 afterward). No unrelated warning sites were changed.++Only owned iOS 27 simulators were used: phone `8E1C14A0-6C10-4B4D-B0ED-FC7A194BF03B` and iPad `09FFB229-247B-461E-85FA-9704F312C698`. Both were shut down after the targeted batch. The owned phone is also Shutdown after the later diagnostic failure. Tests use UUID temporary library fixtures, private `/tmp/t2404-*` caches/DerivedData/results, and the Development configuration. No production-data access, physical installation, main push, merge, or unrelated suite expansion occurred.++## Remaining acceptance++Task 9 stays incomplete until the exact final tree passes unfiltered Core, full native units, the signed Mac build with embedded share extension, broad phone acceptance and full affected iPad acceptance, plus source/identity and pre-push review. No PR102 exception applies. The Mac product may be built but is never launched against a user library. The reservation is released; remaining heavy commands await a new exclusive reservation.++The chosen-day App Intent/Shortcuts enhancement remains separate in T2428 (`C44D6B28-45C2-4FE5-B13A-771C42D82AFF`).++## Source-only pre-push review++The verified app increment is preserved as `10491a20`; tasks 1–8 are complete. Four parallel reviewers checked the complete branch diff against `91703717`: reuse, quality and spec/documentation reported no material source finding. The efficiency review found that Work-line metadata projected an unused history of Entry rows; the existing `entryRows: []` snapshot overload now avoids that traversal while preserving the presented title/type and Work validation. The bounded correction passed unfiltered Core and full native verification and is included in the subsequent local review checkpoint.++Source review reports and the prepared full-gate commands/inventory are under `/tmp/t2404-prepush/`. Review HTML and final ready-to-push status will follow full verification, not precede it. The small manual Development Mac selected-day save/cancel check in `design.md:82` also has no recorded result; a signed Mac build does not establish that interaction result.++## Mandatory pre-push batch — 2026-10-07++| Gate | Observed result | Evidence |+| --- | --- | --- |+| Unfiltered Core, all three targets | **3,349 passed / 55 existing opt-in skips / 0 failures**; all 3,404 registered IDs match source | `/tmp/t2404-prepush/core-full-2.log`; `review-inputs/core-full-2-swift-testing.xml` |+| Signed Development Mac build | **Passed**, including embedded share-extension prerequisite; no Mac app launch | `/tmp/t2404-prepush/native-full-and-signed-mac-1.log` |+| Full native units | **2,000 declarations / 2,122 execution cases passed**, no skips/failures; exact source inventory | `/tmp/t2404-prepush/native-full-1.xcresult` |+| Full phone UI | **Incomplete**. Attempt 1: 8 passed, 1 failed before drain. Attempt 2: 32 execution cases passed, 1 failed across 30 distinct declarations before drain; 209 declarations remain required | `/tmp/t2404-prepush/phone-ui-full-{1,2}.log` |+| Full iPad UI | **Pending**, all 26 declarations remain required | Prepared `/tmp/t2404-prepush/ipad-ui-full-1.sh` |++The first Core attempt had three helper-launch fixture failures because the existing test locator expects package `.build/debug`, while the private scratch path built the helper elsewhere. A temporary task-owned cache alias corrected that configuration; tests were unchanged, the full second run passed, and the alias was removed afterward.++The first phone failure waited for a lazy taught-chapter row before scrolling at the largest text size. A scoped correction uses the suite's existing bounded list-scroll helper, preserves its fixture and navigation assertions, and passed both its exact case and the second broad run. Independent source review reported no finding.++The second phone failure is `AnnouncementUITests.testTheRowStaysHittableAtLargestDynamicType:165`: the row exists initially, then the one-direction swipe loop loses it before the original hittability assertion. The 44-point height assertion was not reached. A faithful exact-case diagnostic passed once, with its instrumentation branch unused. The next bounded diagnostic executed **zero tests**: Xcode could not boot the owned simulator because `launchd_sim` could not bind to its session. A three-second sample showed Xcode waiting for its scoped `simctl diagnose` collector; stopping only that verified child allowed Xcode to flush the primary startup error and drain. Geometry and any necessary Announcement correction remain unproven. Temporary diagnostic source was restored to exact HEAD bytes; no assertion was relaxed.++The parent explicitly released this reservation for queued Halo/Transit checks and prohibited another broad retry in it. This is scheduling, **not an acceptance waiver**. Task 9 remains in progress; no branch push, PR, main mutation or merge occurred. Full phone/iPad gates and the manual Development Mac save/cancel check remain outstanding.++Exact inventories, structured results, snapshots, source hashes and bounded diagnostics are in `/tmp/t2404-prepush/gate-results.json` and `mandatory-gates.json`. No new source warning sites were found in the signed Mac/native gate.++## Local review checkpoint++[gate-evidence.json](gate-evidence.json) preserves all eight observed attempts, exact command scripts, original failure messages, partial-inventory counts, source hashes and hashes of the saved logs/reports. Large inventories and result bundles stay at their recorded local paths. The checkpoint includes the two reviewed corrections and these verification documents; Announcement test source is restored to its exact `10491a20` bytes. A local commit does not complete task 9 or satisfy the unfinished phone/iPad gates.++The next app job awaits a new heavy slot. Prepare one exact Announcement case with unconditional geometry capture before the existing swipe loop and capture after a swipe when needed. Keep the original query, fixture, gestures, eight-attempt limit and both assertions. Choose any permanent scrolling correction only from recorded geometry; the current artifacts do not establish one.++## Focused phone and independent iPad follow-up — 2026-10-07++The corrected source partition is **206 phone + 29 iPad = 235 disjoint UI declarations**. Earlier prepared 209/26 counts misclassified the three wide-accessibility cases; no test was removed or skipped to correct the inventory. The sealed original gate evidence remains unchanged. The preceding full phone attempt completed 93 passed / 1 failed / 2 existing opt-in skips across 93 distinct declarations, leaving 113 missing. All six Announcement cases passed there; PublicationReturnDate failed at line 87.++| Follow-up | Actual result | Scope |+| --- | --- | --- |+| Original exact PublicationReturnDate largest-text case | **0 passed / 1 failed / 0 skips**, runner exit 2 | Later line 120 failed after picker existence returned; final saved hierarchy has no picker. The earlier line-87 failure did not reproduce exactly; no cause or product fix established. |+| Original full iPad suite | **27 passed / 2 failed / 0 skips**, all 29 IDs match, no missing/unexpected IDs | Both T2404 export/cancel and empty-day cases passed. Reading-status landscape and the old No Episode column expectation failed. |+| Reading-status case after one-line driver correction | **0 passed / 1 failed / 0 skips**, runner exit 2 | All five original landscape segment checks and selection passed. Portrait rotation then returned to read mode; original line-1611 editor-preservation assertion remains failing. |+| No Episode after current-layout test correction | **1 passed / 0 failures / 0 skips**, runner exit 0 | Exact original owning selector, fixtures, marked-row predicate and menu gestures retained; correct work title, Today selection and single-pane layout asserted. |++The reading-status driver now swipes its existing detail column, as its comment already required. Eight whole-app swipes previously left the target below the viewport at exactly the same position. The No Episode journey checked a column superseded by approved wide-layouts-rethink Q1/Q8; its saved hierarchy already showed the correct Amber Signal work page. These are two reviewed test corrections only. Strict pre/post guards checked all 791 source/build hashes with exactly those overlays and preserved all 235 test IDs. Production/Core/native source and build inputs remain unchanged.++The later portrait failure shows actual editor-mode loss, not a lazy hidden row: saved PID 40548 trees change from Cancel/Save and selected `toRead` to Edit and persisted Reading: Finished. The model-lifetime cause remains unproven. No assertion, wait or production behavior was changed to hide it.++Both failing iPad runners completed their tests, then waited on their own simulator diagnostic collectors. Two observations more than 60 seconds apart and three-second samples established the blocking collector in each run. Only the verified collector was terminated; Xcode finalized the original failed results. Diagnostic collection was interrupted and is recorded separately from unchanged test execution. The initial phone invocation failed before tests because the default sandbox denied SwiftPM cache diagnostics emission; its outputs were preserved before one authorized identical-command retry.++The synthetic Mac Save/Cancel check was not launched: an existing Development Devsterism instance from another checkout (PID 29406) prevents the prepared fresh-instance check. That instance and the reserved synthetic UUID remain untouched; no GUI/TCC probe or preference operation occurred.++The slot was released at **2026-10-07 10:32:42 UTC** after all owned runners/collectors drained; both owned simulators reported already Shutdown. No full phone restart or full iPad retry occurred. Task 9 remains in progress: phone picker diagnosis, portrait editor preservation, complete phone/iPad acceptance and safe synthetic Mac Save/Cancel are still required. No push, PR, merge or tracker mutation occurred.++[ui-acceptance-follow-up.json](ui-acceptance-follow-up.json) preserves the runtime source checkpoints, exact overlays, outcomes, original failures, interrupted diagnostics and hashes of 17 supporting receipts. Raw logs, bundles and bounded hierarchy extracts remain at their recorded local paths.++## Source-only editor repair and reconciliation — 2026-10-07++Source inspection identifies a matching lifetime defect for the observed portrait edit-mode loss: the iPad layout crossing replaces the Library host, `AppScreens` constructs a fresh work-detail model, and the old model belongs to that host's `@State`. The existing model's reload already preserves an active draft. The prepared repair retains only unfinished iPad editors in the existing library owner, keyed by route stack and Work UUID. Cancel and successful Save release the exact instance; failed/refused Save retains it. Bootstrap blocks admission and late registration; teardown retires retained editors before its first suspension, and the repository epoch rejects old callbacks. Phone/Mac screens and unscoped status/merge previews keep their current factory behavior.++The source draft adds **seven native declarations / nine argument cases** for draft reload, save/cancel, route/work isolation, earlier pushed destinations, stale exits and bootstrap/teardown. The existing iPad rotation case now enters and checks an unsaved title and notes before and after rotation, alongside the unsaved reading-status choice. Its original 20-second survival wait and segment label/frame/selection checks remain. `git diff --check` passes, and the independent critic reports no remaining production source findings in `/tmp/t2404-prepush/next-acceptance/rotation-repair-design-review.json`; **no compilation or runtime verification has run for this repair**. The patch and exact hashes are saved in `/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/{source-preparation.patch,source-readiness.json}`. The five source paths are uncommitted at `4e4af5ae`; task 9 remains in progress. Its Rune details were updated without changing task status, requirements, references or dependencies.++The parent reports PR102 merged as remote main `3cd0ebc0eeb861e534803e932176c676f27910a5`. Its guidance at `caa00fb9` was read from the unchanged refactor checkout: `AGENTS.md` replaces `CLAUDE.md` and preserves targeted development checks, the Core/signed-Mac/native pre-commit bar, and full phone/iPad pre-push acceptance. The PR102 merge exception does not apply here. That upstream source already has an iPad editor cache and stronger UI corrections. Before runtime verification/publication, safely reconcile main into this branch, keep one editor owner, and preserve the upstream compact `work-detail-scroll` marker, both scrolling-direction fallbacks, status-selection assertion and No Episode Back/marked-row checks. No merge, fetch or refactor-checkout mutation occurred in this source-only turn; the new main object is not yet available in this worktree's common repository.++Saved phone PID 34769 evidence proves a positive DatePicker existence observation followed by a final editor hierarchy without the picker. It does not record the intervening visible presentation, dismissal or host/model lifecycle. The status-section sheet host remains a hypothesis, so no permanent picker correction was made. The earlier PID 26570 UIKit presentation conflict is preserved separately and is not attributed to this reproduction. The bounded source/evidence report is `/tmp/t2404-prepush/next-acceptance/publication-picker-source-followup-review.json`; nine small artifacts and three exact source excerpts were independently hash-checked.++The Mac check remains blocked by shared identity: both prepared and running Devsterism products use `me.nore.ig.Asterism.dev` and its sandbox/App Group. The UUID fixture isolates the store/spool/staging but still resets shared Development preferences. No separate provisioned, verified test app was found in the bounded known product locations. Copying or forcing another process does not provide independent identity. `/tmp/t2404-prepush/next-acceptance/mac-separate-identity-source-review.json` records the blocker. PID 29406 was left untouched; no launch, GUI/TCC/defaults operation or repeated signing verification occurred.++All build/test/simulator jobs remain paused for Halo's next verification slot. Focused execution awaits main reconciliation, a newly frozen source inventory and an exclusive reservation. Earlier gate receipts remain historical evidence for their exact source; this draft does not grant a passing current-tree verdict, a code-commit exception or permission to publish.++## Authorized local checkpoint and main integration — 2026-10-07++The user subsequently instructed that the reviewed repair be saved in a coherent local commit with runtime pending, followed immediately by safe reconciliation with merged main `3cd0ebc0eeb861e534803e932176c676f27910a5`. This explicit local-checkpoint exception does not waive runtime or publication gates. Heavy checks remain paused while Halo owns the slot; focused verification will use the integrated source rather than testing the old base first. The remote main object is now available locally, so no fetch is needed. The running Mac instance/preferences remain untouched.++The reviewed repair is preserved in `54edd6d1`. Main reconciliation now keeps one route/Work editor registry, both compact scrolling fallbacks and both sets of legitimate UI assertions, including the No Episode Back/marked-row return. It retains incoming stable return-date sheet presentation. Three small adaptations address the relocated test fixture import, the upstream independent-status test's factory calls, and public access to the moved long-date helper. All five Core export source/test files are byte-identical to the repair checkpoint. Independent integration review reports no remaining source findings; all 30 frozen source hashes match. Reports are under `/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/integration/`. The source still declares exactly 206 phone / 29 iPad UI IDs with none added or removed, and seven ownership declarations / nine cases.++The parent then confirmed Halo cleanup 145/buildgate passed and all heavy jobs drained, granting an exclusive focused slot after this source integration/review. Execute the ownership suite and original rotation case on the clean integrated commit with newly frozen guards. Broad phone acceptance is not restarted in this batch. Task 9 and all full current-tree acceptance gates remain open; source review is not a runtime pass.+++## Focused integrated editor verification — 2026-10-07++The reviewed repair is committed as `54edd6d1`; local merge `c3eaf74f` integrates main `3cd0ebc`. One active editor registry retains unfinished iPad drafts by route and work UUID, rejects registration during bootstrap, and releases the exact editor after Cancel or successful Save. Both legitimate UI correction sets and the incoming stable-root return-date sheet remain. Independent integration source reviews reported no remaining finding.++| Focused selection | Actual result | Exact source |+| --- | --- | --- |+| WorkEditSessionTests | **7 declarations / 9 execution cases passed; 0 failures/skips** | Clean integrated `c3eaf74f`; both Boolean parameter pairs executed |+| Original five-reading-status iPad rotation journey | **1 passed; 0 failures/skips**, 71.343 seconds | Same integrated source; unsaved title, notes and selected status survived portrait rotation; original assertions/wait budgets retained |+| Ownership suite after warning cleanup | **7 declarations / 9 execution cases passed again; 0 failures/skips** | `c3eaf74f` plus the reviewed one-file native test overlay, SHA256 `6c17c2dd3ea30d2d4c375abd316c52df9d8ce248bc46e95d3f6865f8f30928f2`; all production/UI inputs unchanged |++Every run passed its pre/post checks of **819 source/build inputs** and retained all **235 UI declarations (206 phone + 29 iPad)**. The native result metadata separates seven declarations from nine argument executions; exact identifiers and both `false`/`true` pairs were checked. All three runners naturally exited zero and finalized their results; no diagnostic collector was interrupted or process signalled.++The first native compile exposed nine new test-warning sites: five optional-context macro warnings and four weak-observer mutability warnings. The reviewed cleanup assigns the releasable optional directly, requires it to be nonnil, and uses compiler-recommended `weak let`; the deallocation assertions remain intact without an additional strong reference. Its focused rerun emitted none of those warnings. Existing warnings remain recorded; this incremental compile does not establish a full clean warning gate. The iPad result also contains two unclassified Environment warnings for Calendar and CivilDay, logged before work selection/Edit/rotation. No stack establishes their source or inheritance.++The first finalized native metadata read was denied permission to generate its report. One identical-call retry under the explicit focused-verification authorization succeeded; the denial did not alter the test outcome. Subsequent finalized metadata reads used that scoped report-generation access.++The focused slot was released at **2026-10-07T11:46:08.908358+00:00**. Process inspection found no owned runner/diagnostic remaining, and both owned simulators were already Shutdown; no shutdown command was needed. No broad phone restart, Mac launch, shared-preference operation, feature push, PR, tracker write or main checkout mutation occurred.++The consolidated local receipt is [/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/integration/focused-integrated-final-handoff.json](/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/integration/focused-integrated-final-handoff.json). The exact uncommitted warning cleanup is [work-edit-warning-cleanup.patch](/tmp/t2404-prepush/next-acceptance/editor-ownership-repair/integration/work-edit-warning-cleanup.patch). The original sealed gate evidence remains unchanged.++**Task 9 remains InProgress.** Current-tree unfiltered Core, signed Mac/embedded-extension and full native checks, full phone/iPad acceptance, and exact final-tree pre-push review remain required. Incoming main contains return-date presentation/query changes, so the previous phone failure is historical evidence rather than a new result on this source. The manual Development Mac Save/Cancel check remains blocked by the existing shared app identity/preferences; the running instance stays untouched. Further heavy work awaits a new exclusive reservation.++## Final owner-directed verification and PR workflow — 2026-10-07++This section supersedes earlier pending-gate and no-publication statements. [Decision 6](decision_log.md#decision-6-finish-with-targeted-proof-and-the-owner-acceptance-exception) records the owner's explicit no-further-full-UI instruction, one targeted retry policy and later PR-based merge authorization. No approval is inferred from historical tests.++Remote HEAD and GitHub independently verified **`main` at `3cd0ebc0eeb861e534803e932176c676f27910a5`**. After saving backup ref `backup/T-2404-before-owner-rebase-d0e4b065`, fetch and `git rebase --rebase-merges origin/main` completed without conflicts or changed HEAD/source. Runtime checkpoint is **`d0e4b0652343030912ae2c3883f396d3b9866ec0`**; the final bookkeeping commit changes documentation only. All **819 source/build inputs** still match the verified manifest. The existing canonical/refactor checkouts and sealed earlier evidence remain preserved.++| Selection | Actual result | Qualification |+| --- | --- | --- |+| Full iPad acceptance | **29 passed; 0 failures/skips/missing** | Current integrated source; original draft-survival and No Episode assertions retained; 12 Environment runtime warnings visible |+| Final targeted phone | **5 passed; 0 failures/skips; 0 runtime warnings** | Exact torn-group retry plus four export journeys: historical rating-only sharing/Cancel, selected empty day, all-days hiding/restoration and ready empty-library export |+| Focused editor ownership | **7 declarations / 9 cases passed** | Source equivalent to current checkpoint; both Boolean pairs checked; nine new test-warning sites removed and rerun |+| Earlier export Core/native | **55 focused Core / 28 native cases passed** | Historical source-qualified support; six direct source/test files identical and exporter diff comment-only |+| Earlier full Core/native/signed Mac | **Pass at their recorded checkpoint** | Historical support only; incoming main changed other package/app/build inputs; no current full-green claim |+| Full phone interrupted by owner | **73 completed passes; 1 genuine assertion; 1 cancelled in-flight case; 134 missing declarations** | 74 finished executions; 72 structured declaration nodes include cancellation. Structured summary folds four launch configurations into one declaration (70 passed / 2 failed). Result stays FAILED/INCOMPLETE; 66 runtime warnings retained |+| Manual Mac Save/Cancel | **Not run** | Prepared and existing Development products share app identity/preferences; no launch or preference mutation |++The original torn-group assertion was `DuplicateResolutionUITests/testATornGroupIsReadOnlyAndDisclosesBeforeDeleting:193` (row absent), not an export assertion. It started at local 00:00:31; the inherited fixture subtracts 70/69 seconds. This suggests a midnight date-boundary issue, but exact runtime timezone/seed attribution is unproven. Its single exact retry passed in **42.538 seconds** on unchanged source. Preserve this separate follow-up candidate rather than expanding T2404 or declaring the original failure fixed.++Environment warnings are also separate: unchanged main-source Works helpers read Calendar/CivilDay outside a mounted view; a bounded source diagnosis identifies that candidate, without a runtime backtrace proving the first emitting expression. No unrelated correction was added. The already reviewed iPad editor-lifetime repair is retained as a distinct change and verified by nine native cases and full iPad acceptance.++All final runners naturally drained; the owner-requested SIGINT finalized the partial phone run without a collector termination. Both dedicated simulators reported **Shutdown**, and the heavy slot was released at **2026-10-07T13:18:46.480389+00:00**. No further heavy command is planned. The Development Mac app/shared preferences, Personal app, physical devices and tracker remain untouched.++Final local evidence is under [/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065](/tmp/t2404-prepush/next-acceptance/acceptance-d0e4b065): finalized iPad/phone verdicts and source checks, original interruption, `duplicate-torn-midnight-source-diagnosis.json`, and `final-owned-cleanup.json`. Four current source-review reports, exact export input comparison, rebase input equivalence, actual-result JUnit and generated review inputs are under [/tmp/t2404-prepush/final-review-d0e4b065](/tmp/t2404-prepush/final-review-d0e4b065). [final-verification.json](final-verification.json) preserves the compact source-qualified handoff; previous sealed gate JSON is unchanged.++**Scoped verification is complete under the owner exception.** Full phone acceptance is incomplete and manual Mac interaction remains unrun; these remain disclosed limits through PR review and merge. Use the PR workflow, verify the remote merge SHA, and never push main directly.

Things to double-check

Full phone is incomplete

73 completed passes, 1 genuine assertion, 1 cancelled in-flight case and 134 missing declarations. The five-case rerun is scoped evidence, not full-phone acceptance.

Manual Mac Save/Cancel is unrun

Shared Development identity/preferences prevent a separate safe check. No app launch or preference operation occurred; existing model/Core/native-sharing proof covers essential behavior.

Historical full gates retain their source

Incoming main changed other inputs; no full current Core/native/Mac result is claimed. Rebase changed no source, so no additional feature uncertainty justified repeating them.