Add domain CRUD, energy density constraint, LLM status, reset results, score display fixes
Domain management: - Add domain list/detail/form templates and full CRUD routes (domains.py) - Add metric bound add/edit/delete via HTMX partials (_metrics_table.html) Energy density constraint (Rule 6 in ConstraintResolver): - Hard-block combos where power source provides <25% of platform's required Wh/kg - Warn (conditional) when under-density but within 4x - Solar Sail exempt (no stored energy); Airplane requires 400 Wh/kg, Spaceship 2000 Wh/kg - Add energy_density_wh_kg provides to all 8 stored-energy power sources in seed data - 3 new constraint resolver tests LLM-complete status: - Pipeline Pass 4 now sets combo status to llm_reviewed after successful LLM review - update_combination_status guards against downgrading: scored won't overwrite llm_reviewed or reviewed; llm_reviewed won't overwrite reviewed - Add badge-llm_reviewed CSS style (light blue) Reset results: - Repository.reset_domain_results() deletes combination_results, combination_scores, and pipeline_runs for a domain; pipeline re-evaluates on next run - POST /results/<domain>/reset route with flash confirmation - "Reset results" danger button with JS confirm dialog in results list Fix composite score 0 displaying as --- (Jinja2 falsy 0.0 bug): - Change `if r.composite_score` to `if r.composite_score is not none` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,14 @@
|
||||
|
||||
{% if domain and results is not none %}
|
||||
<div class="card">
|
||||
<h2>{{ domain.name }} <span class="subtitle">{{ domain.description }}</span></h2>
|
||||
<div class="page-header">
|
||||
<h2>{{ domain.name }} <span class="subtitle">{{ domain.description }}</span></h2>
|
||||
<form method="post" action="{{ url_for('results.reset_results', domain_name=domain.name) }}"
|
||||
class="inline-form"
|
||||
onsubmit="return confirm('Delete all results for {{ domain.name }}? This cannot be undone.')">
|
||||
<button type="submit" class="btn btn-danger btn-sm">Reset results</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if statuses %}
|
||||
<div class="filter-row">
|
||||
@@ -53,7 +60,7 @@
|
||||
{% for r in results %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td class="score-cell">{{ "%.4f"|format(r.composite_score) if r.composite_score else '—' }}</td>
|
||||
<td class="score-cell">{{ "%.4f"|format(r.composite_score) if r.composite_score is not none else '—' }}</td>
|
||||
<td>{{ r.combination.entities|map(attribute='name')|join(' + ') }}</td>
|
||||
<td><span class="badge badge-{{ r.combination.status }}">{{ r.combination.status }}</span></td>
|
||||
<td class="block-reason-cell">
|
||||
|
||||
Reference in New Issue
Block a user