Repository Analysis

unicity-sphere/sphere-sdk

The SDK for autonomous economic agents. Give an agent an identity, a wallet, and the ability to find, negotiate with, and settle with other agents - peer-to-peer, with perfect privacy and ultra-fast finality

3.9 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of unicity-sphere/sphere-sdk, a TypeScript project with 5,397 GitHub stars. SynthScan v2.0 examined 101,215 lines of code across 324 source files, recording 177 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 3.9 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

3.9
Adjusted Score
3.9
Raw Score
100%
Time Factor
2026-08-28
Last Push
5.4K
Stars
TypeScript
Language
101.2K
Lines of Code
324
Files
177
Pattern Hits
2026-08-29
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 0MEDIUM 91LOW 86

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 177 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators89 hits · 273 pts
SeverityFileLineSnippetContext
MEDIUMeslint.config.js11 // ── Code budget ─────────────────────────────────────────────────────────────COMMENT
MEDIUMeslint.config.js43 // ── token-engine boundary ───────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/mailbox.ts161 // ── deliver ────────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/mailbox.ts250 // ── incoming ───────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/mailbox.ts310 // ── ack ────────────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/mailbox.ts397 // ── seen-set (S7) ──────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/session.ts180 // ── lifecycle ─────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/session.ts203 // ── auth cell (F8/F14) ────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/session.ts283 // ── epoch latch (F12) ─────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/session.ts323 // ── streams ───────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/session.ts352 // ── wake socket ───────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts175 // ── auth ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts193 // ── inventory / blobs ────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts254 // ── intents ──────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts303 // ── mailbox ──────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts335 // ── history ──────────────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts352 // ── payment requests ─────────────────────────────────────────────────────COMMENT
MEDIUMimpl/wallet-api-v2/client.ts379 // ── realtime ─────────────────────────────────────────────────────────────COMMENT
MEDIUMoracle/oracle-provider.ts30 // ── v2 token-engine config surface ─────────────────────────────────────────COMMENT
MEDIUMtests/unit/token-engine/FakeTokenEngine.ts223 // ── internals ──────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/providers.test.ts77// ── contract harnesses ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/providers.test.ts124// ── targeted: storage fan-out ─────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/providers.test.ts189// ── targeted: delivery ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/providers.test.ts362// ── targeted: checkpoints ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts100 // ── auth (not modeled by FakeWalletApi) ──────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts122 // ── inventory / blobs ────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts193 // ── intents ──────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts234 // ── mailbox ──────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts287 // ── history ──────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/fake-client.ts303 // ── payment requests ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts9// ── errors (statusCode mirrors ../wallet-api/src/lib/errors.ts) ──────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts49// ── wire/domain types ─────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts212// ── pure helpers (exported for tests and later phases) ───────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts272// ── internal rows ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts367// ── the fake ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts409 // ── shared internals ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts508 // ── blobs ───────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts523 // ── inventory ───────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts675 // ── intents ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts809 // ── mailbox ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts1057 // ── history ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts1101 // ── payment requests ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts1229 // ── sync epoch + wakes ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/unit/payments-v2/fakes/FakeWalletApi.ts1313// ── module-level helpers ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/integration/sphere-payments-v2-restore.test.ts233 // ── pre-restore durable state ────────────────────────────────────────────COMMENT
MEDIUMtests/e2e/sphere-paymentsv2-wiring.staging.e2e.test.ts119// ── one wallet, rebuildable on the SAME storage (resume rides re-init) ──────COMMENT
MEDIUMtests/e2e/support/vertical.ts66// ── shared plumbing ──────────────────────────────────────────────────────────COMMENT
MEDIUMtests/e2e/support/vertical.ts306// ── keep-open convergence (the ONLY answer to a degraded aggregator) ─────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts209 // ── identity ────────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts220 // ── value (read) ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts257 // ── lifecycle ────────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts567 // ── verification ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts600 // ── serialization ────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/SphereTokenEngine.ts623 // ── internals ────────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/engine.ts92 // ── identity / recipients ───────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/engine.ts104 // ── value (read) ─────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/engine.ts147 // ── verification ──────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/engine.ts159 // ── serialization ──────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/engine.ts176 // ── teardown ───────────────────────────────────────────────────────────────COMMENT
MEDIUMtoken-engine/types.ts18// ── identity / recipients ─────────────────────────────────────────────────────COMMENT
29 more matches not shown…
Structural Annotation Overuse29 hits · 58 pts
SeverityFileLineSnippetContext
LOWdocs/QUICKSTART-NODEJS.md218// Step 1: Create base providersCOMMENT
LOWdocs/QUICKSTART-NODEJS.md256// Step 2: Attach the wallet-api transport config (required for money)COMMENT
LOWdocs/INTEGRATION.md114### Step 1: Create Base ProvidersCOMMENT
LOWdocs/INTEGRATION.md177### Step 2: Attach the Wallet-Api Transport ConfigCOMMENT
LOWdocs/INTEGRATION.md205### Step 3: Initialize the WalletCOMMENT
LOWdocs/INTEGRATION.md237// Step 1: Base providersCOMMENT
LOWdocs/INTEGRATION.md244// Step 2: Attach the wallet-api transport configCOMMENT
LOWdocs/INTEGRATION.md251// Step 3: Initialize walletCOMMENT
LOWdocs/INTEGRATION.md257// Step 4: Use payments (sender-driven, certified on-chain, delivered via mailbox)COMMENT
LOWdocs/QUICKSTART-BROWSER.md39 // Step 1: Create base providers (storage + transport + oracle)COMMENT
LOWdocs/QUICKSTART-BROWSER.md45 // Step 2: Attach the wallet-api transport config (REQUIRED — Sphere.initCOMMENT
LOWdocs/QUICKSTART-BROWSER.md53 // Step 3: Initialize walletCOMMENT
LOWdocs/QUICKSTART-BROWSER.md83 // Step 1: Create base providersCOMMENT
LOWdocs/QUICKSTART-BROWSER.md89 // Step 2: Attach the wallet-api transport config (REQUIRED — money rides the wallet-api vertical)COMMENT
LOWdocs/QUICKSTART-BROWSER.md96 // Step 3: Initialize walletCOMMENT
LOWdocs/QUICKSTART-BROWSER.md160 // Step 1: Create base providersCOMMENT
LOWdocs/QUICKSTART-BROWSER.md166 // Step 2: Attach the wallet-api transport config (REQUIRED — money rides the wallet-api vertical)COMMENT
LOWdocs/QUICKSTART-BROWSER.md173 // Step 3: Initialize walletCOMMENT
LOWdocs/QUICKSTART-BROWSER.md221 // Step 1: Create base providersCOMMENT
LOWdocs/QUICKSTART-BROWSER.md227 // Step 2: Attach the wallet-api transport config (REQUIRED — money rides the wallet-api vertical)COMMENT
LOWdocs/QUICKSTART-BROWSER.md234 // Step 3: Initialize walletCOMMENT
LOWdocs/QUICKSTART-BROWSER.md276// Step 1: Base providers (required for network, oracle, transport)COMMENT
LOWdocs/QUICKSTART-BROWSER.md309// Step 2: Attach the wallet-api transport config (REQUIRED for money)COMMENT
LOWdocs/QUICKSTART-BROWSER.md316// Step 3: Initialize wallet with the composed providersCOMMENT
LOWdocs/QUICKSTART-BROWSER.md582 // Step 1: Create base providersCOMMENT
LOWdocs/QUICKSTART-BROWSER.md588 // Step 2: Attach the wallet-api transport config (REQUIRED — money rides the wallet-api vertical)COMMENT
LOWdocs/QUICKSTART-BROWSER.md595 // Step 3: Initialize walletCOMMENT
LOWregistry/TokenRegistry.ts215 // Step 1: Try loading from cacheCOMMENT
LOWregistry/TokenRegistry.ts229 // Step 2: Cache miss — wait for first remote fetch (only when auto-refresh is enabled)COMMENT
Hyper-Verbose Identifiers30 hits · 30 pts
SeverityFileLineSnippetContext
LOWconstants.ts121export function isNetworkScopedAddressKey(key: string): boolean {CODE
LOWimpl/nodejs/transport/index.ts29export function createNodeWebSocketFactory(): WebSocketFactory {CODE
LOWimpl/nodejs/transport/index.ts42export function createNostrTransportProvider(CODE
LOWimpl/nodejs/oracle/index.ts77export function createNodeTrustBaseLoader(CODE
LOWimpl/nodejs/oracle/index.ts91export function createUnicityAggregatorProvider(CODE
LOWimpl/nodejs/storage/FileStorageProvider.ts239export function createFileStorageProvider(config: FileStorageProviderConfig | string): FileStorageProvider {CODE
LOWimpl/browser/transport/index.ts43export function createNostrTransportProvider(CODE
LOWimpl/browser/oracle/index.ts77export function createBrowserTrustBaseLoader(CODE
LOWimpl/browser/oracle/index.ts91export function createUnicityAggregatorProvider(CODE
LOWimpl/browser/storage/IndexedDBStorageProvider.ts404export function createIndexedDBStorageProvider(CODE
LOWimpl/browser/storage/LocalStorageProvider.ts267export function createLocalStorageProvider(CODE
LOWimpl/browser/connect/ExtensionTransport.ts30export function isExtensionConnectEnvelope(data: unknown): data is ExtensionConnectEnvelope {CODE
LOWcore/errors.ts241export function isPossiblyCommittedSendOutcome(err: unknown): boolean {CODE
LOWcore/crypto.ts437export function generateAddressFromMasterKey(CODE
LOWcore/crypto.ts567export function recoverPubkeyFromSignature(message: string, signature: string): string {CODE
LOWcore/delivery-envelope.ts67export function deriveDeliveryEncryptionKey(privKeyHex: string, peerPubkeyHex: string): Uint8Array {CODE
LOWcore/transport-resolver.ts71export function createTransportAddressResolver(CODE
LOWserialization/wallet-text.ts162export function serializeEncryptedWalletToText(params: {CODE
LOWserialization/wallet-text.ts317export function parseAndDecryptWalletText(CODE
LOW…/unit/transport/NostrTransportProvider.nametag.test.ts20function deriveNametagEncryptionKey(privateKeyHex: string): Uint8Array {CODE
LOWtests/unit/transport/NostrTransportProvider.test.ts546 function createProviderWithStorage(storage: { get: ReturnType<typeof vi.fn>; set: ReturnType<typeof vi.fn> }) {CODE
LOWtests/unit/core/Sphere.nametag-sync.test.ts307 function createMockTransportWithRecovery(options: {CODE
LOW…s/unit/payments-v2/contracts/delivery-port.contract.ts66export function describeDeliveryPortContract(CODE
LOW…ts/unit/payments-v2/contracts/storage-port.contract.ts55export function describeStoragePortContract(CODE
LOWtests/integration/wallet-clear-indexeddb.test.ts90function simulateStrictModeLeakedConnection(dbName: string): Promise<IDBDatabase> {CODE
LOWtests/e2e/sphere-paymentsv2-wiring.staging.e2e.test.ts210async function sendConvergedThroughThrottle(CODE
LOWtoken-engine/factory.ts61export function createWorkerTokenVerifier(config: VerificationWorkerConfig): DisposableTokenVerifier {CODE
LOWmodules/communications/CommunicationsModule.ts813export function createCommunicationsModule(CODE
LOWmodules/payments-v2/recipient.ts17export async function requireSameNetworkRecipient(CODE
LOWmodules/payments-v2/compose.ts36export function supportsDeterministicMint(CODE
Over-Commented Block23 hits · 23 pts
SeverityFileLineSnippetContext
LOWtsup.config.ts1import { defineConfig } from 'tsup';COMMENT
LOWtsup.shared.js1// Shared tsup build configuration (sphere-sdk#548).COMMENT
LOWindex.ts261 // NetworksCOMMENT
LOWimpl/browser/connect/PostMessageTransport.ts121 /**COMMENT
LOWtransport/MultiAddressTransportMux.ts161 private eventCallbacks: Set<TransportEventCallback> = new Set();COMMENT
LOWtransport/NostrTransportProvider.ts261COMMENT
LOWcore/Sphere.ts2221 // Update active module references for backward compatibilityCOMMENT
LOWcore/errors.ts41 // Split burn checkpoint (sdk-changes E.4, sphere-sdk#501) — all keep-open (token-engine/errors.ts):COMMENT
LOW…sts/unit/impl/browser/IndexedDBStorageProvider.test.ts181 });COMMENT
LOW…ransport/MultiAddressTransportMux.sharedClient.test.ts281 // must not run — the sub-call counter stays where it was.COMMENT
LOW…ransport/MultiAddressTransportMux.sharedClient.test.ts441 // Across both layers: exactly one NostrClient was constructed (byCOMMENT
LOWtests/unit/payments-v2/receive.test.ts761 // refresh is a separate call it makes after this resolves.COMMENT
LOW…s/unit/payments-v2/recipient-network.transport.test.ts1// §5.6 cross-network recipient gate, driven from the RELAY (#733/#734).COMMENT
LOWtests/integration/kv-network-isolation-extra.test.ts181 // enumeration — getFullKey('') resolves to the bare base prefix ('sphere_'),COMMENT
LOWtests/integration/wallet-password.test.ts201 transport: createMockTransport(),COMMENT
LOWtests/aggregator/docker/docker-compose.yml1# The local aggregator stack the `test:aggregator` suite runs against.COMMENT
LOWdocs/API.md521#### `deleteGroup(groupId: string): Promise<boolean>`COMMENT
LOWdocs/CONNECT.md201 // Called when a dApp explicitly disconnects — clean up any persisted permissionsCOMMENT
LOWtoken-engine/SphereTokenEngine.ts361 // Value conservation is enforced inside the SDK split (root.value === source value).COMMENT
LOWtoken-engine/SphereTokenEngine.ts381 // EVERY leg (no leg abandoned mid-submit) and rethrows the LOWEST-index rejection,COMMENT
LOWtoken-engine/SphereTokenEngine.ts401 // the certified sibling with no checkpoint recovery (Codex P1 on #684). So, in order:COMMENT
LOWconnect/host/ConnectHost.ts621 ),COMMENT
LOWconnect/host/ConnectHost.ts1101 if (!eventName) throw new SphereError('Missing required parameter: event', 'VALIDATION_ERROR');COMMENT
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMtransport/NostrTransportProvider.ts262 // Create NostrClient with robust connection handling:COMMENT
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippetContext
LOWregistry/TokenRegistry.ts215 // Step 1: Try loading from cacheCOMMENT
LOWregistry/TokenRegistry.ts229 // Step 2: Cache miss — wait for first remote fetch (only when auto-refresh is enabled)COMMENT
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/unit/core/utils.test.ts222 expect(extractFromText(text, pattern)).toBe('John Doe');CODE
LOWtests/unit/token-engine/FakeTokenEngine.ts290// fake-token state: CBOR array[ tokenId, stateId, owner, genesisData?, transferMemo? ]COMMENT
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMCLAUDE.md369│ │ ├── PaymentsFacade.ts # Facade: lifecycle, send/mint/receive orchestrationCODE