Skip to content

fix: results and profile CSVs quote the reader note instead of an unvalidated clause - #62

Merged
Paullo9 merged 2 commits into
mainfrom
issue-reader-note-csv
Nov 1, 2026
Merged

Paullo9 merged 2 commits into
mainfrom
issue-reader-note-csv

Conversation

@Paullo9

@Paullo9 Paullo9 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Exports state what the reader said instead of calling the result "unvalidated", the way Velox, GMS and HyperSpy exports do.

Change

  • TidyResultsCSV and ProfileCSV no longer test the source notes for the word "unvalidated" and append , unvalidated (reader note). When the source has reader notes, every validation sentence (header line and cell) is followed by ; reader note: and the notes, joined by ; . Each note passes CSVText.headerValue, so a cell keeps to one line. Blank notes are left out. Without notes, the sentence stands alone.
  • TidyResultsCSV.unvalidatedClause stays public and is marked @available(*, deprecated). No writer uses it any more, so consumers still compile, with a deprecation warning only.
  • GeometricPhaseAnalysis comments now say what the result was tested against (planted displacement fields) instead of telling apps to show it as unvalidated. Result.validation keeps its value.

Output change for consumers: a source with any reader note now gets the clause. Before, only a note containing "unvalidated" did. App tests that pin CSV text need re-pinning when they move to this version.

Fixtures and tests

  • test: re-pin Tests/ImagoCoreTests/Fixtures/csv-tidy-pins.json for the reader-note clause. 13 of the 15 written cases change, and the inputs are unchanged. A script independent of the Swift writer transformed the old expected texts, and its checks asserted the exact replacement counts.

Evidence

  • Red first: the new tidyQuotesTheReaderNoteAfterEachValidation and shownLineAndReaderNoteAndSanitising tests failed on main's writers and pass now.
  • swift test -c release --parallel --num-workers 1 -j 1 --skip ImagoKitParityTests: green (134 tests).
  • Parity target ImagoKitParityTests: 186 tests green.
  • SwiftLint (strict, the repo config) and SwiftFormat --lint: clean.
  • An independent review of the diff found no correctness or API problems. Its two suggestions (one-line cells, no dangling clause for blank notes) are applied.

🤖 Generated with Claude Code

Paullo9 and others added 2 commits November 1, 2026 16:53
…alidated clause

TidyResultsCSV and ProfileCSV no longer test the source notes for the word
"unvalidated" and append ", unvalidated (reader note)". When the source has
reader notes, every validation sentence (header line and cell) is followed by
"; reader note: " and the notes as the reader wrote them, joined by "; ". Each
note passes CSVText.headerValue so a cell keeps one line, and blank notes are
left out. Without notes the sentence stands alone.

TidyResultsCSV.unvalidatedClause stays public, marked deprecated, and is no
longer written by any writer, so consumers keep compiling.

Comments in GeometricPhaseAnalysis now say what the result was tested against
(planted displacement fields) instead of telling apps to show it as unvalidated.

The tidy pins move in the next commit (the expected texts change).

Done: CSV writers quote the reader notes; next: re-pin csv-tidy-pins.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reason: TidyResultsCSV now follows each validation sentence with
"; reader note: <notes>" instead of ", unvalidated (reader note)". 13 of the 15
written cases have notes and change; the inputs are unchanged.

The expected texts were transformed from the old pins by a script independent of
the Swift writer: header validation lines pass headerValue, cells RFC 4180
quoting, as CSVText does. It checked that the file round-trips through
json.dumps, that each product has exactly one header line and one cell per row
line, and that the old clause is gone. The application harness that first wrote
these pins (tools/csvexport/pins.py) is not re-run.

Done: tidy pins match the new clause; next: none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Nov 1, 2026
@Paullo9
Paullo9 enabled auto-merge (squash) November 1, 2026 15:54
@Paullo9
Paullo9 merged commit e6f6e73 into main Nov 1, 2026
8 checks passed
@Paullo9
Paullo9 deleted the issue-reader-note-csv branch November 1, 2026 16:57
@macem-release macem-release Bot mentioned this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant