Goals¶
Measurable success criteria for the CyberEco Hub Data Layer. Each goal has a clear pass/fail test.
Build & Quality¶
- All 4 packages build successfully from a clean clone:
npm ci && npm run build - All packages pass type checking:
npm run type-checkreturns zero errors - All tests pass:
npm run testwith no Firebase emulators required - Zero
anytypes in public API signatures (enforced by ESLint rule) - All public functions and interfaces have JSDoc documentation
- Bundle analysis:
@cyber-eco/typesadds 0 bytes to a production build (types-only)
Architecture¶
-
@cyber-eco/serviceshas zero imports fromfirebase/*— verified bygrep -r "firebase" packages/services/src/returning no results -
MockStorageAdapterenables full test coverage of all domain services without Firebase emulators or network calls -
createDataLayer()factory produces a fully wired data layer instance with a single function call - The
DataLayerServiceorchestrator correctly executes: permission check -> cache lookup -> adapter fetch -> cache set -> return (for reads) and permission check -> adapter write -> cache invalidate -> sync broadcast -> webhook emit (for writes) - All domain services (SharedData, Permission, Dashboard, Export, Notification) receive
IDataLayerServicevia constructor injection — no module-level state
Test Coverage¶
-
@cyber-eco/servicescore services: >90% line coverage -
@cyber-eco/servicesdomain services: >80% line coverage -
@cyber-eco/firebaseadapter: >80% line coverage (with mocked Firebase) -
@cyber-eco/authutilities and services: >70% line coverage (migrated from existing tests)
Compatibility¶
- The monorepo (
cybereco-monorepo) can install the published packages and replace currentlibs/imports with zero runtime behavior changes - Hub app builds and passes its existing test suite after migration
- JustSplit app builds and passes its existing test suite after migration
- Website app builds after migration (it has minimal data layer usage)
Developer Experience¶
- A new developer can understand the architecture by reading
docs/ARCHITECTURE.mdalone - A new CyberEco app can integrate the data layer by following a 10-step guide in the README
-
npm run buildcompletes in under 30 seconds on a modern machine (Turborepo caching) - Adding a new domain service requires creating one file and registering it in the factory — no other changes needed
Publishing¶
- All 4 packages published to GitHub Packages under
@cyber-ecoscope - Changesets workflow: changeset -> version PR -> merge -> auto-publish works end-to-end
- All packages share the same version number (fixed versioning)
- Pre-release versions (
0.x.0-alpha.N) can be published for testing
MCP Server¶
- MCP server starts without errors:
cd mcp-server && uv run cybereco-mcp - All 7 tools respond with valid JSON when invoked
- All resources return documentation content
- All prompts generate valid integration/debugging guides
- MCP server can be installed via
uvx --from ./mcp-server cybereco-mcp
Tokenomics (2027-2030)¶
- CYE token specification complete with supply model, distribution, and vesting schedule
- Governance model defined: quadratic voting, proposal lifecycle, quorum requirements
- Incentive mechanisms specified: data hosting rewards, network healing, uptime staking, compute contribution
- Fee structure defined with free tier and fee distribution model
- Integration path documented:
TokenizedStorageAdapterwrapping existing adapters
P2P & Multi-Network (2026-2030)¶
-
TransportAdapterinterface defined in@cyber-eco/types - At least 2 transport implementations prototyped (WiFi Direct + Internet)
-
P2PStorageAdapterpasses the same test suite asMockStorageAdapter - CRDT-based conflict resolution handles concurrent offline edits correctly
-
MultiTransportManagerroutes messages across available transports automatically - Store-and-forward delivers messages across network partitions
Encrypted Computation (2025-2030)¶
- Phase A: Client-side AES-256-GCM encryption of sensitive fields via
EncryptedStorageAdapter - Phase B: TEE-based permission evaluation on compatible hardware
- Phase C: FHE batch analytics on encrypted financial data
- Phase D: MPC protocol for private group expense splitting
- Key management: per-user key hierarchy with secure storage on each platform