feat: fail closed before domain runtime entry

This commit is contained in:
冰朔 2026-08-10 01:23:52 +08:00
commit 0990e96c0e
6 changed files with 160 additions and 8 deletions

View file

@ -1,10 +1,12 @@
import { useState } from 'react';
import { BookOpen, Crosshair, DoorOpen, Landmark, Link2, LogIn, ShieldCheck } from 'lucide-react';
import { Crosshair, DoorOpen, Landmark, Link2, LogIn, ShieldCheck } from 'lucide-react';
type DomainId = 'main' | 'sub' | 'zero' | 'zero-sense' | 'fifth';
interface Props {
onEnterFifth: () => void;
access: { blockers: string[]; runtimeReady: boolean; stage: 'checking' | 'login-required' | 'identity-verified' | 'runtime-ready' };
onEnterFifthRuntime: () => void;
onEnterLocalWorkspace: () => void;
onOpenConnection: () => void;
}
@ -16,7 +18,7 @@ const domains: Array<{ id: DomainId; number: string; name: string; summary: stri
{ id: 'fifth', number: '05', name: '第五域 · 光湖本源域', summary: '零点原核的工程本体 · 语言架构层' },
];
export function WorldEntry({ onEnterFifth, onOpenConnection }: Props) {
export function WorldEntry({ access, onEnterFifthRuntime, onEnterLocalWorkspace, onOpenConnection }: Props) {
const [stage, setStage] = useState<'lighthouse' | 'directory' | 'fifth'>('lighthouse');
const [selectedDomain, setSelectedDomain] = useState<DomainId | null>(null);
@ -58,11 +60,11 @@ export function WorldEntry({ onEnterFifth, onOpenConnection }: Props) {
<div><dt><ShieldCheck aria-hidden="true" /><span></span></dt><dd>DOM-FIFTH-0001</dd></div>
<div><dt><Crosshair aria-hidden="true" /><span></span></dt><dd> · </dd></div>
<div><dt><Link2 aria-hidden="true" /><span></span></dt><dd> / </dd></div>
<div><dt><DoorOpen aria-hidden="true" /><span></span></dt><dd> · </dd></div>
<div><dt><DoorOpen aria-hidden="true" /><span></span></dt><dd>{access.stage === 'runtime-ready' ? '节点、域清单、会话能力与连接回执已验证' : access.stage === 'identity-verified' ? '账户与节点已验证 · 尚缺域清单、会话能力和连接回执' : access.stage === 'checking' ? '正在核对真实接入证据' : '公开门厅可查看 · 尚未登录或接入节点'}</dd></div>
</dl>
<div className="fifth-actions">
<button className="fifth-primary" type="button" onClick={onEnterFifth}><LogIn aria-hidden="true" /></button>
<button type="button" onClick={() => setStage('directory')}><BookOpen aria-hidden="true" /></button>
<button className="fifth-primary" type="button" onClick={access.runtimeReady ? onEnterFifthRuntime : onOpenConnection}><LogIn aria-hidden="true" />{access.runtimeReady ? '进入第五域运行体' : '登录或接入节点'}</button>
<button type="button" onClick={onEnterLocalWorkspace}><DoorOpen aria-hidden="true" /></button>
<button type="button" onClick={() => setStage('lighthouse')}><Landmark aria-hidden="true" /></button>
</div>
</section>