Core Node SDK/runtime utility package for Arken protocol, data handling, and game-platform support services.
trpc/: socket transport wrappers for tRPC request/response lifecycle (actively hardened).test/: protocol-focused tests for socket client/server wrappers (including listener-API safety checks for sockets missingon/off).legacy/: backward-compatibility layer for historical game/content/contract metadata.time/: shared scheduling/time utilities used across runtime paths.data/: bundled artifacts and ZK-related support assets.web3/: legacy JSON-RPC provider helper with browser-cache assumptions and hardcoded endpoint selection.scripts/: artifact-regeneration utilities (currently ZKupdateLeafGroth16 setup flow).types/: ambient declaration augmentations (mongoosequeryasJSON) with compile-time drift risk tied to upstream generic signatures..rush/: Rush cache metadata (temp/shrinkwrap-deps.json) that affects dependency determinism and lock reconciliation; temp leaf now includes conciseREADME.md+ANALYSIS.mdguardrails..erb/: documentation/scaffolding branding assets (currentlyimg/logo.png) with low runtime risk but potential UX drift if assets are changed ad hoc.coverage/: generated LCOV/Clover/JSON coverage artifacts; useful diagnostics but should remain generated-only to avoid noisy/manual drift (now documented with localcoverage/{README.md,ANALYSIS.md}).websocket.ts: lightweight socket helper exposingemitAll/emitDirectandgetClientSocket; currently uses untyped emitter params and no explicit reconnect/backoff policy controls at this utility boundary.api.ts: query-to-Mongo filter adapter (getFilter) and HTTP POST helper (fetch) used for dynamic filtering and remote query dispatch; id-field normalization applies consistently acrossequals/contains/inoperators, scalar shorthand field values map to equality filters (root + nested logical nodes), non-plain object values (e.g.,Date, ObjectId-like values) are preserved as equality filters, plain-object values without operator keys are now preserved as direct equality filters (instead of being silently dropped), logical nesting preserves childORgroups inside parentANDclauses, singleton-object shorthand for logical groups (OR/ANDas object instead of array) is normalized for resilient filter parsing, emptyin: []clauses are now treated as no-op fragments (avoids accidental always-empty result filters in mixed logical queries), and the HTTP helper now fail-fast validates URL/query payload shape, trims validated URL input before dispatch, and applies a deterministic axios timeout to avoid unbounded hangs.util.ts: currently re-exports from'.', creating a circular/umbrella alias surface that can obscure intended subpath ownership.- root build/test config (
package.json,tsconfig*.json,jest.unit.config.js): defines compile/test pipeline, export surface, and strictness defaults for the whole package.
This package is a foundational SDK layer for a Steam/Battle.net-like ecosystem (multi-game runtime + launcher/liveops integrations). Reliability priorities are:
- Transport correctness and resiliency (timeouts, retries, error envelopes).
- Deterministic content/economy data contracts.
- Operational observability and typed boundaries across subsystems.
- Mixed legacy and modern patterns (typed + untyped maps).
- Generated data and runtime assumptions need stronger schema/test guardrails.
- Utility modules (time/task queue) need production-grade control surfaces.
api.tsfilter translation relies on looseanyquery shapes and dynamic regex construction, creating contract-drift and query-performance risk without targeted tests.- Root TS/Jest config remains intentionally permissive (
strict: false,noImplicitAny: false, broad coverage collection), which can hide contract drift and inflate test-runtime cost. util.tswildcard re-export from package root can blur module boundaries and increase accidental circular import/export behavior during build refactors.
- Continue bottom-up analysis for remaining leaf folders before refining parent summaries further.
- Add protocol edge-case tests (id collisions, late responses, malformed payload permutations).
- Expand folder README/ANALYSIS coverage with explicit cross-folder dependency notes.
- Add focused tests for
api.tsgetFiltersemantics (OR/ANDnesting, id/_id mapping, empty-contains no-op, and regex escaping). - Add build/test config guard checks (export-map path validity and duplicate include-path cleanup) to reduce packaging drift.
- Clarify
util.tsownership intent (keep alias intentionally or replace with explicit utility exports) and add a smoke test for subpath import behavior.