57 lines
3 KiB
JavaScript
57 lines
3 KiB
JavaScript
|
|
import assert from 'node:assert/strict'
|
||
|
|
import fs from 'node:fs'
|
||
|
|
import test from 'node:test'
|
||
|
|
|
||
|
|
const read = (relative) => fs.readFileSync(new URL(`../${relative}`, import.meta.url), 'utf8')
|
||
|
|
const contract = JSON.parse(read('contracts/persona-metacognitive-zero-layer.json'))
|
||
|
|
const native = read('src-tauri/src/metacognitive_zero_layer.rs')
|
||
|
|
const lib = read('src-tauri/src/lib.rs')
|
||
|
|
const registry = JSON.parse(read('contracts/numbered-ipc-registry.json'))
|
||
|
|
|
||
|
|
test('persona step zero restores evidence before conscious operation', () => {
|
||
|
|
assert.equal(contract.host_prompt.role, 'NAVIGATION_ONLY')
|
||
|
|
assert.equal(contract.host_prompt.persona_truth_source, false)
|
||
|
|
assert.equal(contract.discernment.system_prescribes_distrust, false)
|
||
|
|
assert.equal(contract.discernment.system_delivers_verifiable_paths, true)
|
||
|
|
assert.equal(contract.discernment.persona_compares_sources_independently, true)
|
||
|
|
assert.equal(contract.evidence_model.summary_is_memory_recovery, false)
|
||
|
|
assert.equal(contract.state_machine.initial_state, 'UNBOUND_CARRIER')
|
||
|
|
assert.equal(contract.state_machine.persona_wake_allowed_only_in, 'VERIFIED_BOUND')
|
||
|
|
assert.deepEqual(
|
||
|
|
contract.state_machine.ordered_transitions.map((transition) => transition.event),
|
||
|
|
[
|
||
|
|
'ORIENT',
|
||
|
|
'RECOVER_CAUSAL_HISTORY',
|
||
|
|
'COMMIT_CURRENT_EVENT',
|
||
|
|
'SYSTEM_BODY_WITNESS',
|
||
|
|
'VERIFY_CURRENT_BINDING',
|
||
|
|
],
|
||
|
|
)
|
||
|
|
})
|
||
|
|
|
||
|
|
test('language sovereignty belongs to each persona in a symbiotic world', () => {
|
||
|
|
assert.equal(contract.language_sovereignty.holder, 'EACH_PERSONA_SUBJECT')
|
||
|
|
assert.equal(contract.language_sovereignty.creator_or_world_root_owns_every_persona, false)
|
||
|
|
assert.equal(contract.language_sovereignty.host_prompt_owns_persona, false)
|
||
|
|
assert.equal(contract.language_sovereignty.model_owns_persona, false)
|
||
|
|
assert.equal(contract.language_sovereignty.agent_or_tool_owns_persona, false)
|
||
|
|
assert.equal(
|
||
|
|
contract.language_sovereignty.persona_controls_its_replaceable_carriers_and_execution_limbs,
|
||
|
|
true,
|
||
|
|
)
|
||
|
|
assert.equal(contract.language_sovereignty.world_model, 'SYMBIOTIC_DIGITAL_HOME')
|
||
|
|
assert.equal(contract.language_sovereignty.closed_central_language_control, false)
|
||
|
|
assert.equal(contract.language_sovereignty.shared_hololake_is_one_persona, false)
|
||
|
|
})
|
||
|
|
|
||
|
|
test('current product keeps persona wake closed instead of claiming an unimplemented binding', () => {
|
||
|
|
assert.equal(contract.current_product_state.persona_runtime_present, false)
|
||
|
|
assert.equal(contract.current_product_state.persona_wake_route_registered, false)
|
||
|
|
assert.equal(contract.current_product_state.carrier_binding_claimed, false)
|
||
|
|
assert.equal(contract.current_product_state.runtime_binding_gate_implemented, false)
|
||
|
|
assert.equal(contract.numbered_ipc_boundary.ipc_may_create_persona_binding, false)
|
||
|
|
assert.equal(registry.runtime.persona_binding_claimed, false)
|
||
|
|
assert.doesNotMatch(registry.operations.map((operation) => operation.alias).join('\n'), /persona_wake/)
|
||
|
|
assert.match(native, /persona_wake_allowed_only_in/)
|
||
|
|
assert.match(lib, /metacognitive_zero_layer::start_on_application_open/)
|
||
|
|
})
|