feat(ENG-65): End-to-end verification — full DoD checklist pass#133
feat(ENG-65): End-to-end verification — full DoD checklist pass#133Connorbelez merged 4 commits intomainfrom
Conversation
Run complete Definition of Done verification across the payment system. All 14 DoD items pass (166 payment tests). Fix stale test assertions and add machine version consistency. Code fixes: - Add version property to obligation machine config (consistency with collection attempt machine) - Fix generation.test.ts TS errors with "skipped" in result narrowing - Fix sequenceCounter.test.ts: getNextSequenceNumber now lazy-inits - Fix obligation-effect.test.ts: forwardObligationEventToMortgage returns obligation on no-op (not undefined) - Add sentinel test to testUtils.test.ts (prevents "no suite found") Verification artifacts in specs/ENG-65/: - verification-report.md with full DoD checklist results - Task breakdown and chunk execution logs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Sorry @Connorbelez, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Connorbelez has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
Pull request overview
Runs an ENG-65 “Definition of Done” verification pass for the payments system, and includes a small set of consistency/test fixes plus written verification artifacts under specs/ENG-65/.
Changes:
- Add an explicit machine
versionto the obligation state machine config for consistency with other machines. - Fix/refresh multiple test suites to align with current runtime behavior (no-op returns, TS union narrowing, lazy-init sequence counter) and add a sentinel test to avoid empty-suite failures.
- Add ENG-65 verification documentation (checklist, drift notes, chunk/task logs).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
convex/engine/machines/obligation.machine.ts |
Adds version: OBLIGATION_MACHINE_VERSION to the obligation machine config. |
convex/payments/__tests__/generation.test.ts |
Fixes TS narrowing around the skipped union branch by using "skipped" in … checks. |
src/test/convex/engine/obligation-effect.test.ts |
Updates assertion to match forwardObligationEventToMortgage returning the obligation on no-op transitions. |
convex/ledger/__tests__/sequenceCounter.test.ts |
Updates expectations to match lazy initialization of the ledger sequence counter. |
convex/ledger/__tests__/testUtils.test.ts |
Adds a sentinel describe/it so vitest doesn’t treat the utility module as an empty test suite. |
specs/ENG-65/verification-report.md |
Adds the ENG-65 DoD checklist results and verification notes/artifacts. |
specs/ENG-65/tasks.md |
Adds master task tracking for the ENG-65 verification work. |
specs/ENG-65/chunks/manifest.md |
Adds execution order/manifest for verification chunks. |
specs/ENG-65/chunks/chunk-01-preflight/tasks.md |
Adds chunk 1 task checklist for preflight/schema/structure verification. |
specs/ENG-65/chunks/chunk-01-preflight/context.md |
Adds chunk 1 context (drift report + schema/file-structure references). |
specs/ENG-65/chunks/chunk-02-machines/tasks.md |
Adds chunk 2 task checklist for machine verification. |
specs/ENG-65/chunks/chunk-02-machines/context.md |
Adds chunk 2 context with SPEC excerpts for machines. |
specs/ENG-65/chunks/chunk-03-generation-rules/tasks.md |
Adds chunk 3 task checklist for generation/rules verification. |
specs/ENG-65/chunks/chunk-03-generation-rules/context.md |
Adds chunk 3 context with SPEC excerpts for generation/rules. |
specs/ENG-65/chunks/chunk-04-methods-chain/tasks.md |
Adds chunk 4 task checklist for methods + cross-entity chain verification. |
specs/ENG-65/chunks/chunk-04-methods-chain/context.md |
Adds chunk 4 context with SPEC excerpts for PaymentMethod + effects topology. |
specs/ENG-65/chunks/chunk-05-review-fixes/tasks.md |
Adds chunk 5 task checklist for drift fixes and final pass. |
specs/ENG-65/chunks/chunk-05-review-fixes/context.md |
Adds chunk 5 context (drift items + report template). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
specs/ENG-65/chunks/chunk-04-methods-chain/tasks.md (1)
37-41: Specify the exact test file path for consistency.T-021 says "Read endToEnd tests" without specifying the file path, unlike other tasks that provide explicit paths (e.g., T-017 line 6, T-019 line 20). Based on T-023 line 56, the file is likely
convex/payments/__tests__/endToEnd.test.ts.📝 Suggested improvement for consistency
### T-021: DoD `#11` — Verify partial settlement -- Read endToEnd tests for partial payment flow +- Read `convex/payments/__tests__/endToEnd.test.ts` for partial payment flow - Verify: Two payments against one obligation → amountSettled accumulates🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@specs/ENG-65/chunks/chunk-04-methods-chain/tasks.md` around lines 37 - 41, Update task T-021 to include the exact end-to-end test file path so it's consistent with other tasks: change the instruction "Read endToEnd tests for partial payment flow" to explicitly reference convex/payments/__tests__/endToEnd.test.ts and ensure the verification bullets remain the same (Two payments against one obligation → amountSettled accumulates; First payment → partially_settled, second payment (remainder) → settled), so reviewers know precisely which test file to inspect.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@specs/ENG-65/chunks/chunk-02-machines/context.md`:
- Line 71: The note stating that OBLIGATION_WAIVED is supported from state
`upcoming` conflicts with the state machine where `upcoming` only has a
transition on `BECAME_DUE`; update the doc so they match by either adding an
explicit `OBLIGATION_WAIVED` transition originating from `upcoming` in the
machine diagram (or state transition list) or change the note to state that
waiver is not allowed from `upcoming` and indicate the correct origin state(s)
for `OBLIGATION_WAIVED` (reference the symbols `OBLIGATION_WAIVED`, `upcoming`,
and `BECAME_DUE` when making the change).
In `@specs/ENG-65/chunks/chunk-03-generation-rules/context.md`:
- Around line 45-56: The spec contains a typo in the rule name "LateFeeeRule"
which diverges from the implementation file name lateFeeRule.ts and will break
searches and verification; rename the spec header and all occurrences of
"LateFeeeRule" to "LateFeeRule" so it exactly matches the implementation
(lateFeeRule.ts) and update any related references (e.g., key verification
points or examples) to use the corrected symbol to prevent naming drift.
- Line 10: The documented generation field names are out of sync with the
implementation: the context lists principalBalance and termEndDate but the code
uses principal and maturityDate; update the documentation to use the actual
implementation field names (replace principalBalance -> principal and
termEndDate -> maturityDate) or, if intended, change the implementation to match
the documented names; adjust the list containing interestRate, principalBalance,
paymentFrequency, firstPaymentDate, termEndDate to match the actual symbols used
in the codebase (interestRate, principal, paymentFrequency, firstPaymentDate,
maturityDate) so DoD verification won't produce false negatives.
In `@specs/ENG-65/chunks/chunk-03-generation-rules/tasks.md`:
- Around line 39-40: The task reference and rule name are misspelled: replace
occurrences of the symbol/name LateFeeeRule with LateFeeRule in the T-015
description and any references so they match the module/file name lateFeeRule.ts
and the actual exported symbol; ensure the task title "T-015" and the text read
`convex/payments/collectionPlan/rules/lateFeeRule.ts` remain correct and update
any mentions in the file/docs to use LateFeeRule for consistency.
In `@specs/ENG-65/tasks.md`:
- Around line 7-9: The task checklist falsely marks T-002/T-003/T-004 as
complete despite failing tests/typecheck; update the entries for T-002, T-003
and DoD `#12` (references: T-002, T-003, T-004, DoD `#12`, and the “scope-limited
pass” phrasing) so they are not marked complete — either change the checkboxes
to unchecked or relabel them explicitly as “scope-limited pass” and add a short
parenthetical listing the exclusion criteria (e.g., “fails: test X, typecheck
errors Y, unhandled rejections Z”) and a clear quality-gate note that bun check,
bun typecheck and bunx convex codegen must pass before marking as complete.
---
Nitpick comments:
In `@specs/ENG-65/chunks/chunk-04-methods-chain/tasks.md`:
- Around line 37-41: Update task T-021 to include the exact end-to-end test file
path so it's consistent with other tasks: change the instruction "Read endToEnd
tests for partial payment flow" to explicitly reference
convex/payments/__tests__/endToEnd.test.ts and ensure the verification bullets
remain the same (Two payments against one obligation → amountSettled
accumulates; First payment → partially_settled, second payment (remainder) →
settled), so reviewers know precisely which test file to inspect.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3d4c5f35-1d7b-4388-bd3b-a626c9079850
📒 Files selected for processing (18)
convex/engine/machines/obligation.machine.tsconvex/ledger/__tests__/sequenceCounter.test.tsconvex/ledger/__tests__/testUtils.test.tsconvex/payments/__tests__/generation.test.tsspecs/ENG-65/chunks/chunk-01-preflight/context.mdspecs/ENG-65/chunks/chunk-01-preflight/tasks.mdspecs/ENG-65/chunks/chunk-02-machines/context.mdspecs/ENG-65/chunks/chunk-02-machines/tasks.mdspecs/ENG-65/chunks/chunk-03-generation-rules/context.mdspecs/ENG-65/chunks/chunk-03-generation-rules/tasks.mdspecs/ENG-65/chunks/chunk-04-methods-chain/context.mdspecs/ENG-65/chunks/chunk-04-methods-chain/tasks.mdspecs/ENG-65/chunks/chunk-05-review-fixes/context.mdspecs/ENG-65/chunks/chunk-05-review-fixes/tasks.mdspecs/ENG-65/chunks/manifest.mdspecs/ENG-65/tasks.mdspecs/ENG-65/verification-report.mdsrc/test/convex/engine/obligation-effect.test.ts
- Fix "LateFeeeRule" typo to "LateFeeRule" - Update T-026 to reflect that PR includes actual changes (tests + machine version bump) - Relabel T-003 and T-028 as scope-limited passes with explicit exclusion criteria Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The context.md incorrectly stated only `upcoming` had OBLIGATION_WAIVED as an enhancement. The actual code supports it from all four non-terminal states (upcoming, due, overdue, partially_settled). Updated the note to accurately enumerate all states. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address PR review comments: update CodeRabbit review bullet to reflect actual PR diff, and refresh test suite numbers (0 failures, 1449 passed) to match current branch state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run complete Definition of Done verification across the payment system. All 14 DoD items pass (166 payment tests). Fix stale test assertions and add machine version consistency. Code fixes: - Add version property to obligation machine config (consistency with collection attempt machine) - Fix generation.test.ts TS errors with "skipped" in result narrowing - Fix sequenceCounter.test.ts: getNextSequenceNumber now lazy-inits - Fix obligation-effect.test.ts: forwardObligationEventToMortgage returns obligation on no-op (not undefined) - Add sentinel test to testUtils.test.ts (prevents "no suite found") Verification artifacts in specs/ENG-65/: - verification-report.md with full DoD checklist results - Task breakdown and chunk execution logs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Ledger sequence counter now auto-initializes when obligations are minted, starting at 1. * Obligation machine configuration now includes version tracking. * **Documentation** * Added comprehensive ENG-65 specification documentation covering payment workflows, obligation and collection state machines, generation rules, payment methods, and cross-entity interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->

Run complete Definition of Done verification across the payment system.
All 14 DoD items pass (166 payment tests). Fix stale test assertions
and add machine version consistency.
Code fixes:
collection attempt machine)
returns obligation on no-op (not undefined)
Verification artifacts in specs/ENG-65/:
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Summary by CodeRabbit
New Features
Documentation