feat(web): review owner record handoffs

This commit is contained in:
Your Name
2026-05-21 19:42:39 +08:00
parent f6967b065f
commit f09dd099e7
8 changed files with 454 additions and 1 deletions

View File

@@ -195,6 +195,14 @@ type OwnerResponseFormalRecordOwnerHandoffPacket = {
tone: 'steady' | 'warn' | 'locked'
}
type OwnerResponseFormalRecordOwnerHandoffReviewItem = {
key: string
check: string
value: string
icon: typeof ShieldCheck
tone: 'steady' | 'warn' | 'locked'
}
type CoverageGroup = {
key: string
count: string
@@ -855,6 +863,40 @@ const ownerResponseFormalRecordOwnerHandoffBoundaries = [
'gitea_disablement_authorized=false',
]
const ownerResponseFormalRecordOwnerHandoffReviewItems: OwnerResponseFormalRecordOwnerHandoffReviewItem[] = [
{ key: 'packetCompleteness', check: 'R1', value: '0', icon: ListChecks, tone: 'warn' },
{ key: 'recordOwnerIdentityScope', check: 'R2', value: '0', icon: ClipboardCheck, tone: 'warn' },
{ key: 'authorityBoundaryMatch', check: 'R3', value: '0', icon: ShieldCheck, tone: 'warn' },
{ key: 'evidenceVersionConfirm', check: 'R4', value: '0', icon: SearchCheck, tone: 'warn' },
{ key: 'reviewerNoteConfirm', check: 'R5', value: '0', icon: FileText, tone: 'warn' },
{ key: 'mutationRequestReject', check: 'R6', value: '0', icon: AlertTriangle, tone: 'locked' },
{ key: 'runtimeCutoverSeparation', check: 'R7', value: '0', icon: GitBranch, tone: 'locked' },
]
const ownerResponseFormalRecordOwnerHandoffReviewBoundaries = [
'owner_response_formal_record_owner_handoff_review_check_count=7',
'owner_response_formal_record_owner_handoff_review_passed_count=0',
'owner_response_formal_record_owner_assigned_count=0',
'owner_response_formal_record_created_count=0',
'owner_response_formal_record_approved_count=0',
'owner_response_formal_record_runtime_gate_count=0',
'owner_response_formal_record_owner_handoff_review_only=true',
'owner_response_formal_record_owner_assignment_authorized=false',
'owner_response_formal_record_write_authorized=false',
'owner_response_formal_record_approval_authorized=false',
'owner_response_formal_record_execution_authorized=false',
'runtime_execution_authorized=false',
'active_runtime_gate_count=0',
'action_buttons_allowed=false',
'not_authorization=true',
'secret_value_collection_allowed=false',
'repo_creation_authorized=false',
'refs_sync_authorized=false',
'workflow_modification_authorized=false',
'github_primary_switch_authorized=false',
'gitea_disablement_authorized=false',
]
const coverageGroups: CoverageGroup[] = [
{
key: 'signals',
@@ -2932,6 +2974,130 @@ function OwnerResponseFormalRecordOwnerHandoffBoard() {
)
}
function OwnerResponseFormalRecordOwnerHandoffReviewCard({
item,
}: {
item: OwnerResponseFormalRecordOwnerHandoffReviewItem
}) {
const t = useTranslations('iwooos.ownerResponseFormalRecordOwnerHandoffReviewBoard')
const Icon = item.icon
const textWrap = { overflowWrap: 'anywhere' as const, wordBreak: 'break-word' as const }
return (
<div style={{ ...band, minHeight: 184, padding: 16, ...textWrap }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 9, minWidth: 0 }}>
<Icon size={18} color={toneColors[item.tone]} style={{ flex: '0 0 auto' }} />
<span style={{ fontSize: 11, color: '#87867f' }}>{t('checkLabel')}</span>
</div>
<span style={{ fontSize: 11, color: toneColors[item.tone] }}>{item.check}</span>
</div>
<div style={{ fontSize: 28, fontWeight: 700, color: toneColors[item.tone], marginTop: 12, lineHeight: 1 }}>
{item.value}
</div>
<h2 style={{ fontSize: 14, margin: '10px 0 6px', color: '#141413' }}>
{t(`items.${item.key}.title` as never)}
</h2>
<p style={{ fontSize: 12, lineHeight: 1.55, color: '#6f6d66', margin: 0, ...textWrap }}>
{t(`items.${item.key}.body` as never)}
</p>
<div style={{ marginTop: 10, display: 'grid', gap: 5 }}>
<span style={{ fontSize: 11, color: '#87867f' }}>{t('reviewLabel')}</span>
<span style={{ fontSize: 11, color: toneColors[item.tone], lineHeight: 1.45, ...textWrap }}>
{t(`items.${item.key}.review` as never)}
</span>
<span style={{ fontSize: 11, color: '#87867f', marginTop: 4 }}>{t('guardLabel')}</span>
<span style={{ fontSize: 11, color: '#6f6d66', lineHeight: 1.45, ...textWrap }}>
{t(`items.${item.key}.guard` as never)}
</span>
</div>
</div>
)
}
function OwnerResponseFormalRecordOwnerHandoffReviewBoard() {
const t = useTranslations('iwooos.ownerResponseFormalRecordOwnerHandoffReviewBoard')
const summaryItems = [
{ key: 'checks', value: '7', tone: 'warn' as const },
{ key: 'passed', value: '0', tone: 'warn' as const },
{ key: 'assigned', value: '0', tone: 'locked' as const },
{ key: 'runtime', value: '0', tone: 'locked' as const },
]
return (
<section style={{ marginBottom: 14 }} data-testid="iwooos-owner-response-formal-record-owner-handoff-review-board">
<div style={{ marginBottom: 14 }}>
<h2 style={{ fontSize: 16, margin: 0 }}>{t('title')}</h2>
<p style={{ fontSize: 12, color: '#6f6d66', margin: '6px 0 0', lineHeight: 1.55 }}>
{t('subtitle')}
</p>
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
gap: 10,
marginBottom: 12,
}}
>
{summaryItems.map(item => (
<div key={item.key} style={{ ...band, padding: 14, minHeight: 96 }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
<span style={{ fontSize: 11, color: '#87867f' }}>{t(`summary.${item.key}.label` as never)}</span>
<ToneDot tone={item.tone} />
</div>
<div style={{ fontSize: 24, fontWeight: 700, lineHeight: 1, marginTop: 9, color: '#141413' }}>
{item.value}
</div>
<p style={{ fontSize: 11, color: '#6f6d66', lineHeight: 1.45, margin: '8px 0 0' }}>
{t(`summary.${item.key}.detail` as never)}
</p>
</div>
))}
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(230px, 1fr))',
gap: 12,
}}
>
{ownerResponseFormalRecordOwnerHandoffReviewItems.map(item => (
<OwnerResponseFormalRecordOwnerHandoffReviewCard key={item.key} item={item} />
))}
</div>
<div style={{ ...band, marginTop: 12, padding: 16 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 10 }}>
<ShieldCheck size={16} color={toneColors.locked} />
<h3 style={{ fontSize: 14, margin: 0 }}>{t('boundaryTitle')}</h3>
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(230px, 1fr))',
gap: 7,
}}
>
{ownerResponseFormalRecordOwnerHandoffReviewBoundaries.map(item => (
<span
key={item}
style={{
border: '0.5px solid #eee9dd',
borderRadius: 8,
padding: '7px 9px',
color: '#4f4c45',
fontSize: 11,
lineHeight: 1.4,
overflowWrap: 'anywhere',
}}
>
{item}
</span>
))}
</div>
</div>
</section>
)
}
function CoverageCard({ item }: { item: CoverageGroup }) {
const t = useTranslations('iwooos.coverage')
const Icon = item.icon
@@ -4081,6 +4247,8 @@ export default function IwoooSPage({ params }: { params: { locale: string } }) {
<OwnerResponseFormalRecordOwnerHandoffBoard />
<OwnerResponseFormalRecordOwnerHandoffReviewBoard />
<section style={{ marginBottom: 14 }}>
<div style={{ marginBottom: 14 }}>
<h2 style={{ fontSize: 16, margin: 0 }}>{t('awooopReadOnlyLandingReadiness.title')}</h2>