Skip to content

test: claim-review MVP end-to-end integration coverage - #74

Merged
enlorik merged 1 commit into
mainfrom
feature/claim-review-e2e-mvp-tests-clean
Jul 21, 2026
Merged

test: claim-review MVP end-to-end integration coverage#74
enlorik merged 1 commit into
mainfrom
feature/claim-review-e2e-mvp-tests-clean

Conversation

@enlorik

@enlorik enlorik commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds test/search_screen_claim_review_e2e_test.dart — 2 focused widget tests, no production code changed.
  • Exercises the full configured MVP flow through SearchScreen using fakes only (no network, no real API keys).

Test 1 — full MVP flow:

  • Ask question → provider called once, local evidence retrieved → groups render with provider label → no setup-required card
  • Default selection correct (new + betterSource selected, alreadyKnown not)
  • Toggle better-source off → generate draft A (new claim only) → verify content, exclusions, citation title/URL, no raw prose, no provider name
  • Save draft A → verify exactly 1 insert, source URL preserved, no secrets in content
  • Double-persistence guard: append after save is blocked; repeated save returns ignored, no second insert
  • Toggle better-source back on → draft cleared → generate draft B (new + better-source) → verify differs from draft A
  • Append draft B to target note → 1 update, original content preserved, draft B appended, embeddingPending set, no duplicate on repeat
  • Discard → session cleared (idle, no groups, no draft, no label), repository records intact

Test 2 — alreadyKnown tampering regression:

  • Review with only an alreadyKnown claim
  • Directly call notifier.toggle(knownClaimId) to simulate corrupted selection
  • selectedSaveableItems remains empty (canBeSaved = false)
  • generateDraft() produces null or non-saveable draft
  • saveAsNewNote() returns ignored, no insert
  • appendToExistingNote() is a no-op, no update

Stale #70 assumptions fixed

Old assumption Why incompatible Fix
_FixedGroundedAnswerProvider missing isConfigured isConfigured added to abstract class in #73 Added bool get isConfigured => true
Same draft saved then appended isDraftAlreadySaved guard prevents this (correct behavior) Append path now uses distinct draft B

Verification

  • flutter analyze → No issues found
  • flutter test test/search_screen_claim_review_e2e_test.dart --reporter expanded → 2/2 pass
  • flutter test --reporter expanded → 589/589 pass
  • 1 commit, 1 file changed (+533 lines)

@codex review

🤖 Generated with Claude Code

Two focused widget tests through SearchScreen using fakes only:

1. Full MVP flow: ask → grounded review (provider called once, local
   evidence retrieved) → grouped claims with provider label → toggle
   selection → draft A (new claim only, save, double-persistence guard,
   no append after save) → draft B (new + better-source, append, no
   duplicate append, embeddingPending) → discard (session cleared,
   repository intact).

2. alreadyKnown tampering regression: simulates corrupted selection via
   direct notifier.toggle(); proves selectedSaveableItems stays empty
   and both saveAsNewNote() and appendToExistingNote() are ignored,
   never reaching the repository.

Stale #70 assumptions incompatible with current main:
- _FixedGroundedAnswerProvider missing isConfigured (added in #73)
- step 11 expected same draft to be both saved and appended; current
  main's isDraftAlreadySaved guard prevents this — replaced with
  genuine draft B (different content) for the append path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@enlorik

enlorik commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: b21a1b71c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@enlorik
enlorik merged commit 60fb596 into main Jul 21, 2026
1 check passed
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