discovery-media-player 0.1.152 → 0.1.153
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/docs/HOST-CONTRACT.md +71 -1
- package/package.json +1 -1
- package/server/mesures.js +16 -0
package/docs/HOST-CONTRACT.md
CHANGED
|
@@ -50,7 +50,7 @@ need.
|
|
|
50
50
|
"presenceDurcissement": "inconnu",
|
|
51
51
|
"presenceFusion": "inconnu",
|
|
52
52
|
"lectureSaturee": { "total": 0, "fenetreS": 0, "derniereIlYaS": null },
|
|
53
|
-
"mesures": { "fenetreS": 0, "seauxMs": [1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000], "routes": {}, "base": { "n": 0 }, "statuts": { "ok": 0, "refus4xx": 0, "debit429": 0, "occupe503": 0, "erreur5xx": 0 }, "memoireMio": { "rss": 0, "heap": 0, "tampons": 0 }, "boucleMs": { "n": 0, "moyen": null, "p99": null, "resolutionMs": 20 } },
|
|
53
|
+
"mesures": { "fenetreS": 0, "seauxMs": [1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000], "familles": ["document", "presentation", "action", "fichier", "carte", "autre"], "routes": {}, "base": { "n": 0 }, "statuts": { "ok": 0, "refus4xx": 0, "debit429": 0, "occupe503": 0, "erreur5xx": 0 }, "memoireMio": { "rss": 0, "heap": 0, "tampons": 0 }, "boucleMs": { "n": 0, "moyen": null, "p99": null, "resolutionMs": 20 } },
|
|
54
54
|
"retentionSweep": false,
|
|
55
55
|
"hostShare": true,
|
|
56
56
|
"hostMail": true,
|
|
@@ -180,6 +180,7 @@ these numbers from their side.
|
|
|
180
180
|
|---|---|
|
|
181
181
|
| `fenetreS` | seconds this process has been running — **the window every total below was counted over** |
|
|
182
182
|
| `seauxMs` | the bucket ladder the percentiles are read off, published **with** the numbers |
|
|
183
|
+
| `familles` | **the denominator of `routes`** — every family this build measures, whether or not it was exercised. It does not move with traffic; that is what makes it a denominator |
|
|
183
184
|
| `routes` | one entry per family of work — `document`, `presentation`, `action`, `fichier`, `carte`, `autre`. Families absent from the object were never exercised in this process |
|
|
184
185
|
| `base` | the same shape, for calls through the `db` capability **you** supply — measured at the seam, so it covers every call, including ones nobody has written yet |
|
|
185
186
|
| `statuts` | responses by class: `ok` (<400), `refus4xx`, `debit429`, `occupe503`, `erreur5xx` |
|
|
@@ -194,6 +195,17 @@ reading is. `null` means *past the top of the ladder* (over 10 s), which is itse
|
|
|
194
195
|
⚠️ **`n: 0` is not `0 ms`.** A family that was never exercised reports `{ "n": 0 }` and nothing
|
|
195
196
|
else, and `boucleMs` with no samples reports `moyen: null` — not a zero that would read as *healthy*.
|
|
196
197
|
|
|
198
|
+
⚠️ **`routes: {}` used to be indistinguishable from broken instrumentation, and `familles` is why
|
|
199
|
+
it no longer is.** Omitting an unexercised family is correct — a `0 ms` would read as *instantaneous*
|
|
200
|
+
— but the omission left a reader unable to tell *no traffic in this window* from *measurement is not
|
|
201
|
+
running*. A loaded host never meets the question: its entries are always there, so their presence
|
|
202
|
+
witnesses itself.
|
|
203
|
+
|
|
204
|
+
The rule came from a host measuring their own smallness: **a field whose value is its own witness at
|
|
205
|
+
scale needs an explicit witness at small scale.** At 99 sessions nothing witnesses anything, and a
|
|
206
|
+
busier host is better instrumented without having instrumented anything. `statuts` and `boucleMs`
|
|
207
|
+
already carried their denominators; `routes` had not.
|
|
208
|
+
|
|
197
209
|
⚠️ **`boucleMs` is the delay, not the interval.** The sampler observes how long its own timer
|
|
198
210
|
actually took, which at rest equals its resolution; the resolution is subtracted, so an idle
|
|
199
211
|
instance reports about `0` rather than a permanent `20` that would send you hunting a fault that
|
|
@@ -881,6 +893,64 @@ cannot. Setting the number spares you that reasoning entirely.
|
|
|
881
893
|
but *did you measure exactly what fails*. Two true statements about the same instance can describe
|
|
882
894
|
different responses.
|
|
883
895
|
|
|
896
|
+
## What you can see and we cannot
|
|
897
|
+
|
|
898
|
+
**Read this only if you run this player somewhere.** If you are evaluating it, skip to Versioning —
|
|
899
|
+
this section asks for nothing from you.
|
|
900
|
+
|
|
901
|
+
⚠️ **Everything below exists because three defects in one week were found by hosts, not by us**, and
|
|
902
|
+
none of the three was findable from here. Every guard here measures this repository. They
|
|
903
|
+
cannot measure an installation they have never seen, and that is not a gap we can close by adding
|
|
904
|
+
one more. So this is not a request for feedback in general — it is four specific questions we cannot
|
|
905
|
+
answer ourselves, each printed with what it cost us not to have asked it earlier.
|
|
906
|
+
|
|
907
|
+
You owe us none of this. But you are the only one who can answer any of it.
|
|
908
|
+
|
|
909
|
+
**1. A ceiling in your installation that we assume away.** PostgREST's `db-max-rows` is set to 1000
|
|
910
|
+
by default on Supabase: the server returns 1000 rows however many you ask for. We compared what we
|
|
911
|
+
received against *our* bound, concluded "not truncated", and published `1000` rows of a 1651-row
|
|
912
|
+
table **asserting the number was exact** — which is worse than the defect it replaced, because the
|
|
913
|
+
previous version claimed nothing. Four hours after the release, a host measured it. If your
|
|
914
|
+
deployment caps, times out, paginates, or rewrites anything between us and your database, that
|
|
915
|
+
limit is invisible from here and our arithmetic is probably wrong about it.
|
|
916
|
+
|
|
917
|
+
**2. Something this card asserts that you can check against your own database.** Not "does it look
|
|
918
|
+
right" — *does this number match what a query returns right now*. The purge card is the obvious one:
|
|
919
|
+
`vide: true` is what authorises dropping a column, so a wrong `true` is expensive and a wrong `0`
|
|
920
|
+
authorises a deletion. A host who compared the card against their own tables is the reason the
|
|
921
|
+
counter stopped being able to lie.
|
|
922
|
+
|
|
923
|
+
**3. What your volumes hide from you — and what they reveal for free.** This one is the least
|
|
924
|
+
obvious and cost us a field. At 1655 rows an exact count **is its own proof**: it exceeds a ceiling
|
|
925
|
+
the bounded route structurally cannot cross, so the number itself witnesses which mechanism ran. At
|
|
926
|
+
99 sessions no value can ever separate the two, and a broken seam is indistinguishable from a
|
|
927
|
+
working one. Same code, same card — one installation detects a failure for free that the other
|
|
928
|
+
cannot see at all. So: **tell us your orders of magnitude**, and tell us when a field of ours only
|
|
929
|
+
makes sense at your scale. A small host is not merely short of occasions; it has lost discriminating
|
|
930
|
+
power, and that is our problem to fix with an explicit witness, not theirs to live with.
|
|
931
|
+
|
|
932
|
+
**4. A rule you drew from your own defect.** The most useful things we received this week were not
|
|
933
|
+
bug reports. They were sentences: *a control that separates two mechanisms must rest on what one can
|
|
934
|
+
do and the other cannot, never on a value both could return* — and *is there a state of the world
|
|
935
|
+
where this value is false?*, which is the question separating a limit of observation from a silent
|
|
936
|
+
failure mode. Both were written by hosts about their own mistakes. Both, applied to this repository
|
|
937
|
+
within the hour, found something. A defect tells us about one line; a rule tells us where to look.
|
|
938
|
+
|
|
939
|
+
⚠️ **And tell us what you did not do.** A host closed a report with thirty-two reads still
|
|
940
|
+
unaudited, said so plainly, and that sentence is the only reason we know those reads exist. We
|
|
941
|
+
cannot measure your code. We can only know what someone wrote down. *"Not measured"* and *"nothing
|
|
942
|
+
found"* are different sentences, and only one of them is honest when you have not looked.
|
|
943
|
+
|
|
944
|
+
**What not to send.** Shapes and counts, never contents. No row data, no reader IPs or User-Agents —
|
|
945
|
+
those are the columns half this contract exists to get rid of — no keys, tokens, connection strings,
|
|
946
|
+
or private hostnames. *"A table of ~1600 rows returned 1000"* is the whole of what we needed to fix
|
|
947
|
+
the ceiling defect; the rows themselves would have added nothing and created a problem.
|
|
948
|
+
|
|
949
|
+
**What we do with it.** Every item above became code, a bench that dies if the fix is removed, and a
|
|
950
|
+
dated entry naming the case. That last part is deliberate and a host asked for it: an abstract
|
|
951
|
+
justification rots, a dated incident does not. In six months someone will read a field and ask why
|
|
952
|
+
it exists, and the answer will name you.
|
|
953
|
+
|
|
884
954
|
## Versioning
|
|
885
955
|
|
|
886
956
|
Semantic versioning on the package, independent of the `contract` number. Pin an **exact** version:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "discovery-media-player",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.153",
|
|
4
4
|
"description": "Self-hosted document viewer: per-recipient tracked links, reading analytics, live presentation. The core knows nothing about the application hosting it — everything it borrows arrives through an injected context.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pdf-viewer",
|
package/server/mesures.js
CHANGED
|
@@ -180,6 +180,22 @@ function relever() {
|
|
|
180
180
|
// ⚠️ L'ÉCHELLE EST PUBLIÉE AVEC LES CHIFFRES. Sans elle, `p95sousMs: 250` ne dit pas si la
|
|
181
181
|
// mesure suivante aurait pu être 251 ou 999 — un lecteur ne peut pas juger de sa précision.
|
|
182
182
|
seauxMs: SEAUX_MS,
|
|
183
|
+
// ⚠️ LE DÉNOMINATEUR DE `routes`, ET IL MANQUAIT DEPUIS LE DÉBUT. Une famille sans échantillon
|
|
184
|
+
// est OMISE de `routes` — donc `routes: {}` ne distingue pas « aucun trafic sur la fenêtre »
|
|
185
|
+
// de « la mesure ne tourne pas ». Chez un hôte chargé la question ne se pose jamais : il y a
|
|
186
|
+
// toujours des entrées, et leur présence témoigne d'elle-même. Chez un hôte à 99 sessions,
|
|
187
|
+
// rien ne témoigne de rien.
|
|
188
|
+
//
|
|
189
|
+
// La règle vient d'un hôte, sur ses propres volumes : « les champs dont la valeur est son
|
|
190
|
+
// propre témoin à grande échelle ont besoin d'un témoin explicite à petite échelle ». Une
|
|
191
|
+
// petite installation n'est pas seulement privée d'occasions — elle perd du POUVOIR
|
|
192
|
+
// DISCRIMINANT, et un hôte plus chargé se trouve mieux instrumenté sans avoir rien instrumenté.
|
|
193
|
+
//
|
|
194
|
+
// ⚠️ ET LES DEUX CHAMPS VOISINS AVAIENT DÉJÀ RAISON, ce qui rend l'omission mesurable plutôt
|
|
195
|
+
// qu'opinable : `statuts` publie ses cinq clés à zéro, `boucleMs` publie `n: 0` avec des
|
|
196
|
+
// `null` explicites « plutôt que de publier un zéro qui se lirait la boucle est saine ». Trois
|
|
197
|
+
// champs frères du même objet, deux qui portent leur dénominateur et un qui l'oubliait.
|
|
198
|
+
familles: [...FAMILLES],
|
|
183
199
|
routes,
|
|
184
200
|
base: centiles(histoBase),
|
|
185
201
|
statuts: { ...statuts },
|