fix(dsh): align recovery, scheduling audit and credential guarantees

This commit is contained in:
阿白叔 committed 2026-10-31 14:16:27 +08:00
1 parent e565f67b46
commit 9552f1eb95
32 files changed
+514 -135

No files matched your search

+6 -1
View File
@@ -161,7 +161,12 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
blockerList(row.blockers),actions(
button('dx-schedule-run-'+row.schedule_id,'核对并执行',()=>perform({operation:'run_schedule',schedule_id:row.schedule_id}),pending||row.ready!==true),
button('dx-schedule-cancel-'+row.schedule_id,'取消排期',()=>perform({operation:'cancel_schedule',schedule_id:row.schedule_id}),pending||row.status!=='pending')))),
!operations.schedules?.length&&empty('暂无排期。'));
!operations.schedules?.length&&empty('暂无排期。'),
...(operations.schedule_events||[]).slice(0,10).map(row=>card('schedule-event-'+row.sequence,
row.event==='dispatch'?'排期派发记录':'排期结果记录',
detail('时间',time(row.at_utc)),detail('排期',row.schedule_id),detail('执行',row.run_id),
detail('授权',row.payload?.authority==='native_future_authorization'?'原生预先授权':row.payload?.authority==='native_confirmation'?'原生即时确认':'—'),
detail('结果',status(row.payload?.status||'claimed')))));
}
function ExperiencesPanel({operations,perform,pending}){
const[query,setQuery]=React.useState('');
@@ -4,7 +4,7 @@ const fields=(value,keys)=>Object.fromEntries(keys.filter(k=>value?.[k]!==undefi
const run=row=>({...fields(row,['run_id','queue_id','status','task_ids','remaining_task_ids','counters','blockers','resume_ready','started_utc']),
diff:row.diff?fields(row.diff,['safe','changed','completed','remaining','plan_changes','evidence_changes','blockers']):undefined,
result:row.result?fields(row.result,['status','tasks','message','cad_verification']):undefined});
const schedule=row=>fields(row,['schedule_id','title','task_ids','priority','not_before','due_at','dependencies','auto_start','status','ready','blockers','run_id']);
const schedule=row=>fields(row,['schedule_id','title','task_ids','priority','not_before','due_at','dependencies','auto_start','status','ready','requires_confirmation','dispatchable','dispatch_authority','blockers','run_id']);
const experience=row=>({...fields(row,['incident_id','issue_code','verified','verification','evidence','evidence_refs','evidence_references','status']),
attempts:row.attempts,analyses:row.analyses?.slice(0,2),outcome:row.outcome,
summary:short(row.summary,1200),message:short(row.message)});
@@ -28,6 +28,10 @@ export function compactResult(value){
if(result.tasks)result.tasks=result.tasks.map(t=>({...t,...t.note?{note:short(t.note,300)}:{}}));
if(result.runs)result.runs=result.runs.slice(0,5).map(run);
if(result.schedules)result.schedules=result.schedules.slice(0,10).map(schedule);
if(result.schedule_events)result.schedule_events=result.schedule_events.slice(0,10).map(row=>({
...fields(row,['sequence','schedule_id','at_utc','event','run_id']),
payload:{...fields(row.payload,['automatic','authority','status']),
receipt:row.payload?.receipt?fields(row.payload.receipt,['status','run_id','tasks','reporting_errors']):undefined}}));
if(result.schedule)result.schedule=schedule(result.schedule);
if(result.experiences)result.experiences=result.experiences.slice(0,5).map(experience);
if(result.tickets)result.tickets=result.tickets.slice(0,5).map(ticket);
@@ -42,7 +46,8 @@ export function modelSnapshot(value){
const ops=value.operations||{};
result.operations=compactResult({busy:ops.busy===true,live_run:ops.live_run,last_execution:ops.last_execution,
runs:ops.runs||[],schedules:ops.schedules||[],experiences:ops.experiences||[],tickets:ops.tickets||[],health:ops.health,
decision_audit:ops.decision_audit,decisions:ops.decisions||[]});
decision_audit:ops.decision_audit,decisions:ops.decisions||[],
section_errors:ops.section_errors||[],schedule_events:ops.schedule_events||[]});
if(value.automation?.incident_id)result.automation=fields(value.automation,['incident_id','task_id','issue_code','status','attempts','verification']);
if(value.lifecycle?.status)result.lifecycle=fields(value.lifecycle,['request_id','status','task_ids','run_id']);
return result;