Skip to content

Commit 8298697

Browse files
feat: show research boundary verdict metadata
1 parent 466f147 commit 8298697

4 files changed

Lines changed: 40 additions & 13 deletions

File tree

apps/web/src/app/(workspace)/workspace/settings/SettingsClient.test.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ describe("SettingsClient account verification", () => {
2424
candidate_policy: "not-exposed-as-live-jobs",
2525
boundaries: [
2626
{
27-
key: "h2-output-cloud-geometry-candidate-no-runtime-job",
28-
title: "H2 output-cloud geometry candidate",
29-
admission_status: "watch",
27+
boundary_key: "h2-output-cloud-geometry-candidate-no-runtime-job",
28+
description: "H2 output-cloud geometry candidate",
29+
status: "watch-only",
30+
signal_strength: "strong-controlled-seed-stable",
31+
admission_blocker: "research-side-response-cache-geometry-not-second-public-asset-or-product-contract",
3032
},
3133
{
32-
key: "rediffuse-stl10-bounded-scout-and-score-norm-completed-weak-results-no-runtime-job",
33-
title: "ReDiffuse STL-10 weak scout",
34-
admission_status: "watch",
34+
boundary_key: "rediffuse-stl10-bounded-scout-and-score-norm-completed-weak-results-no-runtime-job",
35+
description: "ReDiffuse STL-10 weak scout",
36+
status: "watch-only",
37+
signal_strength: "weak-random-level",
38+
admission_blocker: "bounded-scout-and-score-norm-failed-membership-signal",
3539
},
3640
],
3741
source_readiness: { ready: true },
@@ -47,7 +51,9 @@ describe("SettingsClient account verification", () => {
4751
expect(markup).toContain(">0<");
4852
expect(markup).toContain("Research candidates stay outside live jobs");
4953
expect(markup).toContain("H2 output-cloud geometry candidate");
54+
expect(markup).toContain("strong-controlled-seed-stable / research-side-response-cache-geometry-not-second-public-asset-or-product-contract");
5055
expect(markup).toContain("ReDiffuse STL-10 weak scout");
56+
expect(markup).toContain("weak-random-level / bounded-scout-and-score-norm-failed-membership-signal");
5157
});
5258

5359
it("renders a verification entry point for pending email addresses", () => {

apps/web/src/app/(workspace)/workspace/settings/SettingsClient.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,12 @@ export function SettingsClient({
880880
</p>
881881
{researchBoundarySummary.previewLabels.length > 0 ? (
882882
<div className="mt-3 space-y-1.5">
883-
{researchBoundarySummary.previewLabels.map((label) => (
884-
<div key={label} className="truncate rounded-lg bg-muted/20 px-2 py-1 font-mono text-[10px] text-muted-foreground">
885-
{label}
883+
{researchBoundarySummary.previewLabels.map((label, index) => (
884+
<div key={label} className="rounded-lg bg-muted/20 px-2 py-1 font-mono text-[10px] text-muted-foreground">
885+
<div className="truncate">{label}</div>
886+
{researchBoundarySummary.previewDetails[index] ? (
887+
<div className="mt-0.5 truncate opacity-75">{researchBoundarySummary.previewDetails[index]}</div>
888+
) : null}
886889
</div>
887890
))}
888891
</div>

apps/web/src/lib/research-boundaries.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ describe("getResearchBoundarySummary", () => {
88
status: "ok",
99
boundaries: [
1010
{
11-
key: "h2-output-cloud-geometry-candidate-no-runtime-job",
12-
title: "H2 output-cloud geometry candidate",
13-
admission_status: "watch",
11+
boundary_key: "h2-output-cloud-geometry-candidate-no-runtime-job",
12+
description: "H2 output-cloud geometry candidate",
13+
status: "watch-only",
14+
signal_strength: "strong-controlled-seed-stable",
15+
admission_blocker: "research-side-response-cache-geometry-not-second-public-asset-or-product-contract",
1416
},
1517
{
1618
key: "rediffuse-stl10-bounded-scout-and-score-norm-completed-weak-results-no-runtime-job",
@@ -31,6 +33,10 @@ describe("getResearchBoundarySummary", () => {
3133
"H2 output-cloud geometry candidate",
3234
"ReDiffuse STL-10 weak scout",
3335
]);
36+
expect(summary.previewDetails).toEqual([
37+
"strong-controlled-seed-stable / research-side-response-cache-geometry-not-second-public-asset-or-product-contract",
38+
"watch",
39+
]);
3440
});
3541

3642
it("sanitizes boundary preview labels before they are rendered", () => {

apps/web/src/lib/research-boundaries.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { sanitizeRuntimeText } from "@/lib/runtime-text";
22

33
export type ResearchBoundary = {
4+
boundary_key?: string;
45
key?: string;
56
title?: string;
67
label?: string;
8+
description?: string;
79
status?: string;
810
admission_status?: string;
11+
signal_strength?: string;
12+
admission_blocker?: string;
13+
promotion_required?: string;
914
};
1015

1116
export type ResearchBoundariesPayload = {
@@ -27,6 +32,7 @@ export type ResearchBoundarySummary = {
2732
admittedBoundaryCount: number;
2833
ready: boolean;
2934
previewLabels: string[];
35+
previewDetails: string[];
3036
};
3137

3238
export function getResearchBoundarySummary(
@@ -43,9 +49,15 @@ export function getResearchBoundarySummary(
4349
admittedBoundaryCount: boundaryItems.filter(isAdmittedBoundary).length,
4450
ready: payload?.status === "ok" || payload?.source_readiness?.ready === true,
4551
previewLabels: boundaryItems.slice(0, 3).map((boundary) => (
46-
sanitizeRuntimeText(boundary.title ?? boundary.label ?? boundary.key ?? fallbackLabel)
52+
sanitizeRuntimeText(boundary.title ?? boundary.label ?? boundary.description ?? boundary.key ?? boundary.boundary_key ?? fallbackLabel)
4753
?? fallbackLabel
4854
)),
55+
previewDetails: boundaryItems.slice(0, 3).map((boundary) => {
56+
const signal = sanitizeRuntimeText(boundary.signal_strength ?? "");
57+
const blocker = sanitizeRuntimeText(boundary.admission_blocker ?? "");
58+
if (signal && blocker) return `${signal} / ${blocker}`;
59+
return signal || blocker || sanitizeRuntimeText(boundary.admission_status ?? boundary.status ?? "") || fallbackLabel;
60+
}),
4961
};
5062
}
5163

0 commit comments

Comments
 (0)