fix(health): fold unrecognized surface status into unknown in subnet rollups (#1739)#1961
fix(health): fold unrecognized surface status into unknown in subnet rollups (#1739)#1961minion1227 wants to merge 1 commit into
Conversation
…rollups (JSONbored#1739) rollupSubnetStatus only reads the ok/degraded/failed/unknown buckets, but the status tallies incremented counts[row.status] directly. A status outside those four landed in a stray key (counts.weird) that the rollup ignored, so a subnet whose surfaces were ALL unrecognized had failed===0 && degraded===0 and wrongly rolled up to "ok" — in both the live serve overlay (summarizeRows) and the 15-minute cron health:current snapshot (summarizeGroup). Add a shared tallyStatus helper next to rollupSubnetStatus (the single source of truth for status precedence) that folds any unrecognized status into unknown, and route every status tally through it — summarizeRows, summarizeGroup, and the two run-level diagnostic counts — so the fold can never drift between the prober and the serve path or leak a stray bucket into summary.status_counts. Closes JSONbored#1739
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
left a comment
There was a problem hiding this comment.
Closing this, and I want to be transparent about why.
This account is permanently blocked from contributing to our repositories — for plagiarism. In JSONbored/gittensory you filed two PRs that were copies of another contributor's open work, submitted as your own to claim the credit:
- JSONbored/gittensory#1377 was an identical copy of kiannidev's JSONbored/gittensory#1376 (same source change; tests only reworded to disguise the lift), filed ~90 minutes later against the same issue.
- JSONbored/gittensory#1378 was a byte-identical copy of kiannidev's JSONbored/gittensory#1373, filed ~2 hours later against the same issue.
Lifting another contributor's diff to claim the credit is a hard line for us — two strikes, you're out. Our Code of Conduct states it plainly: plagiarism and reward-farming result in a permanent block from contributing, enforced across JSONbored/gittensory, JSONbored/metagraphed, and JSONbored/awesome-claude.
The block is on the account, not any individual PR, so this isn't a review of the change — it's enforcement of the ban. Closed and labeled slop. This decision is final.
Summary
rollupSubnetStatus— the single source of truth for a subnet's overallstatus — only inspects the four
ok/degraded/failed/unknownbuckets. But every status tally incremented
counts[row.status]directly, so astatus outside those four landed in a stray key (e.g.
counts.weird) that therollup never reads. A subnet whose surfaces were all unrecognized therefore
had
failed === 0 && degraded === 0and wrongly rolled up took— afalse-green in both the live serve overlay (
summarizeRows) and the 15-minutecron
health:currentsnapshot (summarizeGroup), and a stray bucket leakedinto
summary.status_counts.This adds a shared
tallyStatushelper that folds any unrecognized status intounknown, and routes every status tally through it so the fold can never driftbetween the prober and the serve path.
Closes #1739
What Changed
src/health-probe-core.mjs— new exportedtallyStatus(counts, status)helper placed next to
rollupSubnetStatus(keeping the precedence logic andthe tally logic colocated). It increments the matching bucket and folds any
status outside the four known ones into
unknown, guarding withObject.hasOwnso inherited prototype keys (e.g.
"constructor") are treated as unrecognizedrather than matching via the prototype chain.
src/health-prober.mjs— routesummarizeGroup, plus the two run-leveldiagnostic counts in
runHealthProberandpersistToKv, throughtallyStatus.src/health-serving.mjs— routesummarizeRowsthroughtallyStatus.tallyStatusunit suite (known bucket, unrecognized/undefinedfold,
"constructor"prototype-key fold); an end-to-end prober test proving anall-unrecognized subnet rolls up to
unknownwithunknown_count: 2and nostray bucket in
summary.status_counts; and serve-path tests for theall-unrecognized →
unknowncase plus a mixedweird+failedcase provingthe fold never masks a real failure.
Net: 6 files, +91 / −10 — small, surgical source change; the bulk is regression
coverage. No schema, OpenAPI, or generated artifacts touched.
Registry Safety
validator-local state.
behavioral fix only; no schema or response-shape change.)
Validation
npm run checknpm run validatenpm run validate:schemasnpm run validate:apinpm run validate:openapinpm run validate:typesnpm run validate:artifact-budgetsnpm run validate:docsnpm run validate:intakenpm run validate:workflowsnpm run worker:testnpm run test:coveragenpm run scan:public-safetygit diff --check