feat(graph_explorer): adopta layout assets/ via fn::asset_path

Junto con el cambio del framework (commit 81d8a7c9), graph_explorer
ahora resuelve enrichers/, runtime Python y gx-cli desde
<exe_dir>/assets/ con fallback a las rutas dev legacy.

- main.cpp: enrichers_dir busca primero <exe_dir>/assets/enrichers/
  (deploy con /compile). Fallback a <app_dir>/enrichers/ del repo
  cuando se ejecuta desde build/ (modo dev).
- jobs.cpp::resolve_python_runtime: incluye
  <exe_dir>/assets/runtime/python/{python.exe|bin/python3} como
  primera opcion de la cadena de fallback. La opcion legacy sin
  assets/ queda como segundo intento.
- chat.cpp: gxcli_path busca <exe_dir>/assets/gx-cli{.exe} con
  fallback a <app_dir>/gx-cli para modo dev.

Tests: 32/32 verde. Build Linux + Windows OK. Deploy fresco a
Desktop con todas las 6 apps confirma layout limpio:
  <app>.exe + (duckdb.dll si aplica) + assets/ + local_files/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 00:50:44 +02:00
parent 375573db38
commit 8623732d6d
3 changed files with 55 additions and 16 deletions
+16 -1
View File
@@ -42,6 +42,7 @@
#include <chrono>
#include <cmath>
#include <string>
#include <sys/stat.h>
#include <vector>
#ifndef _WIN32
@@ -1968,7 +1969,21 @@ int main(int argc, char** argv) {
std::string app_dir = registry_root.empty()
? "."
: registry_root + "/projects/osint_graph/apps/graph_explorer";
std::string enrichers_dir = app_dir + "/enrichers";
// Convencion assets/: enrichers vienen empaquetados en
// <exe_dir>/assets/enrichers/. Fallback al app_dir del repo
// para modo dev local cuando se ejecuta desde build/.
std::string enrichers_dir;
{
std::string assets_enrichers = fn::asset_path("enrichers");
struct stat st{};
if (::stat(assets_enrichers.c_str(), &st) == 0 &&
S_ISDIR(st.st_mode)) {
enrichers_dir = assets_enrichers;
} else {
enrichers_dir = app_dir + "/enrichers";
}
}
// graph_explorer.db es el mismo SQLite usado por layout_store.
// Default a <local_files>/graph_explorer.db si no hay proyecto.