Asterism

Pre-push and merge review: T-2487 inline review notes

Record-wide notes can be drafted during character/place suggestion review and saved with Keep.

At a glance

  • Inline character/place notes stay local until Keep. Skip and close discard drafts; stale replacements require an explicit choice.

  • The keyboard toolbar covered the note touch region. A measured iOS safe-area inset now keeps native text available for selection and caret placement; Mac retains its toolbar.

  • The exact red gesture now passes: double-tap/select a word, replace it, single-tap a caret position and insert a prefix while the keyboard stays visible.

  • Rebase bridge: Core10, native6 unique/11 expanded, phone12, iPad2 all passed; no missing/unexpected tests, skips or runtime warnings. Earlier broad suites and cursor9/7 remain source-qualified reused evidence.

Verdict

PR117 merged; phone update awaiting approval

Merged ecbe812f2a04ef8fcc622d6a354ebd8418490c5a, tree 7813d1e92401bdbc3294b71edef1fec64e59c6af exactly equals reviewed c3c664fc. Both independent review/fixer rounds clean. Integrated checks: 30 unique methods, 35 expanded executions, zero failures/skips/runtime warnings; signed Mac compile passed. Personal RunProject was rejected before execution by automatic approval review requiring explicit approval now. No new phone installation or launch occurred.

Personal generic iOS build subsequently passed (234.471s), with strict main/embedded-extension signatures and regular identifiers verified. Device arm64 UUID FADFE787-E9A3-3721-ABF3-0B04CEF224CE; SHA256 e80e7ecea191cd4d246825844d6cffe825f2e74f060b4c26fd42ada418314be9. This is build-only evidence; no phone installation/launch.

Review findings

3 raised · 2 fixed · 1 skipped

Jump to findings →

Tests

Pass rate: 100% (30 of 30)

New tests: 23

Diff coverage: n/a

Jump to tests →

Commits

Three-level explanation

Write a note directly in the review card. You can select words and move the cursor with your finger while typing. Done hides the keyboard; Keep saves the note.

The native keyboard toolbar overlapped the focused field even though its text remained visible. Reserving the Done bar through a measured Form safe-area inset makes native touch editing reachable. The record-note model and repository write boundary are unchanged.

Red geometry: note y505–546 versus toolbar y498–546. Exact first-word replacement appended at the old caret. The same gesture passed with the inset and unchanged immediate scroll-dismiss policy. Final tests add single-tap caret insertion, Done target/retained draft, Keep/readback and place close/reopen/discard. Frozen file hashes were validated and committed unchanged as 0d75b654. Native/package/full-suite results from af19 remain separate baseline evidence.

Important changes — detailed

Native cursor touch region

Asterism/Asterism/Views/CharacterReviewView.swift

Why it matters. Visible text was inside the keyboard toolbar touch region.

What to look at. Measured safeAreaInset and existing RuntimePlatform selection

Takeaway. Reserve the actual dismissal bar height; keep native text editing and persistence semantics.
Rationale. Proven failing gesture and measured overlap; no gesture bypass or guessed toolbar spacer.

Review UI: native note drafts

Asterism/Asterism/Views/CharacterReviewView.swift

Why it matters. Readers can add context while deciding a suggestion.

What to look at. rowContent: inline multiline field and native keyboard Done

Takeaway. Only Keep persists the staged value.
Rationale. Owner-tested inline refinement; keyboard dismissal preserves text.

Review model: scoped note authority

Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swift

Why it matters. Typing and refresh cannot silently authorize an overwrite.

What to look at. setNoteDraft, resolveNoteConflict and target-scoped draft cache

Takeaway. Retain the staged basis until explicit conflict resolution; fresh drafts capture the current note.
Rationale. The existing record note is reader-authored and must not be silently replaced.

Repository: atomic optional note edit

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

Why it matters. Note and accepted record share the existing transaction and rollback.

What to look at. apply decision acceptance and applyAcceptance

Takeaway. Validate captured authority before mutation under the existing write lock.
Rationale. Reuse existing record-note persistence and save boundary.

Key decisions

Record-wide note

The existing character/place note records who or what the entity is. It is distinct from extraction source text and a chapter-link annotation.

Exact Mac Settings seam contract

The initial full Core failure identified an inherited test-list omission. Only the exact MacSettingsWindow path named by the approved Settings design was added; all assertions remain.

Baseline and correction validation remain separate

Baseline af19/head 4ca: Core 3530, fast 152, native 1850, full phone 252 unique passes plus 2 physical-only guards, full iPad 33 passes. Full phone recorded 14 runtime frame warnings. Cursor correction 0d75: focused 9/7 passes, zero selected runtime warnings, Mac compile/signatures and physical Development install/launch. The three compiler diagnostics also occur verbatim in the earlier native log.

Four pre-push roles

Reuse, quality, efficiency and all feature-spec documents reviewed. No blocking findings. Beginner/intermediate/expert explanation and completeness check added to the existing implementation record.

Independent pr-pilot reviews

Round 1: dfea0773, note 6397945087. Fresh post-rebase: c3c664fc, note 6398087644. Both completed independent gpt-6-sol reviews, no actionable findings. Fixer and final merge gate remain distinct from these verdicts.

Rebase dependency impact

Main 97e150da adds opt-in benchmark preference isolation across app root, ContentView, Mac Settings and UI launch support. Core/review implementation and feature test hashes are unchanged. Re-run source seam contracts, new native preference suites, exact accessibility prefix, cursor/discard consumers on phone/iPad, M4 simulator smoke, and signed Mac compile. The T-2115 Creator failure waiver does not apply.

Actual compiler diagnostics

Four native source diagnostics match the earlier native log, including the unchanged snapshotAtOpen capture warning. Mac compile emitted API-deprecation diagnostics in two unchanged FoundationModels clients and a metadata notice. No compile errors; warnings are retained, not hidden.

Branch retained

Automatic approval rejected the optional delete-branch flag; the authorised squash merge succeeded without it. The remote feature branch remains.

Review findings

SeverityAreaFindingResolution
majorKeyboard-visible touch editingNative keyboard toolbar overlapped the note, so selection replacement appended instead.Measured iOS Form safe-area inset; native word selection and caret insertion now pass on phone and iPad.
minorPre-push documentationTwo historical authorisation/install statements could read as current status.Labelled historical and pointed to the later verified installation and explicit current authorisation.
nitpickReuse roleA save-strategy helper overlaps another test helper; scalar comparison could use ExactScalarString.Deferred cosmetic refactoring: no correctness issue and existing tests remain unchanged.

Tests

Source: local run at 2026-10-25T13:32:43.614473+00:00 · snapshot c3c664fc50906f0598bf857047eda1bc2eeaa8a7

Baseline: none

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

Coverage scope: as the project configures it

Totals: 30 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 97e150da36d2b837717e39168007323b0246e83e.

addedmodifieddeletedrenamedunchangedcollapsed package group or +N more⚑N test files with an edge to the node

Per-file diffs

17 files: 9 code · 8 docs. Click to expand.

Code (9)

Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swift Modified
diff --git a/Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swift b/Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swiftindex c50727fa..8eba265c 100644--- a/Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swift+++ b/Asterism/Asterism/CharacterExtraction/CharacterReviewModel.swift@@ -74,6 +74,11 @@ struct CharacterReviewRow: Identifiable, Equatable, Sendable {     let sourceEvidence: [ProposalSourceEvidence]     var aliases: [CharacterReviewAlias]     var proposedFacts: [CharacterReviewFact]+    /// A note already on the previewed target, shown without becoming a write.+    let targetNote: String+    /// Set only by inline editing. Nil preserves the target note.+    var stagedNote: String?+    var noteExpectedNote: String     /// The target record's facts as they stand, so the reader can see what the     /// bundle adds to (Req 2.1). Empty for a candidate.     let existingFacts: [WorkRecordFactRow]@@ -93,6 +98,10 @@ struct CharacterReviewRow: Identifiable, Equatable, Sendable {         Set(proposedFacts.filter { !$0.isTicked }.map(\.fact.identity))     } +    var hasNoteConflict: Bool {+        stagedNote != nil && ExactScalarString(noteExpectedNote) != ExactScalarString(targetNote)+    }+     /// Req 2.2: a reclassified row whose facts all deduped away under the     /// destination has nothing left to keep. It stays displayed, with the kind     /// control and with skip as the decision it can still take (Q31).@@ -110,7 +119,7 @@ struct CharacterReviewRow: Identifiable, Equatable, Sendable {     var canAccept: Bool {         guard projected.target != .unresolved else { return false }         return kind == originalKind || !proposedFacts.isEmpty || proposal.facts.isEmpty-            || aliases.contains { !$0.isStruck }+            || aliases.contains { !$0.isStruck } || stagedNote != nil     } } @@ -138,6 +147,14 @@ final class CharacterReviewModel: Identifiable {     /// presentations, the notes' capture order, and the suppressions the     /// coordinator's last candidate read left standing.     private var inputs: ReviewInputs+    /// Local note drafts are per displayed destination so a kind switch can+    /// return to the same draft without carrying it onto a different record.+    private var noteDrafts: [String: NoteDraft] = [:]++    private struct NoteDraft {+        var staged: String?+        var expectedNote: String+    }     private let library: any LibraryProviding     /// Told which row was decided and which kinds the commit wrote a name-key     /// suppression under, so the coordinator can drop it — and, for Q56's@@ -221,6 +238,33 @@ final class CharacterReviewModel: Identifiable {         rows[rowIndex].aliases[aliasIndex].isStruck = isStruck     } +    func setNoteDraft(_ text: String, in rowID: String) {+        guard let index = rows.firstIndex(where: { $0.id == rowID }) else { return }+        let key = noteDraftKey(rows[index])+        var draft = noteDrafts[key] ?? NoteDraft(+            staged: rows[index].stagedNote, expectedNote: rows[index].noteExpectedNote)+        if draft.staged == nil {+            draft.expectedNote = rows[index].targetNote+            rows[index].noteExpectedNote = rows[index].targetNote+        }+        draft.staged = text+        noteDrafts[key] = draft+        rows[index].stagedNote = text+    }++    func resolveNoteConflict(in rowID: String, useDraft: Bool) {+        guard let index = rows.firstIndex(where: { $0.id == rowID }),+              rows[index].hasNoteConflict else { return }+        let key = noteDraftKey(rows[index])+        var draft = noteDrafts[key] ?? NoteDraft(+            staged: rows[index].stagedNote, expectedNote: rows[index].noteExpectedNote)+        if !useDraft { draft.staged = nil }+        draft.expectedNote = rows[index].targetNote+        noteDrafts[key] = draft+        rows[index].stagedNote = draft.staged+        rows[index].noteExpectedNote = draft.expectedNote+    }+     /// Req 2.2: the reader re-files a candidate under the other kind, and the     /// row is redrawn **at once** against that kind (Q24) — as a bundle where     /// the name resolves onto a record the work already has, as a candidate@@ -240,6 +284,9 @@ final class CharacterReviewModel: Identifiable {         guard row.canReclassify, row.kind != kind else { return }          var rebuilt = Self.row(from: row.proposal, displayedAs: kind, inputs: inputs)+        let noteDraft = noteDrafts[noteDraftKey(rebuilt)]+        rebuilt.stagedNote = noteDraft?.staged+        rebuilt.noteExpectedNote = noteDraft?.expectedNote ?? rebuilt.targetNote         let ticks = Dictionary(             row.proposedFacts.map { ($0.id, $0.isTicked) }, uniquingKeysWith: { first, _ in first })         for index in rebuilt.proposedFacts.indices {@@ -262,6 +309,11 @@ final class CharacterReviewModel: Identifiable {     func dismiss() {         disclosure = nil         routesToCheckLibrary = false+        for index in rows.indices {+            rows[index].stagedNote = nil+            rows[index].noteExpectedNote = rows[index].targetNote+        }+        noteDrafts.removeAll()     }      // MARK: - Decisions (Req 2.2)@@ -272,6 +324,7 @@ final class CharacterReviewModel: Identifiable {      private func decide(_ rowID: String, action: DecisionAction) async {         guard !isSubmitting, let row = rows.first(where: { $0.id == rowID }) else { return }+        guard action == .skip || !row.hasNoteConflict else { return }         isSubmitting = true         defer { isSubmitting = false }         disclosure = nil@@ -289,6 +342,9 @@ final class CharacterReviewModel: Identifiable {             workID: workID, action: action,             struckAliases: row.struckAliases, untickedFacts: row.untickedFacts)         request.reviewedKey = .init(kind: row.proposal.kind, nameKey: row.proposal.nameKey)+        if action == .accept, let note = row.stagedNote {+            request.noteEdit = DecisionNoteEdit(note: note, expectedNote: row.noteExpectedNote)+        }         request.reviewAcknowledgements = row.proposal.reviewAcknowledgements          let remaining = rows.filter { other in@@ -335,6 +391,7 @@ final class CharacterReviewModel: Identifiable {         switch outcome {         case .committed:             rows.removeAll { $0.id == rowID }+            noteDrafts.removeValue(forKey: noteDraftKey(row))             // Q56/Q77: the gated field, so only a candidate skip can sweep the             // other kind's row of this name key away with it.             onDecision(row.key, request.nameKeySuppressedKinds)@@ -356,6 +413,9 @@ final class CharacterReviewModel: Identifiable {             // drops the stale row; re-reading unreconciled held rows re-presented             // the same row and earned the same refusal on the next Keep.             await refreshRows()+        case .staleRecordNote:+            disclosure = "That record note changed while this was waiting. Review the latest note before keeping this suggestion."+            await refreshRows()         case .reRouted(let target):             disclosure = RecordKindPresentation.reRouteDisclosure(row.kind)             // Q66: the refusal carries where the row actually resolves, and@@ -428,6 +488,9 @@ final class CharacterReviewModel: Identifiable {         let inputs = self.inputs         rows = held.map { proposal in             var row = Self.row(from: proposal, inputs: inputs)+            let noteDraft = noteDrafts[noteDraftKey(row)]+            row.stagedNote = noteDraft?.staged+            row.noteExpectedNote = noteDraft?.expectedNote ?? row.targetNote             for index in row.proposedFacts.indices {                 // The reader's ticks survive the refresh: they decided those,                 // and the refusal was about the store, not about them.@@ -674,6 +737,9 @@ final class CharacterReviewModel: Identifiable {                     if left.quote != right.quote { return left.quote < right.quote }                     return left.statement < right.statement                 },+            targetNote: target?.note ?? "",+            stagedNote: nil,+            noteExpectedNote: target?.note ?? "",             existingFacts: target?.facts ?? [],             proposal: proposal,             projected: projected)@@ -690,4 +756,8 @@ final class CharacterReviewModel: Identifiable {         guard inputs.match(nameKey, of: other) != nil else { return nil }         return RecordKindPresentation.existingNameHint(other)     }++    private func noteDraftKey(_ row: CharacterReviewRow) -> String {+        "\(row.id)|\(row.kind.rawValue)|\(row.targetID?.uuidString ?? "new")"+    } }
Asterism/Asterism/Localizable.xcstrings Modified
diff --git a/Asterism/Asterism/Localizable.xcstrings b/Asterism/Asterism/Localizable.xcstringsindex c3f01e0f..fdcd7bb3 100644--- a/Asterism/Asterism/Localizable.xcstrings+++ b/Asterism/Asterism/Localizable.xcstrings@@ -796,6 +796,9 @@     "Crop frame" : {       "comment" : "A label for the crop frame.",       "isCommentAutoGenerated" : true+    },+    "Current note" : {+     },     "Current rule" : {       "comment" : "A label for the current rule's URL.",@@ -2436,6 +2439,9 @@     "Use Suggested URL" : {       "comment" : "A button that confirms a work's URL.",       "isCommentAutoGenerated" : true+    },+    "Use draft note" : {+     },     "Use existing chapter" : {       "comment" : "A label for a picker that lets the user choose which chapter to use when correcting an entry.",@@ -2444,6 +2450,9 @@     "Use existing entry" : {       "comment" : "A picker that lets the user choose an existing entry to use.",       "isCommentAutoGenerated" : true+    },+    "Use saved note" : {+     },     "Use suggested URL for %@" : {       "comment" : "A button that lets the user confirm a suggested URL for a Work. The argument is the title of the Work.",
Asterism/Asterism/Views/CharacterReviewView.swift Modified
diff --git a/Asterism/Asterism/Views/CharacterReviewView.swift b/Asterism/Asterism/Views/CharacterReviewView.swiftindex 58eab4f1..c972ea78 100644--- a/Asterism/Asterism/Views/CharacterReviewView.swift+++ b/Asterism/Asterism/Views/CharacterReviewView.swift@@ -13,6 +13,7 @@ import SwiftUI /// own row in place rather than moving it. struct CharacterReviewView: View {     @Bindable var model: CharacterReviewModel+    @FocusState private var focusedNoteRowID: String?     let onDone: () -> Void     /// Where a torn refusal sends the reader (Req 2.8).     let onCheckLibrary: () -> Void@@ -33,6 +34,7 @@ struct CharacterReviewView: View {                 // (Req 2.6). That is a close, and it renders as the platform's X.                 ToolbarItem(placement: .cancellationAction) {                     Button(role: .close) {+                        focusedNoteRowID = nil                         model.dismiss()                         onDone()                     }@@ -42,6 +44,12 @@ struct CharacterReviewView: View {                     .accessibilityIdentifier("character-review-done")                     .accessibilityLabel("Done")                 }+                if RuntimePlatform.isMac {+                    ToolbarItemGroup(placement: .keyboard) {+                        Spacer()+                        keyboardDoneButton()+                    }+                }             }         }     }@@ -78,7 +86,33 @@ struct CharacterReviewView: View {                 }             }         }+        .scrollDismissesKeyboard(.immediately)         .accessibilityIdentifier("character-review-list")+        // Reserve the inset's measured space so the focused text stays clear+        // of the Done bar's touch region above the software keyboard.+        .safeAreaInset(edge: .bottom, spacing: 0) {+            if !RuntimePlatform.isMac, focusedNoteRowID != nil {+                HStack {+                    Spacer()+                    keyboardDoneButton(minimumHitTarget: AsterismLayout.minHitTarget)+                        .buttonStyle(.bordered)+                }+                .padding(.horizontal, 12)+                .padding(.vertical, 4)+                .frame(maxWidth: .infinity)+                .background(.regularMaterial)+            }+        }+    }++    private func keyboardDoneButton(minimumHitTarget: CGFloat = 0) -> some View {+        Button {+            focusedNoteRowID = nil+        } label: {+            Text("Done")+                .frame(minWidth: minimumHitTarget, minHeight: minimumHitTarget)+        }+        .accessibilityIdentifier("character-review-keyboard-done")     }      /// Req 2.1: every row says which collection it would join. The name is the@@ -146,11 +180,43 @@ struct CharacterReviewView: View {             .accessibilityIdentifier("character-review-alias-\(alias.name)")         } -        if row.proposedFacts.isEmpty, row.aliases.isEmpty {-            Text(RecordKindPresentation.nameOnlyNote(row.kind))-                .font(.caption)-                .foregroundStyle(.secondary)-                .accessibilityIdentifier("character-review-name-only-\(row.id)")+        if row.hasNoteConflict {+            VStack(alignment: .leading, spacing: 4) {+                Text("Current note")+                    .font(.caption.weight(.semibold))+                    .foregroundStyle(.secondary)+                Text(row.targetNote)+                    .textSelection(.enabled)+                    .accessibilityIdentifier("character-review-current-note-\(row.id)")+            }+        }++        TextField("Note", text: Binding(+            get: { row.stagedNote ?? row.targetNote },+            set: { model.setNoteDraft($0, in: row.id) }), axis: .vertical)+            .lineLimit(2...6)+            .accessibilityLabel("Note")+            .accessibilityIdentifier("character-review-note-field-\(row.id)")+            .focused($focusedNoteRowID, equals: row.id)+            .disabled(model.isSubmitting)++        if row.hasNoteConflict {+            VStack(alignment: .leading, spacing: 8) {+                Button("Use saved note") {+                    focusedNoteRowID = nil+                    model.resolveNoteConflict(in: row.id, useDraft: false)+                }+                .buttonStyle(.constellationSecondary)+                .frame(minHeight: AsterismLayout.minHitTarget)+                .accessibilityIdentifier("character-review-note-use-saved-\(row.id)")+                Button("Use draft note") {+                    focusedNoteRowID = nil+                    model.resolveNoteConflict(in: row.id, useDraft: true)+                }+                .buttonStyle(.constellationSecondary)+                .frame(minHeight: AsterismLayout.minHitTarget)+                .accessibilityIdentifier("character-review-note-use-draft-\(row.id)")+            }         }          // Req 2.2: the reader's one-tap correction of the model's kind, on the@@ -163,7 +229,7 @@ struct CharacterReviewView: View {                 values: RecordKind.allCases,                 selection: Binding(                     get: { row.kind },-                    set: { model.reclassify(row.id, to: $0) }),+                    set: { focusedNoteRowID = nil; model.reclassify(row.id, to: $0) }),                 containerLabel: "Record kind",                 title: RecordKindPresentation.name,                 identifier: {@@ -175,6 +241,7 @@ struct CharacterReviewView: View {          HStack(spacing: 12) {             Button("Keep") {+                focusedNoteRowID = nil                 Task { await model.accept(row.id) }             }             .buttonStyle(.constellationPrimary)@@ -182,9 +249,10 @@ struct CharacterReviewView: View {             // Req 2.2: a reclassified row whose facts all deduped away has             // nothing to keep. It stays, and the skip beside it still decides             // it.-            .disabled(!row.canAccept)+            .disabled(!row.canAccept || row.hasNoteConflict)              Button("Skip") {+                focusedNoteRowID = nil                 Task { await model.skip(row.id) }             }             .buttonStyle(.constellationSecondary)
Asterism/AsterismTests/CharacterReviewModelTests.swift Modified
diff --git a/Asterism/AsterismTests/CharacterReviewModelTests.swift b/Asterism/AsterismTests/CharacterReviewModelTests.swiftindex b1878e96..a18c12ad 100644--- a/Asterism/AsterismTests/CharacterReviewModelTests.swift+++ b/Asterism/AsterismTests/CharacterReviewModelTests.swift@@ -55,10 +55,10 @@ struct CharacterReviewModelTests {     /// against and what a reclassify preview resolves onto.     private nonisolated static func record(         id: UUID, kind: RecordKind = .character, name: String = "Ada",-        nameKey: String? = nil, aliases: [String] = [], facts: [RecordFact] = []+        nameKey: String? = nil, aliases: [String] = [], facts: [RecordFact] = [], note: String = ""     ) -> WorkRecordPresentation {         WorkRecordPresentation(-            id: id, kind: kind, name: name, note: "", aliases: aliases,+            id: id, kind: kind, name: name, note: note, aliases: aliases,             nameKey: nameKey ?? RecordNameKey.normalize(name),             facts: facts.map {                 WorkRecordFactRow(@@ -68,7 +68,7 @@ struct CharacterReviewModelTests {             },             isTorn: false, rowCount: 1,             editBasis: RecordEditBasis(-                kind: kind, recordID: id, name: name, note: "", aliases: aliases, facts: facts))+                kind: kind, recordID: id, name: name, note: note, aliases: aliases, facts: facts))     }      private nonisolated static func character(@@ -105,6 +105,182 @@ struct CharacterReviewModelTests {      // MARK: - Fixtures for the refusal cases that cross the real seam +    @Test("An inline note draft is sent with Keep and guards the target note")+    func savedNoteDraftIsPartOfKeepDecision() async throws {+        let targetID = UUID()+        let target = Self.record(id: targetID, note: "Existing note")+        let proposal = Self.candidate(target: .existing(targetID))+        let (model, mock) = makeSUT(proposals: [proposal], characters: [target])+        let row = try #require(model.rows.first)++        #expect(row.targetNote == "Existing note")+        #expect(row.stagedNote == nil)+        model.setNoteDraft("Revised note", in: row.id)+        await model.accept(row.id)++        let edit = mock.committedDecisions.first?.noteEdit+        #expect(edit?.note == "Revised note")+        #expect(edit?.expectedNote == "Existing note")+    }++    @Test("Inline note editing stages locally before Keep")+    func inlineNoteDraftDoesNotCommitBeforeKeep() async throws {+        let (model, mock) = makeSUT()+        let row = try #require(model.rows.first)+        model.setNoteDraft("Staged locally", in: row.id)++        #expect(mock.committedDecisions.isEmpty)+        #expect(model.rows.first?.stagedNote == "Staged locally")+    }++    @Test("Skip ignores an explicitly saved note draft")+    func skipIgnoresSavedNoteDraft() async throws {+        let (model, mock) = makeSUT()+        let row = try #require(model.rows.first)+        model.setNoteDraft("Keep-only note", in: row.id)+        await model.skip(row.id)++        #expect(mock.committedDecisions.first?.noteEdit == nil)+    }++    @Test("Review dismissal discards local note drafts")+    func dismissalDiscardsStagedNote() throws {+        let (model, _) = makeSUT()+        let row = try #require(model.rows.first)+        model.setNoteDraft("Local only", in: row.id)++        model.dismiss()++        #expect(model.rows.first?.stagedNote == nil)+    }++    @Test("A failed Keep retains the staged note and its original basis")+    func failedKeepRetainsStagedNoteAndBasis() async throws {+        let targetID = UUID()+        let target = Self.record(id: targetID, note: "Original")+        let (model, mock) = makeSUT(+            proposals: [Self.candidate(target: .existing(targetID))], characters: [target])+        let row = try #require(model.rows.first)+        model.setNoteDraft("Draft", in: row.id)+        mock.commitDecisionResult = .failure(MockLibraryProvider.MockError.notConfigured)++        await model.accept(row.id)++        #expect(model.rows.first?.stagedNote == "Draft")+        #expect(mock.committedDecisions.first?.noteEdit?.expectedNote == "Original")+    }++    @Test("An existing place note remains untouched unless edited")+    func existingPlaceNoteIsPreservedByDefault() async throws {+        let targetID = UUID()+        let target = Self.record(id: targetID, kind: .place, name: "Brockton Bay", note: "Harbor city")+        let proposal = Self.candidate(+            name: "Brockton Bay", key: "brockton bay", kind: .place,+            target: .existing(targetID),+            displayedKind: .place, pass: .manual)+        let (model, mock) = makeSUT(proposals: [proposal], places: [target])+        let row = try #require(model.rows.first)++        #expect(row.targetNote == "Harbor city")+        #expect(row.stagedNote == nil)+        await model.accept(row.id)++        #expect(mock.committedDecisions.first?.noteEdit == nil)+    }++    @Test("A note draft stays with its original destination across reclassification")+    func reclassificationRestoresOnlyMatchingDestinationDraft() throws {+        let placeID = UUID()+        let places = [Self.record(id: placeID, kind: .place, note: "Place note")]+        let (model, _) = makeSUT(places: places)+        let row = try #require(model.rows.first)+        #expect(row.targetNote.isEmpty)+        model.setNoteDraft("Character draft", in: row.id)++        model.reclassify(row.id, to: .place)+        #expect(model.rows.first?.targetNote == "Place note")+        #expect(model.rows.first?.stagedNote == nil)+        model.reclassify(row.id, to: .character)++        #expect(model.rows.first?.targetNote.isEmpty == true)+        #expect(model.rows.first?.stagedNote == "Character draft")+    }++    @Test("A stale note basis stays blocked until the reader explicitly resolves the conflict")+    func staleNoteRequiresExplicitReviewBeforeRebase() async throws {+        let workID = UUID(), targetID = UUID()+        let proposal = Self.candidate(target: .existing(targetID))+        let original = Self.record(id: targetID, note: "Original")+        let latest = Self.record(id: targetID, note: "Changed elsewhere")+        let mock = MockLibraryProvider()+        mock.workDetailResult = .success(Self.workPresentation(+            workID: workID, characters: [latest]))+        mock.commitDecisionResult = .success(.refused(.staleRecordNote(recordID: targetID)))+        let model = CharacterReviewModel(+            workID: workID, proposals: [proposal], characters: [original], library: mock,+            extractionContext: { nil }, onDecision: { _, _ in }, onReRoute: { _, _ in },+            onReclassify: { _, _, _ in }, refresh: { [proposal] })+        let row = try #require(model.rows.first)+        model.setNoteDraft("My edit", in: row.id)++        await model.accept(row.id)+        #expect(model.rows.first?.targetNote == "Changed elsewhere")+        #expect(model.rows.first?.noteExpectedNote == "Original")+        #expect(model.rows.first?.hasNoteConflict == true)++        model.setNoteDraft("Edited again", in: row.id)+        await model.accept(row.id)+        #expect(mock.committedDecisions.count == 1)+        #expect(mock.committedDecisions.last?.noteEdit?.expectedNote == "Original")+        #expect(model.rows.first?.noteExpectedNote == "Original")++        model.resolveNoteConflict(in: row.id, useDraft: true)+        #expect(model.rows.first?.hasNoteConflict == false)+        mock.commitDecisionResult = .failure(MockLibraryProvider.MockError.notConfigured)+        await model.accept(row.id)+        #expect(mock.committedDecisions.last?.noteEdit?.expectedNote == "Changed elsewhere")+    }++    @Test("Choosing the latest saved note clears the draft and permits Keep")+    func choosingSavedNoteResolvesConflictWithoutNoteWrite() async throws {+        let workID = UUID(), targetID = UUID()+        let proposal = Self.candidate(target: .existing(targetID))+        let original = Self.record(id: targetID, note: "Original")+        let latest = Self.record(id: targetID, note: "Changed elsewhere")+        let mock = MockLibraryProvider()+        mock.workDetailResult = .success(Self.workPresentation(workID: workID, characters: [latest]))+        mock.commitDecisionResult = .success(.refused(.staleRecordNote(recordID: targetID)))+        let model = CharacterReviewModel(+            workID: workID, proposals: [proposal], characters: [original], library: mock,+            extractionContext: { nil }, onDecision: { _, _ in }, onReRoute: { _, _ in },+            onReclassify: { _, _, _ in }, refresh: { [proposal] })+        let row = try #require(model.rows.first)+        model.setNoteDraft("My edit", in: row.id)+        await model.accept(row.id)+        #expect(model.rows.first?.hasNoteConflict == true)++        model.resolveNoteConflict(in: row.id, useDraft: false)+        #expect(model.rows.first?.stagedNote == nil)+        #expect(model.rows.first?.hasNoteConflict == false)+        mock.commitDecisionResult = .failure(MockLibraryProvider.MockError.notConfigured)+        await model.accept(row.id)++        #expect(mock.committedDecisions.last?.noteEdit == nil)++        let latestAgain = Self.record(id: targetID, note: "Latest after saved choice")+        mock.workDetailResult = .success(Self.workPresentation(+            workID: workID, characters: [latestAgain]))+        mock.commitDecisionResult = .success(.refused(.staleSource(.genericNotes)))+        await model.accept(row.id)+        #expect(model.rows.first?.targetNote == "Latest after saved choice")++        model.setNoteDraft("New edit", in: row.id)+        #expect(model.rows.first?.noteExpectedNote == "Latest after saved choice")+        mock.commitDecisionResult = .failure(MockLibraryProvider.MockError.notConfigured)+        await model.accept(row.id)+        #expect(mock.committedDecisions.last?.noteEdit?.expectedNote == "Latest after saved choice")+    }+     @MainActor     final class StubEnvironment: SuggestionEnvironment {         var isActive = true
Asterism/AsterismUITests/CharacterExtractionUITests.swift Modified
diff --git a/Asterism/AsterismUITests/CharacterExtractionUITests.swift b/Asterism/AsterismUITests/CharacterExtractionUITests.swiftindex b7063418..6d5f5565 100644--- a/Asterism/AsterismUITests/CharacterExtractionUITests.swift+++ b/Asterism/AsterismUITests/CharacterExtractionUITests.swift@@ -276,19 +276,61 @@ final class CharacterExtractionUITests: XCTestCase {         return !frame.isEmpty && !viewport.isNull && !viewport.isEmpty && viewport.contains(frame)     } +    /// Makes a small drag when a materialized row control is just outside the+    /// unobscured viewport. A full `swipeUp()` can move it past the viewport on+    /// iPad, so use the visible control's distance from the edge instead.+    private func nudgeReviewControlIntoViewport(_ control: XCUIElement) -> Bool {+        guard control.exists else { return false }+        let frame = control.frame+        let viewport = reviewControlViewport+        let listFrame = reviewList.frame+        guard !frame.isNull, !frame.isEmpty,+              frame.minX.isFinite, frame.minY.isFinite, frame.maxX.isFinite, frame.maxY.isFinite,+              !viewport.isNull, !viewport.isEmpty,+              !listFrame.isNull, !listFrame.isEmpty,+              listFrame.width > 0, listFrame.height > 0 else { return false }++        let correction: CGFloat+        if frame.maxY > viewport.maxY {+            correction = -(frame.maxY - viewport.maxY + 12)+        } else if frame.minY < viewport.minY {+            correction = viewport.minY - frame.minY + 12+        } else {+            return false+        }++        let limit = viewport.height * 0.25+        let distance = max(-limit, min(limit, correction))+        guard distance.isFinite, abs(distance) >= 1 else { return false }+        let start = CGVector(+            dx: min(1, max(0, (viewport.midX - listFrame.minX) / listFrame.width)),+            dy: min(1, max(0, (viewport.midY - listFrame.minY) / listFrame.height)))+        let end = CGVector(+            dx: start.dx,+            dy: min(1, max(0, start.dy + distance / listFrame.height)))+        reviewList.coordinate(withNormalizedOffset: start)+            .press(forDuration: 0.1, thenDragTo: reviewList.coordinate(withNormalizedOffset: end))+        return true+    }+     /// Taps a review row's control, scrolling its owning list in either direction.     private func tapReviewControl(_ identifier: String, _ message: String) {         let control = app.anyElement(identifier)         // Stop at the banner: pulling down again at the top dismisses the sheet.         for _ in 0..<6 where !reviewControlIsFullyVisible(control)             && !reviewControlIsFullyVisible(reviewBanner) {-            reviewList.swipeDown()+            if !nudgeReviewControlIntoViewport(control) {+                reviewList.swipeDown()+            }         }         for _ in 0..<8 {             if reviewControlIsFullyVisible(control) {                 control.tap()                 return             }+            if nudgeReviewControlIntoViewport(control) {+                continue+            }             if control.exists && control.frame.minY < reviewControlViewport.minY {                 reviewList.swipeDown()             } else {@@ -490,6 +532,229 @@ final class CharacterExtractionUITests: XCTestCase {             "Keeping a place writes no generated fact")     } +    // MARK: - Review notes: edit on the proposal, commit only with Keep++    private func typeReviewNote(_ note: String, for rowID: String) {+        tapReviewControl("character-review-note-field-\(rowID)",+            "The proposal carries its own note field")+        let field = waitFor(+            app.anyElement("character-review-note-field-\(rowID)"),+            "The proposal carries its own note field")+        field.typeText(note)+        XCTAssertTrue(+            ((field.value as? String) ?? "").contains(note),+            "Typing updates the proposal's note draft")+        XCTAssertFalse(app.anyElement("character-review-note-editor-\(rowID)").exists,+            "The proposal note is edited in its row")+        XCTAssertFalse(app.staticTexts["Saved with Keep."].exists,+            "The proposal has no separate save instruction")+        XCTAssertTrue(app.keyboards.firstMatch.waitForExistence(timeout: 5),+            "Typing opens the native keyboard")+        let done = waitFor(+            app.buttons["character-review-keyboard-done"],+            "The native keyboard offers Done")+        done.tap()+        waitUntilGone(app.keyboards.firstMatch, "Done dismisses the native keyboard", timeout: 10)+        XCTAssertEqual((field.value as? String), note,+            "Keyboard Done keeps the note as a proposal draft until a decision")+    }++    private func editReviewNoteByTouch(_ rowID: String) -> XCUIElement {+        tapReviewControl("character-review-note-field-\(rowID)",+            "The proposal carries its own note field")+        let field = waitFor(+            app.anyElement("character-review-note-field-\(rowID)"),+            "The proposal's note field is available")+        field.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))+            .withOffset(CGVector(dx: 12, dy: 10)).tap()+        XCTAssertTrue(app.keyboards.firstMatch.waitForExistence(timeout: 5),+            "Tapping the note text line focuses the field and opens the software keyboard")+        field.typeText("one two three")+        XCTAssertEqual(field.value as? String, "one two three")++        // The field fills the row width. Use an absolute inset from the first+        // line to select its first word, independent of the blank width to its+        // right and the unused line below it.+        field.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))+            .withOffset(CGVector(dx: 12, dy: 10)).doubleTap()+        XCTAssertTrue(app.keyboards.firstMatch.exists,+            "Word selection leaves the software keyboard visible")+        let selection = XCTAttachment(screenshot: app.screenshot())+        selection.name = "Review note first-word selection with keyboard visible"+        selection.lifetime = .keepAlways+        add(selection)+        field.typeText("ONE")+        XCTAssertEqual(field.value as? String, "ONE two three",+            "The finger-selected first word is replaced in the proposal draft")++        field.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: 0))+            .withOffset(CGVector(dx: 1, dy: 10)).tap()+        XCTAssertTrue(app.keyboards.firstMatch.exists,+            "Placing the caret by touch keeps the software keyboard visible")+        field.typeText("prefix ")+        XCTAssertEqual(field.value as? String, "prefix ONE two three",+            "The prefix is inserted at the finger-placed caret")+        return field+    }++    func testTypingCharacterReviewNoteAndClosingReviewLeavesNoRecord() {+        openWorkDetail()+        openReview()+        let rowID = Row.ada+        typeReviewNote("A note discarded by closing review", for: rowID)++        closeReview()+        XCTAssertFalse(app.anyElement("work-detail-character").exists,+            "Dismissing review does not create the proposed character")+        XCTAssertFalse(app.staticTexts["A note discarded by closing review"].exists)+    }++    func testTypedReviewNoteIsDiscardedWhenReviewIsDismissed() {+        openWorkDetail()+        openReview()+        let rowID = Row.ada+        typeReviewNote("A typed note discarded by dismissal", for: rowID)++        closeReview()+        XCTAssertFalse(app.anyElement("work-detail-character").exists,+            "Typing a proposal note does not create its record")+        openReview()+        XCTAssertTrue(reviewListShows("character-review-keep-\(rowID)"),+            "The undecided proposal remains available")+        let reopenedField = waitFor(+            app.anyElement("character-review-note-field-\(rowID)"),+            "The reopened proposal shows its note field")+        let reopenedValue = reopenedField.value as? String+        XCTAssertNotNil(reopenedValue, "The reopened note field exposes its value")+        XCTAssertTrue(+            reopenedValue == "" || reopenedValue == reopenedField.placeholderValue,+            "The note field is empty after review closes — was \(String(describing: reopenedValue))")+        XCTAssertFalse(+            reopenedValue?.contains("A typed note discarded by dismissal") ?? true,+            "The proposal's previous draft is gone")+        closeReview()+        XCTAssertFalse(app.staticTexts["A typed note discarded by dismissal"].exists)+    }++    func testCharacterReviewNoteIsSavedOnlyWhenTheProposalIsKept() {+        openWorkDetail()+        openReview()+        let rowID = Row.ada+        let note = "A field note kept with Ada"+        typeReviewNote(note, for: rowID)++        tapReviewControl("character-review-keep-\(rowID)", "Ada can be kept with her note")+        waitUntilGone(app.anyElement("character-review-keep-\(rowID)"),+            "Keeping Ada settles the proposal", timeout: 15)+        closeReview()++        waitFor(app.buttons["work-detail-edit-button"], "The page offers its editor").tap()+        openEditorLine(editLine(named: "Ada"), expecting: "character-editor", in: app,+            "The accepted character opens in its editor")+        let savedNote = waitFor(app.textFields["work-detail-character-note-field"],+            "The accepted character's note is visible in its record editor")+        XCTAssertEqual(savedNote.value as? String, note)+    }++    func testPlaceReviewNoteIsDiscardedWhenReviewIsDismissed() {+        openWorkDetail()+        openReview()+        let rowID = Row.kestrelHead+        let note = "prefix ONE two three"+        _ = editReviewNoteByTouch(rowID)+        closeReview()++        XCTAssertFalse(app.anyElement("work-detail-place").exists,+            "Typing a note and closing review does not create the place")+        openReview()+        XCTAssertTrue(reviewListShows("character-review-keep-\(rowID)"),+            "The undecided place proposal remains available")+        let reopenedField = waitFor(+            app.anyElement("character-review-note-field-\(rowID)"),+            "The reopened place proposal shows its note field")+        let reopenedValue = reopenedField.value as? String+        XCTAssertNotNil(reopenedValue, "The reopened place note field exposes its value")+        XCTAssertTrue(+            reopenedValue == "" || reopenedValue == reopenedField.placeholderValue,+            "The typed place note was discarded on close — was \(String(describing: reopenedValue))")+        XCTAssertFalse(reopenedValue?.contains(note) ?? true,+            "The typed place note did not become a saved note")+        XCTAssertTrue(app.anyElement("character-review-keep-\(rowID)").exists,+            "Reopening review leaves the proposal undecided")+        closeReview()+    }++    func testPlaceReviewNoteIsSavedOnlyWhenTheProposalIsKept() {+        openWorkDetail()+        openReview()+        let rowID = Row.kestrelHead+        let note = "A field note kept with Kestrel Head"+        typeReviewNote(note, for: rowID)++        tapReviewControl("character-review-keep-\(rowID)", "Kestrel Head can be kept with its note")+        waitUntilGone(app.anyElement("character-review-keep-\(rowID)"),+            "Keeping the place settles the proposal", timeout: 15)+        closeReview()++        waitFor(app.buttons["work-detail-edit-button"], "The page offers its editor").tap()+        openEditorLine(editLine(named: "Kestrel Head", kind: "place"),+            expecting: "character-editor", in: app, "The accepted place opens in its editor")+        let savedNote = waitFor(app.textFields["work-detail-character-note-field"],+            "The accepted place's note is visible in its record editor")+        XCTAssertEqual(savedNote.value as? String, note)+    }++    func testSkippingAProposalWithATypedNoteCreatesNoRecord() {+        openWorkDetail()+        openReview()+        let rowID = Row.brede+        typeReviewNote("A note discarded by Skip", for: rowID)++        tapReviewControl("character-review-skip-\(rowID)", "Brede can be skipped")+        waitUntilGone(app.anyElement("character-review-skip-\(rowID)"),+            "Skipping Brede settles the proposal", timeout: 15)+        closeReview()++        XCTAssertFalse(app.anyElement("work-detail-character").exists,+            "Skipping discards the typed note and creates no character")+        XCTAssertFalse(app.staticTexts["A note discarded by Skip"].exists)+    }++    func testReviewNoteWordSelectionCanReplaceTextWhileKeyboardIsVisible() {+        openWorkDetail()+        openReview()+        let rowID = Row.ada+        let note = "prefix ONE two three"+        let field = editReviewNoteByTouch(rowID)+        let keyboardDone = waitFor(app.buttons["character-review-keyboard-done"],+            "Done dismisses the keyboard before Keep")+        let doneFrame = keyboardDone.frame+        XCTAssertTrue(doneFrame.width.isFinite && doneFrame.height.isFinite,+            "Done has finite accessibility geometry")+        guard doneFrame.width.isFinite, doneFrame.height.isFinite else { return }+        XCTAssertGreaterThanOrEqual(doneFrame.width, 44,+            "Done meets the minimum touch target width")+        XCTAssertGreaterThanOrEqual(doneFrame.height, 44,+            "Done meets the minimum touch target height")+        keyboardDone.tap()+        waitUntilGone(app.keyboards.firstMatch,+            "Done dismisses the keyboard before Keep", timeout: 10)+        XCTAssertEqual(field.value as? String, note,+            "Done leaves the touched draft unchanged")++        tapReviewControl("character-review-keep-\(rowID)", "Ada can be kept with her touched note")+        waitUntilGone(app.anyElement("character-review-keep-\(rowID)"),+            "Keeping Ada settles the proposal", timeout: 15)+        closeReview()++        waitFor(app.buttons["work-detail-edit-button"], "The page offers its editor").tap()+        openEditorLine(editLine(named: "Ada"), expecting: "character-editor", in: app,+            "The accepted character opens in its editor")+        let savedNote = waitFor(app.textFields["work-detail-character-note-field"],+            "The accepted character's note is visible in its record editor")+        XCTAssertEqual(savedNote.value as? String, note)+    }+     // MARK: - Req 2.2: reclassification, then keeping under the new kind      /// The reader's one-tap correction of the model's kind. The row keeps its
Packages/AsterismCore/Sources/AsterismCore/CharacterExtractionTypes.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismCore/CharacterExtractionTypes.swift b/Packages/AsterismCore/Sources/AsterismCore/CharacterExtractionTypes.swiftindex bdea59ee..1bb78e72 100644--- a/Packages/AsterismCore/Sources/AsterismCore/CharacterExtractionTypes.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/CharacterExtractionTypes.swift@@ -235,6 +235,21 @@ public enum DecisionAction: String, Sendable, Equatable {     case skip } +/// An optional reader-authored record note submitted with an accepted proposal.+/// `expectedNote` is the exact note captured when a fresh inline draft starts,+/// or adopted by explicit conflict resolution. An existing staged draft never+/// rebases through typing, refresh or repeated Keep attempts, so this guards+/// against overwriting a later note edit.+public struct DecisionNoteEdit: Sendable, Equatable {+    public let note: String+    public let expectedNote: String++    public init(note: String, expectedNote: String) {+        self.note = note+        self.expectedNote = expectedNote+    }+}+ /// One review-list decision, committed on its own (Q37 — immediately, and /// independently of the work page's edit mode). public struct DecisionRequest: Sendable, Equatable {@@ -265,6 +280,9 @@ public struct DecisionRequest: Sendable, Equatable {     public var proposedName: String     /// The unstruck proposed aliases, installed on acceptance (Q92/Q96).     public var proposedAliases: [String]+    /// Optional reader-authored note edit, committed only when this decision+    /// is accepted. Nil preserves the record's current note.+    public var noteEdit: DecisionNoteEdit?     /// The facts the row displayed, minus the ones the reader unticked — so     /// **not** "the accepted ones": an accept writes them, a skip suppresses     /// them, and the field is neutral because both paths read it. Keyed to the@@ -295,6 +313,7 @@ public struct DecisionRequest: Sendable, Equatable {         displayedTargetID: UUID? = nil,         proposedName: String = "",         proposedAliases: [String] = [],+        noteEdit: DecisionNoteEdit? = nil,         facts: [RecordFact] = [],         untickedFacts: [RecordFactIdentity] = [],         completedSources: [CompletedSource] = [],@@ -309,6 +328,7 @@ public struct DecisionRequest: Sendable, Equatable {         self.displayedTargetID = displayedTargetID         self.proposedName = proposedName         self.proposedAliases = proposedAliases+        self.noteEdit = noteEdit         self.facts = facts         self.untickedFacts = untickedFacts         self.completedSources = completedSources@@ -372,6 +392,8 @@ public enum DecisionRefusal: Sendable, Equatable {     /// Req 2.7: a cited revision changed while the proposal was held. The sheet     /// discloses and refreshes.     case staleSource(SourceRef)+    /// The record-wide note changed after the extraction review captured it.+    case staleRecordNote(recordID: UUID?)     /// Q66: the proposal no longer resolves onto the record the reader was     /// shown — including a row displayed as new that now matches an existing     /// record of the **same kind**. The refreshed list re-presents it correctly.
Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+RecordExtraction.swift Modified
diff --git a/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+RecordExtraction.swift b/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+RecordExtraction.swiftindex 8fe948a8..2fe117e1 100644--- a/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+RecordExtraction.swift+++ b/Packages/AsterismCore/Sources/AsterismCore/LibraryRepository+RecordExtraction.swift@@ -590,6 +590,12 @@ extension LibraryRepository {                 request, workGroup: workGroup, resolved: target, workRows: workRows) {                 return .refused(refusal)             }+            if let noteEdit = request.noteEdit {+                let currentNote = target?.presentedContent.note ?? ""+                guard currentNote.unicodeScalars.elementsEqual(noteEdit.expectedNote.unicodeScalars) else {+                    return .refused(.staleRecordNote(recordID: target?.id))+                }+            }             if let refusal = associationAcceptanceRefusal(request, before: associationBefore) { return .refused(refusal) }             committedID = applyAcceptance(                 request, target: target, workRows: workRows,@@ -767,6 +773,7 @@ extension LibraryRepository {             for row in target.rows {                 row.factsData = bytes                 row.aliases = aliases+                if let noteEdit = request.noteEdit { row.note = noteEdit.note }                 row.modifiedAt = timestamp             }         } else {@@ -778,7 +785,7 @@ extension LibraryRepository {                 name: request.proposedName,                 nameKey: retainedKey,                 aliases: request.proposedAliases,-                note: "",+                note: request.noteEdit?.note ?? "",                 facts: incoming,                 timestamp: timestamp,                 work: nil)
Packages/AsterismCore/Tests/AsterismCoreTests/CharacterExtractionRepositoryTests.swift Modified
diff --git a/Packages/AsterismCore/Tests/AsterismCoreTests/CharacterExtractionRepositoryTests.swift b/Packages/AsterismCore/Tests/AsterismCoreTests/CharacterExtractionRepositoryTests.swiftindex ad914c8a..fd6e5afe 100644--- a/Packages/AsterismCore/Tests/AsterismCoreTests/CharacterExtractionRepositoryTests.swift+++ b/Packages/AsterismCore/Tests/AsterismCoreTests/CharacterExtractionRepositoryTests.swift@@ -16,6 +16,20 @@ private let entry2 = UUID(uuidString: "0F000000-0000-4000-8000-000000000102")! private let hanna = UUID(uuidString: "0F000000-0000-4000-8000-000000000201")! private let bruce = UUID(uuidString: "0F000000-0000-4000-8000-000000000202")! +private final class ExtractionFailingSaveStrategy: RepositorySaveStrategy, @unchecked Sendable {+    private let lock = NSLock()+    private var shouldFail = false++    func armFailure() { lock.lock(); defer { lock.unlock() }; shouldFail = true }+    func disarmFailure() { lock.lock(); defer { lock.unlock() }; shouldFail = false }++    func save(_ context: ModelContext) throws {+        lock.lock(); let fail = shouldFail; lock.unlock()+        if fail { throw CocoaError(.fileWriteUnknown) }+        try context.save()+    }+}+ private func fact(     _ statement: String, _ quote: String, _ source: SourceRef, key: String = "hanna" ) -> RecordFact {@@ -317,9 +331,10 @@ struct RecordDecisionCommitTests {      private func fixture(         _ kind: RecordKind,+        saveStrategy: any RepositorySaveStrategy = ModelContextSaveStrategy(),         records: [M5SeedRecord] = [], suppressions: [M5SeedRecordSuppression] = []     ) async throws -> M5Fixture {-        let fixture = try await M5Fixture()+        let fixture = try await M5Fixture(saveStrategy: saveStrategy)         try await fixture.repository.seedM5Rows(             sites: [M5SeedSite(hostname: "c.example")],             works: [M5SeedWork(@@ -385,6 +400,116 @@ struct RecordDecisionCommitTests {         withExtendedLifetime(fixture) {}     } +    @Test("Acceptance saves an optional note for new and existing targets", arguments: RecordKind.allCases)+    func acceptanceSavesOptionalNote(kind: RecordKind) async throws {+        let newFixture = try await fixture(kind)+        var newRequest = acceptNewHanna(kind)+        newRequest.noteEdit = DecisionNoteEdit(note: "Reader note", expectedNote: "")+        let newOutcome = try await newFixture.repository.commitDecision(newRequest)+        guard case .committed(let newID?) = newOutcome else {+            Issue.record("expected a newly committed record, got \(newOutcome)")+            return+        }+        #expect(try await newFixture.repository.m5RecordRows(kind, id: newID).first?.note == "Reader note")++        let existingFixture = try await fixture(kind, records: [+            M5SeedRecord(id: hanna, name: "Hanna", nameKey: "hanna", note: "Original", workID: workA),+        ])+        var existingRequest = acceptNewHanna(kind)+        existingRequest.displayedTargetID = hanna+        existingRequest.noteEdit = DecisionNoteEdit(note: "Updated", expectedNote: "Original")+        #expect(try await existingFixture.repository.commitDecision(existingRequest) == .committed(recordID: hanna))+        #expect(try await existingFixture.repository.m5RecordRows(kind, id: hanna).first?.note == "Updated")+        withExtendedLifetime(newFixture) {}+        withExtendedLifetime(existingFixture) {}+    }++    @Test("Omitting the optional note edit preserves the existing note", arguments: RecordKind.allCases)+    func omittedNoteEditPreservesNote(kind: RecordKind) async throws {+        let fixture = try await fixture(kind, records: [+            M5SeedRecord(id: hanna, name: "Hanna", nameKey: "hanna", note: "Keep this", workID: workA),+        ])+        var request = acceptNewHanna(kind)+        request.displayedTargetID = hanna+        #expect(try await fixture.repository.commitDecision(request) == .committed(recordID: hanna))+        #expect(try await fixture.repository.m5RecordRows(kind, id: hanna).first?.note == "Keep this")+        withExtendedLifetime(fixture) {}+    }++    @Test("A record note changed during review refuses acceptance without overwriting it", arguments: RecordKind.allCases)+    func staleRecordNoteRefusesAcceptance(kind: RecordKind) async throws {+        let fixture = try await fixture(kind, records: [+            M5SeedRecord(id: hanna, name: "Hanna", nameKey: "hanna", note: "Before", workID: workA),+        ])+        let rows = try await fixture.repository.m5RecordRows(kind, id: hanna)+        #expect(rows.first?.note == "Before")+        var request = acceptNewHanna(kind)+        request.displayedTargetID = hanna+        // A captured basis that no longer matches current content must refuse.+        request.noteEdit = DecisionNoteEdit(note: "Review draft", expectedNote: "Concurrent")+        #expect(try await fixture.repository.commitDecision(request) == .refused(.staleRecordNote(recordID: hanna)))+        #expect(try await fixture.repository.m5RecordRows(kind, id: hanna).first?.note == "Before")+        withExtendedLifetime(fixture) {}+    }++    @Test("Record note basis compares exact Unicode scalars", arguments: RecordKind.allCases)+    func recordNoteBasisUsesExactScalars(kind: RecordKind) async throws {+        let fixture = try await fixture(kind, records: [+            M5SeedRecord(id: hanna, name: "Hanna", nameKey: "hanna", note: "Café", workID: workA),+        ])+        var request = acceptNewHanna(kind)+        request.displayedTargetID = hanna+        request.noteEdit = DecisionNoteEdit(note: "Replacement", expectedNote: "Cafe\u{301}")+        #expect(try await fixture.repository.commitDecision(request) == .refused(.staleRecordNote(recordID: hanna)))+        #expect(try await fixture.repository.m5RecordRows(kind, id: hanna).first?.note == "Café")+        withExtendedLifetime(fixture) {}+    }++    @Test("Skip ignores an optional note edit", arguments: RecordKind.allCases)+    func skipIgnoresNoteEdit(kind: RecordKind) async throws {+        let fixture = try await fixture(kind)+        var request = acceptNewHanna(kind)+        request.action = .skip+        request.noteEdit = DecisionNoteEdit(note: "Must not be saved", expectedNote: "")+        #expect(try await fixture.repository.commitDecision(request) == .committed(recordID: nil))+        #expect(try await fixture.repository.m5RecordRows(kind, id: hanna).isEmpty)+        withExtendedLifetime(fixture) {}+    }++    @Test("Replaying a candidate acceptance cannot duplicate the record or erase its note", arguments: RecordKind.allCases)+    func replayAcceptancePreservesNote(kind: RecordKind) async throws {+        let fixture = try await fixture(kind)+        var request = acceptNewHanna(kind)+        request.noteEdit = DecisionNoteEdit(note: "Reader note", expectedNote: "")+        let first = try await fixture.repository.commitDecision(request)+        guard case .committed(let id?) = first else {+            Issue.record("expected a committed record, got \(first)")+            return+        }+        #expect(try await fixture.repository.commitDecision(request) == .refused(.reRouted(to: id)))+        let rows = try await fixture.repository.m5RecordRows(kind, id: id)+        #expect(rows.count == 1)+        #expect(rows.first?.note == "Reader note")+        withExtendedLifetime(fixture) {}+    }++    @Test("A failed acceptance save leaves no record or note", arguments: RecordKind.allCases)+    func failedAcceptanceSaveIsAtomic(kind: RecordKind) async throws {+        let save = ExtractionFailingSaveStrategy()+        let fixture = try await fixture(kind, saveStrategy: save)+        save.armFailure()+        var request = acceptNewHanna(kind)+        request.noteEdit = DecisionNoteEdit(note: "Reader note", expectedNote: "")+        await #expect(throws: LibraryRepositoryError.self) {+            _ = try await fixture.repository.commitDecision(request)+        }+        save.disarmFailure()+        #expect(try await fixture.repository.m5RecordRows(kind, id: hanna).isEmpty)+        let candidates = try await fixture.repository.extractionCandidates(limit: 100)+        #expect(candidates.first?.records(of: kind).isEmpty == true)+        withExtendedLifetime(fixture) {}+    }+     @Test(         "Accepting a bundle appends to the existing record and installs unstruck aliases",         arguments: RecordKind.allCases)
Packages/AsterismCore/Tests/AsterismCoreTests/PlatformSeamTests.swift Modified
diff --git a/Packages/AsterismCore/Tests/AsterismCoreTests/PlatformSeamTests.swift b/Packages/AsterismCore/Tests/AsterismCoreTests/PlatformSeamTests.swiftindex 2e39fcc6..d7329cda 100644--- a/Packages/AsterismCore/Tests/AsterismCoreTests/PlatformSeamTests.swift+++ b/Packages/AsterismCore/Tests/AsterismCoreTests/PlatformSeamTests.swift@@ -31,10 +31,14 @@ struct PlatformSeamTests {     /// `PlatformModifiers` and `AppLifecycle` are the two seams; `AsterismApp`     /// owns the scenes and the appearance proxy, `ContentView` the size-class     /// switch, the Settings presentation and the App Group `.unavailable`-    /// branch (Q19, Q24).+    /// branch (Q19, Q24). `settings-layout/design.md` §Ownership and integration+    /// explicitly names `Support/MacSettingsWindow.swift` as the macOS-only+    /// native Settings owner and requires its file-level platform guard; the+    /// T-2487 full Core gate exposed this already-approved seam missing here.     private static let conditionalSeams: Set<String> = [         "AsterismApp.swift",         "ContentView.swift",+        "Support/MacSettingsWindow.swift",         "Support/PlatformModifiers.swift",         "Support/AppLifecycle.swift",     ]

Docs (8)

CHANGELOG.md Modified
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2049bcaf..e48410c5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).  - **Chapter-history navigation (T-2468):** keep the Mac Today inspector on its dashboard stack, guard retired dismissals, and preserve a scrolled wide Today across inspector and Work returns. Expose real chapter headings beside native Mac previews and reset seeded navigation preferences consistently. +- **Review-note cursor (T-2487):** keep caret placement and text selection usable while the keyboard is open, with a dismissal bar that reserves space above it.+ ### Changed  - **Settings layout (T-2483):** group Sites, Work types and Creator roles under Library on iOS/iPadOS, and expose each destination directly in a retained native Mac Settings window. Preserve page drafts, navigation, Back and Save/Cancel across tab changes and window reopening; routes back reopen the main window after restoring its state. Move Detached link notes and preserved captures into Maintenance, keeping their existing actions and confirmations. Avoid backup staging cleanup on Mac tabs that have no backup controls.@@ -111,6 +113,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).  ### Added +- **Detection review notes (T-2487):** add or edit a character/place note inline while reviewing a suggestion; Keep commits it, while Skip or closing review discards the local draft. Preserve existing notes by default, require an explicit choice to resolve a stale note conflict, and provide keyboard Done/scroll dismissal that reveals Keep and Skip while retaining the draft. Remove the repetitive name-only placeholder and “Saved with Keep” explanation; Keep remains the only save action.+ - **Chosen-day notes (T-2428):** add an optional Day to the existing notes   Shortcuts action. Preserve default-today/latest-share behavior, future-share   folding and complete typed note values; name historical dates in the result
specs/bugfixes/review-note-cursor/report.md Added
diff --git a/specs/bugfixes/review-note-cursor/report.md b/specs/bugfixes/review-note-cursor/report.mdnew file mode 100644index 00000000..0c22bf86--- /dev/null+++ b/specs/bugfixes/review-note-cursor/report.md@@ -0,0 +1,54 @@+# Bugfix Report: Review note cursor under keyboard toolbar++**Date:** 2026-10-25+**Status:** Fixed, validated and installed in Development++## Description of the Issue++The owner could type a note on a detected character/place card but could not move the insertion point with a finger until dismissing the keyboard. Keep remained the only persistence action.++Reproduce on the isolated iPhone simulator: open the note-first review fixture, focus Ada's note, type `one two three`, double-tap the first word with the software keyboard still open and type `ONE`. Expected `ONE two three`; actual `one two threeONE`. The keyboard remained visible and key input continued, but touch selection did not reach the intended text.++## Investigation Summary++Inspected the review Form, stable row identity/value binding, focus actions and its WorkDetail sheet presenter. No custom tap/drag interceptor was present. Immediate scroll dismissal was considered but not assumed causal. The first probe failed before typing because its initial center tap did not establish focus; that attempt is not product-red evidence. The corrected probe explicitly taps the first text line and confirms the keyboard before editing.++The corrected native-selection probe failed on unchanged implementation af19d7c3. A second diagnostic run retained accessibility geometry and the screenshot: note field y=505.33–546.00; native keyboard toolbar y=498–546; Done y=504–540. The visible note was within the toolbar's touch region. The same gesture passed after the measured-inset correction while scroll-dismiss behavior stayed unchanged.++## Discovered Root Cause++The iOS keyboard accessory toolbar overlapped the focused note. Its translucent appearance left text visible while native touch editing was obstructed. Keyboard input still reached the focused field, so typed replacement appended at the old caret. Prior checks typed text then dismissed the keyboard; they did not select or reposition within existing text while it stayed open.++## Resolution for the Issue++Use the existing RuntimePlatform constant to retain Mac's native keyboard toolbar and put the iOS Done button in a focus-visible bottom safe-area inset on the Form. SwiftUI measures that bar and reserves space for it; no fixed toolbar-height spacer, touch pass-through, UIKit wrapper or new platform seam is added. Done only clears focus. The Form's accessibility identifier precedes the inset so it cannot override the button's own identifier. The minimum touch frame is inside the button label.++Changing scroll-dismiss policy was unnecessary: it remains `.immediately`. A guessed extra padding amount would not follow native control size. A forced scroll anchor would address a particular field position rather than reserve the obstruction's actual layout space.++## Regression Test++`CharacterExtractionUITests/testReviewNoteWordSelectionCanReplaceTextWhileKeyboardIsVisible` now checks finger word selection/replacement and a single-tap caret insertion with the keyboard visible, exact draft text, native Done, its touch target, Keep and stored-note readback. The new place dismissal journey performs the same native edits, closes/reopens review, and checks an empty draft with its proposal still undecided. All five original note journeys remain unchanged.++## Affected Files++- `Asterism/Asterism/Views/CharacterReviewView.swift`: measured iOS dismissal bar; Mac presentation retained.+- `Asterism/AsterismUITests/CharacterExtractionUITests.swift`: native touch-edit regressions.+- Note-first requirements/design/decision/verification/task documentation: current behavior and source-specific receipts.++## Verification++- Old product red: corrected one-case probe failed with append instead of replacement; diagnostic repeat confirmed overlap.+- Initial measured-inset green: same selection assertion passed, one test, zero failures/skips/warnings. Subsequent refinement preserves Done's accessibility ID and minimum target.+- Final focused phone: 9 expected/executed passes in 637.524s; iPad: 7 in 804.211s. Zero failures/skips/missing/unexpected identifiers and zero runtime warnings on either final selection. Signed Mac app/extension compile and strict signature checks passed. Source SHA256 fingerprints match the tested files.+- Prior Core/fast/native and full simulator passes stay tied to af19d7c3 / tested head 4ca62ec6. They are not claimed as full runs of this cursor correction; current owner scope requires affected checks without repeating unchanged suites.+- The owner subsequently explicitly requested installation after these checks; the corrected Development build was installed in place and launched successfully. The installed correction is source commit 0d75b654; the earlier installed baseline was af19d7c3. The earlier automated RunProject launch receipt timed out, but the owner subsequently tested the installed inline build and reported this cursor issue; there is no new unlock blocker. Nothing merged.++## Related++T-2487; draft PR #117; [feature verification](../../character-chapter-associations/note-first-redesign/review-notes-verification.md). Raw red/green bundles and geometry are under `/private/tmp/t2487-cursor-*`. Durable screenshots/geometry: `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-cursor/`. The three unit-test actor-isolation diagnostics emitted during compilation also occur verbatim in the prior inline-final-quick log; none originate in the edited view/UI tests.++## Corrected Development deployment++After the explicit install request and completed checks, direct Xcode MCP RunProject built/signed/installed/launched source `0d75b654cf67213f5d55e998ab82f65ef69e75f6` using Asterism Development and the Makefile-selected phone The Dark Side. Success in 16.384s; launch session 7aed86a700 / PID 23402; installed Devsterism 0.7.0(1), `me.nore.ig.Asterism.dev`. Installed inventory and the running executable path agree.++The arm64 iOS device artifact and embedded extension pass strict signature verification. Entitlements retain `group.me.nore.ig.Asterism.dev` and `iCloud.me.nore.ig.Asterism.dev`. Binary UUID `5FD28842-6F26-3A37-AA1D-82DBD9C927E9`, SHA256 `81872de92e8002491a59e0c33f3a90219dc966a6c6af00e41ca3a4eb3330ccbd`. Full receipt with hardware/install/log paths: `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-cursor/install-receipt.json`. No uninstall/reset, signing/account changes, Personal operation or merge. Physical launch is confirmed for this correction; the earlier timed-out receipt remains historical.
specs/character-chapter-associations/note-first-redesign/decision_log.md Modified
diff --git a/specs/character-chapter-associations/note-first-redesign/decision_log.md b/specs/character-chapter-associations/note-first-redesign/decision_log.mdindex 0e94187e..59bb2bb5 100644--- a/specs/character-chapter-associations/note-first-redesign/decision_log.md+++ b/specs/character-chapter-associations/note-first-redesign/decision_log.md@@ -19,6 +19,10 @@ Status: Approved implementation in progress. The pre-implementation installed ch | Q11 | Retain immutable display bodies in the one selected-record snapshot; render bodies on expansion and obtain a fresh editor basis only for editing. Measure 600-chapter size/read cost. | Technical implementation decision with design-critic review, 2026-10-19; no product/storage change. | | Q12 | Hide legacy facts from all visible record/review interfaces while retaining data; remove saved-note ordinals, put dates beside titles and make Chapters (#) a native initially collapsed disclosure. Verify reopen/edit flows and update Development phone build. | Explicit owner-tested follow-up via parent, 2026-10-19; see ui-refinements.md. | | Q13 | Correct both character/place suggestion sources and matching history rows: no Saved source # ordinal or separate Chapter # heading for titled chapters; compact date trailing right in title row; preserve untitled fallback/evidence/disclosure/data and update Development phone build. | Explicit owner-tested follow-up via parent, 2026-10-19; source-row-refinements.md. |+| Q14 | Review notes (T-2487, 2026-10-25): edit the existing record-wide note in a local Save/Cancel sheet, persist only with Keep, omit the name-only placeholder, preserve existing text by default and guard explicit replacement against the captured note. | Owner request to add notes during detection review; existing record-note and draft/save conventions settle scope. No chapter annotation, generated prose, extraction or schema change. |+| Q15 | After testing Development Devsterism 0.7.0 (1), replace the separate note editor with an inline field on each review suggestion and remove the “Saved with Keep” explanation. Keep remains the only write; resolve a stale basis explicitly with Use saved note or Use draft note, without rebasing on typing, refresh or repeated Keep. | Owner-tested presentation refinement, 2026-10-25. Supersedes Q14's presentation only; its local draft, Keep-only persistence, default preservation and conflict-protection decisions remain. |+| Q16 | Provide native keyboard Done and scroll dismissal for the inline note field so Keep/Skip become visible without losing the local draft. Neither dismissal saves; Keep remains the only persistence action, with no separate Save control or explanatory message. | Keyboard-obscured decision controls were reproduced in three affected UI runs; implementation keeps existing note persistence semantics. |+| Q17 | Reserve the iOS Done bar with an intrinsically measured Form safe-area inset so native caret placement/selection works with the keyboard visible; retain Mac keyboard toolbar, immediate scroll dismissal and Keep/discard semantics. | Owner-reported cursor obstruction reproduced on 2026-10-25: note y505–546 overlapped toolbar y498–546. Same finger-selection assertion passed after inset correction; no policy/gesture workaround or new platform seam. |  ## Decision 1 — Follow-up full-spec draft 
specs/character-chapter-associations/note-first-redesign/design.md Modified
diff --git a/specs/character-chapter-associations/note-first-redesign/design.md b/specs/character-chapter-associations/note-first-redesign/design.mdindex 1db2ce5b..4f01f4fa 100644--- a/specs/character-chapter-associations/note-first-redesign/design.md+++ b/specs/character-chapter-associations/note-first-redesign/design.md@@ -121,3 +121,22 @@ The owner-tested UI refinements in [ui-refinements.md](ui-refinements.md) are au ## Q13 source-row correction  [Source-row refinements](source-row-refinements.md) supersede Q12's intrinsic-width/vertical-fallback date layout and redundant designation labels. Both character/place suggestion sources and matching history rows use actual chapter title with a trailing-right compact date in one full-width row. The leading title may wrap; the date remains in that row. No visible source ordinal or separate chapter-number heading appears for titled chapters; truly untitled chapters retain one title fallback. Internal Entry/source identities, order, exact evidence and chapter keys remain intact, including distinct rows with identical visible titles. Rendered verification must include both suggestion kinds, not merely entity history.+++## Review record notes — T-2487++`CharacterReviewRow` carries the displayed target note, optional staged text and expected-note basis. `CharacterReviewModel` retains these values per proposal/kind/target destination. The inline field displays `stagedNote ?? targetNote`; typing stages a local draft only. A stale-note refresh updates the visible current note while retaining staged text and its original basis. Typing, refresh and repeated Keep attempts never rebase that basis.++`CharacterReviewView` removes the name-only sentence and presents one inline record-note field on each review row, initially showing the staged draft or current target note. The separate note-editor sheet and its toolbar Save/Cancel controls are removed, as is the explanatory “Saved with Keep” message. Skip and closing review discard local drafts. Target/kind changes select their own draft so edits never cross destinations.++The inline field's focused state uses `FocusState` and a native keyboard Done action with accessibility identifier `character-review-keyboard-done`. Done ends focus and leaves the draft staged so Keep and Skip are available. Scrolling the review content dismisses the keyboard immediately; neither dismissal writes or discards the draft. This is a keyboard-access remedy, not a second save action or message.++If the current note no longer matches the draft's expected basis, the row exposes a conflict and disables Keep. **Use saved note** clears the staged draft and adopts the current saved text. **Use draft note** retains the staged text and adopts the current note as its expected basis. These actions resolve only local draft state; the existing Keep action remains the only persistence operation. No typing, refresh or repeated Keep attempt changes the expected basis.++`DecisionRequest.noteEdit` is optional `DecisionNoteEdit(note:expectedNote:)`; nil preserves the note. `LibraryRepository+RecordExtraction` checks the exact Unicode scalar basis under the existing lock after target/source validation. A mismatch returns `staleRecordNote` before mutation. Acceptance writes the note to all coherent physical target copies or the new record inside the existing save boundary, alongside the ordinary decision. Skip ignores the payload. No persisted model, archive, intelligence call or save boundary is added.++Q15, following owner testing of Development Devsterism 0.7.0 (1), supersedes Q14's note-editor presentation only. Q14 remains the historical decision for local drafts, Keep-only persistence, preservation by default and stale-note protection. The inline field and explicit local conflict choices above are the current presentation contract. Q16 records the keyboard dismissal remedy after three affected UI failures: Done retains the draft and exposes Keep/Skip, while scrolling also dismisses the keyboard. Neither changes the persistence contract.++Coverage belongs to real Core repository tests for both kinds and save failure, native review-model tests for draft/basis transitions, and rendered character/place review journeys. The verification record is [review-notes-verification.md](review-notes-verification.md).++Q17 corrects the keyboard-visible touch obstruction: on iOS the native Done button lives in an intrinsically measured bottom safe-area inset on the Form; Mac retains its keyboard toolbar via the existing RuntimePlatform seam. The Form identifier is applied before the inset to preserve the button identifier. Scroll dismissal and note-write semantics stay unchanged. Native selection/caret gestures must edit the chosen position before dismissal.
specs/character-chapter-associations/note-first-redesign/implementation.md Modified
diff --git a/specs/character-chapter-associations/note-first-redesign/implementation.md b/specs/character-chapter-associations/note-first-redesign/implementation.mdindex f142b599..5960f74a 100644--- a/specs/character-chapter-associations/note-first-redesign/implementation.md+++ b/specs/character-chapter-associations/note-first-redesign/implementation.md@@ -89,3 +89,34 @@ Transit publication was not retried: automatic approval review previously denied ### Owner-tested presentation follow-up  Q12 refinements are implemented and deployed as Development Devsterism 0.7.0 (1), installed source 701c2799. Hidden legacy data, native chapter disclosure, date/title layout and note editing passed focused native/phone/iPad verification; current signed Mac/phone builds passed. Exact outcomes, the retained test-driver failure/retry, localization-only source qualification and installation receipt are in [ui-refinements-implementation.md](ui-refinements-implementation.md). Existing Mac UI/performance/future publication qualifications remain open.+++## T-2487 review record notes — implementation explanation++**Reader view:** Each suggestion presents an inline record-note field initialized from its staged draft or current target note. Typing stages locally; Keep saves the value with the accepted suggestion. Skip or closing review discards that proposal's local draft. The repetitive name-only sentence and the explanatory “Saved with Keep” message are gone; saved source evidence remains. The separate note-editor sheet was removed after owner testing of Development Devsterism 0.7.0 (1).++**Application flow:** `CharacterReviewModel` keeps staged note text and expected basis per proposal, displayed kind and target. The inline field stages typing locally, and Keep submits an optional `DecisionNoteEdit` through the existing provider/repository operation. Existing notes are displayed and preserved unless explicitly edited. Reclassifying selects a separate destination draft; Skip and close discard local note drafts.++**Keyboard access:** The inline field uses `FocusState` with a native Done action (`character-review-keyboard-done`). Done ends editing, retains the local draft and reveals Keep/Skip. Scrolling the review content dismisses the keyboard immediately with the same retained-draft behavior. These actions do not persist or discard the draft; Keep remains the only save action.++**Transaction authority:** The existing locked acceptance path checks the exact Unicode scalar note basis before any mutation and saves the note together with ordinary record acceptance. A stale-note refusal refreshes visible current text while preserving the original staged basis and disables Keep. The reader explicitly resolves the local conflict with Use saved note (clear the draft and adopt current text) or Use draft note (retain the text and adopt the current note as its basis); neither action writes the repository. Typing, refresh and repeated Keep never rebase. No new table, archive field, extraction call, chapter annotation or save boundary is introduced. Static reviews found no blocking reuse, correctness, efficiency or spec mismatch. Final runtime qualifications and failed-attempt history live in [T-2487 verification](review-notes-verification.md); an unfinished gate is not a pass.++**Keyboard-visible cursor correction (Q17):** The iOS keyboard toolbar overlapped the note text and intercepted touch editing. A measured Form safe-area inset now reserves the Done region; Mac retains its toolbar. The regression replaces a finger-selected word and inserts at a finger-placed caret while the keyboard remains open, then verifies Keep/readback or close/discard. Existing full-gate evidence remains bound to the pre-correction runtime; see the cursor report for current focused results.++## Final full-diff review explanation++### Beginner level++A note can be typed directly on a suggested person or place. It stays local until Keep; Skip or closing review discards it. Done only hides the keyboard. Native finger selection and caret movement remain usable because the dismissal bar reserves its own space.++### Intermediate level++The review model stores a value draft per proposal, displayed kind and target. Keep sends an optional note edit through the existing acceptance transaction; omission preserves saved text. Refresh retains the comparison basis, and a stale replacement needs an explicit saved-note/draft choice. iOS uses a measured Form safe-area inset, while Mac retains its keyboard toolbar through the existing platform constant.++### Expert level++The repository compares exact Unicode scalars under its exclusive lock before mutation and retains the existing single save/rollback boundary. No schema/archive/extraction or reconciliation path changes. Target-scoped caches clear with the review lifecycle. The cursor regression verifies real native word selection, replacement and single-tap insertion with the keyboard open, followed by persistence/discard readback. Native model/Core checks and full UI evidence retain their exact input/source qualification.++### Completeness assessment++Inline drafting, default preservation, explicit stale-note resolution, kind/target scoping, Keep/Skip/close semantics and keyboard-visible touch editing are implemented and covered. All five original note UI test bodies remain unchanged. Full final-feature review uses merge-base cd0e7635 through the PR head, rather than the empty pushed-branch diff. Baseline full phone/iPad and current focused cursor/Mac evidence are reused according to unchanged dependency inputs; rebase changes to app bootstrap/preferences receive a separate impact assessment. Regular Personal installation follows verified merge under the latest explicit user request; performance and unexercised Mac rendered UI are not newly claimed.
specs/character-chapter-associations/note-first-redesign/requirements.md Modified
diff --git a/specs/character-chapter-associations/note-first-redesign/requirements.md b/specs/character-chapter-associations/note-first-redesign/requirements.mdindex bcb29870..abcf9923 100644--- a/specs/character-chapter-associations/note-first-redesign/requirements.md+++ b/specs/character-chapter-associations/note-first-redesign/requirements.md@@ -80,3 +80,28 @@ A **source note** is the exact saved chapter/Entry note or Work generic note use ## Save-time known links amendment — owner approved 2026-10-19  Successful chapter-note saves automatically persist complete-name links to coherent known characters **and known places** within that work, subject to the existing recognition tiers, explicit spelling rejections and safe source identity. This is the bounded exception to the AI place-review requirement: newly discovered places and characters still require review. App, extension and queued replay share one transaction; no AI or new entity creation is added to the extension. Complete-name source maintenance, exact pending-key settlement and final saved-content conflict choices are specified in [save-time known links](../save-time-known-links/smolspec.md). This approval also resumes pr-pilot after implementation and required gate assessment; it does not waive the recorded performance or Mac runtime qualifications.+++## Review record notes amendment — T-2487, 2026-10-25++The owner requested removing the repetitive name-only sentence and adding a note while reviewing a detected person or place.++1. Suggestion review MUST omit the name-only placeholder while retaining exact source evidence, aliases and existing hidden fact data.+2. Each reviewable suggestion MUST show an inline record-note field, initially containing the staged draft or current target note. Typing stages a local record-wide note; Keep persists it with the accepted record in the existing repository transaction. The note is neither source text nor a chapter-link annotation. The separate note-editor sheet and its Save/Cancel controls MUST NOT be shown, and the explanatory “Saved with Keep” message MUST be omitted.+3. Skip and closing review MUST discard the proposal's local note draft without creating or editing a record. Failed Keep MUST retain the draft for retry.+4. Acceptance MUST preserve an existing note unless explicitly edited. An edited note MUST carry its exact captured basis; a changed note MUST refuse acceptance atomically. Typing, refresh and repeated Keep MUST NOT silently rebase that basis. When a conflict is present, Keep MUST be disabled until the reader explicitly chooses **Use saved note** (discard the staged draft and adopt current saved text) or **Use draft note** (retain the staged text and adopt the current note as its new basis). Either choice resolves only the local draft; Keep remains the persistence action.+5. Drafts and conflict state MUST remain scoped to the original work, proposal, displayed kind and target. Reclassification MUST NOT apply a draft to another destination, and returning to a destination MUST restore its local draft and conflict state.+6. Existing extraction, matching, rejection, deduplication, source guards, fact storage and chapter-association semantics MUST remain unchanged. Recognised characters do not gain a new approval queue.+7. While the inline note field has focus and the keyboard is visible, the reader MUST have a working keyboard dismissal action that ends editing and reveals Keep and Skip without discarding or persisting the draft. Scrolling the review content MUST also dismiss the keyboard and reveal those decision controls. Keep remains the sole persistence action; the keyboard remedy MUST NOT add a separate Save action or explanatory message.++### Owner-tested inline note refinement — Q15, 2026-10-25++After testing the separate note editor in Development Devsterism 0.7.0 (1), the owner requested that the record-note field appear inline on each review suggestion and that the “Saved with Keep” explanation be removed. Q15 supersedes Q14's presentation choice only; Q14 remains the historical decision that established local note drafts, Keep-only persistence, preservation by default and stale-note protection. The inline field stages locally; only Keep writes. A stale basis is resolved through the two explicit local choices above and cannot be rebased by typing, refresh or another Keep attempt.++### Keyboard access refinement — Q16++The inline field MUST remain usable when the keyboard covers the review decision controls. Its native keyboard Done action ends field focus while retaining the local draft and revealing Keep/Skip; scrolling the review content dismisses the keyboard as well. Neither action saves or discards the draft.++### Keyboard-visible touch editing follow-up++The reader MUST be able to place the caret and select/replace existing note text by touch while the software keyboard remains visible. The dismissal control MUST reserve layout space instead of covering editable text. Done still only ends editing; Keep alone persists, and Skip/close discard the draft.
specs/character-chapter-associations/note-first-redesign/review-notes-verification.md Added
diff --git a/specs/character-chapter-associations/note-first-redesign/review-notes-verification.md b/specs/character-chapter-associations/note-first-redesign/review-notes-verification.mdnew file mode 100644index 00000000..75c1f47c--- /dev/null+++ b/specs/character-chapter-associations/note-first-redesign/review-notes-verification.md@@ -0,0 +1,182 @@+# T-2487 review record notes — verification++Status: cursor correction 0d75b654 validated with nine phone and seven iPad journeys plus signed Mac compile; zero selected failures/skips/runtime warnings or missing expected cases. Corrected Devsterism 0.7.0(1) is installed and launched on the selected phone. Earlier full acceptance remains baseline af19d7c3 / tested head 4ca62ec6. PR #117 stays draft; nothing merged.++- Ticket: T-2487 (`C496F643-F2E1-4589-A4D7-7BBCFA2FC922`).+- Local task: `01a1712c-74c3-7250-a12d-295dd0a9021c`.+- Worktree: `/Users/arjen/.codex/worktrees/detection-review-notes/asterism`.+- Branch: `codex/detection-review-notes`.+- Base: local main `cd0e7635` (T-2483, PR #115). Original checkout and its unrelated localisation edit remain untouched.+- Authority: owner requested immediate note entry while reviewing detected people/places, removal of repetitive empty placeholder, and model-efficient implementation delegation. The owner subsequently requested a Development phone install to verify the behavior. Those earlier instructions excluded Personal runs and merge. The latest explicit instruction now authorises full pre-push review, pr-pilot merge and one regular Personal phone update after verified merge, preserving data and signing.++## Current inline refinement — owner feedback++The owner confirmed the installed behavior worked, but found “Saved with Keep” confusing and requested inline note entry. The note itself remains. The inline field edits local record-wide note drafts; Keep is the only persistence action. Skip and review closing discard drafts. A stale note refusal shows the saved note and requires an explicit Use saved note or Use draft note choice before another Keep; typing and refresh cannot silently rebase authority.++The earlier owner-directed affected-only refinement checkpoint is retained below as historical evidence. A subsequent explicit instruction required completion of the unfinished full phone and full iPad gates. Those gates have now completed on unchanged product source, without repeating valid Core/fast/quick/focused/Mac checks. The interrupted earlier aggregate remains incomplete; the fresh completed results below establish simulator acceptance.++| Baseline check (pre-cursor) | State | Reason/evidence |+| --- | --- | --- |+| Unfiltered Core and fixed fast cohort | Reused passed evidence | Repository note payload/write/guard and package value rules unchanged except comment wording; 3,530 Core methods and 152 fast methods passed. |+| Native units and signed Mac compile | Passed | Final inline quick: 1,850 total tests, zero failures/skips, including 52 review-model methods; signed Mac compile. `/private/tmp/t2487-inline-final-quick.xcresult`. |+| Focused inline phone | Passed after keyboard remedy | Seven expected/executed, zero failures/skips; `t2487-inline-phone-final.xcresult`. Original 4/3 failure retained below. |+| Focused inline iPad | Passed after bounded test-driver correction | Five expected/executed, zero failures/skips; `t2487-inline-ipad-verified.xcresult`. |+| Full phone/iPad acceptance | Passed with existing physical-performance guards | Phone 252 unique passes / 0 failures / 2 physical-only skips; iPad 33 / 0 failures / 0 skips. All eligible names reconciled; full receipts below. |+| Earlier inline Development install | Historical receipt | af19d7c3 installation verified; automated launch then unverified. The owner subsequently tested it, and correction0d75b654 was later installed/launched successfully as recorded below. |++## Original dependency inventory and check plan (historical)++Changed behavior: review record-note drafting, native Save/Cancel presentation and optional note mutation during Keep. Production consumers are CharacterReviewView → CharacterReviewModel → LibraryProviding.commitDecision → LibraryRepository's existing locked decision/save boundary; downstream Work detail and record editors display the existing note field. Source evidence, extraction clients, matcher, association ledger, automatic recognised-character path, archive and schema are unchanged.++Fixtures: isolated M5 stores for both record kinds, MockLibraryProvider for review state, and canned seeded-characters for rendered review. No real library or CloudKit delivery is involved.++- Focused Core: `make test-core CORE_TEST=RecordDecisionCommitTests`; includes seven new parameterised methods (14 invocations) for new/existing targets, preservation, stale/scalar-different bases, Skip, replay and save rollback.+- Native: `make test-only TEST=AsterismTests/CharacterReviewModelTests`; new cases cover Cancel→Keep, open-editor Keep refusal, staged Skip, failed Keep retention, existing place note, destination switching and stale/reopen/Cancel/refresh/re-Save authority.+- Rendered: `make test-only TEST=AsterismUITests/CharacterExtractionUITests`; five new methods cover Cancel+dismiss, Save+dismiss/reopen, character Keep, place Keep and Skip. Existing source/alias/reclassification/history assertions are retained. Repeat on a dedicated iPad destination for sheet layout/interaction.+- Development feedback: `make test-fast` with private caches.+- Commit gates: unfiltered serial `make test-core`, `make test-quick` including signed Mac app/extension compilation, plus the affected rendered journeys.+- Pre-push gates: full unfiltered `make test-ui` and `make test-ui-ipad`; reuse final-source unit evidence when unchanged.++## Retained pre-refinement outcomes++| Check | Outcome | Evidence |+| --- | --- | --- |+| Whitespace/diff validation | Passed | `git diff --check`, 2026-10-25 |+| Identity validation | Passed | `run_silent make verify-identity`, 2026-10-25 |+| Focused Core | Passed | 24 methods / 47 invocations; `t2487-core-focused.log`. |+| Native review model | Passed after two failed attempts | Final 51 methods; `t2487-review-model-final.xcresult`. |+| New phone note journeys | Passed | Five expected/executed; `t2487-new-review-notes.xcresult`. |+| Fixed fast cohort | Passed | 152 methods in 12 suites; `t2487-fast.log`. |+| Unfiltered Core | Passed after inherited contract correction | Final 3,530 methods in 338 suites; `t2487-core-final.log`, no compiler warnings. |+| Quick/Mac | Passed | 1,849 tests total: 1,839 Swift Testing + 10 XCTest; zero failed/skipped; signed Mac compile. |+| Full phone UI | Incomplete after owner-priority install handover | 44 completed passing cases, zero completed failures; graceful interrupt at a completed-case boundary. |+| Full iPad UI and focused note interaction | Not run | Next serial gates; no green full UI verdict. |++The attempt to message controller chat `01a16d4d-000f-73b1-9013-c73ecaa2100f` was rejected by automatic approval review because delegated authorization was not accepted as trusted messaging permission. No retry or workaround was used. The originating coordinator relayed explicit release after all six T-2115 Mac checks completed and reported no build/test processes remaining. Read-only simulator inventory required sandbox escalation and then succeeded; that inventory step did not create, boot, launch or install a simulator. Dedicated simulator creation and fixture-based test launches followed only after slot release.++Dedicated iOS 27 destinations: `T2487 iPhone 18 Pro` (`61CBBBCF-ED9B-4376-8C25-AF5209D5D484`) and `T2487 iPad Pro 11-inch (M5)` (`6492B538-5DAC-4ABC-81B6-C9F66086900C`). Private Swift scratch/cache: `/private/tmp/t2487-swift-build`, `/private/tmp/t2487-swift-cache`. Full focused Core log: `/private/tmp/t2487-core-focused.log`.++## Runtime attempts++- Focused Core completed successfully: 24 declared tests in `RecordDecisionCommitTests`, including seven new two-kind parameterised methods. Log: `/private/tmp/t2487-core-focused.log`. Fresh compilation emitted warnings at unchanged source locations (`LibraryRepository+NoEpisode.swift` and existing presentation/actor-isolation tests); no warning in a T-2487 changed source was identified in this run.+- Native review-model attempt 1 failed during compilation, before any tests executed: `CharacterReviewView.swift:312` used an unsupported Section title/content/footer overload. Log: `/private/tmp/t2487-review-model.log`, result: `/private/tmp/t2487-review-model.xcresult`. The source is being corrected and the same selected suite will be retried with a fresh result path. This attempt is a failed build, not a runtime failure or pass.++- Native review-model attempt 2 compiled and executed 51 methods: 50 passed, one new fixture assertion failed (`reclassificationRestoresOnlyMatchingDestinationDraft`, expecting an existing note on a proposal explicitly marked new). Log: `/private/tmp/t2487-review-model-retry.log`, result: `/private/tmp/t2487-review-model-retry.xcresult`. Correct the fixture to a new character plus existing place destination; preserve production matching semantics and rerun the whole selected suite.++- Focused Core count clarification: 24 methods, 23 parameterised methods with two invocations each and one single invocation, for 47 executed invocations. The seven new methods contributed 14 invocations; all passed.+- Native review-model final selection passed: all 51 methods executed, zero issues. Log: `/private/tmp/t2487-review-model-final.log`; result: `/private/tmp/t2487-review-model-final.xcresult`.+- Initial phone whole-suite attempt was interrupted by run_silent's five-minute default timeout (exit 124), with four completed passing journeys and a fifth in progress; it is incomplete. Log/result: `/private/tmp/t2487-review-ui-phone.log`, `/private/tmp/t2487-review-ui-phone.xcresult`. Process inventory confirmed no surviving build/test before the next run. Subsequent long runs specify an explicit timeout.+- The five new phone review-note journeys passed as one bounded selection: five expected/executed methods, zero failures, 373.325 seconds. Log/result: `/private/tmp/t2487-new-review-notes.log`, `/private/tmp/t2487-new-review-notes.xcresult`. Exact methods: `testCharacterReviewNoteCancelAndDismissLeaveNoRecord`, `testCharacterReviewNoteIsSavedOnlyWhenTheProposalIsKept`, `testPlaceReviewNoteIsSavedOnlyWhenTheProposalIsKept`, `testSavedReviewNoteIsDiscardedWhenReviewIsDismissed`, `testSkippingAProposalWithAStagedNoteCreatesNoRecord`.++- Fixed fast cohort passed 152 methods in 12 suites (`/private/tmp/t2487-fast.log`).+- Unfiltered Core attempt 1 executed 3,530 methods in 338 suites and failed with one issue in `PlatformSeamTests.conditionalsOnlyAtSeams`: `Support/MacSettingsWindow.swift: #if os(macOS)` was absent from the exact seam list. Log: `/private/tmp/t2487-core-full.log`. Both that production file and the contract test were unchanged from base `cd0e76350fd0daea4ff61ba483893a90a5aec646` when it failed (verified with `git diff` against base).+- Scope of correction: `specs/settings-layout/design.md` explicitly names `Support/MacSettingsWindow.swift` as the macOS-only native window owner, and the Settings decision log assigns it the native Settings command. The contract correction adds only that exact approved seam, with its rationale; the conditional detector, file walk and assertions remain intact. It changes no Settings behavior and is not a baseline-failure exemption. The original failure receipt remains preserved; unfiltered Core must pass anew.++- Required quick/Mac gate passed: 1,839 unit-test methods in 135 suites, 41.061 seconds test-body time; signed Mac app and Mac share-extension products compiled and CodeSign steps succeeded. No Mac product was launched. Log: `/private/tmp/t2487-quick.log`, simulator result: `/private/tmp/t2487-quick.xcresult`.+- Pre-push reviewers found no blocking reuse, correctness, efficiency or specification finding. Optional duplicate save-failure test helper was left as local test support; no product behavior depends on it. Corrected comment wording for explicitly saved note bases and inventory-step qualification. Runtime gates remain independent of static review.++- Final unfiltered Core passed 3,530 methods in 338 suites, 220.904 seconds test-body time, with no compiler warnings in `/private/tmp/t2487-core-final.log`. The original one-issue run is retained above. No unchanged fast, native or quick gate is being repeated.++- Structured quick-result reconciliation: `xcresulttool get test-results summary` reports 1,849 passed, zero failed, zero skipped, zero expected failures and no runtime warnings. The log's 1,839 count is Swift Testing only; ten XCTest cases bring the result-bundle total to 1,849. Structured JSON is under `/private/tmp/t2487-review-inputs/quick-summary.json` and `quick-tests.json`.+++## Owner acceptance install — 2026-10-25++The owner explicitly requested installing Devsterism to verify the behavior. The aggregate phone simulator run was gracefully interrupted after `ChapterNotesUITests.testManualCharacterChipsOpenSwitchExpandCancelReopenAndSave` completed. It recorded 44 passing completed cases and zero completed failures, then exited via cancellation (make error 75). Its raw log and partial result remain at `/private/tmp/t2487-full-ui-phone.log` and `/private/tmp/t2487-full-ui-phone.xcresult`; it is incomplete, not a green UI gate. Process inventory confirmed no remaining simulator test/build before installation.++Device selection used the current Makefile's default phone resolution: physical iPhone18,1, with exact physical identity retained in the local install receipt. Xcode MCP opened this exact worktree project (`workspace-N8bywCAZ7w`), explicitly selected Asterism Development and that eligible physical destination, and used RunProject with attachDebugger false. RunProject returned `The app was launched successfully.`, PID 21989, launch session `79da0ed080`, elapsed 52.403 seconds. Installed app inventory confirms **Devsterism 0.7.0 (1)**, bundle `me.nore.ig.Asterism.dev`, installed path ending `88E418C5-7870-440B-AE18-0DD7D69FE8EB/Asterism.app`; the same PID/executable path was confirmed running.++The exact build signing input pins `group.me.nore.ig.Asterism.dev` and `iCloud.me.nore.ig.Asterism.dev`. Sandboxed host codesign readback initially emitted an invalid-entitlements-blob warning. A read-only decode outside the sandbox succeeded: embedded signature identity `V24684SCZN.me.nore.ig.Asterism.dev`, App Group `group.me.nore.ig.Asterism.dev`, CloudKit container `iCloud.me.nore.ig.Asterism.dev`. This was a sandbox readback limitation; no signing setting or permission was changed. Installation/launch success and the installed identity are established; live CloudKit delivery and library contents are not claimed. No Personal command ran. Receipt: `/private/tmp/t2487-install-receipt.json`. Full Xcode log: `/var/folders/11/v0tnfm294kd9c6zll_ncmpkh0000gn/T/ActionArtifacts/default/RunProject/RunProject-Log-20261025-161914.txt`.++Xcode generated four feature string-catalog entries during the build (Current note, Edit note, Note to keep, Saved with Keep.). These additions belong to T-2487 in this isolated worktree; the original checkout's localisation edit remains untouched.++## Inline handover history++The old sheet's five-case focused iPad selection was stopped for the owner's inline refinement. `testCharacterReviewNoteCancelAndDismissLeaveNoRecord` completed successfully (one completed pass, zero completed failures), then SIGINT requested graceful cancellation. The test runner stopped, but the Xcode client asserted during cancellation cleanup and remained alive. SIGTERM terminated only that already-cancelled matching client (PID 67708); process inventory then showed no test/build runner before new validation. Log/result remain `/private/tmp/t2487-new-review-notes-ipad.log` and `/private/tmp/t2487-new-review-notes-ipad.xcresult`, INCOMPLETE and pre-refinement.++## Inline validation attempts++- Initial inline quick passed 1,850 total tests (1,840 Swift Testing plus ten XCTest), but focused review found a fresh-draft basis edge case after Use saved note and a later refresh. The model now captures current saved text only when starting with no staged value; an actual staged draft retains its basis. The expanded regression covers this sequence, and focused review confirmed the correction.+- Final inline quick passed 1,850 tests with zero failed/skipped/expected failures; 52 CharacterReviewModel methods passed, including inline staging, discard, failure, destination and conflict authority cases. Mac app/embedded extension compilation passed without launch. Log/result: `/private/tmp/t2487-inline-final-quick.log`, `/private/tmp/t2487-inline-final-quick.xcresult`. Five UI-helper unused-return warnings were subsequently removed by dropping the unused return; assertions and product behavior are unchanged.+- Phone affected selection now runs seven methods: the five adapted inline note journeys plus `testReviewShowsExactSavedSourceWithoutGeneratedFacts` and `testReclassifyingACharacterRowKeepsItAsAPlace`, covering source/alias and destination consumers of the changed row. Log/result: `/private/tmp/t2487-inline-phone.log`, `/private/tmp/t2487-inline-phone.xcresult`.++- First inline phone selection executed all seven expected methods: four passed and three failed in 404.753 seconds. Failures: `testCharacterReviewNoteIsSavedOnlyWhenTheProposalIsKept`, `testPlaceReviewNoteIsSavedOnlyWhenTheProposalIsKept`, `testSkippingAProposalWithATypedNoteCreatesNoRecord`, each at the unchanged full-visibility/tap guard after inline typing. Passed: typed-close, close/reopen discard, source/alias evidence, and kind reclassification. No baseline/waiver assumption applies to these affected failures.+- The test execution ended before the command: Xcode launched `simctl diagnose --timeout=600` during finalization. The result bundle remained in Staging with no root Info.plist, so attachment export was unavailable at that point. This is a diagnostics phase, not seven cases still running. Preserve the final failed result once finalized.+- The unused-return warning was removed by making the new helper return Void (all callers ignored its return). Failure-only screenshot, accessibility tree and control/list/keyboard geometry attachments were added without altering existing assertions, full-visibility guards or scroll-attempt limits. One-case instrumented reproduction is prepared if the original attachments do not establish the cause.++## Keyboard reachability cause and remedy — Q16++Original failed selection finalized normally after its 600-second simulator diagnostics phase: seven executed, four passed, three failed, zero skipped. No live runner or orphan was left before reproduction. It contained no exported failure screenshots, so one failing character Keep case was reproduced with explicit screenshot/AX/geometry attachments and `-collect-test-diagnostics never`; that reproduction failed once as expected, without changing interaction assertions.++The captured geometry establishes a user-facing obstruction: the focused inline field retained the software keyboard after the existing scroll attempts. Keep existed at `(32, 713.7, 256, 44)` but was not hittable; the keyboard occupied y=590–816. The screen had no keyboard-dismiss action. This was not addressed by relaxing visibility or increasing scroll counts.++The view now has row-scoped FocusState, a native keyboard Done action which clears only focus, immediate scroll dismissal, and focus clearing before row decisions/reclassification/close. The diagnostic helper was removed before final verification; tests exercise the actual Done action, wait for keyboard disappearance, verify unchanged draft text, and retain the original full-visibility and persistence assertions. The UI helper returns Void to remove its unused-result warnings.++The one-case fixed confirmation passed: one expected/executed method, zero failures, 81.987 seconds. Log/result: `/private/tmp/t2487-inline-keyboard-fixed.log`, `/private/tmp/t2487-inline-keyboard-fixed.xcresult`. It emitted one unlocalized SwiftUI `Invalid frame dimension (negative or non-finite)` runtime warning; no source location or effect on the passing assertions was established. Keep that warning distinct from compiler warnings and test failures.++Durable evidence is outside the working tree at `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-inline-keyboard/`: `typed-note-before-fix.png`, `keep-obscured-before-fix.png`, `failure-ax-tree.txt`, `failure-geometry.txt`. Original diagnostic result: `/private/tmp/t2487-inline-keyboard-repro.xcresult`.++Current Mac compile was refreshed through Xcode MCP (Asterism Development → My Mac → BuildProject buildForTesting false), without launch. Build succeeded in 47.952 seconds, zero errors. Both `Asterism.app` and its embedded `Contents/PlugIns/AsterismShareExtensionMac.appex` exist and passed strict codesign verification. Log: `/var/folders/11/v0tnfm294kd9c6zll_ncmpkh0000gn/T/ActionArtifacts/default/BuildProject/BuildProject-Log-20261025-170304.txt`.++Historical checkpoint: the seven-case phone confirmation was running at `/private/tmp/t2487-inline-phone-final.log` and `/private/tmp/t2487-inline-phone-final.xcresult`; the focused iPad confirmation was then owed; both subsequently passed as recorded below. No full aggregate restart was made for the refinement.++- Final phone confirmation passed all seven selected/expected methods: seven passed, zero failed/skipped, 424.722 seconds. Log/result: `/private/tmp/t2487-inline-phone-final.log`, `/private/tmp/t2487-inline-phone-final.xcresult`. This includes all three formerly failing post-typing decisions. Tests exercise native Done and retain the original full-visibility guard and exact persistence/discard assertions. Six unlocalized SwiftUI invalid-frame runtime warnings remain recorded separately; no changed-source unused-result compiler warning remains.+- Focused iPad confirmation is now active: five note journeys only, `/private/tmp/t2487-inline-ipad-final.log`, `/private/tmp/t2487-inline-ipad-final.xcresult`. Final scoped review found no remaining actionable focus/keyboard or draft-authority issue; this is not a full UI acceptance verdict.+- Final string catalog contains only the currently used new conflict labels (Current note, Use draft note, Use saved note); obsolete sheet-only copy and its generated entries are absent.++## iPad visibility driver qualification and resolution++The first focused inline iPad selection executed five methods: four passed and character Keep failed at the full-visibility guard (373.390 seconds). Keyboard Done assertions and the other four flows passed. Its final failed result remains `/private/tmp/t2487-inline-ipad-final.xcresult` and raw log `/private/tmp/t2487-inline-ipad-final.log`.++The existing screen recording showed the keyboard absent and Keep becoming visually visible during the failed attempt. A diagnostic-only probe first failed early because the trace queried an absent keyboard's frame; this was an instrumentation failure, not a product regression (`t2487-ipad-geometry-repro.xcresult`). Safe optional-element reads corrected the trace without changing interaction behavior. The same one-case probe then passed while exposing the geometry (`t2487-ipad-geometry-repro-2.xcresult`): Keep started at y910.5/h44 with viewport391–935, about20 points clipped below. A full swipe moved it to y218 above the viewport; the reverse swipe returned it to y827. Keyboard was absent throughout. This demonstrates oversized test-driver gestures and timing-dependent oscillation, not a remaining keyboard obstruction.++`tapReviewControl` now uses a bounded edge-distance drag for a materialized clipped control, from the actual visible viewport center, with12-point clearance capped at25% of viewport height. Existing whole swipes remain only as discovery fallbacks. The full-control visibility/hittability guard and6/8 attempt limits remain unchanged. Temporary trace/diagnostic code was removed. Product code, Core and model tests were not changed for this correction.++The complete affected iPad selection then passed: five expected/executed, zero failures/skips,356.323 seconds. Log/result: `/private/tmp/t2487-inline-ipad-verified.log`, `/private/tmp/t2487-inline-ipad-verified.xcresult`. Its five unlocalized invalid-frame runtime warnings remain qualified separately. The final unused diagnostic loop binding was changed to `_` without behavior change; the final phone place/persistence helper consumer subsequently passed as recorded below. Prior seven-phone product passes are retained because the iPad correction changes only bounded test navigation.++Durable existing-recording frames and the captured trace are at `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-ipad-geometry/`: `bottom-clipped-before-driver-fix.png`, `keep-visible-during-overshoot.png`, `keep-control-trace.txt`.++## Earlier affected-only validation checkpoint (historical)++The final harness phone place/persistence consumer passed one expected/executed test with zero failures in96.793 seconds (`/private/tmp/t2487-phone-driver-verified.log`, `/private/tmp/t2487-phone-driver-verified.xcresult`). This compiled the final `_` loop binding and removed the diagnostic unused-counter warning. The geometry correction changes test navigation only, so the prior seven-phone product passes, five-iPad passes, Core3530, fast152, native1850/52-model and current signed Mac compile evidence are retained without repeating unaffected suites.++Final light checks passed: `git diff --check`, string-catalog JSON parse and `make verify-identity`. The original main checkout still has only its pre-existing Localizable.xcstrings change and remains on main; all T-2487 edits are in the managed feature worktree.++The owner explicitly requested affected-only validation after testing the first acceptance build and requesting inline entry. No unfiltered aggregate was restarted solely for that refinement. Full phone acceptance remains incomplete after the owner-priority install handover; the full iPad aggregate was not run. This is a qualified draft-review result, not a green full-UI/release verdict, performance acceptance or merge authorisation. All initial failed/incomplete attempts and runtime warning qualifications remain above.++## Refined Development installation++Xcode MCP explicitly selected Asterism Development and the Makefile-resolved physical phone, then RunProject built successfully and installed the inline update from implementation commit af19d7c3bb87bdfdf95d1f1bc78edb62eecfa29e. The installed app inventory identifies Devsterism 0.7.0 (1), bundle me.nore.ig.Asterism.dev, at a new installation URL. The compiled product entitlements confirm the development App Group and CloudKit container. Exact hardware identity, installation URL, code SHA256 and Mach-O UUID are retained in `/private/tmp/t2487-inline-install-receipt.json`, distinguishing this source from the first acceptance build with the same version/build.++RunProject timed out after 300 seconds while launch waited for the phone: a read-only lockState query returned passcodeRequired true and no main app process was present. The owner was asked to unlock it. Installation is verified; launch is not yet claimed. No Personal operation or physical fixture reset occurred.++## Full simulator acceptance completion — 2026-10-25++A later explicit instruction required completing the unfinished unfiltered phone and full iPad acceptance. The shared slot was idle and reserved for T-2487. Both gates ran serially with private DerivedData `/private/tmp/t2487-derived` on the existing dedicated iOS27 simulators. Source stayed clean at tested head `4ca62ec652d43849b54dceffdb07cf6dd0de4edd`; implementation and installed runtime remain `af19d7c3bb87bdfdf95d1f1bc78edb62eecfa29e`. No rebase, product edit, physical reinstall or merge occurred. Core/fast/quick/focused/Mac checks were reused rather than repeated.++| Gate | Terminal result | Reconciled inventory | Evidence |+| --- | --- | --- | --- |+| `make test-ui` | EXIT 0; 10,494.384 seconds of test time; command 18:04:43–20:59:46 AEDT | 254 unique eligible identifiers: 252 passed / 0 failed / 2 existing physical-signpost skips. No missing or unexpected eligible methods. | `/private/tmp/t2487-full-ui-phone-complete.xcresult`, `t2487-full-ui-phone-summary.json`, `t2487-full-ui-phone-tests.json`, `t2487-full-ui-phone-reconciliation.json` |+| `make test-ui-ipad` | EXIT 0; 1,000.965 seconds of test time; command 20:59:46–21:16:34 AEDT | All 33 expected identifiers passed: WideLayoutUITests 30 plus WideLayoutAccessibilityUITests 3. Zero failures/skips/missing/unexpected. | `/private/tmp/t2487-full-ui-ipad-complete.xcresult`, `t2487-full-ui-ipad-summary.json`, `t2487-full-ui-ipad-tests.json`, `t2487-full-ui-ipad-reconciliation.json` |++Both use Makefile Development defaults and serial execution, with only a fresh resultBundlePath and `-collect-test-diagnostics never` added. Phone uses the Makefile's normal whole-UI-bundle selection and its two iPad-suite skips; iPad uses the normal two wide suites. No custom selection/skip shrinkage was added. Phone destination: T2487 iPhone 18 Pro; iPad: T2487 iPad Pro 11-inch (M5). Exact simulator identifiers are in the result summaries. Terminal status is `/private/tmp/t2487-full-ui-final.status`.++The source inventory contains 297 zero-argument methods. Thirty-three belong to the iPad partition and ten are compile-excluded Mac methods, leaving 254 eligible phone identifiers. All ten absent methods are covered by existing `#if os(macOS)` blocks: AssociationNotesUITests lines 981–1149 and 1195–1224 (four methods) and SettingsLayoutUITests lines 152–305 (six). Their exact names and guard evidence are retained in the phone reconciliation JSON. This is not a missing simulator selection or an inherited-failure waiver.++The two skips are `M4ScaleTodayPerformanceUITests/testTodayPresentationSignpostAtM4ComposedScale()` and `.../testTodayPresentationSignpostAtM4DuplicateSiteRowsScale()`. Both call the existing physical-performance guard, which requires ASTERISM_RUN_PHYSICAL_PERFORMANCE and a physical phone; the recorded skip reason points to make test-performance-m4-recent. No guard was bypassed and no Personal measurement was attempted. These remain unmeasured physical performance, separate from passing simulator acceptance. Xcode's device-level summary counts 255 passing runs because its one parameterized test has four runs; the source-identity reconciliation uses 252 passing unique methods plus two skipped methods.++The full phone result records 14 unlocalized SwiftUI `Invalid frame dimension (negative or non-finite)` runtime warnings; the full iPad result records none. They remain visible evidence and are not claimed resolved or proved inherited. No test failures occurred. The console-log export returned `No console log available`; it was not treated as successful. Supported full action logs were exported instead to `/private/tmp/t2487-full-ui-phone-action.json` and `/private/tmp/t2487-full-ui-ipad-action.json`; complete result bundles and structured test summaries/identifiers are retained. run_silent buffered stdout, so live monitoring used actual runner liveness and advancing result-file writes without inventing completed-case counts.++Both terminal outcomes and unchanged runtime identity were confirmed before documentation updates. Physical installation remains Devsterism 0.7.0(1) from af19d7c3, binary UUID 37762425-FDD5-348C-A824-67F97CF2875D. Its launch is still unverified following the earlier passcode-blocked timed-out RunProject; no new launch/install was attempted. The durable installation receipt is `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-inline-install-receipt.json`. PR #117 remains draft and nothing was merged.++## Keyboard-visible cursor correction (Q17)++Owner feedback reproduced: the visible note y505–546 lay under native keyboard toolbar y498–546. With keyboard open, a finger double-tap failed to select the first word and replacement appended. The same assertion passed after moving iOS Done into a measured safe-area inset; immediate scroll dismissal stayed unchanged. Mac retains its keyboard toolbar through the existing RuntimePlatform constant. The Form identifier precedes the inset, and Done's minimum target lives inside its label. No model/repository/schema/build-setting changes.++Final source fingerprints: `/private/tmp/t2487-cursor-final-source.sha256`. Nine phone and seven iPad expected identifiers all executed and passed, with zero failures/skips/missing/unexpected cases or runtime warnings. Raw logs/results and structured reconciliation: `/private/tmp/t2487-cursor-final-{phone,ipad}.*`, `/private/tmp/t2487-cursor-final-reconciliation.json`. Signed Mac compile: `/private/tmp/t2487-cursor-final-mac.log`; app and embedded extension strict signatures verified. Existing three unit-test actor-isolation diagnostics match the earlier native-build log verbatim; none are in edited source. Scoped Sol review found no actionable findings. All original five note test bodies remain byte-for-byte unchanged; two new journeys exercise keyboard-visible word replacement and caret insertion, then Keep/readback or place close/reopen/discard.++No unchanged Core/fast/native/full aggregate was rerun. The completed full phone252/2physicalguards and iPad33 results above are baseline af19d7c3 evidence, not full-suite claims for this correction. The owner has subsequently tested the installed inline build; the earlier automated launch timeout is historical, not a new unlock blocker. The latest explicit request authorises the corrected Development install after checks. Its source/build/installation receipt will follow separately. See [cursor report](../../bugfixes/review-note-cursor/report.md) for red/green evidence and durable screenshots.++### Corrected installation receipt++The latest explicit owner request authorised installation after checks. Xcode MCP RunProject used Asterism Development / The Dark Side and returned successful launch in 16.384s, PID 23402, session 7aed86a700. Installed inventory identifies Devsterism 0.7.0(1), development bundle; the same PID/executable path matches that installation. Source `0d75b654cf67213f5d55e998ab82f65ef69e75f6`; strict app/extension signatures and development App Group/CloudKit entitlements verified. Device arm64 iOS binary UUID `5FD28842-6F26-3A37-AA1D-82DBD9C927E9`; SHA256 `81872de92e8002491a59e0c33f3a90219dc966a6c6af00e41ca3a4eb3330ccbd`. Durable receipt: `/Users/arjen/.codex/visualizations/2026/10/25/01a1712c-74c3-7250-a12d-295dd0a9021c/t2487-cursor/install-receipt.json`; build/run log: `/var/folders/11/v0tnfm294kd9c6zll_ncmpkh0000gn/T/ActionArtifacts/default/RunProject/RunProject-Log-20261025-221943.txt`. This is an in-place update without uninstall/reset; signing settings and the regular Personal app were not changed. The correction's physical launch is confirmed.
specs/character-chapter-associations/note-first-redesign/tasks.md Modified
diff --git a/specs/character-chapter-associations/note-first-redesign/tasks.md b/specs/character-chapter-associations/note-first-redesign/tasks.mdindex 30d226ea..4e40ca9e 100644--- a/specs/character-chapter-associations/note-first-redesign/tasks.md+++ b/specs/character-chapter-associations/note-first-redesign/tasks.md@@ -46,3 +46,11 @@ references:   - Run AGENTS-appropriate affected Core/native/rendered suites and fixed fast on final composed source; retain exact failures/warnings/counts. Run the separate required code-commit gates before any code commit. Full unfiltered phone/iPad UI belongs to pre-push. Reassess performance against unchanged gates and review documentation. Q10 authorises Development phone deployment for testing after implementation and validation; follow the repository Xcode MCP installation route. Merge and Personal device runs require their own applicable authorisation.   - Stream: 1   - References: specs/character-chapter-associations/note-first-redesign/requirements.md, specs/character-chapter-associations/note-first-redesign/design.md, specs/character-chapter-associations/note-first-redesign/decision_log.md++- [x] 7. T-2487: review notes remain local until Keep and preserve existing note authority+  - Inline notes preserve scoped drafts and exact stale-note authority; Keep alone persists+  - Baseline full acceptance remains af19d7c3 and tested head4ca62ec6; no full-suite claim for cursor correction+  - Cursor correction reserves measured iOS Done inset; native finger word selection and caret insertion work while keyboard remains open; Mac retains its keyboard toolbar+  - Focused phone9 and iPad7 passed with zero failures or skips or runtime warnings; signed Mac app and extension compile and strict signatures passed; scoped Sol review found no actionable issues+  - All original5 note test bodies retained unchanged; package and review model code untouched; no unchanged suite reruns+  - Owner-requested in-place corrected Devsterism0.7.0(1) installed and launched via Xcode MCP from source0d75b654; device arm64 UUID5FD28842-6F26-3A37-AA1D-82DBD9C927E9; receipt linked in verification; no reset or Personal action or merge

Things to double-check

Regular phone update blocked before execution

Exact merged worktree is clean. Asterism Personal / The Dark Side selected, matching Makefile UDID 00008150-000C49940AE2401C. Bundle/team/optimisation/testability and fixture exclusion checked; Personal LaunchAction has no arguments/environment overrides. Existing phone app inventory: Asterism 0.7.0(1). RunProject rejected before execution for fresh approval; this is not an installation success or locked-launch timeout.

Build-only Personal product is ready. The binary names the regular CloudKit container; its optional environment entitlement is absent and the existing development profile permits Production/Development. No runtime CloudKit-environment verification is claimed.