Repository navigation
fix: harden automatic allowance payments - #1738
Conversation
09f07b7 to
4f8ae14
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f8ae14822
ℹ️ 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".
[Critical impact] The changes affect automatic Bitcoin payments and how their limits are tracked. Fix the lost payment checks, reconciliation order, failed-spend cleanup, and End race before merging. Findings
SummaryAdds wallet-backed checks before automatic allowance payments:
Four fixes remain: save failures can discard checks, reconciliation can run before the floor check, failed spends can survive recovery, and an End can race with handoff. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Covered request] --> B[Check saved ledger floor]
B --> C[Reconcile ledger]
C --> D[Check returned ledger]
D --> E[Check ended IDs and monthly spend]
E --> F[Reserve attempt]
F --> G[Save journal and local spend]
G --> H[Check ended IDs]
H --> I[Receive private messages]
I --> J[Begin execution and pay]
K[User ends allowance] --> L[Save ended ID]
L --> M[Send End through SDK]
N[Wallet backup] <--> O[Merge floor, spends, and ended IDs]
Reviews (1) · Last reviewed commit: "fix: harden automatic allowance payments" · Reviewed by Greptile |
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Reviewed the full PR diff against its merge base, at 3c09544.
2 actionable findings — resolve or provide an evidence-backed rebuttal.
A Send-sheet payment of a request this change keeps manual still reconciles the allowance ledger. When a floor is already stored and the SDK serves no ledger, that call attests an empty history. Recovery and automatic payment were changed to leave that ledger alone.
While the node cannot pay, the above-limit handoff still uses ledger and local spend totals only. A request the new floor will force onto the manual flow stays off the Send sheet until a channel is usable.
Comparison with bitkit-ios#1175 at dd478be covered the allowance floor, local spends, ended allowances, and manual ledger reporting. beginManualPayment and exceedsLimits follow the same split.
These open threads still match this revision: floor save still accepts the ledger, reconciliation uses a later read, failed spend kept when the journal row is already failed, and End during receive. Recovery now drops a failed spend whose journal entry was trimmed (thread); that part matches syncSettledJournal when the journal entry is absent.
Validation: inspected PaykitAllowanceExecutorTest.kt, PaykitAllowanceStoreTest.kt, and PaykitAllowanceStateBackupTest.kt at this revision. This review did not execute them. The missing-ledger test asserts that automatic payment does not reconcile; it does not call beginManualPayment. No GitHub issue matched these mechanisms. Device testing: not performed in this review.
Suggested additional test cases:
- Android unit test in
PaykitAllowanceExecutorTest. Setup: store a ledger revision floor and stuballowanceAccountingState()as null. Action: callbeginManualPaymentfor a bitcoin incoming request. Expected:reconcileAllowanceAccountingis not called. - Android unit test of the covered-request pass used when the node cannot pay. Setup: floor set, ledger missing or older, and the request amount within the ledger and local spend totals. Action: run that pass. Expected: the request is marked manual so it can be presented, including before a channel is usable.
Findings
- [HIGH] Manual send rewrites a ledger the floor refused — Trigger: the wallet has a ledger revision floor, and the SDK serves no ledger or an older one. Automatic payment returns manual, the request is presented on the Send sheet, and the user confirms the payment.
Mechanism: proceedWithPayment calls beginManualAllowancePayment, which calls beginManualPayment and reportManualPayment. That function always calls ensureReconciled before reserveManualPayment. ensureReconciled does not consult the floor. A null ledger uses an empty history and a null expectedRevision, and the reconciliation is submitted. An older ledger that requires reconciliation is repaired from that older snapshot. reserveManualPayment then records the attempt on the resulting state.
Consequence: this path would replace a ledger the wallet has already read with an empty or older history. Allowance spends that exist only in the discarded ledger stop constraining the monthly cap once the rewritten revision reaches the floor and automatic payment accepts it again. Local automaticSpends still cover only the spends this wallet stored itself.
Expected behavior: a request kept manual because the ledger is missing or behind should leave that ledger untouched, as recovery does. The Send sheet can still pay. The allowance report should wait until a ledger at or above the floor is served. A failed report already lets the send continue.
Evidence basis: source analysis at 3c09544e3f37a65efb67c6c92e909f9fbf7f8087. a missing ledger after one was read keeps the request manual asserts that automatic payment performs no reconciliation. It does not call beginManualPayment. This review did not execute that test or a device. The same unguarded ensureReconciled call is present in bitkit-ios beginManualPayment at dd478be41ea60887baf613777cb87b7a930a1944.
Source. Summary placement: The write is ensureReconciled in reportManualPayment, which this PR does not modify. The new manual result is what reaches it after the floor refuses the ledger.
- [MEDIUM] Channel wait ignores the ledger floor — inline at
app/src/main/java/to/bitkit/repositories/PaykitAllowanceExecutor.kt:403.
Reviewer model: grok-4.7
Reasoning effort: high
|
@piotr-iohk Addressed in 3c09544: both findings from your QA review at 3c09544 are fixed on this PR's current head:
The iOS twin, synonymdev/bitkit-ios#1175, has both fixes (0e18333a, e503eb7f). |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Follow-up of e93e25509 since 3c09544e, on merge base c080139b. Inherited baseline review 5713748206 for allowance backup restore merge and the shared wire format. This pass covered the descendant delta: durable floor saves, reconciliation before any ledger write, failed-spend removal, the pre-handoff end check, above-limit handoff, manual reporting, and the new executor tests.
No new actionable code findings.
Reconciliation throws LedgerBehind before reconcileAllowanceAccounting when the served ledger is older than the floor, missing after a floor was saved, or the floor cannot be saved. Automatic payment and recovery stop there. Manual reporting stops as well and returns no attempt id, so the Send sheet still sends; that matches the existing unreported-ledger contract and bitkit-ios e503eb7f. While the node cannot pay, that behind ledger is handed back without Limit Reached. Recovery removes local spends for attempts the ledger has failed, including after the journal entry is gone. The private-message fetch runs before the ended-allowance check, the same order as iOS.
Validation: PaykitAllowanceExecutorTest was inspected at e93e255, including the unsaved-floor and behind-ledger cases, and was not executed in this review. Device testing: not performed. A journey cannot produce a ledger older than one this wallet has already read.
Suggested additional test cases:
- Android unit test in
PaykitAllowanceExecutorTest: setledgerRevisionFloorto 5 and the accounting ledger revision to 4, then callbeginManualPaymentfor an incoming bitcoin request. Expected: null attempt id, noreconcileAllowanceAccounting, and noreserveManualPayment.
Earlier findings reconciled at this revision: 2 verified fixed.
Reviewer model: grok-4.7
Reasoning effort: high
|
@piotr-iohk Addressed in b431971: thanks, added your suggested case on both apps (b431971 here, d9265ab4 on synonymdev/bitkit-ios#1175): with a floor of 5 and a ledger at revision 4, |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Re-reviewed the full PR at b431971 after the merge base changed and no prior coverage baseline was available. The comparison base and merge base are fdc1012.
No new actionable code findings.
Automatic payment, recovery, and manual reporting stop before writing a ledger that is missing or older than the stored revision floor. A manual send still proceeds, with no allowance attempt id. While the node cannot pay, that ledger returns the request immediately and does not raise Limit Reached. The monthly check uses the higher of ledger usage and this wallet's own spends, a failed attempt stops counting after its journal row is gone, and an End saved during the private-message fetch stops the handoff. Restore keeps the higher floor and every stored spend and ended allowance. The same checks are on bitkit-ios#1175 at d9265ab.
The findings from the review at 3c09544 do not match this head. PaykitAllowanceExecutorTest.kt, PaykitAllowanceStoreTest.kt, and PaykitAllowanceStateBackupTest.kt were inspected, including the behind-ledger manual-payment case, and were not executed. Device testing: not performed. A journey cannot serve a ledger older than one this wallet has already read.
Reviewer model: grok-4.7
Reasoning effort: high
Addressed in c671bd5b and 8d9c93e; threads resolved. Dismissing so the fix can be re-reviewed on the current head.
jvsena42
left a comment
There was a problem hiding this comment.
Re-reviewed to 8dc7f7f. My MEDIUM is fixed, and no HIGH or MEDIUM is left. Approving with one LOW open (Resume skips the payment PIN). Fix it here or move it to a follow-up issue, your choice; please reply on the thread with which, and the issue link if it is a follow-up.
Checked, reviewed as a funds change:
- The MEDIUM. A backup without Paykit state restores with
ledgerRevisionFloor = null(BackupRepo.kt:1104-1110) and keeps the spends and ended ids. My regression test was added along with the positive case. - Resume pays nothing by itself.
acceptCurrentLedgeronly moves the floor.automaticSpends,endedAllowanceIds, the journal andautoPaidRequestIdsare untouched, and requests already handed to the Send sheet stay manual. - Cap.
fitsnow unions ledger attempts and local spends byattemptId, with the ledger winning on a shared id. Every spend this wallet admitted still counts after Resume, so one install cannot exceed the limit. - Double payment.
hasPaidchecksautoPaidRequestIdsand any non-FAILED journal entry, so a rolled-back ledger cannot re-pay a request this wallet paid. - Restart and restore. Spends are written with the journal entry before the handoff and removed only on FAILED.
withChecksFromunions them and keeps the higher floor. loadAllnow throws. An unreadable store blocks saves instead of wiping every identity's journal: a durable floor save fails, so auto-pay stays manual. The stored format only gained optional fields since v3.0.0, so upgrades read fine.- The merge
88b18f7has an empty remerge-diff.
Performance: refresh() adds one allowanceAccountingState() SDK read per refresh. That is not a user wait.
subscriptions__allowances_paused_* strings could not be checked on screen for the same reason.
Skipped — covered by CI at 8dc7f7f: unit tests, lint, detekt, e2e.
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: Full reassessment of 2e3af6943 against 1337f121 because the comparison base changed; no coverage was inherited. Covered the complete PR diff, payment/recovery callers, persistence and restore, Resume UI, and tests. Comparison with iOS c8830f12 was limited to these allowance contracts and shared backup format, not a full iOS review.
1 actionable finding — resolve or provide an evidence-backed rebuttal.
The earlier End/handoff synchronization concern is not fully cleared: the check now follows message receipt, but a suspending trusted-time save and SDK-lock acquisition still separate it from handoff. This existing concern is not reported again as a new finding.
Validation: CI build and unit-test logs passed on merge 47d60dd, containing the exact reviewed head/base. The added Resume test calls onAuthorized() directly and does not render the tab. Local focused unit tests could not execute because the Android SDK is absent. SDK contracts were inspected at Paykit 01de5dd, the pinned 0.1.1-rc2 dependency.
Suggested additional test cases:
- Android Compose: provide an active allowance and paused state with PIN-for-payments enabled; tap Resume, assert the PIN screen appears, cancel and verify the floor is unchanged, then retry and authorize successfully. No allowance sheet should need to be opened first.
- Android executor unit test: suspend between the final ended-ID check and SDK handoff, durably record End, then continue; assert no Lightning payment is submitted.
Device testing: not performed in this review.
Findings
- [MEDIUM] Render payment authorization for Resume on the Allowances tab — inline at
app/src/main/java/to/bitkit/ui/screens/subscriptions/AllowancesViewModel.kt:164.
Reviewer model: gpt-6-astra
Reasoning effort: high
|
Pushed e479852: the Allowances tab now shows the payment PIN or biometric check when Resume needs one. Before this, Resume set a pending check that only the allowance sheet could draw, so on the tab it never resumed.
This answers #1738 (comment). |
There was a problem hiding this comment.
QA review
Scope: follow-up at e479852, covering the entire delta since 2e3af69 and affected authorization paths. Unchanged accounting, recovery, persistence and coverage surfaces are inherited from the completed baseline; ancestry and the unchanged base/merge base were verified locally.
Code review completed with unverified earlier concerns.
Compared Resume authorization with iOS c8830f1, limited to the affected contract, without a full iOS review.
Validation: inspected the new Compose PIN-success and Back/retry tests and affected ViewModel assertions. The focused JVM test command stopped before executing tests because no Android SDK was configured. Pinned-head CI unit tests were still running at the final check.
Suggested additional test cases
- Android/Robolectric: with a paused allowance and payment PIN enabled, open Resume, remove the authorization host from composition, then recreate it with the same ViewModel. Assert no resume call occurred, the pending authorization cleared, and a fresh Resume tap asks for the PIN again.
Device testing: not performed in this review.
Earlier findings reconciled at this revision: 1 still present, 5 verified fixed, 1 could not be verified.
Reconciliation incomplete: the following earlier concerns remain unverified. This report does not establish that they are fixed or invalid, or establish approval or device readiness.
Could not verify earlier concern — Preserve observed ended IDs when their local save fails: The refresh-time save remains best-effort, so the floor fix does not remove this portion of the report. However, the SDK independently derives terminal allowance lifecycle and rejects it at handoff. Losing a local tombstone alone therefore does not establish an unauthorized payment. I could not establish the supported lifecycle-rollback transition needed to bypass that protection, and no failure/rollback test was executed. This remains unresolved; neither a complete fix nor a current payment bypass is claimed.
Existing concerns
- [HIGH] Synchronize the saved End with automatic-payment handoff — the original thread is marked resolved, but the fix appears incomplete. The check now follows message receipt, yet a suspending trusted-time save and SDK-lock acquisition still separate it from handoff. Coordinate the final check and handoff with rememberEnding, and add a regression test that saves End during that gap and verifies no payment is submitted.
Reviewer model: gpt-6-astra
Reasoning effort: high
|
Pushed 4b078e4: an End and an automatic payment's handoff can no longer interleave.
This answers #1738 (review) and #1738 (comment). |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: follow-up. Re-reviewed the changes since e479852, including affected code paths, at 4b078e4. The merge base 1337f12 is unchanged. Coverage of the rest of the PR is inherited from the baseline review. I also took an inventory of the current 35-file PR diff.
No new actionable code findings.
The delta is a single commit, an end saved during a payment handoff waits for it. It adds a handoffMutex. An automatic payment holds it from its ended-allowance check through beginPaymentExecution. PaykitAllowanceRepo.end holds it from the durable End save through the SDK endAllowance calls. I traced the lock order and every caller. Both paths take handoff, then state, then the SDK operation lock. The new lock has no other users, and nothing that already holds the SDK operation lock (wallet wipe, the automatic-acceptance admit callback) or stateMutex tries to take it, so I found no deadlock path. The early MANUAL return inside withLock releases the lock. An End saved before the handoff still fails the attempt and releases its reservation. An End that arrives during the handoff is saved and sent only after it, and the handed-off payment continues as the code comment says it should. Queued End messages are now flushed only after all of the entry's SDK Ends succeed. If one fails partway, the background outbound processor (PaykitPaymentRequestRepo) still sends what was queued, so I don't count this as a defect. The new Compose test, leaving the screen drops a pending pin check, matches the DisposableEffect cancellation in AllowanceAuthorizationHost.
Parity: the iOS twin synonymdev/bitkit-ios#1175 at 7d699c7 has the same structure: handoffLock in PaykitAllowanceExecutor.rememberEnding and the handoff, and Ends sent inside the lock with the outbound flush after it in PaykitAllowanceManager.end.
Validation: tests were not run locally because this workspace has no Android SDK or Gradle cache. CI ./gradlew testDevDebugUnitTest passed on the pull_request build for this head, and that build includes the new executor and screen tests. Device testing: not performed in this review.
Suggested additional test cases:
- Android, two wallets with an accepted allowance (this wallet pays) and a contact that sends repeated payment requests. Tap End on the allowance just as a covered request is being paid automatically. Expected: the End completes after the payment hands off. At most that one in-flight payment is paid automatically. Later requests from the contact are shown for manual payment, and the allowance shows as Ended on both wallets.
Earlier findings reconciled at this revision: 7 verified fixed, 1 not substantiated.
Reviewer model: claude-opus-5-5
Reasoning effort: high
jvsena42
left a comment
There was a problem hiding this comment.
Re-approving at 4b078e4 with one LOW open, inline. Fix it here or in a follow-up issue, your call; please reply on the thread with which.
- My LOW is fixed:
AllowancesViewModel.kt:164now usesauthorizeThen(isGated = true), and the PIN check is drawn for the whole Subscriptions screen throughAllowanceAuthorizationHost.- Resume is the only path to
acceptCurrentLedger. - Cancel and Back keep the pause, and leaving the screen drops a pending check (
AllowancesScreenTest).
- Resume is the only path to
- "An end saved during a payment handoff waits for it": one mutex covers the ended-id check through
beginPaymentExecution, and the durable End save through the SDKendAllowancecalls.- The outbound flush runs outside the lock, and the lock order is handoff → state → SDK lock. Nothing that holds the SDK lock takes the handoff lock.
- Crash recovery never re-runs a handed-off attempt.
perf: not relevant.
|
Pushed 598290d: the PIN check over the Subscriptions screen and the allowance sheet now blocks taps, so nothing beneath it can be opened while it shows, matching the app's other full-screen PIN checks. It answers @jvsena42's review comment. |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: follow-up. Re-reviewed the changes since 4b078e4, including affected code paths and earlier findings, at 598290d. The merge base 1337f12 is unchanged, and 4b078e4 is an ancestor of the new head. Coverage of the rest of the PR, including End/handoff serialization, accounting, recovery, persistence and restore, comes from the baseline review. The current PR still touches the same 35 files.
No new actionable code findings.
No new actionable code findings in the follow-up.
The delta is one commit, pin check keeps taps off the screen beneath. It adds blockPointerInputPassthrough() to the AllowanceAuthorizationOverlay box. That box fills its parent and is drawn above the content. Compose sends a touch only to the topmost sibling under it, so the overlay's pointerInput now receives taps that used to reach whatever was beneath. The overlay does not consume these events. The PIN keypad, its back button and the biometric view are children of the overlay, so they still get touches first. BackHandler still cancels. This is the same pattern AuthCheckView and the wallet screens already use.
The fix covers both places the overlay is used:
AllowanceAuthorizationHostwraps the whole Subscriptions screen, so allowance rows, the Add button, the tabs and the header are blocked.- In
AllowanceSheet, the Review, Details/End and Set content beneath the overlay is blocked as well.
This resolves the pass-through thread only in the sense that the reported mechanism no longer holds at this head; that thread is already marked resolved. The behaviour now matches bitkit-ios#1175 at 7d699c7, where PaymentAuthorizationModifier shows the PIN screen as a modal sheet. That comparison covered only this contract; it was not a full iOS review.
Validation: I read the new Robolectric case in AllowancesScreenTest. At w360dp-h800dp it taps an allowance row lying under the empty part of the PIN check, then asserts that no allowance click happened and the PIN check is still shown. That test exercises only the screen host, not the sheet. CI testDevDebugUnitTest passed in the pull_request run for this head. I did not run tests locally because no Android SDK is configured here.
Device testing: not performed in this review.
Suggested additional test cases
- Android, Allowances sheet: turn on PIN with "Also require for payments". Open an allowance you fund, choose Details, and swipe End so the PIN check opens inside the sheet. Tap the empty area of the overlay where the End control and the allowance details sit. Expected: nothing beneath reacts and the PIN check stays. Then enter the PIN. Expected: the End completes once.
- Android, TalkBack: with payments paused and the payment PIN on, tap Resume on the Allowances tab so the PIN check opens. Swipe through the elements with TalkBack. Expected: focus does not reach the allowance rows, the Add button or the tabs beneath the overlay, and a double-tap cannot open an allowance sheet behind the PIN check.
Reviewer model: claude-opus-5-5
Reasoning effort: high
QA: Resume with the payment PINThis is the device case @piotr-iohk suggested in the QA review. It ran on 598290d, on an Android emulator against staging regtest, with an Active allowance to an iOS contact. The paused state needs allowance records older than ones the wallet has already used, which staging cannot serve. A local debug-only hook (not in this PR) raised the wallet's floor once. Everything after it ran this PR's code. ✅ Resume asks for the PIN, a cancel keeps payments paused, and an authorized Resume clears the notice
Not on device: that the wallet's own spends and ended allowances still keep covered requests manual after Resume. That part needs funded automatic payments; the |
piotr-iohk
left a comment
There was a problem hiding this comment.
Approving at 598290df2f4c578a7ac1f832558038d045cac916 based on the current code review, automated coverage, and the focused device results below. The four remaining device gaps are accepted for this approval; they remain unverified, and this is not a complete device-gate pass.
Tested on 2026-11-02 using the existing Pixel 6 emulator (Android API 33), to.bitkit.dev, and local regtest services. Installed CI local E2E build 6512, checkout a577ac8553b1c6dedd0c48e1f6d7b8f44f3f664b: app source matches this PR head; the only additional differences are the FCM tester package/lock files. A distinct funded iOS simulator wallet was the payment peer, not an iOS PR test target.
Passed:
- Set/End PIN overlays: blank-area taps did not authorize changes; taps over hidden limit controls left $5/$10 unchanged. Cancellation preserved the allowance, retry worked, and the correct PIN completed End.
- One incorrect PIN was rejected. After background/foreground, app unlock did not also authorize End: the allowance PIN was still required separately.
- One 2,500-sat Lightning-capable request paid automatically, appeared once as Auto-paid, counted $1.95 against the allowance, and was received by the peer for the matching amount.
- After End, a new 1,000-sat Lightning-capable request required Swipe To Pay and remained unpaid.
Remaining device gaps:
- TalkBack focus isolation on the Resume PIN overlay. The paused state was not staged; an End-overlay probe enabled TalkBack, but injected input did not reliably advance accessibility focus.
- Resume with a stale ledger missing locally retained spending, followed by a request exceeding the remaining monthly budget.
- Resume with a stale ledger after an allowance was remembered as ended, verifying that it cannot auto-pay again.
- End during a controlled in-flight automatic-payment handoff, verifying at most the already handed-off payment completes and later requests stay manual.
The stale-ledger fixture could not be established through the available keystore/runtime access, and no controlled handoff window was produced. Unit coverage and the reviewed locking/accounting protections support approval, but ordinary payment/End success does not replace these combined device scenarios. No confirmed new product defect was found. Focused run: three planned cases passed, four blocked by test setup/control limitations.
An initial request accidentally excluded Lightning and correctly stayed manual; the corrected request above retained Lightning and passed. Temporary PIN/TalkBack settings were restored, both test-created allowances were ended, and unpaid test requests were dismissed. Wallets were preserved. Recordings, screenshots and diagnostic evidence were retained locally.
|
Merging: approved by @piotr-iohk on the current head, device run of the Resume PIN case passed on this head (#1738 (comment)), no open threads, CI green. Ships in 3.1.0 with its twin synonymdev/bitkit-ios#1175. |


Twin: synonymdev/bitkit-ios#1175
Automatic allowance payments now also check state the wallet keeps itself, and backs up with the wallet, before they pay.
Description
ledgerRevisionFloor,automaticSpends,endedAllowanceIds; the same wire format as fix: harden automatic allowance payments bitkit-ios#1175). Restore merges them with any already stored: the higher floor, every spend and every ended allowance, so a restore never weakens them, and the restored wallet applies the same checks. A backup taken without Paykit SDK state restores without the floor, since the floor only holds next to the ledger it was read from.Out of Scope
None.
Design
N/A — no design available.
Preview
Allowances tab with automatic payments paused, Resume tapped, and the notice gone (Android emulator, regtest):
android-resume-2x.mp4
QA Notes
Setup
N/A — no device testing required: the checks change behaviour only when the allowance ledger read back is older than one the wallet already read, which no journey can produce. Existing allowance journeys cover the unchanged paths.
Journeys
N/A — the paused notice appears only when the allowance ledger read back is older than one the wallet already read, which no journey can produce; unit tests cover it.
Manual Tests
N/A
Automated Checks
PaykitAllowanceExecutorTest.kt— a floor that cannot be saved keeps the request manual; while the node cannot pay, a ledger behind the wallet hands the request back without Limit Reached; a ledger below the floor, one that drops below it during admission, or one missing after one was read keeps the request manual; an automatic payment raises the floor; local spending above the ledger's keeps the request manual; a spend counts until its attempt fails; an allowance seen ended never pays automatically; recovery drops the spend of a failed attempt the journal no longer holds; spending the ledger lacks adds to the ledger's own; a request this wallet already paid stays manual; recovery keeps a sent attempt the ledger still holds as prepared; resuming takes the ledger read now while the wallet's own spending still counts; an End started during a handoff reaches the SDK after itBackupRepoTest.kt— a wallet restore without Paykit SDK state drops the floor and keeps the spends and ended allowances; one with SDK state keeps the floorPaykitAllowanceStoreTest.kt— restore never lowers the floor and keeps every spend and ended allowance already stored; a save never replaces state this build cannot readPaykitAllowanceTest.kt— capacity counts the ledger's and the wallet's payments together, each oncePaykitAllowanceStateBackupTest.kt— the golden wire format carries the floor, the spends and the ended allowancesAllowancesViewModelTest.kt— resuming automatic payments asks for the PIN first when payments require itAllowancesScreenTest.kt— tapping Resume on the Allowances tab shows the PIN check and resumes once it passes; back leaves payments paused; leaving the screen drops a pending PIN check; a tap on the PIN check never reaches the screen beneath itEvidence
just compile,just testandjust lintpass on this head.Gaps
Models used
claude-opus-5-5(reasoning:medium)claude-opus-5-5(reasoning:medium)claude-sonnet-5-5(reasoning:Not exposed)The review subagent's reasoning setting is not in the session metadata.