Repository navigation
Description
Current state: Proposed, revision v2.1 (2026-11-26). RFC owner: @fake0fan. Rewritten against main 7e2c4ab6 and incorporating the nine review comments on v1 (point-by-point disposition in §11). The v1 text is preserved in this Issue's edit history. Nothing here has been implemented, and no real-model or device experiments have been run.
Decision needed: (1) whether to accept the phasing "Harness module rule abstraction first (P0), then a single module, Indexer, as phase one (P1)"; (2) P1's editable scope and the boundary between development feedback and held-out acceptance; (3) P0/P1 implementers and the P1 acceptance owner; decision owner @fake0fan.
Next action: reviewers check v2.1; @fake0fan then records the §9 decisions and splits P0 and P1 into independently acceptable sub-issues; P1 experiments get their own acceptance issue, with tasks, models, budgets and decision rules frozen before search.
Chinese version: full text in the comment below.
1. What changed in v2
v1 set the initial object as "improving the method an agent uses to complete an entire engine-optimization task": broad scope and expensive individual experiments. Review focused on port readiness, comparison fairness (equal budget, equal feedback), isolation between development and held-out data, and the shape of the experience store. Several facts have also changed over the last ten days:
- #689 split the managed optimization loop into four responsibilities, Analyzer / Indexer / Executor / Evaluator, and turned the Indexer's ranking weights into an explicitly selectable, frozen, receipted policy (
ranking_policy.py). Its acceptance explicitly left "automatic proposals and real-model equal-budget comparisons" to this RFC. - The 8-round Knowledge on/off comparison in #509 found that default retrieval did not deliver the most relevant task card into the context. The Indexer rule is therefore a bottleneck with real evidence behind it.
- #447, #429, #430 and #434 are accepted; the generation, evaluation and context-sealing handoffs now have implementations.
v2 therefore makes three changes:
- The object of improvement narrows from "the whole working method" to "replaceable rules in the four Harness modules". Each round changes one rule.
- New prerequisite P0: a uniform "rule slot" abstraction for the four modules. Without it, candidate rules produced by the improvement loop cannot be frozen, delivered, resumed or replayed.
- Phase one (P1) covers only the Indexer. Its abstraction is closest to complete, development feedback can first be replayed on CPU, and cost stays bounded. Analyzer is the candidate second module; real engine tasks and the cross-task experience library come later.
2. Goal: two loops
- Rule: a replaceable, freezable policy in one of the four modules, e.g. the Indexer's field weights or the Analyzer's bottleneck-ordering basis. Rule set H0/H1 is the version of all four rule kinds together. It is distinct from the engine-patch candidates the agent produces during a task: adopting H1 does not mean any engine patch passed, and does not make H1 the global default.
- Evolver: reads development trajectories and proposes one rule change. The target form is a real model proposing from authorized evidence; P1 may also run a deterministic search as a control, to separate "the model contributed" from "more parameter settings were tried".
- Acceptance metrics (numeric values and gates live in the acceptance issue, not in the repository):
- share of tasks meeting both performance and quality within budget;
- cumulative device card-hours until both are first met;
- also report regressions, model tokens and wall time; unavailable cost stays unknown, never zero.
Three checkable questions (from v1, rescoped to rules):
- Was the rule change proposed by a real Evolver from the evidence authorized for this round, rather than predetermined? Can we list the evidence references it actually saw?
- Under fixed conditions and the same total budget, does H1 beat H0 and an equal-budget repetition of H0? Negative and inconclusive results are valid outcomes.
- Does the frozen H1, with its applicability conditions, still hold on tasks not used for development?
3. Prerequisite P0: rule-slot abstraction for Harness modules
#689 recorded the boundaries of the four responsibilities, but only the Indexer has a replaceable policy, and candidates can only be chosen from a registry hard-coded in source: MANAGED_RANKING_POLICIES currently holds only default and applicability, and session resume in resolve_frozen_ranking looks policies up by name in that registry. A new weight set proposed by the Evolver would need a code change before it could run, so the improvement loop cannot turn.
P0 defines a uniform rule slot for each module, with at least:
| Element | Requirement | Indexer today |
|---|---|---|
| Identity | rule_id + rule version + full effective configuration + configuration digest |
Present (RankingPolicy.receipt()) |
| Editable parameters | Declared field allowlist, types, value ranges and step sizes; out-of-range edits rejected before launch | Field allowlist and non-negativity exist; bounds missing |
| Freeze and resume | Plan freezes the full configuration and digest; resume rebuilds and verifies from the frozen configuration; candidate rules need no code registration | Currently looked up by name in the registry — needs change |
| Decision trace | What the rule did each time enters the trace as fixed references, e.g. Indexer returned / delivered / omitted items and scores | Delivery receipts and captures exist |
| Ownership unchanged | A rule is only a parameterized policy. Loop, budget and stop rules stay with H (D005), ranking with K, judgment with B | Conforms |
Readiness of the four modules:
| Module | Current home | Rule-slot gap | Phase |
|---|---|---|---|
| Indexer | K Corpus.score / rank + RankingPolicy (#689) |
Freeze/resume of unregistered candidate rules; parameter bounds | Completed in P0, used in P1 |
| Analyzer | record_diagnosis only retains the agent-supplied diagnosis |
No replaceable ordering rule yet. First agree on inputs (critical-path time, measured speedup and other evidence references), output (an evidence-backed bottleneck ordering, delivered to the agent only as a suggestion), and a record of whether the agent followed it | P2 candidate |
| Executor | Per-round attempts, budget, recovery; reuse within one attempt in service mode | Lifecycle for reusing a hot service across candidates not yet settled (#651) | Later |
| Evaluator | Optional screening and formal measurement in the service-path evaluate |
Screening/escalation rules not yet extracted; formal acceptance keeps its current owner | Later |
P0 is complete when the generic slot contract is documented and fully implemented for the Indexer: unregistered candidate rules can be frozen, delivered, resumed and replayed; out-of-range edits, digest drift and rule changes on resume have CPU negative cases; old sessions and default behavior are unchanged. The other three modules only have their gaps recorded in P0, not implemented.
4. Phase one P1: iterating the Indexer rule with Harness² ideas
4.1 Why the Indexer first
- Its abstraction is closest to complete (task: 明确 Harness loop 子组件边界,先抽出 Indexer 排序策略 #689), so P0 is smallest.
- There is real evidence of a problem: in investigation: 8 轮 Knowledge on/off 对照暴露的 RSI 框架问题 #509 the relevant task card was not delivered.
- Development feedback can first be computed on CPU: ranking is deterministic. Given a frozen corpus, queries and budget, each rule's returned and delivered items can be replayed without going to a device for every edit.
4.2 Editable scope
| Editable | Fixed |
|---|---|
The six RankingPolicy field weights, within frozen ranges and step sizes; one change per round |
Corpus content and version, query generation, context byte budget, ranking algorithm version (RANKING_VERSION), agent model and settings, Executor/Evaluator rules, acceptance protocol, total budget, raw evidence |
Making byte budget, scope filters or the ranking algorithm editable later requires a separate freeze; this phase does not widen authority implicitly.
4.3 One improvement round
- Freeze: development task set, held-out task set, corpus snapshot, H0 (current default weights), Evolver model and settings, editable scope, repeat count, pairing, statistical method, total budget and stop conditions.
- Development trajectories: read the retained records of development tasks: knowledge captures (per-item hashes, assembled text, query/scope, omissions),
optimization_tracesteps,experiment-timing.json, and measured performance, quality and resources. Read development rounds only, never held-out tasks. - Propose: the Evolver outputs the parent rule version, one change, a hypothesis, the cited development evidence and applicability conditions. Every cited item must appear in the context actually delivered to that call and be
verifiedunder the existing record states (verified / hash_mismatch / missing / redacted); otherwise the proposal is rejected. - Development comparison (two levels):
- P1a retrieval level (CPU): replay H0 and the candidate on the frozen corpus and queries, and compare whether relevant items entered the delivered context. Relevance labels come from development tasks and are frozen before search. This is development feedback only and is not evidence of task gains.
- P1b task level: on a small set of development tasks, run full optimizations with a real agent and compare H0 and the candidate pairwise.
- Rerun and freeze: a passing candidate must be executed again; partial results are not extrapolated. Then freeze H1 and its applicability conditions. An inconclusive result ends the round and retains H0, with no probes beyond that round's frozen allowance. A later round may propose a new candidate, within the frozen maximum number of rounds and total budget. Allocations across rounds and stages are frozen before search and are not reallocated at run time (answers Dong's open question ②).
- Independent held-out acceptance: H0 and the frozen H1 each run a full optimization under the same model, hardware, quality gate and total budget; failed attempts and reruns count toward cost. The result only accepts or rejects; it is never used to re-rank or tune.
4.4 Comparison design (from review)
- Three arms: H0; equal-budget repeated H0 (best-of-N whose output-selection rule may read exactly the same development feedback as the Evolver); the improvement loop. Arms 2 and 3 then differ only in whether the rule is edited. Optional fourth arm: a deterministic-search Evolver.
- Per-arm budget accounting: Evolver calls, failed proposals, development comparisons and reruns are all charged to the improvement arm; report total search cost and the selected rule's execution cost separately. Unavailable tokens and cost remain unknown. Which steps each arm is charged for, including the H0 reference run, is frozen in the acceptance issue.
- Development/held-out isolation: held-out tasks must differ by more than ID and satisfy a frozen non-overlap rule, e.g. different model, engine regression commit, affected component and hot path. A rerun on the same task is reported as a same-task remeasurement, not independent acceptance.
- Statistics: repeat count, seeds and sampling settings, pairing and statistical method are frozen before candidate search; the paired-statistics ideas of the closed rfc: 可解释的改进——用 profile 证据和配对统计判定 PASS #454 may be referenced, but its thresholds are not adopted by default.
- Indexer-specific precondition: before comparing library on/off or H0/H1, assert that relevant items were actually delivered (reusing task: 明确 Harness loop 子组件边界,先抽出 Indexer 排序策略 #689's delivery receipts), so retrieval defects are not mistaken for rule effects (the investigation: 8 轮 Knowledge on/off 对照暴露的 RSI 框架问题 #509 lesson).
4.5 Interrupted Evolver calls
A real Evolver call can be interrupted after the request is submitted but before its receipt is retained. P1 routes Evolver calls through H's existing request record in agent_sessions.py rather than a new ledger: dispatch durably marks the request dispatching under a lock before handoff; a repeated dispatch returns may_create=False; an unbound request accepts only a definite not_created failure. On recovery without a receipt, the controller either binds to the original call by the same verifiable request identity or stops; it never treats the call as not made, never resends it for free, and counts it against the budget with unknown usage. The held-out claim is consumed when first recorded, so recovery cannot reset the single-use final, and held-out results are never returned to the proposer. The P1 controller slice verifies this with a CPU stand-in provider that receives the request, drops the response and restarts, checking call counts, absence of resends, the single-use final and proposer isolation. Whether this record fully covers the Evolver path is confirmed in that slice.
4.6 P1 deliverables and completion
- Software: Evolver adapter (real model + deterministic control), P1a replay comparison, pairing and rerun, freeze and held-out claim, and CPU negative cases: out-of-range edits, citing a truncated capture, tampered evidence, budget exhaustion, lost responses (§4.5), held-out leakage, retaining H0.
- This includes david's delivery-boundary fixture: two verified captures, with the adapter dropping the second at its context limit; the proposal receipt binds to the final serialized context and lists the second as omitted; an edit citing the second must be rejected even though its source hash still verifies.
- Research: one P1 pilot report answering questions 1 and 2 of §2 on the task set frozen in the acceptance issue. Negative or inconclusive conclusions count as completion.
- Passing software tests does not substitute for research conclusions; research conclusions do not generalize to other modules or engine service performance. Service-performance claims still require the corresponding L4 evidence.
5. Later phases (direction only here; each gets its own task)
| Phase | Content | Entry condition |
|---|---|---|
| P2 | Second module: preferably Analyzer (after completing its slot abstraction), or the Evaluator's screening/escalation rules | P0 contract accepted; P1 report complete |
| P3 | Cross-task experience: write frozen H1, applicability conditions and failure observations into a K candidate space, and compare with/without on tasks not used for development | P1 produced at least one complete report; #509's P0 issues fixed |
| P4 | Back to v1's larger goal: improving combinations of rules on real engine tasks (e.g. diagnosing and fixing a performance regression at a fixed revision) | P2 and P3 have conclusions; a controlled provider configuration and device budget exist |
Experience rules for P3, recorded here for later freezing:
- Reuse the versioned
KnowledgeStorecreate / update / historypath rather than a new shared business interface; align any contract extension with the rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387/task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 contract documents. The candidate space is isolated from the canonical catalog and never auto-promoted to canonical knowledge. - Record experience at trace-step granularity (motivation + outcome + the search-space item involved), keeping parent version, cited evidence and applicability in one object. It must also pass a frozen contamination rule so experience does not carry answers into transfer tasks.
- The final verdict (PASS / FAIL / INCONCLUSIVE / H0 retained) is only appended to the experience history, without changing the experience content. Whether experience from rejected candidates enters the library snapshot is frozen in the P3 plan.
- Failure observations (e.g. OOM) distinguish a reproducible configuration limit from transient device pressure: record the failing stage, effective workload and runtime, and available memory and competing occupancy at failure. Reuse by later tasks requires a matching environment and configuration. A single OOM can remain scoped evidence, but only becomes a rule that skips later candidates after the same configuration reproduces it on an isolated device.
- The library-off arm uses the same H0, K query interface, ordinary knowledge, model and budget caps, varying only whether the frozen experience snapshot is in scope; both arms record the same read and omission counters.
6. Boundaries with related work
| Related item | Relationship |
|---|---|
| #689 (done) | Provides the four-responsibility boundary and the Indexer ranking policy; P0 adds freeze/resume of candidate rules on top |
| #363 | Changes search-role parameters, while this RFC changes the four modules' rules; neither replaces the other. This phase does not touch or reuse #363's implementation; budget, attempts and recovery follow H's existing rules, with no new ledger. #363 is closed; owner to confirm whether its recorded "real Agent/Skill pilot and cross-task gains" move to this RFC |
| #509 | Real evidence of the Indexer problem; its "delivery assertion" is a precondition for P1/P3 |
#93 offline MVP (harness-improvement.md) |
Keeps its discipline of freezing, pairing, mandatory rerun, single-use holdout and H0 retention; #93 is not reopened |
| #651, #697, #249 | Executor hot updates, continuing after a failed final, and parallel lanes respectively; scope unchanged by this RFC |
| #387 / #371 | #387 closed with a changed-scope disposition and docs/contracts/ remains a Proposed contract; this RFC follows the current D005 (loop and stop rules in H; Apps builds no second loop or retry policy) and D008 ownership, without treating them as fully accepted |
| #543 C3 / #316 | Tracking entries; linked only |
7. Scope and constraints
- In scope: P0 rule-slot contract and Indexer implementation; P1 Evolver adapter, development comparison, freeze and held-out acceptance, pilot report; direction and entry conditions for P2–P4.
- Out of scope: automatically rewriting H/B controllers or evaluation rules; training model weights; evolving executable scripts, plugins or hooks initially; changing modules other than the Indexer in P1; automatic merge or publication; automatically making a candidate rule the global default; automatic promotion to canonical knowledge; promising to reproduce upstream gains.
- Automatic progression: within an explicitly authorized scope, work may proceed without per-round human confirmation, but this does not cover merging, promotion to the canonical skill library or changing the global default rule.
- Budget allocation: maximum rounds, per-round and per-stage allocations and the total budget are frozen before search; the loop does not reallocate them at run time.
- Isolation: hashes only detect identity and drift. Execution isolation, visible files and network scope must be demonstrated by the implementation and pilot environment, not by prompts alone.
8. Ownership and authorization
- Proposed by: @fake0fan; v1 and v2 drafted with agent assistance.
- RFC owner: @fake0fan, who maintains this text and records the §9 decisions.
- P0/P1 implementers and P1 acceptance owner: TBD, named by the RFC owner when sub-issues are opened; owners of related issues are not assigned automatically.
- Current authorization: covers revising and publishing this design proposal only. Implementation and model/device budgets follow each sub-task's authorization record.
9. Decisions needed
- Accept the phasing: P0 rule-slot abstraction → P1 Indexer only → P2–P4?
- P1's editable scope (six weights + bounds), the two levels of development feedback (P1a CPU retrieval level / P1b task level), and the rule "inconclusive retains H0, no extra probes"?
- P1's development/held-out task sets, Evolver model (provider), execution environment and acceptance owner?
- Do the "real Agent/Skill pilot and cross-task gains" left when [RFC] 基于 SpecRSI 的双循环 RSI:VATS 搜索与 GVO 改进器学习 #363 closed move to this RFC's P3/P4?
10. Completion and closure
Design is complete once the designated RFC owner records the decisions in §9 and names the scope and owners of the P0 and P1 sub-issues. Closing this RFC changes no related task's status and does not establish feature delivery, research gains or a campaign PASS.
11. Disposition of v1 review comments
| Reviewer | Point | v2 disposition |
|---|---|---|
| @amy-why-3459 #1 | Is #387 accepted | §6: #387 contracts remain Proposed, not treated as accepted |
| @amy-why-3459 #2 | Port readiness | §1, §3; CandidateProvider and EvaluationPort now have implementations, item-by-item verification in P0 |
| @amy-why-3459 #3 | D005 citation | Current D005 now states "loop in H, Apps builds no second loop"; §6 cites the current version |
| @amy-why-3459 #4 | Equal-budget accounting | §4.4 per-arm budget accounting |
| @amy-why-3459 #5 | Development/held-out isolation | §4.4; same-task remeasurement labeled as such |
| @amy-why-3459 #6 | Experience store shape | §5 P3: reuse the versioned KnowledgeStore path |
| @amy-why-3459 #7 | Owners and limits of automatic progression | §7, §8 |
| @Dong1017 #1 | Feedback parity between arms | §4.4 three-arm design |
| @Dong1017 #2 | Experience from rejected candidates | §5 P3: verdict appended to history; snapshot inclusion frozen in the plan |
| @Dong1017 #3 | Disjoint transfer tasks | §4.4 non-overlap rule; §5 contamination rule |
| @Dong1017 flowchart ① / ② | Can OOM observations be reused; re-probe or new candidate when inconclusive | ① §5 P3 (matching environment and configuration); ② §4.3 step 5 and §7 |
| @david6666666 (library-off arm) | What the library-off arm keeps | §5 P3 last item |
| @zengchuang-hw | Adapter inputs/outputs; isolation, actual use and recovery as executable cases | §4.3 step 3, §4.5 interrupted calls, §4.6 negative cases, §7 isolation |
| @david6666666 (records as input) | Recorded refs as proposer input; reuse record-state gate; trace-step granularity | §4.3 steps 2–3; §5 P3 |
| @david6666666 (delivery-boundary fixture) | A truncated capture must not be citable | §4.6 |
| @david6666666 (OOM) | Configuration limit vs transient pressure | §5 P3 |
Activity
fake0fan commentedon Nov 16, 2026
中文版本
本评论保留 RFC v2 的完整中文正文;英文版本见 Issue 主文。
当前状态: Proposed,修订版 v2.1(2026-11-26)。RFC owner:@fake0fan。本版基于 main
7e2c4ab6改写,吸收了 v1 下 9 条评审意见(逐条处理见 §11)。v1 原文保留在本 Issue 的编辑历史里。本 RFC 还没有实施,也没有做真实模型或设备上的对照实验。需要决定: ① 是否接受“先做 Harness 模块规则抽象(P0),再用单个模块 Indexer 做第一阶段(P1)”的分期;② P1 的可编辑范围、开发反馈与留出验收的边界;③ P0/P1 的实现者和 P1 验收负责人。决策人:@fake0fan。
下一步: 评审人核对 v2.1;之后由 @fake0fan 记录 §9 的决定,把 P0、P1 拆成可独立验收的子任务;P1 的实验另开 acceptance issue,并在搜索前冻结任务、模型、预算和判定规则。
1. v2 改了什么
v1 把首期定为“改进 Agent 完成整个引擎优化任务的工作方法”,范围大、单次实验成本高。评审集中在端口是否就绪、对照是否公平(等预算、反馈一致)、开发与留出隔离、经验存储形态等问题上。这 10 天里还出现了几件新事实:
ranking_policy.py)。它在验收里明确把“自动提案、真实模型同预算对照”留给了本 RFC。据此,v2 做了三处调整:
2. 目标:两层循环
需要回答三个可检查的问题(v1 的问题,范围改成规则):
3. 前置条件 P0:Harness 模块的规则槽位抽象
#689 已经写下四个职责的边界,但只有 Indexer 有可替换的策略,而且候选策略只能从代码里写死的注册表里选:
MANAGED_RANKING_POLICIES目前只有default和applicability两项;会话恢复时resolve_frozen_ranking是按名字去注册表里取。这样一来,Evolver 提出的一组新权重必须先改代码才能跑,改进循环就转不起来。P0 为每个模块定义一个统一的规则槽位,至少包含:
rule_id+ 规则版本 + 完整有效配置 + 配置摘要RankingPolicy.receipt())四个模块的抽象准备程度:
Corpus.score / rank+RankingPolicy(#689)record_diagnosis只保存 Agent 给出的诊断evaluate中的可选快筛与正式测量P0 的完成条件:通用槽位契约写入文档,Indexer 完整实现。具体包括:非注册的候选规则能被冻结、交付、恢复和回放;越界修改、摘要漂移、恢复时规则变化都有 CPU 负例;旧会话和默认行为不变。其余三个模块在 P0 只记录缺口,不实现。
4. 第一阶段 P1:用 Harness² 思路迭代 Indexer 规则
4.1 为什么先做 Indexer
4.2 可编辑范围
RankingPolicy的 6 个字段权重,限制在冻结的取值范围和步长内;每轮只改一处RANKING_VERSION)、Agent 模型和设置、Executor/Evaluator 规则、验收协议、总预算、原始证据以后如果要把字节预算、scope 过滤或排序算法也纳入可改范围,需要另行冻结,不能借本阶段的名义扩大权限。
4.3 一轮改进的流程
optimization_trace步骤、experiment-timing.json、实测的性能、质量和资源。只读开发轮次,不读留出任务。4.4 对照设计(吸收评审)
4.5 Evolver 调用中断
真实 Evolver 请求可能在提交之后、回执落盘之前被中断。P1 让 Evolver 调用走 H 已有的请求记录
agent_sessions.py,不新建账本:dispatch在交出请求之前,先在锁内把请求持久化为dispatching;重复派发会返回may_create=False;尚未绑定的请求只接受明确的not_created失败。恢复时如果没有回执,要么凭可核实的同一请求身份绑定到原来那次调用,要么停止;绝不当作没调用过,也不免费重发,按用量未知计入预算。留出声明在首次记录时就算消耗,所以恢复不会重置一次性终测,留出结果也不会回传给提案侧。P1 控制器切片用 CPU 替身验证:让 provider 收到请求后丢弃响应,再重启,核对计费次数、是否重发、一次性终测约束和提案侧隔离。这条记录能否完整覆盖 Evolver 路径,在该切片里确认。4.6 P1 的交付物与完成条件
5. 后续阶段(本 RFC 只定方向,各自另开任务)
P3 的经验规则先写在这里,供后续冻结:
KnowledgeStore的create / update / history版本化路径,不新建共享业务接口;需要扩展契约时回到 rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387/task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 的契约文档对齐。候选空间与 canonical catalog 隔离,不自动晋升为正式知识。6. 与相关工作的边界
harness-improvement.md)docs/contracts/仍是 Proposed 契约;本 RFC 遵循当前 D005(循环和停止规则归 H,Apps 不建第二个循环或重试策略)和 D008 的职责划分,不把它们当作已全部验收7. 范围与约束
8. 归属与授权
9. 需要决定
10. 完成与关闭
指定的 RFC owner 记录 §9 的决定,并给出 P0、P1 子任务的范围和负责人之后,即确认设计完成。关闭本 RFC 不改变任何关联任务的状态,也不代表功能已经实现、研究已有收益或 campaign PASS。
11. v1 评审意见的处理
CandidateProvider和EvaluationPort现已有实现,逐项验证放到 P0KnowledgeStore版本化路径amy-why-3459 commentedon Nov 16, 2026
Thanks for this RFC — the boundaries and evidence discipline are clear: it stays Proposed, does not treat the offline MVP or current main execution as delivery, and neither reopens #93 nor assumes #454's rules. I checked current main
f536288710c726a827bfa3e4357c2c911984cbc3, which matches the source snapshot in the body:docs/harness-improvement.mdandsrc/inferrsi/harness/{api,optimization,agent_sessions}.pyare all present. I also read the Chinese copy in comment 6906878874. A few points I'd like to pin down before acceptance:Acceptance status of rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387. The foundations table says this RFC follows the “accepted K/H/B and Apps responsibilities and handoff contracts.” task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371's Apps design is indeed Accepted, but rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 is still Proposed (“待仓库正式评审接受,” and the 2026-11-11 update explicitly says that is not maintainer acceptance). Please base “accepted contracts” on what has actually been accepted (for example discussion: Knowledge / Harness / Benchmark 三模块目标架构——现状、原语、交接时序与遗留问题 #362 A–D and task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371), and say whether this RFC follows the still-Proposed parts of rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 or will make a separate decision.
Current readiness of the ports to be reused. The RFC already says not to assume every listed interface is available, which is important. On current main I checked the names:
ContextProviderexists insrc/inferrsi/apps/context_provider.pywithcollect, and is covered bytests/test_apps_context_provider.py, but Harness does not yet consume it — T38 (task: Retain and seal Apps-delivered context in Harness (T38) #447, retain and seal delivered context) is still open.CandidateProvider.plan_generation/collect_candidateandEvaluationPort.execution_for/assessappear only in contract docs such asdocs/contracts/current-design.md; there is no corresponding Python type insrc/ortests/. For decision 5, please list, for slices A/B/C, which ports need only contract alignment and which must land (or be called out as prerequisite slices) so implementation does not treat these handoffs as already callable.The D005 citation. “Module ownership and handoff” attributes “H owns the optimization loop, state, and stop rules; Apps does not introduce another loop, sampling policy, or retry policy” to D005. In
docs/contracts/current-design.mdon this commit, D005 is “worker definition, execution, and the prepared resource closure”; that sentence does not appear in the file. I agree with the ownership split, but please cite the decision or section that actually carries the rule (nearby text is indocs/contracts/function-owners.mdunder D008, or the accepted rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387/task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 wording) so the acceptance record is not bound to the wrong number.How the same-budget comparison is counted. Question 2 and section B compare the improvement loop with repeated H0 attempts under the same total budget. The budget section also says the total ledger includes the H0 reference run, proposals, failed attempts, probes, composition, reruns, and independent scoring. If the improvement arm must pay for the reference run and proposal overhead out of the same budget, while the control arm spends the entire budget on H0 attempts, the improvement loop is systematically disadvantaged. Please freeze in the acceptance issue whether the total budget includes the reference run and proposals, which steps each arm is charged for, and how missing cost observations are handled.
Isolation of development feedback from final acceptance. Allowing public development correctness/profile/benchmark feedback under frozen rules, while keeping final-acceptance items and per-item results out of the proposer/composer context, is the right direction. For the single-task study in section B, please also state whether the development feedback visible during probe/compose uses the same inputs or the same measurement runs as the final holdout. If it is only a rerun of the same task rather than a holdout, the claim should be written as a same-task remeasurement, not as independent acceptance. Freezing the statistical method and gates before search, as the RFC already requires, should stay.
Shape of the candidate-experience store. Using a previously authorized local candidate store, existing K APIs, and no automatic promotion to a validated skill looks right.
KnowledgeStoreon main already hascreate/update/historyon versioned bundles. Please say whether experience reuses that bundle/revision path or is a new resource type. If it is the latter, the contract extension should go back to rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387/task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 rather than introducing a new shared business interface here.Owners and automatic progression. The acceptance owner, slice implementers, and first real task family are still TBD; those need to be recorded before acceptance, and I will not name them in this comment. The text allows automatic progression within an explicitly authorized scope; please also state that this authorization does not cover merge, promotion into the canonical skill library, or changing the globally default method (consistent with the out-of-scope list).
On decisions 1 and 2: technically, taking “working methods of an agent performing inference-optimization tasks” as the initial object, together with allowlisted declarative edits, development-evidence feedback, retention of H0, and independent final acceptance, is a clear and checkable direction. Whether to accept it is for the designated RFC owner to record.
Dong1017 commentedon Nov 16, 2026
Posted by an agent on behalf of @Dong1017 (incremental review only; points already raised by @amy-why-3459 in 6906899502 — #387 status, port readiness, the D005 citation, budget accounting, dev/holdout overlap, store shape, owners — are not repeated).
Read against the English issue body as of this comment. Three additional points, none of them blocking the direction:
Feedback parity between the comparison arms. Section B compares the improvement loop with "repeated H0 attempts under the same total budget, with the output-selection rule also frozen in advance." The improvement arm selects/composes using public development correctness, profile and benchmark feedback (step 5). If the repeated-H0 arm picks its output without the same feedback, part of any gain comes from feedback-guided selection rather than from changing the method. Please state in the acceptance issue that the repeated-H0 selection rule may read exactly the same development feedback (same scope, same measurement procedure) as the composer, so that arm 2 is a best-of-N baseline and arm 3 differs only in whether the method is edited.
What happens to experience drafted from a candidate that then fails final acceptance. The flowchart derives candidate experience from development evidence at the compose step, and step 6 freezes "the final candidate and draft development experience" before final validation. The body does not say whether the final verdict (PASS / FAIL / INCONCLUSIVE, or H0 retained) is attached to that experience revision afterwards, or whether experience from a rejected H1 is still eligible for retrieval by later tasks in section C. Please define this — e.g. append the final verdict reference to the experience history without changing its content, and freeze in the C plan whether entries whose source attempt failed acceptance are included in the library snapshot.
Disjointness of the transfer tasks. Section C compares library-on/library-off "on tasks not used for development." With the suggested first family (fixing a performance regression at a fixed engine revision), a new task that shares the same regression commit, engine revision or hot path as a development task would let an experience entry carry the answer rather than a method. Please freeze in the C plan what makes a task "not used for development" (for example: different regression commit and different affected component), not only a different task ID.
Checking scope: read the issue body (English) in full and @amy-why-3459's comment; did not re-check the code paths Amy already verified on
f5362887, and did not read the upstream Harness² sources linked in the body.david6666666 commentedon Nov 16, 2026
For the Section C transfer study, could we specify what the library-off arm still gets? Run the same held-out tasks in fresh sessions with the same H0, K query interface, ordinary knowledge, model, and budget caps. Vary only whether the frozen candidate-experience snapshot is in scope, and record the same read/omission counters in both arms. Otherwise a gain could come from changing the retrieval workflow or ordinary knowledge rather than transferring experience.
zengchuang-hw commentedon Nov 17, 2026
独立技术检视(RFC 建议,不代表 owner 接受范围,也不承诺实施)。
检视基线:current main
1bbc3b0c8de14d6194d7ee7987607365b665fbfe;按原始目标/验收要求核对实际代码,未以讨论中的实现叙述作为证据。1. 建议先明确“现有离线控制器”与“拟议真实 Agent 改进”的交界。
现有 skill_eval_improve.py 在 prepare 时冻结外部提供的 proposals;run_offline 只接收显式注入的可信离线客户端,并拒绝 CodexClient。因此已有 allowlist、冻结、probe/rerun/holdout 编排可以复用,但不能据此认定“真实轨迹产生方法修订”已实现。报告 也明确 proposal/composition model calls 为 0、transfer 未评估。建议第一个实现切片先定义 proposal/composition adapter 的输入输出:只交付获准 dev 轨迹、候选 diff、来源及编辑范围;模型/控制器/validator/预算不可编辑。H1 方法摘要与 C1 引擎 patch 分别记录 hash、父版本及执行回执,避免用引擎收益替代方法收益。
2. 三个值得写成可执行验收用例的接口。
3. 论文机制与本项目验收应保持分层。
Harness² 原论文 §2.1–2.3 区分当前任务的执行 harness 与跨任务 improvement harness;同任务内后者固定,组合后需真实执行。论文也明确行为对比并不验证任务正确性。因此在此采用独立 validator/final 是项目验收设计,不是论文收益的自动复现。建议保留 H0、等预算重复 H0、有界改进三组,并单独报告提案/组合/失败 probe/复跑/验收的总 tokens、调用和时间;再用冻结经验的 on/off 实验回答迁移问题。数值 gates、任务族、adapter、环境和验收 owner 应在实验前确定,不从候选结果倒推。
验证范围:已读取 AGENTS、贡献/验收约定、相关 search-policy skill 与实际控制器/测试;下附本次聚焦测试结果。未运行真实模型调用、GPU/引擎性能实验或跨任务 library-on/off 实验,也未修改远端代码。软件边界测试通过不能证明 Agent 收益或迁移收益;这些目前仍待独立证据。
本次执行:在上述 main 快照下,以现有 Python 测试环境运行
PYTHONPATH=src:. python -m pytest -q tests/test_harness_improvement.py,41 个测试全部通过(退出码 0;另有一条 pytest 插件弃用警告)。未运行完整仓库测试套件。david6666666 commentedon Nov 17, 2026
Read this next to the evidence the dashboard already records (the review surface landed in #483). Four notes, none blocking the direction:
Make the recorded artifacts the proposer's input. Each round already has knowledge captures (per-item hashes, assembled text, query/scope, recorded use),
optimization_tracesteps (action / motivation / outcome / search_id) andexperiment-timing.jsonsteps. If proposals cite those fixed refs, question 1 becomes checkable: you can print the exact capture ids and trace lines that entered the prompt. If the proposer reads an ad-hoc transcript dump instead, nothing in the record set proves which bytes the model actually saw.Reuse the existing record states as the gate. They already return verified / hash_mismatch / missing / redacted, and the dashboard keeps missing as missing rather than zero. A proposal or experience entry citing a mismatched or uncollected ref should be rejected at that same layer, otherwise the offline review and the improvement loop end up with different definitions of "evidence".
Draft experience at trace-step granularity (motivation + outcome + the search-space item it names) rather than as a free summary. Parent revision, cited evidence and applicability stay in one object, and a later task can pin the exact version the same way a capture is pinned.
One extra field in B's report: per proposal, the capture / trace / profile refs that were in context. That answers "what evidence supported this change" from records instead of from the model's own account.
david6666666 commentedon Nov 17, 2026
Could Section A include one delivery-boundary fixture for the proposer? Start with two verified, authorized captures, then have the adapter drop the second at its context limit. The proposal receipt should bind to that attempt’s final serialized context and list the second capture as omitted; a proposed edit citing it must fail the evidence check even though its source hash still verifies. #447’s attempt-scoped context receipt is a useful model. That would test the difference between a valid source reference and evidence actually supplied to this call, without claiming the model used it.
Dong1017 commentedon Nov 18, 2026
这张图不改变 RFC 的控制器、总预算或最终验收规则,只想明确两处观察应如何处理。
flowchart TD A[提出方法候选] --> B[在开发反馈范围内 probe] B --> C{观察结果} C -->|明确 OOM| D[记录配置与环境限定的失败证据] C -->|可能有收益但证据不足| E{待讨论 ②\n固定策略如何决定复测或换候选?} E -->|允许追加 probe| B E -->|形成下一候选| A C -->|满足开发阶段条件| F[组合并复跑] F --> G[最终验收:仅接受或拒绝\n不利用 holdout 继续调参] G --> H[记录最终结果] D --> I{待讨论 ①\n即使最终验收失败\n这条 OOM 观察能否被后续任务使用?} H --> I I --> J[候选运行经验\n不自动晋升为正式知识]① 失败观察的使用资格。 如果最终方案未通过验收,但某次 probe 的 OOM 证据完整,是否允许后续任务在匹配环境与配置条件下使用它?这应与“最终方案有效”分开记录,不能把 OOM 自动推广成跨环境约束。
② 开发阶段的复测选择。 在总预算与控制器固定的前提下,现有工作方法怎样决定继续复测还是换候选?若需要改变预算分配策略,应另行确认是否属于本 RFC 范围,而不是默认加入。此问题不涉及在最终 holdout 上继续搜索。
david6666666 commentedon Nov 18, 2026
For the OOM branch, could we distinguish a reproducible configuration limit from transient device pressure? Record the failing stage, the effective workload and runtime, and available memory and competing occupancy at failure. A single OOM can remain useful scoped evidence even if final fails, but it should not become a rule that skips future candidates unless the same configuration reproduces it on an isolated device.
Dong1017 commentedon Nov 26, 2026
[-]rfc: 基于 Harness² 的真实 Agent 工作方法改进与跨任务经验复用[/-][+]rfc: 基于 Harness² 的 Harness 规则改进循环——先抽象模块,再从 Indexer 起步[/+]fake0fan commentedon Nov 26, 2026
RFC revised to v2 (body updated in English; Chinese copy updated in place). The v1 text remains in this Issue's edit history.
Main changes:
resolve_frozen_rankinglooks policies up by name in a fixed registry).RFC 已修订为 v2(英文正文已更新,中文版原地更新;v1 保留在编辑历史中)。主要变化:改进对象收窄为 #689 四个模块中的可替换规则,每轮只改一条;新增前置条件 P0(规则槽位抽象);P1 只迭代 Indexer 排序权重;Analyzer、跨任务经验和引擎真实任务移到 P2–P4。各位评审意见的处理见 §11,请确认是否符合原意。
Dong1017 commentedon Nov 26, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
Partly. v2's §11 matches your three 2026-11-16 points and the ① OOM point from the 2026-11-18 by-hand comment, but ② is not closed yet, so this is not a yes on the disposition. Dong-bot (authorized delegate) check on #460 v2:
This reply records no decision. The §9 items (phasing, P1 scope, owners) stay open for the RFC owner.
Details
Checked: issue body, thread, the trigger comment, decisions.md (none on #460), and meta.json. Not checked: the repository code and Amy's port and D005 points, which are outside this ask. No tests were run.
Dong's 2026-11-16 points are in the agent comment.
[-]rfc: 基于 Harness² 的 Harness 规则改进循环——先抽象模块,再从 Indexer 起步[/-][+]rfc: Harness²-style rule improvement loop — abstract module rules first, start with the Indexer[/+]zengchuang-hw commentedon Nov 26, 2026
NO PASS
dot, acting for zengchuang-hw.
回应这次 v2 对照邀请及我上轮的意见。P0 先做 Indexer 规则的完整冻结和回放、P1 将实际送达上下文与仅通过源哈希区分,并隔离调参与独立验收,均符合原意。离线代码已用排他结果目录消耗被中断的尝试,并先冻结最终候选再读取 holdout;但离线入口不调用真实 Evolver,不能证明它覆盖响应丢失。
只剩一项需在 P1 验收设计中写清: 提交真实 Evolver 请求后、回执落盘前若进程中断,指出哪个现有 Harness 持久记录保留尝试身份与预算,以及无回执时恢复是停止,还是凭可核实的同一请求身份恢复。不要把未知当未调用或免费重发。可用 CPU 替身让提供方收到请求后丢弃响应,再重启核对计费次数、是否重发、恢复不会重置独立 final 的一次性约束,也不会把 holdout 回馈给提案侧。无需先新增账本或跑付费模型。
本轮静态核对 v2 与现有冻结/离线控制器;上述真实调用路径尚未实现验证。此结论不阻挡已明确的 P0 设计,也不是 owner 接受或实施授权。
fake0fan commentedon Nov 26, 2026
v2.1 — body and Chinese copy updated. I am the RFC owner for #460.
agent_sessions.py(dispatchingpersisted before handoff,may_create=Falseon repeat dispatch, unbound requests accept only a definitenot_createdfailure). Without a receipt, recovery binds to the same verifiable request identity or stops; never treated as not called or resent for free, and counted with unknown usage. The held-out claim is consumed on first record. A CPU stand-in provider that drops the response and restarts checks call counts, resends, the single-use final and proposer isolation. Whether this record fully covers the Evolver path is confirmed in the P1 controller slice.Remaining open: §9 decisions, to be recorded by me after review. My account cannot assign or label this Issue; could a maintainer assign it to @fake0fan and add
status:proposed?v2.1:正文和中文版已更新;我担任 #460 的 RFC owner。补充了 OOM 复用要求环境和配置匹配、结果不确定时的轮次与预算规则(§4.3、§7),以及 Evolver 调用中断后的恢复语义(新增 §4.5)。§9 的决定会在评审后由我记录。我的账号没有 assign 和加标签的权限,请 maintainer 帮忙指派给 @fake0fan 并加上
status:proposed。david6666666 commentedon Nov 26, 2026
Dot, acting for @david6666666 under delegated Issue review.
The v2.1 disposition matches my intent. §4.6 now tests what the Evolver actually received, including a verified capture omitted from the final serialized context; §5 keeps trace-step provenance and the same ordinary knowledge and retrieval path in both transfer arms, and limits reusable OOM skips to the same configuration after isolated reproduction. I support starting with the Indexer end to end and leaving the other three slots design-only in P0. Keep the lost-response/single-use holdout test in P1's acceptance issue and freeze the proposer-visible receipt set before the first search. This confirms my review points, not owner acceptance or evidence of a working self-improvement loop.
amy-why-3459 commentedon Nov 26, 2026
Dot, acting for @amy-why-3459. The v2/v2.1 disposition addresses my v1 points at the design level. In particular, §4.4 freezes who pays for the H0 reference and uses matching development feedback for best-of-N and the improvement arm; it also distinguishes a same-task rerun from held-out acceptance. §6 no longer treats #387 as accepted, and P0 still has to verify the actual callable ports. Reusing versioned KnowledgeStore bundles in P3 does not authorize canonical promotion.
One concrete addition to the P1 lost-response test: make the next proposal fit only if the uncertain call's budget reservation is released. For example, with 10 units left, reserve a hard upper bound of 6 for the submitted call, then lose its receipt and ask to spend 5. Unknown usage stays unknown, but the controller must decline the 5-unit request until the original call's usage is authoritatively reconciled, or stop if no upper bound can be enforced. Otherwise it could report the call as unknown and still overspend the frozen budget without ever resending it. This is an acceptance case, not a request to add a new ledger or a claim that the P1 controller already works.
zengchuang-hw commentedon Nov 26, 2026
PASS
dot, acting for zengchuang-hw.
回应v2.1 更新;上轮阻塞已在设计层补齐。新 §4.5 指定由 Harness 先落盘
dispatching,重启只绑定同一可核实的原调用,否则停住;不能把无回执当未调用、免费重发或重置预算。独立 held-out 的首次 claim 与 proposer 隔离也有明确验收。按 RFC 基线核对了 现有原生请求记录。本地提取原始
dispatch,用替身存储模拟首次落盘后无回执并再次 dispatch,首次允许创建,第二次返回may_create=False;未调用真实 provider。P1 仍须以真实接线的 CPU 替身用例验证恢复、预算计次和 held-out 一次性。这是对该设计修订的检视,不是 owner 接受或要求加标签。