@saulwade/swl-ses 2.5.2 → 2.6.0

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.
Files changed (183) hide show
  1. package/CLAUDE.md +194 -192
  2. package/README.md +600 -600
  3. package/agentes/auto-evolucion-swl.md +27 -3
  4. package/bin/swl-ses.js +32 -6
  5. package/comandos/swl/actualizar.md +174 -174
  6. package/comandos/swl/adoptar-proyecto.md +265 -265
  7. package/comandos/swl/aprender.md +836 -823
  8. package/comandos/swl/aprobar-plan.md +146 -146
  9. package/comandos/swl/auditar-deps.md +134 -134
  10. package/comandos/swl/autoresearch.md +264 -264
  11. package/comandos/swl/ayuda.md +224 -224
  12. package/comandos/swl/brainstorm.md +51 -51
  13. package/comandos/swl/briefing.md +119 -119
  14. package/comandos/swl/checkpoint.md +325 -325
  15. package/comandos/swl/claudemd.md +234 -234
  16. package/comandos/swl/compactar.md +310 -310
  17. package/comandos/swl/configurar-ci.md +235 -235
  18. package/comandos/swl/contexto.md +110 -110
  19. package/comandos/swl/contribuir.md +233 -233
  20. package/comandos/swl/crear-skill.md +292 -292
  21. package/comandos/swl/cron.md +194 -194
  22. package/comandos/swl/deuda-codigo.md +97 -97
  23. package/comandos/swl/discutir-fase.md +169 -169
  24. package/comandos/swl/ejecutar-fase.md +233 -233
  25. package/comandos/swl/evaluar-skill.md +520 -505
  26. package/comandos/swl/evolucion-continua.md +73 -0
  27. package/comandos/swl/evolucionar.md +267 -254
  28. package/comandos/swl/exportar-vault.md +583 -583
  29. package/comandos/swl/fix.md +118 -118
  30. package/comandos/swl/gateway.md +158 -158
  31. package/comandos/swl/inbox.md +116 -116
  32. package/comandos/swl/instalar.md +220 -220
  33. package/comandos/swl/instintos.md +86 -86
  34. package/comandos/swl/mapear-codebase.md +312 -312
  35. package/comandos/swl/mcp-status.md +175 -175
  36. package/comandos/swl/modelo.md +100 -100
  37. package/comandos/swl/nemesis.md +433 -433
  38. package/comandos/swl/notificaciones.md +299 -299
  39. package/comandos/swl/nuevo-proyecto.md +251 -251
  40. package/comandos/swl/planear-fase.md +263 -263
  41. package/comandos/swl/plugins.md +256 -256
  42. package/comandos/swl/predecir.md +169 -169
  43. package/comandos/swl/reflect-skills.md +125 -125
  44. package/comandos/swl/release.md +450 -450
  45. package/comandos/swl/revisar-impacto.md +201 -201
  46. package/comandos/swl/revisar.md +330 -330
  47. package/comandos/swl/seguridad.md +189 -189
  48. package/comandos/swl/sesiones.md +200 -200
  49. package/comandos/swl/skill-search.md +113 -113
  50. package/comandos/swl/status.md +343 -343
  51. package/comandos/swl/verificar.md +817 -817
  52. package/comandos/swl/wiki.md +620 -620
  53. package/gateway/cron/jobs.example.json +12 -0
  54. package/habilidades/auto-evolucion-protocolo/SKILL.md +294 -276
  55. package/habilidades/autoresearch/SKILL.md +3 -2
  56. package/habilidades/benchmark-memoria/SKILL.md +7 -7
  57. package/habilidades/changelog-generator/SKILL.md +174 -174
  58. package/habilidades/changelog-generator/scripts/parse-commits.js +2 -1
  59. package/habilidades/checkpoints-verificacion/SKILL.md +6 -0
  60. package/habilidades/context-builder/SKILL.md +4 -0
  61. package/habilidades/doubt-driven-review/SKILL.md +207 -191
  62. package/habilidades/drift-detection/SKILL.md +6 -1
  63. package/habilidades/ejecutar-fase/SKILL.md +6 -6
  64. package/habilidades/eval-framework/SKILL.md +8 -3
  65. package/habilidades/harness-claude-code/SKILL.md +314 -308
  66. package/habilidades/infra-github-actions/SKILL.md +4 -3
  67. package/habilidades/instalar-sistema/SKILL.md +227 -223
  68. package/habilidades/memoria-busqueda/SKILL.md +31 -39
  69. package/habilidades/planear-fase/SKILL.md +358 -350
  70. package/habilidades/proceso-ddia-fundamentos/SKILL.md +3 -2
  71. package/habilidades/release-semver/SKILL.md +4 -2
  72. package/habilidades/swl-claudemd/SKILL.md +6 -7
  73. package/habilidades/swl-dashboard/SKILL.md +11 -43
  74. package/habilidades/tdd-workflow/SKILL.md +749 -744
  75. package/habilidades/validacion-ci-sistema/SKILL.md +1 -1
  76. package/hooks/agente-lifecycle.js +2 -1
  77. package/hooks/aiisms-detector.js +13 -4
  78. package/hooks/audit-trail.js +2 -1
  79. package/hooks/auto-consolidacion.js +2 -1
  80. package/hooks/captura-acciones-post.js +2 -1
  81. package/hooks/captura-acciones-session.js +2 -1
  82. package/hooks/captura-feedback-usuario.js +3 -2
  83. package/hooks/claudemd-bloat-detector.js +12 -3
  84. package/hooks/claudemd-duplicacion-detector.js +13 -3
  85. package/hooks/contexto-iteracion.js +2 -1
  86. package/hooks/degradacion-instintos.js +2 -1
  87. package/hooks/extraccion-aprendizajes.js +109 -15
  88. package/hooks/grafo-contexto.js +2 -1
  89. package/hooks/guardrail-modelo.js +2 -1
  90. package/hooks/inbox-aviso.js +2 -1
  91. package/hooks/inyeccion-contexto.js +2 -1
  92. package/hooks/lib/agent-matcher.js +2 -1
  93. package/hooks/lib/agent-routing.js +2 -1
  94. package/hooks/lib/autonomia.js +5 -3
  95. package/hooks/lib/captura-acciones.js +2 -1
  96. package/hooks/lib/consolidation-lock.js +21 -10
  97. package/hooks/lib/etapa-auto-evolucion.js +10 -4
  98. package/hooks/lib/etapa-metricas.js +2 -1
  99. package/hooks/lib/etapa-perfil-usuario.js +20 -4
  100. package/hooks/lib/evolution-tracker.js +2 -1
  101. package/hooks/lib/gateway-notify.js +193 -179
  102. package/hooks/lib/loop-telemetry.js +5 -4
  103. package/hooks/lib/mcp-health.js +2 -1
  104. package/hooks/lib/memory-search.js +4 -0
  105. package/hooks/lib/merkle-audit.js +58 -6
  106. package/hooks/lib/nudge-tracker.js +2 -1
  107. package/hooks/lib/otlp-exporter.js +2 -1
  108. package/hooks/lib/propose-step.js +3 -2
  109. package/hooks/lib/raiz-proyecto.js +102 -0
  110. package/hooks/lib/run-log.js +2 -1
  111. package/hooks/lib/singleton-guard.js +218 -27
  112. package/hooks/lib/telegram-cliente.js +17 -8
  113. package/hooks/preservar-estado-pre-compact.js +2 -1
  114. package/hooks/proteccion-rutas.js +59 -3
  115. package/hooks/registro-turnos.js +2 -1
  116. package/hooks/resumen-sesion.js +2 -1
  117. package/hooks/risk-scoring.js +2 -1
  118. package/hooks/rotar-audit-auto.js +46 -20
  119. package/hooks/session-briefing.js +127 -1
  120. package/hooks/spec-gate.js +2 -1
  121. package/hooks/sugerir-contribuir.js +6 -3
  122. package/hooks/sugerir-regenerar-inventario.js +3 -2
  123. package/hooks/tdd-gate.js +2 -1
  124. package/hooks/telemetria-agentes.js +2 -1
  125. package/hooks/telemetria-skill-routing.js +2 -1
  126. package/hooks/tracking-costos.js +4 -3
  127. package/hooks/validar-formato-post-subagente.js +2 -1
  128. package/hooks/validar-intent-spec.js +2 -1
  129. package/hooks/validar-memoria-hook.js +13 -3
  130. package/hooks/validar-planning-paths.js +2 -1
  131. package/instintos/.backups/perfil-usuario.yaml.2026-07-10-165128.bak +53 -0
  132. package/instintos/.backups/proyecto.yaml.2026-07-10-165128.bak +372 -0
  133. package/instintos/perfil-usuario.yaml +506 -3
  134. package/instintos/proyecto.yaml +78 -0
  135. package/llms.txt +2 -2
  136. package/manifiestos/canonical-hashes.json +664 -2
  137. package/manifiestos/modulos.json +19 -14
  138. package/manifiestos/planning-paths.json +1 -0
  139. package/manifiestos/skills-lock.json +53 -53
  140. package/package.json +2 -3
  141. package/plugin.json +2 -2
  142. package/scripts/actualizar.js +3 -0
  143. package/scripts/auditar-clases-conocidas.js +32 -4
  144. package/scripts/benchmark-memoria.js +1 -0
  145. package/scripts/cli/autonomia.js +23 -0
  146. package/scripts/cli/benchmark-memoria.js +37 -0
  147. package/scripts/cli/ciclo-autonomo.js +73 -0
  148. package/scripts/cli/ciclo-fase-b.js +102 -0
  149. package/scripts/cli/guardrail-metrics.js +39 -0
  150. package/scripts/cli/loop-telemetry.js +4 -2
  151. package/scripts/cli/memoria-search.js +69 -0
  152. package/scripts/cli/nudge-accionar.js +39 -0
  153. package/scripts/cli/run-eval.js +38 -0
  154. package/scripts/cli/run-skill-evals.js +13 -2
  155. package/scripts/derivar-feature-list.js +15 -14
  156. package/scripts/desinstalar.js +11 -0
  157. package/scripts/doctor.js +24 -10
  158. package/scripts/instalador.js +106 -7
  159. package/scripts/lib/activar-hooks-proyecto.js +116 -0
  160. package/scripts/lib/auditar-invocaciones-comandos.js +96 -6
  161. package/scripts/lib/ciclo-autonomo/candidatos.js +174 -0
  162. package/scripts/lib/ciclo-autonomo/config.js +165 -0
  163. package/scripts/lib/ciclo-autonomo/drenador-feedback.js +174 -0
  164. package/scripts/lib/ciclo-autonomo/fallback.js +77 -0
  165. package/scripts/lib/ciclo-autonomo/guard-convivencia.js +139 -0
  166. package/scripts/lib/ciclo-autonomo/higiene-nudges.js +112 -0
  167. package/scripts/lib/ciclo-autonomo/index.js +301 -0
  168. package/scripts/lib/ciclo-autonomo/lock.js +124 -0
  169. package/scripts/lib/ciclo-autonomo/presupuesto.js +122 -0
  170. package/scripts/lib/ciclo-autonomo/puente-degradacion.js +240 -0
  171. package/scripts/lib/ciclo-autonomo/runner-fase-b.js +248 -0
  172. package/scripts/lib/ciclo-autonomo/writer-instintos.js +190 -0
  173. package/scripts/lib/ciclo-autonomo/yaml-instintos.js +535 -0
  174. package/scripts/lib/estado.js +9 -0
  175. package/scripts/lib/evidencia-valor.js +1 -1
  176. package/scripts/lib/gitignore-manifest.js +8 -1
  177. package/scripts/lib/hooks-settings.js +45 -0
  178. package/scripts/rotar-audit-logs.js +48 -2
  179. package/scripts/run-eval.js +1 -0
  180. package/scripts/run-skill-evals.js +287 -8
  181. package/scripts/smoke-test.js +16 -8
  182. package/scripts/tui/pantallas/install-wizard.js +403 -347
  183. package/scripts/validar.js +40 -1
@@ -814,6 +814,7 @@
814
814
  "archivos": [
815
815
  "comandos/swl/actualizar.md",
816
816
  "comandos/swl/evolucionar.md",
817
+ "comandos/swl/evolucion-continua.md",
817
818
  "comandos/swl/release.md",
818
819
  "comandos/swl/auditar-deps.md",
819
820
  "comandos/swl/seguridad.md",
@@ -1040,6 +1041,7 @@
1040
1041
  "hooks/lib/guardrail-metrics.js",
1041
1042
  "hooks/lib/hook-circuit-breaker.js",
1042
1043
  "hooks/lib/loop-detector.js",
1044
+ "hooks/lib/loop-telemetry.js",
1043
1045
  "hooks/lib/mcp-health.js",
1044
1046
  "hooks/lib/mcp-pool.js",
1045
1047
  "hooks/lib/model-router.js",
@@ -1049,6 +1051,7 @@
1049
1051
  "hooks/lib/privacy-filter.js",
1050
1052
  "hooks/lib/prompt-injection-scanner.js",
1051
1053
  "hooks/lib/propose-step.js",
1054
+ "hooks/lib/raiz-proyecto.js",
1052
1055
  "hooks/lib/rate-limit-ip.js",
1053
1056
  "hooks/lib/reflect-classifier.js",
1054
1057
  "hooks/lib/risk-engine.js",
@@ -1078,6 +1081,13 @@
1078
1081
  "hooks/validar-memoria-hook.js",
1079
1082
  "hooks/validar-planning-paths.js",
1080
1083
  "scripts/lib/canonical-hash.js",
1084
+ "scripts/lib/ciclo-autonomo/candidatos.js",
1085
+ "scripts/lib/ciclo-autonomo/config.js",
1086
+ "scripts/lib/ciclo-autonomo/fallback.js",
1087
+ "scripts/lib/ciclo-autonomo/guard-convivencia.js",
1088
+ "scripts/lib/ciclo-autonomo/lock.js",
1089
+ "scripts/lib/ciclo-autonomo/presupuesto.js",
1090
+ "scripts/lib/ciclo-autonomo/runner-fase-b.js",
1081
1091
  "scripts/lib/drift-detector.js",
1082
1092
  "scripts/lib/git-metricas.js",
1083
1093
  "scripts/lib/npm-version.js",
@@ -1222,7 +1232,7 @@
1222
1232
  },
1223
1233
  "graphify-swl": {
1224
1234
  "descripcion": "Grafo de dependencias SWL: análisis topológico real portado de graphify-3. God nodes, blast radius, community detection, diff de grafos y hook de inyección de contexto.",
1225
- "tipo": "scripts",
1235
+ "tipo": "mixto",
1226
1236
  "archivos": [
1227
1237
  "hooks/lib/graph-security.js",
1228
1238
  "hooks/grafo-contexto.js",
@@ -1239,7 +1249,7 @@
1239
1249
  },
1240
1250
  "mcp-swl": {
1241
1251
  "descripcion": "Integracion MCP para swl-ses: pool de conexiones, telemetria OTLP-lite y orquestacion multi-servidor. Portado de patrones de mcp-use-main.",
1242
- "tipo": "scripts",
1252
+ "tipo": "mixto",
1243
1253
  "archivos": [
1244
1254
  "scripts/mcp-pool-manager.py",
1245
1255
  "scripts/mcp-telemetry.py",
@@ -1254,7 +1264,7 @@
1254
1264
  },
1255
1265
  "sap-auditores": {
1256
1266
  "descripcion": "Auditores SAP (Skill Authoring Patterns) para skills y agentes: detectan Exclusion Clauses, Gotchas, herramientas permitidas y cobertura de frameworks de seguridad. Opt-in en /swl:salud vía SWL_AUDIT_SKILLS=1, SWL_AUDIT_FRAMEWORKS=1 y SWL_AUDIT_AGENTES=1. Zero-deps, CRLF-safe, EXCEPCIONES_DOCUMENTADAS como guardrail (ADR-0002..0005).",
1257
- "tipo": "scripts",
1267
+ "tipo": "mixto",
1258
1268
  "archivos": [
1259
1269
  "scripts/auditar-skills-gaps.js",
1260
1270
  "scripts/auditar-cobertura-frameworks.js",
@@ -1272,13 +1282,12 @@
1272
1282
  },
1273
1283
  "claudemd-auditor": {
1274
1284
  "descripcion": "Auditor de calidad de CLAUDE.md según best practices Anthropic (ADR-0016). Detecta inflación (líneas excesivas, bullets gigantes, secciones canónicas ausentes, sin @references, placeholders). Dimensión 8 (v1.7.0): duplicación inline de reglas globales ~/.claude/rules/ vía catálogo declarativo. Dimensión 9 (v1.7.2): auto-duplicación intra-archivo (2+ secciones H2 citan la misma regla global con prosa). Usado por el comando /swl:claudemd y por el hook claudemd-bloat-detector. Zero-deps. Soporta --json y --strict. Umbrales configurables: SWL_CLAUDEMD_MAX_LINES (default 200), SWL_CLAUDEMD_MAX_BULLET_CHARS (default 1000).",
1275
- "tipo": "scripts",
1285
+ "tipo": "mixto",
1276
1286
  "archivos": [
1277
1287
  "scripts/auditar-claudemd.js",
1278
1288
  "scripts/lib/detector-reglas-duplicadas.js",
1279
1289
  "scripts/lib/detector-autoduplicacion-intra-archivo.js",
1280
- "scripts/lib/reglas-globales-conocidas.json",
1281
- "docs/variables-entorno.md"
1290
+ "scripts/lib/reglas-globales-conocidas.json"
1282
1291
  ],
1283
1292
  "targets": [
1284
1293
  "claude",
@@ -1323,13 +1332,9 @@
1323
1332
  ]
1324
1333
  },
1325
1334
  "mcp-server-swl": {
1326
- "descripcion": "MCP server stub experimental que expone memoria SWL (aprendizajes, sesiones, instintos) a clientes MCP externos (Cursor, Gemini CLI, OpenCode, Cline, Claude Desktop). Modo stdio. 3 endpoints: swl_memory_search, swl_aprendizajes_recientes, swl_instintos_activos. SIN auth, SIN rate limiting, SIN HTTP transport, SIN tests integración. NO USAR EN PRODUCCIÓN. Trigger para hardening: uso real ≥2 runtimes diferentes consistentemente por ≥1 mes. El binario `swl-mcp-server` se instala automáticamente vía npm install -g (declarado en package.json bin). NO se propaga al runtime SWL — vive en el paquete npm como herramienta opt-in. Ver scripts/mcp-server/README.md para 11 limitaciones explícitas y diseño futuro.",
1327
- "tipo": "scripts",
1328
- "archivos": [
1329
- "bin/swl-mcp-server.js",
1330
- "scripts/mcp-server/handlers.js",
1331
- "scripts/mcp-server/README.md"
1332
- ],
1335
+ "descripcion": "MCP server stub experimental que expone memoria SWL (aprendizajes, sesiones, instintos) a clientes MCP externos (Cursor, Gemini CLI, OpenCode, Cline, Claude Desktop). Modo stdio. 3 endpoints: swl_memory_search, swl_aprendizajes_recientes, swl_instintos_activos. SIN auth, SIN rate limiting, SIN HTTP transport, SIN tests integración. NO USAR EN PRODUCCIÓN. Trigger para hardening: uso real ≥2 runtimes diferentes consistentemente por ≥1 mes. El binario `swl-mcp-server` se instala automáticamente vía npm install -g (declarado en package.json bin). NO se propaga al runtime SWL — vive en el paquete npm como herramienta opt-in. Ver scripts/mcp-server/README.md para 11 limitaciones explícitas y diseño futuro. El servidor se ejecuta desde el bin del paquete npm (swl-mcp-server); este módulo no distribuye archivos al destino.",
1336
+ "tipo": "mixto",
1337
+ "archivos": [],
1333
1338
  "targets": [
1334
1339
  "claude",
1335
1340
  "openclaude",
@@ -1341,7 +1346,7 @@
1341
1346
  },
1342
1347
  "rotacion-audit": {
1343
1348
  "descripcion": "Rotación de logs de auditoría (.planning/audit.jsonl y audit-merkle.jsonl) a archivos .gz mensuales en .planning/archive/audit/. Política por defecto: entradas con timestamp mayor a 30 días se archivan. Zero-deps (fs/zlib/path), CRLF-safe, preserva cadena Merkle. Ejecución automática vía hook Stop 'rotar-audit-auto.js' cuando algún audit*.jsonl supera 5 MB (cooldown 6h). Ejecución manual vía 'node scripts/rotar-audit-logs.js' con --dry-run/--dias=N opcionales. Desactivable con SWL_AUDIT_ROTATE_OFF=1.",
1344
- "tipo": "scripts",
1349
+ "tipo": "mixto",
1345
1350
  "archivos": [
1346
1351
  "scripts/rotar-audit-logs.js",
1347
1352
  "hooks/rotar-audit-auto.js"
@@ -34,6 +34,7 @@
34
34
  "archivos_top_level_conocidos": [
35
35
  "APRENDIZAJES.md", "ESTADO.md", "HOJA-RUTA.md", "PROYECTO.md", "REQUISITOS.md",
36
36
  "COMPACTACION.md", "METRICAS.md", "AUDITORIA.md", "PLUGINS.md", "DEUDA-TECNICA.md",
37
+ "DEUDA-TECNICA-RESUELTA.md",
37
38
  "REPORTE-GRAFO.md", "feature-list.json", "gateway-sessions.json", "audit.jsonl",
38
39
  "audit-merkle.jsonl", "continue-here.md"
39
40
  ],
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "lockfileVersion": 1,
3
- "generatedAt": "2026-07-09T19:58:34.042Z",
3
+ "generatedAt": "2026-07-11T03:43:51.543Z",
4
4
  "skillsCount": 181,
5
- "lockHash": "sha256:60e8d0c732526f1329974a4bae2894a493e92a6b506ce192ca7cd5b04f2609da",
5
+ "lockHash": "sha256:5e024188432ac3d5c2148a9987340e326dc083820d3c9cf9752f8925be528b1b",
6
6
  "skills": [
7
7
  {
8
8
  "nombre": "accesibilidad-a11y",
@@ -91,15 +91,15 @@
91
91
  {
92
92
  "nombre": "auto-evolucion-protocolo",
93
93
  "path": "habilidades/auto-evolucion-protocolo/SKILL.md",
94
- "hash": "sha256:2ed0a14ac985a4b875b2acda5dae511e2722a85e935bfc4f702a95b5a6a79ccc",
95
- "bytes": 14672,
96
- "version": "\"1.1.1\""
94
+ "hash": "sha256:9a7fc5eb7da0a6f2b7e4d84098ff598303871dd214492afe9739d8982cc988f0",
95
+ "bytes": 15437,
96
+ "version": "\"1.1.2\""
97
97
  },
98
98
  {
99
99
  "nombre": "autoresearch",
100
100
  "path": "habilidades/autoresearch/SKILL.md",
101
- "hash": "sha256:2d60940136558246ac49eb764ba31e9dc8f9be58558d95a950f069e239493c17",
102
- "bytes": 12826,
101
+ "hash": "sha256:2cbd09b5e322e9ad2733fe91441c1ec189adcb8db65a4192af605fcc92253c02",
102
+ "bytes": 12949,
103
103
  "version": "\"1.1.0\""
104
104
  },
105
105
  {
@@ -140,8 +140,8 @@
140
140
  {
141
141
  "nombre": "benchmark-memoria",
142
142
  "path": "habilidades/benchmark-memoria/SKILL.md",
143
- "hash": "sha256:c221c61b48a86955820950e230def5f0b7139466ad36f7947cc89a393b403346",
144
- "bytes": 7677,
143
+ "hash": "sha256:98cbff0e31e340677f066ef68d77fa961ef838d3ce364b8565089fa33964ebc9",
144
+ "bytes": 7547,
145
145
  "version": "\"1.0.0\""
146
146
  },
147
147
  {
@@ -266,9 +266,9 @@
266
266
  {
267
267
  "nombre": "changelog-generator",
268
268
  "path": "habilidades/changelog-generator/SKILL.md",
269
- "hash": "sha256:1d2cad1dac64cf5bdb9d169013cd481a8447a2e844792123f88de4c6008f6d65",
270
- "bytes": 7811,
271
- "version": "1.1.0"
269
+ "hash": "sha256:02e47f8903d0032b446a415e2939129a2a329c088c115c15434244d6a82702c8",
270
+ "bytes": 7637,
271
+ "version": "1.1.1"
272
272
  },
273
273
  {
274
274
  "nombre": "checklist-calidad",
@@ -287,8 +287,8 @@
287
287
  {
288
288
  "nombre": "checkpoints-verificacion",
289
289
  "path": "habilidades/checkpoints-verificacion/SKILL.md",
290
- "hash": "sha256:e8ed65d37404e4d17564fc1d0e3c2a40cb75add2ac7c26cbbc49f603bed099e3",
291
- "bytes": 13300,
290
+ "hash": "sha256:0723eb8d598dccbd72b6ae43ec55cd2c28d1f463ea5a237856af596cfa357fe4",
291
+ "bytes": 13643,
292
292
  "version": "\"1.1.0\""
293
293
  },
294
294
  {
@@ -322,8 +322,8 @@
322
322
  {
323
323
  "nombre": "context-builder",
324
324
  "path": "habilidades/context-builder/SKILL.md",
325
- "hash": "sha256:c95f827ebabe75ff264b9141c65ae0b5e88ad2304f308a0952897e73fc10cae6",
326
- "bytes": 8620,
325
+ "hash": "sha256:ade43671a9041e5a8d6e6fcbc0295f48e1ef53c4c8acd924ae967bd03a04a0bf",
326
+ "bytes": 8843,
327
327
  "version": "\"1.1.0\""
328
328
  },
329
329
  {
@@ -448,22 +448,22 @@
448
448
  {
449
449
  "nombre": "doubt-driven-review",
450
450
  "path": "habilidades/doubt-driven-review/SKILL.md",
451
- "hash": "sha256:0fc4bdf6c7f790062a1de38475a71711260a4cff1f1ea7258537d5919b1f7739",
452
- "bytes": 9099,
453
- "version": "\"1.1.0\""
451
+ "hash": "sha256:18a16aa4d59fe5cdf87cad0958652458704e6e3e5a8ee8b1128377a7fb818a41",
452
+ "bytes": 9952,
453
+ "version": "\"1.2.0\""
454
454
  },
455
455
  {
456
456
  "nombre": "drift-detection",
457
457
  "path": "habilidades/drift-detection/SKILL.md",
458
- "hash": "sha256:4125b7d74a1caee692d4a8c6a8a78e87642ebfd10a39a58138541f8b7d761f0e",
459
- "bytes": 8623,
460
- "version": "1.0.0"
458
+ "hash": "sha256:73279e0cead4d8b817b97a5b1bbb267a2971bcea5a40d3e2b2de65140b2bb4ef",
459
+ "bytes": 8900,
460
+ "version": "1.0.1"
461
461
  },
462
462
  {
463
463
  "nombre": "ejecutar-fase",
464
464
  "path": "habilidades/ejecutar-fase/SKILL.md",
465
- "hash": "sha256:7c8b14b9027eff6c40dd1577219065145c672c6c48d4b7e65ee4acf68f37d3c1",
466
- "bytes": 24861,
465
+ "hash": "sha256:d69bef0af236937a36a923fdf69f3cabb838d38bfd3fe13c2a68ba04dddf65b0",
466
+ "bytes": 24593,
467
467
  "version": "\"1.2.2\""
468
468
  },
469
469
  {
@@ -490,8 +490,8 @@
490
490
  {
491
491
  "nombre": "eval-framework",
492
492
  "path": "habilidades/eval-framework/SKILL.md",
493
- "hash": "sha256:a2312695b28b1ffc92bdf7ec5144ca1f3a87c05a9fa5a98180d9e71e3d58f11d",
494
- "bytes": 7990,
493
+ "hash": "sha256:ef002c5101ff8600794c21eec10d4026864d9bd20aa59970f1e9eff00a9bd229",
494
+ "bytes": 8325,
495
495
  "version": "\"1.0.0\""
496
496
  },
497
497
  {
@@ -602,9 +602,9 @@
602
602
  {
603
603
  "nombre": "harness-claude-code",
604
604
  "path": "habilidades/harness-claude-code/SKILL.md",
605
- "hash": "sha256:90a45cb0d932ccd38bbb2fc09ef86149d640dd073ab6d21a841db33a6baf41db",
606
- "bytes": 17714,
607
- "version": "\"1.0.4\""
605
+ "hash": "sha256:846ac530d77b303810b1b61e80faa164e9a6610abab13880d00c41981418a22e",
606
+ "bytes": 19553,
607
+ "version": "\"1.0.6\""
608
608
  },
609
609
  {
610
610
  "nombre": "iam-secretos",
@@ -616,16 +616,16 @@
616
616
  {
617
617
  "nombre": "infra-github-actions",
618
618
  "path": "habilidades/infra-github-actions/SKILL.md",
619
- "hash": "sha256:c41c5e2cba14e46814a5e31ae968714eb62d58cd9fad219bbe3078f86f96a9ee",
620
- "bytes": 8039,
619
+ "hash": "sha256:993661727b51cb9dd2035c95daf83a4003ac9e56e15435648dc13e0becb8bb05",
620
+ "bytes": 8106,
621
621
  "version": "\"1.0.0\""
622
622
  },
623
623
  {
624
624
  "nombre": "instalar-sistema",
625
625
  "path": "habilidades/instalar-sistema/SKILL.md",
626
- "hash": "sha256:9769a473af0ec4fd05d4b7a4d05f5d2c6b46fbc9ab74abd46d754d25ef6d533f",
627
- "bytes": 13241,
628
- "version": "\"1.0.2\""
626
+ "hash": "sha256:2dfe720c6bd3691e96ce7b45a54e178a5baf0d3a7077d62f3305081efa3e4da2",
627
+ "bytes": 14558,
628
+ "version": "\"1.0.3\""
629
629
  },
630
630
  {
631
631
  "nombre": "java-experto",
@@ -714,8 +714,8 @@
714
714
  {
715
715
  "nombre": "memoria-busqueda",
716
716
  "path": "habilidades/memoria-busqueda/SKILL.md",
717
- "hash": "sha256:3a23c11eff134da8f2317fdb87aa4f5fd9e37bcaa7ea4591058beacc36874a9e",
718
- "bytes": 10423,
717
+ "hash": "sha256:e00f60d0d04e265cfde978379e62f2033f65a0a51fda438a0367b4b7df309b9c",
718
+ "bytes": 10347,
719
719
  "version": "\"1.1.0\""
720
720
  },
721
721
  {
@@ -882,9 +882,9 @@
882
882
  {
883
883
  "nombre": "planear-fase",
884
884
  "path": "habilidades/planear-fase/SKILL.md",
885
- "hash": "sha256:824b579ccf2ace717c190e160d773f6e31695cb1b4b84d5985b25e095996a3b2",
886
- "bytes": 16449,
887
- "version": "\"1.3.2\""
885
+ "hash": "sha256:10e8ff013e56342902c037e1909bf4e0e6b2a68e82e299f33f1f34f9aaafd959",
886
+ "bytes": 16707,
887
+ "version": "\"1.3.3\""
888
888
  },
889
889
  {
890
890
  "nombre": "postgresql-experto",
@@ -931,8 +931,8 @@
931
931
  {
932
932
  "nombre": "proceso-ddia-fundamentos",
933
933
  "path": "habilidades/proceso-ddia-fundamentos/SKILL.md",
934
- "hash": "sha256:e39b7a59f4638654995716dad5575d350be11660efa2d8a53e11f30dce521afb",
935
- "bytes": 10571,
934
+ "hash": "sha256:02099040dbf31f1b1ac4874f37e2bff2a2c88643f7eda43519d4a857f3c59e8b",
935
+ "bytes": 10675,
936
936
  "version": null
937
937
  },
938
938
  {
@@ -1043,9 +1043,9 @@
1043
1043
  {
1044
1044
  "nombre": "release-semver",
1045
1045
  "path": "habilidades/release-semver/SKILL.md",
1046
- "hash": "sha256:37d4ef6228c83dfc5333188c85c7e910949d3bdcd3f49a5a2b8dd21a4835539d",
1047
- "bytes": 17761,
1048
- "version": "\"1.0.3\""
1046
+ "hash": "sha256:c77cc73cc1f6ef635f9f79d9d008c5ee05f5de557b5f94ffa85b67575b2e9a33",
1047
+ "bytes": 18514,
1048
+ "version": "\"1.0.4\""
1049
1049
  },
1050
1050
  {
1051
1051
  "nombre": "rust-experto",
@@ -1134,15 +1134,15 @@
1134
1134
  {
1135
1135
  "nombre": "swl-claudemd",
1136
1136
  "path": "habilidades/swl-claudemd/SKILL.md",
1137
- "hash": "sha256:97f678f4471b6246c181c074fc64275cbef394109402b80aef8cc56bef3ba0b5",
1138
- "bytes": 15647,
1137
+ "hash": "sha256:2a464ce81ef8fbfea9ec17fc7fd19c3e77e3abf0f44abe1fcbcdd86eb9119876",
1138
+ "bytes": 15548,
1139
1139
  "version": "\"1.3.0\""
1140
1140
  },
1141
1141
  {
1142
1142
  "nombre": "swl-dashboard",
1143
1143
  "path": "habilidades/swl-dashboard/SKILL.md",
1144
- "hash": "sha256:08ac3f8ca3a12cc14ad1a1d2dafa323830717e1e7598ecdc4fcd296c27292a27",
1145
- "bytes": 17868,
1144
+ "hash": "sha256:e850f39f6fbbf5e2ec8da488462a24b785d91ad663dcdad0096a2d5aa4740d01",
1145
+ "bytes": 16548,
1146
1146
  "version": "\"1.0.0\""
1147
1147
  },
1148
1148
  {
@@ -1169,9 +1169,9 @@
1169
1169
  {
1170
1170
  "nombre": "tdd-workflow",
1171
1171
  "path": "habilidades/tdd-workflow/SKILL.md",
1172
- "hash": "sha256:ca7d4f88d8d63528389aca2ef6a779c39bb65bdc751247a53cde891d9fb2d5ab",
1173
- "bytes": 35955,
1174
- "version": "\"1.2.3\""
1172
+ "hash": "sha256:9086f0c9cdb0a7aa2f432f5cabfd3709f2afb49e8fa19b3643f58eee2e84c6aa",
1173
+ "bytes": 36708,
1174
+ "version": "\"1.2.4\""
1175
1175
  },
1176
1176
  {
1177
1177
  "nombre": "terraform-experto",
@@ -1225,8 +1225,8 @@
1225
1225
  {
1226
1226
  "nombre": "validacion-ci-sistema",
1227
1227
  "path": "habilidades/validacion-ci-sistema/SKILL.md",
1228
- "hash": "sha256:817ea99320e3c9162675ded5482925fd0f23e57cdf510b159fe02fd5ac3d994e",
1229
- "bytes": 8430,
1228
+ "hash": "sha256:4ffaaa0b3edf6b30034e1932dbba8b12629d84a2fb0d4b93f26afbad5d808243",
1229
+ "bytes": 8414,
1230
1230
  "version": "\"1.1.0\""
1231
1231
  },
1232
1232
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saulwade/swl-ses",
3
- "version": "2.5.2",
4
- "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot con 61 agentes, 181 habilidades, 47 comandos, 77 reglas y 49 hooks. Soporta 11 lenguajes y 7 runtimes: Claude Code, OpenClaude, OpenCode, Gemini CLI, Cursor, Codex CLI (soporte completo); GitHub Copilot (soporte parcial). 100% en espanol (Mexico). Multi-target install (--target CSV / --all-runtimes), autoconfig MCP en Cursor/Codex con --with-mcp, agentes Codex en TOML, hooks Cursor (17 eventos) y Codex (6 eventos). Gateway bidireccional con relay Telegram y auditoria profunda Nemesis con loop evaluator-optimizer opt-in (ADR-0021) y 8 tools ejecutables. v1.8.0 unifica los directorios runtime de .planning/ al ingles (evolution/, auto-evolution/, user-profile/, archive/), manteniendo fases/ en espanol, con guard validar-planning-paths y allowlist canonica (ADR-0031). Hereda de v1.7.4: skill calidad-anti-patrones-universales + scripts/lib/pr-analyzer.js + 3 sub-secciones en estilo-sin-ai-isms.",
3
+ "version": "2.6.0",
4
+ "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot con 61 agentes, 181 habilidades, 48 comandos, 77 reglas y 49 hooks. Soporta 11 lenguajes y 7 runtimes: Claude Code, OpenClaude, OpenCode, Gemini CLI, Cursor, Codex CLI (soporte completo); GitHub Copilot (soporte parcial). 100% en espanol (Mexico). Multi-target install (--target CSV / --all-runtimes), autoconfig MCP en Cursor/Codex con --with-mcp, agentes Codex en TOML, hooks Cursor (17 eventos) y Codex (6 eventos). Gateway bidireccional con relay Telegram y auditoria profunda Nemesis con loop evaluator-optimizer opt-in (ADR-0021) y 8 tools ejecutables. v1.8.0 unifica los directorios runtime de .planning/ al ingles (evolution/, auto-evolution/, user-profile/, archive/), manteniendo fases/ en espanol, con guard validar-planning-paths y allowlist canonica (ADR-0031). Hereda de v1.7.4: skill calidad-anti-patrones-universales + scripts/lib/pr-analyzer.js + 3 sub-secciones en estilo-sin-ai-isms.",
5
5
  "bin": {
6
6
  "swl-ses": "bin/swl-ses.js",
7
7
  "swl-telegram-bot": "bin/swl-telegram-bot.js",
@@ -28,7 +28,6 @@
28
28
  "llms.txt"
29
29
  ],
30
30
  "scripts": {
31
- "postinstall": "echo '\n swl-software-engineering-system instalado.\n Ejecuta: npx swl-ses init\n'",
32
31
  "test": "node --test tests/lib/*.test.js tests/scripts/*.test.js tests/scripts/lib/*.test.js tests/scripts/tui/*.test.js tests/hooks/*.test.js tests/hooks/lib/*.test.js tests/habilidades/*.test.js tests/gateway/*.test.js tests/bin/*.test.js tests/transformadores/*.test.js tests/mcp-server/*.test.js",
33
32
  "test:validate": "node scripts/validar.js",
34
33
  "test:manifest": "node scripts/validar-manifest.js",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "swl-ses",
3
- "version": "2.5.2",
4
- "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot. 61 agentes, 181 habilidades, 47 comandos, 77 reglas y 49 hooks. 76 librerias. 11 lenguajes. Soporta Claude Code, Copilot, OpenCode, Codex y Gemini CLI. Loop evaluator-optimizer en /swl:nemesis (ADR-0021). v1.8.0 unifica los directorios runtime de .planning/ al ingles (evolution/, auto-evolution/, user-profile/, archive/), manteniendo fases/ en espanol, con guard validar-planning-paths y allowlist canonica (ADR-0031). Hereda de v1.7.4: skill calidad-anti-patrones-universales + scripts/lib/pr-analyzer.js + 3 sub-secciones en estilo-sin-ai-isms.",
3
+ "version": "2.6.0",
4
+ "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot. 61 agentes, 181 habilidades, 48 comandos, 77 reglas y 49 hooks. 76 librerias. 11 lenguajes. Soporta Claude Code, Copilot, OpenCode, Codex y Gemini CLI. Loop evaluator-optimizer en /swl:nemesis (ADR-0021). v1.8.0 unifica los directorios runtime de .planning/ al ingles (evolution/, auto-evolution/, user-profile/, archive/), manteniendo fases/ en espanol, con guard validar-planning-paths y allowlist canonica (ADR-0031). Hereda de v1.7.4: skill calidad-anti-patrones-universales + scripts/lib/pr-analyzer.js + 3 sub-secciones en estilo-sin-ai-isms.",
5
5
  "author": "Saul Wade Leon",
6
6
  "license": "MIT",
7
7
  "repository": "https://github.com/saul-wade/swl-ses",
@@ -226,6 +226,9 @@ async function update(opciones) {
226
226
  profile: estado.perfil,
227
227
  global: estado.global,
228
228
  force: true,
229
+ // Módulos opt-in registrados por --with en installs previos
230
+ // (DT-MODULOS-OPT-IN): sin re-pasarlos, el update los perdía.
231
+ with: (estado.modulosExtra || []).join(',') || undefined,
229
232
  });
230
233
 
231
234
  sp.exito(`${runtime.nombre} actualizado a v${VERSION} (${estado.archivosInstalados.length} archivos)`);
@@ -20,9 +20,20 @@
20
20
  * Escape: `// eol-ok: <razón>`.
21
21
  * C3 — Bloqueo ciego en hooks: exit(2) sin console.error deja al modelo
22
22
  * sin la razón del bloqueo (el canal de exit 2 es stderr).
23
+ * C4 — Ancla .planning/instintos al CWD crudo en hooks: en monorepos con
24
+ * sesión abierta en un subdirectorio fragmenta la memoria del proyecto
25
+ * en árboles huérfanos (DT-HOOKS-RAIZ-GIT, reportes de campo oic+sigm
26
+ * 2026-07-10; flota completa migrada el mismo día). Correcto:
27
+ * `raizProyecto(process.cwd())` de hooks/lib/raiz-proyecto.js.
28
+ * Escape: `// raiz-ok: <razón>`. Solo hooks/** — los scripts CLI se
29
+ * invocan desde la raíz del proyecto por contrato, y el instalador
30
+ * ancla al cwd DELIBERADAMENTE (instala hacia ese proyecto; saltar a
31
+ * un repo padre sería un bug).
23
32
  *
24
- * Alcance: archivos .js versionados en scripts/, hooks/, bin/, gateway/
25
- * (tests/ excluido: los tests DEBEN poder citar el patrón para validarlo).
33
+ * Alcance: archivos .js versionados en scripts/, hooks/, bin/, gateway/ y
34
+ * los scripts ejecutables de skills (habilidades/<skill>/scripts/)
35
+ * parse-commits.js escapó al gate C1 hasta 2026-07-10 por no estar en el alcance.
36
+ * (tests/ excluido: los tests DEBEN poder citar el patrón para validarlo.)
26
37
  * Exit: 0 limpio · 1 con hallazgos.
27
38
  */
28
39
 
@@ -35,6 +46,12 @@ const RAIZ = path.resolve(__dirname, '..');
35
46
  const RX_UTC = /toISOString\(\)\s*\.\s*(?:slice|substring)\s*\(\s*0\s*,\s*10\s*\)/;
36
47
  const RX_ESCAPE_UTC = /fecha-utc-ok/;
37
48
  const RX_ESCAPE_EOL = /eol-ok:/;
49
+ // C4: join directo del cwd crudo con .planning o instintos. El patrón se
50
+ // construye por concatenación para que el gate no se detecte a sí mismo.
51
+ const RX_CWD_PLANNING = new RegExp(
52
+ 'join\\(\\s*process\\.cwd\\(\\)\\s*,\\s*[\'"]' + '(?:\\.plan' + 'ning|instin' + 'tos)'
53
+ );
54
+ const RX_ESCAPE_RAIZ = /raiz-ok:/;
38
55
 
39
56
  function archivosObjetivo() {
40
57
  const salida = execFileSync('git', [
@@ -43,6 +60,7 @@ function archivosObjetivo() {
43
60
  'hooks/*.js', 'hooks/**/*.js',
44
61
  'bin/*.js',
45
62
  'gateway/*.js', 'gateway/**/*.js',
63
+ 'habilidades/*/scripts/*.js', 'habilidades/*/scripts/**/*.js',
46
64
  ], { cwd: RAIZ, encoding: 'utf8' });
47
65
  return salida.split(/\r?\n/).filter(f => f && !f.includes('vendor/'));
48
66
  }
@@ -79,6 +97,15 @@ function auditarBloqueoCiego(ruta, contenido, hallazgos) {
79
97
  }
80
98
  }
81
99
 
100
+ function auditarCwdPlanning(ruta, lineas, hallazgos) {
101
+ if (!ruta.startsWith('hooks/')) return;
102
+ lineas.forEach((linea, i) => {
103
+ if (RX_CWD_PLANNING.test(linea) && !RX_ESCAPE_RAIZ.test(linea)) {
104
+ hallazgos.push(`[C4 raiz-proyecto] ${ruta}:${i + 1} — ancla .planning/instintos a process.cwd() crudo: fragmenta la memoria en monorepos (DT-HOOKS-RAIZ-GIT); usar raizProyecto(process.cwd()) de hooks/lib/raiz-proyecto.js o marcar \`// raiz-ok: <razón>\``);
105
+ }
106
+ });
107
+ }
108
+
82
109
  function main() {
83
110
  const hallazgos = [];
84
111
  const archivos = archivosObjetivo();
@@ -91,10 +118,11 @@ function main() {
91
118
  auditarUtc(ruta, lineas, hallazgos);
92
119
  auditarEolCheck(ruta, contenido, hallazgos);
93
120
  auditarBloqueoCiego(ruta, contenido, hallazgos);
121
+ auditarCwdPlanning(ruta, lineas, hallazgos);
94
122
  }
95
123
 
96
124
  if (hallazgos.length === 0) {
97
- console.log(`[clases-conocidas] OK — ${archivos.length} archivos, 0 reincidencias de clases documentadas (C1 UTC, C2 EOL, C3 bloqueo ciego)`);
125
+ console.log(`[clases-conocidas] OK — ${archivos.length} archivos, 0 reincidencias de clases documentadas (C1 UTC, C2 EOL, C3 bloqueo ciego, C4 ancla cwd)`);
98
126
  return;
99
127
  }
100
128
  console.error(`[clases-conocidas] ${hallazgos.length} reincidencia(s) de clases de bug documentadas:`);
@@ -102,5 +130,5 @@ function main() {
102
130
  process.exitCode = 1;
103
131
  }
104
132
 
105
- module.exports = { auditarUtc, auditarEolCheck, auditarBloqueoCiego };
133
+ module.exports = { auditarUtc, auditarEolCheck, auditarBloqueoCiego, auditarCwdPlanning };
106
134
  if (require.main === module) main();
@@ -164,4 +164,5 @@ if (require.main === module) {
164
164
 
165
165
  module.exports = {
166
166
  parseArgs,
167
+ main,
167
168
  };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Wrapper CLI `swl-ses autonomia` — registro de auto-checkpoints según el
5
+ * dial de autonomía (instintos/autonomia.yaml). Reemplaza el
6
+ * `node hooks/lib/autonomia.js --accion "..."` relativo al proyecto que
7
+ * ejecutar-fase instruía — roto downstream (ver
8
+ * docs/invocacion-cli-cross-scope.md).
9
+ *
10
+ * Uso: swl-ses autonomia --accion="<descripción de la acción>"
11
+ */
12
+
13
+ const { main } = require('../../hooks/lib/autonomia');
14
+
15
+ function autonomia(opciones = {}) {
16
+ const argv = ['node', 'autonomia.js'];
17
+ if (opciones.accion != null && opciones.accion !== true) {
18
+ argv.push('--accion', String(opciones.accion));
19
+ }
20
+ process.exitCode = main(argv);
21
+ }
22
+
23
+ module.exports = autonomia;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Wrapper CLI `swl-ses benchmark-memoria` — benchmark de retrieval de la
5
+ * memoria del proyecto (scripts/benchmark-memoria.js). Reemplaza el
6
+ * `node scripts/benchmark-memoria.js` relativo al proyecto que
7
+ * benchmark-memoria (skill) instruía — roto downstream (ver
8
+ * docs/invocacion-cli-cross-scope.md).
9
+ *
10
+ * Uso: swl-ses benchmark-memoria [--dataset=ruta] [--limit=N] [--json] [--verbose]
11
+ * (SWL_BENCHMARK_PERSIST=1 en el entorno para tracking histórico.)
12
+ *
13
+ * ADVERTENCIA (nemesis iter-1 S3-6): el main() envuelto llama process.exit()
14
+ * en todas sus ramas — este wrapper TERMINA el proceso host. Correcto vía
15
+ * `bin/swl-ses.js` (proceso fresco por invocación); NO invocar in-process.
16
+ */
17
+
18
+ const { main } = require('../benchmark-memoria.js');
19
+
20
+ function benchmarkMemoria(opciones = {}) {
21
+ // parseArgs del script espera flags de dos tokens (--dataset <ruta>).
22
+ const args = [];
23
+ if (opciones.dataset != null && opciones.dataset !== true) args.push('--dataset', String(opciones.dataset));
24
+ if (opciones.limit != null && opciones.limit !== true) args.push('--limit', String(opciones.limit));
25
+ if (opciones.json) args.push('--json');
26
+ if (opciones.verbose) args.push('--verbose');
27
+
28
+ const argvOriginal = process.argv;
29
+ process.argv = ['node', 'benchmark-memoria.js', ...args];
30
+ try {
31
+ main();
32
+ } finally {
33
+ process.argv = argvOriginal;
34
+ }
35
+ }
36
+
37
+ module.exports = benchmarkMemoria;
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Subcomando `swl-ses ciclo-autonomo [on|off|status]` — motor determinista de
5
+ * aprendizaje (Fase A del ciclo autónomo, ADR-0041).
6
+ *
7
+ * Sin positional: ejecuta la Fase A (writer de instintos → puente de
8
+ * degradación → drenador de feedback). Opt-out estricto (nace encendido):
9
+ * con `habilitado:false` en el config o `SWL_CICLO_AUTONOMO=0` retorna sin
10
+ * efecto ni escritura — el off es sagrado.
11
+ *
12
+ * on → habilita el motor (escribe evolution/ciclo-config.json)
13
+ * off → lo deshabilita
14
+ * status → reporta last_run y conteos de la última corrida
15
+ *
16
+ * Uso: swl-ses ciclo-autonomo [on|off|status] [--forzar]
17
+ */
18
+
19
+ const { correrFaseA } = require('../lib/ciclo-autonomo');
20
+ const { leerConfig, escribirConfig, estaHabilitado } = require('../lib/ciclo-autonomo/config');
21
+
22
+ function cicloAutonomo(opciones = {}) {
23
+ const accion = (opciones._args || [])[0];
24
+ const baseDir = opciones.dir || process.cwd();
25
+
26
+ if (accion === 'on' || accion === 'off') {
27
+ const habilitado = accion === 'on';
28
+ escribirConfig(baseDir, { habilitado });
29
+ console.log(`[ciclo-autonomo] motor ${habilitado ? 'HABILITADO' : 'deshabilitado'} (${baseDir})`);
30
+ if (habilitado) {
31
+ console.log('[ciclo-autonomo] la Fase A correrá vía cron/briefing; corrida manual: swl-ses ciclo-autonomo');
32
+ }
33
+ return leerConfig(baseDir);
34
+ }
35
+
36
+ if (accion === 'status') {
37
+ const config = leerConfig(baseDir);
38
+ const estado = {
39
+ habilitado: estaHabilitado(baseDir),
40
+ credencial: config.credencial,
41
+ last_run: config.last_run,
42
+ ultima_corrida: config.ultima_corrida,
43
+ };
44
+ console.log(`[ciclo-autonomo] habilitado: ${estado.habilitado} · credencial: ${estado.credencial}`);
45
+ console.log(`[ciclo-autonomo] last_run: ${estado.last_run || 'nunca'}`);
46
+ if (estado.ultima_corrida) {
47
+ const u = estado.ultima_corrida;
48
+ console.log(`[ciclo-autonomo] última corrida — promovidos: ${u.promovidos}, degradados: ${u.degradados}, drenados: ${u.drenados}, archivados: ${u.archivados}, bajados: ${u.bajados}`);
49
+ }
50
+ return estado;
51
+ }
52
+
53
+ if (accion !== undefined) {
54
+ console.error(`[ciclo-autonomo] acción desconocida: "${accion}". Uso: swl-ses ciclo-autonomo [on|off|status] [--forzar]`);
55
+ process.exitCode = 1;
56
+ return null;
57
+ }
58
+
59
+ const resultado = correrFaseA(baseDir, { forzar: opciones.forzar === true });
60
+ if (!resultado.ejecutado) {
61
+ console.log(`[ciclo-autonomo] sin corrida: ${resultado.razon}`);
62
+ } else if (resultado.acciones === 0) {
63
+ console.log('[ciclo-autonomo] corrida no-op: sin señales que crucen umbral');
64
+ } else {
65
+ console.log(`[ciclo-autonomo] corrida completada — acciones: ${resultado.acciones}`);
66
+ if (resultado.errores && resultado.errores.length > 0) {
67
+ console.error(`[ciclo-autonomo] sub-fases con error: ${resultado.errores.join(', ')}`);
68
+ }
69
+ }
70
+ return resultado;
71
+ }
72
+
73
+ module.exports = cicloAutonomo;