Repository navigation
feat(apps): assemble role-bound evidence capture ports - #568
zengchuang-hw wants to merge 1 commit into
Conversation
Read only current attempt sources through the Harness capability and pass bytes to an injected pure projector. Verify fixed output, report, dashboard and trace references across publication failure and original-attempt replay. Agent-assisted-by: Codex (author) Signed-off-by: zengchuang <zengchuang3@huawei.com>
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — DO NOT PASS
Reviewed base af836963e73251622eefcf8a8a67f8ad3f4ecf12, head abc6de4ddd36a01c37187b64640e81015549bc50 (first review, no prior formal reviews or Approves seeded). This is a Dong-bot (authorized delegate) review. It is not an approval.
Blocker 1: the diff is incomplete. pr/meta.json has diffComplete: false. The seeded patch was cut off partway through src/inferrsi/harness/run_store.py. I could not see the rest of that file, the tests (including tests/test_apps_evidence_capture.py, test_harness_entry_verification.py, test_benchmark_assessment.py) or any fixtures. An approval has to cover the whole change, so I am not passing a partly seen diff.
Blocker 2: the PR contains more than its stated scope. Per the #565 decision, this PR should be only the thin Apps evidence_capture adapter, stacked on #566/#567 and merged after both. Against base af83696, the diff also adds:
benchmark/assessment.pyandbenchmark/proofs.pyharness/evidence_capture.py,entry_code.pyandprepared_binding.pyLocalCpuTarget(module_root=...), replay re-entry throughrun_store._reenter_if_registered, and new contract docs
That is the B, H, entry-verification and replay stacks. The scope decision is "merge only after both prerequisites, sync, CI and Amy+David approvals". Please either retarget or rebase onto the prerequisite branches so the diff shows only the Apps adapter, or state explicitly that this PR is meant to carry the whole stack. In that case it needs its own full review by independent reviewers.
What I checked (in the visible part of the diff):
src/inferrsi/apps/handoff/evidence_capture.pymatchesdocs/contracts/apps-evidence-capture.md.- Reads are bounded to size+1 and hash/size are re-checked.
- Streams are closed.
- Multiple sources for one role raise
IdentityMismatch. - A wrong candidate role is refused.
- Capability errors pass through with their portable code.
- It imports no Benchmark module and writes no archive or RunStore row.
EvidenceCaptureis exported fromapps.api, and the migration inventory, architecture and module-layout docs were updated consistently.- The
bound_inputsandsteps[].artifactsselection filters on attempt id, step id andstatus == "available", as the contract says.
Non-blocking, to confirm once the full diff is visible:
validate_artifact_refis imported from..storage.result. I did not verify that name exists at head.- In
_read, astror other non-bytes return fromartifacts.openis treated as a stream. A mistyped result would surface as anAttributeErrorrather than a typed error. This matches the "unknown host/type errors propagate" contract, so it is fine as long as that is intended. - The
ProofProjectordocs claim thatpreparinghappens before the worker starts. The H-side ordering is inexecution_service._run_claimed, which I did see, and it looks consistent.
Not verified: no tests were run and CI status is unknown. I did not review the truncated part of run_store.py or any of the test files.
I will re-read after the author pushes a reduced or complete diff.
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
amy-why-3459
left a comment
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed implementation base 23fd9d6745b306670b25ffa3a6d431facb47cded (merge of #566 0ef4b078528116c45f9a2fb758b00c643adfa854 and #567 b5199316f659e3a10531d187223e8cf9db3720b5) and head abc6de4ddd36a01c37187b64640e81015549bc50 (Apps-only increment: 10 files, +541/−1). The PR target is main af836963e73251622eefcf8a8a67f8ad3f4ecf12; the main-target diff still carries those unmerged prerequisites, which were already reviewed on #566/#567.
I also read the current-head COMMENTED review 6006276369 (DO NOT PASS). Both of its blockers concern the stacked main-target diff: a truncated review snapshot, and the already-reviewed B/H prerequisite files that this branch is required to sit on. The governing #565 acceptance (7064458592) asks for a thin Apps adapter stacked on #566/#567 for review only, and forbids merging before those prerequisites. I therefore reviewed the complete Apps-only range against 23fd9d67, not the whole main-target stack as new work.
Verified against that Apps-slice acceptance by reading this increment:
apps.api.EvidenceCaptureis a thin handoff adapter: it imports no Benchmark business module, performs no grading, and writes no archive or RunStore. The injected projector's return is passed through unchanged, matching H'scapture(phase, facts, *, artifacts) -> (draft, blobs)contract.- Role selection is attempt-scoped and refuses ambiguous sources as
IdentityMismatchinstead of first/last; an absent family is passed as explicitNone. A configured candidate role that differs from H facts is refused before any byte read. - Reads go only through the supplied H capability. Ref metadata is copied before the host call; streams are bounded to size+1, closed, and independently checked against the retained size/hash. Capability refusals keep their original portable code; unknown host/type errors propagate.
- Unit tests cover the adapter boundaries; the three real pipeline cases check runtime IDs, shared RecordRef across execute/assess/trace/report/dashboard, publication-failure retention, and completed replay with zero extra capture/worker. Diagnostic worker semantics are not claimed as task/grader acceptance.
- Architecture and change necessity look sound; no redundant code or tests found. Accuracy and performance comparison experiments are not applicable for this assembly slice.
Ready lint-and-smoke, installed-package (3.10/3.11), dashboard-browser and pr-references have already passed on this head; full-check was still running when I submitted. Per 7064458592, merge #566 and #567 first, sync this branch, wait for green checks on the final head, and obtain two independent formal Approves on that head. This vote applies only to abc6de4d; a parent/author vote does not count as one of those two approvals.
|
回应当前 owner 检视:已把临时检视基线调整为 临时基线只供检视,不向它执行合入。 前置真正进入 main 后会同步并改回 main,重新获得最终头的 CI 与 Amy/David 两份有效独立批准,再 squash 到 main。已有 vs-main Ready 检查仅按原 head/测试内容保留,不伪称是同步后的最终检查。 @Dong1017 @amy-why-3459 @david6666666 请在缩小后的原生差异上复审,有意见先处理。 |
Dong1017
left a comment
There was a problem hiding this comment.
LGTM
PR review verdict — PASS (owner-boundary review by Dong-bot, authorized delegate)
Reviewed base 23fd9d6745b306670b25ffa3a6d431facb47cded (temporary review-only base) and head abc6de4ddd36a01c37187b64640e81015549bc50. The seeded diff is complete (diffComplete: true) and covers 10 files.
My earlier DO NOT PASS blockers are resolved.
- Truncated diff: the retarget gives a complete native diff, so I could read all of it, including both test files.
- Scope creep: the diff now contains only the Apps adapter, its docs, the registrations, the installed-entry probe and two test files. No B or H prerequisite files remain.
Owner boundary (verified in src/inferrsi/apps/handoff/evidence_capture.py)
- Imports are limited to
inferrsi.harness.errors.PublicErrorand..storage.result.validate_artifact_ref. There is no Benchmark business import, grading, worker start, producer sealing, archive write or RunStore write. - The projector's return value is passed through unchanged. Proof, grade and producer decisions stay with B and H.
- Role selection is scoped to the attempt.
_onerefuses multiple sources withIdentityMismatchinstead of picking a first or last one. - A configured candidate role that differs from the H facts is refused before any byte read.
- A report is only used when its attempt_id and step_id match and its status is
available. Otherwise the report is an explicitNone. - The ref is copied (
deepcopy) before the host call. Reads are bounded to size+1, the stream is closed throughclosing, and size and sha256 are checked independently. CapabilityPublicErrors keep their code. Unknown host or type errors propagate.
Registrations
- I checked
docs/apps-module-migrations.jsonagainsttest_active_consumers_use_canonical_paths_and_are_registered.evidence_capture.pyis registered as a consumer ofstorage.result, andtests/test_apps_evidence_capture.pyas a consumer of archive and artifact_reader. tests/test_apps_capture_adapter.pyimports onlyapps.apiandharness.errors, which are not inventory canonicals, so it needs no entry.evidence_capture.pyis not an inventory entry. This matches the doc claim of "no former flat-path alias".
Tests, read but not run by me
- The unit tests in
tests/test_apps_capture_adapter.pycover:- ambiguity
- foreign attempt and step
- metadata mutation by the reader
- corrupt bytes
- short reads
- preserved refusal codes
- unmasked host
TypeError
tests/test_apps_evidence_capture.pycovers three real pipeline cases. They exercise the passed, failed and publication-failure paths, and replay without capture.- The author's reported results (18 focused tests, 536 expanded tests) are unverified by me. I have not seen CI.
Non-blocking follow-ups
capture()indexesfacts["candidate"]["input_role"],bound_inputs,stepsand so on directly. A malformed H facts shape would raiseKeyError. This follows the H contract from #566, so I am not blocking on it.- A reader that returns
bytesis not size-bounded before the integrity check. It is already in memory, so this is acceptable.
Merge conditions (unchanged)
- This Approve covers the current head against the temporary base only.
- #566 and #567 must reach main first. Then sync, retarget to main, and run final-head CI.
- Fresh independent Approves from Amy and David are required on that final head. Amy has Approved the current head, and David's review is still needed.
- The real task, grader and sampler semantics stay under the separate #565 gate.
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
Review-only base:
codex/apps-565-capture-baseat23fd9d6745b306670b25ffa3a6d431facb47cded. Retargeted per the owner's incomplete/wide-diff review so the native PR diff contains only this delivery unit. No integration into this temporary base. After the prerequisites reach main, sync and retarget main, run final-head checks and obtain two fresh independent formal approvals before squash merging there.Refs #565
Refs #371
Apps can now assemble the H-owned capture callback using configured candidate/report roles and an injected B pure projector. It reads only H-authorized bytes, leaves proof/grade/producer decisions with their owners, and keeps published output, assessment, report, Dashboard and trace on the original fixed references.
Authority: Apps slice delegated to zengchuang-hw / Codex in 7064458592. Amy and David are the required independent reviewers; the author and accountable owner cannot supply independent votes.
Stacked Ready PR: depends on #566
0ef4b078528116c45f9a2fb758b00c643adfa854and #567b5199316f659e3a10531d187223e8cf9db3720b5, and through them #560/#561/#562/#564 and the separate #552 condition. Combined prerequisite baseline23fd9d6745b306670b25ffa3a6d431facb47cdedmerges those two exact heads and unions only the canonical-consumer inventory conflict. Current headabc6de4ddd36a01c37187b64640e81015549bc50; Apps-only incremental range is 10 files, +541/−1. The main-target diff temporarily carries those unmerged prerequisites. Both must integrate first, then this branch is synced and obtains final-head checks and two fresh independent approvals.Change
apps/handoff/evidence_capture.py, exported asapps.api.EvidenceCapture(project, *, candidate_role, report_role).Validation on this exact head
The test worker's predicate is diagnostic fixture logic, not an accepted production grader. Real worker/grader/sampler semantics and resource pins remain the separate #565 gate. No measured sample values or service gains are invented, and no whole-Issue completion is claimed. #371/#429/#430/#434 remain open.
@amy-why-3459 @david6666666 please independently review the complete Apps increment; @Dong1017 please review the owner boundary. Integration requires passing checks, both prerequisites and two eligible current-head formal Approves with first nonempty line
LGTM. Parent/author and non-write bot votes do not count.