@empressaio/atom-contract 1.21.0 → 1.23.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 (108) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/absence/absence-verdict.d.ts +32 -0
  3. package/dist/absence/absence-verdict.d.ts.map +1 -0
  4. package/dist/absence/absence-verdict.js +55 -0
  5. package/dist/absence/absence-verdict.js.map +1 -0
  6. package/dist/absence/index.d.ts +3 -0
  7. package/dist/absence/index.d.ts.map +1 -0
  8. package/dist/absence/index.js +2 -0
  9. package/dist/absence/index.js.map +1 -0
  10. package/dist/access/access-pair.d.ts +29 -0
  11. package/dist/access/access-pair.d.ts.map +1 -0
  12. package/dist/access/access-pair.js +106 -0
  13. package/dist/access/access-pair.js.map +1 -0
  14. package/dist/access/index.d.ts +3 -0
  15. package/dist/access/index.d.ts.map +1 -0
  16. package/dist/access/index.js +2 -0
  17. package/dist/access/index.js.map +1 -0
  18. package/dist/conformance/index.d.ts +1 -0
  19. package/dist/conformance/index.d.ts.map +1 -1
  20. package/dist/conformance/index.js +1 -0
  21. package/dist/conformance/index.js.map +1 -1
  22. package/dist/conformance/track2-absence.d.ts +8 -0
  23. package/dist/conformance/track2-absence.d.ts.map +1 -0
  24. package/dist/conformance/track2-absence.js +19 -0
  25. package/dist/conformance/track2-absence.js.map +1 -0
  26. package/dist/conformance/track2-access.d.ts +6 -0
  27. package/dist/conformance/track2-access.d.ts.map +1 -0
  28. package/dist/conformance/track2-access.js +10 -0
  29. package/dist/conformance/track2-access.js.map +1 -0
  30. package/dist/conformance/track2-alias.d.ts +7 -0
  31. package/dist/conformance/track2-alias.d.ts.map +1 -0
  32. package/dist/conformance/track2-alias.js +21 -0
  33. package/dist/conformance/track2-alias.js.map +1 -0
  34. package/dist/conformance/track2-derivation.d.ts +6 -0
  35. package/dist/conformance/track2-derivation.d.ts.map +1 -0
  36. package/dist/conformance/track2-derivation.js +15 -0
  37. package/dist/conformance/track2-derivation.js.map +1 -0
  38. package/dist/conformance/track2-node-id.d.ts +7 -0
  39. package/dist/conformance/track2-node-id.d.ts.map +1 -0
  40. package/dist/conformance/track2-node-id.js +9 -0
  41. package/dist/conformance/track2-node-id.js.map +1 -0
  42. package/dist/conformance/track2-provenance.d.ts +11 -0
  43. package/dist/conformance/track2-provenance.d.ts.map +1 -0
  44. package/dist/conformance/track2-provenance.js +39 -0
  45. package/dist/conformance/track2-provenance.js.map +1 -0
  46. package/dist/conformance/track2-selector.d.ts +12 -0
  47. package/dist/conformance/track2-selector.d.ts.map +1 -0
  48. package/dist/conformance/track2-selector.js +12 -0
  49. package/dist/conformance/track2-selector.js.map +1 -0
  50. package/dist/conformance/track2-supersession.d.ts +6 -0
  51. package/dist/conformance/track2-supersession.d.ts.map +1 -0
  52. package/dist/conformance/track2-supersession.js +12 -0
  53. package/dist/conformance/track2-supersession.js.map +1 -0
  54. package/dist/derivation/derivation.d.ts +30 -0
  55. package/dist/derivation/derivation.d.ts.map +1 -0
  56. package/dist/derivation/derivation.js +61 -0
  57. package/dist/derivation/derivation.js.map +1 -0
  58. package/dist/derivation/index.d.ts +3 -0
  59. package/dist/derivation/index.d.ts.map +1 -0
  60. package/dist/derivation/index.js +2 -0
  61. package/dist/derivation/index.js.map +1 -0
  62. package/dist/identity/alias.d.ts +53 -0
  63. package/dist/identity/alias.d.ts.map +1 -0
  64. package/dist/identity/alias.js +99 -0
  65. package/dist/identity/alias.js.map +1 -0
  66. package/dist/identity/index.d.ts +7 -0
  67. package/dist/identity/index.d.ts.map +1 -0
  68. package/dist/identity/index.js +7 -0
  69. package/dist/identity/index.js.map +1 -0
  70. package/dist/identity/node-id.d.ts +56 -0
  71. package/dist/identity/node-id.d.ts.map +1 -0
  72. package/dist/identity/node-id.js +82 -0
  73. package/dist/identity/node-id.js.map +1 -0
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1 -0
  77. package/dist/index.js.map +1 -1
  78. package/dist/lineage/index.d.ts +3 -0
  79. package/dist/lineage/index.d.ts.map +1 -0
  80. package/dist/lineage/index.js +2 -0
  81. package/dist/lineage/index.js.map +1 -0
  82. package/dist/lineage/supersession.d.ts +34 -0
  83. package/dist/lineage/supersession.d.ts.map +1 -0
  84. package/dist/lineage/supersession.js +48 -0
  85. package/dist/lineage/supersession.js.map +1 -0
  86. package/dist/property/common.d.ts +4 -4
  87. package/dist/property/common.d.ts.map +1 -1
  88. package/dist/property/common.js +2 -0
  89. package/dist/property/common.js.map +1 -1
  90. package/dist/property/flood-hazard-fact.d.ts +4 -4
  91. package/dist/property/rail-corridor-fact.d.ts +10 -10
  92. package/dist/provenance/index.d.ts +3 -0
  93. package/dist/provenance/index.d.ts.map +1 -0
  94. package/dist/provenance/index.js +2 -0
  95. package/dist/provenance/index.js.map +1 -0
  96. package/dist/provenance/provenance-class.d.ts +52 -0
  97. package/dist/provenance/provenance-class.d.ts.map +1 -0
  98. package/dist/provenance/provenance-class.js +91 -0
  99. package/dist/provenance/provenance-class.js.map +1 -0
  100. package/dist/selector/index.d.ts +3 -0
  101. package/dist/selector/index.d.ts.map +1 -0
  102. package/dist/selector/index.js +2 -0
  103. package/dist/selector/index.js.map +1 -0
  104. package/dist/selector/selector-predicate.d.ts +101 -0
  105. package/dist/selector/selector-predicate.d.ts.map +1 -0
  106. package/dist/selector/selector-predicate.js +104 -0
  107. package/dist/selector/selector-predicate.js.map +1 -0
  108. package/package.json +5 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track2-supersession.js","sourceRoot":"","sources":["../../src/conformance/track2-supersession.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EACL,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,MAAM,2BAA2B,GAAqB,qBAAqB,CAAC;IACjF,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,KAAK,CAAC,sCAAsC,CAAC;IACnD,EAAE,EAAE,KAAK,CAAC,sCAAsC,CAAC;IACjD,QAAQ,EAAE,0BAA0B;CACrC,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Derivation and derivesFrom — instrument contract item 2.3.
3
+ *
4
+ * derivesFrom is required on Derivation and absent on Record.
5
+ * A materialised row's identity is (selectorAtomId, storeVersion, method).
6
+ */
7
+ export type DerivesFrom = {
8
+ readonly selectorAtomId: string;
9
+ readonly storeVersion: string;
10
+ readonly method: string;
11
+ };
12
+ export type Derivation = {
13
+ readonly class: "Derivation";
14
+ readonly formula: string;
15
+ readonly inputs: readonly string[];
16
+ readonly derivesFrom: DerivesFrom;
17
+ };
18
+ export declare class DerivationParseError extends Error {
19
+ readonly input: unknown;
20
+ readonly code: "DERIVES_FROM_REQUIRED";
21
+ constructor(message: string, input: unknown);
22
+ }
23
+ export declare function parseDerivesFrom(input: unknown): DerivesFrom;
24
+ export declare function parseDerivation(input: unknown): Derivation;
25
+ /** Runtime export so the Factory shim check observes `Derivation` on the module. */
26
+ export declare const Derivation: Readonly<{
27
+ parse: typeof parseDerivation;
28
+ parseDerivesFrom: typeof parseDerivesFrom;
29
+ }>;
30
+ //# sourceMappingURL=derivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivation.d.ts","sourceRoot":"","sources":["../../src/derivation/derivation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,KAAK;IAK3C,QAAQ,CAAC,KAAK,EAAE,OAAO;IAJzB,QAAQ,CAAC,IAAI,EAAG,uBAAuB,CAAU;gBAG/C,OAAO,EAAE,MAAM,EACN,KAAK,EAAE,OAAO;CAK1B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAuB5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAoB1D;AAED,oFAAoF;AACpF,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Derivation and derivesFrom — instrument contract item 2.3.
3
+ *
4
+ * derivesFrom is required on Derivation and absent on Record.
5
+ * A materialised row's identity is (selectorAtomId, storeVersion, method).
6
+ */
7
+ export class DerivationParseError extends Error {
8
+ input;
9
+ code = "DERIVES_FROM_REQUIRED";
10
+ constructor(message, input) {
11
+ super(message);
12
+ this.input = input;
13
+ this.name = "DerivationParseError";
14
+ }
15
+ }
16
+ export function parseDerivesFrom(input) {
17
+ if (!input || typeof input !== "object") {
18
+ throw new DerivationParseError("Derivation requires derivesFrom", input);
19
+ }
20
+ const row = input;
21
+ if (typeof row.selectorAtomId !== "string" ||
22
+ row.selectorAtomId.length === 0 ||
23
+ typeof row.storeVersion !== "string" ||
24
+ row.storeVersion.length === 0 ||
25
+ typeof row.method !== "string" ||
26
+ row.method.length === 0) {
27
+ throw new DerivationParseError("derivesFrom requires selectorAtomId, storeVersion, method", input);
28
+ }
29
+ return {
30
+ selectorAtomId: row.selectorAtomId,
31
+ storeVersion: row.storeVersion,
32
+ method: row.method,
33
+ };
34
+ }
35
+ export function parseDerivation(input) {
36
+ if (!input || typeof input !== "object") {
37
+ throw new DerivationParseError("Derivation required", input);
38
+ }
39
+ const row = input;
40
+ if (row.class !== "Derivation") {
41
+ throw new DerivationParseError("Derivation class required", input);
42
+ }
43
+ if (typeof row.formula !== "string" || row.formula.length === 0) {
44
+ throw new DerivationParseError("Derivation requires formula", input);
45
+ }
46
+ if (!Array.isArray(row.inputs)) {
47
+ throw new DerivationParseError("Derivation requires inputs", input);
48
+ }
49
+ return {
50
+ class: "Derivation",
51
+ formula: row.formula,
52
+ inputs: row.inputs.map(String),
53
+ derivesFrom: parseDerivesFrom(row.derivesFrom),
54
+ };
55
+ }
56
+ /** Runtime export so the Factory shim check observes `Derivation` on the module. */
57
+ export const Derivation = Object.freeze({
58
+ parse: parseDerivation,
59
+ parseDerivesFrom,
60
+ });
61
+ //# sourceMappingURL=derivation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivation.js","sourceRoot":"","sources":["../../src/derivation/derivation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAKlC;IAJF,IAAI,GAAG,uBAAgC,CAAC;IAEjD,YACE,OAAe,EACN,KAAc;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,UAAK,GAAL,KAAK,CAAS;QAGvB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,oBAAoB,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,IACE,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ;QACtC,GAAG,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC;QAC/B,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ;QACpC,GAAG,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC7B,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ;QA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,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,eAAe;IACtB,gBAAgB;CACjB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Derivation, DerivationParseError, parseDerivation, parseDerivesFrom, } from "./derivation.js";
2
+ export type { DerivesFrom } from "./derivation.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/derivation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Derivation, DerivationParseError, parseDerivation, parseDerivesFrom, } from "./derivation.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/derivation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Alias as an atom and lineage as edges — instrument contract item 2.10.
3
+ *
4
+ * An alias is claim type `identity.alias` with a validity era. Lineage is
5
+ * an edge (`mergedInto`, `dividedInto`, `unmerged`). No lineage column
6
+ * exists on the node.
7
+ */
8
+ import { type NodeId } from "./node-id.js";
9
+ export type AliasEntityType = "identity.alias";
10
+ export type AliasAtom = {
11
+ readonly entityType: AliasEntityType;
12
+ readonly aliasKey: string;
13
+ readonly nodeId: NodeId;
14
+ readonly authority: string;
15
+ readonly validFrom: string;
16
+ readonly validTo: string | null;
17
+ readonly knowledgeAt: string;
18
+ };
19
+ export type LineageEdgeKind = "mergedInto" | "dividedInto" | "unmerged";
20
+ export type LineageEdge = {
21
+ readonly kind: LineageEdgeKind;
22
+ readonly from: NodeId;
23
+ readonly to: NodeId;
24
+ };
25
+ export declare const LINEAGE_NODE_COLUMNS: readonly ["mergedInto", "dividedInto", "unmerged"];
26
+ export type LineageNodeColumn = (typeof LINEAGE_NODE_COLUMNS)[number];
27
+ /**
28
+ * A node identity record may not carry lineage columns. Those relations
29
+ * are edges. Assigning a type with any of those keys yields `never`.
30
+ */
31
+ export type AssertNoLineageColumn<T> = Extract<keyof T, LineageNodeColumn> extends never ? T : never;
32
+ export declare class AliasParseError extends Error {
33
+ readonly input: unknown;
34
+ readonly code: "ALIAS_ERA";
35
+ constructor(message: string, input: unknown);
36
+ }
37
+ export declare class LineageParseError extends Error {
38
+ readonly input: unknown;
39
+ readonly code: "LINEAGE_EDGE";
40
+ constructor(message: string, input: unknown);
41
+ }
42
+ export declare function parseAliasKey(input: string): string;
43
+ export declare function parseAliasAtom(input: unknown): AliasAtom;
44
+ export declare function parseLineageEdge(input: unknown): LineageEdge;
45
+ export declare function acceptNodeWithoutLineage<T extends Record<string, unknown>>(node: AssertNoLineageColumn<T>): AssertNoLineageColumn<T>;
46
+ /** Runtime export so the Factory shim check observes `AliasAtom` on the module. */
47
+ export declare const AliasAtom: Readonly<{
48
+ entityType: "identity.alias";
49
+ parse: typeof parseAliasAtom;
50
+ parseKey: typeof parseAliasKey;
51
+ parseLineage: typeof parseLineageEdge;
52
+ }>;
53
+ //# sourceMappingURL=alias.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../../src/identity/alias.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC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AAG,WAAW,CAgB5D;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC7B,qBAAqB,CAAC,CAAC,CAAC,CAE1B;AAED,mFAAmF;AACnF,eAAO,MAAM,SAAS;;;;;EAKpB,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Alias as an atom and lineage as edges — instrument contract item 2.10.
3
+ *
4
+ * An alias is claim type `identity.alias` with a validity era. Lineage is
5
+ * an edge (`mergedInto`, `dividedInto`, `unmerged`). No lineage column
6
+ * exists on the node.
7
+ */
8
+ import { parse } from "./node-id.js";
9
+ export const LINEAGE_NODE_COLUMNS = [
10
+ "mergedInto",
11
+ "dividedInto",
12
+ "unmerged",
13
+ ];
14
+ export class AliasParseError extends Error {
15
+ input;
16
+ code = "ALIAS_ERA";
17
+ constructor(message, input) {
18
+ super(message);
19
+ this.input = input;
20
+ this.name = "AliasParseError";
21
+ }
22
+ }
23
+ export class LineageParseError extends Error {
24
+ input;
25
+ code = "LINEAGE_EDGE";
26
+ constructor(message, input) {
27
+ super(message);
28
+ this.input = input;
29
+ this.name = "LineageParseError";
30
+ }
31
+ }
32
+ export function parseAliasKey(input) {
33
+ if (typeof input !== "string" || input.length === 0) {
34
+ throw new AliasParseError("alias key must be a non-empty string", input);
35
+ }
36
+ return input;
37
+ }
38
+ export function parseAliasAtom(input) {
39
+ if (!input || typeof input !== "object") {
40
+ throw new AliasParseError("alias atom required", input);
41
+ }
42
+ const row = input;
43
+ if (row.entityType !== "identity.alias") {
44
+ throw new AliasParseError("alias atom entityType must be identity.alias", input);
45
+ }
46
+ if (typeof row.aliasKey !== "string" || row.aliasKey.length === 0) {
47
+ throw new AliasParseError("alias atom requires aliasKey", input);
48
+ }
49
+ if (typeof row.nodeId !== "string") {
50
+ throw new AliasParseError("alias atom requires nodeId", input);
51
+ }
52
+ if (typeof row.authority !== "string" || row.authority.length === 0) {
53
+ throw new AliasParseError("alias atom requires authority, validFrom, knowledgeAt", input);
54
+ }
55
+ if (typeof row.validFrom !== "string" || row.validFrom.length === 0) {
56
+ throw new AliasParseError("alias atom requires a validity era (validFrom)", input);
57
+ }
58
+ if (typeof row.knowledgeAt !== "string" || row.knowledgeAt.length === 0) {
59
+ throw new AliasParseError("alias atom requires authority, validFrom, knowledgeAt", input);
60
+ }
61
+ if (row.validTo != null && typeof row.validTo !== "string") {
62
+ throw new AliasParseError("alias atom validTo must be a string or null", input);
63
+ }
64
+ return {
65
+ entityType: "identity.alias",
66
+ aliasKey: parseAliasKey(row.aliasKey),
67
+ nodeId: parse(row.nodeId),
68
+ authority: row.authority,
69
+ validFrom: row.validFrom,
70
+ validTo: row.validTo ?? null,
71
+ knowledgeAt: row.knowledgeAt,
72
+ };
73
+ }
74
+ export function parseLineageEdge(input) {
75
+ if (!input || typeof input !== "object") {
76
+ throw new LineageParseError("lineage edge required", input);
77
+ }
78
+ const row = input;
79
+ if (row.kind !== "mergedInto" &&
80
+ row.kind !== "dividedInto" &&
81
+ row.kind !== "unmerged") {
82
+ throw new LineageParseError("lineage kind must be mergedInto, dividedInto, or unmerged", input);
83
+ }
84
+ if (typeof row.from !== "string" || typeof row.to !== "string") {
85
+ throw new LineageParseError("lineage edge requires from and to node ids", input);
86
+ }
87
+ return { kind: row.kind, from: parse(row.from), to: parse(row.to) };
88
+ }
89
+ export function acceptNodeWithoutLineage(node) {
90
+ return node;
91
+ }
92
+ /** Runtime export so the Factory shim check observes `AliasAtom` on the module. */
93
+ export const AliasAtom = Object.freeze({
94
+ entityType: "identity.alias",
95
+ parse: parseAliasAtom,
96
+ parseKey: parseAliasKey,
97
+ parseLineage: parseLineageEdge,
98
+ });
99
+ //# sourceMappingURL=alias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.js","sourceRoot":"","sources":["../../src/identity/alias.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EA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identity`.
5
+ */
6
+ export { COUNTY_PROP_ALIAS_KEY, NODE_ID_PATTERN, NodeId, NodeIdParseError, bindNodeIdForWrite, isCountyPropAliasKey, isNodeId, mint, nodeIdToString, parse, } from "./node-id.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,KAAK,GACN,MAAM,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Opaque node identity (`NodeId`) — mint/parse only constructors.
3
+ *
4
+ * Import from `@empressaio/atom-contract/identity`.
5
+ */
6
+ export { COUNTY_PROP_ALIAS_KEY, NODE_ID_PATTERN, NodeId, NodeIdParseError, bindNodeIdForWrite, isCountyPropAliasKey, isNodeId, mint, nodeIdToString, parse, } from "./node-id.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,KAAK,GACN,MAAM,cAAc,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Branded opaque {@link NodeId} — instrument contract item 2.1 (T1.2).
3
+ *
4
+ * Constructible only via {@link mint} or validating {@link parse}. A bare
5
+ * string does not satisfy write-boundary signatures that require `NodeId`.
6
+ * Salvaged from unpublished PR #22; grammar matches the Factory shim.
7
+ */
8
+ /** Opaque node identity minted by the substrate; not a natural key alias. */
9
+ export type NodeId = string & {
10
+ readonly __brand: "NodeId";
11
+ };
12
+ /** Typed refusal when {@link parse} rejects malformed input. */
13
+ export declare class NodeIdParseError extends Error {
14
+ readonly input: string;
15
+ readonly code: "malformed_node_id";
16
+ constructor(message: string, input: string);
17
+ }
18
+ /** Canonical `nid_` + 32 lowercase hex chars (128-bit opaque payload). */
19
+ export declare const NODE_ID_PATTERN: RegExp;
20
+ /**
21
+ * County-prop natural key `{fips}:{propId}`. An alias key, never a NodeId.
22
+ * `parse` refuses this grammar; {@link isCountyPropAliasKey} accepts it.
23
+ */
24
+ export declare const COUNTY_PROP_ALIAS_KEY: RegExp;
25
+ /**
26
+ * Mint a fresh opaque node id. The only runtime constructor for new writes.
27
+ */
28
+ export declare function mint(): NodeId;
29
+ /**
30
+ * Validate and brand an existing id string. Refuses malformed input; no coercion.
31
+ * Refuses `{fips}:{propId}` — that grammar is an alias key, not a node id.
32
+ */
33
+ export declare function parse(input: string): NodeId;
34
+ /** True when `value` is a county-prop alias key, not a node id. */
35
+ export declare function isCountyPropAliasKey(value: string): boolean;
36
+ /** Runtime narrow for values that already passed {@link parse}. */
37
+ export declare function isNodeId(value: unknown): value is NodeId;
38
+ /**
39
+ * Write-boundary signature: accepts only a branded {@link NodeId}.
40
+ * Property/engine adapters call this (or take `NodeId` directly) so bare
41
+ * natural keys fail at compile time.
42
+ */
43
+ export declare function bindNodeIdForWrite(nodeId: NodeId): {
44
+ readonly nodeId: NodeId;
45
+ };
46
+ /** String form for persistence layers that store plain text. */
47
+ export declare function nodeIdToString(nodeId: NodeId): string;
48
+ /** Runtime export so the Factory shim check observes `NodeId` on the module. */
49
+ export declare const NodeId: Readonly<{
50
+ brand: "NodeId";
51
+ pattern: RegExp;
52
+ mint: typeof mint;
53
+ parse: typeof parse;
54
+ is: typeof isNodeId;
55
+ }>;
56
+ //# sourceMappingURL=node-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-id.d.ts","sourceRoot":"","sources":["../../src/identity/node-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,6EAA6E;AAC7E,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE7D,gEAAgE;AAChE,qBAAa,gBAAiB,SAAQ,KAAK;IAKvC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAJxB,QAAQ,CAAC,IAAI,EAAG,mBAAmB,CAAU;gBAG3C,OAAO,EAAE,MAAM,EACN,KAAK,EAAE,MAAM;CAKzB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,QAAuB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AASrD;;GAEG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAG7B;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoB3C;AAED,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAE9E;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,gFAAgF;AAChF,eAAO,MAAM,MAAM;;;;;;EAMjB,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Branded opaque {@link NodeId} — instrument contract item 2.1 (T1.2).
3
+ *
4
+ * Constructible only via {@link mint} or validating {@link parse}. A bare
5
+ * string does not satisfy write-boundary signatures that require `NodeId`.
6
+ * Salvaged from unpublished PR #22; grammar matches the Factory shim.
7
+ */
8
+ import { randomBytes } from "node:crypto";
9
+ /** Typed refusal when {@link parse} rejects malformed input. */
10
+ export class NodeIdParseError extends Error {
11
+ input;
12
+ code = "malformed_node_id";
13
+ constructor(message, input) {
14
+ super(message);
15
+ this.input = input;
16
+ this.name = "NodeIdParseError";
17
+ }
18
+ }
19
+ /** Canonical `nid_` + 32 lowercase hex chars (128-bit opaque payload). */
20
+ export const NODE_ID_PATTERN = /^nid_[0-9a-f]{32}$/;
21
+ /**
22
+ * County-prop natural key `{fips}:{propId}`. An alias key, never a NodeId.
23
+ * `parse` refuses this grammar; {@link isCountyPropAliasKey} accepts it.
24
+ */
25
+ export const COUNTY_PROP_ALIAS_KEY = /^[0-9]{5}:.+$/;
26
+ const NODE_ID_PREFIX = "nid_";
27
+ const NODE_ID_HEX_LENGTH = 32;
28
+ function brandNodeId(value) {
29
+ return value;
30
+ }
31
+ /**
32
+ * Mint a fresh opaque node id. The only runtime constructor for new writes.
33
+ */
34
+ export function mint() {
35
+ const hex = randomBytes(NODE_ID_HEX_LENGTH / 2).toString("hex");
36
+ return brandNodeId(`${NODE_ID_PREFIX}${hex}`);
37
+ }
38
+ /**
39
+ * Validate and brand an existing id string. Refuses malformed input; no coercion.
40
+ * Refuses `{fips}:{propId}` — that grammar is an alias key, not a node id.
41
+ */
42
+ export function parse(input) {
43
+ if (typeof input !== "string" || input.length === 0) {
44
+ throw new NodeIdParseError("NodeId must be a non-empty string", String(input));
45
+ }
46
+ if (isCountyPropAliasKey(input)) {
47
+ throw new NodeIdParseError(`NodeId refuses county-prop alias key "${input}"; use it as an alias key only`, input);
48
+ }
49
+ if (!NODE_ID_PATTERN.test(input)) {
50
+ throw new NodeIdParseError(`NodeId must match ${NODE_ID_PATTERN}; got "${input}"`, input);
51
+ }
52
+ return brandNodeId(input);
53
+ }
54
+ /** True when `value` is a county-prop alias key, not a node id. */
55
+ export function isCountyPropAliasKey(value) {
56
+ return typeof value === "string" && COUNTY_PROP_ALIAS_KEY.test(value);
57
+ }
58
+ /** Runtime narrow for values that already passed {@link parse}. */
59
+ export function isNodeId(value) {
60
+ return typeof value === "string" && NODE_ID_PATTERN.test(value);
61
+ }
62
+ /**
63
+ * Write-boundary signature: accepts only a branded {@link NodeId}.
64
+ * Property/engine adapters call this (or take `NodeId` directly) so bare
65
+ * natural keys fail at compile time.
66
+ */
67
+ export function bindNodeIdForWrite(nodeId) {
68
+ return { nodeId };
69
+ }
70
+ /** String form for persistence layers that store plain text. */
71
+ export function nodeIdToString(nodeId) {
72
+ return nodeId;
73
+ }
74
+ /** Runtime export so the Factory shim check observes `NodeId` on the module. */
75
+ export const NodeId = Object.freeze({
76
+ brand: "NodeId",
77
+ pattern: NODE_ID_PATTERN,
78
+ mint,
79
+ parse,
80
+ is: isNodeId,
81
+ });
82
+ //# sourceMappingURL=node-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-id.js","sourceRoot":"","sources":["../../src/identity/node-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,gEAAgE;AAChE,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAK9B;IAJF,IAAI,GAAG,mBAA4B,CAAC;IAE7C,YACE,OAAe,EACN,KAAa;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,UAAK,GAAL,KAAK,CAAQ;QAGtB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAErD,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAe,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,MAAM,GAAG,GAAG,WAAW,CAAC,kBAAkB,GAAG,CAAC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M,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,QAAiB;IACxB,OAAO,EAAE,eAAe;IACxB,IAAI;IACJ,KAAK;IACL,EAAE,EAAE,QAAQ;CACb,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -30,4 +30,5 @@ export type { AtomInputRef, AtomInputRefRole, ReasoningChain, } from "./reasonin
30
30
  export { ATOM_INPUT_REF_ROLES, ATOM_INPUT_REF_SCHEMA, REASONING_CHAIN_SCHEMA, REASONING_CHAIN_OBSERVED_SCHEMA, REASONING_CHAIN_DERIVED_SCHEMA, createReasoningChain, validateReasoningChain, } from "./reasoning-chain.js";
31
31
  export type { ActorRecordAtomInstance, ActorLicensingTerms, ActorType, ActorTrustLevel, OrganizationTenantKind, } from "./actor-record.js";
32
32
  export { ACTOR_RECORD_SCHEMA, ACTOR_LICENSING_TERMS_SCHEMA, ACTOR_TYPES, ACTOR_TRUST_LEVELS, ORGANIZATION_TENANT_KINDS, ICC_ACTOR_RECORD_FIXTURE, createActorRecord, } from "./actor-record.js";
33
+ export { COUNTY_PROP_ALIAS_KEY, NODE_ID_PATTERN, NodeId, NodeIdParseError, bindNodeIdForWrite, isCountyPropAliasKey, isNodeId, mint, nodeIdToString, parse, } from "./identity/node-id.js";
33
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,YAAY,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB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AsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,WAAW,EACX,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,YAAY,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,YAAY,EACV,eAAe,EACf,aAAa,EACb,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,+BAA+B,EAC/B,8BAA8B,EAC9B,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,WAAW,EACX,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,KAAK,GACN,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -19,4 +19,5 @@ export { createAtomRegistry, AtomNotRegisteredError } from "./registry.js";
19
19
  export { OBLIGATION_SCHEMA, OBLIGATION_TYPES, OBLIGATION_STATUSES, LICENSE_OBLIGATION_TYPES, } from "./obligation.js";
20
20
  export { ATOM_INPUT_REF_ROLES, ATOM_INPUT_REF_SCHEMA, REASONING_CHAIN_SCHEMA, REASONING_CHAIN_OBSERVED_SCHEMA, REASONING_CHAIN_DERIVED_SCHEMA, createReasoningChain, validateReasoningChain, } from "./reasoning-chain.js";
21
21
  export { ACTOR_RECORD_SCHEMA, ACTOR_LICENSING_TERMS_SCHEMA, ACTOR_TYPES, ACTOR_TRUST_LEVELS, ORGANIZATION_TENANT_KINDS, ICC_ACTOR_RECORD_FIXTURE, createActorRecord, } from "./actor-record.js";
22
+ export { COUNTY_PROP_ALIAS_KEY, NODE_ID_PATTERN, NodeId, NodeIdParseError, bindNodeIdForWrite, isCountyPropAliasKey, isNodeId, mint, nodeIdToString, parse, } from "./identity/node-id.js";
22
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAOlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AAOrB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS7D,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAO3E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAOz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AqB,EACrB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,KAAK,GACN,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { SUPERSEDED_BY, SUPERSEDED_BY_COLUMN, SupersessionEdge, SupersessionParseError, acceptAtomWithoutSupersededBy, parseSupersessionEdge, } from "./supersession.js";
2
+ export type { AssertNoSupersededByColumn, SupersededByColumn, } from "./supersession.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lineage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { SUPERSEDED_BY, SUPERSEDED_BY_COLUMN, SupersessionEdge, SupersessionParseError, acceptAtomWithoutSupersededBy, parseSupersessionEdge, } from "./supersession.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lineage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Supersession as an edge — instrument contract item 2.8.
3
+ *
4
+ * No `supersededBy` column exists to write. SUPERSEDED_BY is an edge
5
+ * type with `closedAt` on the prior window.
6
+ */
7
+ import { type NodeId } from "../identity/node-id.js";
8
+ export declare const SUPERSEDED_BY: "SUPERSEDED_BY";
9
+ export type SupersessionEdge = {
10
+ readonly link_type: typeof SUPERSEDED_BY;
11
+ readonly from: NodeId;
12
+ readonly to: NodeId;
13
+ readonly closedAt: string;
14
+ };
15
+ export declare const SUPERSEDED_BY_COLUMN: "supersededBy";
16
+ export type SupersededByColumn = typeof SUPERSEDED_BY_COLUMN;
17
+ /**
18
+ * An atom record may not carry a supersededBy column. Assigning a type
19
+ * with that key yields `never`.
20
+ */
21
+ export type AssertNoSupersededByColumn<T> = Extract<keyof T, SupersededByColumn> extends never ? T : never;
22
+ export declare class SupersessionParseError extends Error {
23
+ readonly input: unknown;
24
+ readonly code: "SUPERSESSION_EDGE";
25
+ constructor(message: string, input: unknown);
26
+ }
27
+ export declare function parseSupersessionEdge(input: unknown): SupersessionEdge;
28
+ export declare function acceptAtomWithoutSupersededBy<T extends Record<string, unknown>>(atom: AssertNoSupersededByColumn<T>): AssertNoSupersededByColumn<T>;
29
+ /** Runtime export so the Factory shim check observes `SupersessionEdge` on the module. */
30
+ export declare const SupersessionEdge: Readonly<{
31
+ linkType: "SUPERSEDED_BY";
32
+ parse: typeof parseSupersessionEdge;
33
+ }>;
34
+ //# sourceMappingURL=supersession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supersession.d.ts","sourceRoot":"","sources":["../../src/lineage/supersession.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAG,eAAwB,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,aAAa,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAG,cAAuB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,oBAAoB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,0BAA0B,CAAC,CAAC,IACtC,OAAO,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,SAAS,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;AAEjE,qBAAa,sBAAuB,SAAQ,KAAK;IAK7C,QAAQ,CAAC,KAAK,EAAE,OAAO;IAJzB,QAAQ,CAAC,IAAI,EAAG,mBAAmB,CAAU;gBAG3C,OAAO,EAAE,MAAM,EACN,KAAK,EAAE,OAAO;CAK1B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAoBtE;AAED,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7E,IAAI,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAClC,0BAA0B,CAAC,CAAC,CAAC,CAE/B;AAED,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Supersession as an edge — instrument contract item 2.8.
3
+ *
4
+ * No `supersededBy` column exists to write. SUPERSEDED_BY is an edge
5
+ * type with `closedAt` on the prior window.
6
+ */
7
+ import { parse } from "../identity/node-id.js";
8
+ export const SUPERSEDED_BY = "SUPERSEDED_BY";
9
+ export const SUPERSEDED_BY_COLUMN = "supersededBy";
10
+ export class SupersessionParseError extends Error {
11
+ input;
12
+ code = "SUPERSESSION_EDGE";
13
+ constructor(message, input) {
14
+ super(message);
15
+ this.input = input;
16
+ this.name = "SupersessionParseError";
17
+ }
18
+ }
19
+ export function parseSupersessionEdge(input) {
20
+ if (!input || typeof input !== "object") {
21
+ throw new SupersessionParseError("SUPERSEDED_BY edge required", input);
22
+ }
23
+ const row = input;
24
+ if (row.link_type !== SUPERSEDED_BY) {
25
+ throw new SupersessionParseError("link_type must be SUPERSEDED_BY", input);
26
+ }
27
+ if (typeof row.from !== "string" || typeof row.to !== "string") {
28
+ throw new SupersessionParseError("SUPERSEDED_BY edge requires from and to", input);
29
+ }
30
+ if (typeof row.closedAt !== "string" || row.closedAt.length === 0) {
31
+ throw new SupersessionParseError("SUPERSEDED_BY edge requires closedAt on the prior window", input);
32
+ }
33
+ return {
34
+ link_type: SUPERSEDED_BY,
35
+ from: parse(row.from),
36
+ to: parse(row.to),
37
+ closedAt: row.closedAt,
38
+ };
39
+ }
40
+ export function acceptAtomWithoutSupersededBy(atom) {
41
+ return atom;
42
+ }
43
+ /** Runtime export so the Factory shim check observes `SupersessionEdge` on the module. */
44
+ export const SupersessionEdge = Object.freeze({
45
+ linkType: SUPERSEDED_BY,
46
+ parse: parseSupersessionEdge,
47
+ });
48
+ //# sourceMappingURL=supersession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supersession.js","sourceRoot":"","sources":["../../src/lineage/supersession.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAE5D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAwB,CAAC;AAStD,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAuB,CAAC;AAW5D,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAKpC;IAJF,IAAI,GAAG,mBAA4B,CAAC;IAE7C,YACE,OAAe,EACN,KAAc;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,UAAK,GAAL,KAAK,CAAS;QAGvB,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,sBAAsB,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,IAAI,GAAG,CAAC,SAAS,KAAK,aAAa,EAAE,CAAC;QACpC,MAAM,IAAI,sBAAsB,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC/D,MAAM,IAAI,sBAAsB,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,sBAAsB,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAC;IACtG,CAAC;IACD,OAAO;QACL,SAAS,EAAE,aAAa;QACxB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QACrB,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACjB,QAAQ,EAAE,GAAG,CAAC,QAAQ;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,IAAmC;IAEnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,qBAAqB;CAC7B,CAAC,CAAC"}
@@ -818,12 +818,12 @@ export declare const FLOOD_HAZARD_ABSENCE_SCHEMA: z.ZodObject<{
818
818
  export type FloodHazardAbsence = z.infer<typeof FLOOD_HAZARD_ABSENCE_SCHEMA>;
819
819
  export type RailCorridorSourceTier = "ntad-narn" | "absent";
820
820
  export declare const RAIL_CORRIDOR_SOURCE_TIER_SCHEMA: z.ZodEnum<["ntad-narn", "absent"]>;
821
- export declare const RAIL_CORRIDOR_STATUS_VALUES: readonly ["active", "abandoned", "rail-trail"];
821
+ export declare const RAIL_CORRIDOR_STATUS_VALUES: readonly ["active", "abandoned", "rail-trail", "unknown"];
822
822
  export type RailCorridorStatus = (typeof RAIL_CORRIDOR_STATUS_VALUES)[number];
823
- export declare const RAIL_CORRIDOR_STATUS_SCHEMA: z.ZodEnum<["active", "abandoned", "rail-trail"]>;
824
- export declare const RAIL_CORRIDOR_CLASS_VALUES: readonly ["mainline", "spur", "yard"];
823
+ export declare const RAIL_CORRIDOR_STATUS_SCHEMA: z.ZodEnum<["active", "abandoned", "rail-trail", "unknown"]>;
824
+ export declare const RAIL_CORRIDOR_CLASS_VALUES: readonly ["mainline", "spur", "yard", "unknown"];
825
825
  export type RailCorridorClass = (typeof RAIL_CORRIDOR_CLASS_VALUES)[number];
826
- export declare const RAIL_CORRIDOR_CLASS_SCHEMA: z.ZodEnum<["mainline", "spur", "yard"]>;
826
+ export declare const RAIL_CORRIDOR_CLASS_SCHEMA: z.ZodEnum<["mainline", "spur", "yard", "unknown"]>;
827
827
  export declare const RAIL_CORRIDOR_ABSENCE_KINDS: readonly ["no-rail-coverage", "no-parcel-geometry"];
828
828
  export type RailCorridorAbsenceKind = (typeof RAIL_CORRIDOR_ABSENCE_KINDS)[number];
829
829
  export declare const RAIL_CORRIDOR_ABSENCE_SCHEMA: z.ZodObject<{