Fix plan artifacts display for completed runs

- Add get_run_plan() and get_run_artifacts() methods to RunService
- Merge step_results into plan steps to show cache_id per step
- Display output hash links under each completed step
- Use cache manager for artifact path lookups
- Fix RunService constructor to accept database param

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-01-11 08:01:12 +00:00
parent ae68eeef52
commit 29d8d06d76
2 changed files with 152 additions and 19 deletions

View File

@@ -72,25 +72,44 @@
<div class="space-y-2">
{% for step in plan.steps %}
{% set step_color = 'green' if step.cached else ('blue' if step.status == 'running' else 'gray') %}
<div class="bg-gray-800 rounded p-3 flex items-center justify-between">
<div class="flex items-center space-x-3">
<span class="w-6 h-6 rounded-full bg-{{ step_color }}-600 flex items-center justify-center text-xs">
{{ loop.index }}
</span>
<span class="font-medium">{{ step.name }}</span>
<span class="text-gray-500 text-sm">{{ step.type }}</span>
{% set step_color = 'green' if step.status == 'completed' or step.cache_id else ('purple' if step.cached else ('blue' if step.status == 'running' else 'gray')) %}
<div class="bg-gray-800 rounded p-3">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<span class="w-6 h-6 rounded-full bg-{{ step_color }}-600 flex items-center justify-center text-xs">
{{ loop.index }}
</span>
<span class="font-medium">{{ step.name }}</span>
<span class="text-gray-500 text-sm">{{ step.type }}</span>
</div>
<div class="flex items-center space-x-3">
{% if step.cached %}
<span class="text-purple-400 text-sm">cached</span>
{% elif step.status == 'completed' %}
<span class="text-green-400 text-sm">completed</span>
{% endif %}
</div>
</div>
<div class="flex items-center space-x-3">
{% if step.cached %}
<span class="text-purple-400 text-sm">cached</span>
{% endif %}
{% if step.cache_id %}
<a href="/cache/{{ step.cache_id }}" class="font-mono text-xs text-gray-500 hover:text-white">
{{ step.cache_id[:12] }}...
{% if step.cache_id %}
<div class="mt-2 ml-9 flex items-center space-x-2">
<span class="text-gray-500 text-xs">Output:</span>
<a href="/cache/{{ step.cache_id }}" class="font-mono text-xs text-blue-400 hover:text-blue-300">
{{ step.cache_id }}
</a>
</div>
{% endif %}
{% if step.outputs and step.outputs | length > 1 %}
<div class="mt-1 ml-9">
<span class="text-gray-500 text-xs">Additional outputs:</span>
{% for output in step.outputs %}
{% if output != step.cache_id %}
<a href="/cache/{{ output }}" class="block font-mono text-xs text-gray-400 hover:text-white ml-2">
{{ output[:32] }}...
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>