@cccarv82/freya 2.7.0 → 2.8.2
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/cli/auto-update.js +2 -5
- package/cli/web.js +120 -87
- package/package.json +1 -1
- package/scripts/generate-blockers-report.js +6 -1
- package/scripts/generate-daily-summary.js +10 -4
- package/scripts/generate-executive-report.js +8 -4
- package/scripts/generate-sm-weekly-report.js +10 -4
- package/scripts/generate-weekly-report.js +86 -100
- package/scripts/lib/DataLayer.js +95 -7
- package/scripts/lib/DataManager.js +62 -5
- package/scripts/lib/index-utils.js +4 -2
- package/scripts/migrate-data.js +8 -1
- package/scripts/validate-data.js +11 -3
- package/templates/base/scripts/generate-blockers-report.js +6 -1
- package/templates/base/scripts/generate-daily-summary.js +10 -4
- package/templates/base/scripts/generate-executive-report.js +9 -5
- package/templates/base/scripts/generate-sm-weekly-report.js +10 -4
- package/templates/base/scripts/generate-weekly-report.js +86 -100
- package/templates/base/scripts/lib/DataLayer.js +98 -10
- package/templates/base/scripts/lib/DataManager.js +76 -19
- package/templates/base/scripts/lib/index-utils.js +4 -2
- package/templates/base/scripts/migrate-data.js +8 -1
- package/templates/base/scripts/validate-data.js +20 -12
|
@@ -4,7 +4,12 @@ const path = require('path');
|
|
|
4
4
|
const { safeReadJson, quarantineCorruptedFile } = require('./lib/fs-utils');
|
|
5
5
|
const SCHEMA = require('./lib/schema');
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// BUG-30: use FREYA_WORKSPACE_DIR so the web server uses the correct workspace
|
|
8
|
+
const WORKSPACE_DIR = process.env.FREYA_WORKSPACE_DIR
|
|
9
|
+
? path.resolve(process.env.FREYA_WORKSPACE_DIR)
|
|
10
|
+
: path.join(__dirname, '..'); // fallback: scripts/ is one level below workspace root
|
|
11
|
+
|
|
12
|
+
const DATA_DIR = path.join(WORKSPACE_DIR, 'data');
|
|
8
13
|
|
|
9
14
|
// --- Validation Helpers ---
|
|
10
15
|
|
|
@@ -140,10 +145,10 @@ function walk(dir, fileList = []) {
|
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
function validateData() {
|
|
143
|
-
console.log('
|
|
148
|
+
console.log('Starting validation...');
|
|
144
149
|
try {
|
|
145
150
|
if (!fs.existsSync(DATA_DIR)) {
|
|
146
|
-
console.error('
|
|
151
|
+
console.error('Data directory not found:', DATA_DIR);
|
|
147
152
|
process.exit(1);
|
|
148
153
|
}
|
|
149
154
|
|
|
@@ -158,9 +163,9 @@ function validateData() {
|
|
|
158
163
|
if (!result.ok) {
|
|
159
164
|
if (result.error.type === 'parse') {
|
|
160
165
|
quarantineCorruptedFile(file, result.error.message);
|
|
161
|
-
console.warn(
|
|
166
|
+
console.warn(`[${relativePath}] JSON parse failed; quarantined to _corrupted.`);
|
|
162
167
|
} else {
|
|
163
|
-
console.error(
|
|
168
|
+
console.error(`[${relativePath}] Read failed: ${result.error.message}`);
|
|
164
169
|
}
|
|
165
170
|
errorCount++;
|
|
166
171
|
return;
|
|
@@ -173,29 +178,32 @@ function validateData() {
|
|
|
173
178
|
// Route validation based on filename/path
|
|
174
179
|
if (file.endsWith('career-log.json')) {
|
|
175
180
|
fileErrors = validateCareerLog(json, relativePath);
|
|
176
|
-
} else if (file.endsWith('task-log.json') || file.endsWith('
|
|
177
|
-
//
|
|
181
|
+
} else if (file.endsWith('task-log.json') || file.endsWith('blocker-log.json')) {
|
|
182
|
+
// BUG-06: These are legacy JSON files superseded by SQLite storage.
|
|
183
|
+
// They are no longer the source of truth; validation is skipped to avoid
|
|
184
|
+
// false positives on empty/stub files left behind after migration.
|
|
185
|
+
console.log(`[${relativePath}] Legacy file (superseded by SQLite). Skipping schema validation.`);
|
|
178
186
|
} else {
|
|
179
187
|
// Optional: warn about unknown files, or ignore
|
|
180
|
-
// console.warn(
|
|
188
|
+
// console.warn(`[${relativePath}] Unknown JSON file type. Skipping schema validation.`);
|
|
181
189
|
}
|
|
182
190
|
|
|
183
191
|
if (fileErrors.length > 0) {
|
|
184
|
-
console.error(
|
|
192
|
+
console.error(`[${relativePath}] Validation failed:`);
|
|
185
193
|
fileErrors.forEach(e => console.error(` - ${e}`));
|
|
186
194
|
errorCount++;
|
|
187
195
|
}
|
|
188
196
|
});
|
|
189
197
|
|
|
190
198
|
if (errorCount === 0) {
|
|
191
|
-
console.log('
|
|
199
|
+
console.log('All systems operational');
|
|
192
200
|
} else {
|
|
193
|
-
console.error(
|
|
201
|
+
console.error(`Validation completed with errors in ${errorCount} file(s).`);
|
|
194
202
|
process.exit(1);
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
} catch (err) {
|
|
198
|
-
console.error('
|
|
206
|
+
console.error('Fatal error:', err);
|
|
199
207
|
process.exit(1);
|
|
200
208
|
}
|
|
201
209
|
}
|