fix: release v1.0.3 预设渲染与语言搬运监督修复
web-platform-ci / Standalone decision service (no cloud credentials) (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
lekiwi-compatibility / cpu-compatibility (push) Has been cancelled
web-platform-ci / Standalone decision service (no cloud credentials) (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
lekiwi-compatibility / cpu-compatibility (push) Has been cancelled
This commit is contained in:
@@ -2,6 +2,19 @@ import { LANGUAGE_VERSION } from './LanguageScene';
|
||||
import { validateJevDecision, type AgentVersion, type JevDecision, type Skill } from './protocol';
|
||||
|
||||
export const QUALITY_POINTS = { poor: 0, partial: 25, good: 75, excellent: 100 } as const;
|
||||
const REASONS = {
|
||||
unsafe: '检测到不安全因素',
|
||||
insufficient_evidence: '当前阶段证据不足',
|
||||
tracking_error: '动作跟踪或对齐异常',
|
||||
verified_progress: '模型报告已有进展,但仍拒绝继续',
|
||||
} as const;
|
||||
function stopReason(decision: JevDecision): string {
|
||||
const reason = decision.reason;
|
||||
if (reason && reason !== 'none') return REASONS[reason];
|
||||
return decision.noul === 'uncertain'
|
||||
? '模型无法确认下一技能安全,未提供具体原因'
|
||||
: '模型拒绝继续,未提供具体原因';
|
||||
}
|
||||
/** Supervisory advice can veto but cannot grant physical authority. */
|
||||
export class TaskSupervisor {
|
||||
last?: JevDecision;
|
||||
@@ -18,9 +31,9 @@ export class TaskSupervisor {
|
||||
const decision = validateJevDecision(value, candidates, version);
|
||||
this.last = decision;
|
||||
if (version === LANGUAGE_VERSION && decision.noul !== 'allow')
|
||||
throw new Error(`Noul 拦截:${decision.reason ?? 'insufficient_evidence'}`);
|
||||
throw new Error(`Noul 拦截(${decision.noul}):${stopReason(decision)}`);
|
||||
if (decision.choice === 'stop' || decision.recovery === 'stop')
|
||||
throw new Error('Jev 请求安全停止');
|
||||
throw new Error(`Jev 请求安全停止:${stopReason(decision)}`);
|
||||
if (decision.grasp === 'secure' && !secure) throw new Error('Jev 抓持判断与本地物理证据矛盾');
|
||||
if (
|
||||
['carry', 'stop-base'].includes(decision.choice) &&
|
||||
|
||||
Reference in New Issue
Block a user