Skip to content

feat(harness): bind generated candidates to fixed evaluation attempts - #621

Merged
zengchuang-hw merged 2 commits into
mainfrom
codex/harness-584-fixed-lineage
Nov 24, 2026
Merged

zengchuang-hw merged 2 commits into
mainfrom
codex/harness-584-fixed-lineage

Conversation

@zengchuang-hw

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

Copy link
Copy Markdown
Contributor

Governing issue and delivery slice

Refs #584

The Harness owner’s accepted scope allows a distinct CPU evaluation attempt to consume the candidate retained by a successful generation in the same RunStore. The implementation delegation is to zengchuang-hw / Codex. All source prerequisites, including #609 and #618, are on the actual base 5a303ca4f9f3d1b1f24f8a1b5bef68b4a327f735. This PR carries the Harness slice independently of the Apps CLI adapter in #620.

Anchors touched A1 and A5, within the existing #584 contract. Harness reads the fixed generation revision and original bounds, binds the retained candidate artifact to its pre-sealed plan role, and rechecks bytes. Validation preserves the original overall deadline and budget scope. Registered requests take the existing replay/conflict path first. The existing ordinary-path and argument checks from #617 are preserved. The original worker and grading rules stay with Benchmark.

Verification

  • Reviewer follow-up streams candidate integrity hashing without retaining or joining candidate chunks. A regression verifies a candidate larger than three 1 MiB chunks returns no collected content; corrupt candidates remain refused before registration.
  • Windows, Git 2.50.1. The lineage, execute, generation bounds, evidence capture, Apps module migration and real CPU suites ran on this tree. 191 passed, with two POSIX process-group tests skipped. Whole-tree Ruff and whitespace checks passed.
  • Built an sdist, built its wheel, installed the core package in a fresh environment and passed the repository’s outside-checkout installed-package check. Ran the real generation-to-evaluation case with the installed wheel and verified that the two attempt IDs and fixed record refs remain distinct. The generated text is valid UTF-8 and deliberately gives the wrong answer. The independent format/correctness/measurement verdicts were PASS/FAIL/PASS.
  • This is the local CPU path. Historical generations lacking the original-bounds snapshot cannot authorize a fresh chained evaluation. The historical pre-merge approval gap on Retain original generation bounds without changing sealing identity #585 stays recorded separately. Shared Apps/host acceptance belongs to task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371.

Two independent current-head formal LGTM approvals and required green CI precede squash. The author and the accountable Harness owner are excluded from those two seats. Issue acceptance remains with the Harness owner.

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "3b80fee0df28d0a2d876bc45990c91bfc1feca6e",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Codex",
      "model_id": "unknown",
      "effort": "unknown",
      "role": "author"
    }
  ]
}

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

@amy-why-3459 amy-why-3459 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.

Codex, acting for @amy-why-3459.

候选文件在注册前的校验会额外构造两份完整内容,见行内意见。

"evaluation does not use the original retained candidate")
_require(item["snapshot_format"] == "file-v1", "unsupported generated candidate snapshot",
"UnsupportedRuleVersion")
_read(store, candidate)

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.

Codex, acting for @amy-why-3459.

这里仅需校验候选的大小和摘要,_read 返回的内容会被直接丢弃。但 RunStore.open() 已把完整对象放入 BytesIO,_read 又保留所有 1 MiB 分块,并在返回前 join 出另一份完整候选。对于较大的合法候选,仅这次注册前校验就可能额外占用约两倍文件大小的内存。建议给候选提供只累计长度和 SHA-256 的校验路径,逐块释放;需要解码或比较内容的 plan 再收集字节。保留损坏候选在注册前被拒绝的测试。

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

Copy link
Copy Markdown
Contributor Author

已按 Amy 的行内意见更新当前头 3b80fee0。候选注册前的完整性校验现在只按 1 MiB 分块累计长度和 SHA-256,不保留分块,也不再 join 候选内容;需要解析和比较的 generation plan 仍显式收集字节。新增超过三个分块的大候选回归,断言流式校验不返回内容。损坏候选在注册前拒绝的既有覆盖保留。已重新请求 Amy 和 David 检视新头,等待新头 CI。

@amy-why-3459 amy-why-3459 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
Codex, acting for @amy-why-3459.

PR review verdict — PASS

审阅范围与验证依据

已审阅 base 5a303ca4 到 head 3b80fee0 的 8 个文件,并对照 #584 的授权范围。首次评估按固定版本读取生成记录,核对原始时限、预算范围、候选引用和实际字节;已登记请求先走重放或冲突处理。回归覆盖了两次读取之间候选变化、历史记录缺失和发布失败后重放。上一轮提出的内存问题已修复:候选校验逐块累计长度和 SHA-256,只有需要解析或比对的 plan 才保留分块。

已核对该提交的 CI run 45376660559:Python 3.10/3.11 全量检查和安装包验证均通过。本次批准针对 #621 的同一 RunStore 本地 CPU 评估改动。

@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
Dot, acting for @david6666666 (repository admin) under delegated independent InferRSI PR review and approval.

PASS — reviewed 3b80fee0df28d0a2d876bc45990c91bfc1feca6e against 5a303ca4f9f3d1b1f24f8a1b5bef68b4a327f735 for the accepted #584 slice. Fresh admission binds the exact same-Store sealed generation, original deadline and budget scope/policy, and frozen candidate role before registration. Registered requests still replay first. The follow-up hashes the candidate in bounded chunks without keeping or joining them, addressing the prior review finding; the underlying Store still supplies a buffered reader.

Verified all eight Ready jobs and the required knowledge policy status on this head, including the Windows and macOS advisory results. I reviewed the regression coverage and installer evidence but did not rerun the tests or the reported real CPU case locally. This verdict is for the Harness lineage slice, not shared #371 or hardware acceptance.

@zengchuang-hw
zengchuang-hw merged commit 5e963e6 into main Nov 24, 2026
12 checks passed

@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
Reviewed base 5a303ca4f9f3d1b1f24f8a1b5bef68b4a327f735 and head 3b80fee0df28d0a2d876bc45990c91bfc1feca6e (8 files, +932 -11), the #584 same-Store lineage slice.

State note: #621 is already merged at this exact head (2026-11-24T12:37:01Z), with independent current-head Approves from @amy-why-3459 (6037999714) and @david6666666 (6038090650) and no outstanding changes requested. This review records the technical check of 3b80fee0; it does not change merge state and does not count as a third independent vote.

Verified in the diff

  • Prior inline finding resolved. Candidate integrity now streams: generation_lineage._read(..., collect=False) accumulates size and SHA-256 over 1 MiB chunks without retaining or joining them, and _source verifies the candidate with collect=False. Generation-plan bytes are still collected, because they are decoded and compared against the captured copy — the split Amy's inline ask allowed, per the author's 10:38Z reply. New regression test_large_candidate_integrity_check_does_not_collect_content (3 MiB + 17 bytes) asserts no content is returned; the corrupt/missing-candidate refusals before registration are retained.
  • Ordering holds. execution_service.execute calls store._reenter_if_registered before _validate_fresh (execution_service.py:1185-1188), so a registered request replays or conflicts with no fresh lineage read; _validate_fresh returns generation_lineage.authorize's _CaptureReader, and that router is the reader used for capture (:1211). Public validate() passes no store, so non-null lineage still refuses with UnsupportedOperation (:490-493) — matching docs/contracts/generation-lineage.md.
  • Refusals stay pre-registration: authorize() re-raises with stage="validate", started=False, preserving code plus retained/field errors; OSError maps to ArtifactUnavailable, malformed metadata to ArtifactIntegrityError.
  • The new module's contract expectations line up with the accepted bounds slice: foreign-Store refs are rejected against run_store.record_location (run_store.py:148), the sealed snapshot's field set matches _BOUNDS_FIELDS (:72-75), and _time's nanosecond split matches _is_timestamp's 1–9 fractional-digit grammar (:197-205), so the original-vs-evaluation deadline comparison cannot truncate.
  • Referenced helpers exist as used: run_store._has_fields/_is_id/_is_timestamp, prepared_binding._is_path/_is_sha256/_is_definition (prepared_binding.py:85-105).
  • Docs and catalog: docs/contracts/generation-lineage.md is new, generation-bounds.md's blanket refusal now points at that profile, docs/operations.md adds the effect-class row, and docs/apps-module-migrations.json adds the new test to both consumer lists it actually imports (apps.storage.archive, apps.storage.artifact_reader).

Not verified here: I did not run the suite, the real CPU case, or the installed-wheel check; CI evidence is the seeded approvals (Amy's run 45376660559) and the PR body. David's recorded residual still stands and is non-blocking: RunStore.open hands back a buffered BytesIO, so only the extra join/copy is gone, not the store-side buffer.


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