wangjia
59ce391ecc
feat(models+gate): 模型按项目可配置(默认 opus-4.8) + diff 声明外文件硬闸
...
① 模型可配置(项目维度,默认 opus-4.8)
- 新增 projects.models(JSON,按角色 executor/planner/reviewer/conflict
覆盖,值可为字符串=全复杂度统一 或 {easy,medium,hard} 分档)
- models.ts 重构 resolveModel:优先级 项目级 models > 旧 project.model
(仅 executor/planner) > env > 默认 DEFAULT_MODEL(opus-4.8)
- 取消内置 fable/sonnet 分档默认:所有角色默认 opus-4.8(彻底回避 fable-5
不可用问题,需要时项目级显式配置即可);回退链改 opus→sonnet→fable
- API PATCH /projects 透传 models;sanitizeModels 落库校验
② diff 声明外文件闸(task.scopeFiles)
- 新增 tasks.scope_files(JSON glob/路径数组)
- checks.ts: globToRegExp/matchesAnyGlob + scopeFileGate(改动文件越界=硬闸,
空声明跳过,git 出错不拦截);pipeline runApproveGates 接入
- planner 拆解新增每子任务 files 字段:prompt 要求 + parseDecompose 解析 +
ingest 落 scopeFiles,自动填充声明范围
- executor prompt 注入「声明文件范围约束」,让 agent 知边界(gate 才公平)
迁移:projects.models / tasks.scope_files 走 ensureColumn 幂等迁移(旧库补列)
测试:models 默认/配置/优先级、scope glob/gate、planner files 解析、
store 持久化往返、迁移补列 —— 237 通过
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-25 07:06:32 +08:00
wangjia
a9c51021aa
fix(models): isModelError 识别「issue with the selected model」→ 触发回退链
...
线上实测:reviewer 用 fable-5 报「There's an issue with the selected model
(claude-fable-5)」(该档未对当前账号开通),但 isModelError 未命中此措辞 → 不回退 →
复审失败(verdict=null)。补正则后 fable-5 不可用会自动回退 opus 重试,复审正常。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-24 23:44:48 +08:00
wangjia
ff2d7c22e7
feat(agent): 模型档位升 fable-5(复审/hard拆解/解冲突)+ 回退链 fable 置首
...
按 plan ①②③④ 定稿(用户确认):
- reviewer 三档统一 fable-5(不被 project.model 降档,保复审严格度)
- planner hard 拆解 opus→fable-5(最烧脑用最强档);medium=opus/easy=sonnet 不变
- conflict 固定 fable-5(解冲突恒用最强档)
- MODEL_FALLBACK_CHAIN: [fable-5, opus-4-8, sonnet-4-6](fable 置链首)
- executor 档不变(per plan ②);CLAUDE.md 档位表同步更正
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-24 22:24:30 +08:00
wangjia
a5a3c967ce
fix: 全量替换 claude-fable-5 → claude-opus-4-8(模型不可用)
...
- models.ts: 所有档位默认值、回退链、conflict 固定值全部换为 opus-4-8
- 回退链从三项缩为两项 [opus-4-8, sonnet-4-6](删除重复项)
- metrics.ts: 额度权重 opus-4-8 升为 1.0(现为最高档)
- 测试同步更新
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-14 15:14:09 +08:00
wangjia
027a9cb2d6
fix(tests): 修复三类优化实现后的测试适配
...
- pipeline.test.ts:PipelineDeps 增加 syncMain 可注入接口(默认用真 git),
测试 mockDeps 加 syncMain=no-op + runConflict,消除 fake-worktree 上真 git 调用失败
- models.test.ts:reviewer 三档默认 fable-5、project.model 不覆盖复审/conflict、
MODEL_FALLBACK_CHAIN 三项链;pickFallbackModel 改为取链上下一档(循环)而非首个不等项
- ingest.test.ts:verdict=reject 硬闸测试改为断言未进 exec_review
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-14 14:05:22 +08:00
wangjia
f18db021c3
feat: Phase2 完整管线——score 调度 + 自动复审 + 模型分级 + 归档与详情
...
调度:
- model/scoring.ts: score = 自身分(P0=3/P1=2/P2=1) + 已完成依赖分(链条惯性)
+ 等待解锁的 blocked 任务分(解锁加权),编排器与 nextExecutable 同一打分
- createTask 校验 deps 存在且同项目(依赖图天然无环)
- daemon 重启中断自愈: executing 任务标 failed run 后重新入队(reconcileInterrupted)
执行管线:
- executor/cc.ts: 公共 headless CC 执行器(转录/超时/模型回退重试)
- executor/reviewer.ts: 执行后自动复审(只读 CC 审 diff),固定模板 summary
(做了什么/怎么做/测试/CodeReview/安全Review/结论) + VERDICT 解析
- executor/models.ts: 按复杂度选模型(easy→sonnet/medium→opus/hard→fable5),
env 可覆盖、project.model 最优先、不可用自动回退链
- runner: 测试/构建命令白名单(npm/go/shellcheck/make/pytest),prompt 要求实跑测试
- TaskResult 加 summary/verdict; RunKind 加 reviewer
- 容器收口: 已拆解 Hard 子任务全 done → 容器自动 done(afterDone 逐级向上)
看板:
- 五徽章组(待审批/待执行/执行中/被阻塞/总量,hover 展开,均不含已完成)
- 归档区: 深度1整树完成沉底,时间倒序分页(10/20/50/100 chip 选择)
- 归档详情对话框: 全属性/执行历史与时长/审批记录/状态流转时间线(含相关人或事)
- Agent 面板显示调度模式 + 各复杂度实际模型
- 结果闸展示复审 summary + 建议通过/拒绝徽章
- 筛选修复(组选与单选分离、已拆解移出进行中)、同步按钮收进配置面板、
保存配置自动收起、预览全宽、被依赖阻塞→被阻塞
- API: GET /api/tasks/:id/events(任务级事件时间线)、/api/agents 带 scheduling/models
测试: 49/49(新增 scoring/复审/模型/容器收口/deps 校验/中断恢复)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-13 02:46:37 +08:00