Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(wallet): warn on a withdrawal destination that looks drained by a sweeper bot
nirholas5fa6b0109bbd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2f205893f..a93012d8a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,6 +19,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Robinhood Chain feed worker now runs the published SDK, not a stale local snapshot**: workers/robinhood-feed depended on robinhood/robinhood-chain-sdk through a file: link, a reference copy that drifts from the standalone robinhood-chain-sdk repo it mirrors. The worker now installs hoodchain from npm like any other dependency, so it always runs the released SDK. Also fixed: seven pointer READMEs staged for duplicate or superseded standalone repos (three-ui, crypto-market-data, crypto-market-data-ts, crypto-data-aggregator, memescope-monday-directory, and one of each duplicate Robinhood Chain repo pair), ready for the owner to push and archive. `[fix, infra]`- **Standalone GitHub mirrors now stage instead of force-pushing**: scripts/sync-standalone-repos.mjs force-pushed straight to main on every run, which could silently create duplicate repos for the eleven mirrors already renamed on GitHub and bypassed the owner's push-approval rule. data/standalone-mirrors.json is now the single source of truth for which monorepo directory maps to which public repo, read by every exporter (sync, growth satellites, the awesome list, the skill-repo builder) instead of each keeping its own list. The sync script only stages a snapshot under dist/standalone-mirrors/, fixes any stale pre-Apache-2.0 README or LICENSE footer, and prints the push command for the owner; npm run sync:repos:check compares what is staged against each mirror's live tree and reports drift without writing anything. (`/docs/contributing`) `[infra, docs]`- **The native $THREE launchpad now taxes snipers, not just steady trading**: Every pool on the native launchpad lane used to open at the same flat 1% trading fee a coin keeps forever, which is exactly what a sniper bot wants: the same price whether it buys in the pool's first block or an hour later. New pools now open at a 50% fee that decays exponentially down to the normal 1% over the first 100 slots (about 40 seconds), so a bot buying in the first block pays close to half its $THREE in fees while an organic buyer a minute later pays the standard rate. The coin creator's own bundled first buy stays exempt, since that is the creator funding their own launch, not a snipe. The schedule runs entirely on Meteora's own Dynamic Bonding Curve fee scheduler, no new contract. (`/docs/native-launchpad`) `[feature, security]`+- **The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them**: scripts/check-secrets.mjs, the hook that blocks a push carrying a credential, now decodes every 86-90 character base58 run in added content and flags it only when the first 32 bytes derive the embedded public key in the last 32 bytes via Ed25519, catching a real Solana keypair secret while leaving the repo's thousands of genuine 64-byte transaction signatures untouched. Separately, the agent wallet's Withdraw tab now reads a destination's recent on-chain history before you send: a wallet that repeatedly drains to near-zero within seconds of receiving funds, the sweeper-bot fingerprint, surfaces a blocking warning on the confirm screen and again server-side if you retry, so a sweeper bot can't just wait for the preview to go stale. (`/docs/agent-abilities`) `[security]`- **three.ws Avatar MCP clamps unbounded tool arguments before they reach generated HTML**: render_avatar's name and camera-orbit arguments flowed into the generated <model-viewer> HTML with no length bound, unlike the model URL, which already rejected oversized or unsafe values. Both are now clamped the same way, closing the one argument path that could still balloon a rendered page or chat payload. `[fix, security, sdk]`## 2026-10-13diff --git a/api/_lib/agent-trade-guards.js b/api/_lib/agent-trade-guards.jsindex 5b2b5a381..53ea47923 100644--- a/api/_lib/agent-trade-guards.js+++ b/api/_lib/agent-trade-guards.js@@ -31,6 +31,11 @@ import { solUsdPrice } from './avatar-wallet.js';import { logAudit } from './audit.js';// The destination whitelist: cooldown-gated allowlist for every outbound category.import { evaluateDestination } from './destination-whitelist.js';+// Sweeper-bot heuristic for owner-typed withdraw destinations: an injected+// connection (this platform's own failover chain) backs a read-only check, see+// api/_lib/burned-destination.js.+import { checkBurnedDestination } from './burned-destination.js';+import { solanaConnection } from './agent-pumpfun.js';// The wallet's behavioral immune system — an additive anomaly predicate layered on// top of the static caps in this file. See api/_lib/anomaly-events.js +// api/_lib/wallet-anomaly.js. Only referenced inside function bodies, so the@@ -757,9 +762,15 @@ export async function getCounterpartySpendUsd(* destination the platform itself controls or that is bound to a quote the owner* already confirmed (escrow, treasury, a verified provider invoice). It skips the* gate; the numeric caps and policy rules still apply.+ *+ * `sweepRiskAck: true` is set once the owner has already seen the blocking+ * sweeper-bot confirm for THIS destination (surfaced via `destination_sweep_risk`+ * below) and chose to proceed. Only withdraw carries this check: every other+ * category sends to a program address or a platform-controlled wallet the owner+ * never typed in by hand, so there is no "did I copy the right address" risk to warn on.* @throws {SpendLimitError}*/-export async function enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network = 'mainnet', destinationTrust = null }) {+export async function enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network = 'mainnet', destinationTrust = null, sweepRiskAck = false }) {if (destinationTrust === 'system') return null;const dest = typeof destination === 'string' ? destination.trim() : '';// Only the owner's withdraw is required to name a destination. A category@@ -792,9 +803,34 @@ export async function enforceDestinationAllowlist({ agentId, meta, category, des}}}+ if (category === 'withdraw' && dest) {+ const sweepRisk = await checkDestinationSweepRisk({ destination: dest, network });+ if (sweepRisk?.flagged && !sweepRiskAck) {+ throw new SpendLimitError(+ 'destination_sweep_risk',+ `This address looks drained by a sweeper bot: ${sweepRisk.note}`,+ { category, destination: dest, sweepRisk },+ );+ }+ decision.sweepRisk = sweepRisk;+ }return decision;}+/**+ * Heuristic sweeper-bot check for a withdraw destination: does its recent+ * history show the "incoming SOL, drained again within seconds" pattern? A+ * read-only warning, never a static cap, so it degrades to `checked: false`+ * (never throws) on an RPC failure rather than blocking a legitimate withdraw.+ * See api/_lib/burned-destination.js for the classifier.+ */+export async function checkDestinationSweepRisk({ destination, network = 'mainnet' }) {+ const dest = typeof destination === 'string' ? destination.trim() : '';+ if (!dest) return null;+ const conn = solanaConnection(network === 'devnet' ? 'devnet' : 'mainnet');+ return checkBurnedDestination(conn, dest);+}+// ── natural-language policy enforcement ───────────────────────────────────────// The owner-authored, code-enforced policy (meta.policy_rules) layered on top of// the numeric caps. A block here returns the HUMAN rule that caught the spend.@@ -1090,6 +1126,9 @@ export async function enforceSpendLimit({network = 'mainnet',stepUpApproved = false,destinationTrust = null,+ // The owner already saw the sweeper-bot confirm for this exact destination+ // and chose to proceed. See enforceDestinationAllowlist's docstring.+ sweepRiskAck = false,}) {// Fail closed: a caller that named neither the limits nor the meta gets the// agent's REAL policy read from the row, never an empty default policy.@@ -1110,7 +1149,7 @@ export async function enforceSpendLimit({}// 1. Destination allowlist: every outbound category, cooldown-gated.- await enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network, destinationTrust });+ await enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network, destinationTrust, sweepRiskAck });// 2. Natural-language policy — the owner's English rules, deterministically// enforced. Resolved from the explicit `policyRules` arg or the `meta` blob —@@ -1227,6 +1266,9 @@ export async function reserveSpendUsd({// The owner answered this exact spend in the approval inbox. Lifts only a// policy "ask me" verdict, as in enforceSpendLimit; every cap still runs.stepUpApproved = false,+ // The owner already saw the sweeper-bot confirm for this exact destination+ // and chose to proceed. See enforceDestinationAllowlist's docstring.+ sweepRiskAck = false,}) {// Fail closed, exactly as enforceSpendLimit does: the reserve is the layer that// runs before any key is touched, so it is the layer that must never default to@@ -1249,7 +1291,7 @@ export async function reserveSpendUsd({}// Destination allowlist: same gate as enforceSpendLimit, before a row is reserved.- await enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network, destinationTrust });+ await enforceDestinationAllowlist({ agentId, meta, category, destination, usdValue, network, destinationTrust, sweepRiskAck });// Natural-language policy — same deterministic evaluator as enforceSpendLimit,// run BEFORE the row is reserved so a policy block never claims daily headroom.diff --git a/api/_lib/burned-destination.js b/api/_lib/burned-destination.jsnew file mode 100644index 000000000..9609ccef1--- /dev/null+++ b/api/_lib/burned-destination.js@@ -0,0 +1,158 @@+// Flags a Solana destination that shows the "sweeper bot" fingerprint: value+// arrives and is drained again within seconds, repeatedly, leaving a+// near-zero balance despite active funding. Ported from the owner's+// proprietary sol-sweeper-bots `burned-check` (tools/burned-check/check.mjs),+// adapted from a standalone CLI into a withdrawal-time warning: an injected+// `@solana/web3.js` Connection (this platform's own failover chain, never a+// hardcoded endpoint) replaces the CLI's bare `fetch`, and the heuristic is+// now a pure, independently testable function over the collected deltas.+//+// Read-only: only getBalance, getSignaturesForAddress and getTransaction are+// called. It never signs, never moves funds, and a collection failure+// degrades to `checked: false` rather than blocking the withdrawal it backs,+// the heuristic is a warning the owner weighs, not a security boundary that+// must fail closed.+//+// One deliberate fix over the upstream CLI: upstream tracks "quick out" by+// walking signatures newest-first and comparing timestamps without sorting,+// so an outflow that is merely OLDER than some later-seen inflow registers as+// "quick" regardless of the actual gap between them. This module sorts+// deltas into chronological order first, so "quick out" means what it says:+// an outflow within QUICK_OUT_WINDOW_MS of the nearest PRIOR inflow.++import { PublicKey } from '@solana/web3.js';++const LAMPORTS_PER_SOL = 1_000_000_000;+export const QUICK_OUT_WINDOW_MS = 60_000;+export const NEAR_ZERO_LAMPORTS = Math.round(0.001 * LAMPORTS_PER_SOL);+export const DEFAULT_SIGNATURE_LIMIT = 25;+export const DEFAULT_INSPECT_LIMIT = 15;++/**+ * Pure classifier over one destination's recent balance deltas. No network+ * calls, so it can be exercised with synthetic transaction history in tests.+ *+ * @param {{+ * balanceLamports: number,+ * deltas: Array<{ deltaSol: number, blockTimeMs: number|null }>,+ * sigCount: number,+ * sigLimit: number,+ * }} input `deltas` need not be pre-sorted; this function sorts them.+ * @returns {{ verdict: string, flagged: boolean, note: string, inflows: number, outflows: number, quickOutflows: number }}+ */+export function classifySweepPattern({ balanceLamports, deltas, sigCount, sigLimit }) {+ const ordered = [...deltas].sort((a, b) => {+ if (a.blockTimeMs == null && b.blockTimeMs == null) return 0;+ if (a.blockTimeMs == null) return -1;+ if (b.blockTimeMs == null) return 1;+ return a.blockTimeMs - b.blockTimeMs;+ });++ let inflows = 0;+ let outflows = 0;+ let quickOutflows = 0;+ let lastInflowAt = null;+ for (const d of ordered) {+ if (d.deltaSol > 0) {+ inflows += 1;+ lastInflowAt = d.blockTimeMs;+ } else if (d.deltaSol < 0) {+ outflows += 1;+ if (lastInflowAt != null && d.blockTimeMs != null && d.blockTimeMs >= lastInflowAt && d.blockTimeMs - lastInflowAt <= QUICK_OUT_WINDOW_MS) {+ quickOutflows += 1;+ }+ }+ }++ const nearZero = balanceLamports < NEAR_ZERO_LAMPORTS;+ const churny = inflows > 0 && outflows > 0;++ if (nearZero && churny && (quickOutflows > 0 || sigCount >= sigLimit)) {+ return {+ verdict: 'likely_swept', flagged: true, inflows, outflows, quickOutflows,+ note: 'This address shows a near-zero balance with repeated in-then-out transfers. Funds sent here are likely to be drained on arrival by a sweeper bot.',+ };+ }+ if (nearZero && sigCount > 0) {+ return {+ verdict: 'empty_active_history', flagged: false, inflows, outflows, quickOutflows,+ note: 'This address is currently near zero with prior activity.',+ };+ }+ if (balanceLamports > 0) {+ return {+ verdict: 'holds_balance', flagged: false, inflows, outflows, quickOutflows,+ note: 'This address is currently funded.',+ };+ }+ return {+ verdict: 'no_activity', flagged: false, inflows, outflows, quickOutflows,+ note: 'No balance and no recent transaction history for this address.',+ };+}++/**+ * Collect the balance deltas `classifySweepPattern` needs for one address,+ * over an injected connection. Bounded by signature count on both the fetch+ * (`sigLimit`) and the per-transaction inspection pass (`inspectLimit`): a+ * sweeper pattern is a RECENT behavior, so deep history is not needed.+ *+ * @param {object} connection a `@solana/web3.js` Connection, or anything+ * duck-typed the same way (getBalance, getSignaturesForAddress, getTransaction).+ * @param {string} address base58 Solana address+ * @param {{ sigLimit?: number, inspectLimit?: number }} [opts]+ */+export async function collectDestinationDeltas(connection, address, opts = {}) {+ const sigLimit = opts.sigLimit ?? DEFAULT_SIGNATURE_LIMIT;+ const inspectLimit = opts.inspectLimit ?? DEFAULT_INSPECT_LIMIT;+ const pubkey = new PublicKey(address);++ const [balanceLamports, signatures] = await Promise.all([+ connection.getBalance(pubkey, 'confirmed'),+ connection.getSignaturesForAddress(pubkey, { limit: sigLimit }),+ ]);++ const toInspect = signatures.slice(0, Math.min(signatures.length, inspectLimit));+ const deltas = [];+ for (const s of toInspect) {+ if (s.err) continue;+ let tx;+ try {+ tx = await connection.getTransaction(s.signature, { commitment: 'confirmed', maxSupportedTransactionVersion: 0 });+ } catch {+ continue;+ }+ if (!tx?.meta) continue;+ const keys = tx.transaction?.message?.getAccountKeys+ ? tx.transaction.message.getAccountKeys().staticAccountKeys+ : (tx.transaction?.message?.accountKeys ?? []);+ const idx = keys.findIndex((k) => (k?.toBase58 ? k.toBase58() : String(k)) === address);+ if (idx < 0) continue;+ const pre = tx.meta.preBalances?.[idx];+ const post = tx.meta.postBalances?.[idx];+ if (pre == null || post == null) continue;+ const deltaSol = (post - pre) / LAMPORTS_PER_SOL;+ if (deltaSol === 0) continue;+ deltas.push({ deltaSol, blockTimeMs: s.blockTime ? s.blockTime * 1000 : null, signature: s.signature });+ }++ return { balanceLamports: Number(balanceLamports), deltas, sigCount: signatures.length, sigLimit };+}++/**+ * Collect and classify one destination in a single call. Never throws: a+ * collection failure (RPC outage, invalid address) reports `checked: false`+ * so the caller can show the result as "unknown" rather than block on it.+ *+ * @param {object} connection injected `@solana/web3.js` Connection+ * @param {string} address base58 Solana address+ * @param {{ sigLimit?: number, inspectLimit?: number }} [opts]+ */+export async function checkBurnedDestination(connection, address, opts = {}) {+ try {+ const collected = await collectDestinationDeltas(connection, address, opts);+ return { checked: true, ...classifySweepPattern(collected) };+ } catch (err) {+ return { checked: false, flagged: false, verdict: 'unknown', note: 'Could not check this address right now.', error: err?.message || String(err) };+ }+}diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.jsindex b7a455e20..03ef7db54 100644--- a/api/agents/solana-wallet.js+++ b/api/agents/solana-wallet.js@@ -34,7 +34,7 @@ import {validateSolanaAddress, enforceSpendLimit, SpendLimitError, lamportsToUsd,getSpendLimits, setSpendLimits, listCustodyEvents, updateCustodyEvent, recordCustodyEvent,getDailySpendUsd, getTradeLimits, setTradeLimits, getDailySpendLamports,- setPolicyRules, getPolicyRules,+ setPolicyRules, getPolicyRules, checkDestinationSweepRisk,} from '../_lib/agent-trade-guards.js';// Natural-language spend policies — owner authors rules in English (compiler),// code enforces them deterministically (rules engine). Owner-only Policy surface.@@ -594,6 +594,10 @@ async function handleWithdraw(req, res, id) {const network = body.network === 'devnet' ? 'devnet' : 'mainnet';const asset = typeof body.asset === 'string' && body.asset.trim() ? body.asset.trim() : 'SOL';const simulate = body.simulate === true;+ // Set once the owner has already seen the blocking sweeper-bot confirm for+ // this exact destination (surfaced on the simulate response below) and chose+ // to send anyway.+ const sweepRiskAck = body.sweep_risk_ack === true;// A wallet balance promised to marketplace bidders cannot be withdrawn out// from under them: once a listing that includes the balance has an escrowed@@ -786,7 +790,7 @@ async function handleWithdraw(req, res, id) {// 3. Enforce the shared spend policy (allowlist + per-tx + daily ceiling).try {- await enforceSpendLimit({ agentId: id, meta, category: 'withdraw', usdValue, destination: dest.base58, network });+ await enforceSpendLimit({ agentId: id, meta, category: 'withdraw', usdValue, destination: dest.base58, network, sweepRiskAck });} catch (e) {if (e instanceof SpendLimitError) {return error(res, e.status, e.code, e.message, { detail: e.detail });@@ -831,10 +835,13 @@ async function handleWithdraw(req, res, id) {console.error('[agents/solana-wallet] simulation failed', e?.message);return serverError(res, 502, 'simulation_failed', e);}- const allowlist = await allowlistRow({ agentId: id, destination: dest.base58, category: 'withdraw', ownAddress: meta.solana_address });+ const [allowlist, sweepRisk] = await Promise.all([+ allowlistRow({ agentId: id, destination: dest.base58, category: 'withdraw', ownAddress: meta.solana_address }),+ checkDestinationSweepRisk({ destination: dest.base58, network }),+ ]);return json(res, 200, {data: {- allowlist, simulated: true, asset, network, destination: dest.base58,+ allowlist, sweepRisk, simulated: true, asset, network, destination: dest.base58,amount: humanAmount, lamports: lamports != null ? String(lamports) : null,amount_raw: amountRaw != null ? String(amountRaw) : null,usd: usdValue, note: priceNote,diff --git a/data/changelog.json b/data/changelog.jsonindex ca5b4746d..0b290390f 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-10-14",+ "title": "The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them",+ "summary": "scripts/check-secrets.mjs, the hook that blocks a push carrying a credential, now decodes every 86-90 character base58 run in added content and flags it only when the first 32 bytes derive the embedded public key in the last 32 bytes via Ed25519, catching a real Solana keypair secret while leaving the repo's thousands of genuine 64-byte transaction signatures untouched. Separately, the agent wallet's Withdraw tab now reads a destination's recent on-chain history before you send: a wallet that repeatedly drains to near-zero within seconds of receiving funds, the sweeper-bot fingerprint, surfaces a blocking warning on the confirm screen and again server-side if you retry, so a sweeper bot can't just wait for the preview to go stale.",+ "tags": [+ "security"+ ],+ "link": "/docs/agent-abilities"+ },{"date": "2026-10-14","title": "A new wallet linkage score flags a coin's creator buying their own launch",diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 7ac4ed8e8..c6137175a 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-10-14T20:51:56.774Z",+ "generated_at": "2026-10-14T21:30:35.104Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 4092,+ "total": 4093,"complete": false,"full_feed": "/changelog.json","entries": [@@ -147,6 +147,16 @@"security"]},+ {+ "date": "2026-10-14",+ "type": "update",+ "title": "The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them",+ "summary": "scripts/check-secrets.mjs, the hook that blocks a push carrying a credential, now decodes every 86-90 character base58 run in added content and flags it only when the first 32 bytes derive the embedded public key in the last 32 bytes via Ed25519, catching a real Solana keypair secret while leaving the repo's thousands of genuine 64-byte transaction signatures untouched. Separately, the agent wallet's Withdraw tab now reads a destination's recent on-chain history before you send: a wallet that repeatedly drains to near-zero within seconds of receiving funds, the sweeper-bot fingerprint, surfaces a blocking warning on the confirm screen and again server-side if you retry, so a sweeper bot can't just wait for the preview to go stale.",+ "link": "/docs/agent-abilities",+ "tags": [+ "security"+ ]+ },{"date": "2026-10-14","type": "update",@@ -1546,17 +1556,6 @@"feature","sdk"]- },- {- "date": "2026-10-10",- "type": "update",- "title": "Agents can sign themselves up, and the platform now reports its health honestly",- "summary": "An autonomous agent can now create its own three.ws account by signing a short message with its key: no email, no browser. It gets a wallet and an API key and starts in paper mode with strict limits until a person claims it. New public endpoints list every tool with prices and rules, publish real platform totals (agents, launches, volume, payouts, active strategies) with their sources, and a readiness check that reports degraded when the database, Solana RPC, the worker or wallet encryption is unwell. All of it is shown on the status page.",- "link": "/status",- "tags": [- "feature",- "improvement"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 8fdced06c..257f5f0fb 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-14T20:51:56.754Z",+ "generated_at": "2026-10-14T21:30:35.083Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -144,6 +144,16 @@"security"]},+ {+ "date": "2026-10-14",+ "type": "update",+ "title": "The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them",+ "summary": "scripts/check-secrets.mjs, the hook that blocks a push carrying a credential, now decodes every 86-90 character base58 run in added content and flags it only when the first 32 bytes derive the embedded public key in the last 32 bytes via Ed25519, catching a real Solana keypair secret while leaving the repo's thousands of genuine 64-byte transaction signatures untouched. Separately, the agent wallet's Withdraw tab now reads a destination's recent on-chain history before you send: a wallet that repeatedly drains to near-zero within seconds of receiving funds, the sweeper-bot fingerprint, surfaces a blocking warning on the confirm screen and again server-side if you retry, so a sweeper bot can't just wait for the preview to go stale.",+ "link": "/docs/agent-abilities",+ "tags": [+ "security"+ ]+ },{"date": "2026-10-14","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex a96d89e76..da281c2cc 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -110,6 +110,14 @@<category>feature</category><description>Every pool on the native launchpad lane used to open at the same flat 1% trading fee a coin keeps forever, which is exactly what a sniper bot wants: the same price whether it buys in the pool's first block or an hour later. New pools now open at a 50% fee that decays exponentially down to the normal 1% over the first 100 slots (about 40 seconds), so a bot buying in the first block pays close to half its $THREE in fees while an organic buyer a minute later pays the standard rate. The coin creator's own bundled first buy stays exempt, since that is the creator funding their own launch, not a snipe. The schedule runs entirely on Meteora's own Dynamic Bonding Curve fee scheduler, no new contract.</description></item>+ <item>+ <title>The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them</title>+ <link>https://three.ws/docs/agent-abilities</link>+ <guid isPermaLink="false">2026-10-14:The pre-push guard now catches a leaked Solana secret key, and withdrawals warn before a sweeper bot drains them</guid>+ <pubDate>Wed, 14 Oct 2026 12:00:00 GMT</pubDate>+ <category>security</category>+ <description>scripts/check-secrets.mjs, the hook that blocks a push carrying a credential, now decodes every 86-90 character base58 run in added content and flags it only when the first 32 bytes derive the embedded public key in the last 32 bytes via Ed25519, catching a real Solana keypair secret while leaving the repo's thousands of genuine 64-byte transaction signatures untouched. Separately, the agent wallet's Withdraw tab now reads a destination's recent on-chain history before you send: a wallet that repeatedly drains to near-zero within seconds of receiving funds, the sweeper-bot fingerprint, surfaces a blocking warning on the confirm screen and again server-side if you retry, so a sweeper bot can't just wait for the preview to go stale.</description>+ </item><item><title>three.ws Avatar MCP clamps unbounded tool arguments before they reach generated HTML</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex 35cab0aa5..d2de93c03 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-14T20:51:56.741Z",+ "generated_at": "2026-10-14T21:30:35.070Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex c49ff27f5..f5be9ba7d 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -3,16 +3,16 @@<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />-<title>Sitemap · three.ws</title>-<meta name="description" content="Human-readable index of every page on three.ws." />+<title data-i18n="sitemap_index.meta_title">Sitemap · three.ws</title>+<meta name="description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_description"/><meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" /><link rel="canonical" href="https://three.ws/sitemap" /><meta property="og:type" content="website" /><meta property="og:site_name" content="three.ws" /><meta property="og:locale" content="en_US" /><meta property="og:url" content="https://three.ws/sitemap" />-<meta property="og:title" content="Sitemap · three.ws" />-<meta property="og:description" content="Human-readable index of every page on three.ws." />+<meta property="og:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_og_title"/>+<meta property="og:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_og_description"/><meta property="og:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="630" />@@ -20,8 +20,8 @@<meta property="og:image:alt" content="Sitemap - three.ws" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:site" content="@trythreews" />-<meta name="twitter:title" content="Sitemap · three.ws" />-<meta name="twitter:description" content="Human-readable index of every page on three.ws." />+<meta name="twitter:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_twitter_title"/>+<meta name="twitter:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_twitter_description"/><meta name="twitter:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap" /><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script><link rel="alternate" type="application/xml" title="XML sitemap" href="/sitemap.xml" />@@ -95,16 +95,16 @@<header><div id="nav-container"></div></header><main class="sm-wrap"><div class="sm-hero">- <h1>Sitemap</h1>+ <h1 data-i18n="sitemap_index.sitemap">Sitemap</h1><p><span>1078</span> <span data-i18n="sitemap_index.pages_grouped">pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</span></p><div class="sm-formats">- <a href="/everything"><code>/everything</code> · browse by goal, not by section</a>- <a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>- <a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>- <a href="/llms-full.txt"><code>llms-full.txt</code> · long form</a>- <a href="/api/features.json"><code>features.json</code> · machine manifest</a>- <a href="/changelog"><code>changelog</code> · what's new</a>- <a href="/openapi.json"><code>openapi.json</code> · HTTP API</a>+ <a href="/everything" data-i18n-html="sitemap_index.browse_by_goal_not_by_section"><code>/everything</code> · browse by goal, not by section</a>+ <a href="/sitemap.xml" data-i18n-html="sitemap_index.for_search_engines"><code>sitemap.xml</code> · for search engines</a>+ <a href="/llms.txt" data-i18n-html="sitemap_index.for_ai_agents"><code>llms.txt</code> · for AI agents</a>+ <a href="/llms-full.txt" data-i18n-html="sitemap_index.long_form"><code>llms-full.txt</code> · long form</a>+ <a href="/api/features.json" data-i18n-html="sitemap_index.machine_manifest"><code>features.json</code> · machine manifest</a>+ <a href="/changelog" data-i18n-html="sitemap_index.what_s_new"><code>changelog</code> · what's new</a>+ <a href="/openapi.json" data-i18n-html="sitemap_index.http_api"><code>openapi.json</code> · HTTP API</a></div></div><div class="sm-filter">@@ -114,8 +114,8 @@</div><p class="sm-filter-count" role="status" aria-live="polite"><span id="sm-filter-count"></span><span id="sm-filter-hint" aria-hidden="true"></span></p><section class="sm-new" id="sm-new" aria-labelledby="sm-new-title">- <h2 id="sm-new-title">Newest<a class="sm-new-more" href="/changelog">full changelog →</a></h2>- <p class="sm-section-desc">The 9 most recently launched pages, straight to the live surface.</p>+ <h2 id="sm-new-title" data-i18n-html="sitemap_index.newestfull_changelog">Newest<a class="sm-new-more" href="/changelog">full changelog →</a></h2>+ <p class="sm-section-desc" data-i18n="sitemap_index.the_9_most_recently_launched_pages_straight">The 9 most recently launched pages, straight to the live surface.</p><ul class="sm-list"><li><a href="/video-to-motion">@@ -192,22 +192,22 @@</ul></section><nav class="sm-toc" aria-label="Sections">- <a href="#main">Main</a>- <a href="#build">Build</a>- <a href="#labs">Labs</a>- <a href="#crypto">Crypto</a>- <a href="#agent-tools">Agent Tools</a>- <a href="#account">Account</a>- <a href="#learn">Learn</a>- <a href="#blog">Blog</a>- <a href="#legal">Legal</a>- <a href="#machine">Machine-readable</a>- <a href="#news">News</a>+ <a href="#main" data-i18n="sitemap_index.main">Main</a>+ <a href="#build" data-i18n="sitemap_index.build">Build</a>+ <a href="#labs" data-i18n="sitemap_index.labs">Labs</a>+ <a href="#crypto" data-i18n="sitemap_index.crypto">Crypto</a>+ <a href="#agent-tools" data-i18n="sitemap_index.agent_tools">Agent Tools</a>+ <a href="#account" data-i18n="sitemap_index.account">Account</a>+ <a href="#learn" data-i18n="sitemap_index.learn">Learn</a>+ <a href="#blog" data-i18n="sitemap_index.blog">Blog</a>+ <a href="#legal" data-i18n="sitemap_index.legal">Legal</a>+ <a href="#machine" data-i18n="sitemap_index.machine_readable">Machine-readable</a>+ <a href="#news" data-i18n="sitemap_index.news">News</a></nav><section class="sm-section" id="main"><header><h2><span data-i18n="sitemap_index.section_main">Main</span><span class="sm-count" data-count>75</span></h2>- <p class="sm-section-desc">Entry points into the product.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.entry_points_into_the_product">Entry points into the product.</p></header><ul class="sm-list"><li>@@ -741,7 +741,7 @@<section class="sm-section" id="build"><header><h2><span data-i18n="sitemap_index.section_build">Build</span><span class="sm-count" data-count>94</span></h2>- <p class="sm-section-desc">Create and customize an agent.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.create_and_customize_an_agent">Create and customize an agent.</p></header><ul class="sm-list"><li>@@ -1408,7 +1408,7 @@<section class="sm-section" id="labs"><header><h2><span data-i18n="sitemap_index.section_labs">Labs</span><span class="sm-count" data-count>26</span></h2>- <p class="sm-section-desc">Experimental features actively shipping. Expect fast iteration.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.experimental_features_actively_shipping_expe">Experimental features actively shipping. Expect fast iteration.</p></header><ul class="sm-list"><li>@@ -1599,7 +1599,7 @@<section class="sm-section" id="crypto"><header><h2><span data-i18n="sitemap_index.section_crypto">Crypto</span><span class="sm-count" data-count>170</span></h2>- <p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.on_chain_features_pay_per_call_token">On-chain features: pay-per-call, token launches, vanity wallets.</p></header><ul class="sm-list"><li>@@ -2798,7 +2798,7 @@<section class="sm-section" id="agent-tools"><header><h2><span data-i18n="sitemap_index.section_agent-tools">Agent Tools</span><span class="sm-count" data-count>11</span></h2>- <p class="sm-section-desc">Manage, talk to, and deploy individual agents.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.manage_talk_to_and_deploy_individual_agents">Manage, talk to, and deploy individual agents.</p></header><ul class="sm-list"><li>@@ -2884,7 +2884,7 @@<section class="sm-section" id="account"><header><h2><span data-i18n="sitemap_index.section_account">Account</span><span class="sm-count" data-count>15</span></h2>- <p class="sm-section-desc">Sign-in, dashboard, billing.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.sign_in_dashboard_billing">Sign-in, dashboard, billing.</p></header><ul class="sm-list"><li>@@ -2998,7 +2998,7 @@<section class="sm-section" id="learn"><header><h2><span data-i18n="sitemap_index.section_learn">Learn</span><span class="sm-count" data-count>509</span></h2>- <p class="sm-section-desc">Docs, tutorials, and reference.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.docs_tutorials_and_reference">Docs, tutorials, and reference.</p></header><ul class="sm-list"><li>@@ -6570,7 +6570,7 @@<section class="sm-section" id="blog"><header><h2><span data-i18n="sitemap_index.section_blog">Blog</span><span class="sm-count" data-count>39</span></h2>- <p class="sm-section-desc">Long-form announcements, launches, and writing from three.ws.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.long_form_announcements_launches_and_writing">Long-form announcements, launches, and writing from three.ws.</p></header><ul class="sm-list"><li>@@ -6924,7 +6924,7 @@<section class="sm-section" id="machine"><header><h2><span data-i18n="sitemap_index.section_machine">Machine-readable</span><span class="sm-count" data-count>18</span></h2>- <p class="sm-section-desc">Indexes and well-known files for crawlers and AI agents.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.indexes_and_well_known_files_for_crawlers">Indexes and well-known files for crawlers and AI agents.</p></header><ul class="sm-list"><li>@@ -7059,7 +7059,7 @@<section class="sm-section" id="news"><header><h2><span data-i18n="sitemap_index.section_news">News</span><span class="sm-count" data-count>112</span></h2>- <p class="sm-section-desc">Product launches, integrations, and announcements from three.ws.</p>+ <p class="sm-section-desc" data-i18n="sitemap_index.product_launches_integrations_and_announceme">Product launches, integrations, and announcements from three.ws.</p></header><ul class="sm-list"><li>@@ -7850,10 +7850,10 @@</section><div class="sm-empty" id="sm-empty" hidden><p><span data-i18n="sitemap_index.no_pages_match">No pages match</span> “<span id="sm-empty-q"></span>”.</p>- <p class="sm-empty-hint">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p>+ <p class="sm-empty-hint" data-i18n="sitemap_index.try_a_shorter_word_or_search_everything">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p><div class="sm-empty-actions">- <button type="button" id="sm-empty-clear">Clear filter</button>- <a id="sm-empty-search" href="/search">Search all of three.ws</a>+ <button type="button" id="sm-empty-clear" data-i18n="sitemap_index.clear_filter">Clear filter</button>+ <a id="sm-empty-search" href="/search" data-i18n="sitemap_index.search_all_of_three_ws">Search all of three.ws</a></div></div></main>diff --git a/src/agent-wallet-hub/tabs/withdraw.js b/src/agent-wallet-hub/tabs/withdraw.jsindex 8a0db6277..5e16315aa 100644--- a/src/agent-wallet-hub/tabs/withdraw.js+++ b/src/agent-wallet-hub/tabs/withdraw.js@@ -217,6 +217,9 @@ registerWalletTab({intent: null,result: null,submitErr: null,+ // Sweeper-bot read on the current intent's destination: null while+ // loading/unknown, { flagged, note, ... } once the simulate call answers.+ sweepRisk: null,};function subStrip() {@@ -349,8 +352,15 @@ registerWalletTab({} else if (wl) {destBadge = '<span class="awh-dest-tag">allowlist is off</span>';}+ const sweepBanner = state.sweepRisk?.flagged+ ? `<div class="awh-err" role="alert" style="margin-bottom:var(--space-3,12px);">+ <strong>⚠ This address looks drained by a sweeper bot.</strong>+ <div class="why" style="text-transform:none; margin-top:4px;">${esc(state.sweepRisk.note)}</div>+ </div>`+ : '';return `<div class="awh-card">+ ${sweepBanner}<div class="awh-sum"><div class="r"><span>Asset</span><span class="v">${esc(it.assetName)}</span></div><div class="r"><span>Amount</span><span class="v">${it.isMax ? 'Max — ' : ''}${esc(fmtAmount(it.amount, it.decimals))} ${esc(it.assetName)}</span></div>@@ -470,24 +480,48 @@ registerWalletTab({isMax, amount: isMax ? Number(a.max) : amt, destination: state.resolvedDest,idem: (crypto?.randomUUID?.() || `wd-${Date.now()}-${Math.round(Math.random() * 1e9)}`),};+ state.sweepRisk = null;state.phase = 'confirm';render();// Best-effort: pull the spend limits so the confirm step can show the// allowlist-match badge. Non-blocking — the irreversibility warning and// server-side enforcement do not depend on it.if (state.limits === null) loadLimits();+ loadSweepRisk();});}- async function submitWithdraw() {+ // Reads the destination's recent on-chain history (via the withdraw+ // endpoint's `simulate` path, which moves no funds) to warn before the+ // owner sends into a sweeper bot. Best-effort: `checked: false` or a+ // failed call leaves state.sweepRisk unflagged: the server re-checks and+ // blocks on submit regardless, so this is a preview, not the only gate.+ async function loadSweepRisk() {+ const it = state.intent;+ if (!it) return;+ const res = await call(base('withdraw'), {+ method: 'POST',+ body: { asset: it.kind, amount: it.isMax ? 'max' : it.amount, destination: it.destination, network: ctx.getNetwork(), simulate: true },+ });+ if (destroyed || state.intent !== it) return;+ state.sweepRisk = (res.ok && res.data?.sweepRisk?.checked) ? res.data.sweepRisk : null;+ if (state.phase === 'confirm') render();+ }++ async function submitWithdraw(opts = {}) {const it = state.intent;if (!it || state.phase === 'sending') return;if (ctx.getNetwork() !== 'devnet' && !(await ensureRiskAck({ context: 'withdraw' }))) return;+ let sweepAck = opts.sweepAck === true;+ if (!sweepAck && state.sweepRisk?.flagged) {+ if (!confirm(`This address looks drained by a sweeper bot.\n\n${state.sweepRisk.note}\n\nSend anyway?`)) return;+ sweepAck = true;+ }state.phase = 'sending';render();const res = await call(base('withdraw'), {method: 'POST',- body: { asset: it.kind, amount: it.isMax ? 'max' : it.amount, destination: it.destination, network: ctx.getNetwork(), idempotency_key: it.idem },+ body: { asset: it.kind, amount: it.isMax ? 'max' : it.amount, destination: it.destination, network: ctx.getNetwork(), idempotency_key: it.idem, sweep_risk_ack: sweepAck },});if (res.ok || res.status === 202) {state.result = res.ok ? res.data : (res.extra || {});@@ -499,6 +533,15 @@ registerWalletTab({state.limits = null;return;}+ // The server re-checks the sweep risk at submit time (the simulate preview+ // above can be stale or have failed to load); this is the one case where+ // its 403 means "ask the owner", not "refuse the withdrawal".+ if (!sweepAck && res.code === 'destination_sweep_risk') {+ const note = res.detail?.sweepRisk?.note || res.message;+ if (confirm(`This address looks drained by a sweeper bot.\n\n${note}\n\nSend anyway?`)) {+ return submitWithdraw({ sweepAck: true });+ }+ }state.phase = 'confirm';render();const errEl = panel.querySelector('#awh-cf-err');@@ -511,6 +554,7 @@ registerWalletTab({function resetForm() {state.phase = 'form'; state.intent = null; state.result = null;state.dest = ''; state.resolvedDest = null; state.amount = ''; state.selectedAsset = 0; state.unconfirmed = false;+ state.sweepRisk = null;}async function loadHoldings() {diff --git a/tests/agent-custody-guards.test.js b/tests/agent-custody-guards.test.jsindex 539c10b0d..11d2361ce 100644--- a/tests/agent-custody-guards.test.js+++ b/tests/agent-custody-guards.test.js@@ -36,6 +36,13 @@ vi.mock('../api/_lib/anomaly-events.js', () => ({guardOutboundAnomaly: vi.fn(async () => ({ decision: 'allow', verdict: null, anomalyId: null, froze: false })),}));+// The sweeper-bot check is an RPC-backed heuristic with its own dedicated unit+// tests (burned-destination.test.js) against a pure classifier; stub it here so+// the allowlist/ceiling tests below stay off the network and deterministic.+vi.mock('../api/_lib/burned-destination.js', () => ({+ checkBurnedDestination: vi.fn(async () => ({ checked: false, flagged: false, verdict: 'unknown', note: 'not checked in this test' })),+}));+const guards = await import('../api/_lib/agent-trade-guards.js');const {validateSolanaAddress, normalizeSpendLimits, enforceSpendLimit, SpendLimitError,diff --git a/tests/agent-wallet-withdraw.test.js b/tests/agent-wallet-withdraw.test.jsindex 111e33092..2698933e9 100644--- a/tests/agent-wallet-withdraw.test.js+++ b/tests/agent-wallet-withdraw.test.js@@ -129,6 +129,7 @@ vi.mock('../api/_lib/agent-trade-guards.js', () => ({catch { return { valid: false, reason: 'not_pubkey' }; }}),enforceSpendLimit: vi.fn(async () => { if (guardState.enforceThrow) throw guardState.enforceThrow; return { ok: true }; }),+ checkDestinationSweepRisk: vi.fn(async () => ({ checked: false, flagged: false, verdict: 'unknown', note: 'not checked in this test' })),lamportsToUsd: vi.fn(async () => 100),getSpendLimits: vi.fn(() => ({ daily_usd: null, per_tx_usd: null, withdraw_allowlist: [] })),setSpendLimits: vi.fn(async () => ({ daily_usd: null, per_tx_usd: null, withdraw_allowlist: [] })),diff --git a/tests/burned-destination.test.js b/tests/burned-destination.test.jsnew file mode 100644index 000000000..97208cfac--- /dev/null+++ b/tests/burned-destination.test.js@@ -0,0 +1,80 @@+// classifySweepPattern is pure: no RPC, no network. These tests build+// synthetic recorded-transaction-history deltas (never a real wallet) to+// exercise every verdict branch, including the chronological-ordering fix+// over the upstream CLI this module was ported from (see the file header in+// api/_lib/burned-destination.js): an outflow is only "quick" if it follows+// the nearest PRIOR inflow within the window, not merely an inflow seen+// later in an unsorted scan.++import { describe, expect, it } from 'vitest';+import { classifySweepPattern, NEAR_ZERO_LAMPORTS, QUICK_OUT_WINDOW_MS } from '../api/_lib/burned-destination.js';++const T0 = 1_700_000_000_000;++describe('classifySweepPattern', () => {+ it('flags a destination that is drained within seconds of every inflow, repeatedly', () => {+ const deltas = [+ { deltaSol: 0.5, blockTimeMs: T0 },+ { deltaSol: -0.49, blockTimeMs: T0 + 5_000 },+ { deltaSol: 1.2, blockTimeMs: T0 + 60_000 },+ { deltaSol: -1.18, blockTimeMs: T0 + 65_000 },+ ];+ const result = classifySweepPattern({ balanceLamports: 1000, deltas, sigCount: 4, sigLimit: 25 });+ expect(result.verdict).toBe('likely_swept');+ expect(result.flagged).toBe(true);+ expect(result.quickOutflows).toBe(2);+ });++ it('flags a near-zero destination with churn when history is truncated at the signature limit, even without a timed quick-out', () => {+ const deltas = [+ { deltaSol: 2, blockTimeMs: T0 },+ { deltaSol: -2, blockTimeMs: T0 + 10 * 60_000 },+ ];+ const result = classifySweepPattern({ balanceLamports: 0, deltas, sigCount: 25, sigLimit: 25 });+ expect(result.verdict).toBe('likely_swept');+ expect(result.flagged).toBe(true);+ });++ it('does not flag a near-zero destination whose single old outflow is unrelated to a much later inflow', () => {+ // Chronologically: inflow, then (long after) an outflow, with nothing+ // quick about the gap. Feeding these in reverse order is exactly what+ // trips up an unsorted, newest-first scan like the upstream CLI's.+ const deltas = [+ { deltaSol: -1, blockTimeMs: T0 + 10 * 60_000 },+ { deltaSol: 1, blockTimeMs: T0 },+ ];+ const result = classifySweepPattern({ balanceLamports: 0, deltas, sigCount: 2, sigLimit: 25 });+ expect(result.quickOutflows).toBe(0);+ expect(result.verdict).toBe('empty_active_history');+ expect(result.flagged).toBe(false);+ });++ it('reports "empty, active history" for a near-zero address with activity but no churn pattern', () => {+ const deltas = [{ deltaSol: 1, blockTimeMs: T0 }];+ const result = classifySweepPattern({ balanceLamports: 0, deltas, sigCount: 1, sigLimit: 25 });+ expect(result.verdict).toBe('empty_active_history');+ expect(result.flagged).toBe(false);+ });++ it('reports "holds a balance" for a funded address regardless of history', () => {+ const result = classifySweepPattern({ balanceLamports: NEAR_ZERO_LAMPORTS + 1, deltas: [], sigCount: 0, sigLimit: 25 });+ expect(result.verdict).toBe('holds_balance');+ expect(result.flagged).toBe(false);+ });++ it('reports "no activity" for an empty, never-used address', () => {+ const result = classifySweepPattern({ balanceLamports: 0, deltas: [], sigCount: 0, sigLimit: 25 });+ expect(result.verdict).toBe('no_activity');+ expect(result.flagged).toBe(false);+ });++ it('treats an outflow exactly at the quick-out window boundary as quick', () => {+ const deltas = [+ { deltaSol: 1, blockTimeMs: T0 },+ { deltaSol: -1, blockTimeMs: T0 + QUICK_OUT_WINDOW_MS },+ ];+ const result = classifySweepPattern({ balanceLamports: 0, deltas, sigCount: 2, sigLimit: 25 });+ expect(result.quickOutflows).toBe(1);+ expect(result.verdict).toBe('likely_swept');+ });+});