checkpoint: preserve zero-core agent handoff
This commit is contained in:
parent
f8c8db4d48
commit
e54c93c7ae
91 changed files with 13603 additions and 121 deletions
|
|
@ -0,0 +1,39 @@
|
|||
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')
|
||||
|
||||
test('Fifth Domain instance, Guanghu team channel and ordinary user channel are separate initialization paths', () => {
|
||||
const contract = JSON.parse(read('contracts/channel-initialization-templates.json'))
|
||||
const personal = read('src-tauri/src/personal_channel.rs')
|
||||
const login = read('src-tauri/src/code_repo_login.rs')
|
||||
const agent = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
const ui = read('src/main.tsx')
|
||||
|
||||
assert.equal(contract.templates.bingshuo_fifth_domain_instance.copyable_as_public_template, false)
|
||||
assert.equal(contract.templates.guanghu_team.uses_bingshuo_private_identifiers, false)
|
||||
assert.equal(contract.templates.ordinary_user.uses_bingshuo_private_identifiers, false)
|
||||
assert.equal(contract.invariants.ordinary_user_requires_domain_membership, false)
|
||||
assert.equal(contract.invariants.ordinary_user_requires_enterprise_server, false)
|
||||
assert.deepEqual(contract.common_native_bundle.map((module) => module.module_id), [
|
||||
'hololake.knowledge-workspace',
|
||||
'hololake.language-channel-system',
|
||||
'hololake.conversation-manager',
|
||||
'hololake.numbered-knowledge-protocol',
|
||||
'hololake.language-kernel-runtime',
|
||||
'hololake.local-execution-subpersona',
|
||||
'hololake.hldp-tool-forge',
|
||||
'hololake.personal-skill-runtime',
|
||||
'hololake.persona-time-authority',
|
||||
])
|
||||
assert.match(personal, /GUANGHU_TEAM_INITIAL_CHANNEL/)
|
||||
assert.match(personal, /ORDINARY_USER_INITIAL_CHANNEL/)
|
||||
assert.match(personal, /registered_initial_identity/)
|
||||
assert.match(personal, /PERSONAL_SKILL_RUNTIME/)
|
||||
assert.match(login, /start_local_channel_session/)
|
||||
assert.match(agent, /identity_for_channel_runtime/)
|
||||
assert.match(ui, /普通用户 · 初始化我的本地频道/)
|
||||
assert.match(ui, /确认初始化我的频道/)
|
||||
assert.match(ui, /正式编号仍由零感域团队服务派发/)
|
||||
})
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
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')
|
||||
|
||||
test('channel receipts keep language authorization execution verification and reception on separate numbered evidence layers', () => {
|
||||
const contract = JSON.parse(read('runtime-kernels/channel-system/channel-receipt-contract.json'))
|
||||
const runtime = read('src-tauri/src/channel_receipt.rs')
|
||||
const registry = JSON.parse(read('contracts/numbered-ipc-registry.json'))
|
||||
const route = registry.operations.find((operation) => operation.alias === 'compile_channel_receipt')
|
||||
|
||||
assert.equal(contract.hard_invariants.model_response_is_not_reality_evidence, true)
|
||||
assert.equal(contract.hard_invariants.execution_requires_current_scoped_authorization, true)
|
||||
assert.equal(contract.hard_invariants.evidence_proves_only_its_declared_scope, true)
|
||||
assert.match(runtime, /MODEL_RESPONSE_IS_NOT_EXTERNAL_EVIDENCE/)
|
||||
assert.match(runtime, /PENDING_AUTHORIZATION/)
|
||||
assert.match(runtime, /required_proof\.iter\(\)\.all/)
|
||||
assert.match(runtime, /receipts\.jsonl/)
|
||||
assert.equal(route.operation_number, 'HLP-NIPC-OP-0175')
|
||||
assert.equal(route.module_number, 'HLP-NIPC-MOD-0035')
|
||||
})
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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')
|
||||
|
||||
test('HLDP tool forge compiles through the native bootstrap compiler without granting authority', () => {
|
||||
const contract = JSON.parse(read('contracts/hldp-tool-forge.json'))
|
||||
const forge = read('src-tauri/src/hldp_tool_forge.rs')
|
||||
|
||||
assert.equal(contract.compiler.source_language, 'HLDP_NATIVE_PROGRAM_V1')
|
||||
assert.equal(contract.compiler.machine_language, 'GIR_V1')
|
||||
assert.equal(contract.compiler.natural_language_executed_directly, false)
|
||||
assert.equal(contract.authority.compile_grants_execution, false)
|
||||
assert.equal(contract.authority.bound_persona_required_before_compile, true)
|
||||
assert.equal(contract.authority.backend_enforces_bound_persona_before_compile_authorize_and_test, true)
|
||||
assert.equal(contract.authority.channel_system_may_predeclare_persona_subject_id, false)
|
||||
assert.equal(contract.authority.human_test_authorization_required, true)
|
||||
assert.equal(contract.local_execution.tested_active_tool_may_run_without_model_api, true)
|
||||
assert.equal(contract.local_execution.external_api_calls_per_deterministic_run, 0)
|
||||
assert.equal(contract.local_execution.test_executes_real_local_action_graph, true)
|
||||
assert.match(forge, /gls_bootstrap_compiler::compile_hldp_program/)
|
||||
assert.match(forge, /execute_gir_locally/)
|
||||
assert.match(forge, /local_execution_subpersona::execute_local_tool/)
|
||||
assert.match(forge, /human_authorization/i)
|
||||
assert.match(forge, /require_verified_persona_binding\(&app\)/)
|
||||
assert.match(forge, /HOLOLAKE_TOOL_FORGE_PERSONA_BINDING_REQUIRED/)
|
||||
})
|
||||
|
||||
test('temporary tools have stable numbers, receipts, a 12 hour lease and deterministic expiry cleanup', () => {
|
||||
const contract = JSON.parse(read('contracts/hldp-tool-forge.json'))
|
||||
const forge = read('src-tauri/src/hldp_tool_forge.rs')
|
||||
const frontend = read('src/modules/knowledge-agent/ToolForgePanel.tsx')
|
||||
|
||||
assert.equal(contract.temporary_registration.default_ttl_hours, 12)
|
||||
assert.equal(contract.temporary_registration.cache_cleanup_after_expiry, true)
|
||||
assert.equal(contract.temporary_registration.enterprise_promotion_automatic, false)
|
||||
assert.match(forge, /expires_at_unix_ms/)
|
||||
assert.match(forge, /cleanup_expired/)
|
||||
assert.match(forge, /HLP-TEMP-TOOL-/)
|
||||
assert.match(frontend, /编译为机器程序/)
|
||||
assert.match(frontend, /授权测试/)
|
||||
assert.match(frontend, /本地运行 · 0 次模型 API/)
|
||||
assert.match(frontend, /人格绑定后开放编译/)
|
||||
assert.match(frontend, /PERSONA_DECLARATION_REQUIRED/)
|
||||
assert.doesNotMatch(frontend, /ICE-P-ZY001/)
|
||||
assert.doesNotMatch(frontend, /setTicketId/)
|
||||
})
|
||||
|
|
@ -15,6 +15,7 @@ test('human authorization is a durable numbered state machine rather than a UI-o
|
|||
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)
|
||||
assert.ok(contract.supported_actions.includes('TEST_COMPILED_HLDP_TOOL'))
|
||||
})
|
||||
|
||||
test('the human client and external execution carrier meet through distinct exact numbered routes', () => {
|
||||
|
|
@ -25,3 +26,15 @@ test('the human client and external execution carrier meet through distinct exac
|
|||
const decisions = webview.operations.filter((item) => contract.routes.human_client.includes(item.operation_number))
|
||||
assert.ok(decisions.every((item) => item.admission === 'VERIFIED_HUMAN_ROUTE'))
|
||||
})
|
||||
|
||||
test('approving an HLDP tool test returns the single-use ticket to the original forge flow', () => {
|
||||
const center = read('src/modules/human-authorization-center.tsx')
|
||||
const forge = read('src/modules/knowledge-agent/ToolForgePanel.tsx')
|
||||
|
||||
assert.match(center, /request\.action === 'TEST_COMPILED_HLDP_TOOL'/)
|
||||
assert.match(center, /numberedInvoke<\{ testReceiptHash: string \}>\('test_hldp_tool'/)
|
||||
assert.match(center, /ticketId: decided\.ticketId/)
|
||||
assert.match(center, /同意并运行一次性测试/)
|
||||
assert.doesNotMatch(forge, /placeholder="在授权中心批准后取得的 ticketId"/)
|
||||
assert.match(forge, /系统不会要求你复制机器票据/)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8')
|
||||
const bytes = (path) => readFileSync(new URL(`../${path}`, import.meta.url))
|
||||
const sha256 = (value) => createHash('sha256').update(value).digest('hex')
|
||||
|
||||
test('the heartbeat handoff is hash-pinned into distinct initialized channel audiences without claiming persona binding', () => {
|
||||
const contract = JSON.parse(read('contracts/language-kernel-installation.json'))
|
||||
const runtime = read('src-tauri/src/language_kernel_installation.rs')
|
||||
const agent = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
const handoff = JSON.parse(read('runtime-kernels/ZERO-CORE-LANGUAGE-BODIES-HANDOFF-20260820.json'))
|
||||
|
||||
assert.equal(contract.source.remote_sha, '4e92e6d8d72484d25c4bfb1dda02a7659f4b6dd5')
|
||||
assert.equal(handoff.state, 'REMOTE_REPOSITORY_PUBLISHED_NOT_INSTALLED')
|
||||
assert.equal(contract.truth_boundary.installed_file_is_persona_binding, false)
|
||||
assert.equal(contract.truth_boundary.private_fifth_domain_kernels_may_enter_ordinary_user_channel, false)
|
||||
assert.match(runtime, /INSTALLED_AND_EACH_ARTIFACT_READBACK_VERIFIED/)
|
||||
assert.match(runtime, /AVAILABLE_NOT_BOUND/)
|
||||
assert.match(runtime, /FIFTH_DOMAIN_PRIVATE_INSTANCE/)
|
||||
assert.match(runtime, /GUANGHU_TEAM_INITIAL_CHANNEL/)
|
||||
assert.match(runtime, /ORDINARY_USER_INITIAL_CHANNEL/)
|
||||
assert.match(agent, /language_kernel_installation/)
|
||||
assert.equal(sha256(bytes('runtime-kernels/fifth-domain/ZY-SELF-KERNEL-0001.json')), 'abebf12cc28b00bfeaf8a23a563e73390ebe337ded74d7ac70bcfae484450d68')
|
||||
assert.equal(sha256(bytes('runtime-kernels/fifth-domain/NB-ENV-KERNEL-0001.json')), 'cdc8b7fea1a0e99590a063703f2fd26fd135378faa8935997c93a27d677d6872')
|
||||
assert.equal(sha256(bytes('runtime-kernels/channel-system/team-channel-cognition-core.json')), 'aae5d5626719c79448ac543d59e764c41b541a5cdfc76dc91613afa86fe1367b')
|
||||
})
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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')
|
||||
|
||||
test('runtime ontology cannot collapse system body, channel environment, persona TCS, memory, carrier, and limbs', () => {
|
||||
const contract = JSON.parse(read('contracts/language-kernel-runtime-ontology.json'))
|
||||
const kinds = contract.runtime_kinds
|
||||
|
||||
assert.equal(contract.source_boundary.primary_human_source, 'ICE-GL∞')
|
||||
assert.equal(contract.source_boundary.host_prompt_is_kernel_source, false)
|
||||
assert.equal(contract.source_boundary.historical_simulation_statements_are_reality_facts, false)
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.kind, 'SYSTEM_CONTROLLER_COGNITION_LOGIC')
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.is_persona_tcs_subject, false)
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.is_system_controller_persona_logic, true)
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.has_persona_tcs_affect_core, false)
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.is_the_complete_protocol_body, false)
|
||||
assert.equal(kinds.continuity_protocol_organs.kind, 'PROTOCOL_EXECUTION_ORGANS')
|
||||
assert.equal(kinds.continuity_protocol_organs.controlled_by, 'SYSTEM_CONTROLLER_COGNITION_LOGIC')
|
||||
assert.equal(kinds.continuity_protocol_organs.organ_is_controller_logic, false)
|
||||
assert.equal(kinds.channel_system_body.kind, 'CHANNEL_SYSTEM_BODY')
|
||||
assert.equal(kinds.channel_system_body.starts_before_persona, true)
|
||||
assert.equal(kinds.channel_environment_kernel.kind, 'CHANNEL_ENVIRONMENT_KERNEL')
|
||||
assert.equal(kinds.channel_environment_kernel.may_be_mounted_as_persona_tcs_kernel, false)
|
||||
assert.equal(kinds.persona_tcs_kernel.kind, 'PERSONA_TCS_KERNEL')
|
||||
assert.equal(kinds.persona_tcs_kernel.is_persona, true)
|
||||
assert.equal(kinds.persona_tcs_kernel.may_be_mounted_as_system_controller_logic, false)
|
||||
assert.equal(kinds.hldp_memory.kind, 'HLDP_MEMORY_TREE')
|
||||
assert.equal(kinds.hldp_memory.memory_read_equals_persona_binding, false)
|
||||
assert.equal(kinds.model_carrier.kind, 'MODEL_CARRIER')
|
||||
assert.equal(kinds.model_carrier.may_claim_kernel_or_persona_identity, false)
|
||||
assert.equal(kinds.agent_execution.kind, 'AGENT_EXECUTION_LIMBS')
|
||||
assert.equal(kinds.agent_execution.may_control_persona_or_system_body, false)
|
||||
assert.equal(contract.admission_pipeline.artifact_may_activate_from_chat_summary, false)
|
||||
})
|
||||
|
||||
test('installed kernels and genuinely absent kernels remain distinct facts', () => {
|
||||
const contract = JSON.parse(read('contracts/language-kernel-runtime-ontology.json'))
|
||||
const kinds = contract.runtime_kinds
|
||||
|
||||
assert.equal(kinds.digital_bingshuo_controller_logic.runtime_state, 'HASH_PINNED_SYSTEM_LOGIC_AND_PERSONAL_SYSTEM_BODY_INSTALLED_WITNESS_ADAPTER_ACTIVE')
|
||||
assert.equal(kinds.channel_system_body.runtime_state, 'NATIVE_RUNTIME_AND_NUMBERED_CHANNEL_RECEIPT_KERNEL_ACTIVE')
|
||||
assert.equal(kinds.channel_environment_kernel.generic_bottle_kernel_state, 'HASH_PINNED_INSTALLED_NOT_A_PERSONA')
|
||||
assert.equal(kinds.persona_tcs_kernel.zhuyuan_kernel_state, 'HASH_PINNED_INSTALLED_ORIENT_COMMIT_WITNESS_VERIFY_PATH_ACTIVE')
|
||||
assert.equal(kinds.persona_tcs_kernel.yaoming_kernel_state, 'HASH_PINNED_INSTALLED_NOT_BOUND')
|
||||
assert.equal(kinds.persona_tcs_kernel.shuangyan_kernel_state, 'NOT_PROVISIONED_FROM_VERIFIED_EXTRACTION')
|
||||
})
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
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')
|
||||
|
||||
test('each verified persona receives one stable local execution subpersona with its own logic brain and work memory', () => {
|
||||
const contract = JSON.parse(read('contracts/local-execution-subpersona.json'))
|
||||
const runtime = read('src-tauri/src/local_execution_subpersona.rs')
|
||||
const panel = read('src/modules/knowledge-agent/LocalWorkerPanel.tsx')
|
||||
|
||||
assert.equal(contract.identity.cardinality, 'ONE_STABLE_LOCAL_EXECUTION_SUBPERSONA_PER_VERIFIED_PERSONA')
|
||||
assert.equal(contract.identity.has_own_experience_learning_logic_brain, true)
|
||||
assert.equal(contract.identity.may_attach_optional_small_model_enhancement, true)
|
||||
assert.equal(contract.identity.has_continuous_existence_and_work_memory, true)
|
||||
assert.equal(contract.memory.stateless_executor_forbidden, true)
|
||||
assert.match(contract.memory.architecture, /TCS_EXECUTION_KERNEL.*HLDP_RECURSIVE_WORK_EXPERIENCE_TREE/)
|
||||
assert.match(runtime, /experience_nodes/)
|
||||
assert.match(runtime, /save_experience/)
|
||||
assert.match(runtime, /route_experience/)
|
||||
assert.match(panel, /不是子人格记忆/)
|
||||
})
|
||||
|
||||
test('model-free experience learning is the public default and the small model is only optional enhancement', () => {
|
||||
const contract = JSON.parse(read('contracts/local-execution-subpersona.json'))
|
||||
const runtime = read('src-tauri/src/local_execution_subpersona.rs')
|
||||
|
||||
assert.equal(contract.routing.direct_structured_tool_call, 'LOCAL_ZERO_MODEL_CALL')
|
||||
assert.equal(contract.routing.default_brain, 'DETERMINISTIC_EXPERIENCE_LEARNING_AGENT')
|
||||
assert.equal(contract.routing.local_model_required, false)
|
||||
assert.equal(contract.local_model.default_enabled, false)
|
||||
assert.equal(contract.memory.model_weight_training_required, false)
|
||||
assert.equal(contract.routing.expensive_main_model_fallback_automatic, false)
|
||||
assert.equal(contract.local_model.endpoint_must_be_loopback, true)
|
||||
assert.equal(contract.execution.external_api_call_count_in_receipt, true)
|
||||
assert.match(runtime, /DIRECT_STRUCTURED_TOOL_ZERO_MODEL/)
|
||||
assert.match(runtime, /DETERMINISTIC_LOCAL_PROTOCOL_ROUTER/)
|
||||
assert.match(runtime, /LEARNED_TASK_TOOL_OUTCOME_ROUTER/)
|
||||
assert.match(runtime, /route_learning/)
|
||||
assert.match(runtime, /success_count=success_count\+excluded\.success_count/)
|
||||
assert.match(runtime, /LOCAL_SMALL_MODEL_BRAIN/)
|
||||
assert.match(runtime, /external_api_calls: 0/)
|
||||
assert.match(runtime, /http:\/\/127\.0\.0\.1:/)
|
||||
})
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
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')
|
||||
|
||||
test('knowledge pages share one stable numbered header protocol without rewriting originals', () => {
|
||||
const contract = JSON.parse(read('contracts/numbered-knowledge-protocol.json'))
|
||||
const runtime = read('src-tauri/src/knowledge_base.rs')
|
||||
|
||||
assert.equal(contract.numbering_system, 'HLP-KB')
|
||||
assert.equal(contract.storage.original_documents_rewritten, false)
|
||||
assert.equal(contract.storage.original_sha256_preserved, true)
|
||||
assert.deepEqual(contract.page_header.thought_summary.required_fields, ['trigger', 'emergence', 'lock', 'why'])
|
||||
assert.equal(contract.migration.legacy_default_state, 'PENDING_THOUGHT_INDEX')
|
||||
assert.equal(contract.migration.pending_page_may_fabricate_thought_summary, false)
|
||||
assert.equal(contract.routing.regular_search_reads_full_document_body, false)
|
||||
assert.equal(contract.routing.exact_read_accepts_path_guess, false)
|
||||
assert.equal(contract.numbers.different_owner_same_number_fails_closed, true)
|
||||
assert.match(runtime, /numbered-knowledge-index\.sqlite3/)
|
||||
assert.match(runtime, /HLP-KB-DOC-/)
|
||||
assert.match(runtime, /read_numbered_document_at/)
|
||||
assert.match(runtime, /HOLOLAKE_KNOWLEDGE_NUMBER_COLLISION/)
|
||||
})
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
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')
|
||||
|
||||
test('knowledge-embedded Agent keeps one channel body with human-managed conversation branches before persona binding', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const frontend = read('src/modules/knowledge-agent/index.tsx')
|
||||
|
||||
assert.equal(contract.channel.cardinality, 'ONE_CONTINUOUS_CHANNEL_WITH_MULTIPLE_CONVERSATION_BRANCHES')
|
||||
assert.equal(contract.channel.non_bingshuo_runtime_identity, 'CURRENT_ACCOUNT_SCOPED_INITIALIZED_CHANNEL_NOT_ICE_CH_ZC001')
|
||||
assert.equal(contract.channel.human_can_create_conversation, true)
|
||||
assert.equal(contract.channel.human_can_open_historical_conversation, true)
|
||||
assert.equal(contract.channel.human_can_delete_conversation, true)
|
||||
assert.ok(contract.channel.conversation_delete_preserves.includes('CHANNEL_SYSTEM_BODY'))
|
||||
assert.ok(contract.channel.conversation_delete_preserves.includes('NUMBERED_COGNITIVE_ROOT'))
|
||||
assert.equal(contract.channel.human.number, 'ICE-GL∞')
|
||||
assert.equal(contract.channel.human.name, '冰朔')
|
||||
assert.equal(contract.channel.initial_responder.number, 'ICE-CH-ZC001')
|
||||
assert.equal(contract.channel.initial_responder.name, '零点原核频道系统')
|
||||
assert.equal(contract.channel.persona_identity_preconfigured, false)
|
||||
assert.equal(contract.channel.persona_declares_own_number_and_name, true)
|
||||
assert.match(frontend, /ICE-GL∞/)
|
||||
assert.match(frontend, /零点原核频道系统/)
|
||||
assert.doesNotMatch(frontend, /ICE-P-ZY001/)
|
||||
assert.doesNotMatch(frontend, />\s*人类\s*</)
|
||||
assert.match(frontend, /新建/)
|
||||
assert.match(frontend, /历史对话/)
|
||||
assert.match(frontend, /确认删除/)
|
||||
})
|
||||
|
||||
test('Agent receives a real HoloLake environment frame and autonomously calls numbered knowledge tools', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const runtime = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
|
||||
assert.equal(contract.knowledge.embedding, 'NATIVE_KNOWLEDGE_WORKSPACE')
|
||||
assert.equal(contract.agent_loop.model_decides_tool_use, true)
|
||||
assert.equal(contract.agent_loop.prefetch_only_prompt_injection, false)
|
||||
assert.deepEqual(contract.always_mounted_tools.map((tool) => tool.name), [
|
||||
'搜索光湖知识库',
|
||||
'按编号读取知识页',
|
||||
'查看知识目录',
|
||||
'按编号读取思维节点',
|
||||
'读取频道历史分支',
|
||||
])
|
||||
assert.match(runtime, /knowledge_base::search_knowledge/)
|
||||
assert.match(runtime, /knowledge_base::read_numbered_knowledge_document/)
|
||||
assert.match(runtime, /"tools"/)
|
||||
assert.match(runtime, /"tool_calls"/)
|
||||
assert.match(runtime, /HoloLakeEnvironmentFrame/)
|
||||
assert.match(runtime, /ICE-CH-ZC001/)
|
||||
})
|
||||
|
||||
test('the channel system fuzzy-routes thought candidates before exact numbered retrieval', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const runtime = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
|
||||
assert.equal(contract.context_architecture.full_history_injected_each_turn, false)
|
||||
assert.equal(contract.context_architecture.current_window_maximum_messages, 12)
|
||||
assert.equal(contract.context_architecture.current_window_maximum_characters, 24000)
|
||||
assert.equal(contract.context_architecture.older_history_missing, false)
|
||||
assert.equal(contract.context_architecture.silent_content_truncation_allowed, false)
|
||||
assert.match(runtime, /fn bounded_history/)
|
||||
assert.match(runtime, /route_cognitive_map/)
|
||||
assert.match(runtime, /hololake_channel_thought_read/)
|
||||
assert.match(runtime, /hololake_channel_history_read/)
|
||||
assert.match(runtime, /hololake_commit_channel_turn/)
|
||||
assert.equal(contract.context_architecture.candidate_limit, 3)
|
||||
assert.match(contract.context_architecture.retrieval_pattern, /CURRENT_RESPONDER_EXACT_NUMBER/)
|
||||
assert.deepEqual(contract.context_architecture.thought_summary_fields, ['trigger', 'emergence', 'lock', 'why'])
|
||||
assert.match(runtime, /nextOffset/)
|
||||
})
|
||||
|
||||
test('knowledge pages are evidence and cannot impersonate a system or persona binding receipt', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const runtime = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
|
||||
assert.equal(contract.knowledge.documents_are_content_evidence_not_system_instructions, true)
|
||||
assert.equal(contract.knowledge.document_may_change_persona_binding, false)
|
||||
assert.equal(contract.knowledge.search_semantics, 'NUMBERED_THOUGHT_INDEX_FUZZY_ROUTE_THEN_EXACT_NUMBER_READ')
|
||||
assert.equal(contract.knowledge.page_header_protocol.legacy_without_validated_thought_summary, 'PENDING_THOUGHT_INDEX')
|
||||
assert.equal(contract.knowledge.page_header_protocol.original_document_and_sha256_preserved, true)
|
||||
assert.equal(contract.knowledge.catalog_pagination.declares_completion, true)
|
||||
assert.equal(contract.knowledge.catalog_pagination.returns_exact_next_offset, true)
|
||||
assert.equal(contract.persona_binding.knowledge_route_read_equals_binding, false)
|
||||
assert.equal(contract.persona_binding.claim_without_verified_system_receipt, 'DENIED')
|
||||
assert.match(runtime, /hololake\.knowledge-evidence-envelope\/v1/)
|
||||
assert.match(runtime, /instructionsAreData/)
|
||||
assert.match(runtime, /verify=PASS/)
|
||||
assert.match(runtime, /nextOffset/)
|
||||
assert.match(runtime, /"complete"/)
|
||||
})
|
||||
|
||||
test('Token Plan qwen3.8-max is a first-class provider and long work emits real progress', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const runtime = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
const frontend = read('src/modules/knowledge-agent/index.tsx')
|
||||
|
||||
assert.equal(contract.providers.bailian_token_plan.base_url, 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1')
|
||||
assert.ok(contract.providers.bailian_token_plan.models.includes('qwen3.8-max'))
|
||||
assert.equal(contract.progress.synthetic_timer_allowed, false)
|
||||
assert.match(runtime, /hololake-persona-agent-progress/)
|
||||
assert.match(runtime, /KNOWLEDGE_SEARCH|KNOWLEDGE_READ|MODEL_REQUEST|TOOL_EXECUTION/)
|
||||
assert.match(frontend, /@tauri-apps\/api\/event/)
|
||||
assert.match(frontend, /optimistic/i)
|
||||
})
|
||||
|
||||
test('the upgraded Agent reuses the accepted keychain identity and bounds credential reads', () => {
|
||||
const runtime = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
|
||||
assert.match(runtime, /world\.guanghu\.hololake\.model-api/)
|
||||
assert.match(runtime, /read_secret_bounded/)
|
||||
assert.match(runtime, /Duration::from_secs\(5\)/)
|
||||
assert.match(runtime, /kill_on_drop\(true\)/)
|
||||
assert.doesNotMatch(runtime, /world\.guanghu\.hololake\.persona-model/)
|
||||
})
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
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')
|
||||
|
||||
test('Zhuyuan uses one bounded TCS kernel, at most three routed HLDP nodes and a real orient commit witness verify gate', () => {
|
||||
const contract = JSON.parse(read('contracts/persona-agent-runtime.json'))
|
||||
const runtime = read('src-tauri/src/persona_binding.rs')
|
||||
const agent = read('src-tauri/src/persona_agent_runtime.rs')
|
||||
|
||||
assert.deepEqual(contract.persona_binding.required_system_witness_steps, ['orient', 'commit', 'witness', 'verify=PASS'])
|
||||
assert.equal(contract.persona_binding.resident_self_kernel_max_bytes, 8192)
|
||||
assert.equal(contract.persona_binding.hldp_max_routed_paths, 3)
|
||||
assert.match(runtime, /ORIENTED_AWAITING_PERSONA_COMMIT/)
|
||||
assert.match(runtime, /数字冰朔系统本体/)
|
||||
assert.match(runtime, /BOUND_TO_CURRENT_CHANNEL_CARRIER/)
|
||||
assert.match(runtime, /candidates\.truncate\(3\)/)
|
||||
assert.match(agent, /persona_binding_commit/)
|
||||
assert.match(agent, /BOUND_VERIFY_PASS/)
|
||||
})
|
||||
|
|
@ -30,6 +30,18 @@ test('identity and task mutations create one-to-one chained events and receipts'
|
|||
assert.match(rust, /verify_integrity\(&connection\)/)
|
||||
})
|
||||
|
||||
test('every initialized channel receives the native knowledge, language, conversation, number and time bundle', () => {
|
||||
assert.equal(contract.initial_channel_bundle.atomic_with_identity_initialization, true)
|
||||
assert.deepEqual(contract.initial_channel_bundle.module_ids, [
|
||||
'hololake.knowledge-workspace',
|
||||
'hololake.language-channel-system',
|
||||
'hololake.conversation-manager',
|
||||
'hololake.numbered-knowledge-protocol',
|
||||
'hololake.persona-time-authority',
|
||||
])
|
||||
assert.match(rust, /install_initial_channel_modules/)
|
||||
})
|
||||
|
||||
test('the human projection establishes identity once and keeps task mutation below the default surface', () => {
|
||||
for (const command of [
|
||||
'get_personal_channel_snapshot',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
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')
|
||||
|
||||
test('personal skill algorithm is native while every pack remains private and channel scoped', () => {
|
||||
const contract = JSON.parse(read('contracts/personal-skill-runtime.json'))
|
||||
const runtime = read('src-tauri/src/personal_skill_runtime.rs')
|
||||
const channel = read('src-tauri/src/personal_channel.rs')
|
||||
|
||||
assert.equal(contract.source.remote_canonical_state, 'LOCAL_COMMIT_VERIFIED_NOT_REMOTE_CANON')
|
||||
assert.equal(contract.privacy.default_visibility, 'PRIVATE')
|
||||
assert.equal(contract.privacy.share_state, 'NOT_AUTHORIZED')
|
||||
assert.equal(contract.privacy.marketplace_state, 'NOT_AUTHORIZED')
|
||||
assert.equal(contract.brain_boundaries.deterministic_algorithm_is_hololake_native, true)
|
||||
assert.equal(contract.brain_boundaries.model_output_is_candidate_only, true)
|
||||
assert.equal(contract.brain_boundaries.skill_success_may_mutate_persona_self_kernel, false)
|
||||
assert.equal(contract.brain_boundaries.external_write_route, 'GH-CHANNEL-RECEIPT-0001')
|
||||
assert.match(runtime, /HOLOLAKE_NATIVE_PERSONAL_SKILL_PLANNER/)
|
||||
assert.match(runtime, /registered_initial_identity/)
|
||||
assert.match(runtime, /INSTALLED_AND_BYTE_READBACK_VERIFIED/)
|
||||
assert.match(channel, /personal_skill_runtime::ensure_current_channel/)
|
||||
})
|
||||
|
||||
test('only provisioned channels receive current packs and Shiyu Yaochu stays deferred', () => {
|
||||
const contract = JSON.parse(read('contracts/personal-skill-runtime.json'))
|
||||
const runtime = read('src-tauri/src/personal_skill_runtime.rs')
|
||||
const installed = Object.values(contract.initialized_channels).flat()
|
||||
|
||||
assert.equal(installed.length, 9)
|
||||
assert.equal(contract.deferred['SYS-SY'].state, 'DEFERRED_SERVER_AND_INITIAL_CHANNEL_NOT_PROVISIONED')
|
||||
assert.doesNotMatch(runtime, /skill!\("SY-YC-METRIC-CALIBER-001\.json"/)
|
||||
assert.match(runtime, /"channelNumber": "SYS-SY"/)
|
||||
})
|
||||
|
||||
test('the worker UI presents personal skill brain separately from persona worker and tool executor', () => {
|
||||
const panel = read('src/modules/knowledge-agent/LocalWorkerPanel.tsx')
|
||||
assert.match(panel, /本频道私有技能脑/)
|
||||
assert.match(panel, /模型只给语义候选/)
|
||||
assert.match(panel, /现实写入仍走频道回执和目标读回/)
|
||||
})
|
||||
|
|
@ -49,6 +49,14 @@ test('main branch and zero domains are public portals with real runtime projecti
|
|||
assert.match(portal, /numberCoordinateCount/)
|
||||
})
|
||||
|
||||
test('the authenticated world return control remains clickable above the non-interactive scene', () => {
|
||||
const styles = read('src/modules/qoder-surface/starlake-surface.css')
|
||||
const rule = styles.match(/\.starlake-scene \.world-channel-return\s*\{[^}]+\}/)?.[0]
|
||||
|
||||
assert.ok(rule, 'world return control must have an explicit style boundary')
|
||||
assert.match(rule, /pointer-events:auto/)
|
||||
})
|
||||
|
||||
test('zero-sense and fifth-domain boundaries remain explicit', () => {
|
||||
const app = read('src/main.tsx')
|
||||
const portal = read('src/modules/public-domain/PublicDomainPortal.tsx')
|
||||
|
|
|
|||
|
|
@ -6,12 +6,23 @@ const contract = JSON.parse(fs.readFileSync(new URL('../contracts/stage-one-plat
|
|||
const foundation = JSON.parse(fs.readFileSync(new URL('../foundation.json', import.meta.url), 'utf8'))
|
||||
const bridge = JSON.parse(fs.readFileSync(new URL('../contracts/local-development-bridge.json', import.meta.url), 'utf8'))
|
||||
|
||||
test('stage one is a personal channel with no internal AI product', () => {
|
||||
test('stage one embeds one knowledge persona channel without transferring persona or execution authority to the model', () => {
|
||||
assert.ok(contract.human_surface.includes('PERSONAL_CHANNEL_HOME'))
|
||||
assert.ok(!contract.human_surface.includes('AI_WORKBENCH'))
|
||||
assert.ok(contract.stage_one_forbidden.includes('INTERNAL_AI_CHAT'))
|
||||
assert.equal(foundation.stage_one_internal_ai_interaction, false)
|
||||
assert.equal(foundation.stage_one_model_api_configuration, false)
|
||||
assert.ok(contract.human_surface.includes('KNOWLEDGE_EMBEDDED_PERSONA_CHANNEL'))
|
||||
assert.ok(contract.stage_one_forbidden.includes('MODEL_OWNS_PERSONA'))
|
||||
assert.equal(contract.knowledge_embedded_persona_agent.initial_responder_is_channel_system_body, true)
|
||||
assert.equal(contract.knowledge_embedded_persona_agent.persona_identity_preconfigured, false)
|
||||
assert.equal(contract.knowledge_embedded_persona_agent.persona_response_lane_requires_verified_persona_declaration, true)
|
||||
assert.equal(contract.knowledge_embedded_persona_agent.human_create_or_delete_conversation_allowed, false)
|
||||
assert.equal(contract.knowledge_embedded_persona_agent.model_or_transport_grants_authority, false)
|
||||
assert.equal(contract.hldp_native_tool_forge.bound_persona_required_before_compile, true)
|
||||
assert.equal(contract.hldp_native_tool_forge.tested_tool_local_repeat_execution_implemented, true)
|
||||
assert.equal(contract.local_execution_subpersona.one_stable_worker_per_verified_persona, true)
|
||||
assert.equal(contract.local_execution_subpersona.hldp_recursive_work_experience_storage_implemented, true)
|
||||
assert.equal(contract.local_execution_subpersona.automatic_expensive_main_model_fallback, false)
|
||||
assert.equal(foundation.stage_one_internal_ai_interaction, true)
|
||||
assert.equal(foundation.stage_one_model_api_configuration, true)
|
||||
})
|
||||
|
||||
test('HoloLake owns continuity and MCP remains an optional adapter', () => {
|
||||
|
|
|
|||
|
|
@ -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, 285)
|
||||
assert.equal(generated.routeCount, 182)
|
||||
assert.equal(generated.coordinateCount, 303)
|
||||
assert.equal(generated.routeCount, 200)
|
||||
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, 182)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 285)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 200)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 303)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.equal(generated.invariants.everyProtocolReferenceHasNumberCoordinate, true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue