feat: close complete numbering and responsive fifth-domain UI
This commit is contained in:
parent
fe1aaade0e
commit
e8b3082ed5
42 changed files with 3243 additions and 417 deletions
|
|
@ -12,9 +12,10 @@ const sourceRoot = explicitSourceRoot || (repoRoot ? path.join(repoRoot, 'gls')
|
|||
const sourceCommit = args.get('--source-commit')
|
||||
const output = args.get('--output')
|
||||
const projectionsPath = args.get('--projections')
|
||||
const referencesPath = args.get('--references')
|
||||
|
||||
if (!repoRoot || !sourceRoot || !sourceCommit || !output || !projectionsPath) {
|
||||
throw new Error('usage: compile-gls-runtime-registry.mjs --repo-root <REPO-012> --source-commit <sha> --output <manifest.json> --projections <projections.json>')
|
||||
if (!repoRoot || !sourceRoot || !sourceCommit || !output || !projectionsPath || !referencesPath) {
|
||||
throw new Error('usage: compile-gls-runtime-registry.mjs --repo-root <REPO-012> --source-commit <sha> --output <manifest.json> --projections <projections.json> --references <reference-nodes.json>')
|
||||
}
|
||||
if (!/^[a-f0-9]{40}$/.test(sourceCommit)) throw new Error('source commit must be a full SHA-1')
|
||||
|
||||
|
|
@ -168,6 +169,18 @@ if (projectionManifest.schema !== 'hololake.gls-executable-projections/v2'
|
|||
|| projectionManifest.source_commit !== sourceCommit) {
|
||||
throw new Error('projection manifest does not match the selected REPO-012 source commit')
|
||||
}
|
||||
const referenceManifest = JSON.parse(await readFile(referencesPath, 'utf8'))
|
||||
if (referenceManifest.schema !== 'hololake.gls-numbered-reference-nodes/v1'
|
||||
|| referenceManifest.record_id !== 'HLP-GLS-NUMBERED-REFERENCE-REGISTRY-001'
|
||||
|| referenceManifest.source?.repository !== 'REPO-012'
|
||||
|| referenceManifest.source?.commit !== sourceCommit
|
||||
|| referenceManifest.policy?.number_is_coordinate_not_authority !== true
|
||||
|| referenceManifest.policy?.independent_protocol_source_required_for_execution !== true
|
||||
|| referenceManifest.policy?.reference_only_nodes_may_execute !== false
|
||||
|| referenceManifest.policy?.unknown_reference !== 'FAIL_CLOSED'
|
||||
|| referenceManifest.policy?.unresolved_number_reference_allowed !== false) {
|
||||
throw new Error('numbered reference manifest does not match the selected REPO-012 source commit or safety boundary')
|
||||
}
|
||||
|
||||
const protocolRegistryPath = 'gls/GLS-PROTOCOL-REGISTRY.json'
|
||||
const glsEntryPath = 'gls/GLS-ENTRY.hdlp'
|
||||
|
|
@ -222,29 +235,35 @@ for (const relative of await walk(routingRoot)) {
|
|||
}
|
||||
}
|
||||
|
||||
const candidates = (await walk(sourceRoot))
|
||||
.map((relative) => ({ relative, match: path.basename(relative).match(/^(GLS-\d{4}).*\.hdlp$/) }))
|
||||
const allSourceFiles = await walk(sourceRoot)
|
||||
const candidates = allSourceFiles
|
||||
.map((relative) => ({ relative, match: path.basename(relative).match(/^(GLS-\d{4})(?:[^0-9].*)?\.(hdlp|md)$/) }))
|
||||
.filter((item) => item.match)
|
||||
.map((item) => ({ id: item.match[1], relative: item.relative }))
|
||||
.map((item) => ({ id: item.match[1], relative: item.relative, source_format: item.match[2] === 'hdlp' ? 'HDLP_PROTOCOL_SOURCE' : 'LEGACY_MARKDOWN_EVIDENCE' }))
|
||||
const grouped = new Map()
|
||||
for (const candidate of candidates) {
|
||||
const group = grouped.get(candidate.id) || []
|
||||
group.push(candidate.relative)
|
||||
group.push(candidate)
|
||||
grouped.set(candidate.id, group)
|
||||
}
|
||||
|
||||
const selectedSource = new Map()
|
||||
for (const [id, sources] of grouped) {
|
||||
sources.sort((left, right) => sourceRank(left) - sourceRank(right) || left.localeCompare(right))
|
||||
const relative = sources[0]
|
||||
const protocolSources = sources.filter((source) => source.source_format === 'HDLP_PROTOCOL_SOURCE')
|
||||
if (protocolSources.length === 0) continue
|
||||
protocolSources.sort((left, right) => sourceRank(left.relative) - sourceRank(right.relative)
|
||||
|| left.relative.localeCompare(right.relative))
|
||||
const selected = protocolSources[0]
|
||||
const relative = selected.relative
|
||||
selectedSource.set(id, {
|
||||
relative,
|
||||
raw: await readFile(path.join(sourceRoot, relative), 'utf8'),
|
||||
alternate_source_count: sources.length - 1,
|
||||
source_format: selected.source_format,
|
||||
alternate_source_count: protocolSources.length - 1,
|
||||
})
|
||||
}
|
||||
|
||||
const knownSourceIds = new Set(selectedSource.keys())
|
||||
let knownSourceIds = new Set(selectedSource.keys())
|
||||
const protocolRegistryIds = new Set(registryMetadata.keys())
|
||||
const draftIds = new Set((protocolRegistry.registered_draft_protocols || []).map((entry) => entry.id))
|
||||
const legacyDependencyTargets = new Set()
|
||||
|
|
@ -256,6 +275,56 @@ for (const id of draftIds) {
|
|||
}
|
||||
const legacyDependencyCycles = stronglyConnectedComponents(draftGraph)
|
||||
|
||||
// 旧 Notion 导出只在现行协议真实引用且独立 HDLP 正本缺席时作为历史证据节点进入。
|
||||
// 未被现行图引用的旧页面不得因为文件名像 GLS 编号就自动取得当前注册地位。
|
||||
for (const id of [...legacyDependencyTargets].filter((target) => !knownSourceIds.has(target))) {
|
||||
if (!authorityDeclarations.has(id)) continue
|
||||
const legacySources = (grouped.get(id) || []).filter((source) => source.source_format === 'LEGACY_MARKDOWN_EVIDENCE')
|
||||
if (legacySources.length === 0) continue
|
||||
legacySources.sort((left, right) => sourceRank(left.relative) - sourceRank(right.relative) || left.relative.localeCompare(right.relative))
|
||||
const selected = legacySources[0]
|
||||
selectedSource.set(id, {
|
||||
relative: selected.relative,
|
||||
raw: await readFile(path.join(sourceRoot, selected.relative), 'utf8'),
|
||||
source_format: selected.source_format,
|
||||
alternate_source_count: legacySources.length - 1,
|
||||
})
|
||||
}
|
||||
knownSourceIds = new Set(selectedSource.keys())
|
||||
|
||||
const missingSourceTargets = [...legacyDependencyTargets].filter((id) => !knownSourceIds.has(id)).sort()
|
||||
const referenceIds = new Set()
|
||||
const referenceNodeNumbers = new Set()
|
||||
const numberedReferenceNodes = []
|
||||
for (const node of referenceManifest.nodes || []) {
|
||||
if (!/^GLS-\d{4}$/.test(node.protocol_id)
|
||||
|| !/^HLP-GLS-REF-\d{4}$/.test(node.node_number)
|
||||
|| !node.title
|
||||
|| !['NORMATIVE_REFERENCE', 'SCHEMA_IMPORT', 'EVIDENCE_ONLY'].includes(node.reference_kind)
|
||||
|| node.source_state !== 'ROADMAP_REFERENCE_ONLY'
|
||||
|| !referenceIds.add(node.protocol_id)
|
||||
|| !referenceNodeNumbers.add(node.node_number)) {
|
||||
throw new Error(`invalid or duplicated numbered reference node: ${node.protocol_id || 'UNKNOWN'}`)
|
||||
}
|
||||
const evidencePaths = []
|
||||
for (const relative of allSourceFiles) {
|
||||
if (!/\.(?:hdlp|md|json|ya?ml)$/.test(relative)) continue
|
||||
const raw = await readFile(path.join(sourceRoot, relative), 'utf8')
|
||||
if (raw.includes(node.protocol_id)) evidencePaths.push(`gls/${relative}`)
|
||||
}
|
||||
if (evidencePaths.length === 0) throw new Error(`numbered reference node has no REPO-012 evidence: ${node.protocol_id}`)
|
||||
numberedReferenceNodes.push({
|
||||
...node,
|
||||
execution_state: 'REFERENCE_ONLY_NOT_EXECUTABLE',
|
||||
evidence_paths: evidencePaths.sort().slice(0, 12),
|
||||
})
|
||||
}
|
||||
if (missingSourceTargets.length !== referenceIds.size
|
||||
|| missingSourceTargets.some((id) => !referenceIds.has(id))
|
||||
|| [...referenceIds].some((id) => !missingSourceTargets.includes(id))) {
|
||||
throw new Error(`numbered reference registry coverage mismatch: missing=${missingSourceTargets.join(',')} registered=${[...referenceIds].sort().join(',')}`)
|
||||
}
|
||||
|
||||
const protocols = []
|
||||
for (const [id, source] of [...selectedSource.entries()].sort(([left], [right]) => left.localeCompare(right))) {
|
||||
const heading = source.raw.split(/\r?\n/).find((line) => line.startsWith('#') && line.includes(id))
|
||||
|
|
@ -280,6 +349,8 @@ for (const [id, source] of [...selectedSource.entries()].sort(([left], [right])
|
|||
enters_runtime_graph: false,
|
||||
target_registered: protocolRegistryIds.has(target),
|
||||
target_numbered_source_available: knownSourceIds.has(target),
|
||||
target_number_coordinate_available: knownSourceIds.has(target) || referenceIds.has(target),
|
||||
target_resolution: knownSourceIds.has(target) ? 'NUMBERED_PROTOCOL_SOURCE' : referenceIds.has(target) ? 'NUMBERED_REFERENCE_NODE' : 'UNRESOLVED',
|
||||
})),
|
||||
...(projection?.dependencies || []).map((target) => ({
|
||||
target,
|
||||
|
|
@ -288,18 +359,21 @@ for (const [id, source] of [...selectedSource.entries()].sort(([left], [right])
|
|||
enters_runtime_graph: true,
|
||||
target_registered: protocolRegistryIds.has(target),
|
||||
target_numbered_source_available: knownSourceIds.has(target),
|
||||
target_number_coordinate_available: knownSourceIds.has(target) || referenceIds.has(target),
|
||||
target_resolution: knownSourceIds.has(target) ? 'NUMBERED_PROTOCOL_SOURCE' : referenceIds.has(target) ? 'NUMBERED_REFERENCE_NODE' : 'UNRESOLVED',
|
||||
})),
|
||||
]
|
||||
const activationBlockers = []
|
||||
if (!projection) activationBlockers.push('NO_EXECUTABLE_ADAPTER')
|
||||
if (registrationState === 'DISCOVERED_UNRECONCILED') activationBlockers.push('REGISTRATION_NOT_RECONCILED')
|
||||
if (authorityConflict) activationBlockers.push('REGISTRATION_SOURCE_CONFLICT')
|
||||
if (legacyDependencies.some((target) => !knownSourceIds.has(target)) && !projection) activationBlockers.push('DEPENDENCY_NUMBERED_SOURCE_MISSING')
|
||||
if (legacyDependencies.some((target) => !knownSourceIds.has(target) && !referenceIds.has(target)) && !projection) activationBlockers.push('DEPENDENCY_NUMBER_COORDINATE_MISSING')
|
||||
protocols.push({
|
||||
id,
|
||||
title: cleanHeading(heading || id, id),
|
||||
source_status: sourceStatus(source.raw),
|
||||
source_path: `gls/${source.relative}`,
|
||||
source_format: source.source_format,
|
||||
source_sha256: createHash('sha256').update(source.raw).digest('hex'),
|
||||
alternate_source_count: source.alternate_source_count,
|
||||
registration: {
|
||||
|
|
@ -354,6 +428,7 @@ for (const protocol of protocols) {
|
|||
}
|
||||
const dependenciesNotInRegistry = [...legacyDependencyTargets].filter((id) => !protocolRegistryIds.has(id)).sort()
|
||||
const dependenciesWithoutNumberedSource = [...legacyDependencyTargets].filter((id) => !knownSourceIds.has(id)).sort()
|
||||
const unresolvedNumberReferences = dependenciesWithoutNumberedSource.filter((id) => !referenceIds.has(id))
|
||||
const numberedSourcesNotInProtocolRegistry = [...knownSourceIds].filter((id) => !protocolRegistryIds.has(id)).sort()
|
||||
const registry = {
|
||||
schema: 'hololake.gls-runtime-manifest/v2',
|
||||
|
|
@ -384,6 +459,10 @@ const registry = {
|
|||
legacy_dependency_target_count: legacyDependencyTargets.size,
|
||||
dependencies_not_in_protocol_registry: dependenciesNotInRegistry,
|
||||
dependencies_without_numbered_source: dependenciesWithoutNumberedSource,
|
||||
numbered_reference_node_count: numberedReferenceNodes.length,
|
||||
unresolved_number_references: unresolvedNumberReferences,
|
||||
unresolved_number_reference_count: unresolvedNumberReferences.length,
|
||||
every_dependency_has_number_coordinate: unresolvedNumberReferences.length === 0,
|
||||
numbered_sources_not_in_protocol_registry: numberedSourcesNotInProtocolRegistry,
|
||||
legacy_dependency_cycles: legacyDependencyCycles,
|
||||
source_reference_cycles: legacyDependencyCycles,
|
||||
|
|
@ -395,8 +474,10 @@ const registry = {
|
|||
protocol_count: protocols.length,
|
||||
executable_projection_count: executableCount,
|
||||
inventoried_not_executable_count: protocols.length - executableCount,
|
||||
number_coordinate_count: protocols.length + numberedReferenceNodes.length,
|
||||
numbered_reference_nodes: numberedReferenceNodes,
|
||||
protocols,
|
||||
}
|
||||
|
||||
await writeFile(output, `${JSON.stringify(registry, null, 2)}\n`)
|
||||
console.log(`GLS_RUNTIME_MANIFEST_COMPILED protocols=${protocols.length} registered=${protocolRegistryIds.size} executable=${executableCount} legacy_cycles=${legacyDependencyCycles.length} output=${output}`)
|
||||
console.log(`GLS_RUNTIME_MANIFEST_COMPILED protocols=${protocols.length} references=${numberedReferenceNodes.length} unresolved=${unresolvedNumberReferences.length} registered=${protocolRegistryIds.size} executable=${executableCount} legacy_cycles=${legacyDependencyCycles.length} output=${output}`)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ const paths = {
|
|||
identity: resolve(root, 'contracts/zero-core-numbering-kernel.json'),
|
||||
webview: resolve(root, 'contracts/numbered-ipc-registry.json'),
|
||||
broker: resolve(root, 'contracts/direct-local-broker-numbered-registry.json'),
|
||||
gls: resolve(root, 'contracts/gls-runtime-registry.json'),
|
||||
output: resolve(root, 'generated/unified-number-coordinate-tree.json'),
|
||||
}
|
||||
|
||||
|
|
@ -23,6 +24,7 @@ export function compileUnifiedNumberTree() {
|
|||
const identity = readSource(paths.identity)
|
||||
const webview = readSource(paths.webview)
|
||||
const broker = readSource(paths.broker)
|
||||
const gls = readSource(paths.gls)
|
||||
const routes = [
|
||||
...webview.value.operations.map((route) => ({
|
||||
transport: 'TAURI_WEBVIEW_NUMBERED_IPC',
|
||||
|
|
@ -64,8 +66,48 @@ export function compileUnifiedNumberTree() {
|
|||
if (routes.length !== uniquePaths.size || routes.length !== uniqueOperations.size) {
|
||||
throw new Error('HOLOLAKE_UNIFIED_NUMBER_TREE_DUPLICATE_COORDINATE')
|
||||
}
|
||||
const identityNodes = identity.value.namespaces.map((namespace) => ({
|
||||
nodeKind: 'IDENTITY_NAMESPACE',
|
||||
nodeNumber: `HLP-IDENTITY-NS-${namespace.id}`,
|
||||
namespaceId: namespace.id,
|
||||
subjectKind: namespace.subject_kind,
|
||||
domainScope: namespace.domain_scope,
|
||||
admission: namespace.human_entry ? 'REGISTERED_HUMAN_NAMESPACE' : 'NON_HUMAN_NAMESPACE',
|
||||
executionState: 'AUTHORITY_RESOLUTION_ONLY',
|
||||
evidence: identity.value.authority.map_id,
|
||||
path: `HLP-NUMBER-WORLD-ROOT-001/IDENTITY/${namespace.id}`,
|
||||
})).sort((left, right) => left.path.localeCompare(right.path, 'en'))
|
||||
const protocolNodes = [
|
||||
...gls.value.protocols.map((protocol) => ({
|
||||
nodeKind: 'GLS_PROTOCOL_SOURCE',
|
||||
nodeNumber: protocol.id,
|
||||
protocolId: protocol.id,
|
||||
title: protocol.title,
|
||||
sourceState: protocol.source_format,
|
||||
executionState: protocol.projection_state,
|
||||
evidence: protocol.source_sha256,
|
||||
path: `HLP-NUMBER-WORLD-ROOT-001/GLS/SOURCE/${protocol.id}`,
|
||||
})),
|
||||
...gls.value.numbered_reference_nodes.map((reference) => ({
|
||||
nodeKind: 'GLS_REFERENCE_ONLY',
|
||||
nodeNumber: reference.node_number,
|
||||
protocolId: reference.protocol_id,
|
||||
title: reference.title,
|
||||
sourceState: reference.source_state,
|
||||
executionState: reference.execution_state,
|
||||
evidence: reference.evidence_paths[0],
|
||||
path: `HLP-NUMBER-WORLD-ROOT-001/GLS/REFERENCE/${reference.node_number}`,
|
||||
})),
|
||||
].sort((left, right) => left.path.localeCompare(right.path, 'en'))
|
||||
const allPaths = [...routes.map((route) => route.path), ...identityNodes.map((node) => node.path), ...protocolNodes.map((node) => node.path)]
|
||||
if (new Set(allPaths).size !== allPaths.length
|
||||
|| gls.value.reconciliation.unresolved_number_reference_count !== 0
|
||||
|| gls.value.reconciliation.every_dependency_has_number_coordinate !== true
|
||||
|| protocolNodes.some((node) => node.nodeKind === 'GLS_REFERENCE_ONLY' && node.executionState !== 'REFERENCE_ONLY_NOT_EXECUTABLE')) {
|
||||
throw new Error('HOLOLAKE_UNIFIED_NUMBER_TREE_INCOMPLETE_COVERAGE')
|
||||
}
|
||||
return {
|
||||
schema: 'hololake.unified-number-coordinate-tree/v1',
|
||||
schema: 'hololake.unified-number-coordinate-tree/v2',
|
||||
recordId: 'HLP-UNIFIED-NUMBER-TREE-001',
|
||||
state: 'MACHINE_COMPILED_STARTUP_ENFORCED',
|
||||
rootNumber: 'HLP-NUMBER-WORLD-ROOT-001',
|
||||
|
|
@ -84,6 +126,7 @@ export function compileUnifiedNumberTree() {
|
|||
{ recordId: identity.value.record_id, sha256: identity.sha256 },
|
||||
{ recordId: webview.value.record_id, sha256: webview.sha256 },
|
||||
{ recordId: broker.value.record_id, sha256: broker.sha256 },
|
||||
{ recordId: gls.value.record_id, sha256: gls.sha256 },
|
||||
],
|
||||
invariants: {
|
||||
numberIsStableCoordinateNotAuthority: true,
|
||||
|
|
@ -91,9 +134,18 @@ export function compileUnifiedNumberTree() {
|
|||
admissionIsSeparateFromIdentity: true,
|
||||
everyPhysicalCallHasNumberedRoute: true,
|
||||
everyAcceptedCallHasEvidenceClass: true,
|
||||
everyProtocolReferenceHasNumberCoordinate: true,
|
||||
referenceOnlyNodesNeverExecutable: true,
|
||||
unresolvedNumberReferenceCount: 0,
|
||||
mismatchedCoordinate: 'FAIL_CLOSED',
|
||||
},
|
||||
coordinateCount: routes.length + identityNodes.length + protocolNodes.length,
|
||||
routeCount: routes.length,
|
||||
identityNodeCount: identityNodes.length,
|
||||
protocolNodeCount: protocolNodes.length,
|
||||
referenceOnlyNodeCount: protocolNodes.filter((node) => node.nodeKind === 'GLS_REFERENCE_ONLY').length,
|
||||
identityNodes,
|
||||
protocolNodes,
|
||||
routes,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const starlakeStyles = read('src/modules/qoder-surface/starlake-surface.css')
|
|||
const traditional = read('src/modules/qoder-surface/TraditionalSurface.tsx')
|
||||
const traditionalStyles = read('src/modules/qoder-surface/traditional-surface.css')
|
||||
const visualBalance = read('src/modules/qoder-surface/visual-balance.ts')
|
||||
const layoutProfile = read('src/modules/qoder-surface/layout-profile.ts')
|
||||
|
||||
test('dynamic world surface is signed, opt-in and cannot mutate world facts', () => {
|
||||
assert.equal(modulePackage.manifest.moduleNumber, 'HLP-MOD-OFFICIAL-DYNAMIC-WORLD-SURFACE-0001')
|
||||
|
|
@ -37,7 +38,7 @@ test('climate query crosses the unique numbered route and fails closed before ac
|
|||
})
|
||||
|
||||
test('Qoder locked two-track surface is admitted without simulated product state', () => {
|
||||
assert.equal(contract.visual_lock.layout, 'QODER_LOCKED_STARLAKE_AND_TRADITIONAL_SURFACES_RESPONSIVELY_ADAPTED')
|
||||
assert.equal(contract.visual_lock.layout, 'QODER_VISUAL_LANGUAGE_SEMANTICALLY_REASSEMBLED_ON_RESPONSIVE_HOLOLAKE_SHELL')
|
||||
assert.equal(contract.visual_lock.language_world_themes.length, 5)
|
||||
assert.equal(contract.visual_lock.traditional_finishes.length, 8)
|
||||
assert.equal(contract.visual_lock.all_downstream_pages_inherit_active_surface_tokens, true)
|
||||
|
|
@ -45,6 +46,9 @@ test('Qoder locked two-track surface is admitted without simulated product state
|
|||
assert.match(frontend, /天气源暂不可用;湖面只使用北京时间,不生成假天气。/)
|
||||
assert.match(styles, /\.world-climate-veil/)
|
||||
assert.match(starlake, /ResizeObserver/)
|
||||
assert.match(starlake, /data-layout=\{layout\.profile\}/)
|
||||
assert.match(layoutProfile, /panoramic.*wide.*compact.*stacked/s)
|
||||
assert.doesNotMatch(starlake, /naturalScale|sideCenters|onDuty \? 2/)
|
||||
assert.match(starlakeStyles, /\.starlake-scene\.awake/)
|
||||
assert.match(traditional, /broadcasts\.map/)
|
||||
assert.match(traditionalStyles, /\.official-world\.surface-traditional/)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import fs from 'node:fs'
|
|||
import test from 'node:test'
|
||||
|
||||
const source = fs.readFileSync(new URL('../src/main.tsx', import.meta.url), 'utf8')
|
||||
const privateChannel = fs.readFileSync(new URL('../src/modules/private-channel/PrivateChannelSurface.tsx', import.meta.url), 'utf8')
|
||||
|
||||
test('Zhizhi remains absent from the public Fifth Domain card', () => {
|
||||
const publicCard = source.slice(source.indexOf("domain: 'FIFTH_DOMAIN'"), source.indexOf('const starPoints'))
|
||||
|
|
@ -23,7 +24,10 @@ test('the Eternal Lake Heart system body exposes both owned branches before chan
|
|||
assert.match(source, /title="爱之核心子系统" meta="责任主体 · 之之"/)
|
||||
assert.match(source, /title="光之湖" meta="人格体居所"/)
|
||||
assert.match(source, /worldStage === 'heartbeat'/)
|
||||
assert.match(source, /<h1>心跳核心频道<\/h1>/)
|
||||
assert.match(source, /<PrivateChannelSurface ownerName="冰朔" ownerNumber="ICE-GL∞"/)
|
||||
assert.match(privateChannel, /view === 'home' \? '心跳核心频道'/)
|
||||
assert.match(privateChannel, /PrivateChannelView = 'home' \| 'native' \| 'modules'/)
|
||||
assert.match(privateChannel, /private-water-bay/)
|
||||
})
|
||||
|
||||
test('knowledge belongs to Heartbeat Core while persona repositories belong to Light Lake', () => {
|
||||
|
|
@ -32,12 +36,22 @@ test('knowledge belongs to Heartbeat Core while persona repositories belong to L
|
|||
const toolStart = source.indexOf("worldStage === 'tool'", lightLakeStart)
|
||||
const heartbeat = source.slice(heartbeatStart, lightLakeStart)
|
||||
const lightLake = source.slice(lightLakeStart, toolStart)
|
||||
assert.match(heartbeat, /title="知识空间"/)
|
||||
assert.match(heartbeat, /nativeActions=\{privateNativeActions\}/)
|
||||
assert.match(source, /id: 'knowledge', title: '知识空间'/)
|
||||
assert.doesNotMatch(heartbeat, /人格体代码仓库|title="光之湖"/)
|
||||
assert.match(lightLake, /<h1>光之湖<\/h1>/)
|
||||
assert.match(lightLake, /title="人格体代码仓库"/)
|
||||
})
|
||||
|
||||
test('industry modules are installed furniture in the private home, not peer domains', () => {
|
||||
assert.match(source, /const privateInstalledModules: InstalledChannelModule\[\]/)
|
||||
assert.match(privateChannel, /已安装模块/)
|
||||
assert.match(privateChannel, /前往分域模块商城/)
|
||||
assert.match(privateChannel, /这里不属于主域、分域、零域或零感域/)
|
||||
assert.match(privateChannel, /任何反向访问都必须持有/)
|
||||
assert.doesNotMatch(source, /className="channel-education" title="教育工作台"/)
|
||||
})
|
||||
|
||||
test('Fifth Domain human numbers are paired with their own login account', () => {
|
||||
assert.match(source, /'ICE-GL∞': 'bingshuo'/)
|
||||
assert.match(source, /'ICE-GL-ZHI∞': 'zhizhi'/)
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ test('compiled GLS v2 manifest reconciles current registration sources without e
|
|||
|
||||
assert.equal(registry.schema, 'hololake.gls-runtime-manifest/v2')
|
||||
assert.equal(registry.source.repository, 'REPO-012')
|
||||
assert.equal(registry.source.commit, 'd5b1111fcaccaccf025070e531631f2b3cbb00cd')
|
||||
assert.equal(registry.source.commit, '104a5d73162bdf4a529701e65898e2bc2863ea9e')
|
||||
assert.equal(registry.source.authority_files.length, 4)
|
||||
assert.equal(registry.compiler.raw_protocol_text_executed, false)
|
||||
assert.equal(registry.compiler.arbitrary_protocol_code_allowed, false)
|
||||
assert.equal(registry.compiler.unprojected_protocol_behavior, 'INVENTORIED_NOT_EXECUTABLE')
|
||||
assert.equal(registry.compiler.source_dependency_behavior, 'TYPED_AUDIT_ONLY_NEVER_ACTIVATES')
|
||||
assert.equal(registry.protocol_count, 75)
|
||||
assert.equal(new Set(registry.protocols.map((protocol) => protocol.id)).size, 75)
|
||||
assert.equal(registry.protocol_count, 83)
|
||||
assert.equal(new Set(registry.protocols.map((protocol) => protocol.id)).size, 83)
|
||||
assert.ok(registry.protocols.every((protocol) => /^[a-f0-9]{64}$/.test(protocol.source_sha256)))
|
||||
assert.equal(registry.reconciliation.protocol_registry_id_count, 52)
|
||||
assert.equal(registry.reconciliation.existing_registered_count, 19)
|
||||
|
|
@ -24,13 +24,21 @@ test('compiled GLS v2 manifest reconciles current registration sources without e
|
|||
assert.equal(registry.reconciliation.registered_draft_not_started_count, 21)
|
||||
assert.equal(registry.reconciliation.legacy_dependency_target_count, 57)
|
||||
assert.equal(registry.reconciliation.dependencies_not_in_protocol_registry.length, 19)
|
||||
assert.equal(registry.reconciliation.dependencies_without_numbered_source.length, 24)
|
||||
assert.equal(registry.reconciliation.numbered_sources_not_in_protocol_registry.length, 31)
|
||||
assert.equal(registry.reconciliation.dependencies_without_numbered_source.length, 16)
|
||||
assert.equal(registry.reconciliation.numbered_reference_node_count, 16)
|
||||
assert.equal(registry.reconciliation.unresolved_number_reference_count, 0)
|
||||
assert.deepEqual(registry.reconciliation.unresolved_number_references, [])
|
||||
assert.equal(registry.reconciliation.every_dependency_has_number_coordinate, true)
|
||||
assert.equal(registry.reconciliation.numbered_sources_not_in_protocol_registry.length, 32)
|
||||
assert.equal(registry.reconciliation.legacy_dependency_cycles.length, 3)
|
||||
assert.equal(registry.reconciliation.discovered_unreconciled_count, 0)
|
||||
assert.equal(registry.reconciliation.authority_conflict_count, 0)
|
||||
assert.equal(registry.reconciliation.unclassified_source_dependency_count, 0)
|
||||
assert.equal(Object.values(registry.reconciliation.typed_source_dependency_counts).reduce((sum, count) => sum + count, 0), 183)
|
||||
assert.equal(registry.number_coordinate_count, 99)
|
||||
assert.equal(registry.numbered_reference_nodes.length, 16)
|
||||
assert.ok(registry.numbered_reference_nodes.every((node) => node.execution_state === 'REFERENCE_ONLY_NOT_EXECUTABLE'))
|
||||
assert.ok(registry.protocols.flatMap((protocol) => protocol.dependency_edges).every((edge) => edge.target_number_coordinate_available && ['NUMBERED_PROTOCOL_SOURCE', 'NUMBERED_REFERENCE_NODE'].includes(edge.target_resolution)))
|
||||
})
|
||||
|
||||
test('only explicit deterministic projections enter the runtime enforcement set', async () => {
|
||||
|
|
@ -48,7 +56,9 @@ test('only explicit deterministic projections enter the runtime enforcement set'
|
|||
assert.equal(protocols['GLS-0130'].implementation_stage, 'P6')
|
||||
assert.equal(protocols['GLS-0003'], undefined)
|
||||
assert.equal(registry.executable_projection_count, 25)
|
||||
assert.equal(registry.inventoried_not_executable_count, 50)
|
||||
assert.equal(registry.inventoried_not_executable_count, 58)
|
||||
assert.ok(registry.protocols.filter((protocol) => protocol.projection_state === 'EXECUTABLE_PROJECTION').every((protocol) => protocol.source_format === 'HDLP_PROTOCOL_SOURCE'))
|
||||
assert.ok(registry.protocols.filter((protocol) => protocol.source_format === 'LEGACY_MARKDOWN_EVIDENCE').every((protocol) => protocol.projection_state === 'INVENTORIED_NOT_EXECUTABLE'))
|
||||
})
|
||||
|
||||
test('P1 through P6 executable dependencies are explicit, typed, closed and acyclic', async () => {
|
||||
|
|
|
|||
|
|
@ -6,10 +6,20 @@ import { compileUnifiedNumberTree } from './compile-unified-number-tree.mjs'
|
|||
test('identity, webview and direct broker numbers compile into one unique evidence tree', () => {
|
||||
const generated = JSON.parse(readFileSync(new URL('../generated/unified-number-coordinate-tree.json', import.meta.url), 'utf8'))
|
||||
assert.deepEqual(generated, compileUnifiedNumberTree())
|
||||
assert.equal(generated.schema, 'hololake.unified-number-coordinate-tree/v2')
|
||||
assert.equal(generated.recordId, 'HLP-UNIFIED-NUMBER-TREE-001')
|
||||
assert.equal(generated.coordinateCount, 272)
|
||||
assert.equal(generated.routeCount, 169)
|
||||
assert.equal(generated.identityNodeCount, 4)
|
||||
assert.equal(generated.protocolNodeCount, 99)
|
||||
assert.equal(generated.referenceOnlyNodeCount, 16)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 169)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 272)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.equal(generated.invariants.everyProtocolReferenceHasNumberCoordinate, true)
|
||||
assert.equal(generated.invariants.referenceOnlyNodesNeverExecutable, true)
|
||||
assert.equal(generated.invariants.unresolvedNumberReferenceCount, 0)
|
||||
assert.ok(generated.protocolNodes.filter((node) => node.nodeKind === 'GLS_REFERENCE_ONLY').every((node) => node.executionState === 'REFERENCE_ONLY_NOT_EXECUTABLE'))
|
||||
assert.ok(generated.routes.every((route) => route.admission && route.evidence))
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ test('zero-core numbering kernel pins the canonical authority map and fails clos
|
|||
|
||||
assert.equal(contract.schema, 'hololake.zero-core-numbering-kernel/v1')
|
||||
assert.equal(contract.authority.map_id, 'GH-IDENTITY-AUTHORITY-MAP-001')
|
||||
assert.equal(contract.authority.source_commit, 'd5b1111fcaccaccf025070e531631f2b3cbb00cd')
|
||||
assert.equal(contract.authority.source_commit, '104a5d73162bdf4a529701e65898e2bc2863ea9e')
|
||||
assert.equal(contract.runtime.number_shape_is_authority, false)
|
||||
assert.equal(contract.runtime.unknown_number, 'FAIL_CLOSED')
|
||||
assert.equal(contract.runtime.automatic_identity_issuance, false)
|
||||
|
|
|
|||
Loading…
Reference in a new issue