pumuki 6.3.72 → 6.3.75

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 (64) hide show
  1. package/docs/README.md +9 -7
  2. package/docs/operations/RELEASE_NOTES.md +0 -7
  3. package/docs/product/USAGE.md +2 -5
  4. package/docs/validation/README.md +3 -1
  5. package/integrations/evidence/buildEvidence.ts +14 -0
  6. package/integrations/evidence/repoState.ts +3 -0
  7. package/integrations/evidence/schema.ts +18 -0
  8. package/integrations/evidence/trackingContract.ts +146 -0
  9. package/integrations/evidence/writeEvidence.ts +14 -0
  10. package/integrations/gate/evaluateAiGate.ts +166 -3
  11. package/integrations/gate/governanceActionCatalog.ts +275 -0
  12. package/integrations/gate/remediationCatalog.ts +8 -0
  13. package/integrations/git/GitService.ts +0 -25
  14. package/integrations/git/aiGateRepoPolicyFindings.ts +4 -0
  15. package/integrations/git/runPlatformGate.ts +9 -1
  16. package/integrations/git/runPlatformGateFacts.ts +0 -7
  17. package/integrations/git/runPlatformGateOutput.ts +36 -27
  18. package/integrations/lifecycle/adapter.ts +24 -0
  19. package/integrations/lifecycle/bootstrapManifest.ts +248 -0
  20. package/integrations/lifecycle/cli.ts +45 -11
  21. package/integrations/lifecycle/cliSdd.ts +4 -3
  22. package/integrations/lifecycle/doctor.ts +49 -1
  23. package/integrations/lifecycle/governanceNextAction.ts +164 -0
  24. package/integrations/lifecycle/governanceObservationSnapshot.ts +315 -0
  25. package/integrations/lifecycle/install.ts +21 -0
  26. package/integrations/lifecycle/state.ts +8 -1
  27. package/integrations/lifecycle/status.ts +29 -2
  28. package/integrations/mcp/aiGateCheck.ts +140 -10
  29. package/integrations/mcp/alignedPlatformGate.ts +232 -0
  30. package/integrations/mcp/autoExecuteAiStart.ts +92 -85
  31. package/integrations/mcp/enterpriseServer.ts +6 -6
  32. package/integrations/mcp/preFlightCheck.ts +51 -5
  33. package/integrations/mcp/readMcpPrePushStdin.ts +7 -0
  34. package/integrations/policy/experimentalFeatures.ts +1 -1
  35. package/package.json +2 -4
  36. package/scripts/build-ruralgo-s1-evidence-pack.ts +85 -0
  37. package/scripts/consumer-menu-matrix-baseline-report-lib.ts +38 -13
  38. package/scripts/framework-menu-consumer-actions-lib.ts +4 -28
  39. package/scripts/framework-menu-consumer-preflight-hints.ts +2 -5
  40. package/scripts/framework-menu-consumer-preflight-render.ts +6 -0
  41. package/scripts/framework-menu-consumer-preflight-run.ts +19 -0
  42. package/scripts/framework-menu-consumer-preflight-types.ts +8 -0
  43. package/scripts/framework-menu-consumer-runtime-actions.ts +6 -86
  44. package/scripts/framework-menu-consumer-runtime-audit.ts +2 -36
  45. package/scripts/framework-menu-consumer-runtime-lib.ts +0 -2
  46. package/scripts/framework-menu-consumer-runtime-types.ts +1 -3
  47. package/scripts/framework-menu-evidence-summary-lib.ts +0 -1
  48. package/scripts/framework-menu-evidence-summary-read.ts +5 -57
  49. package/scripts/framework-menu-evidence-summary-severity.ts +1 -3
  50. package/scripts/framework-menu-evidence-summary-types.ts +0 -7
  51. package/scripts/framework-menu-gate-lib.ts +0 -9
  52. package/scripts/framework-menu-layout-data.ts +0 -5
  53. package/scripts/framework-menu-matrix-baseline-lib.ts +14 -15
  54. package/scripts/framework-menu-matrix-canary-lib.ts +1 -22
  55. package/scripts/framework-menu-matrix-evidence-lib.ts +0 -1
  56. package/scripts/framework-menu-matrix-evidence-types.ts +1 -13
  57. package/scripts/framework-menu-matrix-runner-lib.ts +0 -35
  58. package/scripts/framework-menu-system-notifications-macos.ts +0 -4
  59. package/scripts/framework-menu.ts +0 -3
  60. package/scripts/ruralgo-s1-evidence-pack-lib.ts +200 -0
  61. package/AGENTS.md +0 -269
  62. package/CHANGELOG.md +0 -666
  63. package/docs/tracking/plan-curso-pumuki-stack-my-architecture.md +0 -111
  64. package/scripts/framework-menu-consumer-runtime-evidence-classic.ts +0 -140
@@ -1,111 +0,0 @@
1
- # Diseño pedagógico y seguimiento — Curso Pumuki (Stack My Architecture)
2
-
3
- Este documento define **qué debe aprender una persona**, **en qué orden**, **cómo se comprueba** y **qué confusiones hay que romper**. El seguimiento de repos y build va **al final**; no sustituye el diseño.
4
-
5
- No sustituye el espejo de producto en [`plan-activo-de-trabajo.md`](./plan-activo-de-trabajo.md).
6
-
7
- ## Leyenda operativa
8
-
9
- - ✅ Entregado en repo curso + coherente con USAGE/INSTALLATION
10
- - 🚧 Única tarea activa (máx. 1)
11
- - ⏳ Pendiente
12
- - ⛔ Bloqueado
13
-
14
- ---
15
-
16
- ## 1. Para quién es y qué problema resuelve
17
-
18
- **Quién:** desarrollador o tech lead que debe **vivir** con hooks, CI y (a veces) agentes; no auditor de slides.
19
-
20
- **Problema:** en la práctica mezcla *SDD*, *gate*, *MCP*, *evidencia* y *menú*; cuando algo bloquea no sabe **qué capa** falló ni **qué comando** la inspecciona.
21
-
22
- **Éxito del curso:** tras cerrarlo, en un repo real puede (1) nombrar el **stage** y el **scope** de un fallo, (2) leer **`.ai_evidence.json`** y relacionarlo con stderr, (3) distinguir **enforcement** (hooks/CI) de **lectura/agente** (MCP), (4) ejecutar el **flujo SDD mínimo** sin confundirlo con “arreglar reglas”, (5) instalar, actualizar o **retirar** Pumuki sin dejar hooks huérfanos.
23
-
24
- Si eso no se cumple, el curso falla aunque el HTML sea bonito.
25
-
26
- ---
27
-
28
- ## 2. Modelo mental único (todo el curso orbita aquí)
29
-
30
- Una sola frase que el alumno debe poder repetir:
31
-
32
- **Hechos del diff/código → reglas efectivas → decisión del gate por stage → registro en evidencia v2.1.**
33
-
34
- Todo lo demás (menú, MCP, notificaciones, `doctor`) es **acceso** a ese mismo pipeline o **comodidad**; no es un segundo producto.
35
-
36
- ---
37
-
38
- ## 3. Confusiones que el material debe desmontar de forma explícita
39
-
40
- Cada unidad del curso debe tener al menos un párrafo “**no confundas**” o un mini escenario:
41
-
42
- | Confusión típica | Verdad operativa |
43
- |------------------|------------------|
44
- | “Sin MCP no hay Pumuki” | Los **hooks y CI** son el enforcement; MCP es **opcional** para IDE/agente. |
45
- | “SDD es lo mismo que el gate” | SDD/OpenSpec gobierna el **cambio**; el gate evalúa **código + política + evidencia** en un **scope** concreto. |
46
- | “`openspec` en el PATH basta” | Pumuki usa OpenSpec **repo-local** (`node_modules/.bin`). |
47
- | “PRE_COMMIT limpio ⇒ push seguro” | **PRE_PUSH** mira otro **scope** (`upstream..HEAD`). |
48
- | “El menú es la fuente de verdad” | El menú **orquesta** diagnósticos; la fuente de verdad es **policy + stage + evidencia**. |
49
- | “Borrar el paquete limpia el repo” | `npm uninstall pumuki` **no** quita hooks/lifecycle; hace falta **`pumuki remove`** / flujo documentado. |
50
-
51
- Si el Markdown del curso no nombra estas líneas, el plan pedagógico sigue vacío aunque haya tablas de check.
52
-
53
- ---
54
-
55
- ## 4. Secuencia didáctica (orden de primera lectura)
56
-
57
- El repo del curso incluye la **columna vertebral en prosa** `00-preparacion/03-recorrido-cero-a-cien-pumuki.md` (0→100 % sin saltos) y el **proyecto guiado** `02-modulos/13-proyecto-guiado-de-la-a-la-z.md` (fases A–M con criterios de hecho). Esta tabla U0–U10 sigue siendo el contrato de **outcomes**; esas piezas son el **relato** y el **laboratorio** que los materializan.
58
-
59
- El **mapa completo** (`00-mapa-completo-del-producto.md`) es **referencia** para quien ya perdió el hilo; la **primera pasada** debe seguir esta secuencia para no cargar conceptos antes de tiempo.
60
-
61
- | Orden | Unidad | Objetivo observable (el alumno demuestra…) | Actividad mínima en lab | Criterio de dominio |
62
- |-------|--------|---------------------------------------------|-------------------------|----------------------|
63
- | U0 | Preparación + versión + lab | Que existe documentación canónica y un repo donde ensayar | Abrir USAGE e INSTALLATION; fijar versión mínima `pumuki` | Explica en una frase dónde miente un “funciona en mi máquina” sin `doctor` |
64
- | U1 | Contrato + stages + cobertura | Qué pregunta **cada** stage y qué es `unevaluated_rule_ids` | Un `pre-commit` / `pre-push` y leer evidencia | Predice scope antes de ejecutar y acierta al comparar con JSON |
65
- | U2 | Instalación y primer verde | Postinstall, `bootstrap` vs `install`, `pathExecutionHazard` | `doctor --json` antes/después de un cambio reversible | Usa `alignmentCommand` o workaround sin improvisar |
66
- | U3 | Ciclo de vida completo | Diferencia `npm uninstall`, `pumuki uninstall`, `pumuki remove`, `update --latest` | Simular retirada en rama de prueba | Lista qué queda en disco tras cada comando |
67
- | U4 | Evidencia | Dónde se escribe, cuándo **no** se reescribe (PRE_PUSH trackeado), restage PRE_COMMIT | Diff de `.ai_evidence.json` entre stages | Explica un caso “hook modificó archivo” sin pánico |
68
- | U5 | Menú interactivo | Consumer vs Advanced; 1–4/8/9; matrix; variables UI | Correr `pumuki-framework` y una opción de cada familia | Enlaza opción de menú con **stage** y **scope** equivalentes |
69
- | U6 | MCP | Evidence vs enterprise; HTTP vs stdio; recibo PRE_WRITE | Levantar o inspeccionar config en `.pumuki/adapter.json` | Explica por qué el gate puede pasar con MCP caído |
70
- | U7 | SDD/OpenSpec | Flujo diario: `sdd status`, `session`, `validate`; catálogo de códigos | Abrir sesión de cambio y validar un stage | Clasifica un JSON de bloqueo en “falta OpenSpec” vs “falta sesión” |
71
- | U8 | Notificaciones y watch | macOS vs stderr; `system-notifications.json`; anti-spam de `watch` | Una sesión `watch --once` o documentada | Elige variable correcta para silenciar o espejar |
72
- | U9 | Perfiles, Governance, monorepo | Cuándo bajar de enterprise; prefijos de scope; parity | (Según perfil del equipo) | Justifica un perfil sin autoboicot |
73
- | U10 | Cierre | Checklist operativa propia del equipo | Checklist escrita a partir del curso | Puede enseñar el modelo mental §2 a otra persona en 3 minutos |
74
-
75
- **Regla:** ninguna fila U1–U10 puede considerarse “hecha” solo con un enlace a USAGE; debe existir **narrativa + comando + actividad + criterio** en el Markdown del curso.
76
-
77
- ---
78
-
79
- ## 5. Qué el curso no debe intentar (límites)
80
-
81
- - Sustituir el curso **SDD** (OpenSpec, Kanban del cambio) ni el **Governance** (AGENTS, cultura): solo **enganchar** Pumuki a ellos.
82
- - Sustituir tests de producto, revisión humana ni criterios de negocio.
83
- - Prometer “cero lectura de USAGE”: USAGE sigue siendo norma; el curso debe **enseñar** lo mismo con **menor fricción**, no duplicar mal.
84
-
85
- ---
86
-
87
- ## 6. Estado de entrega en el repo (operativo, subordinado al §4)
88
-
89
- | Unidad §4 | Estado en `stack-my-architecture-pumuki` |
90
- |-----------|-------------------------------------------|
91
- | U0–U2 | ✅ Base + módulo 2; ciclo de vida **completo** en **08** |
92
- | U3 | ✅ `02-modulos/08-ciclo-de-vida-install-uninstall-actualizacion.md` |
93
- | U4 | ✅ `02-modulos/09-evidencia-por-stage-y-ai-evidence-json.md` |
94
- | U5 | ✅ `02-modulos/10-menu-interactivo-matrix-y-preflight.md` |
95
- | U6 | ✅ `02-modulos/11-mcp-enforcement-vs-lectura-agente.md` |
96
- | U7 | ✅ Módulo **04** ampliado (§4.6–4.8 + criterio dominio) |
97
- | U8 | ✅ `02-modulos/12-notificaciones-macos-stderr-y-watch.md` |
98
- | U9–U10 | ✅ Revisar checklist **07** frente a criterios §4 en próxima iteración |
99
-
100
- | Task | Estado |
101
- |------|--------|
102
- | Implementar U3–U8 en `.md` + `FILE_ORDER` + validación | ✅ |
103
- | CHANGELOG curso + rebuild HTML + sync hub local | ✅ (incl. CSS lectura **0.3.1**) |
104
- | Push hub + deploy Vercel (ver curso en prod) | 🚧 |
105
-
106
- ---
107
-
108
- ## 7. Auditoría técnica (no confundir con evaluación del alumno)
109
-
110
- - `python3 scripts/validate-course-structure.py` y `check-links.py` en repo curso.
111
- - Publicación hub según tu script; URL `/pumuki/` 200.
@@ -1,140 +0,0 @@
1
- import type { EnterpriseEvidenceSeverity } from './framework-menu-evidence-summary-types';
2
- import type { FrameworkMenuEvidenceSummary } from './framework-menu-evidence-summary-lib';
3
- import { renderLegacyPanel, resolveLegacyPanelOuterWidth } from './framework-menu-legacy-audit-lib';
4
- import { applyCliPalette, buildCliDesignTokens } from './framework-menu-ui-components-lib';
5
- import type { CliPaletteRole } from './framework-menu-ui-components-types';
6
-
7
- const enterpriseSeverityToRole = (severity: EnterpriseEvidenceSeverity): CliPaletteRole => {
8
- if (severity === 'CRITICAL') {
9
- return 'critical';
10
- }
11
- if (severity === 'HIGH') {
12
- return 'high';
13
- }
14
- if (severity === 'MEDIUM') {
15
- return 'medium';
16
- }
17
- return 'low';
18
- };
19
-
20
- const outcomeToRole = (outcome: string | null): CliPaletteRole => {
21
- const normalized = (outcome ?? '').trim().toUpperCase();
22
- if (normalized === 'BLOCK' || normalized === 'BLOCKED') {
23
- return 'critical';
24
- }
25
- if (normalized === 'WARN') {
26
- return 'statusWarning';
27
- }
28
- if (normalized === 'PASS' || normalized === 'ALLOW' || normalized === 'ALLOWED') {
29
- return 'goal';
30
- }
31
- return 'sectionTitle';
32
- };
33
-
34
- export const formatVintageEvidenceReportLines = (
35
- summary: FrameworkMenuEvidenceSummary,
36
- tokens: ReturnType<typeof buildCliDesignTokens>
37
- ): string[] => {
38
- if (summary.status !== 'ok') {
39
- return [
40
- applyCliPalette('PUMUKI — Classic evidence view', 'title', tokens),
41
- applyCliPalette(
42
- summary.status === 'missing'
43
- ? 'No .ai_evidence.json — run an engine audit (1, 11–14) first.'
44
- : 'Invalid .ai_evidence.json — regenerate from a gate run.',
45
- 'muted',
46
- tokens
47
- ),
48
- ];
49
- }
50
-
51
- const ent = summary.byEnterpriseSeverity ?? {
52
- CRITICAL: summary.bySeverity.CRITICAL,
53
- HIGH: summary.bySeverity.ERROR,
54
- MEDIUM: summary.bySeverity.WARN,
55
- LOW: summary.bySeverity.INFO,
56
- };
57
-
58
- const lines: string[] = [
59
- applyCliPalette('PUMUKI — Classic evidence view (severities + platforms)', 'title', tokens),
60
- '',
61
- `${applyCliPalette('Stage', 'sectionTitle', tokens)}: ${summary.stage ?? 'unknown'} ${applyCliPalette('Outcome', 'sectionTitle', tokens)}: ${applyCliPalette(String(summary.outcome ?? 'unknown'), outcomeToRole(summary.outcome), tokens)}`,
62
- `${applyCliPalette('Findings', 'sectionTitle', tokens)}: ${summary.totalFindings} ${applyCliPalette('Scanned', 'muted', tokens)}: ${summary.filesScanned} ${applyCliPalette('Affected', 'muted', tokens)}: ${summary.filesAffected}`,
63
- '',
64
- applyCliPalette('Enterprise severities', 'sectionTitle', tokens),
65
- ];
66
-
67
- const order: EnterpriseEvidenceSeverity[] = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'];
68
- for (const band of order) {
69
- const count = ent[band] ?? 0;
70
- if (count === 0) {
71
- continue;
72
- }
73
- lines.push(
74
- ` ${applyCliPalette(`${band}:`, enterpriseSeverityToRole(band), tokens)} ${count}`
75
- );
76
- }
77
-
78
- lines.push('', applyCliPalette('Legacy severities', 'sectionTitle', tokens));
79
- lines.push(
80
- ` ${applyCliPalette('CRITICAL', 'critical', tokens)} ${summary.bySeverity.CRITICAL} ` +
81
- `${applyCliPalette('ERROR', 'high', tokens)} ${summary.bySeverity.ERROR} ` +
82
- `${applyCliPalette('WARN', 'medium', tokens)} ${summary.bySeverity.WARN} ` +
83
- `${applyCliPalette('INFO', 'low', tokens)} ${summary.bySeverity.INFO}`
84
- );
85
-
86
- if (summary.platformAuditRows && summary.platformAuditRows.length > 0) {
87
- lines.push('', applyCliPalette('Platforms (from evidence snapshot)', 'sectionTitle', tokens));
88
- for (const row of summary.platformAuditRows) {
89
- lines.push(
90
- ` ${applyCliPalette(row.platform, 'rule', tokens)}: ${row.violations} violations`
91
- );
92
- }
93
- lines.push(
94
- applyCliPalette(
95
- 'Note: platform buckets are heuristic (path + ruleId); "Other" is not absence of iOS/Android work.',
96
- 'muted',
97
- tokens
98
- )
99
- );
100
- }
101
-
102
- lines.push('', applyCliPalette('Top violations (ranked)', 'sectionTitle', tokens));
103
- if (summary.topFindings.length === 0) {
104
- lines.push(applyCliPalette(' (none)', 'goal', tokens));
105
- } else {
106
- for (const finding of summary.topFindings) {
107
- const role = enterpriseSeverityToRole(finding.severity);
108
- lines.push(
109
- ` ${applyCliPalette(`[${finding.severity}]`, role, tokens)} ${finding.ruleId}`
110
- );
111
- lines.push(
112
- ` ${applyCliPalette(`${finding.file}:${finding.line}`, 'muted', tokens)}`
113
- );
114
- }
115
- }
116
-
117
- return lines;
118
- };
119
-
120
- export const renderVintageEvidenceReport = (params: {
121
- write: (text: string) => void;
122
- summary: FrameworkMenuEvidenceSummary;
123
- useColor: () => boolean;
124
- }): void => {
125
- if (process.env.PUMUKI_MENU_VINTAGE_REPORT === '0') {
126
- return;
127
- }
128
- const tokens = buildCliDesignTokens({
129
- width: resolveLegacyPanelOuterWidth(),
130
- color: params.useColor(),
131
- });
132
-
133
- const lines = formatVintageEvidenceReportLines(params.summary, tokens);
134
- params.write(
135
- `\n${renderLegacyPanel(lines, {
136
- width: resolveLegacyPanelOuterWidth(),
137
- color: params.useColor(),
138
- })}\n`
139
- );
140
- };