MCPcopy Create free account
hub / github.com/SethGammon/Citadel / validateProjectSpec

Function validateProjectSpec

core/project/load-project-spec.js:72–95  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

70}
71
72function validateProjectSpec(spec) {
73 const errors = [];
74
75 if (!spec || typeof spec !== 'object') {
76 return ['Project spec must be an object'];
77 }
78 if (spec.version !== PROJECT_SPEC_VERSION) {
79 errors.push(`Unsupported project spec version: ${spec.version}`);
80 }
81 if (!spec.project || typeof spec.project !== 'object') {
82 errors.push('Project spec missing project metadata');
83 } else {
84 if (!spec.project.name) errors.push('Project spec missing project name');
85 if (!spec.project.summary) errors.push('Project spec missing project summary');
86 }
87
88 for (const field of ['conventions', 'workflows', 'constraints']) {
89 if (!Array.isArray(spec[field])) {
90 errors.push(`Project spec field must be an array: ${field}`);
91 }
92 }
93
94 return errors;
95}
96
97function resolveProjectSpecPath(projectRoot, explicitPath) {
98 if (explicitPath) return path.resolve(explicitPath);

Callers 4

loadProjectSpecFunction · 0.85
mainFunction · 0.85
syncProjectGuidanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected