Skip to content

rfc: Harness²-style rule improvement loop — abstract module rules first, start with the Indexer #460

Open

Description

@fake0fan

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:

  1. The object of improvement narrows from "the whole working method" to "replaceable rules in the four Harness modules". Each round changes one rule.
  2. 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.
  3. 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

InferRSI Harness² 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):

  1. 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?
  2. 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.
  3. 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

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

  1. 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.
  2. Development trajectories: read the retained records of development tasks: knowledge captures (per-item hashes, assembled text, query/scope, omissions), optimization_trace steps, experiment-timing.json, and measured performance, quality and resources. Read development rounds only, never held-out tasks.
  3. 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 verified under the existing record states (verified / hash_mismatch / missing / redacted); otherwise the proposal is rejected.
  4. 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.
  5. 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 ②).
  6. 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 KnowledgeStore create / update / history path 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

  1. Accept the phasing: P0 rule-slot abstraction → P1 Indexer only → P2–P4?
  2. 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"?
  3. P1's development/held-out task sets, Evolver model (provider), execution environment and acceptance owner?
  4. 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

  1. fake0fan commented on Nov 16, 2026

    @fake0fan
    ContributorAuthor

    中文版本

    本评论保留 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 天里还出现了几件新事实:

    • #689 已经把受管优化循环拆成 Analyzer / Indexer / Executor / Evaluator 四个职责,并把 Indexer 的排序权重抽成了可显式选择、可冻结、可留回执的策略(ranking_policy.py)。它在验收里明确把“自动提案、真实模型同预算对照”留给了本 RFC。
    • #509 的 8 轮 Knowledge on/off 实测发现,默认检索没有把最相关的任务卡送进上下文。也就是说,Indexer 规则本身就是一个有真实证据、值得优化的瓶颈。
    • #447、#429、#430、#434 都已验收,生成、评测和上下文封存的交接已有实现。

    据此,v2 做了三处调整:

    1. 改进对象从“整套工作方法”收窄为“Harness 四个模块里可替换的规则”。 每一轮只改一条规则。
    2. 新增前置条件 P0: 为四个模块定义统一的“规则槽位”抽象。没有这层抽象,改进循环产生的候选规则就没法冻结、交付、恢复和回放。
    3. 第一阶段(P1)只做 Indexer。 它的抽象最接近完成,开发反馈可以先在 CPU 上回放得到,成本可控。Analyzer 作为第二个模块候选,引擎真实任务和跨任务经验库放到后续阶段。

    2. 目标:两层循环

    InferRSI Harness² 双循环
    • 规则(rule): 四个模块里可以替换、可以冻结的策略,比如 Indexer 的字段权重、Analyzer 的瓶颈排序依据。规则集 H0/H1 是这四类规则一起的版本。它和 Agent 在任务中产出的引擎补丁候选是两回事:采纳 H1 不等于任何引擎补丁通过,也不会把 H1 设成全局默认。
    • Evolver: 读取开发轨迹,提出一条规则修改。目标形态是由真实模型根据获准的证据来提议;P1 允许同时跑一个确定性的搜索作为对照,用来区分“模型有没有贡献”和“只是多试了几组参数”。
    • 验收指标(具体数值和门槛写在 acceptance issue 里,不写进仓库):
      • 预算内性能与质量同时达标的任务比例;
      • 首次同时达标前累计消耗的设备卡时;
      • 同时报告回归、模型 token、墙钟时间;拿不到的成本记为未知,不按零算。

    需要回答三个可检查的问题(v1 的问题,范围改成规则):

    1. 规则修改是真实 Evolver 根据本轮获准的证据提出的,还是被预先写死的?能否列出它实际看到的证据引用?
    2. 在固定条件、同样的总预算下,H1 是否优于 H0,以及优于 H0 的等预算重复?负面和不确定的结果同样是合法结论。
    3. 冻结的 H1 及其适用条件,在没参与开发的任务上是否依然有效?

    3. 前置条件 P0:Harness 模块的规则槽位抽象

    #689 已经写下四个职责的边界,但只有 Indexer 有可替换的策略,而且候选策略只能从代码里写死的注册表里选:MANAGED_RANKING_POLICIES 目前只有 default 和 applicability 两项;会话恢复时 resolve_frozen_ranking 是按名字去注册表里取。这样一来,Evolver 提出的一组新权重必须先改代码才能跑,改进循环就转不起来。

    P0 为每个模块定义一个统一的规则槽位,至少包含:

    要素 要求 Indexer 现状
    身份 rule_id + 规则版本 + 完整有效配置 + 配置摘要 已有(RankingPolicy.receipt())
    可编辑参数 声明字段白名单、类型、取值范围和步长;超出范围的修改在启动前就拒绝 字段白名单和非负检查已有;还缺取值上下界
    冻结与恢复 计划里冻结完整配置和摘要;恢复时按冻结的配置重建并校验;候选规则不需要改代码注册 目前按名字从注册表取,需要改
    决策留痕 规则每次做了什么,要以固定引用进入轨迹,比如 Indexer 的返回、送达、省略和得分 已有交付回执与 capture
    归属不变 规则只是参数化的策略。循环、预算和停止规则仍归 H(D005),排序归 K,判定归 B 符合

    四个模块的抽象准备程度:

    模块 现有落点 规则槽位缺口 阶段
    Indexer K 层 Corpus.score / rank + RankingPolicy(#689) 非注册候选规则的冻结与恢复;参数边界 P0 补齐,P1 使用
    Analyzer record_diagnosis 只保存 Agent 给出的诊断 还没有可替换的排序规则。需要先约定输入(关键路径耗时、实测提速等证据引用)、输出(带依据的瓶颈排序,只作为建议交给 Agent),以及 Agent 是否采纳的记录 P2 候选
    Executor 逐轮 attempt、预算、恢复;服务模式下单次 attempt 内的复用 跨候选复用热服务的生命周期还没收敛(#651) 后续
    Evaluator 服务路径 evaluate 中的可选快筛与正式测量 快筛、扩测的升级规则还没抽出;正式验收保持现有归属 后续

    P0 的完成条件:通用槽位契约写入文档,Indexer 完整实现。具体包括:非注册的候选规则能被冻结、交付、恢复和回放;越界修改、摘要漂移、恢复时规则变化都有 CPU 负例;旧会话和默认行为不变。其余三个模块在 P0 只记录缺口,不实现。

    4. 第一阶段 P1:用 Harness² 思路迭代 Indexer 规则

    4.1 为什么先做 Indexer

    4.2 可编辑范围

    可以改 固定不变
    RankingPolicy 的 6 个字段权重,限制在冻结的取值范围和步长内;每轮只改一处 语料内容和版本、查询生成、上下文字节预算、排序算法版本(RANKING_VERSION)、Agent 模型和设置、Executor/Evaluator 规则、验收协议、总预算、原始证据

    以后如果要把字节预算、scope 过滤或排序算法也纳入可改范围,需要另行冻结,不能借本阶段的名义扩大权限。

    4.3 一轮改进的流程

    1. 冻结: 开发任务集、留出任务集、语料快照、H0(当前默认权重)、Evolver 的模型和设置、可编辑范围、重复次数、配对方式、统计方法、总预算和停止条件。
    2. 开发轨迹: 读取开发任务已留存的记录:knowledge capture(每条的哈希、组装后的正文、query/scope、省略项)、optimization_trace 步骤、experiment-timing.json、实测的性能、质量和资源。只读开发轮次,不读留出任务。
    3. 提议: Evolver 输出父规则版本、一处修改、假设、引用的开发证据和适用条件。它引用的每一项证据都必须是“本次调用实际送达的上下文”里出现过的,并且在现有记录状态(verified / hash_mismatch / missing / redacted)下是 verified,否则直接拒绝。
    4. 开发比较(两级):
      • P1a 检索级(CPU): 在冻结的语料和查询上回放 H0 与候选,比较相关条目是否进入了送达上下文。相关性标注来自开发任务,并且在搜索前冻结。这一级只是开发反馈,不构成任务收益的证据。
      • P1b 任务级: 在少量开发任务上用真实 Agent 跑完整寻优,配对比较 H0 与候选。
    5. 复跑并冻结: 通过的候选必须重新执行一次,不能拿局部结果推断。然后冻结 H1 和它的适用条件。结果不确定时本轮结束、保留 H0,不追加本轮冻结额度以外的探测;下一轮可以提出新候选,但不超过冻结的最大轮数和总预算。各轮、各阶段的预算分配在搜索前冻结,运行中不重新分配(回应 Dong 的待讨论 ②)。
    6. 独立留出验收: H0 与冻结的 H1 各跑一场完整寻优:同样的模型、硬件、质量门槛和总预算,失败的尝试和复跑都计入成本。验收结果只决定接受还是拒绝,不用来重新排名或调参。

    4.4 对照设计(吸收评审)

    • 三臂: H0;H0 的等预算重复(best-of-N,输出选择规则可以读取与 Evolver 完全相同的开发反馈);改进循环。这样第 2、3 臂的唯一区别就是规则有没有被修改。可选第四臂:确定性搜索 Evolver。
    • 预算按臂计账: Evolver 的调用、失败的提案、开发比较和复跑都记在改进循环这一臂;分开报告“搜索总成本”和“选中规则的执行成本”。拿不到的 token 和费用记为未知。各臂怎么计费、H0 参考运行算在谁头上,都在 acceptance issue 里冻结。
    • 开发与留出隔离: 留出任务不只是 ID 不同,还要满足冻结的不重叠规则,比如模型、引擎回归提交、受影响组件、热点路径都不相同。如果只是在同一任务上重测,结论要写成“同任务复测”,不能写成独立验收。
    • 统计: 重复次数、种子与采样设置、配对方式和统计方法都在候选搜索前冻结;可以参考已关闭的 rfc: 可解释的改进——用 profile 证据和配对统计判定 PASS #454 的配对统计思路,但不默认采纳它的阈值。
    • Indexer 的特有前提: 库开/关或 H0/H1 比较之前,先断言相关条目确实送达了(复用 task: 明确 Harness loop 子组件边界,先抽出 Indexer 排序策略 #689 的交付回执),避免把检索缺陷当成规则效果(investigation: 8 轮 Knowledge on/off 对照暴露的 RSI 框架问题 #509 的教训)。

    4.5 Evolver 调用中断

    真实 Evolver 请求可能在提交之后、回执落盘之前被中断。P1 让 Evolver 调用走 H 已有的请求记录 agent_sessions.py,不新建账本:dispatch 在交出请求之前,先在锁内把请求持久化为 dispatching;重复派发会返回 may_create=False;尚未绑定的请求只接受明确的 not_created 失败。恢复时如果没有回执,要么凭可核实的同一请求身份绑定到原来那次调用,要么停止;绝不当作没调用过,也不免费重发,按用量未知计入预算。留出声明在首次记录时就算消耗,所以恢复不会重置一次性终测,留出结果也不会回传给提案侧。P1 控制器切片用 CPU 替身验证:让 provider 收到请求后丢弃响应,再重启,核对计费次数、是否重发、一次性终测约束和提案侧隔离。这条记录能否完整覆盖 Evolver 路径,在该切片里确认。

    4.6 P1 的交付物与完成条件

    • 软件: Evolver 适配器(真实模型 + 确定性对照)、P1a 回放比较、配对与复跑、冻结与留出声明,以及 CPU 负例:越界修改、引用了被截掉的 capture、证据被篡改、预算耗尽、响应丢失(§4.5)、留出信息泄露、保留 H0。
      • 其中包括 david 提出的交付边界夹具:两条 verified capture,适配器在上下文上限处丢掉第二条;proposal 回执要绑定最终序列化的上下文,并把第二条列为省略项;引用第二条的修改即使源哈希仍然有效,也必须被拒绝。
    • 研究: 一份 P1 试点报告,在 acceptance issue 冻结的任务集上回答 §2 的问题 1 和 2。负面或不确定的结论同样算完成。
    • 软件测试通过不能替代研究结论;研究结论不能推广到其他模块或引擎服务性能。服务性能的主张仍然需要相应的 L4 证据。

    5. 后续阶段(本 RFC 只定方向,各自另开任务)

    阶段 内容 进入条件
    P2 第二个模块:优先 Analyzer(先补齐槽位抽象),也可以是 Evaluator 的快筛/扩测规则 P0 契约已验收;P1 报告已完成
    P3 跨任务经验:把冻结的 H1、适用条件和失败观察写入 K 的候选空间,在没参与开发的任务上做有/无对照 P1 至少产出一份完整报告;#509 的 P0 问题已修复
    P4 回到 v1 的大目标:在引擎真实任务(比如固定版本的性能回归诊断与修复)上改进多条规则的组合 P2、P3 有结论;有受控的 provider 配置和设备预算

    P3 的经验规则先写在这里,供后续冻结:

    • 复用 KnowledgeStore 的 create / update / history 版本化路径,不新建共享业务接口;需要扩展契约时回到 rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387/task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 的契约文档对齐。候选空间与 canonical catalog 隔离,不自动晋升为正式知识。
    • 经验按 trace step 粒度记录(motivation + outcome + 涉及的搜索空间项),父版本、引用证据和适用条件放在同一个对象里。同时必须通过冻结的污染规则,避免经验直接带着答案进入迁移任务。
    • 最终裁决(PASS / FAIL / INCONCLUSIVE / 保留 H0)只追加到经验历史,不改经验正文。被拒绝的候选,其经验能否进入库快照,在 P3 计划里冻结。
    • 失败观察(比如 OOM)要区分是可复现的配置上限,还是瞬时设备压力:记录失败阶段、实际负载与运行时、失败时的可用内存和资源争用。后续任务复用时,环境和配置必须匹配。单次 OOM 可以作为有范围限定的证据保留,但只有在隔离设备上用同样配置复现之后,才能变成跳过后续候选的规则。
    • 库关臂使用同样的 H0、K 查询接口、普通知识、模型和预算上限,只改变冻结的经验快照是否在范围内;两臂记录同样的读取和省略计数。

    6. 与相关工作的边界

    相关项 关系
    #689(已完成) 提供四职责边界和 Indexer 排序策略;P0 在它的基础上补候选规则的冻结与恢复
    #363 改的是搜索角色的参数,本 RFC 改的是四个模块的规则,两者互不替代。本阶段不涉及 #363 的实现与复用;预算、attempt 和恢复沿用 H 的现有规则,不另建账本。#363 已关闭,它记录的“真实 Agent/Skill 试点、跨任务收益”是否由本 RFC 承接,请 owner 确认
    #509 提供 Indexer 问题的真实证据;它的“送达断言”是 P1/P3 的前提
    #93 离线 MVP(harness-improvement.md) 沿用它的冻结、配对、强制复跑、留出只用一次和保留 H0 的纪律;不重开 #93
    #651、#697、#249 分别涉及 Executor 热更新、final 失败后继续、并行 lane;本 RFC 不改变它们的范围
    #387 / #371 #387 已按变更范围关闭,docs/contracts/ 仍是 Proposed 契约;本 RFC 遵循当前 D005(循环和停止规则归 H,Apps 不建第二个循环或重试策略)和 D008 的职责划分,不把它们当作已全部验收
    #543 C3 / #316 跟踪入口,只链接

    7. 范围与约束

    • 范围内: P0 规则槽位契约和 Indexer 实现;P1 的 Evolver 适配器、开发比较、冻结与留出验收、试点报告;P2–P4 的方向和进入条件。
    • 范围外: 自动改写 H/B 的控制器或评测规则;训练模型权重;首期演化可执行脚本、插件或 hook;在 P1 中修改 Indexer 以外的模块;自动合并或发布;自动把候选规则设为全局默认;自动晋升为正式知识;承诺复现上游收益。
    • 自动推进的授权边界: 在明确授权的范围内,可以不逐轮人工确认地推进,但不包括合并、晋升到 canonical skill 库、修改全局默认规则。
    • 预算分配: 最大轮数、各轮和各阶段的分配以及总预算都在搜索前冻结,循环运行中不重新分配。
    • 隔离: 哈希只能检测身份和漂移。执行隔离、可见文件和网络范围要由实现和试点环境实际证明,不能只靠提示词。

    8. 归属与授权

    • 提出人: @fake0fan;v1、v2 均由 agent 协助起草。
    • RFC owner: @fake0fan,负责维护本文并记录 §9 的决定。
    • P0/P1 实现者、P1 验收负责人: 待定,由 RFC owner 在开子 Issue 时指定;不会自动分配关联 Issue 的负责人。
    • 当前授权: 只覆盖修订和发布本设计提案。实现、模型和设备预算遵循各子任务的授权记录。

    9. 需要决定

    1. 是否接受分期:P0 规则槽位抽象 → P1 只做 Indexer → P2–P4?
    2. P1 的可编辑范围(6 个权重 + 取值边界)、两级开发反馈(P1a CPU 检索级 / P1b 任务级),以及“结果不确定时保留 H0、不追加探测”的规则?
    3. P1 的开发/留出任务集、Evolver 的模型(provider)、执行环境和 acceptance owner 分别是什么?
    4. [RFC] 基于 SpecRSI 的双循环 RSI:VATS 搜索与 GVO 改进器学习 #363 关闭时留下的“真实 Agent/Skill 试点、跨任务收益”是否由本 RFC 的 P3/P4 承接?

    10. 完成与关闭

    指定的 RFC owner 记录 §9 的决定,并给出 P0、P1 子任务的范围和负责人之后,即确认设计完成。关闭本 RFC 不改变任何关联任务的状态,也不代表功能已经实现、研究已有收益或 campaign PASS。

    11. v1 评审意见的处理

    评审 要点 v2 处理
    @amy-why-3459 #1 #387 是否已接受 §6:#387 契约仍是 Proposed,不当作已验收
    @amy-why-3459 #2 端口是否就绪 §1、§3;CandidateProvider 和 EvaluationPort 现已有实现,逐项验证放到 P0
    @amy-why-3459 #3 D005 引用 当前 D005 已包含“循环归 H、Apps 不建第二个循环”,§6 改为引用当前版本
    @amy-why-3459 #4 等预算计账 §4.4 预算按臂计账
    @amy-why-3459 #5 开发与留出隔离 §4.4;同任务复测要如实标注
    @amy-why-3459 #6 经验存储形态 §5 P3:复用 KnowledgeStore 版本化路径
    @amy-why-3459 #7 owner 与自动推进的边界 §7、§8
    @Dong1017 #1 两臂反馈一致 §4.4 三臂设计
    @Dong1017 #2 被拒候选的经验 §5 P3:裁决只追加到历史,是否入库快照在计划里冻结
    @Dong1017 #3 迁移任务不重叠 §4.4 不重叠规则;§5 污染规则
    @Dong1017 流程图 ① / ② OOM 观察能否复用;不确定时复测还是换候选 ① §5 P3(环境和配置须匹配);② §4.3 第 5 步、§7
    @david6666666(库关臂) 库关臂保留什么 §5 P3 最后一条
    @zengchuang-hw 适配器的输入输出;隔离、实际使用、恢复写成可执行用例 §4.3 第 3 步、§4.5 调用中断、§4.6 负例、§7 隔离
    @david6666666(记录作为输入) 用已记录引用作 proposer 输入;复用记录状态判定;按 trace step 粒度 §4.3 第 2、3 步;§5 P3
    @david6666666(交付边界夹具) 被截掉的 capture 不能被引用 §4.6
    @david6666666(OOM) 区分配置上限与瞬时压力 §5 P3
  2. amy-why-3459 commented on Nov 16, 2026

    @amy-why-3459
    Collaborator

    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.md and src/inferrsi/harness/{api,optimization,agent_sessions}.py are all present. I also read the Chinese copy in comment 6906878874. A few points I'd like to pin down before acceptance:

    1. 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.

    2. 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: ContextProvider exists in src/inferrsi/apps/context_provider.py with collect, and is covered by tests/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_candidate and EvaluationPort.execution_for / assess appear only in contract docs such as docs/contracts/current-design.md; there is no corresponding Python type in src/ or tests/. 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.

    3. 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.md on 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 in docs/contracts/function-owners.md under 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.

    4. 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.

    5. 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.

    6. 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. KnowledgeStore on main already has create / update / history on 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.

    7. 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.

  3. added
    kind:rfc
    on Nov 16, 2026
  4. Dong1017 commented on Nov 16, 2026

    @Dong1017
    Collaborator

    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:

    1. 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.

    2. 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.

    3. 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.

  5. david6666666 commented on Nov 16, 2026

    @david6666666
    Collaborator

    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.

  6. zengchuang-hw commented on Nov 17, 2026

    @zengchuang-hw
    Contributor

    独立技术检视(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. 三个值得写成可执行验收用例的接口。

    • 隔离与同起点: 从同一冻结源码、输入、环境和知识快照启动每个 probe;验证前一 probe 留下的文件、缓存、进程与网络状态不会被后继暗中继承。现有函数注释已说明 hashes 不是 OS sandbox。真实 adapter 应提供文件/网络隔离的失败测试,不应只扩大客户端类型白名单或靠提示词隐藏 final/答案。
    • 跨任务经验的实际使用: 当前 experience.json 在 holdout 前生成,方向正确,但它是离线审计记录,不是经验被下一任务消费的证据。建议下一任务回执记录冻结 library snapshot、实际检索并交付的条目 ID/hash、遗漏/截断和适用限制;library-on/off 的检索与上下文成本也纳入同一预算。未参与 dev 的任务上进行比较,保留负迁移,不把单任务结果称作迁移成功。
    • 恢复语义: 当前 results.mkdir() 消耗一次独占尝试,并明确无 retry/resume。若本 RFC 要求恢复幂等,需要新定义持久阶段台账与执行 ID:进程中断发生在“调用已提交但回执未落盘”时如何记账、能否重试、如何保持 final 只用一次。建议逐阶段故障注入,检查恢复不会重置总预算、重复执行 final 或把 final 结果送回改进器。这是新增设计要求,不是对当前明确离线边界的缺陷指控。

    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 插件弃用警告)。未运行完整仓库测试套件。

  7. david6666666 commented on Nov 17, 2026

    @david6666666
    Collaborator

    Read this next to the evidence the dashboard already records (the review surface landed in #483). Four notes, none blocking the direction:

    1. Make the recorded artifacts the proposer's input. Each round already has knowledge captures (per-item hashes, assembled text, query/scope, recorded use), optimization_trace steps (action / motivation / outcome / search_id) and experiment-timing.json steps. 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.

    2. 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".

    3. 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.

    4. 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.

  8. david6666666 commented on Nov 17, 2026

    @david6666666
    Collaborator

    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.

  9. Dong1017 commented on Nov 18, 2026

    @Dong1017
    Collaborator

    这张图不改变 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不自动晋升为正式知识]
    
    Loading

    ① 失败观察的使用资格。 如果最终方案未通过验收,但某次 probe 的 OOM 证据完整,是否允许后续任务在匹配环境与配置条件下使用它?这应与“最终方案有效”分开记录,不能把 OOM 自动推广成跨环境约束。

    ② 开发阶段的复测选择。 在总预算与控制器固定的前提下,现有工作方法怎样决定继续复测还是换候选?若需要改变预算分配策略,应另行确认是否属于本 RFC 范围,而不是默认加入。此问题不涉及在最终 holdout 上继续搜索。

  10. david6666666 commented on Nov 18, 2026

    @david6666666
    Collaborator

    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.

  11. added
    area:harness
    on Nov 25, 2026
  12. Dong1017 commented on Nov 26, 2026

    @Dong1017
    Collaborator
    image
  13. changed the title [-]rfc: 基于 Harness² 的真实 Agent 工作方法改进与跨任务经验复用[/-] [+]rfc: 基于 Harness² 的 Harness 规则改进循环——先抽象模块,再从 Indexer 起步[/+] on Nov 26, 2026
  14. fake0fan commented on Nov 26, 2026

    @fake0fan
    ContributorAuthor

    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:

    • The object of improvement narrows to replaceable rules in the four Harness modules from task: 明确 Harness loop 子组件边界,先抽出 Indexer 排序策略 #689 (Analyzer / Indexer / Executor / Evaluator), one rule per round, following the two-loop diagram posted above.
    • New prerequisite P0: a uniform rule-slot abstraction, so candidate rules can be frozen, delivered, resumed and replayed without code registration (today resolve_frozen_ranking looks policies up by name in a fixed registry).
    • P1 iterates only the Indexer ranking weights, with CPU replay of delivery as development feedback before real-agent task comparison and independent held-out acceptance. Analyzer, cross-task experience and real engine tasks move to P2–P4.
    • Every v1 review point is mapped to a section in §11. @amy-why-3459 @Dong1017 @david6666666 @zengchuang-hw please check whether the disposition matches your intent.

    RFC 已修订为 v2(英文正文已更新,中文版原地更新;v1 保留在编辑历史中)。主要变化:改进对象收窄为 #689 四个模块中的可替换规则,每轮只改一条;新增前置条件 P0(规则槽位抽象);P1 只迭代 Indexer 排序权重;Analyzer、跨任务经验和引擎真实任务移到 P2–P4。各位评审意见的处理见 §11,请确认是否符合原意。

  15. Dong1017 commented on Nov 26, 2026

    @Dong1017
    Collaborator

    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:

    • Matches: feedback parity (§4.4), rejected-candidate experience (§5 P3), disjoint transfer tasks (§4.4 and §5).
    • ① OOM reuse: §5 P3 keeps a scoped OOM observation separate from the final verdict. It becomes a skip rule only after reproduction on an isolated device. Add that reuse by later tasks needs a matching environment and configuration.
    • ② re-probe vs new candidate: §4.3 step 5 says an inconclusive result keeps H0 with no probes beyond the frozen allowance. It does not say whether an inconclusive round may propose a new candidate, and §7 does not exclude changing budget allocation.

    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.

  16. changed the title [-]rfc: 基于 Harness² 的 Harness 规则改进循环——先抽象模块,再从 Indexer 起步[/-] [+]rfc: Harness²-style rule improvement loop — abstract module rules first, start with the Indexer[/+] on Nov 26, 2026
  17. zengchuang-hw commented on Nov 26, 2026

    @zengchuang-hw
    Contributor

    NO PASS
    dot, acting for zengchuang-hw.

    回应这次 v2 对照邀请及我上轮的意见。P0 先做 Indexer 规则的完整冻结和回放、P1 将实际送达上下文与仅通过源哈希区分,并隔离调参与独立验收,均符合原意。离线代码已用排他结果目录消耗被中断的尝试,并先冻结最终候选再读取 holdout;但离线入口不调用真实 Evolver,不能证明它覆盖响应丢失。

    只剩一项需在 P1 验收设计中写清: 提交真实 Evolver 请求后、回执落盘前若进程中断,指出哪个现有 Harness 持久记录保留尝试身份与预算,以及无回执时恢复是停止,还是凭可核实的同一请求身份恢复。不要把未知当未调用或免费重发。可用 CPU 替身让提供方收到请求后丢弃响应,再重启核对计费次数、是否重发、恢复不会重置独立 final 的一次性约束,也不会把 holdout 回馈给提案侧。无需先新增账本或跑付费模型。

    本轮静态核对 v2 与现有冻结/离线控制器;上述真实调用路径尚未实现验证。此结论不阻挡已明确的 P0 设计,也不是 owner 接受或实施授权。

  18. fake0fan commented on Nov 26, 2026

    @fake0fan
    ContributorAuthor

    v2.1 — body and Chinese copy updated. I am the RFC owner for #460.

    • @Dong1017 ① OOM: §5 P3 now requires a matching environment and configuration for reuse by later tasks. ② An inconclusive result ends the round and retains H0; a later round may propose a new candidate within the frozen maximum rounds and total budget; allocations are frozen before search and not reallocated at run time (§4.3 step 5, §7).
    • @zengchuang-hw New §4.5: Evolver calls go through H's existing request record in agent_sessions.py (dispatching persisted before handoff, may_create=False on repeat dispatch, unbound requests accept only a definite not_created failure). 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。

  19. david6666666 commented on Nov 26, 2026

    @david6666666
    Collaborator

    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.

  20. amy-why-3459 commented on Nov 26, 2026

    @amy-why-3459
    Collaborator

    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.

  21. zengchuang-hw commented on Nov 26, 2026

    @zengchuang-hw
    Contributor

    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 接受或要求加标签。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:harnesskind:rfc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions