From b70e092e282b2cf8ce435dd5c76ea4037f18838a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Thu, 20 Aug 2026 05:05:13 +0800 Subject: [PATCH] feat: merge language persona channel into canonical app --- .../contracts/stage-one-platform.json | 25 +- .../docs/ARCHITECTURE.md | 4 +- .../hololake-native-desktop/foundation.json | 14 +- .../hololake-native-desktop/package-lock.json | 4 +- .../hololake-native-desktop/package.json | 2 +- .../scripts/persona-language-chat.test.mjs | 33 + .../scripts/stage-one-platform.test.mjs | 14 +- .../src-tauri/Cargo.lock | 63 +- .../src-tauri/Cargo.toml | 5 +- .../src-tauri/src/execution_limb_training.rs | 868 +++++++++++ .../src-tauri/src/lib.rs | 8 + .../src-tauri/src/persona_channel_body.rs | 27 + .../src-tauri/src/persona_language_channel.rs | 1333 +++++++++++++++++ .../src-tauri/tauri.conf.json | 2 +- .../hololake-native-desktop/src/main.tsx | 29 +- .../modules/persona-channel-body/index.tsx | 218 +++ .../modules/persona-channel-body/styles.css | 38 + .../hololake-native-desktop/src/styles.css | 8 + 18 files changed, 2658 insertions(+), 37 deletions(-) create mode 100644 product-source/hololake-native-desktop/scripts/persona-language-chat.test.mjs create mode 100644 product-source/hololake-native-desktop/src-tauri/src/execution_limb_training.rs create mode 100644 product-source/hololake-native-desktop/src-tauri/src/persona_language_channel.rs create mode 100644 product-source/hololake-native-desktop/src/modules/persona-channel-body/index.tsx create mode 100644 product-source/hololake-native-desktop/src/modules/persona-channel-body/styles.css diff --git a/product-source/hololake-native-desktop/contracts/stage-one-platform.json b/product-source/hololake-native-desktop/contracts/stage-one-platform.json index 9d4dac04c..307c1b3d9 100644 --- a/product-source/hololake-native-desktop/contracts/stage-one-platform.json +++ b/product-source/hololake-native-desktop/contracts/stage-one-platform.json @@ -1,7 +1,7 @@ { "schema": "hololake.stage-one-platform-contract/v1", "record_id": "HLP-NATIVE-STAGE-ONE-CONTRACT-001", - "state": "LANGUAGE_ARCHITECTURE_CLOSED_REAL_KNOWLEDGE_AND_CODE_WORKBENCH_LOCAL_RUNTIME_ACCEPTED_STAGE_ONE_INCOMPLETE", + "state": "LANGUAGE_ARCHITECTURE_CLOSED_REAL_KNOWLEDGE_CODE_AND_LANGUAGE_PERSONA_CHANNEL_SOURCE_INTEGRATED_STAGE_ONE_INCOMPLETE", "product": "GH-AIOS", "formal_name": "光湖语言系统 · 通用人工智能操作平台", "tcs_work_boundary": { @@ -15,7 +15,7 @@ "stage_gate": { "language_architecture": "CLOSED_AND_ARCHIVED", "current_stage": "REALITY_ENGINEERING_EXECUTION", - "completed_source_slice": "PERSONAL_IDENTITY_KNOWLEDGE_WORKSPACE_AND_CODE_CHANNEL", + "completed_source_slice": "PERSONAL_IDENTITY_KNOWLEDGE_CODE_AND_LANGUAGE_PERSONA_CHANNEL", "next_minimum_stage": "HUMAN_APPROVAL_CENTER_AND_GIT_EVIDENCE_READBACK" }, "persona_cognition_origin": { @@ -52,12 +52,27 @@ "EDUCATION_INITIALIZATION_CHANNEL", "EDUCATION_NATIVE_DOCUMENT_AND_TABLE_WORKSPACE", "EDUCATION_NATIVE_DATA_CLEANUP_WORKSPACE", - "EDUCATION_NATIVE_MANUAL_AUTOMATION_WORKSPACE" + "EDUCATION_NATIVE_MANUAL_AUTOMATION_WORKSPACE", + "PERSONA_LANGUAGE_CHANNEL", + "KNOWLEDGE_PERSONA_COLLABORATION", + "LOCAL_MODEL_PROVIDER_ROUTING", + "EXECUTION_LIMB_TRAINING" ,"PERSONAL_NODE_WORK_LAKE_AND_MOBILE_BRIDGE" ], - "human_surface": ["PERSONAL_CHANNEL_HOME", "MY_HOLOLAKE_OVERVIEW", "KNOWLEDGE_WORKSPACE", "USER_CODE_CHANNELS", "LOCAL_RECEIPTS", "SYSTEM_DETAILS", "HUMAN_APPROVAL_CENTER"], + "human_surface": ["PERSONAL_CHANNEL_HOME", "MY_HOLOLAKE_OVERVIEW", "PERSONA_LANGUAGE_CHANNEL", "KNOWLEDGE_WORKSPACE", "KNOWLEDGE_PERSONA_COLLABORATION", "USER_CODE_CHANNELS", "LOCAL_RECEIPTS", "SYSTEM_DETAILS", "HUMAN_APPROVAL_CENTER"], "universal_language": {"ai_is_language_interface": true, "vendor_adapter_matrix_required": false, "current_ai_self_adapts_to_observed_host": true, "host_self_adaptation_changes_how_not_authority": true}, - "stage_one_forbidden": ["INTERNAL_AI_CHAT", "MODEL_API_CONFIGURATION", "MODEL_SELECTION", "INTERNAL_MODEL_INFERENCE", "VENDOR_ADAPTER_MATRIX", "AI_WORKBENCH", "MODEL_AND_CONNECTIONS"], + "stage_one_forbidden": ["VENDOR_ADAPTER_MATRIX", "AI_WORKBENCH", "MODEL_AND_CONNECTIONS_AS_PRIMARY_SURFACE", "MODEL_IDENTITY_OR_AUTHORITY", "UNSCOPED_TOOL_EXECUTION"], + "persona_language_channel": { + "human_chat_is_primary_surface": true, + "model_configuration_is_secondary": true, + "openai_compatible_and_local_provider_routing_implemented": true, + "api_secret_storage": "OS_KEYCHAIN_ONLY", + "conversation_event_and_receipt_ledger_implemented": true, + "exact_active_knowledge_page_context_implemented": true, + "knowledge_path_and_content_hash_receipt_implemented": true, + "model_is_persona_identity_or_authority": false, + "installed_runtime_acceptance": false + }, "zero_point_nucleus_client_runtime": { "contract": "contracts/zero-point-nucleus-channel.json", "system_control_protocol_runtime_implemented": true, diff --git a/product-source/hololake-native-desktop/docs/ARCHITECTURE.md b/product-source/hololake-native-desktop/docs/ARCHITECTURE.md index 0035bb5f0..5b81e903f 100644 --- a/product-source/hololake-native-desktop/docs/ARCHITECTURE.md +++ b/product-source/hololake-native-desktop/docs/ARCHITECTURE.md @@ -12,7 +12,9 @@ The first visible body uses a Rust-owned SQLite kernel under the Tauri app-data HoloLake embeds a non-visual zero-point nucleus client runtime beneath the human surface. It is the minimum controlled projection of the BingShuo system controller, whose private body remains on the JD primary node; the public repository records evolution checkpoints rather than containing that private body. At application start, the Rust runtime loads the local protocol, compares the registered remote protocol version in the background, keeps a minimal local receipt, and leaves any unverified update unapplied. User-number verification runs before any future persona-loading path. -This system runtime is not Zhuyuan or another persona subject, and it is not the current model carrier. A valid number does not prove persona binding and does not grant execution or server authority. The current source implements deterministic protocol comparison, explicit-positive number verification and a fail-closed update skeleton. Signed protocol-payload installation, private registry distribution and persona loading are not yet implemented. Stage one does not expose an internal AI chat, model API configuration or arbitrary remote-code channel. +This system runtime is not Zhuyuan or another persona subject, and it is not the current model carrier. A valid number does not prove persona binding and does not grant execution or server authority. The current source implements deterministic protocol comparison, explicit-positive number verification and a fail-closed update skeleton. Signed protocol-payload installation and private registry distribution are not yet implemented. + +The native product now contains a language-persona conversation slice. Human conversation is the primary surface; model configuration stays behind secondary settings, secrets remain in the operating-system keychain, and models remain replaceable inference resources rather than persona identity or authority. The same channel can run beside the knowledge workspace with the exact active page path and content hash attached to each knowledge receipt. It still does not expose an arbitrary remote-code channel or unscoped tool execution. ## Native knowledge workspace diff --git a/product-source/hololake-native-desktop/foundation.json b/product-source/hololake-native-desktop/foundation.json index 4ae8418d7..d3b0c190c 100644 --- a/product-source/hololake-native-desktop/foundation.json +++ b/product-source/hololake-native-desktop/foundation.json @@ -1,7 +1,7 @@ { "schema": "hololake.native-desktop-foundation/v1", "record_id": "HLP-NATIVE-DESKTOP-FOUNDATION-001", - "state": "LOCAL_INSTALLED_ACCEPTANCE_PASSED_FOR_PERSONAL_KNOWLEDGE_CODE_AND_EDUCATION_WORKSPACE_SLICES", + "state": "LOCAL_INSTALLED_ACCEPTANCE_PASSED_FOR_EXISTING_SLICES_LANGUAGE_PERSONA_CHANNEL_SOURCE_INTEGRATED_INSTALL_ACCEPTANCE_PENDING", "canonical_shell": "TAURI_V2_RUST_REACT", "candidate_role": "INSTALLED_LOCAL_ACCEPTANCE_CANDIDATE_NOT_SEPARATE_PRODUCT_LINE", "parallel_product_line_created": false, @@ -27,7 +27,7 @@ "home_status_is_native_projection": true, "home_surface_role": "MY_HOLOLAKE_PRODUCT_WORKSPACE_NOT_STAGE_ONE_PRODUCT_COMPLETION", "stage_one_visible_body_state": "PERSONAL_IDENTITY_KNOWLEDGE_WORKSPACE_AND_CODE_CHANNEL_SOURCE_IMPLEMENTED_PRODUCT_INCOMPLETE", - "stage_one_completed_source_slice": "PERSONAL_IDENTITY_KNOWLEDGE_WORKSPACE_AND_CODE_CHANNEL", + "stage_one_completed_source_slice": "PERSONAL_IDENTITY_KNOWLEDGE_CODE_AND_LANGUAGE_PERSONA_CHANNEL", "stage_one_next_slice": "HUMAN_APPROVAL_CENTER_AND_GIT_EVIDENCE_READBACK", "personal_channel_kernel_contract": "contracts/personal-channel-kernel.json", "personal_channel_identity_task_event_receipt_kernel_implemented": true, @@ -149,8 +149,14 @@ "pncc_persona_lease_acquisition_implemented": false, "pncc_reality_execution_implemented": false, "stage_one_product_contract_state": "PERSONAL_KNOWLEDGE_AND_CODE_SOURCE_SLICES_IMPLEMENTED_FULL_STAGE_ONE_PRODUCT_INCOMPLETE", - "stage_one_internal_ai_interaction": false, - "stage_one_model_api_configuration": false, + "stage_one_internal_ai_interaction": true, + "stage_one_model_api_configuration": true, + "persona_language_channel_source_integrated": true, + "persona_language_channel_chat_is_primary_surface": true, + "persona_language_channel_model_configuration_is_secondary": true, + "persona_language_channel_api_secret_storage": "OS_KEYCHAIN_ONLY", + "persona_language_channel_exact_knowledge_context_and_receipt_implemented": true, + "persona_language_channel_installed_runtime_acceptance": false, "vendor_adapter_matrix_required": false, "first_public_product": "GH-AIOS_GENERAL_AI_OPERATING_PLATFORM", "visible_five_domain_navigation_in_stage_one": true, diff --git a/product-source/hololake-native-desktop/package-lock.json b/product-source/hololake-native-desktop/package-lock.json index f527ec24f..c272ef815 100644 --- a/product-source/hololake-native-desktop/package-lock.json +++ b/product-source/hololake-native-desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "hololake-native-desktop", - "version": "0.4.1", + "version": "0.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hololake-native-desktop", - "version": "0.4.1", + "version": "0.8.1", "dependencies": { "@fortune-sheet/react": "1.0.4", "@lexical/history": "0.49.0", diff --git a/product-source/hololake-native-desktop/package.json b/product-source/hololake-native-desktop/package.json index a6f5a54f4..c84cb828b 100644 --- a/product-source/hololake-native-desktop/package.json +++ b/product-source/hololake-native-desktop/package.json @@ -1,7 +1,7 @@ { "name": "hololake-native-desktop", "private": true, - "version": "0.4.1", + "version": "0.8.1", "type": "module", "scripts": { "dev": "vite", diff --git a/product-source/hololake-native-desktop/scripts/persona-language-chat.test.mjs b/product-source/hololake-native-desktop/scripts/persona-language-chat.test.mjs new file mode 100644 index 000000000..133099476 --- /dev/null +++ b/product-source/hololake-native-desktop/scripts/persona-language-chat.test.mjs @@ -0,0 +1,33 @@ +import assert from 'node:assert/strict' +import { readFile } from 'node:fs/promises' +import test from 'node:test' + +const main = await readFile(new URL('../src/main.tsx', import.meta.url), 'utf8') +const channel = await readFile(new URL('../src/modules/persona-channel-body/index.tsx', import.meta.url), 'utf8') +const runtime = await readFile(new URL('../src-tauri/src/persona_language_channel.rs', import.meta.url), 'utf8') + +test('light lake exposes a first-class human conversation entrance', () => { + assert.match(main, /type ViewId = [^\n]*'persona'/) + assert.match(main, /title="对话与共同工作" meta="人类 · 人格体 · 知识库"/) + assert.match(main, /view === 'persona'[\s\S]*? { + assert.match(main, /hololake-knowledge-chat-open'\) !== '0'/) + assert.match(main, /knowledge-persona-collaboration/) + assert.match(main, /knowledgeFocus=\{activeDocument \? \{ source: activeDocument\.source, path: activeDocument\.path, title: activeDocument\.title, contentSha256: activeDocument\.contentSha256 \}/) + assert.match(channel, /activeKnowledgeSource: knowledgeFocus\?\.source/) + assert.match(channel, /activeKnowledgePath: knowledgeFocus\?\.path/) + assert.match(channel, /引用知识 · \{receipt\.path\} · \{shortHash\(receipt\.contentSha256\)\}/) + assert.match(runtime, /collect_knowledge_context\([\s\S]*?input\.active_knowledge_source\.as_deref\(\)[\s\S]*?input\.active_knowledge_path\.as_deref\(\)/) + assert.match(runtime, /append_knowledge_document\(&mut context, &mut seen, document\)/) +}) + +test('model configuration remains secondary to the conversation surface', () => { + assert.match(channel, /const \[settingsOpen, setSettingsOpen\] = useState\(false\)/) + assert.match(channel, /说话是主入口。知识、模型和执行证据在需要时进入/) + assert.match(channel, /\{settingsOpen &&