@descryy/core 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.
- package/LICENSE +21 -0
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +2 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/preconditions.d.ts +99 -0
- package/dist/capabilities/preconditions.d.ts.map +1 -0
- package/dist/capabilities/preconditions.js +94 -0
- package/dist/capabilities/preconditions.js.map +1 -0
- package/dist/contracts/engine.d.ts +90 -0
- package/dist/contracts/engine.d.ts.map +1 -0
- package/dist/contracts/engine.js +291 -0
- package/dist/contracts/engine.js.map +1 -0
- package/dist/contracts/index.d.ts +9 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/orphans.d.ts +96 -0
- package/dist/contracts/orphans.d.ts.map +1 -0
- package/dist/contracts/orphans.js +241 -0
- package/dist/contracts/orphans.js.map +1 -0
- package/dist/contracts/paths.d.ts +132 -0
- package/dist/contracts/paths.d.ts.map +1 -0
- package/dist/contracts/paths.js +245 -0
- package/dist/contracts/paths.js.map +1 -0
- package/dist/contracts/shapes.d.ts +99 -0
- package/dist/contracts/shapes.d.ts.map +1 -0
- package/dist/contracts/shapes.js +196 -0
- package/dist/contracts/shapes.js.map +1 -0
- package/dist/governance/budget.d.ts +89 -0
- package/dist/governance/budget.d.ts.map +1 -0
- package/dist/governance/budget.js +101 -0
- package/dist/governance/budget.js.map +1 -0
- package/dist/governance/candidate-boundary.d.ts +49 -0
- package/dist/governance/candidate-boundary.d.ts.map +1 -0
- package/dist/governance/candidate-boundary.js +51 -0
- package/dist/governance/candidate-boundary.js.map +1 -0
- package/dist/governance/escalation.d.ts +63 -0
- package/dist/governance/escalation.d.ts.map +1 -0
- package/dist/governance/escalation.js +72 -0
- package/dist/governance/escalation.js.map +1 -0
- package/dist/governance/fact-boundary.d.ts +77 -0
- package/dist/governance/fact-boundary.d.ts.map +1 -0
- package/dist/governance/fact-boundary.js +91 -0
- package/dist/governance/fact-boundary.js.map +1 -0
- package/dist/governance/finding-funnel.d.ts +109 -0
- package/dist/governance/finding-funnel.d.ts.map +1 -0
- package/dist/governance/finding-funnel.js +137 -0
- package/dist/governance/finding-funnel.js.map +1 -0
- package/dist/governance/index.d.ts +11 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +6 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/graph/build.d.ts +127 -0
- package/dist/graph/build.d.ts.map +1 -0
- package/dist/graph/build.js +0 -0
- package/dist/graph/build.js.map +1 -0
- package/dist/graph/cross-language.d.ts +70 -0
- package/dist/graph/cross-language.d.ts.map +1 -0
- package/dist/graph/cross-language.js +104 -0
- package/dist/graph/cross-language.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/merge.d.ts +95 -0
- package/dist/graph/merge.d.ts.map +1 -0
- package/dist/graph/merge.js +131 -0
- package/dist/graph/merge.js.map +1 -0
- package/dist/graph/persist.d.ts +42 -0
- package/dist/graph/persist.d.ts.map +1 -0
- package/dist/graph/persist.js +52 -0
- package/dist/graph/persist.js.map +1 -0
- package/dist/graph/runtime-confirmation.d.ts +169 -0
- package/dist/graph/runtime-confirmation.d.ts.map +1 -0
- package/dist/graph/runtime-confirmation.js +318 -0
- package/dist/graph/runtime-confirmation.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/ledger/index.d.ts +5 -0
- package/dist/ledger/index.d.ts.map +1 -0
- package/dist/ledger/index.js +3 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/mint.d.ts +81 -0
- package/dist/ledger/mint.d.ts.map +1 -0
- package/dist/ledger/mint.js +138 -0
- package/dist/ledger/mint.js.map +1 -0
- package/dist/ledger/resolve.d.ts +124 -0
- package/dist/ledger/resolve.d.ts.map +1 -0
- package/dist/ledger/resolve.js +290 -0
- package/dist/ledger/resolve.js.map +1 -0
- package/dist/multipr/fingerprint.d.ts +56 -0
- package/dist/multipr/fingerprint.d.ts.map +1 -0
- package/dist/multipr/fingerprint.js +169 -0
- package/dist/multipr/fingerprint.js.map +1 -0
- package/dist/multipr/hidden-dependency.d.ts +120 -0
- package/dist/multipr/hidden-dependency.d.ts.map +1 -0
- package/dist/multipr/hidden-dependency.js +185 -0
- package/dist/multipr/hidden-dependency.js.map +1 -0
- package/dist/multipr/index.d.ts +14 -0
- package/dist/multipr/index.d.ts.map +1 -0
- package/dist/multipr/index.js +8 -0
- package/dist/multipr/index.js.map +1 -0
- package/dist/multipr/mechanical.d.ts +239 -0
- package/dist/multipr/mechanical.d.ts.map +1 -0
- package/dist/multipr/mechanical.js +333 -0
- package/dist/multipr/mechanical.js.map +1 -0
- package/dist/multipr/migration-heads.d.ts +160 -0
- package/dist/multipr/migration-heads.d.ts.map +1 -0
- package/dist/multipr/migration-heads.js +212 -0
- package/dist/multipr/migration-heads.js.map +1 -0
- package/dist/multipr/overlap.d.ts +186 -0
- package/dist/multipr/overlap.d.ts.map +1 -0
- package/dist/multipr/overlap.js +254 -0
- package/dist/multipr/overlap.js.map +1 -0
- package/dist/multipr/scope-store.d.ts +105 -0
- package/dist/multipr/scope-store.d.ts.map +1 -0
- package/dist/multipr/scope-store.js +182 -0
- package/dist/multipr/scope-store.js.map +1 -0
- package/dist/multipr/superseded.d.ts +133 -0
- package/dist/multipr/superseded.d.ts.map +1 -0
- package/dist/multipr/superseded.js +128 -0
- package/dist/multipr/superseded.js.map +1 -0
- package/dist/query/confirmed-facts.d.ts +56 -0
- package/dist/query/confirmed-facts.d.ts.map +1 -0
- package/dist/query/confirmed-facts.js +64 -0
- package/dist/query/confirmed-facts.js.map +1 -0
- package/dist/query/declared-value-closure.d.ts +126 -0
- package/dist/query/declared-value-closure.d.ts.map +1 -0
- package/dist/query/declared-value-closure.js +156 -0
- package/dist/query/declared-value-closure.js.map +1 -0
- package/dist/query/index.d.ts +28 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +15 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/memory.d.ts +20 -0
- package/dist/query/memory.d.ts.map +1 -0
- package/dist/query/memory.js +55 -0
- package/dist/query/memory.js.map +1 -0
- package/dist/query/provider.d.ts +127 -0
- package/dist/query/provider.d.ts.map +1 -0
- package/dist/query/provider.js +54 -0
- package/dist/query/provider.js.map +1 -0
- package/dist/query/queries.d.ts +119 -0
- package/dist/query/queries.d.ts.map +1 -0
- package/dist/query/queries.js +267 -0
- package/dist/query/queries.js.map +1 -0
- package/dist/query/refusal-fetch.d.ts +114 -0
- package/dist/query/refusal-fetch.d.ts.map +1 -0
- package/dist/query/refusal-fetch.js +200 -0
- package/dist/query/refusal-fetch.js.map +1 -0
- package/dist/query/refusal-questions.d.ts +123 -0
- package/dist/query/refusal-questions.d.ts.map +1 -0
- package/dist/query/refusal-questions.js +122 -0
- package/dist/query/refusal-questions.js.map +1 -0
- package/dist/query/root-cause-score.d.ts +218 -0
- package/dist/query/root-cause-score.d.ts.map +1 -0
- package/dist/query/root-cause-score.js +251 -0
- package/dist/query/root-cause-score.js.map +1 -0
- package/dist/query/row-closure-picture.d.ts +108 -0
- package/dist/query/row-closure-picture.d.ts.map +1 -0
- package/dist/query/row-closure-picture.js +131 -0
- package/dist/query/row-closure-picture.js.map +1 -0
- package/dist/query/similar-incidents.d.ts +76 -0
- package/dist/query/similar-incidents.d.ts.map +1 -0
- package/dist/query/similar-incidents.js +169 -0
- package/dist/query/similar-incidents.js.map +1 -0
- package/dist/query/sqlite.d.ts +13 -0
- package/dist/query/sqlite.d.ts.map +1 -0
- package/dist/query/sqlite.js +54 -0
- package/dist/query/sqlite.js.map +1 -0
- package/dist/query/traverse.d.ts +110 -0
- package/dist/query/traverse.d.ts.map +1 -0
- package/dist/query/traverse.js +0 -0
- package/dist/query/traverse.js.map +1 -0
- package/dist/query/unresolved.d.ts +195 -0
- package/dist/query/unresolved.d.ts.map +1 -0
- package/dist/query/unresolved.js +225 -0
- package/dist/query/unresolved.js.map +1 -0
- package/dist/query/verification-status.d.ts +134 -0
- package/dist/query/verification-status.d.ts.map +1 -0
- package/dist/query/verification-status.js +163 -0
- package/dist/query/verification-status.js.map +1 -0
- package/dist/recording/index.d.ts +26 -0
- package/dist/recording/index.d.ts.map +1 -0
- package/dist/recording/index.js +30 -0
- package/dist/recording/index.js.map +1 -0
- package/dist/recording/migrate.d.ts +22 -0
- package/dist/recording/migrate.d.ts.map +1 -0
- package/dist/recording/migrate.js +51 -0
- package/dist/recording/migrate.js.map +1 -0
- package/dist/recording/reader.d.ts +27 -0
- package/dist/recording/reader.d.ts.map +1 -0
- package/dist/recording/reader.js +55 -0
- package/dist/recording/reader.js.map +1 -0
- package/dist/recording/redact.d.ts +63 -0
- package/dist/recording/redact.d.ts.map +1 -0
- package/dist/recording/redact.js +98 -0
- package/dist/recording/redact.js.map +1 -0
- package/dist/recording/schema.d.ts +41 -0
- package/dist/recording/schema.d.ts.map +1 -0
- package/dist/recording/schema.js +104 -0
- package/dist/recording/schema.js.map +1 -0
- package/dist/recording/writer.d.ts +120 -0
- package/dist/recording/writer.d.ts.map +1 -0
- package/dist/recording/writer.js +81 -0
- package/dist/recording/writer.js.map +1 -0
- package/dist/scoping/fanout.d.ts +86 -0
- package/dist/scoping/fanout.d.ts.map +1 -0
- package/dist/scoping/fanout.js +95 -0
- package/dist/scoping/fanout.js.map +1 -0
- package/dist/scoping/index.d.ts +10 -0
- package/dist/scoping/index.d.ts.map +1 -0
- package/dist/scoping/index.js +6 -0
- package/dist/scoping/index.js.map +1 -0
- package/dist/scoping/score.d.ts +83 -0
- package/dist/scoping/score.d.ts.map +1 -0
- package/dist/scoping/score.js +125 -0
- package/dist/scoping/score.js.map +1 -0
- package/dist/scoping/tiers.d.ts +32 -0
- package/dist/scoping/tiers.d.ts.map +1 -0
- package/dist/scoping/tiers.js +35 -0
- package/dist/scoping/tiers.js.map +1 -0
- package/dist/scoping/traverse.d.ts +60 -0
- package/dist/scoping/traverse.d.ts.map +1 -0
- package/dist/scoping/traverse.js +172 -0
- package/dist/scoping/traverse.js.map +1 -0
- package/dist/scoping/weights.d.ts +97 -0
- package/dist/scoping/weights.d.ts.map +1 -0
- package/dist/scoping/weights.js +167 -0
- package/dist/scoping/weights.js.map +1 -0
- package/dist/sources/git/diff.d.ts +53 -0
- package/dist/sources/git/diff.d.ts.map +1 -0
- package/dist/sources/git/diff.js +140 -0
- package/dist/sources/git/diff.js.map +1 -0
- package/dist/sources/git/env.d.ts +2 -0
- package/dist/sources/git/env.d.ts.map +1 -0
- package/dist/sources/git/env.js +21 -0
- package/dist/sources/git/env.js.map +1 -0
- package/dist/sources/git/history.d.ts +140 -0
- package/dist/sources/git/history.d.ts.map +1 -0
- package/dist/sources/git/history.js +314 -0
- package/dist/sources/git/history.js.map +1 -0
- package/dist/sources/git/index.d.ts +7 -0
- package/dist/sources/git/index.d.ts.map +1 -0
- package/dist/sources/git/index.js +4 -0
- package/dist/sources/git/index.js.map +1 -0
- package/dist/sources/git/source.d.ts +95 -0
- package/dist/sources/git/source.d.ts.map +1 -0
- package/dist/sources/git/source.js +0 -0
- package/dist/sources/git/source.js.map +1 -0
- package/dist/sources/migrations/dialects.d.ts +59 -0
- package/dist/sources/migrations/dialects.d.ts.map +1 -0
- package/dist/sources/migrations/dialects.js +84 -0
- package/dist/sources/migrations/dialects.js.map +1 -0
- package/dist/sources/migrations/index.d.ts +3 -0
- package/dist/sources/migrations/index.d.ts.map +1 -0
- package/dist/sources/migrations/index.js +2 -0
- package/dist/sources/migrations/index.js.map +1 -0
- package/dist/sources/migrations/read.d.ts +113 -0
- package/dist/sources/migrations/read.d.ts.map +1 -0
- package/dist/sources/migrations/read.js +270 -0
- package/dist/sources/migrations/read.js.map +1 -0
- package/dist/sources/workspace/index.d.ts +3 -0
- package/dist/sources/workspace/index.d.ts.map +1 -0
- package/dist/sources/workspace/index.js +2 -0
- package/dist/sources/workspace/index.js.map +1 -0
- package/dist/sources/workspace/workspace.d.ts +64 -0
- package/dist/sources/workspace/workspace.d.ts.map +1 -0
- package/dist/sources/workspace/workspace.js +294 -0
- package/dist/sources/workspace/workspace.js.map +1 -0
- package/dist/store/driver/driver.d.ts +82 -0
- package/dist/store/driver/driver.d.ts.map +1 -0
- package/dist/store/driver/driver.js +31 -0
- package/dist/store/driver/driver.js.map +1 -0
- package/dist/store/driver/node-sqlite.d.ts +28 -0
- package/dist/store/driver/node-sqlite.d.ts.map +1 -0
- package/dist/store/driver/node-sqlite.js +188 -0
- package/dist/store/driver/node-sqlite.js.map +1 -0
- package/dist/store/index.d.ts +33 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +46 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/migrate.d.ts +68 -0
- package/dist/store/migrate.d.ts.map +1 -0
- package/dist/store/migrate.js +140 -0
- package/dist/store/migrate.js.map +1 -0
- package/dist/store/reader.d.ts +127 -0
- package/dist/store/reader.d.ts.map +1 -0
- package/dist/store/reader.js +269 -0
- package/dist/store/reader.js.map +1 -0
- package/dist/store/schema.d.ts +87 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +322 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/writer.d.ts +116 -0
- package/dist/store/writer.d.ts.map +1 -0
- package/dist/store/writer.js +279 -0
- package/dist/store/writer.js.map +1 -0
- package/dist/tiers/certify.d.ts +375 -0
- package/dist/tiers/certify.d.ts.map +1 -0
- package/dist/tiers/certify.js +434 -0
- package/dist/tiers/certify.js.map +1 -0
- package/dist/tiers/index.d.ts +5 -0
- package/dist/tiers/index.d.ts.map +1 -0
- package/dist/tiers/index.js +3 -0
- package/dist/tiers/index.js.map +1 -0
- package/dist/tiers/ladder.d.ts +73 -0
- package/dist/tiers/ladder.d.ts.map +1 -0
- package/dist/tiers/ladder.js +197 -0
- package/dist/tiers/ladder.js.map +1 -0
- package/dist/validation/config-graph.d.ts +104 -0
- package/dist/validation/config-graph.d.ts.map +1 -0
- package/dist/validation/config-graph.js +205 -0
- package/dist/validation/config-graph.js.map +1 -0
- package/dist/validation/env.d.ts +243 -0
- package/dist/validation/env.d.ts.map +1 -0
- package/dist/validation/env.js +447 -0
- package/dist/validation/env.js.map +1 -0
- package/dist/validation/index.d.ts +16 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +9 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/join-substitution.d.ts +186 -0
- package/dist/validation/join-substitution.d.ts.map +1 -0
- package/dist/validation/join-substitution.js +191 -0
- package/dist/validation/join-substitution.js.map +1 -0
- package/dist/validation/migrations.d.ts +133 -0
- package/dist/validation/migrations.d.ts.map +1 -0
- package/dist/validation/migrations.js +315 -0
- package/dist/validation/migrations.js.map +1 -0
- package/dist/validation/nodes.d.ts +32 -0
- package/dist/validation/nodes.d.ts.map +1 -0
- package/dist/validation/nodes.js +45 -0
- package/dist/validation/nodes.js.map +1 -0
- package/dist/validation/rollback.d.ts +124 -0
- package/dist/validation/rollback.d.ts.map +1 -0
- package/dist/validation/rollback.js +302 -0
- package/dist/validation/rollback.js.map +1 -0
- package/dist/validation/route-drift.d.ts +108 -0
- package/dist/validation/route-drift.d.ts.map +1 -0
- package/dist/validation/route-drift.js +103 -0
- package/dist/validation/route-drift.js.map +1 -0
- package/dist/validation/sources.d.ts +153 -0
- package/dist/validation/sources.d.ts.map +1 -0
- package/dist/validation/sources.js +409 -0
- package/dist/validation/sources.js.map +1 -0
- package/dist/worker/index.d.ts +5 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +3 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/pool.d.ts +73 -0
- package/dist/worker/pool.d.ts.map +1 -0
- package/dist/worker/pool.js +203 -0
- package/dist/worker/pool.js.map +1 -0
- package/dist/worker/protocol.d.ts +91 -0
- package/dist/worker/protocol.d.ts.map +1 -0
- package/dist/worker/protocol.js +19 -0
- package/dist/worker/protocol.js.map +1 -0
- package/dist/worker/traversal.worker.d.ts +25 -0
- package/dist/worker/traversal.worker.d.ts.map +1 -0
- package/dist/worker/traversal.worker.js +124 -0
- package/dist/worker/traversal.worker.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* §15.3's environment/config check — *"cheapest and most reliable, ship first"*.
|
|
3
|
+
*
|
|
4
|
+
* The first thing in this repository that produces a statement about somebody's
|
|
5
|
+
* code rather than a measurement about the graph. Everything below is shaped by
|
|
6
|
+
* one fact, which was measured before any of it was written:
|
|
7
|
+
*
|
|
8
|
+
* > **A variable that is read and never declared is usually not a bug.**
|
|
9
|
+
*
|
|
10
|
+
* | repository | declared | read | read and never declared |
|
|
11
|
+
* | --- | --- | --- | --- |
|
|
12
|
+
* | `outline` | 91 | 23 | **18** |
|
|
13
|
+
* | `saleor` | 7 | 114 | **107** |
|
|
14
|
+
*
|
|
15
|
+
* The 107 are not defects; that repository's configuration lives in framework
|
|
16
|
+
* defaults and a deployment this run cannot see. The 18 are not defects either,
|
|
17
|
+
* and they are the more instructive set because they look plausible — container
|
|
18
|
+
* credentials, a platform's dyno id, a proxy setting, five alternates to a
|
|
19
|
+
* variable that *is* declared. A rule that reports them names a real variable at
|
|
20
|
+
* a real line and is wrong every time, which is how a tool gets uninstalled.
|
|
21
|
+
*
|
|
22
|
+
* This is the contract engine's problem in a second spelling — 117 callers, 24
|
|
23
|
+
* routes, and the 101 unmatched being a backend nobody analysed — so it takes the
|
|
24
|
+
* same two answers. **Report against evidence that exists; disclose the rest with
|
|
25
|
+
* a count.** See DEC-121.
|
|
26
|
+
*
|
|
27
|
+
* ## Three evidence sets, and the rule over them
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* reads (graph) declarations (.env*) deploy target (manifests, CI)
|
|
31
|
+
* │ │ │
|
|
32
|
+
* └───────── a finding needs two of these ────────────┘
|
|
33
|
+
* and, for a defect claim,
|
|
34
|
+
* one of them must assert *requirement*
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Requirement is asserted by exactly one thing: **the read site fails when the
|
|
38
|
+
* variable is absent.** Not "has no fallback" — that was the first rule, it was
|
|
39
|
+
* measured, and it was wrong five times out of six.
|
|
40
|
+
*
|
|
41
|
+
* ## The rule that replaced it, and the six findings that killed the first one
|
|
42
|
+
*
|
|
43
|
+
* The first version asked whether the read supplied a fallback. On `dispatch` it
|
|
44
|
+
* emitted six findings and **five were false**:
|
|
45
|
+
*
|
|
46
|
+
* | finding | source | why it was wrong |
|
|
47
|
+
* | --- | --- | --- |
|
|
48
|
+
* | `FORMKIT_ENTERPRISE_TOKEN` | `if (env.X && env.X.startsWith(…))` | a feature gate |
|
|
49
|
+
* | `VITE_DISPATCH_SENTRY_ENABLED` | `let e = env.X; if (e) {…}` | a feature gate |
|
|
50
|
+
* | `VITE_DISPATCH_SENTRY_DSN` | used only inside that gate | never reached |
|
|
51
|
+
* | `VITE_DISPATCH_AVATAR_TEMPLATE` | `const t = env.X` | absent is a valid value |
|
|
52
|
+
* | `VITE_FORMKIT_PRO_PROJECT_KEY` | `const hasPro = env.X` | the name says it |
|
|
53
|
+
*
|
|
54
|
+
* Every one is *assigned without a fallback and then tested*. Deciding
|
|
55
|
+
* requirement from the assignment needs to know what happens to the value
|
|
56
|
+
* afterwards, which is dataflow — R1 work at least, and not available here.
|
|
57
|
+
*
|
|
58
|
+
* The sixth finding was true, and the difference is the whole rule: it read
|
|
59
|
+
* through an accessor that **raises** when the variable is unset. So:
|
|
60
|
+
*
|
|
61
|
+
* - an accessor that raises on absence — a subscript, a config lookup with no
|
|
62
|
+
* declared default — **asserts requirement**;
|
|
63
|
+
* - an accessor that yields an absent value instead **asserts nothing at all**,
|
|
64
|
+
* however the result is later used.
|
|
65
|
+
*
|
|
66
|
+
* The second case is not "optional". It is *unknown at this resolution*, and it
|
|
67
|
+
* is counted and disclosed rather than assumed either way. That is why a
|
|
68
|
+
* repository whose every read yields-on-absence produces no read-side finding at
|
|
69
|
+
* all and is told so in words.
|
|
70
|
+
*
|
|
71
|
+
* **A list of platform-supplied names was considered and rejected.** It decides a
|
|
72
|
+
* fact about a variable from its spelling, it cannot be maintained across
|
|
73
|
+
* clouds, and it is silently wrong on the repository that genuinely requires
|
|
74
|
+
* `PORT`. Rule 3's shape, one level up from node types.
|
|
75
|
+
*
|
|
76
|
+
* ## The coverage guard — `nearestMiss` in a second spelling
|
|
77
|
+
*
|
|
78
|
+
* `orphans.ts` refuses to report an unmatched caller when nothing on the provider
|
|
79
|
+
* side resembles it, because the honest description is *"the provider side was
|
|
80
|
+
* never read"*. Same refusal here: before any read-side finding is emitted, the
|
|
81
|
+
* check asks what fraction of the variables the code names the repository
|
|
82
|
+
* declares *at all*. Below the floor the declaration surface is decorative, the
|
|
83
|
+
* configuration lives somewhere this run cannot see, and **nothing is reported**
|
|
84
|
+
* — only a count and the reason. That is the rule that turns `saleor`'s 107 into
|
|
85
|
+
* one honest sentence.
|
|
86
|
+
*
|
|
87
|
+
* **The denominator is every named variable, not only the required ones**, and
|
|
88
|
+
* that is not a detail. Measured over required reads alone the denominator was
|
|
89
|
+
* four on a real repository, so deleting a single declaration moved coverage
|
|
90
|
+
* from 75% to 50% and flipped the guard from reporting six findings to
|
|
91
|
+
* reporting none. A guard that inverts on one line is not a guard. Asking "does
|
|
92
|
+
* this repository declare the variables its code names" over every read is the
|
|
93
|
+
* same question with a denominator large enough to answer it — and it is what
|
|
94
|
+
* the positive control found, which is precisely what a positive control is for.
|
|
95
|
+
*
|
|
96
|
+
* ## Deploy-target surfaces can only ever suppress a finding
|
|
97
|
+
*
|
|
98
|
+
* A container manifest's `environment:` block belongs to whichever image that
|
|
99
|
+
* service runs — a database's credentials are not this application's
|
|
100
|
+
* configuration. So manifests and pipelines count towards *declared*, and never
|
|
101
|
+
* towards *undocumented*: they can prevent a finding, never create one. Without
|
|
102
|
+
* this, `outline` reports three database credentials belonging to an image it
|
|
103
|
+
* merely depends on.
|
|
104
|
+
*
|
|
105
|
+
* ## Resolution, and why a config read is not R0
|
|
106
|
+
*
|
|
107
|
+
* A `.env` file is not code. *"This name is on line 12 of one file and in none of
|
|
108
|
+
* the others"* rests on a direct read of two declarative documents with no
|
|
109
|
+
* inference at any hop — strictly better evidence than an LSP-resolved name,
|
|
110
|
+
* because nothing needed resolving. It is treated as R3, on the same precedent
|
|
111
|
+
* that lets a contract format reach R3 with no language adapter at all.
|
|
112
|
+
*
|
|
113
|
+
* A claim about what the *code* requires is capped by the node the read came
|
|
114
|
+
* from, which is R0 for a syntax-only adapter. So a `REQUIRED_NOT_DECLARED`
|
|
115
|
+
* finding lands at class C and is labelled a prediction — principle 3 working,
|
|
116
|
+
* not a defect of the check. §15.3 calls this check Class A because the
|
|
117
|
+
* underlying fact is deterministic; the resolution cap is what reconciles the
|
|
118
|
+
* two, and the report says so rather than picking one.
|
|
119
|
+
*/
|
|
120
|
+
import type { ResolutionLevel } from "@descryy/ir";
|
|
121
|
+
import type { AdjacencyProvider, QueryResult } from "../query/provider.ts";
|
|
122
|
+
import type { ConfigSurface, SurfaceScan } from "./sources.ts";
|
|
123
|
+
export type EnvFindingKind = "REQUIRED_NOT_DECLARED" | "SET_BUT_UNDOCUMENTED";
|
|
124
|
+
/**
|
|
125
|
+
* How strongly the finding is stated.
|
|
126
|
+
*
|
|
127
|
+
* `lead` follows `ROUTE_NOT_CALLED`'s precedent: a fact worth a look whose usual
|
|
128
|
+
* explanation is benign, worded so that a reader is not told it is a defect.
|
|
129
|
+
*/
|
|
130
|
+
export type EnvClaim = "defect" | "lead";
|
|
131
|
+
export interface EnvEvidence {
|
|
132
|
+
readonly file: string;
|
|
133
|
+
readonly line: number;
|
|
134
|
+
/** What this location proves, in plain words. */
|
|
135
|
+
readonly says: string;
|
|
136
|
+
}
|
|
137
|
+
export interface EnvFinding {
|
|
138
|
+
readonly kind: EnvFindingKind;
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly claim: EnvClaim;
|
|
141
|
+
/** The sentence a developer reads. */
|
|
142
|
+
readonly detail: string;
|
|
143
|
+
/** Every location the finding rests on. Never empty. */
|
|
144
|
+
readonly evidence: readonly EnvEvidence[];
|
|
145
|
+
readonly resolution: ResolutionLevel;
|
|
146
|
+
}
|
|
147
|
+
/** One env read, normalised out of `attrs.envReads` — see DEC-120. */
|
|
148
|
+
export interface EnvRead {
|
|
149
|
+
readonly name: string;
|
|
150
|
+
/**
|
|
151
|
+
* True when the read site **fails if the variable is absent** — a subscript, a
|
|
152
|
+
* config lookup with no declared default. False when the accessor yields an
|
|
153
|
+
* absent value instead, which asserts nothing about requirement either way.
|
|
154
|
+
*/
|
|
155
|
+
readonly required: boolean;
|
|
156
|
+
readonly file: string;
|
|
157
|
+
readonly line: number;
|
|
158
|
+
readonly resolution: ResolutionLevel;
|
|
159
|
+
}
|
|
160
|
+
export interface CoverageGuard {
|
|
161
|
+
/** Distinct variables read through an accessor that fails when they are absent. */
|
|
162
|
+
readonly required: number;
|
|
163
|
+
/** Every variable the code names, however it reads them. Context, not the test. */
|
|
164
|
+
readonly named: number;
|
|
165
|
+
/** How many of those the repository declares anywhere. */
|
|
166
|
+
readonly declared: number;
|
|
167
|
+
readonly ratio: number;
|
|
168
|
+
readonly floor: number;
|
|
169
|
+
readonly passed: boolean;
|
|
170
|
+
/** Of the reads that assert requirement, how many are undeclared. */
|
|
171
|
+
readonly requiredUndeclared: number;
|
|
172
|
+
/** The absolute floor: how many declared peers the guard demands. */
|
|
173
|
+
readonly minDeclared: number;
|
|
174
|
+
}
|
|
175
|
+
export interface EnvReport {
|
|
176
|
+
readonly findings: readonly EnvFinding[];
|
|
177
|
+
/** The count before `maxFindings` capped it — P27's disclosed remainder: a structured field, not only a prose note. */
|
|
178
|
+
readonly findingsTotal: number;
|
|
179
|
+
readonly surfaces: readonly {
|
|
180
|
+
readonly file: string;
|
|
181
|
+
readonly role: ConfigSurface["role"];
|
|
182
|
+
readonly example: boolean;
|
|
183
|
+
readonly declared: number;
|
|
184
|
+
}[];
|
|
185
|
+
readonly reads: {
|
|
186
|
+
/** File nodes carrying `attrs.envReads`. */
|
|
187
|
+
readonly filesWithReads: number;
|
|
188
|
+
/** File nodes carrying none — the size of the region no adapter described. */
|
|
189
|
+
readonly filesWithoutReads: number;
|
|
190
|
+
/** Variables read through an accessor that fails when they are absent. */
|
|
191
|
+
readonly required: number;
|
|
192
|
+
/**
|
|
193
|
+
* Variables read through an accessor that yields absent instead.
|
|
194
|
+
*
|
|
195
|
+
* Not "optional" — *unknown at this resolution*. Whether the code copes
|
|
196
|
+
* depends on what happens to the value afterwards, which is dataflow.
|
|
197
|
+
*/
|
|
198
|
+
readonly undetermined: number;
|
|
199
|
+
/** Reads through a computed name. A count, never a guessed name. */
|
|
200
|
+
readonly dynamic: number;
|
|
201
|
+
};
|
|
202
|
+
/** Null when no read existed at all, so the guard could not be evaluated. */
|
|
203
|
+
readonly coverage: CoverageGuard | null;
|
|
204
|
+
/** Declared and never read anywhere. A dead-configuration lead, not reported. */
|
|
205
|
+
readonly declaredNeverRead: number;
|
|
206
|
+
/** True when at least one adapter supplied env reads. */
|
|
207
|
+
readonly readsAvailable: boolean;
|
|
208
|
+
}
|
|
209
|
+
export interface EnvCheckOptions {
|
|
210
|
+
/**
|
|
211
|
+
* Minimum fraction of the variables the code names that the repository must
|
|
212
|
+
* declare before any read-side finding is emitted.
|
|
213
|
+
*
|
|
214
|
+
* **Picked before it was measured, per the gates rule.** A repository
|
|
215
|
+
* declaring fewer than this is telling you its configuration is elsewhere.
|
|
216
|
+
*/
|
|
217
|
+
readonly coverageFloor?: number;
|
|
218
|
+
/** Rule 5's cap. Overflow is disclosed, never dropped quietly. */
|
|
219
|
+
readonly maxFindings?: number;
|
|
220
|
+
/**
|
|
221
|
+
* Restrict the read side to these repo-relative files — §15.1's *"against the
|
|
222
|
+
* scoped subgraph"*. Absent means the whole graph, and the report says which.
|
|
223
|
+
*/
|
|
224
|
+
readonly files?: readonly string[];
|
|
225
|
+
/** Cap on file nodes enumerated. Truncation is reported. */
|
|
226
|
+
readonly limit?: number;
|
|
227
|
+
}
|
|
228
|
+
export declare const DEFAULT_COVERAGE_FLOOR = 0.6;
|
|
229
|
+
/**
|
|
230
|
+
* Pull `attrs.envReads` off a file node, refusing anything malformed.
|
|
231
|
+
*
|
|
232
|
+
* `attrs` is opaque above the boundary and is written by code this engine does
|
|
233
|
+
* not own, so every field is checked. A row missing `required` is **dropped, not
|
|
234
|
+
* defaulted**: defaulting it to `true` would manufacture a requirement claim
|
|
235
|
+
* from an adapter that never made one, and that claim is the whole check.
|
|
236
|
+
*/
|
|
237
|
+
export declare function readEnvReads(attrs: Readonly<Record<string, unknown>>, file: string, resolution: ResolutionLevel): {
|
|
238
|
+
readonly reads: readonly EnvRead[];
|
|
239
|
+
readonly dynamic: number;
|
|
240
|
+
readonly malformed: number;
|
|
241
|
+
};
|
|
242
|
+
export declare function checkEnvironment(provider: AdjacencyProvider, scan: SurfaceScan, options?: EnvCheckOptions): QueryResult<EnvReport>;
|
|
243
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/validation/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsHG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,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