@saulwade/swl-ses 2.5.3 → 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.
- package/CLAUDE.md +192 -192
- package/README.md +600 -600
- package/agentes/auto-evolucion-swl.md +27 -3
- package/bin/swl-ses.js +32 -7
- package/comandos/swl/actualizar.md +174 -174
- package/comandos/swl/adoptar-proyecto.md +265 -265
- package/comandos/swl/aprender.md +836 -823
- package/comandos/swl/aprobar-plan.md +146 -146
- package/comandos/swl/auditar-deps.md +134 -134
- package/comandos/swl/autoresearch.md +264 -264
- package/comandos/swl/ayuda.md +224 -224
- package/comandos/swl/brainstorm.md +51 -51
- package/comandos/swl/briefing.md +119 -119
- package/comandos/swl/checkpoint.md +325 -325
- package/comandos/swl/claudemd.md +234 -234
- package/comandos/swl/compactar.md +310 -310
- package/comandos/swl/configurar-ci.md +235 -235
- package/comandos/swl/contexto.md +110 -110
- package/comandos/swl/contribuir.md +233 -233
- package/comandos/swl/crear-skill.md +292 -292
- package/comandos/swl/cron.md +194 -194
- package/comandos/swl/deuda-codigo.md +97 -97
- package/comandos/swl/discutir-fase.md +169 -169
- package/comandos/swl/ejecutar-fase.md +233 -233
- package/comandos/swl/evaluar-skill.md +520 -505
- package/comandos/swl/evolucion-continua.md +73 -0
- package/comandos/swl/evolucionar.md +267 -254
- package/comandos/swl/exportar-vault.md +583 -583
- package/comandos/swl/fix.md +118 -118
- package/comandos/swl/gateway.md +158 -158
- package/comandos/swl/inbox.md +116 -116
- package/comandos/swl/instalar.md +220 -220
- package/comandos/swl/instintos.md +86 -86
- package/comandos/swl/mapear-codebase.md +312 -312
- package/comandos/swl/mcp-status.md +175 -175
- package/comandos/swl/modelo.md +100 -100
- package/comandos/swl/nemesis.md +433 -433
- package/comandos/swl/notificaciones.md +299 -299
- package/comandos/swl/nuevo-proyecto.md +251 -251
- package/comandos/swl/planear-fase.md +263 -263
- package/comandos/swl/plugins.md +256 -256
- package/comandos/swl/predecir.md +169 -169
- package/comandos/swl/reflect-skills.md +125 -125
- package/comandos/swl/release.md +450 -450
- package/comandos/swl/revisar-impacto.md +201 -201
- package/comandos/swl/revisar.md +330 -330
- package/comandos/swl/seguridad.md +189 -189
- package/comandos/swl/sesiones.md +200 -200
- package/comandos/swl/skill-search.md +113 -113
- package/comandos/swl/status.md +343 -343
- package/comandos/swl/verificar.md +817 -817
- package/comandos/swl/wiki.md +620 -620
- package/gateway/cron/jobs.example.json +12 -0
- package/habilidades/auto-evolucion-protocolo/SKILL.md +294 -276
- package/habilidades/autoresearch/SKILL.md +3 -2
- package/habilidades/benchmark-memoria/SKILL.md +7 -7
- package/habilidades/changelog-generator/SKILL.md +174 -174
- package/habilidades/changelog-generator/scripts/parse-commits.js +2 -1
- package/habilidades/checkpoints-verificacion/SKILL.md +6 -0
- package/habilidades/context-builder/SKILL.md +4 -0
- package/habilidades/doubt-driven-review/SKILL.md +207 -191
- package/habilidades/drift-detection/SKILL.md +6 -1
- package/habilidades/ejecutar-fase/SKILL.md +6 -6
- package/habilidades/eval-framework/SKILL.md +8 -3
- package/habilidades/harness-claude-code/SKILL.md +312 -308
- package/habilidades/infra-github-actions/SKILL.md +4 -3
- package/habilidades/instalar-sistema/SKILL.md +227 -223
- package/habilidades/memoria-busqueda/SKILL.md +31 -39
- package/habilidades/planear-fase/SKILL.md +358 -350
- package/habilidades/proceso-ddia-fundamentos/SKILL.md +3 -2
- package/habilidades/swl-claudemd/SKILL.md +6 -7
- package/habilidades/swl-dashboard/SKILL.md +11 -43
- package/habilidades/tdd-workflow/SKILL.md +749 -744
- package/habilidades/validacion-ci-sistema/SKILL.md +1 -1
- package/hooks/agente-lifecycle.js +2 -1
- package/hooks/aiisms-detector.js +13 -4
- package/hooks/audit-trail.js +2 -1
- package/hooks/auto-consolidacion.js +2 -1
- package/hooks/captura-acciones-post.js +2 -1
- package/hooks/captura-acciones-session.js +2 -1
- package/hooks/captura-feedback-usuario.js +3 -2
- package/hooks/claudemd-bloat-detector.js +12 -3
- package/hooks/claudemd-duplicacion-detector.js +13 -3
- package/hooks/contexto-iteracion.js +2 -1
- package/hooks/degradacion-instintos.js +2 -1
- package/hooks/extraccion-aprendizajes.js +109 -15
- package/hooks/grafo-contexto.js +2 -1
- package/hooks/guardrail-modelo.js +2 -1
- package/hooks/inbox-aviso.js +2 -1
- package/hooks/inyeccion-contexto.js +2 -1
- package/hooks/lib/agent-matcher.js +2 -1
- package/hooks/lib/agent-routing.js +2 -1
- package/hooks/lib/autonomia.js +5 -3
- package/hooks/lib/captura-acciones.js +2 -1
- package/hooks/lib/consolidation-lock.js +21 -10
- package/hooks/lib/etapa-auto-evolucion.js +10 -4
- package/hooks/lib/etapa-metricas.js +2 -1
- package/hooks/lib/etapa-perfil-usuario.js +20 -4
- package/hooks/lib/evolution-tracker.js +2 -1
- package/hooks/lib/gateway-notify.js +193 -179
- package/hooks/lib/loop-telemetry.js +5 -4
- package/hooks/lib/mcp-health.js +2 -1
- package/hooks/lib/memory-search.js +4 -0
- package/hooks/lib/merkle-audit.js +58 -6
- package/hooks/lib/nudge-tracker.js +2 -1
- package/hooks/lib/otlp-exporter.js +2 -1
- package/hooks/lib/propose-step.js +3 -2
- package/hooks/lib/raiz-proyecto.js +102 -0
- package/hooks/lib/run-log.js +2 -1
- package/hooks/lib/singleton-guard.js +218 -27
- package/hooks/lib/telegram-cliente.js +17 -8
- package/hooks/preservar-estado-pre-compact.js +2 -1
- package/hooks/proteccion-rutas.js +59 -3
- package/hooks/registro-turnos.js +2 -1
- package/hooks/resumen-sesion.js +2 -1
- package/hooks/risk-scoring.js +2 -1
- package/hooks/rotar-audit-auto.js +46 -20
- package/hooks/session-briefing.js +127 -1
- package/hooks/spec-gate.js +2 -1
- package/hooks/sugerir-contribuir.js +6 -3
- package/hooks/sugerir-regenerar-inventario.js +3 -2
- package/hooks/tdd-gate.js +2 -1
- package/hooks/telemetria-agentes.js +2 -1
- package/hooks/telemetria-skill-routing.js +2 -1
- package/hooks/tracking-costos.js +4 -3
- package/hooks/validar-formato-post-subagente.js +2 -1
- package/hooks/validar-intent-spec.js +2 -1
- package/hooks/validar-memoria-hook.js +13 -3
- package/hooks/validar-planning-paths.js +2 -1
- package/instintos/.backups/perfil-usuario.yaml.2026-07-10-165128.bak +53 -0
- package/instintos/.backups/proyecto.yaml.2026-07-10-165128.bak +372 -0
- package/instintos/perfil-usuario.yaml +506 -3
- package/instintos/proyecto.yaml +78 -0
- package/llms.txt +2 -2
- package/manifiestos/canonical-hashes.json +335 -3
- package/manifiestos/modulos.json +19 -14
- package/manifiestos/planning-paths.json +1 -0
- package/manifiestos/skills-lock.json +50 -50
- package/package.json +2 -3
- package/plugin.json +2 -2
- package/scripts/actualizar.js +3 -0
- package/scripts/auditar-clases-conocidas.js +32 -4
- package/scripts/benchmark-memoria.js +1 -0
- package/scripts/cli/autonomia.js +23 -0
- package/scripts/cli/benchmark-memoria.js +37 -0
- package/scripts/cli/ciclo-autonomo.js +73 -0
- package/scripts/cli/ciclo-fase-b.js +102 -0
- package/scripts/cli/guardrail-metrics.js +39 -0
- package/scripts/cli/loop-telemetry.js +4 -2
- package/scripts/cli/memoria-search.js +69 -0
- package/scripts/cli/nudge-accionar.js +39 -0
- package/scripts/cli/run-eval.js +38 -0
- package/scripts/cli/run-skill-evals.js +13 -2
- package/scripts/derivar-feature-list.js +15 -14
- package/scripts/desinstalar.js +11 -0
- package/scripts/doctor.js +24 -10
- package/scripts/instalador.js +85 -7
- package/scripts/lib/activar-hooks-proyecto.js +12 -0
- package/scripts/lib/auditar-invocaciones-comandos.js +96 -6
- package/scripts/lib/ciclo-autonomo/candidatos.js +174 -0
- package/scripts/lib/ciclo-autonomo/config.js +165 -0
- package/scripts/lib/ciclo-autonomo/drenador-feedback.js +174 -0
- package/scripts/lib/ciclo-autonomo/fallback.js +77 -0
- package/scripts/lib/ciclo-autonomo/guard-convivencia.js +139 -0
- package/scripts/lib/ciclo-autonomo/higiene-nudges.js +112 -0
- package/scripts/lib/ciclo-autonomo/index.js +301 -0
- package/scripts/lib/ciclo-autonomo/lock.js +124 -0
- package/scripts/lib/ciclo-autonomo/presupuesto.js +122 -0
- package/scripts/lib/ciclo-autonomo/puente-degradacion.js +240 -0
- package/scripts/lib/ciclo-autonomo/runner-fase-b.js +248 -0
- package/scripts/lib/ciclo-autonomo/writer-instintos.js +190 -0
- package/scripts/lib/ciclo-autonomo/yaml-instintos.js +535 -0
- package/scripts/lib/estado.js +9 -0
- package/scripts/lib/gitignore-manifest.js +8 -1
- package/scripts/lib/hooks-settings.js +45 -0
- package/scripts/rotar-audit-logs.js +48 -2
- package/scripts/run-eval.js +1 -0
- package/scripts/run-skill-evals.js +287 -8
- package/scripts/smoke-test.js +16 -8
- package/scripts/tui/pantallas/install-wizard.js +403 -347
- package/scripts/validar.js +40 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lockfileVersion": 1,
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-11T03:43:51.543Z",
|
|
4
4
|
"skillsCount": 181,
|
|
5
|
-
"lockHash": "sha256:
|
|
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:
|
|
95
|
-
"bytes":
|
|
96
|
-
"version": "\"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:
|
|
102
|
-
"bytes":
|
|
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:
|
|
144
|
-
"bytes":
|
|
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:
|
|
270
|
-
"bytes":
|
|
271
|
-
"version": "1.1.
|
|
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:
|
|
291
|
-
"bytes":
|
|
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:
|
|
326
|
-
"bytes":
|
|
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:
|
|
452
|
-
"bytes":
|
|
453
|
-
"version": "\"1.
|
|
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:
|
|
459
|
-
"bytes":
|
|
460
|
-
"version": "1.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:
|
|
466
|
-
"bytes":
|
|
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:
|
|
494
|
-
"bytes":
|
|
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:
|
|
606
|
-
"bytes":
|
|
607
|
-
"version": "\"1.0.
|
|
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:
|
|
620
|
-
"bytes":
|
|
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:
|
|
627
|
-
"bytes":
|
|
628
|
-
"version": "\"1.0.
|
|
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:
|
|
718
|
-
"bytes":
|
|
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:
|
|
886
|
-
"bytes":
|
|
887
|
-
"version": "\"1.3.
|
|
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:
|
|
935
|
-
"bytes":
|
|
934
|
+
"hash": "sha256:02099040dbf31f1b1ac4874f37e2bff2a2c88643f7eda43519d4a857f3c59e8b",
|
|
935
|
+
"bytes": 10675,
|
|
936
936
|
"version": null
|
|
937
937
|
},
|
|
938
938
|
{
|
|
@@ -1134,15 +1134,15 @@
|
|
|
1134
1134
|
{
|
|
1135
1135
|
"nombre": "swl-claudemd",
|
|
1136
1136
|
"path": "habilidades/swl-claudemd/SKILL.md",
|
|
1137
|
-
"hash": "sha256:
|
|
1138
|
-
"bytes":
|
|
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:
|
|
1145
|
-
"bytes":
|
|
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:
|
|
1173
|
-
"bytes":
|
|
1174
|
-
"version": "\"1.2.
|
|
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:
|
|
1229
|
-
"bytes":
|
|
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.
|
|
4
|
-
"description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot con 61 agentes, 181 habilidades,
|
|
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.
|
|
4
|
-
"description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot. 61 agentes, 181 habilidades,
|
|
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",
|
package/scripts/actualizar.js
CHANGED
|
@@ -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
|
-
*
|
|
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();
|
|
@@ -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;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subcomando `swl-ses ciclo-fase-b [status] [--dry-run]` — CLI headless de la
|
|
5
|
+
* Fase B del ciclo autónomo (Fase 22, T-07, ADR-0042 gate G-B, REQ-22-07).
|
|
6
|
+
*
|
|
7
|
+
* Espeja el patrón de `scripts/cli/ciclo-autonomo.js` (contrato del bin: cada
|
|
8
|
+
* subcomando exporta UNA función(opciones) sin efectos al require).
|
|
9
|
+
*
|
|
10
|
+
* (nada) | --dry-run → corre `runner-fase-b.correrFaseB` con `dryRun:true`
|
|
11
|
+
* SIEMPRE, se pase o no el flag. En Fase 22 el runner NUNCA invoca LLM ni
|
|
12
|
+
* gasta bajo ninguna combinación de argumentos — el modo real
|
|
13
|
+
* (`dryRun:false` + `invocador` cableado) llega en Fase 24; hasta
|
|
14
|
+
* entonces `--dry-run` es un no-op explícito frente al default.
|
|
15
|
+
* status → reporta `fase_b_habilitada`, `last_run_fase_b`, candidatos
|
|
16
|
+
* pendientes (conteo tolerante de `evolution/candidatos-fase-b.jsonl` —
|
|
17
|
+
* NUNCA `candidatos.detectar`, que tiene efecto de escritura; `status`
|
|
18
|
+
* jamás muta disco) y el estado de presupuesto (`gasto_mes`,
|
|
19
|
+
* `presupuesto_usd_mes`, `pausado_por_presupuesto`) vía
|
|
20
|
+
* `presupuesto.estado`.
|
|
21
|
+
*
|
|
22
|
+
* Uso: swl-ses ciclo-fase-b [status] [--dry-run]
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const fs = require('fs');
|
|
26
|
+
const path = require('path');
|
|
27
|
+
|
|
28
|
+
const { correrFaseB } = require('../lib/ciclo-autonomo/runner-fase-b');
|
|
29
|
+
const config = require('../lib/ciclo-autonomo/config');
|
|
30
|
+
const presupuesto = require('../lib/ciclo-autonomo/presupuesto');
|
|
31
|
+
|
|
32
|
+
const RUTA_CANDIDATOS_RELATIVA = path.join('.planning', 'evolution', 'candidatos-fase-b.jsonl');
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Conteo tolerante de líneas JSON válidas en `candidatos-fase-b.jsonl`.
|
|
36
|
+
* `status` es de solo lectura: nunca invoca `candidatos.detectar` (que
|
|
37
|
+
* persiste candidatos nuevos) — solo cuenta lo que YA quedó registrado por
|
|
38
|
+
* una corrida previa de la Fase A o del runner.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} baseDir - Directorio raíz del proyecto.
|
|
41
|
+
* @returns {number}
|
|
42
|
+
*/
|
|
43
|
+
function contarCandidatosPendientes(baseDir) {
|
|
44
|
+
let crudo;
|
|
45
|
+
try {
|
|
46
|
+
crudo = fs.readFileSync(path.join(baseDir, RUTA_CANDIDATOS_RELATIVA), 'utf8');
|
|
47
|
+
} catch (_) {
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
return crudo.split(/\r\n|\n/)
|
|
51
|
+
.filter((linea) => linea.trim() !== '')
|
|
52
|
+
.filter((linea) => {
|
|
53
|
+
try {
|
|
54
|
+
JSON.parse(linea);
|
|
55
|
+
return true;
|
|
56
|
+
} catch (_) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}).length;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function cicloFaseB(opciones = {}) {
|
|
63
|
+
const accion = (opciones._args || [])[0];
|
|
64
|
+
const baseDir = opciones.dir || process.cwd();
|
|
65
|
+
|
|
66
|
+
if (accion === 'status') {
|
|
67
|
+
const cfg = config.leerConfig(baseDir);
|
|
68
|
+
const presu = presupuesto.estado(baseDir);
|
|
69
|
+
const estado = {
|
|
70
|
+
fase_b_habilitada: config.estaFaseBHabilitada(baseDir),
|
|
71
|
+
last_run_fase_b: cfg.last_run_fase_b,
|
|
72
|
+
candidatos_pendientes: contarCandidatosPendientes(baseDir),
|
|
73
|
+
gasto_mes: presu.gasto_mes,
|
|
74
|
+
presupuesto_usd_mes: presu.tope,
|
|
75
|
+
pausado_por_presupuesto: presu.pausado_por_presupuesto,
|
|
76
|
+
};
|
|
77
|
+
console.log(`[ciclo-fase-b] fase_b_habilitada: ${estado.fase_b_habilitada}`);
|
|
78
|
+
console.log(`[ciclo-fase-b] last_run_fase_b: ${estado.last_run_fase_b || 'nunca'}`);
|
|
79
|
+
console.log(`[ciclo-fase-b] candidatos_pendientes: ${estado.candidatos_pendientes}`);
|
|
80
|
+
console.log(`[ciclo-fase-b] gasto_mes: $${estado.gasto_mes} / $${estado.presupuesto_usd_mes} · pausado_por_presupuesto: ${estado.pausado_por_presupuesto}`);
|
|
81
|
+
return estado;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (accion !== undefined && accion !== '--dry-run') {
|
|
85
|
+
console.error(`[ciclo-fase-b] acción desconocida: "${accion}". Uso: swl-ses ciclo-fase-b [status] [--dry-run]`);
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Fase 22: dryRun forzado a true sin importar el flag — el runner valida
|
|
91
|
+
// toda la tubería (lock, catch-up, guard, credencial, presupuesto) y
|
|
92
|
+
// registra la corrida SIN invocar LLM. El modo real llega en Fase 24.
|
|
93
|
+
const resultado = correrFaseB(baseDir, { dryRun: true });
|
|
94
|
+
if (!resultado.ejecutado) {
|
|
95
|
+
console.log(`[ciclo-fase-b] sin corrida: ${resultado.razon}`);
|
|
96
|
+
} else {
|
|
97
|
+
console.log(`[ciclo-fase-b] corrida dry-run completada — candidatos: ${resultado.candidatos}`);
|
|
98
|
+
}
|
|
99
|
+
return resultado;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = cicloFaseB;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper CLI `swl-ses guardrail-metrics` — métricas y diagnóstico de los
|
|
5
|
+
* guardrails de la sesión (bridge en tmpdir por sessionId). Reemplaza el
|
|
6
|
+
* `node -e "require('./hooks/lib/guardrail-metrics')..."` relativo al
|
|
7
|
+
* proyecto que swl-dashboard instruía — roto downstream (ver
|
|
8
|
+
* docs/invocacion-cli-cross-scope.md).
|
|
9
|
+
*
|
|
10
|
+
* Uso: swl-ses guardrail-metrics [--session=ID] [--json]
|
|
11
|
+
* --session default: env CLAUDE_SESSION_ID o "default"
|
|
12
|
+
* --json imprime {metricas, advertencias} crudo
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const { getMetrics, formatearResumen, diagnosticar } = require('../../hooks/lib/guardrail-metrics');
|
|
16
|
+
|
|
17
|
+
function guardrailMetrics(opciones = {}) {
|
|
18
|
+
const sessionId = (opciones.session != null && opciones.session !== true)
|
|
19
|
+
? String(opciones.session)
|
|
20
|
+
: (process.env.CLAUDE_SESSION_ID || 'default');
|
|
21
|
+
|
|
22
|
+
const metricas = getMetrics(sessionId);
|
|
23
|
+
const advertencias = diagnosticar(metricas);
|
|
24
|
+
|
|
25
|
+
if (opciones.json) {
|
|
26
|
+
console.log(JSON.stringify({ metricas, advertencias }, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.log(formatearResumen(metricas));
|
|
31
|
+
if (advertencias.length > 0) {
|
|
32
|
+
console.log('\n⚠ Diagnóstico:');
|
|
33
|
+
for (const a of advertencias) console.log(' - ' + a);
|
|
34
|
+
} else {
|
|
35
|
+
console.log('\n✓ Guardrails sin anomalías detectadas.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = guardrailMetrics;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
const fs = require('node:fs');
|
|
17
17
|
const path = require('node:path');
|
|
18
18
|
const lt = require('../../hooks/lib/loop-telemetry');
|
|
19
|
+
const { raizProyecto } = require('../../hooks/lib/raiz-proyecto');
|
|
19
20
|
|
|
20
21
|
// Parseo no degradante: si el flag está presente pero su JSON es inválido,
|
|
21
22
|
// reporta y devuelve {ok:false} en vez de silenciar a fallback (anti-fallback
|
|
@@ -89,8 +90,9 @@ function loopTelemetry(opciones = {}) {
|
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
// listar (default)
|
|
93
|
-
|
|
93
|
+
// listar (default) — misma ancla que iniciar/registrar (raíz del proyecto),
|
|
94
|
+
// o listaría un .planning/loops/ distinto al que las corridas escriben.
|
|
95
|
+
const base = path.join(raizProyecto(process.cwd()), lt.DIR_LOOPS);
|
|
94
96
|
let dirs = [];
|
|
95
97
|
try {
|
|
96
98
|
dirs = fs
|