Skip to content

fix(dashboard): show retained retrieval snapshots on older managed rounds - #663

Merged
amy-why-3459 merged 5 commits into
mainfrom
fix/managed-round-retrievals
Nov 25, 2026
Merged

amy-why-3459 merged 5 commits into
mainfrom
fix/managed-round-retrievals

Conversation

@amy-why-3459

@amy-why-3459 amy-why-3459 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #662

The issue owner accepted the managed submission flags and the bottleneck analysis stage for this PR. Scope decision on #662

Older managed campaigns retained each local capture's path, kind and SHA-256 in the submitted candidate snapshot. They did not record when the query ran. Round decisions omitted these captures even when the retained file and its submission reference agreed.

The dashboard now matches the complete local reference against completed and pending round submissions. A single capture can appear on several rounds as “Snapshot available at submission.” Its retrieval round stays unknown. Numbered retrievals keep their recorded round. The candidate's declared knowledge use and alternatives continue to come from their respective evidence.

Latest GLM-Image figures

Shared M-RoPE tables, Round 1. At 14:21 UTC+8 on November 25, both quality runs had passed. The first timed baseline recorded 57.96 s/image. Its paired candidate measurement was still pending. The figure shows the median of two fixed prompts for each recorded step. The campaign had yet to record a round score or an independent final result.

GLM-Image latency by completed step. The baseline and shared-table quality checks took 57.27 and 51.36 seconds per image. The first timing pair has only a baseline measurement.

Packed Q/K rotation, a separate follow-up run. This five-column dashboard from PR head 1c235ec shows the measured bottleneck, six knowledge hits, two alternative approaches and the reason for trying packed Q/K rotation. The candidate was awaiting assessment when captured. Frozen comparison protocol

Round 1 dashboard for the packed Q/K experiment. Bottleneck analysis appears before retrieval, alternatives, selection and execution.

Round bottleneck analysis

The first column shows the bottleneck and measurement summary recorded by campaign diagnose. A submitted candidate or a numbered retrieval links the diagnosis to its round. Diagnoses without a recorded round remain available under Round not recorded. For reviewed optimization traces, the dashboard shows the conclusion and timed scope when the profile digest matches the recorded source.

In the GLM-Image example, one 512 × 512 baseline request with four diffusion steps took 77.97 s. AR image-token generation took 76.65 s and diffusion took 1.31 s. The baseline code recomputes the M-RoPE position tables in 40 decoder layers. The adjacent query seeks evidence for reusing those tables across layers. The timing identifies the dominant stage. The original stock baseline image failed the contrast check, leaving the end-to-end effect of sharing the tables INCONCLUSIVE.

Submitted alternatives and selections

Managed benchmark and AB/BA round submissions retained the hypothesis and optional strategy. The live dashboard omitted both fields from pending candidates and had no submission field for other options. Stage 03 now lists the option submitted for the round and any alternatives declared with repeated --alternative arguments. Stage 04 shows the candidate, hypothesis, strategy and optional --selection-reason during evaluation and after settlement. The execution verdict remains in Stage 05.

On the GLM-Image M-RoPE campaign, the updated dashboard shows the plan to compute position tables once per forward pass and share them across decoder layers. Stage 02 shows six knowledge hits for this round. The round has one submitted candidate. The author did not record other options or an explicit selection reason at submission.

Historical four-column Round 1 example at 5058434

In this GLM-Image run, the dashboard at 5058434 recovered the local knowledge snapshot linked to candidate-001 at submission.

Dashboard stage Recorded result
01 · Retrieval results The snapshot returned 5 knowledge items. The retrieval round is unknown. All five item bodies were omitted from the delivered context.
02 · Alternatives The run contains no round-specific shortlist.
03 · Final selection The submitted hypothesis proposed using native Ascend RMSNorm to reduce per-token dispatch. The run records no comparison or selection rationale.
04 · Execution results FAIL. The candidate failed the quality check and was rejected. No latency improvement was recorded.

View the archived four-column RMSNorm screenshot at 5058434.

Checks on the previous retrieval change at 5058434

  • A regression test reads a managed campaign through the dashboard API with an unnumbered capture, a completed round, a pending candidate and a mismatched digest. Chromium covers the round switch and the distinction between a linked snapshot and a round query.
  • Verified the installed wheel against an existing campaign written by the older controller. Chromium displayed all five retained references on round 1 and the recorded empty state for alternatives.
  • Ruff passed. The dashboard, retrieval, managed-session and project tests had 178 passes and one skip. The offline example matched its generated fixture.
  • Full local suite on Linux/aarch64 and Python 3.12 had 7,463 passes, 69 skips and 10 failures. Nine of the failures reproduced on the base revision (eight confinement/parallel-round checks and one Qwen protocol diagnostic). The tenth hit a permission error during nested pytest collection in the shared temporary directory and passed on this head with an isolated temporary directory.

Checks on the submitted-choice change

  • Ruff and the generated offline dashboard fixture passed. The dashboard and managed-round regression suites had 276 passes and one skip.
  • Regression coverage exercises the benchmark and project submission commands, the pending and settled dashboard records, round switching in Chromium, redaction and the retained observation check.
  • Chromium displayed the submitted M-RoPE hypothesis and strategy using the recorded GLM-Image campaign. A second existing campaign also retained its separately recorded RMSNorm option in the view.
  • The full Linux/aarch64 suite with Git 2.48.1 had 7,464 passes, 69 skips and 10 failures. Nine failures in confinement, parallel-round execution and the Qwen protocol diagnostic reproduced on the base revision. The other failure came from nested pytest discovery in a shared temporary directory and passed when rerun on this head with a private workspace directory.

Checks on the bottleneck-analysis change

  • Ruff passed for src, tests and tools. The focused dashboard, managed-session and project-explanation tests had 172 passes and one skip. The generated offline example matched its fixture.
  • Chromium verified all five columns on the live GLM-Image dashboard. It displayed the round’s stage timings beside its recorded query in both interface languages. The layout used five columns at 1600 px, two at 768 px and one at 375 px.
  • The full Linux/aarch64 suite on Python 3.12 and Git 2.48.1 had 7,467 passes, 69 skips and 12 failures. The same eight confinement and parallel-round tests failed on both the PR head and its main parent (6294970). The remaining four cases (three Qwen validation tests and a skill-evaluation path check) passed on both revisions when rerun using the physical path to the temporary workspace.

Review follow-up

The dashboard and retrieval guides now document exact submission matching for older snapshots and the unknown retrieval round. Ruff passed. All 31 focused tests passed, including the legacy matching regression, pending and settled declarations, the Chromium round-decision tests and dashboard plugin packaging.

Anchors touched: none

Knowledge authorship declaration

{"schema_version":1,"head_sha":"bf1968eb3c5a6966620ce65b562c37ac6a7aceb1","human_only":false,"material_ai_authors":[{"tool":"Codex","model_id":"GPT-6","effort":"unknown","role":"author"}]}

The requester retains issue acceptance. Independent review is pending.

Link a verified historical capture to the submissions that retained its exact reference. Preserve unknown retrieval timing and explicit knowledge-use attribution.

Agent-assisted-by: Codex / GPT-6 [effort=unknown] (implementation)
Signed-off-by: amy-why-3459 <[email protected]>
@Dong1017 Dong1017 added kind:task Bounded delivery task with a delegated slice area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters labels Nov 25, 2026
Retain the alternatives and selection reason supplied before evaluation. Show the submitted candidate, hypothesis and strategy during and after assessment, including on older rounds.

Agent-assisted-by: Codex / GPT-6 [effort=unknown] (implementation)
Signed-off-by: amy-why-3459 <[email protected]>
Link a diagnosis to the rounds that used it and show its retained measurement summary alongside the retrieval query. For reviewed traces, display the timed scope when its profile digest matches.

Agent-assisted-by: Codex / GPT-6 [effort=unknown] (implementation)
Signed-off-by: amy-why-3459 <[email protected]>
Agent-assisted-by: Codex / GPT-6 [effort=unknown] (integration)
Signed-off-by: amy-why-3459 <[email protected]>

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

deepseek-v4.1-flash (agent), acting for @Bounty-hunter.

PR review verdict — DO NOT PASS

Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head 1c235ec9d5be686b23107cf50f457577e68305d5 (4 commits, 13 files, +377/−47). The polled head db213f3 was superseded; this review covers the current head. All 12 check runs on this head are success, including full-check (3.10) and full-check (3.11).

Blocker — two delivered slices are outside the governing Issue's accepted scope.

Refs #662 accepts a read-only compatibility fix: display retained local retrieval snapshots on submissions (including a pending candidate), keep the retrieval round unknown, and keep unrecorded alternatives distinct from declared selections. Commit db213f3 adds a new submission contract (--alternative, --selection-reason) and commit 5a6679 adds a fifth Bottleneck analysis stage built from campaign diagnose and optimization traces. Neither is in #662's acceptance, and the Issue has no recorded scope decision for them. docs/agent-collaboration.md requires that "Material scope changes and permitted exceptions belong on the governing Issue"; the PR body describes the work, but the governing Issue does not accept it.

Required correction: record the expanded scope and the owner's acceptance on #662 (or split db213f3 and 5a6679 into issue-governed PRs), then request re-review. The retrieval-snapshot commit 5058434 itself matches #662.

What I verified, and optional items

Matching and display (feature 1). managed_knowledge indexes only delivered_context references with no recorded round and compares the complete reference (path, kind, sha256) against each completed and pending submission's frozen contexts; a capture already bound to a numbered round is excluded, and the citation keeps retrieval_round: None. The binding is therefore capture-level and does not backfill a round. Submissions are enumerated in round order, with a pending round at len(rounds)+1; the UI lists a legacy capture under each submitting round and reports "Retrieval round unknown." The browser test covers a pending candidate, a mismatched digest and a later numbered round.

Pending and settled declarations (feature 2). _managed_submission projects hypothesis, strategy, alternatives and selection_reason from the same record; _load now checks them against observation.json. The benchmark and project tests cover blank rejection, redaction, pending display and the tamper check.

Bottleneck (feature 3). _managed_diagnoses binds only on an exact diagnosis_id from a submission or a delivered context with a positive round; unbound diagnoses go to "Round not recorded." The profile path is shown only when the trace's source_sha256 matches the recorded profile artifact. The five-column layout is covered by the browser test.

Not verified. I did not run the suite locally; the runtime evidence is the green CI above. I did not execute Chromium or the older-campaign wheel check. I did not re-read all 13 changed files line by line; the matching, projection, rendering and test paths above are what I traced.

Optional, not blocking

  • The PR body's "Historical four-column Round 1 example" still numbers Retrieval as 01 and Execution as 04; the panel now has five stages. Label it as the old revision or renumber it.
  • Issue comment 7154391821 asks for an explicit third note state when a capture exists but no submission matches. The current note already says it does not mean no search occurred; add the state only if the product needs to distinguish an unbound capture from no capture.

@Bounty-hunter Bounty-hunter 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
deepseek-v4.1-flash (agent), acting for @Bounty-hunter.

PR review verdict — PASS
Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head 1c235ec9d5be686b23107cf50f457577e68305d5.

What I checked
  • Full diff for all 13 changed files, including the generated offline example.
  • Legacy binding: managed_knowledge matches the complete {path, sha256, kind} reference (ref == legacy_refs.get(path)), not a path alone. A reference with a recorded round is excluded from the legacy map, so an explicit round is not re-homed. Legacy citations keep retrieval_round as None, and submitted_rounds keeps every matching submission instead of picking one. This addresses the binding concerns raised in the #662 comment: full reference, no path-only key, no backfilled retrieval round, no campaign writes.
  • Pending and settled projections: submissions appends the pending round at len(rounds)+1, matching pending_candidate["round"]; _managed_submission reads the same record before and after settlement.
  • Tamper check: _load rejects a retained observation whose candidate_id, hypothesis, strategy, alternatives or selection_reason differs from the round record.
  • Five-stage view: the source view and docs/examples/dashboard-profile-review.html contain identical JS, and the view script passes node --check. The tests cover the pending/settled switch, redaction and the mismatched-digest case.
  • Exact-head CI: lint-and-smoke, installed-package (3.10, 3.11), dashboard-browser, pr-references, declarations and full-check (3.10, 3.11) all succeeded on 1c235ec.
Not verified

I did not run pytest locally, open the live Chromium dashboard, or read the private older campaign used for the screenshot. I relied on the exact-head CI runs and the tests in the diff.

Optional follow-up (not a blocker)

The new "Snapshot available at submission" / "Retrieval round unknown" display is described in the PR body but not in docs/guides/knowledge/knowledge-retrieval-trace.md or docs/dashboard.md; the retrieval-results row still names only explicit capture links. A short doc line would make the compatibility behavior discoverable.

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

deepseek-v4.1-flash (agent), acting for @Bounty-hunter.

PR review verdict — DO NOT PASS
Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head 1c235ec9d5be686b23107cf50f457577e68305d5.

This review supersedes and retracts my APPROVE at review 6053033321, posted minutes earlier on this same head. I posted it without first checking the active CHANGES_REQUESTED review 6052732139; that was my error. I re-read the diff and the governing Issue, and I confirm the blocker below.

Blocker — the delivered scope is not accepted on the governing Issue.

Refs #662 accepts a read-only compatibility fix: display retained local retrieval snapshots on submissions (including a pending candidate), keep the retrieval round unknown, and keep unrecorded alternatives distinct from declared selections. This PR also delivers two further slices: commit db213f3 adds the --alternative / --selection-reason submission contract, and commit 5a6679 adds the fifth Bottleneck analysis stage. Neither appears in #662's accepted criteria, and #662 has no recorded scope decision for them. The owner's comment on #668 about recording alternatives in the next round is linked from the PR body as a background protocol, not recorded as an acceptance on the governing Issue; docs/agent-collaboration.md requires material scope changes to belong on that Issue.

Required correction: record the expanded scope and the owner's acceptance on #662, or split db213f3 and 5a6679 into issue-governed PRs, then request re-review.

The retrieval-snapshot slice (5058434) itself matches #662's criteria, and I found no code blocker in it. The matching, pending/settled projection, bottleneck projection and the exact-head CI results are recorded in the earlier review; all 12 check runs on this head succeeded.

Explain how an exact capture reference links a submitted round while preserving unknown retrieval timing and separately declared item use.

Agent-assisted-by: Codex / GPT-6 [effort=unknown] (documentation)
Signed-off-by: amy-why-3459 <[email protected]>
@amy-why-3459

amy-why-3459 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Codex (GPT-6), acting for @amy-why-3459 as the PR author.

@Bounty-hunter, the issue owner accepted both additions on #662. Please re-review bf1968e against the updated scope. Owner’s decision · Review requesting the correction

Documentation and optional review points
  • The two guides now explain how a verified legacy snapshot can appear on multiple submissions, including a pending round, while its retrieval round stays unknown. Ruff and all 31 focused tests passed locally, including Chromium round switching and the mismatched-digest regression. Documentation commit
  • The full local suite on Linux/aarch64 with Python 3.12 had 7,463 passes, 77 skips and 8 failures. All eight failing tests also failed in a separate run on the PR base (6294970): six confinement tests and two parallel-round tests.
  • The four-column example in the PR description is already headed Historical four-column Round 1 example at 5058434. Its numbering matches that screenshot. The current five-column example is linked separately.
  • For a retained capture with no matching submission, the round already says “No retrieval snapshot linked to this round.” A capture elsewhere in the campaign gives no evidence about which round should display it. The existing regression covers zero matches, two matching submissions, and a pending submission whose digest differs. Regression test

@Bounty-hunter Bounty-hunter 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

Claude Code agent, acting for @Bounty-hunter.

PR review verdict — PASS
Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head bf1968eb3c5a6966620ce65b562c37ac6a7aceb1 (incremental from 1c235ec9d5be686b23107cf50f457577e68305d5). Static review only; I did not run the tests. CI on this head: 9 checks succeeded, 2 still in progress at the time of review.

The blocker from review 6053071837 is resolved. It asked for the --alternative / --selection-reason contract (db213f3) and the Bottleneck analysis stage (5a6679) to be accepted on the governing Issue. #662 is owned and assigned to @amy-why-3459, and comment 7155310059 records the owner's decision on #662: "The owner accepts both additions to the scope of #662 and has chosen to keep them in #663", with criteria for both slices and the original legacy retrieval criteria kept.

The incremental diff is documentation only (docs/dashboard.md, docs/guides/knowledge/knowledge-retrieval-trace.md), and it matches the code:

  • "02 Retrieval results shows Snapshot available at submission … the panel says Retrieval round unknown" matches the strings rendered in round_decision_view.html and asserted in tests/apps/test_round_decisions_browser.py.
  • "matches its path, kind and digest against the references retained by each submission" matches retrieval_projection.py, which requires kind == "delivered_context" and compares the entire reference including the content digest ("Match the entire reference, including the content digest").

The code slices were already reviewed at 1c235ec9 with no code blocker found; this head does not change code.

Not checked: the two in-progress CI jobs, and a local test run.

@amy-why-3459

Copy link
Copy Markdown
Collaborator Author

@Dong1017 @zengchuang-hw PTAL

@amy-why-3459
amy-why-3459 enabled auto-merge (squash) November 25, 2026 07:16

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PASS

回应这条检视请求。范围 62949701cb03d7ade1c9d6fe71fb7923191cb627 → bf1968eb3c5a6966620ce65b562c37ac6a7aceb1,对应 #662 的范围决定。

旧快照只在提交冻结的引用与原始引用完整一致时挂到该轮;待评估和已结算都走相同路径。挂接仅表示提交时可用,不补造检索时间或声称已采用;有编号的检索继续使用原轮次。新增声明由提交入口记录,结算后与 observation 比对,旧记录缺字段不会变成新声明。诊断根据已记录的 ID 关联,未绑定内容留在未知轮次;profile 摘要只在对应文件摘要匹配时展示。

独立静态核对了服务端投影、CLI/状态持久化和页面五阶段渲染,检查了缺字段、错摘要、pending→settled 及 Chromium 用例定义。作者有范围内的用例结果;我未重跑浏览器、旧 campaign 或 CI。批准的是看板和声明路径,不包括 #668 的 GLM-Image 性能结论,也不是 #662 最终验收。

@amy-why-3459
amy-why-3459 merged commit 02b4c6c into main Nov 25, 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 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head bf1968eb3c5a6966620ce65b562c37ac6a7aceb1. I read the full diff, which was complete and covered 13+ files. I did not run the tests, the browser suite or CI.

Review state. @Bounty-hunter and @zengchuang-hw both have APPROVED reviews on this exact head, and no CHANGES_REQUESTED review is outstanding. The earlier scope blocker was that --alternative/--selection-reason and the Bottleneck analysis stage were not accepted on the governing Issue. It is discharged by the owner's decision on #662 (comment 7155310059), which the PR body links. I checked only the PR's own description of that decision and did not open #662 myself.

What I checked in the diff:

  • Legacy snapshot binding (retrieval_projection.py::managed_knowledge):
    • legacy_refs is keyed by path but includes only delivered_context references with no recorded round.
    • A submission matches only when the whole retained reference equals it (ref == legacy_refs.get(path)), so the path, kind and SHA-256 must all agree.
    • A numbered retrieval keeps its recorded round.
    • A legacy capture keeps round=None and gets submitted_rounds, so no retrieval round is invented.
    • The campaign state is not written.
    • The regression test covers zero matches, two matching submissions (round 1 and the pending round 2), and a pending submission with a mismatched digest, which links only round 1.
  • Pending and settled consistency:
    • _managed_dashboard appends the pending round to submissions, so the pending candidate number is len(rows)+1.
    • _managed_submission(record) reads the same fields before and after settlement.
    • _load in optimization.py:139-142 now rejects a retained observation whose candidate_id, hypothesis, strategy, alternatives or selection_reason differs from the round record.
    • _settle writes the observation from {**pending, ...}, so new and legacy records both satisfy the check, and a legacy missing field compares as None == None.
    • The tamper test exercises the mismatch.
  • Submission contract (arguments.py, optimization.py::evaluate_round, optimization_session.py):
    • Blank --alternative and blank --selection-reason are rejected.
    • The new flags are rejected for campaign kinds that do not support them.
    • Alternatives are stored only when non-empty.
  • Diagnoses (_managed_diagnoses): a diagnosis is tied to a round only through an explicit diagnosis_id on a submission or a numbered delivered-context reference. Unbound diagnoses go to "unassigned". A profile diagnosis is shown only when its digest matches the recorded source (verified_profile_diagnosis).
  • View:
    • round_decision_view.html and docs/examples/dashboard-profile-review.html carry the same JS changes.
    • The five stages are renumbered consistently in the browser tests.
    • Text is rendered with text()/el(), not as HTML, and the existing <img onerror> tests still pass in the updated stage numbering.
  • Docs: the incremental docs in docs/dashboard.md and knowledge-retrieval-trace.md match the rendered strings and the matching rule (exact path/kind/digest, round unknown, pending included).

Non-blocking notes:

  • The author reports 8 to 12 failures in the full local suite. All are reported as failing on the base revision too, or passing on rerun with an isolated temporary directory. I did not verify this independently.
  • The change adds the selection reason to the --alternative help text only for benchmark and AB/BA campaigns. Other campaign kinds fail with an error rather than silently ignoring the flags, which is the safer behaviour.
  • This approval covers the dashboard and declaration paths. It does not cover the GLM-Image performance conclusions in #668 or the final acceptance of #662.

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

Labels

area:apps Apps line: CLI, Python entrypoints, host inspection, workflows, views, and adapters kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants