oneie 3.4.2 → 3.6.0
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/.claude/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/one.md +411 -10
- package/.claude/commands/release.md +64 -3
- package/CLAUDE.md +55 -69
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +101 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/app.json +8 -0
- package/one/.obsidian/appearance.json +1 -0
- package/one/.obsidian/community-plugins.json +3 -0
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/plugins/easy-bake/main.js +361 -0
- package/one/.obsidian/plugins/easy-bake/manifest.json +11 -0
- package/one/.obsidian/plugins/easy-bake/styles.css +10 -0
- package/one/.obsidian/workspace.json +240 -0
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/groups/nine-padle-contents.baked.md +1252 -0
- package/one/groups/nine-padle-contents.md +6 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/installation-folders.md +45 -1
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/one/things/templates.md +254 -0
- package/one/things/todo.md +23 -5
- package/package.json +2 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const __dirname = path.dirname(__filename);
|
|
9
|
-
|
|
10
|
-
class OntologyValidator {
|
|
11
|
-
constructor(ontologyPath) {
|
|
12
|
-
this.ontologyPath = ontologyPath;
|
|
13
|
-
this.ontologyContent = fs.readFileSync(ontologyPath, 'utf8');
|
|
14
|
-
this.rules = this.extractRules();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
extractRules() {
|
|
18
|
-
// Parse ontology.md to extract validation rules
|
|
19
|
-
return {
|
|
20
|
-
directoryStructure: this.extractDirectoryRules(),
|
|
21
|
-
namingConventions: this.extractNamingRules(),
|
|
22
|
-
agentStructure: this.extractAgentRules(),
|
|
23
|
-
teamComposition: this.extractTeamRules(),
|
|
24
|
-
viralIntegration: this.extractViralRules()
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
extractDirectoryRules() {
|
|
29
|
-
// Extract required directory structure from ontology
|
|
30
|
-
const dirPattern = /```\s*ONE System Root\s*([\s\S]*?)```/;
|
|
31
|
-
const match = this.ontologyContent.match(dirPattern);
|
|
32
|
-
|
|
33
|
-
if (match) {
|
|
34
|
-
const structure = match[1];
|
|
35
|
-
return {
|
|
36
|
-
required: ['one/', 'one/agents/', 'one/agent-teams/', 'one/workflows/'],
|
|
37
|
-
forbidden: ['deprecated/', 'old/', 'backup/'],
|
|
38
|
-
maxDepth: 5
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return { required: [], forbidden: [], maxDepth: 5 };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
extractNamingRules() {
|
|
46
|
-
// Extract naming conventions from ontology
|
|
47
|
-
// These patterns are based on the ontology file structure definitions
|
|
48
|
-
return {
|
|
49
|
-
agent: /^[a-z-]+\.md$/,
|
|
50
|
-
team: /^team-[a-z-]+\.yaml$/,
|
|
51
|
-
workflow: /^[a-z-]+-workflow\.yaml$/,
|
|
52
|
-
template: /^[a-z-]+-tmpl\.yaml$/,
|
|
53
|
-
story: /^story-\d+\.md$/,
|
|
54
|
-
task: /^[a-z-]+\.md$/,
|
|
55
|
-
checklist: /^[a-z-]+\.md$/
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
extractAgentRules() {
|
|
60
|
-
return {
|
|
61
|
-
requiredSections: ['persona', 'role', 'whenToUse', 'capabilities'],
|
|
62
|
-
viralIntegration: ['content_multiplication', 'share_optimization'],
|
|
63
|
-
orchestratorRelationships: true
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
extractTeamRules() {
|
|
68
|
-
return {
|
|
69
|
-
minAgents: 3,
|
|
70
|
-
maxAgents: 12,
|
|
71
|
-
requiresOrchestrator: true,
|
|
72
|
-
crossFunctionAllowed: true
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
extractViralRules() {
|
|
77
|
-
// Extract viral growth requirements
|
|
78
|
-
return {
|
|
79
|
-
requiredKeywords: [
|
|
80
|
-
'viral', 'multiplication', 'k_factor', 'amplification',
|
|
81
|
-
'sharing', 'network_effect', 'exponential'
|
|
82
|
-
],
|
|
83
|
-
viralMetrics: ['k_factor_target', 'viral_cycle_target', 'amplification_target']
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
validateFile(filePath) {
|
|
88
|
-
if (!fs.existsSync(filePath)) {
|
|
89
|
-
return {
|
|
90
|
-
valid: false,
|
|
91
|
-
violations: [{
|
|
92
|
-
type: 'file_existence',
|
|
93
|
-
severity: 'critical',
|
|
94
|
-
message: `File does not exist: ${filePath}`,
|
|
95
|
-
suggestion: 'Ensure file path is correct'
|
|
96
|
-
}],
|
|
97
|
-
score: 0,
|
|
98
|
-
recommendations: ['Check file path']
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
103
|
-
const fileType = this.classifyFile(filePath);
|
|
104
|
-
const violations = [];
|
|
105
|
-
|
|
106
|
-
// Validate directory structure
|
|
107
|
-
const dirViolation = this.validateDirectory(filePath);
|
|
108
|
-
if (dirViolation) violations.push(dirViolation);
|
|
109
|
-
|
|
110
|
-
// Validate naming convention
|
|
111
|
-
const nameViolation = this.validateNaming(filePath, fileType);
|
|
112
|
-
if (nameViolation) violations.push(nameViolation);
|
|
113
|
-
|
|
114
|
-
// Validate content structure
|
|
115
|
-
const contentViolations = this.validateContent(content, fileType);
|
|
116
|
-
violations.push(...contentViolations);
|
|
117
|
-
|
|
118
|
-
// Validate viral integration
|
|
119
|
-
const viralViolation = this.validateViralIntegration(content, fileType);
|
|
120
|
-
if (viralViolation) violations.push(viralViolation);
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
valid: violations.length === 0,
|
|
124
|
-
violations: violations,
|
|
125
|
-
score: this.calculateScore(violations),
|
|
126
|
-
recommendations: this.generateRecommendations(violations)
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
classifyFile(filePath) {
|
|
131
|
-
if (filePath.includes('/agents/')) return 'agent';
|
|
132
|
-
if (filePath.includes('/agent-teams/')) return 'team';
|
|
133
|
-
if (filePath.includes('/workflows/')) return 'workflow';
|
|
134
|
-
if (filePath.includes('/templates/')) return 'template';
|
|
135
|
-
if (filePath.includes('/stories/')) return 'story';
|
|
136
|
-
if (filePath.includes('/tasks/')) return 'task';
|
|
137
|
-
if (filePath.includes('/checklists/')) return 'checklist';
|
|
138
|
-
if (filePath.includes('/data/')) return 'data';
|
|
139
|
-
if (filePath.includes('config')) return 'config';
|
|
140
|
-
return 'unknown';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
validateDirectory(filePath) {
|
|
144
|
-
const allowedPaths = [
|
|
145
|
-
/^one\//,
|
|
146
|
-
/^\.one\//,
|
|
147
|
-
/^one\/agents\//,
|
|
148
|
-
/^one\/agent-teams\//,
|
|
149
|
-
/^one\/workflows\//,
|
|
150
|
-
/^one\/templates\//,
|
|
151
|
-
/^one\/tasks\//,
|
|
152
|
-
/^one\/checklists\//,
|
|
153
|
-
/^one\/data\//,
|
|
154
|
-
/^one\/tools\//,
|
|
155
|
-
/^one\/tests\//,
|
|
156
|
-
/^one\/stories\//,
|
|
157
|
-
/^\.claude\//,
|
|
158
|
-
/^tools\//,
|
|
159
|
-
/^book\//,
|
|
160
|
-
/^prompts\//,
|
|
161
|
-
/^docs\//
|
|
162
|
-
];
|
|
163
|
-
|
|
164
|
-
// Normalize path for comparison
|
|
165
|
-
const normalizedPath = filePath.replace(/^.*\/one-code\//, '');
|
|
166
|
-
const isValid = allowedPaths.some(pattern => pattern.test(normalizedPath));
|
|
167
|
-
|
|
168
|
-
if (!isValid) {
|
|
169
|
-
return {
|
|
170
|
-
type: 'directory',
|
|
171
|
-
severity: 'critical',
|
|
172
|
-
message: `File in unauthorized directory: ${normalizedPath}`,
|
|
173
|
-
suggestion: 'Move file to appropriate ontology-defined directory'
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
validateNaming(filePath, fileType) {
|
|
181
|
-
const fileName = path.basename(filePath);
|
|
182
|
-
const pattern = this.rules.namingConventions[fileType];
|
|
183
|
-
|
|
184
|
-
if (pattern && !pattern.test(fileName)) {
|
|
185
|
-
return {
|
|
186
|
-
type: 'naming',
|
|
187
|
-
severity: 'medium',
|
|
188
|
-
message: `File name "${fileName}" doesn't match pattern for ${fileType}`,
|
|
189
|
-
suggestion: `Rename to match pattern: ${pattern.source}`
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
validateContent(content, fileType) {
|
|
197
|
-
const violations = [];
|
|
198
|
-
|
|
199
|
-
if (fileType === 'story') {
|
|
200
|
-
const requiredSections = ['## Status', '## Story', '## Acceptance Criteria', '## Tasks / Subtasks'];
|
|
201
|
-
const missingSections = requiredSections.filter(section => !content.includes(section));
|
|
202
|
-
|
|
203
|
-
if (missingSections.length > 0) {
|
|
204
|
-
violations.push({
|
|
205
|
-
type: 'content_structure',
|
|
206
|
-
severity: 'high',
|
|
207
|
-
message: `Missing required sections: ${missingSections.join(', ')}`,
|
|
208
|
-
suggestion: 'Add missing sections to story file'
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (fileType === 'agent') {
|
|
214
|
-
const requiredSections = ['# ', 'persona:', 'role:', 'whenToUse:'];
|
|
215
|
-
const missingSections = requiredSections.filter(section => !content.includes(section));
|
|
216
|
-
|
|
217
|
-
if (missingSections.length > 0) {
|
|
218
|
-
violations.push({
|
|
219
|
-
type: 'content_structure',
|
|
220
|
-
severity: 'high',
|
|
221
|
-
message: `Missing required agent sections: ${missingSections.join(', ')}`,
|
|
222
|
-
suggestion: 'Add missing sections to agent definition'
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return violations;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
validateViralIntegration(content, fileType) {
|
|
231
|
-
if (fileType === 'agent' || fileType === 'team') {
|
|
232
|
-
const hasViralKeywords = this.rules.viralIntegration.requiredKeywords.some(
|
|
233
|
-
keyword => content.toLowerCase().includes(keyword)
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
if (!hasViralKeywords) {
|
|
237
|
-
return {
|
|
238
|
-
type: 'viral_integration',
|
|
239
|
-
severity: 'high',
|
|
240
|
-
message: 'Missing viral growth integration patterns',
|
|
241
|
-
suggestion: 'Add viral growth capabilities to definition (keywords: viral, multiplication, k_factor, amplification, sharing, network_effect, exponential)'
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
calculateScore(violations) {
|
|
250
|
-
const weights = { critical: 20, high: 10, medium: 5, low: 2 };
|
|
251
|
-
const totalDeductions = violations.reduce((sum, v) => sum + weights[v.severity], 0);
|
|
252
|
-
return Math.max(0, 100 - totalDeductions);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
generateRecommendations(violations) {
|
|
256
|
-
const recommendations = [];
|
|
257
|
-
|
|
258
|
-
violations.forEach(violation => {
|
|
259
|
-
if (violation.suggestion) {
|
|
260
|
-
recommendations.push(violation.suggestion);
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
if (violations.some(v => v.type === 'viral_integration')) {
|
|
265
|
-
recommendations.push('Review ontology.md viral growth patterns for integration guidance');
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (violations.some(v => v.type === 'directory')) {
|
|
269
|
-
recommendations.push('Consult ontology.md directory structure requirements');
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
return [...new Set(recommendations)]; // Remove duplicates
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Main execution
|
|
277
|
-
function main() {
|
|
278
|
-
const filePath = process.argv[2];
|
|
279
|
-
if (!filePath) {
|
|
280
|
-
console.error('Usage: node ontology-validation-engine.js <file-path>');
|
|
281
|
-
process.exit(1);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
try {
|
|
285
|
-
const ontologyPath = path.join(__dirname, '../../one/ontology.md');
|
|
286
|
-
const validator = new OntologyValidator(ontologyPath);
|
|
287
|
-
const result = validator.validateFile(filePath);
|
|
288
|
-
|
|
289
|
-
if (result.valid) {
|
|
290
|
-
console.log(`✅ ${filePath}: PASSED (Score: ${result.score}/100)`);
|
|
291
|
-
process.exit(0);
|
|
292
|
-
} else {
|
|
293
|
-
console.log(`❌ ${filePath}: FAILED (Score: ${result.score}/100)`);
|
|
294
|
-
result.violations.forEach(v => {
|
|
295
|
-
console.log(` ${v.severity.toUpperCase()}: ${v.message}`);
|
|
296
|
-
if (v.suggestion) console.log(` 💡 ${v.suggestion}`);
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
if (result.recommendations.length > 0) {
|
|
300
|
-
console.log('\n📋 Recommendations:');
|
|
301
|
-
result.recommendations.forEach(rec => console.log(` • ${rec}`));
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const hasCritical = result.violations.some(v => v.severity === 'critical');
|
|
305
|
-
process.exit(hasCritical ? 1 : 0);
|
|
306
|
-
}
|
|
307
|
-
} catch (error) {
|
|
308
|
-
console.error(`Error validating ${filePath}:`, error.message);
|
|
309
|
-
process.exit(1);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
314
|
-
main();
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
export { OntologyValidator };
|