Implements the §7.1 policy in code so Token-2022 (pump.fun) tokens are cleanable
when safe:
- @pyre/core: extensions.ts (BLOCKING/FLAGGED/SAFE sets + evaluateTokenExtensions);
classify.ts gates Token-2022 on account+mint extensions; unknown extension or
confidential-transfer/withheld-fee -> UNSUPPORTED; transfer-hook/permanent-
delegate/pausable -> cleanable+flagged. Added malformed-u64-balance guard.
- @pyre/solana: parseTokenAccounts reads account extensions + withheld fee, and
batch-fetches MINT extensions (getMultipleParsedAccounts, chunked).
SECURITY (from audit): mint-fetch failure no longer silently downgrades to
account-level-only (which could hide a mint-level blocking extension). Token-2022
accounts with unverified mints are marked extensionsVerified=false and classified
UNSUPPORTED ("unknown means skip"). Two audit agents: integration SHIP; security
found this CRITICAL -> fixed + tested.
Tests: core 85, solana 8. Live verified: the two pump.fun Token-2022 tokens now
classify INCINERATE_ONLY (were UNSUPPORTED). classic-SPL behavior unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pyre/core
Shared types and business logic for PYRE / Prometheus Protocol.
Purpose
The canonical home for cross-cutting type definitions and (eventually) pure
business logic shared by apps/* and the other packages/*. Per §13 its
responsibilities are:
- Classification enums —
TokenClassification(§6). - Risk rules — conservative safety-rule types/constants (§7). Placeholder.
- Shared DTOs — request/response shapes for the HTTP API (§14).
- Receipt schema —
CleanupReceipt(§8, §15). - Prometheus I/O schema —
PrometheusInput/PrometheusOutput(§9).
This package carries real type definitions but no application logic in the skeleton.
Modules
src/classification.ts—TokenClassificationenum.src/dto.ts— API request/response DTOs.src/receipt.ts— cleanup receipt schema.src/prometheus.ts— Prometheus meta-mixer input/output.src/risk.ts— risk-rule placeholder.
TODO
- Define concrete risk-rule identifiers, threshold shapes, and pure evaluators.
- Tighten DTO shapes flagged
TODOonce the scan/classify/build pipeline lands. - Define the concrete token
metadataJSON shape used by receipts and Prometheus.