@jam-overture/loom 0.1.0 → 0.3.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/README.md +3 -1
- package/dist/application/application.d.ts +109 -0
- package/dist/application/application.js +97 -0
- package/dist/application/memory.d.ts +20 -0
- package/dist/application/memory.js +79 -0
- package/dist/application/store.d.ts +101 -0
- package/dist/application/store.js +25 -0
- package/dist/audience/audience.d.ts +36 -0
- package/dist/audience/audience.js +41 -0
- package/dist/audience/compose.d.ts +112 -0
- package/dist/audience/compose.js +134 -0
- package/dist/audience/memory.d.ts +14 -0
- package/dist/audience/memory.js +71 -0
- package/dist/audience/overlay-store.d.ts +343 -0
- package/dist/audience/overlay-store.js +217 -0
- package/dist/audience/rule.d.ts +121 -0
- package/dist/audience/rule.js +78 -0
- package/dist/cli/index.d.ts +3 -4
- package/dist/cli/index.js +3 -4
- package/dist/cli/templates.js +19 -0
- package/dist/data/adapter.d.ts +9 -1
- package/dist/data/adapter.js +2 -0
- package/dist/data/plan.js +0 -0
- package/dist/data/resolution.d.ts +23 -1
- package/dist/data/resolve.d.ts +31 -4
- package/dist/data/resolve.js +11 -3
- package/dist/ids.d.ts +10 -0
- package/dist/ids.js +11 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interpretation/anthropic.d.ts +1 -1
- package/dist/interpretation/anthropic.js +2 -22
- package/dist/interpretation/client.d.ts +1 -1
- package/dist/interpretation/materialize.js +67 -22
- package/dist/interpretation/openai-compatible.d.ts +36 -0
- package/dist/interpretation/openai-compatible.js +79 -0
- package/dist/interpretation/status.d.ts +19 -0
- package/dist/interpretation/status.js +26 -0
- package/dist/live/index.d.ts +73 -0
- package/dist/live/index.js +73 -0
- package/dist/live/pages.d.ts +187 -0
- package/dist/live/pages.js +161 -0
- package/dist/live/pull.d.ts +147 -0
- package/dist/live/pull.js +398 -0
- package/dist/live/pulling.d.ts +79 -0
- package/dist/live/pulling.js +117 -0
- package/dist/live/window.d.ts +129 -0
- package/dist/live/window.js +132 -0
- package/dist/patch.d.ts +54 -0
- package/dist/patch.js +44 -0
- package/dist/project/closing.d.ts +51 -0
- package/dist/project/closing.js +53 -0
- package/dist/project/memory.d.ts +20 -0
- package/dist/project/memory.js +97 -0
- package/dist/project/project.d.ts +90 -0
- package/dist/project/project.js +91 -0
- package/dist/project/store.d.ts +135 -0
- package/dist/project/store.js +41 -0
- package/dist/registered.d.ts +64 -0
- package/dist/registered.js +118 -0
- package/dist/render/addressed.d.ts +35 -0
- package/dist/render/addressed.js +79 -0
- package/dist/render/behaviour-adjust.d.ts +11 -19
- package/dist/render/behaviour-adjust.js +75 -21
- package/dist/render/behaviour-present.d.ts +8 -0
- package/dist/render/behaviour-present.js +57 -6
- package/dist/render/behaviour.d.ts +98 -17
- package/dist/render/behaviour.js +91 -26
- package/dist/render/control-name.d.ts +68 -0
- package/dist/render/control-name.js +37 -0
- package/dist/render/diagnostics.d.ts +72 -0
- package/dist/render/diagnostics.js +7 -0
- package/dist/render/document-theme.d.ts +70 -0
- package/dist/render/document-theme.js +139 -0
- package/dist/render/editable.d.ts +15 -1
- package/dist/render/editable.js +13 -1
- package/dist/render/expected.d.ts +98 -0
- package/dist/render/expected.js +88 -0
- package/dist/render/index.d.ts +4 -0
- package/dist/render/index.js +4 -0
- package/dist/render/reads.d.ts +11 -0
- package/dist/render/reads.js +12 -1
- package/dist/render/render.d.ts +11 -0
- package/dist/render/render.js +294 -53
- package/dist/render/request.d.ts +8 -1
- package/dist/render/request.js +1 -0
- package/dist/render/slots.d.ts +52 -0
- package/dist/render/slots.js +24 -0
- package/dist/render/theme.d.ts +54 -1
- package/dist/render/theme.js +23 -1
- package/dist/render/unshown.d.ts +152 -0
- package/dist/render/unshown.js +80 -0
- package/dist/runtime/analysis.d.ts +94 -9
- package/dist/runtime/analysis.js +54 -9
- package/dist/runtime/assessment.d.ts +36 -2
- package/dist/runtime/assessment.js +27 -2
- package/dist/runtime/auto-apply-ceiling.d.ts +54 -0
- package/dist/runtime/auto-apply-ceiling.js +66 -0
- package/dist/runtime/checks.d.ts +148 -0
- package/dist/runtime/checks.js +112 -0
- package/dist/runtime/disposition.d.ts +96 -0
- package/dist/runtime/disposition.js +46 -0
- package/dist/runtime/gate.js +91 -10
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/irreversibility.d.ts +64 -0
- package/dist/runtime/irreversibility.js +45 -0
- package/dist/runtime/nesting.d.ts +13 -1
- package/dist/runtime/nesting.js +41 -24
- package/dist/runtime/pipeline.d.ts +43 -0
- package/dist/runtime/pipeline.js +10 -2
- package/dist/runtime/policy-change.d.ts +93 -0
- package/dist/runtime/policy-change.js +305 -0
- package/dist/runtime/policy-log.d.ts +406 -0
- package/dist/runtime/policy-log.js +285 -0
- package/dist/runtime/policy.d.ts +8 -6
- package/dist/runtime/policy.js +5 -2
- package/dist/runtime/repointing.js +0 -0
- package/dist/runtime/reversibility.d.ts +11 -9
- package/dist/runtime/stakes.d.ts +129 -1
- package/dist/runtime/stakes.js +240 -26
- package/dist/runtime/vocabulary.d.ts +164 -7
- package/dist/runtime/vocabulary.js +181 -8
- package/dist/sdk/audit.d.ts +174 -3
- package/dist/sdk/audit.js +176 -17
- package/dist/sdk/catalogue.d.ts +9 -1
- package/dist/sdk/conformance.d.ts +37 -3
- package/dist/sdk/conformance.js +25 -4
- package/dist/sdk/definition.d.ts +129 -5
- package/dist/sdk/definition.js +66 -0
- package/dist/sdk/registry.d.ts +45 -2
- package/dist/sdk/registry.js +102 -1
- package/dist/signals/acted.contract.d.ts +21 -0
- package/dist/signals/acted.contract.js +236 -0
- package/dist/signals/acted.d.ts +359 -0
- package/dist/signals/acted.js +135 -0
- package/dist/signals/action-change.d.ts +507 -0
- package/dist/signals/action-change.js +265 -0
- package/dist/signals/action.d.ts +331 -0
- package/dist/signals/action.js +182 -0
- package/dist/signals/agenda.d.ts +585 -0
- package/dist/signals/agenda.js +295 -0
- package/dist/signals/applied-window.contract.d.ts +23 -0
- package/dist/signals/applied-window.contract.js +160 -0
- package/dist/signals/arrivals.contract.d.ts +21 -0
- package/dist/signals/arrivals.contract.js +180 -0
- package/dist/signals/arrivals.d.ts +375 -0
- package/dist/signals/arrivals.js +254 -0
- package/dist/signals/arriving.d.ts +210 -0
- package/dist/signals/arriving.js +133 -0
- package/dist/signals/audiences.d.ts +528 -0
- package/dist/signals/audiences.js +255 -0
- package/dist/signals/broadcast.d.ts +33 -17
- package/dist/signals/broadcast.js +255 -32
- package/dist/signals/change.d.ts +378 -0
- package/dist/signals/change.js +327 -0
- package/dist/signals/collect.d.ts +169 -34
- package/dist/signals/collect.js +186 -38
- package/dist/signals/conversion.d.ts +348 -0
- package/dist/signals/conversion.js +235 -0
- package/dist/signals/copy-change.d.ts +553 -0
- package/dist/signals/copy-change.js +377 -0
- package/dist/signals/copy.d.ts +337 -0
- package/dist/signals/copy.js +211 -0
- package/dist/signals/correlated.contract.d.ts +24 -0
- package/dist/signals/correlated.contract.js +94 -0
- package/dist/signals/counters.d.ts +97 -0
- package/dist/signals/counters.js +160 -0
- package/dist/signals/deliver.d.ts +23 -4
- package/dist/signals/deliver.js +34 -6
- package/dist/signals/deployment-change.d.ts +395 -0
- package/dist/signals/deployment-change.js +309 -0
- package/dist/signals/deployment.d.ts +278 -0
- package/dist/signals/deployment.js +178 -0
- package/dist/signals/door.d.ts +114 -0
- package/dist/signals/door.js +77 -0
- package/dist/signals/expire.d.ts +192 -0
- package/dist/signals/expire.js +213 -0
- package/dist/signals/fold.d.ts +10 -0
- package/dist/signals/fold.js +5 -1
- package/dist/signals/form-action.d.ts +302 -0
- package/dist/signals/form-action.js +169 -0
- package/dist/signals/form-copy.d.ts +523 -0
- package/dist/signals/form-copy.js +346 -0
- package/dist/signals/forms.d.ts +247 -0
- package/dist/signals/forms.js +147 -0
- package/dist/signals/frontier.d.ts +268 -0
- package/dist/signals/frontier.js +145 -0
- package/dist/signals/funnel-change.d.ts +548 -0
- package/dist/signals/funnel-change.js +361 -0
- package/dist/signals/funnel-hours.contract.d.ts +21 -0
- package/dist/signals/funnel-hours.contract.js +221 -0
- package/dist/signals/funnel-hours.d.ts +293 -0
- package/dist/signals/funnel-hours.js +99 -0
- package/dist/signals/funnel.d.ts +592 -0
- package/dist/signals/funnel.js +231 -0
- package/dist/signals/health.d.ts +694 -0
- package/dist/signals/health.js +573 -0
- package/dist/signals/index.d.ts +60 -0
- package/dist/signals/index.js +60 -0
- package/dist/signals/ingest.d.ts +56 -1
- package/dist/signals/ingest.js +91 -1
- package/dist/signals/inside.d.ts +190 -0
- package/dist/signals/inside.js +263 -0
- package/dist/signals/join.d.ts +56 -0
- package/dist/signals/join.js +60 -0
- package/dist/signals/journal.d.ts +123 -9
- package/dist/signals/kept.contract.d.ts +22 -0
- package/dist/signals/kept.contract.js +111 -0
- package/dist/signals/kinds.d.ts +8 -6
- package/dist/signals/kinds.js +14 -6
- package/dist/signals/library-action.d.ts +430 -0
- package/dist/signals/library-action.js +336 -0
- package/dist/signals/library-agenda-change.d.ts +324 -0
- package/dist/signals/library-agenda-change.js +199 -0
- package/dist/signals/library-agenda.d.ts +258 -0
- package/dist/signals/library-agenda.js +167 -0
- package/dist/signals/library-change.d.ts +477 -0
- package/dist/signals/library-change.js +335 -0
- package/dist/signals/library-copy-change.d.ts +498 -0
- package/dist/signals/library-copy-change.js +476 -0
- package/dist/signals/library-pace.d.ts +319 -0
- package/dist/signals/library-pace.js +305 -0
- package/dist/signals/library-reach-change.d.ts +646 -0
- package/dist/signals/library-reach-change.js +542 -0
- package/dist/signals/library-reach.d.ts +377 -0
- package/dist/signals/library-reach.js +227 -0
- package/dist/signals/library-senders-change.d.ts +457 -0
- package/dist/signals/library-senders-change.js +367 -0
- package/dist/signals/library-senders-reach-change.d.ts +486 -0
- package/dist/signals/library-senders-reach-change.js +538 -0
- package/dist/signals/library-senders-reach.d.ts +340 -0
- package/dist/signals/library-senders-reach.js +252 -0
- package/dist/signals/library-senders.d.ts +271 -0
- package/dist/signals/library-senders.js +180 -0
- package/dist/signals/library-word-reach-change.d.ts +567 -0
- package/dist/signals/library-word-reach-change.js +564 -0
- package/dist/signals/library.d.ts +306 -0
- package/dist/signals/library.js +178 -0
- package/dist/signals/memory.d.ts +9 -0
- package/dist/signals/memory.js +246 -14
- package/dist/signals/migrate.d.ts +20 -4
- package/dist/signals/migrate.js +269 -8
- package/dist/signals/notice.d.ts +389 -0
- package/dist/signals/notice.js +250 -0
- package/dist/signals/pace-change.d.ts +501 -0
- package/dist/signals/pace-change.js +310 -0
- package/dist/signals/pace.d.ts +296 -0
- package/dist/signals/pace.js +291 -0
- package/dist/signals/page-views.d.ts +365 -0
- package/dist/signals/page-views.js +218 -0
- package/dist/signals/part-pace.d.ts +378 -0
- package/dist/signals/part-pace.js +333 -0
- package/dist/signals/parts.d.ts +354 -0
- package/dist/signals/parts.js +232 -0
- package/dist/signals/postgres.d.ts +16 -2
- package/dist/signals/postgres.js +753 -76
- package/dist/signals/progress.d.ts +212 -0
- package/dist/signals/progress.js +150 -0
- package/dist/signals/ratios.d.ts +108 -0
- package/dist/signals/ratios.js +40 -0
- package/dist/signals/reach.d.ts +309 -0
- package/dist/signals/reach.js +93 -0
- package/dist/signals/readable.d.ts +34 -0
- package/dist/signals/readable.js +34 -0
- package/dist/signals/readership.d.ts +381 -0
- package/dist/signals/readership.js +308 -0
- package/dist/signals/region-pages.d.ts +173 -0
- package/dist/signals/region-pages.js +62 -0
- package/dist/signals/region.d.ts +287 -0
- package/dist/signals/region.js +198 -0
- package/dist/signals/retention.d.ts +163 -0
- package/dist/signals/retention.js +75 -0
- package/dist/signals/rhythm.d.ts +302 -0
- package/dist/signals/rhythm.js +262 -0
- package/dist/signals/rollup.d.ts +194 -4
- package/dist/signals/rollup.js +0 -0
- package/dist/signals/schema.d.ts +1069 -1
- package/dist/signals/schema.js +393 -3
- package/dist/signals/signal.d.ts +237 -11
- package/dist/signals/signal.js +70 -10
- package/dist/signals/silence-census.d.ts +205 -0
- package/dist/signals/silence-census.js +87 -0
- package/dist/signals/silences.d.ts +1147 -0
- package/dist/signals/silences.js +996 -0
- package/dist/signals/subtrees.d.ts +123 -0
- package/dist/signals/subtrees.js +102 -0
- package/dist/signals/tally.d.ts +262 -12
- package/dist/signals/unread.d.ts +292 -0
- package/dist/signals/unread.js +137 -0
- package/dist/signals/window-agenda.d.ts +276 -0
- package/dist/signals/window-agenda.js +83 -0
- package/dist/signals/window-figures.d.ts +148 -0
- package/dist/signals/window-figures.js +42 -0
- package/dist/signals/window-funnels.d.ts +88 -0
- package/dist/signals/window-funnels.js +47 -0
- package/dist/signals/window.d.ts +866 -0
- package/dist/signals/window.js +693 -0
- package/dist/signals/words.d.ts +24 -0
- package/dist/signals/words.js +24 -0
- package/dist/store/cache.d.ts +101 -0
- package/dist/store/cache.js +149 -0
- package/dist/store/history.d.ts +82 -0
- package/dist/store/history.js +36 -0
- package/dist/store/index.d.ts +30 -0
- package/dist/store/index.js +30 -0
- package/dist/store/memory.d.ts +2 -1
- package/dist/store/memory.js +48 -12
- package/dist/store/migrate.d.ts +106 -0
- package/dist/store/migrate.js +323 -7
- package/dist/store/postgres-applications.d.ts +4 -0
- package/dist/store/postgres-applications.js +197 -0
- package/dist/store/postgres-audience.d.ts +14 -0
- package/dist/store/postgres-audience.js +272 -0
- package/dist/store/postgres-holds.d.ts +10 -1
- package/dist/store/postgres-holds.js +116 -101
- package/dist/store/postgres-policy-log.d.ts +14 -0
- package/dist/store/postgres-policy-log.js +240 -0
- package/dist/store/postgres-projects.d.ts +4 -0
- package/dist/store/postgres-projects.js +217 -0
- package/dist/store/postgres.d.ts +17 -1
- package/dist/store/postgres.js +60 -9
- package/dist/store/replay.d.ts +102 -1
- package/dist/store/replay.js +190 -19
- package/dist/store/reseed.d.ts +238 -0
- package/dist/store/reseed.js +308 -0
- package/dist/store/schema.d.ts +762 -2
- package/dist/store/schema.js +218 -5
- package/dist/store/source.d.ts +57 -1
- package/dist/store/source.js +65 -1
- package/dist/store/store.d.ts +29 -6
- package/dist/submit/resolve.d.ts +1 -1
- package/dist/submit/resolve.js +2 -1
- package/dist/telemetry/calibration.d.ts +25 -0
- package/dist/telemetry/calibration.js +27 -1
- package/dist/telemetry/event.d.ts +391 -33
- package/dist/telemetry/event.js +84 -20
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/journal.d.ts +104 -3
- package/dist/telemetry/journal.js +9 -0
- package/dist/telemetry/lookup.d.ts +27 -0
- package/dist/telemetry/lookup.js +18 -0
- package/dist/telemetry/memory.js +33 -1
- package/dist/telemetry/migrate.js +22 -1
- package/dist/telemetry/postgres.d.ts +10 -1
- package/dist/telemetry/postgres.js +188 -90
- package/dist/telemetry/remeasure.d.ts +78 -0
- package/dist/telemetry/remeasure.js +83 -0
- package/dist/telemetry/retention.d.ts +2 -2
- package/dist/telemetry/schema.d.ts +17 -0
- package/dist/telemetry/schema.js +27 -1
- package/dist/telemetry/sink.d.ts +2 -2
- package/dist/telemetry/window.d.ts +135 -0
- package/dist/telemetry/window.js +101 -0
- package/dist/testing/application-contract.d.ts +14 -0
- package/dist/testing/application-contract.js +270 -0
- package/dist/testing/audience-overlay-contract.d.ts +31 -0
- package/dist/testing/audience-overlay-contract.js +354 -0
- package/dist/testing/contracts.d.ts +13 -7
- package/dist/testing/contracts.js +13 -7
- package/dist/testing/definitions.d.ts +78 -0
- package/dist/testing/definitions.js +134 -9
- package/dist/testing/doubles.d.ts +103 -0
- package/dist/testing/doubles.js +143 -0
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +2 -2
- package/dist/testing/journal-contract.js +297 -6
- package/dist/testing/model-contract.d.ts +110 -0
- package/dist/testing/model-contract.js +150 -0
- package/dist/testing/policy-log-contract.d.ts +26 -0
- package/dist/testing/policy-log-contract.js +344 -0
- package/dist/testing/project-contract.d.ts +14 -0
- package/dist/testing/project-contract.js +266 -0
- package/dist/testing/reader-signal-contract.d.ts +27 -2
- package/dist/testing/reader-signal-contract.js +475 -5
- package/dist/testing/store-contract.d.ts +7 -1
- package/dist/testing/store-contract.js +84 -3
- package/dist/theme/apply.d.ts +20 -1
- package/dist/theme/apply.js +5 -3
- package/dist/theme/contrast.d.ts +19 -14
- package/dist/theme/contrast.js +181 -17
- package/dist/theme/derive.d.ts +22 -0
- package/dist/theme/derive.js +54 -1
- package/dist/theme/library.js +1 -1
- package/dist/theme/measure.d.ts +34 -0
- package/dist/theme/measure.js +30 -1
- package/dist/theme/palettes.js +7 -7
- package/dist/theme/ramp.d.ts +64 -0
- package/dist/theme/ramp.js +114 -0
- package/dist/theme/registry.d.ts +9 -0
- package/dist/theme/registry.js +11 -1
- package/dist/theme/separation.d.ts +97 -3
- package/dist/theme/separation.js +75 -0
- package/dist/tree/apply.js +13 -0
- package/dist/tree/compare.d.ts +9 -0
- package/dist/tree/compare.js +18 -0
- package/dist/tree/mutation.d.ts +18 -0
- package/dist/tree/mutation.js +24 -12
- package/dist/tree/navigation.d.ts +5 -0
- package/dist/tree/navigation.js +32 -10
- package/dist/tree/outline.d.ts +7 -0
- package/dist/tree/outline.js +9 -5
- package/dist/write/computed.d.ts +60 -0
- package/dist/write/computed.js +61 -0
- package/dist/write/held.d.ts +59 -0
- package/dist/write/index.d.ts +5 -2
- package/dist/write/index.js +5 -2
- package/dist/write/reseed.d.ts +151 -0
- package/dist/write/reseed.js +184 -0
- package/dist/write/revert.js +2 -16
- package/package.json +25 -3
- package/dist/runtime/inverse-interpreter.d.ts +0 -90
- package/dist/runtime/inverse-interpreter.js +0 -56
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import type { NodeId } from "../ids.js";
|
|
2
|
+
import type { PrimitiveType } from "../primitive-type.js";
|
|
3
|
+
import { type PrimitiveRole } from "../role.js";
|
|
4
|
+
import { type KindKey } from "./library.js";
|
|
5
|
+
import type { PageReading } from "./parts.js";
|
|
6
|
+
/**
|
|
7
|
+
* **Which of a deployment's components are silent.**
|
|
8
|
+
*
|
|
9
|
+
* [0382](../../decisions/0382-a-part-that-reported-nothing-with-a-reader-below-it-is-an-eighth-collection-fault-and-it-reaches-both-ranking-keys.md)
|
|
10
|
+
* named the defect: a part that reported nothing while a part **inside** it
|
|
11
|
+
* reported reach. A reader was demonstrably below it, so it was on a screen and
|
|
12
|
+
* did not say so — a primitive that does not spread the identity attributes a
|
|
13
|
+
* broadcaster reads, or a sender switched on halfway through a release. It is
|
|
14
|
+
* raised per page, as `parts-unreporting` on `PageHealth` ([`health.ts`](health.ts)), and it reaches
|
|
15
|
+
* both of the fix-list's ranking keys.
|
|
16
|
+
*
|
|
17
|
+
* **Per page is the wrong unit for it, and this is the right one.** A deployment
|
|
18
|
+
* with forty pages built out of one silent `loom.accordion` gets forty faulted
|
|
19
|
+
* pages, and nothing in the repository says they are forty symptoms of one
|
|
20
|
+
* thing. The fix is in the library — one primitive, once — and the errand the
|
|
21
|
+
* fix-list hands over is *rewrite these forty pages*. This gathers the same
|
|
22
|
+
* defect by {@link KindKey}, the way
|
|
23
|
+
* [`library.ts`](library.ts) gathers standing and
|
|
24
|
+
* [`library-reach.ts`](library-reach.ts) gathers readers, so the sentence is
|
|
25
|
+
* *`loom.accordion` is silent in thirty-one of the thirty-four places it stands,
|
|
26
|
+
* across nineteen of your pages*.
|
|
27
|
+
*
|
|
28
|
+
* It is the **twenty-fourth** reading taken out of the server-side join of 0212
|
|
29
|
+
* rather than collected: no payload field, no counter, no column, no table, no
|
|
30
|
+
* byte on any wire, and nothing in a reader's browser.
|
|
31
|
+
*
|
|
32
|
+
* ## The denominator is the placements the defect could be seen on
|
|
33
|
+
*
|
|
34
|
+
* This is the whole of the design and the only place it can go wrong.
|
|
35
|
+
*
|
|
36
|
+
* A silent **leaf** — a heading, a price, a control with nothing under it —
|
|
37
|
+
* produces exactly the rows a part nobody reached produces. There is no witness
|
|
38
|
+
* below it and there never can be, so the defect is undetectable there. A
|
|
39
|
+
* placement that holds parts but whose window reported no reach below it is
|
|
40
|
+
* undetectable **today**: nobody has been under it yet.
|
|
41
|
+
*
|
|
42
|
+
* So every placement is in exactly one of three states, and they add to
|
|
43
|
+
* {@link KindSenders.placements}:
|
|
44
|
+
*
|
|
45
|
+
* - {@link KindSenders.leaves} — holds nothing. Never checkable.
|
|
46
|
+
* - {@link KindSenders.unwitnessed} — holds parts, nothing below reported reach.
|
|
47
|
+
* Not checkable in this window.
|
|
48
|
+
* - {@link KindSenders.witnessed} — at least one part below reported reach. The
|
|
49
|
+
* population this reading is about.
|
|
50
|
+
*
|
|
51
|
+
* {@link KindSenders.share} is `silent ÷ witnessed` and never `silent ÷
|
|
52
|
+
* placements`. Dividing by the placements would make every library of mostly
|
|
53
|
+
* leaves look healthy and every quiet window look healthier still — a share that
|
|
54
|
+
* moves when readers arrive rather than when a sender is fixed, which is the
|
|
55
|
+
* direction 0212 says a census of a quiet deployment must never be wrong in.
|
|
56
|
+
*
|
|
57
|
+
* ## The share is a floor, and the bracket says by how much
|
|
58
|
+
*
|
|
59
|
+
* A witnessed placement whose own standing is `unknown` reported *something
|
|
60
|
+
* other than coming into view* with a reader below it — a press delegated to a
|
|
61
|
+
* band no `viewed` ever named. That is plausibly the same defect and 0382 does
|
|
62
|
+
* not claim it, because `unknown` is the absence of a claim (0282) and a fault
|
|
63
|
+
* raised on an absence would be the lie in the direction nobody checks.
|
|
64
|
+
*
|
|
65
|
+
* It is not dropped either. {@link KindSenders.indeterminate} counts those
|
|
66
|
+
* placements, {@link KindSenders.share} excludes them from the numerator and
|
|
67
|
+
* {@link KindSenders.atMost} includes them, so the true rate is bracketed rather
|
|
68
|
+
* than guessed. Where `indeterminate` is nought the two are equal and the
|
|
69
|
+
* bracket is a point, which is what a deployment with working senders publishes.
|
|
70
|
+
*
|
|
71
|
+
* ## It is the same defect the page reading raises, not a second one
|
|
72
|
+
*
|
|
73
|
+
* {@link KindSenders.silent} is counted on the rule `pageFrontierOf` is counted
|
|
74
|
+
* on — `skipped` with reach below it — spelled once in
|
|
75
|
+
* [`subtrees.ts`](subtrees.ts) and shared with it. The totals agree with the
|
|
76
|
+
* sum of `PageFrontier.notReporting` over the same readings term for term, which
|
|
77
|
+
* is asserted rather than described. Two numbers about one defect that could
|
|
78
|
+
* drift apart is the failure this subsystem already has several names for.
|
|
79
|
+
*
|
|
80
|
+
* ## One page counted twice is the one lie a census can tell
|
|
81
|
+
*
|
|
82
|
+
* A caller that concatenated two reads holds one revision twice. Readings are
|
|
83
|
+
* deduplicated on `readingKeyOf` and the drops are reported in
|
|
84
|
+
* {@link LibrarySenders.duplicated}
|
|
85
|
+
* ([0158](../../decisions/0158-counting-a-window-of-reader-signals-and-forgetting-it-are-one-operation.md)).
|
|
86
|
+
*
|
|
87
|
+
* Pure, and linear in the parts handed in: one pre-order pass and two prefix
|
|
88
|
+
* counts per reading, which is the bound rule 4 of
|
|
89
|
+
* [`docs/signals.md`](../../docs/signals.md) holds every reading here to.
|
|
90
|
+
*/
|
|
91
|
+
/** Why a kind has no silent-sender share. */
|
|
92
|
+
export type SenderSilence =
|
|
93
|
+
/**
|
|
94
|
+
* Nothing in the pages read is of this kind at all.
|
|
95
|
+
*
|
|
96
|
+
* Only ever a role row, and the reason a role row exists for every member of
|
|
97
|
+
* the vocabulary: *nothing in this library is a landmark* is a fact about the
|
|
98
|
+
* library, and a surface that had to tell a missing row from an empty one
|
|
99
|
+
* would be reading the vocabulary itself. A type row cannot be in this state.
|
|
100
|
+
*/
|
|
101
|
+
"unplaced"
|
|
102
|
+
/**
|
|
103
|
+
* Every placement of this kind holds nothing, so the defect cannot be seen on
|
|
104
|
+
* it at all.
|
|
105
|
+
*
|
|
106
|
+
* A structural answer and not a measurement one: no number of readers will
|
|
107
|
+
* ever put one below a leaf. A silent leaf and a leaf nobody reached report
|
|
108
|
+
* the same rows, and this reading does not guess between them.
|
|
109
|
+
*/
|
|
110
|
+
| "unwitnessable"
|
|
111
|
+
/**
|
|
112
|
+
* It holds parts, and nothing below any of its placements reported reach in
|
|
113
|
+
* this window.
|
|
114
|
+
*
|
|
115
|
+
* A measurement answer: come back with readers. Kept apart from
|
|
116
|
+
* `unwitnessable` because the two are opposite instructions — one says there
|
|
117
|
+
* is nothing here that could ever be checked, the other says nobody has been
|
|
118
|
+
* under it yet.
|
|
119
|
+
*/
|
|
120
|
+
| "unwitnessed";
|
|
121
|
+
export declare const SENDER_SILENCES: readonly SenderSilence[];
|
|
122
|
+
/** One line per silence, for a surface saying why a kind has no share. */
|
|
123
|
+
export declare const describeSenderSilence: (silence: SenderSilence) => string;
|
|
124
|
+
/** Whether one kind of part reports itself, everywhere it stands in the pages read. */
|
|
125
|
+
export type KindSenders = {
|
|
126
|
+
readonly kind: KindKey;
|
|
127
|
+
/** What part a type plays (0114), or `null`. Always `null` on a role row, which carries it as its key. */
|
|
128
|
+
readonly role: PrimitiveRole | null;
|
|
129
|
+
/** Element nodes of this kind across the readings. */
|
|
130
|
+
readonly placements: number;
|
|
131
|
+
/** Distinct trees it stands in, which is not the number of placements and not the number of readings. */
|
|
132
|
+
readonly trees: number;
|
|
133
|
+
/** Distinct revisions it stands in: two live revisions of one page are two. */
|
|
134
|
+
readonly revisions: number;
|
|
135
|
+
/** Placements holding no part at all, where the defect can never be seen. */
|
|
136
|
+
readonly leaves: number;
|
|
137
|
+
/** Placements holding parts, none of which reported reach in this window. */
|
|
138
|
+
readonly unwitnessed: number;
|
|
139
|
+
/**
|
|
140
|
+
* Placements with at least one part below them reporting reach — the
|
|
141
|
+
* population the rest of this row is about.
|
|
142
|
+
*
|
|
143
|
+
* `leaves + unwitnessed + witnessed` is {@link placements}.
|
|
144
|
+
*/
|
|
145
|
+
readonly witnessed: number;
|
|
146
|
+
/**
|
|
147
|
+
* Witnessed placements that reported no view of themselves, which is the
|
|
148
|
+
* defect a page's own reading raises exactly as it raises it.
|
|
149
|
+
*
|
|
150
|
+
* A **floor** on what is wrong, and the reason is in the module
|
|
151
|
+
* documentation: a silent leaf is invisible to this reading and so is a
|
|
152
|
+
* silent part nobody has been under yet.
|
|
153
|
+
*/
|
|
154
|
+
readonly silent: number;
|
|
155
|
+
/**
|
|
156
|
+
* Witnessed placements whose own standing is `unknown` — something other than
|
|
157
|
+
* a view, with a reader below.
|
|
158
|
+
*
|
|
159
|
+
* Plausibly the same defect, not claimed as it. The gap between
|
|
160
|
+
* {@link share} and {@link atMost}.
|
|
161
|
+
*/
|
|
162
|
+
readonly indeterminate: number;
|
|
163
|
+
/**
|
|
164
|
+
* {@link silent} over {@link witnessed}; `null` where {@link silence} says why
|
|
165
|
+
* not.
|
|
166
|
+
*
|
|
167
|
+
* *Of the places this kind stands that could be checked, this share did not
|
|
168
|
+
* report themselves.*
|
|
169
|
+
*/
|
|
170
|
+
readonly share: number | null;
|
|
171
|
+
/**
|
|
172
|
+
* `(silent + indeterminate) ÷ witnessed`, the other end of the bracket;
|
|
173
|
+
* `null` with {@link share}.
|
|
174
|
+
*
|
|
175
|
+
* Equal to {@link share} where nothing is indeterminate, which is what a
|
|
176
|
+
* deployment with working senders publishes.
|
|
177
|
+
*/
|
|
178
|
+
readonly atMost: number | null;
|
|
179
|
+
/** Why {@link share} is not there, and `null` where it is. */
|
|
180
|
+
readonly silence: SenderSilence | null;
|
|
181
|
+
/**
|
|
182
|
+
* Distinct trees with at least one silent placement of this kind.
|
|
183
|
+
*
|
|
184
|
+
* The figure the per-page fault cannot give: *this one component is silent
|
|
185
|
+
* across nineteen of your pages*. Trees and not revisions, because a page is
|
|
186
|
+
* what an operator opens and two revisions of it are one errand.
|
|
187
|
+
*/
|
|
188
|
+
readonly silentTrees: number;
|
|
189
|
+
/**
|
|
190
|
+
* Nodes of this kind that were silent, in the order the readings were handed
|
|
191
|
+
* in, capped at {@link SILENT_EXAMPLES}.
|
|
192
|
+
*
|
|
193
|
+
* Examples and never a list to act on: the errand is the primitive, and a
|
|
194
|
+
* surface that printed these as *the parts to fix* would be printing the
|
|
195
|
+
* wrong unit of work. Capped so that a library of forty pages cannot put
|
|
196
|
+
* tens of thousands of ids in a row nobody reads to the end.
|
|
197
|
+
*/
|
|
198
|
+
readonly examples: readonly NodeId[];
|
|
199
|
+
};
|
|
200
|
+
/** How many silent nodes a row carries as examples. */
|
|
201
|
+
export declare const SILENT_EXAMPLES = 5;
|
|
202
|
+
/** Which of a deployment's kinds of part report themselves, and which are silent. */
|
|
203
|
+
export type LibrarySenders = {
|
|
204
|
+
/**
|
|
205
|
+
* Every type that stands anywhere, most silent placements first.
|
|
206
|
+
*
|
|
207
|
+
* Then the higher share, then by type, so two kinds silent in equally many
|
|
208
|
+
* places do not reorder on a refresh.
|
|
209
|
+
*/
|
|
210
|
+
readonly byType: readonly KindSenders[];
|
|
211
|
+
/**
|
|
212
|
+
* Every role in the vocabulary that stands anywhere, then the row for parts
|
|
213
|
+
* whose type declared none, in the same order as {@link byType}.
|
|
214
|
+
*/
|
|
215
|
+
readonly byRole: readonly KindSenders[];
|
|
216
|
+
/** Readings counted, which is revisions of pages and not trees. */
|
|
217
|
+
readonly pages: number;
|
|
218
|
+
/** Distinct trees across them. */
|
|
219
|
+
readonly trees: number;
|
|
220
|
+
/** Element nodes across them, which is the sum of every type row's placements. */
|
|
221
|
+
readonly placements: number;
|
|
222
|
+
/** Placements the defect could be seen on, over the whole library. */
|
|
223
|
+
readonly witnessed: number;
|
|
224
|
+
/**
|
|
225
|
+
* Silent placements over the whole library, which is the sum of
|
|
226
|
+
* `PageFrontier.notReporting` over the same readings.
|
|
227
|
+
*/
|
|
228
|
+
readonly silent: number;
|
|
229
|
+
/** Witnessed placements whose own standing is `unknown`, over the whole library. */
|
|
230
|
+
readonly indeterminate: number;
|
|
231
|
+
/**
|
|
232
|
+
* The type silent in the most places, which is the component to fix first.
|
|
233
|
+
*
|
|
234
|
+
* By the **count** of places and not by the share, for the reason a page's
|
|
235
|
+
* falls are ranked by the readers they lose (0221) and a library by the places
|
|
236
|
+
* it is skipped in (0257): a kind silent in its one and only place is a
|
|
237
|
+
* perfect share and a smaller problem than one silent in thirty-one of
|
|
238
|
+
* thirty-four. `null` where nothing anywhere was silent — a deployment whose
|
|
239
|
+
* senders work and one nothing could check both, which {@link witnessed} tells
|
|
240
|
+
* apart.
|
|
241
|
+
*
|
|
242
|
+
* A type and never a role, because a type is the thing an author can replace.
|
|
243
|
+
*/
|
|
244
|
+
readonly worstSender: KindSenders | null;
|
|
245
|
+
/**
|
|
246
|
+
* Readings of a revision beyond the first, which were dropped.
|
|
247
|
+
*
|
|
248
|
+
* A page twice in a census is the one way a census can lie about how much of
|
|
249
|
+
* a library there is (0158).
|
|
250
|
+
*/
|
|
251
|
+
readonly duplicated: number;
|
|
252
|
+
/**
|
|
253
|
+
* Types whose readings disagreed about the role they play, where the first
|
|
254
|
+
* reading's answer stands.
|
|
255
|
+
*
|
|
256
|
+
* Two registries read as one library, which makes every role row below about
|
|
257
|
+
* neither (0114).
|
|
258
|
+
*/
|
|
259
|
+
readonly roleDisagreed: readonly PrimitiveType[];
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Which of a deployment's kinds of part report themselves.
|
|
263
|
+
*
|
|
264
|
+
* Takes the readings rather than the frontiers, for the reason every library
|
|
265
|
+
* reading does: a frontier names the silent nodes and nothing says what kind
|
|
266
|
+
* each one is, and the three states a placement can be in are a fact about the
|
|
267
|
+
* tree rather than about the stops. A caller with a window of counters reads
|
|
268
|
+
* each page, then this.
|
|
269
|
+
*/
|
|
270
|
+
export declare const librarySendersOf: (readings: readonly PageReading[]) => LibrarySenders;
|
|
271
|
+
//# sourceMappingURL=library-senders.d.ts.map
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { everyMemberOf } from "../closed-set.js";
|
|
2
|
+
import { PRIMITIVE_ROLES } from "../role.js";
|
|
3
|
+
import { readingKeyOf } from "./audiences.js";
|
|
4
|
+
import { kindKeyOf } from "./library.js";
|
|
5
|
+
import { senderStatesOf, witnessedState } from "./subtrees.js";
|
|
6
|
+
export const SENDER_SILENCES = everyMemberOf()([
|
|
7
|
+
"unplaced",
|
|
8
|
+
"unwitnessable",
|
|
9
|
+
"unwitnessed",
|
|
10
|
+
]);
|
|
11
|
+
/** One line per silence, for a surface saying why a kind has no share. */
|
|
12
|
+
export const describeSenderSilence = (silence) => {
|
|
13
|
+
switch (silence) {
|
|
14
|
+
case "unplaced":
|
|
15
|
+
return "nothing in the pages read is of this kind";
|
|
16
|
+
case "unwitnessable":
|
|
17
|
+
return "every place this kind stands holds nothing, so a silent sender could not be seen there";
|
|
18
|
+
case "unwitnessed":
|
|
19
|
+
return "nothing reported reach inside any place this kind stands, so nothing could witness it";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/** How many silent nodes a row carries as examples. */
|
|
23
|
+
export const SILENT_EXAMPLES = 5;
|
|
24
|
+
const tallying = (kind) => ({
|
|
25
|
+
kind,
|
|
26
|
+
role: null,
|
|
27
|
+
placements: 0,
|
|
28
|
+
trees: new Set(),
|
|
29
|
+
revisions: new Set(),
|
|
30
|
+
silentIn: new Set(),
|
|
31
|
+
leaves: 0,
|
|
32
|
+
unwitnessed: 0,
|
|
33
|
+
witnessed: 0,
|
|
34
|
+
silent: 0,
|
|
35
|
+
indeterminate: 0,
|
|
36
|
+
examples: [],
|
|
37
|
+
});
|
|
38
|
+
const add = (into, at, revision) => {
|
|
39
|
+
into.placements += 1;
|
|
40
|
+
into.trees.add(at.treeId);
|
|
41
|
+
into.revisions.add(revision);
|
|
42
|
+
if (at.state === "leaf")
|
|
43
|
+
into.leaves += 1;
|
|
44
|
+
else if (at.state === "unwitnessed")
|
|
45
|
+
into.unwitnessed += 1;
|
|
46
|
+
else
|
|
47
|
+
into.witnessed += 1;
|
|
48
|
+
if (at.state === "indeterminate")
|
|
49
|
+
into.indeterminate += 1;
|
|
50
|
+
if (at.state === "silent") {
|
|
51
|
+
into.silent += 1;
|
|
52
|
+
into.silentIn.add(at.treeId);
|
|
53
|
+
if (into.examples.length < SILENT_EXAMPLES)
|
|
54
|
+
into.examples.push(at.nodeId);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The silence, with the three reasons tried in the order they have to be tried
|
|
59
|
+
* in.
|
|
60
|
+
*
|
|
61
|
+
* Nothing of the kind first, because *there is no such part in this library* is
|
|
62
|
+
* a better answer than anything about readers and is true of the others by
|
|
63
|
+
* accident. Then the structural reason before the measurement one: *this can
|
|
64
|
+
* never be checked here* and *nobody has been under it yet* are opposite
|
|
65
|
+
* instructions, and a kind standing only in leaves is in the first however many
|
|
66
|
+
* readers arrive.
|
|
67
|
+
*/
|
|
68
|
+
const silenceOf = (of) => {
|
|
69
|
+
if (of.placements === 0)
|
|
70
|
+
return "unplaced";
|
|
71
|
+
if (of.witnessed > 0)
|
|
72
|
+
return null;
|
|
73
|
+
return of.unwitnessed === 0 ? "unwitnessable" : "unwitnessed";
|
|
74
|
+
};
|
|
75
|
+
const rowOf = (of) => {
|
|
76
|
+
const silence = silenceOf(of);
|
|
77
|
+
return {
|
|
78
|
+
kind: of.kind,
|
|
79
|
+
role: of.kind.by === "type" ? of.role : null,
|
|
80
|
+
placements: of.placements,
|
|
81
|
+
trees: of.trees.size,
|
|
82
|
+
revisions: of.revisions.size,
|
|
83
|
+
leaves: of.leaves,
|
|
84
|
+
unwitnessed: of.unwitnessed,
|
|
85
|
+
witnessed: of.witnessed,
|
|
86
|
+
silent: of.silent,
|
|
87
|
+
indeterminate: of.indeterminate,
|
|
88
|
+
share: of.witnessed === 0 ? null : of.silent / of.witnessed,
|
|
89
|
+
atMost: of.witnessed === 0 ? null : (of.silent + of.indeterminate) / of.witnessed,
|
|
90
|
+
silence,
|
|
91
|
+
silentTrees: of.silentIn.size,
|
|
92
|
+
examples: [...of.examples],
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
/** The name a row is ordered by, which is the key's own and never the row's position. */
|
|
96
|
+
const nameOf = (kind) => (kind.by === "type" ? kind.type : (kind.role ?? ""));
|
|
97
|
+
/**
|
|
98
|
+
* The kind to look at first, which is the ranking rule spelled once.
|
|
99
|
+
*
|
|
100
|
+
* Most places silent, then the higher share, then by name — so a kind with no
|
|
101
|
+
* share at all sorts after one with a share of nought rather than above it,
|
|
102
|
+
* because `null` is *nothing could be checked* and not *every sender works*.
|
|
103
|
+
*/
|
|
104
|
+
const worseOf = (one, other) => other.silent - one.silent ||
|
|
105
|
+
(other.share ?? -1) - (one.share ?? -1) ||
|
|
106
|
+
nameOf(one.kind).localeCompare(nameOf(other.kind));
|
|
107
|
+
/**
|
|
108
|
+
* Which of a deployment's kinds of part report themselves.
|
|
109
|
+
*
|
|
110
|
+
* Takes the readings rather than the frontiers, for the reason every library
|
|
111
|
+
* reading does: a frontier names the silent nodes and nothing says what kind
|
|
112
|
+
* each one is, and the three states a placement can be in are a fact about the
|
|
113
|
+
* tree rather than about the stops. A caller with a window of counters reads
|
|
114
|
+
* each page, then this.
|
|
115
|
+
*/
|
|
116
|
+
export const librarySendersOf = (readings) => {
|
|
117
|
+
const rows = new Map();
|
|
118
|
+
const seen = new Set();
|
|
119
|
+
const trees = new Set();
|
|
120
|
+
const disagreed = new Set();
|
|
121
|
+
let pages = 0;
|
|
122
|
+
let duplicated = 0;
|
|
123
|
+
let placements = 0;
|
|
124
|
+
let witnessed = 0;
|
|
125
|
+
let silent = 0;
|
|
126
|
+
let indeterminate = 0;
|
|
127
|
+
for (const role of [...PRIMITIVE_ROLES, null]) {
|
|
128
|
+
const kind = { by: "role", role };
|
|
129
|
+
rows.set(kindKeyOf(kind), tallying(kind));
|
|
130
|
+
}
|
|
131
|
+
for (const reading of readings) {
|
|
132
|
+
const revision = readingKeyOf(reading);
|
|
133
|
+
if (seen.has(revision)) {
|
|
134
|
+
duplicated += 1;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
seen.add(revision);
|
|
138
|
+
trees.add(reading.treeId);
|
|
139
|
+
pages += 1;
|
|
140
|
+
for (const { part, state } of senderStatesOf(reading.parts)) {
|
|
141
|
+
const placement = { nodeId: part.nodeId, treeId: reading.treeId, state };
|
|
142
|
+
placements += 1;
|
|
143
|
+
witnessed += witnessedState(state) ? 1 : 0;
|
|
144
|
+
silent += state === "silent" ? 1 : 0;
|
|
145
|
+
indeterminate += state === "indeterminate" ? 1 : 0;
|
|
146
|
+
const keys = [
|
|
147
|
+
{ by: "type", type: part.type },
|
|
148
|
+
{ by: "role", role: part.role },
|
|
149
|
+
];
|
|
150
|
+
for (const kind of keys) {
|
|
151
|
+
const key = kindKeyOf(kind);
|
|
152
|
+
const row = rows.get(key) ?? tallying(kind);
|
|
153
|
+
if (kind.by === "type") {
|
|
154
|
+
if (row.placements === 0)
|
|
155
|
+
row.role = part.role;
|
|
156
|
+
else if (row.role !== part.role)
|
|
157
|
+
disagreed.add(part.type);
|
|
158
|
+
}
|
|
159
|
+
add(row, placement, revision);
|
|
160
|
+
rows.set(key, row);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const built = [...rows.values()].map(rowOf);
|
|
165
|
+
const byType = built.filter((row) => row.kind.by === "type").sort(worseOf);
|
|
166
|
+
return {
|
|
167
|
+
byType,
|
|
168
|
+
byRole: built.filter((row) => row.kind.by === "role").sort(worseOf),
|
|
169
|
+
pages,
|
|
170
|
+
trees: trees.size,
|
|
171
|
+
placements,
|
|
172
|
+
witnessed,
|
|
173
|
+
silent,
|
|
174
|
+
indeterminate,
|
|
175
|
+
worstSender: byType.find((row) => row.silent > 0) ?? null,
|
|
176
|
+
duplicated,
|
|
177
|
+
roleDisagreed: [...disagreed].sort((one, other) => one.localeCompare(other)),
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=library-senders.js.map
|