ZY-TAKEOVER-SNAPSHOT 20260815: 铸渊接管前现场冻结(Codex 未提交改动全部入册)· 冰朔面谕接管+可回退
This commit is contained in:
parent
ebe2ecf262
commit
ffed065841
22 changed files with 4293 additions and 567 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, /下一件事|为什么做|开始这件事/)
|
||||
})
|
||||
Loading…
Reference in a new issue