三个用户反馈的修复,外加顺带挖出的三个真实缺陷。 反面案例默认示例(Python → Rust) - 平台是 Rust 框架,审的代码绝大多数是 Rust;拿 Python 当默认样例会让人 误以为「平台审的是 Python」,也让规则的 Rust 分支失去演示意义 - 新反例覆盖 F01–F11 全部规则,且故意用错 API 签名(blind 传 4 参、 match_across 传 4 参、Handle::new 少 Label)—— 模型生成最常见的翻车点 - 线上实测:命中 F01–F11 全部 11 条,score 0 / 禁止入域 推理过程居中 → 左对齐 - 根因:thinking 的 span 继承了外层「推理中」的 text-align:center, 一段英文推理被折成居中几行,左右大片空白,极难读 - 抽出 .thinking-panel 到 _shared/demo.css:显式 left + pre-wrap + 独立边框, 像日志一样从左往右顺读;轮询刷新后自动滚到底部(tail 是尾部窗口) 首页 Python 残留 - 删 footer 的「本地启动:python demo/server.py」两行 - badge 的「PID」「Python 3.13.12」是前端硬编码假数据(后端早就是 Rust 单二进制,既无 PID 概念也无 Python 运行时)→ 改读 /api/health 真值 - 修 refs/refs/refs/ 三重前缀 bug(真实路径 refs/nax/examples/)12 处 - 修编造的 crate 名:mpc-device→mpc-vault、mpc-privacy→mpc-fl、 mpc-crypto→mpc-he、mpc-ml metrics/aggregators→mpc-fl、 SecureSQL.explain→Engine::explain - 「14 条静态 + 2 条 AST」是错的:规则引擎是 F01–F11,AST 规则根本不存在 (14 是红线条数)→ 改为「F01–F11 静态规则 + 14 条红线 + LLM 语义复核」 顺带修掉的规则引擎盲区 - F04 硬编码密钥只认 Python 的 `api_key = "..."`,Rust 最常见的 `const API_KEY: &str = "..."` 整个漏掉(等号前夹着类型标注就匹配不上) → 新增 skip_type_annotation(),兼容 Python / Rust const / Rust let 三种写法 - 补 f04_detects_rust_const_with_type_annotation 回归测试钉死 测试 35 passed / 0 failed;ci.sh 四条全绿;镜像 mpc-demo-v0.1.9 已上线
192 lines
7.9 KiB
CSS
192 lines
7.9 KiB
CSS
/* 尚数网算子集市 · 共享样式 */
|
|
:root {
|
|
--bg:#0e1116; --panel:#161b24; --panel-2:#1d2330;
|
|
--text:#e6e9ef; --text-dim:#8b94a7; --text-faint:#5b6577;
|
|
--border:#2a3142;
|
|
--alice:#4d8bff; --alice-bg:rgba(77,139,255,0.10); --alice-edge:rgba(77,139,255,0.45);
|
|
--bob:#ffb13b; --bob-bg:rgba(255,177,59,0.10);
|
|
--ok:#4ade80; --warn:#f87171; --mute:#636b80;
|
|
--mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin:0; background:var(--bg); color:var(--text);
|
|
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
|
|
font-size: 12px;
|
|
}
|
|
a { color: var(--alice); text-decoration: none; }
|
|
a:hover { text-decoration: underline; }
|
|
code { font-family: var(--mono); color: var(--alice); }
|
|
button {
|
|
background: var(--bg);
|
|
border: 1.5px solid var(--text-faint);
|
|
color: var(--text);
|
|
padding: 7px 14px;
|
|
border-radius: 5px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
transition: all 0.15s ease;
|
|
box-shadow: 0 1px 0 rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.04);
|
|
}
|
|
button:hover:not(:disabled) {
|
|
background: var(--alice-bg);
|
|
border-color: var(--alice);
|
|
color: var(--alice);
|
|
}
|
|
button:active:not(:disabled) {
|
|
transform: translateY(1px);
|
|
}
|
|
button:disabled {
|
|
opacity: 0.4;
|
|
cursor: not-allowed;
|
|
border-color: var(--border);
|
|
}
|
|
button.primary {
|
|
background: var(--alice);
|
|
border-color: var(--alice);
|
|
color: #fff;
|
|
font-weight: 600;
|
|
}
|
|
button.primary:hover:not(:disabled) {
|
|
background: #3a78ee;
|
|
border-color: #3a78ee;
|
|
color: #fff;
|
|
}
|
|
textarea, input[type="number"], input[type="text"], select {
|
|
width:100%; background:var(--bg); border:1px solid var(--border); border-radius:4px;
|
|
padding:8px 10px; color:var(--text); font-family:var(--mono); font-size:12px;
|
|
}
|
|
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--alice); }
|
|
label { display:block; font-size:11px; color:var(--text-dim); margin-bottom:4px; text-transform:uppercase; letter-spacing:0.5px; }
|
|
|
|
.topbar {
|
|
display:flex; align-items:center; gap:14px; padding:14px 24px;
|
|
border-bottom:1px solid var(--border);
|
|
background: linear-gradient(180deg, rgba(77,139,255,0.04), transparent);
|
|
}
|
|
.topbar img { height: 28px; }
|
|
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
|
|
.topbar h1 small { color: var(--text-dim); font-weight: 400; margin-left: 8px; }
|
|
.topbar a.back { color: var(--text-dim); font-size: 12px; }
|
|
.topbar a.back:hover { color: var(--alice); text-decoration: none; }
|
|
|
|
main { padding: 24px; max-width: 1480px; margin: 0 auto; }
|
|
.row { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-bottom:16px; }
|
|
.row.three { grid-template-columns: 1fr 1fr 1fr; }
|
|
.panel {
|
|
background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
|
|
padding: 14px 16px;
|
|
}
|
|
.panel h2 {
|
|
margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
|
|
color: var(--text-dim); font-weight: 600;
|
|
}
|
|
.panel h2 .hint {
|
|
text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px;
|
|
margin-left: 8px; color: var(--text-faint);
|
|
}
|
|
|
|
table.psi { width:100%; border-collapse:collapse; font-family:var(--mono); font-size:12px; }
|
|
table.psi thead th {
|
|
text-align:left; padding:8px 10px; font-weight:500; color:var(--text-dim); font-size:11px;
|
|
background:var(--panel-2); border-bottom:1px solid var(--border); white-space:nowrap;
|
|
}
|
|
table.psi tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
|
|
table.psi tbody tr:hover td { background: var(--panel-2); }
|
|
table.psi td.secret { color: var(--bob); font-weight: 600; }
|
|
table.psi td.bit-1 { color: var(--ok); font-weight: 600; }
|
|
table.psi td.bit-0 { color: var(--warn); }
|
|
table.psi td.ok { color: var(--ok); }
|
|
table.psi td.alice { color: var(--alice); font-weight: 600; }
|
|
|
|
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
|
|
.summary .stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
|
|
.summary .stat .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
|
|
.summary .stat .value { font-size: 14px; font-weight: 600; margin-top: 3px; font-family: var(--mono); }
|
|
.summary .stat .sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
|
|
.ok { color: var(--ok); } .warn { color: var(--warn); } .alice { color: var(--alice); } .bob { color: var(--bob); }
|
|
|
|
.stage-banner {
|
|
display: flex; gap: 6px; align-items: center; padding: 8px 14px;
|
|
background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
|
|
margin-bottom: 14px; font-family: var(--mono);
|
|
}
|
|
.stage-banner .step {
|
|
font-size: 11px; color: var(--text-faint);
|
|
padding: 2px 8px; border-radius: 3px; border: 1px solid var(--border);
|
|
}
|
|
.stage-banner .step.active { color: var(--alice); border-color: var(--alice); background: rgba(77,139,255,0.12); }
|
|
.stage-banner .label { font-size: 12px; color: var(--text); }
|
|
.step-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; }
|
|
.step-controls .label { font-size: 11px; color: var(--text-dim); margin-right: 4px; }
|
|
|
|
.button-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
|
|
.small-note { font-size: 11px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }
|
|
.small-note code { font-family: var(--mono); color: var(--alice); }
|
|
|
|
.flow-svg { width: 100%; height: 220px; }
|
|
.flow-node-bg { transition: fill 0.3s, stroke 0.3s; }
|
|
.flow-edge { fill: none; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 0.7s cubic-bezier(.4,0,.2,1); }
|
|
.flow-edge.active { stroke-dashoffset: 0; }
|
|
.flow-edge.flow-alice { stroke-dasharray: 6 5; animation: flow-alice 0.85s linear infinite; }
|
|
.flow-edge.flow-bob { stroke-dasharray: 6 5; animation: flow-bob 0.85s linear infinite; }
|
|
@keyframes flow-alice { to { stroke-dashoffset: -22; } }
|
|
@keyframes flow-bob { to { stroke-dashoffset: -22; } }
|
|
.flow-label { fill: var(--text); font: 600 12px var(--mono); }
|
|
.flow-sub { fill: var(--text-faint); font: 10px var(--mono); }
|
|
|
|
.l1-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
|
|
|
/* 大模型思考过程面板
|
|
*
|
|
* 为什么必须单独一个类:思考片段是**长文本**,而外层「推理中…」的提示
|
|
* 用的是 `text-align:center`。span 继承父级的居中后,一段英文推理会被
|
|
* 折成居中的几行,左右两侧全是空白,读起来非常难受 —— 模型吐的是
|
|
* 逐字推理,本来就该像日志一样从左往右顺着读。
|
|
*
|
|
* 所以这里显式 `text-align:left`,并给它独立的边框/底色,
|
|
* 让它一眼就是「另一块东西」,而不是提示文案的一部分。
|
|
*/
|
|
.thinking-panel {
|
|
margin-top: 10px;
|
|
background: var(--bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
text-align: left; /* 覆盖父级的居中 —— 这是本类的关键 */
|
|
overflow: hidden;
|
|
}
|
|
.thinking-panel .tp-head {
|
|
display: flex; align-items: center; gap: 8px;
|
|
padding: 5px 10px;
|
|
border-bottom: 1px solid var(--border);
|
|
background: var(--panel-2);
|
|
color: var(--text-faint);
|
|
font-family: var(--mono);
|
|
font-size: 10px;
|
|
letter-spacing: .4px;
|
|
}
|
|
.thinking-panel .tp-head .tp-count { margin-left: auto; }
|
|
.thinking-panel .tp-body {
|
|
padding: 9px 11px;
|
|
font-family: var(--mono);
|
|
font-size: 10.5px;
|
|
line-height: 1.65;
|
|
color: var(--text-dim);
|
|
white-space: pre-wrap; /* 保留模型推理的换行,不压成一行 */
|
|
word-break: break-word;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
}
|
|
.thinking-panel .tp-body:empty::before {
|
|
content: "(等待模型输出思考片段…)";
|
|
color: var(--text-faint);
|
|
}
|
|
/* 深色底上的滚动条别太扎眼 */
|
|
.thinking-panel .tp-body::-webkit-scrollbar { width: 8px; }
|
|
.thinking-panel .tp-body::-webkit-scrollbar-thumb {
|
|
background: var(--border); border-radius: 4px;
|
|
}
|
|
.thinking-panel .tp-body::-webkit-scrollbar-track { background: transparent; }
|