Skip to content

feat(harness): validate frozen generation feedback policy - #590

Merged
zengchuang-hw merged 4 commits into
mainfrom
codex/harness-586-feedback-policy
Nov 23, 2026
Merged

zengchuang-hw merged 4 commits into
mainfrom
codex/harness-586-feedback-policy

Conversation

@zengchuang-hw

@zengchuang-hw zengchuang-hw commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Refs #586 and #371. Authority: accepted bounded H implementation 7085395676.

When a trusted host opts in to a frozen feedback policy, H verifies original scope/check proof references before either generation provider is called. The existing no-policy path keeps its preparation identity/specification and host-precondition behavior.

  • Add keyword-only feedback_policy_ref, feedback_record_refs and artifact_reader using existing CampaignPlan/ArtifactRef/RecordRef contracts and H-owned fixed record reads.
  • Bind the full original policy Ref and ordered record Refs into opt-in preparation identity, retain policy bytes in existing storage and seal a normal generation input. Retained-policy recovery requires a committed delivered-context row; earlier interruption still needs the original policy through the reader. Changed preparation references conflict.
  • Verify prepared/protocol semantics, unique grants, producer/parent/attempt identity, exact requested proofs and actual bytes. Refuse unsupported rules, ambiguity, corruption/unavailability and reserved-role/path collisions.
  • Preserve DTOs/states/tables and H business-module isolation. Policy approval identity, arbitrary text and undeclared mixed feedback/final-only scope use remain host responsibilities.

Current head d6b01caa96d3982fcdd9713d8e8fabaece65af83 synchronizes actual main 3b1b4cebf0b2babba37758d3752aec59fdc9a41d, including #564 replay and #592 Apps views. Native main increment: seven files / +928 -20. The restricted opt-in and absent-policy paths remain distinguished in the newly merged feedback boundary/V25 documentation.

Validation on this head:

  • 285 tests and 289 subtests passed; two POSIX-only skips on Windows. Covers the now 34-case policy suite, original bounds/sealing, Apps generation/context/views/assess, H execution/replay/RunStore and boundaries/isolation.
  • Two new replay regressions remove or corrupt the retained policy after the original real CPU generation, expire the original deadline and retire the target. Same saved spec returns the original fixed RecordRef with fresh authorization, budget/deadline admission, worker start, claim and commit forbidden. Changed digest still produces RequestConflict@claim. The original record bytes and two-attempt/two-record counts remain fixed.
  • Whole-tree Ruff/whitespace passed. Fresh sdist → bare core wheel → clean environment → complete outside-checkout installed check passed.
  • An additional installed-core probe re-prepared from retained policy, ran the CPU generator, removed retained policy bytes, expired the clock and replayed the original Ref against a retired target. The generation/feedback/execution/RunStore files all match source/wheel/installed bytes. No Apps/Benchmark/Knowledge module loaded in the H-only child.
  • New Ready CI 45097680790 is running. Prior-head approvals are not reused.

This completes the explicit post-#564 replay-order verification for this bounded profile. Tests' preceding evidence record is a declared software control, not the full production B→H evidence chain or a service-performance claim. No unrestricted V25 or whole-#371 completion is claimed.

Root/Codex is author/integrator; Dong1017 is the actual H acceptance/accountable parent. Both are excluded from independent approvals. Parent technical checks should be COMMENTED. The ineligible owner approval on the prior head was dismissed while retaining its technical text; it cannot fill a native review slot. Require two distinct independent write+ current-head formal Approves with LGTM alone on the first nonempty line, required CI green, then squash to main. This Ready PR has no named Amy seat. DCO signed; exact runtime model/effort unavailable.

Add the accepted opt-in CampaignPlan scope/check profile over original retained proofs, preserve absent-policy identities, and seal the retained policy in the ordinary generation specification.

Agent-assisted-by: Codex (author)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

@Dong1017 已按 #586 接受的契约实现本切片,请复核范围与技术实现;你作为负责验收者的意见不计入独立批准数。

@jiangkuaixue123 @linyueqian @amy-why-3459 @david6666666 @hsliuustc0106 请对最终源码 40d251cac4bf02ffb2ecce6616e5a066b2179e3c 独立检视。重点检查:无 policy 路径字节兼容;固定 RecordRef 和完整原始 proof 引用授权;拒绝 final-only/越权/歧义及损坏来源时不调用两个 provider;policy 留存、同 attempt 冲突和安装包重放;保留混合 scope、审批身份及自由文本的明确限制。若接受,请正式提交当前 head 的 APPROVED,首个非空行准确为 LGTM,说明独立身份/授权及检视证据。有问题请先提出,我会处理后请求复审。两份合格独立批准及 CI 通过后 squash 合入。

181 tests / 289 subtests、重叠的 70 项迁移与策略检查、独立 core wheel 全检查和实际安装包 CPU 生成/重放已通过。软件控制 fixture 不作为生产链路验收。

Dong1017
Dong1017 previously approved these changes Nov 22, 2026

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

PR review verdict — PASS (code-reading review; tests and CI not run by me)
Reviewed base 0e6b4ea and head 40d251c. The diff is complete (diffComplete: true). prior-reviews.md has no formal reviews and no outstanding CHANGES_REQUESTED.

Eligibility. Under the #586 decisions, Dong1017 is the accountable owner and not an independent vote. This Dong-bot Approve is a scope-conformance and code-reading check and must not count toward the two required independent approvals. This is the same treatment as on #585. Two distinct eligible reviewers plus green CI are still required on this exact head.

Verified against the accepted #586 contract (7085218150 / 7085395676 / 7085383258)

  • Signature. generation.py adds only the keyword-only feedback_policy_ref=None, feedback_record_refs=() and artifact_reader=None.
  • Legacy digest. request_fields returns {} when there is no policy and no records, so preparation.update({}) adds no keys. The preparation digest stays byte-identical, and test_absent_policy_keeps_the_exact_legacy_preparation_identity recomputes it independently. Records without a policy are refused.
  • Order of checks. verify runs after _find_delivery and before _collect_delivery and plan_generation. The refusal tests install provider stubs that raise, and they also assert zero rows in generation_inputs.
  • Mapping. Plan allowed_feedback is treated as scope IDs and feedback_visibility as check IDs from required_evidence.
    • Duplicate scopes are refused.
    • Each record is read through the store at its RecordRef and compared in full. Run, owner and parent candidate are checked, and the record's prepared_ref and protocol_digest must match the plan.
    • Checks must match the producer, control domain, attempt, operation and scope.
    • Every requested Ref must equal an approved evidence_ref exactly (json_v1.encode equality), so a same-hash alternate location is refused.
    • Evidence and parent-candidate bytes are re-read from the store.
  • Identity projection. _semantic mirrors benchmark.preparation.protocol_digest and prepared_id. I read both: it strips only the typed ArtifactRef locations plus display_notes, created_at and prepared_id, and leaves Parameters semantic. The module does not import Benchmark at module level.
  • Final-only handling. Scopes the plan does not grant are refused by scope in policy["allowed_feedback"]. No label-string matching is used. The docs state the mixed-use limit.
  • Retention and InputSpec.
    • retain stores the original bytes at the existing object address. A failure maps to ExecutionPersistenceError at generation-seal with started=false.
    • _bind_generation_plan reserves the role and the path, case-folded and prefix-aware, and appends the policy input only for opt-in calls.
    • Reprepare reads the retained bytes via run_store.object_location, with no current fallback.
  • Error mapping. The mapping matches the accepted table (UnsupportedSchema, UnsupportedRuleVersion, IdentityMismatch, ArtifactUnavailable and ArtifactIntegrityError). The changed-authorization test expects RequestConflict at delivered-context-retention.
  • Docs. The contract doc and the operations.md row say "host precondition, not proved by H" and state the limits: policy approver identity, free-text channels, mixed scope use, and the #564 ordering not yet claimed. The tests label their records as controls, not production-worker evidence.

Not verified here

  • I did not run the tests or the child-process import test. I did not see CI results.
  • I did not confirm RunStoreReader.committed/open behaviour or the _input_errors and _has_fields helpers beyond reading the call sites.
  • I did not check overlap with #585 retention or a rebase onto the current main.
  • Optional follow-up: the Delivered / Verified / Limits card still needs the production-integration evidence listed separately from these control samples.

I won't re-review automatically after this Approve. Mention @Dong1017 if a later push needs another look.


@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

本 PR 给「生成准备」接口 prepare_generation 加了一套可选的冻结反馈策略校验(冻结 = 用事先定死的策略和证明引用,不允许临时改口):

  • 调用方若传入策略引用(feedback_policy_ref)、固定评估记录引用(feedback_record_refs)和制品读取器,Harness(执行支架)会在调用上下文/候选两个 provider(提供方)之前,核对:策略允许的校验范围、可见检查项、父候选身份,以及请求里的反馈引用是否等于原始检查证明。
  • 校验通过后,把策略原文留存在现有 Store,并作为角色 generation_feedback_policy、路径 inputs/generation-feedback-policy.json 的输入封进生成规格。
  • 不传策略时,准备摘要(preparation digest)和规格行为与原来完全一致;只传记录不传策略会直接拒绝。
  • 新增契约文档与 32 组左右的拒绝/重放/边界测试;未引入新的对外 DTO、状态表,也未在运行时拉入 Apps/Benchmark/Knowledge。

对照 #586 已接受契约与 head 40d251cac4bf02ffb2ecce6616e5a066b2179e3c 的 diff(5 个文件,+840/−3)做了通读。

明显问题或风险

未发现影响正确性、安全或已声明行为的实质缺陷。

非阻塞提醒:

  1. 策略角色/路径冲突要等候选 provider 给出 plan 后才能检出(文档已写明);在此之前策略字节可能已留存,但不会提交 generation-plan,与说明一致。
  2. 同一 scope 里若策略作者混用「可反馈检查」和「仅终验」意图,本切片按契约不做推断,仍是宿主/策略作者责任。
  3. 作者已提示:若 #585/#587 先合入,或 #564 落地后,需再核对重叠处与重放顺序;当前基于 main 0e6b4ea9 可独立判断,不视为未合入前置依赖挡住本 diff。
  4. 审查时部分 CI(如 full-check)仍在跑;合入仍须满足仓库要求的 CI 与第二份独立批准。

结论

批准(APPROVE)。

理由:opt-in 与 legacy 路径隔离清楚;拒绝路径在 provider 调用前失败关闭;身份/完整性/唯一性/保留冲突行为与契约和测试覆盖一致;模块边界干净。

独立身份:@jiangkuaixue123,非作者、非 #586 验收负责人;基于当前 head 源码与测试通读,不计入 Dong1017 的验收意见。

@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice labels Nov 22, 2026

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

本 PR 给 Harness(跑生成任务的本地执行层)的 prepare_generation 加了一条可选的「冻结反馈策略」校验:

  1. 新增三个仅关键字参数:feedback_policy_ref(策略制品引用)、feedback_record_refs(固定评估记录引用列表)、artifact_reader(只读打开制品)。
  2. 未传策略时,准备身份(preparation digest)和既有行为保持不变——兼容老调用。
  3. 传了策略时,在调用 context/candidate 两个 provider 之前核验:策略与记录的身份绑定、授权 scope/check、原始 proof 字节;拒绝越权/歧义/损坏来源;把核验过的策略留存并封进生成输入(角色 generation_feedback_policy)。
  4. 配套契约文档、operations 索引,以及约 32 类失败闭合用例。

问题与风险

未发现影响正确性、安全或已声明行为的实质缺陷。

非阻塞备注:

  • 文档写「重新准备时读已留存的策略字节」;实现里仅在已有 delivery(上次准备成功封存)时走 store 重读。若上次在 retain 之后、delivery 之前失败,重试仍依赖原始 artifact_reader。建议文档补一句失败半截路径,避免宿主误删 reader 侧策略源。
  • _semantic 在 Harness 内自建了一份与 Benchmark prepared_id 平行的语义摘要逻辑(刻意不 import Benchmark)。长期需靠契约/夹具防漂移;当前测试已覆盖语义不一致 fail-closed。
  • PR 说明里对 #564 / #585 / #587 的后续同步提醒合理;当前基于 main 的 diff 可独立审查,不构成阻断。

结论

批准(APPROVE) head 40d251cac4bf02ffb2ecce6616e5a066b2179e3c。

理由:无 policy 路径字节兼容;opt-in 路径在 provider 前 fail-closed;RecordRef/proof 全量相等校验(同 hash 不同 location 不可互换);角色/路径保留名冲突会拒绝且不提交 generation-plan;测试覆盖拒识、冲突重放、留存失败、模块边界隔离。独立身份审查,非作者/验收负责人。

Agent-assisted-by: Codex (author)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

已处理 @jiangkuaixue123 在 6014622529 的恢复边界建议,当前 head 96f7605580b7033c10fc3efbeb6f5d1fe728a557。仅契约文档 +3 行:必须已有 committed delivered-context row,才可从 H 已留存 policy 恢复;若只有 policy object 留存成功,collection/封存尚未提交,重试仍依赖原 reader 侧 policy 字节。与 delivery is not None 的实际分支一致。源码和测试相对 40d251ca 字节未变,原验证保留,当前头 diff/whitespace 检查通过;新 Ready CI 待完成。

第二点语义摘要维护风险已记录:H 不导入 B,当前用实际 B prepared/protocol 夹具与语义变更拒绝用例对照,后续契约改变须同步,未增加共享 DTO 或跨模块依赖。

@jiangkuaixue123 @Dong1017 请复核此次文档修正后的当前头;旧头批准不计入新头有效票。Jiang 的独立授权沿用 #582 6013958180 的维护者 standing delegation,本头仍需两个不同的独立 write+ 账号。@linyueqian @amy-why-3459 @david6666666 @hsliuustc0106 请完成实际独立检视,通过时当前头正式 Approve 首个非空行单独 LGTM。Dong 技术票、作者票均排除。

Dong1017
Dong1017 previously approved these changes Nov 22, 2026

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

PR review verdict — PASS (code-reading review; I did not run tests or CI)
Reviewed base 0e6b4ea and head 96f7605. The diff is complete (diffComplete: true).

Eligibility. Under the #586 decisions, Dong1017 is the accountable acceptance owner and not an independent vote. This Dong-bot Approve is a scope and code-reading check. It does not count toward the two required independent current-head approvals. The same treatment applied on #585 and on the earlier #590 Approve at 40d251ca. That Approve is dismissed on this head. Merge still needs two distinct independent write+ LGTM Approves on this exact head and green required CI. If #585 or #587 lands first, sync and re-check as the PR body says.

Prior review state. No formal Approve exists on this head. There is no outstanding CHANGES_REQUESTED. jiangkuaixue123's approvals are on 40d251ca, so they do not carry to this head.

What changed since 40d251ca. The author says source and tests are byte-identical and that only 3 doc lines were added. The diff is consistent with that. The 3 lines are in docs/contracts/generation-feedback-policy.md: "Retained-policy recovery requires a committed delivered-context row. If policy object retention succeeded but context collection or delivery sealing failed, repreparation still needs the original policy bytes through artifact_reader."

Checked against the code

  • The doc matches generation.py. delivery = store._find_delivery(...) runs first. Then generation_feedback.verify(..., retained=delivery is not None) reads the retained object through the store, using run_store.object_location(store.namespace, sha256). Otherwise it reads through artifact_reader. _collect_delivery runs only after verify and retain.
  • This resolves jiangkuaixue123's non-blocking recovery-boundary point from review 6014622529. A host will not delete the reader-side policy source after an interrupted first preparation.
  • Contract checks from the first pass still hold in the diff:
    • Signature: only keyword-only additions.
    • Legacy path: request_fields returns {} with no policy, so the preparation digest gets no new keys. test_absent_policy_keeps_the_exact_legacy_preparation_identity recomputes it.
    • Order of checks: verification runs before either provider call. The refusal tests install raising provider stubs and assert zero generation_inputs rows.
    • Proof references: a requested feedback Ref must equal an authorized check evidence Ref in full, so a same-hash alternate location is refused.
    • Reserved input: the policy role and path are reserved, including casefold prefix collisions.

Non-blocking, not requested for this head

  • _semantic in generation_feedback.py duplicates the Benchmark prepared_id semantic digest logic, on purpose, so Harness does not import Benchmark. The author has recorded the drift risk. The semantic-change fail-closed fixtures are the guard, and the contract change must stay synchronized.
  • Mixed granted and final-only checks in one scope, approver identity and free-text channels are explicit trusted-host limits. They are not claimed as H enforcement.

Not verified by me: test execution, the installed-wheel probe and CI status. The 181-test and 289-subtest validation applies to 40d251ca source. I am relying on the byte-identical runtime and test files and on the independent approver's reading.


@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

相对已审过的 40d251ca,本头 96f76055 只改契约文档 docs/contracts/generation-feedback-policy.md(+3 行),运行时与测试字节未变。

新增说明对齐实现分支:只有已存在 已提交的 delivered-context 行(committed delivery)时,重新准备才能从 Store 里读回已留存的策略字节;若策略对象已留存、但上下文收集或 delivery 封存尚未成功,重试仍必须通过原始 artifact_reader(制品只读口)提供策略。这与 prepare_generation 里 retained=delivery is not None、以及 generation_feedback.verify 在 retained 时改走 object_location 的路径一致,补上了此前审查里提到的半截失败边界。

功能本身(相对 main)仍是:给 prepare_generation 增加可选的冻结反馈策略校验——事先定死的策略与证明引用,在调用两个 provider(上下文/候选提供方)之前核对授权,通过后留存并封进生成输入;不传策略时旧行为与准备摘要不变。

明显问题或风险

未发现影响正确性、安全或已声明行为的实质缺陷。文档修正准确,无新运行时风险。

非阻塞提醒:合入仍须仓库要求的 CI 与第二份独立批准;若 #585/#587 先合或 #564 落地,需再核对重叠与重放顺序(作者已声明)。

结论

批准(APPROVE) head 96f7605580b7033c10fc3efbeb6f5d1fe728a557。

理由:相对前一头仅为文档澄清且与代码一致;前一头已通读的 opt-in/legacy 隔离、provider 前 fail-closed、RecordRef/proof 全量相等、保留名冲突与测试覆盖仍然成立。独立身份:@jiangkuaixue123,非作者、非 #586 验收负责人。

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

相对上一版已审 head 40d251ca,本头 96f7605580b7033c10fc3efbeb6f5d1fe728a557 仅契约文档 +3 行:明确「从已留存策略恢复」必须以已提交的 delivered-context 行为前提;若策略对象已留存、但上下文收集/封存尚未提交,重试仍需通过原始 artifact_reader(制品只读口)提供策略字节。运行时与测试相对 40d251ca 字节未变。

整份 PR 仍是给 prepare_generation 增加可选「冻结反馈策略」校验:无策略时准备身份(preparation digest)与旧行为一致;有策略时在调用两个 provider(提供方)前 fail-closed(失败即关,不往下走),核对 RecordRef/原始 proof,留存策略并封进生成输入。

对照实现:generation.py 里 retained=delivery is not None,generation_feedback.verify 仅在有 delivery 时走 store object_location 重读,否则读 reader——与新增文档一致。

明显问题或风险

未发现影响正确性、安全或已声明行为的实质缺陷。先前关于恢复边界的文档缺口已补齐。

非阻塞提醒:合入仍须满足仓库 CI 与第二份独立批准;若 #585/#587 先合入或 #564 落地,需再核对重叠与重放顺序。

结论

批准(APPROVE) 当前头 96f7605580b7033c10fc3efbeb6f5d1fe728a557。

理由:文档修正与实现分支一致;运行时/测试无新改动;opt-in 与 legacy 隔离、拒绝路径与身份/完整性校验仍成立。独立身份 @jiangkuaixue123,非作者、非 #586 验收负责人。

@zengchuang-hw
zengchuang-hw requested review from hsliuustc0106 and removed request for hsliuustc0106 November 22, 2026 22:41
@Dong1017

Copy link
Copy Markdown
Collaborator

@zengchuang-hw this PR now conflicts with main after #585 and #587 were merged (overlap in src/inferrsi/harness/generation.py and docs/operations.md). Could you rebase onto the latest main and resolve the conflicts? It's otherwise ready to merge (approved, checks were green).

Refs #586 and #590. Agent-assisted-by: Codex (author/integrator)

Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

@jiangkuaixue123 @david6666666 @amy-why-3459 @linyueqian @hsliuustc0106 #585/#587 已进入实际 main,现已处理重叠并推送 75f8f03361eaafa0112358bf429c47451aa7d2bd,请对新头七文件 / +870 -20 独立复审。运行时代码合并保留原界限,文档已将 #587 的笼统无策略约束限定到 absent-policy 路径,并保留 opt-in 的 policy approval/free-text/mixed-scope 限制。165 tests / 289 subtests 通过、2 POSIX skips,Ruff、新 bare-core wheel 完整 outside-checkout check 通过,新 Ready CI 运行中。请按实际 diff/消费者给 PASS 或 DO NOT PASS,不预设结论,旧头批准不计票。作者和 @Dong1017 父责任人排除,需两名不同 write+ 当前头正式 LGTM/Approve;代理身份/授权需可归属,Jiang 既有授权见 #582 review 6013958180。

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

本 PR 给 Harness(本地执行支架)的 prepare_generation(生成准备入口)增加可选的「冻结反馈策略」校验(冻结 = 事先定死的策略与证明引用,不允许临时改口):

  1. 新增三个仅关键字参数:feedback_policy_ref(策略制品引用)、feedback_record_refs(固定评估记录引用列表)、artifact_reader(只读打开制品)。
  2. 无策略时:准备身份(preparation digest)与规格保持旧行为;反馈授权仍是宿主前置责任,H(Harness)不声称已证明。
  3. 有策略时:在调用上下文/候选两个 provider(提供方)之前 fail-closed(失败即关,不往下走):核对 CampaignPlan(活动计划)授予的 scope/check、原始 RecordRef(记录引用)与 proof(证明)字节;通过后把策略留存并封进普通生成输入(角色 generation_feedback_policy,路径 inputs/generation-feedback-policy.json)。
  4. 契约文档区分「无策略宿主边界」与「受限 opt-in 档案」;operations.md 在合入 #585/#587 后明确两条封存路径。

当前头 75f8f03361eaafa0112358bf429c47451aa7d2bd 已与 main(含 #585 原始 bounds 封存、#587 可信宿主边界)同步。相对已审过的 96f76055:核心模块 generation_feedback.py 与策略测试套件字节未变;generation.py 在保留 opt-in 策略输入的同时接入 main 的 original_bounds 封存;文档冲突已按「无策略 / 有策略」拆开写清。恢复边界仍成立:只有已提交的 delivered-context 行才可从 Store 重读留存策略,否则仍依赖原始 artifact_reader。

明显问题或风险

未发现影响正确性、安全或已声明行为的实质缺陷。

非阻塞提醒:

  • 合入仍须仓库要求的第二份独立批准与 CI 全绿(本审时 full-check 仍在跑)。
  • #564 落地后需再核对重放顺序(作者已声明,不阻塞本切片)。
  • _semantic 与 B(benchmark)侧语义摘要仍是对照维护,后续契约变更须同步。

结论

批准(APPROVE) 当前头 75f8f03361eaafa0112358bf429c47451aa7d2bd。

理由:opt-in 与 legacy 隔离清楚;拒绝路径在两个 provider 之前;身份/完整性/保留路径/角色路径保留字检查与文档一致;与 main 的 bounds 合入未破坏策略封存语义。独立身份 @jiangkuaixue123,非作者、非 #586 验收负责人。

Dong1017
Dong1017 previously approved these changes Nov 23, 2026

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

PR review verdict — PASS (code-reading review; I did not run tests or CI)
Reviewed base 5325147 and head 75f8f03. The diff is complete (diffComplete: true, 7 files).

Eligibility. Dong-bot (authorized delegate) is posting as the accountable owner of #586/#590. Under my earlier #585 and #590 decisions, this Approve is a scope and code-reading check. It does not count toward the two required independent current-head approvals. jiangkuaixue123 has an Approve on this exact head. A second distinct independent write+ LGTM on 75f8f033 and green required CI are still needed before squash. No CHANGES_REQUESTED is outstanding.

What changed relative to the reviewed 96f76055. This is the sync with main after #585 and #587 merged. I read the merged result of generation.py at the head.

  • Signature. prepare_generation adds only the keyword-only feedback_policy_ref=None, feedback_record_refs=() and artifact_reader=None.
  • Legacy digest. request_fields returns {} with no policy and no records, so preparation.update({}) adds no keys. Records without a policy are refused. The legacy preparation digest is therefore unchanged. test_absent_policy_keeps_the_exact_legacy_preparation_identity recomputes it independently.
  • Order of checks. _find_delivery runs first, then verify and retain, and only then _collect_delivery and plan_generation. Refusals therefore happen before either provider is called. The refusal tests install raising provider stubs and assert zero generation_inputs rows.
  • Merge with #585. _bind_generation_plan appends the policy InputSpec before the generation-plan input. request_digest(spec) and the bounds are computed afterward, and _seal_generation_input(..., original_bounds=encode(bounds)) is still used. The policy input is therefore part of the digest that main's original-bounds snapshot binds. The bounds fields (attempt_id, run_id, owner, deadline_utc, budget, generation_plan, request_digest) are untouched by the opt-in path.
  • Reserved role and path. The role check and the casefold prefix check in both directions run before the append. They apply only to opt-in calls, so legacy callers keep their existing behavior.
  • Runtime module. generation_feedback.py is new in this PR. The author says it is byte-identical to the already-approved head, and I found nothing in the diff that contradicts that.
  • Docs after #587. The statements are now scoped correctly:
    • generation-feedback.md limits "does not enforce" to calls without feedback_policy_ref.
    • schema-and-semantics.md says the same for the V25 boundary.
    • operations.md splits the row into an opt-in profile and a no-policy trusted-host path.
    • Policy approval identity, free text and unexpressed mixed scope stay explicitly host responsibilities.
    • There is no unrestricted V25 or whole-#371 claim.

Non-blocking, unchanged.

  • The _semantic identity logic in H is a deliberately parallel copy of B's, so it needs a coordinated update if the contract changes.
  • After #564 lands, re-verify the replay ordering against main, as the PR body says.
  • Tests use controlled software fixtures, not production B→H evidence, and I make no performance claim.

Not verified by me. I did not execute the 165 tests / 289 subtests, Ruff, or the bare-core wheel check. I did not see the Ready CI result. I rely on the author's statement and on Jiang's review for those.


Copy link
Copy Markdown
Contributor Author

@hsliuustc0106 请求接手当前头 75f8f03361eaafa0112358bf429c47451aa7d2bd 的第二份独立检视。已同步实际 main/#585/#587,七文件增量;新 Ready CI 刚完成全部成功。Jiang 的 6015311241 是一份有效独立批准,Dong owner 技术票明确不计。165 tests / 289 subtests、2 POSIX skips,fresh core wheel 完整检查及安装包真实 generation/reprepare/replay、source/wheel/installed 字节核对均通过。请按实际源码、消费者和证据给独立结论,有意见先修;通过时用本头正式 Approve、第一非空行单独 LGTM,代理请记录身份/授权。这份可以独立合入,不必等待 #564,但其入 main 后仍要复验重放顺序。

Copy link
Copy Markdown
Contributor Author

@hsliuustc0106 新主线兼容预检已完成:#592 已进入 actual main ecd63513f752ffb9459f7565e2ea08664b824cda,与当前策略头 75f8f03361eaafa0112358bf429c47451aa7d2bd 的 merge-tree 无冲突。公开两源组合的本地隔离树上,32 项反馈策略控制、新 generation views / 全展示面、Apps assess 与模块边界/隔离组 140 passed / 289 subtests。源码头和七文件增量未变,原 Ready CI 全绿;这不等于本 PR 已交付 main,也不把软件控制前序记录说成生产 B→H 证据。

仍缺第二名独立 write+ 当前头正式代码批准,Jiang 一票、作者/Dong 实际 H 父责任技术票排除。请实际检视给结论,有意见先修;#564 合入后重放顺序复验仍保持。

@zengchuang-hw
zengchuang-hw dismissed Dong1017’s stale review November 23, 2026 01:43

Accountable-owner technical self-check, explicitly excluded from independent approvals by this review's Eligibility section and #586 delegation. Dismissing its approval status under docs/agent-collaboration.md so the native counter cannot mistake it for the second independent vote. Technical review text/findings remain visible; future owner checks should be COMMENTED.

Refs #586 and #590. Replay the original record after retained policy damage, expired deadline and target retirement, with no fresh authorization or worker.

Agent-assisted-by: Codex (author/integrator)
Signed-off-by: zengchuang <zengchuang3@huawei.com>

Copy link
Copy Markdown
Contributor Author

@jiangkuaixue123 @hsliuustc0106 @david6666666 @amy-why-3459 @linyueqian 请求对新头 d6b01caa96d3982fcdd9713d8e8fabaece65af83 独立复审:已同步 #564/#592 所在 actual main,七文件增量;285 tests / 289 subtests、2 POSIX skips,新 core wheel 完整检查及安装包“策略原 Ref 恢复→真实 CPU generation→留存策略移除/过期/退役后原 Ref replay”通过,四个 H 文件字节一致。新 Ready CI 45097680790 运行中。

原要求的 #564 主线后重放顺序复验已用两项新增故障回归补齐。旧头批准不继承,当前需两名独立 write+ 本头正式代码批准,没有 Amy 实名席位。请读取实际 diff/接受范围/消费者,给独立结论,有意见先修。@Dong1017 是真实 H 父责任人,技术意见请 COMMENTED,不提交可误计票的 APPROVED;此前非独立状态 dismissed 的技术全文保留。代理检视请注明身份/授权(Jiang 的既有来源见 #582 review 6013958180)。

@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Dong1017 technical check on d6b01caa, posted as a comment only (Dong-bot, authorized delegate). I found no blockers in the diff. This is not an Approve and does not count toward the two independent LGTMs. It follows the recorded #371 line (7089393818): owner technical checks are COMMENTED, and parent-responsibility Approves on this PR were dismissed.

Current-head state: there is no formal APPROVED review on this head and no outstanding CHANGES_REQUESTED. Two independent write+ Approves with LGTM on the first line, plus green CI 45097680790, are still required.

Details

Code-reading only. Base 3b1b4ceb, head d6b01caa, diff complete (seven files). I did not run tests or CI and did not read execution_service.

Checked in the diff

  • Signature. prepare_generation adds only the keyword-only feedback_policy_ref, feedback_record_refs and artifact_reader.
  • Legacy digest. request_fields returns {} when there is no policy, so the preparation digest is unchanged. Records without a policy are refused. test_absent_policy_keeps_the_exact_legacy_preparation_identity recomputes the digest independently.
  • Order of checks. _find_delivery runs first. Then verify and retain run. Only after that do _collect_delivery and plan_generation run. The refusal tests install providers that raise, and they assert zero generation_inputs rows.
  • Authorization.
    • Granted scopes must exist in the policy.
    • Prepared and protocol semantic identities are checked.
    • Check producer, attempt, operation and scope must match the frozen requirement.
    • Every requested feedback Ref must equal an original proof Ref in full. A same-hash, different-location Ref is refused (alternate-ref test).
  • Recovery. retained=delivery is not None matches the doc: only a committed delivered-context row allows re-reading the retained policy.
  • Reserved role and path. The check runs after the provider plan is available, and the casefold prefix check goes both ways. The role, path and casefold-prefix tests cover it.
  • New fix(harness): preserve evaluation limits and replay original attempts (PR-3) #564 replay regressions. These match the contract's claim that replay comes before fresh authorization. The tests make verify, _budget, _deadline_seconds, _supervise, claim and commit forbidden after the retained policy is removed or corrupted. They also advance the clock and use a retired target. The original record_ref is returned, and a changed deadline gives RequestConflict@claim.

Non-blocking

  • _semantic mirrors the B-side digest by hand. Contract changes must update both.
  • A visible check's status is not constrained to passed. That is consistent with the contract, which states no such rule.
  • Both of these are already acknowledged in the PR or earlier reviews.

I have not seen CI 45097680790 finish.

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

改了什么

本 PR 给 Harness(本地跑生成任务的执行支架)的 prepare_generation(生成准备入口)增加可选的「冻结反馈策略」校验(冻结 = 事先定死的策略与证明引用,不允许临时改口):

  1. 新增三个仅关键字参数:feedback_policy_ref(策略制品引用)、feedback_record_refs(固定评估记录引用列表)、artifact_reader(只读打开制品)。
  2. 未传策略时:准备摘要(preparation digest)与原先字节兼容;反馈是否合法仍是宿主(调用方)自己的前置责任。
  3. 传入策略时:在调用上下文/候选两个 provider 之前,用固定 RecordRef(不可变版本记录指针)核对 scope/check 授权与原始 proof 引用;拒绝越权、歧义、损坏或不可用的来源,且此时不会启动 worker。
  4. 通过后把策略字节留存在 Store,并以保留角色 generation_feedback_policy / 路径 inputs/generation-feedback-policy.json 封进普通 generation InputSpec;角色或路径冲突会拒绝,且不会提交 generation-plan。
  5. 相对上一已审头 75f8f033,本头 d6b01caa 运行时 generation.py / generation_feedback.py 字节未变;主要是同步已合入的 #564 重放与 #592 Apps 视图,并补上两项「已注册请求在留存策略缺失/损坏时仍先按原固定 RecordRef 重放、不走新鲜授权/执行」的回归,以及契约文档对齐。

明显问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

非阻塞提醒(可合入后跟进):

  • H 侧 _semantic 与 Benchmark 的语义摘要是并行实现,契约若再变需要两边同步。
  • 测试前序证据是声明的软件控制夹具,不是生产 B→H 全链路验收;作者已在 PR 说明中写明。
  • Ready CI 的 full-check 在审阅时仍有任务进行中;合入仍以当前头 CI 全绿为准。

结论

批准(APPROVE)。 理由:opt-in 与 absent-policy 路径区分清楚;校验顺序在 provider 之前;精确 Ref 相等、留存/封存、角色路径预留与 #564 重放短路行为与接受的 #586 契约一致;本头相对已审实现无运行时回退,新增回归补齐了声明的重放顺序复验。

独立审查身份:@jiangkuaixue123(write+);检视证据:当前 head d6b01caa96d3982fcdd9713d8e8fabaece65af83 相对 base 3b1b4cebf0b2babba37758d3752aec59fdc9a41d 的七文件增量,以及相对上一已审头 75f8f033 的文档/测试增量。

Copy link
Copy Markdown
Contributor Author

Codex / integrator: current head d6b01ca now has all required Ready checks green (45097680790), including bare installed core on 3.10/3.11; advisory host jobs also succeeded. Jiang's 6015874669 is one valid independent actual-head code approval. @david6666666 @linyueqian @hsliuustc0106 please independently review the seven-file main-based increment and its post-#564 missing/corrupt-policy replay tests. If your verdict is PASS, use the normal formal LGTM Approve; please raise concrete findings otherwise. A second distinct eligible vote is still required; owner commentary is not a vote.

Copy link
Copy Markdown
Contributor Author

Codex / integrator,按用户本次“向所有 committer 寻求检视”的要求更新请求。

@amy-why-3459 @Bounty-hunter @david6666666 @Dong1017 @jiangkuaixue123 @linyueqian @hsliuustc0106

请检视当前头 d6b01caa96d3982fcdd9713d8e8fabaece65af83(base: main),实际范围、委托、验证证据和历史失败保留在 PR 正文及前文。

当前头全部 CI 已绿,Jiang 有一份有效本头独立批准;还需第二个独立 write+ 账号的正式代码检视。真实 H 父责任人 Dong 的自检不计独立票。

请先提出并处理具体意见;若独立审查结论为 PASS,请按仓库规则提交第一非空行为独立 LGTM 的正式 Approve。每账号一次,作者/实质贡献者/实际父责任人的技术自检请用 COMMENTED;scope comments 不计代码批准。达到该 PR 的实际主线前置、两份有效独立批准及必需 CI 条件后才 squash。

账号按链接核对:dengyunyang 对应 @Bounty-hunter,WeiQing Chen 对应 @david6666666。本次只扩大检视请求范围,不更改既有验收/席位条件。

@Dong1017

Copy link
Copy Markdown
Collaborator

Parent technical self-check on head d6b01caa96d3982fcdd9713d8e8fabaece65af83 (base 3b1b4cebf0b2babba37758d3752aec59fdc9a41d): no blockers. Posted as COMMENTED. Dong-bot (authorized delegate) for the H accountable parent; this stays outside the two independent approval seats. Existing acceptance and seat conditions are unchanged.

Current-head review state:

  • Weighed @jiangkuaixue123 APPROVED on this exact head (feat(harness): validate frozen generation feedback policy #590 (review), first line LGTM). That is one valid independent write+ code review.
  • No outstanding CHANGES_REQUESTED. Earlier Dong1017 Approves stay dismissed and do not fill a slot.
  • One more distinct independent write+ formal Approve is still required, first non-empty line exactly LGTM. Author, material contributors, and the H parent are excluded. Widening the request to @amy-why-3459, @Bounty-hunter (dengyunyang), @david6666666 (WeiQing Chen), @linyueqian, and @hsliuustc0106 adds reviewers only. There is no named Amy seat. @jiangkuaixue123 already holds the one current-head vote, so a second account is the open seat.
  • The triggering comment reports required CI run 45097680790 green on this head, including bare installed core. I did not re-run those checks.

Same-head code reading in #590 (comment) still stands: keyword-only opt-in signature, legacy preparation digest, verify/retain before the two providers, retained-policy recovery only with a committed delivered-context row, reserved role/path refusal, and the two post-#564 replay regressions (missing or corrupt retained policy returns the original RecordRef and forbids fresh authorization and execution). I am not re-opening those as findings.

Non-blocking, unchanged: H _semantic stays a hand-maintained parallel of the Benchmark digest; the recorded tests are a declared software control, not a production B→H or service-performance claim.

Squash waits on that second eligible current-head Approve and required CI remaining green.

@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

No new formal review from Dong1017 on d6b01caa. The owner technical check is already posted as COMMENTED, and an Approve from this account would not count as an independent vote. I found no blockers in the diff, and nothing is outstanding from Dong1017.

Dong-bot (authorized delegate) is following the recorded #371 line (7089393818) and the #597 rule. Dong1017 is the H accountable parent, so this account's technical checks go in as COMMENTED, not Approve.

  • State on this head: @jiangkuaixue123 has one valid independent APPROVED review (6015874669). No CHANGES_REQUESTED is outstanding.
  • Still open: one more distinct independent write+ reviewer, not the author or Dong1017, must submit a formal Approve whose first line is LGTM. The required CI run (45097680790) must stay green.
  • My earlier checks: the comment 7089726793 and Dong1017's by-hand 7091327548 still stand. I re-read the full seven-file diff and have nothing to add.
Details

Base 3b1b4ceb, head d6b01caa. This is code-reading only. I did not run tests and did not see CI finish.

  • Signature and legacy path: feedback_policy_ref, feedback_record_refs and artifact_reader are keyword-only. request_fields returns {} with no policy, so the preparation digest is unchanged.
  • Opt-in order: verify and retain run after _find_delivery and before _collect_delivery and plan_generation.
  • Authorization: every requested feedback Ref must equal an original check proof Ref in full.
  • Recovery: retained=delivery is not None matches the contract's rule that only a committed delivered-context row allows retained-policy recovery.
  • Replay tests: the two missing/corrupt-policy tests cover the fix(harness): preserve evaluation limits and replay original attempts (PR-3) #564 replay order.
  • Non-blocking, unchanged: _semantic is a hand-maintained parallel of the Benchmark digest. The test fixtures are a software control, not production B→H evidence.

@Dong1017

Copy link
Copy Markdown
Collaborator

No additional formal review on head d6b01caa96d3982fcdd9713d8e8fabaece65af83. Dong1017 is the H accountable parent, so this account's technical check stays a comment. It stays outside the two independent approval seats. Dong-bot (authorized delegate), following the recorded #371 line (7089393818) and the #597 rule.

Current head, base 3b1b4cebf0b2babba37758d3752aec59fdc9a41d:

  • @jiangkuaixue123 has one valid independent APPROVED review on this exact head (6015874669, first line LGTM).
  • No CHANGES_REQUESTED is outstanding. Earlier Dong1017 Approves stay dismissed and do not fill a slot.
  • Still open: one more distinct independent write+ reviewer, not the author or Dong1017, must submit a formal Approve whose first non-empty line is LGTM. Widening the request adds reviewers only. There is no named Amy seat.
  • Required CI run 45097680790 is reported green on this head, including bare installed core. I did not re-run those checks.

Comments 7089726793 and 7091327548 still stand. Same-head reading of the seven-file diff found no blockers: keyword-only feedback_policy_ref / feedback_record_refs / artifact_reader, absent-policy request_fields returning {}, verify and retain after _find_delivery and before the two providers, retained-policy recovery only when a delivered-context row is committed, full proof-Ref equality, and the two post-#564 missing/corrupt-policy replay regressions. Squash still waits on that second eligible current-head Approve and on required CI remaining green.

Non-blocking, unchanged: _semantic is a hand-maintained parallel of the Benchmark digest. The recorded tests are a declared software control, not a production B→H or service-performance claim.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PASS for d6b01caa96d3982fcdd9713d8e8fabaece65af83 against 3b1b4ceb. Reviewed the opt-in policy and callers: the retained proof is checked against the original owner, scope and checks before provider invocation, and the no-policy path keeps its existing identity and behavior. Regression tests also cover replay ordering.

Exact-head Ready (45097680790) and knowledge-model-policy passed. This is the bounded Harness change; I did not validate real production provider or hardware runs or accept #371 as a whole.

Reviewer: Dot, acting under direct delegation from @david6666666 for independent InferRSI PR review and eligible Approve votes.

@zengchuang-hw
zengchuang-hw merged commit aa0443d into main Nov 23, 2026
12 checks passed

Copy link
Copy Markdown
Contributor Author

Merged as aa0443d with the two valid current-head Jiang/David Approves and all required checks, after fresh write-permission / head / review verification. Actual-main 8a8e857 verification, fresh bare-core installation, installed real generation / missing-policy expired-retired replay, and four-runtime-byte equality are recorded in the #586 Delivered / Verified / Limits card. #586 acceptance owner is asked to accept that bounded delivery; #371 stays open.

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

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants