+ Organize hypotheses, strategies and findings with links to the exact backtests supporting + them. +
+ {open && ( +Loading research projects...
} + {error && ( ++ {error} +
+ +No research projects yet. Create a project to begin.
+ )} + {!loading && !error && ( ++ {project.description || 'No description yet.'} +
++ Owner: {project.ownerPrincipal} · Updated {project.updatedAt} +
+Missing research project.
+ ); +} +function ProjectWorkspace({ projectId }: { projectId: string }) { + const [params, setParams] = useSearchParams(); + const mounted = useRef(false); + const pending = useRef(false); + const [project, setProject] = useState+ {section}: {errors[section]} +
+ +Loading research workspace...
} + {sectionError('project')} + {project && ( + <> ++ {project.description || 'No description yet.'} +
++ Project revision {project.revision} · Owner: {project.ownerPrincipal} · Updated{' '} + {project.updatedAt} +
+ {project.archived && ( ++ Archived project. Records, history and evidence remain available; restore the + project to make changes. +
+ )} + {!editing && canWrite && ( + + )}{' '} + + {editing && !project.archived && ( + + )} + {mutationError && ( ++ {mutationError} +
+ )} + {conflict && ( ++ Review the saved project before another update. Your draft has been preserved. +
+ ++ No strategies linked. Link a strategy, then choose an immutable version for a + backtest. +
+ )} + {!errors.strategies && ( +No hypotheses yet.
+ )} + {!errors.hypotheses && ( ++ Unvalidated · Revision {item.latestRevision.ordinal} · Declared{' '} + {item.latestRevision.contentOrigin} +
++ Save findings from a completed backtest result to attach exact evidence. +
+ {!loading && !errors.artifacts && !visibleArtifacts.length && ( +No notes or findings yet.
+ )} + {!errors.artifacts && ( ++ {item.kind} · Unvalidated · Revision {item.latestRevision.ordinal} +
+Select one research entry at a time.
} + {selection && ( +
+ Linked hypothesis revision: {revisionId}
+
{error}
} +Loading research entry and revision history...
} + {loadError && ( ++ {loadError} +
+ ++ Revision {revision.ordinal} · {revision.createdAt} · {revision.id} +
+ {revisionId &&Immutable history: this revision is read-only.
} + {writeBlocked && ( ++ {writeBlocked} Research entries are read-only until the project can be verified. +
+ )} + {archived &&Archived project: research entries are read-only.
} ++ {'proposition' in revision ? revision.proposition : revision.body} +
+ {'validationCriteria' in revision && ( ++ {revision.validationCriteria || 'No criteria recorded.'} +
++ {error} +
+ )} + {editing && !readonly && ( + + )} ++ {origin} · Submitted by {authorship.submittedBy} · Unvalidated narrative +
+ ); +} +export function evidenceReferences(evidence: ResearchEvidence[]): ResearchEvidenceReference[] { + return evidence.map(({ runId, metricsVersion, metricPath, strategyVersionId }) => ({ + runId, + metricsVersion, + metricPath, + ...(strategyVersionId ? { strategyVersionId } : {}), + })); +} +export function researchMetricLabel(path: string): string { + const name = path.split('.').at(-1) ?? path; + return name.replace(/([A-Z])/g, ' $1').replace(/^./, letter => letter.toUpperCase()); +} +export function formatResearchEvidence(evidence: ResearchEvidence): string { + if (evidence.value === null) { + return `Unavailable — ${(evidence.unavailableReason ?? 'not reported').replace(/-/g, ' ')}`; + } + const value = + evidence.unit === 'fraction' + ? new Intl.NumberFormat(undefined, { style: 'percent', maximumSignificantDigits: 12 }).format( + evidence.value + ) + : String(evidence.value); + return evidence.unit === 'currency' ? `${value} (account currency)` : value; +} +/** Display server-resolved measurements; the browser never recomputes cited results. */ +export function ResearchEvidenceList({ evidence }: { evidence: ResearchEvidence[] }) { + if (!evidence.length) { + returnNo measured evidence attached.
; + } + return ( ++ These measurements support review. They do not validate the narrative. +
+ {evidence.map(item => ( ++ {researchMetricLabel(item.metricPath)}: + {formatResearchEvidence(item)} +
++ {item.metricsVersion} · {item.metricPath} · Unit: {item.unit} ·{' '} + {item.resultKind === 'legacy' + ? 'Legacy · Unverified economics' + : 'Canonical Rust result'} + {' · '}Engine: {item.financialEngine} +
++ Raw value: {item.value === null ? 'Unavailable' : String(item.value)} · Run:{' '} + {item.runId} · Dataset: {item.datasetHash ?? 'Unknown'} +
+ {!!item.limitations.length && ( +