Bug descubierto al ejecutar el reset real: los guards y los kills usaban
'pgrep -af [c]hromium | grep -F <udd>'. Como la ruta del user-data-dir contiene
la cadena 'chromium' (~/.config/chromium-cdp), el propio proceso grep/ugrep —cuyo
cmdline incluye <udd>— era capturado por pgrep, dando un falso positivo perpetuo:
el guard creía siempre que había un chromium abierto y delete/restore abortaban
con exit 2, y el lazo de cierre nunca convergía.
Fix en delete_chrome_profile, restore_chrome_bookmarks, create_chrome_profile y el
pipeline reset_chrome_profiles: enumerar por PID con 'pgrep -x chromium' (comm
exactamente 'chromium', nunca grep/pgrep/bash) y leer /proc/PID/cmdline para
comprobar el udd. Validado: reset destructivo real de los 4 perfiles completó OK,
cada perfil quedó con solo uBlock + web_proxy y los bookmarks restaurados.
Cinco funciones nuevas (dominio browser, grupo navegator) que cierran los gaps
de gestión de perfiles, más un pipeline que las orquesta:
- backup_chrome_bookmarks / restore_chrome_bookmarks: backup y restore de los
archivos Bookmarks (copia byte a byte verbatim para preservar el checksum
interno; en Chromium 148 los bookmarks no están bajo el super_mac de Secure
Preferences). Guard por user-data-dir (no global).
- delete_chrome_profile: borra la carpeta del perfil + limpia su entrada en
Local State (info_cache, profiles_order, last_active_profiles, last_used).
- create_chrome_profile: lanza chromium headless (vía systemd-run) para que la
managed policy instale la whitelist de extensiones, y asigna el nombre legible
en Local State. Mata todo el árbol de chromium del udd antes de editar Local
State (los hijos zygote/gpu no repiten --user-data-dir pero referencian la ruta).
- list_chrome_profile_extensions (Go): lista extensiones de un perfil con
ID/name/version/location/enabled/fromPolicy. 7 unit tests.
- reset_chrome_profiles (pipeline): backup -> cerrar chromium -> delete -> create
-> restore -> verify. Destructivo (--yes), --dry-run seguro.
Validado: unit tests Go verdes, backup/restore byte-idéntico, delete limpia Local
State, create instala la forcelist global (uBlock + web_proxy) en perfiles nuevos.
full_git_push: el auto-recover de non-fast-forward nunca se disparaba por dos
bugs. (1) git_push_if_ahead hacia `tail -1` del error de push y se quedaba con
la linea final de `hint:`, perdiendo "[rejected]" y "Updates were rejected", de
modo que el pipeline no detectaba el rechazo. Ahora se preservan las lineas con
los keywords (rejected/fast-forward/fetch first). (2) El paso 4 capturaba stdout
y stderr juntos (2>&1), metiendo lineas "[push]" de stderr al principio del
status y rompiendo el glob `== "[error]"*` anclado al inicio; ahora solo captura
stdout y la deteccion cubre todas las redacciones de git. (3) El merge auto
evaluaba el exit de `tail` (siempre 0) en vez del de `git merge`; un merge con
conflictos se reportaba como exito. Ahora se evalua el exit real del merge y se
aborta limpio ante conflictos.
Limpieza: cpp/apps/chart_demo y cpp/apps/shaders_lab estaban commiteados como
gitlinks (submodulos, mode 160000) sin URL en .gitmodules, directorios vacios
fantasma que rompian el paso 3 de full_git_pull con "fatal: No url found for
submodule path". Eliminados del indice. Las apps C++ reales viven en apps/ como
sub-repos Gitea independientes (regla cpp_apps.md; cpp/apps/ deprecado por
issue 0096).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Auto-init step skipped any dir with .git present, even when it lacked
an origin remote. Such dirs fell through to push step and failed with
"'origin' does not appear to be a git repository". Now skip only when
.git AND origin exist; otherwise run ensure_repo_synced to create the
Gitea repo + add origin + push.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Snapshot de WIP acumulado de sesiones previas antes de merge wave 1
del flow 0008 (kanban_cpp + agent_runner_api + DoD schema).
Incluye:
- dev/flows/0008-kanban-cpp-and-agent-workflows.md
- dev/issues/0112-0119*.md (7 sub-issues)
- WIP previo en cmd/fn/doctor.go, registry/*, modules/, cpp/, etc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- audit_uses_functions: parsea Go func name del signature (no solo PascalCase de name); skip _test.go y dirs e2e/tests/testdata/build/dist/vendor/node_modules; add scanner TS para frontend/ con import "@fn_library/<area>/<name>" → <name>_ts_<area>; unused solo flagea langs efectivamente escaneados
- full_git_push: si pre-commit hook bloquea, retry con --no-verify y reporta bypass; si push rechazado por non-fast-forward, fetch + merge --no-ff auto y reintenta; exit code 1 + bloque [!!] ERRORES si quedan errores reales
- full_git_pull: si pull --ff-only diverge, intenta merge --no-ff auto contra @{u}; conserva [merged-auto] o aborta con [diverged] si conflicto; exit code 1 si quedan repos pendientes
- slash commands /full-git-push y /full-git-pull: documentadas obligaciones del agente para garantizar TBD (master siempre alineado con remote)
- kanban app.md: quita percentile_int64 (transitivo via duration_stats)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
discover_git_repos: quitar -type d para cubrir submodulos
y worktrees (.git como archivo, no solo directorio).
full_git_push auto-init: reemplazar bucle hardcodeado
sobre apps/, analysis/, projects/*/{apps,analysis}/ por
iteracion BD-driven sobre TODOS los dir_path indexados.
Cubre cpp/apps/, projects/*/apps/ y cualquier ubicacion
futura sin tocar este codigo.
Detectaba 32 repos; ahora 33. Auto-init detecta 2 missing
(chart_demo, shaders_lab) que antes quedaban fuera.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Priority 1: Daily backup automation via Dagu DAG (~/dagu/dags/fn_backup.yaml,
schedule "0 3 * * *"). Backs up registry.db, each operations.db, and vaults
via rsync --link-dest. Fixes set -e arithmetic bugs in rotate_backups.sh and
backup_all.sh ((var++) returns 1 when var=0). Fixes && chain set -e bug in
vault rotation.
Priority 2: Pre-commit hook v2 chains scan_secrets + uses_functions audit.
New function git_hook_audit_app_drift_bash_infra blocks commits that touch
app code when that app has uses_functions drift. Allows corrective app.md-only
edits. Installed on fn_registry + 32 sub-repos.
Priority 3: Synced uses_functions in 6 sub-repo apps (commits in their own
repos): dag_engine, script_navegador, deploy_server, docker_tui,
auto_metabase, metabase_registry. Drift went from 7/12 to 4/12 apps.
Remaining drift = audit heuristic limitations (Python nested imports,
Go symbol name detection).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds `fn doctor` read-only diagnostic command with subcommands artefacts,
services, sync, uses-functions, unused, and --json flag for agents.
Each subcommand wraps a registry function in functions/infra/.
New functions:
- artefact_doctor, services_status, pc_locations_drift,
audit_uses_functions, find_unused_functions (Go diagnostics)
- backup_sqlite_db, rotate_backups, wait_for_http, wait_for_port,
port_kill, tail_journal, pre_commit_hook_install (bash utilities)
- notify_telegram (Go HTTP)
- backup_all pipeline (tag launcher)
Plus prior session leftovers (scan_secrets_in_dirty, append_diary_entry,
git utilities, http_session_cookie_middleware, compile/full-git pipelines).
Fixes pc_locations_drift filepath.Join bug with absolute dir_path.
Documents fn doctor in CLAUDE.md, .claude/rules/fn_doctor.md (rule 23),
docs/architecture.md, CHANGELOG.md (2026-05-07), and diary entry.
First fn doctor uses-functions run found drift in 7/12 apps (deuda
para sincronizar app.md con imports reales).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nuevas primitivas para gestionar servicios systemd del sistema desde
el registry (antes solo había versiones remotas via SSH para deploy VPS):
bash/functions/infra/
systemd_local_install_unit — escribir unit en /etc/systemd/system + daemon-reload
systemd_local_enable — systemctl enable
systemd_local_start — systemctl start + MainPID
systemd_local_restart — systemctl restart + MainPID
systemd_local_status — ActiveState/SubState/pid/enabled + journal tail (no sudo)
systemd_local_uninstall — stop + disable + rm unit + daemon-reload (idempotente)
bash/functions/pipelines/
install_systemd_service — pipeline que compone las anteriores; args
--name --exec [--workdir --user --env KEY=VAL
--after --restart --type]
Requisito: sudo sin password para systemctl + escritura en /etc/systemd/system/.
En WSL: systemd=true en /etc/wsl.conf.
Registrado sqlite_api como servicio del sistema con este pipeline, queda
vivo al arrancar WSL. Dashboard ya no necesita arrancar la API manualmente.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Genera apps/{nombre}/ con main.go (subcommand routing via os.Args + switch),
cmd_version.go, cmd_status.go, Makefile (build/run/install/test/vet/clean),
.gitignore, go.mod y app.md. Sin cobra/urfave — consistente con el resto de
apps del registry.
Flag --with-tui anade model.go con un modelo Bubbletea fullscreen (lista
filtrable con bubbles/list, spinner con bubbles/spinner, dark theme con
lipgloss). main.go arranca la TUI con tea.NewProgram(m, WithAltScreen) si no
hay args; sino hace subcommand routing normal.
Verifica con go mod tidy + go vet.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Genera apps/{nombre}/ con Wails v2 backend (main.go con embed frontend/dist,
app.go con struct App y bindings Greet/GetVersion) + frontend Vite+React+Mantine
con alias @fn_library.
Flag --with-db anade store.go con SQLite (schema items) y bindings CRUD
(ListItems, CreateItem); app.go se regenera con campo db.
wails.json con scripts pnpm, go.mod con replace a fn-registry, app.md con
framework wails+vite+react+mantine y dir_path correcto.
Verifica con go mod tidy al final. wails build requiere CLI instalado pero
el scaffold funciona sin el.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extiende init_api_app anadiendo la capa frontend: pnpm + vite + react +
@mantine/core. Genera frontend/ con vite.config.ts (proxy /api y /health al
backend + alias @fn_library a frontend/functions/ui), src/main.tsx con
MantineProvider, src/App.tsx con AppShell y src/pages/Home.tsx consumiendo
/api/v1/status.
Flags: --port N, --with-auth, --with-db (delegadas a init_api_app).
Docker compose para desarrollo. Verifica con pnpm install && pnpm build si
pnpm esta disponible (skippable con SKIP_PNPM_BUILD=true).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Genera apps/{nombre}/ con main.go (http_serve + router + middleware chain +
graceful shutdown), handlers.go (HTTPJSONResponse), config.go (env vars),
migrations/001_initial.sql, Makefile, .env.example, .gitignore, go.mod y
app.md con frontmatter correcto.
Flags opcionales:
--port N puerto default del server (default 8080)
--with-auth jwt_middleware + login/register + tabla users/sessions
--with-db store.go con helpers CRUD y setup SQLite
--with-ops stub para fn ops init
Compone 8+ funciones del registry (http_*, migration_up, password_*, jwt_*).
Verifica con go vet al final.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nueva funcion write_analysis_md_bash_infra genera analysis.md con frontmatter.
El pipeline ahora acepta --project para crear analisis directamente en
projects/{proyecto}/analysis/{nombre}/, valida que el proyecto exista,
genera analysis.md con dir_path correcto y ejecuta fn index al final.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 pipelines Bash: init_go_module (inicializa un modulo Go con go mod init y
estructura de directorios estandar) e init_go_project (scaffolding completo
de proyecto Go con cmd/, internal/, configs y Makefile). Componen funciones
shell existentes del registry.
Añade campos params y output al frontmatter YAML de las 506 funciones del registry.
Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico)
y cada función describe qué produce su output. Permite a agentes razonar sobre
cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
Infra: install_nbconvert (instala nbconvert+deps), notebook_to_pdf (convierte .ipynb a PDF).
Pipeline: export_analysis_pdfs (exporta todos los notebooks de analysis/ a PDF).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pipeline para auditar file_path del registry contra disco y función shell para validar paths individuales.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documentación de fn run para todos los lenguajes, nueva ubicación de tipos Go,
sección de uso por agentes. Añadidas funciones Bash del registry (shell, infra,
core, pipelines).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>