Skip to content

Cover the Brain bulk-delete path and harden two test harnesses - #942

Merged
selfcontained merged 1 commit into
mainfrom
agt_cb84b5f47186/job-test-enforcer-f17c647e
Aug 12, 2026
Merged

Cover the Brain bulk-delete path and harden two test harnesses#942
selfcontained merged 1 commit into
mainfrom
agt_cb84b5f47186/job-test-enforcer-f17c647e

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Recurring Test Enforcer run. The local suite was green on the first pass (24th consecutive), so the run went to the queued next_focus coverage gap plus two harness defects.

Coverage: BrainCollectionView bulk delete

The bulk-delete-by-entry-type surface added in #929 had no unit coverage, and e2e/brains-page.spec.ts only exercises the single-entry and clear-collection paths. brains-collection-view.test.tsx (20 tests) mounts the real card tree with the real use-brain queries and mutations — only the HTTP seam and the toaster are mocked — because everything under test is decided from unfiltered scope totals rather than the rows on screen, and a stubbed card tree cannot tell those apart.

Pinned:

  • the collection-scoped delete URL vs the allCollections=true project-wide one
  • the confirmation quoting the scope total, not the filtered rows, and the toast quoting the server's deleted count rather than the total
  • singular/plural nouns in both places
  • the collection-cleared redirect and both of its guards (other entry types remaining; never redirecting from an all-collections delete)
  • bulk delete not being offered at all until the totals load
  • invalidation after a successful delete, and the failure path leaving the dialog open
  • the filter match fields (object/list collection as well as name; event kind or subject, with a null subject excluded) and sections staying mounted when the filter hides every row
  • the 100-item cap note appearing only in an unfiltered project scope

22/22 mutants killed across brains-collection-view.tsx and use-brain.ts.

Harness fixes

  • scripts/e2e-isolated.sh installs the pinned Playwright chromium before provisioning the database or building the bundle. pnpm install does not fetch browser binaries, so a Playwright bump in the lockfile left the pinned revision missing and every browser test failed at launch with Executable doesn't exist at ~/Library/Caches/ms-playwright/.... CI already installs it as its own step; this makes the local lane match. Sub-second no-op once present.
  • .prettierignore now covers apps/site/.astro. astro check (run by pnpm run check) generates it, after which pnpm run format — and therefore pnpm run ci — fails on any machine that has run check. CI passes it only because its checkout is still fresh.

Validation

pnpm run check, pnpm run format, pnpm run test (server 2650, web 798, extension 60, scripts 4), pnpm run test:e2e (179 passed / 12 skipped), pnpm run test:e2e:live (11 passed, no leaked e2e-* tmux sessions), pnpm run finalize:web.

CI scan of the last 50 GitHub Actions runs: 50/50 success, no CI-only flakes.

🤖 Generated with Claude Code

BrainCollectionView's bulk delete (#929) had no unit coverage and no E2E:
brains-page.spec.ts only exercises the single-entry and clear-collection
paths. The new tests mount the real card tree with the real use-brain
queries and mutations (only the HTTP seam and the toaster are mocked) and
pin the parts that are decided from unfiltered scope totals rather than the
rows on screen — the scoped vs all-collections delete URLs, the count the
confirmation may quote, singular/plural nouns, the collection-cleared
redirect and its two guards, invalidation, the failure path, the filter
match fields, and the 100-item cap note.
Also fixes two harness defects that only showed up locally:
- scripts/e2e-isolated.sh now installs the pinned Playwright chromium
before provisioning anything. pnpm install does not fetch browser
binaries, so a Playwright bump in the lockfile made every browser test
fail at launch; CI has always installed it as its own step.
- .prettierignore now covers apps/site/.astro. `pnpm run check` generates
it, after which `pnpm run format` — and so `pnpm run ci` — failed on any
machine that had run check. CI passes it only because its checkout is
still fresh.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 6c338ca into mainAug 12, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_cb84b5f47186/job-test-enforcer-f17c647e branch August 12, 2026 02:30
Sign up for freeto 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

@selfcontained