gioser

prueba

90e5bd3c7307ac5cce67133f523687b9b1eff48c · ruwaq Sergio · (5 killa ñawpaq) · tayta d270c5e67 · kay commitpi sach'ata qhaway

Semántico sayk'uy · 1

crates/ente-brain/src/loader.rs

2 qillqakuna · +9 −6

diff --git a/crates/ente-brain/src/loader.rs b/crates/ente-brain/src/loader.rs
index d7b7e48..afe3f0c 100644
--- a/crates/ente-brain/src/loader.rs
+++ b/crates/ente-brain/src/loader.rs
@@ -30,9 +30,10 @@ pub fn load_card_file(path: &Path) -> anyhow::Result<EntityCard> {
 ///    salidas de generadores que envuelven en `{"seed": {...}}`).
 pub fn extract_card_from_json(raw: &str) -> anyhow::Result<EntityCard> {
     let v: serde_json::Value = serde_json::from_str(raw)?;
-    if let Ok(c) = serde_json::from_value::<EntityCard>(v.clone()) {
-        return Ok(c);
-    }
+    let direct_err = match serde_json::from_value::<EntityCard>(v.clone()) {
+        Ok(c) => return Ok(c),
+        Err(e) => e,
+    };
     if let serde_json::Value::Object(map) = v {
         for (_, vv) in map {
             if let Ok(c) = serde_json::from_value::<EntityCard>(vv) {
@@ -40,7 +41,9 @@ pub fn extract_card_from_json(raw: &str) -> anyhow::Result<EntityCard> {
             }
         }
     }
-    anyhow::bail!("JSON no contiene una EntityCard válida")
+    // Propagamos el error del intento directo: es el caso típico (JSON top-level
+    // = EntityCard) y su mensaje apunta al campo concreto que rompió.
+    anyhow::bail!("JSON no contiene una EntityCard válida: {direct_err}")
 }
 
 /// Carga reglas desde un archivo JSON.
diff --git a/docs/seed-vps-min.json b/docs/seed-vps-min.json
index 64908fd..1ec07fe 100644
--- a/docs/seed-vps-min.json
+++ b/docs/seed-vps-min.json
@@ -1,6 +1,6 @@
 {
   "schema_version": 1,
-  "id": "01KQVPSMINBOOT0000000000AA",
+  "id": "01HQAR53D4M2NBV8KZTYXFGS01",
   "lineage": null,
   "label": "vps-min",
   "provides": ["Spawn", "Journal"],
@@ -19,7 +19,7 @@
   "genesis": [
     {
       "schema_version": 1,
-      "id": "01KQVPSMINBOOT0000000001SL",
+      "id": "01HQAR53D4M2NBV8KZTYXFGS02",
       "lineage": null,
       "label": "heartbeat-sleep",
       "provides": [],