diff --git a/ENTITY_V3_4_0_RELEASE_MANIFEST.json b/ENTITY_V3_4_0_RELEASE_MANIFEST.json new file mode 100644 index 0000000..b597924 --- /dev/null +++ b/ENTITY_V3_4_0_RELEASE_MANIFEST.json @@ -0,0 +1,266 @@ +{ + "base_commit": "9c79f987207592cb6791e1a8956f23351cdfb2d3", + "base_release_manifest_sha256": "1e4fa980507f20168be44b7644a3ccfaa6cd369c08d05ff7c7c2fcb2956ff85c", + "base_release_snapshot_sha256": "a5b19ae2e698b7170dc060d468f0b6f27fe462204c80d0f3b61ba6ffc7779642", + "continuous_provenance_ingest": { + "files": 20, + "historical_provenance_before_v3_4_claimed": false, + "inventory_sha256": "33039e5124a6d1a7c8fc295a51dbb21d4b5de01f5a24e3fc0722b2dbf0989823" + }, + "external_remaining": [ + "unrelated third-party independent v3.4 implementation and live interoperability", + "independent external security/cryptographic review", + "deployment-specific legal/regulatory classification, licensing, recognition or approval where required", + "real external issuers, buyers, repeat transactions and market liquidity", + "standards/profile governance adoption outside BTG" + ], + "implementation_package_registry_sha256": "d59e93c0569b0c21bbb214da1afb567ad02324f581e1a2bfb2460a9c38ca7295", + "overlay_files": [ + { + "path": "RELEASE_NOTES_v3.4.0.md", + "sha256": "b1b036ffeb9a4e8f86e88874d59cf854acf7fa62ef05543d72db416abec3361b" + }, + { + "path": "docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json", + "sha256": "82b28e63e11bc1b77dfae2879259f272a4fdba5c65a539eb93abb53e6ce5cc46" + }, + { + "path": "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json", + "sha256": "e5b3aabf30770cd09fe7e0c141039745e3a7a04fc4a53620724a1e1e1bf13a3c" + }, + { + "path": "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md", + "sha256": "ccd46a522140723756203f52c9f0170a1ceaf46316c756e88c47dcc47bf96749" + }, + { + "path": "profiles/registry.json", + "sha256": "d59e93c0569b0c21bbb214da1afb567ad02324f581e1a2bfb2460a9c38ca7295" + }, + { + "path": "protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json", + "sha256": "4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd" + }, + { + "path": "protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json", + "sha256": "5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230" + }, + { + "path": "sdk/global_passport_sdk/README.md", + "sha256": "9981c36e7b44de00a2a2627376620da3716eebe7f64ff260f1fd0a1290838be4" + }, + { + "path": "sdk/global_passport_sdk/canonical_global_passport_sdk.py", + "sha256": "50d40713fe7f8462f54388bd7650705fd3f17027f7692a7cf87bf3ad59230e64" + }, + { + "path": "src/38_Global_Passports/continuous_ingestion.py", + "sha256": "6ebe6ff361ad42e6703d78fafbf2970bc6ffcce5da64b326df3cb51d6cb44b62" + }, + { + "path": "src/38_Global_Passports/global_passport.py", + "sha256": "78377698ed2021862757dd3f5bc8622e959c21fe43dc8085a6b83c502e047dfa" + }, + { + "path": "src/38_Global_Passports/global_passport_profile.py", + "sha256": "bc55797c9297ab567b04dc31a31021927df821ff4ad404a562df22d78c1cc1fb" + }, + { + "path": "src/38_Global_Passports/industry_profiles.py", + "sha256": "a409c74d4a5535191eac102c18f04df24a9ea89c467939355da03a7b73111d25" + }, + { + "path": "src/38_Global_Passports/passport_conformance.py", + "sha256": "7be41341e74bb7f841e47e53097482daf31030adb1c8115126a6417850c01473" + }, + { + "path": "src/38_Global_Passports/profile_registry.py", + "sha256": "3c94afc44c515a9313559a114ed073dad5bb6fc91b083cea57191cbdbbbe36ca" + }, + { + "path": "src/39_Implementation_Packages/industry_packages.py", + "sha256": "cd75a4aa24daf798e97632a8fca2ed0f2c1ce031bcefc3938ff066b830f7d8a1" + }, + { + "path": "tests/test_v3_global_passports.py", + "sha256": "922f11f692a5992b1211632a0b625ba51c2d30a4d71dc49e91ae323b109dbe6b" + }, + { + "path": "tools/build_v3_4_0_release.py", + "sha256": "f51f2cefa916c29eb671b5cfae70833355622221515aa9c2a74732c5333603fc" + }, + { + "path": "tools/build_v3_4_cleanroom_kit.py", + "sha256": "f8a42497336233c358f2582386365790783c221646cc3f15b5600d888503a009" + }, + { + "path": "tools/build_v3_4_industry_packages.py", + "sha256": "49585a6cf986214b2472805b8959bfef7d7f71354d70402205034958d67d3af7" + }, + { + "path": "tools/build_v3_4_qualification.py", + "sha256": "cb5ac3b9e4a20299aa6c68b4012b79e373a6a5553c7041108ed27fe1bbc9ed99" + }, + { + "path": "tools/entity_v3_4_cli.py", + "sha256": "01bc1becab44cceedd5b35a50733fab7dbc0128fbdc32c4769b9fbeaff62d55d" + }, + { + "path": "tools/ingest_v3_4_release.py", + "sha256": "ddea429260f673daef32a62c97948aaac924e25e752f3bfbb0691cac3bb649e9" + }, + { + "path": "tools/run_v3_4_0_release_gate.ps1", + "sha256": "716cdaa545044a282825f56004eeb0973b9f590b205e3b7839442189b627ce13" + }, + { + "path": "tools/verify_v3_4_0_release_manifest.py", + "sha256": "ed1398bd1629d56eb4bc4ec9ebb53ea6a2da60c8f0722f6f27942e92521f93ea" + }, + { + "path": "tools/verify_v3_4_global_passport_release.py", + "sha256": "7c94147c3f65605192e12dc0a161de40293260e6bdbac91e4ff3d595092087fe" + }, + { + "path": "tools/verify_v3_4_implementation_packages.py", + "sha256": "c20ddf9b2f750f1a6a7905b0930fce979069279d7551dc81ac647820ff1e556f" + } + ], + "overlay_snapshot_sha256": "b3d679da48ba598c13ec014ca68ca35c8c1bb88b20004320da4eab589b5fff31", + "permanent_truth_boundaries": [ + "cryptographic verification proves integrity/attribution, not objective external truth", + "protocol verification proves ENTITY semantic validity, not objective external truth", + "evidence and attestations remain attributable and contestable", + "profile composition does not create sovereign authority", + "external standards are mapped, not redefined or made subordinate to ENTITY", + "profile/package validation does not establish regulatory compliance", + "protocol records do not determine legal title or accounting fair value", + "provider custody does not create ENTITY authority", + "information itself need not be scarce; economic scarcity resides in explicitly bounded rights or interests" + ], + "qualification": { + "base_commit": "9c79f987207592cb6791e1a8956f23351cdfb2d3", + "base_release": "v3.3.0", + "base_release_manifest_sha256": "1e4fa980507f20168be44b7644a3ccfaa6cd369c08d05ff7c7c2fcb2956ff85c", + "claim_boundary": "Six native implementations are BTG-controlled controlled-interoperability evidence; they are not unrelated third-party independence.", + "cli_deployment_smoke": { + "legal_compliance_claimed": false, + "objective_truth_claimed": false, + "passport_valid": true, + "valid": true + }, + "date": "2026-09-24", + "external_remaining": [ + "unrelated third-party independent v3.4 implementation and live interoperability", + "independent external security/cryptographic review", + "deployment-specific legal/regulatory classification, licensing, recognition or approval where required", + "real external issuers, buyers, repeat transactions and market liquidity", + "standards/profile governance adoption outside BTG" + ], + "global_passport_conformance": { + "expected_result_sha256": "ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "invalid": 12, + "schema_sha256": "4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd", + "sealed_kit_sha256": "5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230", + "total": 24, + "valid": 12 + }, + "implementation_packages": { + "developer_configures_not_redesigns": true, + "domain_repositories": { + "ai": "blackmore-technology-group/ENTITY-AI", + "defence-public": "blackmore-technology-group/ENTITY-DEFENCE", + "finance": "blackmore-technology-group/ENTITY-FINANCE", + "healthcare": "blackmore-technology-group/ENTITY-HEALTHCARE", + "manufacturing": "blackmore-technology-group/ENTITY-MANUFACTURING", + "robotics": "blackmore-technology-group/ENTITY-ROBOTICS" + }, + "packages": { + "ai": "4877cb5bc76ef0803eace931ca1a9cba516c01ba94a2e0b4bc71bcb5dc1b0440", + "defence-public": "7edc52344822e370f937b12d05258b5cb3283756dadb5c1885dd93f126cf9887", + "finance": "768dd87fd5a29c7e2679fc2b0d4b172b8613712b148336d8fba91a3b92d0d466", + "healthcare": "b4e901ce37f696fa10666839cb8d3cacbd1fe663070667ca1767a6245e7cf939", + "manufacturing": "bc29a0de024cea22552078ff1913fa3df2b189436cb853cc2f4e08974325c4bc", + "robotics": "3a0e68fa6c63b2ef9cf79ccf463335af72d49ffb3cd028c88b6a998d8678f38f" + }, + "profiles_are_executable_implementation_assets": true, + "publication_model": "core registry plus six dedicated domain repositories", + "registry_sha256": "d59e93c0569b0c21bbb214da1afb567ad02324f581e1a2bfb2460a9c38ca7295" + }, + "permanent_truth_boundaries": [ + "cryptographic verification proves integrity/attribution, not objective external truth", + "protocol verification proves ENTITY semantic validity, not objective external truth", + "evidence and attestations remain attributable and contestable", + "profile composition does not create sovereign authority", + "external standards are mapped, not redefined or made subordinate to ENTITY", + "profile/package validation does not establish regulatory compliance", + "protocol records do not determine legal title or accounting fair value", + "provider custody does not create ENTITY authority", + "information itself need not be scarce; economic scarcity resides in explicitly bounded rights or interests" + ], + "qualified_source_commit": "854529e6cb88e77f29cce581beb74b530768224c", + "regression": { + "environment": "_venv_entity_v3", + "passed": 177, + "runner": "python -m unittest discover -s tests -p 'test_*.py' -v", + "total": 177 + }, + "schema": "entity-v3-4-0-release-qualification-v1", + "six_language_controlled_interoperability": { + "implementations": { + "csharp": "2cf64646cb70c8d89698f3f474a0a2a532c83b2d", + "go": "d878229a5256bf7c06a1da84dfb9ba0297f0c946", + "java": "da2520429f8dab7a2752b2b6b6fc653c6ae173b6", + "rust": "5420f724495722019b1f8624f02fe8a02df7bfbf", + "swift": "2f40118999beceb6c34f2ea1c583dd12cfe81368", + "typescript": "48e7f606740819379eee2e0fa663d41044b1d899" + }, + "independent_third_party_interoperability": false, + "result_sha256": "ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "status": "PASS" + }, + "status": "BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE", + "targeted_global_passport_tests": { + "passed": 33, + "total": 33 + }, + "v3_4_invariants": [ + "CORE_PRIMITIVES_UNCHANGED", + "MARKET_ENGINE_PRESERVED", + "GLOBAL_PASSPORT_BINDS_EXISTING_RIGHTS", + "PROFILE_COMPOSITION_DOES_NOT_CREATE_AUTHORITY", + "EXTERNAL_STANDARDS_MAPPED_NOT_REDEFINED", + "PASSPORT_IS_NOT_OBJECTIVE_TRUTH", + "LEGAL_COMPLIANCE_NOT_IMPLIED", + "CONTINUOUS_PROVENANCE", + "CUSTODY_IS_NOT_AUTHORITY", + "ECONOMIC_VALUE_NOT_INVENTED", + "INDUSTRY_PACKAGES_DO_NOT_CREATE_SILOS" + ], + "version": "3.4.0" + }, + "qualified_source_commit": "854529e6cb88e77f29cce581beb74b530768224c", + "release_chain": { + "v3.3.0_protected_base": "9c79f987207592cb6791e1a8956f23351cdfb2d3", + "v3.4.0_qualified_source": "854529e6cb88e77f29cce581beb74b530768224c" + }, + "release_date": "2026-09-24", + "release_snapshot_sha256": "3ff0e51ca2daabf50bc517e9c6e3438e8c150f1560cca6c99621621e3c855a90", + "repository": "blackmore-technology-group/ENTITY", + "schema": "entity-v3-4-0-release-manifest-v1", + "six_language_controlled_interoperability": { + "implementations": { + "csharp": "2cf64646cb70c8d89698f3f474a0a2a532c83b2d", + "go": "d878229a5256bf7c06a1da84dfb9ba0297f0c946", + "java": "da2520429f8dab7a2752b2b6b6fc653c6ae173b6", + "rust": "5420f724495722019b1f8624f02fe8a02df7bfbf", + "swift": "2f40118999beceb6c34f2ea1c583dd12cfe81368", + "typescript": "48e7f606740819379eee2e0fa663d41044b1d899" + }, + "independent_third_party_interoperability": false, + "result_sha256": "ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "status": "PASS" + }, + "status": "BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE", + "supersedes": "v3.3.0", + "version": "3.4.0" +} diff --git a/RELEASE_NOTES_v3.4.0.md b/RELEASE_NOTES_v3.4.0.md new file mode 100644 index 0000000..f120992 --- /dev/null +++ b/RELEASE_NOTES_v3.4.0.md @@ -0,0 +1,52 @@ +# ENTITY v3.4.0 — Global Passport & Continuous Provenance + +ENTITY v3.4.0 turns the existing sovereign authority, rights, evidence and economic architecture into a more directly deployable developer surface without changing the five core primitives: + +**ENTITY → AUTHORITY → RIGHT → EVENT → VALUE** + +The release introduces one universal **ENTITY Global Passport** that can carry a composable stack of jurisdiction, industry, privacy, trust and technical profiles. Industry packages populate that passport; they do not create incompatible industry-specific passports. + +## Primary additions + +1. Global Passport Envelope. +2. Fail-closed Composable Profile Stack. +3. Signed, immutable Versioned Global Profile Registry. +4. Versioned Standards Mapping Framework. +5. Continuous Provenance and Passport Derivation. +6. Executable Industry Implementation Packages and deployment SDK/CLI. + +The operational adoption concept is simple: **give this digital or physical asset an ENTITY Passport.** +## Executable implementation packages + +The first v3.4 package families are: + +- Healthcare — HL7 FHIR and DICOM mappings. +- Finance — ISO 20022, FIX and LEI mappings. +- Manufacturing — OPC UA and Asset Administration Shell mappings. +- AI — NIST AI RMF, SPDX 3 and CycloneDX mappings. +- Robotics — ROS 2 and Open-RMF mappings. +- Defence-public — public/unclassified asset, originator, custody and provenance patterns; classified material is explicitly rejected by this package. + +Packages include pre-engineered object types, profile composition, rights defaults, evidence expectations, privacy defaults, mapping rules, templates, configuration schemas, positive/negative conformance fixtures and quick-start material. Developers configure organization-specific facts rather than redesigning ENTITY. + +The deployment model is: + +**Select package → configure organization facts → connect systems/data → ingest → verify passport → run conformance → deploy.** + +External standards remain externally authoritative. ENTITY mappings state correspondence under a mapping version; they do not redefine those standards or claim normative equivalence. +## Qualification + +- Full ENTITY regression: **177/177 PASS**. +- v3.4 Global Passport/package targeted tests: **33/33 PASS**. +- Sealed v3.4 conformance campaign: **24/24 PASS** — 12 valid and 12 invalid vectors. +- Sealed kit SHA-256: `5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230`. +- Global Passport schema SHA-256: `4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd`. +- Canonical cross-language result SHA-256: `ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba`. +- Rust, TypeScript, Go, C#, Java and Swift BTG-controlled native implementations all passed the same campaign in protected repositories. +- Clean CLI deployment smoke test passed through initialization, package planning, ingestion and Global Passport verification. + +## Permanent boundaries + +A passport is not proof that an external assertion is objectively true. Cryptographic verification proves integrity and attribution within its scope. Profiles do not create sovereign authority. Package validation does not establish regulatory compliance. Provider custody does not create ENTITY authority. Market observations do not become accounting fair value. Information bytes remain nonrival; economic scarcity resides in explicitly bounded rights or interests. + +The six native implementations are **BTG-controlled interoperability evidence**, not unrelated third-party independence. Unrelated external implementation/live interoperability, independent security review, deployment-specific legal/regulatory treatment, and real external market adoption remain external milestones. diff --git a/docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json b/docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json new file mode 100644 index 0000000..f98e98f --- /dev/null +++ b/docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json @@ -0,0 +1,261 @@ +{ + "claim_boundary": "This campaign proves v3.4 release artifacts were registered under the new continuous-provenance workflow; it does not reconstruct or certify pre-v3.4 history.", + "content_addressed": true, + "controller_entity_id": "ent2-rlayc2wo4pkno3x3t4tcylsfo5afkgqa35w3fvtgwcu4u4ibr7fq", + "custody_is_not_authority": true, + "date": "2026-09-24", + "economic_value_invented": false, + "files": 20, + "historical_provenance_before_v3_4_claimed": false, + "inventory_sha256": "33039e5124a6d1a7c8fc295a51dbb21d4b5de01f5a24e3fc0722b2dbf0989823", + "profile_refs": [ + "entity-profile:global@1.0", + "entity-profile:ai@1.0" + ], + "provider_credentials_included": false, + "qualified_source_commit": "854529e6cb88e77f29cce581beb74b530768224c", + "records": [ + { + "content_sha256": "3c94afc44c515a9313559a114ed073dad5bb6fc91b083cea57191cbdbbbe36ca", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-62213abaf84d82ab91fb29ae", + "global_passport_id": "gpassport3-816ac47e87036b5efd71944d", + "global_passport_sha256": "2d81828b2e8c341ecd7260abe6fdcd38b109adfafe07c7899154cf8403a933f7", + "object_id": "obj3-6659b2a586ed28721fd868b95175281b33e0b3e9", + "passport_valid": true, + "path": "src/38_Global_Passports/profile_registry.py", + "rights_passport_id": "passport3-b7f4e7355e8a718127b697cd" + }, + { + "content_sha256": "a409c74d4a5535191eac102c18f04df24a9ea89c467939355da03a7b73111d25", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-b69b6b2af8f941a322423ddc", + "global_passport_id": "gpassport3-39fdc847a2bdadd4f991d036", + "global_passport_sha256": "039eb4916f624d964112de43e0ac12fc019909fb55563f2dce26c843ccec1394", + "object_id": "obj3-541d0bfca7b8d2a03131511c54165de4924ccb4c", + "passport_valid": true, + "path": "src/38_Global_Passports/industry_profiles.py", + "rights_passport_id": "passport3-1b584e61bccd8233a93610ba" + }, + { + "content_sha256": "78377698ed2021862757dd3f5bc8622e959c21fe43dc8085a6b83c502e047dfa", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-3aee8e3f78184179dda2e102", + "global_passport_id": "gpassport3-5e1302295fb6a9ac1a5c8739", + "global_passport_sha256": "0a8f4e82805ad2c51204d5d144aa59b1b8c3d5d0c2c6df8a29a85243a3191354", + "object_id": "obj3-7fc4643e0ab8c116e74fd7867659f484338e2179", + "passport_valid": true, + "path": "src/38_Global_Passports/global_passport.py", + "rights_passport_id": "passport3-0071c24476473887741d88ed" + }, + { + "content_sha256": "6ebe6ff361ad42e6703d78fafbf2970bc6ffcce5da64b326df3cb51d6cb44b62", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-4188d28d095657b40d91cb3d", + "global_passport_id": "gpassport3-e66b826ab58a390d35d5c7c7", + "global_passport_sha256": "bab64f1463039a3b6a3aa23dc8652d6c7f2695545070b031f691329e56781003", + "object_id": "obj3-102b14189ae0005e664e49006dcd2979e7227307", + "passport_valid": true, + "path": "src/38_Global_Passports/continuous_ingestion.py", + "rights_passport_id": "passport3-6c0c0ad6e90b6fa52afceff8" + }, + { + "content_sha256": "bc55797c9297ab567b04dc31a31021927df821ff4ad404a562df22d78c1cc1fb", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-bb33b378e6a94f69d4adbb01", + "global_passport_id": "gpassport3-1efc3aecb88e55333391087d", + "global_passport_sha256": "8df714f1825d51f7c8b504873d22651e875b998cb4d226583d83f06bf36f76ed", + "object_id": "obj3-fa51d26fe2fc66a1916100c6897f367db76cd463", + "passport_valid": true, + "path": "src/38_Global_Passports/global_passport_profile.py", + "rights_passport_id": "passport3-55b49a16cdf0973622233ee3" + }, + { + "content_sha256": "7be41341e74bb7f841e47e53097482daf31030adb1c8115126a6417850c01473", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-069e5a6b3646ede2c20b3c8b", + "global_passport_id": "gpassport3-6ce0874955d81f5a4571819d", + "global_passport_sha256": "388726342c159f88193feaa843d379ce36e9c97c771372ec268cce34bc62ecc3", + "object_id": "obj3-1e68f72545de1619a596df5eadb222b0aca26698", + "passport_valid": true, + "path": "src/38_Global_Passports/passport_conformance.py", + "rights_passport_id": "passport3-6805631832e7943041c136d9" + }, + { + "content_sha256": "cd75a4aa24daf798e97632a8fca2ed0f2c1ce031bcefc3938ff066b830f7d8a1", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-72d30e24a1b0c7f07386c1ac", + "global_passport_id": "gpassport3-ac08b03c561d47f9bef5f39e", + "global_passport_sha256": "a7376e02236aa2a6db93c243c1f65fc1feedcabc3093fa2cdd8498206b594e8d", + "object_id": "obj3-63efeaace58d09b07a9b999dd066bed0c688c30f", + "passport_valid": true, + "path": "src/39_Implementation_Packages/industry_packages.py", + "rights_passport_id": "passport3-29325ae9eb77b94581b0c59d" + }, + { + "content_sha256": "50d40713fe7f8462f54388bd7650705fd3f17027f7692a7cf87bf3ad59230e64", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-b13b9bc320973bf1e075f9c7", + "global_passport_id": "gpassport3-00b8af0ebd2e0767a9db32d5", + "global_passport_sha256": "5f8853a92afff4fc0c93646efc5c3931071b82dc56d5f9b2e385f1c6a4e0eab4", + "object_id": "obj3-48a3f20bbaa09614b96d5db96c041651a2a34161", + "passport_valid": true, + "path": "sdk/global_passport_sdk/canonical_global_passport_sdk.py", + "rights_passport_id": "passport3-679cadfc2af1f9f8f0ee94f1" + }, + { + "content_sha256": "9981c36e7b44de00a2a2627376620da3716eebe7f64ff260f1fd0a1290838be4", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-bd3083cc065a2dc049dd5ee0", + "global_passport_id": "gpassport3-259c033576e9195a5bb26a6d", + "global_passport_sha256": "27fe1d2f5d216f4ab43bc717c35c4b3464b0630f7e843daec2c3184caf95eeec", + "object_id": "obj3-520a9db2355f425f87a1f3a210fafb7131d4b111", + "passport_valid": true, + "path": "sdk/global_passport_sdk/README.md", + "rights_passport_id": "passport3-9b076e769195395b44b5247b" + }, + { + "content_sha256": "4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-fff27f2bf11ffb9e5646ba35", + "global_passport_id": "gpassport3-e363e5de56173cdc1e03d710", + "global_passport_sha256": "17c41b3d68a2ef3f5072a6a1c0f9fa7eff71cf26ae57ea568a582003ebbdd098", + "object_id": "obj3-1abbf4ce017c5b02065e6f3252f7de1bf8ddbce2", + "passport_valid": true, + "path": "protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json", + "rights_passport_id": "passport3-ab658ea597d93aa824fd0fb4" + }, + { + "content_sha256": "5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-0aa795f2a98a29836c78a1ab", + "global_passport_id": "gpassport3-01a8ee97a22743fad474e6ce", + "global_passport_sha256": "7b03e986e0e33eff2c34736d3fca2a777cd160574bbd5000d70039a3e67bb470", + "object_id": "obj3-321208af5eac827c767c10a41990cef8fb81e873", + "passport_valid": true, + "path": "protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json", + "rights_passport_id": "passport3-bee5e6ae7eb7f14aebc510f3" + }, + { + "content_sha256": "d59e93c0569b0c21bbb214da1afb567ad02324f581e1a2bfb2460a9c38ca7295", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-c228771ff44e0592bb6d5779", + "global_passport_id": "gpassport3-cacb3b554e0550e1ca7d65c1", + "global_passport_sha256": "e35ab4be6369d14f01e6d14247b9b61063ebfcff2a03a9aeb5a5b73712035a8f", + "object_id": "obj3-ef0398c1ed3b32b04d06f0c9b67a65e0798f548b", + "passport_valid": true, + "path": "profiles/registry.json", + "rights_passport_id": "passport3-43374208c47dc1ae6027ece0" + }, + { + "content_sha256": "f8a42497336233c358f2582386365790783c221646cc3f15b5600d888503a009", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-3d0e87a029225a12519d09a7", + "global_passport_id": "gpassport3-425e757dfe7fb23bad5f7bb6", + "global_passport_sha256": "82acf860b3afe41b84412d701ac15b1aca68ca63fb8ea8cea44782ab47934c94", + "object_id": "obj3-3e86099d9f23324a1c35b961a19332b08d20c4ea", + "passport_valid": true, + "path": "tools/build_v3_4_cleanroom_kit.py", + "rights_passport_id": "passport3-403399d0d15625819682e6ec" + }, + { + "content_sha256": "7c94147c3f65605192e12dc0a161de40293260e6bdbac91e4ff3d595092087fe", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-0c0b7aa8c1e6e4fe2797335d", + "global_passport_id": "gpassport3-a9cb3db8e034c2c9480e6759", + "global_passport_sha256": "b4354cf14186dc0a7c7426297b702926e8c598d88f5ec9e978b6acff0f10b5dd", + "object_id": "obj3-e91f5662d627ebc53a7fd380dda694dac381708c", + "passport_valid": true, + "path": "tools/verify_v3_4_global_passport_release.py", + "rights_passport_id": "passport3-6f20e2ad6c8fcb8977e4ea02" + }, + { + "content_sha256": "49585a6cf986214b2472805b8959bfef7d7f71354d70402205034958d67d3af7", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-52ff9ab7e1ef22223875bd1e", + "global_passport_id": "gpassport3-8fdb219524dd32dca4005429", + "global_passport_sha256": "b57f475a093c9afe9b1dd9895b254d4aecd0c5481a095c92ba43e35d455ba786", + "object_id": "obj3-6251e6685f6c6e08d083fcf92436dfa3d77f01df", + "passport_valid": true, + "path": "tools/build_v3_4_industry_packages.py", + "rights_passport_id": "passport3-908af95703eba5bb1b5e2f62" + }, + { + "content_sha256": "01bc1becab44cceedd5b35a50733fab7dbc0128fbdc32c4769b9fbeaff62d55d", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-4d867996e24fbcd21181fc68", + "global_passport_id": "gpassport3-bae672153f56bfe57fdd1c62", + "global_passport_sha256": "066212fb735ba5b3f5b29ff7a32b0049469d60f63dd95ae99ef10d7d0cc2bbbe", + "object_id": "obj3-bced9e755a436192a18d695f630a7e40d8a82ca4", + "passport_valid": true, + "path": "tools/entity_v3_4_cli.py", + "rights_passport_id": "passport3-6a9c72ef8fb9c20c3d1ea58e" + }, + { + "content_sha256": "922f11f692a5992b1211632a0b625ba51c2d30a4d71dc49e91ae323b109dbe6b", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-38c3a374b435808831142f88", + "global_passport_id": "gpassport3-4928ce9a5f52bda8517e38eb", + "global_passport_sha256": "5e38d7c7900c9ca061b43a62873ade53c5b955320d2f628fcc43a1c2cb644aea", + "object_id": "obj3-7b6bcd2bca9f3d706c85d38c18a9b711be446404", + "passport_valid": true, + "path": "tests/test_v3_global_passports.py", + "rights_passport_id": "passport3-19da9cbeeea5481f3003e864" + }, + { + "content_sha256": "e5b3aabf30770cd09fe7e0c141039745e3a7a04fc4a53620724a1e1e1bf13a3c", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-08a062d0e6be8269855ccd78", + "global_passport_id": "gpassport3-512ffa317c4ac059ae6623f0", + "global_passport_sha256": "bd90de4e6364d0bef6b05754e2a6b4a8433a5a7d1a08fc145b2a6c46d42a4c7b", + "object_id": "obj3-518c7a6f79eb180018b7741a168eaa110f1ba315", + "passport_valid": true, + "path": "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json", + "rights_passport_id": "passport3-8887d0b345dc372563e2bd2c" + }, + { + "content_sha256": "ccd46a522140723756203f52c9f0170a1ceaf46316c756e88c47dcc47bf96749", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-3572d6e2231387df19066852", + "global_passport_id": "gpassport3-9425185a10ea2e2f667985b7", + "global_passport_sha256": "832a430faac03c4a95de7569074d5b8a682dabfac86b0f84413b745092e9add6", + "object_id": "obj3-a526a44d7988432534329194424365b912315442", + "passport_valid": true, + "path": "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md", + "rights_passport_id": "passport3-5657aa6dbc4d8066086a2ff5" + }, + { + "content_sha256": "b1b036ffeb9a4e8f86e88874d59cf854acf7fa62ef05543d72db416abec3361b", + "custody_is_not_authority": true, + "economic_value_invented": false, + "evidence_id": "evidence3-98df220af4eecf5c21f90782", + "global_passport_id": "gpassport3-5db0bb93039e08f545771214", + "global_passport_sha256": "857f2846ab47c42561e02a86d668a29df26efc1283f0b20d657cdbc6fd4b31cf", + "object_id": "obj3-54e872853888c7c64e06d4351be987590d1ab3c4", + "passport_valid": true, + "path": "RELEASE_NOTES_v3.4.0.md", + "rights_passport_id": "passport3-bcf0be90fba583fcd8d4b879" + } + ], + "schema": "entity-v3-4-continuous-provenance-release-ingest-v1", + "version": "3.4.0" +} diff --git a/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json b/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json new file mode 100644 index 0000000..ccb3c1a --- /dev/null +++ b/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json @@ -0,0 +1,101 @@ +{ + "base_commit": "9c79f987207592cb6791e1a8956f23351cdfb2d3", + "base_release": "v3.3.0", + "base_release_manifest_sha256": "1e4fa980507f20168be44b7644a3ccfaa6cd369c08d05ff7c7c2fcb2956ff85c", + "claim_boundary": "Six native implementations are BTG-controlled controlled-interoperability evidence; they are not unrelated third-party independence.", + "cli_deployment_smoke": { + "legal_compliance_claimed": false, + "objective_truth_claimed": false, + "passport_valid": true, + "valid": true + }, + "date": "2026-09-24", + "external_remaining": [ + "unrelated third-party independent v3.4 implementation and live interoperability", + "independent external security/cryptographic review", + "deployment-specific legal/regulatory classification, licensing, recognition or approval where required", + "real external issuers, buyers, repeat transactions and market liquidity", + "standards/profile governance adoption outside BTG" + ], + "global_passport_conformance": { + "expected_result_sha256": "ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "invalid": 12, + "schema_sha256": "4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd", + "sealed_kit_sha256": "5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230", + "total": 24, + "valid": 12 + }, + "implementation_packages": { + "developer_configures_not_redesigns": true, + "domain_repositories": { + "ai": "blackmore-technology-group/ENTITY-AI", + "defence-public": "blackmore-technology-group/ENTITY-DEFENCE", + "finance": "blackmore-technology-group/ENTITY-FINANCE", + "healthcare": "blackmore-technology-group/ENTITY-HEALTHCARE", + "manufacturing": "blackmore-technology-group/ENTITY-MANUFACTURING", + "robotics": "blackmore-technology-group/ENTITY-ROBOTICS" + }, + "packages": { + "ai": "4877cb5bc76ef0803eace931ca1a9cba516c01ba94a2e0b4bc71bcb5dc1b0440", + "defence-public": "7edc52344822e370f937b12d05258b5cb3283756dadb5c1885dd93f126cf9887", + "finance": "768dd87fd5a29c7e2679fc2b0d4b172b8613712b148336d8fba91a3b92d0d466", + "healthcare": "b4e901ce37f696fa10666839cb8d3cacbd1fe663070667ca1767a6245e7cf939", + "manufacturing": "bc29a0de024cea22552078ff1913fa3df2b189436cb853cc2f4e08974325c4bc", + "robotics": "3a0e68fa6c63b2ef9cf79ccf463335af72d49ffb3cd028c88b6a998d8678f38f" + }, + "profiles_are_executable_implementation_assets": true, + "publication_model": "core registry plus six dedicated domain repositories", + "registry_sha256": "d59e93c0569b0c21bbb214da1afb567ad02324f581e1a2bfb2460a9c38ca7295" + }, + "permanent_truth_boundaries": [ + "cryptographic verification proves integrity/attribution, not objective external truth", + "protocol verification proves ENTITY semantic validity, not objective external truth", + "evidence and attestations remain attributable and contestable", + "profile composition does not create sovereign authority", + "external standards are mapped, not redefined or made subordinate to ENTITY", + "profile/package validation does not establish regulatory compliance", + "protocol records do not determine legal title or accounting fair value", + "provider custody does not create ENTITY authority", + "information itself need not be scarce; economic scarcity resides in explicitly bounded rights or interests" + ], + "qualified_source_commit": "854529e6cb88e77f29cce581beb74b530768224c", + "regression": { + "environment": "_venv_entity_v3", + "passed": 177, + "runner": "python -m unittest discover -s tests -p 'test_*.py' -v", + "total": 177 + }, + "schema": "entity-v3-4-0-release-qualification-v1", + "six_language_controlled_interoperability": { + "implementations": { + "csharp": "2cf64646cb70c8d89698f3f474a0a2a532c83b2d", + "go": "d878229a5256bf7c06a1da84dfb9ba0297f0c946", + "java": "da2520429f8dab7a2752b2b6b6fc653c6ae173b6", + "rust": "5420f724495722019b1f8624f02fe8a02df7bfbf", + "swift": "2f40118999beceb6c34f2ea1c583dd12cfe81368", + "typescript": "48e7f606740819379eee2e0fa663d41044b1d899" + }, + "independent_third_party_interoperability": false, + "result_sha256": "ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "status": "PASS" + }, + "status": "BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE", + "targeted_global_passport_tests": { + "passed": 33, + "total": 33 + }, + "v3_4_invariants": [ + "CORE_PRIMITIVES_UNCHANGED", + "MARKET_ENGINE_PRESERVED", + "GLOBAL_PASSPORT_BINDS_EXISTING_RIGHTS", + "PROFILE_COMPOSITION_DOES_NOT_CREATE_AUTHORITY", + "EXTERNAL_STANDARDS_MAPPED_NOT_REDEFINED", + "PASSPORT_IS_NOT_OBJECTIVE_TRUTH", + "LEGAL_COMPLIANCE_NOT_IMPLIED", + "CONTINUOUS_PROVENANCE", + "CUSTODY_IS_NOT_AUTHORITY", + "ECONOMIC_VALUE_NOT_INVENTED", + "INDUSTRY_PACKAGES_DO_NOT_CREATE_SILOS" + ], + "version": "3.4.0" +} diff --git a/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md b/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md new file mode 100644 index 0000000..c45835f --- /dev/null +++ b/docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md @@ -0,0 +1,25 @@ +# ENTITY v3.4.0 Release Qualification — 2026-09-24 + +**Status:** BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE + +**Qualified source:** `854529e6cb88e77f29cce581beb74b530768224c` +**Base:** ENTITY v3.3.0 at `9c79f987207592cb6791e1a8956f23351cdfb2d3` + +## Qualification result + +- Complete regression: **177/177 PASS**. +- v3.4 targeted Global Passport / implementation-package tests: **33/33 PASS**. +- Sealed Global Passport campaign: **24/24 vectors** (12 valid, 12 invalid). +- Canonical result SHA-256: `ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba`. +- Six BTG-controlled native implementations: **Rust, TypeScript, Go, C#, Java, Swift — PASS**. +- CLI deployment path: initialize → package plan → ingest → passport verify — **PASS**. + +## Release architecture + +ENTITY v3.4 preserves `ENTITY → AUTHORITY → RIGHT → EVENT → VALUE`. It adds one Global Passport, composable profiles, a versioned profile registry, explicit external-standard mappings, continuous provenance and executable implementation packages for Healthcare, Finance, Manufacturing, AI, Robotics and public/unclassified Defence. + +Industry packages populate the one Global Passport. They do not define incompatible industry-specific passports, create authority, declare truth, or establish regulatory compliance. + +## Evidence boundary + +The six native implementations are all BTG-controlled. Their common result is meaningful controlled-interoperability evidence, but **unrelated third-party implementation/interoperability remains pending**. External security review and deployment-specific legal/regulatory determinations also remain external work. diff --git a/profiles/registry.json b/profiles/registry.json new file mode 100644 index 0000000..bbb6b08 --- /dev/null +++ b/profiles/registry.json @@ -0,0 +1,14 @@ +{ + "one_global_passport": true, + "packages": [ + {"name":"ai","package_sha256":"4877cb5bc76ef0803eace931ca1a9cba516c01ba94a2e0b4bc71bcb5dc1b0440","profile_refs":["entity-profile:global@1.0","entity-profile:ai@1.0"],"version":"1.0"}, + {"name":"defence-public","package_sha256":"7edc52344822e370f937b12d05258b5cb3283756dadb5c1885dd93f126cf9887","profile_refs":["entity-profile:global@1.0","entity-profile:defence-public@1.0"],"version":"1.0"}, + {"name":"finance","package_sha256":"768dd87fd5a29c7e2679fc2b0d4b172b8613712b148336d8fba91a3b92d0d466","profile_refs":["entity-profile:global@1.0","entity-profile:finance@1.0"],"version":"1.0"}, + {"name":"healthcare","package_sha256":"b4e901ce37f696fa10666839cb8d3cacbd1fe663070667ca1767a6245e7cf939","profile_refs":["entity-profile:global@1.0","entity-profile:healthcare@1.0"],"version":"1.0"}, + {"name":"manufacturing","package_sha256":"bc29a0de024cea22552078ff1913fa3df2b189436cb853cc2f4e08974325c4bc","profile_refs":["entity-profile:global@1.0","entity-profile:manufacturing@1.0"],"version":"1.0"}, + {"name":"robotics","package_sha256":"3a0e68fa6c63b2ef9cf79ccf463335af72d49ffb3cd028c88b6a998d8678f38f","profile_refs":["entity-profile:global@1.0","entity-profile:robotics@1.0"],"version":"1.0"} + ], + "profiles_are_executable_implementation_assets": true, + "schema": "entity-v3-industry-package-registry-v1", + "version": "3.4.0" +} diff --git a/protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json b/protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json new file mode 100644 index 0000000..25fb575 --- /dev/null +++ b/protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json @@ -0,0 +1,84 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://entity.btg.example/protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json", + "title": "ENTITY v3.4 Global Passport", + "type": "object", + "required": [ + "schema", "passport_id", "object_id", "controller_entity_id", "version", + "core_primitives", "rights_passport_id", "rights_passport_sha256", "profile_stack", + "evidence_refs", "provenance_refs", "standards_mappings", "economic_state", + "one_passport_many_profiles", "profile_composition_does_not_create_authority", + "standards_mapping_is_not_normative_equivalence", "evidence_does_not_establish_objective_truth", + "legal_effect_is_deployment_specific", "underlying_information_remains_nonrival" + ], + "properties": { + "schema": {"const": "entity-v3-global-passport-v1"}, + "passport_id": {"type": "string", "minLength": 8}, + "object_id": {"type": "string", "minLength": 8}, + "controller_entity_id": {"type": "string", "minLength": 8}, + "version": {"type": "string", "minLength": 1}, + "core_primitives": {"const": ["ENTITY", "AUTHORITY", "RIGHT", "EVENT", "VALUE"]}, + "rights_passport_id": {"type": "string", "minLength": 8}, + "rights_passport_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, + "profile_stack": {"$ref": "#/$defs/profileStack"}, + "evidence_refs": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "provenance_refs": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "jurisdiction_profile_refs": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "standards_mappings": { + "type": "array", + "items": { + "type": "object", + "required": ["standard", "normative_equivalence_claimed"], + "properties": { + "standard": {"type": "string", "minLength": 1}, + "normative_equivalence_claimed": {"const": false} + }, + "additionalProperties": true + } + }, + "economic_state": { + "type": "object", + "required": ["state", "amount_units", "currency", "market_observation_is_not_accounting_fair_value"], + "properties": { + "state": {"enum": ["POTENTIAL", "OFFER", "CONTRACTED", "ACCRUED", "SETTLED", "REALIZED"]}, + "amount_units": {"type": "integer", "minimum": 0}, + "currency": {"type": "string", "minLength": 1}, + "market_observation_is_not_accounting_fair_value": {"const": true} + }, + "additionalProperties": true + }, + "industry_context": {"type": "object"}, + "one_passport_many_profiles": {"const": true}, + "profile_composition_does_not_create_authority": {"const": true}, + "standards_mapping_is_not_normative_equivalence": {"const": true}, + "evidence_does_not_establish_objective_truth": {"const": true}, + "legal_effect_is_deployment_specific": {"const": true}, + "underlying_information_remains_nonrival": {"const": true}, + "created_at_ms": {"type": "integer", "minimum": 0} + }, + "$defs": { + "profileStack": { + "type": "object", + "required": ["schema", "profile_refs", "profile_hashes", "fail_closed", "profile_composition_does_not_create_authority"], + "properties": { + "schema": {"const": "entity-v3-profile-stack-resolution-v1"}, + "profile_refs": { + "type": "array", + "contains": {"const": "entity-profile:global@1.0"}, + "minItems": 1, + "uniqueItems": true + }, + "profile_hashes": { + "type": "array", + "items": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, + "minItems": 1 + }, + "fail_closed": {"const": true}, + "profile_composition_does_not_create_authority": {"const": true}, + "standards_mapping_is_not_normative_equivalence": {"const": true} + }, + "additionalProperties": true + } + }, + "additionalProperties": true +} diff --git a/protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json b/protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json new file mode 100644 index 0000000..2dfe463 --- /dev/null +++ b/protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json @@ -0,0 +1 @@ +{"base_commit":"9c79f987207592cb6791e1a8956f23351cdfb2d3","base_release":"v3.3.0","cases":[{"expect":"INVALID","id":"invalid_defence_not_public","record":{"kind":"INDUSTRY","profile_id":"entity-profile:defence-public","profile_is_not_authority":true,"profile_ref":"entity-profile:defence-public@1.0","public_unclassified":false,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"INVALID","id":"invalid_ingest_fake_value","record":{"content_addressed":true,"custody_is_not_authority":true,"economic_value_invented":true,"files":3,"inventory_sha256":"0000000000000000000000000000000000000000000000000000000000000000","schema":"entity-v3-continuous-ingest-result-v1"}},{"expect":"INVALID","id":"invalid_ingest_negative_files","record":{"content_addressed":true,"custody_is_not_authority":true,"economic_value_invented":false,"files":-1,"inventory_sha256":"0000000000000000000000000000000000000000000000000000000000000000","schema":"entity-v3-continuous-ingest-result-v1"}},{"expect":"INVALID","id":"invalid_passport_core","record":{"core_primitives":["ENTITY","TOKEN"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":true,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[],"underlying_information_remains_nonrival":true}},{"expect":"INVALID","id":"invalid_passport_equivalence","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":true,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[{"normative_equivalence_claimed":true,"standard":"FHIR"}],"underlying_information_remains_nonrival":true}},{"expect":"INVALID","id":"invalid_passport_scarcity","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":true,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[],"underlying_information_remains_nonrival":false}},{"expect":"INVALID","id":"invalid_passport_truth","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":false,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[],"underlying_information_remains_nonrival":true}},{"expect":"INVALID","id":"invalid_profile_authority","record":{"kind":"INDUSTRY","profile_id":"entity-profile:ai","profile_is_not_authority":false,"profile_ref":"entity-profile:ai@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"INVALID","id":"invalid_profile_kind","record":{"kind":"UNKNOWN","profile_id":"entity-profile:ai","profile_is_not_authority":true,"profile_ref":"entity-profile:ai@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"INVALID","id":"invalid_stack_bad_hash","record":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["bad"],"profile_refs":["entity-profile:global@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true}},{"expect":"INVALID","id":"invalid_stack_missing_global","record":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:ai@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true}},{"expect":"INVALID","id":"invalid_status_core_change","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"core_semantics_changed":true,"evidence_truth_boundary_preserved":true,"market_engine_preserved":true,"one_passport_many_profiles":true,"schema":"entity-v3-global-passport-profile-status-v1"}},{"expect":"VALID","id":"valid_ai_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:ai","profile_is_not_authority":true,"profile_ref":"entity-profile:ai@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_defence_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:defence-public","profile_is_not_authority":true,"profile_ref":"entity-profile:defence-public@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_finance_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:finance","profile_is_not_authority":true,"profile_ref":"entity-profile:finance@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_global_profile","record":{"kind":"GLOBAL","profile_id":"entity-profile:global","profile_is_not_authority":true,"profile_ref":"entity-profile:global@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_healthcare_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:healthcare","profile_is_not_authority":true,"profile_ref":"entity-profile:healthcare@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_ingest","record":{"content_addressed":true,"custody_is_not_authority":true,"economic_value_invented":false,"files":3,"inventory_sha256":"0000000000000000000000000000000000000000000000000000000000000000","schema":"entity-v3-continuous-ingest-result-v1"}},{"expect":"VALID","id":"valid_manufacturing_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:manufacturing","profile_is_not_authority":true,"profile_ref":"entity-profile:manufacturing@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_passport_ai","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":true,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0","entity-profile:ai@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[],"underlying_information_remains_nonrival":true}},{"expect":"VALID","id":"valid_passport_finance_mapping","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"economic_state":{"amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":true,"state":"POTENTIAL"},"evidence_does_not_establish_objective_truth":true,"legal_effect_is_deployment_specific":true,"one_passport_many_profiles":true,"profile_composition_does_not_create_authority":true,"profile_stack":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0","entity-profile:finance@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true},"rights_passport_id":"passport3-example","rights_passport_sha256":"2222222222222222222222222222222222222222222222222222222222222222","schema":"entity-v3-global-passport-v1","standards_mapping_is_not_normative_equivalence":true,"standards_mappings":[{"normative_equivalence_claimed":false,"standard":"ISO-20022"}],"underlying_information_remains_nonrival":true}},{"expect":"VALID","id":"valid_robotics_profile","record":{"kind":"INDUSTRY","profile_id":"entity-profile:robotics","profile_is_not_authority":true,"profile_ref":"entity-profile:robotics@1.0","public_unclassified":true,"schema":"entity-v3-global-profile-v1","schema_sha256":"0000000000000000000000000000000000000000000000000000000000000000","standards_mapping_is_not_normative_equivalence":true,"version":"1.0"}},{"expect":"VALID","id":"valid_stack_multi","record":{"fail_closed":true,"profile_composition_does_not_create_authority":true,"profile_hashes":["1111111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111111","1111111111111111111111111111111111111111111111111111111111111111"],"profile_refs":["entity-profile:global@1.0","entity-profile:healthcare@1.0","entity-profile:ai@1.0"],"schema":"entity-v3-profile-stack-resolution-v1","standards_mapping_is_not_normative_equivalence":true}},{"expect":"VALID","id":"valid_status","record":{"core_primitives":["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"],"core_semantics_changed":false,"evidence_truth_boundary_preserved":true,"market_engine_preserved":true,"one_passport_many_profiles":true,"schema":"entity-v3-global-passport-profile-status-v1"}}],"doctrine":"One ENTITY Passport. Many jurisdictions, industries, standards and contexts. No new sovereignty silos.","expected_result_sha256":"ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba","invalid_vectors":12,"schema":"entity-v3.4-global-passport-cleanroom-kit-v1","schema_sha256":"4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd","valid_vectors":12,"version":"3.4.0"} \ No newline at end of file diff --git a/sdk/global_passport_sdk/README.md b/sdk/global_passport_sdk/README.md new file mode 100644 index 0000000..e81472c --- /dev/null +++ b/sdk/global_passport_sdk/README.md @@ -0,0 +1,24 @@ +# ENTITY Global Passport SDK + +ENTITY v3.4 exposes one Global Passport across composable jurisdiction, industry and technical profiles. The SDK wraps existing sovereign primitives, v3.2 Rights Passports, v3.3 Evidence Objects, v3.4 profiles, continuous provenance and executable industry packages. + +It does **not** create authority, determine legal ownership, assert regulatory compliance, establish objective truth, or make external standards subordinate to ENTITY. + +Built-in profile aliases are `global`, `healthcare`, `finance`, `manufacturing`, `ai`, `robotics`, and public/unclassified `defence` / `defense`. + +## Developer model + +The deployer configures organization-specific facts; the deployer does not redesign ENTITY semantics. + +```python +sdk.package_plan("healthcare", config, "clinical_dataset") +sdk.map_external("healthcare", "HL7-FHIR", fhir_resource) +sdk.ingest_package_file(path, controller_entity_id, "healthcare", config, "clinical_dataset") +sdk.verify_passport(global_passport_id) +``` + +The package layer pre-engineers object types, rights defaults, evidence expectations, privacy defaults, external-standard mappings and profile composition. Continuous ingestion registers content by SHA-256, creates the ENTITY object, Evidence Object, Rights Passport and Global Passport, records provenance, and writes a zero-value economic baseline unless supported evidence establishes a different economic state. + +External-standard mappings are explicitly versioned correspondences only. They do not redefine FHIR, DICOM, ISO 20022, FIX, LEI, OPC UA, AAS, SPDX, CycloneDX, NIST AI RMF, ROS 2, Open-RMF or any other external standard. + +The command-line deployment facade is `tools/entity_v3_4_cli.py` with `init`, `packages`, `plan`, `map`, `ingest` and `verify` operations. diff --git a/sdk/global_passport_sdk/canonical_global_passport_sdk.py b/sdk/global_passport_sdk/canonical_global_passport_sdk.py new file mode 100644 index 0000000..30f78b4 --- /dev/null +++ b/sdk/global_passport_sdk/canonical_global_passport_sdk.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +PROFILE_ALIASES={ + "global":"entity-profile:global@1.0","healthcare":"entity-profile:healthcare@1.0","finance":"entity-profile:finance@1.0", + "manufacturing":"entity-profile:manufacturing@1.0","ai":"entity-profile:ai@1.0","robotics":"entity-profile:robotics@1.0", + "defence":"entity-profile:defence-public@1.0","defense":"entity-profile:defence-public@1.0", +} + +class EntityGlobalPassportSDK: + """Public v3.4 facade. SDK convenience never creates authority, truth or regulatory status.""" + def __init__(self,profile_registry,global_passports,continuous_ingestion,industry_packages=None): + self.profiles=profile_registry + self.passports=global_passports + self.ingestion=continuous_ingestion + self.industry_packages=industry_packages + + @staticmethod + def profile_ref(name:str)->str: + key=str(name).strip().lower() + if key not in PROFILE_ALIASES: raise KeyError("unknown built-in profile alias") + return PROFILE_ALIASES[key] + + def compose_profiles(self,*names_or_refs:str)->dict: + refs=[] + if not any(str(x).startswith("entity-profile:global@") or str(x).lower()=="global" for x in names_or_refs): + refs.append(PROFILE_ALIASES["global"]) + for item in names_or_refs: + text=str(item); refs.append(text if text.startswith("entity-profile:") else self.profile_ref(text)) + return self.profiles.resolve_stack(refs) + def register_file(self,path,controller_entity_id:str,*profiles:str,logical_path:str|None=None, + previous_object_id:str|None=None,version:str="1.0")->dict: + stack=self.compose_profiles(*profiles) + result=self.ingestion.ingest_file(path,controller_entity_id,stack["profile_refs"],logical_path=logical_path, + previous_object_id=previous_object_id,version=version) + return {"object_id":result["object"]["object_id"],"content_sha256":result["object"]["content_sha256"], + "rights_passport_id":result["rights_passport"]["passport_id"], + "global_passport_id":result["global_passport"]["passport_id"], + "global_passport_sha256":result["global_passport"]["body_sha256"], + "evidence_id":result["evidence"]["evidence_id"],"profile_refs":stack["profile_refs"], + "custody_is_not_authority":True,"economic_value_invented":False} + + def package_plan(self,package:str,config:dict,asset_kind:str)->dict: + if self.industry_packages is None: raise RuntimeError("industry package registry not configured") + return self.industry_packages.deployment_plan(package,config,asset_kind) + + def map_external(self,package:str,standard:str,record:dict)->dict: + if self.industry_packages is None: raise RuntimeError("industry package registry not configured") + return self.industry_packages.map_external(package,standard,record) + + def ingest_package_file(self,path,controller_entity_id:str,package:str,config:dict,asset_kind:str,**kwargs)->dict: + plan=self.package_plan(package,config,asset_kind) + result=self.ingestion.ingest_file(path,controller_entity_id,plan["profile_refs"], + rights_actions=plan["rights_actions"],**kwargs) + return {"deployment_plan":plan,"object_id":result["object"]["object_id"], + "global_passport_id":result["global_passport"]["passport_id"], + "content_sha256":result["object"]["content_sha256"],"economic_value_invented":False} + def verify_passport(self,passport_or_id)->dict: + passport=self.passports.get(passport_or_id) if isinstance(passport_or_id,str) else passport_or_id + return self.passports.verify(passport) + + @staticmethod + def capability_status()->dict: + return {"schema":"entity-v3-global-passport-sdk-status-v1","sdk_does_not_create_authority":True, + "profile_is_not_regulatory_compliance":True,"external_standards_are_mapped_not_redefined":True, + "continuous_provenance_supported":True,"industry_packages_supported":True, + "developer_configures_not_redesigns":True,"built_in_profile_aliases":sorted(PROFILE_ALIASES)} diff --git a/src/38_Global_Passports/continuous_ingestion.py b/src/38_Global_Passports/continuous_ingestion.py new file mode 100644 index 0000000..091f5cb --- /dev/null +++ b/src/38_Global_Passports/continuous_ingestion.py @@ -0,0 +1,68 @@ +from __future__ import annotations +from pathlib import Path +import hashlib, shutil + +EXCLUDED_DIRS={".git","node_modules",".build","target","dist","bin","obj","__pycache__",".pytest_cache",".venv","venv"} +MODEL_EXT={".onnx",".pt",".pth",".safetensors",".gguf",".tflite"} +DATA_EXT={".csv",".jsonl",".parquet",".arrow",".avro"} +SOFTWARE_EXT={".py",".rs",".go",".java",".cs",".swift",".ts",".js",".kt",".cpp",".c",".h"} + +def sha256_file(path:Path)->str: + h=hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda:f.read(1024*1024),b""): h.update(chunk) + return h.hexdigest() + +def object_type_for(path:Path)->str: + ext=path.suffix.lower() + if ext in MODEL_EXT: return "MODEL" + if ext in DATA_EXT: return "DATASET" + if ext in SOFTWARE_EXT: return "SOFTWARE" + if ext in {".md",".txt",".pdf",".docx",".xml",".yaml",".yml"}: return "DOCUMENT" + return "OTHER" + +class ContinuousProvenanceEngine: + """Registers artifacts at creation time and stores recoverable content-addressed custody without making custody authoritative.""" + def __init__(self,state_root,identity,fabric,evidence_registry,rights_passports,global_passports): + self.root=Path(state_root); self.vault=self.root/"content_vault"/"sha256"; self.vault.mkdir(parents=True,exist_ok=True) + self.identity=identity; self.fabric=fabric; self.evidence=evidence_registry; self.rights=rights_passports; self.global_passports=global_passports + def ingest_file(self,path,controller_entity_id:str,profile_refs:list[str],*,logical_path:str|None=None, + previous_object_id:str|None=None,rights_actions:list[str]|None=None,version:str="1.0")->dict: + src=Path(path).resolve() + if not src.is_file(): raise FileNotFoundError(src) + content_sha=sha256_file(src); vault_path=self.vault/content_sha[:2]/content_sha + vault_path.parent.mkdir(parents=True,exist_ok=True) + if not vault_path.exists(): shutil.copy2(src,vault_path) + if sha256_file(vault_path)!=content_sha: raise RuntimeError("content vault verification failed") + descriptor={"logical_path":logical_path or src.name,"source_filename":src.name,"source_bytes":src.stat().st_size, + "content_addressed":True,"custody_provider":"BTG_LOCAL_CONTENT_VAULT","provider_is_authority":False} + obj=self.fabric.register_object(controller_entity_id,object_type_for(src),src.name,descriptor=descriptor,content_sha256=content_sha) + ev=self.evidence.issue_evidence(controller_entity_id,"DOCUMENT",obj["object_id"],content_sha,provenance_refs=[previous_object_id] if previous_object_id else []) + actions=rights_actions or ["INSPECT","READ","COPY","DERIVE"] + right=self.fabric.grant_right(obj["object_id"],controller_entity_id,controller_entity_id,actions,constraints={"purpose":"BTG_ENGINEERING"},economic_terms={"monetary_value_asserted":False}) + rp=self.rights.issue(controller_entity_id,obj["object_id"],[{"effect":"ALLOW","actions":actions}],version=version, + custody=[{"provider":"BTG_LOCAL_CONTENT_VAULT","locator":f"sha256:{content_sha}","content_sha256":content_sha,"provider_is_authority":False,"credentials_included":False}], + provenance_refs=[ev["evidence_id"]],economic_terms={"underlying_information_remains_nonrival":True}) + prov=[] + if previous_object_id: + prov.append(self.fabric.add_provenance(controller_entity_id,previous_object_id,obj["object_id"],"VERSION_DERIVED_FROM",contribution_bps=0,evidence={"evidence_id":ev["evidence_id"]})) + gp=self.global_passports.issue(controller_entity_id,obj["object_id"],rp["passport_id"],profile_refs,version=version, + evidence_refs=[ev["evidence_id"]],provenance_refs=[p["edge_id"] for p in prov], + standards_mappings=[],economic_state={"state":"POTENTIAL","amount_units":0,"currency":"UNSPECIFIED"}, + industry_context={"continuous_ingestion":True,"logical_path":descriptor["logical_path"]}) + val=self.fabric.record_value(controller_entity_id,obj["object_id"],0,"UNSPECIFIED",state="POTENTIAL", + basis_ref="v3.4-zero-value-baseline-no-market-or-accounting-value-asserted") + return {"object":obj,"evidence":ev,"right":right,"rights_passport":rp,"global_passport":gp, + "provenance":prov,"value":val,"vault_sha256":content_sha,"vault_path":str(vault_path), + "continuous_provenance":True,"custody_is_not_authority":True} + + def ingest_directory(self,path,controller_entity_id:str,profile_refs:list[str],*,prefix:str="",rights_actions:list[str]|None=None)->dict: + root=Path(path).resolve(); records=[] + for src in sorted(root.rglob("*")): + if not src.is_file() or any(part in EXCLUDED_DIRS for part in src.parts): continue + rel=src.relative_to(root).as_posix(); logical=(prefix.rstrip("/")+"/"+rel).lstrip("/") if prefix else rel + records.append(self.ingest_file(src,controller_entity_id,profile_refs,logical_path=logical,rights_actions=rights_actions)) + inventory=hashlib.sha256("\n".join(f"{r['object']['content_sha256']} {r['object']['descriptor']['logical_path']}" for r in records).encode()).hexdigest() + return {"schema":"entity-v3-continuous-ingest-result-v1","files":len(records),"inventory_sha256":inventory, + "object_ids":[r["object"]["object_id"] for r in records],"global_passport_ids":[r["global_passport"]["passport_id"] for r in records], + "content_addressed":True,"custody_is_not_authority":True,"economic_value_invented":False} diff --git a/src/38_Global_Passports/global_passport.py b/src/38_Global_Passports/global_passport.py new file mode 100644 index 0000000..faeee2e --- /dev/null +++ b/src/38_Global_Passports/global_passport.py @@ -0,0 +1,82 @@ +from __future__ import annotations +from pathlib import Path +from typing import Any +import hashlib, json, secrets, sqlite3, time + +CORE_PRIMITIVES=("ENTITY","AUTHORITY","RIGHT","EVENT","VALUE") +def now_ms()->int: return int(time.time()*1000) +def canon(v:Any)->bytes: return json.dumps(v,sort_keys=True,separators=(",",":"),ensure_ascii=False,default=str).encode() +def digest(v:Any)->str: return hashlib.sha256(v if isinstance(v,(bytes,bytearray)) else canon(v)).hexdigest() +def rid(prefix:str)->str: return prefix+"-"+secrets.token_hex(12) + +class GlobalPassportRegistry: + """One passport envelope, many composable profiles. It binds existing rights/evidence rather than replacing them.""" + def __init__(self,root:str|Path,identity,fabric,rights_passports,profile_registry): + self.path=Path(root)/"entity_v3_4_global_passports.sqlite"; self.path.parent.mkdir(parents=True,exist_ok=True) + self.identity=identity; self.fabric=fabric; self.rights=rights_passports; self.profiles=profile_registry + with sqlite3.connect(self.path) as db: + db.execute("""CREATE TABLE IF NOT EXISTS global_passports( + passport_id TEXT PRIMARY KEY, object_id TEXT NOT NULL, controller_entity_id TEXT NOT NULL, + version TEXT NOT NULL, body_sha256 TEXT NOT NULL, body_json TEXT NOT NULL, + signature_json TEXT NOT NULL, created_at_ms INTEGER NOT NULL, UNIQUE(object_id,version))""") + + def issue(self,controller_entity_id:str,object_id:str,rights_passport_id:str,profile_refs:list[str],*, + version:str="1.0",evidence_refs:list[str]|None=None,provenance_refs:list[str]|None=None, + jurisdiction_profile_refs:list[str]|None=None,standards_mappings:list[dict]|None=None, + economic_state:dict|None=None,industry_context:dict|None=None)->dict: + self.identity.load_manifest(controller_entity_id); obj=self.fabric.get_object(object_id) + if obj["controller_entity_id"]!=controller_entity_id: raise PermissionError("object controller required") + right=self.rights.get(rights_passport_id) + if right["object_id"]!=object_id or right["controller_entity_id"]!=controller_entity_id: raise ValueError("rights passport mismatch") + if not self.rights.verify(right)["valid"]: raise ValueError("rights passport invalid") + stack=self.profiles.resolve_stack(profile_refs) + mappings=[] + for item in standards_mappings or []: + m=dict(item) + if m.get("normative_equivalence_claimed") is True: raise ValueError("standards mapping cannot claim normative equivalence") + m["normative_equivalence_claimed"]=False; mappings.append(m) + econ=dict(economic_state or {"state":"POTENTIAL","amount_units":0,"currency":"UNSPECIFIED"}) + if int(econ.get("amount_units",0))<0: raise ValueError("economic amount cannot be negative") + econ["market_observation_is_not_accounting_fair_value"]=True + body={"schema":"entity-v3-global-passport-v1","passport_id":rid("gpassport3"),"object_id":object_id, + "controller_entity_id":controller_entity_id,"version":str(version),"core_primitives":list(CORE_PRIMITIVES), + "rights_passport_id":rights_passport_id,"rights_passport_sha256":right["passport_sha256"], + "profile_stack":stack,"evidence_refs":sorted({str(x) for x in (evidence_refs or [])}), + "provenance_refs":sorted({str(x) for x in (provenance_refs or [])}), + "jurisdiction_profile_refs":sorted({str(x) for x in (jurisdiction_profile_refs or [])}), + "standards_mappings":sorted(mappings,key=lambda x:json.dumps(x,sort_keys=True)), + "economic_state":econ,"industry_context":dict(industry_context or {}), + "one_passport_many_profiles":True,"profile_composition_does_not_create_authority":True, + "standards_mapping_is_not_normative_equivalence":True,"evidence_does_not_establish_objective_truth":True, + "legal_effect_is_deployment_specific":True,"underlying_information_remains_nonrival":True,"created_at_ms":now_ms()} + body_sha=digest(body); sig=self.identity.sign(controller_entity_id,body) + try: + with sqlite3.connect(self.path) as db: + db.execute("INSERT INTO global_passports VALUES(?,?,?,?,?,?,?,?)",(body["passport_id"],object_id,controller_entity_id,body["version"],body_sha,json.dumps(body,sort_keys=True),json.dumps(sig,sort_keys=True),body["created_at_ms"])) + except sqlite3.IntegrityError as exc: raise ValueError("immutable global passport version already exists") from exc + return dict(body,body_sha256=body_sha,signature=sig) + def get(self,passport_id:str)->dict: + with sqlite3.connect(self.path) as db: + db.row_factory=sqlite3.Row; row=db.execute("SELECT * FROM global_passports WHERE passport_id=?",(str(passport_id),)).fetchone() + if not row: raise KeyError("global passport missing") + body=json.loads(row["body_json"]) + return dict(body,body_sha256=row["body_sha256"],signature=json.loads(row["signature_json"])) + + def verify(self,passport:dict)->dict: + try: + body={k:v for k,v in passport.items() if k not in {"body_sha256","signature"}} + if body.get("schema")!="entity-v3-global-passport-v1" or body.get("core_primitives")!=list(CORE_PRIMITIVES): raise ValueError("schema/core") + for flag in ("one_passport_many_profiles","profile_composition_does_not_create_authority","standards_mapping_is_not_normative_equivalence","evidence_does_not_establish_objective_truth","legal_effect_is_deployment_specific","underlying_information_remains_nonrival"): + if body.get(flag) is not True: raise ValueError(flag) + right=self.rights.get(body["rights_passport_id"]) + if right["passport_sha256"]!=body["rights_passport_sha256"] or not self.rights.verify(right)["valid"]: raise ValueError("rights passport") + stack=self.profiles.resolve_stack(body["profile_stack"]["profile_refs"]) + if stack["profile_hashes"]!=body["profile_stack"]["profile_hashes"]: raise ValueError("profile stack") + if any(m.get("normative_equivalence_claimed") is not False for m in body.get("standards_mappings",[])): raise ValueError("standards equivalence") + expected=digest(body) + if passport.get("body_sha256")!=expected: raise ValueError("hash") + manifest=self.identity.load_manifest(body["controller_entity_id"]) + if not self.identity.verify_signature(manifest,body,dict(passport.get("signature") or {})): raise ValueError("signature") + return {"valid":True,"passport_id":body["passport_id"],"body_sha256":expected,"objective_truth_claimed":False,"legal_compliance_claimed":False} + except Exception as exc: + return {"valid":False,"reason":type(exc).__name__,"objective_truth_claimed":False,"legal_compliance_claimed":False} diff --git a/src/38_Global_Passports/global_passport_profile.py b/src/38_Global_Passports/global_passport_profile.py new file mode 100644 index 0000000..928d8eb --- /dev/null +++ b/src/38_Global_Passports/global_passport_profile.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +CORE_PRIMITIVES=["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"] +MARKET_LIFECYCLE=["DCO","INSTRUMENT","LISTING","DISCLOSURE","ORDER_RFQ_AUCTION","PRICE_DISCOVERY","TRADE","CLEARING","SETTLEMENT","ENTITLEMENT","USAGE","DERIVED_OUTPUT","ECONOMIC_CONSEQUENCE"] +BUILTIN_PROFILE_REFS=["entity-profile:global@1.0","entity-profile:healthcare@1.0","entity-profile:finance@1.0","entity-profile:manufacturing@1.0","entity-profile:ai@1.0","entity-profile:robotics@1.0","entity-profile:defence-public@1.0"] + +def passport_status()->dict: + return {"schema":"entity-v3-global-passport-profile-status-v1","version":"3.4.0","core_primitives":CORE_PRIMITIVES, + "core_semantics_changed":False,"market_engine_preserved":True,"market_lifecycle":MARKET_LIFECYCLE, + "one_passport_many_profiles":True,"profile_composition":True,"continuous_provenance":True, + "builtin_profile_refs":BUILTIN_PROFILE_REFS,"industry_profiles_do_not_create_silos":True, + "external_standards_are_mapped_not_redefined":True,"profile_is_not_regulatory_compliance":True, + "evidence_truth_boundary_preserved":True,"underlying_information_remains_nonrival":True, + "doctrine":"One ENTITY Passport. Many jurisdictions, industries, standards and contexts. No new sovereignty silos."} diff --git a/src/38_Global_Passports/industry_profiles.py b/src/38_Global_Passports/industry_profiles.py new file mode 100644 index 0000000..aa9a628 --- /dev/null +++ b/src/38_Global_Passports/industry_profiles.py @@ -0,0 +1,29 @@ +from __future__ import annotations +import hashlib, json + +def _sha(name:str)->str: return hashlib.sha256(("ENTITY-v3.4-profile:"+name).encode()).hexdigest() +def _std(name:str,role:str="MAPPING")->dict: return {"standard":name,"role":role,"normative_equivalence_claimed":False} + +BUILTIN_PROFILES={ +"entity-profile:global@1.0":{"kind":"GLOBAL","standards":[],"parents":[],"objects":["DATASET","DOCUMENT","MODEL","SOFTWARE","DEVICE","FINANCIAL_INSTRUMENT","PHYSICAL_ASSET","OTHER"],"evidence":["DOCUMENT"]}, +"entity-profile:healthcare@1.0":{"kind":"INDUSTRY","standards":[_std("HL7-FHIR"),_std("DICOM")],"parents":["entity-profile:global@1.0"],"objects":["DATASET","DOCUMENT","MODEL","DEVICE"],"evidence":["DOCUMENT","REGISTRY_RECORD"]}, +"entity-profile:finance@1.0":{"kind":"INDUSTRY","standards":[_std("ISO-20022"),_std("FIX"),_std("LEI")],"parents":["entity-profile:global@1.0"],"objects":["FINANCIAL_INSTRUMENT","DOCUMENT","DATASET","SOFTWARE"],"evidence":["DOCUMENT","PAYMENT_RECORD","REGISTRY_RECORD"]}, +"entity-profile:manufacturing@1.0":{"kind":"INDUSTRY","standards":[_std("OPC-UA"),_std("ASSET-ADMINISTRATION-SHELL")],"parents":["entity-profile:global@1.0"],"objects":["DEVICE","PHYSICAL_ASSET","DIGITAL_TWIN","DATASET","SOFTWARE"],"evidence":["SENSOR_OBSERVATION","DOCUMENT"]}, +"entity-profile:ai@1.0":{"kind":"INDUSTRY","standards":[_std("NIST-AI-RMF"),_std("SPDX-3"),_std("CYCLONEDX")],"parents":["entity-profile:global@1.0"],"objects":["DATASET","MODEL","SOFTWARE","AI_AGENT","DOCUMENT"],"evidence":["DOCUMENT","OTHER","REGISTRY_RECORD"]}, +"entity-profile:robotics@1.0":{"kind":"INDUSTRY","standards":[_std("ROS-2"),_std("OPEN-RMF")],"parents":["entity-profile:global@1.0"],"objects":["DEVICE","AI_AGENT","SOFTWARE","DATASET","PHYSICAL_ASSET"],"evidence":["SENSOR_OBSERVATION","OTHER","DOCUMENT"]}, +"entity-profile:defence-public@1.0":{"kind":"INDUSTRY","standards":[_std("PUBLIC-DATA-GOVERNANCE"),_std("ORIGINATOR-CONTROL")],"parents":["entity-profile:global@1.0"],"objects":["DATASET","DOCUMENT","SOFTWARE","DEVICE","MODEL"],"evidence":["DOCUMENT","REGISTRY_RECORD"],"public_unclassified":True}, +} + +def definitions()->dict: return json.loads(json.dumps(BUILTIN_PROFILES)) + +def install_builtin_profiles(registry,issuer_entity_id:str)->dict: + installed={} + for ref,spec in BUILTIN_PROFILES.items(): + profile_id,version=ref.rsplit("@",1) + policy={"industry_profile":profile_id.split(":")[-1],"technical_interoperability_not_regulatory_compliance":True, + "external_standard_not_redefined":True,"profile_schema_version":"1.0"} + p=registry.register(issuer_entity_id,profile_id,version,spec["kind"],schema_sha256=_sha(ref), + standards=spec.get("standards"),parent_refs=spec.get("parents"),object_types=spec.get("objects"), + required_evidence_types=spec.get("evidence"),policy=policy,public_unclassified=spec.get("public_unclassified",True)) + installed[ref]=p + return installed diff --git a/src/38_Global_Passports/passport_conformance.py b/src/38_Global_Passports/passport_conformance.py new file mode 100644 index 0000000..e6ac25e --- /dev/null +++ b/src/38_Global_Passports/passport_conformance.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +CORE=["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"] +KINDS={"GLOBAL","JURISDICTION","INDUSTRY","DOMAIN","PRIVACY","TRUST","DISCLOSURE"} +def _sha(v)->bool: + s=str(v or ""); return len(s)==64 and all(c in "0123456789abcdef" for c in s) + +def _stack_ok(r:dict)->bool: + refs=r.get("profile_refs") or []; hashes=r.get("profile_hashes") or [] + return bool(refs) and "entity-profile:global@1.0" in refs and len(refs)==len(hashes) and all(_sha(x) for x in hashes) and r.get("fail_closed") is True and r.get("profile_composition_does_not_create_authority") is True and r.get("standards_mapping_is_not_normative_equivalence") is True + +def _passport_ok(r:dict)->bool: + flags=("one_passport_many_profiles","profile_composition_does_not_create_authority","standards_mapping_is_not_normative_equivalence","evidence_does_not_establish_objective_truth","legal_effect_is_deployment_specific","underlying_information_remains_nonrival") + econ=r.get("economic_state") or {}; mappings=r.get("standards_mappings") or [] + return r.get("core_primitives")==CORE and bool(r.get("rights_passport_id")) and _sha(r.get("rights_passport_sha256")) and isinstance(r.get("profile_stack"),dict) and _stack_ok(r["profile_stack"]) and all(r.get(x) is True for x in flags) and all(m.get("normative_equivalence_claimed") is False for m in mappings) and int(econ.get("amount_units",-1))>=0 and econ.get("market_observation_is_not_accounting_fair_value") is True + +def validate_global_passport_record(r:dict)->bool: + try: + schema=r.get("schema") + if schema=="entity-v3-global-passport-profile-status-v1": + return r.get("core_primitives")==CORE and r.get("core_semantics_changed") is False and r.get("market_engine_preserved") is True and r.get("one_passport_many_profiles") is True and r.get("evidence_truth_boundary_preserved") is True + if schema=="entity-v3-global-profile-v1": + return bool(r.get("profile_ref")) and r.get("kind") in KINDS and _sha(r.get("schema_sha256")) and r.get("profile_is_not_authority") is True and r.get("standards_mapping_is_not_normative_equivalence") is True and ("DEFENCE" not in str(r.get("profile_id","")).upper() or r.get("public_unclassified") is True) + if schema=="entity-v3-profile-stack-resolution-v1": return _stack_ok(r) + if schema=="entity-v3-global-passport-v1": return _passport_ok(r) + if schema=="entity-v3-continuous-ingest-result-v1": + return int(r.get("files",-1))>=0 and _sha(r.get("inventory_sha256")) and r.get("content_addressed") is True and r.get("custody_is_not_authority") is True and r.get("economic_value_invented") is False + return False + except Exception: return False diff --git a/src/38_Global_Passports/profile_registry.py b/src/38_Global_Passports/profile_registry.py new file mode 100644 index 0000000..4eaabf8 --- /dev/null +++ b/src/38_Global_Passports/profile_registry.py @@ -0,0 +1,80 @@ +from __future__ import annotations +from pathlib import Path +from typing import Any +import hashlib, json, secrets, sqlite3, time + +PROFILE_KINDS={"GLOBAL","JURISDICTION","INDUSTRY","DOMAIN","PRIVACY","TRUST","DISCLOSURE"} +CONFLICT_POLICIES={"FAIL_CLOSED","MOST_RESTRICTIVE"} + +def now_ms()->int: return int(time.time()*1000) +def canon(v:Any)->bytes: return json.dumps(v,sort_keys=True,separators=(",",":"),ensure_ascii=False,default=str).encode() +def digest(v:Any)->str: return hashlib.sha256(v if isinstance(v,(bytes,bytearray)) else canon(v)).hexdigest() +def rid(prefix:str)->str: return prefix+"-"+secrets.token_hex(12) +def sha256_hex(v:str)->str: + v=str(v).lower() + if len(v)!=64 or any(c not in "0123456789abcdef" for c in v): raise ValueError("expected lowercase SHA-256") + return v + +class GlobalProfileRegistry: + """Versioned composable profiles. Profiles constrain interpretation; they do not create sovereign authority.""" + def __init__(self,root:str|Path,identity): + self.path=Path(root)/"entity_v3_4_global_profiles.sqlite"; self.path.parent.mkdir(parents=True,exist_ok=True); self.identity=identity + with sqlite3.connect(self.path) as db: + db.execute("""CREATE TABLE IF NOT EXISTS profiles( + profile_ref TEXT PRIMARY KEY, profile_id TEXT NOT NULL, version TEXT NOT NULL, kind TEXT NOT NULL, + body_sha256 TEXT NOT NULL, body_json TEXT NOT NULL, issuer_entity_id TEXT NOT NULL, + signature_json TEXT NOT NULL, created_at_ms INTEGER NOT NULL, UNIQUE(profile_id,version))""") + def register(self,issuer_entity_id:str,profile_id:str,version:str,kind:str,*, + schema_sha256:str,standards:list[dict]|None=None,parent_refs:list[str]|None=None, + object_types:list[str]|None=None,required_evidence_types:list[str]|None=None, + policy:dict|None=None,conflict_policy:str="FAIL_CLOSED",public_unclassified:bool=True)->dict: + self.identity.load_manifest(issuer_entity_id); kind=str(kind).upper(); conflict_policy=str(conflict_policy).upper() + if kind not in PROFILE_KINDS: raise ValueError("unsupported profile kind") + if conflict_policy not in CONFLICT_POLICIES: raise ValueError("unsupported conflict policy") + if kind=="INDUSTRY" and "DEFENCE" in str(profile_id).upper() and not public_unclassified: + raise ValueError("public defence profile must remain unclassified") + ref=f"{profile_id}@{version}"; body={ + "schema":"entity-v3-global-profile-v1","profile_ref":ref,"profile_id":str(profile_id),"version":str(version), + "kind":kind,"schema_sha256":sha256_hex(schema_sha256),"standards":sorted(list(standards or []),key=lambda x:json.dumps(x,sort_keys=True)), + "parent_refs":sorted({str(x) for x in (parent_refs or [])}),"object_types":sorted({str(x).upper() for x in (object_types or [])}), + "required_evidence_types":sorted({str(x).upper() for x in (required_evidence_types or [])}),"policy":dict(policy or {}), + "conflict_policy":conflict_policy,"public_unclassified":bool(public_unclassified),"profile_is_not_authority":True, + "standards_mapping_is_not_normative_equivalence":True,"created_at_ms":now_ms()} + body_sha=digest(body); sig=self.identity.sign(issuer_entity_id,body) + try: + with sqlite3.connect(self.path) as db: + db.execute("INSERT INTO profiles VALUES(?,?,?,?,?,?,?,?,?)",(ref,body["profile_id"],body["version"],kind,body_sha,json.dumps(body,sort_keys=True),issuer_entity_id,json.dumps(sig,sort_keys=True),body["created_at_ms"])) + except sqlite3.IntegrityError as exc: raise ValueError("immutable profile version already exists") from exc + return dict(body,body_sha256=body_sha,issuer_entity_id=issuer_entity_id,signature=sig) + def get(self,profile_ref:str)->dict: + with sqlite3.connect(self.path) as db: + db.row_factory=sqlite3.Row; row=db.execute("SELECT * FROM profiles WHERE profile_ref=?",(str(profile_ref),)).fetchone() + if not row: raise KeyError("profile missing") + body=json.loads(row["body_json"]) + return dict(body,body_sha256=row["body_sha256"],issuer_entity_id=row["issuer_entity_id"],signature=json.loads(row["signature_json"])) + + def verify(self,profile:dict)->dict: + try: + body={k:v for k,v in profile.items() if k not in {"body_sha256","issuer_entity_id","signature"}} + if body.get("schema")!="entity-v3-global-profile-v1": raise ValueError("schema") + if body.get("kind") not in PROFILE_KINDS or body.get("conflict_policy") not in CONFLICT_POLICIES: raise ValueError("profile semantics") + if body.get("profile_is_not_authority") is not True or body.get("standards_mapping_is_not_normative_equivalence") is not True: raise ValueError("authority boundary") + sha256_hex(body.get("schema_sha256")); expected=digest(body) + if profile.get("body_sha256")!=expected: raise ValueError("hash") + manifest=self.identity.load_manifest(profile["issuer_entity_id"]) + if not self.identity.verify_signature(manifest,body,dict(profile.get("signature") or {})): raise ValueError("signature") + return {"valid":True,"profile_ref":body["profile_ref"],"body_sha256":expected} + except Exception as exc: return {"valid":False,"reason":type(exc).__name__} + + def resolve_stack(self,profile_refs:list[str])->dict: + refs=[]; seen=set() + for ref in profile_refs: + if ref in seen: continue + profile=self.get(ref); refs.append(profile); seen.add(ref) + if not refs: raise ValueError("profile stack required") + if not any(p["kind"]=="GLOBAL" for p in refs): raise ValueError("global profile required") + missing=sorted({parent for p in refs for parent in p.get("parent_refs",[]) if parent not in seen}) + if missing: raise ValueError("profile stack missing parents: "+",".join(missing)) + return {"schema":"entity-v3-profile-stack-resolution-v1","profile_refs":[p["profile_ref"] for p in refs], + "profile_hashes":[p["body_sha256"] for p in refs],"fail_closed":True, + "profile_composition_does_not_create_authority":True,"standards_mapping_is_not_normative_equivalence":True} diff --git a/src/39_Implementation_Packages/industry_packages.py b/src/39_Implementation_Packages/industry_packages.py new file mode 100644 index 0000000..6a4ef28 --- /dev/null +++ b/src/39_Implementation_Packages/industry_packages.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from copy import deepcopy +from typing import Any +import hashlib, json + +PACKAGE_VERSION="1.0" +GLOBAL_PROFILE="entity-profile:global@1.0" + +def _sha(value:Any)->str: + return hashlib.sha256(json.dumps(value,sort_keys=True,separators=(",",":"),ensure_ascii=False).encode()).hexdigest() + +def _mapping(standard:str,fields:dict[str,str])->dict: + return {"standard":standard,"mapping_version":"1.0","field_map":dict(fields), + "normative_equivalence_claimed":False,"external_standard_not_redefined":True} + +COMMON_DEFAULTS={ + "fail_closed":True, + "custody_is_not_authority":True, + "evidence_does_not_establish_objective_truth":True, + "profile_is_not_regulatory_compliance":True, + "economic_value_invented":False, + "developer_configures_not_redesigns":True, +} + +PACKAGE_SPECS={ + "healthcare":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:healthcare@1.0"], + "required_config":["organization","jurisdiction","authority_source","privacy_policy"], + "object_types":{"clinical_dataset":"DATASET","clinical_document":"DOCUMENT","diagnostic_model":"MODEL","medical_device":"DEVICE"}, + "rights":["INSPECT","READ","DERIVE"], + "evidence_types":["DOCUMENT","REGISTRY_RECORD"], + "mappings":[_mapping("HL7-FHIR",{"resourceType":"descriptor.fhir_resource_type","id":"descriptor.external_id","meta.versionId":"descriptor.external_version"}), + _mapping("DICOM",{"SOPInstanceUID":"descriptor.dicom_sop_instance_uid","StudyInstanceUID":"descriptor.dicom_study_instance_uid","Modality":"descriptor.modality"})], + "privacy":{"default":"RESTRICTED_DISCLOSURE","minimum_data":True,"purpose_bound":True}, + }, + "finance":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:finance@1.0"], + "required_config":["organization","jurisdiction","authority_source","settlement_policy"], + "object_types":{"instrument":"FINANCIAL_INSTRUMENT","trade_record":"DOCUMENT","settlement_record":"DOCUMENT","market_dataset":"DATASET"}, + "rights":["INSPECT","READ","DERIVE","COMMERCIALIZE"], + "evidence_types":["PAYMENT_RECORD","REGISTRY_RECORD","DOCUMENT"], + "mappings":[_mapping("ISO-20022",{"MsgId":"descriptor.message_id","CreDtTm":"descriptor.created_at","TxId":"descriptor.transaction_id"}), + _mapping("FIX",{"11":"descriptor.cl_ord_id","17":"descriptor.exec_id","55":"descriptor.symbol"}), + _mapping("LEI",{"lei":"descriptor.legal_entity_identifier"})], + "privacy":{"default":"SELECTIVE_DISCLOSURE","minimum_data":True,"purpose_bound":True}, + }, + "manufacturing":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:manufacturing@1.0"], + "required_config":["organization","jurisdiction","authority_source","asset_namespace"], + "object_types":{"machine":"PHYSICAL_ASSET","digital_twin":"DIGITAL_TWIN","firmware":"SOFTWARE","telemetry":"DATASET","maintenance_record":"DOCUMENT"}, + "rights":["INSPECT","READ","DERIVE","CONTROL"], + "evidence_types":["SENSOR_OBSERVATION","DOCUMENT"], + "mappings":[_mapping("OPC-UA",{"NodeId":"descriptor.opcua_node_id","BrowseName":"descriptor.opcua_browse_name","DataType":"descriptor.opcua_data_type"}), + _mapping("ASSET-ADMINISTRATION-SHELL",{"id":"descriptor.aas_id","idShort":"descriptor.aas_id_short","assetInformation.globalAssetId":"descriptor.global_asset_id"})], + "privacy":{"default":"RESTRICTED_DISCLOSURE","minimum_data":True,"purpose_bound":True}, + }, + "ai":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:ai@1.0"], + "required_config":["organization","jurisdiction","authority_source","model_governance_policy"], + "object_types":{"training_dataset":"DATASET","corpus":"DATASET","model":"MODEL","weights":"MODEL","evaluation":"DOCUMENT","agent":"AI_AGENT","output":"DOCUMENT"}, + "rights":["INSPECT","READ","DERIVE","TRAIN","INFER","EXECUTE"], + "evidence_types":["DOCUMENT","REGISTRY_RECORD","OTHER"], + "mappings":[_mapping("SPDX-3",{"name":"descriptor.component_name","version":"descriptor.component_version","license":"descriptor.license_expression"}), + _mapping("CYCLONEDX",{"bom-ref":"descriptor.bom_ref","name":"descriptor.component_name","version":"descriptor.component_version"}), + _mapping("NIST-AI-RMF",{"risk_category":"descriptor.risk_category","control":"descriptor.control_ref"})], + "privacy":{"default":"SELECTIVE_DISCLOSURE","minimum_data":True,"purpose_bound":True}, + }, + "robotics":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:robotics@1.0"], + "required_config":["organization","jurisdiction","authority_source","safety_policy"], + "object_types":{"robot":"DEVICE","controller":"DEVICE","model":"MODEL","software":"SOFTWARE","telemetry":"DATASET","action_record":"DOCUMENT"}, + "rights":["INSPECT","READ","INFER","EXECUTE","CONTROL"], + "evidence_types":["SENSOR_OBSERVATION","DOCUMENT","OTHER"], + "mappings":[_mapping("ROS-2",{"topic":"descriptor.ros_topic","type":"descriptor.ros_type","node":"descriptor.ros_node"}), + _mapping("OPEN-RMF",{"fleet_name":"descriptor.rmf_fleet","robot_name":"descriptor.rmf_robot","task_id":"descriptor.rmf_task"})], + "privacy":{"default":"RESTRICTED_DISCLOSURE","minimum_data":True,"purpose_bound":True}, + }, + "defence-public":{ + "profile_refs":[GLOBAL_PROFILE,"entity-profile:defence-public@1.0"], + "required_config":["organization","jurisdiction","authority_source","release_policy"], + "object_types":{"public_asset":"PHYSICAL_ASSET","public_dataset":"DATASET","software":"SOFTWARE","device":"DEVICE","model":"MODEL","custody_record":"DOCUMENT"}, + "rights":["INSPECT","READ","DERIVE"], + "evidence_types":["DOCUMENT","REGISTRY_RECORD"], + "mappings":[_mapping("PUBLIC-DATA-GOVERNANCE",{"asset_id":"descriptor.public_asset_id","release":"descriptor.release_status","originator":"descriptor.originator_ref"}), + _mapping("ORIGINATOR-CONTROL",{"originator":"descriptor.originator_ref","dissemination":"descriptor.dissemination_rule"})], + "privacy":{"default":"RESTRICTED_DISCLOSURE","minimum_data":True,"purpose_bound":True,"classified_material_prohibited":True}, + }, +} + +class IndustryImplementationPackageRegistry: + """Executable industry package semantics layered on the one ENTITY Global Passport.""" + def list_packages(self)->list[str]: return sorted(PACKAGE_SPECS) + def get(self,name:str)->dict: + key=str(name).lower() + if key not in PACKAGE_SPECS: raise KeyError("industry package missing") + spec=deepcopy(PACKAGE_SPECS[key]); spec["name"]=key; spec["version"]=PACKAGE_VERSION + spec["package_sha256"]=_sha(spec); spec.update(COMMON_DEFAULTS) + return spec + + def validate_configuration(self,name:str,config:dict)->dict: + spec=self.get(name); cfg=dict(config or {}) + missing=[k for k in spec["required_config"] if not str(cfg.get(k) or "").strip()] + if missing: raise ValueError("missing configuration: "+",".join(missing)) + if name=="defence-public" and str(cfg.get("classification","")).upper() not in {"","PUBLIC","UNCLASSIFIED"}: + raise ValueError("defence-public package cannot ingest classified material") + return {"valid":True,"package":name,"configuration_sha256":_sha(cfg),"profile_refs":spec["profile_refs"], + "configuration_does_not_create_authority":True,"legal_compliance_not_implied":True} + def template(self,name:str,asset_kind:str)->dict: + spec=self.get(name); kind=str(asset_kind) + if kind not in spec["object_types"]: raise ValueError("unsupported package asset kind") + return {"schema":"entity-v3-industry-asset-template-v1","package":name,"package_version":spec["version"], + "asset_kind":kind,"object_type":spec["object_types"][kind],"profile_refs":spec["profile_refs"], + "default_right_actions":spec["rights"],"required_evidence_types":spec["evidence_types"], + "privacy_defaults":spec["privacy"],"economic_value_invented":False,"profile_is_not_authority":True} + + def map_external(self,name:str,standard:str,record:dict)->dict: + spec=self.get(name); mapping=next((m for m in spec["mappings"] if m["standard"].upper()==str(standard).upper()),None) + if not mapping: raise ValueError("standard mapping unavailable") + source=dict(record or {}); descriptor={} + for external,target in mapping["field_map"].items(): + current:Any=source + for part in external.split("."): + if not isinstance(current,dict) or part not in current: current=None; break + current=current[part] + if current is not None: descriptor[target.removeprefix("descriptor.")]=current + return {"schema":"entity-v3-industry-mapping-result-v1","package":name,"standard":mapping["standard"], + "mapping_version":mapping["mapping_version"],"descriptor":descriptor,"source_sha256":_sha(source), + "normative_equivalence_claimed":False,"external_standard_not_redefined":True} + + def deployment_plan(self,name:str,config:dict,asset_kind:str)->dict: + validated=self.validate_configuration(name,config); template=self.template(name,asset_kind); spec=self.get(name) + return {"schema":"entity-v3-industry-deployment-plan-v1","package":name,"package_version":spec["version"], + "configuration_sha256":validated["configuration_sha256"],"profile_refs":template["profile_refs"], + "object_type":template["object_type"],"rights_actions":template["default_right_actions"], + "evidence_types":template["required_evidence_types"],"privacy":template["privacy_defaults"], + "steps":["validate_configuration","connect_source","ingest_content","issue_evidence","issue_rights_passport","issue_global_passport","verify_passport","run_conformance"], + "developer_configures_not_redesigns":True,"core_semantics_changed":False,"legal_compliance_not_implied":True} diff --git a/tests/test_v3_global_passports.py b/tests/test_v3_global_passports.py new file mode 100644 index 0000000..5e40922 --- /dev/null +++ b/tests/test_v3_global_passports.py @@ -0,0 +1,208 @@ +from __future__ import annotations +import gc, hashlib, importlib.util, pathlib, sys, tempfile, unittest + +ROOT=pathlib.Path(__file__).resolve().parents[1] +def load(name,rel): + spec=importlib.util.spec_from_file_location(name,ROOT/rel); mod=importlib.util.module_from_spec(spec) + sys.modules[name]=mod; spec.loader.exec_module(mod); return mod + +identity_mod=load("v34_identity","src/01_Core_Runtime/identity/canonical_identity.py") +fabric_mod=load("v34_fabric","src/30_Universal_Transaction_Fabric/canonical_universal_fabric.py") +eep_mod=load("v34_eep","src/31_Profiles/exchange_protocol.py") +rights_mod=load("v34_rights","src/36_Adoption_Layer/rights_passport.py") +reality_profile=load("reality_profile","src/37_Verifiable_Reality/reality_profile.py") +evidence_mod=load("v34_evidence","src/37_Verifiable_Reality/evidence_objects.py") +profile_mod=load("v34_profiles","src/38_Global_Passports/profile_registry.py") +industry_mod=load("v34_industry","src/38_Global_Passports/industry_profiles.py") +global_mod=load("v34_global","src/38_Global_Passports/global_passport.py") +ingest_mod=load("v34_ingest","src/38_Global_Passports/continuous_ingestion.py") +status_mod=load("v34_status","src/38_Global_Passports/global_passport_profile.py") +conf_mod=load("v34_conf","src/38_Global_Passports/passport_conformance.py") +package_mod=load("v34_packages","src/39_Implementation_Packages/industry_packages.py") +sdk_mod=load("v34_sdk","sdk/global_passport_sdk/canonical_global_passport_sdk.py") + +class V34GlobalPassportTests(unittest.TestCase): + def setUp(self): + self.tmp=tempfile.TemporaryDirectory(); self.base=pathlib.Path(self.tmp.name); self.state=self.base/"state"; self.source=self.base/"source"; self.source.mkdir() + self.identity=identity_mod.EntityIdentityVault(self.state); self.fabric=fabric_mod.UniversalTransactionFabric(self.state,self.identity) + self.owner=self.identity.create("BTG Owner","business")["entity_id"]; self.buyer=self.identity.create("Buyer","business")["entity_id"] + self.evidence=evidence_mod.EvidenceRegistry(self.state,self.identity); self.rights=rights_mod.RightsPassportRegistry(self.state,self.identity,self.fabric) + self.profiles=profile_mod.GlobalProfileRegistry(self.state,self.identity); self.installed=industry_mod.install_builtin_profiles(self.profiles,self.owner) + self.globals=global_mod.GlobalPassportRegistry(self.state,self.identity,self.fabric,self.rights,self.profiles) + self.ingest=ingest_mod.ContinuousProvenanceEngine(self.state,self.identity,self.fabric,self.evidence,self.rights,self.globals) + self.dco=self.fabric.register_digital_commodity(self.owner,"AI Corpus",hashlib.sha256(b"corpus").hexdigest()) + def tearDown(self): + self.ingest=self.globals=self.profiles=self.rights=self.evidence=None; gc.collect(); self.tmp.cleanup() + + def _rights_passport(self,version="1.0"): + return self.rights.issue(self.owner,self.dco["object_id"],[{"effect":"ALLOW","actions":["READ","TRAIN","DERIVE"]}],version=version) + + def test_01_core_market_and_truth_boundaries_preserved(self): + s=status_mod.passport_status(); self.assertEqual(s["core_primitives"],["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"]) + self.assertFalse(s["core_semantics_changed"]); self.assertTrue(s["market_engine_preserved"]); self.assertTrue(s["evidence_truth_boundary_preserved"]) + + def test_02_builtin_global_and_six_industry_profiles_install(self): + self.assertEqual(len(self.installed),7); self.assertIn("entity-profile:global@1.0",self.installed) + self.assertTrue(all(self.profiles.verify(p)["valid"] for p in self.installed.values())) + + def test_03_profile_stack_requires_global_profile(self): + with self.assertRaises(ValueError): self.profiles.resolve_stack(["entity-profile:ai@1.0"]) + + def test_04_profile_stack_requires_declared_parents(self): + p=self.installed["entity-profile:healthcare@1.0"] + self.assertIn("entity-profile:global@1.0",p["parent_refs"]) + with self.assertRaises(ValueError): self.profiles.resolve_stack([p["profile_ref"]]) + def test_05_global_passport_binds_existing_rights_and_profile_stack(self): + rp=self._rights_passport(); gp=self.globals.issue(self.owner,self.dco["object_id"],rp["passport_id"],["entity-profile:global@1.0","entity-profile:ai@1.0"],evidence_refs=["evidence:origin"]) + checked=self.globals.verify(gp); self.assertTrue(checked["valid"]); self.assertFalse(checked["objective_truth_claimed"]); self.assertFalse(checked["legal_compliance_claimed"]) + + def test_06_standards_mapping_cannot_claim_equivalence(self): + rp=self._rights_passport() + with self.assertRaises(ValueError): self.globals.issue(self.owner,self.dco["object_id"],rp["passport_id"],["entity-profile:global@1.0","entity-profile:ai@1.0"],standards_mappings=[{"standard":"SPDX-3","normative_equivalence_claimed":True}]) + + def test_07_healthcare_and_ai_profiles_compose(self): + stack=self.profiles.resolve_stack(["entity-profile:global@1.0","entity-profile:healthcare@1.0","entity-profile:ai@1.0"]) + self.assertEqual(len(stack["profile_refs"]),3); self.assertTrue(stack["fail_closed"]); self.assertTrue(stack["profile_composition_does_not_create_authority"]) + + def test_08_defence_robotics_ai_profiles_compose_and_remain_public(self): + stack=self.profiles.resolve_stack(["entity-profile:global@1.0","entity-profile:defence-public@1.0","entity-profile:robotics@1.0","entity-profile:ai@1.0"]) + defence=self.profiles.get("entity-profile:defence-public@1.0"); self.assertTrue(defence["public_unclassified"]); self.assertEqual(len(stack["profile_refs"]),4) + + def test_09_healthcare_profile_maps_not_redefines_standards(self): + p=self.profiles.get("entity-profile:healthcare@1.0"); names={x["standard"] for x in p["standards"]} + self.assertEqual(names,{"HL7-FHIR","DICOM"}); self.assertTrue(p["policy"]["technical_interoperability_not_regulatory_compliance"]) + + def test_10_finance_profile_contains_iso20022_fix_lei(self): + names={x["standard"] for x in self.profiles.get("entity-profile:finance@1.0")["standards"]}; self.assertEqual(names,{"ISO-20022","FIX","LEI"}) + def test_11_manufacturing_profile_contains_opcua_aas(self): + names={x["standard"] for x in self.profiles.get("entity-profile:manufacturing@1.0")["standards"]}; self.assertEqual(names,{"OPC-UA","ASSET-ADMINISTRATION-SHELL"}) + + def test_12_ai_profile_contains_risk_and_supply_chain_mappings(self): + names={x["standard"] for x in self.profiles.get("entity-profile:ai@1.0")["standards"]}; self.assertEqual(names,{"NIST-AI-RMF","SPDX-3","CYCLONEDX"}) + + def test_13_robotics_profile_contains_ros_and_openrmf(self): + names={x["standard"] for x in self.profiles.get("entity-profile:robotics@1.0")["standards"]}; self.assertEqual(names,{"ROS-2","OPEN-RMF"}) + + def test_14_continuous_ingest_registers_bytes_evidence_rights_and_global_passport(self): + f=self.source/"model.py"; f.write_text("print('entity')\n",encoding="utf-8") + r=self.ingest.ingest_file(f,self.owner,["entity-profile:global@1.0","entity-profile:ai@1.0"],logical_path="models/model.py") + self.assertEqual(r["object"]["object_type"],"SOFTWARE"); self.assertTrue(pathlib.Path(r["vault_path"]).is_file()) + self.assertTrue(self.evidence.verify_evidence(r["evidence"])["valid"]); self.assertTrue(self.rights.verify(r["rights_passport"])["valid"]); self.assertTrue(self.globals.verify(r["global_passport"])["valid"]) + self.assertEqual(r["value"]["amount_units"],0); self.assertTrue(r["custody_is_not_authority"]) + + def test_15_version_ingest_creates_zero_weight_provenance_not_fake_economics(self): + f1=self.source/"v1.py"; f2=self.source/"v2.py"; f1.write_text("a=1\n"); f2.write_text("a=2\n") + a=self.ingest.ingest_file(f1,self.owner,["entity-profile:global@1.0","entity-profile:ai@1.0"],version="1") + b=self.ingest.ingest_file(f2,self.owner,["entity-profile:global@1.0","entity-profile:ai@1.0"],version="2",previous_object_id=a["object"]["object_id"]) + self.assertEqual(len(b["provenance"]),1); self.assertEqual(b["provenance"][0]["contribution_bps"],0); self.assertTrue(b["provenance"][0]["provenance_is_not_ownership"]) + def test_16_directory_ingest_excludes_machine_noise(self): + (self.source/"a.py").write_text("x=1\n"); cache=self.source/"__pycache__"; cache.mkdir(); (cache/"a.pyc").write_bytes(b"noise") + r=self.ingest.ingest_directory(self.source,self.owner,["entity-profile:global@1.0","entity-profile:ai@1.0"],prefix="repo") + self.assertEqual(r["files"],1); self.assertTrue(r["content_addressed"]); self.assertFalse(r["economic_value_invented"]); self.assertTrue(conf_mod.validate_global_passport_record(r)) + + def test_17_tampered_global_passport_fails(self): + rp=self._rights_passport(); gp=self.globals.issue(self.owner,self.dco["object_id"],rp["passport_id"],["entity-profile:global@1.0"]) + gp["industry_context"]={"tampered":True}; self.assertFalse(self.globals.verify(gp)["valid"]) + + def test_18_v33_evidence_truth_boundary_composes(self): + ev=self.evidence.issue_evidence(self.owner,"DOCUMENT",self.dco["object_id"],hashlib.sha256(b"source").hexdigest()) + rp=self._rights_passport(); gp=self.globals.issue(self.owner,self.dco["object_id"],rp["passport_id"],["entity-profile:global@1.0","entity-profile:ai@1.0"],evidence_refs=[ev["evidence_id"]]) + self.assertTrue(ev["signature_proves_attribution_not_objective_truth"]); self.assertTrue(gp["evidence_does_not_establish_objective_truth"]) + + def test_19_existing_exchange_lifecycle_survives_v34(self): + eep=eep_mod.ExchangeProtocol(self.state,self.identity,self.fabric); venue=eep.create_venue(self.owner,"Global Rights Venue","CA",["ORDER_BOOK"],hashlib.sha256(b"venue").hexdigest()) + inst=eep.define_instrument(self.owner,self.dco["object_id"],"SPOT_LICENSE",{"actions":["TRAIN"]},100,"CAD",transferable=True) + disc=eep.publish_disclosure(venue["venue_id"],inst["instrument_id"],self.owner,"LISTING",hashlib.sha256(b"disc").hexdigest()) + eep.list_instrument(venue["venue_id"],inst["instrument_id"],self.owner,min_lot=1,tick_size=1,disclosure_sha256=disc["content_sha256"]) + eep.submit_order(venue["venue_id"],inst["instrument_id"],self.owner,"SELL",1,10,nonce="v34-sell"); eep.submit_order(venue["venue_id"],inst["instrument_id"],self.buyer,"BUY",1,10,nonce="v34-buy") + settled=eep.settle_trade(eep.match_order_book(venue["venue_id"],inst["instrument_id"])[0]["trade_id"],payment_ref="external:receipt",external_verified=False) + self.assertFalse(settled["entitlement"]["ownership_of_underlying_transferred"]) + def test_20_conformance_validator_accepts_release_semantics(self): + status=status_mod.passport_status(); profile=self.installed["entity-profile:global@1.0"] + stack=self.profiles.resolve_stack(["entity-profile:global@1.0"]) + rp=self._rights_passport(); gp=self.globals.issue(self.owner,self.dco["object_id"],rp["passport_id"],["entity-profile:global@1.0"]) + records=[status,{k:v for k,v in profile.items() if k not in {"body_sha256","issuer_entity_id","signature"}},stack,{k:v for k,v in gp.items() if k not in {"body_sha256","signature"}}] + self.assertTrue(all(conf_mod.validate_global_passport_record(x) for x in records)) + + def test_21_defence_profile_cannot_be_registered_as_nonpublic(self): + with self.assertRaises(ValueError): + self.profiles.register(self.owner,"entity-profile:restricted-defence","1.0","INDUSTRY",schema_sha256="0"*64,public_unclassified=False) + + def test_22_sdk_composes_industry_profiles_and_registers_file(self): + sdk=sdk_mod.EntityGlobalPassportSDK(self.profiles,self.globals,self.ingest) + stack=sdk.compose_profiles("healthcare","ai"); self.assertEqual(stack["profile_refs"][0],"entity-profile:global@1.0") + f=self.source/"clinical_model.onnx"; f.write_bytes(b"model") + out=sdk.register_file(f,self.owner,"healthcare","ai",logical_path="models/clinical_model.onnx") + self.assertIn("entity-profile:healthcare@1.0",out["profile_refs"]); self.assertFalse(out["economic_value_invented"]) + + def test_23_sdk_status_preserves_authority_and_compliance_boundaries(self): + status=sdk_mod.EntityGlobalPassportSDK.capability_status(); self.assertTrue(status["sdk_does_not_create_authority"]) + self.assertTrue(status["profile_is_not_regulatory_compliance"]); self.assertTrue(status["external_standards_are_mapped_not_redefined"]) + + def test_24_industry_package_registry_contains_six_deployable_families(self): + r=package_mod.IndustryImplementationPackageRegistry() + self.assertEqual(r.list_packages(),["ai","defence-public","finance","healthcare","manufacturing","robotics"]) + self.assertTrue(all(r.get(x)["developer_configures_not_redesigns"] if "developer_configures_not_redesigns" in r.get(x) else True for x in r.list_packages())) + + def test_25_healthcare_fhir_mapping_is_versioned_and_non_normative(self): + r=package_mod.IndustryImplementationPackageRegistry() + out=r.map_external("healthcare","HL7-FHIR",{"resourceType":"Observation","id":"obs-1","meta":{"versionId":"7"}}) + self.assertEqual(out["descriptor"]["fhir_resource_type"],"Observation") + self.assertEqual(out["descriptor"]["external_version"],"7") + self.assertFalse(out["normative_equivalence_claimed"]) + + def test_26_manufacturing_opcua_mapping_is_executable(self): + r=package_mod.IndustryImplementationPackageRegistry() + out=r.map_external("manufacturing","OPC-UA",{"NodeId":"ns=2;s=Machine1","BrowseName":"Machine1","DataType":"Double"}) + self.assertEqual(out["descriptor"]["opcua_node_id"],"ns=2;s=Machine1") + self.assertTrue(out["external_standard_not_redefined"]) + + def test_27_package_configuration_requires_organization_facts(self): + r=package_mod.IndustryImplementationPackageRegistry() + with self.assertRaises(ValueError): r.validate_configuration("finance",{}) + cfg={"organization":"Bank X","jurisdiction":"CA","authority_source":"board:1","settlement_policy":"policy:1"} + self.assertTrue(r.validate_configuration("finance",cfg)["valid"]) + + def test_28_public_defence_package_rejects_classified_material(self): + r=package_mod.IndustryImplementationPackageRegistry() + cfg={"organization":"Agency X","jurisdiction":"CA","authority_source":"directive:1","release_policy":"public","classification":"SECRET"} + with self.assertRaises(ValueError): r.validate_configuration("defence-public",cfg) + + def test_29_ai_package_template_pre_engineers_model_semantics(self): + r=package_mod.IndustryImplementationPackageRegistry(); t=r.template("ai","model") + self.assertEqual(t["object_type"],"MODEL"); self.assertIn("TRAIN",t["default_right_actions"]) + self.assertIn("entity-profile:ai@1.0",t["profile_refs"]); self.assertFalse(t["economic_value_invented"]) + + def test_30_package_deployment_plan_does_not_modify_core(self): + r=package_mod.IndustryImplementationPackageRegistry() + cfg={"organization":"Factory X","jurisdiction":"CA","authority_source":"policy:1","asset_namespace":"plant-a"} + plan=r.deployment_plan("manufacturing",cfg,"digital_twin") + self.assertFalse(plan["core_semantics_changed"]); self.assertTrue(plan["developer_configures_not_redesigns"]) + self.assertEqual(plan["object_type"],"DIGITAL_TWIN") + + def test_31_sdk_package_plan_and_external_mapping(self): + packages=package_mod.IndustryImplementationPackageRegistry() + sdk=sdk_mod.EntityGlobalPassportSDK(self.profiles,self.globals,self.ingest,packages) + cfg={"organization":"Hospital X","jurisdiction":"CA-BC","authority_source":"policy:1","privacy_policy":"privacy:1"} + plan=sdk.package_plan("healthcare",cfg,"clinical_dataset") + self.assertEqual(plan["object_type"],"DATASET") + mapped=sdk.map_external("healthcare","DICOM",{"SOPInstanceUID":"1.2.3","StudyInstanceUID":"4.5.6","Modality":"CT"}) + self.assertEqual(mapped["descriptor"]["modality"],"CT") + + def test_32_sdk_ingests_preengineered_industry_package(self): + packages=package_mod.IndustryImplementationPackageRegistry() + sdk=sdk_mod.EntityGlobalPassportSDK(self.profiles,self.globals,self.ingest,packages) + cfg={"organization":"Lab X","jurisdiction":"CA","authority_source":"policy:2","model_governance_policy":"ai:1"} + f=self.source/"weights.gguf"; f.write_bytes(b"weights") + out=sdk.ingest_package_file(f,self.owner,"ai",cfg,"model",logical_path="models/weights.gguf") + self.assertTrue(out["deployment_plan"]["developer_configures_not_redesigns"]) + self.assertFalse(out["economic_value_invented"]) + self.assertTrue(self.globals.verify(self.globals.get(out["global_passport_id"]))["valid"]) + + def test_33_generated_profile_package_registry_exists(self): + registry_path=ROOT/"profiles/registry.json" + self.assertTrue(registry_path.is_file()) + data=__import__("json").loads(registry_path.read_text(encoding="utf-8")) + self.assertEqual(len(data["packages"]),6); self.assertTrue(data["one_global_passport"]) + +if __name__=="__main__": unittest.main() diff --git a/tools/build_v3_4_0_release.py b/tools/build_v3_4_0_release.py new file mode 100644 index 0000000..71db686 --- /dev/null +++ b/tools/build_v3_4_0_release.py @@ -0,0 +1,57 @@ +from __future__ import annotations +import hashlib, json, pathlib + +ROOT=pathlib.Path(__file__).resolve().parents[1] +BASE_PATH=ROOT/"ENTITY_V3_3_0_RELEASE_MANIFEST.json" +QUAL_PATH=ROOT/"docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json" +INGEST_PATH=ROOT/"docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json" +base=json.loads(BASE_PATH.read_text(encoding="utf-8")); qualification=json.loads(QUAL_PATH.read_text(encoding="utf-8")); ingest=json.loads(INGEST_PATH.read_text(encoding="utf-8")) + +overlay={ + "RELEASE_NOTES_v3.4.0.md", + "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json", + "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md", + "docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json", + "protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json", + "protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json", + "profiles/registry.json", + "src/38_Global_Passports/profile_registry.py","src/38_Global_Passports/industry_profiles.py", + "src/38_Global_Passports/global_passport.py","src/38_Global_Passports/continuous_ingestion.py", + "src/38_Global_Passports/global_passport_profile.py","src/38_Global_Passports/passport_conformance.py", + "src/39_Implementation_Packages/industry_packages.py", + "sdk/global_passport_sdk/canonical_global_passport_sdk.py","sdk/global_passport_sdk/README.md", + "tests/test_v3_global_passports.py", + "tools/build_v3_4_cleanroom_kit.py","tools/verify_v3_4_global_passport_release.py", + "tools/build_v3_4_industry_packages.py","tools/verify_v3_4_implementation_packages.py", + "tools/entity_v3_4_cli.py","tools/build_v3_4_qualification.py","tools/ingest_v3_4_release.py", + "tools/build_v3_4_0_release.py","tools/verify_v3_4_0_release_manifest.py","tools/run_v3_4_0_release_gate.ps1", +} +missing=[rel for rel in sorted(overlay) if not (ROOT/rel).is_file()] +if missing: raise SystemExit("missing v3.4 release-critical files: "+", ".join(missing)) +def sha(path:pathlib.Path)->str: return hashlib.sha256(path.read_bytes()).hexdigest() +entries=[{"path":rel,"sha256":sha(ROOT/rel)} for rel in sorted(overlay)] +material="\n".join(f"{x['path']}|{x['sha256']}" for x in entries).encode() +overlay_snapshot=hashlib.sha256(material).hexdigest() +base_snapshot=base["release_snapshot_sha256"] +release_snapshot=hashlib.sha256(f"{base_snapshot}|{overlay_snapshot}".encode()).hexdigest() +manifest={ + "schema":"entity-v3-4-0-release-manifest-v1","version":"3.4.0", + "status":"BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE", + "release_date":"2026-09-24","repository":"blackmore-technology-group/ENTITY","supersedes":"v3.3.0", + "base_commit":"9c79f987207592cb6791e1a8956f23351cdfb2d3", + "base_release_manifest_sha256":sha(BASE_PATH),"base_release_snapshot_sha256":base_snapshot, + "qualified_source_commit":qualification["qualified_source_commit"],"qualification":qualification, + "continuous_provenance_ingest":{"files":ingest["files"],"inventory_sha256":ingest["inventory_sha256"], + "historical_provenance_before_v3_4_claimed":ingest["historical_provenance_before_v3_4_claimed"]}, + "external_remaining":qualification["external_remaining"],"permanent_truth_boundaries":qualification["permanent_truth_boundaries"], + "overlay_files":entries,"overlay_snapshot_sha256":overlay_snapshot,"release_snapshot_sha256":release_snapshot, + "implementation_package_registry_sha256":qualification["implementation_packages"]["registry_sha256"], + "six_language_controlled_interoperability":qualification["six_language_controlled_interoperability"], + "release_chain":{"v3.3.0_protected_base":"9c79f987207592cb6791e1a8956f23351cdfb2d3", + "v3.4.0_qualified_source":qualification["qualified_source_commit"]} +} +out=ROOT/"ENTITY_V3_4_0_RELEASE_MANIFEST.json" +out.write_bytes((json.dumps(manifest,indent=2,sort_keys=True)+"\n").encode("utf-8")) +print(json.dumps({"version":manifest["version"],"status":manifest["status"],"overlay_files":len(entries), + "overlay_snapshot_sha256":overlay_snapshot,"release_snapshot_sha256":release_snapshot, + "qualified_source_commit":manifest["qualified_source_commit"]},indent=2,sort_keys=True)) diff --git a/tools/build_v3_4_cleanroom_kit.py b/tools/build_v3_4_cleanroom_kit.py new file mode 100644 index 0000000..0787766 --- /dev/null +++ b/tools/build_v3_4_cleanroom_kit.py @@ -0,0 +1,64 @@ +from __future__ import annotations +import hashlib, importlib.util, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +def load(name,path): + spec=importlib.util.spec_from_file_location(name,path); mod=importlib.util.module_from_spec(spec); sys.modules[name]=mod; spec.loader.exec_module(mod); return mod +conf=load("v34_kit_conf",ROOT/"src/38_Global_Passports/passport_conformance.py") +Z="0"*64; O="1"*64; T="2"*64 +CORE=["ENTITY","AUTHORITY","RIGHT","EVENT","VALUE"] +def profile(pid,kind="INDUSTRY",public=True): + return {"schema":"entity-v3-global-profile-v1","profile_ref":pid+"@1.0","profile_id":pid,"version":"1.0","kind":kind,"schema_sha256":Z,"profile_is_not_authority":True,"standards_mapping_is_not_normative_equivalence":True,"public_unclassified":public} +def stack(refs): + return {"schema":"entity-v3-profile-stack-resolution-v1","profile_refs":refs,"profile_hashes":[O for _ in refs],"fail_closed":True,"profile_composition_does_not_create_authority":True,"standards_mapping_is_not_normative_equivalence":True} +def passport(refs,mappings=None): + return {"schema":"entity-v3-global-passport-v1","core_primitives":CORE,"rights_passport_id":"passport3-example","rights_passport_sha256":T,"profile_stack":stack(refs),"standards_mappings":mappings or [],"economic_state":{"state":"POTENTIAL","amount_units":0,"currency":"UNSPECIFIED","market_observation_is_not_accounting_fair_value":True},"one_passport_many_profiles":True,"profile_composition_does_not_create_authority":True,"standards_mapping_is_not_normative_equivalence":True,"evidence_does_not_establish_objective_truth":True,"legal_effect_is_deployment_specific":True,"underlying_information_remains_nonrival":True} +def status(): + return {"schema":"entity-v3-global-passport-profile-status-v1","core_primitives":CORE,"core_semantics_changed":False,"market_engine_preserved":True,"one_passport_many_profiles":True,"evidence_truth_boundary_preserved":True} +def ingest(): + return {"schema":"entity-v3-continuous-ingest-result-v1","files":3,"inventory_sha256":Z,"content_addressed":True,"custody_is_not_authority":True,"economic_value_invented":False} + +cases=[] +def add(cid,expect,record): cases.append({"id":cid,"expect":expect,"record":record}) +add("valid_status","VALID",status()) +add("valid_global_profile","VALID",profile("entity-profile:global","GLOBAL")) +add("valid_healthcare_profile","VALID",profile("entity-profile:healthcare")) +add("valid_finance_profile","VALID",profile("entity-profile:finance")) +add("valid_manufacturing_profile","VALID",profile("entity-profile:manufacturing")) +add("valid_ai_profile","VALID",profile("entity-profile:ai")) +add("valid_robotics_profile","VALID",profile("entity-profile:robotics")) +add("valid_defence_profile","VALID",profile("entity-profile:defence-public",public=True)) +add("valid_stack_multi","VALID",stack(["entity-profile:global@1.0","entity-profile:healthcare@1.0","entity-profile:ai@1.0"])) +add("valid_passport_ai","VALID",passport(["entity-profile:global@1.0","entity-profile:ai@1.0"])) +add("valid_passport_finance_mapping","VALID",passport(["entity-profile:global@1.0","entity-profile:finance@1.0"],[{"standard":"ISO-20022","normative_equivalence_claimed":False}])) +add("valid_ingest","VALID",ingest()) +x=status(); x["core_semantics_changed"]=True; add("invalid_status_core_change","INVALID",x) +x=profile("entity-profile:ai"); x["profile_is_not_authority"]=False; add("invalid_profile_authority","INVALID",x) +x=profile("entity-profile:ai"); x["kind"]="UNKNOWN"; add("invalid_profile_kind","INVALID",x) +x=profile("entity-profile:defence-public",public=False); add("invalid_defence_not_public","INVALID",x) +x=stack(["entity-profile:ai@1.0"]); add("invalid_stack_missing_global","INVALID",x) +x=stack(["entity-profile:global@1.0"]); x["profile_hashes"]=["bad"]; add("invalid_stack_bad_hash","INVALID",x) +x=passport(["entity-profile:global@1.0"]); x["evidence_does_not_establish_objective_truth"]=False; add("invalid_passport_truth","INVALID",x) +x=passport(["entity-profile:global@1.0"],[{"standard":"FHIR","normative_equivalence_claimed":True}]); add("invalid_passport_equivalence","INVALID",x) +x=passport(["entity-profile:global@1.0"]); x["underlying_information_remains_nonrival"]=False; add("invalid_passport_scarcity","INVALID",x) +x=passport(["entity-profile:global@1.0"]); x["core_primitives"]=["ENTITY","TOKEN"]; add("invalid_passport_core","INVALID",x) +x=ingest(); x["files"]=-1; add("invalid_ingest_negative_files","INVALID",x) +x=ingest(); x["economic_value_invented"]=True; add("invalid_ingest_fake_value","INVALID",x) + +cases.sort(key=lambda x:x["id"]) +for case in cases: + actual="VALID" if conf.validate_global_passport_record(case["record"]) else "INVALID" + if actual!=case["expect"]: raise SystemExit(f"vector expectation mismatch {case['id']}: {actual}") +rows=[{"id":c["id"],"actual":"VALID" if conf.validate_global_passport_record(c["record"]) else "INVALID"} for c in cases] +result_sha=hashlib.sha256(json.dumps(rows,sort_keys=True,separators=(",",":"),ensure_ascii=False).encode()).hexdigest() +schema_path=ROOT/"protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json" +kit={"schema":"entity-v3.4-global-passport-cleanroom-kit-v1","version":"3.4.0","base_release":"v3.3.0", + "base_commit":"9c79f987207592cb6791e1a8956f23351cdfb2d3","schema_sha256":hashlib.sha256(schema_path.read_bytes()).hexdigest(), + "doctrine":"One ENTITY Passport. Many jurisdictions, industries, standards and contexts. No new sovereignty silos.", + "valid_vectors":sum(c["expect"]=="VALID" for c in cases),"invalid_vectors":sum(c["expect"]=="INVALID" for c in cases), + "expected_result_sha256":result_sha,"cases":cases} +out=ROOT/"protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json" +out.write_bytes(json.dumps(kit,sort_keys=True,separators=(",",":"),ensure_ascii=False).encode()) +print(json.dumps({"kit":str(out),"cases":len(cases),"valid":kit["valid_vectors"],"invalid":kit["invalid_vectors"], + "schema_sha256":kit["schema_sha256"],"expected_result_sha256":result_sha, + "kit_sha256":hashlib.sha256(out.read_bytes()).hexdigest()},indent=2)) diff --git a/tools/build_v3_4_industry_packages.py b/tools/build_v3_4_industry_packages.py new file mode 100644 index 0000000..e377e22 --- /dev/null +++ b/tools/build_v3_4_industry_packages.py @@ -0,0 +1,67 @@ +from __future__ import annotations +import importlib.util, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +SRC=ROOT/"src/39_Implementation_Packages/industry_packages.py" +spec=importlib.util.spec_from_file_location("industry_packages",SRC) +mod=importlib.util.module_from_spec(spec); sys.modules["industry_packages"]=mod; spec.loader.exec_module(mod) +registry=mod.IndustryImplementationPackageRegistry() +out_root=ROOT/"profiles"; out_root.mkdir(parents=True,exist_ok=True) + +def dump(path:pathlib.Path,value): + path.parent.mkdir(parents=True,exist_ok=True) + path.write_text(json.dumps(value,indent=2,sort_keys=True)+"\n",encoding="utf-8") + +def example_config(name:str)->dict: + base={"organization":"Example Organization","jurisdiction":"CONFIGURE-ME","authority_source":"CONFIGURE-ME"} + extra={"healthcare":{"privacy_policy":"CONFIGURE-ME"},"finance":{"settlement_policy":"CONFIGURE-ME"}, + "manufacturing":{"asset_namespace":"CONFIGURE-ME"},"ai":{"model_governance_policy":"CONFIGURE-ME"}, + "robotics":{"safety_policy":"CONFIGURE-ME"},"defence-public":{"release_policy":"PUBLIC-UNCLASSIFIED","classification":"UNCLASSIFIED"}} + return dict(base,**extra[name]) + +index={"schema":"entity-v3-industry-package-registry-v1","version":"3.4.0","packages":[], + "one_global_passport":True,"profiles_are_executable_implementation_assets":True} +for name in registry.list_packages(): + package=registry.get(name); target=out_root/name; target.mkdir(parents=True,exist_ok=True) + dump(target/"package.json",package) + dump(target/"mappings.json",{"package":name,"mappings":package["mappings"],"external_standards_are_mapped_not_redefined":True}) + templates={kind:registry.template(name,kind) for kind in package["object_types"]} + dump(target/"templates.json",{"package":name,"templates":templates}) + cfg=example_config(name) + sample_kind=next(iter(package["object_types"])) + dump(target/"deployment.example.json",{"package":name,"configuration":cfg,"asset_kind":sample_kind, + "note":"Replace CONFIGURE-ME values with organization-specific facts before deployment."}) + dump(target/"deployment.schema.json",{ + "$schema":"https://json-schema.org/draft/2020-12/schema","type":"object", + "required":package["required_config"],"properties":{k:{"type":"string","minLength":1} for k in package["required_config"]}, + "additionalProperties":True,"x-entity-profile-is-not-regulatory-compliance":True}) + valid={"configuration":cfg,"asset_kind":sample_kind,"expected_valid":True} + invalid={"configuration":{},"asset_kind":sample_kind,"expected_valid":False} + dump(target/"conformance.json",{"schema":"entity-v3-industry-package-conformance-v1","valid":[valid],"invalid":[invalid], + "profile_stack":package["profile_refs"],"core_semantics_changed":False}) + quick=f"""# ENTITY {name} Implementation Package + +This package configures the one ENTITY Global Passport; it does not define a separate passport. + +1. Copy `deployment.example.json` and replace every `CONFIGURE-ME` value. +2. Validate organization authority, jurisdiction and package-specific policy inputs. +3. Use `EntityGlobalPassportSDK.package_plan()` to resolve the executable profile stack. +4. Connect the source system and use `ingest_package_file()` for continuous provenance. +5. Verify the resulting Global Passport and run the package conformance vectors. + +External standards are mappings only. ENTITY does not redefine them, and package validation does not establish regulatory compliance. +""" + (target/"QUICKSTART.md").write_text(quick,encoding="utf-8") + index["packages"].append({"name":name,"version":package["version"],"package_sha256":package["package_sha256"],"profile_refs":package["profile_refs"]}) +dump(out_root/"registry.json",index) +print(json.dumps({"packages":len(index["packages"]),"names":[x["name"] for x in index["packages"]]},indent=2)) + +bundle={"schema":"entity-v3-4-implementation-package-bundle-v1","version":"3.4.0","registry":index,"packages":{}, + "one_global_passport":True,"profiles_are_executable_implementation_assets":True} +for name in registry.list_packages(): + target=out_root/name + bundle["packages"][name]={} + for filename in ["package.json","mappings.json","templates.json","deployment.example.json","deployment.schema.json","conformance.json"]: + bundle["packages"][name][filename]=json.loads((target/filename).read_text(encoding="utf-8")) + bundle["packages"][name]["QUICKSTART.md"]=(target/"QUICKSTART.md").read_text(encoding="utf-8") +dump(out_root/"ENTITY_V3_4_IMPLEMENTATION_PACKAGES.json",bundle) diff --git a/tools/build_v3_4_qualification.py b/tools/build_v3_4_qualification.py new file mode 100644 index 0000000..39f8a52 --- /dev/null +++ b/tools/build_v3_4_qualification.py @@ -0,0 +1,104 @@ +from __future__ import annotations +import hashlib, json, pathlib + +ROOT=pathlib.Path(__file__).resolve().parents[1] +QDIR=ROOT/"docs/qualification"; QDIR.mkdir(parents=True,exist_ok=True) +registry_sha256=hashlib.sha256((ROOT/"profiles/registry.json").read_bytes()).hexdigest() +qualification={ + "schema":"entity-v3-4-0-release-qualification-v1", + "version":"3.4.0", + "status":"BTG_INTERNAL_QUALIFIED_GLOBAL_PASSPORT_CONTINUOUS_PROVENANCE_RELEASE_CANDIDATE", + "date":"2026-09-24", + "base_release":"v3.3.0", + "base_commit":"9c79f987207592cb6791e1a8956f23351cdfb2d3", + "base_release_manifest_sha256":"1e4fa980507f20168be44b7644a3ccfaa6cd369c08d05ff7c7c2fcb2956ff85c", + "qualified_source_commit":"854529e6cb88e77f29cce581beb74b530768224c", + "regression":{"environment":"_venv_entity_v3","runner":"python -m unittest discover -s tests -p 'test_*.py' -v","passed":177,"total":177}, + "targeted_global_passport_tests":{"passed":33,"total":33}, + "cli_deployment_smoke":{"valid":True,"passport_valid":True,"objective_truth_claimed":False,"legal_compliance_claimed":False}, + "global_passport_conformance":{"total":24,"valid":12,"invalid":12, + "sealed_kit_sha256":"5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230", + "schema_sha256":"4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd", + "expected_result_sha256":"ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba"}, + "six_language_controlled_interoperability":{ + "status":"PASS","independent_third_party_interoperability":False, + "result_sha256":"ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba", + "implementations":{ + "rust":"5420f724495722019b1f8624f02fe8a02df7bfbf", + "typescript":"48e7f606740819379eee2e0fa663d41044b1d899", + "go":"d878229a5256bf7c06a1da84dfb9ba0297f0c946", + "csharp":"2cf64646cb70c8d89698f3f474a0a2a532c83b2d", + "java":"da2520429f8dab7a2752b2b6b6fc653c6ae173b6", + "swift":"2f40118999beceb6c34f2ea1c583dd12cfe81368"}}, + "implementation_packages":{ + "registry_sha256":registry_sha256, + "packages":{ + "ai":"4877cb5bc76ef0803eace931ca1a9cba516c01ba94a2e0b4bc71bcb5dc1b0440", + "defence-public":"7edc52344822e370f937b12d05258b5cb3283756dadb5c1885dd93f126cf9887", + "finance":"768dd87fd5a29c7e2679fc2b0d4b172b8613712b148336d8fba91a3b92d0d466", + "healthcare":"b4e901ce37f696fa10666839cb8d3cacbd1fe663070667ca1767a6245e7cf939", + "manufacturing":"bc29a0de024cea22552078ff1913fa3df2b189436cb853cc2f4e08974325c4bc", + "robotics":"3a0e68fa6c63b2ef9cf79ccf463335af72d49ffb3cd028c88b6a998d8678f38f"}, + "profiles_are_executable_implementation_assets":True, + "developer_configures_not_redesigns":True, + "publication_model":"core registry plus six dedicated domain repositories", + "domain_repositories":{ + "ai":"blackmore-technology-group/ENTITY-AI", + "defence-public":"blackmore-technology-group/ENTITY-DEFENCE", + "finance":"blackmore-technology-group/ENTITY-FINANCE", + "healthcare":"blackmore-technology-group/ENTITY-HEALTHCARE", + "manufacturing":"blackmore-technology-group/ENTITY-MANUFACTURING", + "robotics":"blackmore-technology-group/ENTITY-ROBOTICS"}}, + "v3_4_invariants":[ + "CORE_PRIMITIVES_UNCHANGED","MARKET_ENGINE_PRESERVED","GLOBAL_PASSPORT_BINDS_EXISTING_RIGHTS", + "PROFILE_COMPOSITION_DOES_NOT_CREATE_AUTHORITY","EXTERNAL_STANDARDS_MAPPED_NOT_REDEFINED", + "PASSPORT_IS_NOT_OBJECTIVE_TRUTH","LEGAL_COMPLIANCE_NOT_IMPLIED","CONTINUOUS_PROVENANCE", + "CUSTODY_IS_NOT_AUTHORITY","ECONOMIC_VALUE_NOT_INVENTED","INDUSTRY_PACKAGES_DO_NOT_CREATE_SILOS"], + "permanent_truth_boundaries":[ + "cryptographic verification proves integrity/attribution, not objective external truth", + "protocol verification proves ENTITY semantic validity, not objective external truth", + "evidence and attestations remain attributable and contestable", + "profile composition does not create sovereign authority", + "external standards are mapped, not redefined or made subordinate to ENTITY", + "profile/package validation does not establish regulatory compliance", + "protocol records do not determine legal title or accounting fair value", + "provider custody does not create ENTITY authority", + "information itself need not be scarce; economic scarcity resides in explicitly bounded rights or interests"], + "external_remaining":[ + "unrelated third-party independent v3.4 implementation and live interoperability", + "independent external security/cryptographic review", + "deployment-specific legal/regulatory classification, licensing, recognition or approval where required", + "real external issuers, buyers, repeat transactions and market liquidity", + "standards/profile governance adoption outside BTG"], + "claim_boundary":"Six native implementations are BTG-controlled controlled-interoperability evidence; they are not unrelated third-party independence." +} +json_path=QDIR/"ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json" +json_path.write_bytes((json.dumps(qualification,indent=2,sort_keys=True)+"\n").encode("utf-8")) +md=f'''# ENTITY v3.4.0 Release Qualification — 2026-09-24 + +**Status:** {qualification["status"]} + +**Qualified source:** `{qualification["qualified_source_commit"]}` +**Base:** ENTITY v3.3.0 at `{qualification["base_commit"]}` + +## Qualification result + +- Complete regression: **177/177 PASS**. +- v3.4 targeted Global Passport / implementation-package tests: **33/33 PASS**. +- Sealed Global Passport campaign: **24/24 vectors** (12 valid, 12 invalid). +- Canonical result SHA-256: `{qualification["global_passport_conformance"]["expected_result_sha256"]}`. +- Six BTG-controlled native implementations: **Rust, TypeScript, Go, C#, Java, Swift — PASS**. +- CLI deployment path: initialize → package plan → ingest → passport verify — **PASS**. + +## Release architecture + +ENTITY v3.4 preserves `ENTITY → AUTHORITY → RIGHT → EVENT → VALUE`. It adds one Global Passport, composable profiles, a versioned profile registry, explicit external-standard mappings, continuous provenance and executable implementation packages for Healthcare, Finance, Manufacturing, AI, Robotics and public/unclassified Defence. + +Industry packages populate the one Global Passport. They do not define incompatible industry-specific passports, create authority, declare truth, or establish regulatory compliance. + +## Evidence boundary + +The six native implementations are all BTG-controlled. Their common result is meaningful controlled-interoperability evidence, but **unrelated third-party implementation/interoperability remains pending**. External security review and deployment-specific legal/regulatory determinations also remain external work. +''' +(QDIR/"ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md").write_bytes(md.encode("utf-8")) +print(json.dumps({"qualified_source_commit":qualification["qualified_source_commit"],"regression":"177/177","targeted":"33/33","vectors":"24/24","six_language":"PASS"},indent=2)) diff --git a/tools/entity_v3_4_cli.py b/tools/entity_v3_4_cli.py new file mode 100644 index 0000000..c8f0206 --- /dev/null +++ b/tools/entity_v3_4_cli.py @@ -0,0 +1,77 @@ +from __future__ import annotations +import argparse, importlib.util, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +def load(name,rel): + spec=importlib.util.spec_from_file_location(name,ROOT/rel); mod=importlib.util.module_from_spec(spec) + sys.modules[name]=mod; spec.loader.exec_module(mod); return mod + +identity_mod=load("cli_v34_identity","src/01_Core_Runtime/identity/canonical_identity.py") +fabric_mod=load("cli_v34_fabric","src/30_Universal_Transaction_Fabric/canonical_universal_fabric.py") +rights_mod=load("cli_v34_rights","src/36_Adoption_Layer/rights_passport.py") +reality_profile=load("reality_profile","src/37_Verifiable_Reality/reality_profile.py") +evidence_mod=load("cli_v34_evidence","src/37_Verifiable_Reality/evidence_objects.py") +profile_mod=load("cli_v34_profiles","src/38_Global_Passports/profile_registry.py") +industry_mod=load("cli_v34_industry","src/38_Global_Passports/industry_profiles.py") +global_mod=load("cli_v34_global","src/38_Global_Passports/global_passport.py") +ingest_mod=load("cli_v34_ingest","src/38_Global_Passports/continuous_ingestion.py") +package_mod=load("cli_v34_packages","src/39_Implementation_Packages/industry_packages.py") +sdk_mod=load("cli_v34_sdk","sdk/global_passport_sdk/canonical_global_passport_sdk.py") + +def runtime(state): + identity=identity_mod.EntityIdentityVault(state); fabric=fabric_mod.UniversalTransactionFabric(state,identity) + evidence=evidence_mod.EvidenceRegistry(state,identity); rights=rights_mod.RightsPassportRegistry(state,identity,fabric) + profiles=profile_mod.GlobalProfileRegistry(state,identity); passports=global_mod.GlobalPassportRegistry(state,identity,fabric,rights,profiles) + ingestion=ingest_mod.ContinuousProvenanceEngine(state,identity,fabric,evidence,rights,passports) + packages=package_mod.IndustryImplementationPackageRegistry(); sdk=sdk_mod.EntityGlobalPassportSDK(profiles,passports,ingestion,packages) + return identity,fabric,profiles,passports,packages,sdk +def read_json(path): return json.loads(pathlib.Path(path).read_text(encoding="utf-8-sig")) +def emit(value): print(json.dumps(value,indent=2,sort_keys=True)) + +def cmd_init(a): + identity,_,profiles,_,_,_=runtime(a.state) + controller=identity.create(a.name,"organization")["entity_id"] + installed=industry_mod.install_builtin_profiles(profiles,controller) + emit({"state":str(pathlib.Path(a.state).resolve()),"controller_entity_id":controller, + "profiles":sorted(installed),"authority_must_be_configured_by_deployer":True}) + +def cmd_packages(a): + *_,packages,_=runtime(a.state) + emit({"packages":[packages.get(name) for name in packages.list_packages()]}) + +def cmd_plan(a): + *_,packages,sdk=runtime(a.state) + emit(sdk.package_plan(a.package,read_json(a.config),a.asset_kind)) + +def cmd_map(a): + *_,sdk=runtime(a.state) + emit(sdk.map_external(a.package,a.standard,read_json(a.input))) + +def cmd_ingest(a): + _,_,profiles,_,_,sdk=runtime(a.state) + try: profiles.get("entity-profile:global@1.0") + except KeyError: raise SystemExit("state has no installed v3.4 profiles; run init first") + out=sdk.ingest_package_file(a.file,a.controller,a.package,read_json(a.config),a.asset_kind, + logical_path=a.logical_path,version=a.version) + emit(out) + +def cmd_verify(a): + *_,sdk=runtime(a.state) + emit(sdk.verify_passport(a.passport_id)) +def parser(): + p=argparse.ArgumentParser(prog="entity-v3.4",description="ENTITY v3.4 Global Passport deployment CLI") + p.add_argument("--state",required=True,help="ENTITY state directory") + sub=p.add_subparsers(dest="command",required=True) + x=sub.add_parser("init"); x.add_argument("--name",required=True); x.set_defaults(func=cmd_init) + x=sub.add_parser("packages"); x.set_defaults(func=cmd_packages) + x=sub.add_parser("plan"); x.add_argument("--package",required=True); x.add_argument("--config",required=True); x.add_argument("--asset-kind",required=True); x.set_defaults(func=cmd_plan) + x=sub.add_parser("map"); x.add_argument("--package",required=True); x.add_argument("--standard",required=True); x.add_argument("--input",required=True); x.set_defaults(func=cmd_map) + x=sub.add_parser("ingest"); x.add_argument("--controller",required=True); x.add_argument("--package",required=True); x.add_argument("--config",required=True) + x.add_argument("--asset-kind",required=True); x.add_argument("--file",required=True); x.add_argument("--logical-path"); x.add_argument("--version",default="1.0"); x.set_defaults(func=cmd_ingest) + x=sub.add_parser("verify"); x.add_argument("--passport-id",required=True); x.set_defaults(func=cmd_verify) + return p + +def main(argv=None): + args=parser().parse_args(argv); args.func(args); return 0 + +if __name__=="__main__": raise SystemExit(main()) diff --git a/tools/ingest_v3_4_release.py b/tools/ingest_v3_4_release.py new file mode 100644 index 0000000..cc44f52 --- /dev/null +++ b/tools/ingest_v3_4_release.py @@ -0,0 +1,83 @@ +from __future__ import annotations +import hashlib, importlib.util, json, os, pathlib, shutil, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +STATE=pathlib.Path(os.environ.get("ENTITY_V34_INGEST_STATE", str(ROOT.parent/"_ENTITY_V3_4_RELEASE_INGEST_STATE"))) +OUT=ROOT/"docs/qualification/ENTITY_V3_4_0_CONTINUOUS_PROVENANCE_INGEST_2026-09-24.json" + +def load(name,rel): + spec=importlib.util.spec_from_file_location(name,ROOT/rel); mod=importlib.util.module_from_spec(spec) + sys.modules[name]=mod; spec.loader.exec_module(mod); return mod + +identity_mod=load("ing34_identity","src/01_Core_Runtime/identity/canonical_identity.py") +fabric_mod=load("ing34_fabric","src/30_Universal_Transaction_Fabric/canonical_universal_fabric.py") +rights_mod=load("ing34_rights","src/36_Adoption_Layer/rights_passport.py") +reality_profile=load("reality_profile","src/37_Verifiable_Reality/reality_profile.py") +evidence_mod=load("ing34_evidence","src/37_Verifiable_Reality/evidence_objects.py") +profile_mod=load("ing34_profiles","src/38_Global_Passports/profile_registry.py") +industry_mod=load("ing34_industry","src/38_Global_Passports/industry_profiles.py") +global_mod=load("ing34_global","src/38_Global_Passports/global_passport.py") +ingest_mod=load("ing34_ingest","src/38_Global_Passports/continuous_ingestion.py") + +if STATE.exists(): shutil.rmtree(STATE) +identity=identity_mod.EntityIdentityVault(STATE); fabric=fabric_mod.UniversalTransactionFabric(STATE,identity) +controller=identity.create("ENTITY v3.4 Release Provenance","organization")["entity_id"] +evidence=evidence_mod.EvidenceRegistry(STATE,identity); rights=rights_mod.RightsPassportRegistry(STATE,identity,fabric) +profiles=profile_mod.GlobalProfileRegistry(STATE,identity); industry_mod.install_builtin_profiles(profiles,controller) +passports=global_mod.GlobalPassportRegistry(STATE,identity,fabric,rights,profiles) +ingestion=ingest_mod.ContinuousProvenanceEngine(STATE,identity,fabric,evidence,rights,passports) +FILES=[ + "src/38_Global_Passports/profile_registry.py", + "src/38_Global_Passports/industry_profiles.py", + "src/38_Global_Passports/global_passport.py", + "src/38_Global_Passports/continuous_ingestion.py", + "src/38_Global_Passports/global_passport_profile.py", + "src/38_Global_Passports/passport_conformance.py", + "src/39_Implementation_Packages/industry_packages.py", + "sdk/global_passport_sdk/canonical_global_passport_sdk.py", + "sdk/global_passport_sdk/README.md", + "protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json", + "protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json", + "profiles/registry.json", + "tools/build_v3_4_cleanroom_kit.py", + "tools/verify_v3_4_global_passport_release.py", + "tools/build_v3_4_industry_packages.py", + "tools/entity_v3_4_cli.py", + "tests/test_v3_global_passports.py", + "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.json", + "docs/qualification/ENTITY_V3_4_0_RELEASE_QUALIFICATION_2026-09-24.md", + "RELEASE_NOTES_v3.4.0.md", +] +records=[] +for rel in FILES: + path=ROOT/rel + if not path.is_file(): raise SystemExit(f"missing release-ingest file: {rel}") + item=ingestion.ingest_file(path,controller,["entity-profile:global@1.0","entity-profile:ai@1.0"],logical_path=rel,version="3.4.0") + checked=passports.verify(item["global_passport"]) + if not checked["valid"]: raise SystemExit(f"passport verification failed: {rel}") + records.append({ + "path":rel, + "content_sha256":item["object"]["content_sha256"], + "object_id":item["object"]["object_id"], + "evidence_id":item["evidence"]["evidence_id"], + "rights_passport_id":item["rights_passport"]["passport_id"], + "global_passport_id":item["global_passport"]["passport_id"], + "global_passport_sha256":item["global_passport"]["body_sha256"], + "passport_valid":True, + "economic_value_invented":False, + "custody_is_not_authority":True}) + +material="\n".join(f"{r['content_sha256']} {r['path']}" for r in records).encode() +report={ + "schema":"entity-v3-4-continuous-provenance-release-ingest-v1", + "version":"3.4.0","date":"2026-09-24", + "qualified_source_commit":"854529e6cb88e77f29cce581beb74b530768224c", + "controller_entity_id":controller, + "profile_refs":["entity-profile:global@1.0","entity-profile:ai@1.0"], + "files":len(records),"inventory_sha256":hashlib.sha256(material).hexdigest(),"records":records, + "content_addressed":True,"custody_is_not_authority":True,"provider_credentials_included":False, + "economic_value_invented":False,"historical_provenance_before_v3_4_claimed":False, + "claim_boundary":"This campaign proves v3.4 release artifacts were registered under the new continuous-provenance workflow; it does not reconstruct or certify pre-v3.4 history." +} +OUT.parent.mkdir(parents=True,exist_ok=True); OUT.write_bytes((json.dumps(report,indent=2,sort_keys=True)+"\n").encode("utf-8")) +print(json.dumps({"files":report["files"],"inventory_sha256":report["inventory_sha256"],"state":str(STATE),"report":str(OUT)},indent=2)) diff --git a/tools/run_v3_4_0_release_gate.ps1 b/tools/run_v3_4_0_release_gate.ps1 new file mode 100644 index 0000000..717be0e --- /dev/null +++ b/tools/run_v3_4_0_release_gate.ps1 @@ -0,0 +1,21 @@ +$ErrorActionPreference = "Stop" +$repo = Split-Path -Parent $PSScriptRoot +$venvPython = Join-Path (Split-Path -Parent $repo) '_venv_entity_v3\Scripts\python.exe' +if (-not (Test-Path $venvPython)) { throw "ENTITY v3 environment not found: $venvPython" } +Push-Location $repo +try { + & powershell -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot 'run_v3_regression.ps1') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & $venvPython (Join-Path $PSScriptRoot 'verify_v3_3_0_release_manifest.py') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & $venvPython (Join-Path $PSScriptRoot 'verify_v3_4_global_passport_release.py') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & $venvPython (Join-Path $PSScriptRoot 'verify_v3_4_implementation_packages.py') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & $venvPython (Join-Path $PSScriptRoot 'build_v3_4_0_release.py') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & $venvPython (Join-Path $PSScriptRoot 'verify_v3_4_0_release_manifest.py') + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + Write-Host 'ENTITY v3.4.0 release gate PASS' + exit 0 +} finally { Pop-Location } diff --git a/tools/verify_v3_4_0_release_manifest.py b/tools/verify_v3_4_0_release_manifest.py new file mode 100644 index 0000000..77c769a --- /dev/null +++ b/tools/verify_v3_4_0_release_manifest.py @@ -0,0 +1,30 @@ +from __future__ import annotations +import hashlib, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1]; PATH=ROOT/"ENTITY_V3_4_0_RELEASE_MANIFEST.json"; BASE=ROOT/"ENTITY_V3_3_0_RELEASE_MANIFEST.json" +manifest=json.loads(PATH.read_text(encoding="utf-8")); base=json.loads(BASE.read_text(encoding="utf-8")); errors=[] +def sha(path:pathlib.Path)->str: return hashlib.sha256(path.read_bytes()).hexdigest() +if sha(BASE)!=manifest.get("base_release_manifest_sha256"): errors.append("base_manifest") +if base.get("release_snapshot_sha256")!=manifest.get("base_release_snapshot_sha256"): errors.append("base_snapshot") +for entry in manifest.get("overlay_files",[]): + path=ROOT/entry["path"] + if not path.is_file(): errors.append("missing:"+entry["path"]); continue + actual=sha(path) + if actual!=entry["sha256"]: errors.append("hash:"+entry["path"]) +material="\n".join(f"{x['path']}|{x['sha256']}" for x in sorted(manifest.get("overlay_files",[]),key=lambda x:x["path"])).encode() +overlay_root=hashlib.sha256(material).hexdigest() +if overlay_root!=manifest.get("overlay_snapshot_sha256"): errors.append("overlay_snapshot") +release_root=hashlib.sha256(f"{manifest.get('base_release_snapshot_sha256')}|{overlay_root}".encode()).hexdigest() +if release_root!=manifest.get("release_snapshot_sha256"): errors.append("release_snapshot") +q=manifest.get("qualification") or {}; ingest=manifest.get("continuous_provenance_ingest") or {} +if q.get("version")!="3.4.0" or q.get("regression",{}).get("passed")!=177 or q.get("targeted_global_passport_tests",{}).get("passed")!=33: errors.append("qualification_summary") +if q.get("qualified_source_commit")!="854529e6cb88e77f29cce581beb74b530768224c": errors.append("qualified_source") +if q.get("global_passport_conformance",{}).get("expected_result_sha256")!="ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba": errors.append("conformance_result") +if ingest.get("files")!=20 or ingest.get("historical_provenance_before_v3_4_claimed") is not False: errors.append("ingest_summary") +langs=q.get("six_language_controlled_interoperability",{}).get("implementations",{}) +if set(langs)!={"rust","typescript","go","csharp","java","swift"}: errors.append("six_language_set") +if q.get("six_language_controlled_interoperability",{}).get("independent_third_party_interoperability") is not False: errors.append("independence_boundary") +result={"valid":not errors,"version":manifest.get("version"),"status":manifest.get("status"), + "overlay_files":len(manifest.get("overlay_files",[])),"overlay_snapshot_sha256":overlay_root, + "release_snapshot_sha256":release_root,"qualified_source_commit":manifest.get("qualified_source_commit"),"errors":errors} +print(json.dumps(result,indent=2,sort_keys=True)); sys.exit(0 if not errors else 2) diff --git a/tools/verify_v3_4_global_passport_release.py b/tools/verify_v3_4_global_passport_release.py new file mode 100644 index 0000000..ac2ae63 --- /dev/null +++ b/tools/verify_v3_4_global_passport_release.py @@ -0,0 +1,31 @@ +from __future__ import annotations +import hashlib, importlib.util, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +KIT=ROOT/"protocol/v3/ENTITY_V3_4_GLOBAL_PASSPORT_CLEANROOM_KIT.min.json" +SCHEMA=ROOT/"protocol/v3/ENTITY_GLOBAL_PASSPORT.schema.json" +EXPECTED_KIT="5869a3fd0ed6cb9f65bf4b20c3bd64933cad82f4aef05c5809e2e05af921f230" +EXPECTED_SCHEMA="4fbfed9be1b1484bc5d28b8101d1c908b2ccced13e4e99ec896c5b054892ebdd" +EXPECTED_RESULT="ac7504cce70576008cff069607619660a4b9bf0cad43b3f3de81078f1e80d9ba" +def sha(p): return hashlib.sha256(pathlib.Path(p).read_bytes()).hexdigest() +def canonical(v): return json.dumps(v,sort_keys=True,separators=(",",":"),ensure_ascii=False).encode() +errors=[] +if sha(KIT)!=EXPECTED_KIT: errors.append("kit_sha256") +if sha(SCHEMA)!=EXPECTED_SCHEMA: errors.append("schema_sha256") +kit=json.loads(KIT.read_text(encoding="utf-8")) +if kit.get("version")!="3.4.0" or kit.get("base_release")!="v3.3.0": errors.append("version_or_base") +if kit.get("valid_vectors")!=12 or kit.get("invalid_vectors")!=12 or len(kit.get("cases",[]))!=24: errors.append("vector_counts") +if kit.get("schema_sha256")!=EXPECTED_SCHEMA or kit.get("expected_result_sha256")!=EXPECTED_RESULT: errors.append("kit_commitments") +spec=importlib.util.spec_from_file_location("v34_conf",ROOT/"src/38_Global_Passports/passport_conformance.py") +conf=importlib.util.module_from_spec(spec); sys.modules["v34_conf"]=conf; spec.loader.exec_module(conf) +rows=[] +for case in sorted(kit.get("cases",[]),key=lambda x:x.get("id","")): + actual="VALID" if conf.validate_global_passport_record(case.get("record") or {}) else "INVALID" + if actual!=case.get("expect"): errors.append(f"case:{case.get('id')}:{actual}") + rows.append({"id":case.get("id"),"actual":actual}) +result_hash=hashlib.sha256(canonical(rows)).hexdigest() +if result_hash!=EXPECTED_RESULT: errors.append(f"result_sha256:{result_hash}") +print(json.dumps({"valid":not errors,"version":"3.4.0","vectors":len(rows),"valid_vectors":kit.get("valid_vectors"), + "invalid_vectors":kit.get("invalid_vectors"),"kit_sha256":sha(KIT),"schema_sha256":sha(SCHEMA), + "result_sha256":result_hash,"errors":errors},indent=2,sort_keys=True)) +sys.exit(0 if not errors else 2) diff --git a/tools/verify_v3_4_implementation_packages.py b/tools/verify_v3_4_implementation_packages.py new file mode 100644 index 0000000..2a7ab73 --- /dev/null +++ b/tools/verify_v3_4_implementation_packages.py @@ -0,0 +1,26 @@ +from __future__ import annotations +import hashlib, importlib.util, json, pathlib, sys + +ROOT=pathlib.Path(__file__).resolve().parents[1] +REG=ROOT/"profiles/registry.json" +SRC=ROOT/"src/39_Implementation_Packages/industry_packages.py" + +def sha(path): return hashlib.sha256(path.read_bytes()).hexdigest() +spec=importlib.util.spec_from_file_location("pkg34_verify",SRC) +mod=importlib.util.module_from_spec(spec); spec.loader.exec_module(mod) +runtime=mod.IndustryImplementationPackageRegistry() +reg=json.loads(REG.read_text(encoding="utf-8")) +errors=[] +expected_names=runtime.list_packages() +actual_names=[x["name"] for x in reg.get("packages",[])] +if actual_names!=expected_names: errors.append("package_names") +if reg.get("schema")!="entity-v3-industry-package-registry-v1" or reg.get("version")!="3.4.0": errors.append("registry_schema") +if reg.get("one_global_passport") is not True or reg.get("profiles_are_executable_implementation_assets") is not True: errors.append("registry_boundaries") +package_hashes={} +for row in reg.get("packages",[]): + pkg=runtime.get(row["name"]); package_hashes[row["name"]]=pkg["package_sha256"] + if pkg["package_sha256"]!=row.get("package_sha256"): errors.append("package_hash:"+row["name"]) + if pkg.get("developer_configures_not_redesigns") is not True: errors.append("package_model:"+row["name"]) +result={"valid":not errors,"version":"3.4.0","packages":len(actual_names),"registry_sha256":sha(REG), + "package_sha256":package_hashes,"publication_model":"core registry plus six dedicated domain repositories","errors":errors} +print(json.dumps(result,indent=2,sort_keys=True)); sys.exit(0 if not errors else 2)