Shape of the run
Where the time went {{ trial.dur_total|secs }}
{# All four phases Harbor records, and the same four on a standard run: Env its environment, Setup the agent's start, Verify its check and score (a - model judge included). A phase that took no time draws neither a segment - nor a chip, so the bar and the chips always match. #} + model judge included). A recorded phase has its chip however short it + was: a check that took no time was still made. One never recorded has + none, and Other, which is computed, only when there is some. A segment + needs enough time to draw. #} {%- if job.runner %} {%- set says = {'env': "The unit's environment: the driver's setup, the relay, its image", 'setup': "The agent's start and session, its MCP servers included", 'verify': "The unit's check and its score, a model judge included", 'other': 'After the check: the container, the relay and the trial written'} %} {%- else %} @@ -134,7 +136,7 @@Where the time went {{ trial.dur_total
{% for key, label, dur, title in phases if dur|phase %}{% endfor %}
- {% for key, label, dur, title in phases if dur|phase %}{{ label }} {{ dur|secs }}
+ {% for key, label, dur, title in phases if (dur is not none and key != 'other') or dur|phase %}{{ label }} {{ dur|secs }}
{% endfor %}
diff --git a/app/ui_tests/test_page_checks.py b/app/ui_tests/test_page_checks.py
index 542ddfbc..9c93ded0 100644
--- a/app/ui_tests/test_page_checks.py
+++ b/app/ui_tests/test_page_checks.py
@@ -87,9 +87,9 @@ def page(self, name: str) -> str:
# --- views.md ---------------------------------------------------------
- def test_a_degenerate_clock_keeps_the_totals_and_draws_no_empty_phase(self):
+ def test_a_degenerate_clock_keeps_the_totals(self):
control = self.page("trial-oracle-control")
- self.assertNotIn("Setup ", control) # a phase that took no time has no chip
+ self.assertIn("Verify 6.7s", control)
self.assertIn("Agent 0.2s", control) # the all-call total stays
diff --git a/app/ui_tests/test_routes.py b/app/ui_tests/test_routes.py
index 156cb7db..4a52d43f 100644
--- a/app/ui_tests/test_routes.py
+++ b/app/ui_tests/test_routes.py
@@ -453,6 +453,27 @@ def test_an_unrecognised_exception_reads_unknown_with_its_type_shown(self):
self.assertNotIn("Agent error", trial_page)
+ def test_a_recorded_phase_keeps_its_chip_however_short(self):
+ """A check that took no time was still made: its chip stays, with no
+ segment to draw. A phase never recorded has neither."""
+ job_dir = self.root / "instant-check"
+ synthetic_job(self.root, "instant-check")
+ result = job_dir / "task-001" / "result.json"
+ res = json.loads(result.read_text())
+ res.update(started_at="2026-09-13T17:00:00+00:00", finished_at="2026-09-13T17:00:12+00:00",
+ environment_setup={"started_at": "2026-09-13T17:00:00+00:00", "finished_at": "2026-09-13T17:00:02+00:00"},
+ agent_execution={"started_at": "2026-09-13T17:00:02+00:00", "finished_at": "2026-09-13T17:00:12+00:00"},
+ verifier={"started_at": "2026-09-13T17:00:12+00:00", "finished_at": "2026-09-13T17:00:12.000500+00:00"})
+ write_json(result, res)
+ job = parse.parse_job(str(job_dir))
+ with patch.object(web.shared, "_jobs_for_request", return_value=[job]):
+ html = self.get_ok("/trial/instant-check/task-001").get_data(as_text=True)
+ panel = html.split("Where the time went", 1)[1].split('
Date: Mon, 16 Nov 2026 23:02:29 +0100
Subject: [PATCH 03/13] feat(web): show durations to two decimals
One decimal turned 0.05 s into 0.1s and hid differences the clock had
measured. Seconds and minutes now carry two decimals.
---
app/ui_tests/test_comparison_routes.py | 2 +-
app/ui_tests/test_page_checks.py | 8 ++++----
app/ui_tests/test_routes.py | 4 ++--
app/ui_tests/test_run_routes.py | 2 +-
app/web/filters.py | 11 ++++-------
5 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/app/ui_tests/test_comparison_routes.py b/app/ui_tests/test_comparison_routes.py
index 18c42812..be490e1e 100644
--- a/app/ui_tests/test_comparison_routes.py
+++ b/app/ui_tests/test_comparison_routes.py
@@ -124,7 +124,7 @@ def test_task_quick_metrics_use_recorded_total_and_count_cached_input_once(self)
body = self.get(cohort="matched")
totals = re.findall(r'Total time(.*?)', body)
tokens = re.findall(r'Tokens(.*?)', body)
- self.assertEqual(totals, ["2.1m", "—"])
+ self.assertEqual(totals, ["2.08m", "—"])
self.assertEqual(tokens, ["130", "—"])
self.assertIn("Token usage not recorded", body)
self.right.agent_name = "nop"
diff --git a/app/ui_tests/test_page_checks.py b/app/ui_tests/test_page_checks.py
index 9c93ded0..3bb1ce3e 100644
--- a/app/ui_tests/test_page_checks.py
+++ b/app/ui_tests/test_page_checks.py
@@ -89,8 +89,8 @@ def page(self, name: str) -> str:
def test_a_degenerate_clock_keeps_the_totals(self):
control = self.page("trial-oracle-control")
- self.assertIn("Verify 6.7s", control)
- self.assertIn("Agent 0.2s", control) # the all-call total stays
+ self.assertIn("Verify 6.72s", control)
+ self.assertIn("Agent 0.20s", control) # the all-call total stays
@@ -117,8 +117,8 @@ def test_the_harbor_that_ran_is_shown_where_the_job_recorded_it(self):
def test_the_board_of_a_recorded_run_renders_from_its_own_clock(self):
"""the page half; the replay of every pair is test_live"""
board = self.page("job-oracle-board")
- self.assertIn("hello-alpine Resolved 0 23s 4.9s 0.2s 6.7s", board)
- self.assertIn("reward-kit-example Resolved 0 24s 2.9s 2.0s 7.9s", board)
+ self.assertIn("hello-alpine Resolved 0 22.91s 4.90s 0.20s 6.72s", board)
+ self.assertIn("reward-kit-example Resolved 0 24.29s 2.93s 1.95s 7.91s", board)
if __name__ == "__main__":
diff --git a/app/ui_tests/test_routes.py b/app/ui_tests/test_routes.py
index 4a52d43f..ec6d3b2b 100644
--- a/app/ui_tests/test_routes.py
+++ b/app/ui_tests/test_routes.py
@@ -253,9 +253,9 @@ def test_run_trial_table_uses_recorded_totals_and_keeps_missing_usage_distinct(s
trial.dur_env, trial.dur_agent, trial.dur_verifier = 1, 2, 3
with patch.object(web.shared, "_jobs_for_request", return_value=[job]):
for agent, duration, usage, total, tokens in (
- ("fixture-agent", 135, (1000, 500, 900), "2.2m", "1.5k"),
+ ("fixture-agent", 135, (1000, 500, 900), "2.25m", "1.5k"),
("fixture-agent", None, (0, 0, 0), "—", "—"),
- ("oracle", 0, (0, 0, 0), "0.0s", "0"),
+ ("oracle", 0, (0, 0, 0), "0.00s", "0"),
):
with self.subTest(agent=agent, duration=duration):
job.agent_name = agent
diff --git a/app/ui_tests/test_run_routes.py b/app/ui_tests/test_run_routes.py
index a662e2d0..6d494300 100644
--- a/app/ui_tests/test_run_routes.py
+++ b/app/ui_tests/test_run_routes.py
@@ -195,7 +195,7 @@ def test_the_run_s_page_shows_its_stages_and_its_units(self):
self.assertEqual((got["units"]["done"], got["units"]["n"], got["units"]["passed"], got["units"]["failed"]), (2, 10, 1, 1))
page = self.client.get("/job/std-x"); self.addCleanup(page.close)
html = page.get_data(as_text=True)
- self.assertIn('Base image41s', html)
+ self.assertIn(' Base image41.00s', html)
self.assertIn(' ', html) # the running step, numbered
diff --git a/app/web/filters.py b/app/web/filters.py
index 19a30fa7..84a7402a 100644
--- a/app/web/filters.py
+++ b/app/web/filters.py
@@ -136,16 +136,13 @@ def _phase(value):
@app.template_filter("secs")
def _secs(value):
- """Seconds with the precision the clock behind them has.
-
- Show tenths below ten seconds, whole seconds below a minute, and tenths
- of minutes above that.
+ """Seconds to two decimals, minutes to two decimals from a minute on:
+ the clock behind them is finer than that, so rounding further would
+ hide a difference it measured.
"""
if value is None:
return "—"
- if value < 9.95: # what .1f would still show as one digit
- return f"{value:.1f}s"
- return f"{value:.0f}s" if value < 60 else f"{value / 60:.1f}m"
+ return f"{value:.2f}s" if value < 59.995 else f"{value / 60:.2f}m"
@app.template_filter("nsround")
From 8754df4962691da5e9289eafc05ae2c20d5a5126 Mon Sep 17 00:00:00 2001
From: Etienne Filhol
Date: Mon, 16 Nov 2026 23:02:29 +0100
Subject: [PATCH 04/13] refactor(traces): make the trial's time bar a compact
overview tile
The "Shape of the run" title goes, and the time bar becomes a tile in a
grid that other summaries can join.
---
app/static/style.css | 7 +++++++
app/templates/traces/trial.html | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/app/static/style.css b/app/static/style.css
index 1473f91c..a0030693 100644
--- a/app/static/style.css
+++ b/app/static/style.css
@@ -615,6 +615,13 @@ button.seg:hover { filter: brightness(1.25); }
color-mix(in srgb, var(--text-faint) 85%, transparent) 0 3px,
color-mix(in srgb, var(--text-faint) 35%, transparent) 3px 6px);
}
+/* the trial's overview: small tiles side by side, the time one among them */
+.overview-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 12px; margin-bottom: 1rem; }
+.overview-tiles > .panel { margin: 0; padding: .85rem 1rem; }
+.overview-tiles h3 { margin: 0 0 .6rem; }
+.overview-tiles .bar.phases { height: 8px; }
+.overview-tiles .legend { gap: .3rem; margin-top: .6rem; }
+.overview-tiles .legend .chip { font-size: .72rem; padding: .12rem .5rem; }
.chip.ph-other { color: var(--text-dim); }
.chip.ph-other::before { background: var(--text-faint); }
.chip.ph-env::before { background: var(--rate_limited); }
diff --git a/app/templates/traces/trial.html b/app/templates/traces/trial.html
index eb261466..3f8559c9 100644
--- a/app/templates/traces/trial.html
+++ b/app/templates/traces/trial.html
@@ -112,12 +112,11 @@ {{ trial.exception_type }}
{% endif %}
-Shape of the run
-
{# The phase bar reads only trial.*, so it renders whether or not a trajectory
was recorded: a trial that failed before writing one still shows its timing. #}
{% set total = trial.dur_phases + trial.dur_other %}
{% if total %}
+
Where the time went {{ trial.dur_total|secs }}
{# All four phases Harbor records, and the same four on a standard run: Env
@@ -140,6 +139,7 @@ Where the time went {{ trial.dur_total
{% endfor %}
+
{% endif %}
{% if traj and traj.error %}
From f477508cdbe4bb348bb26e91c77ad48a03649ce8 Mon Sep 17 00:00:00 2001
From: Etienne Filhol
Date: Mon, 16 Nov 2026 23:13:19 +0100
Subject: [PATCH 05/13] fix(traces): draw no usage panel when a trajectory has
nothing for it
A trajectory with no per-step usage, no reasoning total and no tool call
opened the panel and left it empty.
---
app/templates/traces/trial.html | 5 +++--
app/ui_tests/test_routes.py | 10 ++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/templates/traces/trial.html b/app/templates/traces/trial.html
index 3f8559c9..a68831e6 100644
--- a/app/templates/traces/trial.html
+++ b/app/templates/traces/trial.html
@@ -145,6 +145,8 @@ Where the time went {{ trial.dur_total
{% if traj and traj.error %}
Trajectory unreadable
{{ traj.error }}
{% elif traj %}
+ {# usage and tool calls; a trajectory with neither (one answer, no per-step usage) has no panel #}
+ {% if traj.token_series or traj.total_reasoning_tokens is not none or traj.calls %}
{% set has_growth = traj.token_series|length > 1 %}
{% if has_growth %}
@@ -239,8 +241,7 @@ Usage
{% endif %}
{% endif %}
-
-
+ {% endif %}
{% if loc %}
diff --git a/app/ui_tests/test_routes.py b/app/ui_tests/test_routes.py
index ec6d3b2b..9a66a926 100644
--- a/app/ui_tests/test_routes.py
+++ b/app/ui_tests/test_routes.py
@@ -453,6 +453,16 @@ def test_an_unrecognised_exception_reads_unknown_with_its_type_shown(self):
self.assertNotIn("Agent error", trial_page)
+ def test_a_trajectory_without_usage_or_tool_calls_draws_no_empty_panel(self):
+ """The synthetic trajectory is messages only: no per-step usage, no
+ tool call. Its overview has nothing to put in that panel."""
+ synthetic_job(self.root, "messages-only")
+ job = parse.parse_job(str(self.root / "messages-only"))
+ with patch.object(web.shared, "_jobs_for_request", return_value=[job]):
+ html = self.get_ok("/trial/messages-only/task-001").get_data(as_text=True)
+ overview = html.split('id="trial-overview"', 1)[1].split('id="trial-judgement"', 1)[0]
+ self.assertNotRegex(overview, r'\s*')
+
def test_a_recorded_phase_keeps_its_chip_however_short(self):
"""A check that took no time was still made: its chip stays, with no
segment to draw. A phase never recorded has neither."""
From 6ce49e66ed4b299a89e59dcc954a36497fe6dada Mon Sep 17 00:00:00 2001
From: Etienne Filhol
Date: Mon, 16 Nov 2026 23:26:17 +0100
Subject: [PATCH 06/13] feat(traces): read, download and copy a trial's records
The Artifacts tab lists only the records a trial wrote, each with Read
and Download. A record's page gains Copy and Download, both of the whole
record redacted as the reader shows it, and its back button returns to
the Artifacts tab rather than the overview.
---
app/nullius/runs/artifacts.py | 12 +++++++++---
app/static/style.css | 2 ++
app/templates/base.html | 17 +++++++++++++++--
app/templates/traces/artifact.html | 7 ++++++-
app/templates/traces/trial.html | 7 +++++--
app/ui_tests/test_routes.py | 10 ++++++++++
app/web/traces.py | 21 ++++++++++++++++++++-
7 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/app/nullius/runs/artifacts.py b/app/nullius/runs/artifacts.py
index 388ede17..5adf4e70 100644
--- a/app/nullius/runs/artifacts.py
+++ b/app/nullius/runs/artifacts.py
@@ -48,12 +48,18 @@ def listing(trial_dir):
return records
-def read(trial_dir, key, page=1):
+def whole(trial_dir, key):
+ """The record redacted, up to ``MAX_READ``, and whether it was cut there:
+ what a download or a copy carries, never more than the reader shows."""
path = path_for(trial_dir, key)
with open(path, encoding="utf-8", errors="replace") as handle:
raw = handle.read(MAX_READ + 1)
+ return redact(raw[:MAX_READ]), len(raw) > MAX_READ
+
+
+def read(trial_dir, key, page=1):
# Redact before slicing so credentials cannot straddle visible chunks.
- text = redact(raw[:MAX_READ])
+ text, truncated = whole(trial_dir, key)
pages = max(1, (len(text) + CHUNK_SIZE - 1) // CHUNK_SIZE)
try:
page = int(page)
@@ -63,5 +69,5 @@ def read(trial_dir, key, page=1):
start = (page - 1) * CHUNK_SIZE
return dict(key=key, label=FILES[key][0], filename=FILES[key][1], page=page,
pages=pages, text=text[start:start + CHUNK_SIZE], empty=not text,
- truncated=len(raw) > MAX_READ, characters=len(text), start=start,
+ truncated=truncated, characters=len(text), start=start,
end=min(start + CHUNK_SIZE, len(text)))
diff --git a/app/static/style.css b/app/static/style.css
index a0030693..d4208aaa 100644
--- a/app/static/style.css
+++ b/app/static/style.css
@@ -356,6 +356,8 @@ button.seg:hover { filter: brightness(1.25); }
/* table toolbar + column menu */
.table-tools { display: flex; align-items: center; gap: .75rem; margin: 0 0 .6rem; }
+.artifact-actions { text-align: right; white-space: nowrap; }
+.artifact-actions .btn + .btn { margin-left: .35rem; }
.menu-wrap { position: relative; }
.btn.sm { font-size: .8rem; padding: .42rem .75rem; }
.menu {
diff --git a/app/templates/base.html b/app/templates/base.html
index 08c97a7f..8158ce0d 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -423,9 +423,22 @@
// clipboard and confirm inline. The execCommand fallback covers
// non-secure origins, where navigator.clipboard is undefined.
document.addEventListener('click', async (e) => {
- const btn = e.target.closest('[data-copy]');
+ const btn = e.target.closest('[data-copy], [data-copy-url]');
if (!btn) return;
- const text = btn.dataset.copy;
+ // data-copy-url: text too long for an attribute (a whole record), fetched on click
+ let text = btn.dataset.copy;
+ if (text === undefined) {
+ try {
+ const r = await nulliusFetch(btn.dataset.copyUrl, {cache: 'no-store'});
+ if (!r.ok) throw new Error(r.status);
+ text = await r.text();
+ } catch {
+ const label = btn.textContent;
+ btn.textContent = 'copy failed';
+ setTimeout(() => { btn.textContent = label; }, 1200);
+ return;
+ }
+ }
try {
await navigator.clipboard.writeText(text);
} catch {
diff --git a/app/templates/traces/artifact.html b/app/templates/traces/artifact.html
index aa9bbb37..8d21d8c6 100644
--- a/app/templates/traces/artifact.html
+++ b/app/templates/traces/artifact.html
@@ -2,7 +2,8 @@
{% block title %}{{ artifact.label }} — Nullius{% endblock %}
{% block crumb %}/ runs / {{ job.job_id }} / {{ trial.task_base }} / artifacts{% endblock %}
{% block body %}
-
+{% set download = url_for('artifact_download', job_id=job.job_id, trial_name=trial.trial_name, key=artifact.key, workspace=request.args.get('workspace')) %}
+
{{ artifact.label }}
{{ artifact.filename }} · source record · credential-shaped values redacted
{% if artifact.truncated %}This record exceeds the viewer’s 16 MiB limit. The first portion is available here; the original file is intact.
{% endif %}
@@ -10,6 +11,10 @@
Page {{ artifact.page }} of {{ artifact.pages }} · characters {{ artifact.start + 1 if artifact.characters else 0 }}–{{ artifact.end }} of {{ artifact.characters }}
{% if artifact.page > 1 %}Previous{% endif %}
{% if artifact.page < artifact.pages %}Next{% endif %}
+ {% if not artifact.empty %}
+
+ Download
+ {% endif %}
{% if artifact.empty %}
This record is empty.
{% else %}{{ artifact.text }}{% endif %}
{% endblock %}
diff --git a/app/templates/traces/trial.html b/app/templates/traces/trial.html
index a68831e6..1555fb51 100644
--- a/app/templates/traces/trial.html
+++ b/app/templates/traces/trial.html
@@ -644,13 +644,16 @@ Waterfall
Artifacts
Read the recorded source files. Content is redacted and paged; source files remain intact.
+ {% if artifacts %}
- Record Availability Size
+ Record Size
{% for artifact in artifacts %}
- {{ artifact.label }} {{ 'Recorded' if artifact.exists else 'Not recorded' }} {{ ((artifact.size / 1024)|round(1)) ~ ' KB' if artifact.exists else '—' }} {% if artifact.exists %}Read →{% endif %}
+ {{ artifact.label }} {{ '%.2f'|format(artifact.size / 1024) }} KB
+ Read Download
{% endfor %}
+ {% endif %}
{{ trial.exception_type }}
Where the time went {{ trial.dur_total|secs }}
{# All four phases Harbor records, and the same four on a standard run: Env @@ -140,6 +139,7 @@Where the time went {{ trial.dur_total {% endfor %}
Where the time went {{ trial.dur_total
{% if traj and traj.error %}
Trajectory unreadable
{{ traj.error }}
{% elif traj %}
+ {# usage and tool calls; a trajectory with neither (one answer, no per-step usage) has no panel #}
+ {% if traj.token_series or traj.total_reasoning_tokens is not none or traj.calls %}
{% set has_growth = traj.token_series|length > 1 %}
{% if has_growth %}
@@ -239,8 +241,7 @@ Usage
{% endif %}
{% endif %}
-
-
+ {% endif %}
{% if loc %}
diff --git a/app/ui_tests/test_routes.py b/app/ui_tests/test_routes.py
index ec6d3b2b..9a66a926 100644
--- a/app/ui_tests/test_routes.py
+++ b/app/ui_tests/test_routes.py
@@ -453,6 +453,16 @@ def test_an_unrecognised_exception_reads_unknown_with_its_type_shown(self):
self.assertNotIn("Agent error", trial_page)
+ def test_a_trajectory_without_usage_or_tool_calls_draws_no_empty_panel(self):
+ """The synthetic trajectory is messages only: no per-step usage, no
+ tool call. Its overview has nothing to put in that panel."""
+ synthetic_job(self.root, "messages-only")
+ job = parse.parse_job(str(self.root / "messages-only"))
+ with patch.object(web.shared, "_jobs_for_request", return_value=[job]):
+ html = self.get_ok("/trial/messages-only/task-001").get_data(as_text=True)
+ overview = html.split('id="trial-overview"', 1)[1].split('id="trial-judgement"', 1)[0]
+ self.assertNotRegex(overview, r'\s*')
+
def test_a_recorded_phase_keeps_its_chip_however_short(self):
"""A check that took no time was still made: its chip stays, with no
segment to draw. A phase never recorded has neither."""
From 6ce49e66ed4b299a89e59dcc954a36497fe6dada Mon Sep 17 00:00:00 2001
From: Etienne Filhol
Date: Mon, 16 Nov 2026 23:26:17 +0100
Subject: [PATCH 06/13] feat(traces): read, download and copy a trial's records
The Artifacts tab lists only the records a trial wrote, each with Read
and Download. A record's page gains Copy and Download, both of the whole
record redacted as the reader shows it, and its back button returns to
the Artifacts tab rather than the overview.
---
app/nullius/runs/artifacts.py | 12 +++++++++---
app/static/style.css | 2 ++
app/templates/base.html | 17 +++++++++++++++--
app/templates/traces/artifact.html | 7 ++++++-
app/templates/traces/trial.html | 7 +++++--
app/ui_tests/test_routes.py | 10 ++++++++++
app/web/traces.py | 21 ++++++++++++++++++++-
7 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/app/nullius/runs/artifacts.py b/app/nullius/runs/artifacts.py
index 388ede17..5adf4e70 100644
--- a/app/nullius/runs/artifacts.py
+++ b/app/nullius/runs/artifacts.py
@@ -48,12 +48,18 @@ def listing(trial_dir):
return records
-def read(trial_dir, key, page=1):
+def whole(trial_dir, key):
+ """The record redacted, up to ``MAX_READ``, and whether it was cut there:
+ what a download or a copy carries, never more than the reader shows."""
path = path_for(trial_dir, key)
with open(path, encoding="utf-8", errors="replace") as handle:
raw = handle.read(MAX_READ + 1)
+ return redact(raw[:MAX_READ]), len(raw) > MAX_READ
+
+
+def read(trial_dir, key, page=1):
# Redact before slicing so credentials cannot straddle visible chunks.
- text = redact(raw[:MAX_READ])
+ text, truncated = whole(trial_dir, key)
pages = max(1, (len(text) + CHUNK_SIZE - 1) // CHUNK_SIZE)
try:
page = int(page)
@@ -63,5 +69,5 @@ def read(trial_dir, key, page=1):
start = (page - 1) * CHUNK_SIZE
return dict(key=key, label=FILES[key][0], filename=FILES[key][1], page=page,
pages=pages, text=text[start:start + CHUNK_SIZE], empty=not text,
- truncated=len(raw) > MAX_READ, characters=len(text), start=start,
+ truncated=truncated, characters=len(text), start=start,
end=min(start + CHUNK_SIZE, len(text)))
diff --git a/app/static/style.css b/app/static/style.css
index a0030693..d4208aaa 100644
--- a/app/static/style.css
+++ b/app/static/style.css
@@ -356,6 +356,8 @@ button.seg:hover { filter: brightness(1.25); }
/* table toolbar + column menu */
.table-tools { display: flex; align-items: center; gap: .75rem; margin: 0 0 .6rem; }
+.artifact-actions { text-align: right; white-space: nowrap; }
+.artifact-actions .btn + .btn { margin-left: .35rem; }
.menu-wrap { position: relative; }
.btn.sm { font-size: .8rem; padding: .42rem .75rem; }
.menu {
diff --git a/app/templates/base.html b/app/templates/base.html
index 08c97a7f..8158ce0d 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -423,9 +423,22 @@
// clipboard and confirm inline. The execCommand fallback covers
// non-secure origins, where navigator.clipboard is undefined.
document.addEventListener('click', async (e) => {
- const btn = e.target.closest('[data-copy]');
+ const btn = e.target.closest('[data-copy], [data-copy-url]');
if (!btn) return;
- const text = btn.dataset.copy;
+ // data-copy-url: text too long for an attribute (a whole record), fetched on click
+ let text = btn.dataset.copy;
+ if (text === undefined) {
+ try {
+ const r = await nulliusFetch(btn.dataset.copyUrl, {cache: 'no-store'});
+ if (!r.ok) throw new Error(r.status);
+ text = await r.text();
+ } catch {
+ const label = btn.textContent;
+ btn.textContent = 'copy failed';
+ setTimeout(() => { btn.textContent = label; }, 1200);
+ return;
+ }
+ }
try {
await navigator.clipboard.writeText(text);
} catch {
diff --git a/app/templates/traces/artifact.html b/app/templates/traces/artifact.html
index aa9bbb37..8d21d8c6 100644
--- a/app/templates/traces/artifact.html
+++ b/app/templates/traces/artifact.html
@@ -2,7 +2,8 @@
{% block title %}{{ artifact.label }} — Nullius{% endblock %}
{% block crumb %}/ runs / {{ job.job_id }} / {{ trial.task_base }} / artifacts{% endblock %}
{% block body %}
-
+{% set download = url_for('artifact_download', job_id=job.job_id, trial_name=trial.trial_name, key=artifact.key, workspace=request.args.get('workspace')) %}
+
{{ artifact.label }}
{{ artifact.filename }} · source record · credential-shaped values redacted
{% if artifact.truncated %}This record exceeds the viewer’s 16 MiB limit. The first portion is available here; the original file is intact.
{% endif %}
@@ -10,6 +11,10 @@
Page {{ artifact.page }} of {{ artifact.pages }} · characters {{ artifact.start + 1 if artifact.characters else 0 }}–{{ artifact.end }} of {{ artifact.characters }}
{% if artifact.page > 1 %}Previous{% endif %}
{% if artifact.page < artifact.pages %}Next{% endif %}
+ {% if not artifact.empty %}
+
+ Download
+ {% endif %}
{% if artifact.empty %}
Trajectory unreadable
{{ traj.error }}Usage
{% endif %} {% endif %}{{ artifact.label }}
{{ artifact.filename }} · source record · credential-shaped values redacted
{% if artifact.truncated %}This record exceeds the viewer’s 16 MiB limit. The first portion is available here; the original file is intact.
{% endif %} @@ -10,6 +11,10 @@ Page {{ artifact.page }} of {{ artifact.pages }} · characters {{ artifact.start + 1 if artifact.characters else 0 }}–{{ artifact.end }} of {{ artifact.characters }} {% if artifact.page > 1 %}Previous{% endif %} {% if artifact.page < artifact.pages %}Next{% endif %} + {% if not artifact.empty %} + + Download + {% endif %}This record is empty.
{% else %}{{ artifact.text }}{% endif %}
{% endblock %}
diff --git a/app/templates/traces/trial.html b/app/templates/traces/trial.html
index a68831e6..1555fb51 100644
--- a/app/templates/traces/trial.html
+++ b/app/templates/traces/trial.html
@@ -644,13 +644,16 @@ Waterfall
Artifacts
Read the recorded source files. Content is redacted and paged; source files remain intact.
| Record | Availability | Size |
|---|
| Record | Size | ||
|---|---|---|---|
| {{ artifact.label }} | {{ 'Recorded' if artifact.exists else 'Not recorded' }} | {{ ((artifact.size / 1024)|round(1)) ~ ' KB' if artifact.exists else '—' }} | {% if artifact.exists %}Read →{% endif %} |
| {{ artifact.label }} | {{ '%.2f'|format(artifact.size / 1024) }} KB | +Read Download |