feat: admit signed persona channel body module
This commit is contained in:
parent
bafaf464c2
commit
15b2651074
21 changed files with 2417 additions and 73 deletions
|
|
@ -6,7 +6,7 @@ const catalog = JSON.parse(readFileSync(new URL('../contracts/module-donor-admis
|
|||
const numbered = JSON.parse(readFileSync(new URL('../contracts/numbered-ipc-registry.json', import.meta.url), 'utf8'))
|
||||
|
||||
test('chaotic donors are read-only candidates and never a bulk merge source', () => {
|
||||
assert.equal(catalog.state, 'TWO_CANDIDATES_ADMITTED_REMAINING_DONORS_QUARANTINED')
|
||||
assert.equal(catalog.state, 'THREE_CANDIDATES_ADMITTED_REMAINING_DONORS_QUARANTINED')
|
||||
assert.equal(catalog.root_rule.repair_old_application_in_place, false)
|
||||
assert.equal(catalog.root_rule.bulk_merge_or_wholesale_copy_allowed, false)
|
||||
assert.equal(catalog.root_rule.one_candidate_per_admission_cycle, true)
|
||||
|
|
@ -16,8 +16,8 @@ test('chaotic donors are read-only candidates and never a bulk merge source', ()
|
|||
test('candidate coordinates are unique but are not permanent runtime module numbers', () => {
|
||||
const coordinates = catalog.candidates.map((candidate) => candidate.candidate_number)
|
||||
assert.equal(new Set(coordinates).size, coordinates.length)
|
||||
assert.equal(catalog.candidates.filter((candidate) => candidate.state.startsWith('ADMITTED')).length, 2)
|
||||
assert.ok(catalog.candidates.slice(2).every((candidate) => candidate.state.startsWith('QUARANTINED')))
|
||||
assert.equal(catalog.candidates.filter((candidate) => candidate.state.startsWith('ADMITTED')).length, 3)
|
||||
assert.ok(catalog.candidates.slice(3).every((candidate) => candidate.state.startsWith('QUARANTINED')))
|
||||
assert.equal(catalog.root_rule.candidate_number_is_runtime_module_number, false)
|
||||
assert.equal(catalog.root_rule.permanent_module_number_assignment_before_acceptance, false)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
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/persona-channel-body.json'))
|
||||
const registry = JSON.parse(read('contracts/numbered-ipc-registry.json'))
|
||||
const modulePackage = JSON.parse(read('fixtures/module-packages/HLP-MOD-LOCAL-PERSONA-CHANNEL-BODY-0001-0.1.0.ghmod'))
|
||||
const bodyRust = read('src-tauri/src/persona_channel_body.rs')
|
||||
const growthRust = read('src-tauri/src/channel_growth.rs')
|
||||
const frontend = read('src/modules/persona-channel-body/index.tsx')
|
||||
|
||||
test('persona channel body is a lifecycle container and never manufactures binding', () => {
|
||||
assert.equal(contract.runtime_module_number, 'HLP-MOD-LOCAL-PERSONA-CHANNEL-BODY-0001')
|
||||
assert.equal(contract.binding_boundary.persona_binding_claimed, false)
|
||||
assert.equal(contract.binding_boundary.persona_license_issued_by_host, false)
|
||||
assert.equal(contract.binding_boundary.registration_is_persona_binding, false)
|
||||
assert.equal(modulePackage.manifest.adapter, 'persona-channel-body-v1')
|
||||
assert.equal(modulePackage.payload.adapterConfig.personaBindingClaimed, false)
|
||||
assert.deepEqual(modulePackage.manifest.permissions, [
|
||||
'PERSONA_BODY_READ',
|
||||
'PERSONA_TRIAL_LIFECYCLE_WRITE',
|
||||
'PERSONA_LANGUAGE_CONTRACT_WRITE',
|
||||
'PERSONA_LANGUAGE_APPEND',
|
||||
'CHANNEL_GROWTH_READ',
|
||||
'CHANNEL_GROWTH_EVENT_APPEND',
|
||||
'CHANNEL_GROWTH_SHARING_WRITE',
|
||||
])
|
||||
assert.match(frontend, /本页登记生命周期,不创建人格绑定/)
|
||||
})
|
||||
|
||||
test('persona and growth operations cross only the exact numbered adapter routes', () => {
|
||||
const routes = registry.operations.filter((route) => route.module_number === 'HLP-NIPC-MOD-0023')
|
||||
assert.deepEqual(routes.map((route) => route.operation_number), [
|
||||
'HLP-NIPC-OP-0077',
|
||||
'HLP-NIPC-OP-0078',
|
||||
'HLP-NIPC-OP-0079',
|
||||
'HLP-NIPC-OP-0080',
|
||||
'HLP-NIPC-OP-0081',
|
||||
'HLP-NIPC-OP-0082',
|
||||
'HLP-NIPC-OP-0083',
|
||||
'HLP-NIPC-OP-0084',
|
||||
])
|
||||
assert.ok(routes.every((route) => route.target_number === 'HLP-NIPC-TGT-0023'))
|
||||
assert.ok(routes.every((route) => route.admission === 'VERIFIED_HUMAN_ROUTE'))
|
||||
assert.doesNotMatch(frontend, /from ['"]@tauri-apps\/api\/core['"]/)
|
||||
assert.doesNotMatch(bodyRust, /#\[tauri::command\]/)
|
||||
assert.doesNotMatch(growthRust, /#\[tauri::command\]/)
|
||||
})
|
||||
|
||||
test('language history, contract receipt and derived growth projection fail closed', () => {
|
||||
assert.match(bodyRust, /immutable_language_no_update/)
|
||||
assert.match(bodyRust, /verify_contract_receipt/)
|
||||
assert.match(bodyRust, /HOLOLAKE_PERSONA_BODY_RELATIONSHIP_INTEGRITY_FAILED/)
|
||||
assert.match(growthRust, /verify_event_chain/)
|
||||
assert.match(growthRust, /verify_and_project_affinities/)
|
||||
assert.match(growthRust, /HOLOLAKE_CHANNEL_GROWTH_PROJECTION_INTEGRITY_FAILED/)
|
||||
})
|
||||
|
|
@ -7,8 +7,8 @@ test('identity, webview and direct broker numbers compile into one unique eviden
|
|||
const generated = JSON.parse(readFileSync(new URL('../generated/unified-number-coordinate-tree.json', import.meta.url), 'utf8'))
|
||||
assert.deepEqual(generated, compileUnifiedNumberTree())
|
||||
assert.equal(generated.recordId, 'HLP-UNIFIED-NUMBER-TREE-001')
|
||||
assert.equal(generated.routeCount, 98)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 98)
|
||||
assert.equal(generated.routeCount, 106)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 106)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.ok(generated.routes.every((route) => route.admission && route.evidence))
|
||||
|
|
|
|||
Loading…
Reference in a new issue