Skip to content

Distillation P0: candidate contract + verify/accept ledger (okc distill) - #49

Merged
Niraya666 merged 2 commits into
mainfrom
codex/distill-p0
Jul 16, 2026
Merged

Niraya666 merged 2 commits into
mainfrom
codex/distill-p0

Conversation

@Niraya666

Copy link
Copy Markdown
Owner

落地 docs/trajectory-distillation.md §9 的 P0——契约与手动通路。candidate 此阶段由人手写,先把生命周期和校验跑通;LLM distiller 是 P1。零 API、全确定性。

做了什么

  • 契约:candidate 住 .agent-harness/eval_candidates/<id>/(task.json + fixture/ + provenance.json);EvalTaskSpec 增加可选 source_sessions lineage 字段(手写任务为空 → 永不被 lineage 排除),held-out 卫生从此能在 promote 后存活(§3,PR docs: trajectory-distillation design (weakness → executable held-out tasks) #48 的修正落进代码)。
  • okc distill --verify <id>:确定性反任务校验(§5)——load_eval_task 可加载、verifier 可执行、fail-before 硬门(verifier 在裸 fixture 上必须失败,空过的裁判什么都没测)。
  • --accept / --reject / --list:append-only ledger(复用 harness_edits_apply 的 fold 手法),未过 verify 不可 accept(硬约束);accept 只打印 promote 指引——没有任何代码路径写 tests/e2e/,人工 git commit 是唯一晋升通道(§6.1)。
  • CLI 挂到 okc distill,复用 eval.py 的 verifier 执行路径(_run_verifier/_copy_fixture),不长第二套方言。

验证

  • 新增 tests/test_distill.py(12):契约加载(含手写任务空 lineage)/ fail-before 拒空过 verifier / runnable 拒坏 argv / accept-before-verify 拒绝 / reject 任意时刻 + latest-decision-wins / ledger append-only / 重验失败降级 / CLI 全生命周期。
  • 全量 551 passed(539 → 551)。
  • 真机 smoke:手写一个 candidate 走完 accept-拒绝 → verify → accept → list 全流程。

界限(P0 刻意不做)

LLM distiller(P1)、lineage 过滤接进 holdout gate(P2)、metrics 半(P3)。

…istill)

Eval-task candidates live in .agent-harness/eval_candidates/<id>/ (task.json +
fixture/ + provenance.json) with an append-only lifecycle ledger. okc distill
--verify runs the deterministic anti-task checks: load via load_eval_task,
verifier runnable, and the fail-before hard gate (the verifier must FAIL on the
untouched fixture). --accept refuses unverified candidates and prints promote
guidance only -- no code path writes tests/e2e/; a human commit is the sole
promotion channel. EvalTaskSpec gains the optional source_sessions lineage
field (empty for hand-written tasks) so held-out hygiene survives promotion.
Candidates are hand-written in P0; the LLM distiller is P1.
@Niraya666
Niraya666 merged commit 84f9c6c into main Jul 16, 2026
2 checks passed
@Niraya666
Niraya666 deleted the codex/distill-p0 branch July 16, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant