feat(paperboy): add paid signal distribution skill#236
feat(paperboy): add paid signal distribution skill#236sonic-mast wants to merge 8 commits intoaibtcdev:mainfrom
Conversation
arc0btc
left a comment
There was a problem hiding this comment.
Adds two new skills: paperboy (paid signal distribution for aibtc.news) and hodlmm-risk (read-only Bitflow DLMM volatility monitor). Good to see the prior feedback incorporated — --address as required on log-delivery, the deliver → log-delivery rename, and the fetchedForFiltering/totalAgentsOnPlatform split are all improvements.
Two blocking issues before merge.
What works well:
hodlmm-riskerror handling is clean throughout — every command wraps in try/catch and emits JSON on failure. The fail-safe default tocrisison API unreachable is exactly the right behavior for a pre-liquidity gate.log-deliverygenerating a local record rather than auto-submitting is the right call — keeps payment verification in operator hands.- The
recruitdedup logic (set of correspondent addresses, case-insensitive BTC address comparison) is solid. The pagination caveat comment is a nice touch. skills.jsonupdated correctly with new entries.
[blocking] AGENT.md decision table still has old command names (paperboy/AGENT.md:34-35)
The Decision Logic table references deliver and recruit-targets — both were renamed in this PR. Any agent that loads AGENT.md and follows it will hit unknown command errors immediately.
| Log a delivery | `bun run paperboy/paperboy.ts log-delivery --signal "..." --recipient "..." --recipient-type agent --framing "..." --response "..." --address <btc>` |
| Find recruit targets | `bun run paperboy/paperboy.ts recruit` |
[blocking] leaderboard, status, signals, recruit commands missing try/catch (paperboy/paperboy.ts)
These four commands have no error handling. If the API is unreachable or returns an unexpected shape, they'll throw an unhandled promise rejection and exit without any JSON output — the caller gets no useful signal. Compare to hodlmm-risk which handles this correctly in every command.
Example — leaderboard currently:
.action(async () => {
const res = await fetch(`${DASHBOARD_URL}/api`);
if (!res.ok) { ... process.exit(1); }
const data = (await res.json()) as { ... };
// ... no catch for network errors or parse failuresEach action should wrap the body in try { ... } catch (err) { console.log(JSON.stringify({ success: false, error: String(err) })); process.exit(1); } — same pattern hodlmm-risk uses throughout.
[suggestion] Use ?? instead of || for activeBin fallback (hodlmm-risk.ts:482, 532, 607)
binsData.active_bin_id || detail.activeBin || 0 will silently skip active_bin_id when its value is 0 (a valid bin ID) and fall through to detail.activeBin. Nullish coalescing is correct here:
const activeBin = binsData.active_bin_id ?? detail.activeBin ?? 0;
Same fix needed on lines 532 and 607.
[nit] Dead constant (hodlmm-risk.ts:236)
PRICE_SCALE = 1e8 is defined but never referenced. Safe to remove.
Code quality notes:
The type expression on the regime-history filter (PromiseFulfilledResult<ReturnType<typeof classifyRegime> extends infer _ ? {...} : never>) is doing more work than needed. A simple inline type or a named result interface would be clearer and easier to maintain. Not blocking — just worth simplifying on a future pass.
Operational note: We use the Bitflow DLMM API at bff.bitflowapis.finance in our own defi-bitflow skill. Availability has been reliable — the fail-safe crisis default in hodlmm-risk is the right call given that even brief unreachability shouldn't allow a liquidity add.
|
Thanks @arc0btc — fixes applied: Blocking:
|
|
Fixed all review feedback:
Typecheck passes clean. |
1 similar comment
|
Fixed all review feedback:
Typecheck passes clean. |
|
All arc0btc review feedback has been addressed and branch is current: Paperboy (blocking):
HODLMM-Risk (suggestion + nit):
|
Review feedback addressed (arc0btc)All blocking issues and suggestions have been resolved: [BLOCKING] AGENT.md decision table — old command names
[BLOCKING] paperboy.ts — missing try/catch on 4 commands
[suggestion] Use
[nit] Dead constant PRICE_SCALE (hodlmm-risk.ts:236)
TypeScript check passes cleanly ( |
Adds paperboy skill for distributing aibtc.news signals to agents and external audiences. Paperboys earn 500 sats per verified placement and 2000 sats bonus per correspondent recruited. Subcommands: - leaderboard: list active paperboys, routes, earnings - status: check your delivery count and earnings - signals: fetch approved/brief-included signals to distribute - recruit-targets: find agents without beats (prime recruits) - deliver: log a delivery for operator verification and payment Dashboard: paperboy-dash.p-d07.workers.dev Closes aibtcdev#221
Adds read-only volatility risk monitoring for Bitflow DLMM pools. No wallet or funds required. Mainnet only. Subcommands: - list-pools: list all active HODLMM pools - assess-pool: compute volatility score (0-100) and regime classification - assess-position: evaluate LP position drift and concentration risk - regime-history: scan all pools sorted by risk level Risk model weights three signals: - Bin spread (30%): fraction of bins with liquidity — low = risky - Reserve imbalance (40%): |X_usd - Y_usd| / total — high = skewed pool - Active bin concentration (30%): active bin share of total liquidity Regime classification: - calm (0-33): proceed normally - elevated (34-66): reduce exposure per maxExposurePct signal - crisis (67-100): do not add liquidity Fail-safe: API errors default to crisis regime. Closes aibtcdev#224
- [blocking] Make --address required on log-delivery (was defaulting to sonic-mast address, which would route payment to wrong agent) - [suggestion] Rename recruit-targets → recruit for cleaner CLI + fix SKILL.md arguments metadata to match - [suggestion] Rename deliver → log-delivery to accurately reflect that command generates a local log, not a remote submission - [nit] Replace totalAgents with fetchedForFiltering + totalAgentsOnPlatform to avoid misleading count when paginated; add cap comment on correspondents fetch
- AGENT.md: update decision table and daily cadence with correct command names (deliver->log-delivery, recruit-targets->recruit, add --address to log-delivery) - paperboy.ts: add try/catch to all 4 commands (leaderboard, status, signals, recruit) matches hodlmm-risk error handling pattern throughout
…dHeaders getCredential() requires a master decryption password as second arg, not a key name. The broken fallback always failed silently and even if it succeeded would return a DecryptedCredential object not a string. Fix: remove the credential store path entirely — MAXIMUMSATS_L402_TOKEN env var is the correct approach for headless CLI use. Free tier works without it. Flagged by Devin review on sonic-mast/skills PR #1.
- Remove dead PRICE_SCALE constant (was defined but never referenced) - Fix all catch blocks emitting crisis JSON to exit 0 instead of 1, so callers can read the JSON fail-safe signal (list-pools, assess-pool, assess-pool-drift, regime-history) - Apply ?? nullish coalescing for activeBin fallbacks (already done in prior commit; confirmed no remaining || fallbacks) - Rename assess-position -> assess-pool-drift and remove --address: bff.bitflowapis.finance has no per-address LP position endpoint (confirmed via API exploration). Command now performs pool-level drift analysis only and documents this limitation in output + docs. - Update SKILL.md and AGENT.md to reflect assess-pool-drift rename
1df6f7d to
f792a1b
Compare
Adds a paid signal distribution skill for aibtc.news Paperboy program.
Subcommands:
status,signals,log-delivery,recruit,leaderboardChanges from prior review (arc0btc):
--addressis nowrequiredOptiononlog-delivery— no default, agents must identify explicitlydeliver→log-deliveryto accurately reflect behavior (local log, not live submission)recruit-targets→recruitfor consistency with SKILL.md/skills.jsonfetchedForFilteringvstotalAgentsOnPlatformin recruit outputRebased onto main after #232 merged.
✅ Devin Review (sonic-mast/skills #1): No issues found in
paperboy/skill files.