@hmharness/domain-ops 0.5.1 → 0.5.3
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/dist/index.js +14 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -136,7 +136,20 @@ export async function scanRadar(opts) {
|
|
|
136
136
|
if (!prevIds.has(item.id))
|
|
137
137
|
newItems.push({ source: src.label, item });
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
// Source freshness guard: HTTP 200 ≠ data is alive (the "dead sentinel"
|
|
140
|
+
// lesson - all four sources returned 200 with data pinned at 2020/2024).
|
|
141
|
+
// Flag any source whose newest item is older than 90 days.
|
|
142
|
+
const newest = items.reduce((max, i) => (i.date > max ? i.date : max), '');
|
|
143
|
+
const staleDays = newest ? Math.floor((Date.now() - new Date(newest).getTime()) / 86400000) : Infinity;
|
|
144
|
+
if (staleDays > 90) {
|
|
145
|
+
sourceStates.push({
|
|
146
|
+
key: src.key, ok: false, count: items.length,
|
|
147
|
+
error: `STALE: newest data ${newest || 'no-date'} is ${Number.isFinite(staleDays) ? staleDays + 'd' : '?'} old (threshold 90d)`,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
sourceStates.push({ key: src.key, ok: true, count: items.length });
|
|
152
|
+
}
|
|
140
153
|
}
|
|
141
154
|
catch (err) {
|
|
142
155
|
// single-source failure never kills the scan
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/domain-ops",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "hmharness ops keeper: ecosystem radar (OpenHarmony release tracking, snapshot diff, model brief with template fallback). Rewrite of the old line's hm-keeper per its captured behavior spec.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"build": "tsc -p tsconfig.build.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hmharness/kernel": "0.5.
|
|
18
|
+
"@hmharness/kernel": "0.5.3"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
|
-
"license": "
|
|
23
|
+
"license": "MIT",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/swsgbl/hmharness.git"
|