pumuki 6.3.73 → 6.3.76

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 (44) hide show
  1. package/VERSION +1 -1
  2. package/docs/README.md +9 -7
  3. package/docs/operations/RELEASE_NOTES.md +0 -18
  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 +45 -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/runPlatformGateFacts.ts +0 -1
  16. package/integrations/lifecycle/adapter.templates.json +0 -3
  17. package/integrations/lifecycle/adapter.ts +24 -0
  18. package/integrations/lifecycle/bootstrapManifest.ts +248 -0
  19. package/integrations/lifecycle/cli.ts +30 -68
  20. package/integrations/lifecycle/cliSdd.ts +4 -3
  21. package/integrations/lifecycle/doctor.ts +7 -22
  22. package/integrations/lifecycle/governanceObservationSnapshot.ts +29 -2
  23. package/integrations/lifecycle/index.ts +0 -2
  24. package/integrations/lifecycle/install.ts +21 -0
  25. package/integrations/lifecycle/state.ts +8 -1
  26. package/integrations/mcp/aiGateCheck.ts +140 -10
  27. package/integrations/mcp/alignedPlatformGate.ts +232 -0
  28. package/integrations/mcp/autoExecuteAiStart.ts +6 -1
  29. package/integrations/mcp/enterpriseServer.ts +23 -7
  30. package/integrations/mcp/enterpriseStdioServer.cli.ts +32 -5
  31. package/integrations/mcp/preFlightCheck.ts +10 -0
  32. package/integrations/mcp/readMcpPrePushStdin.ts +7 -0
  33. package/integrations/platform/detectPlatforms.ts +0 -37
  34. package/integrations/policy/experimentalFeatures.ts +1 -1
  35. package/package.json +1 -10
  36. package/scripts/consumer-postinstall.cjs +1 -10
  37. package/AGENTS.md +0 -269
  38. package/CHANGELOG.md +0 -686
  39. package/docs/tracking/plan-curso-pumuki-stack-my-architecture.md +0 -62
  40. package/integrations/lifecycle/audit.ts +0 -101
  41. package/scripts/consumer-postinstall-resolve-args.cjs +0 -38
  42. package/scripts/pumuki-full-surface-smoke-lib.ts +0 -37
  43. package/scripts/pumuki-full-surface-smoke.ts +0 -261
  44. package/scripts/pumuki-smoke-installed-wrapper.cjs +0 -31
@@ -9,7 +9,7 @@ import { resolveMcpEnterpriseExperimentalFeature } from '../policy/experimentalF
9
9
  import { evaluateSddPolicy, readSddStatus } from '../sdd';
10
10
  import type { SddStage } from '../sdd';
11
11
  import { toStatusPayload } from './evidencePayloads';
12
- import { runEnterpriseAiGateCheck } from './aiGateCheck';
12
+ import { runEnterpriseAiGateCheckAsync } from './aiGateCheck';
13
13
  import { runEnterprisePreFlightCheck } from './preFlightCheck';
14
14
  import { runEnterpriseAutoExecuteAiStart } from './autoExecuteAiStart';
15
15
  import { writeMcpAiGateReceipt } from './aiGateReceipt';
@@ -39,6 +39,14 @@ type EnterpriseStatusPayload = {
39
39
  evidence: ReturnType<typeof toStatusPayload>;
40
40
  };
41
41
 
42
+ type EnterpriseHealthPayload = {
43
+ status: 'ok';
44
+ repoRoot: string;
45
+ experimentalFeatures: {
46
+ mcp_enterprise: ReturnType<typeof resolveMcpEnterpriseExperimentalFeature>;
47
+ };
48
+ };
49
+
42
50
  const ENTERPRISE_RESOURCES = [
43
51
  'evidence://status',
44
52
  'gitflow://state',
@@ -382,16 +390,16 @@ const evaluateCriticalToolGuard = (
382
390
  }
383
391
  };
384
392
 
385
- const executeEnterpriseTool = (
393
+ const executeEnterpriseTool = async (
386
394
  repoRoot: string,
387
395
  toolName: EnterpriseToolName,
388
396
  args: Record<string, string | number | boolean | bigint | symbol | null | Date | object>,
389
397
  dryRun: boolean
390
- ): EnterpriseToolExecution => {
398
+ ): Promise<EnterpriseToolExecution> => {
391
399
  switch (toolName) {
392
400
  case 'ai_gate_check': {
393
401
  const stage = toSddStage(args.stage, 'PRE_COMMIT');
394
- const execution = runEnterpriseAiGateCheck({
402
+ const execution = await runEnterpriseAiGateCheckAsync({
395
403
  repoRoot,
396
404
  stage,
397
405
  });
@@ -650,6 +658,14 @@ const buildStatusPayload = (repoRoot: string): EnterpriseStatusPayload => ({
650
658
  evidence: toStatusPayload(repoRoot),
651
659
  });
652
660
 
661
+ const buildHealthPayload = (repoRoot: string): EnterpriseHealthPayload => ({
662
+ status: 'ok',
663
+ repoRoot,
664
+ experimentalFeatures: {
665
+ mcp_enterprise: readMcpEnterpriseExperimentalState(),
666
+ },
667
+ });
668
+
653
669
  export const startEnterpriseMcpServer = (
654
670
  options: EnterpriseServerOptions = {}
655
671
  ): EnterpriseServerHandle => {
@@ -680,7 +696,7 @@ export const startEnterpriseMcpServer = (
680
696
  sendJson(res, 405, { error: 'Method not allowed' });
681
697
  return;
682
698
  }
683
- sendJson(res, 200, { status: 'ok' });
699
+ sendJson(res, 200, buildHealthPayload(repoRoot));
684
700
  return;
685
701
  }
686
702
 
@@ -741,7 +757,7 @@ export const startEnterpriseMcpServer = (
741
757
  return;
742
758
  }
743
759
  void readJsonBody(req)
744
- .then((body) => {
760
+ .then(async (body) => {
745
761
  if (typeof body !== 'object' || body === null) {
746
762
  sendJson(res, 400, {
747
763
  error: 'Invalid request body.',
@@ -814,7 +830,7 @@ export const startEnterpriseMcpServer = (
814
830
  }
815
831
  let result: EnterpriseToolExecution;
816
832
  try {
817
- result = executeEnterpriseTool(
833
+ result = await executeEnterpriseTool(
818
834
  repoRoot,
819
835
  toolName,
820
836
  args,
@@ -1,5 +1,6 @@
1
1
  import { Socket, createServer } from 'node:net';
2
2
  import { startEnterpriseMcpServer } from './enterpriseServer';
3
+ import { resolveMcpEnterpriseExperimentalFeature } from '../policy/experimentalFeatures';
3
4
 
4
5
  type JsonRpcId = string | number | null;
5
6
 
@@ -98,11 +99,32 @@ const fetchJson = async (url: string, options?: RequestInit): Promise<unknown> =
98
99
  }
99
100
  };
100
101
 
102
+ type EnterpriseHealthPayload = {
103
+ status?: string;
104
+ repoRoot?: string;
105
+ experimentalFeatures?: {
106
+ mcp_enterprise?: {
107
+ mode?: string;
108
+ };
109
+ };
110
+ };
111
+
112
+ const canReuseEnterpriseHttp = (
113
+ health: EnterpriseHealthPayload,
114
+ repoRoot: string,
115
+ expectedMcpMode: string
116
+ ): boolean =>
117
+ health.status === 'ok'
118
+ && health.repoRoot === repoRoot
119
+ && health.experimentalFeatures?.mcp_enterprise?.mode === expectedMcpMode;
120
+
101
121
  const startOrReuseEnterpriseHttp = async (): Promise<{
102
122
  host: string;
103
123
  port: number;
104
124
  startedByThisProcess: boolean;
105
125
  }> => {
126
+ const repoRoot = process.cwd();
127
+ const expectedMcpMode = resolveMcpEnterpriseExperimentalFeature().mode;
106
128
  const host = process.env.PUMUKI_ENTERPRISE_MCP_HOST ?? '127.0.0.1';
107
129
  const parsedPort = Number.parseInt(process.env.PUMUKI_ENTERPRISE_MCP_PORT ?? '', 10);
108
130
  const preferredPort = Number.isFinite(parsedPort) ? parsedPort : 7391;
@@ -110,16 +132,21 @@ const startOrReuseEnterpriseHttp = async (): Promise<{
110
132
 
111
133
  const healthUrl = `http://${host}:${requestedPort}/health`;
112
134
  try {
113
- const health = (await fetchJson(healthUrl)) as { status?: string };
114
- if (health.status === 'ok') {
135
+ const health = (await fetchJson(healthUrl)) as EnterpriseHealthPayload;
136
+ if (canReuseEnterpriseHttp(health, repoRoot, expectedMcpMode)) {
115
137
  return {
116
138
  host,
117
139
  port: requestedPort,
118
140
  startedByThisProcess: false,
119
141
  };
120
142
  }
121
- } catch {
122
- // Intentionally ignored: endpoint not available yet.
143
+ } catch (error) {
144
+ if (process.env.PUMUKI_DEBUG_MCP === '1') {
145
+ const message = error instanceof Error ? error.message : String(error);
146
+ process.stderr.write(
147
+ `[pumuki-mcp-enterprise-stdio] health probe reuse skipped: ${message}\n`
148
+ );
149
+ }
123
150
  }
124
151
 
125
152
  const portInUse = await isPortInUse(host, requestedPort);
@@ -127,7 +154,7 @@ const startOrReuseEnterpriseHttp = async (): Promise<{
127
154
  startEnterpriseMcpServer({
128
155
  host,
129
156
  port: resolvedPort,
130
- repoRoot: process.cwd(),
157
+ repoRoot,
131
158
  });
132
159
 
133
160
  return {
@@ -42,6 +42,14 @@ const ACTIONABLE_HINTS_BY_CODE: Readonly<Record<string, string>> = {
42
42
  'Mapea todas las reglas AUTO a detectores AST antes de continuar.',
43
43
  EVIDENCE_TIMESTAMP_FUTURE: 'Corrige la hora del sistema y regenera evidencia.',
44
44
  GITFLOW_PROTECTED_BRANCH: 'Evita trabajo directo en ramas protegidas (usa feature/*).',
45
+ GITFLOW_BRANCH_NAMING_INVALID:
46
+ 'La rama actual no cumple GitFlow. Usa feature/*, bugfix/*, hotfix/*, release/*, chore/*, refactor/* o docs/*.',
47
+ TRACKING_CANONICAL_SOURCE_CONFLICT:
48
+ 'AGENTS.md y los README del repo no apuntan a la misma fuente canónica de tracking.',
49
+ TRACKING_CANONICAL_FILE_MISSING:
50
+ 'El repo declara un MD de tracking canónico que ahora mismo no existe.',
51
+ TRACKING_CANONICAL_IN_PROGRESS_INVALID:
52
+ 'El MD canónico de tracking debe dejar exactamente una task o fase en construcción.',
45
53
  };
46
54
 
47
55
  const normalizeGovernanceCatalogCode = (code: string): string => {
@@ -51,6 +59,8 @@ const normalizeGovernanceCatalogCode = (code: string): string => {
51
59
  return 'EVIDENCE_INVALID_OR_CHAIN';
52
60
  case 'GITFLOW_PROTECTED_BRANCH':
53
61
  return 'GITFLOW_PROTECTED_BRANCH_CONTEXT';
62
+ case 'GITFLOW_BRANCH_NAMING_INVALID':
63
+ return 'GITFLOW_BRANCH_NAMING_INVALID_CONTEXT';
54
64
  default:
55
65
  return code;
56
66
  }
@@ -0,0 +1,7 @@
1
+ export const readMcpPrePushStdin = (): string => {
2
+ const envInput = process.env.PUMUKI_PRE_PUSH_STDIN;
3
+ if (typeof envInput === 'string' && envInput.trim().length > 0) {
4
+ return envInput;
5
+ }
6
+ return '';
7
+ };
@@ -51,38 +51,6 @@ const collectFilePaths = (facts: ReadonlyArray<Fact>): string[] => {
51
51
  .filter((path): path is string => typeof path === 'string');
52
52
  };
53
53
 
54
- const ALLOWED_PIN_KEYS = new Set(['ios', 'android', 'backend', 'frontend']);
55
-
56
- const readPinnedPlatformsFromEnv = (): ReadonlySet<keyof DetectedPlatforms> | null => {
57
- const raw = process.env.PUMUKI_PIN_PLATFORMS?.trim().toLowerCase();
58
- if (!raw) {
59
- return null;
60
- }
61
- const tokens = raw
62
- .split(',')
63
- .map((token) => token.trim())
64
- .filter((token) => token.length > 0)
65
- .filter((token) => ALLOWED_PIN_KEYS.has(token)) as Array<keyof DetectedPlatforms>;
66
- if (tokens.length === 0) {
67
- return null;
68
- }
69
- return new Set(tokens);
70
- };
71
-
72
- const applyPinnedPlatformsFilter = (
73
- detected: DetectedPlatforms,
74
- pin: ReadonlySet<keyof DetectedPlatforms>
75
- ): DetectedPlatforms => {
76
- const next: DetectedPlatforms = {};
77
- for (const key of pin) {
78
- const state = detected[key];
79
- if (state) {
80
- next[key] = state;
81
- }
82
- }
83
- return next;
84
- };
85
-
86
54
  export const detectPlatformsFromFacts = (
87
55
  facts: ReadonlyArray<Fact>
88
56
  ): DetectedPlatforms => {
@@ -134,10 +102,5 @@ export const detectPlatformsFromFacts = (
134
102
  };
135
103
  }
136
104
 
137
- const pin = readPinnedPlatformsFromEnv();
138
- if (pin && pin.size > 0) {
139
- return applyPinnedPlatformsFilter(result, pin);
140
- }
141
-
142
105
  return result;
143
106
  };
@@ -40,7 +40,7 @@ type ExperimentalFeatureConfig = {
40
40
 
41
41
  const EXPERIMENTAL_FEATURES: Record<ExperimentalFeatureId, ExperimentalFeatureConfig> = {
42
42
  pre_write: {
43
- defaultMode: 'off',
43
+ defaultMode: 'strict',
44
44
  activationVariable: 'PUMUKI_EXPERIMENTAL_PRE_WRITE',
45
45
  legacyActivationVariable: 'PUMUKI_PREWRITE_ENFORCEMENT',
46
46
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.73",
3
+ "version": "6.3.76",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -54,8 +54,6 @@
54
54
  "test:saas-ingestion": "npx --yes tsx@4.21.0 --test integrations/lifecycle/__tests__/saasIngestionContract.test.ts integrations/lifecycle/__tests__/saasIngestionBuilder.test.ts integrations/lifecycle/__tests__/saasIngestionTransport.test.ts integrations/lifecycle/__tests__/saasIngestionIdempotency.test.ts integrations/lifecycle/__tests__/saasIngestionAuth.test.ts integrations/lifecycle/__tests__/saasIngestionAudit.test.ts integrations/lifecycle/__tests__/saasIngestionMetrics.test.ts integrations/lifecycle/__tests__/saasIngestionGovernance.test.ts integrations/lifecycle/__tests__/saasFederation.test.ts integrations/lifecycle/__tests__/saasEnterpriseAnalytics.test.ts integrations/lifecycle/__tests__/cli.test.ts",
55
55
  "test:operational-memory": "npx --yes tsx@4.21.0 --test integrations/lifecycle/__tests__/operationalMemoryContract.test.ts integrations/lifecycle/__tests__/operationalMemorySignals.test.ts integrations/lifecycle/__tests__/operationalMemorySnapshot.test.ts integrations/git/__tests__/runPlatformGate.test.ts integrations/git/__tests__/runPlatformGateEvidence.test.ts integrations/evidence/__tests__/buildEvidence.test.ts integrations/evidence/writeEvidence.test.ts integrations/evidence/generateEvidence.test.ts",
56
56
  "test:stage-gates": "npx --yes tsx@4.21.0 --test integrations/config/__tests__/*.test.ts integrations/gate/__tests__/*.test.ts integrations/git/__tests__/*.test.ts integrations/lifecycle/__tests__/*.test.ts integrations/sdd/__tests__/*.test.ts scripts/__tests__/*.test.ts",
57
- "smoke:pumuki-surface": "npx --yes tsx@4.21.0 scripts/pumuki-full-surface-smoke.ts",
58
- "smoke:pumuki-surface-installed": "node scripts/pumuki-smoke-installed-wrapper.cjs",
59
57
  "test:deterministic": "npm run test:evidence && npm run test:mcp && npm run test:heuristics",
60
58
  "ast:refresh": "node bin/pumuki-pre-commit.js",
61
59
  "ast:audit": "node bin/pumuki-pre-commit.js",
@@ -146,8 +144,6 @@
146
144
  "validation:phase5-escalation:payload": "bash scripts/build-phase5-support-portal-payload.sh",
147
145
  "validation:architecture-guardrails": "npx --yes tsx@4.21.0 --test scripts/__tests__/architecture-file-size-guardrails.test.ts",
148
146
  "validation:package-manifest": "node --import tsx scripts/check-package-manifest.ts",
149
- "validation:pumuki-surface-smoke": "npm run -s smoke:pumuki-surface",
150
- "validation:local-merge-bar": "npm run -s typecheck && npm run -s validation:pumuki-surface-smoke && npm test",
151
147
  "validation:package-smoke": "node --import tsx scripts/package-install-smoke.ts --mode=block",
152
148
  "validation:package-smoke:minimal": "node --import tsx scripts/package-install-smoke.ts --mode=minimal",
153
149
  "validation:lifecycle-smoke": "node --import tsx scripts/package-install-smoke.ts --mode=minimal",
@@ -253,8 +249,6 @@
253
249
  "integrations/telemetry/*.ts",
254
250
  "scripts/*.ts",
255
251
  "scripts/consumer-postinstall.cjs",
256
- "scripts/consumer-postinstall-resolve-args.cjs",
257
- "scripts/pumuki-smoke-installed-wrapper.cjs",
258
252
  "scripts/adapters/*.ts",
259
253
  "scripts/adapters/*.md",
260
254
  "scripts/*.sh",
@@ -266,13 +260,10 @@
266
260
  "docs/product/*.md",
267
261
  "docs/rule-packs/*.md",
268
262
  "docs/validation/*.md",
269
- "docs/tracking/plan-curso-pumuki-stack-my-architecture.md",
270
263
  "assets/**/*",
271
264
  "vendor/skills/**/*",
272
265
  "index.js",
273
266
  "README.md",
274
- "AGENTS.md",
275
- "CHANGELOG.md",
276
267
  "LICENSE",
277
268
  "VERSION",
278
269
  "tsconfig.json",
@@ -4,7 +4,6 @@
4
4
  const { existsSync } = require('node:fs');
5
5
  const { join, resolve } = require('node:path');
6
6
  const { spawnSync } = require('node:child_process');
7
- const { resolveConsumerPostinstallInstallExtras } = require('./consumer-postinstall-resolve-args.cjs');
8
7
 
9
8
  const skipReason = () => {
10
9
  if (process.env.PUMUKI_SKIP_POSTINSTALL === '1') {
@@ -42,15 +41,7 @@ const main = () => {
42
41
  PUMUKI_SKIP_OPENSPEC_BOOTSTRAP: process.env.PUMUKI_SKIP_OPENSPEC_BOOTSTRAP ?? '1',
43
42
  };
44
43
 
45
- const { extras: installExtras, reason: mcpReason } = resolveConsumerPostinstallInstallExtras(
46
- consumerRoot,
47
- env
48
- );
49
- if (installExtras.length > 0 && env.PUMUKI_VERBOSE_INSTALL === '1') {
50
- console.debug(`[pumuki] postinstall: mcp wiring (${mcpReason}): ${installExtras.join(' ')}`);
51
- }
52
-
53
- const result = spawnSync(process.execPath, [pumukiCli, 'install', ...installExtras], {
44
+ const result = spawnSync(process.execPath, [pumukiCli, 'install'], {
54
45
  cwd: consumerRoot,
55
46
  env,
56
47
  stdio: 'inherit',
package/AGENTS.md DELETED
@@ -1,269 +0,0 @@
1
- # AGENTS.md — Reglas de Codex para este repositorio
2
-
3
- ## Idioma y comunicación
4
- - MUST: Responder siempre en español.
5
- - MUST: Mantener trazabilidad en cada entrega (`escenario -> tests -> evidencia -> task`).
6
- - MUST: Al cerrar cada iteración, responder siempre con `MD de seguimiento` y `task actual`.
7
-
8
- ## Project mode
9
- - PROJECT MODE: brownfield
10
-
11
- ## Producto Pumuki (baseline vs adaptadores)
12
- - MUST: La **línea base** es **agnóstica al IDE**: hooks Git gestionados, gate, lifecycle, evidencia, políticas. En **`pre-commit`** y **`pre-push`**, el bloque gestionado ejecuta **primero** `pumuki-pre-write` (SDD / stage **PRE_WRITE**) y **después** `pumuki-pre-commit` o `pumuki-pre-push`. Opt-out: `PUMUKI_SKIP_CHAINED_PRE_WRITE=1`.
13
- - MUST: Tras **`pumuki install`**, si no existe, se genera **`.pumuki/adapter.json`** con comandos canónicos de hooks y **MCP stdio** (referencia en el repo para cualquier cliente MCP; no sustituye registrar el servidor en un IDE).
14
- - MUST: **Ficheros propios de un IDE** (p. ej. `.cursor/mcp.json`) siguen siendo **opt-in** (`pumuki install --with-mcp --agent=…`, `bootstrap --enterprise`).
15
-
16
- ## Skills requeridos
17
- - REQUIRED SKILL: enterprise-operating-system
18
- - REQUIRED SKILL: ios-enterprise-rules
19
- - REQUIRED SKILL: swift-concurrency
20
- - REQUIRED SKILL: swiftui-expert-skill
21
- - REQUIRED SKILL: android-enterprise-rules
22
- - REQUIRED SKILL: backend-enterprise-rules
23
- - REQUIRED SKILL: frontend-enterprise-rules
24
-
25
- ## Cadena de skills
26
- - La cadena canónica es:
27
- 1. `AGENTS.md`
28
- 2. `vendor/skills/` del repo (si existe)
29
- 3. `skills.sources.json`
30
- 4. `skills.lock.json`
31
- 5. `~/.agents/skills` como capa global canónica
32
- 6. `~/.codex/skills/public` solo como compatibilidad legacy
33
- - `skills.sources.json` y `skills.lock.json` son artefactos generados, no punto de entrada humano.
34
- - Leer skills desde `~/.agents/skills/**` y `~/.codex/skills/public/**` está permitido.
35
- - Escribir o modificar cualquier cosa bajo `~/.codex/**` o `~/.agents/**` está prohibido.
36
-
37
- ## Obligatorio (en cada iteracion)
38
- Antes de realizar cualquier accion:
39
- 1) Confirmar workspace:
40
- - `pwd`
41
- - `git rev-parse --show-toplevel`
42
- - `git status`
43
- 2) Confirmar que no estas ejecutando desde dentro de `~/.codex` ni `~/.agents`.
44
- 3) Enumerar skills disponibles (repo + globales):
45
- - Preferir `vendor/skills/` si existe.
46
- - Si no existe, resolver desde `~/.agents/skills`.
47
- - Usar `~/.codex/skills/public` solo como compatibilidad legacy.
48
- 4) Decidir si una o mas skills aplican a la solicitud actual.
49
- - Si una skill aplica, invocarla y seguir sus instrucciones de `SKILL.md`.
50
- - Si no aplica ninguna skill, continuar de forma normal.
51
- 5) Comprobaciones legacy:
52
- - Los checks legacy de gate/evidencia estan deprecados en este repositorio.
53
- - No bloquear trabajo por esos checks.
54
- 6) Actualizar el estado real de refactor/estabilidad en el area de tracking actual (sin depender de artefactos de piloto):
55
- - con el estado actual del proyecto, siguiendo el formato de ese documento.
56
- - cada vez que termines una tarea, marcarla como hecha con su emoji y marcar la siguiente como en construccion; no es negociable.
57
-
58
- ## Contrato hard de skills (no negociable)
59
- - Las skills activas son un CONTRATO HARD, no una guia opcional.
60
- - Esta prohibido omitir, relajar o reinterpretar reglas internas de una skill por rapidez, conveniencia o contexto heredado.
61
- - Resolucion de conflictos de reglas:
62
- - Si hay conflicto entre skill vendorizada y skill local, aplicar la regla mas estricta.
63
- - Documentar en trazabilidad que version se aplico (vendorizada/local) y por que.
64
- - Reglas hard por ambito:
65
- - Cambios iOS/Swift/SwiftUI: aplicar SIEMPRE y en conjunto:
66
- - `ios-enterprise-rules`
67
- - `swift-concurrency`
68
- - `swiftui-expert-skill`
69
- - Cambios Frontend web (React/Next/TypeScript/CSS/UI web): aplicar SIEMPRE:
70
- - `frontend-enterprise-rules`
71
- - Cambios Backend (NestJS/TypeScript/API/datos/backend services): aplicar SIEMPRE:
72
- - `backend-enterprise-rules`
73
- - Cambios Android (Kotlin/Compose/Android): aplicar SIEMPRE:
74
- - `android-enterprise-rules`
75
- - Si una tarea toca multiples ambitos, aplicar TODAS las skills relevantes en conjunto.
76
- - No se permite aplicar solo una parte de esas skills ni hacer cherry-picking de reglas.
77
- - Si una regla de skill entra en conflicto con codigo existente, se corrige el codigo para cumplir la regla (no al reves), salvo instruccion explicita del usuario.
78
- - Si una regla no se puede cumplir tecnicamente en ese momento:
79
- - detener implementacion,
80
- - declarar `STATUS: BLOCKED`,
81
- - explicar la regla exacta bloqueante, y
82
- - pedir decision explicita del usuario antes de continuar.
83
-
84
- ## Contrato hard de GitFlow y ramas (no negociable)
85
- - El ciclo GitFlow del proyecto es obligatorio.
86
- - Es obligatorio respetar ramas nombradas segun la convencion acordada del repositorio.
87
- - Esta prohibido trabajar en una rama que no corresponda al tipo de tarea o fase.
88
- - Esta prohibido hacer commits en una rama fuera de convencion o fuera del flujo esperado.
89
- - Esta prohibido mezclar trabajo de ramas distintas sin instruccion explicita del usuario.
90
- - Convencion de naming hard por defecto (si el repo no define otra mas estricta):
91
- - `main`
92
- - `develop`
93
- - `feature/<descripcion-kebab-case>`
94
- - `bugfix/<descripcion-kebab-case>`
95
- - `hotfix/<descripcion-kebab-case>`
96
- - `release/<semver>`
97
- - `chore/<descripcion-kebab-case>`
98
- - `refactor/<descripcion-kebab-case>`
99
- - `docs/<descripcion-kebab-case>`
100
- - Flujo hard por tipo de rama:
101
- - `feature/*`, `bugfix/*`, `chore/*`, `refactor/*`, `docs/*`: deben salir de `develop`.
102
- - `release/*`: debe salir de `develop` y solo contener cambios de estabilizacion/release.
103
- - `hotfix/*`: debe salir de `main` para fixes urgentes de produccion.
104
- - Esta prohibido commitear en `main` y `develop` sin instruccion explicita del usuario.
105
- - Si la rama actual no cumple naming o flujo:
106
- - detener implementacion,
107
- - declarar `STATUS: BLOCKED`,
108
- - explicar el conflicto de rama/flujo, y
109
- - pedir al usuario el cambio o confirmacion de rama antes de continuar.
110
-
111
- ## Gate operativo obligatorio (antes de editar codigo)
112
- - Declarar internamente las skills aplicables y tratarlas como activas durante TODO el turno.
113
- - Verificar cumplimiento minimo previo:
114
- - BDD/TDD requerido por la skill correspondiente.
115
- - Concurrencia y aislamiento segun `swift-concurrency` cuando haya codigo Swift.
116
- - Estado/arquitectura/UI segun `swiftui-expert-skill` e `ios-enterprise-rules` cuando aplique iOS/SwiftUI.
117
- - Reglas frontend segun `frontend-enterprise-rules` cuando aplique web.
118
- - Reglas backend segun `backend-enterprise-rules` cuando aplique backend.
119
- - Reglas Android segun `android-enterprise-rules` cuando aplique Android.
120
- - Rama actual alineada con GitFlow y convencion de naming.
121
- - Si no se puede garantizar este gate, no se permite editar codigo.
122
-
123
- ## Prohibiciones explicitas
124
- - Prohibido avanzar con implementacion funcional si incumple cualquier regla hard de skill.
125
- - Prohibido cerrar una tarea si hay violaciones conocidas de skills pendientes de corregir.
126
- - Prohibido asumir permiso implicito del usuario para saltar reglas.
127
- - Prohibido ejecutar `merge`, `rebase`, `cherry-pick` o `push --force` sin instruccion explicita del usuario.
128
-
129
- ## Contrato hard anti-bucle y prioridad de bugs externos (no negociable)
130
- - Los bugs reportados por repos consumidores son prioridad absoluta sobre cualquier task interna del repo.
131
- - Las fuentes canonicas externas son:
132
- - `/Users/juancarlosmerlosalbarracin/Developer/Projects/SAAS:APP_SUPERMERCADOS/docs/pumuki/PUMUKI_BUGS_MEJORAS.md`
133
- - `/Users/juancarlosmerlosalbarracin/Developer/Projects/R_GO/docs/technical/08-validation/refactor/pumuki-integration-feedback.md`
134
- - `/Users/juancarlosmerlosalbarracin/Developer/Projects/Flux_training/docs/BUGS_Y_MEJORAS_PUMUKI.md`
135
- - La unica fuente viva del tracking interno es `PUMUKI-RESET-MASTER-PLAN.md`.
136
- - Los antiguos MDs internos bajo `docs/tracking/` quedan retirados del repo y no pueden reintroducirse como backlog fuente.
137
- - El bucle previo se produjo por mantener espejos internos compitiendo con backlog externo y con el propio reset.
138
- - Desde este punto, ningun documento de seguimiento fuera de `PUMUKI-RESET-MASTER-PLAN.md` puede actuar como backlog, criterio de prioridad ni prueba de avance.
139
- - Regla hard nueva:
140
- - si existe aunque sea un bug abierto en cualquiera de los MDs externos,
141
- - la unica task `🚧` permitida en el tracking interno debe corresponder a uno de esos bugs externos,
142
- - y queda prohibido arrancar, continuar o cerrar cualquier `PUMUKI-2xx` de refactor interno salvo que sea estrictamente necesaria para cerrar ese bug externo.
143
- - Si el tracking interno muestra una `🚧` distinta de un bug externo mientras haya bugs externos abiertos:
144
- - eso cuenta como violacion hard del proceso,
145
- - el estado correcto pasa a ser `STATUS: BLOCKED`,
146
- - y la unica accion permitida es corregir el tracking y volver al bug externo prioritario.
147
- - Si cualquiera de esos MDs contiene items abiertos (`🚧`, `⏳`, `⛔`, `OPEN`, `REPORTED`, `STOP`), quedan congeladas todas las tasks internas `PUMUKI-2xx` que no sean estrictamente necesarias para resolver ese bug externo.
148
- - Esta prohibido abrir, continuar o cerrar tareas internas de refactor, docs, tracking o modularizacion mientras exista un bug externo abierto que aun no tenga:
149
- - reproduccion,
150
- - fix,
151
- - tests/regresion,
152
- - release util si aplica,
153
- - y actualizacion del MD externo correspondiente.
154
- - Antes de iniciar cualquier task interna nueva, comprobar explicitamente el estado de los tres MDs externos.
155
- - Si los MDs externos y el tracking interno entran en conflicto:
156
- - los MDs externos ganan automaticamente,
157
- - el tracking interno se considera incorrecto,
158
- - y debe corregirse en el mismo turno antes de tocar codigo funcional.
159
- - Si el modelo detecta que se esta desviando a trabajo interno con bugs externos abiertos:
160
- - debe parar,
161
- - declarar el desvio en la respuesta,
162
- - corregir `PUMUKI-RESET-MASTER-PLAN.md` en ese mismo turno,
163
- - corregir el tracking interno,
164
- - y volver en ese mismo turno al bug externo prioritario.
165
- - Si el modelo vuelve a abrir una task interna no alineada con bugs externos abiertos:
166
- - declarar `STATUS: BLOCKED`,
167
- - no editar mas codigo funcional,
168
- - reparar primero el tracking,
169
- - y solo despues continuar con el bug externo prioritario.
170
- - Queda explicitamente prohibido usar el cierre de tasks internas `PUMUKI-2xx` como prueba de avance del producto mientras `SAAS`, `RuralGo` o `Flux` mantengan bugs abiertos.
171
-
172
- ## Contrato hard de release y adopcion en consumers
173
- - Si un cambio ya aporta valor real a repos consumidores, tiene tests verdes y no introduce regresiones conocidas, preparar y ejecutar una nueva publicacion de `pumuki`.
174
- - Tras cada publicacion util, y siempre que el usuario haya definido repos consumidores activos para rollout, ejecutar el ciclo:
175
- - verificar publicacion remota,
176
- - actualizar consumers a la nueva version,
177
- - revalidar `status` / `doctor` / hooks segun aplique,
178
- - actualizar el tracking real de esos consumers si cambia su estado.
179
- - No dejar consumidores largos periodos sobre una version antigua si ya existe una release estable que corrige bugs o mejoras que les afectan directamente.
180
- - Si publicar o actualizar consumers implica riesgo no obvio, explicarlo antes; si no, tratarlo como parte normal del ciclo enterprise.
181
-
182
- ## Contrato hard de higiene documental y artefactos (enterprise clean)
183
- - Objetivo no negociable: mantener el repositorio limpio, trazable y sin acumulacion de basura operativa.
184
- - Prohibido crear un `.md` nuevo por cada micro-paso si la informacion cabe en un documento existente.
185
- - Antes de crear cualquier archivo en `docs/**`, verificar y priorizar actualizacion de:
186
- - `docs/ENTERPRISE_EXECUTION_CYCLE_*.md`
187
- - `docs/REFRACTOR_PROGRESS.md`
188
- - `docs/README.md`
189
- - `docs/validation/README.md`
190
- - Crear un `.md` nuevo solo si:
191
- - lo pide explicitamente el usuario, o
192
- - es un hito contractual de fase/ciclo que no puede consolidarse en un documento ya existente.
193
- - Si se crea un `.md` nuevo, en la misma entrega es obligatorio:
194
- - indexarlo en los `README` correspondientes,
195
- - consolidar o eliminar `.md` redundantes del mismo ambito funcional,
196
- - dejar una sola fuente de verdad por tema.
197
- - Prohibido versionar artefactos efimeros de ejecucion o diagnostico:
198
- - `.audit_tmp/**`, `.audit-reports/**`, `.coverage/**`
199
- - `*.out`, `*.exit`, `*.log`, `*.tmp`, `*.bak`, `*.orig`, `*.rej`
200
- - Limpieza obligatoria antes de cerrar cualquier tarea:
201
- - eliminar artefactos efimeros locales,
202
- - eliminar directorios vacios huerfanos,
203
- - verificar que `git status` no muestra basura no trackeada fuera del alcance de la tarea.
204
- - Criterio de bloqueo hard:
205
- - si un archivo no aporta valor profesional claro (producto, arquitectura, operacion estable o compliance), no se mantiene.
206
- - si hay duda razonable, declarar `STATUS: BLOCKED` y pedir decision explicita del usuario para conservar o eliminar.
207
-
208
- ## Seguridad del repositorio
209
- - Hacer cambios SOLO dentro de este repositorio.
210
- - Evitar refactors amplios salvo peticion explicita.
211
- - Para operaciones destructivas (`delete/drop/apply/destroy`), PARAR y preguntar.
212
-
213
- ## Secretos
214
- - Nunca imprimir ni registrar secretos (API keys, tokens, service role keys o credenciales).
215
- - Si detectas un secreto, reportar solo ruta del archivo + remediacion (sin mostrar el valor).
216
-
217
- ## Protocolo de entrega
218
- Al finalizar cualquier tarea, siempre reportar:
219
- - STATUS (`DONE`/`BLOCKED`)
220
- - BRANCH
221
- - FILES CHANGED
222
- - COMMANDS RUN
223
- - NEXT instruction
224
-
225
- ## Plantilla obligatoria de trazabilidad por turno (hard)
226
- - En cada entrega final, incluir una matriz de trazabilidad por archivo con este formato minimo:
227
- - `ARCHIVO | SKILL | REGLA | EVIDENCIA | ESTADO`
228
- - Donde:
229
- - `ARCHIVO`: ruta absoluta del archivo afectado.
230
- - `SKILL`: skill o contrato aplicable (`ios-enterprise-rules`, `swift-concurrency`, `swiftui-expert-skill`, `GitFlow`, etc.).
231
- - `REGLA`: regla concreta aplicada.
232
- - `EVIDENCIA`: comando, test, diff, o referencia de linea que prueba cumplimiento.
233
- - `ESTADO`: `OK` o `BLOCKED`.
234
- - Esta prohibido cerrar una tarea sin esta matriz.
235
-
236
- <!-- BEGIN CODEX SKILLS -->
237
- ## Skills de Codex (local + vendorizado)
238
-
239
- - Precedencia:
240
- - Mantener la precedencia global ya definida en `AGENTS.md`.
241
- - Si no esta definida explicitamente, usar: `AGENTS.md > vendor/skills > ~/.agents/skills > ~/.codex/skills/public`.
242
- - Operativa:
243
- - Al inicio de cualquier fase, usar primero los archivos vendorizados en `docs/codex-skills/*.md` si existen.
244
- - Si no existen, intentar leer las rutas locales canónicas.
245
- - Si `docs/codex-skills/` no existe, usar rutas locales sin bloquear la tarea.
246
- - Aplicar reglas de las skills siempre que no contradigan `AGENTS.md`.
247
-
248
- - Skills:
249
- - `android-enterprise-rules`
250
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/android-enterprise-rules/SKILL.md`
251
- - Vendorizado: `docs/codex-skills/android-enterprise-rules.md`
252
- - `backend-enterprise-rules`
253
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/backend-enterprise-rules/SKILL.md`
254
- - Vendorizado: `docs/codex-skills/backend-enterprise-rules.md`
255
- - `frontend-enterprise-rules`
256
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/frontend-enterprise-rules/SKILL.md`
257
- - Vendorizado: `docs/codex-skills/frontend-enterprise-rules.md`
258
- - `ios-enterprise-rules`
259
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/ios-enterprise-rules/SKILL.md`
260
- - Vendorizado: `docs/codex-skills/ios-enterprise-rules.md`
261
- - `swift-concurrency`
262
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/swift-concurrency/SKILL.md`
263
- - Vendorizado: `docs/codex-skills/swift-concurrency.md`
264
- - `swiftui-expert-skill`
265
- - Local: `/Users/juancarlosmerlosalbarracin/.agents/skills/swiftui-expert-skill/SKILL.md`
266
- - Vendorizado: `docs/codex-skills/swiftui-expert-skill.md`
267
-
268
- - Comando de sincronizacion: `./scripts/sync-codex-skills.sh`
269
- <!-- END CODEX SKILLS -->