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
45 changes: 45 additions & 0 deletions research_ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,50 @@ function buildPretradePanel(pretrade) {
const reasons = Array.isArray(pretrade.reasons) && pretrade.reasons.length
? pretrade.reasons.map((reason) => `<span class="inline-chip">${escapeHtml(reason)}</span>`).join("")
: `<span class="muted-copy">No rejection reasons.</span>`;
const artifactEntries = [
{
label: "Validation artifact",
path: pretrade.latest_validation_path,
href: pretrade.latest_validation_href,
fallback: "Latest validation artifact not available yet.",
},
{
label: "Source artifact",
path: pretrade.source_artifact_path,
href: pretrade.source_artifact_href,
fallback: "Source artifact not available yet.",
},
].filter((artifact) => artifact.path || artifact.href);

const artifactLinks = artifactEntries.length
? `
<div class="artifact-list">
${artifactEntries.map((artifact) => {
const label = escapeHtml(artifact.label);
const path = escapeHtml(artifact.path || artifact.fallback);
if (artifact.href) {
return `
<a class="artifact-link" href="${escapeHtml(artifact.href)}" target="_blank" rel="noreferrer">
<span>${label}</span>
<span>${path}</span>
</a>
`;
}
return `
<div class="artifact-link">
<span>${label}</span>
<span>${path}</span>
</div>
`;
}).join("")}
</div>
`
: `
<div class="panel-empty compact-empty">
<strong>No artifact paths yet</strong>
<span>QuantLab will show the validation and source artifact paths here once the first bounded handoff is ingested.</span>
</div>
`;

return `
<div class="key-value-grid">
Expand All @@ -777,6 +821,7 @@ function buildPretradePanel(pretrade) {
${keyValue("Side", titleCase(pretrade.side || "-"))}
${keyValue("Draft ready", pretrade.ready_for_draft_execution_intent ? "Yes" : "No")}
</div>
${artifactLinks}
<div class="inline-list">${reasons}</div>
`;
}
Expand Down
2 changes: 2 additions & 0 deletions test/test_research_ui_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ def test_build_pretrade_handoff_payload_selects_latest_validation_artifact(tmp_p
assert payload["handoff_id"] == "handoff-newer"
assert payload["latest_validation_path"] == str(newer)
assert payload["latest_validation_href"] == "/outputs/pretrade_handoff/newer/pretrade_handoff_validation.json"
assert payload["source_artifact_path"] == "C:\\Users\\marce\\Documents\\meta_trade\\tests\\fixtures\\expected_quantlab_handoff.json"
assert payload["source_artifact_href"] is None
Comment on lines +514 to +515
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (testing): Avoid asserting on a hard-coded, absolute, Windows-specific path in the test

This hard-coded, user-specific Windows path will make the test fail on CI and on non-Windows or differently configured machines. Instead, derive the expected value from the test paths/fixtures already in use (e.g., via tmp_path or a known fixture root) and compare a constructed or normalized path (using os.path.join / os.path.normpath, or checking a relative suffix) so the test validates the contract without depending on a specific machine layout.



def test_normalize_launch_request_accepts_run_payload():
Expand Down
Loading