feat: reconcile GLS registry into runtime manifest v2
This commit is contained in:
parent
b25597117c
commit
ca5d6f3f58
7 changed files with 4615 additions and 121 deletions
|
|
@ -1,20 +1,20 @@
|
|||
import { createHash } from 'node:crypto'
|
||||
import { readdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import { readFile, readdir, writeFile } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
const args = new Map()
|
||||
for (let index = 2; index < process.argv.length; index += 2) {
|
||||
args.set(process.argv[index], process.argv[index + 1])
|
||||
}
|
||||
for (let index = 2; index < process.argv.length; index += 2) args.set(process.argv[index], process.argv[index + 1])
|
||||
|
||||
const sourceRoot = args.get('--source-root')
|
||||
const explicitSourceRoot = args.get('--source-root')
|
||||
const repoRoot = args.get('--repo-root') || (explicitSourceRoot ? path.dirname(explicitSourceRoot) : null)
|
||||
const sourceRoot = explicitSourceRoot || (repoRoot ? path.join(repoRoot, 'gls') : null)
|
||||
const sourceCommit = args.get('--source-commit')
|
||||
const output = args.get('--output')
|
||||
const projectionsPath = args.get('--projections')
|
||||
|
||||
if (!sourceRoot || !sourceCommit || !output || !projectionsPath) {
|
||||
throw new Error('usage: compile-gls-runtime-registry.mjs --source-root <REPO-012/gls> --source-commit <sha> --output <registry.json> --projections <projections.json>')
|
||||
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 (!/^[a-f0-9]{40}$/.test(sourceCommit)) throw new Error('source commit must be a full SHA-1')
|
||||
|
||||
|
|
@ -29,6 +29,10 @@ async function walk(directory, prefix = '') {
|
|||
return paths
|
||||
}
|
||||
|
||||
async function readRequired(relative) {
|
||||
return readFile(path.join(repoRoot, relative), 'utf8')
|
||||
}
|
||||
|
||||
function sourceRank(relative) {
|
||||
if (!relative.includes('/')) return 0
|
||||
if (relative.startsWith('standards/')) return 1
|
||||
|
|
@ -37,11 +41,7 @@ function sourceRank(relative) {
|
|||
}
|
||||
|
||||
function cleanHeading(line, id) {
|
||||
return line
|
||||
.replace(/^#+\s*/, '')
|
||||
.replaceAll('**', '')
|
||||
.replace(new RegExp(`^${id}\\s*[·::-]?\\s*`), '')
|
||||
.trim() || id
|
||||
return line.replace(/^#+\s*/, '').replaceAll('**', '').replace(new RegExp(`^${id}\\s*[·::-]?\\s*`), '').trim() || id
|
||||
}
|
||||
|
||||
function sourceStatus(raw) {
|
||||
|
|
@ -50,16 +50,159 @@ function sourceStatus(raw) {
|
|||
return line.replace(/^\s*(?:>|[-*]\s*)?(?:状态|Status)\s*[::]\s*/i, '').replaceAll('`', '').trim()
|
||||
}
|
||||
|
||||
function sourceDependencies(raw) {
|
||||
const match = raw.match(/^\s*depends:\s*\[([^\]]*)\]/m)
|
||||
return [...new Set(match?.[1].match(/GLS-\d{4}/g) || [])].sort()
|
||||
}
|
||||
|
||||
function contractKind(family, projectionKind) {
|
||||
if (projectionKind) return projectionKind
|
||||
const kinds = {
|
||||
GLS_ENGINEERING: 'COMPILER_OR_INTERMEDIATE_REPRESENTATION',
|
||||
GLP: 'MESSAGE_SCHEMA_OR_SYNC_CONTRACT',
|
||||
GLP_CONTROL_PLANE: 'CONTROL_PLANE_STATE_MACHINE',
|
||||
GLP_WITNESS: 'APPEND_ONLY_EVIDENCE_LEDGER',
|
||||
HLDP: 'LANGUAGE_PROGRAM_PROFILE',
|
||||
GLS_IMPLEMENTATION: 'ADAPTER_MODEL_OR_MODULE_CONTRACT',
|
||||
AGE: 'EXECUTION_BODY_LIFECYCLE_STATE_MACHINE',
|
||||
AGE_OS: 'RESOURCE_SCHEDULER',
|
||||
AGE_AUTONOMOUS_RUNTIME: 'TIME_OR_CAPABILITY_EXTENSION_RUNTIME',
|
||||
GUANGHU_WORLD: 'WORLD_BOOT_AND_RECOVERY_STATE_MACHINE',
|
||||
GUANGHU_NATIVE_ENGINEERING: 'NATIVE_QUALITY_GATE',
|
||||
GUANGHU_NATIVE_OS: 'NATIVE_NODE_RUNTIME_CONTRACT',
|
||||
GUANGHU_NATIVE_STORAGE: 'NATIVE_STORAGE_CONTRACT',
|
||||
GUANGHU_PERSONA_GESTATION: 'GESTATIONAL_INGRESS_OR_REVIEW_PIPELINE',
|
||||
GUANGHU_LANGUAGE_WORLD: 'LANGUAGE_WORLD_BOUNDARY_GUARD',
|
||||
}
|
||||
return kinds[family] || 'UNCLASSIFIED_PROTOCOL_SOURCE'
|
||||
}
|
||||
|
||||
function parseTableAuthorities(raw, authorityKind) {
|
||||
const results = []
|
||||
for (const line of raw.split(/\r?\n/)) {
|
||||
const id = line.match(/^\|\s*(GLS-\d{4})\s*\|/)?.[1]
|
||||
if (!id) continue
|
||||
results.push({
|
||||
id,
|
||||
authority_kind: authorityKind,
|
||||
declared_source_path: line.match(/`(gls\/[^`]+\.hdlp)`/)?.[1] || null,
|
||||
})
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
function parseSourceManifest(raw) {
|
||||
const lines = raw.split(/\r?\n/)
|
||||
const results = []
|
||||
for (let index = 0; index < lines.length; index += 1) {
|
||||
const match = lines[index].match(/^\s*-\s+id:\s*["']?(GLS-\d{4})["']?\s*$/)
|
||||
if (!match) continue
|
||||
let sourcePath = null
|
||||
for (let cursor = index + 1; cursor < lines.length && cursor <= index + 12; cursor += 1) {
|
||||
if (/^\s*-\s+id:/.test(lines[cursor])) break
|
||||
sourcePath ||= lines[cursor].match(/^\s*source_path:\s*["']?(gls\/[^"']+\.hdlp)["']?\s*$/)?.[1] || null
|
||||
}
|
||||
results.push({ id: match[1], authority_kind: 'SOURCE_MANIFEST', declared_source_path: sourcePath })
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
function stronglyConnectedComponents(graph) {
|
||||
let nextIndex = 0
|
||||
const indices = new Map()
|
||||
const lowLinks = new Map()
|
||||
const stack = []
|
||||
const onStack = new Set()
|
||||
const components = []
|
||||
function visit(id) {
|
||||
indices.set(id, nextIndex)
|
||||
lowLinks.set(id, nextIndex)
|
||||
nextIndex += 1
|
||||
stack.push(id)
|
||||
onStack.add(id)
|
||||
for (const target of graph.get(id) || []) {
|
||||
if (!graph.has(target)) continue
|
||||
if (!indices.has(target)) {
|
||||
visit(target)
|
||||
lowLinks.set(id, Math.min(lowLinks.get(id), lowLinks.get(target)))
|
||||
} else if (onStack.has(target)) lowLinks.set(id, Math.min(lowLinks.get(id), indices.get(target)))
|
||||
}
|
||||
if (lowLinks.get(id) !== indices.get(id)) return
|
||||
const component = []
|
||||
let current
|
||||
do {
|
||||
current = stack.pop()
|
||||
onStack.delete(current)
|
||||
component.push(current)
|
||||
} while (current !== id)
|
||||
if (component.length > 1 || (graph.get(id) || []).includes(id)) components.push(component.sort())
|
||||
}
|
||||
for (const id of [...graph.keys()].sort()) if (!indices.has(id)) visit(id)
|
||||
return components.sort((left, right) => left[0].localeCompare(right[0]))
|
||||
}
|
||||
|
||||
const projectionManifest = JSON.parse(await readFile(projectionsPath, 'utf8'))
|
||||
if (projectionManifest.schema !== 'hololake.gls-executable-projections/v1' || projectionManifest.source_commit !== sourceCommit) {
|
||||
throw new Error('projection manifest does not match the selected REPO-012 source commit')
|
||||
}
|
||||
|
||||
const protocolRegistryPath = 'gls/GLS-PROTOCOL-REGISTRY.json'
|
||||
const glsEntryPath = 'gls/GLS-ENTRY.hdlp'
|
||||
const sourceManifestPath = 'gls/SOURCE-MANIFEST.yml'
|
||||
const architectureCatalogPath = 'gls/GLS-ARCHITECTURE-CATALOG.hdlp'
|
||||
const protocolRegistryRaw = await readRequired(protocolRegistryPath)
|
||||
const glsEntryRaw = await readRequired(glsEntryPath)
|
||||
const sourceManifestRaw = await readRequired(sourceManifestPath)
|
||||
const architectureCatalogRaw = await readRequired(architectureCatalogPath)
|
||||
const protocolRegistry = JSON.parse(protocolRegistryRaw)
|
||||
|
||||
const authorityFiles = [
|
||||
[protocolRegistryPath, protocolRegistryRaw, 'PROTOCOL_REGISTRY'],
|
||||
[glsEntryPath, glsEntryRaw, 'GLS_ENTRY'],
|
||||
[sourceManifestPath, sourceManifestRaw, 'SOURCE_MANIFEST'],
|
||||
[architectureCatalogPath, architectureCatalogRaw, 'ARCHITECTURE_CATALOG'],
|
||||
].map(([source_path, raw, authority_kind]) => ({
|
||||
authority_kind,
|
||||
source_path,
|
||||
source_sha256: createHash('sha256').update(raw).digest('hex'),
|
||||
}))
|
||||
|
||||
const registryMetadata = new Map()
|
||||
const authorityDeclarations = new Map()
|
||||
function addAuthority(declaration) {
|
||||
const declarations = authorityDeclarations.get(declaration.id) || []
|
||||
if (!declarations.some((existing) => existing.authority_kind === declaration.authority_kind)) declarations.push(declaration)
|
||||
authorityDeclarations.set(declaration.id, declarations)
|
||||
}
|
||||
|
||||
for (const entry of protocolRegistry.existing_registered || []) {
|
||||
registryMetadata.set(entry.id, { ...entry, registry_section: 'existing_registered' })
|
||||
addAuthority({ id: entry.id, authority_kind: 'PROTOCOL_REGISTRY', declared_source_path: entry.source || null })
|
||||
}
|
||||
for (const entry of protocolRegistry.registered_draft_protocols || []) {
|
||||
registryMetadata.set(entry.id, { ...entry, registry_section: 'registered_draft_protocols' })
|
||||
addAuthority({ id: entry.id, authority_kind: 'PROTOCOL_REGISTRY', declared_source_path: entry.source || null })
|
||||
}
|
||||
for (const declaration of parseTableAuthorities(glsEntryRaw, 'GLS_ENTRY')) addAuthority(declaration)
|
||||
for (const declaration of parseSourceManifest(sourceManifestRaw)) addAuthority(declaration)
|
||||
for (const declaration of parseTableAuthorities(architectureCatalogRaw, 'ARCHITECTURE_CATALOG')) addAuthority(declaration)
|
||||
|
||||
const routingReferences = new Map()
|
||||
const routingRoot = path.join(repoRoot, 'routing')
|
||||
for (const relative of await walk(routingRoot)) {
|
||||
if (!/\.(?:json|hdlp|md|yml|yaml)$/.test(relative)) continue
|
||||
const raw = await readFile(path.join(routingRoot, relative), 'utf8')
|
||||
for (const id of new Set(raw.match(/GLS-\d{4}/g) || [])) {
|
||||
const refs = routingReferences.get(id) || []
|
||||
refs.push(`routing/${relative}`)
|
||||
routingReferences.set(id, refs)
|
||||
}
|
||||
}
|
||||
|
||||
const candidates = (await walk(sourceRoot))
|
||||
.map((relative) => ({ relative, match: path.basename(relative).match(/^(GLS-\d{4}).*\.hdlp$/) }))
|
||||
.filter((item) => item.match)
|
||||
.map((item) => ({ id: item.match[1], relative: item.relative }))
|
||||
|
||||
const grouped = new Map()
|
||||
for (const candidate of candidates) {
|
||||
const group = grouped.get(candidate.id) || []
|
||||
|
|
@ -67,25 +210,96 @@ for (const candidate of candidates) {
|
|||
grouped.set(candidate.id, group)
|
||||
}
|
||||
|
||||
const protocols = []
|
||||
for (const [id, sources] of [...grouped.entries()].sort(([left], [right]) => left.localeCompare(right))) {
|
||||
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 raw = await readFile(path.join(sourceRoot, relative), 'utf8')
|
||||
const heading = raw.split(/\r?\n/).find((line) => line.startsWith('#') && line.includes(id))
|
||||
selectedSource.set(id, {
|
||||
relative,
|
||||
raw: await readFile(path.join(sourceRoot, relative), 'utf8'),
|
||||
alternate_source_count: sources.length - 1,
|
||||
})
|
||||
}
|
||||
|
||||
const 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()
|
||||
const draftGraph = new Map()
|
||||
for (const id of draftIds) {
|
||||
const dependencies = sourceDependencies(selectedSource.get(id)?.raw || '')
|
||||
draftGraph.set(id, dependencies.filter((target) => draftIds.has(target)))
|
||||
for (const target of dependencies) legacyDependencyTargets.add(target)
|
||||
}
|
||||
const legacyDependencyCycles = stronglyConnectedComponents(draftGraph)
|
||||
|
||||
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))
|
||||
const projection = projectionManifest.projections[id]
|
||||
const metadata = registryMetadata.get(id) || null
|
||||
const authorities = (authorityDeclarations.get(id) || []).sort((left, right) => left.authority_kind.localeCompare(right.authority_kind))
|
||||
const declaredPaths = [...new Set(authorities.map((entry) => entry.declared_source_path).filter(Boolean))]
|
||||
const authorityConflict = declaredPaths.length > 1
|
||||
const registrationState = authorityConflict
|
||||
? 'REGISTRATION_CONFLICT'
|
||||
: authorities.some((entry) => entry.authority_kind === 'PROTOCOL_REGISTRY')
|
||||
? 'REGISTERED_PROTOCOL_REGISTRY'
|
||||
: authorities.length > 0
|
||||
? 'REGISTERED_OTHER_CANONICAL_INDEX'
|
||||
: 'DISCOVERED_UNRECONCILED'
|
||||
const legacyDependencies = sourceDependencies(source.raw)
|
||||
const dependencyEdges = [
|
||||
...legacyDependencies.map((target) => ({
|
||||
target,
|
||||
edge_kind: 'LEGACY_UNTYPED_REFERENCE',
|
||||
declared_by: `gls/${source.relative}`,
|
||||
enters_runtime_graph: false,
|
||||
target_registered: protocolRegistryIds.has(target),
|
||||
target_numbered_source_available: knownSourceIds.has(target),
|
||||
})),
|
||||
...(projection?.dependencies || []).map((target) => ({
|
||||
target,
|
||||
edge_kind: 'RUNTIME_REQUIRES',
|
||||
declared_by: 'contracts/gls-executable-projections.json',
|
||||
enters_runtime_graph: true,
|
||||
target_registered: protocolRegistryIds.has(target),
|
||||
target_numbered_source_available: knownSourceIds.has(target),
|
||||
})),
|
||||
]
|
||||
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.length > 0 && !projection) activationBlockers.push('LEGACY_DEPENDENCIES_REQUIRE_TYPED_REVIEW')
|
||||
if (legacyDependencies.some((target) => !knownSourceIds.has(target)) && !projection) activationBlockers.push('DEPENDENCY_NUMBERED_SOURCE_MISSING')
|
||||
protocols.push({
|
||||
id,
|
||||
title: cleanHeading(heading || id, id),
|
||||
source_status: sourceStatus(raw),
|
||||
source_path: `gls/${relative}`,
|
||||
source_sha256: createHash('sha256').update(raw).digest('hex'),
|
||||
alternate_source_count: sources.length - 1,
|
||||
source_status: sourceStatus(source.raw),
|
||||
source_path: `gls/${source.relative}`,
|
||||
source_sha256: createHash('sha256').update(source.raw).digest('hex'),
|
||||
alternate_source_count: source.alternate_source_count,
|
||||
registration: {
|
||||
state: registrationState,
|
||||
authorities,
|
||||
declared_source_paths: declaredPaths,
|
||||
routing_reference_count: (routingReferences.get(id) || []).length,
|
||||
},
|
||||
maturity: {
|
||||
registry_section: metadata?.registry_section || null,
|
||||
registry_status: metadata?.status || null,
|
||||
family: metadata?.family || null,
|
||||
implementation_evidence: metadata?.implementation || null,
|
||||
},
|
||||
contract_kind: contractKind(metadata?.family, projection?.projection_kind),
|
||||
projection_state: projection ? 'EXECUTABLE_PROJECTION' : 'INVENTORIED_NOT_EXECUTABLE',
|
||||
projection_kind: projection?.projection_kind || null,
|
||||
adapter: projection?.adapter || null,
|
||||
event_kinds: projection?.event_kinds || [],
|
||||
dependencies: projection?.dependencies || [],
|
||||
dependency_edges: dependencyEdges,
|
||||
activation_blockers: activationBlockers,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -93,12 +307,9 @@ const known = new Set(protocols.map((protocol) => protocol.id))
|
|||
for (const [id, projection] of Object.entries(projectionManifest.projections)) {
|
||||
if (!known.has(id)) throw new Error(`projection references an unknown protocol: ${id}`)
|
||||
for (const dependency of projection.dependencies) {
|
||||
if (!projectionManifest.projections[dependency]) {
|
||||
throw new Error(`${id} depends on a protocol without an executable projection: ${dependency}`)
|
||||
}
|
||||
if (!projectionManifest.projections[dependency]) throw new Error(`${id} depends on a protocol without an executable projection: ${dependency}`)
|
||||
}
|
||||
}
|
||||
|
||||
const visiting = new Set()
|
||||
const visited = new Set()
|
||||
function visit(id) {
|
||||
|
|
@ -112,13 +323,17 @@ function visit(id) {
|
|||
for (const id of Object.keys(projectionManifest.projections)) visit(id)
|
||||
|
||||
const executableCount = protocols.filter((protocol) => protocol.projection_state === 'EXECUTABLE_PROJECTION').length
|
||||
const dependenciesNotInRegistry = [...legacyDependencyTargets].filter((id) => !protocolRegistryIds.has(id)).sort()
|
||||
const dependenciesWithoutNumberedSource = [...legacyDependencyTargets].filter((id) => !knownSourceIds.has(id)).sort()
|
||||
const numberedSourcesNotInProtocolRegistry = [...knownSourceIds].filter((id) => !protocolRegistryIds.has(id)).sort()
|
||||
const registry = {
|
||||
schema: 'hololake.gls-protocol-runtime-registry/v1',
|
||||
record_id: 'HLP-GLS-PROTOCOL-RUNTIME-001',
|
||||
schema: 'hololake.gls-runtime-manifest/v2',
|
||||
record_id: 'HLP-GLS-RUNTIME-MANIFEST-002',
|
||||
source: {
|
||||
repository: 'REPO-012',
|
||||
commit: sourceCommit,
|
||||
root: 'gls',
|
||||
authority_files: authorityFiles,
|
||||
},
|
||||
compiler: {
|
||||
source_protocol_is_human_and_machine_authority: true,
|
||||
|
|
@ -126,9 +341,25 @@ const registry = {
|
|||
arbitrary_protocol_code_allowed: false,
|
||||
executable_projection_requires_explicit_adapter: true,
|
||||
unprojected_protocol_behavior: 'INVENTORIED_NOT_EXECUTABLE',
|
||||
dependency_cycles: 'REJECT',
|
||||
legacy_untyped_dependency_behavior: 'AUDIT_ONLY_BLOCKS_NEW_ACTIVATION',
|
||||
runtime_graph_source: 'EXPLICIT_EXECUTABLE_PROJECTIONS_ONLY',
|
||||
runtime_dependency_cycles: 'REJECT',
|
||||
unknown_protocol: 'FAIL_CLOSED',
|
||||
},
|
||||
reconciliation: {
|
||||
numbered_protocol_count: protocols.length,
|
||||
protocol_registry_id_count: protocolRegistryIds.size,
|
||||
existing_registered_count: (protocolRegistry.existing_registered || []).length,
|
||||
registered_draft_count: (protocolRegistry.registered_draft_protocols || []).length,
|
||||
registered_draft_not_started_count: (protocolRegistry.registered_draft_protocols || []).filter((entry) => entry.implementation === 'NOT_STARTED').length,
|
||||
legacy_dependency_target_count: legacyDependencyTargets.size,
|
||||
dependencies_not_in_protocol_registry: dependenciesNotInRegistry,
|
||||
dependencies_without_numbered_source: dependenciesWithoutNumberedSource,
|
||||
numbered_sources_not_in_protocol_registry: numberedSourcesNotInProtocolRegistry,
|
||||
legacy_dependency_cycles: legacyDependencyCycles,
|
||||
discovered_unreconciled_count: protocols.filter((protocol) => protocol.registration.state === 'DISCOVERED_UNRECONCILED').length,
|
||||
authority_conflict_count: protocols.filter((protocol) => protocol.registration.state === 'REGISTRATION_CONFLICT').length,
|
||||
},
|
||||
protocol_count: protocols.length,
|
||||
executable_projection_count: executableCount,
|
||||
inventoried_not_executable_count: protocols.length - executableCount,
|
||||
|
|
@ -136,4 +367,4 @@ const registry = {
|
|||
}
|
||||
|
||||
await writeFile(output, `${JSON.stringify(registry, null, 2)}\n`)
|
||||
console.log(`GLS_RUNTIME_REGISTRY_COMPILED protocols=${protocols.length} executable=${executableCount} output=${output}`)
|
||||
console.log(`GLS_RUNTIME_MANIFEST_COMPILED protocols=${protocols.length} registered=${protocolRegistryIds.size} executable=${executableCount} legacy_cycles=${legacyDependencyCycles.length} output=${output}`)
|
||||
|
|
|
|||
|
|
@ -4,18 +4,31 @@ import test from 'node:test'
|
|||
|
||||
const registryUrl = new URL('../contracts/gls-runtime-registry.json', import.meta.url)
|
||||
|
||||
test('compiled GLS registry inventories every current numbered protocol without executing raw text', async () => {
|
||||
test('compiled GLS v2 manifest reconciles current registration sources without executing raw text', async () => {
|
||||
const registry = JSON.parse(await readFile(registryUrl, 'utf8'))
|
||||
|
||||
assert.equal(registry.schema, 'hololake.gls-protocol-runtime-registry/v1')
|
||||
assert.equal(registry.schema, 'hololake.gls-runtime-manifest/v2')
|
||||
assert.equal(registry.source.repository, 'REPO-012')
|
||||
assert.equal(registry.source.commit, '2598fbfba8caf64c7ab9740a3036c5aab977502e')
|
||||
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.legacy_untyped_dependency_behavior, 'AUDIT_ONLY_BLOCKS_NEW_ACTIVATION')
|
||||
assert.equal(registry.protocol_count, 75)
|
||||
assert.equal(new Set(registry.protocols.map((protocol) => protocol.id)).size, 75)
|
||||
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)
|
||||
assert.equal(registry.reconciliation.registered_draft_count, 33)
|
||||
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.legacy_dependency_cycles.length, 3)
|
||||
assert.equal(registry.reconciliation.discovered_unreconciled_count, 0)
|
||||
assert.equal(registry.reconciliation.authority_conflict_count, 0)
|
||||
})
|
||||
|
||||
test('only explicit deterministic projections enter the runtime enforcement set', async () => {
|
||||
|
|
@ -25,6 +38,11 @@ test('only explicit deterministic projections enter the runtime enforcement set'
|
|||
assert.equal(protocols['GLS-0253'].projection_state, 'EXECUTABLE_PROJECTION')
|
||||
assert.equal(protocols['GLS-0253'].adapter, 'zero-core-numbering')
|
||||
assert.ok(protocols['GLS-0253'].event_kinds.includes('IDENTITY_ROUTE'))
|
||||
assert.ok(protocols['GLS-0253'].dependency_edges.every((edge) => edge.edge_kind === 'RUNTIME_REQUIRES'))
|
||||
assert.equal(protocols['GLS-0130'].registration.state, 'REGISTERED_PROTOCOL_REGISTRY')
|
||||
assert.equal(protocols['GLS-0130'].contract_kind, 'COMPILER_OR_INTERMEDIATE_REPRESENTATION')
|
||||
assert.ok(protocols['GLS-0130'].dependency_edges.some((edge) => edge.target === 'GLS-0131' && edge.edge_kind === 'LEGACY_UNTYPED_REFERENCE' && !edge.enters_runtime_graph))
|
||||
assert.ok(protocols['GLS-0130'].activation_blockers.includes('LEGACY_DEPENDENCIES_REQUIRE_TYPED_REVIEW'))
|
||||
assert.equal(protocols['GLS-0003'], undefined)
|
||||
assert.equal(registry.executable_projection_count, 4)
|
||||
assert.equal(registry.inventoried_not_executable_count, 71)
|
||||
|
|
|
|||
Loading…
Reference in a new issue