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, /下一件事|为什么做|开始这件事/)
|
||||
})
|
||||
|
|
@ -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/)
|
||||
})
|
||||
Loading…
Reference in a new issue