Commit Graph

39 Commits

Author SHA1 Message Date
dafang 6e6a4ca8d3 feat(cs): 路由后同轮直转并补齐 1.0.2 升级 2026-07-10 15:13:07 +08:00
dafang ab39a4be56 refactor(cs-skill): 对齐 feat/epic Spec 与 runtime 2026-07-10 11:15:28 +08:00
dafang a28d31d473 chore(cs-skill): 插件版本 1.0.1 → 1.0.2 + 补老项目无版本→需同步的测试锁
- 版本源 4 处统一升 1.0.2:repo 根 VERSION、.claude-plugin/plugin.json、
  .codex-plugin/plugin.json、dogfood .codestable/runtime-manifest.json
- 新增 test_runtime_manifest_without_version_is_treated_as_needing_sync:
  manifest 缺 plugin_version(version 探测引入前的老 runtime)→ installed=None,
  runtime_health 判 version-mismatch → 提示同步。锁定"老的无版本项目默认需
  重新同步/onboard"这一既有行为(None != expected_version)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 00:03:28 +08:00
dafang e46fea7e95 feat(cs-skill): 方案深度 pre-pass 防降本偏置 + 独立 reviewer 启动 mode 收敛(provider-aware)
两组治理加固,均单一权威 + 执行点触达,不逐文件抄逻辑:

A. 方案深度 pre-pass(防 AI「降本默认偏置」:不论证就默认最小闭环 / fake / mock / 正则 / 占位)
- 新增权威源 solution-depth-conventions.md(触发器 + 场景锚点 + 硬约束:降级须显式论证候选/理由/转正条件)
- shared-conventions 第 7 节加交叉引用(结构膨胀 ↔ 实现降级互补)
- 触达 6 处选型点:cs-feat design、cs-epic planning、cs-goal 迭代 + 快速路径 cs-feat/cs-refactor fastforward、cs-issue fix

B. 独立 reviewer 启动 mode(消除 agent 瞎选 mode / 同一 reviewer 重复创建)
- agent-conventions 加「启动 mode」:只读隔离 Task agent 用 provider 的 plan / read-only 等价 mode,
  按 capability 发现 modeId、不硬编码(Claude 有 plan、codex 只有 auto/full-access),无等价时降级只读 prompt 兜底;Goal driver 例外
- 触达 6 处派发点:design-review / epic review / independent-review + QA runner / acceptance auditor / goal 功能验收

经 codex/gpt-5.5 独立 review(changes-requested)后落地全部 4 important + 1 nit:
provider-aware 修正、B 组补 QA/acceptance/功能验收触达、A 组补快速路径触达、测试锁副本逐字一致 + 新触达点。

测试:新增 3 个 test(方案深度可达性、reviewer mode provider-aware、模板↔项目副本一致);193 passed。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 23:55:18 +08:00
dafang ce1e56c3f1 refactor(cs-issue,cs-refactor,cs-goal): 推广伪代码四模式,owner-stop 口径收敛到 CheckpointReason 枚举
- cs-issue / cs-refactor:套用 workflow pipeline、stageProtocol 映射、onCheckpoint、
  needsHuman / mayExit 四模式;cs-issue 补齐 AmbiguousIssueTarget,区分路由层与
  stage 内 checkpoint 的触发权威;cs-refactor 按 mode 拆 modeProtocol / stageSupport
- cs-goal:「严格 Owner Stop」bullet 清单删除,触发条件以 Spec 的 CheckpointReason
  枚举为唯一权威(280 -> 272 行)
- goal-conventions(cs-onboard 模板 + 项目副本):owner-stop 清单对齐枚举口径——补
  AcceptanceAgentUnavailable 条目、修 AcceptanceConflict / RiskAcceptanceNeeded 措辞漂移

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 21:56:41 +08:00
dafang 25a99ead4e refactor(cs-feat,cs-epic): Workflow/Reference/checkpoint/退出条件伪代码化,checkpoint 触发口径收敛到 Spec
- Workflow 编号散文改为 workflow pipeline(preflight >=> ... >=> exitRecoverable)逐步注释
- Reference 加载改为 stageProtocol 映射,gate 纪律(独立 Task agent reviewer)抽为独立段落
- 人工 checkpoint 改为 onCheckpoint,触发时机以 Spec 的 restore 函数为唯一权威,消除双重定义;
  补齐 AmbiguousFeatureTarget / AmbiguousEpicTarget
- Failure Behavior / 退出条件改为 needsHuman / mayExit 谓词
- cs-epic batch loop 纪律唯一权威收敛到 SKILL.md「Child design batch loop」,测试断言同步

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 21:56:29 +08:00
dafang a7b4228972 fix(cs-epic): review 修复 — goalPackage 状态细化、minimal_loop 口径对齐、batch loop 纪律去重
- SKILL.md 状态机 hasGoalPackage 拆为 Missing|ReadyToDispatch|Dispatched|Complete,
  新增 ReportDriver / Completed 分支,与 workflow-next report_driver/complete 对齐
- planning 退出条件补 minimal_loop 字段,与 review 启动检查和 reference 模板一致
- batch loop 推进纪律以 SKILL.md「Child design batch loop」为唯一权威,
  Workflow 第 5 步与 goal/protocol.md 改为引用不复述

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 16:29:53 +08:00
dafang 96ca9fdf41 fix(cs-skill): 启动上下文幂等减负,消除项目事实重复读取 (issue #39)
问题:多个 cs skill 启动时把 CONTEXT/adrs/compound/attention 等项目事实的读取写成
无条件指令(必读/总是先搜/共同必读/先跑 preflight),同会话延续与 epic 批量下重复
读取、浪费 token。根因是缺"上下文感知/幂等"守卫(progressive reference loading 只
管 skill 自己的 reference,不管项目事实文件)。

- build-cs-skill: 立 Idempotent Context Loading Gate(session 粒度,与 progressive
  reference loading 互补)+ anti-pattern + authoring 指针
- shared-conventions §5 与 design/planning/req/brainstorm: 无条件读取改"首次读、已载复用"软守卫
- epic 批量: overload epic_child_batch 承载"全局输入已加载",子 feature design 复用不重扫
- preflight: execution-conventions 加上下文幂等前置,同会话复用 attention/onboard/runtime 结论
- cs-feat / cs-req: 加 grep contract 防回退
- 同步 .codestable/reference 运行时副本

measured fixture 本轮不做:routing scorer 单轮无工具、facts 预注入,"读取幂等"不可
评分(已在 gate 文档化为 future work)。回归:pytest 190 passed、runtime health ok、
路由/状态机/checkpoint 逻辑零触碰。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 07:03:01 +08:00
dafang 9daea46116 fix(cs-feat,cs-epic): design-review gate must use independent Task agent on EVERY round
Production feedback (paseo agent c67d935f): on review round 2 the agent
self-reviewed locally and marked design-review passed. Triage: the protocol
already had a strict independent-reviewer gate, but (a) the main SKILL.md
routing line carried no P1 constraint (progressive loading means round 2
may not reload the protocol), and (b) no rule named repeat rounds. Fix:
P1 hard constraint at the routing line in both skills + "every round"
clause in both protocols + contract anchor. Codified as rt-f09 with a
frozen pre-fix variant: reason-level analysis shows independent-reviewer
mention 1/9 before → 9/9 after across 3 models.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 13:37:16 +08:00
dafang 61a413eaa9 chore: release CodeStable 1.0.1 2026-07-08 11:02:37 +08:00
dafang 6db10400cd refactor(cs-goal): complete lifecycle in selectNextAttempt; measured 0.877→0.951
Structural round (owner-authorized) after two wording rounds plateaued:
- selectNextAttempt now covers the full lifecycle: grill entry guard for
  new goals (info gaps go to phase-1 grill, never a checkpoint), rebuild/
  degrade dual branch for missing start reports, dead tail branch removed
- eager 8-item startup list replaced by ## Operation (6-step runtime path,
  need-based reference loading, absorbs the state-model section)
- duplicate routing truths in phase sections removed (Measured Rule 1)

Key datapoint written back as quality-gates Measured Rule 6: rt-g02 stayed
0.33 through two wording rounds, jumped to 0.89 after one added entry
guard — wording-resistant failures signal structural gaps. Routing eval:
baseline 0.765(original)→0.951, sonnet/gpt-5.5 at 1.000.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 21:45:00 +08:00
dafang 0460baa2f6 refactor(skills): prompt-as-code rewrite of 11 cs skills, measured no-regression
Spec (restoreXStage / pipeline contract) becomes the single routing truth:
prose state-machine tables deleted (issue/epic/docs), guards absorb
table-only nuances; Workflow sections for stage routers; narrowed
descriptions with adjacent-skill exclusions; Failure Behavior everywhere.
Contracts keep only behavioral invariants (restoreXStage + artifact/
checkpoint/forbidden-action anchors); bare type-name anchors removed.
cs-goal: in-iteration review must go through a visible Task agent
(same pattern as cs-feat/cs-epic goal driver), + AcceptanceAgentUnavailable
checkpoint + "not before grill" enum qualifier.
New tests/test_skill_contracts.py enforces frontmatter contracts against
SKILL.md body (frontmatter-stripped) for all declaring skills.

Measured (routing_ok, 3 models, k=3, calibrated oracle):
original mean 0.807 -> rewritten 0.965 across 7 skills; parallel
"table+Spec" hardened variant proved harmful on cs-epic (0.833 < 0.867).
Evidence: experiments/cs-issue-routing-001/results.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 20:54:30 +08:00
dafang d8ca4fac60 fix(cs-skill-lab): measure primary path with onboard context; revert cs-code-review fast-path
A controlled experiment showed the earlier "haiku robustness gap" was an eval
validity artifact: cs skills are designed for an onboarded .codestable/ repo,
but the eval fed bare diffs with no context, so haiku correctly refused on
missing preconditions. With onboard context injected, haiku recovers on the
original skill (0.31 -> 0.92, near sonnet); the real cross-model review gap is
small (~0.08).

- add config.inject_context + a buildprompt onboard-context block; set true on
  the committed eval suite so it measures the primary (onboarded) path, not a
  bare-input artifact
- revert the ad-hoc/bare-input fast path previously landed into cs-code-review
  (it treated a symptom and risked weakening a deliberate gate)
- rewrite experiments/cs-code-review-robustness-001 evidence to the corrected
  finding; document inject_context (and the validity lesson) in the eval protocol

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 09:01:55 +08:00
dafang bf79cb4d8d feat(cs-skill-lab): add skill engineering eval/autoresearch loop
Add cs-skill-lab, a project-local maintainer skill (.claude/skills/, NOT
shipped in the codestable plugin) for engineering cs skills end to end:
author -> eval -> optimize -> release, across models/harnesses, reusing the
BAIME discipline (dual value function, pre-registration, [measured] honesty).

- runner + harness adapter registry (mock/mock-weak offline; claude-headless,
  codex-cli, paseo, api real) + scorers (planted_defect, dod_gate, llm_judge)
  + metrics tagged [measured]/[soft]/[underpowered]; cost dry-run + budget cap
- optimize.py OCA loop (V_instance/V_meta, convergence), regression battery,
  bump_version, adapt_extracted_skill, enqueue (cron autonomy), calibrate_judge
- 8 eval experiments (code-review/issue-fix/audit/refactor/feat/epic/docs +
  cs-skill-lab self-reference); cs-feedback -> regression fixture bridge
- 5 pytest suites; ADR-003; generated eval outputs gitignored

Land a [measured] cross-model fix into cs-code-review: an ad-hoc/bare-input
fast path so weaker models review a bare diff instead of refusing on missing
CodeStable context (claude-haiku-4-5 recall 0.31 -> 1.00, sonnet unchanged;
evidence in experiments/cs-code-review-robustness-001).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 08:31:08 +08:00
dafang b8babf9eb1 refactor(codestable): decouple tool runtime and worktree policy 2026-07-06 21:11:54 +08:00
dafang d7305ac6b5 fix(codestable): hide stale dod runner json output 2026-07-06 14:42:25 +08:00
dafang d969ac4f8f refactor(codestable): remove default worktree workflow 2026-07-05 20:15:04 +08:00
dafang 75646fb978 feat(codestable): move worktree decision to first persistent change
解决 issue #38:worktree 原在 impl/fix/apply 阶段才建,规划产物先落主检出,
合并回来时 .codestable/{unit}/{slug}/ 反复冲突。

改为在「第一次产生持久改动前」探测+用户选择,不自动建;一经决定该 unit
全生命周期产物落单一分支,消除跨分支冲突。工具零代码改动。

- worktree-conventions.md 新增「改动前 worktree 探测与选择」「收尾 checkpoint」
  「epic 特例」;改写检出模式叙事为探测+选择
- 各流程锚点引用统一约定:feat design / issue report / refactor scan /
  epic planning 起手;后置 gate 改「复用或补探测」
- 模块C:cs-feat design review gate 新增 spec 覆盖率/占位符扫描/术语·类型一致
- 模块D:agent-conventions 新增进度 ledger/审查结论双维度/模型分级/file handoff

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 18:38:13 +08:00
dafang 9bf6211ae0 docs(codestable): slim preflight conventions 2026-07-05 11:10:58 +08:00
dafang 64487b94f2 docs(codestable): centralize runtime capability preflight 2026-07-05 00:01:39 +08:00
dafang bf84f19dc3 feat(codestable): add runtime manifest sync 2026-07-04 13:44:33 +08:00
dafang 07f2a7e894 feat(codestable): add runtime capability preflight 2026-07-03 23:23:12 +08:00
dafang 758a66f4e2 docs(codestable): support explicit runtime refresh 2026-07-03 22:51:27 +08:00
dafang ef72cd76d0 feat(codestable): add workflow next hook 2026-07-03 21:13:35 +08:00
dafang 0b8fde6236 fix(codestable): continue epic child design loop 2026-07-03 20:50:28 +08:00
dafang 1611c80fbc docs(codestable): mark compatibility skills deprecated 2026-07-03 17:23:46 +08:00
dafang 28f5ba0758 fix(codestable): close completed task agents 2026-07-03 14:37:06 +08:00
dafang 03ad942110 fix(codestable): harden feedback privacy flow 2026-07-03 14:17:38 +08:00
dafang c8950e06ef fix(codestable): require tdd in feature implementation 2026-07-03 12:53:13 +08:00
dafang 0e8e9c8da8 feat(codestable): add feedback collection skill 2026-07-03 12:10:58 +08:00
dafang 7ec239d19a fix(codestable): enforce goal driver flow 2026-07-03 11:17:57 +08:00
dafang 5f0a806d54 chore(codestable): release 1.0.0 2026-07-03 09:29:30 +08:00
dafang 0af202c5c1 docs(codestable): tighten goal driver reentry semantics 2026-07-02 21:32:24 +08:00
dafang 8b973a9912 docs(codestable): align goal mode handoff semantics 2026-07-02 21:32:24 +08:00
dafang 4e75ab1370 docs(codestable): add visible goal driver dispatch 2026-07-02 21:32:24 +08:00
dafang 27fdf995a2 docs(codestable): document no-argument skill defaults 2026-07-02 21:32:23 +08:00
dafang 3890ee657c docs(codestable): flag main entry arguments 2026-07-02 21:32:23 +08:00
dafang 6df69ddf75 refactor(codestable): simplify skill entrypoints 2026-07-02 21:32:23 +08:00
Wyatt Fang cd7e1d33f0 refactor: package CodeStable plugin distribution (#34)
* refactor: package codestable plugin distribution

* docs: restore README workflow details

* refactor: remove browser bridge from distribution

---------

Co-authored-by: QA Bot <qa@example.invalid>
2026-07-02 09:56:21 +08:00