pumuki 6.3.26 → 6.3.28

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 (76) hide show
  1. package/README.md +3 -1
  2. package/bin/pumuki-mcp-enterprise-stdio.js +5 -0
  3. package/bin/pumuki-mcp-evidence-stdio.js +5 -0
  4. package/core/gate/conditionMatches.ts +1 -21
  5. package/core/gate/evaluateGate.js +5 -0
  6. package/core/gate/evaluateRules.js +5 -0
  7. package/core/gate/evaluateRules.ts +1 -24
  8. package/core/gate/scopeMatcher.ts +84 -0
  9. package/docs/EXECUTION_BOARD.md +749 -376
  10. package/docs/MCP_SERVERS.md +41 -2
  11. package/docs/README.md +6 -2
  12. package/docs/REFRACTOR_PROGRESS.md +374 -6
  13. package/docs/validation/README.md +11 -1
  14. package/docs/validation/p9-ruralgo-bug-registry.md +607 -0
  15. package/docs/validation/p9-ruralgo-fork-validation-tracking.md +904 -0
  16. package/docs/validation/real-repo-manual-e2e-ruralgo-fork.md +372 -0
  17. package/integrations/config/skillsCompliance.ts +212 -0
  18. package/integrations/evidence/integrity.ts +352 -0
  19. package/integrations/evidence/rulesCoverage.ts +94 -0
  20. package/integrations/evidence/schema.test.ts +16 -0
  21. package/integrations/evidence/schema.ts +41 -0
  22. package/integrations/evidence/writeEvidence.test.ts +68 -0
  23. package/integrations/evidence/writeEvidence.ts +23 -2
  24. package/integrations/gate/evaluateAiGate.ts +382 -15
  25. package/integrations/gate/stagePolicies.ts +70 -15
  26. package/integrations/gate/waivers.ts +209 -0
  27. package/integrations/git/findingTraceability.ts +3 -23
  28. package/integrations/git/index.js +5 -0
  29. package/integrations/git/runCliCommand.ts +16 -0
  30. package/integrations/git/runPlatformGate.ts +53 -1
  31. package/integrations/git/runPlatformGateEvaluation.ts +13 -0
  32. package/integrations/git/stageRunners.ts +168 -5
  33. package/integrations/lifecycle/adapter.templates.json +72 -5
  34. package/integrations/lifecycle/adapter.ts +78 -4
  35. package/integrations/lifecycle/cli.ts +384 -14
  36. package/integrations/lifecycle/doctor.ts +534 -0
  37. package/integrations/lifecycle/hookBlock.ts +2 -1
  38. package/integrations/lifecycle/index.js +5 -0
  39. package/integrations/lifecycle/install.ts +115 -3
  40. package/integrations/lifecycle/openSpecBootstrap.ts +68 -8
  41. package/integrations/lifecycle/preWriteAutomation.ts +142 -0
  42. package/integrations/mcp/aiGateCheck.ts +6 -0
  43. package/integrations/mcp/aiGateReceipt.ts +188 -0
  44. package/integrations/mcp/enterpriseServer.ts +14 -1
  45. package/integrations/mcp/enterpriseStdioServer.cli.ts +315 -0
  46. package/integrations/mcp/evidenceStdioServer.cli.ts +342 -0
  47. package/integrations/mcp/index.js +5 -0
  48. package/integrations/sdd/index.js +5 -0
  49. package/integrations/sdd/index.ts +2 -0
  50. package/integrations/sdd/policy.ts +191 -2
  51. package/integrations/sdd/sessionStore.ts +139 -19
  52. package/integrations/sdd/syncDocs.ts +180 -0
  53. package/integrations/sdd/types.ts +4 -1
  54. package/integrations/telemetry/structuredTelemetry.ts +197 -0
  55. package/package.json +27 -8
  56. package/scripts/build-p9-validation-manifests.ts +53 -0
  57. package/scripts/check-p9-ruralgo-baseline-clean.ts +200 -0
  58. package/scripts/check-p9-ruralgo-baseline-versioned.ts +198 -0
  59. package/scripts/check-p9-ruralgo-branch-ready.ts +215 -0
  60. package/scripts/check-p9-ruralgo-install-health.ts +288 -0
  61. package/scripts/check-p9-ruralgo-runtime-ready.ts +188 -0
  62. package/scripts/check-package-manifest.ts +49 -0
  63. package/scripts/check-tracking-single-active.sh +40 -0
  64. package/scripts/framework-menu-consumer-preflight-lib.ts +31 -0
  65. package/scripts/framework-menu-consumer-runtime-lib.ts +3 -3
  66. package/scripts/framework-menu-legacy-audit-lib.ts +35 -7
  67. package/scripts/framework-menu-matrix-evidence-lib.ts +6 -2
  68. package/scripts/manage-library.sh +1 -1
  69. package/scripts/p9-ruralgo-baseline-clean-lib.ts +117 -0
  70. package/scripts/p9-ruralgo-baseline-versioned-lib.ts +119 -0
  71. package/scripts/p9-ruralgo-branch-ready-lib.ts +128 -0
  72. package/scripts/p9-ruralgo-install-health-lib.ts +121 -0
  73. package/scripts/p9-ruralgo-runtime-ready-lib.ts +149 -0
  74. package/scripts/p9-validation-manifests-lib.ts +366 -0
  75. package/scripts/package-manifest-lib.ts +9 -0
  76. package/skills.lock.json +1 -1
@@ -19,7 +19,10 @@
19
19
  },
20
20
  "mcp": {
21
21
  "enterprise": {
22
- "command": "npx --yes pumuki-mcp-enterprise"
22
+ "command": "npx --yes --package pumuki@latest pumuki-mcp-enterprise-stdio"
23
+ },
24
+ "evidence": {
25
+ "command": "npx --yes --package pumuki@latest pumuki-mcp-evidence-stdio"
23
26
  }
24
27
  }
25
28
  }
@@ -50,7 +53,18 @@
50
53
  "command": "npx",
51
54
  "args": [
52
55
  "--yes",
53
- "pumuki-mcp-enterprise"
56
+ "--package",
57
+ "pumuki@latest",
58
+ "pumuki-mcp-enterprise-stdio"
59
+ ]
60
+ },
61
+ "pumuki-evidence": {
62
+ "command": "npx",
63
+ "args": [
64
+ "--yes",
65
+ "--package",
66
+ "pumuki@latest",
67
+ "pumuki-mcp-evidence-stdio"
54
68
  ]
55
69
  }
56
70
  }
@@ -66,7 +80,18 @@
66
80
  "command": "npx",
67
81
  "args": [
68
82
  "--yes",
69
- "pumuki-mcp-enterprise"
83
+ "--package",
84
+ "pumuki@latest",
85
+ "pumuki-mcp-enterprise-stdio"
86
+ ]
87
+ },
88
+ "pumuki-evidence": {
89
+ "command": "npx",
90
+ "args": [
91
+ "--yes",
92
+ "--package",
93
+ "pumuki@latest",
94
+ "pumuki-mcp-evidence-stdio"
70
95
  ]
71
96
  }
72
97
  },
@@ -95,7 +120,46 @@
95
120
  "postCommand": "npx --yes pumuki-pre-commit",
96
121
  "pushCommand": "npx --yes pumuki-pre-push",
97
122
  "ciCommand": "npx --yes pumuki-ci",
98
- "mcpCommand": "npx --yes pumuki-mcp-enterprise"
123
+ "mcpCommand": "npx --yes --package pumuki@latest pumuki-mcp-enterprise-stdio"
124
+ }
125
+ },
126
+ {
127
+ "path": "$HOME/.codeium/windsurf/mcp_config.json",
128
+ "mode": "json-merge",
129
+ "payload": {
130
+ "mcpServers": {
131
+ "pumuki-enterprise": {
132
+ "command": "npx",
133
+ "args": [
134
+ "--yes",
135
+ "--package",
136
+ "pumuki@latest",
137
+ "pumuki-mcp-enterprise-stdio"
138
+ ],
139
+ "disabledTools": [],
140
+ "env": {
141
+ "PUMUKI_ENTERPRISE_MCP_PORT": "0",
142
+ "PUMUKI_ENTERPRISE_MCP_HOST": "127.0.0.1"
143
+ },
144
+ "disabled": false
145
+ },
146
+ "pumuki-evidence": {
147
+ "command": "npx",
148
+ "args": [
149
+ "--yes",
150
+ "--package",
151
+ "pumuki@latest",
152
+ "pumuki-mcp-evidence-stdio"
153
+ ],
154
+ "disabledTools": [],
155
+ "env": {
156
+ "PUMUKI_EVIDENCE_PORT": "0",
157
+ "PUMUKI_EVIDENCE_HOST": "127.0.0.1",
158
+ "PUMUKI_EVIDENCE_ROUTE": "/ai-evidence"
159
+ },
160
+ "disabled": false
161
+ }
162
+ }
99
163
  }
100
164
  }
101
165
  ],
@@ -119,7 +183,10 @@
119
183
  },
120
184
  "mcp": {
121
185
  "enterprise": {
122
- "command": "npx --yes pumuki-mcp-enterprise"
186
+ "command": "npx --yes --package pumuki@latest pumuki-mcp-enterprise-stdio"
187
+ },
188
+ "evidence": {
189
+ "command": "npx --yes --package pumuki@latest pumuki-mcp-evidence-stdio"
123
190
  }
124
191
  }
125
192
  }
@@ -1,5 +1,6 @@
1
1
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
- import { dirname, join } from 'node:path';
2
+ import { homedir } from 'node:os';
3
+ import { dirname, isAbsolute, join, resolve } from 'node:path';
3
4
  import { LifecycleGitService, type ILifecycleGitService } from './gitService';
4
5
 
5
6
  export type AdapterAgent = string;
@@ -15,6 +16,7 @@ export type LifecycleAdapterInstallResult = {
15
16
  type AdapterTemplate = {
16
17
  path: string;
17
18
  payload: unknown;
19
+ mode?: 'replace' | 'json-merge';
18
20
  };
19
21
 
20
22
  type AdapterTemplatesManifest = Record<string, ReadonlyArray<AdapterTemplate>>;
@@ -53,6 +55,76 @@ const readFileOrEmpty = (path: string): string => {
53
55
  }
54
56
  };
55
57
 
58
+ const isRecord = (value: unknown): value is Record<string, unknown> =>
59
+ typeof value === 'object' && value !== null && !Array.isArray(value);
60
+
61
+ const mergeObjects = (base: unknown, incoming: unknown): unknown => {
62
+ if (!isRecord(base) || !isRecord(incoming)) {
63
+ return incoming;
64
+ }
65
+ const merged: Record<string, unknown> = { ...base };
66
+ for (const [key, value] of Object.entries(incoming)) {
67
+ merged[key] = key in base ? mergeObjects(base[key], value) : value;
68
+ }
69
+ return merged;
70
+ };
71
+
72
+ const resolveHomeDir = (): string => process.env.HOME ?? homedir();
73
+
74
+ const resolveTemplatePath = (repoRoot: string, templatePath: string): string => {
75
+ if (templatePath.startsWith('$HOME/')) {
76
+ return resolve(resolveHomeDir(), templatePath.slice('$HOME/'.length));
77
+ }
78
+ if (templatePath.startsWith('~/')) {
79
+ return resolve(resolveHomeDir(), templatePath.slice(2));
80
+ }
81
+ if (isAbsolute(templatePath)) {
82
+ return templatePath;
83
+ }
84
+ return join(repoRoot, templatePath);
85
+ };
86
+
87
+ const buildTemplateContents = (params: {
88
+ template: AdapterTemplate;
89
+ absolutePath: string;
90
+ }): { currentContents: string; nextContents: string } => {
91
+ const currentContents = readFileOrEmpty(params.absolutePath);
92
+ if (params.template.mode !== 'json-merge') {
93
+ return {
94
+ currentContents,
95
+ nextContents: toJson(params.template.payload),
96
+ };
97
+ }
98
+
99
+ if (!isRecord(params.template.payload)) {
100
+ throw new Error(`Invalid adapter template payload for JSON merge: "${params.template.path}".`);
101
+ }
102
+
103
+ let baseObject: Record<string, unknown> = {};
104
+ if (currentContents.trim().length > 0) {
105
+ let parsedCurrent: unknown;
106
+ try {
107
+ parsedCurrent = JSON.parse(currentContents) as unknown;
108
+ } catch {
109
+ throw new Error(
110
+ `Cannot merge adapter template into invalid JSON file: "${params.template.path}" (${params.absolutePath}).`
111
+ );
112
+ }
113
+ if (!isRecord(parsedCurrent)) {
114
+ throw new Error(
115
+ `Cannot merge adapter template into non-object JSON file: "${params.template.path}" (${params.absolutePath}).`
116
+ );
117
+ }
118
+ baseObject = parsedCurrent;
119
+ }
120
+
121
+ const merged = mergeObjects(baseObject, params.template.payload);
122
+ return {
123
+ currentContents,
124
+ nextContents: toJson(merged),
125
+ };
126
+ };
127
+
56
128
  export const runLifecycleAdapterInstall = (params: {
57
129
  cwd?: string;
58
130
  git?: ILifecycleGitService;
@@ -66,9 +138,11 @@ export const runLifecycleAdapterInstall = (params: {
66
138
  const changedFiles: string[] = [];
67
139
 
68
140
  for (const template of templates) {
69
- const absolutePath = join(repoRoot, template.path);
70
- const nextContents = toJson(template.payload);
71
- const currentContents = readFileOrEmpty(absolutePath);
141
+ const absolutePath = resolveTemplatePath(repoRoot, template.path);
142
+ const { currentContents, nextContents } = buildTemplateContents({
143
+ template,
144
+ absolutePath,
145
+ });
72
146
  if (currentContents === nextContents) {
73
147
  continue;
74
148
  }