@dads-framework/cross-domain-references 0.0.0-stage → 0.1.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 (28) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +114 -2
  3. package/dist/cross-domain-references.tsbuildinfo +1 -0
  4. package/dist/index.d.ts +16 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +6 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/lib/cross-domain-reference.d.ts +101 -0
  9. package/dist/lib/cross-domain-reference.d.ts.map +1 -0
  10. package/dist/lib/cross-domain-reference.js +16 -0
  11. package/dist/lib/cross-domain-reference.js.map +1 -0
  12. package/dist/lib/database/check-cross-domain-references.d.ts +22 -0
  13. package/dist/lib/database/check-cross-domain-references.d.ts.map +1 -0
  14. package/dist/lib/database/check-cross-domain-references.js +131 -0
  15. package/dist/lib/database/check-cross-domain-references.js.map +1 -0
  16. package/dist/lib/declare-cross-domain-references.d.ts +41 -0
  17. package/dist/lib/declare-cross-domain-references.d.ts.map +1 -0
  18. package/dist/lib/declare-cross-domain-references.js +59 -0
  19. package/dist/lib/declare-cross-domain-references.js.map +1 -0
  20. package/dist/lib/logic/format-dangling-reference-report.d.ts +11 -0
  21. package/dist/lib/logic/format-dangling-reference-report.d.ts.map +1 -0
  22. package/dist/lib/logic/format-dangling-reference-report.js +31 -0
  23. package/dist/lib/logic/format-dangling-reference-report.js.map +1 -0
  24. package/dist/lib/queries/check-cross-domain-references.query.d.ts +34 -0
  25. package/dist/lib/queries/check-cross-domain-references.query.d.ts.map +1 -0
  26. package/dist/lib/queries/check-cross-domain-references.query.js +32 -0
  27. package/dist/lib/queries/check-cross-domain-references.query.js.map +1 -0
  28. package/package.json +38 -4
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bryton Cooper
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,115 @@
1
- # Temporary Holding Version
1
+ # cross-domain-references
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The reconciliation half of ADR-0023,
4
+ as a kit every product runs.
5
+
6
+ Domains can replace cross-domain foreign keys with explicit references. That trade keeps
7
+ domain schemas on independent lifecycles, and the escape hatch it banks on is
8
+ that an FK can always be added later — which is true only while the data is
9
+ clean, because `ALTER TABLE … ADD FOREIGN KEY` fails on the first dangling row.
10
+ So every product LEFT JOINs every reference it declares to the key that
11
+ reference claims to point at, and reports the values that match nothing.
12
+
13
+ ## A declaration
14
+
15
+ A reference belongs to the domain whose table carries the id, so the
16
+ declaration lives in that domain, never in a central file:
17
+
18
+ ```ts
19
+ // libs/<product>/domains/orders/server/src/lib/public-api/cross-domain-references.ts
20
+ export const ordersCrossDomainReferences = declareCrossDomainReferences([
21
+ {
22
+ id: "orders.managing_organization_id",
23
+ consumerDomain: "orders",
24
+ consumerTable: "orders",
25
+ consumerColumn: "managing_organization_id",
26
+ providerDomain: "organizations",
27
+ providerTable: "organizations",
28
+ providerColumn: "id",
29
+ classification: "live-association",
30
+ },
31
+ ]);
32
+ ```
33
+
34
+ `classification` is ADR-0023's, and it travels with the finding so a report
35
+ reads with the policy that governs its repair. A polymorphic column — one whose
36
+ target table is chosen by a `*_kind` / `*_type` discriminator — is one
37
+ declaration per arm, each narrowed by `filters`, or by `discriminatedByParent`
38
+ when the discriminator sits on a parent row. `declareCrossDomainReferences`
39
+ refuses an unnarrowed arm at import: without the discriminator the check
40
+ reports every other arm's rows as dangling and proves none of its own.
41
+
42
+ A domain file lives at `src/lib/public-api/cross-domain-references.ts` — the
43
+ product's composition root reads it, so it is a cross-boundary promise and the
44
+ barrel may only export one from there. A kit declaring references for its own
45
+ tables keeps the file beside them, in `src/lib/database/`.
46
+
47
+ ## Wiring the check
48
+
49
+ Pass the assembled declarations and an application-owned SQL client to the
50
+ check. A PostgreSQL pool satisfies the `CrossDomainReferenceQueryClient`
51
+ contract. The checker validates the rows returned by that client.
52
+
53
+ The product's composition root assembles one list:
54
+
55
+ ```ts
56
+ export const commandCrossDomainReferences = assembleCrossDomainReferences([
57
+ ordersCrossDomainReferences,
58
+ facilitiesCrossDomainReferences,
59
+ // …one entry per domain that declares any
60
+ ]);
61
+ ```
62
+
63
+ An empty list is valid and means what it says — this product declares no
64
+ cross-domain reference yet. It is not silence: the check still runs and reports
65
+ that it checked nothing.
66
+
67
+ That list reaches two places:
68
+
69
+ - **`npm run db:check-references -- --product <name>`** — `tools/check-cross-domain-references`,
70
+ for a database someone can already reach (local, CI, the nightly job). Exit
71
+ codes: `0` clean, `1` dangling references found, `2` the check could not run.
72
+ - **The live-environment action `cross-domain-references.check`** — for the
73
+ environments nobody should have to shell into. Routine tier, read-only, its
74
+ handler delegating to this kit's `CheckCrossDomainReferences` query. The
75
+ product declares it, not this kit: the live-environment-actions kit declares
76
+ a loose reference of its own and therefore imports this one, so an action
77
+ defined here would close a cycle. The application declares its own beside
78
+ its API composition root.
79
+
80
+ ## What counts as dangling
81
+
82
+ Existence, and only existence. A row naming a soft-deleted organization or
83
+ facility is fine: ADR-0023 archives referenced registry rows rather than
84
+ removing them, and status/scope validation belongs to the accepting mutation,
85
+ not to reconciliation.
86
+
87
+ ## What is deliberately not declared
88
+
89
+ Registration is the only outcome for a loose cross-domain id column
90
+ withdrew the exception hatch, which had been an empty array for its whole life.
91
+ These are the cases the rule never sees at all, kept here so they are not
92
+ rediscovered as false positives:
93
+
94
+ - **SpiceDB object references** over an open string vocabulary — they are not
95
+ rows in this database.
96
+ - **Frozen audit ids** a table states must never be resolved back to a live
97
+ record.
98
+ - **Name-keyed references** (a `tag_name` scoped by organization), which need a
99
+ composite check rather than this id-to-key shape.
100
+ - **Intra-domain columns with a real foreign key** — the database already
101
+ refuses the orphan, so an anti-join could only return zero rows and would
102
+ read as coverage it is not providing.
103
+
104
+ A domain's own file records the ones particular to it, beside the ones it does
105
+ declare.
106
+
107
+ ## Brand owners
108
+
109
+ The reference check derives brand ownership from the
110
+ schema: the domain whose table declares `id: ….primaryKey()….$type<XId>()`
111
+ owns `XId`. A vendored table breaks that — Better Auth's `user.id` is a plain
112
+ text column — so the domain that holds it declares the brand it mints with
113
+ `declareCrossDomainBrandOwners`, in the same file as its references. That is
114
+ what lets the rule see a `UserId` column in another domain as the cross-domain
115
+ reference it is.
@@ -0,0 +1 @@
1
+ {"version":"7.0.2","root":[[64,67],[72,73]],"packageJsons":["../../../../node_modules/@types/node/package.json","../../../../node_modules/buffer/package.json","../../../../node_modules/events/package.json","../../../../node_modules/process/package.json","../../../../node_modules/punycode/package.json","../../../../node_modules/string_decoder/package.json","../../../../node_modules/undici-types/package.json","../package.json","../../errors/package.json"],"missingPackageJsons":["../../../../node_modules/@types/assert/package.json","../../../../node_modules/@types/assert/strict/package.json","../../../../node_modules/@types/async_hooks/package.json","../../../../node_modules/@types/child_process/package.json","../../../../node_modules/@types/cluster/package.json","../../../../node_modules/@types/console/package.json","../../../../node_modules/@types/constants/package.json","../../../../node_modules/@types/crypto/package.json","../../../../node_modules/@types/dgram/package.json","../../../../node_modules/@types/diagnostics_channel/package.json","../../../../node_modules/@types/dns/package.json","../../../../node_modules/@types/dns/promises/package.json","../../../../node_modules/@types/domain/package.json","../../../../node_modules/@types/events/package.json","../../../../node_modules/@types/fs/package.json","../../../../node_modules/@types/fs/promises/package.json","../../../../node_modules/@types/http/package.json","../../../../node_modules/@types/http2/package.json","../../../../node_modules/@types/https/package.json","../../../../node_modules/@types/inspector/package.json","../../../../node_modules/@types/inspector/promises/package.json","../../../../node_modules/@types/module/package.json","../../../../node_modules/@types/net/package.json","../../../../node_modules/@types/node/assert/package.json","../../../../node_modules/@types/node/compatibility/package.json","../../../../node_modules/@types/node/dns/package.json","../../../../node_modules/@types/node/fs/package.json","../../../../node_modules/@types/node/readline/package.json","../../../../node_modules/@types/node/stream/package.json","../../../../node_modules/@types/node/timers/package.json","../../../../node_modules/@types/node/web-globals/package.json","../../../../node_modules/@types/os/package.json","../../../../node_modules/@types/path/package.json","../../../../node_modules/@types/path/posix/package.json","../../../../node_modules/@types/path/win32/package.json","../../../../node_modules/@types/perf_hooks/package.json","../../../../node_modules/@types/process/package.json","../../../../node_modules/@types/punycode/package.json","../../../../node_modules/@types/querystring/package.json","../../../../node_modules/@types/readline/package.json","../../../../node_modules/@types/readline/promises/package.json","../../../../node_modules/@types/repl/package.json","../../../../node_modules/@types/stream/consumers/package.json","../../../../node_modules/@types/stream/package.json","../../../../node_modules/@types/stream/promises/package.json","../../../../node_modules/@types/stream/web/package.json","../../../../node_modules/@types/string_decoder/package.json","../../../../node_modules/@types/timers/package.json","../../../../node_modules/@types/timers/promises/package.json","../../../../node_modules/@types/tls/package.json","../../../../node_modules/@types/trace_events/package.json","../../../../node_modules/@types/tty/package.json","../../../../node_modules/@types/url/package.json","../../../../node_modules/@types/util/package.json","../../../../node_modules/@types/util/types/package.json","../../../../node_modules/@types/v8/package.json","../../../../node_modules/@types/vm/package.json","../../../../node_modules/@types/wasi/package.json","../../../../node_modules/@types/worker_threads/package.json","../../../../node_modules/@types/zlib/package.json","../../../../node_modules/assert/package.json","../../../../node_modules/assert/strict/package.json","../../../../node_modules/async_hooks/package.json","../../../../node_modules/child_process/package.json","../../../../node_modules/cluster/package.json","../../../../node_modules/console/package.json","../../../../node_modules/constants/package.json","../../../../node_modules/crypto/package.json","../../../../node_modules/dgram/package.json","../../../../node_modules/diagnostics_channel/package.json","../../../../node_modules/dns/package.json","../../../../node_modules/dns/promises/package.json","../../../../node_modules/domain/package.json","../../../../node_modules/fs/package.json","../../../../node_modules/fs/promises/package.json","../../../../node_modules/http/package.json","../../../../node_modules/http2/package.json","../../../../node_modules/https/package.json","../../../../node_modules/inspector/package.json","../../../../node_modules/inspector/promises/package.json","../../../../node_modules/module/package.json","../../../../node_modules/net/package.json","../../../../node_modules/os/package.json","../../../../node_modules/path/package.json","../../../../node_modules/path/posix/package.json","../../../../node_modules/path/win32/package.json","../../../../node_modules/perf_hooks/package.json","../../../../node_modules/querystring/package.json","../../../../node_modules/readline/package.json","../../../../node_modules/readline/promises/package.json","../../../../node_modules/repl/package.json","../../../../node_modules/stream/consumers/package.json","../../../../node_modules/stream/package.json","../../../../node_modules/stream/promises/package.json","../../../../node_modules/stream/web/package.json","../../../../node_modules/timers/package.json","../../../../node_modules/timers/promises/package.json","../../../../node_modules/tls/package.json","../../../../node_modules/trace_events/package.json","../../../../node_modules/tty/package.json","../../../../node_modules/url/package.json","../../../../node_modules/util/package.json","../../../../node_modules/util/types/package.json","../../../../node_modules/v8/package.json","../../../../node_modules/vm/package.json","../../../../node_modules/wasi/package.json","../../../../node_modules/worker_threads/package.json","../../../../node_modules/zlib/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2025.float16.d.ts","lib.esnext.disposable.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../src/lib/cross-domain-reference.ts","../src/lib/declare-cross-domain-references.ts","../src/lib/database/check-cross-domain-references.ts","../src/lib/logic/format-dangling-reference-report.ts","../../errors/dist/domain-error.d.ts","../../errors/dist/result.d.ts","../../errors/dist/stale-save.d.ts","../../errors/dist/index.d.ts","../src/lib/queries/check-cross-domain-references.query.ts","../src/index.ts","../../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../../node_modules/@types/node/web-globals/events.d.ts","../../../../node_modules/undici-types/utility.d.ts","../../../../node_modules/undici-types/header.d.ts","../../../../node_modules/undici-types/readable.d.ts","../../../../node_modules/undici-types/fetch.d.ts","../../../../node_modules/undici-types/formdata.d.ts","../../../../node_modules/undici-types/connector.d.ts","../../../../node_modules/undici-types/client-stats.d.ts","../../../../node_modules/undici-types/client.d.ts","../../../../node_modules/undici-types/errors.d.ts","../../../../node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/undici-types/global-origin.d.ts","../../../../node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/undici-types/pool.d.ts","../../../../node_modules/undici-types/handlers.d.ts","../../../../node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/undici-types/round-robin-pool.d.ts","../../../../node_modules/undici-types/h2c-client.d.ts","../../../../node_modules/undici-types/agent.d.ts","../../../../node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/undici-types/mock-call-history.d.ts","../../../../node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/undici-types/mock-client.d.ts","../../../../node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/undici-types/snapshot-agent.d.ts","../../../../node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/undici-types/api.d.ts","../../../../node_modules/undici-types/cache-interceptor.d.ts","../../../../node_modules/undici-types/interceptors.d.ts","../../../../node_modules/undici-types/util.d.ts","../../../../node_modules/undici-types/cookies.d.ts","../../../../node_modules/undici-types/patch.d.ts","../../../../node_modules/undici-types/websocket.d.ts","../../../../node_modules/undici-types/eventsource.d.ts","../../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/undici-types/content-type.d.ts","../../../../node_modules/undici-types/cache.d.ts","../../../../node_modules/undici-types/index.d.ts","../../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../../node_modules/@types/node/web-globals/storage.d.ts","../../../../node_modules/@types/node/web-globals/streams.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/buffer/index.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/inspector.generated.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/sea.d.ts","../../../../node_modules/@types/node/sqlite.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/test.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"66d7c29681cfa31210c62089c77123af","signature":"abfe7411fbd12bd39c0fb5a92bbd46d5","impliedNodeFormat":99},{"version":"1caed640d37ee32b52ea0f6468ad7e4d","signature":"a9a7620743df9306b9766c6dd11a5727","impliedNodeFormat":99},{"version":"2e3d7446e570830a0cd7041cf597855b","signature":"1951bc8897559a53cd79fed462c200cd","impliedNodeFormat":99},{"version":"5317a161cb0410796a851ca7563ea5ce","signature":"8db171dc7dccb191edb2379aa9ab970d","impliedNodeFormat":99},{"version":"9c8a354557a6330aecd6239fda834e14","impliedNodeFormat":99},{"version":"1a9e6e3e3604d720f5df6c6f493dea76","impliedNodeFormat":99},{"version":"c961811fb4b0f34f46fcb43d14312b68","impliedNodeFormat":99},{"version":"05e0f413308951c71a345000cf0b2a2e","impliedNodeFormat":99},{"version":"c73a100040f4226bc18aaf87af238409","signature":"5ed34309048624f280454f9224704b8e","impliedNodeFormat":99},{"version":"4b8812b3ad0caee921e695581f3a5136","signature":"ff1550cd620b5803ac16fe28e59a0b18","impliedNodeFormat":99},{"version":"2514e9a2749c0fc18d2f478e9e1e641e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6ae4c332ecb24e76c1e47c0e21d4663d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"69ee0752d1e70c56ca160360425752a9","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf33440030f0a0fae7d1efd6c293a8d2","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9af0a7e3ef1c42cd066b9f8d365cc1ba","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7b772cebc7136c34fc77954aef70519d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9eca652586205dc5b07f9ba57b1c8500","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ec5f75939754ce94652189ec7d0d3058","affectsGlobalScope":true,"impliedNodeFormat":1},"49133c0dfbc32ab95668c3443dea49e5","85c2cf74d24d4069fac4686501a2d7e3","9f970a4ba4bb3ed6326d46b3ddab3f63","f444b82bb192c8ecc7c9a06cba5c1fba","75de66fc4824402123c0d694ccc0a085","db51f206bae5021bd84c7079251e08e9","fcd1a513c1e5802916fa602e8b8e64bc","aedc93367cdc148d7dd56ef6fd5ef308","8e2bc11d0328ba95e490a741c44a215d","d63481078bffe02fbaf6694a35815dc7","705645fe223430c696f47b708d592ca8","28d57c837c94adb42add03d499793cab","8c01a9bbae8449be21b3e018d59a74ac","44d3b7d58481743f4726cf411e667164","679024f8e9f58a112f4badf119c4d612","74d351e4ed233e82c6d74c444c1a6b86","94d8e37d28e92494f484dd9afe8f043c","79db245997e9261ae21e5f3d93e3493b","c3659054228b00c4e2a22d9ebea8b4f0","d7e5f7a0f1f883f28458f684106e7643","c2364011a80b6a9e3cc0e77895bad577","38da5c670190f4a35cbc204ca6c616bf","d95cc0eb29beed58f5ce72db21398f53","ecd53256b1ec7379c73316eaf392a69c","db5a9211b779628398011a5b8f5b8b5d","69c7bb9c3befe9ae37eed0e6a6310fee","1cba93fafccb7b2655f0e75229185e83","094ecadae30f65a82b77343dde77a666","f75df12d75dd783b03a0329b95abdb25","b438b08b2f0ed94a95a75c8990d9021b","f2becd2589591db92ab14e803eb8bdd5","8dec66ce34e6fe771e58a92b7068edc0","30f12c2660896a33bd3c3a126392c80a","0468c0ccd0ec7770b76481b165564d62","188234d616a4f50ed9b14c8f84a39f33","4c116bcf0a47ea8fbf4072f380925fa7","22111ccb71c0e95ff0796144b40eed2b","add85ec26ba695fc99c698dbec065f8c","5bfde23f96fc502b5413d772c35e1abf","b744265d8ad12b7d4d5c5dc35d18d44e","eff32168b8348b822afeed9cbf61afa7","acaa6ef6fcd5ba662929d6036121a616",{"version":"dd1cf1cc3aa21cd78b4869a44d98c6d9","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"292c9398a407b33b1d9c9812b673387a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"45df94b3c51b898624bacc2bcd6d9eb2","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7d352f71d1b1bcc12c79dd0e4597537c","affectsGlobalScope":true,"impliedNodeFormat":1},"db11b80743ed5356b81d763a708788e6","39078ea063fcaf72bd3cca7e0d13d017","f81aa09811fa65ac6f354ab0018d3c38","e2f0114efc512fd95bdc12c81d5e8d6a",{"version":"282318b178d190157a4deacb14f3040a","affectsGlobalScope":true,"impliedNodeFormat":1},"aafe512c4216100fd65028f9b2afce83","54c5c3dcfdb5f7cf5fbbccfff6ead3fa",{"version":"dc14f078230582a2f8fb2138bfcf4f85","affectsGlobalScope":true,"impliedNodeFormat":1},"b2b472cd0bf0f8d5f022e00ca1c401f4","370d966b810b687a9e58851208cb3d4c","39b3089f3df8d14e0f2ddac0479872d9","cc7a57e86f908c313649aea8d90377e1","5c271f10d8a9b9a1206bc82a4fe5b84d","fbe31979333ec391d8b59e8f42236e8e","6751c8c175fac6bbe7b935582cdfdca7",{"version":"a3f111d2a29b6cdd04fc4b41aa560c86","affectsGlobalScope":true,"impliedNodeFormat":1},"5f4ac576bcdc670a8489c881b23a2b17","a500e7362abeae2d2f1fefea525dc869","02a1ccf1ef65bfbf65865ac4ce346974","d589d01c82f6793f20d2f5c838462e3d","dbe700f7f1fa52fd220c7ee2c6617ebc","579675a2c3b0f8c532a82ad9cbd5d384","b2e8f93606aeb2dee2a4cc9272c56973",{"version":"a8e5d3e42303570b1114b6cd9ef9f38a","affectsGlobalScope":true,"impliedNodeFormat":1},"0003c8459d069181cc4856724fcf2832","c9053dbbe4fa2853f2d3f73b9a2fee81","4e458316a6083cbd2bba2fd29f674dd5",{"version":"3cccee1f2c106192d18ac4e08119f872","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"057189402e597cd50262b082723f21ff","affectsGlobalScope":true,"impliedNodeFormat":1},"6b26581aa2587701d570206a0db8c9ee","88a29e2aac8082c0910733950159e1ca","10282f14d9c2a5cbf3bcf2b1c8cebeaf","0f80958d77cd6301b43c1d7904e3e4bc","3bdc645524ab0d2f6795d3a008833bd7","deb50b47eb75a5566532a763fa1324fa","6e61cd09c2e15845909de3ed59a00b37","3e4ffe5f2733e0589b2612bd86f6cec3","c8206d568b54e5ea06131963eecd576a","15878f4f50c2e562c0768eb735c2aed5",{"version":"cb8f7733bee3d973c152a75fad9f6da6","affectsGlobalScope":true,"impliedNodeFormat":1},"dd404118e8bd70aff746f7d31e46270b","a0fa4618173795c74b488178ea77f951",{"version":"6b8649a280031d9e86955db721cfad87","affectsGlobalScope":true,"impliedNodeFormat":1},"4bc8f13c472858fb74f77388c0c5d885","75ab229142dad0ca2ff14d02d52f11f9","c72d2516d1e8910caca33c4dff75fcd4","f0231f36cb7117fbe9271ff19ef0f5f4",{"version":"8a642eed2a45ac7028479b6089a04842","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1e6ddb6b86dc5d86e75ba797d5324346","affectsGlobalScope":true,"impliedNodeFormat":1},"701aef085585b152042aa216b06bb4b8","e9bc5b1de50e48fa9857b64091673883","9268959cff1006c82e6abbd73824db97",{"version":"8f1c048bd5761910f5ea340fe4d792cd","affectsGlobalScope":true,"impliedNodeFormat":1},"6b1f3649b0eabeaca20c778fcc5f270c","eb567c7b5824aab578f75bbccf9f4b05"],"fileIdsList":[[76,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,123,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[74,75,76,77,78,79,80,81,124,125,126,127,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,180,181],[76,123,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,123,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180],[76,88,91,94,95,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,95,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,85,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,89,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,87,88,91,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[76,85,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[76,87,91,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,82,83,84,86,90,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,100,108,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,83,89,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,117,118,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,83,86,91,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[76,82,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,85,86,87,89,90,91,92,93,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,110,113,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,100,101,102,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,89,91,101,103,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,90,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,83,85,91,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,95,101,103,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,95,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,89,91,94,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,83,87,91,100,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,91,110,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,103,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[76,85,91,117,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[64,65,66,67,72,76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[64,76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[64,66,67,71,76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[68,69,70,76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[68,76,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181]],"options":{"composite":true,"declaration":true,"declarationMap":true,"exactOptionalPropertyTypes":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"noImplicitOverride":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"sourceMap":true,"target":10,"tsBuildInfoFile":"./cross-domain-references.tsbuildinfo","useUnknownInCatchVariables":true,"verbatimModuleSyntax":true},"referencedMap":[[128,1],[129,2],[130,3],[76,4],[132,5],[133,6],[134,7],[74,8],[135,9],[136,10],[137,11],[138,12],[139,13],[140,14],[141,15],[142,16],[143,17],[144,18],[145,19],[77,8],[75,8],[146,20],[147,21],[148,22],[182,23],[149,24],[150,25],[151,26],[152,27],[153,28],[154,29],[155,30],[156,31],[157,32],[158,33],[159,34],[160,35],[161,36],[162,37],[163,38],[164,39],[166,40],[165,41],[167,42],[168,43],[169,44],[170,45],[171,46],[172,47],[173,48],[174,49],[175,50],[176,51],[177,52],[178,53],[179,54],[78,8],[79,8],[80,8],[81,8],[124,55],[125,8],[126,8],[127,8],[180,56],[181,57],[62,8],[63,8],[12,8],[11,8],[2,8],[13,8],[14,8],[15,8],[16,8],[17,8],[18,8],[19,8],[20,8],[3,8],[21,8],[22,8],[4,8],[23,8],[27,8],[24,8],[25,8],[26,8],[28,8],[29,8],[30,8],[5,8],[31,8],[32,8],[33,8],[34,8],[6,8],[38,8],[35,8],[36,8],[37,8],[39,8],[7,8],[40,8],[45,8],[46,8],[41,8],[42,8],[43,8],[44,8],[8,8],[50,8],[47,8],[48,8],[49,8],[51,8],[9,8],[52,8],[53,8],[54,8],[56,8],[55,8],[57,8],[58,8],[10,8],[59,8],[60,8],[1,8],[61,8],[131,8],[100,58],[112,59],[97,60],[113,8],[122,61],[88,62],[89,63],[87,8],[121,64],[116,65],[120,66],[91,67],[109,68],[90,69],[119,70],[85,71],[86,65],[92,59],[93,8],[99,66],[96,59],[83,72],[123,73],[114,74],[103,75],[102,59],[104,76],[107,77],[101,78],[105,79],[117,64],[94,80],[95,81],[108,82],[84,8],[111,83],[110,59],[98,81],[106,84],[115,8],[82,8],[118,85],[73,86],[64,8],[66,87],[65,87],[67,87],[72,88],[68,8],[71,89],[69,90],[70,90]],"latestChangedDtsFile":"./index.d.ts"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Public surface of the cross-domain reference kit: the
3
+ * vocabulary a domain declares its loose references in, the engine that LEFT
4
+ * JOINs them against a real database, and the report an operator reads.
5
+ *
6
+ * The live-environment action that runs the check is declared by the product,
7
+ * not here: the live-environment-actions kit declares a loose reference of its
8
+ * own, so it imports this kit, and an action defined here would close a cycle.
9
+ */
10
+ export type { CrossDomainBrandOwner, CrossDomainReference, DanglingReferenceFinding, ParentDiscriminator, ReferenceClassification, ReferenceFilter, } from "./lib/cross-domain-reference.js";
11
+ export { SAMPLE_LIMIT } from "./lib/cross-domain-reference.js";
12
+ export { assembleCrossDomainReferences, declareCrossDomainBrandOwners, declareCrossDomainReferences, } from "./lib/declare-cross-domain-references.js";
13
+ export { buildDanglingValueQuery, checkCrossDomainReferences, type CrossDomainReferenceQueryClient, } from "./lib/database/check-cross-domain-references.js";
14
+ export { formatCleanReport, formatDanglingReferenceReport, } from "./lib/logic/format-dangling-reference-report.js";
15
+ export { CheckCrossDomainReferences, type CheckCrossDomainReferencesDependencies, type CrossDomainReferenceCheckReport, } from "./lib/queries/check-cross-domain-references.query.js";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,+BAA+B,GACrC,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,0BAA0B,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,+BAA+B,GACrC,MAAM,sDAAsD,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { SAMPLE_LIMIT } from "./lib/cross-domain-reference.js";
2
+ export { assembleCrossDomainReferences, declareCrossDomainBrandOwners, declareCrossDomainReferences, } from "./lib/declare-cross-domain-references.js";
3
+ export { buildDanglingValueQuery, checkCrossDomainReferences, } from "./lib/database/check-cross-domain-references.js";
4
+ export { formatCleanReport, formatDanglingReferenceReport, } from "./lib/logic/format-dangling-reference-report.js";
5
+ export { CheckCrossDomainReferences, } from "./lib/queries/check-cross-domain-references.query.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAE3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,0BAA0B,GAG3B,MAAM,sDAAsD,CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The vocabulary one declared cross-domain reference is written in.
3
+ *
4
+ * ADR-0023 trades database enforcement for modularity: a reference that
5
+ * crosses a domain boundary is an indexed scalar id with no foreign key. The
6
+ * trade is only honest if the integrity nobody is enforcing is VERIFIED, so
7
+ * every such column is declared as data by the domain that holds it and
8
+ * checked against a real database
9
+ * (docs/architecture/data-modeling.md#verifying-the-references-no-one-constrains).
10
+ *
11
+ * These are the words; `declare-cross-domain-references.ts` is how a domain
12
+ * says them and how a product collects them.
13
+ */
14
+ /**
15
+ * ADR-0023's relationship classification, carried on every row so a finding
16
+ * reads with the policy that governs its repair.
17
+ *
18
+ * `historical-document` — the consumer recorded what was true at a business
19
+ * event and keeps its own snapshot labels. A dangling id is a broken NAVIGATION
20
+ * link; history is never rewritten to repair it.
21
+ *
22
+ * `live-association` — current provider state affects whether new consumer
23
+ * action is valid. A dangling id is a live integrity break and belongs to the
24
+ * consuming domain's repair path.
25
+ */
26
+ export type ReferenceClassification = "historical-document" | "live-association";
27
+ /** One `<column> = '<value>'` condition that narrows which rows a row applies to. */
28
+ export type ReferenceFilter = {
29
+ readonly column: string;
30
+ readonly equals: string;
31
+ };
32
+ /**
33
+ * A discriminator that does not live on the referencing row itself.
34
+ *
35
+ * `permission_set_assignments.membership_id` points at an organization
36
+ * membership or a facility membership, and the row carrying that answer is the
37
+ * parent `permission_sets.scope_type` reached through `permission_set_id`.
38
+ * Without this hop the column cannot be resolved at all, so it is modelled
39
+ * rather than skipped.
40
+ */
41
+ export type ParentDiscriminator = {
42
+ readonly table: string;
43
+ /** Column on the referencing row that names the parent. */
44
+ readonly localColumn: string;
45
+ /** Column on the parent the local column matches. */
46
+ readonly parentColumn: string;
47
+ readonly filters: readonly ReferenceFilter[];
48
+ };
49
+ /** One registered reference: which column points at which table's key. */
50
+ export type CrossDomainReference = {
51
+ /** Stable slug used in reports and in the seeded-violation proof. */
52
+ readonly id: string;
53
+ readonly consumerDomain: string;
54
+ readonly consumerTable: string;
55
+ readonly consumerColumn: string;
56
+ readonly providerDomain: string;
57
+ readonly providerTable: string;
58
+ readonly providerColumn: string;
59
+ readonly classification: ReferenceClassification;
60
+ /** Conditions on the referencing row — a polymorphic column's own `*_type`. */
61
+ readonly filters?: readonly ReferenceFilter[];
62
+ /** Conditions on a parent row, when the discriminator is not local. */
63
+ readonly discriminatedByParent?: ParentDiscriminator;
64
+ /**
65
+ * The consumer column is an ARRAY of ids (`uuid[]`), and every element is
66
+ * one reference. Each element is checked on its own; an empty array holds
67
+ * no reference, exactly as a null scalar does.
68
+ */
69
+ readonly consumerHoldsMany?: true;
70
+ };
71
+ /** One reference's findings against one database. */
72
+ export type DanglingReferenceFinding = {
73
+ readonly reference: CrossDomainReference;
74
+ /** Referencing rows whose id matches no provider row. */
75
+ readonly rows: number;
76
+ /** Distinct dangling id values behind those rows. */
77
+ readonly distinctValues: number;
78
+ /** Up to `SAMPLE_LIMIT` of those values, worst-count first. */
79
+ readonly sampleIds: readonly string[];
80
+ };
81
+ /** How many dangling ids a finding carries, so a report stays readable. */
82
+ export declare const SAMPLE_LIMIT = 5;
83
+ /**
84
+ * Who mints a branded id when the table's primary key cannot say so itself.
85
+ *
86
+ * The reference check derives brand ownership from
87
+ * the schema: the domain whose table declares
88
+ * `id: ….primaryKey()….$type<XId>()` owns `XId`. Vendored tables break that,
89
+ * because their schema is not ours to brand — Better Auth owns its own, so
90
+ * `user.id` and `sso_provider.id` are plain text columns. Declaring the owner
91
+ * beside the domain's references is what lets the rule see a `UserId` column in
92
+ * another domain as the cross-domain reference it is. An owner naming a table
93
+ * no table file declares is a detect error.
94
+ */
95
+ export type CrossDomainBrandOwner = {
96
+ /** The id brand, e.g. "UserId". */
97
+ readonly brand: string;
98
+ /** The vendored table whose unbranded primary key mints these ids. */
99
+ readonly table: string;
100
+ };
101
+ //# sourceMappingURL=cross-domain-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-domain-reference.d.ts","sourceRoot":"","sources":["../../src/lib/cross-domain-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GACjC,qBAAqB,GAAG,kBAAkB,CAAC;AAE7C,qFAAqF;AACrF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,MAA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G;IAClC,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The vocabulary one declared cross-domain reference is written in.
3
+ *
4
+ * ADR-0023 trades database enforcement for modularity: a reference that
5
+ * crosses a domain boundary is an indexed scalar id with no foreign key. The
6
+ * trade is only honest if the integrity nobody is enforcing is VERIFIED, so
7
+ * every such column is declared as data by the domain that holds it and
8
+ * checked against a real database
9
+ * (docs/architecture/data-modeling.md#verifying-the-references-no-one-constrains).
10
+ *
11
+ * These are the words; `declare-cross-domain-references.ts` is how a domain
12
+ * says them and how a product collects them.
13
+ */
14
+ /** How many dangling ids a finding carries, so a report stays readable. */
15
+ export const SAMPLE_LIMIT = 5;
16
+ //# sourceMappingURL=cross-domain-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-domain-reference.js","sourceRoot":"","sources":["../../src/lib/cross-domain-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA2EH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { CrossDomainReference, DanglingReferenceFinding } from "../cross-domain-reference.js";
2
+ /** Executes the reconciliation query through an application-owned connection. */
3
+ export type CrossDomainReferenceQueryClient = {
4
+ query(text: string, values: string[]): Promise<{
5
+ readonly rows: readonly unknown[];
6
+ }>;
7
+ };
8
+ /**
9
+ * Every registered reference, checked against one database.
10
+ *
11
+ * References are checked for EXISTENCE. A row naming a soft-deleted
12
+ * organization or facility is not dangling — ADR-0023 keeps referenced
13
+ * registry rows archived rather than removed, and status/scope validation
14
+ * belongs to the accepting mutation, not to reconciliation.
15
+ */
16
+ export declare function checkCrossDomainReferences(pool: CrossDomainReferenceQueryClient, references: readonly CrossDomainReference[]): Promise<readonly DanglingReferenceFinding[]>;
17
+ /** The LEFT JOIN anti-join for one reference, with its filter values bound. */
18
+ export declare function buildDanglingValueQuery(reference: CrossDomainReference): {
19
+ readonly text: string;
20
+ readonly values: readonly string[];
21
+ };
22
+ //# sourceMappingURL=check-cross-domain-references.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cross-domain-references.d.ts","sourceRoot":"","sources":["../../../src/lib/database/check-cross-domain-references.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,8BAA8B,CAAC;AAEtC,iFAAiF;AACjF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,CACH,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;KAAE,CAAC,CAAC;CACnD,CAAC;AAgBF;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,+BAA+B,EACrC,UAAU,EAAE,SAAS,oBAAoB,EAAE,GAC1C,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC,CAa9C;AA6CD,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,oBAAoB,GAAG;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAgDA"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * The Postgres half of the checker: LEFT JOIN every registered reference to
3
+ * the key it claims to point at, and report the values that match nothing.
4
+ *
5
+ * The engine knows no table names. Everything it runs comes from the registry,
6
+ * so adding a domain is adding rows (detection wall).
7
+ */
8
+ import { SAMPLE_LIMIT } from "../cross-domain-reference.js";
9
+ const REFERENCING = "referencing";
10
+ const REFERENCED = "referenced";
11
+ const DISCRIMINATOR = "discriminator";
12
+ const ELEMENT = "element";
13
+ /** Postgres identifiers this repo writes: lower snake case, nothing exotic. */
14
+ const SAFE_IDENTIFIER = /^[a-z_][a-z0-9_]*$/;
15
+ /**
16
+ * Every registered reference, checked against one database.
17
+ *
18
+ * References are checked for EXISTENCE. A row naming a soft-deleted
19
+ * organization or facility is not dangling — ADR-0023 keeps referenced
20
+ * registry rows archived rather than removed, and status/scope validation
21
+ * belongs to the accepting mutation, not to reconciliation.
22
+ */
23
+ export async function checkCrossDomainReferences(pool, references) {
24
+ const findings = [];
25
+ for (const reference of references) {
26
+ const dangling = await findDanglingValues(pool, reference);
27
+ if (dangling.length === 0)
28
+ continue;
29
+ findings.push({
30
+ reference,
31
+ rows: dangling.reduce((total, row) => total + row.occurrences, 0),
32
+ distinctValues: dangling.length,
33
+ sampleIds: dangling.slice(0, SAMPLE_LIMIT).map((row) => row.value),
34
+ });
35
+ }
36
+ return findings;
37
+ }
38
+ /**
39
+ * One reference's dangling values, worst count first.
40
+ *
41
+ * A failure here is never swallowed: a table or column the registry names but
42
+ * the database does not have is itself a finding about the registry, and it
43
+ * has to say which row went stale.
44
+ */
45
+ async function findDanglingValues(pool, reference) {
46
+ const { text, values } = buildDanglingValueQuery(reference);
47
+ let rows;
48
+ try {
49
+ ({ rows } = await pool.query(text, [...values]));
50
+ }
51
+ catch (error) {
52
+ const detail = error instanceof Error ? error.message : String(error);
53
+ throw new Error(`reference \`${reference.id}\` could not be checked — the registry names something this database does not have: ${detail}`, { cause: error });
54
+ }
55
+ return rows.map((row) => parseDanglingValue(row, reference.id));
56
+ }
57
+ function parseDanglingValue(row, referenceId) {
58
+ if (typeof row === "object" &&
59
+ row !== null &&
60
+ "value" in row &&
61
+ typeof row.value === "string" &&
62
+ "occurrences" in row &&
63
+ typeof row.occurrences === "number" &&
64
+ Number.isInteger(row.occurrences) &&
65
+ row.occurrences > 0) {
66
+ return { value: row.value, occurrences: row.occurrences };
67
+ }
68
+ throw new Error(`Reference ${referenceId} returned an invalid reconciliation row`);
69
+ }
70
+ /** The LEFT JOIN anti-join for one reference, with its filter values bound. */
71
+ export function buildDanglingValueQuery(reference) {
72
+ const consumerColumn = `${REFERENCING}.${quote(reference.consumerColumn)}`;
73
+ // An array column is checked one element at a time: each element is a
74
+ // reference of its own, and an empty array contributes no rows at all.
75
+ const referencingColumn = reference.consumerHoldsMany
76
+ ? `${ELEMENT}."value"`
77
+ : consumerColumn;
78
+ const unnestElements = reference.consumerHoldsMany
79
+ ? `\n CROSS JOIN LATERAL unnest(${consumerColumn}) AS ${ELEMENT}("value")`
80
+ : "";
81
+ const referencedColumn = `${REFERENCED}.${quote(reference.providerColumn)}`;
82
+ const conditions = [
83
+ `${referencingColumn} IS NOT NULL`,
84
+ `${referencedColumn} IS NULL`,
85
+ ];
86
+ const values = [];
87
+ for (const filter of reference.filters ?? []) {
88
+ conditions.push(bindFilter(REFERENCING, filter, values));
89
+ }
90
+ const parent = reference.discriminatedByParent;
91
+ const joinParent = parent === undefined
92
+ ? ""
93
+ : `\n JOIN ${quote(parent.table)} AS ${DISCRIMINATOR}` +
94
+ `\n ON ${DISCRIMINATOR}.${quote(parent.parentColumn)} = ${REFERENCING}.${quote(parent.localColumn)}`;
95
+ for (const filter of parent?.filters ?? []) {
96
+ conditions.push(bindFilter(DISCRIMINATOR, filter, values));
97
+ }
98
+ // Both sides are compared as text. `user.id` is TEXT while every uuid key is
99
+ // UUID, and `sso_provider.organization_id` is a TEXT column pointing at a
100
+ // UUID key — a typed comparison would abort the run on that one row instead
101
+ // of reporting the malformed id it exists to find.
102
+ const text = `SELECT ${referencingColumn}::text AS value, count(*)::int AS occurrences` +
103
+ `\n FROM ${quote(reference.consumerTable)} AS ${REFERENCING}` +
104
+ unnestElements +
105
+ joinParent +
106
+ `\n LEFT JOIN ${quote(reference.providerTable)} AS ${REFERENCED}` +
107
+ `\n ON ${referencedColumn}::text = ${referencingColumn}::text` +
108
+ `\n WHERE ${conditions.join("\n AND ")}` +
109
+ `\n GROUP BY 1` +
110
+ `\n ORDER BY occurrences DESC, value ASC`;
111
+ return { text, values };
112
+ }
113
+ /** Adds one filter's value to the bind list and returns its SQL condition. */
114
+ function bindFilter(alias, filter, values) {
115
+ values.push(filter.equals);
116
+ return `${alias}.${quote(filter.column)} = $${values.length}`;
117
+ }
118
+ /**
119
+ * A registry identifier, double-quoted so `user` and friends survive.
120
+ *
121
+ * Registry rows are repo-authored, never request input — but a typo that
122
+ * produced injectable SQL would be found in production rather than in review,
123
+ * so the shape is asserted rather than assumed.
124
+ */
125
+ function quote(identifier) {
126
+ if (!SAFE_IDENTIFIER.test(identifier)) {
127
+ throw new Error(`registry identifier \`${identifier}\` is not a plain lower_snake_case Postgres identifier`);
128
+ }
129
+ return `"${identifier}"`;
130
+ }
131
+ //# sourceMappingURL=check-cross-domain-references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cross-domain-references.js","sourceRoot":"","sources":["../../../src/lib/database/check-cross-domain-references.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAqB5D,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,+EAA+E;AAC/E,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAAqC,EACrC,UAA2C;IAE3C,MAAM,QAAQ,GAA+B,EAAE,CAAC;IAChD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACpC,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS;YACT,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAA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Ae,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,yBAAyB,UAAU,wDAAwD,CAC5F,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,UAAU,GAAG,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * How a domain declares the loose references it holds, and how a product
3
+ * collects them.
4
+ *
5
+ * There is no central registry. A reference belongs to the domain whose table
6
+ * carries the id, so the declaration sits in that domain beside the column it
7
+ * describes, and the product's composition root assembles one list out of them
8
+ * (every product runs the dangling-reference check over its own
9
+ * references).
10
+ *
11
+ * Both calls are walls, not decoration. They run at module load, so a
12
+ * declaration that cannot be checked correctly fails the BOOT of anything that
13
+ * imports it rather than quietly reporting the wrong rows.
14
+ */
15
+ import type { CrossDomainBrandOwner, CrossDomainReference } from "./cross-domain-reference.js";
16
+ /**
17
+ * One domain's loose cross-domain references.
18
+ *
19
+ * Two things must hold inside a domain, and both are checked here because a
20
+ * violation makes the CHECK wrong rather than the schema wrong:
21
+ *
22
+ * - ids are unique, because a finding is reported by its id;
23
+ * - a column declared more than once is narrowed by a discriminator. A
24
+ * polymorphic column declared twice without one reports every other arm's
25
+ * rows as dangling and never proves its own.
26
+ */
27
+ export declare function declareCrossDomainReferences(references: readonly CrossDomainReference[]): readonly CrossDomainReference[];
28
+ /**
29
+ * One product's whole list, assembled from its domains' declarations.
30
+ *
31
+ * An EMPTY result is valid and means what it says: this product declares no
32
+ * cross-domain reference yet. It is not silence — the check still runs, and
33
+ * reports that it checked nothing.
34
+ */
35
+ export declare function assembleCrossDomainReferences(declarations: readonly (readonly CrossDomainReference[])[]): readonly CrossDomainReference[];
36
+ /**
37
+ * The brands a domain's vendored tables mint, when the primary key cannot
38
+ * carry the brand itself. Data for the detector, never read at runtime.
39
+ */
40
+ export declare function declareCrossDomainBrandOwners(owners: readonly CrossDomainBrandOwner[]): readonly CrossDomainBrandOwner[];
41
+ //# sourceMappingURL=declare-cross-domain-references.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declare-cross-domain-references.d.ts","sourceRoot":"","sources":["../../src/lib/declare-cross-domain-references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,SAAS,oBAAoB,EAAE,GAC1C,SAAS,oBAAoB,EAAE,CAiBjC;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,SAAS,CAAC,SAAS,oBAAoB,EAAE,CAAC,EAAE,GACzD,SAAS,oBAAoB,EAAE,CAIjC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,qBAAqB,EAAE,GACvC,SAAS,qBAAqB,EAAE,CAWlC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * One domain's loose cross-domain references.
3
+ *
4
+ * Two things must hold inside a domain, and both are checked here because a
5
+ * violation makes the CHECK wrong rather than the schema wrong:
6
+ *
7
+ * - ids are unique, because a finding is reported by its id;
8
+ * - a column declared more than once is narrowed by a discriminator. A
9
+ * polymorphic column declared twice without one reports every other arm's
10
+ * rows as dangling and never proves its own.
11
+ */
12
+ export function declareCrossDomainReferences(references) {
13
+ refuseDuplicateIds(references, "declared in one domain");
14
+ for (const reference of references) {
15
+ const column = `${reference.consumerTable}.${reference.consumerColumn}`;
16
+ const arms = references.filter((other) => other.consumerTable === reference.consumerTable &&
17
+ other.consumerColumn === reference.consumerColumn);
18
+ if (arms.length === 1 || isNarrowed(reference))
19
+ continue;
20
+ throw new Error(`cross-domain reference \`${reference.id}\` shares column \`${column}\` with ${arms.length - 1} other declaration(s) and narrows nothing — a polymorphic column needs \`filters\` or \`discriminatedByParent\` on every arm`);
21
+ }
22
+ return references;
23
+ }
24
+ /**
25
+ * One product's whole list, assembled from its domains' declarations.
26
+ *
27
+ * An EMPTY result is valid and means what it says: this product declares no
28
+ * cross-domain reference yet. It is not silence — the check still runs, and
29
+ * reports that it checked nothing.
30
+ */
31
+ export function assembleCrossDomainReferences(declarations) {
32
+ const assembled = declarations.flat();
33
+ refuseDuplicateIds(assembled, "assembled for one product");
34
+ return assembled;
35
+ }
36
+ /**
37
+ * The brands a domain's vendored tables mint, when the primary key cannot
38
+ * carry the brand itself. Data for the detector, never read at runtime.
39
+ */
40
+ export function declareCrossDomainBrandOwners(owners) {
41
+ const brands = owners.map((owner) => owner.brand);
42
+ const duplicate = brands.find((brand, index) => brands.indexOf(brand) !== index);
43
+ if (duplicate !== undefined) {
44
+ throw new Error(`brand \`${duplicate}\` is declared by two tables — a brand has one minting table or none`);
45
+ }
46
+ return owners;
47
+ }
48
+ function isNarrowed(reference) {
49
+ return ((reference.filters ?? []).length > 0 ||
50
+ reference.discriminatedByParent !== undefined);
51
+ }
52
+ function refuseDuplicateIds(references, scope) {
53
+ const ids = references.map((reference) => reference.id);
54
+ const duplicate = ids.find((id, index) => ids.indexOf(id) !== index);
55
+ if (duplicate !== undefined) {
56
+ throw new Error(`two cross-domain references ${scope} share the id \`${duplicate}\` — findings are reported by id, so it has to be unique`);
57
+ }
58
+ }
59
+ //# sourceMappingURL=declare-cross-domain-references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declare-cross-domain-references.js","sourceRoot":"","sources":["../../src/lib/declare-cross-domain-references.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAA2C;IAE3C,kBAAkB,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;IAEzD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,cAAc,EAAE,CAAC;QACxE,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAC5B,C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AAED,SAAS,kBAAkB,CACzB,UAA2C,EAC3C,KAAa;IAEb,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;IACrE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,+BAA+B,KAAK,mBAAmB,SAAS,0DAA0D,CAC3H,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Turns findings into the lines an operator reads. Pure — the formatting is
3
+ * where a reconciliation report either becomes actionable or becomes noise, so
4
+ * it is testable without a database.
5
+ */
6
+ import type { DanglingReferenceFinding } from "../cross-domain-reference.js";
7
+ /** The clean-run line, so "it ran and found nothing" is never silence. */
8
+ export declare function formatCleanReport(checkedReferences: number): string;
9
+ /** One block per finding, worst first, each naming its ADR-0023 class. */
10
+ export declare function formatDanglingReferenceReport(findings: readonly DanglingReferenceFinding[], checkedReferences: number): string;
11
+ //# sourceMappingURL=format-dangling-reference-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-dangling-reference-report.d.ts","sourceRoot":"","sources":["../../../src/lib/logic/format-dangling-reference-report.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAEtC,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,0EAA0E;AAC1E,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,SAAS,wBAAwB,EAAE,EAC7C,iBAAiB,EAAE,MAAM,GACxB,MAAM,CASR"}
@@ -0,0 +1,31 @@
1
+ /** The clean-run line, so "it ran and found nothing" is never silence. */
2
+ export function formatCleanReport(checkedReferences) {
3
+ return `cross-domain reference integrity: ${checkedReferences} references checked, no dangling values`;
4
+ }
5
+ /** One block per finding, worst first, each naming its ADR-0023 class. */
6
+ export function formatDanglingReferenceReport(findings, checkedReferences) {
7
+ const ordered = [...findings].sort((left, right) => right.rows - left.rows);
8
+ const danglingRows = ordered.reduce((total, one) => total + one.rows, 0);
9
+ const header = `cross-domain reference integrity: ${checkedReferences} references checked, ` +
10
+ `${ordered.length} broken, ${count(danglingRows, "dangling row")}`;
11
+ return [header, ...ordered.map(formatFinding)].join("\n");
12
+ }
13
+ function formatFinding(finding) {
14
+ const { reference } = finding;
15
+ return [
16
+ `DANGLING ${describeReference(reference)}`,
17
+ ` ${count(finding.rows, "row")}, ${count(finding.distinctValues, "distinct id")}, ${reference.classification}`,
18
+ ` sample ids: ${finding.sampleIds.join(", ")}`,
19
+ ].join("\n");
20
+ }
21
+ /** `1 row` / `3 rows` — a report an operator reads should read like English. */
22
+ function count(amount, noun) {
23
+ return `${amount} ${noun}${amount === 1 ? "" : "s"}`;
24
+ }
25
+ /** `permission_grants.subject_id → permission_sets.id (access-management → access-management)`. */
26
+ function describeReference(reference) {
27
+ return (`${reference.consumerTable}.${reference.consumerColumn} → ` +
28
+ `${reference.providerTable}.${reference.providerColumn} ` +
29
+ `(${reference.consumerDomain} → ${reference.providerDomain})`);
30
+ }
31
+ //# sourceMappingURL=format-dangling-reference-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-dangling-reference-report.js","sourceRoot":"","sources":["../../../src/lib/logic/format-dangling-reference-report.ts"],"names":[],"mappings":"AAUA,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAAC,iBAAyB;IACzD,OAAO,qCAAqC,iBAAiB,yCAAyC,CAAC;AACzG,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,6BAA6B,CAC3C,QAA6C,EAC7C,iBAAyB;IAE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AS,CAAC,aAAa,IAAI,SAAS,CAAC,cAAc,KAAK;QAC3D,GAAG,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,cAAc,GAAG;QACzD,IAAI,SAAS,CAAC,cAAc,MAAM,SAAS,CAAC,cAAc,GAAG,CAC9D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type Result } from "@dads-framework/errors";
2
+ import type { CrossDomainReference } from "../cross-domain-reference.js";
3
+ import { type CrossDomainReferenceQueryClient } from "../database/check-cross-domain-references.js";
4
+ /** What one run of the check says, in the words the CLI prints. */
5
+ export type CrossDomainReferenceCheckReport = {
6
+ /** How many declared references the run LEFT JOINed. */
7
+ readonly checkedReferences: number;
8
+ /** How many of them had at least one value matching nothing. */
9
+ readonly danglingReferences: number;
10
+ /** Referencing rows behind those broken references. */
11
+ readonly danglingRows: number;
12
+ /** The report an operator reads — identical to `npm run db:check-references`. */
13
+ readonly report: string;
14
+ };
15
+ export type CheckCrossDomainReferencesDependencies = {
16
+ readonly pool: CrossDomainReferenceQueryClient;
17
+ /** This product's assembled declarations, from its composition root. */
18
+ readonly references: readonly CrossDomainReference[];
19
+ };
20
+ /**
21
+ * ADR-0023's detection wall, run on demand against a live environment.
22
+ *
23
+ * Read-only: it LEFT JOINs every declared reference to the key it claims to
24
+ * point at and counts what matches nothing. Nothing is repaired here and
25
+ * nothing is recorded — a finding is a report an owner acts on, which is the
26
+ * policy ADR-0023 states for a dangling reference and the reason the same
27
+ * engine serves the nightly CLI and this action.
28
+ */
29
+ export declare class CheckCrossDomainReferences {
30
+ private readonly dependencies;
31
+ constructor(dependencies: CheckCrossDomainReferencesDependencies);
32
+ execute(): Promise<Result<CrossDomainReferenceCheckReport>>;
33
+ }
34
+ //# sourceMappingURL=check-cross-domain-references.query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cross-domain-references.query.d.ts","sourceRoot":"","sources":["../../../src/lib/queries/check-cross-domain-references.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,8CAA8C,CAAC;AAMtD,mEAAmE;AACnE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,wDAAwD;IACxD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,gEAAgE;IAChE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,uDAAuD;IACvD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,IAAI,EAAE,+BAA+B,CAAC;IAC/C,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACtD,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,0BAA0B;IAEnC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAD/B,YACmB,YAAY,EAAE,sCAAsC,EACnE;IAEE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAiBhE;CACF"}
@@ -0,0 +1,32 @@
1
+ import { ok } from "@dads-framework/errors";
2
+ import { checkCrossDomainReferences, } from "../database/check-cross-domain-references.js";
3
+ import { formatCleanReport, formatDanglingReferenceReport, } from "../logic/format-dangling-reference-report.js";
4
+ /**
5
+ * ADR-0023's detection wall, run on demand against a live environment.
6
+ *
7
+ * Read-only: it LEFT JOINs every declared reference to the key it claims to
8
+ * point at and counts what matches nothing. Nothing is repaired here and
9
+ * nothing is recorded — a finding is a report an owner acts on, which is the
10
+ * policy ADR-0023 states for a dangling reference and the reason the same
11
+ * engine serves the nightly CLI and this action.
12
+ */
13
+ export class CheckCrossDomainReferences {
14
+ dependencies;
15
+ constructor(dependencies) {
16
+ this.dependencies = dependencies;
17
+ }
18
+ async execute() {
19
+ const { pool, references } = this.dependencies;
20
+ const findings = await checkCrossDomainReferences(pool, references);
21
+ const danglingRows = findings.reduce((total, finding) => total + finding.rows, 0);
22
+ return ok({
23
+ checkedReferences: references.length,
24
+ danglingReferences: findings.length,
25
+ danglingRows,
26
+ report: findings.length === 0
27
+ ? formatCleanReport(references.length)
28
+ : formatDanglingReferenceReport(findings, references.length),
29
+ });
30
+ }
31
+ }
32
+ //# sourceMappingURL=check-cross-domain-references.query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-cross-domain-references.query.js","sourceRoot":"","sources":["../../../src/lib/queries/check-cross-domain-references.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAe,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EACL,0BAA0B,GAE3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,8CAA8C,CAAC;AAoBtD;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA0B;IAElB,YAAY;IAD/B,YACmB,YAAoD;4BAApD,YAAY;IAC5B,CAAC;IAEJ,KAAK,CAAC,OAAO;QACX,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAClC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,EACxC,CAAC,CACF,CAAC;QAEF,OAAO,EAAE,CAAC;YACR,iBAAiB,EAAE,UAAU,CAAC,MAAM;YACpC,kBAAkB,EAAE,QAAQ,CAAC,MAAM;YACnC,YAAY;YACZ,MAAM,EACJ,QAAQ,CAAC,MAAM,KAAK,CAAC;gBACnB,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,MAAM,CAAC;gBACtC,CAAC,CAAC,6BAA6B,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC;SACjE,CAAC,CAAC;IACL,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@dads-framework/cross-domain-references",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "engines": {
6
+ "node": ">=22"
7
+ },
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "dependencies": {
19
+ "@dads-framework/errors": "0.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "@dads-framework/postgres": "0.1.0",
23
+ "@types/pg": "^8.20.0",
24
+ "vitest": "~4.1.0"
25
+ },
26
+ "scripts": {
27
+ "prepublishOnly": "node ../../../scripts/verify-prepublish.mjs",
28
+ "build": "tsc -b",
29
+ "test": "vitest run",
30
+ "test:integration": "VITEST_TIER=integration vitest run",
31
+ "typecheck": "tsc -b --pretty false"
32
+ },
33
+ "license": "MIT",
34
+ "author": "Bryton Cooper",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/brytoncooper/dads-framework.git",
38
+ "directory": "packages/server/cross-domain-references"
39
+ }
40
+ }