Repository navigation
feat(dashspend): piggycards provider picker - #1414
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
HashEngineering
left a comment
There was a problem hiding this comment.
one item to look at, otherwise good.
| } | ||
| } | ||
| ).addMigrations(ExploreDatabaseMigrations.migration1To2, ExploreDatabaseMigrations.migration2To3) | ||
| ).addMigrations(ExploreDatabaseMigrations.migration1To2, ExploreDatabaseMigrations.migration2To3)//, ExploreDatabaseMigrations.migration3To4, ExploreDatabaseMigrations.migration4To5) |
There was a problem hiding this comment.
a line is commented here.
Do we need a dummy migration for v3 to v4?
There was a problem hiding this comment.
During my testing, I found that the dummy 3-4 migration wasn't necessary. But it might be better to have to for consistency and to avoid any potential issues.
…ject map) (#1637) * chore(claude): /pre-review skill and an opt-in push gate (#1634) * chore(claude): /pre-review skill and an opt-in push gate thepastaclaw re-reviews the whole PR range on every pushed commit and approves only at zero findings, so each push with a finding we could have seen costs a round. The skill runs the bot's own model (GPT-6.1 Sol via the Codex CLI) with its public review prompts, fetched at run time from a pinned commit, over merge_base..HEAD; Claude then verifies each finding against the code and fixes the whole class of it. Verdicts are cached per commit in ~/.cache/prereview and count only for a range that covers the commit's merge base with the PR's base. The push gate is off unless a clone turns it on (prereview.sh --install, a pre-push hook copied into .git/hooks), so nobody needs the Codex CLI unless they opt in. From a terminal the hook runs a missing review; from a non-interactive shell it refuses and says to run /pre-review first. test_prereview.sh covers the gate with a fake codex. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(pre-review): how to give Codex access to ChatGPT The script only checks that Codex has a login; nothing said how to make one. README.md (and the script's header and error messages) now name the two ways: `codex login` with a ChatGPT plan (--device-auth without a browser), or an OpenAI API key in OPENAI_API_KEY (or stored with `codex login --with-api-key`), with the one-line check, the CLI version the model needs, and where a key must never go. The skill tells Claude never to ask for the key in the chat. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): no pinned prompts, no verdict; tests clean up and ignore the caller's env - With the pinned review prompts unreachable, the review used to fall back to this repository's guidance and cache a zero-count answer as clean, which the gate then trusted. A review by other rules must not stand in for the bot's: it now ends "not reviewed" (found by the skill's own pre-review of this change). - From CodeRabbit's review: every test run left its temporary repositories behind, and an inherited OPENAI_API_KEY (or PREREVIEW_BASE / PREREVIEW_TIMEOUT) changed what the cases test — with a key set, the logged-out case passed for the wrong reason. An EXIT trap removes the run's folder, and the variables are unset before the cases run. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): a verdict is for exactly its range; the API key codex exec reads From thepastaclaw's review of this PR: - A cached verdict was accepted when its base was any ancestor of the current merge base. That is not the same diff: a branch that undoes a change the base made after the reviewed base shows the undo in the current range and not in the reviewed one. The recorded base must now equal the current merge base; a base that moved means a new review. Regression test: master advances to the branch's first commit, the same tip goes stale, master back, clean again. - codex exec (0.163) reads an API key from CODEX_API_KEY; OPENAI_API_KEY alone is ignored, so the documented environment-only setup passed the check and then failed in Codex. The check accepts CODEX_API_KEY, copies OPENAI_API_KEY into it, and the docs name CODEX_API_KEY. - --status exits 0 when HEAD has no report; a blank line before the new CLAUDE.md heading. From this change's own pre-review (the skill, on itself, three rounds at effort high): - the hook and --status checked the merge base against the local copy of the base, so a base that moved on origin since the last fetch did not make a verdict stale: the base is fetched first, into its remote-tracking ref (a single-branch clone's plain fetch updates only FETCH_HEAD), and a fetch that fails refuses the push (the range is unknown) — unless the push only deletes; - GIT_DIR / GIT_WORK_TREE, which git exports to its hooks, reached the review's worktree and would have made git there resolve the checkout's HEAD: cleared at the top, as githooks(5) says; - a signal to the script did not reach the review it had started: the lock holder ran on and could publish a verdict after the cancellation. INT/TERM/HUP are forwarded to it, and it runs codex in the background so its trap fires at once, stops codex and cleans up; - the test harness went on after a failed cd and would have made its fixture commits in the caller's checkout: setup steps now abort the run; - the docs said the bot re-reviews the whole range on every push; its pinned policy reviews the whole range once and later pushes against the findings it carries forward. The whole-range pass here is this skill's choice, said so. - The review runs at reasoning effort high (PREREVIEW_EFFORT), the bot's own setting for this model; codex exec's default is lower, which is one reason it missed these. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(pre-review): the model's commands never see the reviewer's credentials From thepastaclaw's second review (security-auditor): codex's default shell_environment_policy hands the whole environment to every command the model runs, so a branch under review could make the reviewer run `printenv CODEX_API_KEY` and put the key in its answer, which this script prints and keeps. And its read-only sandbox lets those commands read the whole disk, ~/.codex/auth.json included, so a stored login was exposed the same way. Both confirmed on codex 0.163 with canary values: visible by default, gone with the changes below. The commands the model runs now get an explicit environment allowlist (include_only, applied last, so a `set` entry in the user's own codex config cannot bring a credential back), git pointed at an empty global config (the user's may carry a PAT in a url.insteadOf or an extraheader), a scratch folder of the review's own as TMPDIR (not the shared temp dirs, where another review keeps its files), and a permission profile instead of -s read-only (the two do not compose; a sandbox_mode in the user's config is fine — the session's default_permissions wins, checked): they may read the review's own --shared clone of the commit (not a linked worktree: codex resolves a linked worktree's project trust through the main checkout, and a trusted one would load the reviewed tree's .codex/config.toml), the object stores it borrows (alternates, recursively — a --shared or --reference checkout needs them), the pinned prompts and the minimal system paths. Codex's ways out of the sandbox are switched off and read back: the user's MCP servers by name with a complete entry (`-c mcp_servers={}` merges instead of clearing, and a partial `.enabled=false` for a server the desktop app provides breaks codex's config load), the implicit Apps connector, browser and computer use and web search through `features.*` and `web_search`. A copy of the login in a private CODEX_HOME is not the way either: codex rotates refresh tokens, and a copy left behind by a cancelled review would break the user's login. The clone carries the base as origin has it (its origin/<base> would be the checkout's stale local branch), and a verdict records that base tip: a base that moved on, even without changing the merge base, was never checked against the branch, so the verdict goes stale. codex older than 0.163.0 (no permission profiles) or a capability that does not read back as off make the review refuse. A failed removal of an earlier verdict is no longer ignored: removed, or emptied, or the review refuses and says the gate still trusts it. The prompt asks for a static review — the first real pass ran the test suite in the sandbox until the 25-minute cap. The report is scrubbed of the key's value, README prefers `codex login --with-api-key` over an environment variable, and --install and --uninstall refuse under a shared core.hooksPath: the gate is per clone. From CodeRabbit: "for every pushed commit" read as a review per commit; one review of merge_base..tip covers the commits in between. Reworded in SKILL.md, README.md and the header. From this change's own pre-review: - the lock's descriptor was inherited by every child that can outlive a cancelled review (git fetch and clone, curl, codex and its probes), so a stray one kept the commit locked after the cancellation: they all start without it, in the background with a wait so a signal reaches the trap at once even while a fetch or a probe stalls (probes write to files, never `$(…)`: a foreground subshell defers the trap), and cleanup and cancellation traps are set from the first step; tests cancel during a stalled fetch, a stalled probe, and with a timeout that does not kill the group; - the test harness inherited the caller's git configuration and git's environment overrides: with a global or GIT_CONFIG_COUNT-supplied core.hooksPath its --install and --uninstall would have written to, and deleted from, the caller's real hooks folder, and a GIT_INDEX_FILE would have taken the fixture's `git add`. All of it cleared for the run; - a push of several refs: a ref accepted against the base as fetched, then the next ref's own review fetches a base that moved meanwhile — every tip is checked once more at the end (the test calls the hook directly: git puts its exec path first in a hook's PATH, so a wrapper never reaches it); the cleanup tests look at the review's folder itself, not `git worktree list`; - the review tree was cloned and checked out with the user's git config in force: a relative core.hooksPath (.githooks) resolves inside the clone, and the reviewed commit's own post-checkout hook would have run there, outside every restriction — hooks are off while the tree is made; - a cancelled automatic review inside the hook let the loop start the next ref's review: the hook stops on it; an empty `codex --version` skipped the version guard: refused. The skill reviewed this change nine times. Each round found a real but smaller hole in the previous fix, which is the pattern the tool exists for, seen from the other side — so SKILL.md now says: at most two rounds per push, then push and let the bot judge. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(pre-review): check for the Codex CLI before probing it; scope the test's pkill to its own hook From CodeRabbit: the version probe ran before the existence check, so a missing CLI ended in "gave no version" and the install guidance was unreachable — the check comes first now; and the cancellation test's pkill matched any "hooks/pre-push origin" on the machine, a real push's hook in another clone included — it matches this run's hook path only. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(pre-review): escape the hook path before pkill -f (CodeRabbit) Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(pre-review): no execpolicy rules or user config for the review; MCP roster read from the clone From thepastaclaw's third review: - the user's execpolicy allow rules (~/.codex/rules) could let a matching command run outside the sandbox, and the user's config.toml came along: codex exec runs with --ignore-rules and --ignore-user-config (the login still loads), and ~/.codex is an explicit deny in the profile — an allow rule for `cat` did not reach a canary file on 0.163 in a test, the flags are defence in depth; - MCP discovery and verification ran in the source checkout while exec runs in the review clone — different configuration contexts (a trusted checkout's own .codex/config.toml could mask a global server): both probes now run from the clone (-C); - the hook fetches the base once more before its final recheck, so a base that moved during a minutes-long review is seen. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(pre-review): the rules of the loop — PR scope, 2–3 local rounds, blocking/major only, push back Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(pre-review): checkout under no user git config; probes and exec from inside the clone; keep config.toml From thepastaclaw's fourth review: - the review tree was checked out with the user's global/system git config in force, so a filter.<name>.smudge registered there ran for paths the reviewed commit's .gitattributes selects — the commit's code, outside every restriction: clone and checkout run with GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1 and no environment-supplied config (hooks stay off); a test registers such a filter and checks it stays quiet; - codex's -C does not move `mcp list`'s configuration context, so the probes still read the caller's checkout: the probes and exec now run with their working directory inside the review clone; - --ignore-user-config dropped a keyring-backed login (cli_auth_credentials_store): removed rather than carrying the store setting over. What config.toml could open is switched off and read back in the same context — MCP servers by name, apps/browser/computer use/web search — and --ignore-rules keeps the execpolicy allow rules out. Also the four rules of the loop in SKILL.md: only the PR's own code, two local rounds per push, locally blocking/major only, push back when a finding is out of scope or immaterial. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): MCP servers disabled in their own transport; lifecycle hooks off; the tool's scope written down From thepastaclaw's fifth review: - the disable entry `{ command = "/bin/sh", enabled = false }` merged with an HTTP server's `url`, and codex refused the configuration ("url is not supported for stdio") — the review could not start for anyone with an HTTP MCP server. The entry now follows the server's transport (`url` for http), checked on codex 0.163; the fake codex models the rejection; - codex lifecycle hooks from the user's trusted config ran outside the sandbox in the review clone: features.hooks=false, read back with the other capabilities. And the scope, in README and SKILL.md: the review is for our own branches before push — code the developer already builds and runs. It is not a sandbox for a hostile branch; the isolation it does apply is defence in depth. Findings of the class "a branch written to attack the reviewer escapes the review's isolation" are answered with this scope rather than with another isolation layer; a defect that breaks the review for an ordinary user is fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): TOML-escape paths in the codex configuration; python3 checked and documented From thepastaclaw's sixth review (no blocking findings left; two suggestions): - paths (CODEX_HOME, the review's temp folders, the prompt cache, alternate object stores) went into the permission profile and the env `set` as raw TOML strings, so a quote or backslash in one made the configuration invalid: each is encoded with JSON string escapes, valid in TOML basic strings; a test reviews with a TMPDIR holding both and parses the result back with tomllib; - python3 does the verdict lookup, the lock, the JSON work: the script checks for it first and says so, and README lists it with git. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): any MCP server name codex accepts; literal UTF-8 in TOML paths; tomllib optional in tests From thepastaclaw's seventh review, the narrowest fix for each: - the name filter ^[A-Za-z0-9_-]+$ refused valid names (docs.internal, npm:@scope/x), so the review never started for those users: the filter is gone, and the servers are switched off in one `mcp_servers={ "<name>" = {…}, … }` table with quoted keys — codex splits a dotted -c path on every dot, so the per-server form could not address them. Checked on codex 0.163; - json.dumps escaped non-BMP characters as UTF-16 surrogates, which TOML rejects: ensure_ascii=False; the path round-trip test now has an emoji in it; - that test needs tomllib (3.11+) while the script needs 3.8: it is skipped on an older python3, and README says so. Also rule 5 in SKILL.md: fix a bot's suggestion only when it is a line or two of the existing code — two of these three came from the previous round's suggestion fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(pre-review): unset the fake codex's controls before the cases run From thepastaclaw's eighth review (no blocking findings; one suggestion, a one-line fix): FAKE_* variables inherited from the caller could steer unrelated cases. Checked by running the suite with FAKE_LOGIN_RC=1, FAKE_FEAT_STUBBORN=1 and FAKE_LAST set in the caller's environment: all pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: andreika-baranouski <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * docs: code knowledge for the v12 line, from 722 review threads and a read of the code thepastaclaw and coderabbitai keep finding the same classes of defect on v12 PRs: an unreadable value treated as zero or absent, a fix that opens the next interleaving, an intent written after the act it protects. Each was rediscovered PR by PR, often over 20+ rounds. This writes them down once. docs/code-knowledge/ holds: - rules by area: fail-closed reads, concurrency, durability, money/SDK/Platform, lifecycle, security, testing, style, and working with the review bots. Each rule names the PRs it came from. - a pre-push checklist. - a project map of the v12 code: modules, flavors, cutover, sends, identities, shielded, persistence, tests/CI, gotchas. The sources are all bot threads on the 87 PRs into feat/kotlin-sdk-phase-1 (#1414-#1632), with the author replies and how each thread was resolved, plus an independent read of the tree at 421514a. CLAUDE.md links the new folder. It also corrects three stale facts: ViewBinding, not Data Binding; Gradle 8.13; and the Kotlin SDK owns L1 after the cutover. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(code-knowledge): correct the Compose palette, parseCoin rounding and CI test-coverage notes pre-review found three inaccuracies in the new docs: - MyTheme.Colors is the fixed light palette, so Compose code must read LocalDashColors.current; - Coin.parseCoin's fallback rounds to 8 significant digits, not to 8 decimals; - CI's testDebugUnitTest skips the flavoured wallet unit tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): a stale or missing verdict after a review exits non-zero prereview.sh returned 0 unless the fresh verdict read "blocking". If another invocation fetched a newer base while Codex ran, verdict() answered "stale" even for a review with blocking findings, and the standalone command reported success. The hook was not affected: it re-reads the verdict and refuses a stale one. Only clean and suggestions now count as a pass. A test moves the base during a blocking review and expects exit 1. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): fail when the verdict of a commit already on the base cannot be written When the commit had no commits over the base, the empty-range path wrote a clean record and returned 0 even if the write failed. The gate then found no record and refused, while the command had reported success. Return 2, as the other publication paths do. The docs now name the unqualified application CoroutineScope binding that exists, and note the L1-send exception to the pinned-on production flags. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): validate the counts line without a Python assert An assert is removed when the caller's environment has PYTHONOPTIMIZE set. A counts line such as {"blocking": null, ...} then passed validation and was published as a clean verdict, which the push gate trusts. The check is now an explicit raise. A test sets PYTHONOPTIMIZE=1 and expects exit 2 with no verdict. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review, docs): close the five review suggestions on #1637 pre-review tests: - The cancellation cases now wait for the fake to report it has reached its stall point, instead of sleeping a fixed two seconds. The fake then stays there until released, so on a slow machine the signal can neither come before Codex starts nor after a short fake finishes. - The chmod-based cases check that chmod really blocks a write, and are skipped where it does not. As root (in a container, say) chmod a-w blocks nothing, and those tests failed for a correct script. Checked on macOS and as root on Linux. Docs: - One local-round limit everywhere: at most two per push, a third only when the user asks for it. - The CI line in the project map no longer claims coverage of the flavoured wallet tests. - The marker recipe states what temp+fsync+ATOMIC_MOVE survives (process death), and what an OS crash also needs (fsync of the parent directory). - The future-start deadline rule is stated as an explicit check. - CLAUDE.md no longer says dashj does the blockchain work after the cutover. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): a failed codex mcp list stops the review; web search is set, not read back Both MCP probes ignored codex's exit status. A failed first probe left no servers to switch off. A failed read-back that still printed a list passed. Either failure now means no review, and a test covers it. web_search is a codex config value, not a feature, so `codex features list` has no row to read back. The -c on the command line outranks every config layer. README and the comments said it was read back; they now say it is set. The project map no longer calls root CLAUDE.md stale on Gradle, Data Binding and dashj, which this PR fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): a failed codex features list stops the review; docs: marker mechanisms and ATOMIC_MOVE The capability probe ignored codex's exit status, as the MCP probes did before 8b2c7fc. A failing probe that still printed every row as off passed the count check. Now no review runs, and a test covers it. The other probes already check theirs, or validate their output (--version). Docs: - 03 §3.11 says that AtomicMoveNotSupportedException is a failed write, not a cue for a plain move. Whether ATOMIC_MOVE replaces an existing target depends on the implementation, so pair it with REPLACE_EXISTING or never overwrite. - 08 lists what the three marker classes share, and the mechanism each one actually uses. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(code-knowledge): REPLACE_EXISTING does not change ATOMIC_MOVE's replacement behaviour Files.move ignores every other option under ATOMIC_MOVE (found by the local pre-review). A failed replacement aborts the write like any other step. On Android the move is rename(2), which replaces the target. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pre-review): check each codex capability row once, not the count of false rows; #1607 has merged The read-back counted rows that named a capability and ended in false, so seven copies of one capability passed even if the others were missing or on. Each of the seven must now appear exactly once, and be false. Tests cover a listing made of copies of one row, a listing with one row duplicated, and a clean one. Checked with BSD awk and mawk. #1607 merged into feat/kotlin-sdk-phase-1 while this PR was open. It is gone from the docs' open-PR list, and only getAllOrThrow() (#1616) is still marked as not on the base. Co-Authored-By: Claude Opus 5.5 <[email protected]> * revert(pre-review): keep the skill identical to master's #1634 version This PR is code knowledge for v12. It carries the /pre-review skill only because v12 does not have #1634 yet. The hardening fixes made here in answer to review rounds (stale-verdict and empty-range exit status, assert under PYTHONOPTIMIZE, MCP and features probe exit status, the per-capability read-back, test synchronisation) changed a tool that was reviewed and merged in #1634. They belong in their own PR into master. They are kept on the local branch chore/prereview-hardening for that. .claude/skills/pre-review/ now matches origin/master (cdaf542) byte for byte. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(code-knowledge): #1630 has merged; REPLACE_EXISTING is not part of the atomic-marker guarantee #1630 merged into feat/kotlin-sdk-phase-1 while this PR was open, so it comes off the open-PR list. BackupReplacementState passes REPLACE_EXISTING, but ATOMIC_MOVE ignores it, so 08 no longer lists it as part of the mechanism. 08 also states that arm() and complete() both run under the AtomicFileWriter lock. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(code-knowledge): correct GlobalScope and Java counts; marker check and publish share one lock GlobalScope is launched in 2 files; BaseConfig only imports it. wallet/src holds 110 Java files, and 115 is the module including its tests. §3.11 now says that a marker's state check and its publishing write belong under one writer lock. BackupReplacementState does that, and WalletWipeState.begin() relies on not running concurrently. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(code-knowledge): generation markers may be replaced; the protocol latch is an AtomicFile, not SharedPreferences From the local pre-review: - §3.11's "never overwrite a pending marker" holds for markers whose content is the authority (WalletWipeState). BackupReplacementState.arm() replaces a pending marker with a new generation by design. - §3.14 named ProtocolVersionLatch as a commit() latch. It keeps its mark in its own AtomicFile, with the data and directory fsynced and the file read back, because SharedPreferences cannot tell unreadable from absent. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: andreika-baranouski <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
We need UI for picking a gift card provider if multiple are available.
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: