diff --git a/AGENTS.md b/AGENTS.md
index cff7764..13eb0f3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -191,6 +191,11 @@ only covers cloud-specific, non-obvious caveats.
`sudo -u postgres psql -f docker/postgres/init/11_create_acme_erp.sql` then
`bash scripts/seed-acme-erp.sh` (registers `ACME ERP (Multi-Schema)` when backend auth
is disabled or you have an admin session cookie).
+- **Company Knowledge → Review queue** (code-scan suggestions): seed without an LLM via
+ `python3 scripts/self-host/seed-review-suggestions.py --count 50`, then exercise approve/
+ reject/bulk edge cases with `python3 scripts/self-host/e2e-review-approvals.py`.
+ Approving `SCHEMA_DOC` rows needs `CODE_DERIVED` on `schema_documentation_source_check`
+ (startup initializer repairs this; Hibernate `ddl-auto` does not).
### Non-obvious setup caveats (each cost real debugging time)
diff --git a/backend/src/main/java/com/dbaagent/config/SchemaDocumentationSourceCompatibilityInitializer.java b/backend/src/main/java/com/dbaagent/config/SchemaDocumentationSourceCompatibilityInitializer.java
new file mode 100644
index 0000000..2dfd635
--- /dev/null
+++ b/backend/src/main/java/com/dbaagent/config/SchemaDocumentationSourceCompatibilityInitializer.java
@@ -0,0 +1,74 @@
+package com.dbaagent.config;
+
+import com.dbaagent.model.DocumentationSource;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+import javax.sql.DataSource;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+/**
+ * Keeps {@code schema_documentation.source} CHECK aligned with
+ * {@link DocumentationSource}.
+ *
+ *
Hibernate {@code ddl-auto=update} does not rewrite CHECK constraints when an
+ * enum gains a value. Self-host installs that predate V90 therefore reject
+ * {@code CODE_DERIVED} rows written by code-scan suggestion approve — the Review
+ * queue shows {@code APPROVED 0 OF N} while every SCHEMA_DOC decide is swallowed
+ * by bulk-decide. Mirrors {@link BrainInitSchemaCompatibilityInitializer}.
+ */
+@Configuration
+@Slf4j
+public class SchemaDocumentationSourceCompatibilityInitializer {
+
+ private static final String TABLE = "schema_documentation";
+ private static final String COLUMN = "source";
+ private static final String CONSTRAINT = "schema_documentation_source_check";
+
+ @Bean("schemaDocumentationSourceCompatibilityBootstrap")
+ @DependsOn("entityManagerFactory")
+ public Object schemaDocumentationSourceCompatibilityBootstrap(DataSource dataSource) {
+ JdbcTemplate jdbc = new JdbcTemplate(dataSource);
+ if (!tableExists(jdbc, TABLE) || !columnExists(jdbc, TABLE, COLUMN)) {
+ return new Object();
+ }
+
+ String allowed = Arrays.stream(DocumentationSource.values())
+ .map(DocumentationSource::name)
+ .map(v -> "'" + v + "'")
+ .collect(Collectors.joining(", "));
+
+ jdbc.execute("ALTER TABLE " + TABLE + " DROP CONSTRAINT IF EXISTS " + CONSTRAINT);
+ jdbc.execute(
+ "ALTER TABLE " + TABLE
+ + " ADD CONSTRAINT " + CONSTRAINT
+ + " CHECK ((" + COLUMN + ")::text = ANY (ARRAY[" + allowed + "]::text[]))"
+ );
+ log.info("Ensured {} allows DocumentationSource values: {}", CONSTRAINT, allowed);
+ return new Object();
+ }
+
+ private boolean tableExists(JdbcTemplate jdbc, String tableName) {
+ Integer count = jdbc.queryForObject("""
+ SELECT COUNT(*)
+ FROM information_schema.tables
+ WHERE table_schema = 'public' AND table_name = ?
+ """, Integer.class, tableName);
+ return count != null && count > 0;
+ }
+
+ private boolean columnExists(JdbcTemplate jdbc, String tableName, String columnName) {
+ Integer count = jdbc.queryForObject("""
+ SELECT COUNT(*)
+ FROM information_schema.columns
+ WHERE table_schema = 'public'
+ AND table_name = ?
+ AND column_name = ?
+ """, Integer.class, tableName, columnName);
+ return count != null && count > 0;
+ }
+}
diff --git a/backend/src/main/java/com/dbaagent/controller/CodeScanController.java b/backend/src/main/java/com/dbaagent/controller/CodeScanController.java
index 93007fc..fb3198c 100644
--- a/backend/src/main/java/com/dbaagent/controller/CodeScanController.java
+++ b/backend/src/main/java/com/dbaagent/controller/CodeScanController.java
@@ -15,6 +15,7 @@
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.io.IOException;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -156,16 +157,18 @@ public ResponseEntity