feat: merge HoloLake desktop into unified 0.3.0
This commit is contained in:
commit
b7461c66c5
37 changed files with 8732 additions and 613 deletions
|
|
@ -0,0 +1,71 @@
|
|||
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 knowledgeContract = JSON.parse(read('contracts/knowledge-workspace.json'))
|
||||
const codeContract = JSON.parse(read('contracts/code-channel.json'))
|
||||
const provenance = JSON.parse(read('audit/knowledge-workspace-migration-provenance.json'))
|
||||
const knowledgeRust = read('src-tauri/src/knowledge_base.rs')
|
||||
const codeRust = read('src-tauri/src/code_channel.rs')
|
||||
const lib = read('src-tauri/src/lib.rs')
|
||||
const ui = read('src/main.tsx')
|
||||
|
||||
test('knowledge workspace is HoloLake-owned and keeps the legacy source read-only', () => {
|
||||
assert.equal(knowledgeContract.native_storage.owner, 'HOLOLAKE_NATIVE_RUST_CORE')
|
||||
assert.equal(knowledgeContract.legacy_compatibility.mode, 'READ_ONLY_SEPARATE_ROOT')
|
||||
assert.equal(knowledgeContract.legacy_compatibility.in_place_migration, false)
|
||||
assert.equal(knowledgeContract.legacy_compatibility.tolaria_surface_used, false)
|
||||
assert.equal(provenance.legacy_data_boundary.modified, false)
|
||||
assert.match(knowledgeRust, /join\("knowledge-v1"\)/)
|
||||
assert.match(knowledgeRust, /source_docs_root/)
|
||||
})
|
||||
|
||||
test('folder import is bounded, idempotent, conflict-safe and creates a local Git receipt', () => {
|
||||
assert.equal(knowledgeContract.folder_import.maximum_files, 1000)
|
||||
assert.equal(knowledgeContract.folder_import.symlinks_followed, false)
|
||||
assert.equal(knowledgeContract.folder_import.repeated_import, 'MERGE_BY_STABLE_SOURCE_NAME')
|
||||
assert.equal(knowledgeContract.folder_import.exact_duplicate_result, 'ALREADY_PRESENT')
|
||||
assert.equal(knowledgeContract.folder_import.conflicting_file_overwrite, false)
|
||||
assert.equal(knowledgeContract.capabilities.import_commit_receipt, true)
|
||||
assert.equal(knowledgeContract.capabilities.exact_content_deduplication, true)
|
||||
assert.equal(knowledgeContract.capabilities.optimistic_native_editing, true)
|
||||
assert.match(knowledgeRust, /MAX_IMPORT_FILES: usize = 1_000/)
|
||||
assert.match(knowledgeRust, /kind\.is_symlink\(\)/)
|
||||
assert.match(knowledgeRust, /ImportDisposition::Existing/)
|
||||
assert.match(knowledgeRust, /HOLOLAKE_KNOWLEDGE_SAVE_CONFLICT/)
|
||||
assert.match(knowledgeRust, /rev-parse", "HEAD/)
|
||||
})
|
||||
|
||||
test('official code-channel clone cannot use credentials or credential prompts', () => {
|
||||
assert.equal(codeContract.clone.embedded_credentials_allowed, false)
|
||||
assert.equal(codeContract.clone.terminal_prompt_allowed, false)
|
||||
assert.equal(codeContract.clone.credential_helper_allowed, false)
|
||||
assert.equal(codeContract.authority.automatic_push, false)
|
||||
assert.match(codeRust, /GIT_TERMINAL_PROMPT/)
|
||||
assert.match(codeRust, /credential\.helper=/)
|
||||
assert.match(codeRust, /parsed\.username\(\)\.is_empty\(\)/)
|
||||
})
|
||||
|
||||
test('the product surface exposes a real knowledge workbench and browsable code channel', () => {
|
||||
for (const command of [
|
||||
'get_knowledge_snapshot',
|
||||
'read_knowledge_document',
|
||||
'search_knowledge',
|
||||
'save_knowledge_document',
|
||||
'select_and_import_knowledge_folder',
|
||||
'get_code_channel_snapshot',
|
||||
'clone_code_channel',
|
||||
'select_local_code_channel',
|
||||
'browse_code_channel',
|
||||
'read_code_channel_file',
|
||||
]) {
|
||||
assert.match(lib, new RegExp(command))
|
||||
assert.match(ui, new RegExp(`['"]${command}['"]`))
|
||||
}
|
||||
assert.match(ui, /知识工作台/)
|
||||
assert.match(ui, /HoloLake Era/)
|
||||
assert.match(ui, /知识视图/)
|
||||
assert.match(ui, /源文件/)
|
||||
assert.doesNotMatch(ui, /下一件事|为什么做|开始这件事/)
|
||||
})
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
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/personal-channel-kernel.json'))
|
||||
const foundation = JSON.parse(read('foundation.json'))
|
||||
const stageOne = JSON.parse(read('contracts/stage-one-platform.json'))
|
||||
const rust = read('src-tauri/src/personal_channel.rs')
|
||||
const lib = read('src-tauri/src/lib.rs')
|
||||
const ui = read('src/main.tsx')
|
||||
|
||||
test('personal channel kernel has one private SQLite owner and no server authority', () => {
|
||||
assert.equal(contract.storage.owner, 'HOLOLAKE_NATIVE_RUST_CORE')
|
||||
assert.equal(contract.storage.engine, 'EMBEDDED_SQLITE')
|
||||
assert.equal(contract.storage.webview_direct_database_access, false)
|
||||
assert.equal(contract.identity.platform_account_authentication_claimed, false)
|
||||
assert.equal(contract.identity.server_or_repository_authority_granted, false)
|
||||
assert.equal(contract.acceptance.server_deployment, false)
|
||||
})
|
||||
|
||||
test('identity and task mutations create one-to-one chained events and receipts', () => {
|
||||
assert.equal(contract.event_and_receipt.identity_and_task_mutations_are_single_sqlite_transactions, true)
|
||||
assert.equal(contract.event_and_receipt.every_mutation_has_event, true)
|
||||
assert.equal(contract.event_and_receipt.every_event_has_receipt, true)
|
||||
assert.equal(contract.event_and_receipt.tampering_fails_closed, true)
|
||||
assert.match(rust, /CREATE TABLE IF NOT EXISTS events/)
|
||||
assert.match(rust, /CREATE TABLE IF NOT EXISTS receipts/)
|
||||
assert.match(rust, /verify_integrity\(&connection\)/)
|
||||
})
|
||||
|
||||
test('the human projection establishes identity once and keeps task mutation below the default surface', () => {
|
||||
for (const command of [
|
||||
'get_personal_channel_snapshot',
|
||||
'initialize_personal_channel',
|
||||
'create_personal_channel_task',
|
||||
'transition_personal_channel_task',
|
||||
]) {
|
||||
assert.match(lib, new RegExp(`personal_channel::${command}`))
|
||||
}
|
||||
for (const command of ['get_personal_channel_snapshot', 'initialize_personal_channel']) {
|
||||
assert.match(ui, new RegExp(`['"]${command}['"]`))
|
||||
}
|
||||
assert.doesNotMatch(ui, /['"]create_personal_channel_task['"]/)
|
||||
assert.doesNotMatch(ui, /['"]transition_personal_channel_task['"]/)
|
||||
assert.doesNotMatch(ui, /下一件事|为什么做|开始这件事/)
|
||||
assert.equal(stageOne.personal_channel_kernel.native_source_implemented, true)
|
||||
assert.equal(stageOne.personal_channel_kernel.installed_runtime_acceptance, true)
|
||||
assert.equal(foundation.personal_channel_identity_task_event_receipt_kernel_implemented, true)
|
||||
assert.equal(foundation.personal_channel_installed_runtime_acceptance, true)
|
||||
})
|
||||
|
||||
test('full stage-one completion stays false after the first source slice', () => {
|
||||
assert.equal(stageOne.implementation_complete, false)
|
||||
assert.equal(foundation.stage_one_next_slice, 'HUMAN_APPROVAL_CENTER_AND_GIT_EVIDENCE_READBACK')
|
||||
assert.match(foundation.stage_one_visible_body_state, /PRODUCT_INCOMPLETE/)
|
||||
})
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
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/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 lib = read('src-tauri/src/lib.rs')
|
||||
const ui = read('src/main.tsx')
|
||||
|
||||
test('zero-point nucleus is a system runtime and never an inferred persona binding', () => {
|
||||
assert.equal(contract.metacognitive_boundary.zero_point_system_is_persona, false)
|
||||
assert.equal(contract.metacognitive_boundary.zero_point_system_is_model_carrier, false)
|
||||
assert.equal(contract.metacognitive_boundary.number_verification_is_persona_binding, false)
|
||||
assert.equal(contract.metacognitive_boundary.number_verification_grants_execution_authority, false)
|
||||
assert.equal(stageOne.zero_point_nucleus_client_runtime.system_is_persona, false)
|
||||
assert.equal(foundation.zero_point_nucleus_is_persona, false)
|
||||
assert.match(ui, /验证结果不构成人格绑定、模型载体绑定或执行授权/)
|
||||
})
|
||||
|
||||
test('protocol comparison starts below the public surface and fails closed', () => {
|
||||
assert.equal(contract.current_implementation.boot_time_silent_version_comparison, true)
|
||||
assert.equal(contract.current_implementation.signed_protocol_payload_installation, false)
|
||||
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.doesNotMatch(lib, /zero_point_save_api|zero_point_api_config|generic_layer_chat/)
|
||||
assert.doesNotMatch(ui, /模型 API 配置|通用AI运行层|AGENT PARLOR|会客厅/)
|
||||
})
|
||||
|
||||
test('number validation requires an explicit positive lighthouse verdict', () => {
|
||||
assert.match(rust, /fn lighthouse_resolution/)
|
||||
assert.match(rust, /eq_ignore_ascii_case\("RESOLVED"\)/)
|
||||
assert.match(rust, /route_not_found/)
|
||||
assert.match(rust, /an arbitrary successful response/)
|
||||
assert.match(rust, /inner\.route = "restricted"/)
|
||||
})
|
||||
Loading…
Reference in a new issue