id int(11) not_null auto_increment comment(Primary key)
entity_type varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci not_null comment(product | category | cms)
entity_id int(11) not_null comment(FK to the entity table (products / categories / …))
language_id int(11) not_null comment(FK to languages)
triggered_by varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL comment(manual | ajax | cron)
pipeline_run_uuid char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL comment(Shared by every attempt of the same optimize() call)
attempt smallint default 1 comment(1-based attempt index inside a single pipeline run)
verdict enum('improvement','parity','regression','unknown') default 'unknown' comment(Composite-score verdict between source and generated text)
regression_reason varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default 'none' comment(low_coverage | repetition | entropy_drop | diversity_drop | delta_drop | multiple | none)
critical tinyint(1) not_null default 0 comment(Materialised diagnostics.critical flag - indexable without parsing JSON)
delta decimal(6,3) default 0.000 comment(generated_score - source_score)
source_score decimal(6,3) default 0.000 comment(Composite SEO quality score of the source description)
generated_score decimal(6,3) default 0.000 comment(Composite SEO quality score of the generated description)
source_entropy decimal(6,3) default 0.000 comment(Normalised Shannon entropy on source)
generated_entropy decimal(6,3) default 0.000 comment(Normalised Shannon entropy on generated)
source_diversity decimal(6,3) default 0.000 comment(Type-token ratio on source)
generated_diversity decimal(6,3) default 0.000 comment(Type-token ratio on generated)
entity_coverage decimal(6,3) default 0.000 comment(Fraction of source content vocabulary preserved in the generated text)
repetition decimal(6,3) default 0.000 comment(Over-repetition penalty on generated text (0 = none, 1 = severe))
diagnostics longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin default NULL comment(Normalised JSON - critical, coverage, diversity_drop, entropy_drop, repetition, messages[]) CHECK (json_valid(`diagnostics`))
feedback_snapshot text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL comment(JSON payload that was actually injected into the next LLM attempt - NULL when the attempt was accepted)
date_modified datetime default current_timestamp() comment(Insertion timestamp)
--
primary id
idx_entity entity_type entity_id
idx_entity_lang entity_id language_id
idx_regression_window verdict date_modified delta
idx_run pipeline_run_uuid
idx_critical critical
idx_reason regression_reason
idx_date_modified date_modified
##
engine innodb
character_set utf8mb4
collate utf8mb4_unicode_ci
