Display metric units in web UI, make seed idempotent, simplify code

- Load m.unit in get_domain() so MetricBound carries units from DB
- Add Unit column to domains list template
- Make load_transport_seed() idempotent with IntegrityError handling
  and metric unit backfill for existing DBs
- Remove unused imports (json, sqlite3, Entity)
- Simplify combinator loop to list comprehension
- Merge duplicate conditional/valid branches in pipeline
- Consolidate duplicated SQL in get_all_results()
- Expand CLAUDE.md with fuller architecture docs and conventions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 16:18:50 -06:00
parent d2028a642b
commit f1b3c75190
9 changed files with 63 additions and 53 deletions

View File

@@ -13,12 +13,13 @@
<p>{{ d.description }}</p>
<table>
<thead>
<tr><th>Metric</th><th>Weight</th><th>Norm Min</th><th>Norm Max</th></tr>
<tr><th>Metric</th><th>Unit</th><th>Weight</th><th>Norm Min</th><th>Norm Max</th></tr>
</thead>
<tbody>
{% for mb in d.metric_bounds %}
<tr>
<td>{{ mb.metric_name }}</td>
<td>{{ mb.unit }}</td>
<td>{{ mb.weight }}</td>
<td>{{ mb.norm_min }}</td>
<td>{{ mb.norm_max }}</td>