pumuki 6.3.71 → 6.3.73

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 (36) hide show
  1. package/AGENTS.md +269 -0
  2. package/CHANGELOG.md +686 -0
  3. package/README.md +32 -0
  4. package/VERSION +1 -1
  5. package/docs/README.md +7 -2
  6. package/docs/operations/RELEASE_NOTES.md +18 -0
  7. package/docs/product/USAGE.md +10 -0
  8. package/docs/tracking/plan-curso-pumuki-stack-my-architecture.md +62 -0
  9. package/integrations/gate/governanceActionCatalog.ts +230 -0
  10. package/integrations/git/GitService.ts +25 -0
  11. package/integrations/git/runPlatformGate.ts +9 -1
  12. package/integrations/git/runPlatformGateFacts.ts +1 -0
  13. package/integrations/git/runPlatformGateOutput.ts +36 -27
  14. package/integrations/lifecycle/adapter.templates.json +3 -0
  15. package/integrations/lifecycle/audit.ts +101 -0
  16. package/integrations/lifecycle/cli.ts +80 -8
  17. package/integrations/lifecycle/doctor.ts +64 -1
  18. package/integrations/lifecycle/governanceNextAction.ts +164 -0
  19. package/integrations/lifecycle/governanceObservationSnapshot.ts +288 -0
  20. package/integrations/lifecycle/index.ts +2 -0
  21. package/integrations/lifecycle/status.ts +29 -2
  22. package/integrations/mcp/autoExecuteAiStart.ts +86 -84
  23. package/integrations/mcp/preFlightCheck.ts +40 -3
  24. package/integrations/platform/detectPlatforms.ts +37 -0
  25. package/integrations/sdd/openSpecCli.ts +12 -3
  26. package/package.json +11 -1
  27. package/scripts/build-ruralgo-s1-evidence-pack.ts +85 -0
  28. package/scripts/consumer-postinstall-resolve-args.cjs +38 -0
  29. package/scripts/consumer-postinstall.cjs +10 -1
  30. package/scripts/framework-menu-consumer-preflight-render.ts +6 -0
  31. package/scripts/framework-menu-consumer-preflight-run.ts +19 -0
  32. package/scripts/framework-menu-consumer-preflight-types.ts +8 -0
  33. package/scripts/pumuki-full-surface-smoke-lib.ts +37 -0
  34. package/scripts/pumuki-full-surface-smoke.ts +261 -0
  35. package/scripts/pumuki-smoke-installed-wrapper.cjs +31 -0
  36. package/scripts/ruralgo-s1-evidence-pack-lib.ts +200 -0
@@ -0,0 +1,200 @@
1
+ import { mkdirSync, writeFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+
4
+ type RuralGoS1EvidenceEntry = {
5
+ title: string;
6
+ mode: 'shell' | 'mcp';
7
+ command: string;
8
+ capture: ReadonlyArray<string>;
9
+ expectedFragments: ReadonlyArray<string>;
10
+ incs: ReadonlyArray<string>;
11
+ };
12
+
13
+ export type RuralGoS1EvidencePackOptions = {
14
+ cwd: string;
15
+ consumerRoot: string;
16
+ packageVersion: string;
17
+ generatedAt: string;
18
+ };
19
+
20
+ const resolvePumukiPackageSelector = (packageVersion: string): string => {
21
+ const trimmed = packageVersion.trim();
22
+ const isStableSemver = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(trimmed);
23
+ if (isStableSemver) {
24
+ return `pumuki@${trimmed}`;
25
+ }
26
+ return 'pumuki@latest';
27
+ };
28
+
29
+ const EVIDENCE_ENTRIES: ReadonlyArray<RuralGoS1EvidenceEntry> = [
30
+ {
31
+ title: 'Lifecycle status',
32
+ mode: 'shell',
33
+ command: 'npm run pumuki:status',
34
+ capture: [
35
+ 'Bloque `governance truth` completo.',
36
+ 'Indicadores de contrato efectivo, rama y skills surface.',
37
+ ],
38
+ expectedFragments: [
39
+ 'governance truth',
40
+ 'governance_effective',
41
+ 'contract_surface',
42
+ 'current_branch',
43
+ ],
44
+ incs: ['PUMUKI-INC-070', 'PUMUKI-INC-071', 'PUMUKI-INC-073', 'PUMUKI-INC-076'],
45
+ },
46
+ {
47
+ title: 'Lifecycle doctor',
48
+ mode: 'shell',
49
+ command: 'npm run pumuki:doctor',
50
+ capture: [
51
+ 'Veredicto humano final.',
52
+ 'Bloque `governance truth` con `next_action` visible.',
53
+ ],
54
+ expectedFragments: [
55
+ 'governance truth',
56
+ 'next_action',
57
+ 'reason_code',
58
+ 'WARN',
59
+ ],
60
+ incs: ['PUMUKI-INC-070', 'PUMUKI-INC-071', 'PUMUKI-INC-073'],
61
+ },
62
+ {
63
+ title: 'PRE_WRITE canónico',
64
+ mode: 'shell',
65
+ command: 'npx --yes --package pumuki@latest pumuki sdd validate --stage=PRE_WRITE --json',
66
+ capture: [
67
+ 'Salida JSON completa.',
68
+ 'Campos de session/mode y remediación inmediata.',
69
+ ],
70
+ expectedFragments: [
71
+ '"stage":"PRE_WRITE"',
72
+ '"decision"',
73
+ '"next_action"',
74
+ ],
75
+ incs: ['PUMUKI-INC-070', 'PUMUKI-INC-072'],
76
+ },
77
+ {
78
+ title: 'Hook pre-commit / gate',
79
+ mode: 'shell',
80
+ command: 'git commit --allow-empty -m "test: pumuki s1 validation"',
81
+ capture: [
82
+ 'Bloque de gate con `reason_code`, `instruction` y `next_action`.',
83
+ 'Si bloquea, conservar `NEXT:` y `REMEDIATION:`.',
84
+ ],
85
+ expectedFragments: [
86
+ 'reason_code=',
87
+ 'instruction=',
88
+ 'next_action=',
89
+ ],
90
+ incs: ['PUMUKI-INC-071', 'PUMUKI-INC-073', 'PUMUKI-INC-076'],
91
+ },
92
+ {
93
+ title: 'MCP pre_flight_check',
94
+ mode: 'mcp',
95
+ command: 'mcp::pre_flight_check(stage=PRE_WRITE)',
96
+ capture: [
97
+ 'Payload completo de `result`.',
98
+ 'Campos `reason_code`, `instruction`, `next_action`, `hints`.',
99
+ ],
100
+ expectedFragments: [
101
+ 'reason_code',
102
+ 'instruction',
103
+ 'next_action',
104
+ 'hints',
105
+ ],
106
+ incs: ['PUMUKI-INC-071', 'PUMUKI-INC-072', 'PUMUKI-INC-073'],
107
+ },
108
+ {
109
+ title: 'MCP auto_execute_ai_start',
110
+ mode: 'mcp',
111
+ command: 'mcp::auto_execute_ai_start(stage=PRE_WRITE)',
112
+ capture: [
113
+ 'Payload completo de `result`.',
114
+ 'Campos `action`, `reason_code`, `next_action`, `confidence_pct`.',
115
+ ],
116
+ expectedFragments: [
117
+ 'action',
118
+ 'reason_code',
119
+ 'next_action',
120
+ 'confidence_pct',
121
+ ],
122
+ incs: ['PUMUKI-INC-071', 'PUMUKI-INC-073', 'PUMUKI-INC-076'],
123
+ },
124
+ ];
125
+
126
+ const renderEntry = (params: {
127
+ entry: RuralGoS1EvidenceEntry;
128
+ consumerRoot: string;
129
+ }): string => {
130
+ const command = params.entry.mode === 'shell'
131
+ ? `cd ${params.consumerRoot} && ${params.entry.command}`
132
+ : params.entry.command;
133
+
134
+ return [
135
+ `### ${params.entry.title}`,
136
+ '',
137
+ `- mode: ${params.entry.mode}`,
138
+ `- command: \`${command}\``,
139
+ `- incs: ${params.entry.incs.join(', ')}`,
140
+ '- capture:',
141
+ ...params.entry.capture.map((item) => ` - ${item}`),
142
+ '- expected_fragments:',
143
+ ...params.entry.expectedFragments.map((item) => ` - ${item}`),
144
+ '',
145
+ ].join('\n');
146
+ };
147
+
148
+ export const buildRuralGoS1EvidencePackMarkdown = (
149
+ options: RuralGoS1EvidencePackOptions
150
+ ): string => {
151
+ const pumukiPackageSelector = resolvePumukiPackageSelector(options.packageVersion);
152
+ const evidenceEntries: ReadonlyArray<RuralGoS1EvidenceEntry> = EVIDENCE_ENTRIES.map((entry) =>
153
+ entry.title === 'PRE_WRITE canónico'
154
+ ? {
155
+ ...entry,
156
+ command: `npx --yes --package ${pumukiPackageSelector} pumuki sdd validate --stage=PRE_WRITE --json`,
157
+ }
158
+ : entry
159
+ );
160
+
161
+ return [
162
+ '# RuralGo S1 Evidence Pack',
163
+ '',
164
+ `- generated_at: ${options.generatedAt}`,
165
+ `- consumer_root: \`${options.consumerRoot}\``,
166
+ `- package_version: ${options.packageVersion}`,
167
+ '- objective: validar S1 contra PUMUKI-INC-071/073/076 y reunir soporte adicional para 070/072.',
168
+ '',
169
+ '## Uso',
170
+ '',
171
+ '- Ejecuta los comandos shell desde el consumer real tras repinear la semver publicada.',
172
+ '- Captura las respuestas MCP desde una sesión conectada al servidor enterprise.',
173
+ '- No muevas un INC a `FIXED` si falta convergencia entre lifecycle, hooks y MCP.',
174
+ '',
175
+ ...evidenceEntries.map((entry) =>
176
+ renderEntry({
177
+ entry,
178
+ consumerRoot: options.consumerRoot,
179
+ })
180
+ ),
181
+ '## Criterio rápido de cierre',
182
+ '',
183
+ '- `PUMUKI-INC-071`: candidato a FIXED si lifecycle, hooks y MCP exponen contrato efectivo del repo.',
184
+ '- `PUMUKI-INC-073`: candidato a FIXED si el verde parcial desaparece y se ve governance real.',
185
+ '- `PUMUKI-INC-076`: candidato a FIXED si hooks y surfaces muestran GitFlow/naming como parte del gate.',
186
+ '- `PUMUKI-INC-072`: no cerrar salvo que el pre-edit gate aparezca de forma homogénea y automática.',
187
+ '',
188
+ ].join('\n');
189
+ };
190
+
191
+ export const writeRuralGoS1EvidencePack = (params: {
192
+ cwd: string;
193
+ outFile: string;
194
+ markdown: string;
195
+ }): string => {
196
+ const outputPath = resolve(params.cwd, params.outFile);
197
+ mkdirSync(dirname(outputPath), { recursive: true });
198
+ writeFileSync(outputPath, params.markdown, 'utf8');
199
+ return outputPath;
200
+ };