@iann29/rastro 0.1.0-alpha.1 → 0.1.0-alpha.11

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.
Files changed (179) hide show
  1. package/README.md +693 -69
  2. package/agent/integration.md +801 -0
  3. package/agent/manifest.json +205 -0
  4. package/agent/manifest.schema.json +444 -0
  5. package/dist/client/federation.d.ts +381 -0
  6. package/dist/client/federation.d.ts.map +1 -0
  7. package/dist/client/federation.js +274 -0
  8. package/dist/client/federation.js.map +1 -0
  9. package/dist/client/index.d.ts +2673 -15
  10. package/dist/client/index.d.ts.map +1 -1
  11. package/dist/client/index.js +565 -33
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/component/_generated/api.d.ts +22 -0
  14. package/dist/component/_generated/api.d.ts.map +1 -1
  15. package/dist/component/_generated/api.js.map +1 -1
  16. package/dist/component/_generated/component.d.ts +315 -4
  17. package/dist/component/_generated/component.d.ts.map +1 -1
  18. package/dist/component/_generated/server.d.ts +4 -0
  19. package/dist/component/_generated/server.d.ts.map +1 -1
  20. package/dist/component/_generated/server.js.map +1 -1
  21. package/dist/component/affiliates.d.ts.map +1 -1
  22. package/dist/component/affiliates.js +6 -2
  23. package/dist/component/affiliates.js.map +1 -1
  24. package/dist/component/cardinality.d.ts +12 -0
  25. package/dist/component/cardinality.d.ts.map +1 -0
  26. package/dist/component/cardinality.js +94 -0
  27. package/dist/component/cardinality.js.map +1 -0
  28. package/dist/component/constants.d.ts +28 -1
  29. package/dist/component/constants.d.ts.map +1 -1
  30. package/dist/component/constants.js +44 -1
  31. package/dist/component/constants.js.map +1 -1
  32. package/dist/component/convex.config.d.ts +6 -1
  33. package/dist/component/convex.config.js +9 -1
  34. package/dist/component/convex.config.js.map +1 -1
  35. package/dist/component/coverage.d.ts +27 -0
  36. package/dist/component/coverage.d.ts.map +1 -0
  37. package/dist/component/coverage.js +56 -0
  38. package/dist/component/coverage.js.map +1 -0
  39. package/dist/component/diagnostics.d.ts +9 -0
  40. package/dist/component/diagnostics.d.ts.map +1 -0
  41. package/dist/component/diagnostics.js +47 -0
  42. package/dist/component/diagnostics.js.map +1 -0
  43. package/dist/component/errors.d.ts +1 -1
  44. package/dist/component/errors.d.ts.map +1 -1
  45. package/dist/component/errors.js.map +1 -1
  46. package/dist/component/eventStore.d.ts +21 -9
  47. package/dist/component/eventStore.d.ts.map +1 -1
  48. package/dist/component/eventStore.js +142 -152
  49. package/dist/component/eventStore.js.map +1 -1
  50. package/dist/component/funnels.d.ts.map +1 -1
  51. package/dist/component/funnels.js +5 -3
  52. package/dist/component/funnels.js.map +1 -1
  53. package/dist/component/geo.d.ts +73 -0
  54. package/dist/component/geo.d.ts.map +1 -0
  55. package/dist/component/geo.js +648 -0
  56. package/dist/component/geo.js.map +1 -0
  57. package/dist/component/goals.d.ts.map +1 -1
  58. package/dist/component/goals.js +8 -5
  59. package/dist/component/goals.js.map +1 -1
  60. package/dist/component/guards.d.ts.map +1 -1
  61. package/dist/component/guards.js.map +1 -1
  62. package/dist/component/http.d.ts.map +1 -1
  63. package/dist/component/http.js +281 -62
  64. package/dist/component/http.js.map +1 -1
  65. package/dist/component/identity.d.ts +13 -0
  66. package/dist/component/identity.d.ts.map +1 -0
  67. package/dist/component/identity.js +58 -0
  68. package/dist/component/identity.js.map +1 -0
  69. package/dist/component/ingest.d.ts +3 -1
  70. package/dist/component/ingest.d.ts.map +1 -1
  71. package/dist/component/ingest.js +498 -95
  72. package/dist/component/ingest.js.map +1 -1
  73. package/dist/component/live.d.ts.map +1 -1
  74. package/dist/component/live.js +7 -6
  75. package/dist/component/live.js.map +1 -1
  76. package/dist/component/localTime.d.ts +25 -0
  77. package/dist/component/localTime.d.ts.map +1 -0
  78. package/dist/component/localTime.js +126 -0
  79. package/dist/component/localTime.js.map +1 -0
  80. package/dist/component/reports.d.ts +266 -10
  81. package/dist/component/reports.d.ts.map +1 -1
  82. package/dist/component/reports.js +1243 -137
  83. package/dist/component/reports.js.map +1 -1
  84. package/dist/component/retention.d.ts +75 -1
  85. package/dist/component/retention.d.ts.map +1 -1
  86. package/dist/component/retention.js +561 -38
  87. package/dist/component/retention.js.map +1 -1
  88. package/dist/component/rollupStore.d.ts +320 -0
  89. package/dist/component/rollupStore.d.ts.map +1 -0
  90. package/dist/component/rollupStore.js +596 -0
  91. package/dist/component/rollupStore.js.map +1 -0
  92. package/dist/component/rollups.d.ts +20 -0
  93. package/dist/component/rollups.d.ts.map +1 -0
  94. package/dist/component/rollups.js +73 -0
  95. package/dist/component/rollups.js.map +1 -0
  96. package/dist/component/sanitize.d.ts +24 -1
  97. package/dist/component/sanitize.d.ts.map +1 -1
  98. package/dist/component/sanitize.js +96 -16
  99. package/dist/component/sanitize.js.map +1 -1
  100. package/dist/component/schema.d.ts +687 -65
  101. package/dist/component/schema.js +187 -20
  102. package/dist/component/schema.js.map +1 -1
  103. package/dist/component/sites.d.ts +12 -0
  104. package/dist/component/sites.d.ts.map +1 -1
  105. package/dist/component/sites.js +41 -7
  106. package/dist/component/sites.js.map +1 -1
  107. package/dist/component/useragent.d.ts +9 -0
  108. package/dist/component/useragent.d.ts.map +1 -0
  109. package/dist/component/useragent.js +152 -0
  110. package/dist/component/useragent.js.map +1 -0
  111. package/dist/component/validators.d.ts +124 -69
  112. package/dist/component/validators.d.ts.map +1 -1
  113. package/dist/component/validators.js +35 -14
  114. package/dist/component/validators.js.map +1 -1
  115. package/dist/component/visitors.d.ts +19 -0
  116. package/dist/component/visitors.d.ts.map +1 -0
  117. package/dist/component/visitors.js +86 -0
  118. package/dist/component/visitors.js.map +1 -0
  119. package/dist/component/vitals.d.ts +41 -0
  120. package/dist/component/vitals.d.ts.map +1 -0
  121. package/dist/component/vitals.js +115 -0
  122. package/dist/component/vitals.js.map +1 -0
  123. package/dist/react/index.d.ts.map +1 -1
  124. package/dist/react/index.js.map +1 -1
  125. package/dist/tracker/generated.d.ts +11 -4
  126. package/dist/tracker/generated.d.ts.map +1 -1
  127. package/dist/tracker/generated.js +11 -4
  128. package/dist/tracker/generated.js.map +1 -1
  129. package/dist/tracker/tracker.d.ts +1 -1
  130. package/dist/tracker/tracker.d.ts.map +1 -1
  131. package/dist/tracker/tracker.js +57 -20
  132. package/dist/tracker/tracker.js.map +1 -1
  133. package/dist/tracker/vitals.d.ts +10 -0
  134. package/dist/tracker/vitals.d.ts.map +1 -0
  135. package/dist/tracker/vitals.js +140 -0
  136. package/dist/tracker/vitals.js.map +1 -0
  137. package/dist/tracker.min.js +1 -1
  138. package/dist/vitals.min.js +1 -0
  139. package/docs/benchmarks/2026-08-20-realistic.md +76 -76
  140. package/docs/benchmarks/2026-08-21-formal-certification.md +353 -0
  141. package/docs/benchmarks/2026-08-30-alpha6-recertification.md +206 -0
  142. package/docs/federation-setup.md +464 -0
  143. package/docs/federation.md +352 -0
  144. package/docs/upgrading.md +344 -0
  145. package/llms.txt +72 -0
  146. package/package.json +55 -11
  147. package/scripts/benchmark-ingest.mjs +175 -73
  148. package/scripts/generate-federation-keys.mjs +20 -0
  149. package/src/component/_generated/api.ts +22 -0
  150. package/src/component/_generated/component.ts +381 -4
  151. package/src/component/_generated/server.ts +4 -0
  152. package/src/component/affiliates.ts +20 -5
  153. package/src/component/cardinality.ts +117 -0
  154. package/src/component/constants.ts +44 -1
  155. package/src/component/convex.config.ts +11 -1
  156. package/src/component/coverage.ts +71 -0
  157. package/src/component/diagnostics.ts +65 -0
  158. package/src/component/errors.ts +2 -1
  159. package/src/component/eventStore.ts +217 -193
  160. package/src/component/funnels.ts +19 -16
  161. package/src/component/geo.ts +835 -0
  162. package/src/component/goals.ts +29 -21
  163. package/src/component/guards.ts +3 -1
  164. package/src/component/http.ts +404 -70
  165. package/src/component/identity.ts +74 -0
  166. package/src/component/ingest.ts +894 -188
  167. package/src/component/live.ts +13 -7
  168. package/src/component/localTime.ts +167 -0
  169. package/src/component/reports.ts +1872 -197
  170. package/src/component/retention.ts +788 -96
  171. package/src/component/rollupStore.ts +799 -0
  172. package/src/component/rollups.ts +82 -0
  173. package/src/component/sanitize.ts +144 -29
  174. package/src/component/schema.ts +217 -21
  175. package/src/component/sites.ts +59 -12
  176. package/src/component/useragent.ts +171 -0
  177. package/src/component/validators.ts +49 -14
  178. package/src/component/visitors.ts +116 -0
  179. package/src/component/vitals.ts +146 -0
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ // The opt-in Web Vitals module. It shares the main tracker's session identity
3
+ // through sessionStorage but never depends on it: either script works alone.
4
+ // Values are integers — milliseconds, except CLS which ships scaled by 1000.
5
+ (() => {
6
+ const script = document.currentScript;
7
+ const siteId = script?.dataset.site;
8
+ const endpoint = script?.dataset.endpoint ||
9
+ (script?.src && new URL("events", script.src).href);
10
+ if (!siteId || !endpoint)
11
+ return;
12
+ const createId = () => crypto.randomUUID?.() || Math.random() + "";
13
+ let sessionId;
14
+ try {
15
+ sessionId = sessionStorage._r || createId();
16
+ sessionStorage._r = sessionId;
17
+ }
18
+ catch {
19
+ sessionId = createId();
20
+ }
21
+ const visitorId = script.dataset.visitor || sessionId;
22
+ // Metrics describe the loaded document, so they keep the landing path even
23
+ // when a SPA rewrites the URL later.
24
+ const path = location.pathname.slice(0, 256);
25
+ const values = {};
26
+ const observers = [];
27
+ const observe = (type, handler, extra) => {
28
+ try {
29
+ const observer = new PerformanceObserver((list) => handler(list.getEntries()));
30
+ observer.observe({
31
+ type,
32
+ buffered: true,
33
+ ...extra,
34
+ });
35
+ observers.push({ observer, handler });
36
+ }
37
+ catch {
38
+ // The metric simply goes unreported where the entry type is missing.
39
+ }
40
+ };
41
+ const navigation = performance.getEntriesByType?.("navigation")[0];
42
+ if (navigation && navigation.responseStart > 0) {
43
+ values.TTFB = navigation.responseStart;
44
+ }
45
+ observe("paint", (entries) => {
46
+ for (const entry of entries) {
47
+ if (entry.name === "first-contentful-paint")
48
+ values.FCP = entry.startTime;
49
+ }
50
+ });
51
+ observe("largest-contentful-paint", (entries) => {
52
+ const last = entries[entries.length - 1];
53
+ if (last)
54
+ values.LCP = last.startTime;
55
+ });
56
+ // CLS session windows: shifts joined by <1s gaps within a 5s span; the worst
57
+ // window is the score.
58
+ let clsWindow = 0;
59
+ let clsFirst = 0;
60
+ let clsLast = 0;
61
+ observe("layout-shift", (entries) => {
62
+ for (const entry of entries) {
63
+ if (entry.hadRecentInput)
64
+ continue;
65
+ if (clsWindow &&
66
+ entry.startTime - clsLast < 1_000 &&
67
+ entry.startTime - clsFirst < 5_000) {
68
+ clsWindow += entry.value;
69
+ }
70
+ else {
71
+ clsWindow = entry.value;
72
+ clsFirst = entry.startTime;
73
+ }
74
+ clsLast = entry.startTime;
75
+ values.CLS = Math.max(values.CLS || 0, clsWindow * 1_000);
76
+ }
77
+ });
78
+ // INP keeps the worst durations and reports the (interactions / 50)th
79
+ // longest — the same estimate the web-vitals library uses.
80
+ const durations = [];
81
+ const interactionIds = new Set();
82
+ const interactions = (entries) => {
83
+ for (const entry of entries) {
84
+ if (!entry.interactionId)
85
+ continue;
86
+ interactionIds.add(entry.interactionId);
87
+ durations.push(entry.duration);
88
+ }
89
+ if (!durations.length)
90
+ return;
91
+ durations.sort((left, right) => right - left);
92
+ durations.length = Math.min(durations.length, 10);
93
+ const count = performance.interactionCount ||
94
+ interactionIds.size;
95
+ values.INP =
96
+ durations[Math.min(durations.length - 1, Math.floor(count / 50))];
97
+ };
98
+ observe("event", interactions, { durationThreshold: 40 });
99
+ observe("first-input", interactions);
100
+ let sent = false;
101
+ const send = () => {
102
+ if (sent)
103
+ return;
104
+ for (const { observer, handler } of observers) {
105
+ handler(observer.takeRecords());
106
+ observer.disconnect();
107
+ }
108
+ const timestamp = Date.now();
109
+ const events = Object.keys(values).map((name, index) => ({
110
+ eventId: `${sessionId}.${timestamp.toString(36)}.v${index}`,
111
+ sessionId,
112
+ visitorId,
113
+ type: "vital",
114
+ name,
115
+ value: Math.round(values[name]),
116
+ path,
117
+ timestamp,
118
+ sequence: index,
119
+ }));
120
+ if (!events.length)
121
+ return;
122
+ sent = true;
123
+ // sentAt lets the server re-anchor a clock that is minutes off.
124
+ const body = new Blob([
125
+ JSON.stringify({ siteId, events, sentAt: timestamp }),
126
+ ]);
127
+ const beacon = navigator.sendBeacon?.bind(navigator);
128
+ if (!beacon || !beacon(endpoint, body)) {
129
+ void fetch(endpoint, { method: "POST", body, keepalive: true }).catch(() => {
130
+ // Best effort by design: measurement must never break the host page.
131
+ });
132
+ }
133
+ };
134
+ document.addEventListener("visibilitychange", () => {
135
+ if (document.visibilityState === "hidden")
136
+ send();
137
+ });
138
+ addEventListener("pagehide", send);
139
+ })();
140
+ //# sourceMappingURL=vitals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitals.js","sourceRoot":"","sources":["../../src/tracker/vitals.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAc7E,CAAC,GAAG,EAAE;IACJ,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAyC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;IACpC,MAAM,QAAQ,GACZ,MAAM,EAAE,OAAO,CAAC,QAAQ;QACxB,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEjC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;IACnE,IAAI,SAAiB,CAAC;IACtB,IAAI,CAAC;QACH,SAAS,GAAG,cAAc,CAAC,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC5C,cAAc,CAAC,EAAE,GAAG,SAAS,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,SAAS,GAAG,QAAQ,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,SAAS,GAAG,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\.js.*$/,"events");if(!e||!o)return;const s=()=>crypto.randomUUID?.()||Math.random()+"",n=new URLSearchParams(location.search).get("ref")?.slice(0,64);let r,a;try{r=sessionStorage._r||s(),sessionStorage._r=r,a=n||sessionStorage._a,a&&(sessionStorage._a=a)}catch{r=s(),a=n}const i=t.dataset.visitor||r;let c,d=0;const l=[],h=document.referrer?new URL(document.referrer).origin:void 0,p=t=>{const s=l.splice(0,50);if(!s.length)return;const n=()=>new Blob([JSON.stringify({siteId:e,events:s})]);let r=n();for(;r.size>64e3&&s.length>1;)l.unshift(s.pop()),r=n();t&&navigator.sendBeacon(o,r)||fetch(o,{method:"POST",body:r,keepalive:1}).catch(()=>{}),l.length&&p(t)},g=(t,e,o)=>{const s=Date.now();l.push({eventId:`${r}.${s.toString(36)}.${d.toString(36)}`,sessionId:r,visitorId:i,type:t,name:e,path:location.pathname.slice(0,256),referrer:h,timestamp:s,sequence:d++,affiliateSlug:a,...o}),clearTimeout(c),c=setTimeout(p,1200)};let u;const v=()=>{const t=location.pathname;t!==u&&(u=t,g("pageview"))};window.rastro=(t,e,o)=>{if("context"===t)return{sessionId:r,visitorId:i};"event"===t&&g("custom",`${e||"event"}`.slice(0,80),o&&JSON.stringify(o).length>2e4?void 0:{properties:o})},document.addEventListener("click",t=>{const e=t.target?.closest("a,button,[data-rastro-event]");if(!e)return;const o=e.dataset.rastroEvent,s=e.href,n=s?new URL(s):void 0,r="http:"===n?.protocol||"https:"===n?.protocol;g(o?"custom":r&&n.origin!==location.origin?"outbound":"click",o,{target:(e.dataset.rastroLabel||e.tagName).slice(0,80),href:r?n.pathname.slice(0,256):void 0})},1);const m=t=>{const e=history[t];history[t]=function(t,o,s){e.call(history,t,o,s),v()}};m("pushState"),m("replaceState"),addEventListener("popstate",v),addEventListener("pagehide",()=>p(1)),setInterval(()=>{g("heartbeat"),p()},2e4),v()})();
1
+ (()=>{const e=document.currentScript,t=e?.dataset.site,s=e?.dataset.endpoint||e?.src&&new URL("events",e.src).href;if(!t||!s)return;const o=()=>crypto.randomUUID?.()||Math.random()+"",n=new URLSearchParams(location.search),r=n.get("ref")?.slice(0,64);let a,i,c;for(const e of["source","medium","campaign","term","content"]){const t=n.get("utm_"+e)?.slice(0,64);t&&((a??={})["utm_"+e]=t)}try{i=sessionStorage._r||o(),sessionStorage._r=i,c=r||sessionStorage._a,c&&(sessionStorage._a=c),a||=sessionStorage._u&&JSON.parse(sessionStorage._u),a&&(sessionStorage._u=JSON.stringify(a))}catch{i=o(),c=r}let d=e.dataset.visitor;try{d||=localStorage._rv||=o()}catch{}d||=i;let l,p=0;const g=[],h=document.referrer?new URL(document.referrer).origin:void 0,u=e=>{const o=g.splice(0,50);if(!o.length)return;const n=()=>new Blob([JSON.stringify({siteId:t,events:o,sentAt:Date.now()})]);let r=n();for(;r.size>64e3&&o.length>1;)g.unshift(o.pop()),r=n();e&&navigator.sendBeacon(s,r)||fetch(s,{method:"POST",body:r,keepalive:1}).catch(()=>{}),g.length&&u(e)},m=(e,t,s)=>{const o=Date.now();g.push({eventId:`${i}.${o.toString(36)}.${p}`,sessionId:i,visitorId:d,type:e,name:t,path:location.pathname.slice(0,256),referrer:h,timestamp:o,sequence:p++,affiliateSlug:c,...s}),clearTimeout(l),l=setTimeout(u,1200)};let v;const f=()=>{const e=location.pathname;e!==v&&(v=e,m("pageview",void 0,a&&{properties:a}))};window.rastro=(e,t,s)=>{if("context"===e)return{sessionId:i,visitorId:d};"event"===e&&m("custom",`${t||"event"}`.slice(0,80),s&&JSON.stringify(s).length>2e4?void 0:{properties:s})},document.addEventListener("click",e=>{const t=e.target?.closest("a,button,[data-rastro-event]");if(!t)return;const s=t.dataset.rastroEvent,o=t.href,n=o&&new URL(o),r=/^https?:$/.test(n?.protocol),a=r&&n.origin!==location.origin;m(s?"custom":a?"outbound":"click",s,{target:(t.dataset.rastroLabel||t.innerText||t.tagName).slice(0,64),href:r?((a?n.origin:"")+n.pathname).slice(0,256):void 0})},1);const S=e=>{const t=history[e];history[e]=(...e)=>{t.apply(history,e),f()}};S("pushState"),S("replaceState"),addEventListener("popstate",f),addEventListener("pagehide",()=>{m("leave"),u(1)}),addEventListener("pageshow",e=>{e.persisted&&(m("heartbeat"),u(1))}),setInterval(()=>{m("heartbeat"),u()},2e4),f()})();
@@ -0,0 +1 @@
1
+ (()=>{const t=document.currentScript,e=t?.dataset.site,n=t?.dataset.endpoint||t?.src&&new URL("events",t.src).href;if(!e||!n)return;const r=()=>crypto.randomUUID?.()||Math.random()+"";let a;try{a=sessionStorage._r||r(),sessionStorage._r=a}catch{a=r()}const s=t.dataset.visitor||a,o=location.pathname.slice(0,256),i={},c=[],d=(t,e,n)=>{try{const r=new PerformanceObserver(t=>e(t.getEntries()));r.observe({type:t,buffered:1,...n}),c.push({observer:r,handler:e})}catch{}},h=performance.getEntriesByType?.("navigation")[0];h&&h.responseStart>0&&(i.TTFB=h.responseStart),d("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(i.FCP=e.startTime)}),d("largest-contentful-paint",t=>{const e=t[t.length-1];e&&(i.LCP=e.startTime)});let l=0,f=0,m=0;d("layout-shift",t=>{for(const e of t)e.hadRecentInput||(l&&e.startTime-m<1e3&&e.startTime-f<5e3?l+=e.value:(l=e.value,f=e.startTime),m=e.startTime,i.CLS=Math.max(i.CLS||0,1e3*l))});const u=[],p=new Set,v=t=>{for(const e of t)e.interactionId&&(p.add(e.interactionId),u.push(e.duration));if(!u.length)return;u.sort((t,e)=>e-t),u.length=Math.min(u.length,10);const e=performance.interactionCount||p.size;i.INP=u[Math.min(u.length-1,Math.floor(e/50))]};d("event",v,{durationThreshold:40}),d("first-input",v);let g=0;const y=()=>{if(g)return;for(const{observer:t,handler:e}of c)e(t.takeRecords()),t.disconnect();const t=Date.now(),r=Object.keys(i).map((e,n)=>({eventId:`${a}.${t.toString(36)}.v${n}`,sessionId:a,visitorId:s,type:"vital",name:e,value:Math.round(i[e]),path:o,timestamp:t,sequence:n}));if(!r.length)return;g=1;const d=new Blob([JSON.stringify({siteId:e,events:r,sentAt:t})]),h=navigator.sendBeacon?.bind(navigator);h&&h(n,d)||fetch(n,{method:"POST",body:d,keepalive:1}).catch(()=>{})};document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&y()}),addEventListener("pagehide",y)})();
@@ -1,40 +1,40 @@
1
1
  # Realistic ingest validation, 2026-08-20
2
2
 
3
3
  This report preserves the performance evidence produced while developing PR
4
- [#8](https://github.com/amageweb/amage-rastro/pull/8), merged as `93a0b4e`.
5
- It is a historical engineering record, not a production SLA.
4
+ [#8](https://github.com/amageweb/amage-rastro/pull/8), merged as `93a0b4e`. It
5
+ is a historical engineering record, not a production SLA.
6
6
 
7
7
  ## Status
8
8
 
9
- - The realistic workload demonstrated the 100 million accepted-events/day
10
- target during a sustained ten-minute soak.
9
+ - The realistic workload demonstrated the 100 million accepted-events/day target
10
+ during a sustained ten-minute soak.
11
11
  - The sustained run predates the current `--certify` contract and did not
12
12
  preserve a run-scoped JSON artifact with aggregate reconciliation.
13
13
  - A later smoke against the final PR code reconciled every expected stored
14
14
  event, but lasted only 30 seconds.
15
- - Formal certification of the merged commit is therefore **pending** a new
16
- 600-second run using `--certify` on a dedicated idle site.
17
- - Heavy-payload, browser-feature, and trusted-conversion workloads have not
18
- received equivalent sustained certification.
15
+ - This historical gap was closed by the four-profile runs recorded in
16
+ [`2026-08-21-formal-certification.md`](2026-08-21-formal-certification.md).
17
+ Lean and realistic exceeded 100 million stored events/day; heavy and feature
18
+ completed cleanly below that target. Trusted conversions remain pending.
19
19
 
20
20
  Do not collapse these statements into a generic claim that every workload is
21
21
  certified for 100 million stored events/day.
22
22
 
23
23
  ## Environment
24
24
 
25
- | Item | Value |
26
- | --- | --- |
27
- | Date | 2026-08-20 |
28
- | Platform | Synapse-managed Convex |
29
- | Deployment | DEV canary `fast-finch-7454` |
30
- | Allocation | 4 GiB |
31
- | Site scope | One dedicated benchmark site |
32
- | Profile | `realistic` |
33
- | Concurrency | 75 workers |
34
- | Batch size | 50 events |
35
- | Session pool | 2,048 reused sessions |
36
- | Browser context | 12 geographic locations and 4 user-agent families |
37
- | Event mix | Pageviews, clicks, custom events, outbound events, and heartbeats |
25
+ | Item | Value |
26
+ | --------------- | ----------------------------------------------------------------- |
27
+ | Date | 2026-08-20 |
28
+ | Platform | Synapse-managed Convex |
29
+ | Deployment | DEV canary `fast-finch-7454` |
30
+ | Allocation | 4 GiB |
31
+ | Site scope | One dedicated benchmark site |
32
+ | Profile | `realistic` |
33
+ | Concurrency | 75 workers |
34
+ | Batch size | 50 events |
35
+ | Session pool | 2,048 reused sessions |
36
+ | Browser context | 12 geographic locations and 4 user-agent families |
37
+ | Event mix | Pageviews, clicks, custom events, outbound events, and heartbeats |
38
38
 
39
39
  The deployment name is historical and may be deleted or repointed. Never use
40
40
  this document as deployment configuration.
@@ -44,51 +44,51 @@ this document as deployment configuration.
44
44
  The sustained soak ran after the raw-event batching and five-second live-sweep
45
45
  work in `bbfb9ad`, before the final review fixes later included in `93a0b4e`.
46
46
 
47
- | Metric | Result |
48
- | --- | ---: |
49
- | Target duration | 600 seconds |
50
- | Accepted events | 1,067,650 |
51
- | Failed requests | 0 |
52
- | Rejected events | 0 |
53
- | Accepted throughput | 1,773 events/s |
54
- | Accepted daily-rate estimate | 153.2 million events/day |
55
- | Target daily rate | 100 million events/day |
56
- | Headroom over target | 53.2% |
57
- | Request latency p99 | approximately 5.4 seconds |
47
+ | Metric | Result |
48
+ | ---------------------------- | ------------------------: |
49
+ | Target duration | 600 seconds |
50
+ | Accepted events | 1,067,650 |
51
+ | Failed requests | 0 |
52
+ | Rejected events | 0 |
53
+ | Accepted throughput | 1,773 events/s |
54
+ | Accepted daily-rate estimate | 153.2 million events/day |
55
+ | Target daily rate | 100 million events/day |
56
+ | Headroom over target | 53.2% |
57
+ | Request latency p99 | approximately 5.4 seconds |
58
58
 
59
59
  The target requires approximately 1,157 accepted events/s. The daily figure is
60
60
  an extrapolation from the measured soak, not a full-day load test.
61
61
 
62
62
  This run established sustained accepted-ingress capacity. Its exact heartbeat
63
- count and stored-event delta were not retained, so it must not be presented as
64
- a formally reconciled stored-events certification under the current harness.
63
+ count and stored-event delta were not retained, so it must not be presented as a
64
+ formally reconciled stored-events certification under the current harness.
65
65
 
66
66
  ## Reconciled corroboration
67
67
 
68
68
  A separate two-minute realistic rerun on the same canary used the same
69
69
  concurrency, batch size, and session pool:
70
70
 
71
- | Metric | Result |
72
- | --- | ---: |
73
- | Run label | `realistic-2m-rerun` |
74
- | Run ID | `mt1ydsq5-jjmbjv` |
75
- | Target duration | 120 seconds |
76
- | Measured elapsed time | 122.021 seconds |
77
- | Requests completed | 4,363 |
78
- | Accepted events | 218,150 |
79
- | Accepted heartbeats | 10,775 |
80
- | Expected stored events | 207,375 |
81
- | Aggregate event delta | 207,375 |
82
- | Reconciliation | exact |
83
- | Failed requests | 0 |
84
- | Duplicate events | 0 |
85
- | Rejected events | 0 |
86
- | Accepted throughput | 1,788 events/s |
71
+ | Metric | Result |
72
+ | ---------------------------- | ---------------------: |
73
+ | Run label | `realistic-2m-rerun` |
74
+ | Run ID | `mt1ydsq5-jjmbjv` |
75
+ | Target duration | 120 seconds |
76
+ | Measured elapsed time | 122.021 seconds |
77
+ | Requests completed | 4,363 |
78
+ | Accepted events | 218,150 |
79
+ | Accepted heartbeats | 10,775 |
80
+ | Expected stored events | 207,375 |
81
+ | Aggregate event delta | 207,375 |
82
+ | Reconciliation | exact |
83
+ | Failed requests | 0 |
84
+ | Duplicate events | 0 |
85
+ | Rejected events | 0 |
86
+ | Accepted throughput | 1,788 events/s |
87
87
  | Accepted daily-rate estimate | 154,466,612 events/day |
88
- | Request latency p50 | 2,049 ms |
89
- | Request latency p95 | 2,570 ms |
90
- | Request latency p99 | 3,082 ms |
91
- | Request latency max | 3,366 ms |
88
+ | Request latency p50 | 2,049 ms |
89
+ | Request latency p95 | 2,570 ms |
90
+ | Request latency p99 | 3,082 ms |
91
+ | Request latency max | 3,366 ms |
92
92
 
93
93
  Reconciliation was a site-wide before/after delta. It is reliable only because
94
94
  the benchmark site was kept idle apart from this run.
@@ -99,28 +99,28 @@ After the final correctness review, commit `c43d971` was deployed to the canary.
99
99
  That source was subsequently squash-merged unchanged as `93a0b4e`. A 30-second
100
100
  smoke produced:
101
101
 
102
- | Metric | Result |
103
- | --- | ---: |
104
- | Run label | `final-pr-smoke` |
105
- | Run ID | `mt2072x6-4c0avl` |
106
- | Measured elapsed time | 31.747 seconds |
107
- | Requests completed | 1,243 |
108
- | Accepted events | 62,150 |
109
- | Accepted heartbeats | 2,486 |
110
- | Expected stored events | 59,664 |
111
- | Aggregate event delta | 59,664 |
112
- | Reconciliation | exact |
113
- | Failed requests | 0 |
114
- | Duplicate events | 0 |
115
- | Rejected events | 0 |
116
- | Accepted throughput | 1,958 events/s |
117
- | Stored throughput | 1,879 events/s |
102
+ | Metric | Result |
103
+ | ---------------------------- | ---------------------: |
104
+ | Run label | `final-pr-smoke` |
105
+ | Run ID | `mt2072x6-4c0avl` |
106
+ | Measured elapsed time | 31.747 seconds |
107
+ | Requests completed | 1,243 |
108
+ | Accepted events | 62,150 |
109
+ | Accepted heartbeats | 2,486 |
110
+ | Expected stored events | 59,664 |
111
+ | Aggregate event delta | 59,664 |
112
+ | Reconciliation | exact |
113
+ | Failed requests | 0 |
114
+ | Duplicate events | 0 |
115
+ | Rejected events | 0 |
116
+ | Accepted throughput | 1,958 events/s |
117
+ | Stored throughput | 1,879 events/s |
118
118
  | Accepted daily-rate estimate | 169,139,895 events/day |
119
- | Stored daily-rate estimate | 162,374,299 events/day |
120
- | Request latency p50 | 1,882 ms |
121
- | Request latency p95 | 2,430 ms |
122
- | Request latency p99 | 2,733 ms |
123
- | Request latency max | 2,827 ms |
119
+ | Stored daily-rate estimate | 162,374,299 events/day |
120
+ | Request latency p50 | 1,882 ms |
121
+ | Request latency p95 | 2,430 ms |
122
+ | Request latency p99 | 2,733 ms |
123
+ | Request latency max | 2,827 ms |
124
124
 
125
125
  The harness correctly marked this result as an estimate, not a certification,
126
126
  because it was shorter than 600 seconds.
@@ -150,7 +150,7 @@ A passing harness certification must include:
150
150
  - `certification.requested: true` and `certification.passed: true`;
151
151
  - zero request failures, duplicate events, rejected events, and failed events;
152
152
  - completed request accounting;
153
- - reliable and exact aggregate reconciliation;
153
+ - reliable and exact run-session reconciliation;
154
154
  - separate accepted and stored throughput/capacity fields.
155
155
 
156
156
  Release evidence should additionally record deployment health and successful