@vessel-dsp/compiler 0.5.0 → 0.6.0

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.
Files changed (77) hide show
  1. package/README.md +4 -2
  2. package/dist/bbd-clock.d.ts.map +1 -1
  3. package/dist/bbd-clock.js +5 -0
  4. package/dist/bbd-clock.js.map +1 -1
  5. package/dist/compile.d.ts.map +1 -1
  6. package/dist/compile.js +261 -12
  7. package/dist/compile.js.map +1 -1
  8. package/dist/device-laws.d.ts.map +1 -1
  9. package/dist/device-laws.js +541 -97
  10. package/dist/device-laws.js.map +1 -1
  11. package/dist/fixtures/circuits.d.ts +23 -2
  12. package/dist/fixtures/circuits.d.ts.map +1 -1
  13. package/dist/fixtures/circuits.js +205 -2
  14. package/dist/fixtures/circuits.js.map +1 -1
  15. package/dist/index.d.ts +2 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/netlist.d.ts +30 -0
  20. package/dist/netlist.d.ts.map +1 -1
  21. package/dist/netlist.js +488 -8
  22. package/dist/netlist.js.map +1 -1
  23. package/dist/part-catalog.d.ts +35 -18
  24. package/dist/part-catalog.d.ts.map +1 -1
  25. package/dist/part-catalog.js +2474 -592
  26. package/dist/part-catalog.js.map +1 -1
  27. package/dist/registry-data/bjt.d.ts +3 -0
  28. package/dist/registry-data/bjt.d.ts.map +1 -0
  29. package/dist/registry-data/bjt.js +1350 -0
  30. package/dist/registry-data/bjt.js.map +1 -0
  31. package/dist/registry-data/charge-pump.d.ts +3 -0
  32. package/dist/registry-data/charge-pump.d.ts.map +1 -0
  33. package/dist/registry-data/charge-pump.js +204 -0
  34. package/dist/registry-data/charge-pump.js.map +1 -0
  35. package/dist/registry-data/diode.d.ts +3 -0
  36. package/dist/registry-data/diode.d.ts.map +1 -0
  37. package/dist/registry-data/diode.js +683 -0
  38. package/dist/registry-data/diode.js.map +1 -0
  39. package/dist/registry-data/index.d.ts +20 -0
  40. package/dist/registry-data/index.d.ts.map +1 -0
  41. package/dist/registry-data/index.js +100 -0
  42. package/dist/registry-data/index.js.map +1 -0
  43. package/dist/registry-data/jfet.d.ts +3 -0
  44. package/dist/registry-data/jfet.d.ts.map +1 -0
  45. package/dist/registry-data/jfet.js +605 -0
  46. package/dist/registry-data/jfet.js.map +1 -0
  47. package/dist/registry-data/loader.d.ts +137 -0
  48. package/dist/registry-data/loader.d.ts.map +1 -0
  49. package/dist/registry-data/loader.js +350 -0
  50. package/dist/registry-data/loader.js.map +1 -0
  51. package/dist/registry-data/mosfet.d.ts +3 -0
  52. package/dist/registry-data/mosfet.d.ts.map +1 -0
  53. package/dist/registry-data/mosfet.js +63 -0
  54. package/dist/registry-data/mosfet.js.map +1 -0
  55. package/dist/registry-data/opamp.d.ts +37 -0
  56. package/dist/registry-data/opamp.d.ts.map +1 -0
  57. package/dist/registry-data/opamp.js +669 -0
  58. package/dist/registry-data/opamp.js.map +1 -0
  59. package/dist/registry-data/regulator.d.ts +3 -0
  60. package/dist/registry-data/regulator.d.ts.map +1 -0
  61. package/dist/registry-data/regulator.js +189 -0
  62. package/dist/registry-data/regulator.js.map +1 -0
  63. package/dist/registry-data/schema.d.ts +56 -0
  64. package/dist/registry-data/schema.d.ts.map +1 -0
  65. package/dist/registry-data/schema.js +142 -0
  66. package/dist/registry-data/schema.js.map +1 -0
  67. package/dist/registry-data/zener.d.ts +3 -0
  68. package/dist/registry-data/zener.d.ts.map +1 -0
  69. package/dist/registry-data/zener.js +547 -0
  70. package/dist/registry-data/zener.js.map +1 -0
  71. package/dist/registry.d.ts +61 -6
  72. package/dist/registry.d.ts.map +1 -1
  73. package/dist/registry.js +35 -7
  74. package/dist/registry.js.map +1 -1
  75. package/dist/types.d.ts +209 -19
  76. package/dist/types.d.ts.map +1 -1
  77. package/package.json +1 -1
@@ -0,0 +1,137 @@
1
+ import { type PartClassName } from "./schema";
2
+ /** Where a cited value came from: printed in a datasheet, derived with the working shown,
3
+ * read directly from a manufacturer-published SPICE/PSpice model file, measured by the
4
+ * owner on the bench (generic LED / diode defaults only, until a measurement JSON exists),
5
+ * or provisional `community` (a published model or measurement by a named author where no
6
+ * better source exists; the compiler names every device that runs on one). */
7
+ export type ParamBasis = "datasheet" | "derived" | "manufacturer-model" | "measured" | "community";
8
+ /** What kind of published source a `community` parameter was taken from. */
9
+ export type CommunitySourceKind = "published-spice-model" | "published-measurement";
10
+ /**
11
+ * One registry parameter: the single number the engine uses, with its provenance.
12
+ * A datasheet's printed limits are never stored as fields; where they were used to derive
13
+ * the value they are quoted in `derivation` (zener typ from a min/max row) or the value is
14
+ * the printed TYP transcribed with its row quoted in `source` (op-amp gain-bandwidth).
15
+ * A `manufacturer-model` parameter is read directly from the manufacturer's own model
16
+ * file: `modelFileUrl` is that file's URL (one of the eight publishing manufacturers'
17
+ * own hosts) and `modelLine` is the exact model line the value was read from, verbatim
18
+ * as printed -- a `.MODEL` / `.SUBCKT` card (with its continuation lines) from a model
19
+ * file, or a Microsim-style `NPN (...)` line from the manufacturer's own datasheet --
20
+ * both quoted in `source` as well.
21
+ * A `measured` parameter is the owner's own bench value: `measurementInstrument` names
22
+ * the meter, `measurementConditions` states the supply, resistors and temperature,
23
+ * `measurementSampleCount` counts the pooled samples, `measurementDate` is the sitting
24
+ * date (YYYY-MM-DD), and `measurementEvidencePath` plus `measurementEvidenceSha256`
25
+ * point at the committed measurement JSON (repo-relative path, sha256 of the file) --
26
+ * both quoted in `source` as well. The JSON schema is
27
+ * `vesseldsp.junction-default-measurement.v1` (`perDevice` entries with `isEngine`,
28
+ * `nEngine`, `samples`, pooled over every sample, already referred to the engine's
29
+ * thermal voltage 0.025852 V); see `led-measurement.html` and its README.
30
+ * A `community` parameter is provisional (decided 2026-10-19, option B): where no
31
+ * datasheet, manufacturer model or owner measurement exists, a parameter may be taken
32
+ * from a published source found online -- a published SPICE model, or a published
33
+ * measurement by a named author. The record carries `sourceKind` (which of the two),
34
+ * `url` (the http(s) address where the source can be read), `quote` (verbatim text
35
+ * carrying the value), `author` (a named person or organisation, never "forum"),
36
+ * `retrievedDate` (the sitting date, YYYY-MM-DD), and `whyNoBetterSource` (what was
37
+ * searched: datasheet, manufacturer model, owner bench). An unattributed or
38
+ * unverifiable number is not admitted. It is provisional: adding a datasheet,
39
+ * manufacturer-model or measured record for the same parameter of the same part throws
40
+ * until the community record is removed, and the compiler names every device that runs
41
+ * on one (`registry-provisional-value`). An original-manufacturer datasheet hosted on
42
+ * a third-party site (a scan of a Mullard, Philips, Hitachi, Toshiba or Rohm sheet) is
43
+ * still `datasheet`, not `community`.
44
+ */
45
+ export type CitedParam = {
46
+ /** The single number the engine uses. Must be finite. */
47
+ readonly value: number;
48
+ readonly basis: ParamBasis;
49
+ /** The citation: datasheet document, page and row, or the actual provenance chain. */
50
+ readonly source: string;
51
+ /** Required when `basis` is `derived`: the working, written so it can be checked. */
52
+ readonly derivation?: string;
53
+ /** Required when `basis` is `manufacturer-model`: the manufacturer model file's URL. */
54
+ readonly modelFileUrl?: string;
55
+ /** Required when `basis` is `manufacturer-model`: the exact `.MODEL` / `.SUBCKT` line. */
56
+ readonly modelLine?: string;
57
+ /** Required when `basis` is `measured`: the meter (make/model). */
58
+ readonly measurementInstrument?: string;
59
+ /** Required when `basis` is `measured`: supply, resistors, temperature. */
60
+ readonly measurementConditions?: string;
61
+ /** Required when `basis` is `measured`: pooled sample count (>= 1, integer). */
62
+ readonly measurementSampleCount?: number;
63
+ /** Required when `basis` is `measured`: sitting date, YYYY-MM-DD. */
64
+ readonly measurementDate?: string;
65
+ /** Required when `basis` is `measured`: repo-relative path of the measurement JSON. */
66
+ readonly measurementEvidencePath?: string;
67
+ /** Required when `basis` is `measured`: lowercase hex sha256 of the measurement JSON. */
68
+ readonly measurementEvidenceSha256?: string;
69
+ /** Required when `basis` is `community`: which published kind the value was taken from. */
70
+ readonly sourceKind?: CommunitySourceKind;
71
+ /** Required when `basis` is `community`: the http(s) URL where the source can be read. */
72
+ readonly url?: string;
73
+ /** Required when `basis` is `community`: verbatim text carrying the value. */
74
+ readonly quote?: string;
75
+ /** Required when `basis` is `community`: the named person or organisation behind it. */
76
+ readonly author?: string;
77
+ /** Required when `basis` is `community`: the retrieval date, YYYY-MM-DD. */
78
+ readonly retrievedDate?: string;
79
+ /** Required when `basis` is `community`: what was searched and why no better source exists. */
80
+ readonly whyNoBetterSource?: string;
81
+ };
82
+ /**
83
+ * One part's parameters, as data.
84
+ *
85
+ * Bin and package spellings are typed explicitly -- every spelling is a listed string,
86
+ * never a pattern: `partIds` holds the canonical ids and `aliases` the bin/package
87
+ * spellings that resolve to them. Both are matched whole and case-folded, and both share
88
+ * one uniqueness scope: an alias may not collide with any other entry's id or alias.
89
+ * Stage-1 data keeps each row's spellings exactly as the pre-registry catalog listed them
90
+ * (all in `partIds`); `aliases` is validated and available for stage 3's bin splits.
91
+ */
92
+ export type PartDataEntry = {
93
+ readonly partIds: readonly string[];
94
+ readonly aliases?: readonly string[];
95
+ readonly class: PartClassName;
96
+ readonly params: Readonly<Record<string, CitedParam>>;
97
+ /** Provenance disclosures that are not a parameter: stand-ins, exceptions, caveats. */
98
+ readonly note?: string;
99
+ };
100
+ /** Validate one cited value. Returns it unchanged; throws naming the entry and parameter. */
101
+ export declare function validateCitedParam(entryLabel: string, name: string, param: CitedParam): CitedParam;
102
+ /**
103
+ * Validate a list of entries and freeze it. Throws at module load on any violation:
104
+ * unknown class, unknown parameter name for the class, uncited parameter, or a folded
105
+ * id claimed by two entries in this list. Cross-list collisions are `assemblePartData`'s
106
+ * beat.
107
+ *
108
+ * Two spellings in the SAME entry that fold to one id (`RD5.6JB2`, `RD5.6J B2`,
109
+ * `RD5.6J-B2`) are redundant, not conflicting: the pre-registry catalog lists every
110
+ * observed spelling explicitly, and the matcher folds them anyway. Only two entries
111
+ * claiming one id is a wrong answer about somebody's part.
112
+ */
113
+ export declare function definePartData(entries: readonly PartDataEntry[]): readonly PartDataEntry[];
114
+ /**
115
+ * Assemble the per-class lists into the one registry data set. Throws when an id or
116
+ * alias in one list collides with another list's -- an alias that collides with another
117
+ * entry is a wrong answer about somebody's part, so it refuses rather than shadowing.
118
+ */
119
+ export declare function assemblePartData(lists: readonly (readonly PartDataEntry[])[]): readonly PartDataEntry[];
120
+ /** Find an entry by exact folded id or alias. Whole folded id only; no prefix or family rule. */
121
+ export declare function findPartData(data: readonly PartDataEntry[], partId: string): PartDataEntry | null;
122
+ /**
123
+ * One provisional parameter: the registry parameter name and the community source URL
124
+ * the entry's value was taken from. The compiler stamps these onto `PartEntry` so a
125
+ * compiled device that runs on one can be named (`registry-provisional-value`) without
126
+ * the compiler importing any part data.
127
+ */
128
+ export type CommunityProvenance = {
129
+ readonly name: string;
130
+ readonly url: string;
131
+ };
132
+ /**
133
+ * Every `community`-basis parameter in the record, with its source URL. Empty when the
134
+ * record holds none. The loader guarantees every community parameter carries a URL.
135
+ */
136
+ export declare function communityProvenanceOf(record: PartDataEntry): readonly CommunityProvenance[];
137
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/registry-data/loader.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAgCpF;;;;8EAI8E;AAC9E,MAAM,MAAM,UAAU,GACnB,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,UAAU,GACV,WAAW,CAAC;AAEf,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAC5B,uBAAuB,GACvB,uBAAuB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAq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QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IACtD,uFAAuF;IACvF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,6FAA6F;AAC7F,wBAAgB,kBAAkB,CACjC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,GACf,UAAU,CAyOZ;AA8BD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,SAAS,aAAa,EAAE,GAC/B,SAAS,aAAa,EAAE,CAiD1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,SAAS,CAAC,SAAS,aAAa,EAAE,CAAC,EAAE,GAC1C,SAAS,aAAa,EAAE,CA8B1B;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAC3B,IAAI,EAAE,SAAS,aAAa,EAAE,EAC9B,MAAM,EAAE,MAAM,GACZ,aAAa,GAAG,IAAI,CAQtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,aAAa,GACnB,SAAS,mBAAmB,EAAE,CAYhC"}
@@ -0,0 +1,350 @@
1
+ // The data-registry loader: cited parameters in, validated entries out, loudly.
2
+ //
3
+ // Every parameter is `{ value, basis, source }`: `value` is the single number the engine
4
+ // uses, `basis` says where it came from (`datasheet`, printed as a typical or point value;
5
+ // `derived`, with the derivation written out; `manufacturer-model`, read directly from a
6
+ // manufacturer-published SPICE/PSpice model file; `measured`, the owner's bench value;
7
+ // `community`, a published SPICE model or published measurement by a named author where
8
+ // no better source exists), and `source` is the citation. An uncited
9
+ // value is not loadable -- the loader throws, at module load, on:
10
+ //
11
+ // - a parameter missing `source` or `basis`;
12
+ // - a `derived` basis with no derivation text;
13
+ // - a `manufacturer-model` basis without the manufacturer model file URL and the exact
14
+ // model line it was read from (both required, validated, and quoted in `source`);
15
+ // the line is verbatim as the manufacturer printed it: a `.MODEL` / `.SUBCKT` card
16
+ // (with its continuation lines) from a model file, or a Microsim-style `NPN (...)`
17
+ // line from the manufacturer's own datasheet (clarified 2026-10-19: a model the
18
+ // manufacturer prints inside its datasheet is manufacturer-published);
19
+ // - a `measured` basis without the owner's bench record (instrument, conditions,
20
+ // sample count, date, evidence path plus sha256 -- every field required, validated,
21
+ // and the evidence path and sha256 quoted in `source`);
22
+ // - a `community` basis without the provisional record (source kind, http(s) URL,
23
+ // verbatim quote, named author, ISO retrieval date, why-no-better-source -- every
24
+ // field required, validated, and the URL and quote quoted in `source`);
25
+ // - a part id whose `community` parameter clashes with a non-community record for the
26
+ // SAME parameter (adding a datasheet, manufacturer model or measured value forces
27
+ // the community record out rather than sitting beside it);
28
+ // - model file/line fields on any other basis;
29
+ // - a model file URL outside the manufacturer's own hosts (third-party libraries,
30
+ // mirrors, forums and aggregators are not manufacturer models, even when the text
31
+ // they carry is manufacturer-authored);
32
+ // - measured fields on any other basis;
33
+ // - community fields on any other basis;
34
+ // - model file/line fields on any other basis;
35
+ // - a parameter name that is not in the class schema;
36
+ // - a duplicate part id or alias (folded, across the whole assembled set);
37
+ // - an alias that collides with another entry (an id or another alias).
38
+ //
39
+ // The loader validates *shape and provenance*, never electrical plausibility: a finite
40
+ // 0.35 V pump loss and a finite 30 V zener both load, and the stamping path keeps its own
41
+ // loud checks (a half-stated swing pair still throws in `withDatasheetOutputSwing`).
42
+ // A third-party model library (LTspice's standard files, Tina, a forum) is NOT a
43
+ // manufacturer model and is not admitted: the file URL must be the manufacturer's own
44
+ // publication (onsemi, Vishay, STMicroelectronics, Nexperia, Diodes Inc, TI, Analog Devices,
45
+ // Central Semiconductor).
46
+ import { foldPartId } from "../registry.js";
47
+ import { CLASS_PARAM_SCHEMAS, classParamNames } from "./schema.js";
48
+ /**
49
+ * Manufacturer hosts a `manufacturer-model` file URL may live on. The file must be the
50
+ * manufacturer's own publication: a model text carried by a third-party library, mirror,
51
+ * forum or aggregator is not a manufacturer model even when the text is
52
+ * manufacturer-authored. Matched by domain suffix, so `www.` and asset subdomains pass.
53
+ */
54
+ const MANUFACTURER_MODEL_HOSTS = [
55
+ "onsemi.com",
56
+ "vishay.com",
57
+ "st.com",
58
+ "nexperia.com",
59
+ "diodes.com",
60
+ "ti.com",
61
+ "analog.com",
62
+ "centralsemi.com",
63
+ ];
64
+ /** True when the URL's host belongs to one of the eight publishing manufacturers. */
65
+ function isManufacturerModelHost(url) {
66
+ let host = "";
67
+ try {
68
+ host = new URL(url).hostname.toLowerCase();
69
+ }
70
+ catch {
71
+ return false;
72
+ }
73
+ return MANUFACTURER_MODEL_HOSTS.some((suffix) => host === suffix || host.endsWith(`.${suffix}`));
74
+ }
75
+ /** Validate one cited value. Returns it unchanged; throws naming the entry and parameter. */
76
+ export function validateCitedParam(entryLabel, name, param) {
77
+ if (param.basis !== "datasheet" &&
78
+ param.basis !== "derived" &&
79
+ param.basis !== "manufacturer-model" &&
80
+ param.basis !== "measured" &&
81
+ param.basis !== "community") {
82
+ throw new Error(`${entryLabel}: parameter "${name}" has no basis: expected "datasheet", "derived", "manufacturer-model", "measured" or "community"`);
83
+ }
84
+ if (typeof param.value !== "number" || !Number.isFinite(param.value)) {
85
+ throw new Error(`${entryLabel}: parameter "${name}" has no finite value: ${String(param.value)}`);
86
+ }
87
+ if (typeof param.source !== "string" || param.source.length === 0) {
88
+ throw new Error(`${entryLabel}: parameter "${name}" is missing its source citation`);
89
+ }
90
+ if (param.basis === "derived" &&
91
+ (typeof param.derivation !== "string" || param.derivation.length === 0)) {
92
+ throw new Error(`${entryLabel}: parameter "${name}" has a derived basis with no derivation text`);
93
+ }
94
+ if (param.basis === "manufacturer-model") {
95
+ if (typeof param.modelFileUrl !== "string" ||
96
+ param.modelFileUrl.length === 0) {
97
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis with no model file URL`);
98
+ }
99
+ if (!/^https?:\/\//u.test(param.modelFileUrl) ||
100
+ /\s/u.test(param.modelFileUrl)) {
101
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis with a model file that is not an http(s) URL: ${param.modelFileUrl}`);
102
+ }
103
+ if (!isManufacturerModelHost(param.modelFileUrl)) {
104
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis with a model file outside the manufacturer's own hosts: ${param.modelFileUrl}`);
105
+ }
106
+ if (typeof param.modelLine !== "string" || param.modelLine.length === 0) {
107
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis with no model line`);
108
+ }
109
+ if (!param.source.includes(param.modelFileUrl)) {
110
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis whose source does not quote the model file URL`);
111
+ }
112
+ if (!param.source.includes(param.modelLine.trim())) {
113
+ throw new Error(`${entryLabel}: parameter "${name}" has a manufacturer-model basis whose source does not quote the model line`);
114
+ }
115
+ }
116
+ else {
117
+ if (param.modelFileUrl !== undefined || param.modelLine !== undefined) {
118
+ throw new Error(`${entryLabel}: parameter "${name}" states a model file/line on a "${param.basis}" basis (manufacturer-model only)`);
119
+ }
120
+ }
121
+ if (param.basis === "measured") {
122
+ if (typeof param.measurementInstrument !== "string" ||
123
+ param.measurementInstrument.length === 0) {
124
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no instrument`);
125
+ }
126
+ if (typeof param.measurementConditions !== "string" ||
127
+ param.measurementConditions.length === 0) {
128
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no conditions (supply, resistors, temperature)`);
129
+ }
130
+ if (typeof param.measurementSampleCount !== "number" ||
131
+ !Number.isInteger(param.measurementSampleCount) ||
132
+ param.measurementSampleCount < 1) {
133
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no sample count (integer >= 1): ${String(param.measurementSampleCount)}`);
134
+ }
135
+ if (typeof param.measurementDate !== "string" ||
136
+ !/^\d{4}-\d{2}-\d{2}$/u.test(param.measurementDate) ||
137
+ Number.isNaN(Date.parse(`${param.measurementDate}T00:00:00Z`))) {
138
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no date (YYYY-MM-DD): ${String(param.measurementDate)}`);
139
+ }
140
+ if (typeof param.measurementEvidencePath !== "string" ||
141
+ param.measurementEvidencePath.length === 0) {
142
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no evidence path`);
143
+ }
144
+ if (param.measurementEvidencePath.startsWith("/") ||
145
+ param.measurementEvidencePath.includes("..") ||
146
+ !param.measurementEvidencePath.endsWith(".json")) {
147
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with an evidence path that is not a repo-relative JSON path: ${param.measurementEvidencePath}`);
148
+ }
149
+ if (typeof param.measurementEvidenceSha256 !== "string" ||
150
+ !/^[0-9a-f]{64}$/u.test(param.measurementEvidenceSha256)) {
151
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis with no evidence sha256 (64 lowercase hex): ${String(param.measurementEvidenceSha256)}`);
152
+ }
153
+ if (!param.source.includes(param.measurementEvidencePath)) {
154
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis whose source does not quote the evidence path`);
155
+ }
156
+ if (!param.source.includes(param.measurementEvidenceSha256)) {
157
+ throw new Error(`${entryLabel}: parameter "${name}" has a measured basis whose source does not quote the evidence sha256`);
158
+ }
159
+ }
160
+ else {
161
+ if (param.measurementInstrument !== undefined ||
162
+ param.measurementConditions !== undefined ||
163
+ param.measurementSampleCount !== undefined ||
164
+ param.measurementDate !== undefined ||
165
+ param.measurementEvidencePath !== undefined ||
166
+ param.measurementEvidenceSha256 !== undefined) {
167
+ throw new Error(`${entryLabel}: parameter "${name}" states measured fields on a "${param.basis}" basis (measured only)`);
168
+ }
169
+ }
170
+ if (param.basis === "community") {
171
+ if (param.sourceKind !== "published-spice-model" &&
172
+ param.sourceKind !== "published-measurement") {
173
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no sourceKind: expected "published-spice-model" or "published-measurement"`);
174
+ }
175
+ if (typeof param.url !== "string" ||
176
+ param.url.length === 0 ||
177
+ !/^https?:\/\//u.test(param.url) ||
178
+ /\s/u.test(param.url)) {
179
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no URL (http(s), no whitespace): ${String(param.url)}`);
180
+ }
181
+ if (typeof param.quote !== "string" || param.quote.trim().length === 0) {
182
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no verbatim quote`);
183
+ }
184
+ if (typeof param.author !== "string" ||
185
+ param.author.trim().length === 0 ||
186
+ param.author.trim().toLowerCase() === "forum") {
187
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no named author (a person or organisation, never "forum"): ${String(param.author)}`);
188
+ }
189
+ if (typeof param.retrievedDate !== "string" ||
190
+ !/^\d{4}-\d{2}-\d{2}$/u.test(param.retrievedDate) ||
191
+ Number.isNaN(Date.parse(`${param.retrievedDate}T00:00:00Z`))) {
192
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no retrieval date (YYYY-MM-DD): ${String(param.retrievedDate)}`);
193
+ }
194
+ if (typeof param.whyNoBetterSource !== "string" ||
195
+ param.whyNoBetterSource.trim().length === 0) {
196
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis with no whyNoBetterSource (what was searched)`);
197
+ }
198
+ if (!param.source.includes(param.url)) {
199
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis whose source does not quote the URL`);
200
+ }
201
+ if (!param.source.includes(param.quote.trim())) {
202
+ throw new Error(`${entryLabel}: parameter "${name}" has a community basis whose source does not quote the verbatim text`);
203
+ }
204
+ }
205
+ else {
206
+ if (param.sourceKind !== undefined ||
207
+ param.url !== undefined ||
208
+ param.quote !== undefined ||
209
+ param.author !== undefined ||
210
+ param.retrievedDate !== undefined ||
211
+ param.whyNoBetterSource !== undefined) {
212
+ throw new Error(`${entryLabel}: parameter "${name}" states community fields on a "${param.basis}" basis (community only)`);
213
+ }
214
+ }
215
+ return param;
216
+ }
217
+ /** The folded id scope of one entry: canonical ids plus aliases, in listing order. */
218
+ function entryIds(entry) {
219
+ return [...entry.partIds, ...(entry.aliases ?? [])];
220
+ }
221
+ /**
222
+ * The community clash: the same parameter of one part recorded once from a provisional
223
+ * `community` source and once from a better source. Adding the datasheet, manufacturer
224
+ * model or measured record forces the community record out rather than sitting beside
225
+ * it, so the pair throws. Returns the clashing parameter name, or null.
226
+ */
227
+ function communityClash(a, b) {
228
+ for (const name of Object.keys(a.params)) {
229
+ const pa = a.params[name];
230
+ const pb = b.params[name];
231
+ if (pa === undefined || pb === undefined)
232
+ continue;
233
+ if ((pa.basis === "community") !== (pb.basis === "community")) {
234
+ return name;
235
+ }
236
+ }
237
+ return null;
238
+ }
239
+ /**
240
+ * Validate a list of entries and freeze it. Throws at module load on any violation:
241
+ * unknown class, unknown parameter name for the class, uncited parameter, or a folded
242
+ * id claimed by two entries in this list. Cross-list collisions are `assemblePartData`'s
243
+ * beat.
244
+ *
245
+ * Two spellings in the SAME entry that fold to one id (`RD5.6JB2`, `RD5.6J B2`,
246
+ * `RD5.6J-B2`) are redundant, not conflicting: the pre-registry catalog lists every
247
+ * observed spelling explicitly, and the matcher folds them anyway. Only two entries
248
+ * claiming one id is a wrong answer about somebody's part.
249
+ */
250
+ export function definePartData(entries) {
251
+ const seen = new Map();
252
+ for (const entry of entries) {
253
+ const label = entry.partIds.join(",") || "(no part ids)";
254
+ if (!(entry.class in CLASS_PARAM_SCHEMAS)) {
255
+ throw new Error(`${label}: unknown part class "${entry.class}"`);
256
+ }
257
+ const allowed = new Set(classParamNames(entry.class));
258
+ for (const [name, param] of Object.entries(entry.params)) {
259
+ if (!allowed.has(name)) {
260
+ throw new Error(`${label}: unknown parameter "${name}" for class "${entry.class}" ` +
261
+ `(accepted: ${[...allowed].join(", ")})`);
262
+ }
263
+ validateCitedParam(label, name, param);
264
+ }
265
+ const ids = entryIds(entry);
266
+ if (ids.length === 0) {
267
+ throw new Error(`${label}: an entry names no part ids`);
268
+ }
269
+ // Within-entry folded duplicates are redundant spellings, not a conflict (see above).
270
+ const foldedHere = new Set();
271
+ for (const id of ids) {
272
+ if (typeof id !== "string" || id.length === 0) {
273
+ throw new Error(`${label}: an entry lists an empty part id or alias`);
274
+ }
275
+ foldedHere.add(foldPartId(id));
276
+ }
277
+ for (const folded of foldedHere) {
278
+ const first = seen.get(folded);
279
+ if (first !== undefined) {
280
+ const clash = communityClash(first.entry, entry);
281
+ if (clash !== null) {
282
+ throw new Error(`${label}: duplicate part id or alias (already listed on ${first.label}) -- ` +
283
+ `a community record for parameter "${clash}" clashes with a non-community ` +
284
+ `record for the same parameter (adding a datasheet, manufacturer-model or ` +
285
+ `measured value forces the community record out)`);
286
+ }
287
+ throw new Error(`${label}: duplicate part id or alias (already listed on ${first.label})`);
288
+ }
289
+ seen.set(folded, { label, entry });
290
+ }
291
+ }
292
+ return Object.freeze(entries.map((entry) => Object.freeze(entry)));
293
+ }
294
+ /**
295
+ * Assemble the per-class lists into the one registry data set. Throws when an id or
296
+ * alias in one list collides with another list's -- an alias that collides with another
297
+ * entry is a wrong answer about somebody's part, so it refuses rather than shadowing.
298
+ */
299
+ export function assemblePartData(lists) {
300
+ const seen = new Map();
301
+ for (const list of lists) {
302
+ for (const entry of list) {
303
+ const label = entry.partIds.join(",") || "(no part ids)";
304
+ // Same within-entry tolerance as `definePartData`: redundant spellings, one entry.
305
+ const foldedHere = new Set(entryIds(entry).map((id) => foldPartId(id)));
306
+ for (const folded of foldedHere) {
307
+ const first = seen.get(folded);
308
+ if (first !== undefined) {
309
+ const clash = communityClash(first.entry, entry);
310
+ if (clash !== null) {
311
+ throw new Error(`${label}: part id or alias collides with another entry (${first.label}) -- ` +
312
+ `a community record for parameter "${clash}" clashes with a non-community ` +
313
+ `record for the same parameter (adding a datasheet, manufacturer-model or ` +
314
+ `measured value forces the community record out)`);
315
+ }
316
+ throw new Error(`${label}: part id or alias collides with another entry (${first.label})`);
317
+ }
318
+ seen.set(folded, { label, entry });
319
+ }
320
+ }
321
+ }
322
+ return Object.freeze(lists.flat());
323
+ }
324
+ /** Find an entry by exact folded id or alias. Whole folded id only; no prefix or family rule. */
325
+ export function findPartData(data, partId) {
326
+ const folded = foldPartId(partId);
327
+ for (const entry of data) {
328
+ if (entryIds(entry).some((id) => foldPartId(id) === folded)) {
329
+ return entry;
330
+ }
331
+ }
332
+ return null;
333
+ }
334
+ /**
335
+ * Every `community`-basis parameter in the record, with its source URL. Empty when the
336
+ * record holds none. The loader guarantees every community parameter carries a URL.
337
+ */
338
+ export function communityProvenanceOf(record) {
339
+ const out = [];
340
+ for (const [name, param] of Object.entries(record.params)) {
341
+ if (param.basis !== "community")
342
+ continue;
343
+ if (typeof param.url !== "string" || param.url.length === 0) {
344
+ throw new Error(`${record.partIds.join(",")}: community parameter "${name}" carries no URL`);
345
+ }
346
+ out.push({ name, url: param.url });
347
+ }
348
+ return out;
349
+ }
350
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/registry-data/loader.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,yFAAyF;AACzF,2FAA2F;AAC3F,yFAAyF;AACzF,uFAAuF;AACvF,wFAAwF;AACxF,qEAAqE;AACrE,kEAAkE;AAClE,EAAE;AACF,6CAA6C;AAC7C,+CAA+C;AAC/C,uFAAuF;AACvF,oFAAoF;AACpF,qFAAqF;AACrF,qFAAqF;AACrF,kFAAkF;AAClF,yEAAyE;AACzE,iFAAiF;AACjF,sFAAsF;AACtF,0DAA0D;AAC1D,kFAAkF;AAClF,oFAAoF;AACpF,0EAA0E;AAC1E,sFAAsF;AACtF,oFAAoF;AACpF,6DAA6D;AAC7D,+CAA+C;AAC/C,kFAAkF;AAClF,oFAAoF;AACpF,0CAA0C;AAC1C,wCAAwC;AACxC,yCAAyC;AACzC,+C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AC3E,CAAC;QACH,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type PartDataEntry } from "./loader";
2
+ export declare const mosfetRegistryRecords: readonly PartDataEntry[];
3
+ //# sourceMappingURL=mosfet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mosfet.d.ts","sourceRoot":"","sources":["../../src/registry-data/mosfet.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,SAAS,aAAa,EAuCxD,CAAC"}
@@ -0,0 +1,63 @@
1
+ // MOSFET registry data: wave-1 discrete fill.
2
+ //
3
+ // One value per parameter; a parameter with no datasheet citation is not loadable, so it
4
+ // is omitted here and the stamp falls back to the class default (never a guess):
5
+ //
6
+ // - `thresholdVolts`: a printed VGS(th) bin or range becomes one value by its midpoint
7
+ // (form 2, arithmetic -- a threshold is not a gain). A MIN-only VGS(th) with no MAX is a
8
+ // limit, not a range, and yields nothing.
9
+ // - `transconductance`: the square-law Beta is NOT derived from gfs here -- gfs is a
10
+ // small-signal figure at one bias, a different quantity. Only a printed TYP gfs stated as
11
+ // the part's transconductance transcribes directly (basis `datasheet`); a MIN-only gfs
12
+ // yields nothing.
13
+ // - `channelLengthModulation`, `subthresholdVolts`, gate terms: omitted for every part below.
14
+ // No sheet in this wave prints lambda, and the insulated gate draws no current by
15
+ // construction (gate zeros stand).
16
+ //
17
+ // This module starts empty: no vendored MOSFET sheet exists in the artifacts library, and the
18
+ // fetched sheets land here as they are verified. See the wave-1 report for the per-part
19
+ // verdicts.
20
+ //
21
+ // NOTE (method gap for later waves): a printed gfs/Yfs -- even TYP -- is a small-signal
22
+ // transconductance at one bias, NOT the square-law Beta the shared `fet` law wants
23
+ // (`current = beta * drive^2`). Converting one to the other needs the bias point, which is
24
+ // a fifth derived form the owner has not approved, so gfs never transcribes here even when
25
+ // printed. BS170 and 2N7000 therefore carry thresholdVolts only.
26
+ import { definePartData } from "./loader.js";
27
+ export const mosfetRegistryRecords = definePartData([
28
+ {
29
+ // transconductance omitted: the sheet's gfs TYP 200 mmhos at VDS = 10 V, ID = 250 mA
30
+ // is small-signal gm at one bias, not square-law Beta (see module note).
31
+ partIds: ["BS170"],
32
+ class: "mosfet",
33
+ params: {
34
+ thresholdVolts: {
35
+ value: 2.0,
36
+ basis: "datasheet",
37
+ source: "Fetched manufacturer sheet (no vendored copy): onsemi BS170/D, Nov 2017 Rev. 7, p2, ON " +
38
+ "CHARACTERISTICS (Note 1: pulse test): 'Gate Threshold Voltage VGS(th), VDS = VGS, " +
39
+ "ID = 1.0 mA: MIN 0.8 TYP 2.0 MAX 3.0 V'",
40
+ derivation: "Printed VGS(th) TYP 2.0 V at VDS = VGS, ID = 1.0 mA, transcribed (no midpoint: a " +
41
+ "TYP is already one value). The range midpoint would be 1.9; the printed TYP wins.",
42
+ },
43
+ },
44
+ },
45
+ {
46
+ // transconductance omitted: the sheet's gfs is MIN-only 100 mS (a limit, not a value)
47
+ // and in any case small-signal gm, not square-law Beta (see module note).
48
+ partIds: ["2N7000"],
49
+ class: "mosfet",
50
+ params: {
51
+ thresholdVolts: {
52
+ value: 1.9,
53
+ basis: "derived",
54
+ source: "Fetched manufacturer sheet (no vendored copy): Zetex 2N7000 (now Diodes Inc), Issue 2 " +
55
+ "Nov 1994, p1 table: 'Gate-Source Threshold Voltage VGS(th), ID = 1 mA, VDS = VGS: " +
56
+ "MIN 0.8 MAX 3.0 V' (no TYP)",
57
+ derivation: "Printed VGS(th) range 0.8-3.0 V at ID = 1 mA; arithmetic midpoint (form 2, a " +
58
+ "threshold is not a gain): (0.8 + 3.0) / 2 = 1.9 V.",
59
+ },
60
+ },
61
+ },
62
+ ]);
63
+ //# sourceMappingURL=mosfet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mosfet.js","sourceRoot":"","sources":["../../src/registry-data/mosfet.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,yFAAyF;AACzF,iFAAiF;AACjF,EAAE;AACF,uFAAuF;AACvF,2FAA2F;AAC3F,4CAA4C;AAC5C,qFAAqF;AACrF,4FAA4F;AAC5F,yFAAyF;AACzF,oBAAoB;AACpB,8FAA8F;AAC9F,oFAAoF;AACpF,qCAAqC;AACrC,EAAE;AACF,8FAA8F;AAC9F,wFAAwF;AACxF,YAAY;AACZ,EAAE;AACF,wFAAwF;AACxF,mFAAmF;AACnF,2FAA2F;AAC3F,2FAA2F;AAC3F,iEAAiE;AAEjE,OAAO,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AAE9D,MAAM,CAAC,MAAM,qBAAqB,GAA6B,cAAc,CAAC;IAC7E;QACC,qFAAqF;QACrF,yEAAyE;QACzE,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE;YACP,cAAc,EAAE;gBACf,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,WAAW;gBAClB,MAAM,EACL,yFAAyF;oBACzF,oFAAoF;oBACpF,yCAAyC;gBAC1C,UAAU,EACT,mFAAmF;oBACnF,mFAAmF;aACpF;SACD;KACD;IACD;QACC,sFAAsF;QACtF,0EAA0E;QAC1E,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE;YACP,cAAc,EAAE;gBACf,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,SAAS;gBAChB,MAAM,EACL,wFAAwF;oBACxF,oFAAoF;oBACpF,6BAA6B;gBAC9B,UAAU,EACT,+EAA+E;oBAC/E,oDAAoD;aACrD;SACD;KACD;CACD,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { OpampOutputSwingTranslation } from "../types";
2
+ import { type CitedParam } from "./loader";
3
+ /** The printed condition a swing pair was read at, and how it is carried. */
4
+ export type OpampSwingPrinted = {
5
+ /** The printed row's total supply, VS+ minus VS- (30 for +-15 V). */
6
+ readonly supplyVolts: number;
7
+ readonly loadOhms: number;
8
+ readonly translation: OpampOutputSwingTranslation;
9
+ /** The printed column the figure was read from. */
10
+ readonly column: string;
11
+ };
12
+ /**
13
+ * Every datasheet-stated parameter for one row of part ids. A record states a
14
+ * gain-bandwidth product, a swing pair, or both; a record with neither is a table error.
15
+ * Drops are both or neither, with the printed condition exactly when the pair is.
16
+ */
17
+ export type OpampRegistryRecord = {
18
+ readonly partIds: readonly string[];
19
+ readonly gainBandwidthHz?: CitedParam;
20
+ readonly outputSwingDropHighVolts?: CitedParam;
21
+ readonly outputSwingDropLowVolts?: CitedParam;
22
+ readonly outputSwingPrinted?: OpampSwingPrinted;
23
+ };
24
+ /** Validate op-amp records and freeze them. Throws at module load on any violation. */
25
+ export declare function defineOpampRecords(records: readonly OpampRegistryRecord[]): readonly OpampRegistryRecord[];
26
+ export declare const opampRegistryRecords: readonly OpampRegistryRecord[];
27
+ /** Op-amp ids this catalog holds whose datasheet states no TYP gain-bandwidth figure, and why. */
28
+ export declare const opampGainBandwidthAbsent: ReadonlyArray<{
29
+ readonly partIds: readonly string[];
30
+ readonly reason: string;
31
+ }>;
32
+ /** Op-amp ids this catalog holds that state no output-swing pair, and why. */
33
+ export declare const opampOutputSwingAbsent: ReadonlyArray<{
34
+ readonly partIds: readonly string[];
35
+ readonly reason: string;
36
+ }>;
37
+ //# sourceMappingURL=opamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opamp.d.ts","sourceRoot":"","sources":["../../src/registry-data/opamp.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,6EAA6E;AAC7E,MAAM,MAAM,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