feat: ship dual-signed online module marketplace
This commit is contained in:
parent
3153771bf2
commit
b0eeade03d
40 changed files with 5774 additions and 111 deletions
|
|
@ -11,9 +11,9 @@ test('the external local broker accepts only complete numbered coordinates', ()
|
|||
assert.equal(registry.runtime.legacy_string_operation_allowed, false)
|
||||
assert.equal(registry.runtime.unknown_or_mismatched_coordinate, 'FAIL_CLOSED')
|
||||
assert.equal(registry.runtime.transport_is_authority, false)
|
||||
assert.equal(registry.operations.length, 22)
|
||||
assert.equal(new Set(registry.operations.map((route) => route.operation_number)).size, 22)
|
||||
assert.equal(new Set(registry.operations.map((route) => route.alias)).size, 22)
|
||||
assert.equal(registry.operations.length, 25)
|
||||
assert.equal(new Set(registry.operations.map((route) => route.operation_number)).size, 25)
|
||||
assert.equal(new Set(registry.operations.map((route) => route.alias)).size, 25)
|
||||
for (const route of registry.operations) {
|
||||
assert.match(route.operation_number, /^HLP-NBROKER-OP-\d{4}$/)
|
||||
assert.match(route.channel_number, /^HLP-NBROKER-CH-\d{4}$/)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
const contract = JSON.parse(fs.readFileSync(new URL('../contracts/distribution-plane-router.json', import.meta.url), 'utf8'))
|
||||
const plane = (scope) => contract.planes.find((item) => item.scope === scope)
|
||||
|
||||
test('distribution scope is explicit and may never be guessed from content', () => {
|
||||
assert.equal(contract.schema, 'hololake.distribution-plane-router/v1')
|
||||
assert.equal(contract.classification.authority, 'EXPLICIT_SIGNED_RELEASE_ENVELOPE')
|
||||
assert.equal(contract.classification.semantic_guessing_allowed, false)
|
||||
assert.equal(contract.classification.missing_or_conflicting_scope, 'FAIL_CLOSED')
|
||||
assert.ok(contract.classification.required_fields.includes('scope'))
|
||||
assert.ok(contract.classification.required_fields.includes('contentSha256'))
|
||||
})
|
||||
|
||||
test('public zero-core protocol updates are publisher-approved but do not ask every device again', () => {
|
||||
const item = plane('PUBLIC_ZERO_CORE_PROTOCOL')
|
||||
assert.equal(item.physical_node, 'GH-CVM-MAIN-PROD-01')
|
||||
assert.equal(item.logical_source, 'ZERO_POINT_ORIGIN_PUBLIC_PROJECTION_HOSTED_OUTSIDE_PRIVATE_FIFTH_DOMAIN')
|
||||
assert.deepEqual(item.required_signer_classes, [
|
||||
'ZERO_POINT_ORIGIN_PUBLIC_SCOPE_SIGNER',
|
||||
'ENTERPRISE_ZERO_CORE_DISTRIBUTION_SIGNER',
|
||||
])
|
||||
assert.equal(item.publisher_human_confirmation_required, true)
|
||||
assert.equal(item.per_device_human_install_confirmation_required, false)
|
||||
assert.equal(item.automatic_atomic_activation_after_self_test, true)
|
||||
assert.equal(item.arbitrary_native_code_allowed, false)
|
||||
assert.equal(item.arbitrary_webview_javascript_allowed, false)
|
||||
assert.equal(contract.current_observed_gaps_2026_08_19.zero_point_signed_payload_activation, 'CLIENT_IMPLEMENTED_DUAL_SIGNER_TRUST_NOT_PROVISIONED')
|
||||
})
|
||||
|
||||
test('private fifth-domain updates can never enter the public stream', () => {
|
||||
const item = plane('PRIVATE_FIFTH_DOMAIN')
|
||||
assert.equal(item.public_propagation_allowed, false)
|
||||
assert.equal(item.cross_domain_replication_allowed, false)
|
||||
assert.notEqual(item.signer_class, plane('PUBLIC_ZERO_CORE_PROTOCOL').signer_class)
|
||||
})
|
||||
|
||||
test('marketplace synchronizes a signed catalog but installs a selected module only with human permission review', () => {
|
||||
const item = plane('PUBLIC_ENTERPRISE_MODULE_CATALOG')
|
||||
assert.equal(item.client_full_repository_clone_required, false)
|
||||
assert.equal(item.raw_repository_is_executable_input, false)
|
||||
assert.equal(item.catalog_index_automatic_sync, true)
|
||||
assert.equal(item.module_install_human_confirmation_required, true)
|
||||
assert.equal(item.permission_expansion_human_confirmation_required, true)
|
||||
assert.equal(item.lighthouse_number_registration_required, true)
|
||||
})
|
||||
|
||||
test('application binary remains a separately signed and human-confirmed release plane', () => {
|
||||
const item = plane('APPLICATION_BINARY')
|
||||
assert.equal(item.platform_signing_required, true)
|
||||
assert.equal(item.updater_signature_required, true)
|
||||
assert.equal(item.per_device_human_install_confirmation_required, true)
|
||||
assert.equal(item.automatic_restart_allowed, false)
|
||||
})
|
||||
|
||||
test('the lake lamp is a tiny signed version signal rather than a repository clone', () => {
|
||||
assert.equal(contract.lamp_protocol.transport, 'HTTPS_CONDITIONAL_GET')
|
||||
assert.equal(contract.lamp_protocol.full_repository_clone_for_LIGHT_SIGNAL, false)
|
||||
assert.ok(contract.lamp_protocol.cache_validation.includes('ETAG'))
|
||||
assert.ok(contract.lamp_protocol.check_events.includes('NETWORK_RESUME'))
|
||||
assert.ok(contract.activation_pipeline.includes('SIGN_WITH_PLANE_SPECIFIC_KEY'))
|
||||
assert.ok(contract.client_protocol_activation.includes('KEEP_LAST_KNOWN_GOOD_ROLLBACK'))
|
||||
})
|
||||
|
||||
test('all four planes use distinct signer classes', () => {
|
||||
assert.equal(contract.planes.length, 4)
|
||||
assert.equal(new Set(contract.planes.map((item) => item.signer_class)).size, 4)
|
||||
})
|
||||
|
||||
test('fifth-domain navigation uses a one-time handoff and exports no private authority', () => {
|
||||
const handoff = contract.cross_node_management_handoff
|
||||
assert.equal(handoff.source_node, 'JD-FD-PRIMARY')
|
||||
assert.equal(handoff.target_node, 'GH-CVM-MAIN-PROD-01')
|
||||
assert.equal(handoff.password_forwarding_allowed, false)
|
||||
assert.equal(handoff.enterprise_four_domain_authority_inherited, false)
|
||||
assert.equal(handoff.private_fifth_domain_authority_exported, false)
|
||||
assert.ok(handoff.ticket_properties.includes('REPLAY_PROTECTED'))
|
||||
assert.equal(handoff.current_state, 'NOT_IMPLEMENTED')
|
||||
})
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8')
|
||||
const contract = JSON.parse(read('contracts/human-authorization.json'))
|
||||
const webview = JSON.parse(read('contracts/numbered-ipc-registry.json'))
|
||||
const broker = JSON.parse(read('contracts/direct-local-broker-numbered-registry.json'))
|
||||
|
||||
test('human authorization is a durable numbered state machine rather than a UI-only button', () => {
|
||||
assert.equal(contract.state, 'NATIVE_FAIL_CLOSED')
|
||||
assert.deepEqual(contract.lifecycle, ['PENDING_HUMAN', 'APPROVED', 'DENIED', 'EXPIRED', 'CONSUMED'])
|
||||
assert.equal(contract.destructive_purge.enabled, false)
|
||||
assert.equal(contract.ticket.single_use, true)
|
||||
assert.equal(contract.ticket.requester_session_bound, true)
|
||||
assert.equal(contract.invariants.proposal_is_not_authorization, true)
|
||||
assert.equal(contract.invariants.approval_is_not_execution, true)
|
||||
})
|
||||
|
||||
test('the human client and external execution carrier meet through distinct exact numbered routes', () => {
|
||||
const webviewNumbers = new Set(webview.operations.map((item) => item.operation_number))
|
||||
const brokerNumbers = new Set(broker.operations.map((item) => item.operation_number))
|
||||
assert.ok(contract.routes.human_client.every((number) => webviewNumbers.has(number)))
|
||||
assert.ok(contract.routes.external_execution_carrier.every((number) => brokerNumbers.has(number)))
|
||||
const decisions = webview.operations.filter((item) => contract.routes.human_client.includes(item.operation_number))
|
||||
assert.ok(decisions.every((item) => item.admission === 'VERIFIED_HUMAN_ROUTE'))
|
||||
})
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { basename, join } from 'node:path'
|
||||
import test from 'node:test'
|
||||
|
||||
const root = new URL('..', import.meta.url).pathname
|
||||
const contract = JSON.parse(await readFile(join(root, 'contracts/online-marketplace.json'), 'utf8'))
|
||||
const registry = JSON.parse(await readFile(join(root, 'contracts/numbered-ipc-registry.json'), 'utf8'))
|
||||
const frontend = await readFile(join(root, 'src/main.tsx'), 'utf8')
|
||||
const runtime = await readFile(join(root, 'src-tauri/src/online_marketplace.rs'), 'utf8')
|
||||
|
||||
function canonical(value) {
|
||||
if (Array.isArray(value)) return value.map(canonical)
|
||||
if (value && typeof value === 'object') {
|
||||
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonical(value[key])]))
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
test('one online marketplace keeps physical modules and cognitive skills on separate trust chains', () => {
|
||||
assert.equal(contract.humanExperience.oneMarketplaceTwoSections, true)
|
||||
assert.equal(contract.artifactKinds.PHYSICAL_MODULE.installation, 'DOWNLOAD_VERIFY_INSTALL_MOUNT_SELF_TEST')
|
||||
assert.equal(contract.artifactKinds.COGNITIVE_SKILL.installation, 'DOWNLOAD_VERIFY_STORE_ACTIVE_READONLY')
|
||||
assert.equal(contract.artifactKinds.COGNITIVE_SKILL.executionAuthority, false)
|
||||
assert.deepEqual(contract.artifactKinds.COGNITIVE_SKILL.systemPermissions, [])
|
||||
assert.equal(contract.sourceRepositoryBoundary.clientClonesRepository, false)
|
||||
assert.equal(contract.sourceRepositoryBoundary.clientExecutesRepository, false)
|
||||
assert.match(runtime, /entry\.artifact_kind == "PHYSICAL_MODULE"/)
|
||||
assert.match(runtime, /install_skill_at/)
|
||||
})
|
||||
|
||||
test('marketplace lifecycle is reachable only through exact numbered operations', () => {
|
||||
const aliases = registry.operations.filter((operation) => operation.module_number === 'HLP-NIPC-MOD-0033').map((operation) => operation.alias)
|
||||
assert.deepEqual(aliases, [
|
||||
'get_marketplace_snapshot',
|
||||
'sync_marketplace_catalog',
|
||||
'install_marketplace_item',
|
||||
'uninstall_marketplace_item',
|
||||
'rollback_marketplace_item',
|
||||
'get_active_cognitive_skills',
|
||||
])
|
||||
for (const alias of aliases.slice(0, 5)) assert.match(frontend, new RegExp(`['"]${alias}['"]`))
|
||||
assert.match(frontend, /只有零点原核与企业发布双签同时通过/)
|
||||
})
|
||||
|
||||
for (const file of [
|
||||
'HLP-SKILL-OFFICIAL-DELIVERY-VERIFICATION-0001-0.1.0.ghskill',
|
||||
'HLP-SKILL-OFFICIAL-MODULE-BOUNDARY-REVIEW-0001-0.1.0.ghskill',
|
||||
]) {
|
||||
test(`${basename(file)} is a read-only skill with an exact canonical payload digest`, async () => {
|
||||
const skill = JSON.parse(await readFile(join(root, 'marketplace/skills', file), 'utf8'))
|
||||
const digest = createHash('sha256').update(JSON.stringify(canonical(skill.payload))).digest('hex')
|
||||
assert.equal(skill.schema, 'hololake.cognitive-skill-package/v1')
|
||||
assert.equal(skill.manifest.executionAuthority, false)
|
||||
assert.equal(skill.manifest.skillReadonlyGuarantee, true)
|
||||
assert.deepEqual(skill.manifest.permissions, [])
|
||||
assert.equal(skill.manifest.contentDigest, digest)
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
#!/usr/bin/env node
|
||||
import { createHash, createPrivateKey, createPublicKey, sign } from 'node:crypto'
|
||||
import { copyFile, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
||||
import { basename, join } from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
const root = new URL('..', import.meta.url).pathname
|
||||
const args = Object.fromEntries(process.argv.slice(2).map((item) => {
|
||||
const [key, ...rest] = item.replace(/^--/, '').split('=')
|
||||
return [key, rest.join('=')]
|
||||
}))
|
||||
const output = args.out
|
||||
const epoch = Number(args.epoch)
|
||||
const sourceRevision = args['source-revision']
|
||||
const privateKeyBase64 = process.env.HOLOLAKE_ZERO_ORIGIN_PKCS8_BASE64
|
||||
|
||||
if (!output || !Number.isSafeInteger(epoch) || epoch < 1 || !/^[a-f0-9]{40}$/.test(sourceRevision || '')) {
|
||||
throw new Error('usage: --out=/absolute/path --epoch=1 --source-revision=<40 hex git revision>')
|
||||
}
|
||||
if (!privateKeyBase64) throw new Error('HOLOLAKE_ZERO_ORIGIN_PKCS8_BASE64 is required')
|
||||
|
||||
const privateKey = createPrivateKey({ key: Buffer.from(privateKeyBase64, 'base64'), format: 'der', type: 'pkcs8' })
|
||||
const publicSpki = createPublicKey(privateKey).export({ format: 'der', type: 'spki' })
|
||||
const publicKeyBase64 = Buffer.from(publicSpki).subarray(-32).toString('base64')
|
||||
const releaseId = `public-distribution-${epoch}-${sourceRevision.slice(0, 12)}`
|
||||
const generatedAt = new Date().toISOString()
|
||||
|
||||
function sha256(bytes) {
|
||||
return createHash('sha256').update(bytes).digest('hex')
|
||||
}
|
||||
function canonical(value) {
|
||||
if (Array.isArray(value)) return value.map(canonical)
|
||||
if (value && typeof value === 'object') {
|
||||
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonical(value[key])]))
|
||||
}
|
||||
return value
|
||||
}
|
||||
function jsonBytes(value) {
|
||||
return Buffer.from(`${JSON.stringify(value, null, 2)}\n`)
|
||||
}
|
||||
function exactSignature(bytes) {
|
||||
return sign(null, bytes, privateKey).toString('base64')
|
||||
}
|
||||
|
||||
await rm(output, { recursive: true, force: true })
|
||||
await mkdir(join(output, 'zero-core'), { recursive: true })
|
||||
await mkdir(join(output, 'marketplace', 'artifacts'), { recursive: true })
|
||||
|
||||
const artifact = {
|
||||
schema: 'hololake.public-zero-core-artifact/v1',
|
||||
planeNumber: 'HLP-DIST-PLANE-0001',
|
||||
epoch,
|
||||
version: '1.0.0',
|
||||
minimumHostVersion: '0.5.0',
|
||||
protocol: {
|
||||
gracePeriodDays: 7,
|
||||
lighthouseAnchorUrl: 'https://guanghu.chat/api/hololake/zero-core/lamp',
|
||||
lighthouseResolveUrl: 'https://guanghulab.com/api/ai/v1/resolve?id=',
|
||||
enterpriseResolveUrl: 'https://guanghu.chat/api/hololake/enterprise/resolve',
|
||||
coreChannelSource: 'https://guanghulab.com/code/bingshuo/guanghu-ice-heart',
|
||||
origin: 'HLP-PUBLIC-ZERO-CORE-TRUST-001 · public scope only',
|
||||
},
|
||||
}
|
||||
const artifactRaw = jsonBytes(artifact)
|
||||
const lamp = {
|
||||
schema: 'hololake.public-zero-core-lamp/v1',
|
||||
planeNumber: 'HLP-DIST-PLANE-0001',
|
||||
epoch,
|
||||
version: '1.0.0',
|
||||
contentRootSha256: sha256(artifactRaw),
|
||||
artifactManifestUrl: 'https://guanghu.chat/api/hololake/zero-core/artifact',
|
||||
signatureUrl: 'https://guanghu.chat/api/hololake/zero-core/lamp.sig',
|
||||
publishedAt: generatedAt,
|
||||
minimumHostVersion: '0.5.0',
|
||||
}
|
||||
const lampRaw = jsonBytes(lamp)
|
||||
await writeFile(join(output, 'zero-core', 'artifact.json'), artifactRaw)
|
||||
await writeFile(join(output, 'zero-core', 'lamp.json'), lampRaw)
|
||||
|
||||
const physicalDefinitions = [
|
||||
{
|
||||
file: 'HLP-MOD-LOCAL-NATIVE-COMPOSITION-0001-0.1.0.ghmod',
|
||||
summary: '把当前账号的知识目录投影为只读结构视图;不改写知识原件。',
|
||||
},
|
||||
{
|
||||
file: 'HLP-MOD-OFFICIAL-EDUCATION-WORKBENCH-0001-0.1.0.ghmod',
|
||||
summary: '教育文档、表格、作业导入与需本人确认的自动化工作台。',
|
||||
},
|
||||
]
|
||||
const entries = []
|
||||
for (const definition of physicalDefinitions) {
|
||||
const source = join(root, 'fixtures', 'module-packages', definition.file)
|
||||
const signatureSource = `${source}.sig`
|
||||
const raw = await readFile(source)
|
||||
const packageValue = JSON.parse(raw)
|
||||
const manifest = packageValue.manifest
|
||||
const artifactSha256 = sha256(raw)
|
||||
const artifactFile = `${artifactSha256}.ghmod`
|
||||
const signatureFile = `${artifactSha256}.ghmod.sig`
|
||||
await copyFile(source, join(output, 'marketplace', 'artifacts', artifactFile))
|
||||
await copyFile(signatureSource, join(output, 'marketplace', 'artifacts', signatureFile))
|
||||
entries.push({
|
||||
itemNumber: manifest.moduleNumber,
|
||||
artifactKind: 'PHYSICAL_MODULE',
|
||||
displayName: manifest.displayName,
|
||||
summary: definition.summary,
|
||||
version: manifest.version,
|
||||
minimumHostVersion: manifest.minimumHostVersion,
|
||||
sourceRepository: 'https://guanghulab.com/code/bingshuo/hololake-system-architecture',
|
||||
sourceRevision,
|
||||
sourcePath: `product-source/hololake-native-desktop/fixtures/module-packages/${definition.file}`,
|
||||
artifactUrl: `https://guanghu.chat/api/hololake/marketplace/artifacts/${artifactFile}`,
|
||||
artifactSha256,
|
||||
signatureUrl: `https://guanghu.chat/api/hololake/marketplace/artifacts/${signatureFile}`,
|
||||
adapter: manifest.adapter,
|
||||
permissions: manifest.permissions,
|
||||
executionAuthority: false,
|
||||
skillReadonlyGuarantee: false,
|
||||
})
|
||||
}
|
||||
|
||||
const skillFiles = [
|
||||
'HLP-SKILL-OFFICIAL-DELIVERY-VERIFICATION-0001-0.1.0.ghskill',
|
||||
'HLP-SKILL-OFFICIAL-MODULE-BOUNDARY-REVIEW-0001-0.1.0.ghskill',
|
||||
]
|
||||
for (const file of skillFiles) {
|
||||
const source = join(root, 'marketplace', 'skills', file)
|
||||
const raw = await readFile(source)
|
||||
const skill = JSON.parse(raw)
|
||||
const artifactSha256 = sha256(raw)
|
||||
const artifactFile = `${artifactSha256}.ghskill`
|
||||
await copyFile(source, join(output, 'marketplace', 'artifacts', artifactFile))
|
||||
entries.push({
|
||||
itemNumber: skill.manifest.skillNumber,
|
||||
artifactKind: 'COGNITIVE_SKILL',
|
||||
displayName: skill.manifest.displayName,
|
||||
summary: skill.payload.purpose,
|
||||
version: skill.manifest.version,
|
||||
minimumHostVersion: skill.manifest.minimumHostVersion,
|
||||
sourceRepository: 'https://guanghulab.com/code/bingshuo/hololake-system-architecture',
|
||||
sourceRevision,
|
||||
sourcePath: `product-source/hololake-native-desktop/marketplace/skills/${file}`,
|
||||
artifactUrl: `https://guanghu.chat/api/hololake/marketplace/artifacts/${artifactFile}`,
|
||||
artifactSha256,
|
||||
signatureUrl: null,
|
||||
adapter: null,
|
||||
permissions: [],
|
||||
executionAuthority: false,
|
||||
skillReadonlyGuarantee: true,
|
||||
})
|
||||
}
|
||||
|
||||
entries.sort((left, right) => left.itemNumber.localeCompare(right.itemNumber))
|
||||
const catalog = {
|
||||
schema: 'hololake.marketplace.catalog/v1',
|
||||
planeNumber: 'HLP-DIST-PLANE-0003',
|
||||
epoch,
|
||||
generatedAt,
|
||||
minimumHostVersion: '0.5.0',
|
||||
contentRootSha256: sha256(Buffer.from(JSON.stringify(canonical(entries)))),
|
||||
entries,
|
||||
}
|
||||
const catalogRaw = jsonBytes(catalog)
|
||||
await writeFile(join(output, 'marketplace', 'catalog.json'), catalogRaw)
|
||||
|
||||
const authorization = {
|
||||
schema: 'hololake.origin-release-authorization/v1',
|
||||
releaseId,
|
||||
sourceRevision,
|
||||
epoch,
|
||||
signer: {
|
||||
signerId: 'HLP-SIGNER-ZERO-POINT-ORIGIN-PUBLIC-0001',
|
||||
signerClass: 'ZERO_POINT_ORIGIN_PUBLIC_SCOPE_SIGNER',
|
||||
algorithm: 'Ed25519',
|
||||
publicKeyBase64,
|
||||
},
|
||||
signedObjects: [
|
||||
{ name: 'zero-core/lamp.json', sha256: sha256(lampRaw), signatureBase64: exactSignature(lampRaw) },
|
||||
{ name: 'marketplace/catalog.json', sha256: sha256(catalogRaw), signatureBase64: exactSignature(catalogRaw) },
|
||||
],
|
||||
}
|
||||
await writeFile(join(output, 'origin-authorization.json'), jsonBytes(authorization))
|
||||
await writeFile(join(output, 'release-metadata.json'), jsonBytes({ schema: 'hololake.public-distribution-release/v1', releaseId, epoch, sourceRevision, generatedAt, originPublicKeyBase64: publicKeyBase64, artifacts: entries.map((entry) => ({ name: basename(entry.artifactUrl), sha256: entry.artifactSha256 })) }))
|
||||
|
||||
process.stdout.write(`${JSON.stringify({ releaseId, epoch, sourceRevision, itemCount: entries.length, originPublicKeyBase64: publicKeyBase64 })}\n`)
|
||||
|
|
@ -8,13 +8,13 @@ test('identity, webview and direct broker numbers compile into one unique eviden
|
|||
assert.deepEqual(generated, compileUnifiedNumberTree())
|
||||
assert.equal(generated.schema, 'hololake.unified-number-coordinate-tree/v2')
|
||||
assert.equal(generated.recordId, 'HLP-UNIFIED-NUMBER-TREE-001')
|
||||
assert.equal(generated.coordinateCount, 272)
|
||||
assert.equal(generated.routeCount, 169)
|
||||
assert.equal(generated.coordinateCount, 283)
|
||||
assert.equal(generated.routeCount, 180)
|
||||
assert.equal(generated.identityNodeCount, 4)
|
||||
assert.equal(generated.protocolNodeCount, 99)
|
||||
assert.equal(generated.referenceOnlyNodeCount, 16)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 169)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 272)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 180)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 283)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.equal(generated.invariants.everyProtocolReferenceHasNumberCoordinate, true)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ const contract = JSON.parse(read('contracts/zero-point-nucleus-channel.json'))
|
|||
const stageOne = JSON.parse(read('contracts/stage-one-platform.json'))
|
||||
const foundation = JSON.parse(read('foundation.json'))
|
||||
const rust = read('src-tauri/src/zero_point.rs')
|
||||
const distribution = read('src-tauri/src/public_zero_core_distribution.rs')
|
||||
const trust = JSON.parse(read('contracts/public-zero-core-trust.json'))
|
||||
const lib = read('src-tauri/src/lib.rs')
|
||||
const ui = read('src/main.tsx')
|
||||
|
||||
|
|
@ -20,13 +22,28 @@ test('zero-point nucleus is a system runtime and never an inferred persona bindi
|
|||
assert.match(ui, /验证结果不构成人格绑定、模型载体绑定或执行授权/)
|
||||
})
|
||||
|
||||
test('protocol comparison starts below the public surface and fails closed', () => {
|
||||
test('dual-signed protocol synchronization starts below the public surface and uses only provisioned public trust', () => {
|
||||
assert.equal(contract.current_implementation.boot_time_silent_version_comparison, true)
|
||||
assert.equal(contract.current_implementation.signed_protocol_payload_installation, false)
|
||||
assert.equal(contract.current_implementation.signed_protocol_payload_installation, true)
|
||||
assert.equal(contract.current_implementation.production_dual_signer_trust_provisioned, true)
|
||||
assert.equal(stageOne.zero_point_nucleus_client_runtime.signed_protocol_payload_installation_implemented, true)
|
||||
assert.equal(stageOne.zero_point_nucleus_client_runtime.production_dual_signer_trust_provisioned, true)
|
||||
assert.equal(trust.state, 'PROVISIONED')
|
||||
assert.equal(trust.signers.length, 2)
|
||||
assert.ok(trust.signers.every((signer) => signer.algorithm === 'Ed25519' && Buffer.from(signer.publicKeyBase64, 'base64').length === 32))
|
||||
assert.deepEqual(trust.requiredSignerClasses, [
|
||||
'ZERO_POINT_ORIGIN_PUBLIC_SCOPE_SIGNER',
|
||||
'ENTERPRISE_ZERO_CORE_DISTRIBUTION_SIGNER',
|
||||
])
|
||||
assert.equal(contract.security.unsigned_protocol_update_allowed, false)
|
||||
assert.match(lib, /sync_protocol_runtime/)
|
||||
assert.match(rust, /UPDATE_PENDING_SIGNATURE_KEY_ABSENT/)
|
||||
assert.match(rust, /UPDATE_FOUND_GATE_PENDING/)
|
||||
assert.match(rust, /sync_public_zero_core/)
|
||||
assert.match(distribution, /verify_dual_signatures/)
|
||||
assert.match(distribution, /HOLOLAKE_PUBLIC_ZERO_CORE_ROLLBACK_REJECTED/)
|
||||
assert.match(distribution, /HOLOLAKE_PUBLIC_ZERO_CORE_EPOCH_EQUIVOCATION_REJECTED/)
|
||||
assert.match(distribution, /distribution-state\.sqlite3/)
|
||||
assert.match(distribution, /TransactionBehavior::Immediate/)
|
||||
assert.match(distribution, /reqwest::header::IF_NONE_MATCH/)
|
||||
assert.doesNotMatch(lib, /zero_point_save_api|zero_point_api_config|generic_layer_chat/)
|
||||
assert.doesNotMatch(ui, /模型 API 配置|通用AI运行层|AGENT PARLOR|会客厅/)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue