Faza 1 complete: bilingual+enrichment plumbing, UI/filters, frozen DB

Extraction finished (575/588 chunks; 6 content-filter-blocked, 7 await
re-extraction). DB rebuilt and frozen at 9418 activities — content_keys
are now stable for the enrichment overlay.

Part A (plumbing + UI):
- database.py: name_ro/description_ro/rules_ro/variations_ro, indoor_outdoor,
  space_needed, estimated_fields, source_id/source_ids/chunk_key columns;
  FTS5 indexes the 4 *_ro columns across CREATE + all 3 triggers; new equality
  filters + category counts for both axes.
- activity.py: new fields + bilingual display helpers (get_display_*,
  is_estimated, axis displays).
- config_taxonomy.py: INDOOR_OUTDOOR/SPACE_NEEDED enums + normalizers
  (None on unrecognised, no fabrication).
- search.py / routes.py / config.py / templates / css: new dropdowns,
  RO-primary rendering with "(estimat)" markers and collapsible original
  text, and a /source/<id> download route shipped DARK behind
  SOURCE_DOWNLOAD_ENABLED (copyright opt-in).
- build_database.py: source_id/chunk_key in dict_to_activity; merge_cluster
  unions source_ids without touching enrichment fields.

Part B (enrichment pipeline, built not yet run):
- build_database.py: load_enrichment + apply_enrichment (post-dedup, keyed on
  content_key) + --enrichment CLI + stated-vs-estimated QA.
- run_enrichment.py (resumable, --source/--limit pilot scoping, --collect),
  ENRICHMENT_PROMPT.md.

Repair: scripts/repair_extractions.py fixes the subagents' systematic
unescaped-ASCII-quote bug with a faithful char-scanner (escapes, never
truncates) + schema validation + a strictly-more-text guard. json_repair was
tried first, truncated silently, and is NOT used. build_database has no repair
dependency.

Tests: tests/test_enrichment.py added; 99 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-05-29 18:10:13 +00:00
parent 46d9592a55
commit bcfb6841eb
18 changed files with 1579 additions and 167 deletions

View File

@@ -85,6 +85,28 @@
</select>
{% endif %}
{% if filters.indoor_outdoor %}
<select name="indoor_outdoor" class="filter-select compact">
<option value="">Oriunde</option>
{% for io in filters.indoor_outdoor %}
<option value="{{ io }}" {% if applied_filters.indoor_outdoor == io %}selected{% endif %}>
{{ display_names.get(io, io) }}
</option>
{% endfor %}
</select>
{% endif %}
{% if filters.space_needed %}
<select name="space_needed" class="filter-select compact">
<option value="">Orice spațiu</option>
{% for sp in filters.space_needed %}
<option value="{{ sp }}" {% if applied_filters.space_needed == sp %}selected{% endif %}>
{{ display_names.get(sp, sp) }}
</option>
{% endfor %}
</select>
{% endif %}
<button type="button" class="btn btn-secondary btn-sm" onclick="clearFilters()">
Resetează
</button>
@@ -128,7 +150,7 @@
<header class="activity-header">
<h3 class="activity-title">
<a href="{{ url_for('main.activity_detail', activity_id=activity.id) }}">
{{ activity.name }}
{{ activity.get_display_name() }}
</a>
</h3>
<span class="activity-category">{{ display_names.get(activity.category, activity.category) }}</span>
@@ -138,24 +160,36 @@
</header>
<div class="activity-content">
<p class="activity-description">{{ activity.description }}</p>
<p class="activity-description">{{ activity.get_display_description() }}</p>
<div class="activity-metadata">
{% if activity.get_age_range_display() != "toate vârstele" %}
<span class="metadata-item">
<strong>Vârsta:</strong> {{ activity.get_age_range_display() }}
<strong>Vârsta:</strong> {{ activity.get_age_range_display() }}{% if activity.is_estimated('age_group_min') or activity.is_estimated('age_group_max') %} <em class="estimated">(estimat)</em>{% endif %}
</span>
{% endif %}
{% if activity.get_participants_display() != "orice număr" %}
<span class="metadata-item">
<strong>Participanți:</strong> {{ activity.get_participants_display() }}
<strong>Participanți:</strong> {{ activity.get_participants_display() }}{% if activity.is_estimated('participants_min') or activity.is_estimated('participants_max') %} <em class="estimated">(estimat)</em>{% endif %}
</span>
{% endif %}
{% if activity.get_duration_display() != "durată variabilă" %}
<span class="metadata-item">
<strong>Durata:</strong> {{ activity.get_duration_display() }}
<strong>Durata:</strong> {{ activity.get_duration_display() }}{% if activity.is_estimated('duration_min') or activity.is_estimated('duration_max') %} <em class="estimated">(estimat)</em>{% endif %}
</span>
{% endif %}
{% if activity.get_indoor_outdoor_display() %}
<span class="metadata-item">
<strong>Loc:</strong> {{ activity.get_indoor_outdoor_display() }}{% if activity.is_estimated('indoor_outdoor') %} <em class="estimated">(estimat)</em>{% endif %}
</span>
{% endif %}
{% if activity.get_space_needed_display() %}
<span class="metadata-item">
<strong>Spațiu:</strong> {{ activity.get_space_needed_display() }}{% if activity.is_estimated('space_needed') %} <em class="estimated">(estimat)</em>{% endif %}
</span>
{% endif %}
@@ -168,7 +202,11 @@
{% if activity.source_file %}
<div class="activity-source">
{% if config.SOURCE_DOWNLOAD_ENABLED %}
<small>Sursă: <a href="{{ url_for('main.source_download', activity_id=activity.id) }}">{{ activity.source_file }}</a></small>
{% else %}
<small>Sursă: {{ activity.source_file }}</small>
{% endif %}
</div>
{% endif %}
</div>