holosphere 2.0.0-alpha0 → 2.0.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +473 -0
- package/FEATURES.md +431 -0
- package/LICENSE +29 -42
- package/LICENSE-AGPL.md +180 -0
- package/README.md +97 -16
- package/dist/2019-D2OG2idw.js +6680 -0
- package/dist/2019-D2OG2idw.js.map +1 -0
- package/dist/2019-EION3wKo.cjs +8 -0
- package/dist/2019-EION3wKo.cjs.map +1 -0
- package/dist/_commonjsHelpers-C37NGDzP.cjs +2 -0
- package/dist/_commonjsHelpers-C37NGDzP.cjs.map +1 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +7 -0
- package/dist/_commonjsHelpers-CUmg6egw.js.map +1 -0
- package/dist/browser-BSniCNqO.js +3058 -0
- package/dist/browser-BSniCNqO.js.map +1 -0
- package/dist/browser-Cq59Ij19.cjs +2 -0
- package/dist/browser-Cq59Ij19.cjs.map +1 -0
- package/dist/cdn/holosphere.min.js +55 -0
- package/dist/cdn/holosphere.min.js.map +1 -0
- package/dist/cjs/holosphere.cjs +2 -0
- package/dist/cjs/holosphere.cjs.map +1 -0
- package/dist/esm/holosphere.js +53 -0
- package/dist/esm/holosphere.js.map +1 -0
- package/dist/index-DDGt_V9o.cjs +12 -0
- package/dist/index-DDGt_V9o.cjs.map +1 -0
- package/dist/index-DJXftyvB.js +39841 -0
- package/dist/index-DJXftyvB.js.map +1 -0
- package/dist/index-DMbdcMtK.cjs +18 -0
- package/dist/index-DMbdcMtK.cjs.map +1 -0
- package/dist/index-DeZ1xz_s.js +15104 -0
- package/dist/index-DeZ1xz_s.js.map +1 -0
- package/dist/indexeddb-storage-BFt6hMeF.js +176 -0
- package/dist/indexeddb-storage-BFt6hMeF.js.map +1 -0
- package/dist/indexeddb-storage-BK5tv4Sh.cjs +2 -0
- package/dist/indexeddb-storage-BK5tv4Sh.cjs.map +1 -0
- package/dist/memory-storage-C9HuoL2E.js +91 -0
- package/dist/memory-storage-C9HuoL2E.js.map +1 -0
- package/dist/memory-storage-Dao7jfYG.cjs +2 -0
- package/dist/memory-storage-Dao7jfYG.cjs.map +1 -0
- package/dist/secp256k1-BbKzbLtD.cjs +12 -0
- package/dist/secp256k1-BbKzbLtD.cjs.map +1 -0
- package/dist/secp256k1-CreY7Pcl.js +1890 -0
- package/dist/secp256k1-CreY7Pcl.js.map +1 -0
- package/docs/CONTRACTS.md +797 -0
- package/docs/FOSDEM_PROPOSAL.md +388 -0
- package/docs/LOCALFIRST.md +266 -0
- package/docs/api/ai_aggregation.js.html +333 -0
- package/docs/api/ai_breakdown.js.html +524 -0
- package/docs/api/ai_classifier.js.html +231 -0
- package/docs/api/ai_council.js.html +246 -0
- package/docs/api/ai_embeddings.js.html +304 -0
- package/docs/api/ai_federation-ai.js.html +338 -0
- package/docs/api/ai_h3-ai.js.html +970 -0
- package/docs/api/ai_index.js.html +124 -0
- package/docs/api/ai_json-ops.js.html +241 -0
- package/docs/api/ai_llm-service.js.html +239 -0
- package/docs/api/ai_nl-query.js.html +236 -0
- package/docs/api/ai_relationships.js.html +367 -0
- package/docs/api/ai_schema-extractor.js.html +235 -0
- package/docs/api/ai_spatial.js.html +307 -0
- package/docs/api/ai_tts.js.html +214 -0
- package/docs/api/content_social-protocols.js.html +180 -0
- package/docs/api/core_holosphere.js.html +757 -0
- package/docs/api/crypto_nostr-utils.js.html +306 -0
- package/docs/api/crypto_secp256k1.js.html +267 -0
- package/docs/api/data/search.json +1 -0
- package/docs/api/federation_discovery.js.html +337 -0
- package/docs/api/federation_handshake.js.html +478 -0
- package/docs/api/federation_hologram.js.html +1053 -0
- package/docs/api/federation_registry.js.html +389 -0
- package/docs/api/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/api/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/api/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/api/global.html +3 -0
- package/docs/api/hierarchical_upcast.js.html +128 -0
- package/docs/api/index.html +265 -0
- package/docs/api/index.js.html +1868 -0
- package/docs/api/lib_ai-methods.js.html +660 -0
- package/docs/api/lib_contract-methods.js.html +445 -0
- package/docs/api/lib_errors.js.html +56 -0
- package/docs/api/lib_federation-methods.js.html +348 -0
- package/docs/api/lib_index.js.html +33 -0
- package/docs/api/module-ai.html +5 -0
- package/docs/api/module-ai_aggregation-SmartAggregation.html +6 -0
- package/docs/api/module-ai_aggregation.SmartAggregation.html +3 -0
- package/docs/api/module-ai_aggregation.html +3 -0
- package/docs/api/module-ai_breakdown-TaskBreakdown.html +5 -0
- package/docs/api/module-ai_breakdown.TaskBreakdown.html +3 -0
- package/docs/api/module-ai_breakdown.html +3 -0
- package/docs/api/module-ai_classifier-Classifier.html +6 -0
- package/docs/api/module-ai_classifier.Classifier.html +3 -0
- package/docs/api/module-ai_classifier.html +3 -0
- package/docs/api/module-ai_council-Council.html +6 -0
- package/docs/api/module-ai_council.Council.html +3 -0
- package/docs/api/module-ai_council.html +3 -0
- package/docs/api/module-ai_embeddings-Embeddings.html +5 -0
- package/docs/api/module-ai_embeddings.Embeddings.html +3 -0
- package/docs/api/module-ai_embeddings.html +3 -0
- package/docs/api/module-ai_federation-ai-FederationAdvisor.html +6 -0
- package/docs/api/module-ai_federation-ai.FederationAdvisor.html +3 -0
- package/docs/api/module-ai_federation-ai.html +3 -0
- package/docs/api/module-ai_h3-ai-H3AI.html +6 -0
- package/docs/api/module-ai_h3-ai.H3AI.html +3 -0
- package/docs/api/module-ai_h3-ai.html +3 -0
- package/docs/api/module-ai_json-ops-JSONOps.html +5 -0
- package/docs/api/module-ai_json-ops.JSONOps.html +3 -0
- package/docs/api/module-ai_json-ops.html +3 -0
- package/docs/api/module-ai_llm-service-LLMService.html +5 -0
- package/docs/api/module-ai_llm-service.LLMService.html +3 -0
- package/docs/api/module-ai_llm-service.html +3 -0
- package/docs/api/module-ai_nl-query-NLQuery.html +5 -0
- package/docs/api/module-ai_nl-query.NLQuery.html +3 -0
- package/docs/api/module-ai_nl-query.html +3 -0
- package/docs/api/module-ai_relationships-RelationshipDiscovery.html +6 -0
- package/docs/api/module-ai_relationships.RelationshipDiscovery.html +3 -0
- package/docs/api/module-ai_relationships.html +3 -0
- package/docs/api/module-ai_schema-extractor-SchemaExtractor.html +5 -0
- package/docs/api/module-ai_schema-extractor.SchemaExtractor.html +3 -0
- package/docs/api/module-ai_schema-extractor.html +3 -0
- package/docs/api/module-ai_spatial-SpatialAnalysis.html +6 -0
- package/docs/api/module-ai_spatial.SpatialAnalysis.html +3 -0
- package/docs/api/module-ai_spatial.html +3 -0
- package/docs/api/module-ai_tts-TTS.html +5 -0
- package/docs/api/module-ai_tts.TTS.html +3 -0
- package/docs/api/module-ai_tts.html +3 -0
- package/docs/api/module-content_social-protocols.html +3 -0
- package/docs/api/module-core_holosphere-HoloSphere.html +6 -0
- package/docs/api/module-core_holosphere.HoloSphere.html +3 -0
- package/docs/api/module-core_holosphere.html +3 -0
- package/docs/api/module-crypto_nostr-utils.html +3 -0
- package/docs/api/module-crypto_secp256k1.html +3 -0
- package/docs/api/module-federation_hologram.html +3 -0
- package/docs/api/module-hierarchical_upcast.html +3 -0
- package/docs/api/module-holosphere-HoloSphereBase.html +3 -0
- package/docs/api/module-holosphere.html +3 -0
- package/docs/api/module-lib_ai-methods.html +3 -0
- package/docs/api/module-lib_contract-methods.html +3 -0
- package/docs/api/module-lib_errors-AuthorizationError.html +3 -0
- package/docs/api/module-lib_errors-ValidationError.html +3 -0
- package/docs/api/module-lib_errors.AuthorizationError.html +3 -0
- package/docs/api/module-lib_errors.ValidationError.html +3 -0
- package/docs/api/module-lib_errors.html +3 -0
- package/docs/api/module-lib_federation-methods.html +3 -0
- package/docs/api/module-lib_index.html +3 -0
- package/docs/api/module-schema_validator-ValidationError.html +3 -0
- package/docs/api/module-schema_validator.ValidationError.html +3 -0
- package/docs/api/module-schema_validator.html +3 -0
- package/docs/api/module-spatial_h3-operations.html +4 -0
- package/docs/api/module-storage_backend-factory.BackendFactory.html +3 -0
- package/docs/api/module-storage_backend-factory.html +3 -0
- package/docs/api/module-storage_backend-interface-StorageBackend.html +3 -0
- package/docs/api/module-storage_backend-interface.StorageBackend.html +3 -0
- package/docs/api/module-storage_backend-interface.html +3 -0
- package/docs/api/module-storage_backends_activitypub-backend-ActivityPubBackend.html +7 -0
- package/docs/api/module-storage_backends_activitypub-backend.ActivityPubBackend.html +3 -0
- package/docs/api/module-storage_backends_activitypub-backend.html +3 -0
- package/docs/api/module-storage_backends_activitypub_server-ActivityPubServer.html +8 -0
- package/docs/api/module-storage_backends_activitypub_server.ActivityPubServer.html +3 -0
- package/docs/api/module-storage_backends_activitypub_server.html +3 -0
- package/docs/api/module-storage_backends_gundb-backend-GunDBBackend.html +7 -0
- package/docs/api/module-storage_backends_gundb-backend.GunDBBackend.html +3 -0
- package/docs/api/module-storage_backends_gundb-backend.html +3 -0
- package/docs/api/module-storage_backends_nostr-backend-NostrBackend.html +8 -0
- package/docs/api/module-storage_backends_nostr-backend.NostrBackend.html +3 -0
- package/docs/api/module-storage_backends_nostr-backend.html +3 -0
- package/docs/api/module-storage_filesystem-storage-FileSystemStorage.html +5 -0
- package/docs/api/module-storage_filesystem-storage-browser-FileSystemStorage.html +3 -0
- package/docs/api/module-storage_filesystem-storage-browser.FileSystemStorage.html +3 -0
- package/docs/api/module-storage_filesystem-storage-browser.html +3 -0
- package/docs/api/module-storage_filesystem-storage.FileSystemStorage.html +3 -0
- package/docs/api/module-storage_filesystem-storage.html +3 -0
- package/docs/api/module-storage_global-tables.html +3 -0
- package/docs/api/module-storage_gun-async.html +3 -0
- package/docs/api/module-storage_gun-auth-GunAuth.html +5 -0
- package/docs/api/module-storage_gun-auth.GunAuth.html +3 -0
- package/docs/api/module-storage_gun-auth.html +3 -0
- package/docs/api/module-storage_gun-federation.html +3 -0
- package/docs/api/module-storage_gun-references-GunReferenceHandler.html +5 -0
- package/docs/api/module-storage_gun-references.GunReferenceHandler.html +3 -0
- package/docs/api/module-storage_gun-references.html +3 -0
- package/docs/api/module-storage_gun-schema-GunSchemaValidator.html +5 -0
- package/docs/api/module-storage_gun-schema.GunSchemaValidator.html +3 -0
- package/docs/api/module-storage_gun-schema.html +3 -0
- package/docs/api/module-storage_gun-wrapper.html +11 -0
- package/docs/api/module-storage_indexeddb-storage-IndexedDBStorage.html +5 -0
- package/docs/api/module-storage_indexeddb-storage.IndexedDBStorage.html +3 -0
- package/docs/api/module-storage_indexeddb-storage.html +3 -0
- package/docs/api/module-storage_key-storage-simple.html +3 -0
- package/docs/api/module-storage_key-storage.html +4 -0
- package/docs/api/module-storage_memory-storage-MemoryStorage.html +5 -0
- package/docs/api/module-storage_memory-storage.MemoryStorage.html +3 -0
- package/docs/api/module-storage_memory-storage.html +3 -0
- package/docs/api/module-storage_migration-MigrationTool.html +6 -0
- package/docs/api/module-storage_migration.MigrationTool.html +3 -0
- package/docs/api/module-storage_migration.html +3 -0
- package/docs/api/module-storage_nostr-async.html +18 -0
- package/docs/api/module-storage_nostr-client-LRUCache.html +3 -0
- package/docs/api/module-storage_nostr-client-NostrClient.html +7 -0
- package/docs/api/module-storage_nostr-client.NostrClient.html +15 -0
- package/docs/api/module-storage_nostr-client.html +6 -0
- package/docs/api/module-storage_nostr-wrapper.html +3 -0
- package/docs/api/module-storage_outbox-queue-OutboxQueue.html +4 -0
- package/docs/api/module-storage_outbox-queue.OutboxQueue.html +3 -0
- package/docs/api/module-storage_outbox-queue.html +3 -0
- package/docs/api/module-storage_persistent-storage-PersistentStorage.html +3 -0
- package/docs/api/module-storage_persistent-storage.html +4 -0
- package/docs/api/module-storage_sync-service-SyncService.html +5 -0
- package/docs/api/module-storage_sync-service.SyncService.html +3 -0
- package/docs/api/module-storage_sync-service.html +3 -0
- package/docs/api/module-storage_unified-storage.html +3 -0
- package/docs/api/module-subscriptions_manager.SubscriptionRegistry.html +3 -0
- package/docs/api/module-subscriptions_manager.html +3 -0
- package/docs/api/schema_validator.js.html +113 -0
- package/docs/api/scripts/core.js +726 -0
- package/docs/api/scripts/core.min.js +23 -0
- package/docs/api/scripts/resize.js +90 -0
- package/docs/api/scripts/search.js +265 -0
- package/docs/api/scripts/search.min.js +6 -0
- package/docs/api/scripts/third-party/Apache-License-2.0.txt +202 -0
- package/docs/api/scripts/third-party/fuse.js +9 -0
- package/docs/api/scripts/third-party/hljs-line-num-original.js +369 -0
- package/docs/api/scripts/third-party/hljs-line-num.js +1 -0
- package/docs/api/scripts/third-party/hljs-original.js +5171 -0
- package/docs/api/scripts/third-party/hljs.js +1 -0
- package/docs/api/scripts/third-party/popper.js +5 -0
- package/docs/api/scripts/third-party/tippy.js +1 -0
- package/docs/api/scripts/third-party/tocbot.js +672 -0
- package/docs/api/scripts/third-party/tocbot.min.js +1 -0
- package/docs/api/spatial_h3-operations.js.html +129 -0
- package/docs/api/storage_backend-factory.js.html +133 -0
- package/docs/api/storage_backend-interface.js.html +164 -0
- package/docs/api/storage_backends_activitypub-backend.js.html +298 -0
- package/docs/api/storage_backends_activitypub_server.js.html +678 -0
- package/docs/api/storage_backends_gundb-backend.js.html +878 -0
- package/docs/api/storage_backends_nostr-backend.js.html +254 -0
- package/docs/api/storage_filesystem-storage-browser.js.html +83 -0
- package/docs/api/storage_filesystem-storage.js.html +207 -0
- package/docs/api/storage_global-tables.js.html +116 -0
- package/docs/api/storage_gun-async.js.html +344 -0
- package/docs/api/storage_gun-auth.js.html +376 -0
- package/docs/api/storage_gun-federation.js.html +788 -0
- package/docs/api/storage_gun-references.js.html +212 -0
- package/docs/api/storage_gun-schema.js.html +309 -0
- package/docs/api/storage_gun-wrapper.js.html +645 -0
- package/docs/api/storage_indexeddb-storage.js.html +224 -0
- package/docs/api/storage_key-storage-simple.js.html +102 -0
- package/docs/api/storage_key-storage.js.html +171 -0
- package/docs/api/storage_memory-storage.js.html +128 -0
- package/docs/api/storage_migration.js.html +354 -0
- package/docs/api/storage_nostr-async.js.html +1076 -0
- package/docs/api/storage_nostr-client.js.html +1598 -0
- package/docs/api/storage_nostr-wrapper.js.html +218 -0
- package/docs/api/storage_outbox-queue.js.html +248 -0
- package/docs/api/storage_persistent-storage.js.html +160 -0
- package/docs/api/storage_sync-service.js.html +201 -0
- package/docs/api/storage_unified-storage.js.html +157 -0
- package/docs/api/styles/clean-jsdoc-theme-base.css +1159 -0
- package/docs/api/styles/clean-jsdoc-theme-dark.css +412 -0
- package/docs/api/styles/clean-jsdoc-theme-light.css +482 -0
- package/docs/api/styles/clean-jsdoc-theme-scrollbar.css +30 -0
- package/docs/api/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
- package/docs/api/styles/clean-jsdoc-theme.min.css +1 -0
- package/docs/api/subscriptions_manager.js.html +162 -0
- package/docs/contracts/api-interface.md +793 -0
- package/docs/data-model.md +476 -0
- package/docs/gun-async-usage.md +338 -0
- package/docs/plan.md +349 -0
- package/docs/quickstart.md +674 -0
- package/docs/research.md +362 -0
- package/docs/spec.md +244 -0
- package/docs/storage-backends.md +326 -0
- package/docs/tasks.md +947 -0
- package/examples/demo.html +47 -0
- package/examples/holosphere-widget.js +1242 -0
- package/examples/widget-demo.html +274 -0
- package/examples/widget.html +703 -0
- package/jsdoc.json +26 -0
- package/package.json +25 -7
- package/src/ai/aggregation.js +13 -2
- package/src/ai/breakdown.js +12 -2
- package/src/ai/classifier.js +14 -3
- package/src/ai/council.js +22 -7
- package/src/ai/embeddings.js +37 -15
- package/src/ai/federation-ai.js +13 -2
- package/src/ai/h3-ai.js +14 -2
- package/src/ai/index.js +16 -7
- package/src/ai/json-ops.js +18 -5
- package/src/ai/llm-service.js +62 -31
- package/src/ai/nl-query.js +12 -2
- package/src/ai/relationships.js +13 -2
- package/src/ai/schema-extractor.js +24 -10
- package/src/ai/spatial.js +13 -2
- package/src/ai/tts.js +25 -8
- package/src/cdn-entry.js +22 -0
- package/src/content/social-protocols.js +34 -25
- package/src/contracts/abis/Appreciative.json +1280 -0
- package/src/contracts/abis/AppreciativeFactory.json +101 -0
- package/src/contracts/abis/Bundle.json +1438 -0
- package/src/contracts/abis/BundleFactory.json +106 -0
- package/src/contracts/abis/Holon.json +881 -0
- package/src/contracts/abis/Holons.json +330 -0
- package/src/contracts/abis/Managed.json +1262 -0
- package/src/contracts/abis/ManagedFactory.json +149 -0
- package/src/contracts/abis/Membrane.json +261 -0
- package/src/contracts/abis/Splitter.json +1624 -0
- package/src/contracts/abis/SplitterFactory.json +220 -0
- package/src/contracts/abis/TestToken.json +321 -0
- package/src/contracts/abis/Zoned.json +1461 -0
- package/src/contracts/abis/ZonedFactory.json +154 -0
- package/src/contracts/chain-manager.js +403 -0
- package/src/contracts/deployer.js +500 -0
- package/src/contracts/event-listener.js +539 -0
- package/src/contracts/holon-contracts.js +359 -0
- package/src/contracts/index.js +82 -0
- package/src/contracts/networks.js +229 -0
- package/src/contracts/operations.js +687 -0
- package/src/contracts/queries.js +638 -0
- package/src/core/holosphere.js +487 -6
- package/src/crypto/nostr-utils.js +303 -0
- package/src/crypto/secp256k1.js +7 -2
- package/src/federation/handshake.js +475 -0
- package/src/federation/hologram.js +117 -3
- package/src/hierarchical/upcast.js +40 -25
- package/src/index.js +1501 -1909
- package/src/lib/ai-methods.js +657 -0
- package/src/lib/contract-methods.js +442 -0
- package/src/lib/errors.js +53 -0
- package/src/lib/federation-methods.js +345 -0
- package/src/lib/index.js +30 -0
- package/src/schema/validator.js +22 -3
- package/src/spatial/h3-operations.js +19 -3
- package/src/storage/backend-factory.js +7 -2
- package/src/storage/backend-interface.js +21 -2
- package/src/storage/backends/activitypub/server.js +25 -3
- package/src/storage/backends/activitypub-backend.js +25 -2
- package/src/storage/backends/gundb-backend.js +692 -50
- package/src/storage/backends/nostr-backend.js +116 -1
- package/src/storage/filesystem-storage-browser.js +42 -2
- package/src/storage/filesystem-storage.js +72 -5
- package/src/storage/global-tables.js +35 -3
- package/src/storage/gun-async.js +75 -15
- package/src/storage/gun-auth.js +373 -0
- package/src/storage/gun-federation.js +785 -0
- package/src/storage/gun-references.js +209 -0
- package/src/storage/gun-schema.js +306 -0
- package/src/storage/gun-wrapper.js +475 -54
- package/src/storage/indexeddb-storage.js +112 -13
- package/src/storage/key-storage-simple.js +32 -9
- package/src/storage/key-storage.js +45 -13
- package/src/storage/memory-storage.js +68 -2
- package/src/storage/migration.js +20 -7
- package/src/storage/nostr-async.js +412 -122
- package/src/storage/nostr-client.js +749 -76
- package/src/storage/nostr-wrapper.js +6 -2
- package/src/storage/outbox-queue.js +55 -18
- package/src/storage/persistent-storage.js +62 -14
- package/src/storage/sync-service.js +51 -17
- package/src/storage/unified-storage.js +154 -0
- package/src/subscriptions/manager.js +34 -17
- package/types/index.d.ts +133 -0
- package/vite.config.cdn.js +60 -0
- package/tests/unit/ai/aggregation.test.js +0 -295
- package/tests/unit/ai/breakdown.test.js +0 -446
- package/tests/unit/ai/classifier.test.js +0 -294
- package/tests/unit/ai/council.test.js +0 -262
- package/tests/unit/ai/embeddings.test.js +0 -384
- package/tests/unit/ai/federation-ai.test.js +0 -344
- package/tests/unit/ai/h3-ai.test.js +0 -458
- package/tests/unit/ai/index.test.js +0 -304
- package/tests/unit/ai/json-ops.test.js +0 -307
- package/tests/unit/ai/llm-service.test.js +0 -390
- package/tests/unit/ai/nl-query.test.js +0 -383
- package/tests/unit/ai/relationships.test.js +0 -311
- package/tests/unit/ai/schema-extractor.test.js +0 -384
- package/tests/unit/ai/spatial.test.js +0 -279
- package/tests/unit/ai/tts.test.js +0 -279
- package/tests/unit/content.test.js +0 -332
- package/tests/unit/contract/core.test.js +0 -88
- package/tests/unit/contract/crypto.test.js +0 -198
- package/tests/unit/contract/data.test.js +0 -223
- package/tests/unit/contract/federation.test.js +0 -181
- package/tests/unit/contract/hierarchical.test.js +0 -113
- package/tests/unit/contract/schema.test.js +0 -114
- package/tests/unit/contract/social.test.js +0 -217
- package/tests/unit/contract/spatial.test.js +0 -110
- package/tests/unit/contract/subscriptions.test.js +0 -128
- package/tests/unit/contract/utils.test.js +0 -159
- package/tests/unit/core.test.js +0 -152
- package/tests/unit/crypto.test.js +0 -328
- package/tests/unit/federation.test.js +0 -234
- package/tests/unit/gun-async.test.js +0 -252
- package/tests/unit/hierarchical.test.js +0 -399
- package/tests/unit/integration/scenario-01-geographic-storage.test.js +0 -74
- package/tests/unit/integration/scenario-02-federation.test.js +0 -76
- package/tests/unit/integration/scenario-03-subscriptions.test.js +0 -102
- package/tests/unit/integration/scenario-04-validation.test.js +0 -129
- package/tests/unit/integration/scenario-05-hierarchy.test.js +0 -125
- package/tests/unit/integration/scenario-06-social.test.js +0 -135
- package/tests/unit/integration/scenario-07-persistence.test.js +0 -130
- package/tests/unit/integration/scenario-08-authorization.test.js +0 -161
- package/tests/unit/integration/scenario-09-cross-dimensional.test.js +0 -139
- package/tests/unit/integration/scenario-10-cross-holosphere-capabilities.test.js +0 -357
- package/tests/unit/integration/scenario-11-cross-holosphere-federation.test.js +0 -410
- package/tests/unit/integration/scenario-12-capability-federated-read.test.js +0 -719
- package/tests/unit/performance/benchmark.test.js +0 -85
- package/tests/unit/schema.test.js +0 -213
- package/tests/unit/spatial.test.js +0 -158
- package/tests/unit/storage.test.js +0 -195
- package/tests/unit/subscriptions.test.js +0 -328
- package/tests/unit/test-data-permanence-debug.js +0 -197
- package/tests/unit/test-data-permanence.js +0 -340
- package/tests/unit/test-key-persistence-fixed.js +0 -148
- package/tests/unit/test-key-persistence.js +0 -172
- package/tests/unit/test-relay-permanence.js +0 -376
- package/tests/unit/test-second-node.js +0 -95
- package/tests/unit/test-simple-write.js +0 -89
- /package/{cleanup-test-data.js → scripts/cleanup-test-data.js} +0 -0
- /package/{test-ai-real-api.js → scripts/test-ai-real-api.js} +0 -0
package/docs/tasks.md
ADDED
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
# Tasks: HoloSphere - Holonic Geospatial Communication Infrastructure
|
|
2
|
+
|
|
3
|
+
**Input**: Design documents from `/Users/roberto/Projects/Liminal/holosphere2/specs/001-holosphere-holonic-geospatial/`
|
|
4
|
+
**Prerequisites**: plan.md, research.md, data-model.md, contracts/, quickstart.md (all present)
|
|
5
|
+
**Branch**: `001-holosphere-holonic-geospatial`
|
|
6
|
+
|
|
7
|
+
## Execution Flow (main)
|
|
8
|
+
```
|
|
9
|
+
1. Load plan.md from feature directory ✓
|
|
10
|
+
→ Tech stack: JavaScript ES2020+, GunDB, h3-js, @noble/curves, Ajv
|
|
11
|
+
→ Structure: Single library project (src/, tests/)
|
|
12
|
+
2. Load design documents ✓
|
|
13
|
+
→ data-model.md: 9 entities (Holon, Lens, Data Object, etc.)
|
|
14
|
+
→ contracts/api-interface.md: 10 API categories, ~30 methods
|
|
15
|
+
→ quickstart.md: 9 integration test scenarios
|
|
16
|
+
→ research.md: Technical decisions and tooling
|
|
17
|
+
3. Generate tasks by category:
|
|
18
|
+
→ Setup: npm project, Vite, Vitest, ESLint
|
|
19
|
+
→ Tests: Contract tests (30), Integration tests (9), Unit tests (8 modules)
|
|
20
|
+
→ Core: 8 modules (core, spatial, storage, schema, federation, content, crypto, subscriptions)
|
|
21
|
+
→ Integration: Public API wiring, build configuration
|
|
22
|
+
→ Polish: Bundle optimization, TypeScript definitions, documentation
|
|
23
|
+
4. Apply task rules:
|
|
24
|
+
→ Test files in parallel [P]
|
|
25
|
+
→ Module implementations in parallel where no dependencies [P]
|
|
26
|
+
→ TDD order enforced (tests before implementation)
|
|
27
|
+
5. Total tasks: 42 numbered tasks (T001-T042)
|
|
28
|
+
6. Dependencies mapped (see Dependencies section)
|
|
29
|
+
7. Parallel execution examples provided
|
|
30
|
+
8. Validation: All contracts tested, all entities modeled, TDD order preserved
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Format: `[ID] [P?] Description`
|
|
34
|
+
- **[P]**: Can run in parallel (different files, no dependencies)
|
|
35
|
+
- Include exact file paths in descriptions
|
|
36
|
+
- Repository root: `/Users/roberto/Projects/Liminal/holosphere2/`
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Phase 3.1: Setup & Infrastructure
|
|
41
|
+
|
|
42
|
+
### T001: Initialize npm project with dependencies
|
|
43
|
+
**File**: `package.json`
|
|
44
|
+
**Description**: Create package.json with:
|
|
45
|
+
- Package name: `holosphere`
|
|
46
|
+
- Type: `module` (ESM)
|
|
47
|
+
- Dependencies: `gun` (GunDB), `h3-js`, `@noble/curves`, `ajv`
|
|
48
|
+
- Dev dependencies: `vite`, `vitest`, `eslint`, `prettier`
|
|
49
|
+
- Scripts: `dev`, `build`, `test`, `test:coverage`, `lint`, `format`
|
|
50
|
+
|
|
51
|
+
**Acceptance**: `npm install` completes without errors
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### T002: Configure Vitest for unit and integration testing
|
|
56
|
+
**File**: `vitest.config.js`
|
|
57
|
+
**Description**: Create Vitest configuration:
|
|
58
|
+
- Test file patterns: `**/*.test.js`
|
|
59
|
+
- Coverage provider: `v8`
|
|
60
|
+
- Coverage threshold: 80% line coverage
|
|
61
|
+
- Test environment: `node` (default)
|
|
62
|
+
- Include directories: `tests/unit/`, `tests/integration/`, `tests/contract/`
|
|
63
|
+
|
|
64
|
+
**Acceptance**: `npm test` runs (no tests yet, but config loads)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### T003: [P] Configure Vite for multi-format build
|
|
69
|
+
**File**: `vite.config.js`
|
|
70
|
+
**Description**: Create Vite build configuration:
|
|
71
|
+
- Entry point: `src/index.js`
|
|
72
|
+
- Output formats: ESM (`dist/esm/`), CommonJS (`dist/cjs/`), UMD (`dist/cdn/`)
|
|
73
|
+
- Library name: `HoloSphere`
|
|
74
|
+
- External dependencies: none (bundle all for CDN)
|
|
75
|
+
- Minification: terser for production
|
|
76
|
+
- Sourcemaps enabled
|
|
77
|
+
|
|
78
|
+
**Acceptance**: `npm run build` creates all three output formats
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### T004: [P] Configure ESLint and Prettier
|
|
83
|
+
**Files**: `.eslintrc.json`, `.prettierrc.json`
|
|
84
|
+
**Description**:
|
|
85
|
+
- ESLint: ES2020 environment, recommended rules, async-await support
|
|
86
|
+
- Prettier: 2-space indent, single quotes, semicolons, trailing commas
|
|
87
|
+
- ESLint plugin prettier integration
|
|
88
|
+
|
|
89
|
+
**Acceptance**: `npm run lint` and `npm run format` execute without errors
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### T005: Create source directory structure
|
|
94
|
+
**Directories**: Create all module directories per plan.md:
|
|
95
|
+
```
|
|
96
|
+
src/
|
|
97
|
+
├── core/
|
|
98
|
+
├── spatial/
|
|
99
|
+
├── storage/
|
|
100
|
+
├── schema/
|
|
101
|
+
├── federation/
|
|
102
|
+
├── hierarchical/
|
|
103
|
+
├── content/
|
|
104
|
+
├── crypto/
|
|
105
|
+
├── subscriptions/
|
|
106
|
+
└── utils/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Acceptance**: Directory tree matches plan.md structure
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### T006: Create test directory structure
|
|
114
|
+
**Directories**: Create test directories:
|
|
115
|
+
```
|
|
116
|
+
tests/
|
|
117
|
+
├── unit/
|
|
118
|
+
├── integration/
|
|
119
|
+
└── contract/
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Acceptance**: All test directories exist
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Phase 3.2: Tests First (TDD) ⚠️ MUST COMPLETE BEFORE 3.3
|
|
127
|
+
|
|
128
|
+
**CRITICAL: These tests MUST be written and MUST FAIL before ANY implementation**
|
|
129
|
+
|
|
130
|
+
### Contract Tests (API Interface) - All [P]
|
|
131
|
+
|
|
132
|
+
### T007: [P] Contract test: Core initialization
|
|
133
|
+
**File**: `tests/contract/core.test.js`
|
|
134
|
+
**Description**: Test `new HoloSphere(config)` constructor:
|
|
135
|
+
- Default config creates instance
|
|
136
|
+
- Custom appName, peers, radisk config works
|
|
137
|
+
- Invalid config throws TypeError
|
|
138
|
+
- Instance has all expected methods
|
|
139
|
+
|
|
140
|
+
**Acceptance**: Test written, fails (HoloSphere not implemented)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### T008: [P] Contract test: Spatial operations
|
|
145
|
+
**File**: `tests/contract/spatial.test.js`
|
|
146
|
+
**Description**: Test spatial API methods:
|
|
147
|
+
- `toHolon(lat, lng, resolution)` → H3 string
|
|
148
|
+
- `getParents(holonId, maxResolution)` → parent array
|
|
149
|
+
- `getChildren(holonId)` → 7 children
|
|
150
|
+
- `isValidH3(holonId)` → boolean
|
|
151
|
+
- Error cases: invalid coords, out of range resolution
|
|
152
|
+
|
|
153
|
+
**Acceptance**: Test written, fails (spatial methods not implemented)
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### T009: [P] Contract test: Data operations (write/read/update/delete)
|
|
158
|
+
**File**: `tests/contract/data.test.js`
|
|
159
|
+
**Description**: Test CRUD API methods:
|
|
160
|
+
- `write(holonId, lensName, data, options)` → boolean
|
|
161
|
+
- `read(holonId, lensName, dataId?)` → object | array | null
|
|
162
|
+
- `update(holonId, lensName, dataId, updates, options)` → boolean
|
|
163
|
+
- `delete(holonId, lensName, dataId, options)` → boolean
|
|
164
|
+
- Validate signatures, parameter types, return values
|
|
165
|
+
|
|
166
|
+
**Acceptance**: Test written, fails (data methods not implemented)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### T010: [P] Contract test: Schema operations
|
|
171
|
+
**File**: `tests/contract/schema.test.js`
|
|
172
|
+
**Description**: Test schema API methods:
|
|
173
|
+
- `setSchema(lensName, schemaUri, strict?)` → void
|
|
174
|
+
- `getSchema(lensName)` → object | null
|
|
175
|
+
- `clearSchema(lensName)` → void
|
|
176
|
+
- Validate JSON Schema 2019 format enforcement
|
|
177
|
+
|
|
178
|
+
**Acceptance**: Test written, fails (schema methods not implemented)
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### T011: [P] Contract test: Federation operations
|
|
183
|
+
**File**: `tests/contract/federation.test.js`
|
|
184
|
+
**Description**: Test federation API methods:
|
|
185
|
+
- `federate(sourceHolon, targetHolon, lensName, options)` → boolean
|
|
186
|
+
- `getFederatedData(holonId, lensName, options)` → array
|
|
187
|
+
- `unfederate(sourceHolon, targetHolon, lensName)` → boolean
|
|
188
|
+
- Options: direction, mode, filter validation
|
|
189
|
+
|
|
190
|
+
**Acceptance**: Test written, fails (federation methods not implemented)
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### T012: [P] Contract test: Hierarchical operations
|
|
195
|
+
**File**: `tests/contract/hierarchical.test.js`
|
|
196
|
+
**Description**: Test upcast API method:
|
|
197
|
+
- `upcast(holonId, lensName, dataId, options)` → boolean
|
|
198
|
+
- Options: maxLevel, operation validation
|
|
199
|
+
- Error: noospheric holons (no hierarchy)
|
|
200
|
+
|
|
201
|
+
**Acceptance**: Test written, fails (upcast not implemented)
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
### T013: [P] Contract test: Subscription operations
|
|
206
|
+
**File**: `tests/contract/subscriptions.test.js`
|
|
207
|
+
**Description**: Test subscription API:
|
|
208
|
+
- `subscribe(holonId, lensName, callback, options)` → { unsubscribe }
|
|
209
|
+
- Callback invoked on data changes
|
|
210
|
+
- Unsubscribe stops callbacks
|
|
211
|
+
- Options: includeFederated, throttle, filter
|
|
212
|
+
|
|
213
|
+
**Acceptance**: Test written, fails (subscribe not implemented)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### T014: [P] Contract test: Cryptographic operations
|
|
218
|
+
**File**: `tests/contract/crypto.test.js`
|
|
219
|
+
**Description**: Test crypto API methods:
|
|
220
|
+
- `sign(content, privateKey)` → signature string
|
|
221
|
+
- `verify(content, signature, publicKey)` → boolean
|
|
222
|
+
- `issueCapability(permissions, scope, recipient, options)` → token
|
|
223
|
+
- `verifyCapability(token, requiredPermission, scope)` → boolean
|
|
224
|
+
- Lazy loading verification (crypto module not loaded until first use)
|
|
225
|
+
|
|
226
|
+
**Acceptance**: Test written, fails (crypto methods not implemented)
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### T015: [P] Contract test: Social protocol operations
|
|
231
|
+
**File**: `tests/contract/social.test.js`
|
|
232
|
+
**Description**: Test social protocol API:
|
|
233
|
+
- `publishNostr(event, holonId, lensName?)` → boolean
|
|
234
|
+
- `publishActivityPub(object, holonId, lensName?)` → boolean
|
|
235
|
+
- `querySocial(holonId, options)` → array
|
|
236
|
+
- Nostr NIP-01 and ActivityPub format validation
|
|
237
|
+
|
|
238
|
+
**Acceptance**: Test written, fails (social methods not implemented)
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### T016: [P] Contract test: Utility operations
|
|
243
|
+
**File**: `tests/contract/utils.test.js`
|
|
244
|
+
**Description**: Test utility API:
|
|
245
|
+
- `metrics()` → object (writes, reads, subscriptions counts)
|
|
246
|
+
- Error types: ValidationError, AuthorizationError, HolosphereError
|
|
247
|
+
- Error object structure and properties
|
|
248
|
+
|
|
249
|
+
**Acceptance**: Test written, fails (utils not implemented)
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### Integration Tests (Quickstart Scenarios) - All [P]
|
|
254
|
+
|
|
255
|
+
### T017: [P] Integration test: Scenario 1 - Geographic data storage and retrieval
|
|
256
|
+
**File**: `tests/integration/scenario-01-geographic-storage.test.js`
|
|
257
|
+
**Description**: Implement quickstart scenario 1:
|
|
258
|
+
- Convert lat/lng to H3 holon
|
|
259
|
+
- Write temperature data to lens
|
|
260
|
+
- Read data by location + category + ID
|
|
261
|
+
- Query all data in category
|
|
262
|
+
|
|
263
|
+
**Acceptance**: Test written, fails (full workflow not implemented)
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### T018: [P] Integration test: Scenario 2 - Hierarchical federation
|
|
268
|
+
**File**: `tests/integration/scenario-02-federation.test.js`
|
|
269
|
+
**Description**: Implement quickstart scenario 2:
|
|
270
|
+
- Create local data
|
|
271
|
+
- Federate local → regional holon
|
|
272
|
+
- Query regional (includes local via hologram)
|
|
273
|
+
- Update local, verify regional sees change (single source of truth)
|
|
274
|
+
|
|
275
|
+
**Acceptance**: Test written, fails (federation workflow not implemented)
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
### T019: [P] Integration test: Scenario 3 - Real-time subscriptions
|
|
280
|
+
**File**: `tests/integration/scenario-03-subscriptions.test.js`
|
|
281
|
+
**Description**: Implement quickstart scenario 3:
|
|
282
|
+
- Subscribe to holon/lens changes
|
|
283
|
+
- Write data, verify callback invoked
|
|
284
|
+
- Update data, verify callback invoked again
|
|
285
|
+
- Unsubscribe, verify no more callbacks
|
|
286
|
+
|
|
287
|
+
**Acceptance**: Test written, fails (subscription workflow not implemented)
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### T020: [P] Integration test: Scenario 4 - Schema validation
|
|
292
|
+
**File**: `tests/integration/scenario-04-validation.test.js`
|
|
293
|
+
**Description**: Implement quickstart scenario 4:
|
|
294
|
+
- Define JSON Schema for lens
|
|
295
|
+
- Permissive mode: invalid data succeeds with warning
|
|
296
|
+
- Strict mode: invalid data throws ValidationError
|
|
297
|
+
- Valid data succeeds in both modes
|
|
298
|
+
|
|
299
|
+
**Acceptance**: Test written, fails (validation workflow not implemented)
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### T021: [P] Integration test: Scenario 5 - Multi-scale hierarchical queries
|
|
304
|
+
**File**: `tests/integration/scenario-05-hierarchy.test.js`
|
|
305
|
+
**Description**: Implement quickstart scenario 5:
|
|
306
|
+
- Create data at high resolution (local)
|
|
307
|
+
- Upcast to parent hierarchy
|
|
308
|
+
- Query at different scales (neighborhood, city, region)
|
|
309
|
+
- Verify data propagated to all parent levels
|
|
310
|
+
|
|
311
|
+
**Acceptance**: Test written, fails (hierarchy workflow not implemented)
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### T022: [P] Integration test: Scenario 6 - Cross-protocol social content
|
|
316
|
+
**File**: `tests/integration/scenario-06-social.test.js`
|
|
317
|
+
**Description**: Implement quickstart scenario 6:
|
|
318
|
+
- Publish Nostr event to geographic holon
|
|
319
|
+
- Publish ActivityPub object to noospheric holon
|
|
320
|
+
- Query all social (unified interface)
|
|
321
|
+
- Filter by protocol
|
|
322
|
+
- Verify cryptographic signatures
|
|
323
|
+
|
|
324
|
+
**Acceptance**: Test written, fails (social workflow not implemented)
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
### T023: [P] Integration test: Scenario 7 - Offline persistence
|
|
329
|
+
**File**: `tests/integration/scenario-07-persistence.test.js`
|
|
330
|
+
**Description**: Implement quickstart scenario 7:
|
|
331
|
+
- Initialize with radisk
|
|
332
|
+
- Write data
|
|
333
|
+
- Simulate restart (new instance)
|
|
334
|
+
- Read previously written data (recovered from disk)
|
|
335
|
+
- Offline write, verify immediately available
|
|
336
|
+
|
|
337
|
+
**Acceptance**: Test written, fails (persistence workflow not implemented)
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
### T024: [P] Integration test: Scenario 8 - Authorization with capability tokens
|
|
342
|
+
**File**: `tests/integration/scenario-08-authorization.test.js`
|
|
343
|
+
**Description**: Implement quickstart scenario 8:
|
|
344
|
+
- User A creates data
|
|
345
|
+
- User B attempts unauthorized delete → AuthorizationError
|
|
346
|
+
- User A issues capability token to User B
|
|
347
|
+
- User B deletes with valid token → success
|
|
348
|
+
- Verify data deleted
|
|
349
|
+
|
|
350
|
+
**Acceptance**: Test written, fails (authorization workflow not implemented)
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
### T025: [P] Integration test: Scenario 9 - Cross-dimensional federation
|
|
355
|
+
**File**: `tests/integration/scenario-09-cross-dimensional.test.js`
|
|
356
|
+
**Description**: Implement quickstart scenario 9:
|
|
357
|
+
- Create data in geographic holon
|
|
358
|
+
- Create data in noospheric holon (URI)
|
|
359
|
+
- Federate geographic ↔ noospheric (bidirectional)
|
|
360
|
+
- Query geographic → includes noospheric data
|
|
361
|
+
- Query noospheric → includes geographic data
|
|
362
|
+
|
|
363
|
+
**Acceptance**: Test written, fails (cross-dimensional workflow not implemented)
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Phase 3.3: Core Implementation (ONLY after tests are failing)
|
|
368
|
+
|
|
369
|
+
**Prerequisites**: All tests (T007-T025) written and failing
|
|
370
|
+
|
|
371
|
+
### Unit Tests (Module-specific) - All [P]
|
|
372
|
+
|
|
373
|
+
### T026: [P] Unit test for core module
|
|
374
|
+
**File**: `tests/unit/core.test.js`
|
|
375
|
+
**Description**: Unit tests for `src/core/`:
|
|
376
|
+
- HoloSphere class initialization
|
|
377
|
+
- Config validation and defaults
|
|
378
|
+
- GunDB instance creation
|
|
379
|
+
- Radisk adapter integration
|
|
380
|
+
- Log level configuration
|
|
381
|
+
|
|
382
|
+
**Acceptance**: Test written, fails (core module not implemented)
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
### T027: [P] Unit test for spatial module
|
|
387
|
+
**File**: `tests/unit/spatial.test.js`
|
|
388
|
+
**Description**: Unit tests for `src/spatial/`:
|
|
389
|
+
- H3 validation (starts with '8', ≥15 chars)
|
|
390
|
+
- Coordinate to H3 conversion
|
|
391
|
+
- Parent/child hierarchy navigation
|
|
392
|
+
- Resolution extraction
|
|
393
|
+
- Edge cases (poles, dateline)
|
|
394
|
+
|
|
395
|
+
**Acceptance**: Test written, fails (spatial module not implemented)
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### T028: [P] Unit test for storage module
|
|
400
|
+
**File**: `tests/unit/storage.test.js`
|
|
401
|
+
**Description**: Unit tests for `src/storage/`:
|
|
402
|
+
- Path construction (`appname/holon/lens/key`)
|
|
403
|
+
- Gun graph operations (get, put, once)
|
|
404
|
+
- Radisk persistence
|
|
405
|
+
- Path encoding (special characters)
|
|
406
|
+
- Error handling
|
|
407
|
+
|
|
408
|
+
**Acceptance**: Test written, fails (storage module not implemented)
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
### T029: [P] Unit test for schema module
|
|
413
|
+
**File**: `tests/unit/schema.test.js`
|
|
414
|
+
**Description**: Unit tests for `src/schema/`:
|
|
415
|
+
- JSON Schema 2019 validation
|
|
416
|
+
- Ajv validator compilation
|
|
417
|
+
- Schema caching (1-hour TTL)
|
|
418
|
+
- Cache expiration and recompilation
|
|
419
|
+
- Strict vs permissive mode
|
|
420
|
+
|
|
421
|
+
**Acceptance**: Test written, fails (schema module not implemented)
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
### T030: [P] Unit test for federation module
|
|
426
|
+
**File**: `tests/unit/federation.test.js`
|
|
427
|
+
**Description**: Unit tests for `src/federation/`:
|
|
428
|
+
- Hologram creation (reference structure)
|
|
429
|
+
- Hologram resolution (dereference)
|
|
430
|
+
- Circular reference detection
|
|
431
|
+
- Federation config validation
|
|
432
|
+
- Inbound/outbound/bidirectional modes
|
|
433
|
+
|
|
434
|
+
**Acceptance**: Test written, fails (federation module not implemented)
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
### T031: [P] Unit test for content module
|
|
439
|
+
**File**: `tests/unit/content.test.js`
|
|
440
|
+
**Description**: Unit tests for `src/content/`:
|
|
441
|
+
- Nostr event format validation (NIP-01)
|
|
442
|
+
- ActivityPub object format validation
|
|
443
|
+
- Protocol adapter interface
|
|
444
|
+
- Stigmergic access level filtering
|
|
445
|
+
- Content transformation (to/from HoloSphere format)
|
|
446
|
+
|
|
447
|
+
**Acceptance**: Test written, fails (content module not implemented)
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
### T032: [P] Unit test for crypto module
|
|
452
|
+
**File**: `tests/unit/crypto.test.js`
|
|
453
|
+
**Description**: Unit tests for `src/crypto/`:
|
|
454
|
+
- secp256k1 signing and verification
|
|
455
|
+
- Capability token generation
|
|
456
|
+
- Token expiration validation
|
|
457
|
+
- Nonce uniqueness (replay protection)
|
|
458
|
+
- Lazy initialization (module not loaded until first use)
|
|
459
|
+
|
|
460
|
+
**Acceptance**: Test written, fails (crypto module not implemented)
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
### T033: [P] Unit test for subscriptions module
|
|
465
|
+
**File**: `tests/unit/subscriptions.test.js`
|
|
466
|
+
**Description**: Unit tests for `src/subscriptions/`:
|
|
467
|
+
- Gun `.on()` listener attachment
|
|
468
|
+
- Callback invocation on data changes
|
|
469
|
+
- Throttling mechanism
|
|
470
|
+
- Filter predicate application
|
|
471
|
+
- Unsubscribe cleanup
|
|
472
|
+
|
|
473
|
+
**Acceptance**: Test written, fails (subscriptions module not implemented)
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
### T033.5: [P] Unit test for hierarchical module
|
|
478
|
+
**File**: `tests/unit/hierarchical.test.js`
|
|
479
|
+
**Description**: Unit tests for `src/hierarchical/`:
|
|
480
|
+
- Upcast operation with summarize mode
|
|
481
|
+
- Upcast operation with aggregate mode
|
|
482
|
+
- Upcast operation with concatenate mode
|
|
483
|
+
- MaxLevel limit enforcement (default: 3 levels)
|
|
484
|
+
- Parent hierarchy traversal
|
|
485
|
+
- Error: noospheric holons (no hierarchy support)
|
|
486
|
+
|
|
487
|
+
**Acceptance**: Test written, fails (hierarchical module not implemented)
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
### Module Implementations
|
|
492
|
+
|
|
493
|
+
### T034: [P] Implement core module
|
|
494
|
+
**File**: `src/core/holosphere.js`
|
|
495
|
+
**Description**: Implement HoloSphere class:
|
|
496
|
+
- Constructor with config validation
|
|
497
|
+
- Initialize GunDB with radisk adapter
|
|
498
|
+
- Set up logging (structured JSON format)
|
|
499
|
+
- Store app configuration
|
|
500
|
+
- Export class
|
|
501
|
+
|
|
502
|
+
**Dependencies**: None
|
|
503
|
+
**Acceptance**: Unit tests (T026) pass
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
### T035: [P] Implement spatial module
|
|
508
|
+
**File**: `src/spatial/h3-operations.js`
|
|
509
|
+
**Description**: Implement H3 spatial operations:
|
|
510
|
+
- `toHolon(lat, lng, resolution)` using h3-js `geoToH3()`
|
|
511
|
+
- `getParents(holonId, maxResolution)` using `h3ToParent()` iteratively
|
|
512
|
+
- `getChildren(holonId)` using `h3ToChildren()`
|
|
513
|
+
- `isValidH3(holonId)` using `h3IsValid()` + format check
|
|
514
|
+
- `getResolution(holonId)` using `h3GetResolution()`
|
|
515
|
+
- Input validation and error handling
|
|
516
|
+
|
|
517
|
+
**Dependencies**: T034 (core)
|
|
518
|
+
**Acceptance**: Unit tests (T027) and contract tests (T008) pass
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
### T036: Implement storage module
|
|
523
|
+
**File**: `src/storage/gun-wrapper.js`
|
|
524
|
+
**Description**: Implement GunDB storage wrapper:
|
|
525
|
+
- Path construction (`buildPath(appname, holon, lens, key)`)
|
|
526
|
+
- `write(path, data)` → Gun `.put()` with radisk persistence
|
|
527
|
+
- `read(path)` → Gun `.once()` with Promise wrapper
|
|
528
|
+
- `delete(path)` → Gun `.put(null)` for tombstone
|
|
529
|
+
- `subscribe(path, callback)` → Gun `.on()` with cleanup
|
|
530
|
+
- Path encoding for special characters
|
|
531
|
+
|
|
532
|
+
**Dependencies**: T034 (core)
|
|
533
|
+
**Acceptance**: Unit tests (T028) pass
|
|
534
|
+
|
|
535
|
+
---
|
|
536
|
+
|
|
537
|
+
### T036.5: Implement global data operations
|
|
538
|
+
**File**: `src/storage/global-tables.js`
|
|
539
|
+
**Description**: Extend storage for non-location-specific data (FR-044, FR-045):
|
|
540
|
+
- `writeGlobal(table, data)` → Nostr write to `appname/{table}/{data.id}` (id extracted from data)
|
|
541
|
+
- `readGlobal(table, key?)` → Nostr read from global path
|
|
542
|
+
- `updateGlobal(table, key, updates)` → merge updates
|
|
543
|
+
- `deleteGlobal(table, key)` → tombstone
|
|
544
|
+
- No holon parameter required
|
|
545
|
+
- Consistent CRUD operations matching holon-based data API
|
|
546
|
+
|
|
547
|
+
**Dependencies**: T036 (storage module)
|
|
548
|
+
**Acceptance**: Extended unit tests (T028) pass with global operations
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
### T037: Implement schema module
|
|
553
|
+
**File**: `src/schema/validator.js`
|
|
554
|
+
**Description**: Implement JSON Schema validation:
|
|
555
|
+
- `compileSchema(schemaUri)` → Ajv validator with caching
|
|
556
|
+
- `validate(data, lensName, strict)` → boolean | ValidationError
|
|
557
|
+
- Schema cache with TTL (1 hour default)
|
|
558
|
+
- Cache invalidation and recompilation
|
|
559
|
+
- Logging for validation failures (permissive mode)
|
|
560
|
+
|
|
561
|
+
**Dependencies**: T036 (storage for schema retrieval)
|
|
562
|
+
**Acceptance**: Unit tests (T029) and contract tests (T010) pass
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
### T038: Implement federation module
|
|
567
|
+
**File**: `src/federation/hologram.js`
|
|
568
|
+
**Description**: Implement federation and holograms:
|
|
569
|
+
- `createHologram(sourceHolon, targetHolon, lensName, dataId)` → hologram object
|
|
570
|
+
- `resolveHologram(hologram, visitedSet)` → actual data
|
|
571
|
+
- Circular reference detection (max depth: 10)
|
|
572
|
+
- `setupFederation(source, target, lens, options)` → config
|
|
573
|
+
- `propagateData(data, federation)` → create holograms in target
|
|
574
|
+
|
|
575
|
+
**Dependencies**: T036 (storage), T035 (spatial for hierarchy)
|
|
576
|
+
**Acceptance**: Unit tests (T030) and contract tests (T011) pass
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
### T039: [P] Implement crypto module (lazy loading)
|
|
581
|
+
**File**: `src/crypto/secp256k1.js`
|
|
582
|
+
**Description**: Implement cryptographic operations:
|
|
583
|
+
- Dynamic import of `@noble/curves/secp256k1`
|
|
584
|
+
- `sign(content, privateKey)` → signature
|
|
585
|
+
- `verify(content, signature, publicKey)` → boolean
|
|
586
|
+
- `issueCapability(permissions, scope, recipient, options)` → token
|
|
587
|
+
- `verifyCapability(token, requiredPermission, scope)` → boolean
|
|
588
|
+
- Nonce generation and replay protection
|
|
589
|
+
|
|
590
|
+
**Dependencies**: None (lazy loaded)
|
|
591
|
+
**Acceptance**: Unit tests (T032) and contract tests (T014) pass
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
### T040: Implement content module
|
|
596
|
+
**File**: `src/content/social-protocols.js`
|
|
597
|
+
**Description**: Implement social protocol adapters:
|
|
598
|
+
- Nostr adapter: NIP-01 event validation, signing, verification
|
|
599
|
+
- ActivityPub adapter: JSON-LD validation, HTTP signatures
|
|
600
|
+
- `publishNostr(event, holonId, lensName)` → write to storage
|
|
601
|
+
- `publishActivityPub(object, holonId, lensName)` → write to storage
|
|
602
|
+
- `querySocial(holonId, options)` → filter by protocol and access level
|
|
603
|
+
|
|
604
|
+
**Dependencies**: T036 (storage), T039 (crypto for signatures)
|
|
605
|
+
**Acceptance**: Unit tests (T031) and contract tests (T015) pass
|
|
606
|
+
|
|
607
|
+
---
|
|
608
|
+
|
|
609
|
+
### T041: Implement subscriptions module
|
|
610
|
+
**File**: `src/subscriptions/manager.js`
|
|
611
|
+
**Description**: Implement subscription management:
|
|
612
|
+
- `subscribe(holonId, lensName, callback, options)` → subscription object
|
|
613
|
+
- Gun `.on()` listener with throttle and filter
|
|
614
|
+
- Callback invocation on data changes
|
|
615
|
+
- `unsubscribe()` cleanup (remove listener)
|
|
616
|
+
- Subscription registry for tracking active subscriptions
|
|
617
|
+
|
|
618
|
+
**Dependencies**: T036 (storage)
|
|
619
|
+
**Acceptance**: Unit tests (T033) and contract tests (T013) pass
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
### T041.5: Implement hierarchical upcast module
|
|
624
|
+
**File**: `src/hierarchical/upcast.js`
|
|
625
|
+
**Description**: Implement hierarchical aggregation with operations (FR-025 to FR-027):
|
|
626
|
+
- `upcast(holonId, lensName, dataId, options)` → boolean
|
|
627
|
+
- Operation modes: 'summarize' (count), 'aggregate' (merge objects), 'concatenate' (arrays)
|
|
628
|
+
- Traverse H3 parent hierarchy up to maxLevel (default: 3)
|
|
629
|
+
- Write holograms to parent holons referencing original data
|
|
630
|
+
- Error handling for noospheric holons (no spatial hierarchy)
|
|
631
|
+
- Integration with spatial module for parent traversal
|
|
632
|
+
- Integration with storage module for hologram creation
|
|
633
|
+
|
|
634
|
+
**Dependencies**: T035 (spatial), T036 (storage), T038 (federation for holograms)
|
|
635
|
+
**Acceptance**: Unit tests (T033.5) and contract tests (T012) pass
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## Phase 3.4: Integration & Public API
|
|
640
|
+
|
|
641
|
+
### T042: Wire up public API exports
|
|
642
|
+
**File**: `src/index.js`
|
|
643
|
+
**Description**: Create main entry point exporting HoloSphere class with all methods:
|
|
644
|
+
- Import and attach all modules to HoloSphere prototype
|
|
645
|
+
- Core: constructor
|
|
646
|
+
- Spatial: toHolon, getParents, getChildren, isValidH3
|
|
647
|
+
- Data: write, read, update, delete, writeGlobal, readGlobal, updateGlobal, deleteGlobal
|
|
648
|
+
- Schema: setSchema, getSchema, clearSchema
|
|
649
|
+
- Federation: federate, getFederatedData, unfederate
|
|
650
|
+
- Hierarchical: upcast
|
|
651
|
+
- Subscriptions: subscribe
|
|
652
|
+
- Crypto: sign, verify, issueCapability, verifyCapability
|
|
653
|
+
- Social: publishNostr, publishActivityPub, querySocial
|
|
654
|
+
- Utils: metrics
|
|
655
|
+
- Export error classes: ValidationError, AuthorizationError, HolosphereError
|
|
656
|
+
|
|
657
|
+
**Dependencies**: All modules (T034-T041.5)
|
|
658
|
+
**Acceptance**: All contract tests (T007-T016) pass
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
### T043: Verify all integration tests pass
|
|
663
|
+
**Files**: `tests/integration/scenario-*.test.js`
|
|
664
|
+
**Description**: Run all integration tests and verify end-to-end workflows:
|
|
665
|
+
- All 9 quickstart scenarios execute successfully
|
|
666
|
+
- No test failures, no errors
|
|
667
|
+
- Data persists correctly with radisk
|
|
668
|
+
- Federation works across dimensions
|
|
669
|
+
- Authorization enforced properly
|
|
670
|
+
|
|
671
|
+
**Dependencies**: T042 (public API complete)
|
|
672
|
+
**Acceptance**: All integration tests (T017-T025) pass
|
|
673
|
+
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
## Phase 3.5: Build, Distribution & Polish
|
|
677
|
+
|
|
678
|
+
### T044: Configure ESM build
|
|
679
|
+
**File**: `vite.config.js` (already created in T003, update if needed)
|
|
680
|
+
**Description**: Ensure ESM build configuration:
|
|
681
|
+
- Entry: `src/index.js`
|
|
682
|
+
- Output: `dist/esm/holosphere.js`
|
|
683
|
+
- Format: `es`
|
|
684
|
+
- Tree-shakeable exports
|
|
685
|
+
- Sourcemaps
|
|
686
|
+
|
|
687
|
+
**Dependencies**: T043 (tests passing)
|
|
688
|
+
**Acceptance**: `npm run build` creates `dist/esm/holosphere.js`
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
### T045: Configure CommonJS build
|
|
693
|
+
**File**: `vite.config.js` (update)
|
|
694
|
+
**Description**: Add CommonJS build target:
|
|
695
|
+
- Output: `dist/cjs/holosphere.cjs`
|
|
696
|
+
- Format: `cjs`
|
|
697
|
+
- Externalize peer dependencies (optional)
|
|
698
|
+
|
|
699
|
+
**Dependencies**: T044
|
|
700
|
+
**Acceptance**: `npm run build` creates `dist/cjs/holosphere.cjs`
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
### T046: Configure CDN bundle with radisk
|
|
705
|
+
**File**: `vite.config.js` (update)
|
|
706
|
+
**Description**: Add UMD bundle for CDN:
|
|
707
|
+
- Output: `dist/cdn/holosphere.min.js`
|
|
708
|
+
- Format: `umd`
|
|
709
|
+
- Global name: `HoloSphere`
|
|
710
|
+
- Bundle ALL dependencies (Gun, h3-js, @noble/curves, Ajv, radisk)
|
|
711
|
+
- Minify with terser
|
|
712
|
+
|
|
713
|
+
**Dependencies**: T045
|
|
714
|
+
**Acceptance**: `npm run build` creates `dist/cdn/holosphere.min.js`
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
### T047: Validate bundle size (<1MB target)
|
|
719
|
+
**File**: Create `scripts/check-bundle-size.js`
|
|
720
|
+
**Description**: Script to validate bundle size:
|
|
721
|
+
- Read `dist/cdn/holosphere.min.js` size
|
|
722
|
+
- Calculate gzipped size
|
|
723
|
+
- Assert <1MB (1,048,576 bytes)
|
|
724
|
+
- Exit with error if exceeds limit
|
|
725
|
+
- Add to `npm test` script
|
|
726
|
+
|
|
727
|
+
**Dependencies**: T046
|
|
728
|
+
**Acceptance**: Bundle size <1MB minified+gzipped
|
|
729
|
+
|
|
730
|
+
---
|
|
731
|
+
|
|
732
|
+
### T048: Configure package.json exports
|
|
733
|
+
**File**: `package.json` (update)
|
|
734
|
+
**Description**: Add package exports configuration:
|
|
735
|
+
```json
|
|
736
|
+
{
|
|
737
|
+
"type": "module",
|
|
738
|
+
"main": "./dist/cjs/holosphere.cjs",
|
|
739
|
+
"module": "./dist/esm/holosphere.js",
|
|
740
|
+
"browser": "./dist/cdn/holosphere.min.js",
|
|
741
|
+
"exports": {
|
|
742
|
+
".": {
|
|
743
|
+
"import": "./dist/esm/holosphere.js",
|
|
744
|
+
"require": "./dist/cjs/holosphere.cjs"
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
**Dependencies**: T046
|
|
751
|
+
**Acceptance**: `npm pack` creates package with correct exports
|
|
752
|
+
|
|
753
|
+
---
|
|
754
|
+
|
|
755
|
+
### T049: [P] Generate TypeScript definitions
|
|
756
|
+
**File**: Create `scripts/generate-types.js` or use `tsc`
|
|
757
|
+
**Description**: Generate TypeScript `.d.ts` files:
|
|
758
|
+
- Create type definitions for HoloSphere class
|
|
759
|
+
- Define all method signatures with parameter types
|
|
760
|
+
- Export error class types
|
|
761
|
+
- Include JSDoc comments from source
|
|
762
|
+
- Output to `dist/types/index.d.ts`
|
|
763
|
+
- Add `"types": "./dist/types/index.d.ts"` to package.json
|
|
764
|
+
|
|
765
|
+
**Dependencies**: T042 (source complete)
|
|
766
|
+
**Acceptance**: `dist/types/index.d.ts` exists with all API types
|
|
767
|
+
|
|
768
|
+
---
|
|
769
|
+
|
|
770
|
+
### T050: [P] Verify code coverage ≥80%
|
|
771
|
+
**File**: N/A (run coverage report)
|
|
772
|
+
**Description**: Run `npm run test:coverage` and verify:
|
|
773
|
+
- Line coverage ≥80% across all modules
|
|
774
|
+
- All modules have unit tests
|
|
775
|
+
- Contract tests cover 100% of public API
|
|
776
|
+
- Integration tests cover all user stories
|
|
777
|
+
- Generate HTML coverage report
|
|
778
|
+
|
|
779
|
+
**Dependencies**: T043 (all tests passing)
|
|
780
|
+
**Acceptance**: Coverage report shows ≥80% line coverage
|
|
781
|
+
|
|
782
|
+
---
|
|
783
|
+
|
|
784
|
+
### T051: [P] Create README.md with quickstart
|
|
785
|
+
**File**: `README.md`
|
|
786
|
+
**Description**: Create comprehensive README:
|
|
787
|
+
- Project description
|
|
788
|
+
- Installation (npm, CDN)
|
|
789
|
+
- Quick start example (basic usage)
|
|
790
|
+
- Link to full API documentation
|
|
791
|
+
- Link to quickstart scenarios
|
|
792
|
+
- Contributing guidelines
|
|
793
|
+
- License (specify)
|
|
794
|
+
|
|
795
|
+
**Dependencies**: T048 (package configured)
|
|
796
|
+
**Acceptance**: README covers installation and basic usage
|
|
797
|
+
|
|
798
|
+
---
|
|
799
|
+
|
|
800
|
+
### T052: [P] Performance validation
|
|
801
|
+
**File**: Create `tests/performance/benchmark.test.js`
|
|
802
|
+
**Description**: Performance tests:
|
|
803
|
+
- Initialization time <50ms (without crypto lazy load)
|
|
804
|
+
- Write operation <20ms (avg)
|
|
805
|
+
- Read operation <10ms (avg)
|
|
806
|
+
- Subscription overhead <5ms
|
|
807
|
+
- Hologram resolution <15ms (single level)
|
|
808
|
+
|
|
809
|
+
**Dependencies**: T043
|
|
810
|
+
**Acceptance**: All performance benchmarks meet targets
|
|
811
|
+
|
|
812
|
+
---
|
|
813
|
+
|
|
814
|
+
## Dependencies
|
|
815
|
+
|
|
816
|
+
**Sequential Dependencies**:
|
|
817
|
+
- Setup (T001-T006) → Tests (T007-T033) → Implementation (T034-T041) → Integration (T042-T043) → Build (T044-T052)
|
|
818
|
+
|
|
819
|
+
**Module Dependencies**:
|
|
820
|
+
- T035 (spatial), T036 (storage), T039 (crypto) depend on T034 (core)
|
|
821
|
+
- T037 (schema) depends on T036 (storage)
|
|
822
|
+
- T038 (federation) depends on T035 (spatial) and T036 (storage)
|
|
823
|
+
- T040 (content) depends on T036 (storage) and T039 (crypto)
|
|
824
|
+
- T041 (subscriptions) depends on T036 (storage)
|
|
825
|
+
- T042 (public API) depends on all modules (T034-T041)
|
|
826
|
+
|
|
827
|
+
**Test Dependencies**:
|
|
828
|
+
- Contract tests (T007-T016) can run in parallel
|
|
829
|
+
- Integration tests (T017-T025) can run in parallel
|
|
830
|
+
- Unit tests (T026-T033) can run in parallel
|
|
831
|
+
- All tests must be written before implementation begins
|
|
832
|
+
|
|
833
|
+
**Build Dependencies**:
|
|
834
|
+
- T045 (CJS) depends on T044 (ESM)
|
|
835
|
+
- T046 (CDN) depends on T045 (CJS)
|
|
836
|
+
- T047 (size check) depends on T046 (CDN)
|
|
837
|
+
- T048 (exports) depends on T046 (all builds complete)
|
|
838
|
+
|
|
839
|
+
---
|
|
840
|
+
|
|
841
|
+
## Parallel Execution Examples
|
|
842
|
+
|
|
843
|
+
### Launch all contract tests together (T007-T016):
|
|
844
|
+
```bash
|
|
845
|
+
# Use Task tool or run tests in parallel
|
|
846
|
+
vitest run tests/contract/core.test.js &
|
|
847
|
+
vitest run tests/contract/spatial.test.js &
|
|
848
|
+
vitest run tests/contract/data.test.js &
|
|
849
|
+
vitest run tests/contract/schema.test.js &
|
|
850
|
+
vitest run tests/contract/federation.test.js &
|
|
851
|
+
vitest run tests/contract/hierarchical.test.js &
|
|
852
|
+
vitest run tests/contract/subscriptions.test.js &
|
|
853
|
+
vitest run tests/contract/crypto.test.js &
|
|
854
|
+
vitest run tests/contract/social.test.js &
|
|
855
|
+
vitest run tests/contract/utils.test.js &
|
|
856
|
+
wait
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
### Launch all integration tests together (T017-T025):
|
|
860
|
+
```bash
|
|
861
|
+
vitest run tests/integration/scenario-01-geographic-storage.test.js &
|
|
862
|
+
vitest run tests/integration/scenario-02-federation.test.js &
|
|
863
|
+
vitest run tests/integration/scenario-03-subscriptions.test.js &
|
|
864
|
+
vitest run tests/integration/scenario-04-validation.test.js &
|
|
865
|
+
vitest run tests/integration/scenario-05-hierarchy.test.js &
|
|
866
|
+
vitest run tests/integration/scenario-06-social.test.js &
|
|
867
|
+
vitest run tests/integration/scenario-07-persistence.test.js &
|
|
868
|
+
vitest run tests/integration/scenario-08-authorization.test.js &
|
|
869
|
+
vitest run tests/integration/scenario-09-cross-dimensional.test.js &
|
|
870
|
+
wait
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
### Launch parallel unit tests (T026-T033):
|
|
874
|
+
```bash
|
|
875
|
+
vitest run tests/unit/core.test.js &
|
|
876
|
+
vitest run tests/unit/spatial.test.js &
|
|
877
|
+
vitest run tests/unit/storage.test.js &
|
|
878
|
+
vitest run tests/unit/schema.test.js &
|
|
879
|
+
vitest run tests/unit/federation.test.js &
|
|
880
|
+
vitest run tests/unit/content.test.js &
|
|
881
|
+
vitest run tests/unit/crypto.test.js &
|
|
882
|
+
vitest run tests/unit/subscriptions.test.js &
|
|
883
|
+
wait
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
### Launch parallel module implementations (T034, T035, T036, T039):
|
|
887
|
+
```bash
|
|
888
|
+
# Independent modules with no cross-dependencies
|
|
889
|
+
# Task: "Implement core module in src/core/holosphere.js"
|
|
890
|
+
# Task: "Implement spatial module in src/spatial/h3-operations.js (depends on core)"
|
|
891
|
+
# Task: "Implement storage module in src/storage/gun-wrapper.js (depends on core)"
|
|
892
|
+
# Task: "Implement crypto module in src/crypto/secp256k1.js (independent, lazy loaded)"
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
---
|
|
896
|
+
|
|
897
|
+
## Notes
|
|
898
|
+
|
|
899
|
+
- **[P] tasks** = Different files, no dependencies, safe to parallelize
|
|
900
|
+
- **TDD Enforcement**: All tests (T007-T033) MUST be written and failing before implementation (T034-T041)
|
|
901
|
+
- **Constitutional Compliance**: Every module has unit tests (per Constitution XI)
|
|
902
|
+
- **Coverage Target**: ≥80% line coverage enforced in T050
|
|
903
|
+
- **Commit Strategy**: Commit after each task or logical group
|
|
904
|
+
- **Error Handling**: All modules must use structured logging (JSON format)
|
|
905
|
+
|
|
906
|
+
---
|
|
907
|
+
|
|
908
|
+
## Validation Checklist
|
|
909
|
+
|
|
910
|
+
**Pre-Implementation Gates**:
|
|
911
|
+
- [x] All contracts have corresponding tests (T007-T016)
|
|
912
|
+
- [x] All entities have model/implementation tasks (9 entities → 8 modules)
|
|
913
|
+
- [x] All tests come before implementation (Phase 3.2 before 3.3)
|
|
914
|
+
- [x] Parallel tasks truly independent (verified file paths)
|
|
915
|
+
- [x] Each task specifies exact file path
|
|
916
|
+
- [x] No [P] task modifies same file as another [P] task
|
|
917
|
+
|
|
918
|
+
**Post-Implementation Gates**:
|
|
919
|
+
- [ ] All contract tests pass (run after T042)
|
|
920
|
+
- [ ] All integration tests pass (run after T043)
|
|
921
|
+
- [ ] All unit tests pass (continuous)
|
|
922
|
+
- [ ] Code coverage ≥80% (T050)
|
|
923
|
+
- [ ] Bundle size <1MB (T047)
|
|
924
|
+
- [ ] Performance benchmarks met (T052)
|
|
925
|
+
|
|
926
|
+
---
|
|
927
|
+
|
|
928
|
+
## Summary
|
|
929
|
+
|
|
930
|
+
**Total Tasks**: 52 (T001-T052)
|
|
931
|
+
**Parallel Opportunities**:
|
|
932
|
+
- 10 contract tests [P]
|
|
933
|
+
- 9 integration tests [P]
|
|
934
|
+
- 8 unit tests [P]
|
|
935
|
+
- 4 module implementations [P] (core, spatial, storage, crypto initially)
|
|
936
|
+
- 3 polish tasks [P] (types, coverage, docs)
|
|
937
|
+
|
|
938
|
+
**Estimated Phases**:
|
|
939
|
+
1. Setup: 6 tasks (sequential)
|
|
940
|
+
2. Tests: 27 tasks (mostly parallel)
|
|
941
|
+
3. Implementation: 9 tasks (parallel with dependencies)
|
|
942
|
+
4. Integration: 2 tasks (sequential)
|
|
943
|
+
5. Build & Polish: 8 tasks (mixed)
|
|
944
|
+
|
|
945
|
+
**Critical Path**: Setup → Tests → Core modules → Storage → Federation → Public API → Integration → Build
|
|
946
|
+
|
|
947
|
+
**Next Step**: Begin with T001 (Initialize npm project)
|