04 · PROTO/Unit 详情抽屉

UnitDrawer · Unit 详情

点击 DAG 节点弹出。展示该 Unit 的 spec / contract / 最近 3 次 run。是 Future Maintainer 反推决策的主入口(US-05)。

线框

UnitDrawer · unit auth-be · open from DAG
Unit · auth-be passed type=be · retries 1/5 × SPEC(来自 SDD@rev 5) 提供登录 / 注册 / token 校验端点 → POST /api/auth/login → POST /api/auth/register CONTRACT(contract.json · sha256:7f3a...) 200 → { token, user_id } 401 → { error: "invalid_credentials" } RECENT RUNS · 最近 3 次 run-...-0731 · attempt 1 · FAIL · invalid-pwd 期望 401 收 500 run-...-0734 · attempt 2 · PASS · 8/8 绿 (这是第 3 次的占位,未跑) CODER 决策日志(coder.log) [01] 选用 bcrypt 直接比对 → 因 user 不存在抛错 [02] 反思后:先查 user,user 缺失或 pwd 错都 401 → open full log ↗

抽屉 4 个区域

① 头部

Unit id + 状态徽章 + meta(type / retries / depends_on)+ 关闭 ×。

② Spec

来自 SDD 对应 section 的 <p> + <ul data-acceptance>,含「来自 SDD@revN」追溯标签。

③ Contract

展开 contract.json 的 exports(HTTP endpoints)。鼠标悬停可看完整 schema。

④ Recent runs + coder.log

最近 3 次 run 摘要卡片,每张可点开看完整 result.json。底部黑底面板显示 coder.log 的最近 5 条决策。

从哪里打开 / 怎么关闭

方式说明
点击 DAG 节点主入口
SSE unit.state 推送时点击「查看」从右上 toast 跳
键盘 ←/→切换上一/下一个 Unit(在 units 数组中)
Esc 或 ×关闭
点击外部遮罩关闭

资料完整性追溯

抽屉是 US-05 的核心 — 让 3 个月后的自己能反推决策。所以下面这些链接必须可用:

链接跳到
"来自 SDD@rev 5" pill新 tab 打开 history/sdd-rev-5.html
contract sha256:7f3a... pill纯净 JSON 视图
每条 run 卡片展开内嵌 result.json + stdout 抽屉
"open full log"跳到 stream.log 中该 Unit 全部行
如曾被 L2 reset显示触发它的 triage.json 链接