docs: add ARCHITECTURE.md - Rust/Dart boundary ADR - #7
Conversation
Defines the clear boundary between Rust core and Flutter shell: - Rust: Protocol, crypto, network, business logic (nostr-sdk) - Dart: UI, platform APIs, device I/O (camera, push, biometrics) Includes: - Data flow diagram - Example: QR scan → Lightning payment - Forbidden patterns (what NOT to do) - Platform-specific considerations - Dependencies summary - Checklist for new features This is a spec-kit reference document for Claude to understand the architecture decisions when implementing features.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughA new Architecture Decision Record is introduced that establishes a Rust/Dart boundary within the project, defining cryptography, networking, and business logic as Rust responsibilities while assigning UI, platform APIs, and device I/O to Dart/Flutter. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.specify/ARCHITECTURE.md:
- Around line 8-13: Update the fenced code blocks that currently have no
language tag (the ASCII box art blocks and the numbered step list) to include a
language identifier like "text" or "plaintext" after the opening triple
backticks so markdownlint MD040 is satisfied; specifically, locate the
triple-backtick blocks that contain the box-drawing UI/architecture diagrams and
the numbered "1. User taps..." sequence and change their openings from ``` to
```text (or ```plaintext) for each occurrence across the documented sections.
- Line 216: The dependency declaration nostr-sdk = "0.44+" uses invalid Cargo
semver syntax; replace the version specifier with a valid requirement such as
"0.44" or "^0.44" to allow patch updates within 0.44.x without permitting
breaking minor/major changes, updating the line that currently reads nostr-sdk =
"0.44+" accordingly.
- Around line 183-187: The example should guard against null/empty barcode
values before calling the Rust API: in onDetect, check that capture.barcodes is
not empty and that capture.barcodes.first.rawValue (Barcode.rawValue) is
non-null and non-empty, and only then call rustApi.parseInvoice(invoice: code);
otherwise skip calling the Rust API or handle the invalid input; update the
onDetect handler to validate rawValue (String?) from mobile_scanner before
passing to rustApi.parseInvoice.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3bd78243-bdf8-48c9-8918-eeaa056073ca
📒 Files selected for processing (1)
.specify/ARCHITECTURE.md
| ``` | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ RUST handles: Protocol, Crypto, Network, Business Logic │ | ||
| │ DART handles: UI, Platform APIs, Device I/O │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ``` |
There was a problem hiding this comment.
Add language identifiers to fenced code blocks.
These blocks trigger markdownlint MD040 and should specify a language (for example text/plaintext) to keep docs lint-clean.
📝 Suggested doc fix
-```
+```text
┌─────────────────────────────────────────────────────────────────┐
│ RUST handles: Protocol, Crypto, Network, Business Logic │
│ DART handles: UI, Platform APIs, Device I/O │
└─────────────────────────────────────────────────────────────────┘- +text
┌──────────────────────────────────────────────────────────────────────┐
...
└──────────────────────────────────────────────────────────────────────┘
-```
+```text
1. User taps "Scan QR" button
...
9. Rust handles NWC payment or returns invoice for manual payment
</details>
Also applies to: 44-89, 95-122
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.21.0)</summary>
[warning] 8-8: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @.specify/ARCHITECTURE.md around lines 8 - 13, Update the fenced code blocks
that currently have no language tag (the ASCII box art blocks and the numbered
step list) to include a language identifier like "text" or "plaintext" after the
opening triple backticks so markdownlint MD040 is satisfied; specifically,
locate the triple-backtick blocks that contain the box-drawing UI/architecture
diagrams and the numbered "1. User taps..." sequence and change their openings
from totext (or ```plaintext) for each occurrence across the documented
sections.
</details>
<!-- fingerprinting:phantom:triton:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
orders.rs — Fix #7: store_trade_key_index before publish Moved store_trade_key_index(&order_id, trade_index) from before the action dispatch to inside the publish-success else branch. A publish failure no longer leaves a stale key mapping. orders.rs — Fix #5: ln_address logged in plain text Replaced ln_address={:?} (which printed the actual address) with ln_address=present/none using if ln_address_ref.is_some(). orders.rs — Fix #4: fixed 30-min deadline regardless of activity Replaced the fixed deadline with a last_activity instant that resets on each matching event. The idle timeout is now 30 minutes of inactivity, not 30 minutes of total uptime. add_lightning_invoice_screen.dart — Fix #2: Lightning Address sent with 1-sat amount _isValid now returns false for @ inputs when _resolvedSats is null. _submit also guards against it and surfaces an error instead of falling through to BigInt.one. trade_detail_screen.dart — Fix #3: OrderStatus.pending mapped to TradeStatus.active Added TradeStatus.loading to the enum and made it the default branch in _mapOrderStatus. Unresolved/initial statuses no longer match the active-trade action button sections.
Summary
Adds an Architecture Decision Record that clearly defines the boundary between Rust core and Flutter shell.
Why This Matters
The spec mentions "Rust Core, Flutter Shell" in multiple places but never explicitly explains:
This document answers all three.
Content
The Golden Rule
Includes
For Claude/AI
This is a spec-kit reference document. When Claude implements features, it should:
Location
.specify/ARCHITECTURE.md- alongside PROTOCOL.md and DESIGN_SYSTEM.mdSummary by CodeRabbit
Release Notes