bulltrackers-module 1.0.266 → 1.0.267
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Main Orchestrator. Coordinates the topological execution.
|
|
3
3
|
* UPDATED: Implements Smart Audit logic to detect WHY a hash mismatch occurred.
|
|
4
|
+
* FIX: Added 'Audit Upgrade' check to force re-run if composition metadata is missing.
|
|
4
5
|
*/
|
|
5
6
|
const { normalizeName, DEFINITIVE_EARLIEST_DATES } = require('./utils/utils');
|
|
6
7
|
const { checkRootDataAvailability, checkRootDependencies } = require('./data/AvailabilityChecker');
|
|
@@ -50,6 +51,7 @@ function analyzeDateExecution(dateStr, calcsInPass, rootDataStatus, dailyStatus,
|
|
|
50
51
|
const markRunnable = (isReRun = false, reRunDetails = null) => {
|
|
51
52
|
if (isReRun) report.reRuns.push(reRunDetails);
|
|
52
53
|
else report.runnable.push({ name: cName, ...reRunDetails });
|
|
54
|
+
// Simulate success so dependents can pass their check
|
|
53
55
|
simulationStatus[cName] = { hash: currentHash, category: calc.category, composition: calc.composition };
|
|
54
56
|
};
|
|
55
57
|
|
|
@@ -116,22 +118,17 @@ function analyzeDateExecution(dateStr, calcsInPass, rootDataStatus, dailyStatus,
|
|
|
116
118
|
const newComp = calc.composition;
|
|
117
119
|
|
|
118
120
|
if (oldComp && newComp) {
|
|
119
|
-
// 1. Check Code
|
|
120
121
|
if (oldComp.code !== newComp.code) {
|
|
121
122
|
changeReason = "Code Changed";
|
|
122
123
|
}
|
|
123
|
-
// 2. Check Layers
|
|
124
124
|
else if (JSON.stringify(oldComp.layers) !== JSON.stringify(newComp.layers)) {
|
|
125
|
-
// Find specific layer
|
|
126
125
|
const changedLayers = [];
|
|
127
126
|
for(const lKey in newComp.layers) {
|
|
128
127
|
if (newComp.layers[lKey] !== oldComp.layers[lKey]) changedLayers.push(lKey);
|
|
129
128
|
}
|
|
130
129
|
changeReason = `Layer Update: [${changedLayers.join(', ')}]`;
|
|
131
130
|
}
|
|
132
|
-
// 3. Check Dependencies
|
|
133
131
|
else if (JSON.stringify(oldComp.deps) !== JSON.stringify(newComp.deps)) {
|
|
134
|
-
// Find specific dep
|
|
135
132
|
const changedDeps = [];
|
|
136
133
|
for(const dKey in newComp.deps) {
|
|
137
134
|
if (newComp.deps[dKey] !== oldComp.deps[dKey]) changedDeps.push(dKey);
|
|
@@ -150,12 +147,21 @@ function analyzeDateExecution(dateStr, calcsInPass, rootDataStatus, dailyStatus,
|
|
|
150
147
|
oldHash: storedHash,
|
|
151
148
|
newHash: currentHash,
|
|
152
149
|
previousCategory: migrationOldCategory,
|
|
153
|
-
reason: changeReason
|
|
150
|
+
reason: changeReason
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
153
|
else if (migrationOldCategory) {
|
|
157
154
|
markRunnable(true, { name: cName, reason: 'Category Migration', previousCategory: migrationOldCategory, newCategory: calc.category });
|
|
158
155
|
}
|
|
156
|
+
// [CRITICAL FIX] Audit Upgrade Check: Force re-run if hash matches but composition is missing (Legacy Record)
|
|
157
|
+
else if (!stored.composition) {
|
|
158
|
+
markRunnable(true, {
|
|
159
|
+
name: cName,
|
|
160
|
+
oldHash: storedHash,
|
|
161
|
+
newHash: currentHash,
|
|
162
|
+
reason: 'Audit Upgrade (Populating Composition Metadata)'
|
|
163
|
+
});
|
|
164
|
+
}
|
|
159
165
|
else {
|
|
160
166
|
report.skipped.push({ name: cName });
|
|
161
167
|
simulationStatus[cName] = { hash: currentHash, category: calc.category, composition: calc.composition };
|