feat: merge language persona channel into canonical app

This commit is contained in:
冰朔 2026-08-20 05:05:13 +08:00
commit b70e092e28
18 changed files with 2658 additions and 37 deletions

View file

@ -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]*?<PersonaChannelBody/)
assert.match(channel, /<textarea[\s\S]*?form\?\.requestSubmit\(\)/)
assert.match(channel, /\{sending \? '正在回应…' : '发送'\}/)
})
test('knowledge workspace keeps the chat visible and binds the exact active page', () => {
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 && <aside className="persona-chat-settings">/)
assert.match(channel, /API 密钥 · 只进钥匙串/)
})

View file

@ -6,12 +6,18 @@ 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 exposes a language persona channel without turning configuration into the product', () => {
assert.ok(contract.human_surface.includes('PERSONAL_CHANNEL_HOME'))
assert.ok(contract.human_surface.includes('PERSONA_LANGUAGE_CHANNEL'))
assert.ok(contract.human_surface.includes('KNOWLEDGE_PERSONA_COLLABORATION'))
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.stage_one_forbidden.includes('MODEL_IDENTITY_OR_AUTHORITY'))
assert.equal(contract.persona_language_channel.human_chat_is_primary_surface, true)
assert.equal(contract.persona_language_channel.model_configuration_is_secondary, true)
assert.equal(contract.persona_language_channel.installed_runtime_acceptance, false)
assert.equal(foundation.stage_one_internal_ai_interaction, true)
assert.equal(foundation.stage_one_model_api_configuration, true)
assert.equal(foundation.persona_language_channel_api_secret_storage, 'OS_KEYCHAIN_ONLY')
})
test('HoloLake owns continuity and MCP remains an optional adapter', () => {