@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,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fifth contract suite both reader-signal journals are run against: **a
|
|
3
|
+
* counted delivery is marked rather than deleted, and the mark is what the next
|
|
4
|
+
* fold reads** (0351).
|
|
5
|
+
*
|
|
6
|
+
* It is here rather than beside the three in `src/testing/reader-signal-contract.ts`
|
|
7
|
+
* for the reason `applied-window.contract.ts` is: that directory is another
|
|
8
|
+
* lane's and this is reader-signal work. The finding filed with 0316 asks for
|
|
9
|
+
* the set to be moved together, which is one import away.
|
|
10
|
+
*
|
|
11
|
+
* **Every property here needs two implementations to be worth asserting**,
|
|
12
|
+
* which is what earns it a contract rather than a test beside the memory store.
|
|
13
|
+
* The stamp has to be idempotent, and in Postgres that is a clause in a `WHERE`
|
|
14
|
+
* — `folded_at IS NULL` — while in memory it is a guard in a `map`. The filter
|
|
15
|
+
* has to tell three states apart, and in Postgres `null` is one of them while
|
|
16
|
+
* in memory the field is absent. Those are exactly the differences that make
|
|
17
|
+
* two stores quietly disagree, and the disagreement here would be a window
|
|
18
|
+
* counted twice (0158).
|
|
19
|
+
*/
|
|
20
|
+
import { describe, expect, it } from "vitest";
|
|
21
|
+
import { batchOf, nodeId, viewed } from "../testing/reader-signal-contract.js";
|
|
22
|
+
const AT = "2026-11-05T09:00:00.000Z";
|
|
23
|
+
const LATER = "2026-11-05T10:00:00.000Z";
|
|
24
|
+
const unwrap = (result) => {
|
|
25
|
+
if (!result.ok)
|
|
26
|
+
throw new Error(result.error.detail);
|
|
27
|
+
return result.value;
|
|
28
|
+
};
|
|
29
|
+
export const describeKeptDeliveryContract = (name, make) => {
|
|
30
|
+
describe(`${name} — a counted delivery`, () => {
|
|
31
|
+
/** Three deliveries, oldest first, and the position above the second. */
|
|
32
|
+
const three = async () => {
|
|
33
|
+
const journal = await make();
|
|
34
|
+
await journal.receive([
|
|
35
|
+
batchOf([viewed("a")]),
|
|
36
|
+
batchOf([viewed("b")]),
|
|
37
|
+
batchOf([viewed("c")]),
|
|
38
|
+
]);
|
|
39
|
+
const seqs = unwrap(await journal.read()).batches.map((batch) => batch.seq);
|
|
40
|
+
return { journal, before: seqs[2] };
|
|
41
|
+
};
|
|
42
|
+
const names = async (journal, counted) => unwrap(await journal.read(counted === undefined ? undefined : { counted })).batches.map((batch) => batch.signals[0]?.nodeId);
|
|
43
|
+
it("is still there, carrying the instant the fold was taken at", async () => {
|
|
44
|
+
const { journal, before } = await three();
|
|
45
|
+
expect(unwrap(await journal.counted({ before, at: AT })).counted).toBe(2);
|
|
46
|
+
expect(unwrap(await journal.read()).batches.map((batch) => batch.foldedAt)).toEqual([
|
|
47
|
+
AT,
|
|
48
|
+
AT,
|
|
49
|
+
undefined,
|
|
50
|
+
]);
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* **The case this would double-count** (0158). The run that stamps has
|
|
54
|
+
* already written the counters, so a retry of the stamp must not be worse
|
|
55
|
+
* than the failure that caused it — and the second call must not move an
|
|
56
|
+
* instant a reading has been taken against.
|
|
57
|
+
*/
|
|
58
|
+
it("is stamped once, however many times the prefix is marked", async () => {
|
|
59
|
+
const { journal, before } = await three();
|
|
60
|
+
await journal.counted({ before, at: AT });
|
|
61
|
+
expect(unwrap(await journal.counted({ before, at: LATER })).counted).toBe(0);
|
|
62
|
+
expect(unwrap(await journal.read()).batches.map((batch) => batch.foldedAt)).toEqual([
|
|
63
|
+
AT,
|
|
64
|
+
AT,
|
|
65
|
+
undefined,
|
|
66
|
+
]);
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* The fold's own read. It is what stops collection scanning the kept window
|
|
70
|
+
* to find the handful of rows it is for, and it is what stops it folding a
|
|
71
|
+
* window twice.
|
|
72
|
+
*/
|
|
73
|
+
it("is left out of the uncounted read and in the counted one", async () => {
|
|
74
|
+
const { journal, before } = await three();
|
|
75
|
+
await journal.counted({ before, at: AT });
|
|
76
|
+
expect(await names(journal, false)).toEqual([nodeId("c")]);
|
|
77
|
+
expect(await names(journal, true)).toEqual([nodeId("a"), nodeId("b")]);
|
|
78
|
+
expect(await names(journal)).toEqual([nodeId("a"), nodeId("b"), nodeId("c")]);
|
|
79
|
+
});
|
|
80
|
+
it("marks nothing where nothing is below the position", async () => {
|
|
81
|
+
const journal = await make();
|
|
82
|
+
await journal.receive([batchOf([viewed("a")])]);
|
|
83
|
+
const [only] = unwrap(await journal.read()).batches;
|
|
84
|
+
expect(unwrap(await journal.counted({ before: only?.seq ?? 0, at: AT })).counted).toBe(0);
|
|
85
|
+
expect(await names(journal, false)).toEqual([nodeId("a")]);
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* The expiry sweep's delete, which is the ordinary `forget` against a
|
|
89
|
+
* prefix the fold has already stamped. The journal does not enforce the
|
|
90
|
+
* *counted first* rule — that is `expire.ts`' plan, which is where the rule
|
|
91
|
+
* can be read — so what this asserts is that the two operations compose:
|
|
92
|
+
* the prefix a fold marked is a prefix retention can delete.
|
|
93
|
+
*/
|
|
94
|
+
it("is deleted by the ordinary prefix forget once retention reaches it", async () => {
|
|
95
|
+
const { journal, before } = await three();
|
|
96
|
+
await journal.counted({ before, at: AT });
|
|
97
|
+
expect(unwrap(await journal.forget({ before })).removed).toBe(2);
|
|
98
|
+
expect(await names(journal)).toEqual([nodeId("c")]);
|
|
99
|
+
expect(await names(journal, true)).toEqual([]);
|
|
100
|
+
});
|
|
101
|
+
/** A fresh delivery is uncounted, which is the state every row starts in. */
|
|
102
|
+
it("starts uncounted, with nothing on the field", async () => {
|
|
103
|
+
const journal = await make();
|
|
104
|
+
await journal.receive([batchOf([viewed("a")])]);
|
|
105
|
+
const [only] = unwrap(await journal.read()).batches;
|
|
106
|
+
expect(only?.foldedAt).toBeUndefined();
|
|
107
|
+
expect(await names(journal, true)).toEqual([]);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=kept.contract.js.map
|
package/dist/signals/kinds.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The five kinds of reader signal, with nothing else in the module.
|
|
3
3
|
*
|
|
4
4
|
* The schema in `signal.ts` is built from this list. It lives apart so the
|
|
5
5
|
* broadcaster, which runs in a visitor's browser, can know the kinds without
|
|
6
6
|
* pulling in the schema library (0136).
|
|
7
7
|
*/
|
|
8
|
-
export declare const READER_SIGNAL_KINDS: readonly ["viewed", "dwelled", "activated", "disclosed"];
|
|
8
|
+
export declare const READER_SIGNAL_KINDS: readonly ["viewed", "dwelled", "activated", "disclosed", "completed"];
|
|
9
9
|
/**
|
|
10
10
|
* The kinds whose node is not the thing a reader aimed at.
|
|
11
11
|
*
|
|
12
12
|
* A reader presses a button and opens a disclosure; both are addressed nodes of
|
|
13
13
|
* their own, so the node such a signal is filed against is the control rather
|
|
14
|
-
* than the region the control is in.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* than the region the control is in. A submitted form is the same shape — the
|
|
15
|
+
* node is the form, and the band the form was the end of is the thing a
|
|
16
|
+
* deployment wants to read. `viewed` and `dwelled` have no such gap — they are
|
|
17
|
+
* observed on the addressed element itself — which is why these three carry an
|
|
18
|
+
* ancestry and the other two do not (0167).
|
|
17
19
|
*
|
|
18
20
|
* Here rather than in `signal.ts` so the broadcaster can know which signals it
|
|
19
21
|
* must walk for without loading the schema library (0136).
|
|
20
22
|
*/
|
|
21
|
-
export declare const DELEGATED_READER_SIGNAL_KINDS: readonly ["activated", "disclosed"];
|
|
23
|
+
export declare const DELEGATED_READER_SIGNAL_KINDS: readonly ["activated", "disclosed", "completed"];
|
|
22
24
|
//# sourceMappingURL=kinds.d.ts.map
|
package/dist/signals/kinds.js
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The five kinds of reader signal, with nothing else in the module.
|
|
3
3
|
*
|
|
4
4
|
* The schema in `signal.ts` is built from this list. It lives apart so the
|
|
5
5
|
* broadcaster, which runs in a visitor's browser, can know the kinds without
|
|
6
6
|
* pulling in the schema library (0136).
|
|
7
7
|
*/
|
|
8
|
-
export const READER_SIGNAL_KINDS = [
|
|
8
|
+
export const READER_SIGNAL_KINDS = [
|
|
9
|
+
"viewed",
|
|
10
|
+
"dwelled",
|
|
11
|
+
"activated",
|
|
12
|
+
"disclosed",
|
|
13
|
+
"completed",
|
|
14
|
+
];
|
|
9
15
|
/**
|
|
10
16
|
* The kinds whose node is not the thing a reader aimed at.
|
|
11
17
|
*
|
|
12
18
|
* A reader presses a button and opens a disclosure; both are addressed nodes of
|
|
13
19
|
* their own, so the node such a signal is filed against is the control rather
|
|
14
|
-
* than the region the control is in.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
20
|
+
* than the region the control is in. A submitted form is the same shape — the
|
|
21
|
+
* node is the form, and the band the form was the end of is the thing a
|
|
22
|
+
* deployment wants to read. `viewed` and `dwelled` have no such gap — they are
|
|
23
|
+
* observed on the addressed element itself — which is why these three carry an
|
|
24
|
+
* ancestry and the other two do not (0167).
|
|
17
25
|
*
|
|
18
26
|
* Here rather than in `signal.ts` so the broadcaster can know which signals it
|
|
19
27
|
* must walk for without loading the schema library (0136).
|
|
20
28
|
*/
|
|
21
|
-
export const DELEGATED_READER_SIGNAL_KINDS = ["activated", "disclosed"];
|
|
29
|
+
export const DELEGATED_READER_SIGNAL_KINDS = ["activated", "disclosed", "completed"];
|
|
22
30
|
//# sourceMappingURL=kinds.js.map
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import type { PrimitiveType } from "../primitive-type.js";
|
|
2
|
+
import { type PrimitiveRole } from "../role.js";
|
|
3
|
+
import { type ActionStanding } from "./action.js";
|
|
4
|
+
import { type KindKey } from "./library.js";
|
|
5
|
+
import type { KindReachSilence, UnscaledPage } from "./library-reach.js";
|
|
6
|
+
import { type RevisionOf, type StoredPageViews } from "./page-views.js";
|
|
7
|
+
import type { PageReading } from "./parts.js";
|
|
8
|
+
/**
|
|
9
|
+
* Of the readers who met a kind of part, the share that did something inside
|
|
10
|
+
* it.
|
|
11
|
+
*
|
|
12
|
+
* Three readings now stand on one list of `PageReading`s and answer three
|
|
13
|
+
* different questions about one primitive type. [`library.ts`](library.ts)
|
|
14
|
+
* counts the **places** it stands and how many of them were reached (0257);
|
|
15
|
+
* [`library-reach.ts`](library-reach.ts) counts the **readers** who met those
|
|
16
|
+
* places and read it (0256). Both are about attention. This is the third and it
|
|
17
|
+
* is about what readers *did*: *of the readers who met your pricing card, three
|
|
18
|
+
* in ten did something inside it.*
|
|
19
|
+
*
|
|
20
|
+
* It is the **sixteenth** thing taken out of what this subsystem already knows
|
|
21
|
+
* rather than collected. `engaged` has been on a tally since the counters
|
|
22
|
+
* existed and [`action.ts`](action.ts) interpreted it for one page (0242);
|
|
23
|
+
* nothing had ever asked it of a **component**, which is the question a person
|
|
24
|
+
* who wrote that component actually has. **Nothing is added to a payload, a
|
|
25
|
+
* browser, a column, a store or the vocabulary of kinds**, and the broadcaster
|
|
26
|
+
* is not touched.
|
|
27
|
+
*
|
|
28
|
+
* ## It is the page reading summed, and not a second reading of a nought
|
|
29
|
+
*
|
|
30
|
+
* Every rule about what a counter means is 0242's and is applied by
|
|
31
|
+
* {@link pageActionOf}, whose rows this folds. So *a leaf has no inside*, *a
|
|
32
|
+
* press is its own occurrence and not a reader*, and *an absent row is not a
|
|
33
|
+
* nought* are decided in one place and once. What is added here is the
|
|
34
|
+
* arithmetic of putting several pages' answers together, which is the only part
|
|
35
|
+
* a library-level reading can get wrong on its own.
|
|
36
|
+
*
|
|
37
|
+
* ## The door is a weight here, and nothing else — which is why this can answer
|
|
38
|
+
* where a share of arrivals cannot
|
|
39
|
+
*
|
|
40
|
+
* A placement's own share is `engaged ÷ reached`: two distinct page-view counts
|
|
41
|
+
* off one row, so the straddle over-count (0147) is common to both terms and
|
|
42
|
+
* divides out, which is the figure 0242 settled and 0221 established the
|
|
43
|
+
* soundness of.
|
|
44
|
+
*
|
|
45
|
+
* Across pages it does not divide out, because the straddle rate is each page's
|
|
46
|
+
* own (0250) — so the weight each page carries is put on the scale the door
|
|
47
|
+
* counts in, exactly as a kind's reach is (0256): `appearances ÷ (1 +
|
|
48
|
+
* inflation)`, which comes to `min(appearances, opened)`, taken as that minimum
|
|
49
|
+
* of two whole numbers rather than as the division it equals.
|
|
50
|
+
*
|
|
51
|
+
* **But the door appears in the weights only**, and that is the difference
|
|
52
|
+
* worth the record. 0256's share divides a reach by the *arrivals*, so the
|
|
53
|
+
* scale is in its denominator and a page the door cannot scale takes the whole
|
|
54
|
+
* figure with it. Here both terms are reaches off the same rows, so a page's
|
|
55
|
+
* own scale factor cancels inside that page's contribution and only the
|
|
56
|
+
* *relative* weight of one page against another needs the door. Two
|
|
57
|
+
* consequences, and they are the shape of this module:
|
|
58
|
+
*
|
|
59
|
+
* - **A kind borne by one page needs no door row at all.** Its share is that
|
|
60
|
+
* page's own sound figure, and 0256 would have had to withhold it. A deployment
|
|
61
|
+
* with one page, and a component that stands on one page of forty, are both
|
|
62
|
+
* answered.
|
|
63
|
+
* - **A page whose placements were reached by nobody needs no scale either**,
|
|
64
|
+
* because it contributes nothing to either term whatever its scale is. So the
|
|
65
|
+
* pages that must be scalable are exactly the ones that contributed reach, and
|
|
66
|
+
* {@link KindAction.weighed} is how many there were.
|
|
67
|
+
*
|
|
68
|
+
* Where more than one page contributed reach and one of them cannot be scaled,
|
|
69
|
+
* the whole kind is withheld — 0256's refusal unchanged, for its reason: a
|
|
70
|
+
* weighted mean over a subset is a figure whose denominator nobody named.
|
|
71
|
+
*
|
|
72
|
+
* ## There is no nought share, and that is not a gap
|
|
73
|
+
*
|
|
74
|
+
* A census can report that nobody read a kind; a reach reading can report that
|
|
75
|
+
* nobody who arrived met it. Neither is available to this one, because its
|
|
76
|
+
* denominator is **the readers who got there**. A kind nothing reached has no
|
|
77
|
+
* denominator, so *nobody acted in it* is a silence here and never a nought —
|
|
78
|
+
* and a surface that printed a nought would be saying the one thing the counters
|
|
79
|
+
* cannot distinguish from nobody ever seeing it.
|
|
80
|
+
*
|
|
81
|
+
* ## What is deliberately not published
|
|
82
|
+
*
|
|
83
|
+
* **No ceiling.** 0256 publishes a share against the folded page views and a
|
|
84
|
+
* bound against the openings, because openings are exact. Nothing counts an
|
|
85
|
+
* action at the door, so there is no exact term to bound this with — and none is
|
|
86
|
+
* needed, since the straddle cancels inside every page's contribution rather
|
|
87
|
+
* than being carried into the result. {@link KindAction.settled} says whether
|
|
88
|
+
* the evidence has stopped arriving, which is the only error left.
|
|
89
|
+
*
|
|
90
|
+
* **No count where there is no scale.** A scale-free row publishes its share and
|
|
91
|
+
* **not** `met` or `acted`: those are counts of page views at the door's scale,
|
|
92
|
+
* and a row whose page the door could not scale has no number on that scale to
|
|
93
|
+
* offer. Mixing the two scales in one column would misrank the one ordering
|
|
94
|
+
* here that matters, so {@link LibraryAction.unranked} says how many rows the
|
|
95
|
+
* ranking could not see.
|
|
96
|
+
*
|
|
97
|
+
* **No reading-wide share**, for 0256's reason: a share over every kind at once
|
|
98
|
+
* weighs a page by how finely it was built.
|
|
99
|
+
*
|
|
100
|
+
* **Nothing the census already says.** The standings of attention, the words,
|
|
101
|
+
* the dwell and the occurrence counts are a kind's row in `library.ts`. The
|
|
102
|
+
* three readings pair on {@link kindKeyOf}.
|
|
103
|
+
*
|
|
104
|
+
* Pure. It reaches no store, no clock and no DOM, it is linear in the parts of
|
|
105
|
+
* the readings times the rows handed in, and nothing in it survives into a
|
|
106
|
+
* browser bundle.
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* Why a kind has no share of the readers who acted inside it.
|
|
110
|
+
*
|
|
111
|
+
* **The reach reading's whole set is reused rather than restated**, which is the
|
|
112
|
+
* affirmative use of the limit 0256 found: a silence's subject is a property of
|
|
113
|
+
* the reading that publishes it (0240), and this reading's subject is a kind
|
|
114
|
+
* exactly as that one's is. Its five members are the same five states of the
|
|
115
|
+
* world at the same subject, so a surface drawing two of the three library
|
|
116
|
+
* readings prints one word for one state. Two are added, and only one of them
|
|
117
|
+
* brings a condition nothing else could report.
|
|
118
|
+
*/
|
|
119
|
+
export type KindActionSilence = KindReachSilence
|
|
120
|
+
/**
|
|
121
|
+
* No place this kind stands has anything inside it.
|
|
122
|
+
*
|
|
123
|
+
* A heading, a paragraph, a rule, an image and a button are all this: a press
|
|
124
|
+
* is filed against the control and `engaged` counts the views whose reader
|
|
125
|
+
* did something *strictly inside* a node (0167), so a leaf reports a nought
|
|
126
|
+
* for ever and the nought is a filing rule rather than a measurement (0242).
|
|
127
|
+
*
|
|
128
|
+
* **It is a fact about the shape of the pages and not about the window**, and
|
|
129
|
+
* it is the one reason here that would be exactly as true if every reader in
|
|
130
|
+
* the world had read them. The question does not exist for this kind rather
|
|
131
|
+
* than having gone unanswered — so the instruction it carries is *ask the
|
|
132
|
+
* census instead*, never *collect more*.
|
|
133
|
+
*
|
|
134
|
+
* It is said of the kind only where **every** placement is a leaf. A kind that
|
|
135
|
+
* bears parts in some places and not others is answered over the places where
|
|
136
|
+
* the question exists, and {@link KindAction.leaves} is how many it stood in
|
|
137
|
+
* where it did not.
|
|
138
|
+
*/
|
|
139
|
+
| "unenterable"
|
|
140
|
+
/**
|
|
141
|
+
* A page that contributed readers holds actions and credits them to nobody.
|
|
142
|
+
*
|
|
143
|
+
* A press is credited to the addressed ancestors the signal carries (0167), so
|
|
144
|
+
* a sender whose delegated signals have no `within` adds occurrences and no
|
|
145
|
+
* `engaged` anywhere on that page — a server synthesising batches, a replayed
|
|
146
|
+
* fixture, a walk turned off. Every share on such a page is a nought that is a
|
|
147
|
+
* filing rule, which is what `PageAction.unwalked` reports for one page.
|
|
148
|
+
*
|
|
149
|
+
* Withheld for the **whole** kind where any page behind the figure is in that
|
|
150
|
+
* state, and not blended: such a page puts reach into the denominator and
|
|
151
|
+
* nothing into the numerator, so a mean across pages would be dragged down by
|
|
152
|
+
* a sender's configuration with no reader involved. That is the same class of
|
|
153
|
+
* error as a page the door cannot scale, and it gets the same refusal.
|
|
154
|
+
* {@link LibraryAction.unwalked} names the pages, which is the actionable half.
|
|
155
|
+
*/
|
|
156
|
+
| "unwalked";
|
|
157
|
+
export declare const KIND_ACTION_SILENCES: readonly KindActionSilence[];
|
|
158
|
+
/** One line per silence, for a surface saying why a kind has no share of its readers' actions. */
|
|
159
|
+
export declare const describeKindActionSilence: (silence: KindActionSilence) => string;
|
|
160
|
+
/**
|
|
161
|
+
* One kind of part, against what the readers who met it did inside it.
|
|
162
|
+
*
|
|
163
|
+
* Identity and the placement counts travel with the figures, so a surface
|
|
164
|
+
* drawing this never holds two lists side by side to find out how much is behind
|
|
165
|
+
* a share.
|
|
166
|
+
*/
|
|
167
|
+
export type KindAction = {
|
|
168
|
+
readonly kind: KindKey;
|
|
169
|
+
/** What part a type plays (0114), or `null`. Always `null` on a role row, which carries it as its key. */
|
|
170
|
+
readonly role: PrimitiveRole | null;
|
|
171
|
+
/** Element nodes of this kind across the readings, as the census counts them. */
|
|
172
|
+
readonly placements: number;
|
|
173
|
+
/**
|
|
174
|
+
* Placements that bear element parts, which are the ones the question exists
|
|
175
|
+
* for.
|
|
176
|
+
*
|
|
177
|
+
* Taken off the tree the reading was built from, so it is a property of the
|
|
178
|
+
* pages and not of the window: a part keeps its children in a window nobody
|
|
179
|
+
* read.
|
|
180
|
+
*/
|
|
181
|
+
readonly insides: number;
|
|
182
|
+
/**
|
|
183
|
+
* Placements with no element part under them, which are in no term here.
|
|
184
|
+
*
|
|
185
|
+
* `placements = insides + leaves`. Published rather than left to be inferred
|
|
186
|
+
* because on an ordinary library it is most of the rows, and a figure over a
|
|
187
|
+
* third of a kind's places should say so where it is.
|
|
188
|
+
*/
|
|
189
|
+
readonly leaves: number;
|
|
190
|
+
/** Placements bearing parts that a window could speak for. */
|
|
191
|
+
readonly verdicts: number;
|
|
192
|
+
/** Placements bearing parts that no row named, and therefore excluded. */
|
|
193
|
+
readonly unknown: number;
|
|
194
|
+
/**
|
|
195
|
+
* Placements with a verdict that no reader reached.
|
|
196
|
+
*
|
|
197
|
+
* In neither term, because a reader who never got there says nothing about
|
|
198
|
+
* what readers do once they have. It is the reason a kind can have verdicts
|
|
199
|
+
* and still no share.
|
|
200
|
+
*/
|
|
201
|
+
readonly unmet: number;
|
|
202
|
+
/**
|
|
203
|
+
* Placements at the root of their page.
|
|
204
|
+
*
|
|
205
|
+
* A root's `engaged` is the page-wide headcount of readers who did anything at
|
|
206
|
+
* all (0242), so a row whose placements are roots is that figure and not a
|
|
207
|
+
* fact about a component. A kind is not a node and the same type is a root on
|
|
208
|
+
* one page and nested on another, so nothing is excluded for it — this is the
|
|
209
|
+
* number that says how much of the row is page-wide.
|
|
210
|
+
*/
|
|
211
|
+
readonly roots: number;
|
|
212
|
+
/**
|
|
213
|
+
* Placements by the standing a page's own reading gives them (0242), over
|
|
214
|
+
* **every** placement including the leaves.
|
|
215
|
+
*
|
|
216
|
+
* The *places* half of this row, and the one a surface must not print under
|
|
217
|
+
* the share's label: *readers acted in it in 3 of its 9 places* and *3 in 10
|
|
218
|
+
* of the readers who met it acted inside it* are different sentences about one
|
|
219
|
+
* component and can differ by an order of magnitude. It is the pairing care
|
|
220
|
+
* the other two readings of a library already needed once (0256, 0257).
|
|
221
|
+
*/
|
|
222
|
+
readonly standings: Readonly<Record<ActionStanding, number>>;
|
|
223
|
+
/** Revisions bearing a placement with an inside and a verdict. */
|
|
224
|
+
readonly pages: number;
|
|
225
|
+
/**
|
|
226
|
+
* Of those, the pages that contributed reach — the weights that actually
|
|
227
|
+
* decide the share.
|
|
228
|
+
*
|
|
229
|
+
* 1 is the scale-free case: one page's own sound figure, needing no door row.
|
|
230
|
+
* It is also what makes the door's silences conditional, since a page nobody
|
|
231
|
+
* reached needs no scale.
|
|
232
|
+
*/
|
|
233
|
+
readonly weighed: number;
|
|
234
|
+
/**
|
|
235
|
+
* Page views that reached an enterable place of this kind, at the door's
|
|
236
|
+
* scale: `reached × min(appearances, opened) ÷ appearances`, added over the
|
|
237
|
+
* bearing placements.
|
|
238
|
+
*
|
|
239
|
+
* The denominator of {@link share}. **Not a count of people and deliberately
|
|
240
|
+
* not rounded into one** (0256): the unit is the pair *(a page view, a place
|
|
241
|
+
* this kind stands on that page)*, so a page view of a page bearing three
|
|
242
|
+
* placements is three of them.
|
|
243
|
+
*
|
|
244
|
+
* `null` under a silence, and `null` on a scale-free row — where the share
|
|
245
|
+
* stands and there is no number on the door's scale to publish beside it.
|
|
246
|
+
*/
|
|
247
|
+
readonly met: number | null;
|
|
248
|
+
/** The same page views whose reader acted inside the place, at the same scale. */
|
|
249
|
+
readonly acted: number | null;
|
|
250
|
+
/** `met − acted`: the page views that met an enterable place and did nothing in it. */
|
|
251
|
+
readonly ignored: number | null;
|
|
252
|
+
/**
|
|
253
|
+
* `acted ÷ met` — the share of the readers who met it that did something
|
|
254
|
+
* inside it.
|
|
255
|
+
*
|
|
256
|
+
* A weighted mean of each page's own sound share with that page's arrivals
|
|
257
|
+
* behind it, and the one figure here that survives where the counts do not:
|
|
258
|
+
* a scale-free row publishes this and no count. Above 1 exactly where
|
|
259
|
+
* {@link unreconciled} is non-nought and never otherwise.
|
|
260
|
+
*/
|
|
261
|
+
readonly share: number | null;
|
|
262
|
+
/**
|
|
263
|
+
* Whether {@link met} and {@link acted} are on the door's scale, which is the
|
|
264
|
+
* only scale two rows' counts may be compared on.
|
|
265
|
+
*
|
|
266
|
+
* False on a scale-free row and under a silence. {@link share} is sound either
|
|
267
|
+
* way, which is the whole of what the door buys here.
|
|
268
|
+
*/
|
|
269
|
+
readonly onDoorScale: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Appearances in excess of openings across the weighing pages, added **once
|
|
272
|
+
* per page** rather than once per placement.
|
|
273
|
+
*
|
|
274
|
+
* The weights here are a page's and not a placement's, which is where this
|
|
275
|
+
* parts from the reach reading's figure of the same name. It biases nothing:
|
|
276
|
+
* the straddle divided out inside each page's share before the pages met, so
|
|
277
|
+
* this is the measured size of a correction that has already happened.
|
|
278
|
+
*/
|
|
279
|
+
readonly drift: number;
|
|
280
|
+
/**
|
|
281
|
+
* Openings across the weighing pages whose reading no rollup has folded yet.
|
|
282
|
+
*
|
|
283
|
+
* The one error left in the share, and it is in the weights rather than in any
|
|
284
|
+
* term: a lagging page weighs less than a caught-up one, which shifts the
|
|
285
|
+
* evidence and not the figure.
|
|
286
|
+
*/
|
|
287
|
+
readonly pending: number;
|
|
288
|
+
/**
|
|
289
|
+
* No opening is waiting to be folded and nothing is unreconciled, so the
|
|
290
|
+
* weights are final.
|
|
291
|
+
*
|
|
292
|
+
* **Not an exactness claim and there is no `exact` here**, because no term of
|
|
293
|
+
* this share carries a straddle to be exact about. False under a silence.
|
|
294
|
+
*/
|
|
295
|
+
readonly settled: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Placements crediting more readers with acting inside them than reached them,
|
|
298
|
+
* which no rollup produces.
|
|
299
|
+
*
|
|
300
|
+
* Counters older than the column, or a caller that concatenated two reads. It
|
|
301
|
+
* is the one thing that can put {@link share} above 1, and a surface should
|
|
302
|
+
* show the census instead where it is non-nought.
|
|
303
|
+
*/
|
|
304
|
+
readonly unreconciled: number;
|
|
305
|
+
readonly silence: KindActionSilence | null;
|
|
306
|
+
};
|
|
307
|
+
/** What a deployment's library gets its readers to do, by kind of part. */
|
|
308
|
+
export type LibraryAction = {
|
|
309
|
+
/**
|
|
310
|
+
* Every type that stands anywhere, most readers ignored first.
|
|
311
|
+
*
|
|
312
|
+
* Then the lower share, then by type, so two kinds that are ignored equally
|
|
313
|
+
* do not reorder on a refresh. A kind with no share sorts after one whose
|
|
314
|
+
* share is nought.
|
|
315
|
+
*/
|
|
316
|
+
readonly byType: readonly KindAction[];
|
|
317
|
+
/** Every role in the vocabulary, then the row for parts whose type declared none, in the same order. */
|
|
318
|
+
readonly byRole: readonly KindAction[];
|
|
319
|
+
/** Readings counted, which is revisions of pages and not trees. */
|
|
320
|
+
readonly pages: number;
|
|
321
|
+
/** Distinct trees across them. */
|
|
322
|
+
readonly trees: number;
|
|
323
|
+
/** Element nodes across them, which is the sum of every type row's placements. */
|
|
324
|
+
readonly placements: number;
|
|
325
|
+
/** Of those, the ones bearing element parts. */
|
|
326
|
+
readonly insides: number;
|
|
327
|
+
/** Of those, the ones with nothing inside them. `placements = insides + leaves`. */
|
|
328
|
+
readonly leaves: number;
|
|
329
|
+
/**
|
|
330
|
+
* Page views counted at the door across the pages read, added **once per
|
|
331
|
+
* page**.
|
|
332
|
+
*
|
|
333
|
+
* Addable for the reason no other count here is: a page view began on one
|
|
334
|
+
* revision of one tree and was counted once (0219). It is the weight behind
|
|
335
|
+
* the whole reading and is the denominator of nothing.
|
|
336
|
+
*/
|
|
337
|
+
readonly arrivals: number;
|
|
338
|
+
/** Placements by standing, over the whole library. */
|
|
339
|
+
readonly standings: Readonly<Record<ActionStanding, number>>;
|
|
340
|
+
/**
|
|
341
|
+
* The type the most readers met and did nothing inside, which is the kind to
|
|
342
|
+
* look at first.
|
|
343
|
+
*
|
|
344
|
+
* By the **count** of page views and not by the share, for the reason a page's
|
|
345
|
+
* falls are ranked by the readers they lose (0221). A type and never a role,
|
|
346
|
+
* because a type is the thing an author can replace.
|
|
347
|
+
*
|
|
348
|
+
* **A kind that is only ever a page's root is not eligible**, which is how a
|
|
349
|
+
* page's own reading treats its root (0242) and the pace reading before it
|
|
350
|
+
* (0230): a root's reach is the whole page's, so such a row contains every row
|
|
351
|
+
* it would outrank and would lead with *readers opened your pages and did
|
|
352
|
+
* nothing* for ever. It is the row's `roots` against its `placements` that
|
|
353
|
+
* decides, never the type's name — a kind is not a node, and a type that is a
|
|
354
|
+
* root on one page and a band on another is a fact about a component and stays
|
|
355
|
+
* in the ranking with {@link KindAction.roots} saying how much of it is
|
|
356
|
+
* page-wide.
|
|
357
|
+
*
|
|
358
|
+
* It can only ever be a row on the door's scale, since a count is the thing
|
|
359
|
+
* being ranked. {@link unranked} is how many rows had a share the ranking
|
|
360
|
+
* could not see.
|
|
361
|
+
*/
|
|
362
|
+
readonly mostIgnored: KindAction | null;
|
|
363
|
+
/**
|
|
364
|
+
* Type rows with a share and no count, which the ranking above cannot
|
|
365
|
+
* include.
|
|
366
|
+
*
|
|
367
|
+
* The scale-free rows, and only those: a row the ranking passes over for being
|
|
368
|
+
* a page's root is excluded by design rather than for want of a scale.
|
|
369
|
+
* Published because a ranking that silently skipped rows is the kind of
|
|
370
|
+
* omission a surface presents as a complete answer.
|
|
371
|
+
*/
|
|
372
|
+
readonly unranked: number;
|
|
373
|
+
/** Pages the door could scale, which is where every count here comes from. */
|
|
374
|
+
readonly scaled: number;
|
|
375
|
+
/**
|
|
376
|
+
* The pages bearing a measured placement that the door could not scale, by
|
|
377
|
+
* tree and newest revision first, with the reason in the vocabulary a page's
|
|
378
|
+
* own reading publishes (0240).
|
|
379
|
+
*
|
|
380
|
+
* One of these pages is why a row above is withheld — or is harmless, because
|
|
381
|
+
* a page needs no scale until a second one is weighed against it. Reused from
|
|
382
|
+
* the reach reading rather than restated: it is a fact about a page either way.
|
|
383
|
+
*/
|
|
384
|
+
readonly unscaled: readonly UnscaledPage[];
|
|
385
|
+
/**
|
|
386
|
+
* The pages holding actions that credit nobody, by tree and newest revision
|
|
387
|
+
* first.
|
|
388
|
+
*
|
|
389
|
+
* The sender diagnosis, and the actionable half of every `unwalked` row above.
|
|
390
|
+
* Empty is the healthy state, and so is a deployment nobody acted on at all —
|
|
391
|
+
* a page with no occurrences is not in this list.
|
|
392
|
+
*/
|
|
393
|
+
readonly unwalked: readonly RevisionOf[];
|
|
394
|
+
/**
|
|
395
|
+
* Readings of a revision beyond the first, which were dropped.
|
|
396
|
+
*
|
|
397
|
+
* A caller that concatenated two reads holds one page twice, and a page twice
|
|
398
|
+
* is the one way a weighted figure can lie about how much weight is behind it.
|
|
399
|
+
*/
|
|
400
|
+
readonly duplicated: number;
|
|
401
|
+
/**
|
|
402
|
+
* Door rows for one revision beyond the first, which were ignored.
|
|
403
|
+
*
|
|
404
|
+
* A store keeps one row per revision, so this is a caller's two reads again —
|
|
405
|
+
* and adding them would double a page's weight against every other page.
|
|
406
|
+
*/
|
|
407
|
+
readonly duplicatedRows: number;
|
|
408
|
+
/**
|
|
409
|
+
* Types whose readings disagreed about the role they play, where the first
|
|
410
|
+
* reading's answer stands.
|
|
411
|
+
*
|
|
412
|
+
* Detected off the same readings by the same rule as the other two library
|
|
413
|
+
* readings, so the three cannot disagree about it.
|
|
414
|
+
*/
|
|
415
|
+
readonly roleDisagreed: readonly PrimitiveType[];
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* What a deployment's library gets its readers to do, by kind of part.
|
|
419
|
+
*
|
|
420
|
+
* Takes the readings and the whole window of page-view rows a deployment holds —
|
|
421
|
+
* each page's own row is picked out of them by the published matching rule
|
|
422
|
+
* (`pageViewsFor`) rather than by a fourth hand-written copy of it, because the
|
|
423
|
+
* pairing is the part of every join here that fails quietly when it is got
|
|
424
|
+
* wrong.
|
|
425
|
+
*
|
|
426
|
+
* Linear in the parts of the readings times the rows, with one pass that fills
|
|
427
|
+
* both groupings.
|
|
428
|
+
*/
|
|
429
|
+
export declare const libraryActionOf: (readings: readonly PageReading[], rows: readonly StoredPageViews[]) => LibraryAction;
|
|
430
|
+
//# sourceMappingURL=library-action.d.ts.map
|