@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,573 @@
|
|
|
1
|
+
import { everyMemberOf } from "../closed-set.js";
|
|
2
|
+
import { pageActionOf } from "./action.js";
|
|
3
|
+
import { readingKeyOf } from "./audiences.js";
|
|
4
|
+
import { pageFrontierOf } from "./frontier.js";
|
|
5
|
+
import { pageViewsFor } from "./page-views.js";
|
|
6
|
+
/**
|
|
7
|
+
* Whether what a deployment collected can be trusted, and which of its pages
|
|
8
|
+
* cannot.
|
|
9
|
+
*
|
|
10
|
+
* Every reading in this subsystem answers a question about readers and, beside
|
|
11
|
+
* the answer, names the reasons the answer may be absent: a part with no
|
|
12
|
+
* denominator, a window with no page views, a sender that is not marking its
|
|
13
|
+
* openings. Twelve vocabularies of them
|
|
14
|
+
* ([0240](../../decisions/0240-a-silence-is-a-condition-and-a-subject-and-the-two-names-for-one-state-were-not-synonyms.md)),
|
|
15
|
+
* each published beside the figure it withholds.
|
|
16
|
+
*
|
|
17
|
+
* **So a deployment could only discover that its measurement was broken by
|
|
18
|
+
* asking a question about reading and noticing the answer was missing.** Three
|
|
19
|
+
* of those reasons are faults rather than quiet windows — senders that never
|
|
20
|
+
* mark an opening, so every rate on the page has no exact denominator (0229);
|
|
21
|
+
* senders that credit no action to any reader, so every band reads *untouched*
|
|
22
|
+
* while the counters look healthy
|
|
23
|
+
* ([0242](../../decisions/0242-what-readers-did-is-a-share-off-one-row-and-a-leaf-has-no-inside.md));
|
|
24
|
+
* a rollup window shorter than a visit, so every count against the revision is
|
|
25
|
+
* half again the truth
|
|
26
|
+
* ([0219](../../decisions/0219-a-page-view-is-counted-once-at-the-door-and-the-over-count-in-the-node-counters-is-a-measurement.md)).
|
|
27
|
+
* Each of them is page by page, one card at a time, and a deployment with
|
|
28
|
+
* forty pages and one broken sender had no way to be told.
|
|
29
|
+
*
|
|
30
|
+
* This is that answer, taken off the readings and the door rows a deployment
|
|
31
|
+
* already has and nothing else: no payload, no browser change, no counter that
|
|
32
|
+
* does not exist, no column and no byte on any wire.
|
|
33
|
+
*
|
|
34
|
+
* ## A fault is named by what it costs, and the remedy is named only where the
|
|
35
|
+
* rows determine one
|
|
36
|
+
*
|
|
37
|
+
* The eight faults here are not eight shapes of missing data; they are eight
|
|
38
|
+
* different things to go and do, and the reason to report them together is that
|
|
39
|
+
* a person looking at a reader screen cannot tell them apart from the figures.
|
|
40
|
+
* {@link remedyOf} publishes which of four hands each one falls to — the pages,
|
|
41
|
+
* the configuration, the caller — and `undetermined` where the rows genuinely do
|
|
42
|
+
* not say, which is one fault out of eight and is better than inventing one of
|
|
43
|
+
* three causes.
|
|
44
|
+
*
|
|
45
|
+
* ## What a fault costs is the page's arrivals, and a page is counted once
|
|
46
|
+
*
|
|
47
|
+
* The readers a fault affects are the readers of the page it is on: a sender not
|
|
48
|
+
* marking its openings spoils every rate on that revision, not some share of
|
|
49
|
+
* them. So the cost is the page's own `opened` — exact, counted once at the
|
|
50
|
+
* door, and addable for the reason no other counter here is (0219).
|
|
51
|
+
*
|
|
52
|
+
* **Which makes the only double-count available to this reading the one it
|
|
53
|
+
* guards: a page counted once per fault it has.** A revision with three faults
|
|
54
|
+
* is one revision and its readers are added once, because counting a window and
|
|
55
|
+
* forgetting it are one operation
|
|
56
|
+
* ([0158](../../decisions/0158-counting-a-window-of-reader-signals-and-forgetting-it-are-one-operation.md)).
|
|
57
|
+
* {@link CollectionHealth.faults} counts revisions per fault and so deliberately
|
|
58
|
+
* does not add to the number of faulted pages, which is said on the field.
|
|
59
|
+
*
|
|
60
|
+
* ## A page the door cannot price is not ranked against one it can
|
|
61
|
+
*
|
|
62
|
+
* A revision whose counters hold readers and whose door row is missing is the
|
|
63
|
+
* first fault in the list, and it is also the one page whose cost cannot be
|
|
64
|
+
* stated: there is no exact arrival count to rank it by. Ranking it by its view
|
|
65
|
+
* floor would put it in the order at a height taken off a different scale, which
|
|
66
|
+
* is the mixing
|
|
67
|
+
* [0265](../../decisions/0265-what-readers-do-inside-a-kind-of-part-is-a-share-of-the-readers-who-met-it-and-the-door-is-only-a-weight.md)
|
|
68
|
+
* refuses one unit across and
|
|
69
|
+
* [0250](../../decisions/0250-a-deployment-is-ordered-by-readers-lost-at-the-doors-scale-and-a-page-the-door-cannot-scale-is-out-of-the-order.md)
|
|
70
|
+
* refuses for an order of pages. So it is published apart, in
|
|
71
|
+
* {@link CollectionHealth.unpriced}, with its floor on the row and never in the
|
|
72
|
+
* ranking.
|
|
73
|
+
*
|
|
74
|
+
* ## What is published as a figure rather than judged
|
|
75
|
+
*
|
|
76
|
+
* **Openings no rollup has folded, where nothing says when a fold last was.**
|
|
77
|
+
* `pending` is *the other sign of the same subtraction* (0219) and is what a
|
|
78
|
+
* stalled collection looks like — and it is also what a revision published two
|
|
79
|
+
* minutes ago looks like, because the ordinary lag of the tallies behind the
|
|
80
|
+
* buffer is one window
|
|
81
|
+
* ([0158](../../decisions/0158-counting-a-window-of-reader-signals-and-forgetting-it-are-one-operation.md)).
|
|
82
|
+
* `updatedAt` cannot tell those apart, because the door writes it on every
|
|
83
|
+
* delivery: a busy page whose rollup has stopped keeps a fresh timestamp while
|
|
84
|
+
* its appearances never move.
|
|
85
|
+
*
|
|
86
|
+
* A page-view row now carries `foldedAt`, written by the fold and by nothing
|
|
87
|
+
* else ([0274](../../decisions/0274-a-page-view-row-says-when-the-fold-last-touched-it-and-a-stall-is-judged-against-a-schedule-the-deployment-hands-in.md)),
|
|
88
|
+
* so the lag is readable — against a schedule the caller hands in, because how
|
|
89
|
+
* long a fold may honestly be behind is the deployment's own cron interval and
|
|
90
|
+
* rollup window and is not the framework's to assume. Hand one in and
|
|
91
|
+
* `collection-stalled` is raised on the pages whose openings have waited longer
|
|
92
|
+
* than that. Hand none in, or read a row no fold has ever touched, and nothing
|
|
93
|
+
* is claimed: `pending` is published per page and added across the deployment,
|
|
94
|
+
* {@link CollectionHealth.unattested} counts the revisions whose lag could not
|
|
95
|
+
* be read at all, and no fault is raised from either.
|
|
96
|
+
*
|
|
97
|
+
* Pure, linear in the readings times the rows, and reaches no store, clock or
|
|
98
|
+
* DOM.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* How generous a revision's distinct counts may be before its absolute figures
|
|
102
|
+
* are not worth printing.
|
|
103
|
+
*
|
|
104
|
+
* `drift ÷ opened` above a half means the appearances are more than one and a
|
|
105
|
+
* half times the openings — so the typical page view is being folded into more
|
|
106
|
+
* than one and a half rollup windows, which is a window shorter than the reading
|
|
107
|
+
* it measures. Every **ratio** in this subsystem survives that, because both of
|
|
108
|
+
* its counts come off the same rows and the inflation very nearly divides out
|
|
109
|
+
* (0221, 0229, 0242); every **count** on a card is half again what it should be.
|
|
110
|
+
*
|
|
111
|
+
* Published and not overridable, which is
|
|
112
|
+
* [0218](../../decisions/0218-what-a-counter-means-is-published-and-the-browser-pays-for-the-number-and-not-its-name.md)'s
|
|
113
|
+
* rule at the one remove where it still holds: how much error makes a figure
|
|
114
|
+
* unfit to print is the framework's statement about its own numbers, where the
|
|
115
|
+
* remedy — a longer window — is the deployment's own configuration.
|
|
116
|
+
*/
|
|
117
|
+
export const COUNTS_INFLATED_ABOVE = 0.5;
|
|
118
|
+
export const COLLECTION_FAULTS = everyMemberOf()([
|
|
119
|
+
"door-unscaled",
|
|
120
|
+
"openings-unmarked",
|
|
121
|
+
"counts-inflated",
|
|
122
|
+
"collection-stalled",
|
|
123
|
+
"actions-uncredited",
|
|
124
|
+
"parts-unreporting",
|
|
125
|
+
"rows-mishandled",
|
|
126
|
+
"audiences-mixed",
|
|
127
|
+
]);
|
|
128
|
+
/** One line per fault, for a surface naming what is wrong. */
|
|
129
|
+
export const describeCollectionFault = (fault) => {
|
|
130
|
+
switch (fault) {
|
|
131
|
+
case "door-unscaled":
|
|
132
|
+
return "readers were counted against this version and no page views were counted at its door";
|
|
133
|
+
case "openings-unmarked":
|
|
134
|
+
return "page views of this version appeared in a rollup and nothing said one began";
|
|
135
|
+
case "counts-inflated":
|
|
136
|
+
return "the rollup window is shorter than the visits, so every count against this version is high";
|
|
137
|
+
case "collection-stalled":
|
|
138
|
+
return "page views of this version have been waiting longer than a fold is meant to take";
|
|
139
|
+
case "actions-uncredited":
|
|
140
|
+
return "readers acted on this page and no reader was credited with acting inside anything";
|
|
141
|
+
case "parts-unreporting":
|
|
142
|
+
return "parts of this page were on a reader's screen and said nothing, so this page's senders are not reporting everything they are on";
|
|
143
|
+
case "rows-mishandled":
|
|
144
|
+
return "rows were handed in that this version cannot account for, or handed in twice";
|
|
145
|
+
case "audiences-mixed":
|
|
146
|
+
return "this page was served to more than one audience and the window holding both was read as one";
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
export const FAULT_REMEDIES = everyMemberOf()([
|
|
150
|
+
"senders",
|
|
151
|
+
"configuration",
|
|
152
|
+
"caller",
|
|
153
|
+
"undetermined",
|
|
154
|
+
]);
|
|
155
|
+
/** Whose hand this fault falls to, which is the half of a fault a person acts on. */
|
|
156
|
+
export const remedyOf = (fault) => {
|
|
157
|
+
switch (fault) {
|
|
158
|
+
case "door-unscaled":
|
|
159
|
+
return "undetermined";
|
|
160
|
+
case "openings-unmarked":
|
|
161
|
+
return "senders";
|
|
162
|
+
case "counts-inflated":
|
|
163
|
+
return "configuration";
|
|
164
|
+
case "collection-stalled":
|
|
165
|
+
return "configuration";
|
|
166
|
+
case "actions-uncredited":
|
|
167
|
+
return "senders";
|
|
168
|
+
case "parts-unreporting":
|
|
169
|
+
return "senders";
|
|
170
|
+
case "rows-mishandled":
|
|
171
|
+
return "caller";
|
|
172
|
+
case "audiences-mixed":
|
|
173
|
+
return "caller";
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Whether a fault reaches the figure an order of a deployment's pages is ranked
|
|
178
|
+
* on, which is readers lost at the sharpest fall, deflated to the door's scale
|
|
179
|
+
* (0250).
|
|
180
|
+
*
|
|
181
|
+
* The order is
|
|
182
|
+
* [0250](../../decisions/0250-a-deployment-is-ordered-by-readers-lost-at-the-doors-scale-and-a-page-the-door-cannot-scale-is-out-of-the-order.md)
|
|
183
|
+
* and the join that reads this is
|
|
184
|
+
* [`agenda.ts`](agenda.ts).
|
|
185
|
+
*
|
|
186
|
+
* The second half of a fault, beside {@link remedyOf}'s first: that one says
|
|
187
|
+
* whose hand the fault falls to, and this says whether the fall a deployment
|
|
188
|
+
* was about to act on is evidence of anything. It is **here rather than beside
|
|
189
|
+
* the order** because it is a statement about a fault, and a fault vocabulary
|
|
190
|
+
* written in two places is this subsystem's own commonest defect.
|
|
191
|
+
*
|
|
192
|
+
* ## Why it is not simply *every fault*
|
|
193
|
+
*
|
|
194
|
+
* A fault spoils every **rate** on its page, which is what makes the health
|
|
195
|
+
* reading worth ranking by headcount. It does not follow that it spoils *this*
|
|
196
|
+
* figure, and two of the eight plainly do not:
|
|
197
|
+
*
|
|
198
|
+
* - **`counts-inflated` is already corrected for.** The key the order is on is
|
|
199
|
+
* `lost ÷ (1 + inflation)`, and the inflation comes off the door row, where
|
|
200
|
+
* an opening is counted once and exactly (0219). The fault says the page's
|
|
201
|
+
* absolute counts are not worth printing; the ranking key is not one of them.
|
|
202
|
+
* - **`actions-uncredited` is about a different counter.** A fall is between two
|
|
203
|
+
* siblings on `reached`, and an uncredited sender spends its `engaged`
|
|
204
|
+
* (0242). Every band on the page reads *untouched* and not one fall moves.
|
|
205
|
+
*
|
|
206
|
+
* Taking a page out of the order for either of those would send an operator to
|
|
207
|
+
* repair a sender when what the rows said was *four hundred readers stop here*,
|
|
208
|
+
* and it would be the over-caution that makes a verdict worth ignoring.
|
|
209
|
+
*
|
|
210
|
+
* ## Why three of the six cannot be seen today
|
|
211
|
+
*
|
|
212
|
+
* `door-unscaled`, `openings-unmarked` and `audiences-mixed` are `true` here and
|
|
213
|
+
* **cannot co-occur with a rank**, because the order already refuses those
|
|
214
|
+
* pages as `unscaled`, `unopened` and `unsplit`. They are answered anyway: this
|
|
215
|
+
* says what the fault does to the figure, not what today's standings happen to
|
|
216
|
+
* let through, so the day a standing changes the two readings do not silently
|
|
217
|
+
* come apart.
|
|
218
|
+
*
|
|
219
|
+
* ## Its sibling answers the same question about the other order
|
|
220
|
+
*
|
|
221
|
+
* {@link spoilsTheConversion} is this for the order of a deployment's
|
|
222
|
+
* conversions (0333), and it is **not this function with a word changed**: a
|
|
223
|
+
* short window is corrected for here and manufactures the loss there. Neither
|
|
224
|
+
* answer may be read off the other.
|
|
225
|
+
*
|
|
226
|
+
* The three that can be seen are the three worth seeing. `rows-mishandled` is a
|
|
227
|
+
* tree and a window that do not belong together, which leaves most of the page
|
|
228
|
+
* reading `skipped` — so it manufactures the steepest fall in the deployment and
|
|
229
|
+
* puts the page at the head of the order (0212). `collection-stalled` reads a
|
|
230
|
+
* fall off counters the fold has not caught up to and scales it by a door that
|
|
231
|
+
* has, so the loss is of one window and the scale is of another; it understates
|
|
232
|
+
* rather than overstates, which makes a stalled page's rank a floor on its
|
|
233
|
+
* trouble rather than a measure of it.
|
|
234
|
+
*
|
|
235
|
+
* `parts-unreporting` is `rows-mishandled`'s shape arrived at from the other
|
|
236
|
+
* direction, and it is **not** read off the analogy. A fall is between two
|
|
237
|
+
* siblings on `reached`, and a part that never reports has a `reached` of
|
|
238
|
+
* nought while readers were demonstrably below it — so the fall into it is
|
|
239
|
+
* total, and a total fall is the sharpest fall a page can have. The ranking key
|
|
240
|
+
* is the deployment's sharpest fall, so one silent part is enough to put a page
|
|
241
|
+
* the readers were perfectly happy with at the head of the order. The wider
|
|
242
|
+
* reason is the one on the member itself: the parts this fault can see are the
|
|
243
|
+
* containers, a silent leaf is indistinguishable from a part nobody reached,
|
|
244
|
+
* and *this page's senders do not report everything they are on* is a statement
|
|
245
|
+
* about every `reached` count on it.
|
|
246
|
+
*/
|
|
247
|
+
export const spoilsTheLoss = (fault) => {
|
|
248
|
+
switch (fault) {
|
|
249
|
+
case "door-unscaled":
|
|
250
|
+
return true;
|
|
251
|
+
case "openings-unmarked":
|
|
252
|
+
return true;
|
|
253
|
+
case "counts-inflated":
|
|
254
|
+
return false;
|
|
255
|
+
case "collection-stalled":
|
|
256
|
+
return true;
|
|
257
|
+
case "actions-uncredited":
|
|
258
|
+
return false;
|
|
259
|
+
case "parts-unreporting":
|
|
260
|
+
return true;
|
|
261
|
+
case "rows-mishandled":
|
|
262
|
+
return true;
|
|
263
|
+
case "audiences-mixed":
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Whether a fault reaches the figure an order of a deployment's conversions is
|
|
269
|
+
* ranked on, which is readers lost **between** the two ends of a question,
|
|
270
|
+
* deflated to the door's scale.
|
|
271
|
+
*
|
|
272
|
+
* The order is
|
|
273
|
+
* [0333](../../decisions/0333-a-deployments-conversions-are-a-third-order-ranked-on-the-loss-between-the-two-ends.md)
|
|
274
|
+
* and the join that reads this is [`agenda.ts`](agenda.ts).
|
|
275
|
+
*
|
|
276
|
+
* The sibling of {@link spoilsTheLoss}, and it is here for the same reason that
|
|
277
|
+
* one is: the question is about a fault, and a fault vocabulary written in two
|
|
278
|
+
* places is this subsystem's commonest defect.
|
|
279
|
+
*
|
|
280
|
+
* ## It is not {@link spoilsTheLoss} with the word changed
|
|
281
|
+
*
|
|
282
|
+
* The two answers differ on one fault and agree on another for a different
|
|
283
|
+
* reason, and both of those were found by arguing from what the counters are
|
|
284
|
+
* made of rather than by analogy — which is the way a fault vocabulary comes to
|
|
285
|
+
* be right in one of its two places and wrong in the other.
|
|
286
|
+
*
|
|
287
|
+
* - **`counts-inflated` is `false` for a fall and `true` here.** A fall is a
|
|
288
|
+
* difference of two independent distinct-view counts, so a short window
|
|
289
|
+
* inflates both ends of the subtraction and `lost ÷ (1 + inflation)` puts the
|
|
290
|
+
* difference back on the door's scale (0219, 0250). A conversion is **not** a
|
|
291
|
+
* difference of two independent counts: `converted` is a *conjunction inside
|
|
292
|
+
* one rollup window*, so a page view that satisfied the first end in one
|
|
293
|
+
* window and the second in the next contributes `reached 1, converted 0` and
|
|
294
|
+
* its conversion is lost rather than double-counted (0147). A window shorter
|
|
295
|
+
* than the visits being measured therefore **manufactures the very loss this
|
|
296
|
+
* order ranks**, and dividing by the straddle corrects the scale of the count
|
|
297
|
+
* and not the count. `PairReach.rateAtMost` bounds that error for the rate;
|
|
298
|
+
* nothing bounds it for the key, which is why the page leaves the order.
|
|
299
|
+
* - **`actions-uncredited` is `false` in both places and not for the same
|
|
300
|
+
* reason.** A fall survives it because a fall is made of `reached` and an
|
|
301
|
+
* uncredited sender spends `engaged` (0242). A conversion survives it because
|
|
302
|
+
* **no funnel figure is made of `engaged` at all**: an end is satisfied by the
|
|
303
|
+
* node a signal names and the kind it is, and the ancestry a signal carries
|
|
304
|
+
* feeds exactly one counter, which is `engaged` (0167). A question whose
|
|
305
|
+
* second end asks for `activated` on a control is answered from the control's
|
|
306
|
+
* own signal, so the fault cannot touch it.
|
|
307
|
+
*
|
|
308
|
+
* ## The five that transfer, and why
|
|
309
|
+
*
|
|
310
|
+
* `door-unscaled` leaves the loss with no scale to be comparable on;
|
|
311
|
+
* `openings-unmarked` leaves it with no denominator; `audiences-mixed` reads one
|
|
312
|
+
* question of two populations (0300). All three are `true` and, exactly as in
|
|
313
|
+
* {@link spoilsTheLoss}, **none of them can co-occur with a conversion rank
|
|
314
|
+
* today**, because the order already refuses those pages as `unscaled`,
|
|
315
|
+
* `unopened` and `unsplit`. They are answered anyway, so that the day a
|
|
316
|
+
* standing changes the two readings do not silently come apart.
|
|
317
|
+
*
|
|
318
|
+
* `rows-mishandled` is `true` for both halves of what it names. A tree and a
|
|
319
|
+
* window that do not belong together answers this revision's questions with
|
|
320
|
+
* another revision's counters (0212), and a row handed in twice doubles
|
|
321
|
+
* `reached` and `converted` together, which doubles the loss while leaving the
|
|
322
|
+
* rate intact — so the ranking key moves and the figure beside it does not say
|
|
323
|
+
* so (0147).
|
|
324
|
+
*
|
|
325
|
+
* `collection-stalled` is `true` for the reason it is for a fall: the counts are
|
|
326
|
+
* of one window and the scale is of another, because a fold that has stopped
|
|
327
|
+
* freezes the funnel rows while the door goes on counting arrivals. It
|
|
328
|
+
* understates, so a stalled page's place is a floor on its trouble rather than a
|
|
329
|
+
* measure of it.
|
|
330
|
+
*
|
|
331
|
+
* `parts-unreporting` is `true`, and the argument is **weaker here than it is
|
|
332
|
+
* for a fall** — which is why it is written down rather than carried over. A
|
|
333
|
+
* funnel end is satisfied by the node a signal names and the kind it is, so a
|
|
334
|
+
* silent end makes `converted` nought and manufactures a total loss exactly as
|
|
335
|
+
* it manufactures a total fall. But what this fault can actually see is a part
|
|
336
|
+
* with something reported *inside* it, and a funnel's ends are usually controls
|
|
337
|
+
* with nothing inside them, so the end itself is rarely the part that is named.
|
|
338
|
+
* It is `true` on the member's own wider claim instead: a page with one
|
|
339
|
+
* container that does not report has senders that do not report, every silent
|
|
340
|
+
* leaf on it is invisible, and an end that never fired is indistinguishable
|
|
341
|
+
* from an end nobody reached.
|
|
342
|
+
*
|
|
343
|
+
* ## Which can be seen on a ranked page
|
|
344
|
+
*
|
|
345
|
+
* Four, where a fall has three: `counts-inflated`, `collection-stalled`,
|
|
346
|
+
* `rows-mishandled` and `parts-unreporting`. The extra one is the fault a fall
|
|
347
|
+
* is explicitly safe from, which is the whole reason this answer could not be
|
|
348
|
+
* transferred.
|
|
349
|
+
*/
|
|
350
|
+
export const spoilsTheConversion = (fault) => {
|
|
351
|
+
switch (fault) {
|
|
352
|
+
case "door-unscaled":
|
|
353
|
+
return true;
|
|
354
|
+
case "openings-unmarked":
|
|
355
|
+
return true;
|
|
356
|
+
case "counts-inflated":
|
|
357
|
+
return true;
|
|
358
|
+
case "collection-stalled":
|
|
359
|
+
return true;
|
|
360
|
+
case "actions-uncredited":
|
|
361
|
+
return false;
|
|
362
|
+
case "parts-unreporting":
|
|
363
|
+
return true;
|
|
364
|
+
case "rows-mishandled":
|
|
365
|
+
return true;
|
|
366
|
+
case "audiences-mixed":
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
export const HEALTH_STANDINGS = everyMemberOf()([
|
|
371
|
+
"sound",
|
|
372
|
+
"faulted",
|
|
373
|
+
"unmeasured",
|
|
374
|
+
"unfolded",
|
|
375
|
+
]);
|
|
376
|
+
/** One line per standing, for a surface saying why a page is where it is. */
|
|
377
|
+
export const describeHealthStanding = (standing) => {
|
|
378
|
+
switch (standing) {
|
|
379
|
+
case "sound":
|
|
380
|
+
return "measured, with nothing these rows can see wrong with it";
|
|
381
|
+
case "faulted":
|
|
382
|
+
return "something about what is being collected here is wrong";
|
|
383
|
+
case "unmeasured":
|
|
384
|
+
return "nothing was collected about this version in the window";
|
|
385
|
+
case "unfolded":
|
|
386
|
+
return "page views began and no rollup has folded any of them yet, and nothing here says that is late";
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
const EMPTY_STANDINGS = Object.freeze(Object.fromEntries(HEALTH_STANDINGS.map((standing) => [standing, 0])));
|
|
390
|
+
const EMPTY_FAULTS = Object.freeze(Object.fromEntries(COLLECTION_FAULTS.map((fault) => [fault, 0])));
|
|
391
|
+
/**
|
|
392
|
+
* Whether this revision's openings have waited longer than a fold is meant to
|
|
393
|
+
* take.
|
|
394
|
+
*
|
|
395
|
+
* **Four states answer *no* without anything being sound**, and each of them is
|
|
396
|
+
* a refusal rather than a gap:
|
|
397
|
+
*
|
|
398
|
+
* - **no schedule.** How long a fold may be behind is the deployment's cron
|
|
399
|
+
* interval plus its ripeness window, and a framework that supplied a default
|
|
400
|
+
* would fault an hourly collection for not being a ten-minute one.
|
|
401
|
+
* - **nothing pending.** A collection that has stopped where nobody is arriving
|
|
402
|
+
* is costing no reader's measurement anything, and there is nothing waiting
|
|
403
|
+
* for it to be late for.
|
|
404
|
+
* - **no fold attested.** A row written before `folded_at` existed, or one no
|
|
405
|
+
* fold has touched, says *nothing here can tell you* — and it reads exactly
|
|
406
|
+
* like a brand-new revision (0274).
|
|
407
|
+
* - **a schedule that is not a positive, finite number of milliseconds, or an
|
|
408
|
+
* instant that does not parse.** A nought allowance would make the lag the
|
|
409
|
+
* design requires into a fault on every live page.
|
|
410
|
+
*
|
|
411
|
+
* A fold timestamp ahead of the instant handed in is a clock disagreeing with
|
|
412
|
+
* itself, and it answers *no* by the same subtraction rather than by a special
|
|
413
|
+
* case: a negative age is never longer than a positive allowance.
|
|
414
|
+
*
|
|
415
|
+
* **A door summed over two forms is stalled exactly when one of its forms is**,
|
|
416
|
+
* and that equivalence is a property of the fold the reading waits on rather
|
|
417
|
+
* than of anything here: `pending` is the sum of the forms' pending openings
|
|
418
|
+
* and `foldedAt` is the oldest fold attested by a form that still has some
|
|
419
|
+
* (0299), so one lagging form answers *yes* and a quiet form whose openings are
|
|
420
|
+
* all folded cannot.
|
|
421
|
+
*/
|
|
422
|
+
const stalled = (door, schedule) => {
|
|
423
|
+
if (door === null || schedule === undefined)
|
|
424
|
+
return false;
|
|
425
|
+
if (door.pending <= 0 || door.foldedAt === undefined)
|
|
426
|
+
return false;
|
|
427
|
+
if (!Number.isFinite(schedule.foldsWithinMs) || schedule.foldsWithinMs <= 0)
|
|
428
|
+
return false;
|
|
429
|
+
const at = Date.parse(schedule.at);
|
|
430
|
+
const folded = Date.parse(door.foldedAt);
|
|
431
|
+
if (Number.isNaN(at) || Number.isNaN(folded))
|
|
432
|
+
return false;
|
|
433
|
+
return at - folded > schedule.foldsWithinMs;
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* One revision's row, with every fault it has rather than the first one found.
|
|
437
|
+
*
|
|
438
|
+
* A page with an old sender and a short window has two things to do and a
|
|
439
|
+
* reading that stopped at the first would hide the second behind a fix.
|
|
440
|
+
*/
|
|
441
|
+
const healthOf = (reading, door, doubledRows, schedule) => {
|
|
442
|
+
const doubled = reading.duplicated.length + doubledRows;
|
|
443
|
+
const faults = [];
|
|
444
|
+
if (reading.views > 0 && door === null)
|
|
445
|
+
faults.push("door-unscaled");
|
|
446
|
+
if (door !== null && door.opened === 0 && (door.appearances > 0 || reading.views > 0)) {
|
|
447
|
+
faults.push("openings-unmarked");
|
|
448
|
+
}
|
|
449
|
+
if (door !== null && door.inflation !== null && door.inflation > COUNTS_INFLATED_ABOVE) {
|
|
450
|
+
faults.push("counts-inflated");
|
|
451
|
+
}
|
|
452
|
+
if (stalled(door, schedule))
|
|
453
|
+
faults.push("collection-stalled");
|
|
454
|
+
if (pageActionOf(reading).unwalked)
|
|
455
|
+
faults.push("actions-uncredited");
|
|
456
|
+
/**
|
|
457
|
+
* Taken from the frontier rather than spelled again, on the rule
|
|
458
|
+
* `actions-uncredited` is taken from `pageActionOf` under (0242): a fault
|
|
459
|
+
* vocabulary written in two places is this subsystem's commonest defect, and
|
|
460
|
+
* *a part that reported nothing with a reader below it* is a sentence
|
|
461
|
+
* `frontier.ts` already owns. One more linear pass over the page's parts,
|
|
462
|
+
* which is the bound every reading here is held to.
|
|
463
|
+
*/
|
|
464
|
+
const unreporting = pageFrontierOf(reading).notReporting.length;
|
|
465
|
+
if (unreporting > 0)
|
|
466
|
+
faults.push("parts-unreporting");
|
|
467
|
+
if (reading.orphaned.length > 0 || doubled > 0)
|
|
468
|
+
faults.push("rows-mishandled");
|
|
469
|
+
if (reading.audienceId === null && reading.audiences.length > 1)
|
|
470
|
+
faults.push("audiences-mixed");
|
|
471
|
+
const standing = faults.length > 0
|
|
472
|
+
? "faulted"
|
|
473
|
+
: reading.views > 0
|
|
474
|
+
? "sound"
|
|
475
|
+
: door !== null && door.opened > 0
|
|
476
|
+
? "unfolded"
|
|
477
|
+
: "unmeasured";
|
|
478
|
+
return {
|
|
479
|
+
treeId: reading.treeId,
|
|
480
|
+
revision: reading.revision,
|
|
481
|
+
audienceId: reading.audienceId,
|
|
482
|
+
standing,
|
|
483
|
+
faults,
|
|
484
|
+
views: reading.views,
|
|
485
|
+
arrivals: door?.opened ?? null,
|
|
486
|
+
appearances: door?.appearances ?? null,
|
|
487
|
+
inflation: door?.inflation ?? null,
|
|
488
|
+
pending: door?.pending ?? 0,
|
|
489
|
+
foldedAt: door?.foldedAt ?? null,
|
|
490
|
+
orphaned: reading.orphaned.length,
|
|
491
|
+
doubled,
|
|
492
|
+
unreporting,
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* The worse of two faulted pages, which is the ranking rule spelled once.
|
|
497
|
+
*
|
|
498
|
+
* By arrivals before the view floor, because the arrivals are the readers and
|
|
499
|
+
* the floor is only what is left to order by when two pages cost the same.
|
|
500
|
+
*/
|
|
501
|
+
const worseOf = (one, other) => (other.arrivals ?? 0) - (one.arrivals ?? 0) ||
|
|
502
|
+
other.views - one.views ||
|
|
503
|
+
one.treeId.localeCompare(other.treeId) ||
|
|
504
|
+
other.revision - one.revision;
|
|
505
|
+
/**
|
|
506
|
+
* Tree id, then newest revision first, which is the order the door rows are
|
|
507
|
+
* read in, then the audience — which only separates two rows that are the same
|
|
508
|
+
* page in two forms, and is there so the order is total rather than left to
|
|
509
|
+
* the input's.
|
|
510
|
+
*/
|
|
511
|
+
const byPage = (one, other) => one.treeId.localeCompare(other.treeId) ||
|
|
512
|
+
other.revision - one.revision ||
|
|
513
|
+
(one.audienceId ?? "").localeCompare(other.audienceId ?? "");
|
|
514
|
+
/**
|
|
515
|
+
* What a deployment is collecting, read off the page readings and the door rows
|
|
516
|
+
* it already has.
|
|
517
|
+
*
|
|
518
|
+
* Takes the readings rather than the counters, as every derived reading here
|
|
519
|
+
* does: the join to the tree is what makes an orphaned counter and an uncredited
|
|
520
|
+
* action visible at all, and deriving it twice is how two screens come to
|
|
521
|
+
* disagree. A caller with counters and trees reads the parts, then this.
|
|
522
|
+
*
|
|
523
|
+
* The rows are the whole window of door rows a deployment holds, not one page's
|
|
524
|
+
* — each revision's own row is picked out of them by the published rule (0219),
|
|
525
|
+
* so no caller writes the matching itself.
|
|
526
|
+
*
|
|
527
|
+
* The schedule is optional and is the only argument here that is not a row: a
|
|
528
|
+
* caller that states what its collection promises gets `collection-stalled`
|
|
529
|
+
* judged for it, and one that does not gets every other fault and `pending`
|
|
530
|
+
* published unjudged (0274).
|
|
531
|
+
*/
|
|
532
|
+
export const collectionHealthOf = (readings, rows, schedule) => {
|
|
533
|
+
const seen = new Set();
|
|
534
|
+
const pages = [];
|
|
535
|
+
let duplicated = 0;
|
|
536
|
+
for (const reading of readings) {
|
|
537
|
+
const key = readingKeyOf(reading);
|
|
538
|
+
if (seen.has(key)) {
|
|
539
|
+
duplicated += 1;
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
seen.add(key);
|
|
543
|
+
const door = pageViewsFor(reading, rows);
|
|
544
|
+
pages.push(healthOf(reading, door.measured, door.duplicated, schedule));
|
|
545
|
+
}
|
|
546
|
+
const standings = { ...EMPTY_STANDINGS };
|
|
547
|
+
const faults = { ...EMPTY_FAULTS };
|
|
548
|
+
for (const page of pages) {
|
|
549
|
+
standings[page.standing] += 1;
|
|
550
|
+
for (const fault of page.faults)
|
|
551
|
+
faults[fault] += 1;
|
|
552
|
+
}
|
|
553
|
+
const faulted = pages
|
|
554
|
+
.filter((page) => page.standing === "faulted" && page.arrivals !== null)
|
|
555
|
+
.sort(worseOf);
|
|
556
|
+
return {
|
|
557
|
+
pages: [...pages].sort(byPage),
|
|
558
|
+
faulted,
|
|
559
|
+
unpriced: pages
|
|
560
|
+
.filter((page) => page.standing === "faulted" && page.arrivals === null)
|
|
561
|
+
.sort(byPage),
|
|
562
|
+
worst: faulted[0] ?? null,
|
|
563
|
+
standings,
|
|
564
|
+
faults,
|
|
565
|
+
readersAffected: faulted.reduce((sum, page) => sum + (page.arrivals ?? 0), 0),
|
|
566
|
+
arrivals: pages.reduce((sum, page) => sum + (page.arrivals ?? 0), 0),
|
|
567
|
+
pending: pages.reduce((sum, page) => sum + page.pending, 0),
|
|
568
|
+
unattested: pages.filter((page) => page.pending > 0 && page.foldedAt === null).length,
|
|
569
|
+
trees: new Set(pages.map((page) => page.treeId)).size,
|
|
570
|
+
duplicated,
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
//# sourceMappingURL=health.js.map
|
package/dist/signals/index.d.ts
CHANGED
|
@@ -16,16 +16,76 @@
|
|
|
16
16
|
* `@jam-overture/loom/signals/postgres` is where a deployment picks it up, exactly
|
|
17
17
|
* as the store and the journal do it.
|
|
18
18
|
*/
|
|
19
|
+
export * from "./acted.js";
|
|
20
|
+
export * from "./action-change.js";
|
|
21
|
+
export * from "./action.js";
|
|
22
|
+
export * from "./agenda.js";
|
|
23
|
+
export * from "./arrivals.js";
|
|
24
|
+
export * from "./arriving.js";
|
|
25
|
+
export * from "./audiences.js";
|
|
19
26
|
export * from "./broadcast.js";
|
|
27
|
+
export * from "./change.js";
|
|
20
28
|
export * from "./collect.js";
|
|
29
|
+
export * from "./conversion.js";
|
|
30
|
+
export * from "./copy-change.js";
|
|
31
|
+
export * from "./copy.js";
|
|
21
32
|
export * from "./deliver.js";
|
|
33
|
+
export * from "./deployment-change.js";
|
|
34
|
+
export * from "./deployment.js";
|
|
35
|
+
export * from "./door.js";
|
|
36
|
+
export * from "./expire.js";
|
|
22
37
|
export * from "./fold.js";
|
|
38
|
+
export * from "./form-action.js";
|
|
39
|
+
export * from "./form-copy.js";
|
|
40
|
+
export * from "./forms.js";
|
|
41
|
+
export * from "./frontier.js";
|
|
42
|
+
export * from "./funnel-change.js";
|
|
43
|
+
export * from "./funnel-hours.js";
|
|
44
|
+
export * from "./funnel.js";
|
|
45
|
+
export * from "./health.js";
|
|
23
46
|
export * from "./ingest.js";
|
|
47
|
+
export * from "./inside.js";
|
|
24
48
|
export * from "./intake.js";
|
|
25
49
|
export * from "./journal.js";
|
|
50
|
+
export * from "./library-action.js";
|
|
51
|
+
export * from "./library-agenda-change.js";
|
|
52
|
+
export * from "./library-agenda.js";
|
|
53
|
+
export * from "./library-change.js";
|
|
54
|
+
export * from "./library-copy-change.js";
|
|
55
|
+
export * from "./library-pace.js";
|
|
56
|
+
export * from "./library-reach-change.js";
|
|
57
|
+
export * from "./library-reach.js";
|
|
58
|
+
export * from "./library-senders-change.js";
|
|
59
|
+
export * from "./library-senders-reach-change.js";
|
|
60
|
+
export * from "./library-senders-reach.js";
|
|
61
|
+
export * from "./library-senders.js";
|
|
62
|
+
export * from "./library-word-reach-change.js";
|
|
63
|
+
export * from "./library.js";
|
|
26
64
|
export * from "./memory.js";
|
|
65
|
+
export * from "./notice.js";
|
|
66
|
+
export * from "./pace-change.js";
|
|
67
|
+
export * from "./pace.js";
|
|
68
|
+
export * from "./page-views.js";
|
|
69
|
+
export * from "./part-pace.js";
|
|
70
|
+
export * from "./parts.js";
|
|
71
|
+
export * from "./progress.js";
|
|
72
|
+
export * from "./ratios.js";
|
|
73
|
+
export * from "./reach.js";
|
|
74
|
+
export * from "./readership.js";
|
|
75
|
+
export * from "./readable.js";
|
|
76
|
+
export * from "./region-pages.js";
|
|
77
|
+
export * from "./region.js";
|
|
78
|
+
export * from "./retention.js";
|
|
79
|
+
export * from "./rhythm.js";
|
|
27
80
|
export * from "./rollup.js";
|
|
28
81
|
export * from "./signal.js";
|
|
82
|
+
export * from "./silence-census.js";
|
|
83
|
+
export * from "./silences.js";
|
|
29
84
|
export * from "./tally.js";
|
|
85
|
+
export * from "./unread.js";
|
|
30
86
|
export * from "./view.js";
|
|
87
|
+
export * from "./window-agenda.js";
|
|
88
|
+
export * from "./window-figures.js";
|
|
89
|
+
export * from "./window-funnels.js";
|
|
90
|
+
export * from "./window.js";
|
|
31
91
|
//# sourceMappingURL=index.d.ts.map
|