7B: Add parse error tracking (BMad review fix)

This commit is contained in:
Jarvis Prime
2026-03-09 18:35:13 +00:00
parent ca02fe131b
commit 1869fcb5b2

View File

@@ -135,6 +135,7 @@ function extractContracts(filePath, relFile) {
function extractAllContracts(subsystemMap, srcRoot) { function extractAllContracts(subsystemMap, srcRoot) {
const allContracts = []; const allContracts = [];
const bySubsystem = {}; const bySubsystem = {};
const parseErrors = [];
for (const sub of subsystemMap.subsystems) { for (const sub of subsystemMap.subsystems) {
bySubsystem[sub.name] = []; bySubsystem[sub.name] = [];
@@ -150,12 +151,12 @@ function extractAllContracts(subsystemMap, srcRoot) {
allContracts.push(...contracts); allContracts.push(...contracts);
bySubsystem[sub.name].push(...contracts); bySubsystem[sub.name].push(...contracts);
} catch (err) { } catch (err) {
// Skip files that fail to parse parseErrors.push({ file: relFile, error: err.message });
} }
} }
} }
return { contracts: allContracts, bySubsystem }; return { contracts: allContracts, bySubsystem, parseErrors };
} }
/** /**