Skip to content

[cli] Address the review of compass test export - #197

Merged
mcraveiro merged 3 commits into
mainfrom
feature/campaign-export-review-fixes
Nov 23, 2026
Merged

mcraveiro merged 3 commits into
mainfrom
feature/campaign-export-review-fixes

Conversation

@mcraveiro

Copy link
Copy Markdown
Member

Follow-up to #194, addressing its review. Nothing there was must-fix. This PR fixes all five should-fix findings and nits 6, 7, 9, 11 and 13.

Should-fix

  1. Tester text no longer forms links. cell and the screenshot caption now break each [[ and ]] with a zero-width space, as org-link-make-string does. They also put one before the colon of a plain link such as id:X. Without that, id:NOPE-1 with no brackets still parsed as a link: compass's parser found 14 links where 9 were expected. A new test renders hostile tester text and titles and parses the page with compass::ingest::org::parse. It checks that the link targets, the table-cell count and the headings match the plain page, and that the text a reader sees is unchanged.
  2. Example-block comma. The comma now goes after the indentation ( ,** Nor this). The test asserts that the block body, unescaped by org's rule, round-trips to the note's text.
  3. Titles. link now passes its description through cell and adds a zero-width space after a final ]. A title with | or ]] therefore stays one cell and one link. The test compares the parsed link descriptions.
  4. exported_at. read_campaigns takes now() in the snapshot's first statement and returns it in a new campaign_snapshot. mark_exported sets that value.
  5. Tests. The screenshot bytes are read back and compared. New cases cover a story page that is gone (exit 1, the warning, no file, exported_at NULL) and --story with two campaigns.

Nits

  • 6: .at() replaces both find(...)->second.
  • 7: the export refuses an absolute path or one that leaves the checkout, before it writes any file of that campaign. It does not warn about a missing story folder.
  • 9: a --story that matches no campaign prints no test campaign of story <id> on <env> and exits 2.
  • 11: added the missing direct includes. The zero-width space is spelled "\xE2\x80\x8B" because the build does not pass /utf-8 to MSVC.
  • 13: the task's * Status table is realigned and updated.
  • Declined 8: activity.attachment.media_type has no CHECK constraint. A throw in extension_of would let one hand-inserted row block every export, so .bin stays.
  • Declined 10: memory use is fine at current sizes, as the review says. Writing files inside the read transaction would hold it open across disk I/O.
  • Declined 12: a cell whose whole text is <r> is a display cookie only. It is cosmetic and needs that exact input.

Verification

  • The new tests fail on origin/main: 6 assertions in [campaign_page] and 6 in [test_export].
  • The coverage tests from finding 5 fail under injected faults. Those faults were a wrong hex digit in from_hex, an ignored --story, no skip for a missing story page, exported_at = now(), live title brackets, a cell that is not inert, the comma before the indentation, live plain links, and an unchecked .. path.
  • After merging origin/main, the built binary's compass generate and compass check --ratchet --no-blame (0 new) ran, and the full ctest passed: 1702 tests, 0 failed.

🤖 Generated with Claude Code

mcraveiro and others added 3 commits November 23, 2026 18:25
Tester text in a table cell or a caption, and a page title used as a
link description, can no longer form a link: a zero-width space breaks
each [[ and ]] and the colon of a plain link such as id:X, as
org-link-make-string does. A test parses the page with compass's own
parser and checks that hostile text leaves the links and cells as they
were.

The example-block comma now goes after a line's indentation, where org
and compass's readers remove it; a test checks the round trip.

exported_at is the time of the snapshot the export read, not the time
of the update after it.

The export refuses a path outside the checkout, and a --story that
matches no campaign fails and says so. The tests now read the
screenshot's bytes back and cover a missing story page and a --story
that matches one of two campaigns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Counting links and their targets misses a description that a final ]
ends early, so the test now compares the descriptions a reader sees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mcraveiro
mcraveiro merged commit 47dd2a6 into main Nov 23, 2026
4 checks passed
@mcraveiro
mcraveiro deleted the feature/campaign-export-review-fixes branch November 23, 2026 18:48

This branch was previously deployed

1 inactive deployment
CI — d611e254 Deployed Nov 23, 2026 by mcraveiro via linux-clang-release-ninja #180
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