feat(hololake): add stage-one read-only PNCC core
This commit is contained in:
parent
ec8bbfd604
commit
f4c896d15c
11 changed files with 2539 additions and 6 deletions
|
|
@ -0,0 +1,72 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import test from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const readJson = (relative) => JSON.parse(fs.readFileSync(path.join(root, relative), 'utf8'))
|
||||
const readText = (relative) => fs.readFileSync(path.join(root, relative), 'utf8')
|
||||
|
||||
const contract = readJson('contracts/pncc-stage-one.json')
|
||||
const provenance = readJson('audit/pncc-migration-provenance.json')
|
||||
const foundation = readJson('foundation.json')
|
||||
|
||||
test('PNCC migration is file-evidenced and excludes donor runtime source copying', () => {
|
||||
assert.equal(provenance.decision, 'CLEAN_ROOM_REIMPLEMENT_CONTRACT_NO_DONOR_SOURCE_COPY')
|
||||
assert.equal(provenance.whole_tree_copy_authorized, false)
|
||||
assert.equal(provenance.model_runtime_migration_authorized, false)
|
||||
assert.equal(provenance.execution_limb_migration_authorized, false)
|
||||
assert.equal(provenance.facts_used.length, 4)
|
||||
})
|
||||
|
||||
test('stage-one PNCC contains no internal model or execution authority', () => {
|
||||
assert.equal(contract.repository_binding.returns_model_fields, false)
|
||||
assert.equal(contract.repository_binding.starts_model_inference, false)
|
||||
assert.equal(contract.repository_binding.acquires_persona_lease, false)
|
||||
assert.equal(contract.repository_binding.allows_reality_execution, false)
|
||||
for (const forbidden of [
|
||||
'INTERNAL_MODEL_INFERENCE',
|
||||
'MODEL_BINDING_IN_PUBLIC_RECEIPT',
|
||||
'EXECUTION_LIMB',
|
||||
'PERSONA_LEASE_ACQUISITION',
|
||||
]) assert.ok(contract.forbidden.includes(forbidden))
|
||||
})
|
||||
|
||||
test('remote channel is incremental, app-owned and refuses clone fallback', () => {
|
||||
const remote = contract.remote_object_channel
|
||||
assert.deepEqual(remote.accepted_remote_schemes, ['https'])
|
||||
assert.equal(remote.credentials_in_url_allowed, false)
|
||||
assert.equal(remote.cache, 'APP_OWNED_BARE_PROMISOR_BLOB_NONE')
|
||||
assert.equal(remote.worktree_created, false)
|
||||
assert.equal(remote.git_clone_invoked, false)
|
||||
assert.equal(remote.durable_cursor_separate_from_evictable_cache, true)
|
||||
assert.equal(remote.history_rewrite_allowed, false)
|
||||
})
|
||||
|
||||
test('neither webview nor external AI can register an arbitrary PNCC source', () => {
|
||||
assert.equal(contract.mount_registration.webview_arbitrary_path_or_url_registration_allowed, false)
|
||||
assert.equal(contract.mount_registration.external_ai_registration_allowed, false)
|
||||
assert.equal(contract.mount_registration.native_file_picker_exact_confirmation_required, true)
|
||||
assert.equal(contract.mount_registration.implemented, false)
|
||||
const native = readText('src-tauri/src/lib.rs')
|
||||
const broker = readText('src-tauri/src/direct_local_broker.rs')
|
||||
assert.doesNotMatch(native, /register_pncc_(repository|remote)_mount/)
|
||||
assert.doesNotMatch(broker, /RegisterPncc(Repository|Remote)Mount/)
|
||||
})
|
||||
|
||||
test('foundation and Rust modules report the implemented PNCC boundary', () => {
|
||||
assert.equal(foundation.pncc_stage_one_contract, 'contracts/pncc-stage-one.json')
|
||||
assert.equal(foundation.pncc_repository_binding_implemented, true)
|
||||
assert.equal(foundation.pncc_remote_incremental_object_channel_implemented, true)
|
||||
assert.equal(foundation.pncc_receipt_projection_implemented, true)
|
||||
assert.equal(foundation.pncc_human_mount_registration_implemented, false)
|
||||
assert.equal(foundation.pncc_internal_model_inference_implemented, false)
|
||||
assert.equal(foundation.pncc_execution_limb_implemented, false)
|
||||
for (const relative of [
|
||||
'src-tauri/src/pncc_repository_binding.rs',
|
||||
'src-tauri/src/pncc_remote_git.rs',
|
||||
]) assert.equal(fs.existsSync(path.join(root, relative)), true)
|
||||
const productionBindingSource = readText('src-tauri/src/pncc_repository_binding.rs').split('\n#[cfg(test)]\nmod tests')[0]
|
||||
assert.doesNotMatch(productionBindingSource, /modelProvider|model_id|api[_-]?key/i)
|
||||
})
|
||||
Loading…
Reference in a new issue