schematex 0.9.6 → 0.9.7

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,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkKH5GRKUM_cjs = require('./chunk-KH5GRKUM.cjs');
3
+ var chunk6X7MVZZT_cjs = require('./chunk-6X7MVZZT.cjs');
4
4
 
5
5
  // src/ai/registry.ts
6
6
  var DIAGRAM_REGISTRY = [
@@ -415,7 +415,7 @@ var DIAGRAM_REGISTRY = [
415
415
  type: "rbd",
416
416
  name: "Reliability Block Diagram (RBD)",
417
417
  tagline: "The success-logic diagram that computes its own system reliability \u2014 series/parallel/k-of-n reduction, Birnbaum importance, and single-point-of-failure detection.",
418
- useWhen: 'Use to model whether a system *works* from the reliability of its components, and to compute the overall figure \u2014 RAMS analysis, redundancy/high-availability design, fault-tolerance trade studies. Header `rbd`; nest `series { \u2026 }`, `parallel { \u2026 }`, and `kofn k/n { \u2026 }` success-logic groups around `block ID "Label" R=0.99` leaves (`p=0.01` failure prob or `R=99%` also accepted). The engine computes system reliability (\u220F for series, 1\u2212\u220F(1\u2212R\u1D62) for parallel, exact k-of-n), the Birnbaum reliability-importance of every block, and flags blocks whose failure alone fails the system (SPOF, drawn in red). Sibling of fault tree (\xA737) in the risk-reliability cluster.',
418
+ useWhen: 'Use to model whether a system *works* from the reliability of its components, and to compute the overall figure \u2014 RAMS analysis, redundancy/high-availability design, fault-tolerance trade studies. Header `rbd`; nest `series { \u2026 }`, `parallel { \u2026 }`, and `kofn k/n { \u2026 }` success-logic groups around `block ID "Label" R=0.99` leaves (`p=0.01` failure prob or `R=99%` also accepted). The engine computes system reliability (\u220F for series, 1\u2212\u220F(1\u2212R\u1D62) for parallel, exact k-of-n), the Birnbaum reliability-importance of every block, and flags blocks whose failure alone fails the system (SPOF, drawn in red). For reliability over a mission, add `mission: <t>` and give blocks a distribution \u2014 `rate=\u03BB`/`mtbf=N` (exponential) or `weibull=\u03B2,\u03B7` \u2014 and the engine evaluates R(t). Sibling of fault tree (\xA737) in the risk-reliability cluster.',
419
419
  cluster: "risk-reliability",
420
420
  standard: "IEC 61078:2016 \xB7 MIL-HDBK-338B; see 50-RBD-STANDARD.md",
421
421
  syntaxKey: "rbd",
@@ -436,7 +436,11 @@ var DIAGRAM_REGISTRY = [
436
436
  "RAMS",
437
437
  "Birnbaum importance",
438
438
  "single point of failure",
439
- "fault tolerance"
439
+ "fault tolerance",
440
+ "MTBF",
441
+ "Weibull",
442
+ "mission time reliability",
443
+ "reliability over time"
440
444
  ]
441
445
  },
442
446
  // ── Systems thinking / stochastic ────────────────────────────
@@ -3609,6 +3613,26 @@ A textbook fly-by-wire architecture, the kind certified under ARP4761: **2-out-o
3609
3613
 
3610
3614
  **The architecture's whole point is a number, and the engine computes it.** Each subsystem is driven so close to 1 that the product still lands at a system reliability of **\u2248 0.999998** \u2014 and Schematex prints the nines rather than rounding to "1", because in this domain the nines *are* the answer. No single point of failure remains, which is exactly the design intent the diagram now proves rather than merely asserts.`
3611
3615
  },
3616
+ {
3617
+ "slug": "rbd-pump-station-mission",
3618
+ "diagram": "rbd",
3619
+ "title": "Pump station reliability over a 1-year mission (R(t))",
3620
+ "description": "A reliability block diagram evaluated at a mission time \u2014 two redundant pumps with exponential (MTBF) and Weibull failure distributions. The engine computes R(t) for each block from its distribution and rolls it up to the system reliability at t = 8760 hours.",
3621
+ "standard": "IEC 61078 (RBD) + IEC 61810 / MIL-HDBK-217 (R(t))",
3622
+ "tags": [
3623
+ "rbd",
3624
+ "reliability",
3625
+ "mission-time",
3626
+ "mtbf",
3627
+ "weibull",
3628
+ "redundancy",
3629
+ "availability"
3630
+ ],
3631
+ "complexity": 3,
3632
+ "featured": false,
3633
+ "dsl": 'rbd "Pump Station \u2014 1-year mission"\n mission: 8760\n series {\n block CTRL "Controller" mtbf=50000\n parallel {\n block A "Pump A" mtbf=10000\n block B "Pump B" weibull=1.5,12000\n }\n }',
3634
+ "notes": "## What this shows\n\nStatic reliabilities are the entry point; real RAMS work is **reliability over a mission**. Here `mission: 8760` (one year in hours) turns each block's failure distribution into an **R(t)**: the controller and Pump A use an exponential model from their **MTBF**, while Pump B uses a **Weibull** (\u03B2 = 1.5, so a gently increasing hazard \u2014 wear-out).\n\n**The engine evaluates R(t) per block and composes it.** Pump A's `e^(\u22128760/10000) \u2248 0.42` and Pump B's `e^(\u2212(8760/12000)^1.5) \u2248 0.54` combine in parallel to \u2248 0.73, then multiply by the controller in series \u2014 the headline reads `R(t=8760) = \u2026`. Change the mission time and every figure, and the importance ranking, recomputes. Constant `R=` blocks still work and mix freely with distributions."
3635
+ },
3612
3636
  {
3613
3637
  "slug": "rbd-redundant-server",
3614
3638
  "diagram": "rbd",
@@ -4588,7 +4612,7 @@ var SYNTAX = {
4588
4612
  },
4589
4613
  "rbd": {
4590
4614
  "title": "Reliability Block Diagram",
4591
- "content": '## 1. Your first diagram\n\nEvery document starts with the `rbd` keyword (alias `reliability`), an optional title, then nested success-logic groups around `block` leaves:\n\n```\nrbd "Two redundant pumps"\n parallel {\n block A "Pump A" R=0.9\n block B "Pump B" R=0.9\n }\n```\n\nThe engine draws the two pumps on parallel rails between a split node and a join node, computes the system reliability `1 \u2212 (1\u22120.9)(1\u22120.9) = 0.99`, and prints it as the headline. A bare top-level list of blocks (no outer group) is treated as a **series** chain.\n\n## 2. Blocks\n\nA `block` is one component on a success path:\n\n```\nblock ID "Label" R=0.99\n```\n\n- `ID` \u2014 a short identifier (shown when no label is given).\n- `"Label"` \u2014 an optional display name (CJK quotes welcome).\n- Reliability is given as **`R=0.99`** (reliability/availability), **`p=0.01`** (probability of *failure*, \u2192 R = 1\u2212p), or a percentage **`R=99%`**. A block with no reliability leaves the system figure symbolic (`n/a`).\n\n## 3. Success-logic groups\n\nGroups nest freely, so you can model redundant chains, voting banks, and standby pairs:\n\n| Group | Succeeds when | Reliability |\n|-------|---------------|-------------|\n| `series { \u2026 }` | **every** child works | \u220F R\u1D62 |\n| `parallel { \u2026 }` | **any** child works | 1 \u2212 \u220F(1 \u2212 R\u1D62) |\n| `kofn k/n { \u2026 }` | **\u2265 k of n** children work | exact state enumeration |\n\n```\nseries {\n block CTRL "Controller" R=0.995\n parallel {\n series { block P1 "Path 1 sensor" R=0.97\n block A1 "Path 1 actuator" R=0.98 }\n series { block P2 "Path 2 sensor" R=0.97\n block A2 "Path 2 actuator" R=0.98 }\n }\n}\n```\n\n## 4. Computed reliability, importance & SPOF\n\nAfter parsing, the engine computes:\n\n- **System reliability** \u2014 the headline figure, by recursive series/parallel/k-of-n reduction.\n- **Birnbaum importance** `I\u1D2E(i) = R_sys(R\u1D62=1) \u2212 R_sys(R\u1D62=0)` for every block; the highest-importance block (the improvement target) is accented.\n- **Single points of failure** \u2014 any block where `R_sys(R\u1D62=0) = 0` (its failure alone fails the system) is drawn with a red border. A non-redundant block in series is always a SPOF.\n\n## 5. Validation\n\nThe parser reports non-fatal warnings rather than failing:\n\n- a `kofn k/n` threshold with `k > n` is clamped to `n` (and `k < 1` to `1`);\n- a reliability outside `0..1` is clamped;\n- a duplicate block id is flagged.\n\n## 6. Theming\n\n`theme: default` uses the shared risk-reliability palette (neutral blocks, blue reliability numerals, red single-point-of-failure borders). `theme: monochrome` renders a black-and-white print version (SPOF by border weight); `theme: dark` is the Catppuccin dark variant.'
4615
+ "content": '## 1. Your first diagram\n\nEvery document starts with the `rbd` keyword (alias `reliability`), an optional title, then nested success-logic groups around `block` leaves:\n\n```\nrbd "Two redundant pumps"\n parallel {\n block A "Pump A" R=0.9\n block B "Pump B" R=0.9\n }\n```\n\nThe engine draws the two pumps on parallel rails between a split node and a join node, computes the system reliability `1 \u2212 (1\u22120.9)(1\u22120.9) = 0.99`, and prints it as the headline. A bare top-level list of blocks (no outer group) is treated as a **series** chain.\n\n## 2. Blocks\n\nA `block` is one component on a success path:\n\n```\nblock ID "Label" R=0.99\n```\n\n- `ID` \u2014 a short identifier (shown when no label is given).\n- `"Label"` \u2014 an optional display name (CJK quotes welcome).\n- Reliability is given as **`R=0.99`** (reliability/availability), **`p=0.01`** (probability of *failure*, \u2192 R = 1\u2212p), or a percentage **`R=99%`**. A block with no reliability leaves the system figure symbolic (`n/a`).\n\n## 3. Success-logic groups\n\nGroups nest freely, so you can model redundant chains, voting banks, and standby pairs:\n\n| Group | Succeeds when | Reliability |\n|-------|---------------|-------------|\n| `series { \u2026 }` | **every** child works | \u220F R\u1D62 |\n| `parallel { \u2026 }` | **any** child works | 1 \u2212 \u220F(1 \u2212 R\u1D62) |\n| `kofn k/n { \u2026 }` | **\u2265 k of n** children work | exact state enumeration |\n\n```\nseries {\n block CTRL "Controller" R=0.995\n parallel {\n series { block P1 "Path 1 sensor" R=0.97\n block A1 "Path 1 actuator" R=0.98 }\n series { block P2 "Path 2 sensor" R=0.97\n block A2 "Path 2 actuator" R=0.98 }\n }\n}\n```\n\n## 4. Computed reliability, importance & SPOF\n\nAfter parsing, the engine computes:\n\n- **System reliability** \u2014 the headline figure, by recursive series/parallel/k-of-n reduction.\n- **Birnbaum importance** `I\u1D2E(i) = R_sys(R\u1D62=1) \u2212 R_sys(R\u1D62=0)` for every block; the highest-importance block (the improvement target) is accented.\n- **Criticality importance** `I_C(i) = I\u1D2E(i)\xB7(1\u2212R\u1D62)/(1\u2212R_sys)` \u2014 the probability block i is failed *and* critical, given the system is failed.\n- **Single points of failure** \u2014 any block where `R_sys(R\u1D62=0) = 0` (its failure alone fails the system) is drawn with a red border. A non-redundant block in series is always a SPOF.\n\n## 5. Time-dependent reliability \u2014 R(t)\n\nA static `R=` is the entry point; in practice reliability is a function of mission time. Set a **`mission: <t>`** and give blocks a failure distribution instead of a constant \u2014 the engine evaluates **R(t)** and rolls it up exactly as before. Use **consistent time units** across `mission` and the rates.\n\n| Block attribute | Model | R(t) |\n|-----------------|-------|------|\n| `rate=0.0001` | exponential (constant hazard \u03BB) | e^(\u2212\u03BBt) |\n| `mtbf=10000` | exponential (\u03BB = 1/MTBF) | e^(\u2212t/MTBF) |\n| `weibull=2,10000` | Weibull(\u03B2 shape, \u03B7 scale) | e^(\u2212(t/\u03B7)^\u03B2) |\n\n```\nrbd "Pump station \u2014 1-year mission"\n mission: 8760 # hours\n parallel {\n block A "Pump A" mtbf=10000\n block B "Pump B" weibull=1.5,12000\n }\n```\n\nThe headline becomes `R(t=8760) = \u2026`. A block with a distribution but no `mission:` warns and falls back to its constant `R=` (if any).\n\n## 6. Validation\n\nThe parser reports non-fatal warnings rather than failing:\n\n- a `kofn k/n` threshold with `k > n` is clamped to `n` (and `k < 1` to `1`);\n- a reliability outside `0..1` is clamped;\n- a duplicate block id is flagged.\n\n## 7. Theming\n\n`theme: default` uses the shared risk-reliability palette (neutral blocks, blue reliability numerals, red single-point-of-failure borders). `theme: monochrome` renders a black-and-white print version (SPOF by border weight); `theme: dark` is the Catppuccin dark variant.'
4592
4616
  }
4593
4617
  };
4594
4618
 
@@ -5861,7 +5885,7 @@ var PROFILES = {
5861
5885
  type: "rbd",
5862
5886
  header: 'rbd "Title"',
5863
5887
  mode: "brace-nested success logic: series/parallel/kofn groups wrapping `block` leaves",
5864
- keywords: 'header: rbd | reliability \xB7 groups: series { \u2026 } | parallel { \u2026 } | kofn k/n { \u2026 } (nestable) \xB7 leaf: block ID "Label" R=0.99 (also p=0.01 failure prob, or R=99%) \xB7 engine computes system reliability + Birnbaum importance + SPOF',
5888
+ keywords: 'header: rbd | reliability \xB7 groups: series { \u2026 } | parallel { \u2026 } | kofn k/n { \u2026 } (nestable) \xB7 leaf: block ID "Label" R=0.99 (also p=0.01 failure prob, R=99%) \xB7 time-dependent: mission: <t> + block rate=\u03BB | mtbf=N | weibull=\u03B2,\u03B7 \u2192 R(t) \xB7 engine computes system reliability + Birnbaum & criticality importance + SPOF',
5865
5889
  forms: [
5866
5890
  'rbd "Redundant Server"',
5867
5891
  "series {",
@@ -5882,7 +5906,8 @@ var PROFILES = {
5882
5906
  "Give every block a reliability: `R=0.99` (or failure prob `p=0.01`, or `R=99%`); the engine then computes system reliability.",
5883
5907
  "Use `parallel { \u2026 }` for full redundancy and `kofn 2/3 { \u2026 }` for k-out-of-n voting redundancy.",
5884
5908
  "Groups nest freely \u2014 e.g. a `parallel` of two `series` strings models redundant chains.",
5885
- "A bare top-level list of blocks (no outer group) is treated as a series chain."
5909
+ "A bare top-level list of blocks (no outer group) is treated as a series chain.",
5910
+ "For reliability over a mission, add `mission: <t>` and give blocks a distribution \u2014 `rate=\u03BB` or `mtbf=N` (exponential) or `weibull=\u03B2,\u03B7` \u2014 and the engine computes R(t); keep mission and rates in the same time units."
5886
5911
  ],
5887
5912
  avoid: [
5888
5913
  "Don't omit the `block` keyword's reliability if you want a number \u2014 a block with no R leaves the system reliability symbolic.",
@@ -6286,7 +6311,7 @@ function getExamples(type, opts = {}) {
6286
6311
  function validateDsl(type, dsl) {
6287
6312
  const resolvedType = type ? resolveDiagramType(type) : void 0;
6288
6313
  const config = type ? { type: resolvedType ?? type } : void 0;
6289
- const result = chunkKH5GRKUM_cjs.parseResult(dsl, config);
6314
+ const result = chunk6X7MVZZT_cjs.parseResult(dsl, config);
6290
6315
  if (result.ok) {
6291
6316
  return {
6292
6317
  ok: true,
@@ -6312,7 +6337,7 @@ function renderDsl(type, dsl, options = {}) {
6312
6337
  ...options,
6313
6338
  ...type ? { type: resolvedType ?? type } : {}
6314
6339
  };
6315
- const result = chunkKH5GRKUM_cjs.renderResult(dsl, config);
6340
+ const result = chunk6X7MVZZT_cjs.renderResult(dsl, config);
6316
6341
  if (result.ok) {
6317
6342
  return {
6318
6343
  ok: true,
@@ -6374,5 +6399,5 @@ exports.listDiagrams = listDiagrams;
6374
6399
  exports.renderDsl = renderDsl;
6375
6400
  exports.resolveDiagramType = resolveDiagramType;
6376
6401
  exports.validateDsl = validateDsl;
6377
- //# sourceMappingURL=chunk-HX64QWB6.cjs.map
6378
- //# sourceMappingURL=chunk-HX64QWB6.cjs.map
6402
+ //# sourceMappingURL=chunk-ECHPMEZX.cjs.map
6403
+ //# sourceMappingURL=chunk-ECHPMEZX.cjs.map