ee0d26ce2d
Cada enricher con `lang: python` y `uses_functions` no vacio ahora
puede empaquetar las funciones del registry que necesita en
`<enricher>/_vendored/`. El run.py importa de ahi en lugar de
`<registry_root>/python/functions/`, lo que hace al binario
distribuible sin dependencia de un fn_registry montado.
Cambios:
1. tools/vendor_enricher_python.sh
- Lee `uses_functions` del manifest (filtrando IDs `*_py_*`).
- Resuelve `file_path` desde registry.db.
- Copia recursivamente con expansion transitiva: si un fichero
vendorizado importa siblings del mismo dominio, los siblings
tambien se copian (resuelve el caso `extract_iocs.py` que
importa 7 modulos hermanos).
- Genera `.vendor.lock` con `<id> <sha256> <src_path>` por
funcion declarada para auditoria.
- Idempotente — si todos los hashes coinciden, no rehace nada.
2. Manifests actualizados con `uses_functions`:
- fetch_webpage: normalize_url + html_to_markdown
- extract_links: extract_urls
- extract_text_entities: extract_iocs
3. run.py de los 3 enrichers afectados: importan de `_vendored/`
si existe, fallback a `<registry_root>/python/functions/` en
modo dev (mantiene los tests pytest funcionando).
4. app.md: anade `cryptography` a python_runtime_deps porque el
blob `cybersecurity.cybersecurity` lo importa al top.
5. Tests:
- test_vendor_script.py — 6 tests del script: layout correcto,
transitive siblings, lock con SHA256, idempotencia, modulos
importables en aislamiento.
- 16 tests de enrichers existentes pasan via vendoring (no usan
registry_root porque _vendored/ tiene prioridad).
6. Issue 0033b movido a issues/completed/.
Tests: 32/32 verde (16 enrichers + 6 dispatcher + 4 runtime + 6
vendor).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
87 lines
3.0 KiB
Markdown
87 lines
3.0 KiB
Markdown
---
|
|
name: graph_explorer
|
|
lang: cpp
|
|
domain: viz
|
|
description: "Visor de grafos GPU-accelerated agnostico del backend. Lee operations.db de cualquier app del registry y permite explorar entidades/relaciones con shapes/iconos/layouts/filtros."
|
|
tags: [imgui, graph, osint, visualization, gpu]
|
|
uses_functions:
|
|
- graph_renderer_cpp_viz
|
|
- graph_force_layout_cpp_viz
|
|
- graph_force_layout_gpu_cpp_viz
|
|
- graph_layouts_cpp_viz
|
|
- graph_viewport_cpp_viz
|
|
- graph_labels_cpp_viz
|
|
- graph_icons_cpp_viz
|
|
- graph_sources_cpp_viz
|
|
- toolbar_cpp_core
|
|
- modal_dialog_cpp_core
|
|
- select_cpp_core
|
|
- text_input_cpp_core
|
|
- tree_view_cpp_core
|
|
- page_header_cpp_core
|
|
- fullscreen_window_cpp_core
|
|
uses_types: []
|
|
framework: "imgui"
|
|
entry_point: "main.cpp"
|
|
dir_path: "projects/osint_graph/apps/graph_explorer"
|
|
repo_url: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/dataforge/graph_explorer"
|
|
python_runtime: true
|
|
python_runtime_deps:
|
|
- requests
|
|
- certifi
|
|
- urllib3
|
|
- cryptography
|
|
---
|
|
|
|
## Arquitectura
|
|
|
|
App C++ ImGui para explorar cualquier `operations.db` del registry como un grafo
|
|
de entidades y relaciones. Agnostica del backend — el dispatcher en
|
|
`data.{h,cpp}` selecciona el `GraphLoadFn` segun `--input` (hoy solo
|
|
`operations`, manana `json`/`jsonl`/`graphml`).
|
|
|
|
**Capas:**
|
|
|
|
- `data.{h,cpp}` — dispatcher de sources. Hoy unica implementacion:
|
|
`graph_load_from_operations` (issue 0049g).
|
|
- `types_registry.{h,cpp}` — parser minimo de YAML para sobrescribir
|
|
`color`/`shape`/`icon`/`style` por nombre de tipo. Construye el `IconAtlas`
|
|
con los codepoints Tabler resueltos por `tabler_codepoint_by_name`.
|
|
- `views.{h,cpp}` — paneles `Toolbar`, `Legend`, `Inspector`, `Stats`. Toggle
|
|
via `AppConfig::panels`.
|
|
- `main.cpp` — CLI + `fn::run_app` + bucle de force layout (CPU/GPU) + glue.
|
|
- `graph_explorer.db` — SQLite junto al exe. Tabla `layouts(graph_hash,
|
|
node_id, x, y, pinned, updated_at)`. Persistencia de posiciones por grafo.
|
|
|
|
## CLI
|
|
|
|
```bash
|
|
graph_explorer [<operations.db>]
|
|
graph_explorer --input operations <path>
|
|
graph_explorer --types <yaml>
|
|
graph_explorer --layout force|grid|circular|radial|hierarchical|fixed
|
|
graph_explorer apps/registry_dashboard/operations.db
|
|
graph_explorer --types projects/osint_graph/apps/graph_explorer/examples/types.yaml \
|
|
apps/element_agents/operations.db
|
|
```
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd cpp
|
|
cmake -B build/linux -S .
|
|
cmake --build build/linux --target graph_explorer -j$(nproc)
|
|
./build/linux/apps/graph_explorer/graph_explorer apps/registry_dashboard/operations.db
|
|
```
|
|
|
|
## Notas
|
|
|
|
- Usa GPU layout si el contexto soporta compute 4.3; toggle CPU/GPU desde la
|
|
toolbar. Fallback transparente a CPU si GPU no esta disponible.
|
|
- 50k nodos a 60fps con layout GPU (medido en demos/graph en
|
|
`primitives_gallery`).
|
|
- `operations.db` se abre con `mode=ro` cuando el path no apunta al
|
|
filesystem propio para evitar lock con otras apps que esten escribiendo.
|
|
- El `graph_hash` se calcula a partir del path canonico del input. Mismo path
|
|
= mismo grafo a efectos de layout guardado.
|