pumuki 6.3.35 → 6.3.36

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/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.24
1
+ v6.3.36
@@ -191,6 +191,7 @@ Behavior:
191
191
  - non dry-run: persists `learning.json` deterministically and reports digest/path in output.
192
192
  - `rule_updates`: deterministic recommendations derived from evidence/gate signals (`missing`, `invalid`, `blocked`, `allowed`).
193
193
  - dedicated command: `pumuki sdd learn --change=<id> [--stage=<stage>] [--task=<task>] [--dry-run] [--json]` generates/persists the same artifact without requiring `sync-docs`.
194
+ - orchestration command: `pumuki sdd auto-sync --change=<id> [--stage=<stage>] [--task=<task>] [--dry-run] [--json]` executes deterministic docs sync plus learning generation in one step.
194
195
 
195
196
  ## Gate telemetry export (optional)
196
197
 
@@ -5,6 +5,22 @@ Detailed commit history remains available through Git history (`git log` / `git
5
5
 
6
6
  ## 2026-03 (enterprise hardening updates)
7
7
 
8
+ ### 2026-03-04 (v6.3.36)
9
+
10
+ - SDD orchestration hardening shipped:
11
+ - New enterprise command `pumuki sdd auto-sync` with `--change`, optional `--stage/--task`, `--dry-run`, and `--json`.
12
+ - `auto-sync` orchestrates deterministic docs sync plus learning generation in one step.
13
+ - Fail-safe behavior preserved through the existing transactional `sync-docs` path (no partial writes on conflict).
14
+ - Traceability:
15
+ - implementation issue: `#600`
16
+ - implementation PR: `#602`
17
+ - tracking sync PR: `#604`
18
+ - Consumer quick verification:
19
+ - `npx --yes --package pumuki@latest pumuki sdd auto-sync --change=rgo-quickstart-02 --stage=PRE_WRITE --task=P12.F2.T70 --dry-run --json`
20
+ - expected signal:
21
+ - `command=pumuki sdd auto-sync` available in CLI help.
22
+ - JSON payload includes `syncDocs.updated` and `learning.path`.
23
+
8
24
  ### 2026-03-04 (v6.3.35)
9
25
 
10
26
  - SDD enterprise incremental hardening shipped:
@@ -7,8 +7,8 @@
7
7
  ## Estado actual
8
8
  - Plan activo: `docs/seguimiento-completo-validacion-ruralgo-03-03-2026.md`
9
9
  - Estado del plan: EN CURSO
10
- - Última task cerrada (`✅`): `P12.F2.T68` (nuevo comando `pumuki sdd learn`, issue `#597`, PR `#599`).
11
- - Task activa (`🚧`): `P12.F2.T69` (publicar release `6.3.35` con cierre SDD incremental en npm).
10
+ - Última task cerrada (`✅`): `P12.F2.T70` (comando orquestador `pumuki sdd auto-sync`, issue `#600`, PR `#602`, commit `2be34c5`).
11
+ - Task activa (`🚧`): `P12.F2.T71` (publicar release `6.3.36` con `auto-sync`, issue `#603`).
12
12
 
13
13
  ## Historial resumido
14
14
  - No se mantienen MDs históricos de seguimiento en este repositorio.
@@ -1942,11 +1942,37 @@ Criterio de salida F5:
1942
1942
  - `npx --yes tsx@4.21.0 --test integrations/sdd/__tests__/syncDocs.test.ts integrations/lifecycle/__tests__/cli.test.ts` => `38 passed, 0 failed`.
1943
1943
  - `npm run -s typecheck` => `exit 0`.
1944
1944
 
1945
- - 🚧 `P12.F2.T69` Publicar release `6.3.35` con cierre SDD incremental.
1945
+ - `P12.F2.T69` Publicar release `6.3.35` con cierre SDD incremental.
1946
+ - cierre ejecutado:
1947
+ - versión incrementada a `6.3.35` en `package.json` y `package-lock.json`.
1948
+ - release notes actualizadas con entrada `2026-03-04 (v6.3.35)` en `docs/RELEASE_NOTES.md`.
1949
+ - publicación npm ejecutada con éxito (`npm publish --access public`).
1950
+ - propagación validada:
1951
+ - `npm view pumuki dist-tags --json` => `"latest": "6.3.35"`.
1952
+ - smoke `@latest` en carpeta temporal mostrando `pumuki sdd learn ...` en `--help`.
1953
+ - evidencia:
1954
+ - `npx --yes tsx@4.21.0 --test integrations/sdd/__tests__/syncDocs.test.ts integrations/lifecycle/__tests__/cli.test.ts` => `38 passed, 0 failed`.
1955
+ - `npm run -s typecheck` => `exit 0`.
1956
+ - `npm publish --access public` => `+ pumuki@6.3.35`.
1957
+ - `npm view pumuki@6.3.35 version` => `6.3.35`.
1958
+
1959
+ - ✅ `P12.F2.T70` Siguiente SDD pendiente enterprise: comando orquestador `pumuki sdd auto-sync` (`#600`).
1960
+ - cierre ejecutado:
1961
+ - nuevo runtime `runSddAutoSync` en capa SDD para orquestar `sync-docs` + `learning` en un único paso determinista.
1962
+ - CLI ampliada con:
1963
+ - `pumuki sdd auto-sync --change=<id> --stage=<stage> --task=<task-id> [--dry-run] [--json]`.
1964
+ - cobertura de regresión añadida en `syncDocs`/`index`/`cli` y documentación actualizada en `docs/CONFIGURATION.md`.
1965
+ - issue cerrada: `#600`.
1966
+ - PR mergeada: `#602` (`commit 2be34c5`).
1967
+ - evidencia:
1968
+ - `npx --yes tsx@4.21.0 --test integrations/sdd/__tests__/syncDocs.test.ts integrations/sdd/__tests__/index.test.ts integrations/lifecycle/__tests__/cli.test.ts` => `44 passed, 0 failed`.
1969
+ - `npm run -s typecheck` => `exit 0`.
1970
+
1971
+ - 🚧 `P12.F2.T71` Publicar release `6.3.36` con `pumuki sdd auto-sync` (`#603`).
1946
1972
  - salida esperada:
1947
- - bump de versión (`package.json`, `package-lock.json`) + nota de release.
1948
- - publicación npm exitosa y verificación `npm view pumuki version`.
1949
- - smoke mínimo con `npx --yes --package pumuki@latest pumuki --help`.
1973
+ - versionado a `6.3.36` en `package.json`, `package-lock.json` y `VERSION`.
1974
+ - release notes actualizadas con entrada `v6.3.36`.
1975
+ - publicación npm validada (`latest=6.3.36`) + smoke de `--help` mostrando `auto-sync`.
1950
1976
 
1951
1977
  Criterio de salida F6:
1952
1978
  - veredicto final trazable y cierre administrativo completo.
@@ -27,6 +27,7 @@ import {
27
27
  openSddSession,
28
28
  readSddStatus,
29
29
  refreshSddSession,
30
+ runSddAutoSync,
30
31
  runSddLearn,
31
32
  runSddSyncDocs,
32
33
  type SddStage,
@@ -63,7 +64,7 @@ type LifecycleCommand =
63
64
  | 'adapter'
64
65
  | 'analytics';
65
66
 
66
- type SddCommand = 'status' | 'validate' | 'session' | 'sync-docs' | 'learn';
67
+ type SddCommand = 'status' | 'validate' | 'session' | 'sync-docs' | 'learn' | 'auto-sync';
67
68
  type LoopCommand = 'run' | 'status' | 'stop' | 'resume' | 'list' | 'export';
68
69
  type AnalyticsCommand = 'hotspots';
69
70
  type AnalyticsHotspotsCommand = 'report' | 'diagnose';
@@ -95,6 +96,10 @@ type ParsedArgs = {
95
96
  sddLearnChange?: string;
96
97
  sddLearnStage?: SddStage;
97
98
  sddLearnTask?: string;
99
+ sddAutoSyncDryRun?: boolean;
100
+ sddAutoSyncChange?: string;
101
+ sddAutoSyncStage?: SddStage;
102
+ sddAutoSyncTask?: string;
98
103
  adapterCommand?: 'install';
99
104
  adapterAgent?: AdapterAgent;
100
105
  adapterDryRun?: boolean;
@@ -130,6 +135,7 @@ Pumuki lifecycle commands:
130
135
  pumuki sdd session --close [--json]
131
136
  pumuki sdd sync-docs [--change=<change-id>] [--stage=PRE_WRITE|PRE_COMMIT|PRE_PUSH|CI] [--task=<task-id>] [--dry-run] [--json]
132
137
  pumuki sdd learn --change=<change-id> [--stage=PRE_WRITE|PRE_COMMIT|PRE_PUSH|CI] [--task=<task-id>] [--dry-run] [--json]
138
+ pumuki sdd auto-sync --change=<change-id> [--stage=PRE_WRITE|PRE_COMMIT|PRE_PUSH|CI] [--task=<task-id>] [--dry-run] [--json]
133
139
  `.trim();
134
140
 
135
141
  const LOOP_RUN_POLICY: GatePolicy = {
@@ -436,6 +442,10 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
436
442
  let sddLearnChange: ParsedArgs['sddLearnChange'];
437
443
  let sddLearnStage: ParsedArgs['sddLearnStage'];
438
444
  let sddLearnTask: ParsedArgs['sddLearnTask'];
445
+ let sddAutoSyncDryRun = false;
446
+ let sddAutoSyncChange: ParsedArgs['sddAutoSyncChange'];
447
+ let sddAutoSyncStage: ParsedArgs['sddAutoSyncStage'];
448
+ let sddAutoSyncTask: ParsedArgs['sddAutoSyncTask'];
439
449
  let adapterCommand: ParsedArgs['adapterCommand'];
440
450
  let adapterAgent: ParsedArgs['adapterAgent'];
441
451
  let adapterDryRun = false;
@@ -615,7 +625,8 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
615
625
  subcommandRaw !== 'validate' &&
616
626
  subcommandRaw !== 'session' &&
617
627
  subcommandRaw !== 'sync-docs' &&
618
- subcommandRaw !== 'learn'
628
+ subcommandRaw !== 'learn' &&
629
+ subcommandRaw !== 'auto-sync'
619
630
  ) {
620
631
  throw new Error(`Unsupported SDD subcommand "${subcommandRaw}".\n\n${HELP_TEXT}`);
621
632
  }
@@ -635,7 +646,11 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
635
646
  sddLearnDryRun = true;
636
647
  continue;
637
648
  }
638
- throw new Error(`--dry-run is only supported with "pumuki sdd sync-docs" or "pumuki sdd learn".\n\n${HELP_TEXT}`);
649
+ if (sddCommand === 'auto-sync') {
650
+ sddAutoSyncDryRun = true;
651
+ continue;
652
+ }
653
+ throw new Error(`--dry-run is only supported with "pumuki sdd sync-docs", "pumuki sdd learn" or "pumuki sdd auto-sync".\n\n${HELP_TEXT}`);
639
654
  }
640
655
  if (arg.startsWith('--stage=')) {
641
656
  if (sddCommand === 'validate') {
@@ -650,7 +665,11 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
650
665
  sddLearnStage = parseSddStage(arg.slice('--stage='.length));
651
666
  continue;
652
667
  }
653
- throw new Error(`--stage is only supported with "pumuki sdd validate", "pumuki sdd sync-docs" or "pumuki sdd learn".\n\n${HELP_TEXT}`);
668
+ if (sddCommand === 'auto-sync') {
669
+ sddAutoSyncStage = parseSddStage(arg.slice('--stage='.length));
670
+ continue;
671
+ }
672
+ throw new Error(`--stage is only supported with "pumuki sdd validate", "pumuki sdd sync-docs", "pumuki sdd learn" or "pumuki sdd auto-sync".\n\n${HELP_TEXT}`);
654
673
  }
655
674
  if (arg === '--open') {
656
675
  if (sddCommand !== 'session') {
@@ -694,7 +713,15 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
694
713
  sddLearnChange = changeValue;
695
714
  continue;
696
715
  }
697
- throw new Error(`--change is only supported with "pumuki sdd session", "pumuki sdd sync-docs" or "pumuki sdd learn".\n\n${HELP_TEXT}`);
716
+ if (sddCommand === 'auto-sync') {
717
+ const changeValue = arg.slice('--change='.length).trim();
718
+ if (changeValue.length === 0) {
719
+ throw new Error(`Invalid --change value "${arg}".`);
720
+ }
721
+ sddAutoSyncChange = changeValue;
722
+ continue;
723
+ }
724
+ throw new Error(`--change is only supported with "pumuki sdd session", "pumuki sdd sync-docs", "pumuki sdd learn" or "pumuki sdd auto-sync".\n\n${HELP_TEXT}`);
698
725
  }
699
726
  if (arg.startsWith('--task=')) {
700
727
  if (sddCommand === 'sync-docs') {
@@ -713,7 +740,15 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
713
740
  sddLearnTask = taskValue;
714
741
  continue;
715
742
  }
716
- throw new Error(`--task is only supported with "pumuki sdd sync-docs" or "pumuki sdd learn".\n\n${HELP_TEXT}`);
743
+ if (sddCommand === 'auto-sync') {
744
+ const taskValue = arg.slice('--task='.length).trim();
745
+ if (taskValue.length === 0) {
746
+ throw new Error(`Invalid --task value "${arg}".`);
747
+ }
748
+ sddAutoSyncTask = taskValue;
749
+ continue;
750
+ }
751
+ throw new Error(`--task is only supported with "pumuki sdd sync-docs", "pumuki sdd learn" or "pumuki sdd auto-sync".\n\n${HELP_TEXT}`);
717
752
  }
718
753
  if (arg.startsWith('--ttl-minutes=')) {
719
754
  if (sddCommand !== 'session') {
@@ -783,6 +818,26 @@ export const parseLifecycleCliArgs = (argv: ReadonlyArray<string>): ParsedArgs =
783
818
  ...(sddLearnTask ? { sddLearnTask } : {}),
784
819
  };
785
820
  }
821
+ if (sddCommand === 'auto-sync') {
822
+ if (sddSessionAction || sddChangeId || typeof sddTtlMinutes === 'number') {
823
+ throw new Error(
824
+ `"pumuki sdd auto-sync" only supports --change=<change-id> [--stage=PRE_WRITE|PRE_COMMIT|PRE_PUSH|CI] [--task=<task-id>] [--dry-run] [--json].\n\n${HELP_TEXT}`
825
+ );
826
+ }
827
+ if (!sddAutoSyncChange || sddAutoSyncChange.length === 0) {
828
+ throw new Error(`Missing --change=<change-id> for "pumuki sdd auto-sync".\n\n${HELP_TEXT}`);
829
+ }
830
+ return {
831
+ command: commandRaw,
832
+ purgeArtifacts: false,
833
+ json,
834
+ sddCommand,
835
+ sddAutoSyncDryRun,
836
+ sddAutoSyncChange,
837
+ ...(sddAutoSyncStage ? { sddAutoSyncStage } : {}),
838
+ ...(sddAutoSyncTask ? { sddAutoSyncTask } : {}),
839
+ };
840
+ }
786
841
 
787
842
  if (!sddSessionAction) {
788
843
  throw new Error(
@@ -1824,6 +1879,31 @@ export const runLifecycleCli = async (
1824
1879
  }
1825
1880
  return 0;
1826
1881
  }
1882
+ if (parsed.sddCommand === 'auto-sync') {
1883
+ const autoSyncResult = runSddAutoSync({
1884
+ repoRoot: process.cwd(),
1885
+ dryRun: parsed.sddAutoSyncDryRun === true,
1886
+ change: parsed.sddAutoSyncChange,
1887
+ stage: parsed.sddAutoSyncStage,
1888
+ task: parsed.sddAutoSyncTask,
1889
+ });
1890
+ if (parsed.json) {
1891
+ writeInfo(JSON.stringify(autoSyncResult, null, 2));
1892
+ } else {
1893
+ writeInfo(
1894
+ `[pumuki][sdd] auto-sync dry_run=${autoSyncResult.dryRun ? 'yes' : 'no'} change=${autoSyncResult.context.change} stage=${autoSyncResult.context.stage ?? 'none'} task=${autoSyncResult.context.task ?? 'none'} updated=${autoSyncResult.syncDocs.updated ? 'yes' : 'no'} files=${autoSyncResult.syncDocs.files.length} learning_written=${autoSyncResult.learning.written ? 'yes' : 'no'}`
1895
+ );
1896
+ writeInfo(
1897
+ `[pumuki][sdd] learning_path=${autoSyncResult.learning.path} digest=${autoSyncResult.learning.digest}`
1898
+ );
1899
+ for (const file of autoSyncResult.syncDocs.files) {
1900
+ writeInfo(
1901
+ `[pumuki][sdd] file=${file.path} updated=${file.updated ? 'yes' : 'no'} before=${file.beforeDigest} after=${file.afterDigest}`
1902
+ );
1903
+ }
1904
+ }
1905
+ return 0;
1906
+ }
1827
1907
  return 0;
1828
1908
  }
1829
1909
  case 'adapter': {
@@ -9,4 +9,4 @@ export type {
9
9
  } from './types';
10
10
  export { evaluateSddPolicy, readSddStatus } from './policy';
11
11
  export { closeSddSession, openSddSession, readSddSession, refreshSddSession } from './sessionStore';
12
- export { runSddLearn, runSddSyncDocs } from './syncDocs';
12
+ export { runSddAutoSync, runSddLearn, runSddSyncDocs } from './syncDocs';
@@ -85,6 +85,22 @@ export type SddLearnResult = {
85
85
  learning: NonNullable<SddSyncDocsResult['learning']>;
86
86
  };
87
87
 
88
+ export type SddAutoSyncResult = {
89
+ command: 'pumuki sdd auto-sync';
90
+ dryRun: boolean;
91
+ repoRoot: string;
92
+ context: {
93
+ change: string;
94
+ stage: SddStage | null;
95
+ task: string | null;
96
+ };
97
+ syncDocs: {
98
+ updated: boolean;
99
+ files: ReadonlyArray<SddSyncDocsFileResult>;
100
+ };
101
+ learning: NonNullable<SddSyncDocsResult['learning']>;
102
+ };
103
+
88
104
  const normalizeSectionBody = (value: string): string => value.trim().replace(/\r\n/g, '\n');
89
105
 
90
106
  const computeDigest = (value: string): string =>
@@ -433,3 +449,50 @@ export const runSddLearn = (params?: {
433
449
  learning: result.learning,
434
450
  };
435
451
  };
452
+
453
+ export const runSddAutoSync = (params?: {
454
+ repoRoot?: string;
455
+ dryRun?: boolean;
456
+ change?: string;
457
+ stage?: SddStage;
458
+ task?: string;
459
+ now?: () => Date;
460
+ evidenceReader?: (repoRoot: string) => EvidenceReadResult;
461
+ targets?: ReadonlyArray<SddSyncDocsTarget>;
462
+ }): SddAutoSyncResult => {
463
+ const change = params?.change?.trim();
464
+ if (!change) {
465
+ throw new Error('[pumuki][sdd] auto-sync requires --change=<change-id>.');
466
+ }
467
+
468
+ const syncResult = runSddSyncDocs({
469
+ repoRoot: params?.repoRoot,
470
+ dryRun: params?.dryRun,
471
+ change,
472
+ stage: params?.stage,
473
+ task: params?.task,
474
+ now: params?.now,
475
+ evidenceReader: params?.evidenceReader,
476
+ targets: params?.targets,
477
+ });
478
+
479
+ if (!syncResult.learning) {
480
+ throw new Error('[pumuki][sdd] auto-sync could not generate learning artifact.');
481
+ }
482
+
483
+ return {
484
+ command: 'pumuki sdd auto-sync',
485
+ dryRun: syncResult.dryRun,
486
+ repoRoot: syncResult.repoRoot,
487
+ context: {
488
+ change,
489
+ stage: syncResult.context.stage,
490
+ task: syncResult.context.task,
491
+ },
492
+ syncDocs: {
493
+ updated: syncResult.updated,
494
+ files: syncResult.files,
495
+ },
496
+ learning: syncResult.learning,
497
+ };
498
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.35",
3
+ "version": "6.3.36",
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": {