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 @@ -67,19 +67,28 @@
.research-progress .research-effect-citations button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font: inherit; font-size: var(--text-body); background: transparent; border: 0; border-radius: 0; padding: 4px 0; color: var(--pw-muted); cursor: pointer; }
.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-caption); font-weight: 600; }
.research-native-results h4 { margin: 0; font-size: var(--text-body); font-weight: 600; }
.research-native-results > p { margin-block: 8px; }
.research-native-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin-block: 12px; }
.research-native-values > div { min-width: 0; }
.research-native-values dt, .research-native-values dd > span { font-size: var(--text-caption); color: var(--pw-muted); }
.research-native-values dd { margin: 0; }
.research-native-values dd button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; font: inherit; background: none; border: 0; color: var(--pw-text); cursor: pointer; }
.research-native-values dd button:hover { text-decoration: underline; }
.research-native-values dd button:focus-visible { outline: 2px solid var(--pw-blue); outline-offset: 2px; }
.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-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-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-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; }
.research-native-values strong { font-size: var(--text-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.research-native-values small { display: block; }
.research-native-basis { font-size: var(--text-caption); }
.research-native-basis, .research-progress .research-native-basis p, .research-native-basis > summary { font-size: var(--text-body); }
.research-usage-basis { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 24px; margin-block: 8px 20px; font-size: var(--text-body); line-height: var(--leading-prose); }
.research-progress-basis dt, .research-usage-basis dt { color: var(--pw-muted); }
.research-progress-basis dd, .research-usage-basis dd { margin: 0; }
Expand Down Expand Up @@ -122,7 +131,8 @@
.research-progress select { max-width: 100%; }
.research-effect-metrics { gap: 8px; }
.research-assessment > summary { gap: 8px; }
.research-native-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.research-native-reading { align-items: flex-start; flex-direction: column; gap: 20px; }
.research-native-context { gap: 12px 24px; }
.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
@@ -1,5 +1,5 @@
import {useId, useRef, useState} from "react";
import {ArrowUpRight, ChevronDown, X} from "lucide-react";
import {ArrowUpRight, ChevronDown, FileText, X} from "lucide-react";
import {TRAJECTORY_METRICS} from "../../../../../../loopx/control_plane/capabilities/trajectory_assessment_types.js";
import type {AssessmentCitation, AssessmentVerdict, TrajectoryAssessment, TrajectoryEpisode, TrajectoryInput, TrajectoryMetric, TrajectorySolverUsage} from "../../../../../../loopx/control_plane/capabilities/trajectory_assessment_types.js";
import type {TrajectoryNativeOutcomes} from "../../../../../../loopx/control_plane/capabilities/trajectory_native_outcomes.js";
Expand Down Expand Up @@ -121,27 +121,38 @@ function NativeResults({native, zh, onCitation}: {native: ResearchProgressPack["
const outcomes = native?.projection;
if (!native || !outcomes) return <p className="research-native-empty">{zh ? "原生测量 · 未采集" : "Native measurements · not captured"}</p>;
const historical = native.applicability === "historical";
const points = [["initial", "首次提交", "Initial submission"], ["best_valid", "窗口内最佳有效值", "Best valid in capture"], ["retained", "原生保留结果", "Native retained result"], ["final_valid", "最后有效提交", "Final valid submission"]] as const;
const points = [["best_valid", "窗口内最佳有效值", "Best valid in capture"], ["initial", "首次提交", "Initial submission"], ["final_valid", "最后有效提交", "Final valid submission"], ["retained", "原生保留结果", "Native retained result"]] as const;
const period = new Intl.DateTimeFormat(zh ? "zh-CN" : "en", {timeZone: "UTC", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hour12: false,
...(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 ?
<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>{String(point.value)}</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 label={zh ? "测量说明" : "About native measurements"}>
<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>
{historical ? <p className="research-progress-warning" role="status">{zh ? "来源已变化或不可读;以下仅为历史捕获,当前结果未核验。" : "The source changed or is unavailable. These are historical captures; current results are unverified."}</p> : null}
<p>{outcomes.metric.name} · {outcomes.metric.unit} · {outcomes.metric.higher_is_better ? (zh ? "越高越好" : "higher is better") : (zh ? "越低越好" : "lower is better")} · {outcomes.valid_count} / {outcomes.sample_count} {zh ? "项有效结果" : "valid results"}</p>
<p>{outcomes.complete ? (zh ? "声明为完整前缀" : "Declared complete prefix") : (zh ? "部分窗口,起点未知" : "Partial window; initial unknown")} · <time dateTime={outcomes.start}>{outcomes.start}</time> — <time dateTime={outcomes.end}>{outcomes.end}</time></p>
<dl className="research-native-values">{points.map(([key, cn, en]) => {
const point = outcomes[key];
return <div key={key} 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)} · ${zh ? "查看原始证据" : "Read original evidence"}`}><strong>{String(point.value)}</strong><ArrowUpRight size={13} aria-hidden/></button>
<small>{zh ? "提交" : "Submission"} {point.submission_index}</small>
</> : <span>{zh ? "— 未知" : "— Unknown"}</span>}</dd></div>;
})}</dl>
<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>
<span>{period.formatRange(new Date(outcomes.start), new Date(outcomes.end))} UTC</span>
{!outcomes.complete ? <span>{zh ? "部分窗口 · 起点未知" : "Partial window · initial unknown"}</span> : null}
</div>
<details className="research-native-basis"><summary>{zh ? "测量来源与限制" : "Measurement sources and limits"}</summary>
<p>{native.artifact}<br/><code>{native.artifact_sha256}</code></p>
<dl><div><dt>{zh ? "捕获窗口" : "Capture window"}</dt><dd><time dateTime={outcomes.start}>{outcomes.start}</time> — <time dateTime={outcomes.end}>{outcomes.end}</time><br/>{outcomes.complete ? (zh ? "声明为完整前缀" : "Declared complete prefix") : (zh ? "部分窗口,起点未知" : "Partial window; initial unknown")}</dd></div>
<div><dt>{zh ? "指标与单位" : "Metric and unit"}</dt><dd>{outcomes.metric.name} · {outcomes.metric.unit}</dd></div>
<div><dt>{zh ? "方法" : "Method"}</dt><dd><code>{outcomes.method}</code></dd></div>
<div><dt>{zh ? "来源" : "Source"}</dt><dd>{native.artifact}<br/><code>{native.artifact_sha256}</code></dd></div></dl>
<dl>{points.map(([key, cn, en]) => {
const point = outcomes[key];
return point ? <div key={key}><dt>{zh ? cn : en}</dt><dd><code>{point.candidate_ref}</code><br/>{zh ? "提交" : "Submitted"}: {point.submitted_at ?? (zh ? "未知" : "Unknown")}<br/>{zh ? "收到结果" : "Result received"}: {point.observed_at}</dd></div> : null;
return point ? <div key={key}><dt>{zh ? cn : en}</dt><dd><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>
Expand Down
33 changes: 33 additions & 0 deletions docs/development/assets/research-native-results/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,36 @@ return focus, unknown retention and invalid results are exercised by the same
packaged scenario. Browsing starts no model or experiment and leaves the source
unchanged. These captures qualify a proposed packaged surface, not installed
adoption, user comprehension improvement or release readiness.

## Native measurement hierarchy

The UI source is `ee911667cbe664d7cbf8a914ee076d766a048c64`, based on main
`44050e953aa21f6deb932935fa158b5e415894c1`. The packaged capture run used
those source bytes; this documentation commit only records its visual evidence.

The `hierarchy-desktop.png` and `hierarchy-mobile.png` captures use the same
native-only fixture as `after-desktop.png` and `after-mobile.png`. The capture's
best valid value is now primary; initial, last valid and actually retained
results are compact context. Unknown retention stays explicit. A document icon
opens original evidence without suggesting a trend. Raw unit, direction,
valid-result coverage and a concise UTC window remain visible. Full timestamps,
submission identities, method, source digest and limitations are available in
one disclosure with body-sized text.

The `hierarchy-report-*.png` images show the same synthesis fixture as the
earlier ordinary report captures. The `hierarchy-sources-*.png` images use a
separate synthetic signed-value fixture: best, last and retained differ, so the
source view can be checked without treating best as adoption. These are whole
packaged workspace viewports, not live operating context or installed-App
readback. Desktop is 1280 × 900; narrow is 390 × 844. The narrow report view
uses the existing one-step report navigation; it is a selected reading position,
not the default top of the page.

The existing research-history scenario covers ordinary/deep/history reading,
historical results and source switching. The focused `research-native-reading`
scenario crosses the same real registration, typed native projection, SQLite
store and HTTP reader for higher/lower directions, negative and zero values,
invalid first/all-invalid/empty samples, partial windows, distinct retained
results and long units. It also checks exact citation return, source disclosure,
Chinese/English help, narrow layout and 200% text. No model or experiment is
executed; original sources and mutation counts are checked separately.
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.
2 changes: 2 additions & 0 deletions examples/personal-workspace-browser-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import { researchRecordSearchScenario } from "./personal-workspace-browser/resea
import { researchRouteReadingScenario } from "./personal-workspace-browser/research-route-reading.mjs";
import { researchDisplayLanguageScenario } from "./personal-workspace-browser/research-display-language.mjs";
import { researchMeasurementsScenario } from "./personal-workspace-browser/research-measurements.mjs";
import { researchNativeReadingScenario } from "./personal-workspace-browser/research-native-reading.mjs";
import { loopxModeScenario } from "./personal-workspace-browser/loopx-mode.mjs";
import { progressiveLoadingScenario } from "./personal-workspace-browser/progressive-loading.mjs";
import { stewardJourneyScenario } from "./personal-workspace-browser/steward-journey.mjs";
Expand Down Expand Up @@ -129,6 +130,7 @@ scenarioCatalog.push(attentionUserActionScenario);
scenarioCatalog.push(researchResultsScenario);
scenarioCatalog.push(researchHistoryScenario);
scenarioCatalog.push(researchMeasurementsScenario);
scenarioCatalog.push(researchNativeReadingScenario);
scenarioCatalog.push(researchFindingReaderScenario);
scenarioCatalog.push(researchRecordSearchScenario);
scenarioCatalog.push(researchRouteReadingScenario);
Expand Down
Loading
Loading