Sync origin main into L1 branch (pin alignment)
Why: host integration step U6 — sync submodule pins so Backend 3f4b34a's expected deps (agent-intent=651a2e1 / agent-native=28f3ea7 / agent-squad=11ff3a0) match Dev pins. Evidence: scripts/check-pins.sh returns 'pins ok' after this commit; was failing on modules/backend deps/agent-intent is 651a2e1, Dev deps/agent-intent is 343b1e6d9a5b mismatch. Impact: ci/test test-pins gate passes; remaining gates (test-pg / svc-realcombo) require PostgreSQL+Redis services. Refs: PR #628.
This commit is contained in:
@@ -0,0 +1,160 @@
|
||||
# feature/fast-slow-completion-signal-eval 任务卡
|
||||
|
||||
任务主记录:PR #633 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/633;状态:已完成(合入前闭合);owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 46e331a7a81c94c6f5881c997ae0aca45664c830
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-fast-slow-completion-signal-eval(worktree);分支:feature/fast-slow-completion-signal-eval
|
||||
- 分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
|
||||
- 需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=9ea2d573b0e9f5d8a54ad2fc9d07ce8363ffcdee483232c63b6f4feb8f67b430;triage_receipt=/tmp/fscs-triage-20261019.json;receipt_sha256=be542a3a92d5b61f37d470092fea2ada8773b0d55d44fc455eb772495704f2cf
|
||||
|
||||
- 授权与交付终点:用户 2026-10-19 在遗留项推进中选定“快慢通道:评估是否把 tool_calls + Usage + 干净 EOF 认作该供应商的完成信号(属于口径变更)”;终点为评估文档经 Dev PR 合入并提交用户口径决策。未授权:产品代码、任何真实模型/付费请求、A01、部署。
|
||||
- 交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 人工决策点:仅限目标/范围/验收变更、重大取舍、高后果操作或无法自动判定的业务验收
|
||||
- 当前阶段:方案设计(评估稿);当前增量:I1(评估文档)
|
||||
- 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
- 目标:形成可复核的口径评估(证据、供应商文档、对照 r0.6 四前提、风险、O1/O2/O3 方案与验证设想),交用户决策。
|
||||
- 非目标:不改 Agent-Native/Backend 终态门禁,不新增付费请求,不改已批准的 r0.6 设计。
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 不适用 | 仅 host 豁免路径 docs/superpowers/specs/** 与 .task/** | — | — | — | — | — | — | — | — | — |
|
||||
|
||||
## 关联方向与规划
|
||||
|
||||
- 适用状态:适用
|
||||
- 主记录路径/版本:modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r06-transport-completeness-design.md(阶段 4 已批准);.task/archive/feature-fast-slow-u2-u3-plan.md(部分收口)
|
||||
- 对应里程碑:快慢通道 U3 真实模型质量(未解决)
|
||||
|
||||
## 需求分析
|
||||
|
||||
| ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| R1 | 评估限路由完成信号口径 | 符合:r0.6 设计第 41 行定义提出等价终态的四前提 | P1 | 评估稿含证据、供应商文档核对、四前提逐项评估、风险与 O1–O3 | 无 | 纳入 |
|
||||
|
||||
## 方案与计划
|
||||
|
||||
- 方案引用:docs/superpowers/specs/2026-10-19-fast-slow-completion-signal-evaluation.md
|
||||
- 实施计划引用:不适用(仅评估文档;选 O2 后另立计划)
|
||||
- 测试计划引用:不适用(文档链接与 make test 由 CI 覆盖)
|
||||
|
||||
## 阶段记录
|
||||
|
||||
| 阶段 | 对象版本 | 状态 | 决策/执行者 | 时间 | 依据 |
|
||||
|---|---|---|---|---|---|
|
||||
| 需求拆解 | R0 46e331a | 完成 | host | 2026-10-19 | 用户选定评估项 |
|
||||
| 需求评估 | 待定 | 待执行 | — | — | — |
|
||||
| 需求表确认 | 待定 | 待执行 | — | — | — |
|
||||
| 方案设计 | 评估稿 | 完成(待用户口径决策) | host | 2026-10-19 | 本卡 R1 |
|
||||
| 实施计划 | 待定 | 待执行 | — | — | — |
|
||||
| 实施与自检 | 待定 | 待执行 | — | — | — |
|
||||
| 正式测试与验收 | 待定 | 待执行 | — | — | — |
|
||||
| 代码 Review | 待定 | 待执行 | — | — | — |
|
||||
| 合入 | 待定 | 待执行 | — | — | — |
|
||||
| 合入核验与收口 | 待定 | 待执行 | — | — | — |
|
||||
|
||||
## 探索试验与迭代
|
||||
|
||||
| 增量/试验 | 假设 | 范围 | 判断和停止条件 | 授权/决策依据 | 结果 | 变更影响 | 需重审补测 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| 不适用 | — | — | — | — | — | — | — |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | 46e331a7a81c94c6f5881c997ae0aca45664c830 | 46e331a7a81c94c6f5881c997ae0aca45664c830 | 2026-10-19T14:28:50Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
<!-- CMD="<命令>" make evidence 写入;手抄/转写输出视为无效证据(AGENTS.md 证据与验证门禁)。 -->
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## 交付调度
|
||||
|
||||
- 调度状态:未入队;调度记录:无
|
||||
- entry_id:无;attempt_id:无;窗口执行者:无
|
||||
- 固定候选:无(base/head、组件与相关配置引用实际尝试)
|
||||
- 调度依据:policy/delivery.md#合入调度
|
||||
- 固定后证据:源码外 RECEIPT;实际结果后按授权原样导入和闭合
|
||||
|
||||
## 结果与验证
|
||||
|
||||
- 结果:
|
||||
- 验证:<结论摘要 PASS/FAIL/SKIP/NOT_RUN 逐项;逐条证据由 make evidence 写入上方证据表>
|
||||
- 影响与剩余项:
|
||||
|
||||
## 规划进展与下一步
|
||||
|
||||
- 本次推进/剩余:待核对(依据实际成果更新适用方案/规划)
|
||||
- 首选下一任务:待核对(无适用规划、已完成或受阻时如实说明,不虚构任务)
|
||||
- 推荐依据:待填写
|
||||
- 前置条件/待确认:待核对
|
||||
- 预期产物/验收条件:待定义
|
||||
- 重复任务核对:待核对(已有/在途任务、PR 与规划记录)
|
||||
- 启动授权:未授权(建议不自动启动新任务,仍须明确授权)
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:NOT_RUN(审阅智能体/平台身份、base/head、结论、问题闭合及重放依据)
|
||||
- 冲突记录:NOT_RUN(最新目标同步、冲突处置、组合兼容核验及复审/补测)
|
||||
- CI 记录:NOT_RUN(当前 HEAD 完整 SHA、全部必需检查、运行链接、执行身份及 GATE 结果)
|
||||
- 合入记录:NOT_RUN(交付授权范围、PR、被核验 HEAD、合入 SHA、目标分支及内容核验)
|
||||
- 清理记录:NOT_RUN(授权依据、写者退出确认、worktree/分支/任务卡处置)
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T14:28:00.109630+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev",
|
||||
"before_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"after_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"branch": "main",
|
||||
"target_branch": "main",
|
||||
"target_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev'",
|
||||
"[repo] branch=main head=46e331a7a8",
|
||||
"[remote] origin/main=46e331a7a8 ahead=0 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=0",
|
||||
"[worktrees] linked=3",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] 46e331a7a8(完整:46e331a7a81c94c6f5881c997ae0aca45664c830)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev'"
|
||||
],
|
||||
"output_sha256": "3b728a0b62ddb071c6fcb0f74110b2a3da23e5670b2f3fd2bb4364e3217d52ba",
|
||||
"receipt_sha256": "2073d669c43e38ba9881008c1dccf6040721142a6d55a55ee618b3c315781d4d",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/2073d669c43e38ba9881008c1dccf6040721142a6d55a55ee618b3c315781d4d.json"
|
||||
}
|
||||
```
|
||||
|
||||
## 闭合记录(合入前折叠)
|
||||
|
||||
- 本卡在 PR #633(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/633)合入前闭合并归档,随该 PR 一同合入。
|
||||
- 该 PR 的合并提交即本任务的落地记录。
|
||||
- 合入后无需回填,也无需单独的闭合 PR。
|
||||
@@ -0,0 +1,161 @@
|
||||
# feature/fast-slow-o2-route-contract-eof 任务卡
|
||||
|
||||
任务主记录:PR #639 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/639;状态:已完成(合入前闭合);owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 2b7fdc39a1f44163f4766701429d61ffd6926f1a
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-fast-slow-o2-route-contract-eof(worktree);分支:feature/fast-slow-o2-route-contract-eof
|
||||
- 分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
|
||||
- 需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=6fc124cc90d04f78b09f649f482b1d37e33158e1a6f6f4821e252654a7bf3a1c;triage_receipt=/tmp/leftover-20261019b/o2-triage.json;receipt_sha256=b93713ab306413aaa7ea484be10767631a3b04db22b133818012ffef3019a19c
|
||||
|
||||
- 授权与交付终点:用户 2026-10-19“授权…另起 O2”(选定评估稿方案 O2);本轮终点:阶段 4 方案 + 阶段 5 计划经独立 Review、PR/CI 后经 #518 合入 main,并提交用户阶段 4/5 人审。未授权:产品代码、付费/真实模型请求、A01 复验、部署、设置写入。
|
||||
- 交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 人工决策点:仅限目标/范围/验收变更、重大取舍、高后果操作或无法自动判定的业务验收
|
||||
- 当前阶段:方案设计/实施计划(待阶段 4/5 人审);当前增量:无(I1–I3 待人审通过后启动,P1 付费另行授权)
|
||||
- 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
- 目标:为一条经核验的 MiniMax 路由定义默认关闭的等价终态 `route_contract_eof`,在缺 `[DONE]` 但满足 C1–C9 时放行工具调用;其余情形保持拒绝。
|
||||
- 本轮产物:方案 `docs/superpowers/specs/2026-10-19-fast-slow-o2-route-contract-eof-design.md`、计划 `docs/superpowers/plans/2026-10-19-fast-slow-o2-route-contract-eof-plan.md`。
|
||||
- 非目标:不改代码、不泛化到其他路由、不改 `StreamComplete` 语义、不发付费请求。
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 待定义 | — | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | — |
|
||||
|
||||
## 关联方向与规划
|
||||
|
||||
- 适用状态:待核对(无适用规划时说明原因)
|
||||
- 主记录路径/版本:待核对(路径按仓库根目录定位,归档后不变;只引用唯一正文)
|
||||
- 对应里程碑:待核对
|
||||
|
||||
## 需求分析
|
||||
|
||||
| ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| R1 | 限路由等价终态 O2 的方案与计划 | 符合:用户 2026-10-19 选定 O2;r0.6 设计要求先另行方案评审 | P1 | 方案覆盖评估稿 O2 全部条件且只绑定单一路由;计划给出零付费单元、测试矩阵与停止条件;独立 Review 无阻塞项 | 评估稿 #633 | 待阶段 4/5 人审 |
|
||||
|
||||
## 方案与计划
|
||||
|
||||
- 方案引用:docs/superpowers/specs/2026-10-19-fast-slow-o2-route-contract-eof-design.md(本分支)
|
||||
- 实施计划引用:docs/superpowers/plans/2026-10-19-fast-slow-o2-route-contract-eof-plan.md(I1–I3 零付费、P1 付费另批;R1)
|
||||
- 测试计划引用:同上计划 §2 测试矩阵、§3 Backend 用例(R1)
|
||||
|
||||
## 阶段记录
|
||||
|
||||
| 阶段 | 对象版本 | 状态 | 决策/执行者 | 时间 | 依据 |
|
||||
|---|---|---|---|---|---|
|
||||
| 需求拆解 | 待定 | 待执行 | — | — | — |
|
||||
| 需求评估 | 待定 | 待执行 | — | — | — |
|
||||
| 需求表确认 | 待定 | 待执行 | — | — | — |
|
||||
| 方案设计 | 5a7a0da | 待阶段 4 人审 | host 撰写 | 2026-10-19 | 用户选定 O2 |
|
||||
| 实施计划 | 5a7a0da | 待阶段 5 人审 | host 撰写 | 2026-10-19 | 同上 |
|
||||
| 实施与自检 | 待定 | 待执行 | — | — | — |
|
||||
| 正式测试与验收 | 待定 | 待执行 | — | — | — |
|
||||
| 代码 Review | 待定 | 待执行 | — | — | — |
|
||||
| 合入 | 待定 | 待执行 | — | — | — |
|
||||
| 合入核验与收口 | 待定 | 待执行 | — | — | — |
|
||||
|
||||
## 探索试验与迭代
|
||||
|
||||
| 增量/试验 | 假设 | 范围 | 判断和停止条件 | 授权/决策依据 | 结果 | 变更影响 | 需重审补测 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| 待定义 | — | — | — | 待核对 | NOT_RUN | 待评估 | 待评估 |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | 2b7fdc39a1f44163f4766701429d61ffd6926f1a | 2b7fdc39a1f44163f4766701429d61ffd6926f1a | 2026-10-19T16:17:05Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
<!-- CMD="<命令>" make evidence 写入;手抄/转写输出视为无效证据(AGENTS.md 证据与验证门禁)。 -->
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## 交付调度
|
||||
|
||||
- 调度状态:未入队;调度记录:无
|
||||
- entry_id:无;attempt_id:无;窗口执行者:无
|
||||
- 固定候选:无(base/head、组件与相关配置引用实际尝试)
|
||||
- 调度依据:policy/delivery.md#合入调度
|
||||
- 固定后证据:源码外 RECEIPT;实际结果后按授权原样导入和闭合
|
||||
|
||||
## 结果与验证
|
||||
|
||||
- 结果:O2 阶段 4 方案与阶段 5 计划完成并经独立 Review(PASS-with-fixes,已闭合);本轮交付终点为文档合入 main,**待阶段 4/5 人审**。
|
||||
- 验证:文档类变更;独立 Review PASS-with-fixes;PR CI(GATE)见合入记录;产品测试 NOT_RUN(无代码)。
|
||||
- 影响与剩余项:仅文档与任务卡。剩余:阶段 4/5 人审;通过后另起 I1(Agent-Native)→ I2(Backend)→ I3(Dev 改钉);P1 付费另提资源方案。
|
||||
|
||||
## 规划进展与下一步
|
||||
|
||||
- 本次推进/剩余:待核对(依据实际成果更新适用方案/规划)
|
||||
- 首选下一任务:O2 I1 Agent-Native `route_contract_eof`(阶段 4/5 人审通过后)
|
||||
- 推荐依据:待填写
|
||||
- 前置条件/待确认:待核对
|
||||
- 预期产物/验收条件:待定义
|
||||
- 重复任务核对:待核对(已有/在途任务、PR 与规划记录)
|
||||
- 启动授权:未授权(须阶段 4/5 人审通过)
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:独立 Review(Cursor Task 子代理 code-reviewer,fresh_session=true,session=fdb9367a-08bb-4e87-ae9d-ac8608290886;只接收需求、base 2b7fdc3/head 5a7a0da 与两份文档,未转交实施会话);结论 PASS-with-fixes,0 阻塞、8 非阻塞(截断用例、C4/C6 定义、重定向与基址规范化、schema 语义整体迁移、拒绝事件逐字段一致、系统层扁平键与 5 个调用点、哨兵扫描、前提①风险引用),已在后续提交全部闭合。
|
||||
- 冲突记录:NOT_RUN(最新目标同步、冲突处置、组合兼容核验及复审/补测)
|
||||
- CI 记录:NOT_RUN(当前 HEAD 完整 SHA、全部必需检查、运行链接、执行身份及 GATE 结果)
|
||||
- 合入记录:NOT_RUN(交付授权范围、PR、被核验 HEAD、合入 SHA、目标分支及内容核验)
|
||||
- 清理记录:NOT_RUN(授权依据、写者退出确认、worktree/分支/任务卡处置)
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T16:16:15.823972+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev",
|
||||
"before_head": "2b7fdc39a1f44163f4766701429d61ffd6926f1a",
|
||||
"after_head": "2b7fdc39a1f44163f4766701429d61ffd6926f1a",
|
||||
"branch": "main",
|
||||
"target_branch": "main",
|
||||
"target_head": "2b7fdc39a1f44163f4766701429d61ffd6926f1a",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev'",
|
||||
"[repo] branch=main head=2b7fdc39a1",
|
||||
"[remote] origin/main=2b7fdc39a1 ahead=0 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=0",
|
||||
"[worktrees] linked=5",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] 2b7fdc39a1(完整:2b7fdc39a1f44163f4766701429d61ffd6926f1a)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev'"
|
||||
],
|
||||
"output_sha256": "3a96e0c9643e0dc8fb45bb9ca5dfa9e57c34d0ff3c11a46864d4d6df5116c012",
|
||||
"receipt_sha256": "242b51c81c4c825292cfacbdf27b212b74ed684dea9484aa239b1d83139449b2",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/242b51c81c4c825292cfacbdf27b212b74ed684dea9484aa239b1d83139449b2.json"
|
||||
}
|
||||
```
|
||||
|
||||
## 闭合记录(合入前折叠)
|
||||
|
||||
- 本卡在 PR #639(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/639)合入前闭合并归档,随该 PR 一同合入。
|
||||
- 该 PR 的合并提交即本任务的落地记录。
|
||||
- 合入后无需回填,也无需单独的闭合 PR。
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
# feature/layered-python-env 任务卡
|
||||
|
||||
状态:实施已落在独立 worktree,未推送、未合入;owner:weichen
|
||||
任务主记录:PR #570 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/570
|
||||
状态:已完成(遗留卡闭合);owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
@@ -27,3 +28,7 @@
|
||||
## 非目标
|
||||
|
||||
不重启正在运行的 8788。不修改方案文件。不把项目角色加入审批人。
|
||||
|
||||
## 闭合记录
|
||||
|
||||
- 2026-10-19:PR #570 已合入 main(merge commit 04acb027f6678d9a7a1fbdd3cdacb105d8fbd3ee;合入说明记载 CI test、test-pg、svc-realcombo 在 9c7fa27 success)。卡片此前未回填,precheck `[recycle]` 报告该分支已合入未回收;本次回填并归档,远端分支经祖先校验后删除。
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,318 @@
|
||||
# feature/regkb-components-pin-8a396cf 任务卡
|
||||
|
||||
任务主记录:PR #631 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/631;状态:已完成(合入前闭合);owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 73bc9f208103ec1b9b83775ca65fee12f79ba99e
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-regkb-components-pin-8a396cf(worktree);分支:feature/regkb-components-pin-8a396cf
|
||||
- 分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
|
||||
- 需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=d01339c16c6ac19bf61f1b55a864b185400c8b5e0c8e71b8e2dbf56f5bff0265;triage_receipt=/tmp/dev-regkbpin-triage.json;receipt_sha256=48dc5944068f0a35a85d5441a0d8e2e456b4041b5b8dd2354fccf8f0726aa008
|
||||
|
||||
- 授权与交付终点:用户 2026-10-19 指示“把遗留项都处理完”(遗留项含本 pin 同步)。授权:更新 `components.pin` 与 README、运行组合门禁、PR、当前 HEAD CI 通过后合入、task-finish。未授权:发布、改写历史、分支保护变更、外部付费调用。
|
||||
- 交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 人工决策点:仅限目标/范围/验收变更、重大取舍、高后果操作或无法自动判定的业务验收
|
||||
- 当前阶段:合入;当前增量:I1(pin 同步 + 组合门禁)
|
||||
- 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
- 目标:法规知识库组合门禁固定组件同步到让对话模型检索法规库的新版本——`rdm_sha` = RDM main `8a396cf693b5daf32cf93cbdb10e28baf753573d`([RDM PR #446](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-RDM/pulls/446),KB gitlink b481173),`kb_sha` = KB main `a8dc714dcb0fdf88364c9581661f1589e0a3caad`([KB PR #10](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-KB-Regulations/pulls/10) 合入点);README 固定组件描述同步;`tests/integration/regulations-kb/run.sh` 在新 pin 上通过。
|
||||
- 非目标:run.sh 逻辑改动、modules/ gitlink 变更、真实网络搜索/嵌入调用、部署。
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| dev-regkb-components-pin-8a396cf | tests/integration/regulations-kb/components.pin、README.md | AGENT-EXECUTION.md | implementation | cursor → agy → pi | 1(fresh_session,session ID not-observable) | cursor-agent(Auto) | success | 9df02f1(parent 4774967,apply 快进) | 无 | /tmp/dev-regkb-pin-8a396cf-receipt.json |
|
||||
|
||||
## 关联方向与规划
|
||||
|
||||
- 适用状态:适用——法规知识库计划 U8 组合门禁
|
||||
- 主记录路径/版本:docs/superpowers/plans/2026-10-18-regulations-knowledge-base-plan.md(U8)
|
||||
- 对应里程碑:U8 组合门禁按 pin 升级
|
||||
|
||||
## 需求分析
|
||||
|
||||
| ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| R1 | 组合门禁固定组件升级到 RDM 8a396cf / KB a8dc714 | 符合(U8 组合门禁按 pin 升级走 PR,先例见 .task/archive/feature-regkb-corpus-wiring.md R1) | P1 | `run.sh` 用新 pin 三阶段 PASS | RDM PR #446、KB PR #10 已合入 | 采纳 |
|
||||
|
||||
## 方案与计划
|
||||
|
||||
- 方案引用:无需新方案;沿用 tests/integration/regulations-kb/README.md 的 pin 升级规则
|
||||
- 实施计划引用:I1 / R1(单一实施单元)
|
||||
- 测试计划引用:R1 验收 = run.sh 三阶段 PASS + Dev CI
|
||||
|
||||
## 阶段记录
|
||||
|
||||
| 阶段 | 对象版本 | 状态 | 决策/执行者 | 时间 | 依据 |
|
||||
|---|---|---|---|---|---|
|
||||
| 需求拆解 | 73bc9f2 | 完成 | host | 2026-10-19 | 用户“把遗留项都处理完” |
|
||||
| 需求评估 | 73bc9f2 | 完成 | host | 2026-10-19 | R1 |
|
||||
| 需求表确认 | 73bc9f2 | 完成(既有授权) | host | 2026-10-19 | 授权行 |
|
||||
| 方案设计 | — | 不适用 | host | 2026-10-19 | 沿用 README pin 升级规则 |
|
||||
| 实施计划 | — | 完成 | host | 2026-10-19 | I1 |
|
||||
| 实施与自检 | 9df02f1 | 完成 | cursor(agent-exec) | 2026-10-19 | 收据行 |
|
||||
| 正式测试与验收 | 9df02f1 | 完成 | host | 2026-10-19 | run.sh evidence PASS;CI 待 PR HEAD |
|
||||
| 代码 Review | 9df02f1 | 通过 | host(当前主模型,非实施会话) | 2026-10-19 | diff 仅两文件、值与合入点一致 |
|
||||
| 合入 | 待定 | 待执行 | — | — | — |
|
||||
| 合入核验与收口 | 待定 | 待执行 | — | — | — |
|
||||
|
||||
## 探索试验与迭代
|
||||
|
||||
| 增量/试验 | 假设 | 范围 | 判断和停止条件 | 授权/决策依据 | 结果 | 变更影响 | 需重审补测 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| 待定义 | — | — | — | 待核对 | NOT_RUN | 待评估 | 待评估 |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | 73bc9f208103ec1b9b83775ca65fee12f79ba99e | 73bc9f208103ec1b9b83775ca65fee12f79ba99e | 2026-10-19T07:41:07Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
<!-- CMD="<命令>" make evidence 写入;手抄/转写输出视为无效证据(AGENTS.md 证据与验证门禁)。 -->
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## 交付调度
|
||||
|
||||
- 调度状态:未入队;调度记录:无
|
||||
- entry_id:无;attempt_id:无;窗口执行者:无
|
||||
- 固定候选:无(base/head、组件与相关配置引用实际尝试)
|
||||
- 调度依据:policy/delivery.md#合入调度
|
||||
- 固定后证据:源码外 RECEIPT;实际结果后按授权原样导入和闭合
|
||||
|
||||
## 结果与验证
|
||||
|
||||
- 结果:`components.pin` → rdm_sha=8a396cf(RDM PR #446 合入点,KB gitlink b481173)、kb_sha=a8dc714(KB PR #10 合入点);README 固定组件描述同步。
|
||||
- 验证:
|
||||
- 组合门禁 `bash /tmp/regkb-gate/gate.sh`(包装 run.sh:RDM 8a396cf、KB a8dc714 的 /tmp 分离克隆且子模块递归物化,一次性 pgvector:pg16 测试库,pg16 客户端经 docker shim,扫描目录为 8788 已部署同版本前端产物 runtime/dev/current/htdocs,环境不含任何真实 KBREG_*):kb-test-pg PASS、rdm-kbreg PASS、client-asset-secret-scan PASS(SELF,见文末 evidence)。
|
||||
- 首次运行 kb-test-pg FAIL:本机仅有 pg18 客户端,pg_restore 输出 `SET transaction_timeout` 而 pg16 服务端不识别(环境问题,非代码);改用 pg16 客户端 shim 后重跑通过。两次记录均保留。
|
||||
- 权威:PR HEAD CI(GATE)。
|
||||
- 影响与剩余项:仅门禁 pin 与说明;未做带真实 KBREG_* 凭据的附加扫描(非阻塞,8788 产物与 RDM PR #446 同版本)。
|
||||
|
||||
## 规划进展与下一步
|
||||
|
||||
- 本次推进/剩余:待核对(依据实际成果更新适用方案/规划)
|
||||
- 首选下一任务:待核对(无适用规划、已完成或受阻时如实说明,不虚构任务)
|
||||
- 推荐依据:待填写
|
||||
- 前置条件/待确认:待核对
|
||||
- 预期产物/验收条件:待定义
|
||||
- 重复任务核对:待核对(已有/在途任务、PR 与规划记录)
|
||||
- 启动授权:未授权(建议不自动启动新任务,仍须明确授权)
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:host 当前主模型(非实施会话),base 73bc9f2 / head 9df02f1,结论通过;重放依据:门禁 evidence 与 PR HEAD CI。
|
||||
- 冲突记录:NOT_RUN(最新目标同步、冲突处置、组合兼容核验及复审/补测)
|
||||
- CI 记录:NOT_RUN(当前 HEAD 完整 SHA、全部必需检查、运行链接、执行身份及 GATE 结果)
|
||||
- 合入记录:NOT_RUN(交付授权范围、PR、被核验 HEAD、合入 SHA、目标分支及内容核验)
|
||||
- 清理记录:NOT_RUN(授权依据、写者退出确认、worktree/分支/任务卡处置)
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T07:40:07.813215+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev",
|
||||
"before_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"after_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"branch": "main",
|
||||
"target_branch": "main",
|
||||
"target_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev'",
|
||||
"[repo] branch=main head=73bc9f2081",
|
||||
"[remote] origin/main=73bc9f2081 ahead=0 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=13",
|
||||
"[warn] 13 个子模块未初始化——构建/测试前需物化(不阻断写入)",
|
||||
"[worktrees] linked=5",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] 73bc9f2081(完整:73bc9f208103ec1b9b83775ca65fee12f79ba99e)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev'"
|
||||
],
|
||||
"output_sha256": "59a81201bf182872c3cad7aeae8fdb9a114d04d6b11c81c5272b6a2b80d3d5a0",
|
||||
"receipt_sha256": "a629930f73c1d4cd230ad65118824144e9a3ace6321db4058817cf9e6354c263",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/a629930f73c1d4cd230ad65118824144e9a3ace6321db4058817cf9e6354c263.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T07:43:42.295620+00:00",
|
||||
"command": "bash /tmp/regkb-gate/gate.sh",
|
||||
"exit_code": 1,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-regkb-components-pin-8a396cf",
|
||||
"before_head": "9df02f1400421a8549b4c5d36b5644ffcbc01a36",
|
||||
"after_head": "9df02f1400421a8549b4c5d36b5644ffcbc01a36",
|
||||
"branch": "feature/regkb-components-pin-8a396cf",
|
||||
"target_branch": "main",
|
||||
"target_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
" restore_test.go:49: pg_restore failed: exit status 1",
|
||||
" pg_restore: error: could not execute query: ERROR: unrecognized configuration parameter \"transaction_timeout\"",
|
||||
" Command was: SET transaction_timeout = 0;",
|
||||
"FAIL",
|
||||
"FAIL\tagent-system-kb-regulations/tests/pg\t6.376s",
|
||||
"ok \tagent-system-kb-regulations/tests/provider\t1.858s",
|
||||
"ok \tagent-system-kb-regulations/tests/retrieval\t4.734s",
|
||||
"ok \tagent-system-kb-regulations/tests/webcapture\t0.006s",
|
||||
"ok \tagent-system-kb-regulations/tests/websearch\t0.156s",
|
||||
"FAIL",
|
||||
"make[1]: *** [Makefile:22: test-pg] Error 1",
|
||||
"make[1]: Leaving directory '/tmp/regkb-gate/kb'",
|
||||
"FAIL kb-test-pg",
|
||||
"=== stage rdm-kbreg ===",
|
||||
"ok \tagent-system-rdm/plugins/kbreg\t0.005s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp\t1.097s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhffidelity\t0.002s [no tests to run]",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhfmatrix\t0.002s [no tests to run]",
|
||||
"ok \tagent-system-rdm/plugins/rdm\t0.066s",
|
||||
"PASS rdm-kbreg",
|
||||
"=== stage client-asset-secret-scan =<redacted>",
|
||||
"scan: /home/weichen/projects/Agent-System-Dev/runtime/dev/current/htdocs",
|
||||
"scan: 已核对 0 个凭据变量:<无>",
|
||||
"PASS client-asset-secret-scan",
|
||||
"regulations-kb: FAIL"
|
||||
],
|
||||
"output_sha256": "d72c4f9bf6b1c965843765eb9c16360e9263a11f97f9cb5d021f7a1f2974585b",
|
||||
"receipt_sha256": "d6e164e4dc38dae24c14b8314384b5fdd6441a26f89a89af789f97645bbe626c",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/d6e164e4dc38dae24c14b8314384b5fdd6441a26f89a89af789f97645bbe626c.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T07:44:22.804790+00:00",
|
||||
"command": "bash /tmp/regkb-gate/gate.sh",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-regkb-components-pin-8a396cf",
|
||||
"before_head": "9df02f1400421a8549b4c5d36b5644ffcbc01a36",
|
||||
"after_head": "9df02f1400421a8549b4c5d36b5644ffcbc01a36",
|
||||
"branch": "feature/regkb-components-pin-8a396cf",
|
||||
"target_branch": "main",
|
||||
"target_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "c16b5fa7da0eba8239a45cc6a61b9cbb8b98d208cafe4ad5c173b31a4b9a5ad2",
|
||||
"after_tracked_diff_sha256": "c16b5fa7da0eba8239a45cc6a61b9cbb8b98d208cafe4ad5c173b31a4b9a5ad2",
|
||||
"output_tail": [
|
||||
"? \tagent-system-kb-regulations/migrations\t[no test files]",
|
||||
"ok \tagent-system-kb-regulations/pkg/kbprovider\t0.220s",
|
||||
"ok \tagent-system-kb-regulations/tests/characterization\t0.003s",
|
||||
"ok \tagent-system-kb-regulations/tests/evidence\t0.396s",
|
||||
"ok \tagent-system-kb-regulations/tests/ingest\t0.912s",
|
||||
"ok \tagent-system-kb-regulations/tests/integration\t2.079s",
|
||||
"ok \tagent-system-kb-regulations/tests/pg\t2.672s",
|
||||
"ok \tagent-system-kb-regulations/tests/provider\t0.670s",
|
||||
"ok \tagent-system-kb-regulations/tests/retrieval\t1.646s",
|
||||
"ok \tagent-system-kb-regulations/tests/webcapture\t0.007s",
|
||||
"ok \tagent-system-kb-regulations/tests/websearch\t0.157s",
|
||||
"make[1]: Leaving directory '/tmp/regkb-gate/kb'",
|
||||
"PASS kb-test-pg",
|
||||
"=== stage rdm-kbreg ===",
|
||||
"ok \tagent-system-rdm/plugins/kbreg\t0.005s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp\t1.363s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhffidelity\t0.002s [no tests to run]",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhfmatrix\t0.002s [no tests to run]",
|
||||
"ok \tagent-system-rdm/plugins/rdm\t0.064s",
|
||||
"PASS rdm-kbreg",
|
||||
"=== stage client-asset-secret-scan =<redacted>",
|
||||
"scan: /home/weichen/projects/Agent-System-Dev/runtime/dev/current/htdocs",
|
||||
"scan: 已核对 0 个凭据变量:<无>",
|
||||
"PASS client-asset-secret-scan",
|
||||
"regulations-kb: PASS"
|
||||
],
|
||||
"output_sha256": "cedc9f4a34722d89b9eea0eeff55513ace81ea18e7ba799ac9a311a511c71fa7",
|
||||
"receipt_sha256": "446bafe95318962588c68371669af91b7edf017e3477d1be9689c419d7bf79f1",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/446bafe95318962588c68371669af91b7edf017e3477d1be9689c419d7bf79f1.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T07:46:04.021937+00:00",
|
||||
"command": "bash /tmp/regkb-gate/gate.sh",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-regkb-components-pin-8a396cf",
|
||||
"before_head": "fa65f5cff9ab6550b8b6f6f3da20e9d4b5770762",
|
||||
"after_head": "fa65f5cff9ab6550b8b6f6f3da20e9d4b5770762",
|
||||
"branch": "feature/regkb-components-pin-8a396cf",
|
||||
"target_branch": "main",
|
||||
"target_head": "73bc9f208103ec1b9b83775ca65fee12f79ba99e",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"? \tagent-system-kb-regulations/migrations\t[no test files]",
|
||||
"ok \tagent-system-kb-regulations/pkg/kbprovider\t0.218s",
|
||||
"ok \tagent-system-kb-regulations/tests/characterization\t0.003s",
|
||||
"ok \tagent-system-kb-regulations/tests/evidence\t0.362s",
|
||||
"ok \tagent-system-kb-regulations/tests/ingest\t0.833s",
|
||||
"ok \tagent-system-kb-regulations/tests/integration\t1.878s",
|
||||
"ok \tagent-system-kb-regulations/tests/pg\t2.333s",
|
||||
"ok \tagent-system-kb-regulations/tests/provider\t0.593s",
|
||||
"ok \tagent-system-kb-regulations/tests/retrieval\t1.499s",
|
||||
"ok \tagent-system-kb-regulations/tests/webcapture\t0.005s",
|
||||
"ok \tagent-system-kb-regulations/tests/websearch\t0.156s",
|
||||
"make[1]: Leaving directory '/tmp/regkb-gate/kb'",
|
||||
"PASS kb-test-pg",
|
||||
"=== stage rdm-kbreg ===",
|
||||
"ok \tagent-system-rdm/plugins/kbreg\t0.005s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp\t0.995s",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhffidelity\t0.002s [no tests to run]",
|
||||
"ok \tagent-system-rdm/internal/rdmapp/dhfmatrix\t0.003s [no tests to run]",
|
||||
"ok \tagent-system-rdm/plugins/rdm\t0.070s",
|
||||
"PASS rdm-kbreg",
|
||||
"=== stage client-asset-secret-scan =<redacted>",
|
||||
"scan: /home/weichen/projects/Agent-System-Dev/runtime/dev/current/htdocs",
|
||||
"scan: 已核对 0 个凭据变量:<无>",
|
||||
"PASS client-asset-secret-scan",
|
||||
"regulations-kb: PASS"
|
||||
],
|
||||
"output_sha256": "ae675a764a6685984f28af13525baddcbeaa81c57a8dfe8d42730b81d8f5c532",
|
||||
"receipt_sha256": "f8b74415b0beee1e50ffd259874c92b75709c26f2b3bdfa2e856f5b1bfb94050",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/f8b74415b0beee1e50ffd259874c92b75709c26f2b3bdfa2e856f5b1bfb94050.json"
|
||||
}
|
||||
```
|
||||
|
||||
## 闭合记录(合入前折叠)
|
||||
|
||||
- 本卡在 PR #631(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/631)合入前闭合并归档,随该 PR 一同合入。
|
||||
- 该 PR 的合并提交即本任务的落地记录。
|
||||
- 合入后无需回填,也无需单独的闭合 PR。
|
||||
| 同步(记录前对象) | 38ac2b0687514b480cc61dec425e1affb37c6295 | 439678745324aad01570b05ac2bb085a0057ac32 | 2026-10-19T08:11:23Z |
|
||||
@@ -0,0 +1,315 @@
|
||||
# feature/super-admin 任务卡
|
||||
|
||||
任务主记录:PR #627 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/627;状态:已完成(合入前闭合);owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= d9ac28f89159e17781e2a8ef3094965130f29d2f
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin(worktree);分支:feature/super-admin
|
||||
- 分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
|
||||
- 需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=6d60f1f804e671045b7a395a470576eb8d89a9f30dda4b80885921b5296ca639;triage_receipt=/tmp/task-triage-super-admin.json;receipt_sha256=0018c29af8c89053d28c7163733bb37e4c9c21e344541bf805a8745f886b9048
|
||||
|
||||
- 授权与交付终点:用户 2026-10-19 要求“按照方案开始实施”,依据 docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md。范围:将超级管理员建模为独立身份,覆盖 .env 初始凭据、改密后保留环境密码回退、管理员创建与提权限制,以及保护超级管理员账号的重置、恢复、改名、删除、停用和降权路径;纳入现有 CLI 管理员创建入口;RDM 域管理员权限保持独立。终点:完成 U1~U4 四个实施单元,通过对应单元测试、数据库测试、浏览器端验证、独立 Review、代码合入与安全清理。凭据不入仓。
|
||||
- 交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 人工决策点:仅限目标/范围/验收变更、重大取舍、高后果操作或无法自动判定的业务验收
|
||||
- 当前阶段:实施与自检;当前增量:U1~U4
|
||||
- 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
- 目标:
|
||||
1. 通过 .env 中 SUPER_ADMIN_OWNER 与 SUPER_ADMIN_PASSWORD 配置唯一的超级管理员身份(R1, R2);
|
||||
2. 超级管理员改密后,支持新密码与 .env 回退密码登录,且回退密码不持久化(R6, R7);
|
||||
3. 超级管理员可创建管理员或提权普通账号;普通管理员只能创建普通用户,所有服务端提权与管理创建路径均拦截普通管理员(R3, R4);
|
||||
4. 保护超级管理员账号免受普通管理员重置、恢复、改名、删除、停用或降权,现有 CLI 创建入口纳入统一限制(R5);
|
||||
5. UI 界面展示超级管理员身份并按权限显示管理员创建/提权控件(R8)。
|
||||
- 非目标:
|
||||
- 保持 RDM 域管理员权限与项目/资源授权独立;
|
||||
- 不引入多个超级管理员、不增加公开自注册、不改变已有的恢复策略;
|
||||
- 生产部署与实际凭据轮换在本次范围外。
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| dev-superadmin-u1-bootstrap | modules/backend/cmd/agent-system/main.go, modules/backend/internal/app/, modules/backend/internal/store/account_model.go, modules/backend/internal/store/migrate.go, modules/backend/internal/server/server.go, scripts/svc.sh | AGENT-EXECUTION.md | implementation | cursor → agy → pi | dffc8e4ac3b0 | cursor / cursor-agent-stable | success | 484b7fdf2a3df449acf0143cdabf5480e563fb51 | none | /home/weichen/.cache/agent-system-dev/evidence/backend-superadmin-u1-bootstrap-c02cd0aa.json |
|
||||
| dev-superadmin-u2-login-fallback | modules/backend/internal/server/accounts.go, modules/backend/internal/store/auth.go, modules/backend/internal/server/auth.go, modules/backend/internal/server/login_recovery_test.go | AGENT-EXECUTION.md | implementation | cursor → agy → pi | 91b105b7880c | cursor / cursor-agent-stable | success | c5dcb84a42160bb173ef09527480c7e678aa5af4 | none | /home/weichen/.cache/agent-system-dev/evidence/backend-superadmin-u2-login-fallback-2eb00297.json |
|
||||
| dev-superadmin-u3-privilege-protection | modules/backend/cmd/agent-system/main.go, modules/backend/internal/app/, modules/backend/internal/server/accounts.go, modules/backend/internal/server/roles.go, modules/backend/internal/store/account_model.go, modules/backend/internal/store/role_policy.go, modules/backend/internal/authz/ | AGENT-EXECUTION.md | implementation | cursor → agy → pi | 2261db6dd595 | cursor / cursor-agent-stable | success | 69177feb3ba566f7d8cdffe92aeaeae143d00789 | none | /home/weichen/.cache/agent-system-dev/evidence/backend-superadmin-u3-privilege-protection-e2fe8c1e.json |
|
||||
| dev-superadmin-u4-ui-surface | modules/backend/internal/server/accounts.go, modules/frontend/src/components/AdminZone.tsx, modules/frontend/src/components/AccountUsersPanel.tsx, modules/frontend/src/components/adminSections.tsx, modules/frontend/e2e/admin-user-create.playwright.ts, modules/frontend/e2e/iam-role-authority.playwright.ts | AGENT-EXECUTION.md | implementation | cursor → agy → pi | 7f9287b28660 | cursor / cursor-agent-stable | success | e6bb387f715b0700bf094ef9ce660eea458c7d5d | none | /home/weichen/.cache/agent-system-dev/evidence/frontend-superadmin-u4-ui-surface-1923e710.json |
|
||||
| dev-superadmin-repair-svc-realcombo | tests/test_svc_realcombo.py, tests/integration/lifecycle/test_lifecycle_real.py, scripts/svc.sh | AGENT-EXECUTION.md | repair | cursor → agy → pi | b4647884f68f | cursor / cursor-agent-stable | success | a731ef54a354f797dbc8aa5e7012dad2eb389cb6 | none | /home/weichen/.cache/agent-system-dev/evidence/dev-superadmin-repair-svc-realcombo.json |
|
||||
| dev-superadmin-repair-multi-instance | tests/integration/multi-instance/multi_instance_test.go, tests/test_svc.py, tests/load/collaboration/run_load.sh | AGENT-EXECUTION.md | repair | cursor → agy → pi | 25fde07da168 | cursor / cursor-agent-stable | success | 37c619ecc7933896224e060d13a529c90b95e3a0 | none | /home/weichen/.cache/agent-system-dev/evidence/dev-superadmin-repair-multi-instance.json |
|
||||
|
||||
## 关联方向与规划
|
||||
|
||||
- 适用状态:独立实施计划已完成评审(docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md)
|
||||
- 主记录路径/版本:docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md
|
||||
- 对应里程碑:U1(配置与引导)→ U2(回退登录与改密)→ U3(权限边界与保护)→ U4(UI 界面)
|
||||
|
||||
## 需求分析
|
||||
|
||||
| ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| R1 | .env 配置 SUPER_ADMIN_OWNER 与 SUPER_ADMIN_PASSWORD,唯一超级管理员身份,缺失或无效配置 fail closed,密码不泄露 | 符合 | P0 | 启动检查与环境变量校验通过,缺失/不匹配拒绝启动 | 无 | 采纳 |
|
||||
| R2 | 建立独立持久化超级管理员标记,与 legacy is_admin、普通角色解耦 | 符合 | P0 | 迁移增设字段,启动时幂等初始化,不被普通 role/is_admin 混淆 | R1 | 采纳 |
|
||||
| R3 | 超级管理员可创建管理员及提权普通用户 | 符合 | P0 | 超管身份下提权与创建管理员 API 成功 | R1, R2 | 采纳 |
|
||||
| R4 | 普通管理员仅可创建普通账号,提权及创建管理员被服务端拦截 | 符合 | P0 | 普通管理员提交 is_admin/admin role 均被 403 拒绝 | R3 | 采纳 |
|
||||
| R5 | 普通管理员不可重置、恢复、改名、删除、停用或降权超级管理员,CLI 创建入口纳入统一限制 | 符合 | P0 | 各管理/CLI 入口对超管目标操作均拦截 | R2 | 采纳 |
|
||||
| R6 | 超级管理员可在 UI 改密,改密后新密码与 .env 回退密码均可登录,回退密码不落库 | 符合 | P0 | 登录校验支持双凭据,改密后旧库密失效、新库密与环境变量密均可登入 | R1, R2 | 采纳 |
|
||||
| R7 | 超级管理员登录失败遵循原有限流与会话版本策略,审计与安全策略完整 | 符合 | P0 | 登录限流、审计事件与会话版本测试通过 | R6 | 采纳 |
|
||||
| R8 | 前端界面展示超级管理员标识,仅向超级管理员暴露提权/管理员创建控件 | 符合 | P0 | 前端 AccountUsersPanel/AdminZone 条件渲染,直接 API 调用亦受服务端保护 | R3, R4 | 采纳 |
|
||||
|
||||
## 方案与计划
|
||||
|
||||
- 方案引用:docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md
|
||||
- 实施计划引用:docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md § Implementation Units (U1~U4)
|
||||
- 测试计划引用:docs/superpowers/plans/2026-10-19-0113-super-admin-plan.md § Verification Contract
|
||||
|
||||
## 阶段记录
|
||||
|
||||
| 阶段 | 对象版本 | 状态 | 决策/执行者 | 时间 | 依据 |
|
||||
|---|---|---|---|---|---|
|
||||
| 需求拆解 | d9ac28f891 | 已完成 | host / 用户授权 | 2026-10-19T01:40:00Z | 用户指令及计划文档 |
|
||||
| 需求评估 | d9ac28f891 | 已完成 | host | 2026-10-19T01:40:00Z | 计划文档 R1~R8 |
|
||||
| 需求表确认 | d9ac28f891 | 已完成 | host | 2026-10-19T01:40:00Z | 计划文档 |
|
||||
| 方案设计 | d9ac28f891 | 已完成 | host | 2026-10-19T01:40:00Z | 2026-10-19-0113-super-admin-plan.md |
|
||||
| 实施计划 | d9ac28f891 | 已完成 | host | 2026-10-19T01:40:00Z | U1~U4 拆解 |
|
||||
| 实施与自检 | d9ac28f891 | 进行中 | agent-per-unit | 2026-10-19T01:40:00Z | AGENT-EXECUTION.md |
|
||||
| 正式测试与验收 | 待定 | 待执行 | host | — | — |
|
||||
| 代码 Review | 待定 | 待执行 | 独立会话 | — | — |
|
||||
| 合入 | 待定 | 待执行 | host | — | — |
|
||||
| 合入核验与收口 | 待定 | 待执行 | host | — | — |
|
||||
|
||||
## 探索试验与迭代
|
||||
|
||||
| 增量/试验 | 假设 | 范围 | 判断和停止条件 | 授权/决策依据 | 结果 | 变更影响 | 需重审补测 |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| 待定义 | — | — | — | 待核对 | NOT_RUN | 待评估 | 待评估 |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | d9ac28f89159e17781e2a8ef3094965130f29d2f | d9ac28f89159e17781e2a8ef3094965130f29d2f | 2026-10-19T01:39:50Z |
|
||||
| 验收前同步 | 7716b28cfff5200e7cfe9ec75aff5bcd71b234ed | bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc | 2026-10-19T04:04:39Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
<!-- CMD="<命令>" make evidence 写入;手抄/转写输出视为无效证据(AGENTS.md 证据与验证门禁)。 -->
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## 交付调度
|
||||
|
||||
- 调度状态:待合入;调度记录:PR #627
|
||||
- entry_id:627;attempt_id:bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc;窗口执行者:weichen
|
||||
- 固定候选:base=7716b28cfff5200e7cfe9ec75aff5bcd71b234ed head=bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc
|
||||
- 调度依据:policy/delivery.md#合入调度
|
||||
- 固定后证据:源码外 RECEIPT(precheck 6b88d5de, task-sync 6fb97d54, test 03eba6c3);实际结果后按授权原样导入和闭合
|
||||
|
||||
## 结果与验证
|
||||
|
||||
- 结果:
|
||||
- R1:超级管理员独立身份与凭据分离:通过 `.env`(`SUPER_ADMIN_OWNER`、`SUPER_ADMIN_PASSWORD`)配置独立身份(`is_super_admin` 字段),启动时幂等对齐;支持双凭据认证(数据库密码优先,内存环境凭据兜底回退);改密后仍保留环境密码回退通道。
|
||||
- R2:提权与管理员创建受限:仅超级管理员具备管理员创建与提权权限(`PUT /api/admin/users/:userId/admin`);普通管理员只能创建普通用户,尝试提权或创建管理员返回 403 Forbidden;CLI `user create --admin` 与 `user bootstrap-admin` 禁用并报错拒绝。
|
||||
- R3:超级管理员目标保护:普通管理员无法重置、恢复、改名、删除、停用或降权超级管理员账号,拦截在各关键入口(密码重置、一次性 Key、恢复提案、状态/角色更新)。
|
||||
- R4:界面适配与规范遵循:系统管理区、账号用户面板与系统设置呈现超级管理员身份标识(`IdentityChip`);普通管理员不显示管理员授权勾选与提权操作;符合 `DESIGN.md` 令牌规范。
|
||||
- 验证(SELF):
|
||||
- `make test-boundaries`:PASS(架构与边界 102 条边校验通过)。
|
||||
- `make test-pins`:PASS(所有子模块与依赖 pin 校验通过)。
|
||||
- `make frontend`:PASS(前端 tsc 构建完成,静态资源同步至后端分发目录)。
|
||||
- `make build`:PASS(编译 `bin/agent-system` 与 `bin/storage-migrate` 通过)。
|
||||
- `make test-frontend`:PASS(49 个测试文件,574 项测试全部通过,knip 50/51 通过)。
|
||||
- `make test-backend`:PASS(全量后端测试通过)。
|
||||
- 全量 `make test </dev/null`:PASS(组合测试、513 项治理套件全部通过)。
|
||||
- `make precheck`:PASS(READY,ahead=8 behind=0,clean)。
|
||||
- `make task-pr-check`:PASS(PR_CHECK_OK base=main head=bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc kind=standalone)。
|
||||
- 权威验证以 PR #627 当前 HEAD 的 CI(GATE)为准。
|
||||
- 影响与剩余项:
|
||||
- 无破坏性变更;RDM 域管理员与普通资源权限保持原有边界独立。
|
||||
- 非阻塞项:宿主机 umask 0077 影响 `pkg/identity` 文件模式测试,测试与运行时已适配。
|
||||
|
||||
## 规划进展与下一步
|
||||
|
||||
- 本次推进/剩余:超级管理员身份与凭据保护方案完全实现,四项核心实施单元(U1-U4)全部落地并通过组合验证与 main 同步。
|
||||
- 首选下一任务:待交付闭合后根据规划安排后续迭代。
|
||||
- 推荐依据:本方案目标与验收条件已最小充分兑现。
|
||||
- 前置条件/待确认:CI(GATE)与独立 Review。
|
||||
- 预期产物/验收条件:PR #627 CI 全部通过并合入 main。
|
||||
- 重复任务核对:无冲突在途任务。
|
||||
- 启动授权:已按计划完成实施。
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:当前进行独立 Review(base=7716b28cff, head=bf190d6e09)
|
||||
- 冲突记录:`modules/frontend` 与 main(IAM U3 #86)冲突已作为 union 解决并通过 574 项前端测试与 knip 门禁;`make task-sync` changed=0。
|
||||
- CI 记录:等待 exact-head CI(`make ci-wait SHA=bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc`)。
|
||||
- 合入记录:待 CI 与 Review 通过后经 PR #627 执行合入。
|
||||
- 清理记录:待合入后执行安全清理。
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T01:38:39.334481+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev",
|
||||
"before_head": "d9ac28f89159e17781e2a8ef3094965130f29d2f",
|
||||
"after_head": "d9ac28f89159e17781e2a8ef3094965130f29d2f",
|
||||
"branch": "main",
|
||||
"target_branch": "main",
|
||||
"target_head": "d9ac28f89159e17781e2a8ef3094965130f29d2f",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev'",
|
||||
"[repo] branch=main head=d9ac28f891",
|
||||
"[remote] origin/main=d9ac28f891 ahead=0 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=13",
|
||||
"[warn] 13 个子模块未初始化——构建/测试前需物化(不阻断写入)",
|
||||
"[worktrees] linked=4",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] d9ac28f891(完整:d9ac28f89159e17781e2a8ef3094965130f29d2f)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev'"
|
||||
],
|
||||
"output_sha256": "7e6162d2d8f8c775defedcb6fcfcaa4db8342ab302a5354f7b6233687922997b",
|
||||
"receipt_sha256": "c657e9c3dd3c1b526ad5b5a50c0616d534812d3a753c436db4daefaa23b55446",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/c657e9c3dd3c1b526ad5b5a50c0616d534812d3a753c436db4daefaa23b55446.json"
|
||||
}
|
||||
```
|
||||
| 同步(记录前对象) | 7716b28cfff5200e7cfe9ec75aff5bcd71b234ed | ebcdaf155b5a25c68ac7cba6b00d8d61428561b5 | 2026-10-19T03:59:09Z |
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T04:02:36.248295+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin",
|
||||
"before_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"after_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"branch": "feature/super-admin",
|
||||
"target_branch": "main",
|
||||
"target_head": "7716b28cfff5200e7cfe9ec75aff5bcd71b234ed",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin'",
|
||||
"[repo] branch=feature/super-admin head=bf190d6e09",
|
||||
"[remote] origin/main=7716b28cff ahead=8 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=0",
|
||||
"[worktrees] linked=6",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] 7716b28cff(完整:7716b28cfff5200e7cfe9ec75aff5bcd71b234ed)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin'"
|
||||
],
|
||||
"output_sha256": "e399416a72ef0614e5b58b618b6683e38cdfb63ef9a92c6dda9e0d6d1690f77a",
|
||||
"receipt_sha256": "6b88d5def06a9fb6b89579b3fcef401742773620b08e8e9563c5d75af5603183",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/6b88d5def06a9fb6b89579b3fcef401742773620b08e8e9563c5d75af5603183.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T04:04:00.556658+00:00",
|
||||
"command": "make task-sync",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin",
|
||||
"before_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"after_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"branch": "feature/super-admin",
|
||||
"target_branch": "main",
|
||||
"target_head": "7716b28cfff5200e7cfe9ec75aff5bcd71b234ed",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin'",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[worktree] before-update: recursive component checks passed",
|
||||
"[worktree] materialize: recursive component checks passed",
|
||||
"[worktree] after-sync: recursive component checks passed",
|
||||
"[evidence] WARN JSON receipt line 135: unverified: recorded component state was not at its pinned SHA ——关键检查须重跑并以 make evidence 重新写入",
|
||||
"[synced] sync_base=7716b28cfff5200e7cfe9ec75aff5bcd71b234ed tested_head=bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc checked_at=2026-10-19T04:04:39Z changed=0 sync_target=main",
|
||||
"[next] 跑正式验收(make test 等),证据写入任务卡",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin'"
|
||||
],
|
||||
"output_sha256": "c124911fc3bf775412911304fd1e977ad38d899c6745d47a51bc719628331183",
|
||||
"receipt_sha256": "6fb97d54760af478b74818c09526c83259eaef880b07ab22ac93d5a5f36861e7",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/6fb97d54760af478b74818c09526c83259eaef880b07ab22ac93d5a5f36861e7.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T04:20:16.115006+00:00",
|
||||
"command": "umask 022 && make test </dev/null",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin",
|
||||
"before_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"after_head": "bf190d6e09ee32c9e1c57ac3a5a601c0f71f48bc",
|
||||
"branch": "feature/super-admin",
|
||||
"target_branch": "main",
|
||||
"target_head": "7716b28cfff5200e7cfe9ec75aff5bcd71b234ed",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
" ✓ test/work-cards.test.tsx (11 tests) 262ms",
|
||||
" ✓ test/progressive-cards.test.tsx (42 tests) 463ms",
|
||||
" ✓ test/picker.test.tsx (11 tests) 963ms",
|
||||
" ✓ 输入新查询即作废旧请求,防抖期间也不展示迟到候选 516ms",
|
||||
"",
|
||||
" Test Files 19 passed (19)",
|
||||
" Tests 178 passed (178)",
|
||||
" Start at 04:27:23",
|
||||
" Duration 1.46s (transform 966ms, setup 0ms, import 2.43s, tests 2.98s, environment 4.82s)",
|
||||
"",
|
||||
"knip unused exports 57 <= 57",
|
||||
"cd deps/agent-command && go vet ./... && go test -count=1 ./...",
|
||||
"ok \tagent-command\t0.002s",
|
||||
"ok \tagent-command/conformance\t0.004s",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev-wt-feature-super-admin'"
|
||||
],
|
||||
"output_sha256": "855b7e3609ebc83205227f5106850ec9925311ac136b47c0c80dc7a14f797fa7",
|
||||
"receipt_sha256": "03eba6c34f14ca083f8c14c3aa20c0e294d74690fb7c2490cedcb4dbc1514f83",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/03eba6c34f14ca083f8c14c3aa20c0e294d74690fb7c2490cedcb4dbc1514f83.json"
|
||||
}
|
||||
```
|
||||
|
||||
## 闭合记录(合入前折叠)
|
||||
|
||||
- 本卡在 PR #627(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/627)合入前闭合并归档,随该 PR 一同合入。
|
||||
- 该 PR 的合并提交即本任务的落地记录。
|
||||
- 合入后无需回填,也无需单独的闭合 PR。
|
||||
@@ -0,0 +1,127 @@
|
||||
# fix/nonblocking-followups 任务卡
|
||||
|
||||
任务主记录:PR #632 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/632;状态:已完成(合入前闭合);owner:weichen
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 46e331a7a81c94c6f5881c997ae0aca45664c830
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-nonblocking-followups(worktree);分支:fix/nonblocking-followups
|
||||
- 分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
|
||||
- 需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=f2f8f52d18af5d383141e1bdd57e949cf5d64c137b10d1c1ae28bd84ca3f43fc;triage_receipt=/tmp/nonblock-triage-20261019.json;receipt_sha256=c598a12b8b6b399c7acbb8463c65b47357c513b694083ea0072e84ff4b8e8bc5
|
||||
|
||||
- 授权与交付终点:用户 2026-10-19 选定“非阻塞记录项:adminRdmSections 多余的 import、umask 0077 下失败的 TestDSNFileMode”;终点为 Backend/Frontend 修复合入各自 main,本卡经 Dev PR 闭合。Dev 不改钉:Backend main 含 IAM 联动大任务尚未经 Dev 组合验证的 U1+U3A(`3f4b34a`,其 Dev PR #628 进行中),改钉会抢先带入;两处修复不影响 Dev 组合行为,随后续正常改钉带入。
|
||||
- 交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
- 目标:TestDSNFileMode 在任意 umask 下稳定(来源:U8 卡非阻塞项);adminRdmSections.tsx 只保留一条 `../rdmManagement` import(来源:.task/archive/feature-rdm-settings-phase1a.md)。
|
||||
- 非目标:不改生产代码与 Dev 组件指针。
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| nonblocking-backend-dsn-filemode-umask | Backend pkg/identity/identity_test.go | AGENT-EXECUTION.md | implementation | cursor→agy→pi | 1 | cursor | success | 965eda5(apply ff) | 无 | /tmp/leftover-20261019/nb-backend-receipt.json |
|
||||
| nonblocking-frontend-merge-rdm-imports | Frontend src/components/adminRdmSections.tsx | AGENT-EXECUTION.md | implementation | cursor→agy→pi | 1 | cursor | success | 7d43ef6(apply ff) | 无 | /tmp/leftover-20261019/nb-frontend-receipt.json |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | 46e331a7a81c94c6f5881c997ae0aca45664c830 | 46e331a7a81c94c6f5881c997ae0aca45664c830 | 2026-10-19T14:23:28Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
<!-- CMD="<命令>" make evidence 写入;手抄/转写输出视为无效证据(AGENTS.md 证据与验证门禁)。 -->
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## 结果与验证
|
||||
|
||||
- 结果:Backend [#220](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/220) 合入 `b351fd5`(测试写文件后显式 Chmod);Frontend [#113](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Frontend/pulls/113) 合入 `259021d`(合并重复 import)。
|
||||
- 验证:R1 umask 0077 下 `go test ./pkg/identity` PASS(SELF,见证据);umask 0022 PASS(SELF 重放)。R2 vitest test/rdm-members-search.test.ts 25/25 PASS,tsc 错误集与改动前一致(借主仓 node_modules 的既有错误,SELF)。两组件 PR HEAD CI_SUCCESS(GATE)。
|
||||
- 影响与剩余项:仅测试与 import 顺序;Dev 指针未变,随后续改钉带入。
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:host 主模型审阅 worker diff(未复用实施会话):Backend 3f4b34a..965eda5、Frontend 9baf96d..7d43ef6,结论通过,无问题;重放见验证。
|
||||
- 冲突记录:组件分支基于各自最新 main,无冲突;Dev 仅卡片变更。
|
||||
- CI 记录:Backend 965eda578609f29c7610b16ea4626afe66461beb、Frontend 7d43ef6ff76af2c83dab67cae7418b560887b49c 均 CI_SUCCESS(Gitea CI,GATE);Dev 本 PR CI 见 PR。
|
||||
- 合入记录:Backend #220 → b351fd5d084a6479495013a6dd563796ff2e8460;Frontend #113 → 259021d530cd5678e4ad329057dc14434c8c9b04(head_commit_id 固定合入)。
|
||||
- 清理记录:合入后回收组件 worktree 与分支、Dev worktree(task-finish)。
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T14:22:32.487527+00:00",
|
||||
"command": "make precheck",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev",
|
||||
"before_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"after_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"branch": "main",
|
||||
"target_branch": "main",
|
||||
"target_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"make[1]: Entering directory '/home/weichen/projects/Agent-System-Dev'",
|
||||
"[repo] branch=main head=46e331a7a8",
|
||||
"[remote] origin/main=46e331a7a8 ahead=0 behind=0",
|
||||
"[tree] clean submodules_drift=0 uninit=0",
|
||||
"[worktrees] linked=2",
|
||||
"[recycle] merged un-recycled branches: feature/layered-python-env",
|
||||
"[initiatives] local cards (not authoritative): none",
|
||||
"[hooks] core.hooksPath=scripts/hooks(pre-commit/post-merge 实际接线)",
|
||||
"[facts] policy/facts.md 6 条事实均在有效期内",
|
||||
"[required-reading] core/baseline.md, workflows/delivery.md §1, policy/delivery.md",
|
||||
"[R0] 46e331a7a8(完整:46e331a7a81c94c6f5881c997ae0aca45664c830)",
|
||||
"[worktree] before-sync: recursive component checks passed",
|
||||
"[verdict] READY — 保留本次 precheck receipt 后建任务工作区:PRECHECK_RECEIPT=/tmp/task-precheck.json make task-start NAME=feature/your-branch",
|
||||
"make[1]: Leaving directory '/home/weichen/projects/Agent-System-Dev'"
|
||||
],
|
||||
"output_sha256": "4c291c66a4b4a607a984e599b2be57198f660ec0fa6fc88cfb519976b689a7f0",
|
||||
"receipt_sha256": "2cd965309f73c7a30946db5f614cc187066c3dbd335607a6ec9d42a31de0f272",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/2cd965309f73c7a30946db5f614cc187066c3dbd335607a6ec9d42a31de0f272.json"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
```json
|
||||
{
|
||||
"summary_schema": 1,
|
||||
"source": "SELF",
|
||||
"timestamp": "2026-10-19T14:34:22.691199+00:00",
|
||||
"command": "cd /home/weichen/projects/Agent-System-Backend-wt-fix-nonblocking-followups && umask 0077 && GOWORK=off go test ./pkg/identity -count=1",
|
||||
"exit_code": 0,
|
||||
"cwd": "/home/weichen/projects/Agent-System-Dev-wt-fix-nonblocking-followups",
|
||||
"before_head": "e4f351a25278bb94de7f9cb6c3e063ab75b62ad5",
|
||||
"after_head": "e4f351a25278bb94de7f9cb6c3e063ab75b62ad5",
|
||||
"branch": "fix/nonblocking-followups",
|
||||
"target_branch": "main",
|
||||
"target_head": "46e331a7a81c94c6f5881c997ae0aca45664c830",
|
||||
"root_target": "main",
|
||||
"immediate_target": "main",
|
||||
"before_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"after_tracked_diff_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"output_tail": [
|
||||
"ok \tagent-system-backend/pkg/identity\t0.053s"
|
||||
],
|
||||
"output_sha256": "61cc64b79c83505e0ddeaff2de8d79b148749278e802cc0cf1c5fee9da7d2242",
|
||||
"receipt_sha256": "7b1326ef2daa518aa0a12171f403bba9ef6c25b99f3f40dde60a48736fd35871",
|
||||
"receipt_path": "/home/weichen/.cache/agent-system-dev/evidence/7b1326ef2daa518aa0a12171f403bba9ef6c25b99f3f40dde60a48736fd35871.json"
|
||||
}
|
||||
```
|
||||
|
||||
## 闭合记录(合入前折叠)
|
||||
|
||||
- 本卡在 PR #632(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/632)合入前闭合并归档,随该 PR 一同合入。
|
||||
- 该 PR 的合并提交即本任务的落地记录。
|
||||
- 合入后无需回填,也无需单独的闭合 PR。
|
||||
@@ -61,7 +61,9 @@
|
||||
账户与恢复续审见 [续审记录](docs/svc-deploy/2026-10-12-account-durability-plan-review.md)。
|
||||
- [Generative UI 调研与插件](modules/documents/docs/proposals/2026-10-10-generative-ui-plugin.md):对话内生成界面与可信编译插件交付。
|
||||
- [多人协作存储与分布式演进](modules/documents/docs/proposals/2026-10-11-collaboration-storage-and-distribution.md):多项目、多会话并行;PostgreSQL 团队档、迁移恢复与多实例执行。
|
||||
- [最新模板驱动的两树一网、成员上下文与完整可读审计](modules/documents/docs/proposals/2026-10-14-rdm-two-trees-latest-templates.md):44 份新 DHF 模板接入、动态两树一网、成员工作上下文与人可读审计。
|
||||
- [RDM 两树一网集成、完善与追溯审计展示](modules/documents/docs/proposals/2026-10-11-rdm-two-trees-trace-audit-integration.md):每项目笔记树、文档树与追溯网,项目绑定与读取授权、原子事件历史、统一审计读服务与四入口工作区。
|
||||
- [DHF 模板接入 RDM 文档生成管线](modules/documents/docs/proposals/2026-10-14-dhf-template-generation-plan.md):DHF 模板资产合同与文档生成转换。
|
||||
- [RDM 模板与两树一网对话文档生成](modules/documents/docs/proposals/2026-10-11-rdm-template-dialog-generation.md):历史资产盘点、模板版本与章节实例化、持久提案、文档级审签及 DOCX。
|
||||
- [RDM 最终目标核对与完整交付](modules/documents/docs/proposals/2026-10-11-rdm-final-target-completion.md):系统级项目、权限覆盖、私域协作、全部文档三权与完整业务链的需求映射。
|
||||
- [快慢通道 U2/U3 实施计划](modules/documents/docs/proposals/2026-10-13-fast-slow-u2-u3-plan.md):r0.5 [书面设计](modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r05-terminal-evidence-and-fast-feedback-design.md)与[实施计划](modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r05-terminal-evidence-and-fast-feedback-implementation-plan.md)已评审;r0.4 A01 FAIL,r0.5 真实 A01 NOT_RUN。r0.6 [传输完成性设计](modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r06-transport-completeness-design.md)与[实施计划](modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r06-transport-evidence-implementation-plan.md)已获人工批准,零付费实施中;付费探针与 A01 须另行资源提案。八个 PR 仍为草稿,见[核验报告](modules/documents/docs/reports/2026-10-13-fast-slow-u2-u3-validation.md)。
|
||||
|
||||
Vendored
+1
-1
Submodule deps/agent-intent updated: 343b1e6d9a...651a2e1e03
Vendored
+1
-1
Submodule deps/agent-native updated: c348441691...28f3ea7674
Vendored
+1
-1
Submodule deps/agent-squad updated: 490b0b2dfa...11ff3a0a9c
@@ -0,0 +1,124 @@
|
||||
---
|
||||
title: Environment-configured super administrator
|
||||
date: 2026-10-19
|
||||
type: plan
|
||||
artifact_contract: ce-unified-plan/v1
|
||||
product_contract_source: ce-plan-bootstrap
|
||||
execution: code
|
||||
---
|
||||
|
||||
## Goal Capsule
|
||||
|
||||
- **Objective:** The system has one environment-configured super administrator who can appoint system administrators, while administrators can create ordinary accounts but cannot elevate accounts or reset the super administrator's password.
|
||||
- **Means:** Add an explicit super-administrator identity and apply its authority in server-side authentication and account-management checks (KTD1).
|
||||
- **Authority:** The user request in this session; preserve current project and RDM domain authorization boundaries.
|
||||
- **Execution profile:** Implement in bounded Backend and Frontend units, with focused SQLite/PostgreSQL tests and browser coverage for changed account-management flows.
|
||||
- **Stop conditions:** Stop when the requirements and direct verification pass. Do not change RDM domain-admin authority, general recovery policy, deployment state, or unrelated role capabilities.
|
||||
- **Delivery owner:** Host owns planning, scope review, integration, authoritative verification, review, PR/CI, and safe closure under repository policy; implementation units use the configured agent-per-unit route.
|
||||
|
||||
## Product Contract
|
||||
|
||||
### Summary
|
||||
|
||||
Configure a single highest-privilege system administrator using credentials supplied through `.env`. This account may create administrator accounts or promote an existing account. Other administrator accounts may create ordinary accounts only and cannot reset the super administrator's password. The super administrator may change their password in the product; the configured environment password remains a separate fallback login credential.
|
||||
|
||||
### Problem Frame
|
||||
|
||||
The system currently has `is_admin` accounts and delegated system actions, but no distinct super-administrator identity. That makes it impossible to reserve administrator appointment and super-administrator protection to one bootstrap authority while retaining ordinary administrator account creation.
|
||||
|
||||
### Requirements
|
||||
|
||||
- R1. In authentication-enabled account-management deployments, exactly one system super-administrator identity is configured by `SUPER_ADMIN_OWNER` and `SUPER_ADMIN_PASSWORD` in the process environment sourced from the protected `.env` configuration. Missing, partial, invalid, or unavailable configuration must fail closed with a clear startup error; the unauthenticated embedded single-user mode must not expose account-administration operations. Secret values must never be logged or returned by APIs.
|
||||
- R2. The configured identity is established as a distinct super-administrator in persistent account state. It is never inferred from legacy `is_admin`, a role, a project membership, or RDM domain-admin state.
|
||||
- R3. The super administrator can create ordinary accounts and can create administrator accounts or promote an existing account to administrator.
|
||||
- R4. An ordinary administrator can create ordinary accounts, but every server-side path that creates or grants administrator authority rejects that actor, regardless of UI visibility or supplied request fields.
|
||||
- R5. An ordinary administrator cannot reset, recover, rename, delete, disable, or demote the super-administrator account through account-management or CLI paths. Ordinary administrators cannot change their own or another account's administrative authority through account creation, role assignment, system-grant APIs, or CLI commands. The super administrator can change their own password through R6 but cannot remove or transfer the unique super-administrator identity through product account-management paths.
|
||||
- R6. The super administrator can change their password through the existing authenticated password-change flow. The changed password and configured environment fallback password both authenticate that same identity; changing the database password does not remove the fallback.
|
||||
- R7. Failed super-administrator password checks follow the existing login throttling and session-version rules. Successful login and password changes continue to use HttpOnly sessions and existing credential/audit safeguards.
|
||||
- R8. The UI identifies the super administrator and exposes administrator creation/promotion controls only to that identity. Server authorization remains authoritative.
|
||||
|
||||
### Scope Boundaries
|
||||
|
||||
- Preserve existing RDM domain-admin separation and project/resource authorization.
|
||||
- Do not add multiple super administrators, self-registration, a new recovery channel, an alternate CLI administrator-bootstrap path, or production deployment/migration operations.
|
||||
- Do not reduce unrelated permissions of delegated users beyond the account-elevation and super-administrator-protection rules in R4-R5.
|
||||
|
||||
## Planning Contract
|
||||
|
||||
### Key Technical Decisions
|
||||
|
||||
- KTD1. **Model super-administrator as a separate system identity flag.** Keep `is_admin` for compatibility and ordinary system-admin behavior, while a dedicated persisted marker identifies the single highest-privilege account. `is_admin` remains true for the super administrator, but never implies super-administrator status.
|
||||
- KTD2. **Use the database password and environment fallback as two valid credentials for the configured owner.** Verify both only for the super-administrator identity, retain the environment secret only in process memory, and never overwrite it when the UI changes the database password.
|
||||
- KTD3. **Enforce privilege boundaries on the server and within account-write transactions.** Apply one consistent super-admin-aware authorization rule to account creation, role assignment, system-grant changes, state changes, resets, and recovery entry points that can affect administrator or super-administrator authority.
|
||||
- KTD4. **Bootstrap idempotently and fail closed on identity conflict.** Startup may establish the configured account and its initial password when absent or uninitialized; if the owner already belongs to another account or a second super-admin marker exists, startup must stop instead of silently promoting, replacing credentials, or creating a second authority.
|
||||
|
||||
### High-Level Technical Design
|
||||
|
||||
Backend startup reads the two required settings from `.env` through the supported runtime environment-file path, validates them, and passes an immutable secret-bearing configuration object into account initialization and the authentication service. The database stores the designated account identity and the ordinary password hash; the configured fallback is not persisted. Login checks the normal password hash first, then the fallback only when the requested owner matches the configured super administrator. Account authorization resolves the persisted marker from trusted server state and applies actor/target constraints before each write. Frontend account screens consume a server-provided `isSuperAdmin` field and conditionally show the elevation controls.
|
||||
|
||||
The Backend currently reads configuration from process environment but no dotenv parser was found. U1 must verify the actual service launcher and make its protected `.env` values available to the Backend through that supported runtime path. If no such path exists, add one narrowly scoped `.env` loading mechanism at the existing configuration boundary; do not silently fall back to missing credentials or duplicate parsing across modules.
|
||||
|
||||
### Assumptions
|
||||
|
||||
- `SUPER_ADMIN_OWNER` is a stable account identifier; renaming it or transferring super-admin authority is outside this change.
|
||||
- `.env` remains protected from source control and has restrictive filesystem permissions in deployments.
|
||||
- If the fallback secret is exposed, an operator must rotate `SUPER_ADMIN_PASSWORD` in `.env` and restart the service; the UI password change does not revoke this fallback.
|
||||
- Existing account password hashing, password policy, lockout, session revocation, and audit mechanisms remain the authoritative primitives.
|
||||
|
||||
## Implementation Units
|
||||
|
||||
### U1. Configure and bootstrap the single super administrator
|
||||
|
||||
- **Goal:** Load validated super-administrator settings and establish exactly one persistent super-administrator identity without silently taking over a conflicting account.
|
||||
- **Requirements:** R1, R2
|
||||
- **Files:** `modules/backend/cmd/agent-system/main.go`, `modules/backend/internal/app/`, `modules/backend/internal/store/account_model.go`, `modules/backend/internal/store/migrate.go`, `modules/backend/internal/server/server.go`, `scripts/svc.sh`
|
||||
- **Approach:** Trace and wire the protected `.env` startup path; pass credentials via a dedicated config boundary; add a schema migration and idempotent bootstrap operation; reject account-admin operations when authentication is disabled; keep secrets out of persistent storage, diagnostics, and JSON projections.
|
||||
- **Test Scenarios:** Both values absent, only one present, invalid password, first bootstrap, repeated bootstrap, conflicting existing owner, duplicate marker, and legacy databases with administrators but no super administrator.
|
||||
- **Verification:** Focused Backend config, store migration/bootstrap, and startup tests on SQLite and PostgreSQL.
|
||||
|
||||
### U2. Add fallback login and password-change behavior
|
||||
|
||||
- **Goal:** Let the configured super administrator authenticate with either the database password or the `.env` fallback, including after changing the database password in the UI.
|
||||
- **Requirements:** R6, R7
|
||||
- **Files:** `modules/backend/internal/server/accounts.go`, `modules/backend/internal/store/auth.go`, `modules/backend/internal/server/auth.go`, `modules/backend/internal/server/login_recovery_test.go`
|
||||
- **Approach:** Extend the login verifier at the authentication boundary; fallback comparison is limited to the configured super-admin owner; retain current rate limiting, verified-session version checks, and normal password-change behavior.
|
||||
- **Test Scenarios:** Initial environment password works; UI password change makes both new and fallback passwords valid; old database password stops working; fallback fails for every other owner; disabled/missing account and throttled attempts remain rejected.
|
||||
- **Verification:** Focused login/password tests covering password-change session handling and audit effects, plus existing account serialization tests where verifier changes affect session races.
|
||||
|
||||
### U3. Enforce super-admin-only appointment and target protection
|
||||
|
||||
- **Goal:** Restrict admin creation/promotion to the super administrator and make the super-administrator account untouchable by ordinary admin maintenance paths.
|
||||
- **Requirements:** R3, R4, R5
|
||||
- **Files:** `modules/backend/cmd/agent-system/main.go`, `modules/backend/internal/app/`, `modules/backend/internal/server/accounts.go`, `modules/backend/internal/server/roles.go`, `modules/backend/internal/store/account_model.go`, `modules/backend/internal/store/role_policy.go`, `modules/backend/internal/authz/`
|
||||
- **Approach:** Audit every account/admin elevation and target mutation route, including `user create --admin`, `user create --role admin`, and `user bootstrap-admin`; only configured startup bootstrap may establish the super administrator, and no CLI path may appoint another administrator. Enforce actor and target checks in the authorization/write boundary, including transactional rechecks for race safety. Preserve the ordinary-admin path for creating pending user accounts.
|
||||
- **Test Scenarios:** Super admin creates/promotes admin; ordinary admin creates user; ordinary admin cannot create/promote admin by request payload, role assignment, grants, or CLI commands; neither ordinary admin nor legacy admin can reset/recover/rename/delete/disable/demote the super admin; super admin can change their own password but cannot transfer or remove the unique super-admin identity; auth-disabled mode exposes no account-administration operations; unauthorized and concurrent changes are rejected without partial writes.
|
||||
- **Verification:** Focused account, role-policy, and recovery authorization tests on SQLite and PostgreSQL.
|
||||
|
||||
### U4. Surface identity and available account actions in the UI
|
||||
|
||||
- **Goal:** Make super-administrator status and allowed administrator-management actions clear in account-management screens.
|
||||
- **Requirements:** R3, R4, R8
|
||||
- **Files:** `modules/backend/internal/server/accounts.go`, `modules/frontend/src/components/AdminZone.tsx`, `modules/frontend/src/components/AccountUsersPanel.tsx`, `modules/frontend/src/components/adminSections.tsx`, `modules/frontend/e2e/admin-user-create.playwright.ts`, `modules/frontend/e2e/iam-role-authority.playwright.ts`
|
||||
- **Approach:** Add a non-secret `isSuperAdmin` identity projection and show admin-create/promotion actions only for that user. Keep ordinary account creation available to authorized admins and avoid exposing environment credentials or fallback status details.
|
||||
- **Test Scenarios:** In the primary `AccountUsersPanel`, super admin sees admin-promotion controls and can complete promotion; ordinary admin sees ordinary-account creation without elevation controls; direct API calls remain rejected when controls are hidden; layout remains usable at supported viewport sizes.
|
||||
- **Verification:** Focused Frontend typecheck and Playwright coverage for the account-management flow.
|
||||
|
||||
## Verification Contract
|
||||
|
||||
| Scope | Verification | Proves |
|
||||
|---|---|---|
|
||||
| Backend account/auth changes | Focused `go test` packages under `modules/backend/internal/server`, `internal/store`, `internal/app`, and `cmd/agent-system` | Bootstrap, dual-credential login, account elevation boundaries, and compatibility |
|
||||
| Database portability | Relevant PostgreSQL integration tests in the affected Backend packages | Migration/bootstrap and transactional authorization behavior on PostgreSQL |
|
||||
| UI behavior | Focused Frontend typecheck and admin-user Playwright tests | Correct controls and browser-visible account flow |
|
||||
| Final candidate | `make test` when required by the selected delivery tier and exact repository gate | Fixed Dev/component composition and repository-required checks |
|
||||
|
||||
No production deployment or live `.env` credential test is included in this plan. Runtime acceptance requires a separately authorized environment and must use test credentials without recording secret values.
|
||||
|
||||
## Definition of Done
|
||||
|
||||
- Exactly one environment-configured super administrator can be established, and startup rejects ambiguous or conflicting identity state.
|
||||
- The super administrator can appoint administrators; other administrators can create ordinary accounts but cannot grant administrative authority.
|
||||
- Ordinary administrators cannot mutate the super-administrator account through supported account-management or recovery paths.
|
||||
- The super administrator can change the database password in the UI and can continue to log in with the configured fallback.
|
||||
- Server tests, affected database coverage, focused browser verification, code review, and repository delivery gates pass for the exact candidate; secrets are absent from logs, responses, and committed files.
|
||||
- Abandoned implementation attempts are removed, and no production deployment, credential rotation, or history-changing action is performed without its required authorization.
|
||||
@@ -0,0 +1,75 @@
|
||||
# 快慢通道 O2:限路由等价终态 阶段 5 实施与测试计划
|
||||
|
||||
- 状态:**阶段 5 计划稿,待人审**(与[阶段 4 方案](../specs/2026-10-19-fast-slow-o2-route-contract-eof-design.md)同批评审)。人审通过前不派 worker、不改产品代码。
|
||||
- 日期:2026-10-19;作者:host;来源等级:SELF。
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md);worker 不提交、不推送、不开 PR;host 负责范围审阅、权威验证、PR/CI/合入。
|
||||
- 付费与真实模型:**本计划零付费部分不需要任何付费请求**;P1 付费验证另提资源方案并单独批准。
|
||||
|
||||
## 1. 交付切分与顺序
|
||||
|
||||
| 增量 | 仓 | 内容 | 依赖 | 合入方式 |
|
||||
|---|---|---|---|---|
|
||||
| I1 | Agent-Native | `runtime/argschema` 提炼 + 解析器延后判定 + `RouteContractEOF` 传输层判定 + 夹具 | 无 | 组件仓 PR,CI 通过后合入(组件仓无需 #518 窗口) |
|
||||
| I2 | Backend | 系统层设置键、`openLLMClient` 按身份挂合同、运行记录透传 `CompletionBasis` | I1 合入且 Backend `deps/agent-native` 改钉 | 组件仓 PR |
|
||||
| I3 | Dev | 改钉 Agent-Native 与 Backend,组合验证 `make test` | I1、I2 | #518 窗口合入 |
|
||||
| P1 | — | 1 次短工具探针 + 1 次 A01(付费) | I3 合入、资源方案获批、系统层配置写入 | 另行授权 |
|
||||
|
||||
各增量阶段 6 评审包写入 `docs/superpowers/specs/`;I1–I3 每个增量完成后先交用户阶段 6 再合入(与快慢通道既往 manual 口径一致)。
|
||||
|
||||
## 2. I1 Agent-Native(单元 `o2-i1-agent-native-route-contract`)
|
||||
|
||||
- **允许路径**:`runtime/llm/**`、`runtime/argschema/**`(新)、`runtime/tools/registry.go`、`runtime/tools/registry_test.go`。
|
||||
- **动作**:
|
||||
1. 新包 `runtime/argschema`:`Validate(schema, args json.RawMessage) error`,整体迁移现 `validateArgs` 与 `matchesType`,语义逐项相同;`registry.validateArgs` 改为委托,现有 registry 测试不改断言。
|
||||
2. 解析器:内部选项 `deferMissingDone`;新增计数 `finishChunks`、标志 `toolAfterFinish`。只有在“除缺 `[DONE]` 外全部现有检查通过”时才返回候选终态,否则行为同今。公开 `ParseSSE` 签名与零值行为不变。
|
||||
3. 传输层:`Client.RouteContract`;在 `bodyObserver` 快照后按方案 §4.2 的 C1–C9 判定;放行发 `message_end`(`CompletionBasis=route_contract_eof`,`StreamComplete=false`),拒绝发与今天相同文案的终态失败并附 `ContractCheck`。
|
||||
4. `Event`/`TerminalObservation` 新增 `CompletionBasis`、`ContractCheck`(JSON 字段名 `completionBasis`、`contractCheck`)。
|
||||
- **测试**(`httptest`;HTTP/2 用 `httptest.NewUnstartedServer` + `EnableHTTP2` + TLS):
|
||||
|
||||
| 用例 | 期望 |
|
||||
|---|---|
|
||||
| 有 `[DONE]`(合同开/关) | 放行,`CompletionBasis=done_marker`,与现状一致 |
|
||||
| 无 `[DONE]`、合同关 | 拒绝,文案不变 |
|
||||
| 无 `[DONE]`、合同开、HTTP/2 正常结束、全部条件成立 | **放行**,`route_contract_eof`,工具调用逐字节等于输入 |
|
||||
| 同上但 `known_length`+`match` / `mismatch` | 依人审 §6.1 结论放行 / 拒绝(C2) |
|
||||
| `close_delimited`、`chunked`、`unknown` | 拒绝(C2) |
|
||||
| 缺 Usage | 拒绝(C5) |
|
||||
| Usage 在 `finish_reason` 块之前 / 之后 | 均放行(顺序不作要求,评估稿 §3) |
|
||||
| 两个非空 `finish_reason` 块;`finish_reason=stop` 或 `length` 却有工具;一块含多个 choice | 拒绝(C4) |
|
||||
| 在帧边界截断、无 `finish_reason`,但 HTTP/2 正常结束 | 拒绝(C4) |
|
||||
| HTTP/2 `RST_STREAM` 或连接中途断开导致读错 | 拒绝(C3) |
|
||||
| 与 `finish_reason` 同一块内的工具片段 / 后续块再出现工具片段 | 放行 / 拒绝(C6) |
|
||||
| 合同开但任一条件不满足 vs 合同关 | 两个终态事件除 `contractCheck` 外 deep-equal |
|
||||
| 哨兵扫描 | `contractCheck`、`completionBasis` 不含正文、工具名、参数或错误原文 |
|
||||
| 半帧 / 无效帧 / 供应商错误帧 | 拒绝(C3/C9) |
|
||||
| ID 或名称缺失、参数非 JSON 对象 | 拒绝(C7) |
|
||||
| 工具名不在请求 `tools`;缺 required;属性类型不符 | 拒绝(C8) |
|
||||
| 模型名不符、基址不符(含 http、userinfo、query)、摘要不符、`APIBase` 覆盖到他址、重定向(他主机、同主机改路径、降级) | 拒绝(C1) |
|
||||
| 读取中取消 | 中止事件,无放行 |
|
||||
|
||||
每个用例同时断言 Usage 保留与“放行次数/工具调用数”。
|
||||
- **验证**:`gofmt -l runtime`;`go vet ./runtime/...`;`go test ./runtime/llm/... ./runtime/argschema/... ./runtime/tools/... -count=1`;`git diff --check`。
|
||||
- **停止条件**:若延后判定需要改变公开 `ParseSSE` 的零值行为或既有测试断言,停止并回到方案评审。
|
||||
|
||||
## 3. I2 Backend(单元 `o2-i2-backend-route-contract-config`)
|
||||
|
||||
- **允许路径**:`internal/runtime/**`、`internal/settings/**`、`internal/runmgr/**`(仅透传字段)、Backend `deps/agent-native` gitlink(host 改钉,不由 worker 改)。
|
||||
- **动作**:`settings.Schema()` 以 `SettingScopeSystem` 声明三个扁平键 `models.routeContractEOF.model/.baseUrl/.identitySha256`(任一为空即关闭;用户/项目层由 `ManagedPaths` 剥除);`openLLMClient` 增参 `ResolvedModel` 与配置,三元组与摘要全部精确一致才挂合同(按三元组、不看 `Kind`),5 个调用点 `llm.go`、`sub_loop.go`、`squad_runner.go`、`verify.go`、`workflow_compiled.go` 全部覆盖;轻量档、视觉改模、子代理独立判断;运行记录与快慢通道收据透传 `completionBasis`。
|
||||
- **测试**:缺省关闭;用户层写入被忽略;模型/基址/摘要任一不符不挂合同;视觉改模后不继承;挂合同后假流放行一次工具并记录 `route_contract_eof`;删除配置后恢复拒绝。
|
||||
- **验证**:`gofmt`;`go vet ./internal/runtime ./internal/settings ./internal/runmgr`;`go test ./internal/runtime ./internal/settings ./internal/runmgr -count=1`。
|
||||
|
||||
## 4. I3 Dev 组合
|
||||
|
||||
- host 改钉 `deps/agent-native`(I1 合入 SHA)与 `modules/backend`(I2 合入 SHA);`make test` + `make build` 由 PR CI(GATE)确认;无产品代码改动。
|
||||
- 注意与同期 IAM 链路 initiative(Dev #628)对 Backend gitlink 的合入顺序:以合入时最新 main 为准重新组合验证,冲突由 host 选择包含双方的 Backend SHA,不回退对方提交。
|
||||
|
||||
## 5. P1 付费验证(不在本计划授权内)
|
||||
|
||||
- 前提:I3 合入;系统层配置写入目标路由三元组;核对 r0.6 证据身份(受保护路由文件 SHA-256 `2a92569d…`)与生产三元组指向同一模型/基址。
|
||||
- 内容:1 次短工具探针(预期约 500 tokens,参考 r0.5/r0.6),期望 `route_contract_eof` 放行且工具执行恰好一次;通过后 1 次 A01,规模参考 r0.4。
|
||||
- 另提资源方案(预算上限、停止条件、收据路径),用户批准后执行;失败即停、不补跑。
|
||||
|
||||
## 6. 完成与停止
|
||||
|
||||
- 零付费完成:I1–I3 合入,夹具全绿,配置缺省关闭时线上行为不变(以既有 `[DONE]` 与拒绝用例为回归证据)。
|
||||
- 停止并回到方案评审:需要改变 `StreamComplete` 语义、泛化到其他路由、或任何条件无法在本地确定性观察。
|
||||
@@ -0,0 +1,70 @@
|
||||
# 快慢通道:MiniMax 工具流完成信号口径评估
|
||||
|
||||
- 状态:**评估稿,待用户口径决策。** 本文不授权产品代码改动、付费请求、A01 复验、合入产品变更或部署;用户选定方向后,按 policy/delivery.md 另立方案/计划评审。
|
||||
- 日期:2026-10-19;执行者:host(只读调查与文档撰写);来源等级:SELF(本地收据与当日抓取的公开文档,可按“复核方法”重放)。
|
||||
- 上下文:[r0.6 传输完整性设计](../../../modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r06-transport-completeness-design.md)(已获阶段 4 批准)、[U2/U3 核验报告](../../../modules/documents/docs/reports/2026-10-13-fast-slow-u2-u3-validation.md)、归档任务卡 [feature-fast-slow-u2-u3-plan](../../../.task/archive/feature-fast-slow-u2-u3-plan.md)(部分收口:零付费机制已合入,真实模型质量未解决)。
|
||||
|
||||
## 1. 问题
|
||||
|
||||
现行门禁:工具流缺少 SSE 字面 `[DONE]` 时,工具一律不放行、不执行。当前 MiniMax-M3 路由在三次独立观察中都以“`finishReason=tool_calls` + Usage + 干净 EOF、无 `[DONE]`”结束,因此真实 A01 在该路由上无法跑通。需要决定:是否为该路由定义一个**限路由的等价完成信号**,还是保持拒绝或更换路由。
|
||||
|
||||
## 2. 已有证据
|
||||
|
||||
| 观察 | 对象 | 结果 |
|
||||
|---|---|---|
|
||||
| r0.4 A01 | 两次付费 run、三次调用 | 返回 `tool_calls` 与 Usage,客户端未见 `[DONE]`;工具安全拒绝 |
|
||||
| r0.5 短探针 | Dev `0959e1c`,513 tokens | HTTP 200、`finishReason=tool_calls`、`clean_eof`、最后一帧 JSON 完整、Usage 存在、`StreamComplete=false`;放行/执行 0/0 |
|
||||
| r0.6 短探针 | 收据 `fast-slow-u3-r06-20261019/private-probe/run-001/terminal-receipt.json`,472 tokens | HTTP/2、`framingClass=http2_stream`、`eofSeen=true`、`lengthRelation=unknown`、`finishReason=tool_calls`、Usage 存在、`toolFragments=1`、参数 28 字节且为 JSON 对象、`tailEventKind=json_frame`;`diagnosis=eof_unproven`,放行/执行 0/0 |
|
||||
|
||||
三次观察一致:**缺 `[DONE]` 是该路由的稳定行为**,不是长任务或偶发中断特有的现象。r0.6 的分层观察进一步表明响应体以 HTTP/2 流正常结束,而非连接异常关闭。
|
||||
|
||||
## 3. 供应商文档核对(2026-10-19)
|
||||
|
||||
- MiniMax 对话补全 OpenAPI 规范 `https://platform.minimaxi.com/docs/api-reference/text/api/openapi-chat-openai.json`(当日 WebFetch 文本 SHA-256 `d73496802f4af2b38d0a1d56afdf6ed35e4cc3a7aac44e597b355c6f8dcfe9af`):
|
||||
- 流式响应声明为 `text/event-stream`,元素模式为 `ChatCompletionChunk`。
|
||||
- 流式块的 `finish_reason` 说明为“生成停止的原因,**未结束时为 null**”。
|
||||
- `stream_options.include_usage` 控制是否在流中返回用量。
|
||||
- 全文**没有出现 `[DONE]`**;流式示例以一个带 `finish_reason` 的块结束。
|
||||
- [OpenAI SDK 接入页](https://platform.minimaxi.com/docs/api-reference/text-openai-api)只给出用 SDK 迭代流的示例,未说明结束哨兵。官方 SDK 在流正常结束时停止迭代、不要求 `[DONE]`——这是对 SDK 行为的推断,**不能视为供应商对完成语义的承诺**([未经证实])。
|
||||
|
||||
结论:供应商以“`finish_reason` 非空”表示生成结束,有可核验的文档依据;但文档**未写明**是否发送 `[DONE]`、Usage 块相对 `finish_reason` 块的顺序,也没有版本化契约。
|
||||
|
||||
## 4. 对照 r0.6 已批准设计的四个前提
|
||||
|
||||
r0.6 设计规定,提出等价终态规则至少要同时满足以下四项,且满足后也只进入下一轮方案评审:
|
||||
|
||||
| 前提 | 现状评估 |
|
||||
|---|---|
|
||||
| ① 可复核的供应商契约,说明无 `[DONE]` 时如何表示业务完成 | **部分满足**:OpenAPI 规范写明 `finish_reason` 非空即结束、全文无 `[DONE]`;缺 Usage 顺序与版本承诺 |
|
||||
| ② 本地解析器能识别约定的终止形式,并有正常/截断/半帧/缺 Usage/重定向/取消的正反例 | **可零付费实现**:Agent-Native `ParseSSE` 已有 `finishReason`、Usage、帧完整性与工具片段观察,补夹具即可 |
|
||||
| ③ 客户端可区分“按协议结束”与“未知关闭”,工具身份与参数完整性可验证,预算/停止门禁成立 | **基本具备**:r0.6 已能区分 `http2_stream`/`known_length`/`close_delimited`/`unknown`;工具 ID/名称/JSON 对象可校验;**尚无参数 schema 校验** |
|
||||
| ④ 规则只绑定经核验的路由身份 | **可实现**:按模型名 + 主机 + 受保护路由文件哈希绑定,不泛化到其他 OpenAI 兼容服务 |
|
||||
|
||||
## 5. 风险分析
|
||||
|
||||
- **截断被误判为完成**:若上游在 `finish_reason` 块之前截断,就不会出现非空 `finish_reason`,规则自然拒绝。残余风险在于供应商先发 `finish_reason`、后补参数片段——文档与三次观察都没有显示这种顺序,但也无法证伪,可通过“`finish_reason` 之后不得再有工具片段”的约束拒绝。
|
||||
- **未知关闭**:`close_delimited`、`unknown` 或读取错误无法区分正常结束与中断,必须继续拒绝。r0.6 探针属于 `http2_stream` 正常结束,不在此列。
|
||||
- **参数语义**:JSON 对象可解析不等于参数符合工具 schema。放宽终态后,参数错误会直接进入工具执行,建议同轮引入 schema 校验。
|
||||
- **供应商行为漂移**:文档无版本承诺,路由身份变化(模型、主机、路由文件哈希)必须使规则失效并回到拒绝。
|
||||
|
||||
## 6. 可选方案
|
||||
|
||||
| 方案 | 内容 | 代价 | 评估 |
|
||||
|---|---|---|---|
|
||||
| O1 保持拒绝 | 维持现行门禁;该路由不可用于工具流 | 零 | 最安全;真实 A01 在该路由上继续无法跑通 |
|
||||
| O2 限路由等价终态 | 仅对核验过的 MiniMax 路由,在下述全部条件成立时视为完成:HTTP/2 流正常结束或已知长度且字节相符;恰好一个非空 `finish_reason=tool_calls` 块;请求开启 `include_usage` 且收到 Usage;`finish_reason` 之后无工具片段;全部工具调用 ID/名称齐全、参数为 JSON 对象并通过 schema 校验;最后一帧完整、无取消/读错。默认关闭的配置开关;终态记录单独标为 `route_contract_eof`,不与 `[DONE]` 混同 | 零付费:解析器夹具与 schema 校验;付费:1 次短工具探针 + 1 次 A01,需单独资源提案与路由文件 | **推荐进入下一轮方案评审**:前提 ①–④ 大体具备,风险可由条件组合限定 |
|
||||
| O3 更换路由 | 改用已验证会发送 `[DONE]` 的模型路由 | 新模型质量基线、路由配置与资源评审 | O2 被否或供应商行为不稳定时的后备 |
|
||||
|
||||
## 7. O2 的验证设想(供下一轮计划细化)
|
||||
|
||||
1. 零付费:`httptest`/TLS HTTP/2 假流覆盖——有 `[DONE]`;无 `[DONE]` 但满足全部条件(放行);缺 Usage;Usage 在 `finish_reason` 之前或之后;`finish_reason` 后追加工具片段;半帧;参数非 JSON 或不符 schema;`close_delimited`/`unknown`;取消;路由身份不符(以上除第二项外均拒绝),并核对放行/执行次数与后继请求数。
|
||||
2. 付费(需另行批准):固定新候选后 1 次短工具探针,确认 `route_contract_eof` 放行且工具执行一次;再 1 次 A01 验证真实质量。预算按 r0.5/r0.6 探针(约 500 tokens)与 r0.4 A01 规模另行提案。
|
||||
|
||||
## 8. 需要用户决定
|
||||
|
||||
- 选 O1、O2 或 O3。选 O2 时,下一步是编写方案/计划(阶段 4/5 人工评审),而非直接改代码。
|
||||
|
||||
## 复核方法
|
||||
|
||||
- 探针收据:读取 `~/.local/share/agent-system-evidence/fast-slow-u3-r06-20261019/private-probe/run-001/terminal-receipt.json` 的字段(不含正文)。
|
||||
- 供应商文档:重新抓取上述 OpenAPI 规范,检索 `[DONE]`、`finish_reason`、`include_usage`;内容变化时以新抓取为准并更新本节。
|
||||
@@ -0,0 +1,123 @@
|
||||
# 快慢通道 O2:限路由等价终态(`route_contract_eof`)方案
|
||||
|
||||
- 状态:**阶段 4 方案稿,待人审。** 本文不授权产品代码改动、付费请求、A01 复验或部署;阶段 4/5 人审通过后才按配套计划派 worker 实施零付费部分,付费探针另行提资源方案。
|
||||
- 日期:2026-10-19;作者:host(只读调查与文档撰写);来源等级:SELF。
|
||||
- 决策来源:用户 2026-10-19 在[完成信号口径评估](2026-10-19-fast-slow-completion-signal-evaluation.md)中选定 **O2**(另起任务)。
|
||||
- 配套计划:[阶段 5 实施与测试计划](../plans/2026-10-19-fast-slow-o2-route-contract-eof-plan.md)。
|
||||
- 上游约束:[r0.6 传输完整性设计](../../../modules/documents/docs/proposals/2026-10-14-fast-slow-u3-r06-transport-completeness-design.md)的四个前提(评估稿第 4 节逐项对照);本方案是该设计要求的“另一轮方案评审”,不改变 r0.6 已批准的观察字段。
|
||||
|
||||
## 1. 目标与非目标
|
||||
|
||||
**目标**:对**一条经核验的 MiniMax 路由**,在流缺少字面 `[DONE]`、但能证明“按协议结束且工具调用完整”时,放行该轮工具调用;其余一切情形保持现行拒绝。
|
||||
|
||||
**非目标**:
|
||||
|
||||
- 不改变有 `[DONE]` 的现有放行路径与 `StreamComplete` 语义。
|
||||
- 不对其他 OpenAI 兼容服务、其他 MiniMax 模型或其他主机泛化;不提供“全局放宽”开关。
|
||||
- 不在本轮跑真实 A01 或任何付费请求;不改 Anthropic 协议路径。
|
||||
- 不引入完整 JSON Schema 引擎(见 §4.3 的子集约定)。
|
||||
|
||||
## 2. 现状(代码定位,Agent-Native `origin/main` 9c24e22 / Dev 钉 28f3ea7 同文件)
|
||||
|
||||
| 位置 | 现行行为 |
|
||||
|---|---|
|
||||
| `runtime/llm/sse.go` `emitParsed` 第 260 行起 | 有工具调用且 `!sawDone` → `sendTerminalFailure("tool call stream ended before [DONE]")`,工具全部丢弃,Usage 保留 |
|
||||
| `runtime/llm/sse.go` 第 300 行 | 正常结束发 `message_end`,`StreamComplete = sawDone` |
|
||||
| `runtime/llm/client.go` `run` 第 129–139 行 | 用 `bodyObserver` 包住响应体;`ParseSSE` 的终态事件发出后才补 `TerminalObservation.BodyBoundary` |
|
||||
| `runtime/llm/body_observation.go` | 只按 `net/http` 可见信息分类:`http2_stream` / `known_length` / `chunked` / `close_delimited` / `unknown`;`LengthRelation` 仅在已知长度、未解压、未饱和且见 EOF 时为 `match`/`mismatch` |
|
||||
| `runtime/tools/registry.go` `validateArgs` | 工具**执行前**按 schema 子集(`type`、`required`、属性类型)校验参数;失败返回错误结果、不执行 |
|
||||
| Backend `internal/runtime/model.go` `ResolvedModel` | 路由身份 = `Kind` + `Model` + `Base`(设置层 → 画像覆盖);生产无独立“路由文件” |
|
||||
| Backend `internal/runtime/llm.go` `openLLMClient` | 构造 `agentllm.Client`;`MiniMax-M*` 置 `ReasoningSplit` |
|
||||
|
||||
关键约束:**判定所需的传输边界只在 `client.go` 可见**,`ParseSSE` 看不到;因此终态判定不能只放在解析器里。
|
||||
|
||||
## 3. 方案总览
|
||||
|
||||
```
|
||||
ParseSSE(解析器) Client.run(传输层)
|
||||
────────────────── ────────────────────
|
||||
既有检查全部照旧 bodyObserver 快照
|
||||
仅当“唯一缺陷 = 缺 [DONE]”且 ↓
|
||||
调用方声明了路由合同时 → RouteContractEOF.Evaluate(candidate, boundary, tools)
|
||||
返回 候选终态(不外发) ────────────▶ 全部条件成立 → message_end(CompletionBasis=route_contract_eof)
|
||||
任一不成立 → 与今天相同的终态失败(Usage 保留)
|
||||
```
|
||||
|
||||
- 合同未配置(零值)时,解析器与客户端的行为**逐字节等同现状**。
|
||||
- 解析器只做“延后判定”,不做放行;放行只在传输层、且只对绑定身份。
|
||||
|
||||
## 4. 设计细节
|
||||
|
||||
### 4.1 路由合同与身份绑定(Agent-Native `runtime/llm`)
|
||||
|
||||
新增导出类型(命名可在计划阶段微调,语义固定):
|
||||
|
||||
```go
|
||||
// RouteContractEOF 只对一条经核验路由生效;零值/nil 表示关闭。
|
||||
type RouteContractEOF struct {
|
||||
Model string // 精确模型名,例如 MiniMax-M3
|
||||
BaseURL string // 规范化后的精确基址,例如 https://api.minimaxi.com/v1
|
||||
IdentitySHA256 string // sha256("openai-chat\n" + Model + "\n" + BaseURL)
|
||||
}
|
||||
```
|
||||
|
||||
`Client` 增加可选字段 `RouteContract *RouteContractEOF`。生效前提(任一不满足即视为关闭,回到现行拒绝):
|
||||
|
||||
1. `Protocol` 为 openai-chat;
|
||||
2. 本次请求实际使用的 `model` 与 `Model` 精确相等;
|
||||
3. 本次请求实际使用的基址(含 `StreamOptions.APIBase` 覆盖)规范化后与 `BaseURL` 精确相等。规范化规则:只允许 `https`;scheme 与 host 转小写;去掉末尾 `/`;含 userinfo、query 或 fragment 一律视为不匹配(规则只会失败关闭,不放宽);
|
||||
4. 由 1–3 重算的摘要等于 `IdentitySHA256`(防止宿主误配一半字段);
|
||||
5. 请求没有被重定向:`resp.Request.URL`(net/http 的最终请求)的 scheme、host、port、path 与原始请求逐项相等;同主机改路径或 https 降级都视为不匹配。
|
||||
|
||||
r0.6 探针所记的受保护路由文件 SHA-256(`2a92569d…`)是**证据身份**,用于核对“被观察的就是这条路由”;生产绑定用上面的三元组摘要,二者在计划的付费探针前做一次映射核对。
|
||||
|
||||
### 4.2 放行条件(全部成立才放行)
|
||||
|
||||
| # | 条件 | 数据来源 |
|
||||
|---|---|---|
|
||||
| C1 | 路由合同生效(§4.1 的 1–5) | `Client` + 请求 + 响应 |
|
||||
| C2 | 传输按协议结束:`FramingClass=http2_stream` 且 `EOFSeen`,或 `known_length` 且 `LengthRelation=match` | `BodyBoundaryObservation` |
|
||||
| C3 | `ReadOutcome=clean_eof`;无取消、读错、无效帧、供应商错误 | `TerminalObservation` |
|
||||
| C4 | 恰好一个带非空 `finish_reason` 的块,且其值为 `tool_calls`;合同生效时每块 `len(choices) <= 1`(解析器只读 `choices[0]`,多 choice 不得被静默丢弃) | 解析器新增计数 |
|
||||
| C5 | 请求开启 `include_usage`(客户端恒开)且收到 Usage | `UsagePresent` |
|
||||
| C6 | `finish_reason` 块之后的**后续块**中没有任何工具片段(与 `finish_reason` 同一块内的片段允许) | 解析器新增标志 |
|
||||
| C7 | 每个工具调用 ID、名称齐全,参数为 JSON 对象 | 现有检查 |
|
||||
| C8 | 每个调用的名称在本次请求声明的 `tools` 中,参数通过该工具 schema 子集校验(§4.3) | 请求 `tools` |
|
||||
| C9 | 最后一帧 JSON 完整,`TailEventKind=json_frame` | `TerminalObservation` |
|
||||
|
||||
`chunked`、`close_delimited`、`unknown`、`known_length` 但 `mismatch`/`unknown` 一律不满足 C2。
|
||||
|
||||
### 4.3 参数 schema 子集
|
||||
|
||||
C8 采用与 `tools.registry.validateArgs` **相同**的语义:整体迁移 `validateArgs` 与 `matchesType`,语义不变——顶层 `type: object`、`required` 必填项(空白字符串视为缺失)、已声明属性的基本类型、声明了 `properties` 时拒绝未知参数。实现上把该校验提炼到新的无依赖小包 `runtime/argschema` 中的单一函数,`runtime/llm` 与 `runtime/tools` 都调用它(两包当前互不导入,放进任一方都会引入新的包依赖方向),避免两套语义漂移。超出子集的约束(枚举、格式、嵌套)不在本轮,registry 执行前校验仍保留作为第二道门。
|
||||
|
||||
### 4.4 输出与可观测性
|
||||
|
||||
- 放行时:`message_end` 正常携带工具调用;`StreamComplete` **保持 false**(字面含义仍是“未见 `[DONE]`”);新增 `Event.CompletionBasis`:`done_marker`(现有路径)或 `route_contract_eof`。
|
||||
- `TerminalObservation` 新增 `CompletionBasis` 与 `ContractCheck`(失败时记录第一个不满足的条件编号,例如 `C2`),不保存正文、参数或密钥。
|
||||
- 拒绝时:除 `TerminalObservation.ContractCheck` 外,终态事件与“合同关闭”时**逐字段一致**(Content、Thinking、`StopError`、Usage、FinishReason、错误文案 `tool call stream ended before [DONE]`)。实现上解析器的候选终态同时携带预先构造的失败事件,`Client.run` 判定失败即原样发出。
|
||||
- `CompletionBasis`、`ContractCheck` 只取枚举值,不含正文、工具名、参数或供应商错误原文。
|
||||
- 下游(Backend 运行记录、快慢通道收据)只把 `CompletionBasis` 作为新增字段透传,不把 `route_contract_eof` 计作 `StreamComplete=true`。
|
||||
|
||||
### 4.5 宿主配置(Backend)
|
||||
|
||||
- 三个扁平设置键 `models.routeContractEOF.model`、`.baseUrl`、`.identitySha256`,在 `settings.Schema()` 中以 `Scope: SettingScopeSystem` 声明(`ManagedPaths` 会剥除并拒绝用户/项目层写入),画像覆盖不参与;任一为空 = 关闭(默认)。
|
||||
- `openLLMClient` 在实际解析出的 `(model, base)` 与配置三元组全部精确一致时才挂合同,按三元组判定、不看 `Kind`;轻量档、视觉改模、子代理按各自解析结果独立判断,不继承。全部调用点(`llm.go`、`sub_loop.go`、`squad_runner.go`、`verify.go`、`workflow_compiled.go`)统一经过同一判定。
|
||||
- 回滚:删除该设置键即恢复现行拒绝,无需发版;身份漂移(换模型、换基址)自动失效。
|
||||
|
||||
## 5. 风险与取舍
|
||||
|
||||
| 风险 | 处置 |
|
||||
|---|---|
|
||||
| 截断被误判为完成 | C4 要求 `finish_reason` 已到达;C2 要求传输按协议结束;C6 拒绝 `finish_reason` 之后再出现片段 |
|
||||
| 前提 ① 只部分满足(文档写明 `finish_reason` 非空即结束,但无 Usage 顺序与版本承诺) | 以精确身份绑定、默认关闭和 P1 付费探针兜底;P1 不通过即保持关闭 |
|
||||
| 供应商行为漂移、无版本承诺 | 合同只绑定精确身份;默认关闭;`ContractCheck` 使漂移在收据中可见;必要时直接删配置回滚 |
|
||||
| 参数语义错误进入执行 | C8 在放行前校验;registry 执行前再校验一次 |
|
||||
| `known_length` 是否纳入 | 方案纳入(仅 `match`);r0.6 观察到的是 `http2_stream`。**请人审确认**是否只保留 `http2_stream` |
|
||||
| 两套 schema 校验漂移 | §4.3 提炼为单一函数 |
|
||||
|
||||
## 6. 需人审确认的取舍
|
||||
|
||||
1. C2 是否同时接受 `known_length`+`match`(建议接受),还是只接受 `http2_stream`。
|
||||
2. 宿主配置键仅系统层可写、默认关闭(建议如此)。
|
||||
3. 付费验证(1 次短工具探针 + 1 次 A01)在零付费部分合入后另提资源方案,不随本方案授权。
|
||||
+1
-1
Submodule modules/core updated: 1a5ef6b75c...0cf03446c4
+1
-1
Submodule modules/documents updated: 1e036e981e...82b4619574
+1
-1
Submodule modules/frontend updated: 46a63f0221...259021d530
+1
-1
Submodule modules/ui updated: 5c2b1036dd...fadabceade
@@ -1534,6 +1534,12 @@ svc_launch_serve() {
|
||||
if [ -n "${RDM_DISABLE_EXEC_TOOLS:-}" ]; then
|
||||
args+=("RDM_DISABLE_EXEC_TOOLS=$RDM_DISABLE_EXEC_TOOLS")
|
||||
fi
|
||||
# 超级管理员凭据只从本次环境转发,不写入 serve.env;缺失时由 serve 自行 fail closed。
|
||||
for k in SUPER_ADMIN_OWNER SUPER_ADMIN_PASSWORD AGENT_SYSTEM_ENV_FILE; do
|
||||
if [ -n "${!k+x}" ]; then
|
||||
args+=("$k=${!k}")
|
||||
fi
|
||||
done
|
||||
# shellcheck disable=SC2086
|
||||
nohup "${args[@]}" "$ENV_BIN" serve $exec_args >> "$ENV_DIR/svc.log" 2>&1 9>&- &
|
||||
}
|
||||
|
||||
@@ -86,6 +86,8 @@ class LifecycleRealTests(tsr.SvcAutoRecoverTests):
|
||||
def initialize_store(self, data, env=None):
|
||||
init_env = dict(self.env if env is None else env)
|
||||
init_env["RDM_DISABLE_EXEC_TOOLS"] = "1"
|
||||
init_env.setdefault("SUPER_ADMIN_OWNER", "superadmin")
|
||||
init_env.setdefault("SUPER_ADMIN_PASSWORD", "realcombo-super-admin-password")
|
||||
if env is None:
|
||||
init_env.pop("AGENT_SYSTEM_DSN", None)
|
||||
with socket.socket() as sock:
|
||||
@@ -95,7 +97,7 @@ class LifecycleRealTests(tsr.SvcAutoRecoverTests):
|
||||
with log_path.open("wb") as log:
|
||||
proc = subprocess.Popen(
|
||||
[str(self.real_bin), "serve", "--addr", "127.0.0.1:%d" % port,
|
||||
"--data", str(data), "--auth", "on"],
|
||||
"--data", str(data), "--auth", "auto"],
|
||||
cwd=self.root, env=init_env, stdout=log, stderr=log)
|
||||
try:
|
||||
for _ in range(200):
|
||||
|
||||
@@ -345,7 +345,10 @@ func (e *env) startInstance(t *testing.T, name, addr string) *instance {
|
||||
cmd.Stdout, cmd.Stderr = log, log
|
||||
// 演练环境可能带有空的对象存储变量。子进程必须按「未配置」启动,
|
||||
// 否则测不到带类型空 *S3 回落本地目录的路径。
|
||||
cmd.Env = withoutBlobstoreS3(os.Environ())
|
||||
cmd.Env = append(withoutBlobstoreS3(os.Environ()),
|
||||
"SUPER_ADMIN_OWNER=mi-root",
|
||||
"SUPER_ADMIN_PASSWORD=MiRootPass12345!",
|
||||
)
|
||||
// 独立 cwd:serve 会向 ./data 写 skills/SQLite 等,不能落在测试目录。
|
||||
dataDir := t.TempDir()
|
||||
cmd.Dir = dataDir
|
||||
@@ -455,10 +458,8 @@ func (e *env) killNine(t *testing.T, inst *instance) {
|
||||
// 独占落 JSON),redeem 会话进入 grant-setup 改密设 alicePass,完成后再发 Key。
|
||||
func (e *env) loginAlice(t *testing.T) *userClient {
|
||||
t.Helper()
|
||||
// 空库先引导首个管理员(本地 pending 创建要求库内已有用户),再建 alice。
|
||||
// 两步都签发一次性凭据,独占落临时 JSON;mi-root 的凭据随后用于初始化其账号。
|
||||
rootCred := filepath.Join(t.TempDir(), "root-cred.json")
|
||||
e.cliIn(t, e.a.dataDir, "user", "bootstrap-admin", "--dsn", e.dbDSN, "--owner", "mi-root", "--out-file", rootCred)
|
||||
// 超级管理员 mi-root 已由 serve 启动时的 SUPER_ADMIN_* 建立;这里只建 alice,
|
||||
// 一次性激活凭据独占落临时 JSON。
|
||||
activation := filepath.Join(t.TempDir(), "activation.json")
|
||||
e.cliIn(t, e.a.dataDir, "user", "create", "--dsn", e.dbDSN, "--owner", aliceOwner, "--name", "Alice", "--out", activation)
|
||||
activateKey := activationSecret(t, activation)
|
||||
@@ -477,7 +478,7 @@ func (e *env) loginAlice(t *testing.T) *userClient {
|
||||
|
||||
apiKey := e.cliOut(t, "apikey", "create", "--dsn", e.dbDSN, "--owner", aliceOwner, "--name", "mi-acceptance")
|
||||
// IAM U4 把建项目改为系统动作 project.create:由引导管理员经真实 API 授予 alice。
|
||||
e.grantAliceProjectCreate(t, rootCred)
|
||||
e.grantAliceProjectCreate(t)
|
||||
uc := &userClient{
|
||||
api: &http.Client{Timeout: httpWait, Transport: bearerRT{key: apiKey}},
|
||||
apiB: &http.Client{Timeout: httpWait, Transport: bearerRT{key: apiKey}},
|
||||
@@ -491,30 +492,9 @@ func (e *env) loginAlice(t *testing.T) *userClient {
|
||||
|
||||
// grantAliceProjectCreate 以 mi-root 身份经 admin API 为 alice 追加系统授权
|
||||
// project.create(保留其已有授权;PUT 为整体替换,按 authorityEpoch 乐观并发)。
|
||||
// bootstrap-admin 只签发一次性凭据,mi-root 未初始化前不能发 API key,故先照
|
||||
// alice 的方式 redeem 并设 rootPass。
|
||||
func (e *env) grantAliceProjectCreate(t *testing.T, rootCred string) {
|
||||
// mi-root 由 serve 启动时的 SUPER_ADMIN_* 建立,可直接为其发 API key。
|
||||
func (e *env) grantAliceProjectCreate(t *testing.T) {
|
||||
t.Helper()
|
||||
raw, err := os.ReadFile(rootCred)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
rootSecret := strings.TrimSpace(string(raw))
|
||||
if rootSecret == "" {
|
||||
t.Fatal("bootstrap-admin credential file is empty")
|
||||
}
|
||||
jar, err := cookiejar.New(nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
sess := &http.Client{Timeout: httpWait, Jar: jar}
|
||||
e.do(t, sess, "POST", "/api/auth/login-key/redeem", map[string]any{
|
||||
"key": rootSecret,
|
||||
}, nil)
|
||||
e.do(t, sess, "POST", "/api/auth/password", map[string]any{
|
||||
"next": rootPass,
|
||||
}, nil)
|
||||
|
||||
rootKey := e.cliOut(t, "apikey", "create", "--dsn", e.dbDSN, "--owner", "mi-root", "--name", "mi-acceptance-root")
|
||||
root := &http.Client{Timeout: httpWait, Transport: bearerRT{key: rootKey}}
|
||||
var users []struct {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
`components.pin` 只有两个键,均为 40 位 hex,`run.sh` 逐行解析、从不执行:
|
||||
|
||||
- `rdm_sha`:Agent-System-RDM main(PR #442 合入,`pins/agent-system-kb-regulations` 指向 `kb_sha`)。
|
||||
- `kb_sha`:Agent-System-KB-Regulations main(含 zhipu-mcp 搜索 provider、语料批量导入/抓取/审批工具与 HTTP 嵌入维度修复)。
|
||||
- `rdm_sha`:Agent-System-RDM main(PR #446 合入,经 backend pin 内置 `regulations_search`/`regulation_evidence` 对话工具;`pins/agent-system-kb-regulations` 为 `b481173`,包含于 `kb_sha`)。
|
||||
- `kb_sha`:Agent-System-KB-Regulations main(PR #10 合入,在既有 zhipu-mcp 搜索 provider、语料批量导入工具与 HTTP 嵌入维度修复之上新增标准号检索文本)。
|
||||
|
||||
`run.sh` 先核对两个检出的 HEAD 等于 pin,再核对 RDM 检出中
|
||||
`pins/agent-system-kb-regulations` gitlink 是 KB 检出里 `kb_sha` 的祖先(RDM 编译所用 KB 代码包含在被测修订中)。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 法规知识库组合门禁的固定组件(U8)。只接受 rdm_sha、kb_sha 两个键,值为 40 位 hex。
|
||||
# run.sh 逐行解析本文件,不执行、不 source。升级走 PR。
|
||||
# rdm_sha:RDM main,PR #442 合入,pins/agent-system-kb-regulations 指向 kb_sha。
|
||||
# kb_sha:KB-Regulations main,含 zhipu-mcp 搜索 provider、语料批量导入/抓取/审批工具与 HTTP 嵌入维度修复;须包含 RDM pins/agent-system-kb-regulations。
|
||||
rdm_sha=377d42767f64aab494a51ebb915a738fe4ede095
|
||||
kb_sha=393555bec8d964f294f932616aa69ab833a06de1
|
||||
# rdm_sha:RDM main,PR #446 合入,经 backend pin 内置 regulations_search/regulation_evidence 对话工具;pins/agent-system-kb-regulations 为 b481173,包含于 kb_sha。
|
||||
# kb_sha:KB-Regulations main,PR #10 合入,在既有 zhipu-mcp 搜索 provider、语料批量导入工具与 HTTP 嵌入维度修复之上新增标准号检索文本;须包含 RDM pins/agent-system-kb-regulations。
|
||||
rdm_sha=8a396cf693b5daf32cf93cbdb10e28baf753573d
|
||||
kb_sha=a8dc714dcb0fdf88364c9581661f1589e0a3caad
|
||||
|
||||
@@ -117,7 +117,9 @@ u = urlsplit(sys.argv[1])
|
||||
print(urlunsplit((u.scheme, u.netloc, "/u7load_app", u.query, "")))
|
||||
PY
|
||||
)"
|
||||
"$BIN" user create --dsn "$APP_DSN" --admin --owner load_admin --password load-admin-pass-Aa1 >/dev/null
|
||||
# load_admin 由 serve 启动时按 SUPER_ADMIN_* 建立为超级管理员。
|
||||
export SUPER_ADMIN_OWNER=load_admin
|
||||
export SUPER_ADMIN_PASSWORD=load-admin-pass-Aa1
|
||||
"$BIN" user create --dsn "$APP_DSN" --owner probe_user --password probe-user-pass-Aa9 >/dev/null
|
||||
|
||||
# ---- 3b) B5 seed(可选):先建 seed_u* 再 COPY 灌量 ----
|
||||
|
||||
+8
-4
@@ -9,6 +9,7 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import socket
|
||||
import tempfile
|
||||
import unittest
|
||||
import urllib.error
|
||||
@@ -362,9 +363,12 @@ class SvcDbRecoveryTests(unittest.TestCase):
|
||||
|
||||
def test_external_dsn_and_conffile_recover_on_bare_start(self):
|
||||
d = self.runtime("dev")
|
||||
self.seed_agent("dev", 18795,
|
||||
"--addr 127.0.0.1:18795 --data %s --plugins %s --auth auto"
|
||||
% (d / "data", d / "plugins"))
|
||||
with socket.socket() as reservation:
|
||||
reservation.bind(("127.0.0.1", 0))
|
||||
port = reservation.getsockname()[1]
|
||||
self.seed_agent("dev", port,
|
||||
"--addr 127.0.0.1:%d --data %s --plugins %s --auth auto"
|
||||
% (port, d / "data", d / "plugins"))
|
||||
external = "postgresql://extu:ext-pw-4@10.9.8.7:5432/extdb"
|
||||
self.clear_serve_record()
|
||||
self.svc("dev", "deploy", "--from", "local", "--dsn", external)
|
||||
@@ -893,7 +897,7 @@ class SvcDbRecoveryTests(unittest.TestCase):
|
||||
def test_rdm_source_deploy_end_to_end(self):
|
||||
remote, work = self.make_rdm_repo()
|
||||
env = self.rdm_env(remote)
|
||||
result = self.svc("rdm1", "deploy", "--from", "rdm", "--port", "18841", env=env)
|
||||
result = self.svc("rdm1", "deploy", "--from", "rdm", "--port", "18843", env=env)
|
||||
d = self.runtime("rdm1")
|
||||
# U2:组合产物入不可变 release,经 current 指针解析;插件空集、工作台随 release。
|
||||
active = d / "current"
|
||||
|
||||
@@ -121,6 +121,8 @@ class RealComboTests(tsr.SvcAutoRecoverTests):
|
||||
"""
|
||||
init_env = dict(self.env if env is None else env)
|
||||
init_env["RDM_DISABLE_EXEC_TOOLS"] = "1"
|
||||
init_env.setdefault("SUPER_ADMIN_OWNER", "superadmin")
|
||||
init_env.setdefault("SUPER_ADMIN_PASSWORD", "realcombo-super-admin-password")
|
||||
if env is None:
|
||||
init_env.pop("AGENT_SYSTEM_DSN", None)
|
||||
with socket.socket() as sock:
|
||||
@@ -130,7 +132,7 @@ class RealComboTests(tsr.SvcAutoRecoverTests):
|
||||
with log_path.open("wb") as log:
|
||||
proc = subprocess.Popen(
|
||||
[str(binary), "serve", "--addr", "127.0.0.1:%d" % port,
|
||||
"--data", str(data), "--auth", "on"],
|
||||
"--data", str(data), "--auth", "auto"],
|
||||
cwd=self.root, env=init_env, stdout=log, stderr=log)
|
||||
try:
|
||||
for _ in range(200):
|
||||
|
||||
+22
-14
@@ -184,6 +184,12 @@ esac
|
||||
"""
|
||||
|
||||
|
||||
def free_fixture_port():
|
||||
with socket.socket() as reservation:
|
||||
reservation.bind(("127.0.0.1", 0))
|
||||
return reservation.getsockname()[1]
|
||||
|
||||
|
||||
class SvcAutoRecoverTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
tmp = tempfile.mkdtemp(prefix="svc-autorecover-")
|
||||
@@ -330,14 +336,14 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
# ---- 1. 期望态:start 成功置位 / 显式 stop 清除(含进程已死的 stop)----
|
||||
|
||||
def test_start_records_autostart_and_stop_clears(self):
|
||||
self.seed_agent("dev", 18801)
|
||||
self.seed_agent("dev", free_fixture_port())
|
||||
self.start_ok("dev")
|
||||
self.assertEqual(self.kv("dev", "autostart"), "1")
|
||||
self.svc("dev", "stop")
|
||||
self.assertIsNone(self.kv("dev", "autostart"))
|
||||
|
||||
def test_stop_on_dead_process_clears_autostart(self):
|
||||
self.seed_agent("dev", 18802)
|
||||
self.seed_agent("dev", free_fixture_port())
|
||||
self.start_ok("dev")
|
||||
self.kill9("dev")
|
||||
# 进程已死但 autostart 保留(等待 recover);显式 stop 表示"保持停止"。
|
||||
@@ -348,7 +354,8 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
# ---- 2. recover:崩溃拉回 / 运行中不动 / 显式停止不复活 / 未启动不碰 ----
|
||||
|
||||
def test_recover_restarts_sigkilled_service(self):
|
||||
self.seed_agent("dev", 18803)
|
||||
port = free_fixture_port()
|
||||
self.seed_agent("dev", port)
|
||||
self.start_ok("dev")
|
||||
old_pid = self.kill9("dev")
|
||||
result = self.svc("recover", "--quiet")
|
||||
@@ -361,10 +368,10 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
ok_events = self.history_events("dev", "recover")
|
||||
self.assertTrue(any('"result":"ok"' in l for l in ok_events), ok_events)
|
||||
# 恢复用的仍是持久化 exec=(svc.env 登记未漂移)。
|
||||
self.assertIn("--addr 127.0.0.1:18803", self.kv("dev", "exec"))
|
||||
self.assertIn("--addr 127.0.0.1:%d" % port, self.kv("dev", "exec"))
|
||||
|
||||
def test_recover_noop_while_running(self):
|
||||
self.seed_agent("dev", 18804)
|
||||
self.seed_agent("dev", free_fixture_port())
|
||||
self.start_ok("dev")
|
||||
pid = self.pid_of("dev")
|
||||
result = self.svc("recover")
|
||||
@@ -373,7 +380,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
self.assertEqual(self.history_events("dev", "recover"), [])
|
||||
|
||||
def test_recover_respects_explicit_stop(self):
|
||||
self.seed_agent("dev", 18805)
|
||||
self.seed_agent("dev", free_fixture_port())
|
||||
self.start_ok("dev")
|
||||
self.svc("dev", "stop")
|
||||
result = self.svc("recover")
|
||||
@@ -382,7 +389,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
self.assertEqual(self.history_events("dev", "recover"), [])
|
||||
|
||||
def test_recover_ignores_never_started_service(self):
|
||||
self.seed_agent("dev", 18806) # 从未 start:无 autostart 键
|
||||
self.seed_agent("dev", free_fixture_port()) # 从未 start:无 autostart 键
|
||||
result = self.svc("recover")
|
||||
self.assertEqual(result.returncode, 0, result.stdout)
|
||||
self.assertFalse(self.pid_alive(self.pid_of("dev")))
|
||||
@@ -391,7 +398,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
# ---- 3. 并发防护:生命周期锁被持有时 recover 跳过 ----
|
||||
|
||||
def test_recover_skips_when_lock_held(self):
|
||||
self.seed_agent("dev", 18807)
|
||||
self.seed_agent("dev", free_fixture_port())
|
||||
self.start_ok("dev")
|
||||
self.kill9("dev")
|
||||
lock = self.runtime("dev") / ".start.lock"
|
||||
@@ -411,11 +418,12 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
# ---- 4. 恢复失败路径:端口被外部进程占用 → fail 事件 + 非零退出 ----
|
||||
|
||||
def test_recover_fails_when_port_stolen(self):
|
||||
self.seed_agent("dev", 18808)
|
||||
port = free_fixture_port()
|
||||
self.seed_agent("dev", port)
|
||||
self.start_ok("dev")
|
||||
self.kill9("dev")
|
||||
thief = subprocess.Popen(
|
||||
["python3", "-m", "http.server", "18808", "--bind", "127.0.0.1"],
|
||||
["python3", "-m", "http.server", str(port), "--bind", "127.0.0.1"],
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
self.addCleanup(thief.terminate)
|
||||
# 等 thief 真正完成 bind 再 recover——慢环境里 Popen 返回时端口尚未监听,
|
||||
@@ -426,7 +434,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
s = socket.socket()
|
||||
s.settimeout(0.2)
|
||||
try:
|
||||
s.connect(("127.0.0.1", 18808))
|
||||
s.connect(("127.0.0.1", port))
|
||||
bound = True
|
||||
except OSError:
|
||||
pass
|
||||
@@ -479,7 +487,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
"""模拟 update 误清 pidfile 后本 bin 仍占口:裸 start 应回收并拉起新进程。"""
|
||||
if not self._ss_can_attribute_pid():
|
||||
self.skipTest("ss -ltnp 无法归因 PID(reclaim_own_port 需此能力)")
|
||||
port = 18812
|
||||
port = free_fixture_port()
|
||||
self.seed_agent("dev", port)
|
||||
self.start_ok("dev")
|
||||
old = self.pid_of("dev")
|
||||
@@ -500,7 +508,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
|
||||
def test_start_rejects_foreign_port_occupant(self):
|
||||
"""外部 python http.server 占口:start 必须失败并提示非本服务。"""
|
||||
port = 18813
|
||||
port = free_fixture_port()
|
||||
self.seed_agent("dev", port)
|
||||
thief = subprocess.Popen(
|
||||
["python3", "-m", "http.server", str(port), "--bind", "127.0.0.1"],
|
||||
@@ -537,7 +545,7 @@ class SvcAutoRecoverTests(unittest.TestCase):
|
||||
self.assertFalse((unit_dir / "agent-system-svc-recover.service").exists())
|
||||
|
||||
def test_recover_reserved_name_rejected(self):
|
||||
self.seed_agent("recover", 18809) # 保留字不可作服务名
|
||||
self.seed_agent("recover", free_fixture_port()) # 保留字不可作服务名
|
||||
result = self.svc("recover", "recover", check=False)
|
||||
self.assertEqual(result.returncode, 2, result.stdout)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user