Skip to content

Finish paid bookings in a fixed number of database calls - #2048

Merged
stefan-burke merged 7 commits into
mainfrom
payment-aggregate/03-payment-processing-core
Aug 7, 2026
Merged

Finish paid bookings in a fixed number of database calls#2048
stefan-burke merged 7 commits into
mainfrom
payment-aggregate/03-payment-processing-core

Conversation

@stefan-burke

@stefan-burke stefan-burke commented Aug 6, 2026

Copy link
Copy Markdown
Member

What changed

  • Claim new and stale payment work atomically.
  • Load the facts needed to finish a paid booking in one database batch.
  • Finish paid bookings in four database calls, or five when answers must be saved.
  • Batch stored answers and activity records.
  • Reuse package facts for email and webhooks instead of reading them again.
  • Use only modifier links that match the modifier current scope.
  • Let primary writes preserve valid answers when a read replica is behind.
  • Keep free and API notification preparation in pending work after the booking commits.
  • Give each batched snapshot result and raw database row shape a clear name.
  • Add project guidance to name positional results and use types when they remove noise.

Why

Large paid orders should cost the same small number of database requests as simple orders. This leaves room under the edge request limit and closes races when several callbacks try to reclaim the same stale payment. Provider reads must not silently change prices or lose answers because old links or a lagging replica were observed. Named batch results also make the snapshot code easier to read and safer to reorder.

Checks

  • nix develop -c deno task precommit
  • 100% line and branch coverage
  • Focused review suite: 147 tests
  • Equivalent-mutant anchors and zero-duplication checks passed
  • Earlier targeted mutation runs: 100% for the payment core, claim, answer, and notification behavior
  • Full branch mutation run was skipped because of its runtime, by owner request

Summary by CodeRabbit

  • Improvements
    • Improved paid booking validation and refund handling for package pricing, hidden listings, stale registrations, and parent-child relationships.
    • Reduced database activity during payment processing and registration notifications for faster, more consistent processing.
    • Registration emails and webhooks now share package and pricing details for more accurate content.
    • Improved duplicate and concurrent payment reservation handling.
    • Faster saving for attendee answers containing stored choices, while preserving free-text support.
  • Bug Fixes
    • Improved fallback behavior when package or listing information is unavailable during booking.
  • Documentation
    • Expanded development and operational guidance.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (2)
  • AGENTS.md
  • TODO.md
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 62a851c6-811c-46e6-86ec-27e6d28bbf5c

📥 Commits

Reviewing files that changed from the base of the PR and between bba8f4d and 891073f.

📒 Files selected for processing (2)
  • AGENTS.md
  • TODO.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The payment flow now loads a single paid-order snapshot for validation, pricing, ledger replay, attendee creation, refunds, and notifications. Shared package facts prevent repeated reads. Processed payments and stored attendee answers use atomic database paths with expanded regression coverage.

Changes

Paid-order processing and persistence

Layer / File(s) Summary
Snapshot contracts, loading, and validation
src/features/api/payment-processing/snapshot/*, src/features/api/payment-processing/items.ts, src/features/api/payment-processing/package-pricing.ts, test/features/api/payment-processing/snapshot/*, test/features/api/payment-processing/package-pricing/*
The payment flow now builds and loads PaidOrderSnapshot data. Validation and package pricing consume snapshot-backed facts.
Payment orchestration and attendee creation
src/features/api/payment-processing/index.ts, src/features/api/payment-processing/create.ts, src/features/api/payment-processing/completion.ts, src/features/api/payment-processing/recovery.ts, src/features/api/payment-processing/store-refund.ts, src/shared/db/attendees/*
Booking, replay, refund, recovery, attendee creation, and promo-code activity handling use preloaded status, ledger, modifier, notification, and parent-child data.
Registration notifications
src/shared/registration-package-facts.ts, src/shared/email.ts, src/shared/email-renderer.ts, src/shared/webhook.ts
Email and webhook delivery share package display and pricing facts. Supplied facts bypass package database reads.
Atomic payment and answer persistence
src/shared/db/processed-payments.ts, src/shared/db/questions/attendee-answers/save.ts, test/shared/db/processed-payments/*, test/shared/db/questions/attendee-answers/save/*
Reservations use atomic upsert-and-lookup batches. Stored-ID answer saves use batched statements, while mixed and free-text saves retain transactional handling.
Regression and mutation coverage
test/**/*, scripts/mutation/equivalent-mutants/*
Tests cover snapshot consistency, database-call budgets, notification reuse, concurrency, rollback behavior, and renamed equivalent-mutant paths.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary objective of reducing paid-booking processing to a fixed number of database calls.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch payment-aggregate/03-payment-processing-core
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch payment-aggregate/03-payment-processing-core

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dfe3a6924

ℹ️ 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".

Comment thread src/features/api/payment-processing/snapshot/fold.ts Outdated
Comment thread src/features/api/payment-processing/snapshot/types.ts Outdated
Comment thread src/shared/session-ledger.ts Outdated
Comment thread src/features/api/payment-processing/snapshot/io.ts Outdated
…payment-processing-core

# Conflicts:
#	scripts/mutation/equivalent-mutants/features.txt
#	scripts/mutation/equivalent-mutants/shared-a-l.txt
#	scripts/mutation/equivalent-mutants/shared-db.txt

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 010db3f0de

ℹ️ 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".

Comment thread src/shared/webhook.ts Outdated
Comment thread src/features/api/payment-processing/create.ts Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/shared/db/processed-payments.test.ts (1)

81-97: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Rename this test: reserveSession no longer retries.

The implementation now claims a stale unresolved row with one conditional upsert. No retry remains. The test asserts exactly one database call, which contradicts the name "retries when stale reservation detected".

✏️ Proposed rename
-    test("retries when stale reservation detected", async () => {
+    test("claims a stale reservation in one database call", async () => {
🤖 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 `@test/shared/db/processed-payments.test.ts` around lines 81 - 97, Rename the
test describing the stale reservation scenario so it reflects that
reserveSession claims the stale row with a single database call rather than
retrying. Update only the test name in the test around reserveSession and
preserve its assertions and setup.
🤖 Prompt for all review comments with 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.

Inline comments:
In `@src/features/api/payment-processing/create.ts`:
- Around line 231-247: Update promoCodeActivities to retrieve each modifier
application with requiredMapValue(byId, spec.id) instead of the unchecked
non-null assertion before reading delta. Add a regression test covering the
required spec-to-application contract.

In `@src/shared/db/processed-payments.ts`:
- Around line 139-142: Replace the manual staleBefore calculation in the
processed-payments claim flow with isoBefore(STALE_RESERVATION_MS), while
keeping claimedAt derived from nowIso() unchanged.

In `@src/shared/db/questions/attendee-answers/save.ts`:
- Around line 220-224: Update storedIdsOnly in
src/shared/db/questions/attendee-answers/save.ts around lines 220-224 to
evaluate the normalized map after line 238, using set.textAnswers.length === 0
without excluding arrays, so normalizeAnswerSet reaches storedIdAnswerStatements
for array inputs. In
test/shared/db/questions/attendee-answers/save/stored-ids-behavior.test.ts lines
207-214, rename the test to describe the batch path and change the expected
database call count from three to one.

In `@test/features/api/payment-processing/create.test.ts`:
- Around line 283-289: Replace the as never casts in the promoCodeActivities
call with properly typed, complete ModifierSpec, ModifierApplication, and
listing fixtures. Ensure the fixtures satisfy the production activity contract
directly, including all required fields, so contract changes cause this test to
fail at compile time.

In `@test/features/api/payment-processing/create/answers.test.ts`:
- Around line 16-27: Remove the unnecessary `as CreatedEntry` assertion from the
return statement in `bookedEntry`; return the `{ attendee, listing: loaded }`
object directly while preserving the existing `CreatedEntry` return type.

In `@test/features/api/payment-processing/index/helpers.ts`:
- Around line 106-108: Require the result of getProcessedPayment before
asserting failure_data, replacing optional chaining with a strong assertion that
the processed-payment row exists and then checking its failure_data value. Apply
this change at test/features/api/payment-processing/index/helpers.ts:106-108,
test/features/api/payment-processing/index/balance.test.ts:93-93, and
test/features/api/payment-processing/index/booking.test.ts:141-141; each site
requires the same direct update.

In `@test/features/api/payment-processing/store-refund.test.ts`:
- Line 19: Add an assertion in the refund persistence test to verify the stored
attendee status_id equals await requirePublicStatusId(). Extend the existing
row-count and quantity assertions without changing their behavior, using the
imported requirePublicStatusId symbol.

In `@test/integration/processed-payments/locking.test.ts`:
- Around line 143-172: Update the locking test around the gated db.batch stub
and winner assertion so it does not assume stub invocation order matches the
attempts array order. Release the first invocation gate, await all attempts, and
assert the aggregate result that exactly one attempt reserved the session,
relying on the existing remaining assertions for the full outcome.

In `@test/integration/server/api-packages.test.ts`:
- Around line 479-495: Update the test around apiBookPackage to track whether
the execute branch matching groupRecord.hide_package_listings was invoked, set
the flag when injecting the database failure, and assert it after the call. Keep
the existing recovery and booking-row assertions, ensuring the test fails if the
expected lookup no longer uses that failure path.

In `@test/shared/registration-package-facts.test.ts`:
- Around line 25-60: Update the test named “loads each package once with its
display and complete member pricing” to record package query statements and
assert that both loaders receive group.id exactly once, despite duplicate
row(group.id) inputs. Preserve the existing display and pricing assertions, and
ensure the added assertions cover deduplication while maintaining full coverage
and mutation detection.

In `@test/shared/webhook/budget.test.ts`:
- Around line 147-170: Update the test around sendRegistrationWebhooks to
capture the emitted webhook payload while retaining the zero-database-call
assertion, then assert the payload contains the supplied package name “Supplied
package” and package price 500. Use the existing webhook test capture mechanism
and verify the values originate from the facts object.

In `@test/test-utils/db-poison.ts`:
- Around line 19-24: Extract the shared statement-matching, one-shot poisoning,
rejection, and delegation flow into a helper in db-poison.ts. Update both the
db.batch and tx.batch wrappers to call this helper, passing their respective
real batch functions as delegates, while preserving the existing poisoned state
and error-message behavior.
- Around line 8-10: Declare the explicit return type of the exported
withPoisonedWrite helper as a function accepting body and returning
Promise<void>, while preserving the existing curried behavior and
implementation.

In `@test/test-utils/processed-payments.ts`:
- Around line 19-24: Update expectSessionFailed so failure_data is asserted to
be a populated non-empty string, rather than merely not equal to an empty
string; preserve the existing attendee_id assertion and session error handling.

---

Outside diff comments:
In `@test/shared/db/processed-payments.test.ts`:
- Around line 81-97: Rename the test describing the stale reservation scenario
so it reflects that reserveSession claims the stale row with a single database
call rather than retrying. Update only the test name in the test around
reserveSession and preserve its assertions and setup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 106ebbaf-6b47-434f-954b-967da7169416

📥 Commits

Reviewing files that changed from the base of the PR and between d30671f and a440003.

📒 Files selected for processing (87)
  • scripts/mutation/equivalent-mutants/features.txt
  • scripts/mutation/equivalent-mutants/shared-a-l.txt
  • scripts/mutation/equivalent-mutants/shared-db.txt
  • scripts/mutation/equivalent-mutants/shared-m-z.txt
  • src/features/api/payment-processing/completion.ts
  • src/features/api/payment-processing/create.ts
  • src/features/api/payment-processing/index.ts
  • src/features/api/payment-processing/items.ts
  • src/features/api/payment-processing/package-pricing.ts
  • src/features/api/payment-processing/recovery.ts
  • src/features/api/payment-processing/snapshot/build.ts
  • src/features/api/payment-processing/snapshot/io.ts
  • src/features/api/payment-processing/snapshot/types.ts
  • src/features/api/payment-processing/store-refund.ts
  • src/shared/db/activity-log.ts
  • src/shared/db/attendee-types.ts
  • src/shared/db/attendees/create.ts
  • src/shared/db/attendees/order-parents.ts
  • src/shared/db/attendees/queries.ts
  • src/shared/db/modifier-resolve.ts
  • src/shared/db/processed-payments.ts
  • src/shared/db/questions/attendee-answers/save.ts
  • src/shared/email-renderer.ts
  • src/shared/email.ts
  • src/shared/registration-package-facts.ts
  • src/shared/session-ledger.ts
  • src/shared/webhook.ts
  • test/features/admin/questions/listing-questions.test.ts
  • test/features/api/payment-processing/completion.test.ts
  • test/features/api/payment-processing/create.test.ts
  • test/features/api/payment-processing/create/answers.test.ts
  • test/features/api/payment-processing/index/balance.test.ts
  • test/features/api/payment-processing/index/booking.test.ts
  • test/features/api/payment-processing/index/helpers.ts
  • test/features/api/payment-processing/index/refunds.test.ts
  • test/features/api/payment-processing/items.test.ts
  • test/features/api/payment-processing/items/boundaries.test.ts
  • test/features/api/payment-processing/items/budget.test.ts
  • test/features/api/payment-processing/items/helpers.ts
  • test/features/api/payment-processing/package-pricing.test.ts
  • test/features/api/payment-processing/package-pricing/database.test.ts
  • test/features/api/payment-processing/recovery.test.ts
  • test/features/api/payment-processing/snapshot/build.test.ts
  • test/features/api/payment-processing/snapshot/io.test.ts
  • test/features/api/payment-processing/store-refund.test.ts
  • test/integration/email/config.test.ts
  • test/integration/email/registration.test.ts
  • test/integration/processed-payments/locking.test.ts
  • test/integration/questions-attendee-answers.test.ts
  • test/integration/server/api-packages.test.ts
  • test/integration/server/balance-payment-replay.test.ts
  • test/integration/server/payments/confirm.test.ts
  • test/integration/server/payments/replay.test.ts
  • test/integration/server/payments/success.test.ts
  • test/integration/server/reservation-edge-cases.test.ts
  • test/integration/server/webhooks/can-pay-more-multi-ticket.test.ts
  • test/integration/server/webhooks/concurrent-processing.test.ts
  • test/integration/server/webhooks/multi-ticket-refunds.test.ts
  • test/integration/server/webhooks/price-signature-package-overrides.test.ts
  • test/integration/server/webhooks/price-signature-post-commit-recovery.test.ts
  • test/integration/server/webhooks/price-signature-stored-refund-and-ignore.test.ts
  • test/integration/server/webhooks/refund-helper-functions.test.ts
  • test/integration/servicing/atomicity.test.ts
  • test/integration/webhook-price-signature-trusted-and-mismatch.test.ts
  • test/shared/checkout-pricing/consistency.test.ts
  • test/shared/db/attendees/api/create-rollback.test.ts
  • test/shared/db/attendees/balance.test.ts
  • test/shared/db/attendees/create.test.ts
  • test/shared/db/attendees/delete.test.ts
  • test/shared/db/listings/delete.test.ts
  • test/shared/db/modifier-resolve.test.ts
  • test/shared/db/processed-payments.test.ts
  • test/shared/db/processed-payments/finalize-guard.test.ts
  • test/shared/db/processed-payments/staleness.test.ts
  • test/shared/db/questions/attendee-answers/save/group-listings.test.ts
  • test/shared/db/questions/attendee-answers/save/stored-ids-behavior.test.ts
  • test/shared/db/questions/attendee-answers/save/stored-ids.test.ts
  • test/shared/registration-package-facts.test.ts
  • test/shared/session-ledger.test.ts
  • test/shared/webhook/budget.test.ts
  • test/shared/webhook/payload-fields.test.ts
  • test/shared/webhook/payload.test.ts
  • test/specs/steps/payment-capacity.ts
  • test/test-utils/db-poison.ts
  • test/test-utils/email.ts
  • test/test-utils/processed-payments.ts
  • test/test-utils/webhooks.ts
💤 Files with no reviewable changes (4)
  • src/shared/db/modifier-resolve.ts
  • src/shared/db/attendees/queries.ts
  • scripts/mutation/equivalent-mutants/shared-a-l.txt
  • test/shared/db/modifier-resolve.test.ts

Comment thread src/features/api/payment-processing/create.ts
Comment thread src/shared/db/processed-payments.ts Outdated
Comment thread src/shared/db/questions/attendee-answers/save.ts Outdated
Comment thread test/features/api/payment-processing/create.test.ts Outdated
Comment thread test/features/api/payment-processing/create/answers.test.ts
Comment thread test/shared/registration-package-facts.test.ts
Comment thread test/shared/webhook/budget.test.ts
Comment thread test/test-utils/db-poison.ts
Comment thread test/test-utils/db-poison.ts Outdated
Comment thread test/test-utils/processed-payments.ts
@stefan-burke

Copy link
Copy Markdown
Member Author

CodeRabbit did not return findings because its review was rate limited. All six Codex review threads were verified, fixed in a4400034f, replied to individually, and resolved.

@stefan-burke

Copy link
Copy Markdown
Member Author

CodeRabbit outside-diff note resolved in ae81264: the stale reservation test is now named claims a stale reservation in one database call, matching its actual behavior. The full precommit suite passes with 100% coverage.

@coderabbitai coderabbitai Bot left a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/shared/webhook/budget.test.ts (1)

148-177: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate required test values before use.

storedEntry! and payload.tickets[0]! hide an absent fixture or webhook ticket. Check both values explicitly so the test fails with a local, clear error.

Proposed fix
     const [storedEntry] = await packagedEntries("Supplied", 1);
+    if (!storedEntry) throw new Error("Expected one supplied package entry");
     const entry = {
-      ...storedEntry!,
-      listing: { ...storedEntry!.listing, name: "Supplied package" },
+      ...storedEntry,
+      listing: { ...storedEntry.listing, name: "Supplied package" },
     };
@@
     ).toBe(0);
     const payload = fetchSpy.firstBody();
-    expect(payload.tickets[0]!.listing_name).toBe("Supplied package");
-    expect(payload.tickets[0]!.unit_price).toBe(500);
+    const [ticket] = payload.tickets;
+    if (!ticket) throw new Error("Expected one webhook ticket");
+    expect(ticket.listing_name).toBe("Supplied package");
+    expect(ticket.unit_price).toBe(500);

As per coding guidelines, do not use unchecked non-null assertions for required data. Based on learnings, test fixtures should validate missing values locally.

🤖 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 `@test/shared/webhook/budget.test.ts` around lines 148 - 177, Update the test
around packagedEntries and fetchSpy.firstBody to validate storedEntry and
payload.tickets[0] explicitly before accessing their properties, replacing the
non-null assertions with local, clear failures while preserving the existing
assertions and webhook behavior.

Sources: Coding guidelines, Learnings

🤖 Prompt for all review comments with 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.

Outside diff comments:
In `@test/shared/webhook/budget.test.ts`:
- Around line 148-177: Update the test around packagedEntries and
fetchSpy.firstBody to validate storedEntry and payload.tickets[0] explicitly
before accessing their properties, replacing the non-null assertions with local,
clear failures while preserving the existing assertions and webhook behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0030f261-8e86-4fcf-a894-e660b5392682

📥 Commits

Reviewing files that changed from the base of the PR and between a440003 and ae81264.

📒 Files selected for processing (17)
  • src/features/api/payment-processing/create.ts
  • src/shared/db/processed-payments.ts
  • src/shared/db/questions/attendee-answers/save.ts
  • test/features/api/payment-processing/create.test.ts
  • test/features/api/payment-processing/create/answers.test.ts
  • test/features/api/payment-processing/index/balance.test.ts
  • test/features/api/payment-processing/index/booking.test.ts
  • test/features/api/payment-processing/index/helpers.ts
  • test/features/api/payment-processing/store-refund.test.ts
  • test/integration/processed-payments/locking.test.ts
  • test/integration/server/api-packages.test.ts
  • test/shared/db/processed-payments.test.ts
  • test/shared/db/questions/attendee-answers/save/stored-ids-behavior.test.ts
  • test/shared/registration-package-facts.test.ts
  • test/shared/webhook/budget.test.ts
  • test/test-utils/db-poison.ts
  • test/test-utils/processed-payments.ts

@stefan-burke stefan-burke left a comment

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.

All Codex and CodeRabbit findings have been addressed in a440003 and ae81264. Each inline thread has a specific resolution reply and is resolved; the outside-diff test-name finding is also answered. The branch passes the full precommit suite with 100% coverage.

Comment thread test/integration/server/api-packages.test.ts

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with 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.

Inline comments:
In `@AGENTS.md`:
- Around line 171-186: Resolve the contradiction in AGENTS.md by splitting its
guidance into linked topic files, or by explicitly exempting root instruction
files from the 400/1,000-line limits and documenting the rationale. Update the
file-size guidance so it consistently applies to the intended files, including
the current AGENTS.md structure, without leaving conflicting requirements.
- Around line 1059-1069: Remove the full-access DB_TOKEN output from the
migration flow in scripts/turso-migration-steps.ts, including any success or
failure recovery messages that print it. Update the AGENTS.md migration
instructions to direct operators to retrieve the token through a secure existing
path instead of stdout, while retaining the DB_URL and DB_ENCRYPTION_KEY
guidance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5966b37-1db4-421f-b0e5-4fad1abbed09

📥 Commits

Reviewing files that changed from the base of the PR and between ae81264 and bba8f4d.

📒 Files selected for processing (2)
  • AGENTS.md
  • src/features/api/payment-processing/snapshot/io.ts

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
@stefan-burke
stefan-burke added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 32a4257 Aug 7, 2026
3 checks passed
@stefan-burke
stefan-burke deleted the payment-aggregate/03-payment-processing-core branch August 7, 2026 11:30
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