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
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,25 @@
.research-effect-citations button:hover { text-decoration: underline; }
.research-native-results { border-block-start: 1px solid var(--pw-line); margin-block-start: 16px; padding-block-start: 16px; }
.research-native-results h4 { margin: 0; font-size: var(--text-body); font-weight: 600; }
.research-native-results > p { margin-block: 8px; }
.research-native-reading { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 48px; margin-block: 16px; }
.research-native-best { min-width: 0; }
.research-native-reading dl { margin: 0; }
.research-native-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.research-native-reading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 32px; margin-block: 12px 4px; }
.research-native-reading > div { min-width: 0; max-width: 100%; }
.research-native-reading > .research-native-best { margin-inline-end: 24px; }
.research-native-reading dt { font-size: var(--text-body); color: var(--pw-muted); }
.research-native-reading dd { margin: 4px 0 0; }
.research-native-reading dd button { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 100%; min-height: 44px; padding: 0; font: inherit; background: none; border: 0; color: var(--pw-text); text-align: start; cursor: pointer; }
.research-native-best dd button { align-items: baseline; }
.research-native-reading dd button svg { align-self: center; flex-shrink: 0; color: var(--pw-muted); }
.research-native-reading dd button:hover strong { text-decoration: underline; }
.research-native-reading dd button:focus-visible { outline: 2px solid var(--pw-blue); outline-offset: 2px; }
.research-native-reading strong { font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--text-lead); }
.research-native-best strong { font-size: var(--text-display); line-height: var(--leading-title); }
.research-native-reading strong { font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--text-title); line-height: var(--leading-title); }
.research-native-best strong { font-size: var(--text-display); }
.research-native-unit { font-size: var(--text-body); color: var(--pw-muted); }
.research-native-best > p { margin: 4px 0 0; font-size: var(--text-body); }
.research-native-context { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 32px; }
.research-native-context > div { min-width: 0; }
.research-progress .research-native-metric { margin: 0; font-size: var(--text-body); }
.research-native-footer { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0 24px; }
.research-native-footer .research-native-scope { align-items: center; min-height: 44px; }
.research-native-footer .research-native-basis { min-width: 0; }
.research-native-footer .research-native-basis[open] { flex-basis: 100%; }
.research-native-unknown { display: inline-block; padding-block: 10px; font-size: var(--text-body); color: var(--pw-muted); }
.research-native-scope { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--pw-muted); font-size: var(--text-body); }
.research-native-basis dd { margin: 4px 0 12px; }
Expand Down Expand Up @@ -131,8 +133,8 @@
.research-progress select { max-width: 100%; }
.research-effect-metrics { gap: 8px; }
.research-assessment > summary { gap: 8px; }
.research-native-reading { align-items: flex-start; flex-direction: column; gap: 20px; }
.research-native-context { gap: 12px 24px; }
.research-native-reading { gap: 12px 16px; }
.research-native-reading > .research-native-best { flex-basis: 100%; margin-inline-end: 0; }
.research-progress-values { grid-template-columns: 1fr; gap: 16px; }
.research-request-values { grid-template-columns: 1fr; }
.research-usage-basis { grid-template-columns: 1fr; gap: 4px; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,21 @@ function NativeResults({native, zh, onCitation}: {native: ResearchProgressPack["
...(new Date(outcomes.start).getUTCFullYear() !== new Date(outcomes.end).getUTCFullYear() ? {year: "numeric"} : {})});
const value = ([key, cn, en]: typeof points[number]) => {
const point = outcomes[key];
return <div key={key} data-native-point={key}><dt>{zh ? cn : en}</dt><dd>{point ?
return <div key={key} className={key === "best_valid" ? "research-native-best" : undefined} data-native-point={key}><dt>{zh ? cn : en}</dt><dd>{point ?
<button type="button" onClick={event => onCitation(point.citation, event.currentTarget)} aria-label={`${zh ? cn : en}: ${String(point.value)} ${outcomes.metric.unit} · ${zh ? "查看原始证据" : "Read original evidence"}`}>
<strong>{formatNativeMeasurement(point.value, zh)}</strong>{key === "best_valid" ? <span className="research-native-unit">{outcomes.metric.unit}</span> : null}<FileText size={14} aria-hidden/>
</button> : <span className="research-native-unknown">{zh ? "未知" : "Unknown"}{key === "best_valid" ? <span className="research-native-unit"> · {outcomes.metric.unit}</span> : null}</span>}</dd></div>;
};
return <section className="research-native-results" aria-label={zh ? "原生测量" : "Native measurements"}>
<div className="research-progress-title"><h4>{historical ? (zh ? "历史原生测量" : "Historical native measurements") : (zh ? "原生测量" : "Native measurements")}</h4><ContextHelp
<div className="research-progress-title research-native-heading"><div className="research-progress-title"><h4>{historical ? (zh ? "历史原生测量" : "Historical native measurements") : (zh ? "原生测量" : "Native measurements")}</h4><ContextHelp
icon={historical ? TriangleAlert : undefined} label={historical ? (zh ? "当前来源未核验" : "Current source unverified") : (zh ? "测量说明" : "About native measurements")}>
{historical ? <p>{zh ? "来源已变化或不可读;以下仅为历史捕获,当前结果未核验。" : "The source changed or is unavailable. These are historical captures; current results are unverified."}</p> : null}
<p>{zh ? "最佳只限本次捕获窗口;原生保留与最后提交可能不同。未采集的值保留未知,不记零。" : "Best is limited to this capture; retained and final submissions can differ. Uncaptured values remain unknown, not zero."}</p>
<p>{zh ? "检验过收益、采用了证据及原目标达成各需各自证据,不能由这些数值推断。" : "Utility testing, evidence adoption and original-objective success each need their own evidence; these values cannot establish them."}</p>
</ContextHelp></div>
<div className="research-native-reading">
<div className="research-native-best"><dl>{value(points[0])}</dl><p>{outcomes.metric.name} · {outcomes.metric.higher_is_better ? (zh ? "越高越好" : "higher is better") : (zh ? "越低越好" : "lower is better")}</p></div>
<dl className="research-native-context">{points.slice(1).map(value)}</dl>
</div>
<div className="research-native-scope"><span>{outcomes.valid_count} / {outcomes.sample_count} {zh ? "项有效结果" : "valid results"}</span>
<p className="research-native-metric">{outcomes.metric.name} · {outcomes.metric.higher_is_better ? (zh ? "越高越好" : "higher is better") : (zh ? "越低越好" : "lower is better")}</p></div>
<dl className="research-native-reading">{points.map(value)}</dl>
<div className="research-native-footer"><div className="research-native-scope"><span>{outcomes.valid_count} / {outcomes.sample_count} {zh ? "项有效结果" : "valid results"}</span>
<span>{period.formatRange(new Date(outcomes.start), new Date(outcomes.end))} UTC</span>
{!outcomes.complete ? <span>{zh ? "部分窗口 · 起点未知" : "Partial window · initial unknown"}</span> : null}
</div>
Expand All @@ -173,7 +171,7 @@ function NativeResults({native, zh, onCitation}: {native: ResearchProgressPack["
return point ? <div key={key}><dt>{zh ? cn : en}</dt><dd>{String(point.value)} {outcomes.metric.unit}<br/><code>{point.candidate_ref}</code><br/>{zh ? "提交" : "Submission"} {point.submission_index} · {zh ? "提交时间" : "Submitted at"}: {point.submitted_at ?? (zh ? "未知" : "Unknown")}<br/>{zh ? "收到结果" : "Result received"}: {point.observed_at}</dd></div> : null;
})}</dl>
<ul>{outcomes.limitations.map((line, i) => <li key={i}>{line}</li>)}</ul>
</details>
</details></div>
</section>;
}

Expand Down
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.
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.
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.
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.
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.
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 @@ -79,6 +79,8 @@ def main():
original[registry] = registry.read_bytes()
# Optional synthetic analysis uses the real pack verifier, process/job
# owner and HTTP reader. It never enables model dispatch from the page.
fixture_config = {**DEFAULT_CONFIG, "research_synthesis": False}
fixture_config.pop("research_synthesis_revision", None)
for capture in captures:
for index, analysis in enumerate(capture.get("analyses", [])):
source_root = root / f"analysis-{capture['goal_id']}-{index}"
Expand All @@ -91,7 +93,7 @@ def main():
input_path.write_text(json.dumps(analysis["input"], ensure_ascii=False))
scope = dict(runtime_root=runtime, owner_goal_id=capture["goal_id"])
registered = register_pack(**scope, input_path=input_path, source_root=source_root, title=analysis["title"],
config=analysis.get("config", {**DEFAULT_CONFIG, "research_synthesis": False}),
config=analysis.get("config", fixture_config),
native_outcomes_json=analysis.get("native_outcomes_json"))
for language, output in analysis["outputs"].items():
provider = root / f"analysis-provider-{index}-{language}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ export const researchNativeReadingScenario = {
assert.match(await native.locator(".research-native-best .research-native-unit").textContent(), new RegExp(c.unit ?? "points"), "The raw unit remains visible even when no valid measurement exists");
assert.match(await native.locator(".research-native-scope").innerText(), new RegExp(`${c.values.filter(v => v !== null).length} / ${c.values.length}.*有效结果`));
if (c.partial) assert.match(await native.innerText(), /部分窗口 · 起点未知/);
if (c.id === "invalid-first") {
const best = await native.locator('[data-native-point="best_valid"]').boundingBox();
const retained = await native.locator('[data-native-point="retained"]').boundingBox();
assert(best.width > retained.width + 8, "An unknown retained result must not reserve an equal primary column beside the best valid measurement");
await native.evaluate(e => e.scrollIntoView({block: "start"}));
await page.screenshot({path: resolve(outputDir, "research-native-unknown-desktop.png"), animations: "disabled"});
}
await page.setViewportSize({width: 390, height: 844});
const details = native.locator(".research-native-basis");
if (await details.evaluate(e => e.open)) await details.locator(":scope > summary").click();
Expand All @@ -122,6 +129,7 @@ export const researchNativeReadingScenario = {
await page.screenshot({path: resolve(outputDir, "research-native-source-tail-phone.png"), animations: "disabled"});
}
await details.locator(":scope > summary").tap();
if (c.id === "invalid-first") await page.screenshot({path: resolve(outputDir, "research-native-unknown-phone.png"), animations: "disabled"});
if (c.id === "lower-negative") {
const retained = native.getByRole("button", {name: /原生保留结果.*查看原始证据/});
await retained.focus(); await retained.press("Enter");
Expand Down
Loading