Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ def do_GET(self):
metrics["analysis_reads"] += 1
language = query.get("output_language", ["original"])[0]
record = capture["analysis_readbacks"].get(language)
if "pack_id" in query:
record = next((item for item in capture["analysis_readbacks"].values()
if query == parse_qs(urlparse(item["request_path"]).query)), None)
if record and query.get("pack_id", [record["response"]["pack"]["pack_id"]]) == [record["response"]["pack"]["pack_id"]]:
return self._send_json(record["response"])
elif path == "/api/chat/research-analysis/citation":
Expand Down
24 changes: 24 additions & 0 deletions examples/personal-workspace-browser/research-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,30 @@ request identities. Other cited ranges return an explicit unavailable response;
no transcript or failure stack is substituted. These analysis Goals have no
Explore logs: their empty histories are preserved, separately from the recent
real-history cases above.
The same fixture also freezes the original registered feedback snapshot, whose
native retention is unknown. Select it through **Evaluation scope / 评估范围**:
the best valid value remains `0.849544264387785` and the last valid candidate
remains `0.8485288027628158`, while initial and retained results stay unknown.
No retained-improvement value is supplied by that snapshot. Its saved 36 process
judgments and analysis usage are identical to the later declaration; neither
is rerun or relabeled. Switching scope and Back must restore each snapshot's own
native results, without borrowing a retained value from the other. The additional
original/Chinese/English responses are captured through the real read-only HTTP
owner and pinned independently. This is a reader regression, not independent
verification of the later provider's retention declaration.

The packaged reader keeps the original snapshot's unknown retention visible
beside its measured best and final values. The narrow view below is scrolled to
that same result area; it preserves the same values and on-demand sources.

![Original Graph snapshot, desktop](../../docs/development/assets/runtime-source-analysis/original-native-retention-desktop.png)

![Original Graph snapshot, narrow result area](../../docs/development/assets/runtime-source-analysis/original-native-retention-mobile.png)

The original snapshot includes the exact best/final native-result citations and
the same native-report-4 excerpt as the later snapshot. Other cited ranges return
an explicit unavailable response; no transcript, failure stack or other snapshot's
evidence is substituted. The selected Goal has no Explore log: its empty history is preserved.
Pass `--fixture apps/presentation/dashboard/src/data/fixtures/edgebench-graph-saved-analysis.json`
to the same read-only preview to inspect this case. All mutation verbs are denied.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,63 @@ async function readNativeResults(page, history, capture, language) {
assert.equal(await history.locator("[data-analysis-judgment]").count(), 0);
}
await progress.locator(".research-progress-basis > summary").click();
const name = pack.scope.case_id.split("_")[0];
for (const width of [1440, 390]) {
await page.setViewportSize({width, height: 900});
await progress.scrollIntoViewIfNeeded();
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false);
const name = pack.scope.case_id.split("_")[0];
await page.screenshot({path: resolve(outputDir, `research-real-native-${name}-${language}-${width}.png`), animations: "disabled"});
}
await page.setViewportSize({width: 1440, height: 900});
}

async function readOriginalNativeSnapshot(page, history, capture, language) {
const initial = capture.analysis_readbacks.initial_original.response.pack;
const current = capture.analysis_readbacks.original.response.pack;
const progress = history.locator(".research-progress");
const scope = progress.getByRole("combobox", {name: language === "zh" ? "评估范围" : "Evaluation scope"});
const selectOriginal = async () => {
await scope.selectOption(initial.pack_id);
await progress.locator(`[data-pack-id="${initial.pack_id}"]`).waitFor();
await history.locator('.research-analysis [data-analysis-judgment]').first().waitFor({state: "attached"});
};
await selectOriginal();
for (const key of ["initial", "retained"]) {
const row = progress.locator(`[data-native-point="${key}"]`);
assert.match(await row.innerText(), language === "zh" ? /未知/ : /Unknown/);
assert.equal(await row.getByRole("button").count(), 0, "An absent native result is not borrowed from another snapshot");
}
assert.match(await progress.locator('[data-native-point="best_valid"] button').getAttribute("aria-label"), /0\.849544264387785/);
assert.match(await progress.locator('[data-native-point="final_valid"] button').getAttribute("aria-label"), /0\.8485288027628158/);
assert.equal(await progress.locator("[data-retained-improvement]").count(), 0, "A best measurement does not supply missing retained improvement");
assert.equal(await history.locator("[data-analysis-judgment]").count(), 36, "The same original process judgments remain available");
const missing = history.locator('[data-analysis-episode="native-feedback-1"]');
await missing.locator(":scope > summary").click();
for (const detail of await missing.locator(".analysis-judgments > details").all()) {
if (!await detail.evaluate(element => element.open)) await detail.locator(":scope > summary").click();
}
await missing.getByRole("button", {name: /native-report-1/}).first().click();
const source = history.locator(".analysis-source");
await source.locator(".analysis-error").waitFor();
assert.equal(await source.locator("pre").count(), 0, "An uncaptured source is not borrowed from a different snapshot");
await source.getByRole("button", {name: language === "zh" ? "关闭原文" : "Close source", exact: true}).click();
await progress.locator('[data-native-point="best_valid"] button').click();
await source.locator("pre").waitFor();
assert.equal(JSON.parse(await source.locator("pre").innerText()).value, 0.849544264387785);
await source.getByRole("button", {name: language === "zh" ? "关闭原文" : "Close source", exact: true}).click();
await page.goBack();
await progress.locator(`[data-pack-id="${current.pack_id}"]`).waitFor();
assert.match(await progress.locator("[data-retained-improvement]").innerText(), /\+0\.0323/);
await selectOriginal();
for (const width of [1440, 390]) {
await page.setViewportSize({width, height: 900});
await progress.scrollIntoViewIfNeeded();
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false);
await page.screenshot({path: resolve(outputDir, `research-real-graph-retention-unknown-${language}-${width}.png`), animations: "disabled"});
}
await page.setViewportSize({width: 1440, height: 900});
}

async function readUnanalyzedNativeResults(browser, collectCoverage) {
const coverageEntries = [];
for (const name of ["portfolio", "ad"]) {
Expand Down Expand Up @@ -164,6 +211,7 @@ async function readSavedGraphAnalysis(browser, collectCoverage) {
await page.screenshot({path: resolve(outputDir, `research-real-graph-analysis-${language}-${width}.png`), animations: "disabled"});
}
await page.setViewportSize({width: 1440, height: 900});
await readOriginalNativeSnapshot(page, history, capture, language);
}
const readback = await (await page.request.get(`${owner.base}/fixture/readback`)).json();
assert.equal(readback.source_unchanged, true);
Expand Down
14 changes: 14 additions & 0 deletions tests/presentation/test_research_history_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def read(path):
"original": "0e4bb4b931784abe1faf8cba49922aeb36f6c96f9e1730fdc77d82e7ebd3da2f",
"zh": "cb8fdf1a61915f06168816c82367e9d037bdf49424028cd2793dfe61364def64",
"en": "d76b579672d87f8b071d871ecfd5797b986f295b8dc93bc967471c0e1aab0b2b",
"initial_original": "7b68615db558732a9a78b4d83befcb3e31d92840f4d4944c37f5589288fcfcd2",
"initial_zh": "be0621f5d24cc61a9717611caf7b0ef89c7acdfc5eb03da0d763da7a1c87e531",
"initial_en": "c44c78a2404ea55183a42d3ae1c2e08b90920666b49f159d8f841a84d8f5a4da",
},
"edgebench-portfolio-native-results.json": {
"original": "b33ebfcc7c233f8cf87b70e23b3bc76e34d5b91b8fcf11393e532afa9597b717",
Expand Down Expand Up @@ -145,6 +148,17 @@ def read(path):
assert "solver_usage" not in view and not events
for citation in capture["analysis_citations"]:
assert read(citation["request_path"]) == citation["response"]
citation = capture["analysis_citations"][0]
if fixture_name == "edgebench-graph-saved-analysis.json":
initial = read(capture["analysis_readbacks"]["initial_original"]["request_path"])["pack"]
initial_native = initial["native_outcomes"]["projection"]
assert initial_native["retained"] is None and initial_native["initial"] is None
assert "retained_improvement" not in initial_native
assert initial_native["best_valid"]["candidate_ref"] == "agent-16"
assert initial_native["final_valid"]["candidate_ref"] == "agent-18"
assert initial["result"] == view["result"]
assert initial["job"] == view["job"]
assert read(citation["request_path"]) == citation["response"]
for query in [
{"output_language": "fr"}, {"pack_id": "wrong-pack"},
]:
Expand Down
Loading