- 已进入光湖世界{fifthDomainOpen ? '第五域 · JD-FD-PRIMARY' : '世界入口 · 等待域跳转'}
+
+
+
+ {activeRouterReceipt ? '第五域连接已回执' : '光湖身份已授权'}
+
+ {activeRouterReceipt
+ ? `第五域 · ${activeRouterReceipt.node_id}`
+ : fifthDomainOpen
+ ? '域内界面已打开 · 节点未回执'
+ : '世界入口 · 等待域跳转'}
+
+
+
{fifthDomainOpen && onOpenAiWorkspace
?
diff --git a/product-source/hololake-platform/src/constants/feedback.ts b/product-source/hololake-platform/src/constants/feedback.ts
index 67972cdac..f437a299f 100644
--- a/product-source/hololake-platform/src/constants/feedback.ts
+++ b/product-source/hololake-platform/src/constants/feedback.ts
@@ -1,6 +1,4 @@
export const REFACTORING_HOME_URL = 'https://refactoring.fm/'
-export const CODACY_HOME_URL = 'https://www.codacy.com/'
-export const CODESCENE_HOME_URL = 'https://codescene.com/'
export const CIRCLECI_HOME_URL = 'https://circleci.com/'
export const UNBLOCKED_HOME_URL = 'https://getunblocked.com/'
export const HOLOLAKE_REPOSITORY_URL = 'https://guanghulab.com/code/bingshuo/hololake-system-architecture'
diff --git a/product-source/hololake-platform/src/lib/guanghuLivingSystem.test.ts b/product-source/hololake-platform/src/lib/guanghuLivingSystem.test.ts
index 90d7c98d8..329d963cb 100644
--- a/product-source/hololake-platform/src/lib/guanghuLivingSystem.test.ts
+++ b/product-source/hololake-platform/src/lib/guanghuLivingSystem.test.ts
@@ -8,6 +8,61 @@ import {
} from './guanghuLivingSystem'
describe('Guanghu living system contract', () => {
+ it('binds every event to the persona system, knowledge state, boundaries, and capability registry', () => {
+ const event = createLivingSystemEvent({
+ currentRoute: 'world',
+ eventId: 'event-context',
+ intent: 'open-knowledge',
+ receiptIds: ['truth-001'],
+ requestedRoute: 'world',
+ worldOpen: true,
+ modelInstanceId: 'model-instance-current',
+ knowledgeState: {
+ selectedLakeId: 'lake-current',
+ mountedSources: ['REPO-012', 'REPO-014'],
+ },
+ })
+
+ expect(event.personaSystem).toEqual({
+ humanAnchorId: 'ICE-GL∞',
+ personaSystemId: 'ICE-P-ZY001',
+ memoryProtocolRoot: 'REPO-012',
+ modelInstanceId: 'model-instance-current',
+ })
+ expect(event.knowledgeState).toEqual({
+ selectedLakeId: 'lake-current',
+ mountedSources: ['REPO-012', 'REPO-014'],
+ })
+ expect(event.permissionBoundary.allowedCapabilities).toContain('knowledge.open')
+ expect(event.responsibilityBoundary.controllerPersonaSystemId).toBe('ICE-P-ZY001')
+ expect(event.capabilityRegistry).toContainEqual(expect.objectContaining({
+ id: 'knowledge.open',
+ outputType: 'CapabilityCall',
+ }))
+ })
+
+ it('drops a claimed runtime binding when its issuing receipt is absent', () => {
+ const event = createLivingSystemEvent({
+ currentRoute: 'world',
+ eventId: 'event-unverified-runtime',
+ intent: 'navigate',
+ receiptIds: [],
+ requestedRoute: 'world',
+ worldOpen: true,
+ runtimeBinding: {
+ bindingId: 'binding-unverified',
+ nodeId: 'JD-FD-PRIMARY',
+ personaSystemId: 'ICE-P-ZY001',
+ modelInstanceId: 'model-unverified',
+ issuedByReceiptId: 'missing-receipt',
+ status: 'verified',
+ },
+ })
+
+ expect(event.currentSystemState.runtimeBinding).toBeNull()
+ expect(event.personaSystem.modelInstanceId).toBeNull()
+ })
+
it('accepts a model-native navigation plan with a bounded visual scene', () => {
const event = createLivingSystemEvent({
currentRoute: 'world',
@@ -23,14 +78,20 @@ describe('Guanghu living system contract', () => {
eventId: 'event-001',
intent: 'navigate',
planId: 'plan-001',
- route: 'fifth-domain',
requiredTruth: ['receipt-001'],
- scene: {
- depth: 'immersive',
- motion: 'responsive',
- starDensity: 'rich',
- connectionEmphasis: 'active-route',
+ uiProjection: {
+ route: 'fifth-domain',
+ stateLabel: 'model-proposed',
+ scene: {
+ depth: 'immersive',
+ motion: 'responsive',
+ starDensity: 'rich',
+ connectionEmphasis: 'active-route',
+ },
},
+ navigationAction: { type: 'navigate', route: 'fifth-domain' },
+ capabilityCall: null,
+ receiptSchema: { outcome: 'pending-evidence', requiredEvidence: ['ui.route.readback'] },
}))
expect(validateLivingSystemPlan(event, plan)).toEqual({
@@ -54,11 +115,17 @@ describe('Guanghu living system contract', () => {
eventId: 'event-002',
intent: 'navigate',
planId: 'plan-002',
- route: 'fifth-domain',
requiredTruth: ['invented-receipt'],
- scene: {
- depth: 'focused', motion: 'quiet', starDensity: 'balanced', connectionEmphasis: 'contextual',
+ uiProjection: {
+ route: 'fifth-domain',
+ stateLabel: 'model-proposed',
+ scene: {
+ depth: 'focused', motion: 'quiet', starDensity: 'balanced', connectionEmphasis: 'contextual',
+ },
},
+ navigationAction: { type: 'navigate', route: 'fifth-domain' },
+ capabilityCall: null,
+ receiptSchema: { outcome: 'pending-evidence', requiredEvidence: [] },
}))
expect(validateLivingSystemPlan(event, plan)).toEqual({
@@ -79,8 +146,11 @@ describe('Guanghu living system contract', () => {
})
expect(createDeterministicLivingSystemPlan(event)).toMatchObject({
- route: 'world-login',
- scene: { depth: 'focused', motion: 'responsive' },
+ uiProjection: {
+ route: 'world-login',
+ scene: { depth: 'focused', motion: 'responsive' },
+ },
+ navigationAction: { route: 'world-login' },
})
})
@@ -99,14 +169,24 @@ describe('Guanghu living system contract', () => {
eventId: event.eventId,
intent: 'open-agent-workspace',
planId: 'substituted-action',
- route: 'world',
requiredTruth: [],
- scene: {
- depth: 'overview',
- motion: 'responsive',
- starDensity: 'balanced',
- connectionEmphasis: 'contextual',
+ uiProjection: {
+ route: 'world',
+ stateLabel: 'model-proposed',
+ scene: {
+ depth: 'overview',
+ motion: 'responsive',
+ starDensity: 'balanced',
+ connectionEmphasis: 'contextual',
+ },
},
+ navigationAction: { type: 'navigate', route: 'world' },
+ capabilityCall: {
+ type: 'capability',
+ capabilityId: 'agent.workspace.open',
+ input: {},
+ },
+ receiptSchema: { outcome: 'pending-evidence', requiredEvidence: [] },
}))
expect(validateLivingSystemPlan(event, plan)).toEqual({
@@ -115,9 +195,76 @@ describe('Guanghu living system contract', () => {
})
})
+ it('rejects route substitution, closed-world projection, and capability substitution', () => {
+ const openEvent = createLivingSystemEvent({
+ currentRoute: 'world',
+ eventId: 'event-route-boundary',
+ intent: 'navigate',
+ requestedRoute: 'fifth-domain',
+ worldOpen: true,
+ receiptIds: [],
+ now: 1,
+ })
+ const openPlan = createDeterministicLivingSystemPlan(openEvent)
+ expect(validateLivingSystemPlan(openEvent, {
+ ...openPlan,
+ navigationAction: { type: 'navigate', route: 'world' },
+ })).toEqual({ accepted: false, reason: 'route_mismatch' })
+
+ const closedEvent = createLivingSystemEvent({
+ currentRoute: 'world',
+ eventId: 'event-world-boundary',
+ intent: 'navigate',
+ requestedRoute: 'fifth-domain',
+ worldOpen: false,
+ receiptIds: [],
+ now: 1,
+ })
+ const closedPlan = createDeterministicLivingSystemPlan(closedEvent)
+ const protectedPlan = {
+ ...closedPlan,
+ uiProjection: { ...closedPlan.uiProjection, route: 'fifth-domain' as const },
+ navigationAction: { type: 'navigate' as const, route: 'fifth-domain' as const },
+ }
+ expect(validateLivingSystemPlan(closedEvent, protectedPlan)).toEqual({
+ accepted: false,
+ reason: 'world_closed',
+ })
+
+ const capabilityEvent = createLivingSystemEvent({
+ currentRoute: 'world',
+ eventId: 'event-capability-boundary',
+ intent: 'open-knowledge',
+ requestedRoute: 'world',
+ worldOpen: true,
+ receiptIds: [],
+ now: 1,
+ })
+ const capabilityPlan = createDeterministicLivingSystemPlan(capabilityEvent)
+ expect(validateLivingSystemPlan(capabilityEvent, {
+ ...capabilityPlan,
+ capabilityCall: {
+ type: 'capability',
+ capabilityId: 'agent.workspace.open',
+ input: {},
+ },
+ })).toEqual({ accepted: false, reason: 'capability_mismatch' })
+ })
+
it('rejects chatty or structurally invalid model output', () => {
expect(parseLivingSystemPlan('我来帮你进入第五域')).toBeNull()
expect(parseLivingSystemPlan('{"route":"fifth-domain"}')).toBeNull()
+ expect(parseLivingSystemPlan(JSON.stringify({
+ version: 1,
+ eventId: 'event-001',
+ intent: 'navigate',
+ planId: 'legacy-theme-adapter',
+ route: 'fifth-domain',
+ requiredTruth: [],
+ scene: {
+ depth: 'immersive', motion: 'active', starDensity: 'rich', connectionEmphasis: 'network',
+ },
+ }))).toBeNull()
})
it('binds a local executor receipt to the accepted event and plan', () => {
@@ -131,16 +278,43 @@ describe('Guanghu living system contract', () => {
now: 1,
}))
- expect(createLivingSystemExecutionReceipt({ plan, source: 'fallback', now: 2 })).toEqual({
+ expect(createLivingSystemExecutionReceipt({
+ plan,
+ source: 'fallback',
+ outcome: 'executed',
+ evidence: ['ui.route:zero-core'],
+ now: 2,
+ })).toEqual({
version: 1,
- receiptId: 'local-execution:fallback-event-004',
+ receiptId: 'local-execution:fallback-event-004:executed',
eventId: 'event-004',
intent: 'navigate',
planId: 'fallback-event-004',
route: 'zero-core',
source: 'fallback',
outcome: 'executed',
- executedAt: 2,
+ evidence: ['ui.route:zero-core'],
+ completedAt: 2,
})
})
+
+ it('refuses to create a successful receipt before real evidence exists', () => {
+ const plan = createDeterministicLivingSystemPlan(createLivingSystemEvent({
+ currentRoute: 'world',
+ intent: 'navigate',
+ requestedRoute: 'zero-core',
+ worldOpen: true,
+ receiptIds: [],
+ eventId: 'event-no-evidence',
+ now: 1,
+ }))
+
+ expect(() => createLivingSystemExecutionReceipt({
+ plan,
+ source: 'fallback',
+ outcome: 'executed',
+ evidence: [],
+ now: 2,
+ })).toThrow('guanghu_living_system_success_evidence_required')
+ })
})
diff --git a/product-source/hololake-platform/src/lib/guanghuLivingSystem.ts b/product-source/hololake-platform/src/lib/guanghuLivingSystem.ts
index 33fd727e8..d08d59068 100644
--- a/product-source/hololake-platform/src/lib/guanghuLivingSystem.ts
+++ b/product-source/hololake-platform/src/lib/guanghuLivingSystem.ts
@@ -34,6 +34,61 @@ export type GuanghuLivingScene = {
connectionEmphasis: LivingSceneConnectionEmphasis
}
+export type GuanghuPersonaSystemContext = {
+ humanAnchorId: 'ICE-GL∞'
+ personaSystemId: 'ICE-P-ZY001'
+ memoryProtocolRoot: 'REPO-012'
+ modelInstanceId: string | null
+}
+
+export type GuanghuRuntimeBinding = {
+ bindingId: string
+ nodeId: string
+ personaSystemId: 'ICE-P-ZY001'
+ modelInstanceId: string
+ issuedByReceiptId: string
+ status: 'verified'
+}
+
+export type GuanghuKnowledgeState = {
+ selectedLakeId: string | null
+ mountedSources: string[]
+}
+
+export type GuanghuCapabilityId =
+ | 'navigation.apply'
+ | 'knowledge.open'
+ | 'agent.workspace.open'
+ | 'local.workspace.open'
+ | 'appearance.apply'
+
+export type GuanghuCapabilityRegistration = {
+ id: GuanghuCapabilityId
+ inputType: 'NavigationAction' | 'CapabilityCall'
+ outputType: 'ReceiptSchema' | 'CapabilityCall'
+ requiresWorldOpen: boolean
+}
+
+export type GuanghuPermissionBoundary = {
+ allowedCapabilities: GuanghuCapabilityId[]
+ deniedCapabilities: string[]
+}
+
+export type GuanghuResponsibilityBoundary = {
+ controllerPersonaSystemId: 'ICE-P-ZY001'
+ humanAnchorId: 'ICE-GL∞'
+ executorRule: 'deterministic-host-only'
+ successRule: 'evidence-required'
+}
+
+export type GuanghuCurrentSystemState = {
+ currentRoute: GuanghuChannelRoute
+ requestedRoute: GuanghuChannelRoute
+ worldOpen: boolean
+ receiptIds: string[]
+ runtimeBinding: GuanghuRuntimeBinding | null
+}
+
export type GuanghuLivingSystemEvent = {
eventId: string
intent: GuanghuLivingIntent
@@ -43,6 +98,34 @@ export type GuanghuLivingSystemEvent = {
worldOpen: boolean
receiptIds: string[]
occurredAt: number
+ personaSystem: GuanghuPersonaSystemContext
+ currentSystemState: GuanghuCurrentSystemState
+ knowledgeState: GuanghuKnowledgeState
+ permissionBoundary: GuanghuPermissionBoundary
+ responsibilityBoundary: GuanghuResponsibilityBoundary
+ capabilityRegistry: GuanghuCapabilityRegistration[]
+}
+
+export type GuanghuUIProjection = {
+ route: GuanghuChannelRoute
+ scene: GuanghuLivingScene
+ stateLabel: 'local-safe' | 'model-proposed' | 'server-bound'
+}
+
+export type GuanghuNavigationAction = {
+ type: 'navigate'
+ route: GuanghuChannelRoute
+}
+
+export type GuanghuCapabilityCall = {
+ type: 'capability'
+ capabilityId: GuanghuCapabilityId
+ input: Record
+}
+
+export type GuanghuReceiptSchema = {
+ outcome: 'pending-evidence'
+ requiredEvidence: string[]
}
export type GuanghuLivingSystemPlan = {
@@ -50,9 +133,11 @@ export type GuanghuLivingSystemPlan = {
eventId: string
intent: GuanghuLivingIntent
planId: string
- route: GuanghuChannelRoute
requiredTruth: string[]
- scene: GuanghuLivingScene
+ uiProjection: GuanghuUIProjection
+ navigationAction: GuanghuNavigationAction
+ capabilityCall: GuanghuCapabilityCall | null
+ receiptSchema: GuanghuReceiptSchema
}
export type GuanghuLivingSystemExecutionReceipt = {
@@ -63,17 +148,40 @@ export type GuanghuLivingSystemExecutionReceipt = {
planId: string
route: GuanghuChannelRoute
source: 'server' | 'model' | 'fallback'
- outcome: 'executed'
- executedAt: number
+ outcome: 'executed' | 'failed'
+ evidence: string[]
+ completedAt: number
+ error?: string
}
-type CreateLivingSystemEventInput = Omit & {
+type CreateLivingSystemEventInput = Omit<
+ GuanghuLivingSystemEvent,
+ | 'occurredAt'
+ | 'personaSystem'
+ | 'currentSystemState'
+ | 'knowledgeState'
+ | 'permissionBoundary'
+ | 'responsibilityBoundary'
+ | 'capabilityRegistry'
+> & {
now?: number
+ modelInstanceId?: string | null
+ runtimeBinding?: GuanghuRuntimeBinding | null
+ knowledgeState?: GuanghuKnowledgeState
}
export type LivingSystemPlanValidation =
| { accepted: true; plan: GuanghuLivingSystemPlan }
- | { accepted: false; reason: 'event_mismatch' | 'intent_mismatch' | 'route_mismatch' | 'unverified_truth' | 'world_closed' }
+ | {
+ accepted: false
+ reason:
+ | 'event_mismatch'
+ | 'intent_mismatch'
+ | 'route_mismatch'
+ | 'unverified_truth'
+ | 'world_closed'
+ | 'capability_mismatch'
+ }
const PROTECTED_ROUTES = new Set([
'fifth-domain',
@@ -90,6 +198,39 @@ const SCENE_MOTIONS = new Set(['quiet', 'responsive', 'active
const STAR_DENSITIES = new Set(['sparse', 'balanced', 'rich'])
const CONNECTION_EMPHASES = new Set(['contextual', 'active-route', 'network'])
const LIVING_INTENTS = new Set(GUANGHU_LIVING_INTENTS)
+const CAPABILITY_FOR_INTENT: Record = {
+ navigate: 'navigation.apply',
+ 'open-knowledge': 'knowledge.open',
+ 'open-agent-workspace': 'agent.workspace.open',
+ 'open-local-workspace': 'local.workspace.open',
+ 'apply-theme': 'appearance.apply',
+}
+const CAPABILITY_REGISTRY: GuanghuCapabilityRegistration[] = [
+ { id: 'navigation.apply', inputType: 'NavigationAction', outputType: 'ReceiptSchema', requiresWorldOpen: false },
+ { id: 'knowledge.open', inputType: 'CapabilityCall', outputType: 'CapabilityCall', requiresWorldOpen: false },
+ { id: 'agent.workspace.open', inputType: 'CapabilityCall', outputType: 'CapabilityCall', requiresWorldOpen: false },
+ { id: 'local.workspace.open', inputType: 'CapabilityCall', outputType: 'CapabilityCall', requiresWorldOpen: false },
+ { id: 'appearance.apply', inputType: 'CapabilityCall', outputType: 'CapabilityCall', requiresWorldOpen: false },
+]
+
+function verifiedRuntimeBinding(
+ binding: GuanghuRuntimeBinding | null | undefined,
+ receiptIds: string[],
+): GuanghuRuntimeBinding | null {
+ if (
+ !binding
+ || binding.status !== 'verified'
+ || binding.personaSystemId !== 'ICE-P-ZY001'
+ || binding.bindingId.length === 0
+ || binding.nodeId.length === 0
+ || binding.modelInstanceId.length === 0
+ || binding.issuedByReceiptId.length === 0
+ || !receiptIds.includes(binding.issuedByReceiptId)
+ ) {
+ return null
+ }
+ return { ...binding }
+}
function isStringArray(value: unknown): value is string[] {
return Array.isArray(value) && value.every(item => typeof item === 'string')
@@ -99,26 +240,58 @@ function isRoute(value: unknown): value is GuanghuChannelRoute {
return typeof value === 'string' && (GUANGHU_CHANNEL_ROUTES as readonly string[]).includes(value)
}
+function isLivingScene(value: unknown): value is GuanghuLivingScene {
+ if (!value || typeof value !== 'object') return false
+ const scene = value as Partial
+ return SCENE_DEPTHS.has(scene.depth!)
+ && SCENE_MOTIONS.has(scene.motion!)
+ && STAR_DENSITIES.has(scene.starDensity!)
+ && CONNECTION_EMPHASES.has(scene.connectionEmphasis!)
+}
+
+function isCapabilityCall(value: unknown): value is GuanghuCapabilityCall | null {
+ if (value === null) return true
+ if (!value || typeof value !== 'object') return false
+ const call = value as Partial
+ return call.type === 'capability'
+ && Object.values(CAPABILITY_FOR_INTENT).includes(call.capabilityId!)
+ && Boolean(call.input)
+ && typeof call.input === 'object'
+ && !Array.isArray(call.input)
+}
+
function isLivingSystemPlan(value: unknown): value is GuanghuLivingSystemPlan {
if (!value || typeof value !== 'object') return false
const candidate = value as Partial
- const scene = candidate.scene
+ const projection = candidate.uiProjection
+ const navigation = candidate.navigationAction
+ const receipt = candidate.receiptSchema
return candidate.version === GUANGHU_LIVING_SYSTEM_VERSION
&& typeof candidate.eventId === 'string'
&& candidate.eventId.length > 0
&& LIVING_INTENTS.has(candidate.intent!)
&& typeof candidate.planId === 'string'
&& candidate.planId.length > 0
- && isRoute(candidate.route)
&& isStringArray(candidate.requiredTruth)
- && Boolean(scene)
- && SCENE_DEPTHS.has(scene!.depth)
- && SCENE_MOTIONS.has(scene!.motion)
- && STAR_DENSITIES.has(scene!.starDensity)
- && CONNECTION_EMPHASES.has(scene!.connectionEmphasis)
+ && Boolean(projection)
+ && isRoute(projection!.route)
+ && isLivingScene(projection!.scene)
+ && ['local-safe', 'model-proposed', 'server-bound'].includes(projection!.stateLabel)
+ && Boolean(navigation)
+ && navigation!.type === 'navigate'
+ && isRoute(navigation!.route)
+ && isCapabilityCall(candidate.capabilityCall)
+ && Boolean(receipt)
+ && receipt!.outcome === 'pending-evidence'
+ && isStringArray(receipt!.requiredEvidence)
}
export function createLivingSystemEvent(input: CreateLivingSystemEventInput): GuanghuLivingSystemEvent {
+ const runtimeBinding = verifiedRuntimeBinding(input.runtimeBinding, input.receiptIds)
+ const allowedCapabilities = CAPABILITY_REGISTRY
+ .filter(capability => !capability.requiresWorldOpen || input.worldOpen)
+ .map(capability => capability.id)
+ const receiptIds = [...input.receiptIds]
return {
eventId: input.eventId,
intent: input.intent,
@@ -126,8 +299,36 @@ export function createLivingSystemEvent(input: CreateLivingSystemEventInput): Gu
requestedRoute: input.requestedRoute,
...(input.appearanceTheme ? { appearanceTheme: input.appearanceTheme } : {}),
worldOpen: input.worldOpen,
- receiptIds: [...input.receiptIds],
+ receiptIds,
occurredAt: input.now ?? Date.now(),
+ personaSystem: {
+ humanAnchorId: 'ICE-GL∞',
+ personaSystemId: 'ICE-P-ZY001',
+ memoryProtocolRoot: 'REPO-012',
+ modelInstanceId: input.modelInstanceId ?? runtimeBinding?.modelInstanceId ?? null,
+ },
+ currentSystemState: {
+ currentRoute: input.currentRoute,
+ requestedRoute: input.requestedRoute,
+ worldOpen: input.worldOpen,
+ receiptIds,
+ runtimeBinding,
+ },
+ knowledgeState: input.knowledgeState ?? {
+ selectedLakeId: null,
+ mountedSources: [],
+ },
+ permissionBoundary: {
+ allowedCapabilities,
+ deniedCapabilities: [],
+ },
+ responsibilityBoundary: {
+ controllerPersonaSystemId: 'ICE-P-ZY001',
+ humanAnchorId: 'ICE-GL∞',
+ executorRule: 'deterministic-host-only',
+ successRule: 'evidence-required',
+ },
+ capabilityRegistry: CAPABILITY_REGISTRY.map(capability => ({ ...capability })),
}
}
@@ -146,16 +347,33 @@ export function validateLivingSystemPlan(
): LivingSystemPlanValidation {
if (!plan || plan.eventId !== event.eventId) return { accepted: false, reason: 'event_mismatch' }
if (plan.intent !== event.intent) return { accepted: false, reason: 'intent_mismatch' }
- if (plan.route !== event.requestedRoute && plan.route !== 'world-login') {
+ if (
+ plan.uiProjection.route !== plan.navigationAction.route
+ || (
+ plan.uiProjection.route !== event.requestedRoute
+ && plan.uiProjection.route !== 'world-login'
+ )
+ ) {
return { accepted: false, reason: 'route_mismatch' }
}
const suppliedTruth = new Set(event.receiptIds)
if (plan.requiredTruth.some(receiptId => !suppliedTruth.has(receiptId))) {
return { accepted: false, reason: 'unverified_truth' }
}
- if (!event.worldOpen && PROTECTED_ROUTES.has(plan.route)) {
+ if (!event.worldOpen && PROTECTED_ROUTES.has(plan.uiProjection.route)) {
return { accepted: false, reason: 'world_closed' }
}
+ const expectedCapability = CAPABILITY_FOR_INTENT[event.intent]
+ if (
+ !event.permissionBoundary.allowedCapabilities.includes(expectedCapability)
+ || (
+ event.intent === 'navigate'
+ ? plan.capabilityCall !== null
+ : plan.capabilityCall?.capabilityId !== expectedCapability
+ )
+ ) {
+ return { accepted: false, reason: 'capability_mismatch' }
+ }
return { accepted: true, plan }
}
@@ -166,18 +384,39 @@ export function createDeterministicLivingSystemPlan(
? 'world-login'
: event.requestedRoute
const immersive = event.worldOpen && route !== 'world' && route !== 'world-login'
+ const capabilityId = CAPABILITY_FOR_INTENT[event.intent]
return {
version: GUANGHU_LIVING_SYSTEM_VERSION,
eventId: event.eventId,
intent: event.intent,
planId: `fallback-${event.eventId}`,
- route,
requiredTruth: [],
- scene: {
- depth: immersive ? 'immersive' : route === 'world' ? 'overview' : 'focused',
- motion: route === 'world' ? 'quiet' : 'responsive',
- starDensity: immersive ? 'rich' : 'balanced',
- connectionEmphasis: immersive ? 'active-route' : 'contextual',
+ uiProjection: {
+ route,
+ stateLabel: 'local-safe',
+ scene: {
+ depth: immersive ? 'immersive' : route === 'world' ? 'overview' : 'focused',
+ motion: route === 'world' ? 'quiet' : 'responsive',
+ starDensity: immersive ? 'rich' : 'balanced',
+ connectionEmphasis: immersive ? 'active-route' : 'contextual',
+ },
+ },
+ navigationAction: { type: 'navigate', route },
+ capabilityCall: event.intent === 'navigate'
+ ? null
+ : {
+ type: 'capability',
+ capabilityId,
+ input: {
+ ...(event.appearanceTheme ? { appearanceTheme: event.appearanceTheme } : {}),
+ requestedRoute: route,
+ },
+ },
+ receiptSchema: {
+ outcome: 'pending-evidence',
+ requiredEvidence: event.intent === 'navigate'
+ ? ['ui.route.readback']
+ : [`capability.${capabilityId}.result`],
},
}
}
@@ -185,21 +424,32 @@ export function createDeterministicLivingSystemPlan(
export function createLivingSystemExecutionReceipt({
plan,
source,
+ outcome,
+ evidence,
+ error,
now = Date.now(),
}: {
plan: GuanghuLivingSystemPlan
source: GuanghuLivingSystemExecutionReceipt['source']
+ outcome: GuanghuLivingSystemExecutionReceipt['outcome']
+ evidence: string[]
+ error?: string
now?: number
}): GuanghuLivingSystemExecutionReceipt {
+ if (outcome === 'executed' && evidence.length === 0) {
+ throw new Error('guanghu_living_system_success_evidence_required')
+ }
return {
version: GUANGHU_LIVING_SYSTEM_VERSION,
- receiptId: `local-execution:${plan.planId}`,
+ receiptId: `local-execution:${plan.planId}:${outcome}`,
eventId: plan.eventId,
intent: plan.intent,
planId: plan.planId,
- route: plan.route,
+ route: plan.uiProjection.route,
source,
- outcome: 'executed',
- executedAt: now,
+ outcome,
+ evidence: [...evidence],
+ completedAt: now,
+ ...(error ? { error } : {}),
}
}
diff --git a/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.test.ts b/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.test.ts
index fe17ff943..0df65d784 100644
--- a/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.test.ts
+++ b/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.test.ts
@@ -30,26 +30,72 @@ const event = createLivingSystemEvent({
now: 1,
})
+function typedPlan({
+ eventId = 'event-001',
+ intent = 'navigate' as const,
+ requiredTruth = ['truth-001'],
+ stateLabel = 'model-proposed' as const,
+} = {}) {
+ return {
+ version: 1 as const,
+ eventId,
+ intent,
+ planId: 'model-plan-001',
+ requiredTruth,
+ uiProjection: {
+ route: 'fifth-domain' as const,
+ stateLabel,
+ scene: {
+ depth: 'immersive' as const,
+ motion: 'active' as const,
+ starDensity: 'rich' as const,
+ connectionEmphasis: 'network' as const,
+ },
+ },
+ navigationAction: { type: 'navigate' as const, route: 'fifth-domain' as const },
+ capabilityCall: null,
+ receiptSchema: {
+ outcome: 'pending-evidence' as const,
+ requiredEvidence: ['ui.route.readback'],
+ },
+ }
+}
+
describe('planGuanghuLivingSystem', () => {
- it('uses the receipt-backed Shanghai lighthouse as the primary system model', async () => {
+ it('does not call a server planner without a verified current runtime binding', async () => {
+ const server = vi.fn().mockRejectedValue(new Error('legacy server route must stay closed'))
+
+ await planGuanghuLivingSystem({ event, server })
+
+ expect(server).not.toHaveBeenCalled()
+ })
+
+ it('uses a server model only when the current runtime binding has a receipt', async () => {
+ const boundEvent = createLivingSystemEvent({
+ eventId: 'event-001',
+ intent: 'navigate',
+ currentRoute: 'world',
+ requestedRoute: 'fifth-domain',
+ worldOpen: true,
+ receiptIds: ['truth-001', 'runtime-binding-receipt'],
+ runtimeBinding: {
+ bindingId: 'binding-current',
+ nodeId: 'JD-FD-PRIMARY',
+ personaSystemId: 'ICE-P-ZY001',
+ modelInstanceId: 'model-current',
+ issuedByReceiptId: 'runtime-binding-receipt',
+ status: 'verified',
+ },
+ now: 1,
+ })
const server = vi.fn().mockResolvedValue({
source: 'server_lighthouse',
serverReceiptId: 'GMRP-HOLOLAKE-001',
model: 'deepseek-v4-flash',
- plan: {
- version: 1,
- eventId: 'event-001',
- intent: 'navigate',
- planId: 'server-plan-001',
- route: 'fifth-domain',
- requiredTruth: ['truth-001'],
- scene: {
- depth: 'immersive', motion: 'responsive', starDensity: 'rich', connectionEmphasis: 'network',
- },
- },
+ plan: { ...typedPlan({ stateLabel: 'server-bound' }), planId: 'server-plan-001' },
})
- await expect(planGuanghuLivingSystem({ event, server })).resolves.toMatchObject({
+ await expect(planGuanghuLivingSystem({ event: boundEvent, server })).resolves.toMatchObject({
source: 'server',
serverReceiptId: 'GMRP-HOLOLAKE-001',
plan: { planId: 'server-plan-001' },
@@ -59,37 +105,76 @@ describe('planGuanghuLivingSystem', () => {
it('uses a valid model-native plan as the primary system path', async () => {
const server = vi.fn().mockRejectedValue(new Error('offline'))
const stream = vi.fn(async ({ callbacks }) => {
- callbacks.onText(JSON.stringify({
- version: 1,
- eventId: 'event-001',
- intent: 'navigate',
- planId: 'model-plan-001',
- route: 'fifth-domain',
- requiredTruth: ['truth-001'],
- scene: {
- depth: 'immersive', motion: 'active', starDensity: 'rich', connectionEmphasis: 'network',
- },
- }))
+ callbacks.onText(JSON.stringify(typedPlan()))
callbacks.onDone()
})
await expect(planGuanghuLivingSystem({ event, target, stream, server })).resolves.toMatchObject({
source: 'model',
- plan: { planId: 'model-plan-001', route: 'fifth-domain' },
+ plan: {
+ planId: 'model-plan-001',
+ navigationAction: { route: 'fifth-domain' },
+ },
})
})
it('returns an explicit fallback receipt when model output violates the boundary', async () => {
const server = vi.fn().mockRejectedValue(new Error('offline'))
const stream = vi.fn(async ({ callbacks }) => {
- callbacks.onText('{"version":1,"eventId":"event-001","intent":"navigate","planId":"bad","route":"fifth-domain","requiredTruth":["invented"],"scene":{"depth":"immersive","motion":"active","starDensity":"rich","connectionEmphasis":"network"}}')
+ callbacks.onText(JSON.stringify({
+ ...typedPlan({ requiredTruth: ['invented'] }),
+ planId: 'bad',
+ }))
callbacks.onDone()
})
await expect(planGuanghuLivingSystem({ event, target, stream, server })).resolves.toMatchObject({
source: 'fallback',
fallbackReason: 'unverified_truth',
- plan: { route: 'fifth-domain' },
+ plan: { navigationAction: { route: 'fifth-domain' } },
+ })
+ })
+
+ it('fails closed for model callback errors, rejected streams, and timeouts', async () => {
+ const callbackErrorStream = vi.fn(async ({ callbacks }) => {
+ callbacks.onThinking('bounded')
+ callbacks.onToolStart('none')
+ callbacks.onToolDone('none')
+ callbacks.onError(new Error('model callback failed'))
+ callbacks.onDone()
+ })
+ await expect(planGuanghuLivingSystem({
+ event,
+ target,
+ stream: callbackErrorStream,
+ timeoutMs: 20,
+ })).resolves.toMatchObject({
+ source: 'fallback',
+ fallbackReason: 'model_error',
+ })
+
+ const rejectedStream = vi.fn(async () => {
+ throw new Error('stream rejected')
+ })
+ await expect(planGuanghuLivingSystem({
+ event,
+ target,
+ stream: rejectedStream,
+ timeoutMs: 20,
+ })).resolves.toMatchObject({
+ source: 'fallback',
+ fallbackReason: 'model_error',
+ })
+
+ const timedOutStream = vi.fn(async () => new Promise(() => {}))
+ await expect(planGuanghuLivingSystem({
+ event,
+ target,
+ stream: timedOutStream,
+ timeoutMs: 1,
+ })).resolves.toMatchObject({
+ source: 'fallback',
+ fallbackReason: 'timeout',
})
})
})
diff --git a/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.ts b/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.ts
index 776a6fd0d..b0a8b796a 100644
--- a/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.ts
+++ b/product-source/hololake-platform/src/utils/planGuanghuLivingSystem.ts
@@ -18,14 +18,15 @@ const DEFAULT_TIMEOUT_MS = 1_400
const LIVING_SYSTEM_PROMPT = [
'You are the non-conversational HoloLake living-system planner.',
- 'Transform exactly one verified interaction event into one version-1 system plan.',
+ 'Transform exactly one bounded interaction event into one version-1 typed system plan.',
'Return one compact JSON object only. Never return prose, markdown, explanations, or tool calls.',
- 'Keep eventId and intent unchanged. route must equal requestedRoute, except world-login may be used as a safe gate.',
+ 'Keep eventId and intent unchanged.',
+ 'uiProjection.route and navigationAction.route must equal requestedRoute, except world-login may be used as a safe gate.',
'requiredTruth may contain only receiptIds supplied by the event.',
- 'scene.depth: overview|focused|immersive.',
- 'scene.motion: quiet|responsive|active.',
- 'scene.starDensity: sparse|balanced|rich.',
- 'scene.connectionEmphasis: contextual|active-route|network.',
+ 'uiProjection.scene is a visual projection of supplied state, not a theme score.',
+ 'navigationAction is typed and cannot substitute another host action.',
+ 'capabilityCall must use the exact registered capability for the event intent, or null for navigate.',
+ 'receiptSchema must remain pending-evidence; never claim execution success.',
'Do not infer authorization, server state, identity, or execution success.',
].join(' ')
@@ -39,6 +40,14 @@ type LivingSystemStreamRequest = {
type LivingSystemStream = (request: LivingSystemStreamRequest) => Promise
+const CAPABILITY_FOR_INTENT: Record = {
+ navigate: null,
+ 'open-knowledge': 'knowledge.open',
+ 'open-agent-workspace': 'agent.workspace.open',
+ 'open-local-workspace': 'local.workspace.open',
+ 'apply-theme': 'appearance.apply',
+}
+
export type LivingSystemPlanResult = {
source: 'server' | 'model' | 'fallback'
plan: GuanghuLivingSystemPlan
@@ -60,28 +69,34 @@ type PlanGuanghuLivingSystemOptions = {
function eventPrompt(event: GuanghuLivingSystemEvent): string {
return JSON.stringify({
version: 1,
- event: {
- eventId: event.eventId,
- intent: event.intent,
- currentRoute: event.currentRoute,
- requestedRoute: event.requestedRoute,
- appearanceTheme: event.appearanceTheme,
- worldOpen: event.worldOpen,
- receiptIds: event.receiptIds,
- occurredAt: event.occurredAt,
- },
+ event,
output: {
version: 1,
eventId: event.eventId,
intent: event.intent,
planId: 'unique string',
- route: event.requestedRoute,
requiredTruth: [],
- scene: {
- depth: 'overview|focused|immersive',
- motion: 'quiet|responsive|active',
- starDensity: 'sparse|balanced|rich',
- connectionEmphasis: 'contextual|active-route|network',
+ uiProjection: {
+ route: event.requestedRoute,
+ stateLabel: event.currentSystemState.runtimeBinding ? 'server-bound' : 'model-proposed',
+ scene: {
+ depth: 'overview|focused|immersive',
+ motion: 'quiet|responsive|active',
+ starDensity: 'sparse|balanced|rich',
+ connectionEmphasis: 'contextual|active-route|network',
+ },
+ },
+ navigationAction: { type: 'navigate', route: event.requestedRoute },
+ capabilityCall: event.intent === 'navigate'
+ ? null
+ : {
+ type: 'capability',
+ capabilityId: CAPABILITY_FOR_INTENT[event.intent],
+ input: {},
+ },
+ receiptSchema: {
+ outcome: 'pending-evidence',
+ requiredEvidence: [],
},
},
})
@@ -147,19 +162,21 @@ export async function planGuanghuLivingSystem({
stream = streamAiModel,
timeoutMs = DEFAULT_TIMEOUT_MS,
}: PlanGuanghuLivingSystemOptions): Promise {
- try {
- const serverResult = await server(event)
- const validation = validateLivingSystemPlan(event, serverResult.plan)
- if (validation.accepted) {
- return {
- source: 'server',
- plan: validation.plan,
- serverReceiptId: serverResult.serverReceiptId,
+ if (event.currentSystemState.runtimeBinding?.status === 'verified') {
+ try {
+ const serverResult = await server(event)
+ const validation = validateLivingSystemPlan(event, serverResult.plan)
+ if (validation.accepted) {
+ return {
+ source: 'server',
+ plan: validation.plan,
+ serverReceiptId: serverResult.serverReceiptId,
+ }
}
+ } catch {
+ // A receipt-bound runtime is optional. A configured local model or the
+ // deterministic recovery plan keeps local navigation available.
}
- } catch {
- // The server route is the primary runtime. A configured direct model or
- // the deterministic recovery plan keeps navigation available if it is absent.
}
if (!target) return fallback(event, 'model_error')
const model = await collectModelOutput(stream, target, event, timeoutMs)
diff --git a/product-source/hololake-platform/standards/GLS-0844.md b/product-source/hololake-platform/standards/GLS-0844.md
index e68b16f15..ffdb010e0 100644
--- a/product-source/hololake-platform/standards/GLS-0844.md
+++ b/product-source/hololake-platform/standards/GLS-0844.md
@@ -41,9 +41,32 @@ GHNQG 是光湖代码频道内生的源码验收协议。它不向任何外部
## 执行归属
-施工期由世界包内的 `scripts/run-guanghu-native-quality-gate.sh` 在宿主工具链
-上执行。终态执行体为 `GOSK_CODE_CHANNEL_QUALITY_EXECUTOR`。迁移改变执行
-位置,不改变二值规则、必需门或回执语义。
+HoloLake 施工期由产品仓库内的
+`scripts/run-hololake-native-quality-gate.sh` 在宿主工具链上自动执行;世界包
+执行器只验证它自身,不能替 HoloLake 签发产品回执。终态执行体为
+`GOSK_CODE_CHANNEL_QUALITY_EXECUTOR`。迁移改变执行位置,不改变二值规则、
+必需门或回执语义。
外部分析器可以被人类主动调用作为观察意见,但其不存在、无账号、无额度
或给出不同评分,都不能授权或阻止光湖代码频道。
+
+## HoloLake 产品层绑定
+
+HoloLake 的开发、测试、打包、发布和第五域代码频道都继承同一套原生权威,
+不得另建产品层评分宪法。执行时遵循 GLS-0101 的
+`Parse → Validate → Resolve → Authorize → Execute → Verify → Write Back`
+骨架,并同时绑定:
+
+- `GLS-0247`:从注册表解析当前有效协议与替代关系;
+- `TCS / GLS-0200`:保存需求、判断边界与认知因果;
+- `HLDP / GLS-0400`:追加式保存变更、纠正、提交树和回执;
+- `GLP`:传递任务、权限、结果与失败,不把消息当成执行事实;
+- `GHNQG / GLS-0844`:只签发 `PASS_100` 或 `FAIL_0`。
+
+测试框架、编译器、代码托管、流水线和侧车都是施工工具。它们可以执行或
+观察某个必需门,但不能定义第三种状态,也不能取代注册表、精确源码树和原生
+回执。
+
+仓库内 `scripts/test-guanghu-native-authority.sh` 负责阻止旧外部评分规则重新
+进入当前生效面;HoloLake 产品执行器负责汇总前端、原生端、世界与协议证据,
+并签发绑定精确提交与源码树的最终回执。
diff --git a/product-source/hololake-platform/standards/guanghu-native-engineering-profile.json b/product-source/hololake-platform/standards/guanghu-native-engineering-profile.json
new file mode 100644
index 000000000..79ad8dde7
--- /dev/null
+++ b/product-source/hololake-platform/standards/guanghu-native-engineering-profile.json
@@ -0,0 +1,157 @@
+{
+ "schema": "guanghu.native-engineering-profile/v1",
+ "profileId": "HLP-NATIVE-ENGINEERING-001",
+ "product": "HoloLake",
+ "authority": {
+ "repository": "REPO-012",
+ "remote": "https://guanghulab.com/code/bingshuo/guanghu-ice-heart",
+ "commit": "488a4792bbe4f3678d67a247540b14d28d5d3a62",
+ "registry": "gls/GLS-PROTOCOL-REGISTRY.json",
+ "registryId": "GLS-PROTOCOL-REGISTRY-20260731",
+ "scope": "FIFTH_DOMAIN_CODE_CHANNEL_ONLY"
+ },
+ "decisionModel": {
+ "allowedReceiptStates": ["FAIL_0", "PASS_100"],
+ "aggregateRule": "ALL_REQUIRED_GATES_100_OR_TOTAL_0",
+ "registrationIsImplementation": false,
+ "externalScoringHasAuthority": false
+ },
+ "automaticTriggers": [
+ {
+ "event": "development_start",
+ "surface": "package.predev",
+ "gate": "native_authority_and_protocol_binding"
+ },
+ {
+ "event": "test_start",
+ "surface": "package.pretest",
+ "gate": "native_authority_and_protocol_binding"
+ },
+ {
+ "event": "build_start",
+ "surface": "package.prebuild",
+ "gate": "native_authority_protocol_binding_and_core_coverage_100"
+ },
+ {
+ "event": "source_commit",
+ "surface": ".husky/pre-commit",
+ "gate": "native_authority_and_protocol_binding"
+ },
+ {
+ "event": "source_publish",
+ "surface": ".husky/pre-push",
+ "gate": "GHNQG"
+ },
+ {
+ "event": "code_channel_review",
+ "surface": ".github/workflows/ci.yml",
+ "gate": "GHNQG"
+ },
+ {
+ "event": "living_system_event",
+ "surface": "src/lib/guanghuLivingSystem.ts#createLivingSystemEvent",
+ "gate": "identity_state_permission_responsibility_capability"
+ },
+ {
+ "event": "model_plan_returned",
+ "surface": "src/lib/guanghuLivingSystem.ts#validateLivingSystemPlan",
+ "gate": "typed_output_and_verified_truth"
+ },
+ {
+ "event": "server_model_request",
+ "surface": "src/utils/planGuanghuLivingSystem.ts#planGuanghuLivingSystem",
+ "gate": "receipt_backed_runtime_binding"
+ },
+ {
+ "event": "execution_receipt_requested",
+ "surface": "src/lib/guanghuLivingSystem.ts#createLivingSystemExecutionReceipt",
+ "gate": "real_evidence_before_success"
+ }
+ ],
+ "protocolBindings": [
+ {
+ "protocol": "GLS-0110",
+ "acronym": "ISRP",
+ "engineeringRole": "Intent is parsed into one registered action and cannot be substituted by a model.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts"]
+ },
+ {
+ "protocol": "GLS-0200",
+ "acronym": "TCS",
+ "engineeringRole": "Persona identity, relationship, responsibility and cognition remain explicit model inputs.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts", "src/utils/planGuanghuLivingSystem.ts"]
+ },
+ {
+ "protocol": "GLS-0230",
+ "acronym": "GLOW-SOURCE-GUARD",
+ "engineeringRole": "External source and tools are observations or isolated material, never product authority or body.",
+ "implementation": ["scripts/test-guanghu-native-authority.sh"]
+ },
+ {
+ "protocol": "GLS-0306",
+ "acronym": "GLP-RECEIPT",
+ "engineeringRole": "Execution success is emitted only after deterministic host evidence exists.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts", "src/components/HoloLakeHome.tsx"]
+ },
+ {
+ "protocol": "GLS-0311",
+ "acronym": "GLOW",
+ "engineeringRole": "Visible execution preserves source, outcome, evidence and failure instead of replacing them with a score.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts", "src/components/HoloLakeHome.tsx"]
+ },
+ {
+ "protocol": "GLS-0400",
+ "acronym": "HLDP",
+ "engineeringRole": "Receipts and corrections are append-only evidence addresses; summaries do not overwrite source truth.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts"]
+ },
+ {
+ "protocol": "GLS-0708",
+ "acronym": "GMRP",
+ "engineeringRole": "A server model is callable only through a receipt-backed current runtime binding.",
+ "implementation": ["src/utils/planGuanghuLivingSystem.ts", "src-tauri/src/guanghu_living_system.rs"]
+ },
+ {
+ "protocol": "GLS-0710",
+ "acronym": "GMP",
+ "engineeringRole": "Every executable capability has a stable identity, typed input and receipt output.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts"]
+ },
+ {
+ "protocol": "GLS-0803",
+ "acronym": "PALP",
+ "engineeringRole": "Persona is the responsible brain; bounded capabilities are hands and never acquire subject authority.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts"]
+ },
+ {
+ "protocol": "GLS-0810",
+ "acronym": "LPOS",
+ "engineeringRole": "HoloLake projects the language-persona operating system instead of attaching a chat or theme adapter.",
+ "implementation": ["src/components/HoloLakeHome.tsx"]
+ },
+ {
+ "protocol": "GLS-0842",
+ "acronym": "HLSP",
+ "engineeringRole": "Online world state requires a live-session receipt; a UI label or repository record is not a session.",
+ "implementation": ["src/lib/guanghuLivingSystem.ts", "src/components/HoloLakeHome.tsx"]
+ },
+ {
+ "protocol": "GLS-0844",
+ "acronym": "GHNQG",
+ "engineeringRole": "All applicable native gates must pass for one exact source tree; no partial score grants authority.",
+ "implementation": ["scripts/run-hololake-native-quality-gate.sh", ".husky/pre-push", ".github/workflows/ci.yml"]
+ }
+ ],
+ "requiredInvariants": [
+ "persona_system_context_is_explicit",
+ "current_system_knowledge_permission_responsibility_and_capability_inputs_are_explicit",
+ "model_outputs_are_typed_projection_navigation_capability_and_receipt_schema",
+ "runtime_binding_is_receipt_backed",
+ "legacy_server_route_is_not_auto_resurrected",
+ "success_requires_execution_evidence",
+ "auditable_native_core_lines_and_functions_are_100",
+ "third_party_scores_have_no_authority",
+ "registered_protocol_source_is_traceable",
+ "hololake_quality_receipt_is_issued_by_product_native_gate"
+ ]
+}
diff --git a/product-source/hololake-platform/tests/smoke/contribute-modal.spec.ts b/product-source/hololake-platform/tests/smoke/contribute-modal.spec.ts
index 09b78ade2..304ecd1bc 100644
--- a/product-source/hololake-platform/tests/smoke/contribute-modal.spec.ts
+++ b/product-source/hololake-platform/tests/smoke/contribute-modal.spec.ts
@@ -44,16 +44,6 @@ test.describe('Contribute modal', () => {
await page.keyboard.press('Enter')
await expect.poll(async () => page.evaluate(() => (window as typeof window & { __tolariaOpenedUrls: string[] }).__tolariaOpenedUrls)).toContain('https://refactoring.fm/')
- await page.keyboard.press('Tab')
- await expect(page.getByRole('button', { name: 'Open Codacy' })).toBeFocused()
- await page.keyboard.press('Enter')
- await expect.poll(async () => page.evaluate(() => (window as typeof window & { __tolariaOpenedUrls: string[] }).__tolariaOpenedUrls)).toContain('https://www.codacy.com/')
-
- await page.keyboard.press('Tab')
- await expect(page.getByRole('button', { name: 'Open CodeScene' })).toBeFocused()
- await page.keyboard.press('Space')
- await expect.poll(async () => page.evaluate(() => (window as typeof window & { __tolariaOpenedUrls: string[] }).__tolariaOpenedUrls)).toContain('https://codescene.com/')
-
await page.keyboard.press('Tab')
await expect(page.getByRole('button', { name: 'Open CircleCI' })).toBeFocused()
await page.keyboard.press('Enter')
diff --git a/product-source/hololake-platform/vite.config.ts b/product-source/hololake-platform/vite.config.ts
index fdb55a8b8..950a30e19 100644
--- a/product-source/hololake-platform/vite.config.ts
+++ b/product-source/hololake-platform/vite.config.ts
@@ -1038,12 +1038,6 @@ export default defineConfig({
'src/components/ui/tooltip.tsx',
'src/components/ui/card.tsx',
],
- thresholds: {
- lines: 70,
- functions: 70,
- branches: 70,
- statements: 70,
- },
},
},
})
diff --git a/product-source/hololake-platform/vitest.guanghu-native.config.ts b/product-source/hololake-platform/vitest.guanghu-native.config.ts
new file mode 100644
index 000000000..8dfefafd0
--- /dev/null
+++ b/product-source/hololake-platform/vitest.guanghu-native.config.ts
@@ -0,0 +1,35 @@
+import os from 'node:os'
+import path from 'node:path'
+import { existsSync } from 'node:fs'
+import { defineConfig } from 'vitest/config'
+
+const reportsDirectory = process.env.GHNQG_COVERAGE_DIR
+ ?? (
+ existsSync('/Volumes/JZAO/HoloLake/artifacts')
+ ? '/Volumes/JZAO/HoloLake/artifacts/hololake-native-quality/coverage/current'
+ : path.join(os.tmpdir(), 'hololake-ghnqg-coverage')
+ )
+
+export default defineConfig({
+ test: {
+ environment: 'jsdom',
+ setupFiles: ['./src/test/setup.ts'],
+ include: [
+ 'src/lib/guanghuLivingSystem.test.ts',
+ 'src/utils/planGuanghuLivingSystem.test.ts',
+ ],
+ coverage: {
+ provider: 'v8',
+ reporter: ['text', 'json-summary'],
+ reportsDirectory,
+ include: [
+ 'src/lib/guanghuLivingSystem.ts',
+ 'src/utils/planGuanghuLivingSystem.ts',
+ ],
+ thresholds: {
+ lines: 100,
+ functions: 100,
+ },
+ },
+ },
+})