@saulwade/swl-ses 2.2.4 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +48 -7
- package/README.md +3 -3
- package/agentes/accesibilidad-wcag-swl.md +690 -690
- package/agentes/arquitecto-swl.md +267 -267
- package/agentes/auto-evolucion-swl.md +908 -908
- package/agentes/backend-api-swl.md +472 -472
- package/agentes/backend-csharp-swl.md +420 -420
- package/agentes/backend-go-swl.md +390 -390
- package/agentes/backend-java-swl.md +281 -281
- package/agentes/backend-node-swl.md +479 -479
- package/agentes/backend-python-swl.md +605 -605
- package/agentes/backend-rust-swl.md +364 -364
- package/agentes/backend-workers-swl.md +482 -482
- package/agentes/cloud-infra-swl.md +509 -509
- package/agentes/consolidador-swl.md +541 -541
- package/agentes/datos-swl.md +605 -605
- package/agentes/depurador-swl.md +352 -352
- package/agentes/devops-ci-swl.md +400 -400
- package/agentes/disenador-ui-swl.md +569 -569
- package/agentes/documentador-swl.md +345 -345
- package/agentes/frontend-angular-swl.md +621 -621
- package/agentes/frontend-css-swl.md +716 -716
- package/agentes/frontend-react-swl.md +692 -692
- package/agentes/frontend-swl.md +496 -496
- package/agentes/frontend-tailwind-swl.md +826 -826
- package/agentes/gh-fix-ci-swl.md +2 -2
- package/agentes/implementador-swl.md +328 -328
- package/agentes/investigador-swl.md +432 -432
- package/agentes/investigador-ux-swl.md +505 -505
- package/agentes/llm-apps-swl.md +278 -278
- package/agentes/migrador-swl.md +442 -442
- package/agentes/mobile-android-swl.md +511 -511
- package/agentes/mobile-cross-swl.md +541 -541
- package/agentes/mobile-ios-swl.md +502 -502
- package/agentes/mobile-testing-swl.md +302 -302
- package/agentes/nemesis-auditor-swl.md +285 -285
- package/agentes/notificador-swl.md +918 -918
- package/agentes/observabilidad-swl.md +438 -438
- package/agentes/orquestador-swl.md +1026 -1026
- package/agentes/pagos-swl.md +310 -310
- package/agentes/perfilador-usuario-swl.md +321 -321
- package/agentes/planificador-swl.md +399 -399
- package/agentes/producto-prd-swl.md +589 -589
- package/agentes/red-team-swl.md +1 -1
- package/agentes/release-manager-swl.md +590 -590
- package/agentes/rendimiento-swl.md +713 -713
- package/agentes/resolutor-build-swl.md +245 -245
- package/agentes/revisor-angular-swl.md +278 -278
- package/agentes/revisor-codigo-swl.md +505 -505
- package/agentes/revisor-csharp-swl.md +264 -264
- package/agentes/revisor-go-swl.md +259 -259
- package/agentes/revisor-java-swl.md +257 -257
- package/agentes/revisor-kotlin-swl.md +273 -273
- package/agentes/revisor-nextjs-swl.md +281 -281
- package/agentes/revisor-php-swl.md +271 -271
- package/agentes/revisor-react-swl.md +278 -278
- package/agentes/revisor-rust-swl.md +346 -346
- package/agentes/revisor-seguridad-swl.md +399 -399
- package/agentes/revisor-swift-swl.md +268 -268
- package/agentes/revisor-typescript-swl.md +346 -346
- package/agentes/sre-swl.md +291 -291
- package/agentes/tdd-qa-swl.md +393 -393
- package/comandos/swl/aprobar-plan.md +146 -141
- package/comandos/swl/briefing.md +119 -119
- package/comandos/swl/contribuir.md +233 -233
- package/comandos/swl/predecir.md +139 -139
- package/comandos/swl/release.md +30 -8
- package/comandos/swl/sesiones.md +1 -1
- package/comandos/swl/status.md +343 -333
- package/gateway/agent-executor.js +1 -1
- package/gateway/lib/event-channel.js +191 -191
- package/habilidades/agent-deep-links/SKILL.md +148 -148
- package/habilidades/agentes-como-servicio/SKILL.md +2 -2
- package/habilidades/angular-moderno/SKILL.md +20 -1
- package/habilidades/auto-evolucion-protocolo/SKILL.md +276 -276
- package/habilidades/backend-async-postgres-testing/SKILL.md +215 -215
- package/habilidades/backend-error-design/SKILL.md +221 -221
- package/habilidades/backend-production-resilience/SKILL.md +288 -288
- package/habilidades/benchmark-memoria/SKILL.md +186 -186
- package/habilidades/calidad-anti-patrones-universales/SKILL.md +368 -368
- package/habilidades/calidad-contract-testing/SKILL.md +165 -165
- package/habilidades/calidad-mutation-testing/SKILL.md +170 -170
- package/habilidades/changelog-generator/scripts/parse-commits.js +367 -367
- package/habilidades/checklist-seguridad/recursos/stride-cobertura.md +60 -60
- package/habilidades/contenedores-docker/SKILL.md +3 -1
- package/habilidades/diagrama-arquitectura/assets/template.html +276 -276
- package/habilidades/doubt-driven-review/recursos/EXAMPLES.md +130 -130
- package/habilidades/drift-detection/SKILL.md +179 -179
- package/habilidades/ejecutar-fase/SKILL.md +564 -541
- package/habilidades/ejecutar-task-iterativo/SKILL.md +278 -278
- package/habilidades/estructura-proyecto-claude/recursos/frontmatter-y-hooks-referencia.md +1 -1
- package/habilidades/estructura-proyecto-claude/recursos/mcp-json-template.json +57 -57
- package/habilidades/eval-framework/SKILL.md +212 -212
- package/habilidades/extractor-de-aprendizajes/SKILL.md +3 -3
- package/habilidades/feynman-auditor-swl/recursos/preguntas-language-agnostic.md +108 -108
- package/habilidades/harness-claude-code/recursos/disciplina-harness-regla.md +252 -252
- package/habilidades/legacy-code-rescue/SKILL.md +267 -267
- package/habilidades/meta-skills-estandar/recursos/convencion-examples.md +93 -93
- package/habilidades/patrones-python/recursos/patrones-avanzados.md +469 -469
- package/habilidades/perfil-usuario/SKILL.md +200 -200
- package/habilidades/planear-fase/SKILL.md +15 -1
- package/habilidades/prevencion-sobreingenieria/recursos/EXAMPLES.md +580 -580
- package/habilidades/proceso-ddia-fundamentos/SKILL.md +255 -255
- package/habilidades/proceso-ddia-streaming/SKILL.md +231 -231
- package/habilidades/proceso-debate-adversarial/SKILL.md +191 -164
- package/habilidades/proceso-debate-adversarial/recursos/personas.md +105 -105
- package/habilidades/proceso-discovery-machote/SKILL.md +157 -157
- package/habilidades/proceso-dynamic-workflows/SKILL.md +138 -138
- package/habilidades/proceso-dynamic-workflows/recursos/template-adversarial-verify.js +65 -65
- package/habilidades/proceso-dynamic-workflows/recursos/template-triage.js +65 -65
- package/habilidades/proceso-intent-engineering/SKILL.md +269 -269
- package/habilidades/proceso-modular-split/SKILL.md +256 -256
- package/habilidades/prompt-engineering/recursos/patrones-avanzados.md +2 -2
- package/habilidades/state-inconsistency-auditor-swl/recursos/coupled-state-patterns.md +147 -147
- package/habilidades/structured-outputs/SKILL.md +2 -2
- package/habilidades/swl-claudemd/recursos/contrato-aprender.md +83 -83
- package/habilidades/swl-claudemd/recursos/duplicacion-reglas-globales.md +85 -85
- package/habilidades/swl-claudemd/recursos/plantillas-init.md +94 -94
- package/habilidades/swl-dashboard/SKILL.md +2 -2
- package/habilidades/tdd-workflow/SKILL.md +33 -1
- package/habilidades/tdd-workflow/recursos/gherkin-bdd.md +111 -111
- package/habilidades/validacion-ci-sistema/recursos/validadores-completos.md +1 -1
- package/habilidades/validacion-ci-sistema/scripts/validar-sistema.sh +1 -1
- package/hooks/captura-acciones-post.js +151 -0
- package/hooks/captura-acciones-session.js +155 -0
- package/hooks/ciclo-evolucion-subagente.js +26 -26
- package/hooks/ciclo-evolucion.js +26 -26
- package/hooks/claudemd-bloat-detector.js +161 -161
- package/hooks/claudemd-duplicacion-detector.js +170 -170
- package/hooks/contexto-iteracion.js +144 -144
- package/hooks/guardrail-modelo.js +1 -1
- package/hooks/lib/agent-routing.js +107 -107
- package/hooks/lib/auto-consolidator.js +335 -335
- package/hooks/lib/autonomia.js +208 -208
- package/hooks/lib/briefing.js +512 -474
- package/hooks/lib/captura-acciones.js +392 -0
- package/hooks/lib/ciclo-evolucion.js +47 -47
- package/hooks/lib/deep-links.js +185 -185
- package/hooks/lib/error-classifier.js +308 -308
- package/hooks/lib/etapa-auto-evolucion.js +701 -701
- package/hooks/lib/etapa-metricas.js +388 -388
- package/hooks/lib/etapa-perfil-usuario.js +376 -376
- package/hooks/lib/loop-telemetry.js +321 -321
- package/hooks/lib/merkle-audit.js +96 -96
- package/hooks/lib/model-router.js +2 -2
- package/hooks/lib/propose-step.js +358 -358
- package/hooks/lib/provenance-tracker.js +191 -191
- package/hooks/lib/rate-limit-tracker.js +253 -253
- package/hooks/lib/resource-quota.js +122 -122
- package/hooks/lib/retry-jitter.js +165 -165
- package/hooks/lib/security-net.js +201 -201
- package/hooks/lib/skill-auditor.js +588 -588
- package/hooks/lib/sync-status.js +228 -228
- package/hooks/lib/taint-tracker.js +107 -107
- package/hooks/lib/text-similarity.js +241 -241
- package/hooks/lib/token-estimator.js +1 -0
- package/hooks/lib/toon-compressor.js +245 -245
- package/hooks/lib/usage-model.js +1 -1
- package/hooks/linea-estado.js +2 -0
- package/hooks/registro-turnos.js +209 -209
- package/hooks/session-briefing.js +98 -98
- package/hooks/spec-gate.js +211 -211
- package/hooks/sugerir-regenerar-inventario.js +170 -170
- package/hooks/tdd-gate.js +241 -241
- package/hooks/telemetria-skill-routing.js +100 -100
- package/hooks/validar-formato-post-subagente.js +140 -140
- package/hooks/validar-intent-spec.js +242 -242
- package/hooks/validar-memoria-hook.js +218 -218
- package/hooks/validar-planning-paths.js +134 -134
- package/instintos/autonomia.yaml +27 -27
- package/instintos/prompt-appendices.yaml +57 -57
- package/llms.txt +2 -2
- package/manifiestos/agent-output-schemas.json +57 -57
- package/manifiestos/canonical-hashes.json +2291 -1637
- package/manifiestos/hooks-config.json +18 -0
- package/manifiestos/modulos.json +4 -0
- package/manifiestos/planning-paths.json +44 -44
- package/manifiestos/skills-lock.json +1282 -1282
- package/package.json +2 -2
- package/plantillas/auditor-veto-template.md +105 -105
- package/plantillas/github-workflows/README.md +47 -47
- package/plantillas/github-workflows/release-please.yml +44 -44
- package/plantillas/github-workflows/swl-ci.yml +107 -107
- package/plantillas/github-workflows/swl-security.yml +51 -51
- package/plugin.json +2 -2
- package/reglas/accesibilidad.md +10 -10
- package/reglas/analisis-previo-tareas-grandes.md +172 -172
- package/reglas/api-diseno.md +9 -9
- package/reglas/arreglar-al-detectar.md +240 -240
- package/reglas/auditorias-documentales-estructurales.md +7 -7
- package/reglas/cloud-infra.md +8 -8
- package/reglas/consultar-vault-primero.md +195 -195
- package/reglas/debatir-antes-de-aceptar.md +158 -158
- package/reglas/fragmentos-compartidos.md +183 -183
- package/reglas/hooks.md +6 -6
- package/reglas/intent-engineering.md +218 -218
- package/reglas/markitdown.md +8 -8
- package/reglas/memoria-consolidada.md +41 -0
- package/reglas/monitor-ci.md +309 -309
- package/reglas/patrones.md +6 -6
- package/reglas/seguridad-agentes.md +66 -0
- package/reglas/sesiones-paralelas.md +180 -180
- package/reglas/sin-duplicacion-reglas-globales.md +182 -182
- package/reglas/skills-estandar.md +6 -6
- package/reglas/testing.md +7 -7
- package/reglas/tests-cleanup.md +224 -224
- package/reglas/usar-code-review-graph.md +155 -155
- package/reglas/usar-context7.md +226 -226
- package/reglas/verificar-citas-normativas.md +548 -548
- package/schemas/agent-frontmatter.schema.json +3 -3
- package/schemas/agent-message.schema.json +73 -73
- package/schemas/agent-output-implementacion.schema.json +114 -114
- package/schemas/agent-output-planificacion.schema.json +150 -150
- package/schemas/agent-output-review.schema.json +98 -98
- package/schemas/diary-entry.schema.json +112 -112
- package/schemas/hook-profiles.schema.json +54 -54
- package/schemas/hooks-config.schema.json +89 -89
- package/schemas/instinct.schema.json +161 -152
- package/schemas/modulos.schema.json +38 -38
- package/schemas/perfiles.schema.json +36 -36
- package/schemas/plugin.schema.json +77 -77
- package/schemas/skill-evals.schema.json +119 -119
- package/schemas/skill-frontmatter.schema.json +245 -245
- package/scripts/audit-tools/audit-history.js +330 -330
- package/scripts/audit-tools/bundle-tracker.js +290 -290
- package/scripts/audit-tools/canary-monitor.js +352 -352
- package/scripts/audit-tools/code-profiler.js +605 -605
- package/scripts/audit-tools/dep-doctor.js +320 -320
- package/scripts/audit-tools/env-validator.js +206 -206
- package/scripts/audit-tools/lib/fs-walk.js +48 -48
- package/scripts/audit-tools/lib/output.js +23 -23
- package/scripts/audit-tools/migration-checker.js +392 -392
- package/scripts/audit-tools/pentest-scanner.js +1436 -1436
- package/scripts/benchmark-memoria.js +167 -167
- package/scripts/bootstrap-instintos.js +25 -7
- package/scripts/cli/aprobar-plan.js +73 -73
- package/scripts/cli/briefing.js +23 -23
- package/scripts/cli/ciclo-evolucion.js +26 -26
- package/scripts/cli/configurar-ci.js +40 -40
- package/scripts/cli/derivar-feature-list.js +25 -25
- package/scripts/cli/detectar-host.js +27 -27
- package/scripts/cli/diary-entry.js +69 -69
- package/scripts/cli/execution-state.js +18 -18
- package/scripts/cli/gateway-notify.js +41 -41
- package/scripts/cli/liberar-fase.js +42 -42
- package/scripts/cli/loop-telemetry.js +125 -125
- package/scripts/cli/mark-evolved.js +56 -56
- package/scripts/cli/metricas-dora.js +26 -26
- package/scripts/cli/near-duplicate.js +55 -55
- package/scripts/cli/notificaciones.js +123 -123
- package/scripts/cli/propose-step.js +29 -29
- package/scripts/cli/schedule-parse.js +19 -19
- package/scripts/cli/sugerir-modelo.js +20 -20
- package/scripts/cli/verificar-plan.js +36 -36
- package/scripts/cli/verificar-trazabilidad.js +35 -35
- package/scripts/configurar-branch-protection.js +418 -418
- package/scripts/detectar-aprendizajes-duplicados.js +151 -151
- package/scripts/field-report.js +199 -199
- package/scripts/generar-checklists-consolidados.js +273 -273
- package/scripts/generar-matriz-lenguajes.js +271 -271
- package/scripts/lib/artefactos-python.js +43 -43
- package/scripts/lib/auditar-invocaciones-comandos.js +104 -104
- package/scripts/lib/benchmark-metrics.js +160 -160
- package/scripts/lib/budget-enforcer.js +252 -252
- package/scripts/lib/ci-reader.js +193 -193
- package/scripts/lib/claude-sessions.js +1 -0
- package/scripts/lib/configurar-ci.js +380 -380
- package/scripts/lib/contadores-inventario.js +217 -217
- package/scripts/lib/detectar-host-swl.js +175 -175
- package/scripts/lib/detectar-stack-detallado.js +307 -307
- package/scripts/lib/detector-autoduplicacion-intra-archivo.js +234 -234
- package/scripts/lib/detector-reglas-duplicadas.js +220 -220
- package/scripts/lib/diary-entry.js +234 -234
- package/scripts/lib/eval-metrics-store.js +218 -218
- package/scripts/lib/eval-quality.js +171 -171
- package/scripts/lib/eval-schemas.js +144 -144
- package/scripts/lib/eval-self-correct.js +106 -106
- package/scripts/lib/eval-validator.js +185 -185
- package/scripts/lib/evidencia-release.js +322 -322
- package/scripts/lib/expandir-targets.js +71 -71
- package/scripts/lib/gate-hooks-requires.js +249 -249
- package/scripts/lib/gate-licencias.js +212 -212
- package/scripts/lib/git-metricas.js +257 -257
- package/scripts/lib/gitignore-manifest.js +44 -11
- package/scripts/lib/jaccard-similarity.js +98 -98
- package/scripts/lib/longmemeval-runner.js +125 -125
- package/scripts/lib/metricas-dora.js +204 -204
- package/scripts/lib/npm-version.js +261 -261
- package/scripts/lib/paquetes-conocidos.js +50 -50
- package/scripts/lib/plan-lock.js +275 -275
- package/scripts/lib/pr-analyzer.js +399 -399
- package/scripts/lib/prompt-builder.js +264 -264
- package/scripts/lib/reglas-globales-conocidas.json +180 -180
- package/scripts/lib/resolver-plan-fase.js +37 -37
- package/scripts/lib/rrf-fusion.js +175 -175
- package/scripts/lib/schema-version.js +164 -164
- package/scripts/lib/scoring-instintos.js +277 -277
- package/scripts/lib/semantic-search.js +252 -252
- package/scripts/lib/skill-metrics.js +41 -1
- package/scripts/lib/toml-merge.js +204 -204
- package/scripts/lib/tool-cost-analyzer.js +1 -0
- package/scripts/limpiar-artefactos-python.js +131 -131
- package/scripts/mcp-server/auth.js +105 -105
- package/scripts/mcp-server/cache.js +106 -106
- package/scripts/migrar-csv-a-array.js +168 -168
- package/scripts/migrar-fase-dominio.js +200 -200
- package/scripts/publicar.js +497 -497
- package/scripts/run-eval.js +141 -141
- package/scripts/tui/componentes/selector-multi.js +189 -189
- package/scripts/tui/componentes/selector-unico.js +158 -158
- package/scripts/tui/ejecutores.js +375 -375
- package/scripts/tui/index.js +162 -162
- package/scripts/tui/lib/colores.js +129 -129
- package/scripts/tui/lib/render.js +264 -264
- package/scripts/tui/lib/teclas.js +113 -113
- package/scripts/tui/pantallas/inspect.js +173 -173
- package/scripts/tui/pantallas/install-wizard.js +334 -334
- package/scripts/tui/pantallas/menu-principal.js +52 -52
- package/scripts/tui/pantallas/progreso.js +274 -274
- package/scripts/tui/pantallas/resumen.js +132 -132
- package/scripts/tui/pantallas/uninstall-wizard.js +208 -208
- package/scripts/tui/pantallas/update-wizard.js +232 -232
- package/scripts/tui/pantallas/welcome.js +187 -187
- package/scripts/validar-userland-vacio.js +110 -110
- package/scripts/verificar-trazabilidad.js +329 -298
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lib: captura-acciones.js
|
|
5
|
+
*
|
|
6
|
+
* Núcleo puro y testeable de la captura de SEÑALES DE ACCIÓN del usuario
|
|
7
|
+
* (Fase 17, "Aprendizaje de señales de usuario"). Mientras
|
|
8
|
+
* `captura-feedback-usuario.js` captura las señales VERBALES (palabras tecleadas
|
|
9
|
+
* en UserPromptSubmit), esta lib alimenta las señales de ACCIÓN — la mitad
|
|
10
|
+
* procedural que hoy se pierde:
|
|
11
|
+
* - revert/reset de commits hechos por el agente,
|
|
12
|
+
* - edición manual de archivos que el agente escribió,
|
|
13
|
+
* - rechazo de un PLAN propuesto,
|
|
14
|
+
* - override de un veredicto de /swl:verificar.
|
|
15
|
+
*
|
|
16
|
+
* Las señales se encolan en el MISMO `.planning/evolution/feedback-queue.jsonl`
|
|
17
|
+
* con `tipo:"accion"` (esquema extendido backward-compatible con las verbales),
|
|
18
|
+
* para el mismo consumidor (perfilador-usuario-swl + ciclo AGP). Alcance Fase 17:
|
|
19
|
+
* **solo capturar + telemetría** — sin conversión a memoria procedural.
|
|
20
|
+
*
|
|
21
|
+
* Consumida por los hooks `captura-acciones-post.js` (PostToolUse) y
|
|
22
|
+
* `captura-acciones-session.js` (SessionStart). Zero-deps salvo `atomic-write`
|
|
23
|
+
* (sibling en hooks/lib/). Todas las funciones son puras o reciben `baseDir`
|
|
24
|
+
* explícito → testeables en aislamiento.
|
|
25
|
+
*
|
|
26
|
+
* Opt-out unificado (en los hooks, no aquí): SWL_CAPTURAR_FEEDBACK=0.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const fs = require('fs');
|
|
30
|
+
const path = require('path');
|
|
31
|
+
const crypto = require('crypto');
|
|
32
|
+
|
|
33
|
+
// atomic-write es sibling en hooks/lib/ (y queda en el mismo dir tras el
|
|
34
|
+
// aplanado del instalador). Fallback inline si faltara.
|
|
35
|
+
let atomicWriteJSON;
|
|
36
|
+
try {
|
|
37
|
+
({ atomicWriteJSON } = require('./atomic-write'));
|
|
38
|
+
} catch (_) {
|
|
39
|
+
atomicWriteJSON = (p, obj) => fs.writeFileSync(p, JSON.stringify(obj, null, 2), 'utf8');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Sanitización de evidencia (REQ-17-07)
|
|
44
|
+
//
|
|
45
|
+
// Port de los 5 patrones de `registro-turnos.js:67-82` + `reglas/seguridad.md
|
|
46
|
+
// § Sanitización PII centralizada`. La sanitización vive en el punto de
|
|
47
|
+
// persistencia (encolarAccion) — ningún path de encolado puede omitirla.
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
const PATRONES_REDACT = [
|
|
51
|
+
/\b[A-Za-z0-9_-]{32,}\b/g, // tokens largos
|
|
52
|
+
/(?:sk|pk|key|token|secret|password|pwd|api[_-]?key)["':\s=]+[A-Za-z0-9_\-./]{8,}/gi,
|
|
53
|
+
/\bey[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\b/g, // JWT
|
|
54
|
+
/https?:\/\/[^:]+:[^@\s]+@/g, // basic auth en URL
|
|
55
|
+
/-----BEGIN [A-Z ]+-----[\s\S]*?-----END [A-Z ]+-----/g, // PEM blocks
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
/** Redacta secretos de un texto libre (REQ-17-07). Best-effort, no lanza. */
|
|
59
|
+
function sanitizarEvidencia(texto) {
|
|
60
|
+
if (!texto) return '';
|
|
61
|
+
let r = String(texto);
|
|
62
|
+
for (const re of PATRONES_REDACT) r = r.replace(re, '[REDACTED]');
|
|
63
|
+
return r;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** SHA-256 hex de un string (módulo nativo, sin deps). */
|
|
67
|
+
function hashContenido(str) {
|
|
68
|
+
return crypto.createHash('sha256').update(String(str == null ? '' : str)).digest('hex');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// Rutas runtime (gitignored)
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
const MAX_EVIDENCIA_LEN = 500;
|
|
76
|
+
|
|
77
|
+
function rutaCola(baseDir) {
|
|
78
|
+
return path.join(baseDir, '.planning', 'evolution', 'feedback-queue.jsonl');
|
|
79
|
+
}
|
|
80
|
+
function rutaIndiceWrites(baseDir) {
|
|
81
|
+
return path.join(baseDir, '.planning', 'evolution', 'agent-writes-index.json');
|
|
82
|
+
}
|
|
83
|
+
function rutaCommits(baseDir) {
|
|
84
|
+
return path.join(baseDir, '.planning', 'evolution', 'agent-commits.jsonl');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function asegurarEvolutionDir(baseDir) {
|
|
88
|
+
const dir = path.join(baseDir, '.planning', 'evolution');
|
|
89
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
90
|
+
return dir;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
// Encolado (REQ-17-06, REQ-17-07)
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Encola una señal de acción en feedback-queue.jsonl. Esquema extendido
|
|
99
|
+
* backward-compatible: las entradas verbales legacy (sin `accion`) siguen
|
|
100
|
+
* parseando. La `evidencia` se sanitiza SIEMPRE aquí (invariante REQ-17-07).
|
|
101
|
+
*
|
|
102
|
+
* @param {string} baseDir raíz del proyecto (cwd del hook).
|
|
103
|
+
* @param {object} accion { accion, archivo?, evidencia?, sessionId?, cwd? }.
|
|
104
|
+
*/
|
|
105
|
+
function encolarAccion(baseDir, accion) {
|
|
106
|
+
try {
|
|
107
|
+
asegurarEvolutionDir(baseDir);
|
|
108
|
+
const entrada = {
|
|
109
|
+
ts: new Date().toISOString(),
|
|
110
|
+
sessionId: String(accion.sessionId || 'default'),
|
|
111
|
+
tipo: 'accion',
|
|
112
|
+
accion: accion.accion,
|
|
113
|
+
cwd: accion.cwd || baseDir,
|
|
114
|
+
procesado: false,
|
|
115
|
+
};
|
|
116
|
+
if (accion.archivo) entrada.archivo = String(accion.archivo);
|
|
117
|
+
if (accion.evidencia != null) {
|
|
118
|
+
entrada.evidencia = sanitizarEvidencia(accion.evidencia).slice(0, MAX_EVIDENCIA_LEN);
|
|
119
|
+
}
|
|
120
|
+
fs.appendFileSync(rutaCola(baseDir), JSON.stringify(entrada) + '\n');
|
|
121
|
+
} catch (_) {
|
|
122
|
+
/* nunca bloquear */
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Índice de escrituras del agente (REQ-17-02, REQ-17-03)
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
/** Lee el índice de hashes de escritura del agente; {} si ausente/corrupto. */
|
|
131
|
+
function leerIndiceWrites(baseDir) {
|
|
132
|
+
try {
|
|
133
|
+
const p = rutaIndiceWrites(baseDir);
|
|
134
|
+
if (!fs.existsSync(p)) return {};
|
|
135
|
+
const obj = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
136
|
+
return obj && typeof obj === 'object' ? obj : {};
|
|
137
|
+
} catch (_) {
|
|
138
|
+
return {};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function escribirIndiceWrites(baseDir, indice) {
|
|
143
|
+
try {
|
|
144
|
+
asegurarEvolutionDir(baseDir);
|
|
145
|
+
atomicWriteJSON(rutaIndiceWrites(baseDir), indice);
|
|
146
|
+
} catch (_) {
|
|
147
|
+
/* best-effort */
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Registra el hash del último write del agente sobre `rutaRel`. */
|
|
152
|
+
function registrarEscrituraAgente(baseDir, rutaRel, contenido, meta = {}) {
|
|
153
|
+
const indice = leerIndiceWrites(baseDir);
|
|
154
|
+
indice[rutaRel] = {
|
|
155
|
+
sha256: hashContenido(contenido),
|
|
156
|
+
ts: new Date().toISOString(),
|
|
157
|
+
sessionId: String(meta.sessionId || 'default'),
|
|
158
|
+
};
|
|
159
|
+
escribirIndiceWrites(baseDir, indice);
|
|
160
|
+
return indice;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
// Registro de commits del agente (REQ-17-01) — sin co-author (git-coauthor.md)
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
/** Registra un SHA commiteado por el agente en agent-commits.jsonl. */
|
|
168
|
+
function registrarCommitAgente(baseDir, { sessionId, sha, mensaje } = {}) {
|
|
169
|
+
try {
|
|
170
|
+
if (!sha) return;
|
|
171
|
+
asegurarEvolutionDir(baseDir);
|
|
172
|
+
const entrada = { ts: new Date().toISOString(), sessionId: String(sessionId || 'default'), sha: String(sha) };
|
|
173
|
+
// `mensaje` también se sanitiza (un mensaje de commit puede llevar un token
|
|
174
|
+
// pegado): este es un segundo path de persistencia y la invariante de no
|
|
175
|
+
// filtrar secretos aplica a TODO path, no solo a encolarAccion (sec BAJA-1).
|
|
176
|
+
if (mensaje) entrada.mensaje = sanitizarEvidencia(String(mensaje)).slice(0, 200);
|
|
177
|
+
fs.appendFileSync(rutaCommits(baseDir), JSON.stringify(entrada) + '\n');
|
|
178
|
+
} catch (_) {
|
|
179
|
+
/* best-effort */
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Lee los SHAs registrados por el agente; [] si ausente/corrupto. */
|
|
184
|
+
function leerCommitsAgente(baseDir) {
|
|
185
|
+
try {
|
|
186
|
+
const p = rutaCommits(baseDir);
|
|
187
|
+
if (!fs.existsSync(p)) return [];
|
|
188
|
+
return fs
|
|
189
|
+
.readFileSync(p, 'utf8')
|
|
190
|
+
.split(/\r?\n/)
|
|
191
|
+
.filter(Boolean)
|
|
192
|
+
.map((l) => {
|
|
193
|
+
try {
|
|
194
|
+
return JSON.parse(l);
|
|
195
|
+
} catch (_) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
.filter(Boolean);
|
|
200
|
+
} catch (_) {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
// Detectores puros
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* SHAs registrados por el agente que ya NO están en el historial actual
|
|
211
|
+
* (revert/reset). REQ-17-01.
|
|
212
|
+
* @param {Array<{sha:string}>|string[]} commitsRegistrados
|
|
213
|
+
* @param {string[]} shasHistorialActual
|
|
214
|
+
* @returns {string[]}
|
|
215
|
+
*/
|
|
216
|
+
function detectarRevert(commitsRegistrados, shasHistorialActual) {
|
|
217
|
+
const hist = new Set(shasHistorialActual || []);
|
|
218
|
+
const vistos = new Set();
|
|
219
|
+
const out = [];
|
|
220
|
+
for (const c of commitsRegistrados || []) {
|
|
221
|
+
const sha = typeof c === 'string' ? c : c && c.sha;
|
|
222
|
+
if (!sha || vistos.has(sha)) continue;
|
|
223
|
+
vistos.add(sha);
|
|
224
|
+
if (!hist.has(sha)) out.push(sha);
|
|
225
|
+
}
|
|
226
|
+
return out;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Archivos cuyo hash en disco difiere del último write del agente (edición
|
|
231
|
+
* neta del usuario fuera de sesión). REQ-17-02.
|
|
232
|
+
* @param {Object} indiceWrites { ruta: { sha256 } }
|
|
233
|
+
* @param {Object} hashActualPorArchivo { ruta: sha256 }
|
|
234
|
+
* @returns {string[]}
|
|
235
|
+
*/
|
|
236
|
+
function detectarEdicionNeta(indiceWrites, hashActualPorArchivo) {
|
|
237
|
+
const out = [];
|
|
238
|
+
for (const ruta of Object.keys(indiceWrites || {})) {
|
|
239
|
+
const actual = hashActualPorArchivo ? hashActualPorArchivo[ruta] : undefined;
|
|
240
|
+
if (actual === undefined) continue; // archivo borrado/ilegible → no inferir
|
|
241
|
+
const registrado = indiceWrites[ruta] && indiceWrites[ruta].sha256;
|
|
242
|
+
if (registrado && actual !== registrado) out.push(ruta);
|
|
243
|
+
}
|
|
244
|
+
return out;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* true si el contenido re-leído difiere del último write del agente (edición
|
|
249
|
+
* manual en caliente). false si coincide o no hay registro. REQ-17-03.
|
|
250
|
+
*/
|
|
251
|
+
function detectarEdicionManual(rutaArchivo, contenidoReleido, indiceWrites) {
|
|
252
|
+
const rec = indiceWrites && indiceWrites[rutaArchivo];
|
|
253
|
+
if (!rec || !rec.sha256) return false;
|
|
254
|
+
return hashContenido(contenidoReleido) !== rec.sha256;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function _frontmatterCampo(contenido, campo) {
|
|
258
|
+
const m = contenido.match(new RegExp(`^${campo}:\\s*(.+)$`, 'm'));
|
|
259
|
+
return m ? m[1].trim() : null;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function _faseDeNombre(nombre) {
|
|
263
|
+
const m = nombre.match(/^(\d{1,3})-/);
|
|
264
|
+
return m ? parseInt(m[1], 10) : null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* PLANs que parecen rechazados: estado `rechazado` explícito, o estado
|
|
269
|
+
* `borrador` sin lock G1 mientras la fase ya cerró (existe NN-RESUMEN.md).
|
|
270
|
+
* REQ-17-04.
|
|
271
|
+
* @returns {Array<{fase:number, archivo:string}>}
|
|
272
|
+
*/
|
|
273
|
+
function _evaluarPlanRechazado(archivo, fasesDir, locksDir) {
|
|
274
|
+
let contenido = '';
|
|
275
|
+
try {
|
|
276
|
+
contenido = fs.readFileSync(path.join(fasesDir, archivo), 'utf8');
|
|
277
|
+
} catch (_) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
const estado = (_frontmatterCampo(contenido, 'estado') || '').toLowerCase();
|
|
281
|
+
const fase = _faseDeNombre(archivo);
|
|
282
|
+
if (estado === 'rechazado') return { fase, archivo };
|
|
283
|
+
if (estado === 'borrador') {
|
|
284
|
+
const lock = path.join(locksDir, archivo + '.lock');
|
|
285
|
+
const resumen = path.join(fasesDir, archivo.replace('-PLAN.md', '-RESUMEN.md'));
|
|
286
|
+
if (!fs.existsSync(lock) && fs.existsSync(resumen)) return { fase, archivo };
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function detectarPlanRechazado(baseDir) {
|
|
292
|
+
const fasesDir = path.join(baseDir, '.planning', 'fases');
|
|
293
|
+
const locksDir = path.join(baseDir, '.planning', 'locks');
|
|
294
|
+
let archivos;
|
|
295
|
+
try {
|
|
296
|
+
archivos = fs.readdirSync(fasesDir).filter((f) => /-PLAN\.md$/.test(f));
|
|
297
|
+
} catch (_) {
|
|
298
|
+
return [];
|
|
299
|
+
}
|
|
300
|
+
return archivos.map((a) => _evaluarPlanRechazado(a, fasesDir, locksDir)).filter(Boolean);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* VERIFICACIONes con veredicto no-aprobatorio (caso determinista de override).
|
|
305
|
+
* La inferencia "se procedió igual" queda como inspección (T-10). REQ-17-05.
|
|
306
|
+
* @returns {Array<{fase:number, archivo:string, veredicto:string}>}
|
|
307
|
+
*/
|
|
308
|
+
function detectarVeredictoOverride(baseDir) {
|
|
309
|
+
const out = [];
|
|
310
|
+
const fasesDir = path.join(baseDir, '.planning', 'fases');
|
|
311
|
+
let archivos;
|
|
312
|
+
try {
|
|
313
|
+
archivos = fs.readdirSync(fasesDir).filter((f) => /-VERIFICACION\.md$/.test(f));
|
|
314
|
+
} catch (_) {
|
|
315
|
+
return out;
|
|
316
|
+
}
|
|
317
|
+
for (const archivo of archivos) {
|
|
318
|
+
let contenido = '';
|
|
319
|
+
try {
|
|
320
|
+
contenido = fs.readFileSync(path.join(fasesDir, archivo), 'utf8');
|
|
321
|
+
} catch (_) {
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
const m = contenido.match(/VEREDICTO:?\s*(RECHAZADO|REQUIERE[_\s]CORRECCIONES)/i);
|
|
325
|
+
if (m) out.push({ fase: _faseDeNombre(archivo), archivo, veredicto: m[1].toUpperCase().replace(/\s/g, '_') });
|
|
326
|
+
}
|
|
327
|
+
return out;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// ---------------------------------------------------------------------------
|
|
331
|
+
// Telemetría (REQ-17-09)
|
|
332
|
+
// ---------------------------------------------------------------------------
|
|
333
|
+
|
|
334
|
+
const SUBTIPOS = ['revert', 'edicion-manual', 'plan-rechazado', 'veredicto-override'];
|
|
335
|
+
|
|
336
|
+
/** Conteo por subtipo de acción en la cola; ignora entradas verbales. */
|
|
337
|
+
function contarPorSubtipo(baseDir) {
|
|
338
|
+
const conteo = Object.fromEntries(SUBTIPOS.map((s) => [s, 0]));
|
|
339
|
+
try {
|
|
340
|
+
const p = rutaCola(baseDir);
|
|
341
|
+
if (!fs.existsSync(p)) return conteo;
|
|
342
|
+
for (const linea of fs.readFileSync(p, 'utf8').split(/\r?\n/)) {
|
|
343
|
+
if (!linea) continue;
|
|
344
|
+
let e;
|
|
345
|
+
try {
|
|
346
|
+
e = JSON.parse(linea);
|
|
347
|
+
} catch (_) {
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
if (e && e.tipo === 'accion' && Object.prototype.hasOwnProperty.call(conteo, e.accion)) {
|
|
351
|
+
conteo[e.accion] += 1;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
} catch (_) {
|
|
355
|
+
/* devuelve ceros */
|
|
356
|
+
}
|
|
357
|
+
return conteo;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
module.exports = {
|
|
361
|
+
sanitizarEvidencia,
|
|
362
|
+
hashContenido,
|
|
363
|
+
encolarAccion,
|
|
364
|
+
leerIndiceWrites,
|
|
365
|
+
escribirIndiceWrites,
|
|
366
|
+
registrarEscrituraAgente,
|
|
367
|
+
registrarCommitAgente,
|
|
368
|
+
leerCommitsAgente,
|
|
369
|
+
detectarRevert,
|
|
370
|
+
detectarEdicionNeta,
|
|
371
|
+
detectarEdicionManual,
|
|
372
|
+
detectarPlanRechazado,
|
|
373
|
+
detectarVeredictoOverride,
|
|
374
|
+
contarPorSubtipo,
|
|
375
|
+
SUBTIPOS,
|
|
376
|
+
MAX_EVIDENCIA_LEN,
|
|
377
|
+
_internals: { PATRONES_REDACT, rutaCola, rutaIndiceWrites, rutaCommits },
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// ---------------------------------------------------------------------------
|
|
381
|
+
// CLI: `node hooks/lib/captura-acciones.js --conteo` (REQ-17-09 consultable)
|
|
382
|
+
// ---------------------------------------------------------------------------
|
|
383
|
+
|
|
384
|
+
if (require.main === module) {
|
|
385
|
+
try {
|
|
386
|
+
if (process.argv.includes('--conteo')) {
|
|
387
|
+
process.stdout.write(JSON.stringify(contarPorSubtipo(process.cwd()), null, 2) + '\n');
|
|
388
|
+
}
|
|
389
|
+
} catch (_) {
|
|
390
|
+
/* exit 0 siempre */
|
|
391
|
+
}
|
|
392
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* hooks/lib/ciclo-evolucion.js — Lib de dominio del ciclo de evolución (Fase 11).
|
|
5
|
-
*
|
|
6
|
-
* Consolida las 3 etapas que antes eran hooks independientes
|
|
7
|
-
* (`metricas-evolucion.js`, `actualizar-perfil-usuario.js`,
|
|
8
|
-
* `auto-evolucion.js`). Cada etapa preserva su lógica intacta en
|
|
9
|
-
* `etapa-*.js`; esta lib solo las compone para reducir procesos de arranque.
|
|
10
|
-
*
|
|
11
|
-
* Mapeo a entry points:
|
|
12
|
-
* - hooks/ciclo-evolucion.js (Stop) → metricas + perfil-usuario
|
|
13
|
-
* - hooks/ciclo-evolucion-subagente.js (SubagentStop) → auto-evolucion
|
|
14
|
-
*
|
|
15
|
-
* `auto-consolidacion.js` queda FUERA por diseño: pertenece al dominio de
|
|
16
|
-
* consolidación de aprendizajes (/swl:aprender), no al de evolución (D-12).
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const etapaMetricas = require('./etapa-metricas');
|
|
20
|
-
const etapaPerfilUsuario = require('./etapa-perfil-usuario');
|
|
21
|
-
const etapaAutoEvolucion = require('./etapa-auto-evolucion');
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Sub-etapas del evento Stop: métricas del ciclo + perfil de usuario.
|
|
25
|
-
* Cada etapa es best-effort (nunca lanza); un fallo en una no impide la otra.
|
|
26
|
-
* @param {string} inputRaw payload del hook Stop
|
|
27
|
-
*/
|
|
28
|
-
function ejecutarStop(inputRaw) {
|
|
29
|
-
try { etapaMetricas.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
30
|
-
try { etapaPerfilUsuario.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Sub-etapa del evento SubagentStop: auto-evolución de agentes.
|
|
35
|
-
* @param {string} inputRaw payload del hook SubagentStop
|
|
36
|
-
*/
|
|
37
|
-
function ejecutarSubagentStop(inputRaw) {
|
|
38
|
-
try { etapaAutoEvolucion.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
module.exports = {
|
|
42
|
-
ejecutarStop,
|
|
43
|
-
ejecutarSubagentStop,
|
|
44
|
-
etapaMetricas,
|
|
45
|
-
etapaPerfilUsuario,
|
|
46
|
-
etapaAutoEvolucion,
|
|
47
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* hooks/lib/ciclo-evolucion.js — Lib de dominio del ciclo de evolución (Fase 11).
|
|
5
|
+
*
|
|
6
|
+
* Consolida las 3 etapas que antes eran hooks independientes
|
|
7
|
+
* (`metricas-evolucion.js`, `actualizar-perfil-usuario.js`,
|
|
8
|
+
* `auto-evolucion.js`). Cada etapa preserva su lógica intacta en
|
|
9
|
+
* `etapa-*.js`; esta lib solo las compone para reducir procesos de arranque.
|
|
10
|
+
*
|
|
11
|
+
* Mapeo a entry points:
|
|
12
|
+
* - hooks/ciclo-evolucion.js (Stop) → metricas + perfil-usuario
|
|
13
|
+
* - hooks/ciclo-evolucion-subagente.js (SubagentStop) → auto-evolucion
|
|
14
|
+
*
|
|
15
|
+
* `auto-consolidacion.js` queda FUERA por diseño: pertenece al dominio de
|
|
16
|
+
* consolidación de aprendizajes (/swl:aprender), no al de evolución (D-12).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const etapaMetricas = require('./etapa-metricas');
|
|
20
|
+
const etapaPerfilUsuario = require('./etapa-perfil-usuario');
|
|
21
|
+
const etapaAutoEvolucion = require('./etapa-auto-evolucion');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Sub-etapas del evento Stop: métricas del ciclo + perfil de usuario.
|
|
25
|
+
* Cada etapa es best-effort (nunca lanza); un fallo en una no impide la otra.
|
|
26
|
+
* @param {string} inputRaw payload del hook Stop
|
|
27
|
+
*/
|
|
28
|
+
function ejecutarStop(inputRaw) {
|
|
29
|
+
try { etapaMetricas.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
30
|
+
try { etapaPerfilUsuario.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Sub-etapa del evento SubagentStop: auto-evolución de agentes.
|
|
35
|
+
* @param {string} inputRaw payload del hook SubagentStop
|
|
36
|
+
*/
|
|
37
|
+
function ejecutarSubagentStop(inputRaw) {
|
|
38
|
+
try { etapaAutoEvolucion.ejecutar(inputRaw); } catch { /* best-effort */ }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
ejecutarStop,
|
|
43
|
+
ejecutarSubagentStop,
|
|
44
|
+
etapaMetricas,
|
|
45
|
+
etapaPerfilUsuario,
|
|
46
|
+
etapaAutoEvolucion,
|
|
47
|
+
};
|