@mark1russell7/stack-hazards
Hazard cases as reference data. Each case tells the public supplies that it can stop, and the source of each claim. Each cut has a law of the duration of the stop, or no read.
It is an add-on of @mark1russell7/system-stack. It gives the values of CaseCuts of the core, and @mark1russell7/stack-endurance calculates with them. The cases have generic names and codes of an alert taxonomy, for example met.winter.storm. The data names no person and no place.
Each function is a plain function with no clock, no network and no file.
The records
| Record |
What it tells |
SUPPLY_PARTS |
The reference parts: the public supplies that a case can stop, for example power.grid and water.main. Each one is a failure domain of many stacks. |
Source |
A public page or dataset: its URL, its publisher, its license, the date of its last change and the date of the read. |
Claim |
The reason for a cut: a source that tells that the case can stop the part, or the definition of the case. The text is in own words, not a quote. A claim of a source has a basis. |
ClaimBasis |
The basis of a claim of a source. told: what the event does when it happens. assessed: a judgment about the threat itself. |
DurationLaw |
A survival curve of the duration for each region of its source, with its fit. |
NoLaw |
No law is read yet. The cut has no curve, so its draws are no read. |
Hazard |
A case: its code, its name, its cuts and the sources that the dataset examined for it. |
The rules of the data
- A cut is in a case only when a source names it, or when the case is the stop of the part by definition.
- A supply with no cut in a case is no read, not a pass.
supplyState tells it.
- Each cut has a law with its source, its license and its fit, or an explicit no read.
- Each claim of a source has a basis of
CLAIM_BASES. A claim of the definition has no basis, because the definition is its basis.
- A regional law covers each region of its source, not only one chosen region. The region of the user is input data.
- The fits come from
@mark1russell7/rigor-statistics. The fetches of a source go through polite-crawler.
checkHazards is the gate of the rules. It refuses a law with no source or no license, and a law with no curve for a region of its source. It gives a warning for each cut with no law.
The gate refuses a claim of a source with no basis or with a basis that is not in CLAIM_BASES. It also refuses a claim of the definition with a basis. Each of these faults has the code hazards-source.
A first look
import { HAZARD_LIST, hazardCase, hazardOf, supplyState } from "@mark1russell7/stack-hazards";
const storm = hazardOf(HAZARD_LIST, "met.winter.storm");
if (storm !== undefined) {
// The values of CaseCuts, for a stack with its own id of the grid.
const cuts = hazardCase(HAZARD_LIST, storm, { parts: { "power.grid": ["home-power"] } });
console.log(cuts.cuts.map((cut) => cut.part)); // ["home-power", "phone.network", "road.local"]
console.log(supplyState(storm, "water.main")); // { state: "no-read" }
}
The option region gives the region of the user: one region, or one region for each scheme. Each law reads the region with its scheme. The laws of EAGLE-I have the scheme us-state-fips, and the law of a physical attack has the scheme us-nation with the code US. A law with no region of its scheme gives a cut with no curve, which is no read.
const attack = hazardOf(HAZARD_LIST, "infra.power.physical-attack");
if (attack !== undefined) {
// One list of regions: the state laws and the law of the nation in one call.
const region = [
{ scheme: "us-state-fips", code: "37" },
{ scheme: "us-nation", code: "US" },
];
console.log(hazardCase(HAZARD_LIST, attack, { region }).cuts[0]?.duration !== undefined); // true
}
A part of a stack that needs a public supply names a reference id in its needs. Or the option parts maps each reference id to the ids of the stack. An empty list tells that the stack does not have the supply.
Told effects and assessed risks
A told claim and an assessed claim are not equal. The axis is the object of the claim: the effect of the event, or the threat.
told: the source tells what the event does when it happens, as a fact of past events or of physics. A flood washes bridges away.
assessed: the source gives a judgment about the threat itself: the intent of an actor, a prepositioning, or a chance. The advisory AA24-038A assesses that state actors prepare to disrupt four sectors in a conflict.
A source that hedges an effect, for example with the word "potential", is assessed. The record does not make a hedge into a fact.
With the option assessed: "drop", a cut keeps its told claims, its claims of the definition and its law. Its source drops the URLs of the assessed claims.
A cut with only assessed claims stays in the case with no duration and with the sources of its claims. Thus its draws are no read in the shortfall, not 0 user-days. A case with no cut stops no supply, and that is a false pass. supplyState takes the same option and gives the same cut.
const war = hazardOf(HAZARD_LIST, "security.armed-conflict");
if (war !== undefined) {
const cuts = hazardCase(HAZARD_LIST, war, { assessed: "drop" }).cuts;
console.log(cuts.length); // 5
console.log(cuts.filter((cut) => cut.duration === undefined).length); // 5: each cut is no read
}
With no option, or with assessed: "keep", the output is the same as before the option.
Only three sources have assessed claims: the DHS framework for AI, the CISA page on the electromagnetic pulse and the advisory AA24-038A. The CISA page tells only a potential of damage from an attack. Each other claim of a source is told.
The sources
The claims of the cases of 0.1.0 come from the hazard pages of FEMA (Ready.gov) and of the National Weather Service. Each is a work of the United States federal government, in the public domain. The record of each source has the page of its terms of reuse.
The law of the grid cut of a power outage comes from EAGLE-I of Oak Ridge National Laboratory (CC BY 4.0, DOI 10.6084/m9.figshare.24237376). It has one curve for each state, the District of Columbia, Puerto Rico and the US Virgin Islands. The curves are a derived work.
This law is for all causes. The grid cut of each storm case has a law of its own, from the outages that start in a storm event of the case. The law has a source of its own. Its regions are the states with 30 such outages or more. The grid cut of a physical attack has the law of the OE-417 summaries. Each other cut has no law.
The catastrophic cases
Since 0.1.1, the list also has 12 catastrophic cases. The claims of these cases come from pages of FEMA (Ready.gov), of CDC, of CISA and of the Department of Homeland Security. Each is a work of the United States federal government, in the public domain. The advisory AA24-038A also has foreign partners, so its claims are facts in own words, not quotes.
| Code |
Case |
The sources of its cuts |
civic.ai-collapse |
Collapse driven by AI |
The DHS framework for AI in critical infrastructure (2024) |
security.nuclear-war |
Nuclear war |
The CISA page on the electromagnetic pulse, the Ready.gov page on radiation emergencies |
cbrne.nuclear-detonation |
Nuclear detonation |
The Ready.gov page on radiation emergencies |
health.outbreak.pandemic |
Severe pandemic |
No cut: 3 sources read, none names a cut |
infra.power.grid-collapse |
Long collapse of the power grid |
The definition, and the Ready.gov page on power outages |
cyber.infrastructure-attack |
Cyberattack on the infrastructure |
The Ready.gov page on cybersecurity |
infra.supply-chain.food |
Failure of the food supply |
The definition |
civic.economy.collapse |
Financial collapse |
The definition, and the Ready.gov page on financial preparedness |
security.civil-unrest |
Civil unrest |
No cut: 3 sources read, none names a cut |
security.armed-conflict |
War |
The CISA advisory AA24-038A (2024): the energy, communications, transportation, and water and wastewater sectors |
cbrne.emp |
Electromagnetic pulse |
The CISA page on the electromagnetic pulse |
geo.space-weather.geomagnetic-storm |
Solar storm |
The Ready.gov page on space weather |
- A catastrophic case with no cut is a gap, and each of its supplies is no read. For each of these cases, the dataset read sources, and none of them names a cut. For the severe pandemic, the guidelines of CDC name the closure of schools, child care, workplaces and mass gatherings. These are not public supplies. For civil unrest, Ready.gov has no page, and the pages on mass gatherings and on physical security name no cut. The text of FEMA CPG 201 does not have the words civil, riot or unrest.
- No cut of these cases has a law of its duration. No source read gives a law, and a number from no source is not a law. Each cut has a no read with its reason:
| No read |
Its cuts |
The reason |
NO_COLLAPSE_LAW |
The grid cut of a long collapse of the grid |
The event summaries of DOE tell of one such collapse: Puerto Rico after Hurricane Maria in 2017. The OE-417 summary of 2017 has no row of Puerto Rico. The OE-417 summaries give the last restoration of each event, and their long storms are not a collapse. One event gives no law. |
NO_CYBER_LAW |
The grid cut of a cyberattack |
The CISA alert IR-ALERT-H-16-056-01 tells of one grid outage from a cyberattack, in Ukraine in 2015, with no duration. Of the 42 cyber events of the OE-417 summaries, one tells of a loss, with an unknown count of customers. Two events give no law. |
NO_GEOMAGNETIC_LAW |
The grid cut of a solar storm |
The page of NOAA SWPC names three blackouts from space weather. Only one has a duration: 9 hours in Canada in 1989. No type of an event of the OE-417 summaries names a geomagnetic, solar, magnetic or space weather cause. |
NO_FOLLOW_LAW |
The cuts that follow the stop of the grid in a collapse or a solar storm |
The grid cut of the case has no law, and no source read gives a duration of its own. |
NO_EVENT_LAW |
Each other cut |
No source read gives a duration of the cut or a record of its events. |
- The law of EAGLE-I comes from usual outages, so it does not tell the duration of a long collapse of the grid. The early counts of DOE for Puerto Rico are estimates from the load, not counts of customers.
- The OE-417 summaries of DOE have the outages of each cause, cyber events included. The site of DOE did not answer the reads of 2026-11-22 and 2026-11-24. The dataset read the archived copies of the summaries of 2000 to 2023 in the Wayback Machine.
The laws from outage records
These functions make a law of a duration from the records of a source of outages. They do no fetch.
| Function |
What it does |
outageReader(options) |
It reads the counts of the customers out of power in each area at each time of the collection. It gives the events and a tally. |
eagleLine(line), eagleCustomers(text), eagleRegion(area) |
They read a line of an outage file of EAGLE-I, the file of the customers of each county, and the state of a county. |
outageCurves(events, region) |
It gives the Kaplan-Meier curve of the durations of each region, with its counts and its median. |
survivalOf(curve) |
It gives a Kaplan-Meier curve in the form of the core, read at the days of LAW_DAYS, from 15 minutes to 90 days. |