caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

36 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# @reelforge/growth-analytics
Pure client-and-server analytics: **retention-curve normalization + reach-tier
mapping, hook-strength scoring vs the 70% gate, and retention-weighted A/B winner
selection**. No I/O — takes data, returns verdicts — so web, mobile and the
Python backend compute identical numbers (golden fixtures).
## API
```ts
import { normalizeCurve, reachTier, dropoff, hookScore, selectWinner } from "@reelforge/growth-analytics";
normalizeCurve([1000, 820, 610]); // → [1, 0.82, 0.61]
reachTier(0.9); // → { tier: "viral", multiplier: 3 }
hookScore({ motion: 0.9, contrast: 0.8, text: 0.7, audio_onset: 0.8 }); // { score, passes }
selectWinner([{ id: "A", completion: 0.5, avg_watch: 12 }, { id: "B", completion: 0.42, avg_watch: 18 }]);
// → picks B: retention-weighted, not vanity views
```
```python
from reelforge_growth_analytics import reach_tier, hook_score, select_winner
```
- **reach tiers:** `<70%` minimal (1×) · `70–85%` boosted (2.2×) · `≥85%` viral (3×)
- **hook gate:** weighted first-3s signals (motion .35 / contrast .2 / text .2 / audio-onset .25) vs 0.70
- **A/B winner:** `0.6·completion + 0.4·(avg_watch / max_avg_watch)`
## Parity
Bit-identical via a shared `round6`. `test/fixtures/golden/analytics.json` is the contract.
```bash
PYTHONPATH=python python -m pytest test -q
npm run build && npm run test:parity
```