feat(pot): pay only with a Rada-signed trigger; one Atram approver (ENG-1774) #5
All Vouch review confidence checks passed
Residual risk 0.47 = Change Risk (0.75) × (1 − Review Confidence (0.38)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 73% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #5"
general
weight: 0.35
greptile-apps[bot]
Closes ENG-1774: Pot pays only with a Rada-signed trigger.
What this changes
Every payout now needs three independent signatures, all checked on-chain:
| Who | Signs | Where |
|---|---|---|
| Rada (simulated) | the trigger: this pot, this FSP wallet, this amount, this proposal | Lydia's simulated drought signal (ENG-1759, Michael) |
| Atram | the payout (now 1 approver, was 2) | the signer |
| The FSP (Contactar) | the payout to its own wallet | the signer (testnet only) |
releasetakesrada_signatureand traps unless Rada signed exactly this pot, wallet, amount and trigger ID. A signed trigger can't be replayed on another pot, redirected or resized. Cap, window, FSP list and one-payout-per-trigger are unchanged.rada_signatureand maps a bad one tobad_trigger_signature. It never holds Rada's key (that's Lydia's side).signer/src/rada.jsis the reference implementation of the message; the CLI signs withRADA_TEST_SECRETfor local test payouts.docs/release-interface.md(link works once merged) has the byte layout, a worked example, and a PHP version for Lydia. The example is checked in both the contract tests (the_documented_trigger_example_verifies) and the signer tests, and the PHP snippet was run against it.rada-mockpublic key.Live on testnet
New red pot: 1 Atram approver,
rada-mockkey, cap 5,000, 20 USDC deposited, open until 1 Nov.bad_trigger_signature, nothing moved. (Earlier, on the interim pot: a signature made for 1 USDC used for 2 was refused the same way.)adminand are listed underretiredindeployments/testnet.json.Tests
🤖 Generated with Claude Code
<!-- greptile_comment -->
<!-- greptile_summary -->
<h2><a href="https://app.greptile.com/api/retrigger?id=87649737"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/atram/github/Atram-Inc/lydia-hackmeridian/-/pull/5"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2>
<!-- greptile-risk -->
The PR appears safe to merge, with non-blocking improvements to dashboard reads and signature tests.
<h2><a href="https://app.greptile.com/api/ide/codex?prompt=IMPORTANT%3A%20Work%20in%20the%20repository%20%22atram-inc%2Flydia-hackmeridian%22%20on%20the%20existing%20branch%20%22feat%2Frada-signed-trigger%22.%20Checkout%20that%20branch%20%E2%80%94%20do%20NOT%20create%20a%20new%20branch%20or%20open%20a%20new%20PR.%20Push%20your%20changes%20to%20%22feat%2Frada-signed-trigger%22.%0A%0A%23%23%23%20Issue%201%0Asigner%2Fsrc%2Fserver.js%3A29-35%0A%60potReader%60%20caches%20the%20result%20only%20after%20%60readPot%60%20finishes.%20Several%20dashboard%20requests%20arriving%20on%20an%20empty%20or%20expired%20cache%20each%20start%20the%20same%20contract%2C%20event%20and%20wallet%20reads.%20Larger%20histories%20make%20these%20polling%20bursts%20slower%20and%20more%20likely%20to%20hit%20upstream%20request%20limits.%20Cache%20the%20pending%20promise%20per%20label%2C%20and%20remove%20it%20if%20the%20read%20fails.%0A%0A%23%23%23%20Issue%202%0Acontracts%2Fpot%2Fsrc%2Ftest.rs%3A308-317%0AThe%20new%20refusal%20tests%20cover%20a%20wrong%20key%2C%20changed%20amount%20and%20changed%20wallet%2C%20but%20not%20a%20changed%20pot%20or%20%60reason%60.%20Those%20two%20fields%20stop%20a%20signature%20from%20being%20reused%20on%20another%20pot%20or%20under%20a%20new%20proposal%20ID.%20The%20worked%20example%20checks%20only%20a%20valid%20signature.%20Add%20refusal%20tests%20that%20keep%20the%20signature%20unchanged%20while%20changing%20only%20the%20pot%20or%20only%20%60reason%60%2C%20and%20check%20that%20no%20funds%20move.%0A%0ANote%3A%20If%20this%20suggestion%20doesn't%20match%20your%20team's%20coding%20style%2C%20reply%20to%20this%20and%20let%20me%20know.%20I'll%20remember%20it%20for%20next%20time!%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=atram-inc%2Flydia-hackmeridian&pr=5&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodexDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7"><img alt="Fix All in Codex" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInCodex.svg?v=7" align="right"></picture></a>Findings</h2>
1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Dashboard requests repeat expensive reads <a href="https://github.com/Atram-Inc/lydia-hackmeridian/pull/5#discussion_r4370984176">▶</a>
2. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Replay checks lack focused tests <a href="https://github.com/Atram-Inc/lydia-hackmeridian/pull/5#discussion_r4370984179">▶</a>
<details><summary><h3>Summary</h3></summary>
Adds Rada's signature to every payout and changes the deployment default to one Atram approver.
Intentional change acknowledged by
jazzmin95: the deployment now uses one Atram approver, as stated in the PR description.</details>
<details open><summary><h3>Diagram</h3></summary>
</details>
<!-- greptile_confidence_score:4 -->
<sub>Reviews (1) · Last reviewed commit: "feat(signer): forward Lydia's Rada-signe..." · Reviewed by Greptile</sub>
<!-- /greptile_comment -->