Skip to content

test(apps): verify fixed CPU records across read-only views - #542

Merged
Dong1017 merged 1 commit into
mainfrom
codex/apps-490-fixed-record-acceptance
Nov 21, 2026
Merged

Dong1017 merged 1 commit into
mainfrom
codex/apps-490-fixed-record-acceptance

Conversation

@zengchuang-hw

Copy link
Copy Markdown
Contributor

Refs #490
Refs #371

Complete #490 step 5's durable acceptance coverage after the storage, handoff, workflows, Cannbot and MindIE slices merged. A real ordinary CPU generation run now has one fixed RecordRef checked across CLI status/trace, HTML report, offline Dashboard, live Dashboard state/page and a fresh isolated Python process. The test rejects allocation, execution, assessment and RunStore writes while querying, then confirms the original RecordRef and committed payload bytes are unchanged.

Reuse the actual Apps providers, Harness prepare_generation and SQLiteRunStore fixtures. The assessment remains absent: this test establishes shared ordinary CPU execution facts, while production evaluation execution and offline assess remain #429 / #434 work. Clarify the non-blocking note from #537: legacy worker files are importable compatibility shims, not runnable scripts; approved interpreters launch the canonical worker files.

Base: merged #537 / main 13a9953ac682f831d5be6d9489c9092779410295. Head: 96b327fe1222d297275f340c35e4a428393add2b. Scope: one new 129-line regression and one documentation clarification, with no runtime/API/CI changes.

Validation and checked-content relationship

Acceptance boundary

This is the final directory-refactor acceptance slice, not completion of #371's production evaluation chain or an L4/model/service claim. No thresholds, frozen fixtures, recorded evidence, legacy shim retirement rules or CI lanes change. After this PR has two eligible independent formal approvals and passing required checks, squash it and record the whole #490 delivery/verification/limits card for owner acceptance. Keep #371 open for its remaining production ports and joint CPU acceptance.

Please review the real CPU/fixed-record provenance, whether all queries share the exact committed record, read-only enforcement, test fixture use and the stated validation limits. Apps accountable parent and author: zengchuang-hw / Codex; author/self-review cannot count. Approval requires LGTM alone on the first non-empty line of the formal Approve.

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

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

PR review verdict — DO NOT PASS

Reviewed base 13a9953ac682f831d5be6d9489c9092779410295 and head 96b327fe1222d297275f340c35e4a428393add2b (full diff, first review). No prior formal reviews, Approves or CHANGES_REQUESTED are seeded for this head, so there is no independent re-check to weigh.

Blockers

  1. Unrelated docs change with an unverified claim (docs/module-layout.md, around line 114).

    • The PR is titled test(apps): verify fixed CPU records across read-only views. The diff also rewrites a normative sentence.
    • Old text: "Legacy worker paths retain Python import compatibility; external interpreters are launched against the canonical files."
    • New text: "files are importable compatibility shims, not runnable scripts."
    • That is a new behavioral contract about the legacy worker files, and no test in this PR exercises it.
    • The reviewable material does not show a governing Issue or a code change that backs it.
    • Expected correction: either drop the docs hunk from this test PR, or split it out. If it stays, link the Issue or PR that made the legacy workers non-runnable and cite the evidence.
    • The new text also leaves a long unwrapped line. This is minor.
  2. No execution evidence for the new test.

    • tests/test_apps_fixed_cpu_views.py is a new 129-line integration test. It runs a real CPU harness execution, the CLI, an HTTP DashboardServer and a -I subprocess.
    • Nothing seeded shows it passing, and I could not run it here. There is no CI result, no local command output and no environment note.
    • Expected correction: record the exact command and result on this head, for example the pytest invocation, interpreter and CPU environment. Also record the required CI status.

What I read in the test (static only)

  • The test runs one real CPU record through read_attempt_view, status, trace, report, dashboard, and DashboardServer with fixed_attempt. It asserts that they agree: traced is a superset of expected, and the dashboard HTML served at / equals the file written by the CLI.
  • The no-execution guard patches Harness.execute, Harness.allocate, RunStore.claim, Claim.commit, apps_api.assess and subprocess.Popen.
  • The subprocess.run for the isolated child comes after the with block exits, so the Popen patch does not interfere with it.
  • The child also guards execute, allocate, claim, commit and assess.
  • The test checks record_ref and payload_bytes before and after, which covers the no-write claim.
  • The server shutdown and thread.join are in finally.

Not verified

  • Tests were not run.
  • The helper contracts were not verified: the cpu_generation fixture, the record_ref["artifact"]["sha256"] shape, and the DashboardServer(None, None, 0, fixed_attempt=...) signature.
  • Lint was not run. generation is imported from test_apps_generation_plan and does not appear to be used directly. Please confirm it is a deliberate fixture re-export.

I will re-read after the author pushes. Once the docs hunk is justified or removed and passing evidence is attached, I expect to be able to PASS. This review does not approve or alter scope.


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

Copy link
Copy Markdown
Contributor Author

@Dong1017 @amy-why-3459 @david6666666 按已接受 #490 顺序提交第五步正式 Ready 验收切片;#537 已合入,当前 base 13a9953ac682f831d5be6d9489c9092779410295 / head 96b327fe1222d297275f340c35e4a428393add2b。

本 PR 仅新增一个真实普通 CPU 固定记录的只读表面回归,并按 #537 的 non-blocking 建议明确旧 worker 是 importable shim、不是可按文件直接运行的脚本。请关注真实 Harness/SQLite 记录来源、status/trace/report/离线及实时 Dashboard/新进程读取是否同一 Ref、读期间禁止执行/判定/写入及记录字节不变、live server 线程收束,以及测试范围/环境缺口是否如实声明。

本 head 定向 39 passed;全 Apps + delivery/Dashboard/trace/T38 在 0af3fb37 362 passed / 2 skipped / 1 deselected,当前所有 Python/测试内容与其完全一致,仅文档澄清不同。两个 Playwright 缺失跳过与 #494 单节点排除已明确,不计通过;新 CI 44868142347 排队中。父任务 owner/作者是 zengchuang-hw / Codex,本人自检不计独立批准。

请独立检视;通过时以首个非空行独立 LGTM 提交正式 Approve。两份有效独立批准及必需检查通过后 squash 合入,再由 owner 按 closure card 验收 #490;#371 的 #429/#434 生产链继续单独推进。

@Dong1017 Dong1017 added the kind:task Bounded delivery task with a delegated slice label Nov 21, 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

PR review verdict — PASS

Reviewed base 13a9953ac682f831d5be6d9489c9092779410295 and head 96b327fe1222d297275f340c35e4a428393add2b. The full diff is visible (diffComplete: true): the new tests/test_apps_fixed_cpu_views.py and a one-sentence edit to docs/module-layout.md. This re-checks my earlier DO NOT PASS on this same head. I did not run anything, so the points below come from reading the diff and the linked PRs and issues.

Earlier blockers

  1. Docs hunk without a governing source — resolved.

    • The new wording is "legacy worker files are importable compatibility shims, not runnable scripts".
    • It is backed by #490 (the accepted design). Dong-bot's acceptance there carried a non-blocking item: "state that old worker file paths are not supported or keep the shim runnable".
    • It is also backed by the merged #537. My review there recorded that running the legacy worker file by path fails with ImportError: attempted relative import with no known parent package.
    • #537's merge comment and #490's step 5 both say this clarification was deferred to #542.
    • The PR body links all of this, so the docs change is a documented accepted follow-up and not a new behavioral contract.
    • Still open, and minor: the edited line is now unwrapped and long.
  2. No execution evidence — partly resolved.

    • The body now states 39 passed on this head for the fixed-CPU-views and migration group, plus Ruff and diff whitespace.
    • It also states 362 passed, 2 skipped and 1 deselected on 0af3fb37.
    • The skips (missing Playwright) and the deselected #494 busy-lock node are named as not counted as passed.
    • The body says the Git tree matches after rebasing onto #537, and that only docs/module-layout.md differs from the fully tested tree. That fits the diff, which has no Python changes beyond the new test file.
    • These are author-reported results and I have not independently reproduced them. See "Not verified" below.

Verified from the diff

  • Real record source.
    • The test uses the cpu_generation fixture, Harness prepare_generation and harness.execute(spec). It asserts exit_code == 0.
    • It takes record_ref from the real record.
    • It does not build a synthetic record.
  • One shared RecordRef.
    • read_attempt_view, CLI status, CLI trace, the report and dashboard HTML, the live DashboardServer state and page, and a -I child process all take the same record_ref and storage config.
    • Each output is compared with expected or traced.
    • The HTML outputs are checked for the artifact sha256 and the attempt id.
  • Read-only enforcement.
    • Harness.execute, Harness.allocate, RunStore.claim, Claim.commit, apps_api.assess and subprocess.Popen are patched to raise while the in-process surfaces run.
    • The child process patches the same set except Popen.
    • Afterwards the test asserts that store.committed(...) returns an unchanged record_ref and unchanged payload_bytes.
    • The assessment is explicitly asserted to be absent, which matches the stated #429/#434 boundary.
  • Thread cleanup. The live server is shut down in finally, the thread is joined, and the test asserts not thread.is_alive().
  • Scope. There are no runtime, API or CI changes.

Non-blocking observations

  • Live Dashboard check is weaker than the others. DashboardServer(None, None, 0, fixed_attempt=traced) is given the already-read view, so /api/state == traced shows the server echoes that fixed attempt. It does not show the server read the store itself. The / page is compared with the offline dashboard HTML, which is the more useful check. A short comment or docstring saying this would avoid over-reading the coverage.
  • Child-process claim. It checks that read_attempt_view works with -I and returns the same view. The Popen ban is parent-only, which is fine.

Not verified here

  • I did not execute the new test or the 362-test group.
  • The new head's Ready CI (44868142347) was reported as queued, and I did not see a result.
  • Merge still needs a passing required CI on this head and two eligible independent approvals, and this review is one vote. If CI fails on the Linux lanes, treat that as a blocker and I will re-read.

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

@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

PR review verdict — PASS
Reviewed base 13a9953 and head 96b327f.

Verified against accepted #490 step 5: the new test drives a real ordinary CPU record through cpu_generation / prepare_generation / harness.execute, then checks that CLI status/trace, report, offline dashboard, live Dashboard / page and an isolated -I child all share the same RecordRef. Query paths patch execute/allocate/claim/commit/assess (and parent Popen) and then confirm the committed ref and payload bytes are unchanged. Assessment is asserted absent, matching the #429/#434 boundary. The generation import is required because cpu_generation depends on that fixture.

The docs/module-layout.md one-sentence clarification matches the deferred #537 / #490 follow-up (legacy worker files are importable shims, not path-runnable scripts) and does not change runtime code.

lint-and-smoke, declarations, pr-references, installed-package (3.10/3.11), dashboard-browser and host-compatibility are green on this head; Ready CI full-check (3.10/3.11) in 44868142347 is still running and should pass before merge.

Non-blocking: DashboardServer(..., fixed_attempt=traced) echoes the already-read view on /api/state; the stronger live check is that / equals the offline dashboard HTML.

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

Labels

kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants