@endora-commerce/cli 0.100.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.
- package/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/bin/endora.d.ts +28 -0
- package/dist/bin/endora.d.ts.map +1 -0
- package/dist/bin/endora.js +926 -0
- package/dist/bin/endora.js.map +1 -0
- package/dist/check/estate.d.ts +189 -0
- package/dist/check/estate.d.ts.map +1 -0
- package/dist/check/estate.js +1037 -0
- package/dist/check/estate.js.map +1 -0
- package/dist/check/hosts.d.ts +25 -0
- package/dist/check/hosts.d.ts.map +1 -0
- package/dist/check/hosts.js +1347 -0
- package/dist/check/hosts.js.map +1 -0
- package/dist/check/index.d.ts +60 -0
- package/dist/check/index.d.ts.map +1 -0
- package/dist/check/index.js +111 -0
- package/dist/check/index.js.map +1 -0
- package/dist/check/layout.d.ts +136 -0
- package/dist/check/layout.d.ts.map +1 -0
- package/dist/check/layout.js +262 -0
- package/dist/check/layout.js.map +1 -0
- package/dist/check/ledger.d.ts +98 -0
- package/dist/check/ledger.d.ts.map +1 -0
- package/dist/check/ledger.js +173 -0
- package/dist/check/ledger.js.map +1 -0
- package/dist/check/peer-owners.d.ts +116 -0
- package/dist/check/peer-owners.d.ts.map +1 -0
- package/dist/check/peer-owners.js +225 -0
- package/dist/check/peer-owners.js.map +1 -0
- package/dist/check/report.d.ts +33 -0
- package/dist/check/report.d.ts.map +1 -0
- package/dist/check/report.js +107 -0
- package/dist/check/report.js.map +1 -0
- package/dist/check/run.d.ts +147 -0
- package/dist/check/run.d.ts.map +1 -0
- package/dist/check/run.js +111 -0
- package/dist/check/run.js.map +1 -0
- package/dist/checks.d.ts +17 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +17 -0
- package/dist/checks.js.map +1 -0
- package/dist/dev/index.d.ts +83 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +298 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/generate/divergence.d.ts +38 -0
- package/dist/generate/divergence.d.ts.map +1 -0
- package/dist/generate/divergence.js +237 -0
- package/dist/generate/divergence.js.map +1 -0
- package/dist/generate/index.d.ts +90 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +369 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs/declaration.d.ts +18 -0
- package/dist/inputs/declaration.d.ts.map +1 -0
- package/dist/inputs/declaration.js +64 -0
- package/dist/inputs/declaration.js.map +1 -0
- package/dist/inputs/env-file.d.ts +73 -0
- package/dist/inputs/env-file.d.ts.map +1 -0
- package/dist/inputs/env-file.js +134 -0
- package/dist/inputs/env-file.js.map +1 -0
- package/dist/inputs/prompt.d.ts +21 -0
- package/dist/inputs/prompt.d.ts.map +1 -0
- package/dist/inputs/prompt.js +59 -0
- package/dist/inputs/prompt.js.map +1 -0
- package/dist/inputs/resolve.d.ts +163 -0
- package/dist/inputs/resolve.d.ts.map +1 -0
- package/dist/inputs/resolve.js +290 -0
- package/dist/inputs/resolve.js.map +1 -0
- package/dist/install/host.d.ts +27 -0
- package/dist/install/host.d.ts.map +1 -0
- package/dist/install/host.js +90 -0
- package/dist/install/host.js.map +1 -0
- package/dist/install/index.d.ts +173 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +793 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/wizard.d.ts +144 -0
- package/dist/install/wizard.d.ts.map +1 -0
- package/dist/install/wizard.js +362 -0
- package/dist/install/wizard.js.map +1 -0
- package/dist/lib/admin-artefacts.d.ts +70 -0
- package/dist/lib/admin-artefacts.d.ts.map +1 -0
- package/dist/lib/admin-artefacts.js +354 -0
- package/dist/lib/admin-artefacts.js.map +1 -0
- package/dist/lib/admin-surfaces.d.ts +298 -0
- package/dist/lib/admin-surfaces.d.ts.map +1 -0
- package/dist/lib/admin-surfaces.js +669 -0
- package/dist/lib/admin-surfaces.js.map +1 -0
- package/dist/lib/delegated-composer.d.ts +85 -0
- package/dist/lib/delegated-composer.d.ts.map +1 -0
- package/dist/lib/delegated-composer.js +241 -0
- package/dist/lib/delegated-composer.js.map +1 -0
- package/dist/lib/divergence-artefacts.d.ts +305 -0
- package/dist/lib/divergence-artefacts.d.ts.map +1 -0
- package/dist/lib/divergence-artefacts.js +828 -0
- package/dist/lib/divergence-artefacts.js.map +1 -0
- package/dist/lib/divergence.d.ts +337 -0
- package/dist/lib/divergence.d.ts.map +1 -0
- package/dist/lib/divergence.js +1005 -0
- package/dist/lib/divergence.js.map +1 -0
- package/dist/lib/docs-artefacts.d.ts +395 -0
- package/dist/lib/docs-artefacts.d.ts.map +1 -0
- package/dist/lib/docs-artefacts.js +781 -0
- package/dist/lib/docs-artefacts.js.map +1 -0
- package/dist/lib/emitted-exports.d.ts +21 -0
- package/dist/lib/emitted-exports.d.ts.map +1 -0
- package/dist/lib/emitted-exports.js +96 -0
- package/dist/lib/emitted-exports.js.map +1 -0
- package/dist/lib/emitted-freshness.d.ts +112 -0
- package/dist/lib/emitted-freshness.d.ts.map +1 -0
- package/dist/lib/emitted-freshness.js +288 -0
- package/dist/lib/emitted-freshness.js.map +1 -0
- package/dist/lib/entity-index-artefact.d.ts +95 -0
- package/dist/lib/entity-index-artefact.d.ts.map +1 -0
- package/dist/lib/entity-index-artefact.js +210 -0
- package/dist/lib/entity-index-artefact.js.map +1 -0
- package/dist/lib/instance-build-inputs.d.ts +108 -0
- package/dist/lib/instance-build-inputs.d.ts.map +1 -0
- package/dist/lib/instance-build-inputs.js +165 -0
- package/dist/lib/instance-build-inputs.js.map +1 -0
- package/dist/lib/module-docs.d.ts +473 -0
- package/dist/lib/module-docs.d.ts.map +1 -0
- package/dist/lib/module-docs.js +711 -0
- package/dist/lib/module-docs.js.map +1 -0
- package/dist/lib/module-package-subpaths.d.ts +56 -0
- package/dist/lib/module-package-subpaths.d.ts.map +1 -0
- package/dist/lib/module-package-subpaths.js +223 -0
- package/dist/lib/module-package-subpaths.js.map +1 -0
- package/dist/lib/module-packages.d.ts +200 -0
- package/dist/lib/module-packages.d.ts.map +1 -0
- package/dist/lib/module-packages.js +580 -0
- package/dist/lib/module-packages.js.map +1 -0
- package/dist/lib/module-population.d.ts +129 -0
- package/dist/lib/module-population.d.ts.map +1 -0
- package/dist/lib/module-population.js +172 -0
- package/dist/lib/module-population.js.map +1 -0
- package/dist/lib/module-roots.d.ts +337 -0
- package/dist/lib/module-roots.d.ts.map +1 -0
- package/dist/lib/module-roots.js +586 -0
- package/dist/lib/module-roots.js.map +1 -0
- package/dist/lib/nested-checkouts.d.ts +33 -0
- package/dist/lib/nested-checkouts.d.ts.map +1 -0
- package/dist/lib/nested-checkouts.js +160 -0
- package/dist/lib/nested-checkouts.js.map +1 -0
- package/dist/lib/platform-root.d.ts +43 -0
- package/dist/lib/platform-root.d.ts.map +1 -0
- package/dist/lib/platform-root.js +134 -0
- package/dist/lib/platform-root.js.map +1 -0
- package/dist/lib/platform-surface.d.ts +235 -0
- package/dist/lib/platform-surface.d.ts.map +1 -0
- package/dist/lib/platform-surface.js +393 -0
- package/dist/lib/platform-surface.js.map +1 -0
- package/dist/lib/port-registrations.d.ts +223 -0
- package/dist/lib/port-registrations.d.ts.map +1 -0
- package/dist/lib/port-registrations.js +532 -0
- package/dist/lib/port-registrations.js.map +1 -0
- package/dist/lib/read-size.d.ts +154 -0
- package/dist/lib/read-size.d.ts.map +1 -0
- package/dist/lib/read-size.js +182 -0
- package/dist/lib/read-size.js.map +1 -0
- package/dist/lib/registration-owners.d.ts +79 -0
- package/dist/lib/registration-owners.d.ts.map +1 -0
- package/dist/lib/registration-owners.js +77 -0
- package/dist/lib/registration-owners.js.map +1 -0
- package/dist/lib/release-index.d.ts +53 -0
- package/dist/lib/release-index.d.ts.map +1 -0
- package/dist/lib/release-index.js +162 -0
- package/dist/lib/release-index.js.map +1 -0
- package/dist/lib/repeating-timers.d.ts +79 -0
- package/dist/lib/repeating-timers.d.ts.map +1 -0
- package/dist/lib/repeating-timers.js +189 -0
- package/dist/lib/repeating-timers.js.map +1 -0
- package/dist/lib/source-text.d.ts +34 -0
- package/dist/lib/source-text.d.ts.map +1 -0
- package/dist/lib/source-text.js +80 -0
- package/dist/lib/source-text.js.map +1 -0
- package/dist/lib/specifiers.d.ts +20 -0
- package/dist/lib/specifiers.d.ts.map +1 -0
- package/dist/lib/specifiers.js +130 -0
- package/dist/lib/specifiers.js.map +1 -0
- package/dist/lib/sql-tables.d.ts +166 -0
- package/dist/lib/sql-tables.d.ts.map +1 -0
- package/dist/lib/sql-tables.js +464 -0
- package/dist/lib/sql-tables.js.map +1 -0
- package/dist/lib/switchable-modules.d.ts +54 -0
- package/dist/lib/switchable-modules.d.ts.map +1 -0
- package/dist/lib/switchable-modules.js +104 -0
- package/dist/lib/switchable-modules.js.map +1 -0
- package/dist/lib/tailwind-sources.d.ts +136 -0
- package/dist/lib/tailwind-sources.d.ts.map +1 -0
- package/dist/lib/tailwind-sources.js +307 -0
- package/dist/lib/tailwind-sources.js.map +1 -0
- package/dist/lib/ui-layer.d.ts +54 -0
- package/dist/lib/ui-layer.d.ts.map +1 -0
- package/dist/lib/ui-layer.js +57 -0
- package/dist/lib/ui-layer.js.map +1 -0
- package/dist/lib/workspace-packages.d.ts +186 -0
- package/dist/lib/workspace-packages.d.ts.map +1 -0
- package/dist/lib/workspace-packages.js +351 -0
- package/dist/lib/workspace-packages.js.map +1 -0
- package/dist/new-instance/deploy.d.ts +211 -0
- package/dist/new-instance/deploy.d.ts.map +1 -0
- package/dist/new-instance/deploy.js +1381 -0
- package/dist/new-instance/deploy.js.map +1 -0
- package/dist/new-instance/docs-toolchain.d.ts +66 -0
- package/dist/new-instance/docs-toolchain.d.ts.map +1 -0
- package/dist/new-instance/docs-toolchain.js +69 -0
- package/dist/new-instance/docs-toolchain.js.map +1 -0
- package/dist/new-instance/host.d.ts +124 -0
- package/dist/new-instance/host.d.ts.map +1 -0
- package/dist/new-instance/host.js +276 -0
- package/dist/new-instance/host.js.map +1 -0
- package/dist/new-instance/index.d.ts +118 -0
- package/dist/new-instance/index.d.ts.map +1 -0
- package/dist/new-instance/index.js +567 -0
- package/dist/new-instance/index.js.map +1 -0
- package/dist/new-instance/modules.d.ts +188 -0
- package/dist/new-instance/modules.d.ts.map +1 -0
- package/dist/new-instance/modules.js +392 -0
- package/dist/new-instance/modules.js.map +1 -0
- package/dist/new-instance/template.d.ts +505 -0
- package/dist/new-instance/template.d.ts.map +1 -0
- package/dist/new-instance/template.js +1886 -0
- package/dist/new-instance/template.js.map +1 -0
- package/dist/new-module/emit.d.ts +67 -0
- package/dist/new-module/emit.d.ts.map +1 -0
- package/dist/new-module/emit.js +1393 -0
- package/dist/new-module/emit.js.map +1 -0
- package/dist/new-module/host.d.ts +67 -0
- package/dist/new-module/host.d.ts.map +1 -0
- package/dist/new-module/host.js +224 -0
- package/dist/new-module/host.js.map +1 -0
- package/dist/new-module/index.d.ts +32 -0
- package/dist/new-module/index.d.ts.map +1 -0
- package/dist/new-module/index.js +193 -0
- package/dist/new-module/index.js.map +1 -0
- package/dist/new-module/spec.d.ts +188 -0
- package/dist/new-module/spec.d.ts.map +1 -0
- package/dist/new-module/spec.js +404 -0
- package/dist/new-module/spec.js.map +1 -0
- package/dist/new-module/text.d.ts +15 -0
- package/dist/new-module/text.d.ts.map +1 -0
- package/dist/new-module/text.js +22 -0
- package/dist/new-module/text.js.map +1 -0
- package/dist/new-storefront/dockerfile.d.ts +20 -0
- package/dist/new-storefront/dockerfile.d.ts.map +1 -0
- package/dist/new-storefront/dockerfile.js +131 -0
- package/dist/new-storefront/dockerfile.js.map +1 -0
- package/dist/new-storefront/gitignore.d.ts +23 -0
- package/dist/new-storefront/gitignore.d.ts.map +1 -0
- package/dist/new-storefront/gitignore.js +39 -0
- package/dist/new-storefront/gitignore.js.map +1 -0
- package/dist/new-storefront/index.d.ts +93 -0
- package/dist/new-storefront/index.d.ts.map +1 -0
- package/dist/new-storefront/index.js +329 -0
- package/dist/new-storefront/index.js.map +1 -0
- package/dist/new-storefront/npmrc.d.ts +98 -0
- package/dist/new-storefront/npmrc.d.ts.map +1 -0
- package/dist/new-storefront/npmrc.js +217 -0
- package/dist/new-storefront/npmrc.js.map +1 -0
- package/dist/new-storefront/reference.d.ts +189 -0
- package/dist/new-storefront/reference.d.ts.map +1 -0
- package/dist/new-storefront/reference.js +430 -0
- package/dist/new-storefront/reference.js.map +1 -0
- package/dist/new-storefront/rewrite.d.ts +171 -0
- package/dist/new-storefront/rewrite.d.ts.map +1 -0
- package/dist/new-storefront/rewrite.js +701 -0
- package/dist/new-storefront/rewrite.js.map +1 -0
- package/dist/release-index.json +284 -0
- package/dist/rules/action-route-permissions.d.ts +141 -0
- package/dist/rules/action-route-permissions.d.ts.map +1 -0
- package/dist/rules/action-route-permissions.js +556 -0
- package/dist/rules/action-route-permissions.js.map +1 -0
- package/dist/rules/bundle-pairing.d.ts +74 -0
- package/dist/rules/bundle-pairing.d.ts.map +1 -0
- package/dist/rules/bundle-pairing.js +281 -0
- package/dist/rules/bundle-pairing.js.map +1 -0
- package/dist/rules/channel-resolution.d.ts +17 -0
- package/dist/rules/channel-resolution.d.ts.map +1 -0
- package/dist/rules/channel-resolution.js +382 -0
- package/dist/rules/channel-resolution.js.map +1 -0
- package/dist/rules/command-coverage.d.ts +210 -0
- package/dist/rules/command-coverage.d.ts.map +1 -0
- package/dist/rules/command-coverage.js +714 -0
- package/dist/rules/command-coverage.js.map +1 -0
- package/dist/rules/container-imports.d.ts +60 -0
- package/dist/rules/container-imports.d.ts.map +1 -0
- package/dist/rules/container-imports.js +158 -0
- package/dist/rules/container-imports.js.map +1 -0
- package/dist/rules/default-language-prose.d.ts +212 -0
- package/dist/rules/default-language-prose.d.ts.map +1 -0
- package/dist/rules/default-language-prose.js +710 -0
- package/dist/rules/default-language-prose.js.map +1 -0
- package/dist/rules/diacritic-folds.d.ts +238 -0
- package/dist/rules/diacritic-folds.d.ts.map +1 -0
- package/dist/rules/diacritic-folds.js +681 -0
- package/dist/rules/diacritic-folds.js.map +1 -0
- package/dist/rules/entity-tenant-classification.d.ts +171 -0
- package/dist/rules/entity-tenant-classification.d.ts.map +1 -0
- package/dist/rules/entity-tenant-classification.js +323 -0
- package/dist/rules/entity-tenant-classification.js.map +1 -0
- package/dist/rules/entry-presence.d.ts +142 -0
- package/dist/rules/entry-presence.d.ts.map +1 -0
- package/dist/rules/entry-presence.js +339 -0
- package/dist/rules/entry-presence.js.map +1 -0
- package/dist/rules/entry-scope.d.ts +91 -0
- package/dist/rules/entry-scope.d.ts.map +1 -0
- package/dist/rules/entry-scope.js +404 -0
- package/dist/rules/entry-scope.js.map +1 -0
- package/dist/rules/env-inputs.d.ts +222 -0
- package/dist/rules/env-inputs.d.ts.map +1 -0
- package/dist/rules/env-inputs.js +951 -0
- package/dist/rules/env-inputs.js.map +1 -0
- package/dist/rules/kernel-boundary.d.ts +37 -0
- package/dist/rules/kernel-boundary.d.ts.map +1 -0
- package/dist/rules/kernel-boundary.js +195 -0
- package/dist/rules/kernel-boundary.js.map +1 -0
- package/dist/rules/nul-bytes.d.ts +233 -0
- package/dist/rules/nul-bytes.d.ts.map +1 -0
- package/dist/rules/nul-bytes.js +332 -0
- package/dist/rules/nul-bytes.js.map +1 -0
- package/dist/rules/platform-surface.d.ts +479 -0
- package/dist/rules/platform-surface.d.ts.map +1 -0
- package/dist/rules/platform-surface.js +749 -0
- package/dist/rules/platform-surface.js.map +1 -0
- package/dist/rules/port-catches.d.ts +225 -0
- package/dist/rules/port-catches.d.ts.map +1 -0
- package/dist/rules/port-catches.js +1374 -0
- package/dist/rules/port-catches.js.map +1 -0
- package/dist/rules/port-shape.d.ts +213 -0
- package/dist/rules/port-shape.d.ts.map +1 -0
- package/dist/rules/port-shape.js +670 -0
- package/dist/rules/port-shape.js.map +1 -0
- package/dist/rules/queue-names.d.ts +108 -0
- package/dist/rules/queue-names.d.ts.map +1 -0
- package/dist/rules/queue-names.js +395 -0
- package/dist/rules/queue-names.js.map +1 -0
- package/dist/rules/singleton-identity.d.ts +205 -0
- package/dist/rules/singleton-identity.d.ts.map +1 -0
- package/dist/rules/singleton-identity.js +830 -0
- package/dist/rules/singleton-identity.js.map +1 -0
- package/dist/rules/subscribe-seam.d.ts +121 -0
- package/dist/rules/subscribe-seam.d.ts.map +1 -0
- package/dist/rules/subscribe-seam.js +594 -0
- package/dist/rules/subscribe-seam.js.map +1 -0
- package/dist/rules/transaction-context.d.ts +40 -0
- package/dist/rules/transaction-context.d.ts.map +1 -0
- package/dist/rules/transaction-context.js +294 -0
- package/dist/rules/transaction-context.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PackageLayout` — the one substitution
|
|
3
|
+
* (`specs/101-endora-check/contracts/package-scope-layout.md` §2 and §3).
|
|
4
|
+
*
|
|
5
|
+
* ## Why one seam and not thirty-five adapters
|
|
6
|
+
*
|
|
7
|
+
* `lib/module-roots.ts` is already two-sourced: a module's directory is *a
|
|
8
|
+
* directory under the application's source root named after a registered id*
|
|
9
|
+
* **or** *a workspace member declaring `endora: { type: 'module', id }`*. The
|
|
10
|
+
* second source is the package half of that derivation, and a package-scope
|
|
11
|
+
* layout is that half with the workspace enumeration replaced by a single
|
|
12
|
+
* package. Rules do not learn about packages; they keep taking their population
|
|
13
|
+
* as a parameter, and a second implementation of the layout supplies it.
|
|
14
|
+
*
|
|
15
|
+
* ## The floor is derived from the package's own declarations
|
|
16
|
+
*
|
|
17
|
+
* It has to be, because that is the only independent second author a single
|
|
18
|
+
* package has. Issue #215's refusal was never *"an empty population is exit
|
|
19
|
+
* 2"* — it was *"the walk disagreed with an independent second author about how
|
|
20
|
+
* much there was to read"*, which is what `sources=<covered>/<expected>` encodes
|
|
21
|
+
* and why `read-size.ts` has three refusal kinds rather than one. For one
|
|
22
|
+
* package that author is its `package.json`: the `exports` map and the `endora`
|
|
23
|
+
* block.
|
|
24
|
+
*
|
|
25
|
+
* So, per rule, in this order:
|
|
26
|
+
*
|
|
27
|
+
* 1. the package declares the subject and the walk found sources → `ran`;
|
|
28
|
+
* 2. the package declares the subject and the walk found nothing → **short
|
|
29
|
+
* walk**, `unreadable`, exit 2. A declared `./migrations` with no migration
|
|
30
|
+
* source is a defect, not a clean tree;
|
|
31
|
+
* 3. the package declares no subject → `not-applicable`, and the line names
|
|
32
|
+
* the declaration that is absent. The `sources=` token is **omitted**,
|
|
33
|
+
* never printed `0/0` — `read-size.ts` refuses `expected=0` as
|
|
34
|
+
* `no-expectation` and `check:admin-zones` already omits on that ground.
|
|
35
|
+
*
|
|
36
|
+
* The consequence is the point: a module package with no worker, no timer, no
|
|
37
|
+
* admin layer, no entity and no migration is *completely* evaluated and exits
|
|
38
|
+
* **0**. Nothing about it is skipped and nothing is silent.
|
|
39
|
+
*
|
|
40
|
+
* ## Nothing here spells a path
|
|
41
|
+
*
|
|
42
|
+
* Not `./backend`, not `src/`, not `dist/`, not `packages/modules` (D-100). The
|
|
43
|
+
* subpath→directory mapping comes off the package's own `exports` map and the
|
|
44
|
+
* source→artefact mapping off its own `tsconfig.build.json` `rootDir`/`outDir`,
|
|
45
|
+
* through the derivations `lib/module-packages.ts` and `lib/emitted-freshness.ts`
|
|
46
|
+
* already implement.
|
|
47
|
+
*/
|
|
48
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
49
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
50
|
+
import { nodeFreshnessFs, originOf, sourceOfEmitted, SOURCE_EXTENSIONS, } from '../lib/emitted-freshness.js';
|
|
51
|
+
import { declaredExports, readEmitLayout } from '../lib/module-packages.js';
|
|
52
|
+
import { nodeWorkspaceFs } from '../lib/workspace-packages.js';
|
|
53
|
+
/** Raised when the working directory is not a module package. Never a clean run. */
|
|
54
|
+
export class NotAModulePackageError extends Error {
|
|
55
|
+
name = 'NotAModulePackageError';
|
|
56
|
+
}
|
|
57
|
+
/** `endora.id` from a manifest, or `null` when the member is not a module's. */
|
|
58
|
+
function declaredModuleId(manifest) {
|
|
59
|
+
const endora = manifest['endora'];
|
|
60
|
+
if (typeof endora !== 'object' || endora === null || Array.isArray(endora))
|
|
61
|
+
return null;
|
|
62
|
+
const block = endora;
|
|
63
|
+
if (block['type'] !== 'module')
|
|
64
|
+
return null;
|
|
65
|
+
const id = block['id'];
|
|
66
|
+
return typeof id === 'string' && id.length > 0 ? id : null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The ledger the package declares about itself, or `null`.
|
|
70
|
+
*
|
|
71
|
+
* Declared in the `endora` block and **not discovered by filename**: a
|
|
72
|
+
* discovered filename is a convention nobody can see, which is the class of
|
|
73
|
+
* defect this programme exists against (`contracts/package-ledger.md` §2).
|
|
74
|
+
*/
|
|
75
|
+
function declaredLedger(manifest) {
|
|
76
|
+
const endora = manifest['endora'];
|
|
77
|
+
if (typeof endora !== 'object' || endora === null || Array.isArray(endora))
|
|
78
|
+
return null;
|
|
79
|
+
const value = endora['checkLedger'];
|
|
80
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
81
|
+
}
|
|
82
|
+
/** The nearest ancestor of `from` whose `package.json` declares a module. */
|
|
83
|
+
function findPackageRoot(from) {
|
|
84
|
+
let dir = resolve(from);
|
|
85
|
+
for (;;) {
|
|
86
|
+
const manifestPath = join(dir, 'package.json');
|
|
87
|
+
if (existsSync(manifestPath)) {
|
|
88
|
+
try {
|
|
89
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
90
|
+
if (declaredModuleId(manifest) !== null)
|
|
91
|
+
return dir;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// A manifest that does not parse is not this package's answer; keep
|
|
95
|
+
// walking rather than reporting the directory as not a module package,
|
|
96
|
+
// which would name the wrong repair.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const parent = resolve(dir, '..');
|
|
100
|
+
if (parent === dir)
|
|
101
|
+
return null;
|
|
102
|
+
dir = parent;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function posix(path) {
|
|
106
|
+
return path.split(sep).join('/');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The source a declared target *would* have compiled from, when none is there.
|
|
110
|
+
*
|
|
111
|
+
* `sourceOfEmitted` answers only for a source that exists — the right answer for
|
|
112
|
+
* a freshness comparison, and the wrong one here: a declared `exports` subpath
|
|
113
|
+
* whose source is gone is exactly the short walk the floor exists to refuse, and
|
|
114
|
+
* a layer dropped for that reason would be reported as a clean run over a
|
|
115
|
+
* smaller population. The extension map is `emitted-freshness.ts`', imported
|
|
116
|
+
* rather than copied.
|
|
117
|
+
*/
|
|
118
|
+
function predictedSource(pkg, emitted) {
|
|
119
|
+
const within = posix(relative(pkg.dir, emitted));
|
|
120
|
+
const prefix = pkg.emit.outDir === '' ? '' : `${pkg.emit.outDir}/`;
|
|
121
|
+
if (prefix !== '' && !within.startsWith(prefix))
|
|
122
|
+
return null;
|
|
123
|
+
const belowOut = within.slice(prefix.length);
|
|
124
|
+
for (const [emittedExtension, sourceExtensions] of SOURCE_EXTENSIONS) {
|
|
125
|
+
if (!belowOut.endsWith(emittedExtension))
|
|
126
|
+
continue;
|
|
127
|
+
const stem = belowOut.slice(0, -emittedExtension.length);
|
|
128
|
+
const extension = sourceExtensions[0];
|
|
129
|
+
if (extension === undefined)
|
|
130
|
+
continue;
|
|
131
|
+
const relativeSource = pkg.emit.rootDir === '' ? `${stem}${extension}` : `${pkg.emit.rootDir}/${stem}${extension}`;
|
|
132
|
+
return join(pkg.dir, ...relativeSource.split('/'));
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The layout for the module package at, or above, `from`.
|
|
138
|
+
*
|
|
139
|
+
* Refuses a directory that is not a module package **naming the declaration it
|
|
140
|
+
* looked for**, rather than reporting a clean run over nothing (FR-002).
|
|
141
|
+
*/
|
|
142
|
+
export function resolvePackageLayout(from) {
|
|
143
|
+
const packageRoot = findPackageRoot(from);
|
|
144
|
+
if (packageRoot === null) {
|
|
145
|
+
throw new NotAModulePackageError(`${resolve(from)} is not inside a module package: no \`package.json\` at or above it ` +
|
|
146
|
+
`declares \`endora: { "type": "module", "id": … }\`. That block is how a package ` +
|
|
147
|
+
`states what it is — the running platform reads the same one — so a run over a ` +
|
|
148
|
+
`directory without it would be a clean verdict over nothing.`);
|
|
149
|
+
}
|
|
150
|
+
const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
|
|
151
|
+
const moduleId = declaredModuleId(manifest);
|
|
152
|
+
if (moduleId === null) {
|
|
153
|
+
throw new NotAModulePackageError(`${packageRoot} declares no \`endora.id\`.`);
|
|
154
|
+
}
|
|
155
|
+
const packageName = typeof manifest['name'] === 'string' ? manifest['name'] : packageRoot;
|
|
156
|
+
const packageVersion = typeof manifest['version'] === 'string' ? manifest['version'] : '0.0.0';
|
|
157
|
+
const emit = readEmitLayout(packageRoot, packageName, nodeWorkspaceFs());
|
|
158
|
+
const exportsMap = declaredExports(manifest);
|
|
159
|
+
const sourceRoot = emit === null || emit.rootDir === '' ? packageRoot : join(packageRoot, ...emit.rootDir.split('/'));
|
|
160
|
+
const emitting = emit === null
|
|
161
|
+
? null
|
|
162
|
+
: { name: packageName, dir: packageRoot, emit, exports: exportsMap };
|
|
163
|
+
const fs = nodeFreshnessFs();
|
|
164
|
+
const layers = [];
|
|
165
|
+
let layerRefusal = null;
|
|
166
|
+
if (emitting === null) {
|
|
167
|
+
// A module package emits (D-164): `tsx` applies one tsconfig per process, so
|
|
168
|
+
// a decorated entity file outside it is lowered with standard semantics
|
|
169
|
+
// while MikroORM's are legacy, and a source-shipping module's entities die
|
|
170
|
+
// at load. Without a build layout there is no derivation from a declared
|
|
171
|
+
// subpath to the sources it publishes, so the floor has no expectation to
|
|
172
|
+
// compare — and a rule that reported clean on that basis would be reporting
|
|
173
|
+
// on a walk nothing corroborated.
|
|
174
|
+
layerRefusal =
|
|
175
|
+
`${packageName} declares no \`tsconfig.build.json\`, so which of its sources each ` +
|
|
176
|
+
`\`exports\` subpath publishes cannot be derived — and a module package emits ` +
|
|
177
|
+
`rather than shipping source (D-164), because \`tsx\` lowers a decorated entity file ` +
|
|
178
|
+
`outside its own tsconfig with the wrong decorator semantics. Add the build ` +
|
|
179
|
+
`configuration and build the package.`;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
for (const [subpath, target] of exportsMap) {
|
|
183
|
+
const absolute = join(packageRoot, ...target.replace(/^\.\//, '').split('/'));
|
|
184
|
+
// A subpath is a **source layer** iff the build produces its target. That
|
|
185
|
+
// is what keeps `./package.json` — a real subpath the build writes
|
|
186
|
+
// nothing for — out of the expectation, and it is derived from the
|
|
187
|
+
// package's own `outDir` rather than from the file's name.
|
|
188
|
+
if (originOf(absolute, emitting) !== 'emitted')
|
|
189
|
+
continue;
|
|
190
|
+
// The source, if it is there; otherwise the source it *would* have had.
|
|
191
|
+
// Existence is deliberately not the test: a declared subpath whose source
|
|
192
|
+
// is gone is the short walk the floor exists to refuse, and dropping the
|
|
193
|
+
// layer here would report it as a clean run over a smaller population.
|
|
194
|
+
const entry = sourceOfEmitted(emitting, absolute, fs) ?? predictedSource(emitting, absolute);
|
|
195
|
+
if (entry === null)
|
|
196
|
+
continue;
|
|
197
|
+
layers.push({ subpath, target, entry, directory: dirname(entry) });
|
|
198
|
+
}
|
|
199
|
+
// Deepest directory first, so a file under `src/backend` is attributed to
|
|
200
|
+
// `./backend` rather than to the root export's `src`.
|
|
201
|
+
layers.sort((a, b) => b.directory.length - a.directory.length);
|
|
202
|
+
}
|
|
203
|
+
const keyOf = (absolutePath) => posix(relative(packageRoot, absolutePath));
|
|
204
|
+
const layerOf = (absolutePath) => {
|
|
205
|
+
for (const layer of layers) {
|
|
206
|
+
if (layer.entry === absolutePath)
|
|
207
|
+
return layer;
|
|
208
|
+
const prefix = layer.directory.endsWith(sep) ? layer.directory : layer.directory + sep;
|
|
209
|
+
if (absolutePath.startsWith(prefix))
|
|
210
|
+
return layer;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
};
|
|
214
|
+
const ledger = declaredLedger(manifest);
|
|
215
|
+
return {
|
|
216
|
+
packageRoot,
|
|
217
|
+
packageName,
|
|
218
|
+
packageVersion,
|
|
219
|
+
moduleId,
|
|
220
|
+
moduleIds: [moduleId],
|
|
221
|
+
emit,
|
|
222
|
+
sourceRoot,
|
|
223
|
+
layers,
|
|
224
|
+
layerRefusal,
|
|
225
|
+
ledgerPath: ledger === null ? null : join(packageRoot, ...ledger.replace(/^\.\//, '').split('/')),
|
|
226
|
+
keyOf,
|
|
227
|
+
displayOf: keyOf,
|
|
228
|
+
layerOf,
|
|
229
|
+
emitting,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* The declaration-derived floor for one rule's walk.
|
|
234
|
+
*
|
|
235
|
+
* **Expected** is the declared layers whose own entry file the rule's walk would
|
|
236
|
+
* open — derived from the layer's entry extension, so a `./admin` layer entered
|
|
237
|
+
* at a `.tsx` file is not expected of a `.ts`-only walk and cannot be reported
|
|
238
|
+
* as a short one. **Covered** is those a walked file was attributed to.
|
|
239
|
+
*/
|
|
240
|
+
export function layerExpectation(layout, walked, opens) {
|
|
241
|
+
const expected = layout.layers.filter((layer) => opens(layer.entry));
|
|
242
|
+
const reached = new Set();
|
|
243
|
+
for (const file of walked) {
|
|
244
|
+
const layer = layout.layerOf(file);
|
|
245
|
+
if (layer !== null)
|
|
246
|
+
reached.add(layer.subpath);
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
expected,
|
|
250
|
+
covered: expected.filter((layer) => reached.has(layer.subpath)),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/** `true` when the file is on disk — used where a walk is not the evidence. */
|
|
254
|
+
export function isFile(path) {
|
|
255
|
+
try {
|
|
256
|
+
return statSync(path).isFile();
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/check/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,eAAe,EACf,iBAAiB,GAElB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,oFAAoF;AACpF,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC7B,IAAI,GAAG,wBAAwB,CAAC;CACnD;AA6DD,gFAAgF;AAChF,SAAS,gBAAgB,CAAC,QAA2C;IACnE,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACxF,MAAM,KAAK,GAAG,MAAiC,CAAC;IAChD,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC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,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjG,KAAK;QACL,SAAS,EAAE,KAAK;QAChB,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC;AAUD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAqB,EACrB,MAAyB,EACzB,KAAwC;IAExC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IACD,OAAO;QACL,QAAQ;QACR,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package ledger — acknowledged findings, and who they bind
|
|
3
|
+
* (`specs/101-endora-check/contracts/package-ledger.md`; owner ruling D-196,
|
|
4
|
+
* 2026-09-03).
|
|
5
|
+
*
|
|
6
|
+
* ## Why a package needs one
|
|
7
|
+
*
|
|
8
|
+
* There are findings that are right to stand, and this estate already knows it:
|
|
9
|
+
* the standing example is the KSeF marking on a Polish invoice, an entry in
|
|
10
|
+
* `NON_ENGLISH_DEFAULTS` expected to survive that ledger's drain. A third-party
|
|
11
|
+
* author in a regulated market will have their own. Without a ledger such a
|
|
12
|
+
* module can never reach exit 0 — and a command that cannot be satisfied stops
|
|
13
|
+
* being run, at which point **none** of the estate's rules are enforced rather
|
|
14
|
+
* than most of them.
|
|
15
|
+
*
|
|
16
|
+
* ## Two readers, two answers, and `--as-platform` is a condition of the ruling
|
|
17
|
+
*
|
|
18
|
+
* In this repository a ledger entry is adjudicated in a merge request. A
|
|
19
|
+
* stranger's is not adjudicated by us, so an unqualified package ledger would be
|
|
20
|
+
* a **self-issued exemption from the rules the platform admits modules on,
|
|
21
|
+
* granted by the party being measured** — precisely the shape
|
|
22
|
+
* `check:module-boundary` refuses for a package's own `endora` block.
|
|
23
|
+
*
|
|
24
|
+
* * the author (`endora check`) reads an acknowledged finding as
|
|
25
|
+
* *acknowledged*: printed with its reason, contributing nothing to the exit
|
|
26
|
+
* code;
|
|
27
|
+
* * the platform (`endora check --as-platform`, and whatever admission gate
|
|
28
|
+
* consumes it) reads it as **a finding**: exit 1.
|
|
29
|
+
*
|
|
30
|
+
* Both run the same analysis over the same tree and see the same findings. The
|
|
31
|
+
* ledger changes only whether an acknowledged finding contributes to the
|
|
32
|
+
* *author's* exit code. Stating this now costs one flag; retrofitting it once a
|
|
33
|
+
* module ecosystem exists costs a renegotiation with every author in it.
|
|
34
|
+
*
|
|
35
|
+
* ## Never a count
|
|
36
|
+
*
|
|
37
|
+
* Six of this repository's ledgers are per-file count ratchets, and every one
|
|
38
|
+
* exists to freeze debt that **predates its rule**. A new module package
|
|
39
|
+
* predates nothing: a count would let an author write *"3 violations in this
|
|
40
|
+
* file"* on their first commit, licensing debt that has no history, which is the
|
|
41
|
+
* single thing a ratchet must not do. Keyed entries with reasons express a
|
|
42
|
+
* *decision*; counts express a *history*, and a package has none.
|
|
43
|
+
*
|
|
44
|
+
* ## Two-way
|
|
45
|
+
*
|
|
46
|
+
* An entry describing no finding this run produced is itself a finding. That is
|
|
47
|
+
* not optional: it is the property that makes the ledger a ratchet rather than a
|
|
48
|
+
* suppression list. It also means a ledger can never turn exit 2 into exit 0 —
|
|
49
|
+
* an entry naming a rule that did not run describes no finding, so it is stale.
|
|
50
|
+
*
|
|
51
|
+
* ## It is not a `.endorarc`
|
|
52
|
+
*
|
|
53
|
+
* The CLI's constraint forbids **tool configuration**: a file that changes how
|
|
54
|
+
* the program behaves. A ledger changes **what the tree claims about itself**,
|
|
55
|
+
* in the same category as a `command-coverage-ignore` comment or a
|
|
56
|
+
* `naming:allow-snake-case` marker, and it is committed and diffable. There is
|
|
57
|
+
* no way to disable a rule here, only to acknowledge an individual finding.
|
|
58
|
+
*/
|
|
59
|
+
import type { PackageLayout } from './layout.js';
|
|
60
|
+
import type { Finding, RuleResult } from './run.js';
|
|
61
|
+
/** `<rule id>|<the rule's own key>` → the reason it is right to stand. */
|
|
62
|
+
export type PackageLedger = ReadonlyMap<string, string>;
|
|
63
|
+
/** The key a ledger entry uses for one finding. */
|
|
64
|
+
export declare function ledgerKeyOf(finding: Finding): string;
|
|
65
|
+
export interface LedgerRead {
|
|
66
|
+
readonly ledger: PackageLedger;
|
|
67
|
+
/** Refusals about the ledger file itself, each exit 1. */
|
|
68
|
+
readonly findings: readonly string[];
|
|
69
|
+
/** Where it was read from, or `null` when the package declares none. */
|
|
70
|
+
readonly path: string | null;
|
|
71
|
+
}
|
|
72
|
+
/** An empty ledger — the package that declares none. A claim, not a skip. */
|
|
73
|
+
export declare const NO_ACKNOWLEDGED_DEBT: LedgerRead;
|
|
74
|
+
/**
|
|
75
|
+
* The ledger the package declares, with the entries it refuses.
|
|
76
|
+
*
|
|
77
|
+
* A ledger that cannot be read is **not** an empty ledger: an unreadable one is
|
|
78
|
+
* reported, because silently treating it as empty would turn every acknowledged
|
|
79
|
+
* finding back into a finding with no explanation of why.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readPackageLedger(layout: PackageLayout): LedgerRead;
|
|
82
|
+
export interface LedgerApplication {
|
|
83
|
+
readonly results: readonly RuleResult[];
|
|
84
|
+
/** The ledger's own refusals plus every stale entry. Each makes the run exit 1. */
|
|
85
|
+
readonly findings: readonly string[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Split each rule's findings into unacknowledged and acknowledged, and report
|
|
89
|
+
* every entry that matched nothing.
|
|
90
|
+
*
|
|
91
|
+
* The split is the same in both readers; which half counts is
|
|
92
|
+
* {@link effectiveFindings}'s question, not this one's. That is what makes
|
|
93
|
+
* `--as-platform` a second reader of one analysis rather than a strictness dial.
|
|
94
|
+
*/
|
|
95
|
+
export declare function applyLedger(results: readonly RuleResult[], read: LedgerRead): LedgerApplication;
|
|
96
|
+
/** The reason recorded for an acknowledged finding, for the report. */
|
|
97
|
+
export declare function reasonFor(read: LedgerRead, finding: Finding): string;
|
|
98
|
+
//# sourceMappingURL=ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/check/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEpD,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExD,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,EAAE,UAIlC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,UAAU,CAgEnE;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,IAAI,EAAE,UAAU,GACf,iBAAiB,CA2BnB;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package ledger — acknowledged findings, and who they bind
|
|
3
|
+
* (`specs/101-endora-check/contracts/package-ledger.md`; owner ruling D-196,
|
|
4
|
+
* 2026-09-03).
|
|
5
|
+
*
|
|
6
|
+
* ## Why a package needs one
|
|
7
|
+
*
|
|
8
|
+
* There are findings that are right to stand, and this estate already knows it:
|
|
9
|
+
* the standing example is the KSeF marking on a Polish invoice, an entry in
|
|
10
|
+
* `NON_ENGLISH_DEFAULTS` expected to survive that ledger's drain. A third-party
|
|
11
|
+
* author in a regulated market will have their own. Without a ledger such a
|
|
12
|
+
* module can never reach exit 0 — and a command that cannot be satisfied stops
|
|
13
|
+
* being run, at which point **none** of the estate's rules are enforced rather
|
|
14
|
+
* than most of them.
|
|
15
|
+
*
|
|
16
|
+
* ## Two readers, two answers, and `--as-platform` is a condition of the ruling
|
|
17
|
+
*
|
|
18
|
+
* In this repository a ledger entry is adjudicated in a merge request. A
|
|
19
|
+
* stranger's is not adjudicated by us, so an unqualified package ledger would be
|
|
20
|
+
* a **self-issued exemption from the rules the platform admits modules on,
|
|
21
|
+
* granted by the party being measured** — precisely the shape
|
|
22
|
+
* `check:module-boundary` refuses for a package's own `endora` block.
|
|
23
|
+
*
|
|
24
|
+
* * the author (`endora check`) reads an acknowledged finding as
|
|
25
|
+
* *acknowledged*: printed with its reason, contributing nothing to the exit
|
|
26
|
+
* code;
|
|
27
|
+
* * the platform (`endora check --as-platform`, and whatever admission gate
|
|
28
|
+
* consumes it) reads it as **a finding**: exit 1.
|
|
29
|
+
*
|
|
30
|
+
* Both run the same analysis over the same tree and see the same findings. The
|
|
31
|
+
* ledger changes only whether an acknowledged finding contributes to the
|
|
32
|
+
* *author's* exit code. Stating this now costs one flag; retrofitting it once a
|
|
33
|
+
* module ecosystem exists costs a renegotiation with every author in it.
|
|
34
|
+
*
|
|
35
|
+
* ## Never a count
|
|
36
|
+
*
|
|
37
|
+
* Six of this repository's ledgers are per-file count ratchets, and every one
|
|
38
|
+
* exists to freeze debt that **predates its rule**. A new module package
|
|
39
|
+
* predates nothing: a count would let an author write *"3 violations in this
|
|
40
|
+
* file"* on their first commit, licensing debt that has no history, which is the
|
|
41
|
+
* single thing a ratchet must not do. Keyed entries with reasons express a
|
|
42
|
+
* *decision*; counts express a *history*, and a package has none.
|
|
43
|
+
*
|
|
44
|
+
* ## Two-way
|
|
45
|
+
*
|
|
46
|
+
* An entry describing no finding this run produced is itself a finding. That is
|
|
47
|
+
* not optional: it is the property that makes the ledger a ratchet rather than a
|
|
48
|
+
* suppression list. It also means a ledger can never turn exit 2 into exit 0 —
|
|
49
|
+
* an entry naming a rule that did not run describes no finding, so it is stale.
|
|
50
|
+
*
|
|
51
|
+
* ## It is not a `.endorarc`
|
|
52
|
+
*
|
|
53
|
+
* The CLI's constraint forbids **tool configuration**: a file that changes how
|
|
54
|
+
* the program behaves. A ledger changes **what the tree claims about itself**,
|
|
55
|
+
* in the same category as a `command-coverage-ignore` comment or a
|
|
56
|
+
* `naming:allow-snake-case` marker, and it is committed and diffable. There is
|
|
57
|
+
* no way to disable a rule here, only to acknowledge an individual finding.
|
|
58
|
+
*/
|
|
59
|
+
import { readFileSync } from 'node:fs';
|
|
60
|
+
/** The key a ledger entry uses for one finding. */
|
|
61
|
+
export function ledgerKeyOf(finding) {
|
|
62
|
+
return `${finding.rule}|${finding.key}`;
|
|
63
|
+
}
|
|
64
|
+
/** An empty ledger — the package that declares none. A claim, not a skip. */
|
|
65
|
+
export const NO_ACKNOWLEDGED_DEBT = {
|
|
66
|
+
ledger: new Map(),
|
|
67
|
+
findings: [],
|
|
68
|
+
path: null,
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The ledger the package declares, with the entries it refuses.
|
|
72
|
+
*
|
|
73
|
+
* A ledger that cannot be read is **not** an empty ledger: an unreadable one is
|
|
74
|
+
* reported, because silently treating it as empty would turn every acknowledged
|
|
75
|
+
* finding back into a finding with no explanation of why.
|
|
76
|
+
*/
|
|
77
|
+
export function readPackageLedger(layout) {
|
|
78
|
+
if (layout.ledgerPath === null)
|
|
79
|
+
return NO_ACKNOWLEDGED_DEBT;
|
|
80
|
+
let text;
|
|
81
|
+
try {
|
|
82
|
+
text = readFileSync(layout.ledgerPath, 'utf8');
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return {
|
|
86
|
+
ledger: new Map(),
|
|
87
|
+
path: layout.ledgerPath,
|
|
88
|
+
findings: [
|
|
89
|
+
`the \`endora.checkLedger\` declaration names ${layout.keyOf(layout.ledgerPath)}, ` +
|
|
90
|
+
`which could not be read. A declared ledger that is not there is a claim about ` +
|
|
91
|
+
`this package that nothing backs.`,
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
let parsed;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(text);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
ledger: new Map(),
|
|
102
|
+
path: layout.ledgerPath,
|
|
103
|
+
findings: [
|
|
104
|
+
`${layout.keyOf(layout.ledgerPath)} does not parse as JSON (${String(error)}).`,
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
109
|
+
return {
|
|
110
|
+
ledger: new Map(),
|
|
111
|
+
path: layout.ledgerPath,
|
|
112
|
+
findings: [
|
|
113
|
+
`${layout.keyOf(layout.ledgerPath)} is not an object of \`"<rule>|<key>": "<reason>"\` ` +
|
|
114
|
+
`entries. A ledger is keyed and reasoned; there is no other shape it can take.`,
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const ledger = new Map();
|
|
119
|
+
const findings = [];
|
|
120
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
121
|
+
if (typeof value === 'number') {
|
|
122
|
+
findings.push(`${layout.keyOf(layout.ledgerPath)}: \`${key}\` is a count. Every count ratchet in ` +
|
|
123
|
+
`this estate exists to freeze debt that predates its rule, and a new package ` +
|
|
124
|
+
`predates nothing — a count would license debt with no history. Write the reason ` +
|
|
125
|
+
`the finding is right to stand.`);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
129
|
+
findings.push(`${layout.keyOf(layout.ledgerPath)}: \`${key}\` carries no reason. An entry without ` +
|
|
130
|
+
`one is a suppression, and a suppression is what this ledger is not.`);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
ledger.set(key, value);
|
|
134
|
+
}
|
|
135
|
+
return { ledger, findings, path: layout.ledgerPath };
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Split each rule's findings into unacknowledged and acknowledged, and report
|
|
139
|
+
* every entry that matched nothing.
|
|
140
|
+
*
|
|
141
|
+
* The split is the same in both readers; which half counts is
|
|
142
|
+
* {@link effectiveFindings}'s question, not this one's. That is what makes
|
|
143
|
+
* `--as-platform` a second reader of one analysis rather than a strictness dial.
|
|
144
|
+
*/
|
|
145
|
+
export function applyLedger(results, read) {
|
|
146
|
+
const matched = new Set();
|
|
147
|
+
const applied = results.map((result) => {
|
|
148
|
+
const unacknowledged = [];
|
|
149
|
+
const acknowledged = [...result.acknowledged];
|
|
150
|
+
for (const finding of result.findings) {
|
|
151
|
+
const key = ledgerKeyOf(finding);
|
|
152
|
+
if (read.ledger.has(key)) {
|
|
153
|
+
matched.add(key);
|
|
154
|
+
acknowledged.push(finding);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
unacknowledged.push(finding);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return { ...result, findings: unacknowledged, acknowledged };
|
|
161
|
+
});
|
|
162
|
+
const stale = [...read.ledger.keys()]
|
|
163
|
+
.filter((key) => !matched.has(key))
|
|
164
|
+
.map((key) => `stale ledger entry \`${key}\`: this run produced no such finding. An entry ` +
|
|
165
|
+
`describing nothing is what makes the ledger a ratchet rather than a suppression ` +
|
|
166
|
+
`list — delete it, or find out why the rule stopped seeing the site.`);
|
|
167
|
+
return { results: applied, findings: [...read.findings, ...stale] };
|
|
168
|
+
}
|
|
169
|
+
/** The reason recorded for an acknowledged finding, for the report. */
|
|
170
|
+
export function reasonFor(read, finding) {
|
|
171
|
+
return read.ledger.get(ledgerKeyOf(finding)) ?? '';
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/check/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO,GA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