feat: embed complete GLS protocol kernel in HoloLake

This commit is contained in:
冰朔 2026-08-17 17:56:47 +08:00
commit b8d08fb620
15 changed files with 3515 additions and 485 deletions

View file

@ -97,11 +97,36 @@ interface GlsProtocolRuntimeSnapshot {
legacyDependencyCycleCount: number
discoveredUnreconciledCount: number
authorityConflictCount: number
typedSourceDependencyCount: number
unclassifiedSourceDependencyCount: number
implementationStageCount: number
activeAdapters: string[]
rawProtocolTextExecuted: boolean
arbitraryProtocolCodeAllowed: boolean
unprojectedProtocolBehavior: string
}
interface GlsKernelStage { id: string; state: string; protocols: string[] }
interface GlsNodeAssembly { protocolId: string; target: string; state: string; sourceEvidenceNode: string }
interface GlsProtocolKernelSnapshot {
state: string
contractId: string
sourceCommit: string
executableProtocolCount: number
implementedStageCount: number
decisionReceiptCount: number
allowCount: number
denyCount: number
ambiguousCount: number
unverifiedCount: number
lastReceiptSha256: string
stages: GlsKernelStage[]
p7NodeAssemblies: GlsNodeAssembly[]
p7VerifiedPhysicalCapabilityCount: number
rawProtocolTextExecuted: boolean
modelCanOverrideDecision: boolean
bootstrapCompilerSelfCheck: string
bootstrapGoldenGirSha256: string
}
interface PersonalChannelIdentity { humanSubjectId: string; displayName: string; channelId: string; createdAtUnixMs: number }
interface PersonalChannelModule { moduleId: string; kind: string; displayName: string; state: string; installedAtUnixMs: number; timeZone: string; calendarName: string; clockVerification: string }
interface LoginSession { username: string; host: string; domain: string; signedInAtUnixMs: number }
@ -616,6 +641,7 @@ function HoloLakeApp() {
const [developmentLane, setDevelopmentLane] = useState<DevelopmentWriteLaneStatus | null>(null)
const [numberingKernel, setNumberingKernel] = useState<ZeroCoreNumberingKernelSnapshot | null>(null)
const [glsRuntime, setGlsRuntime] = useState<GlsProtocolRuntimeSnapshot | null>(null)
const [glsKernel, setGlsKernel] = useState<GlsProtocolKernelSnapshot | null>(null)
const [enterpriseEntry, setEnterpriseEntry] = useState<EnterpriseEntry | null>(null)
const [enterpriseEntryBusy, setEnterpriseEntryBusy] = useState(false)
const [enterpriseReceiptBusy, setEnterpriseReceiptBusy] = useState(false)
@ -644,7 +670,7 @@ function HoloLakeApp() {
setBeijingCoordinate(startup.coordinate)
} catch { /* 联网失败时其余首页能力仍可启动。 */ }
const localAccountId = getOrCreateLocalId('hololake-local-account', 'human-local')
const [homeResult, personalResult, knowledgeResult, codeResult, eraResult, developmentResult, numberingResult, glsRuntimeResult] = await Promise.allSettled([
const [homeResult, personalResult, knowledgeResult, codeResult, eraResult, developmentResult, numberingResult, glsRuntimeResult, glsKernelResult] = await Promise.allSettled([
invoke<HomeStatus>('get_hololake_home_status'),
invoke<PersonalChannelSnapshot>('get_personal_channel_snapshot'),
invoke<KnowledgeSnapshot>('get_knowledge_snapshot'),
@ -653,6 +679,7 @@ function HoloLakeApp() {
invoke<DevelopmentWriteLaneStatus>('inspect_development_write_lane', { input: { accountId: localAccountId } }),
invoke<ZeroCoreNumberingKernelSnapshot>('get_zero_core_numbering_kernel'),
invoke<GlsProtocolRuntimeSnapshot>('get_gls_protocol_runtime'),
invoke<GlsProtocolKernelSnapshot>('get_gls_protocol_kernel'),
])
if (homeResult.status === 'fulfilled') setStatus(homeResult.value)
if (personalResult.status === 'fulfilled') setPersonal(personalResult.value)
@ -665,6 +692,7 @@ function HoloLakeApp() {
setDevelopmentLane(developmentResult.status === 'fulfilled' ? developmentResult.value : null)
setNumberingKernel(numberingResult.status === 'fulfilled' ? numberingResult.value : null)
setGlsRuntime(glsRuntimeResult.status === 'fulfilled' ? glsRuntimeResult.value : null)
setGlsKernel(glsKernelResult.status === 'fulfilled' ? glsKernelResult.value : null)
}, [])
const loadReceipts = useCallback(async () => {
try {
@ -1372,7 +1400,8 @@ function HoloLakeApp() {
<button className="secondary-button" type="button" disabled={serverPnccBusy} onClick={() => void refreshServerPncc()}>{serverPnccBusy ? '正在读取…' : '重新读取主控状态'}</button>
</section>
<section className="plain-panel"><header><div><h2> GH-PNCC </h2><p></p></div></header><dl className="evidence-list"><div><dt></dt><dd>{status.codeRepositoryMountCount}</dd></div><div><dt></dt><dd>{status.pnccReceiptCount}</dd></div><div><dt></dt><dd>{developmentLane?.state === 'ACTIVE' ? '已切入 HoloLake' : '等待受控载体'}</dd></div><div><dt>线</dt><dd>{developmentLane?.laneId || '—'}</dd></div><div><dt></dt><dd>{developmentLane?.ownerInstanceId || '—'}</dd></div><div><dt></dt><dd>{developmentLane?.state === 'ACTIVE' ? '开发执行环境已由 HoloLake 持有单写通道' : status.codeRepositoryMountCount > 0 && status.pnccReceiptCount > 0 ? '已有可核验运行记录' : '接口已接入,尚无完整运行记录'}</dd></div></dl></section>
<section className="plain-panel"><header><div><h2>GLS </h2><p></p></div><span className={glsRuntime?.state === 'ACTIVE_EXPLICIT_PROJECTIONS_ONLY' && glsRuntime.authorityConflictCount === 0 && glsRuntime.discoveredUnreconciledCount === 0 ? 'status-chip online' : 'status-chip'}>{glsRuntime ? '运行清单 v2 已加载' : '失败关闭'}</span></header>{glsRuntime ? <dl className="evidence-list"><div><dt></dt><dd>{glsRuntime.sourceRepository} · {glsRuntime.sourceCommit.slice(0, 12)}</dd></div><div><dt></dt><dd>{glsRuntime.protocolCount}</dd></div><div><dt></dt><dd>{glsRuntime.protocolRegistryIdCount}</dd></div><div><dt></dt><dd>{glsRuntime.registeredDraftCount} · {glsRuntime.registeredDraftNotStartedCount} </dd></div><div><dt></dt><dd>{glsRuntime.executableProjectionCount}</dd></div><div><dt></dt><dd>{glsRuntime.inventoriedNotExecutableCount}</dd></div><div><dt></dt><dd>{glsRuntime.legacyDependencyTargetCount} · {glsRuntime.legacyDependencyCycleCount} </dd></div><div><dt></dt><dd>{glsRuntime.dependencyGapCount}</dd></div><div><dt> / </dt><dd>{glsRuntime.authorityConflictCount} / {glsRuntime.discoveredUnreconciledCount}</dd></div><div><dt></dt><dd>{glsRuntime.rawProtocolTextExecuted ? '允许' : '禁止'}</dd></div><div><dt></dt><dd>{glsRuntime.arbitraryProtocolCodeAllowed ? '允许' : '禁止'}</dd></div></dl> : <p className="boundary-note">GLS </p>}</section>
<section className="plain-panel"><header><div><h2>GLS </h2><p></p></div><span className={glsRuntime?.state === 'ACTIVE_EXPLICIT_PROJECTIONS_ONLY' && glsRuntime.authorityConflictCount === 0 && glsRuntime.discoveredUnreconciledCount === 0 ? 'status-chip online' : 'status-chip'}>{glsRuntime ? '运行清单 v2 已加载' : '失败关闭'}</span></header>{glsRuntime ? <dl className="evidence-list"><div><dt></dt><dd>{glsRuntime.sourceRepository} · {glsRuntime.sourceCommit.slice(0, 12)}</dd></div><div><dt></dt><dd>{glsRuntime.protocolCount}</dd></div><div><dt></dt><dd>{glsRuntime.protocolRegistryIdCount}</dd></div><div><dt></dt><dd>{glsRuntime.registeredDraftCount} · {glsRuntime.registeredDraftNotStartedCount} </dd></div><div><dt></dt><dd>{glsRuntime.executableProjectionCount} · P0P6 {glsRuntime.implementationStageCount} </dd></div><div><dt></dt><dd>{glsRuntime.inventoriedNotExecutableCount}</dd></div><div><dt></dt><dd>{glsRuntime.typedSourceDependencyCount} · {glsRuntime.unclassifiedSourceDependencyCount}</dd></div><div><dt></dt><dd>{glsRuntime.legacyDependencyCycleCount} · </dd></div><div><dt></dt><dd>{glsRuntime.dependencyGapCount}</dd></div><div><dt> / </dt><dd>{glsRuntime.authorityConflictCount} / {glsRuntime.discoveredUnreconciledCount}</dd></div><div><dt></dt><dd>{glsRuntime.rawProtocolTextExecuted ? '允许' : '禁止'}</dd></div><div><dt></dt><dd>{glsRuntime.arbitraryProtocolCodeAllowed ? '允许' : '禁止'}</dd></div></dl> : <p className="boundary-note">GLS </p>}</section>
<section className="plain-panel"><header><div><h2>HoloLake </h2><p></p></div><span className={glsKernel?.state === 'P1_TO_P6_NATIVE_P7_FAIL_CLOSED' ? 'status-chip online' : 'status-chip'}>{glsKernel ? '随软件运行' : '失败关闭'}</span></header>{glsKernel ? <dl className="evidence-list"><div><dt>P1P6 </dt><dd>{glsKernel.executableProtocolCount} · {glsKernel.implementedStageCount} </dd></div><div><dt></dt><dd>{glsKernel.decisionReceiptCount}</dd></div><div><dt> / </dt><dd>{glsKernel.allowCount} / {glsKernel.denyCount}</dd></div><div><dt> / </dt><dd>{glsKernel.ambiguousCount} / {glsKernel.unverifiedCount}</dd></div><div><dt>GLC </dt><dd>{glsKernel.bootstrapCompilerSelfCheck === 'PASS_DETERMINISTIC_DOUBLE_COMPILE' ? '双编译一致' : '失败关闭'}</dd></div><div><dt>P7 </dt><dd>{glsKernel.p7VerifiedPhysicalCapabilityCount} · {glsKernel.p7NodeAssemblies.length} </dd></div><div><dt></dt><dd>{glsKernel.modelCanOverrideDecision ? '允许' : '禁止'}</dd></div><div><dt></dt><dd>{glsKernel.lastReceiptSha256 === 'GENESIS' ? '尚无裁决' : glsKernel.lastReceiptSha256.slice(0, 16)}</dd></div></dl> : <p className="boundary-note"></p>}</section>
<section className="plain-panel"><header><div><h2></h2><p></p></div><span className={numberingKernel?.state === 'ACTIVE_PINNED_AUTHORITY_MAP' ? 'status-chip online' : 'status-chip'}>{numberingKernel ? '本机内核已加载' : '失败关闭'}</span></header>{numberingKernel ? <dl className="evidence-list"><div><dt></dt><dd>{numberingKernel.authorityMapId}</dd></div><div><dt></dt><dd>{numberingKernel.authorityMapVersion}</dd></div><div><dt></dt><dd>{numberingKernel.sourceCommit.slice(0, 12)}</dd></div><div><dt></dt><dd>{numberingKernel.humanRouteNamespaces.join(' · ')}</dd></div><div><dt></dt><dd>{numberingKernel.automaticIdentityIssuance ? '已开启' : '禁止'}</dd></div><div><dt></dt><dd>{numberingKernel.unknownNumber === 'FAIL_CLOSED' ? '失败关闭 · 不猜测' : numberingKernel.unknownNumber}</dd></div></dl> : <p className="boundary-note"></p>}</section>
<section className="plain-panel">
<header><div><h2></h2><p></p></div><span className={zeroPoint?.route === 'verified' ? 'status-chip online' : 'status-chip'}>{zeroPoint ? (zeroPoint.route === 'verified' ? '验证有效' : '功能受限') : '正在读取'}</span></header>