Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ccf21a5
WIP: direct tests for the attendee page and attendees browser
claude Jul 29, 2026
d5bec6f
WIP: strengthen the attendee-page suite, add roster-filter tests
claude Jul 29, 2026
c1e79d5
WIP: target the attendee-page survivors, add store-refund tests
claude Jul 29, 2026
b63e9ce
WIP: attendees-list paging and activity-log tests, listing-page-data …
claude Jul 29, 2026
9639b4c
WIP: money-path tests for storeRefundedBooking
claude Jul 29, 2026
bb409cb
WIP: balance-change and overbook tests for store-refund
claude Jul 29, 2026
ae71e6c
Record the one unclosed store-refund mutant in the backlog
claude Jul 29, 2026
b153bce
Sharpen the listing-page-data ledger and activity-preview tests
claude Jul 29, 2026
6c7db9f
Give four feature modules the direct tests the mutation gate needs
claude Jul 29, 2026
de1aa11
Answer the review: restore a lost TODO, split the helper, fix the fix…
claude Jul 29, 2026
861d524
Import the seeder from its new module in the integration suite
claude Jul 29, 2026
162ff25
Record the duplicate attendees-list suites for a future pass
claude Jul 29, 2026
0317da4
Fixtures for the listing page's package, parent, daily and note paths
claude Jul 29, 2026
f3ed7ff
Questions, date-picker and daily-date fixtures for the listing page
claude Jul 29, 2026
0864406
WIP: review fixes — package helper, guide path, stronger refund asser…
claude Jul 29, 2026
e78c5b4
All four modules reach 100%
claude Jul 29, 2026
b1924ff
Build the refund fixtures from real types, not any
claude Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ shows up in the report:
- **Seed volume with a batch, not a loop.** When a test needs many rows (e.g.
filling a pagination page), create ONE record through the production path
and clone its rows in a single batch — see `seedFillerAttendees` in
`test/integration/server/attendees-list.test.ts` — instead of running the full
`test/test-utils/db-helpers/attendee-seeding.ts` — instead of running the full
production write path N times.
- **Shard inherently heavy suites.** A suite that is minutes of sequential
work by nature (the migration restore/chain suites) is split into shard
Expand Down
69 changes: 44 additions & 25 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,30 @@ stands, so the split can be a pure move.

---

## Two suites now cover the attendees list

*Origin: Codex review of PR #1993 (direct tests for the four testless modules).*

`test/features/admin/attendees-list.test.ts` was added because the mutation
gate needs a test at the source's mirrored path. It calls the handlers
directly. But `test/integration/server/attendees-list.test.ts` already drives
the same behaviour over HTTP — authentication, the listing filter, sort order
and paging — and `test/integration/server/attendees-csv.test.ts` covers the
export. So the same rules are now checked twice.

That costs runtime on every suite run, and lets the two sets of fixtures and
expectations drift apart. The fix is to consolidate: move the route-level cases
into the mirrored feature suite (which can call the handler directly *and* go
through the router where that is the point), and delete what is left behind.

Not done in #1993 because that change touches suites the PR otherwise had no
reason to open, and the mirrored suite had to exist first. Worth doing next
time either file is opened.

Starting point: the three files named above.

---

## Let Deno-hosted sites with a Bunny database be migrated

`POST /instance/site-credentials` (`src/features/instance.ts`) only returns
Expand Down Expand Up @@ -1708,33 +1732,28 @@ and thinking again about the startup grace, which exists because a process id
can be given to somebody else after the original has gone. Start at
`RUN_STARTUP_GRACE_MS` in `isolation-state.ts` and the comment above it.

## Four feature modules have no test at their mirrored path
## Four feature modules had no test at their mirrored path — now they do

*Origin: `deno task precommit:mutation` on the notes-migration branch, which
could not start.*

The mutation gate refuses to run a source that has mutants but no test at its
mirrored path under `test/`. Four modules are in that state:

- `src/features/admin/attendee-page.ts` (55 mutants)
- `src/features/admin/attendees-list.ts` (37)
- `src/features/admin/listing-page-data.ts` (45)
- `src/features/api/payment-processing/store-refund.ts` (29)

Nothing needs moving: no test imports any of them. They are reached only
through the app, by integration and Cucumber journeys, so each needs a direct
test written at `test/features/…` to match its path.

This blocks the gate for *any* branch that touches one of them, however small
the change — the notes migration only swapped an import in each. Until they
have direct tests, a branch touching them can prove its own work with a
targeted `deno task mutation <source> <tests>` run instead.

`src/features/admin/attendee-notes.ts` was in the same state and is now fixed:
its route suite drives real pages through the session helpers, so it moved from
`test/integration/admin/` to `test/features/admin/`, which is where that kind
of suite belongs (see "Let the misplaced-test list see past request helpers"
above). The other four have no such suite to move.
could not start. Closed by the direct-test pass that followed.*
Comment on lines +1735 to +1738

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the still-open lost-answer TODO

This replacement also deletes the unrelated “An answer filed under a listing nobody booked” item that came from the review of PR #1990, although the bug is still present: BookingIntentSchema accepts any numeric listing key, and saveSessionAnswers only visits createdEntries, so answers keyed to an unbooked listing are silently discarded after payment. Restore that TODO until the booking code validates the answer keys, rather than losing an acknowledged out-of-scope review issue.

AGENTS.md reference: AGENTS.md:L99-L99

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in de1aa11, and thank you for catching it — this was real data loss, not a judgement call. My edit replaced from the "Four feature modules" heading to end of file, so it took the still-open lost-answer item with it. The section is restored verbatim from origin/main, and git diff origin/main -- TODO.md now shows only the one heading I meant to rewrite.


Generated by Claude Code


All four now have a direct test at their mirrored path, so the gate no longer
refuses to start on a branch that touches them:

- `src/features/admin/attendee-page.ts` → `test/features/admin/attendee-page.test.ts` (98.1%, one recorded equivalent)
- `src/features/admin/attendees-list.ts` → `test/features/admin/attendees-list.test.ts` (100%)
- `src/features/admin/listing-page-data.ts` → `test/features/admin/listing-page-data/` (100%, one recorded equivalent)
- `src/features/api/payment-processing/store-refund.ts` → `test/features/api/payment-processing/store-refund.test.ts` (100%)

Every one of them is now at the 100% the gate demands, so a branch touching
any of them can pass without first writing the tests that should already have
existed.
Comment on lines +1748 to +1750

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify that this refers to 100% coverage.

“Now at the 100% the gate demands” is grammatically incomplete. Use “now at the 100% coverage the gate demands” or equivalent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TODO.md` around lines 1748 - 1750, Clarify the sentence in TODO.md by
explicitly stating “100% coverage” when describing the gate’s requirement, while
preserving the existing meaning and surrounding wording.


`src/features/admin/attendee-notes.ts` was in the same state and was fixed
earlier: its route suite drives real pages through the session helpers, so it
moved from `test/integration/admin/` to `test/features/admin/`, which is where
that kind of suite belongs (see "Let the misplaced-test list see past request
helpers" above).

---

Expand Down
3 changes: 3 additions & 0 deletions scripts/mutation/equivalent-mutants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -986,3 +986,6 @@ src/shared/db/migrations.ts:254:49 ?? → || # opts.allowMissingSettings is b
# statuses strictness is about.
scripts/specs/run.ts:88:17 true → false # strict only changes how Cucumber treats undefined and pending steps, and messageIssues rejects exactly those two statuses (REJECTED_STATUSES in scripts/specs/messages.ts), so a run containing either fails on the issues whatever strict says, and a run containing neither is unaffected by it
src/shared/crypto/encryption.ts:120:5 false → true # importKey is module-private and the CryptoKey it returns never leaves this file, which only encrypts and decrypts with it — nothing can call exportKey on it, so extractable is unobservable
src/features/admin/attendee-page.ts:122:43 ?? → || # URLSearchParams.get returns string | null, and the fallback is the empty string: null and "" both yield "" under either operator, so no query can tell them apart
src/features/admin/attendees-list.ts:56:52 ?? → || # parsePositiveInt validates against PositiveIntSchema (minValue 1), so it returns a number of 1 or more, or null — it can never return 0, the only falsy number that would tell ?? and || apart
src/features/admin/listing-page-data.ts:282:61 ?? → || # Map.get returns ListingWithCount[] | undefined, and every array — empty included — is truthy, so only undefined reaches the fallback and both operators yield the same []
Loading