wangjia
|
fa4ba3db28
|
feat(rule13): 执行前分歧重评估闸——main 撞声明范围→needs_attention 重评估
通用规则13的(B)半边:sync main 之前先跑 reevalScopeGate,
以 git diff HEAD...origin/main 取 main 自分支点以来改动的文件,
与任务 scopeFiles 求交集;非空即 emit needs-reeval →
daemon markReeval 直接转 needs_attention(不重试/不计失败/run收尾cancelled)。
- checks.ts: + reevalScopeGate / ReevalGateFn / ReevalGateResult
- pipeline.ts: createWorktree 后、syncMain 前插入重评估闸 + reevalGate 依赖注入
- protocol.ts: + needs-reeval OutboxRecord/Payload 事件
- ingest.ts: + case 'needs-reeval' → store.markReeval
- store.ts: + markReeval(executing→needs_attention,不进重试链)
- status.ts: executing 合法转移 + needs_attention
- 测试 +5:reevalScopeGate(命中/未命中/空/无前移/git错) · pipeline(命中emit/未命中续跑) · store.markReeval;全套 242 绿
- docs: optimization-plan.html 规则13 标 ✅ 已实现
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-25 20:15:02 +08:00 |
|
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
|
2d127698d1
|
feat(agent): ② approve 前硬闸——分项检查(lint/typecheck/build) + diff 体量闸
- checks.ts:runChecks 按 lint→typecheck→build 逐项跑(worktree 内,各 10min,
任一非0=硬失败报哪项挂);parseChecks 解析 project.checks JSON
- diffSizeGate:git diff --numstat 统计文件数+增删行数,超阈值=硬失败(提示拆解);
阈值 env 可配 MAESTRO_DIFF_MAX_FILES/LINES(默认 60/3000,0=不限);git 出错不拦截
- pipeline:verify 后插 checks+diff 闸,任一失败 emit failed 不进复审;
conflict 管线只跑 checks(diff 含整条原分支,体量闸会误伤)
- 注:diff「声明外文件」闸未做——task 无声明文件范围字段
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-24 22:53:56 +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
|
8392944877
|
feat(planner): 编排器把 analyzing/speccing 也当可执行——派 planner run 自动拆解/写方案
修复"hard/medium 任务建后永远停在 analyzing/speccing"的缺口:编排器现在对 analyzing(hard)
派 planner-decompose、对 speccing(medium) 派 planner-spec(auto-approved 下;auto-easy 仍只执行 easy),
planner 只读跑 CC(无 worktree/无写)产出 → daemon 落库 + 自动提交到 plan_review/spec_review 闸(仍人审)。
- protocol: JobSpec.runKind + spec-result/decompose-result 两型 outbox + DecomposeResult
- runner: runPlanner(只读 Read/Glob/Grep 跑在 repo,opus 档)+ buildPlannerPrompt
- pipeline: runKind 分支 + parseDecompose(取末尾 fenced JSON,非法→failed)
- orchestrator: claimable 纳入 analyzing/speccing + 排除在途;并发/in-flight 从 countExecuting 泛化为
inflightTaskIds(有 started run 的任务,executor+planner 通用);claimOne 按状态分 executor/planner
(planner 不转状态);reap 泛化(死 planner→failPlanAttempt)
- ingest: ingestAll 覆盖所有 started run;spec-result→setSpec+spec_review;decompose-result→setPlan+建子任务+plan_review;
failed 按 kind 分流(planner→failPlanAttempt 退避留态、超限→needs_attention)
- store: inflightTaskIds / liveRunsWithTask / failPlanAttempt;reconcile 泛化到所有 started run
- status: analyzing/speccing 加 →needs_attention(planner 失败超限升级)
- models: planner 角色(opus);status: RunKind 已含 planner
- 测试 +12(pipeline 5 / ingest 3 / orchestrator 4),194 全绿
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-13 16:59:30 +08:00 |
|
wangjia
|
d8f8b5da1e
|
phase3(worker): pipeline.ts 纯执行管线 + worker.ts 进程入口(不碰 DB,经 outbox 文件汇报)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-13 12:56:50 +08:00 |
|