Adds @settlekit/attribution — reuse-detection, weighted provenance lineage,
and HMAC-signed proofs-of-citation — wired live into the rsshub-citation-toll
sidecar (POST /attribution/{detect,proof,verify}) and persisted via
PgLineageStore/PgProofStore over new lepton_lineage_edges + lepton_citation_proofs
tables.
Adds apps/creator-dashboard — a Next.js earnings view in the Statement
greenbar-ledger design system, driven by real domain logic (createSource +
computeRoyaltyDistribution + detectReuse, not mocks). Statement / Sources /
Payouts / Reuse & proofs (interactive) / Wallet. next build green.
Also bundles in-progress settlement hardening: settlement-core idempotency
concurrency, api env validation, bundles + contracts/worker tweaks.
Verified: 943 vitest tests, 27 Foundry tests, next build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The /scrobble validator accepted any `typeof === "number"` playedSeconds, but
typeof NaN/Infinity is also "number" and `NaN < minPlaySeconds` is false — so a
non-finite duration slips past the skip-gate and charges for a non-play. Over
JSON, NaN/Infinity serialize to null (already rejected), but a negative duration
was silently treated as a free skip rather than flagged as malformed, and any
programmatic caller of the typed processor API could pass a raw NaN.
Require a finite, non-negative playedSeconds at the boundary. Test: NaN,
Infinity, and -1 all return 400 and accrue no royalty leg. Full suite 906 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Navidrome, Owncast, and RSSHub sidecars exposed unauthenticated POST
endpoints that bind payout wallets and accrue/settle royalties (/scrobble,
/sessions/*, /admin/*). Because join/ingest events carry a caller-supplied
wallet, an attacker who can reach an exposed endpoint could rebind a creator's
payout address and redirect earnings.
Add a shared requireBearer guard (constant-time token compare) to each sidecar
and a SIDECAR_AUTH_TOKEN config knob. When the token is set, guarded routes
require `Authorization: Bearer <token>`; when unset the guard is a no-op so local
demos and tests run unchanged. Read-only routes (/, /health) and RSSHub's
x402-paid /articles/:id stay open — payment is that route's gate.
Test: with a token configured, /sessions/join is 401 without/with a wrong token
and 200 with the right one; /health stays open. Full suite 905 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live-wiring (flip to production by config, no code change):
- settlementProviderFromEnv (local/Circle) wired into every sidecar startSidecar
- createFeedPoller fetches a live RSSHub JSON feed and ingests on an interval
On-chain contracts (Foundry, Solc 0.8.30, forge test green):
- RecursiveSplitDistributor.sol: settle a citation/remix lineage in one tx (RFB 6)
- LeptonStreamSettlement.sol: per-second stream w/ reserve, proof-of-flow
pause/resume, settle, close+refund (RFB 4)
- AgentReputationBond.sol: ERC-8004-style USDC bond, release/slash (RFB 3)
All green: full typecheck, 885 JS tests, 25 Foundry tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owncast per-second streaming settlement (RFB 4) on @settlekit/streaming:
- viewer join/leave meters watched time into a per-second PaymentStream
- watched time accrues to the streamer (payee-registry), unused reserve refunded
- settled via the shared sweepPendingRoyalties + settlement-core
Live-wiring seams (flip to production by config, no code change):
- all three sidecars accept an injectable settlementProvider (Gateway/Circle)
- rsshub sidecar: verify override + on-chain verification via ARC_INDEXER_URL
- fetchRssHubFeed / mapJsonFeed map a live RSSHub JSON feed to RssItems
Three creator-monetization patterns now share one settlement spine:
per-citation (RSSHub), per-listen (Navidrome), per-second (Owncast).
All green: full typecheck + 881 tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per-listen royalties for self-hosted music servers (Navidrome/Subsonic):
- play-gating (a skip in the first seconds is free)
- per-listener daily spending caps (wallet-fleet SpendingCapEnforcer)
- artist→wallet via @settlekit/payee-registry (escrow fallback)
- accrues per-listen royalty legs, settled to artists via the shared
sweepPendingRoyalties + settlement-core
Hono service: /scrobble, /admin/artists, /admin/sweep, /health. Reuses the
production spine; booted live (skip→free, full play→accrued, sweep→settled).
Plan updated. All green: full typecheck + 875 tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2501 files under sdks/rust/target and services/arc-indexer/target were
committed before the target/ gitignore rule. Remove them from the index
(kept on disk); .gitignore already excludes target/. Also shrinks Vercel
uploads.