The projectSkills and evidence14 min read
Metrics
What the project measures in performance, Core Web Vitals, testing, reliability, quality and maintainability: the figures counted at build time, the thresholds that make a script fail, the dated readings, and a reproducible protocol for what isn’t measured yet.
Here’s what the project can measure, how it measures it, and what it doesn’t measure yet. No figure here is typed by hand, except the dated readings. Each of those readings gives its date, its method and its source. And I only say something improved when I have a measurement before and a measurement after, taken the same way.
Four kinds of figures
| Status | What it is | What it lets you say |
|---|---|---|
| Measured at build | counted in the repository at every build of these docs, with what is being counted | the state of the code at the last build |
| Checked threshold | a script fails beyond a limit, and the page says when it runs | that the limit is respected, each time the script runs |
| Dated reading | a measurement taken once, with its date, method and source, not checked again since | the state on that date, and nothing about what followed |
| Not measured | no data in the repository or in a tool consulted, and the page gives the protocol to obtain it | nothing, until the protocol has been run |
Overview
| Area | Indicator | Status |
|---|---|---|
| Performance | Storefront JavaScript weight | threshold checked on push, dated readings |
| ERP JavaScript weight | threshold checked by hand only | |
| Number of queries per read | threshold checked by tests on Postgres | |
| Function response time in production | dated reading | |
| Share of requests served from cache | dated reading | |
| Core Web Vitals | LCP, INP, CLS for visitors | collected, not consulted here |
| CLS and LCP measured locally | CLS: one undated reading, no measurement after fix · LCP: never measured | |
| Tests | Volume, kinds and test cases | measured at build |
| Tests that pass | dated reading | |
| Coverage, duration, flakiness | not measured | |
| Reliability | Error responses in production | dated reading |
| Anomalies searched for every morning | measured at build | |
| Availability, webhook delay, restore time | not measured | |
| Quality | Lint, typing, exemptions | threshold checked on push, measured at build |
| Maintainability | Code size, files over the thresholds, copies | measured at build, dated reading |
Performance
JavaScript weight
For the storefront, pnpm site:size measures the compressed JavaScript after a build. There’s one ceiling for the total and another for what the home page loads, because a page can double in weight without the total moving. When a change touches the storefront, the pre-push hook builds it and runs this check. The script’s comment keeps the successive readings for the home page, taken by the same script. In the repository, it’s the only performance change I found that was measured before and after with the same method.
apps/site/scripts/check-bundle-size.mjs · lines 11–24/**
* Le JS que l'ACCUEIL fait charger, à part du total du site (analyse de performance de l'accueil,
* 03/11/2026) : le plafond de 1,8 Mo additionne tous les chunks, et une page peut doubler son poids
* sans qu'il bouge. Le build du 29/10/2026 en faisait charger 295 Ko gzip à l'accueil, polyfills
* exclus ; le volet du panier, chargé à l'intention depuis le 03/11/2026, en est sorti. Le 06/11/2026,
* l'accueil était remonté à 331 Ko : zod (~30 Ko) partait sur chaque page par les horaires du
* magasin, la recherche et le menu du téléphone étaient chargés fermés. Sortis, il pèse 259 Ko ; le
* plafond suit à 280 Ko pour que la prochaine dérive se voie.
*
* La coquille prérendue de l'accueil (`server/app/index.html`, `cacheComponents`) nomme tous ses
* chunks : les `<script src>` et ceux que le flux RSC demande à l'hydratation. Les polyfills
* (`noModule`) n'en sont pas : un navigateur récent ne les télécharge pas.
*/
const HOME_HTML = join(BUILD_DIR, "server", "app", "index.html");The ERP has its own ceilings too, per family of pages and for the total. But pnpm size doesn’t run on push or in pnpm check. So a drift only shows if someone runs it.
apps/erp/scripts/check-initial-js.mjs · lines 10–14const FAMILY_BUDGETS = [
{ family: "/produits/", limit: 588 },
{ family: "/connexion", limit: 435 },
{ family: "/", limit: 512 },
];Number of queries per read
The time a query takes changes from one machine to the next. The number of queries doesn’t. So the ERP’s order page and order list have a test on Postgres that counts their queries and rejects an N+1. One more line on the order must not add a single query.
apps/erp/test/db/admin-order-query-count.db.test.ts · lines 114–119it("n'ajoute AUCUNE requête quand la commande porte trois lignes — pas de N+1", async () => {
const order = await getAdminOrder(threeLineOrderId);
expect(order?.items).toHaveLength(3);
expect(selectsEmitted()).toHaveLength(1);
});Response time in production
This dated reading of November 13, 2026 comes from Vercel Observability, on the production environment, from October 16 to November 13, 2026 (November 13 is incomplete). Over that period, the storefront only has traffic from October 17.
| Time to first byte of functions | p50 | p75 | p95 | Calls |
|---|---|---|---|---|
| Public storefront | 328 ms | 1,233 ms | 3,334 ms | 11,522 |
| ERP | 50 ms | 186 ms | 1,985 ms | 11,001 |
| Public storefront, by function start | p75 | Share of calls |
|---|---|---|
| warm | 892 ms | 82.5% |
| pre-warmed | 1,918 ms | 3.8% |
| cold | 3,586 ms | 13.7% |
| Public storefront, cache response | Requests | Share |
|---|---|---|
| served from the cache | 17,415 | 68.8% |
| served stale, rebuilt afterwards | 4,349 | 17.2% |
| prerendered page | 1,567 | 6.2% |
| missing from the cache | 964 | 3.8% |
| revalidated | 557 | 2.2% |
| outside the cache, or not qualified | 468 | 1.8% |
This reading has its limits. Function time only counts requests that call a function. So a page served from the cache isn’t in it, and on those pages visitors don’t wait that long. Bots and scheduled tasks are counted. The repository sets no target. So these figures describe a state, without saying whether it’s good or bad. And they don’t say where the gap between a warm start and a cold start comes from.
To replay it, run these commands from apps/site and then apps/erp (a project linked to Vercel), keeping the same window:
vercel metrics vercel.function_invocation.ttfb_ms -a p75 --prod --since 2026-10-16 --until 2026-11-14 -g 1d
vercel metrics vercel.function_invocation.ttfb_ms -a p75 --prod --since 2026-10-16 --until 2026-11-14 --group-by functionStartType
vercel metrics vercel.request.count --prod --since 2026-10-16 --until 2026-11-14 --group-by cacheResultVercel only keeps its data for a while, and that limits the window you can still query. To find where the long times come from, the next measurement to take is the same query grouped by route (--group-by route).
Core Web Vitals
The storefront sends Vercel Speed Insights the Core Web Vitals of its visitors, measured on their devices. If the visitor refused on the Cookies page, the storefront sends nothing.
apps/site/shared/components/site-telemetry.tsx · lines 28–40/**
* La vitesse vue par les visiteurs (Core Web Vitals : chargement, réponse au geste, stabilité),
* mesurée sur leurs appareils : le build et ses mesures en local ne disent pas ce que vit un
* téléphone sur une connexion lente.
*/
export function SiteTelemetry() {
return (
<>
<Analytics beforeSend={measured} />
<SpeedInsights beforeSend={measured} />
</>
);
}You can read this data in the Vercel dashboard of the storefront project. To query it from the command line, you need the Speed Insights Plus plan. On November 13, 2026, vercel metrics vercel.speed_insights.lcp_ms answered payment_required. So this page gives no LCP, INP or CLS figure measured on visitors.
Google judges a page at the 75th percentile of its visits. It takes an LCP of 2.5 s at most, an INP of 200 ms at most and a CLS of 0.1 at most.
Local measurements
On the favourites page when it’s empty, a local measurement gave a CLS of 0.22. The footer moved up before the visitor’s eyes during loading. Since then, the loading grid reserves at least one screen (apps/site/app/(site)/favoris/page.tsx). But the value after the fix wasn’t recorded, so no measurement proves the effect.
For the home page LCP, the scale of image widths was tuned to the showcase piece, which is the LCP candidate. The tuning comes from a pixel calculation: the browser was picking an image 2.2 times larger than needed. The LCP itself wasn’t measured before or after.
apps/site/shared/constants/image-optimizer.ts · lines 1–10/**
* L'échelle de l'optimiseur d'images (`images` de `next.config.ts`), partagée avec ce qui en
* compose les adresses hors de `next/image` : la visionneuse de la galerie.
*
* 1080 et 1600 comblent les deux grands sauts de l'échelle (analyse de performance de l'accueil,
* 03/11/2026). La grande pièce de la vitrine, candidate LCP, mesure 43 rem au bureau : sur un écran
* 2×, il lui faut 1 376 px, et le navigateur prenait la 2048 (2,2 fois les pixels de la 1600). Au
* téléphone, 72 vw d'un écran de 390 px en 3× demandent 842 px : la 1080 au lieu de la 1200.
*/
export const IMAGE_DEVICE_SIZES = [640, 828, 1080, 1200, 1600, 2048] as const;The protocol to run
- For visitors, in Speed Insights, over 28 days, record for mobile devices and then desktops the p75 of LCP, INP and CLS, the number of measured visits and the five most viewed routes. With Speed Insights Plus, you can replay the same measurement from the command line:
vercel metrics vercel.speed_insights.lcp_ms -a p75 --prod --since 28d --group-by deviceType. - In the lab, to compare two versions, run Lighthouse in mobile mode, five runs on the same address. Keep the median and note the tool version, the date and the commit.
for run in 1 2 3 4 5; do
pnpm dlx lighthouse@12.2.1 https://meublesmoriniere.fr/ --only-categories=performance \
--output=json --output-path="lighthouse-$run.json" --chrome-flags="--headless=new"
doneA lab reading doesn’t replace measurement on visitors. It compares two versions under the same conditions, but it doesn’t say what it’s like on a phone with a slow connection.
Tests
- written test cases (it, test), an it.each table counting as one
- 20,951
- *.test.ts(x) and *.spec.ts under apps/ and packages/
- lines of tests: unit, on Postgres, source-reading, end-to-end
- 381,832
- *.test.ts(x) and *.spec.ts under apps/ and packages/
- test suites run against a real Postgres database
- 111
- apps/*/test/db/*.db.test.ts
- regression tests, most of which read the source code and reject any departure from a rule
- 92
- apps/*/test/*.regression.test.ts
- end-to-end journey files (Playwright), run by hand
- 52
- apps/*/e2e/*.spec.ts
The count of cases is static. An it.each table counts as one case, whereas Vitest counts one per row. So it doesn’t say how many tests actually run.
According to a dated reading of November 7, 2026 (reports/Storefront fiabilité en production.md), all the storefront’s unit tests pass, 3,588 tests in total. On the ERP side, 13 tests of share-document-button were failing under Node 22, because Blob.stream() is missing in jsdom, whereas the project requires Node 24.
What is not measured
| Indicator | State | Protocol |
|---|---|---|
| Coverage | measurable, with no threshold and no recorded result | pnpm test:coverage, from apps/erp then apps/site: note the summary (text-summary) with the date and the commit |
| Suite duration | not measured | pnpm exec vitest run --reporter=json --outputFile=vitest.json: each test’s duration is in the report |
| Flakiness | not measured | pnpm e2e --repeat-each=5 on the affected tests: one that fails once in five is flaky |
| End-to-end tests | run by hand, no recorded result | pnpm e2e, from each application (Tests) |
| Fisher evaluation | run by hand, and its reports stay on the workstation (apps/erp/ai-eval/, git-ignored) | pnpm ai:eval, then record the report’s score with the date, the model and the commit |
Reliability
This dated reading of November 13, 2026 also comes from Vercel Observability, on the production environment, from October 16 to November 13, 2026.
| Application | Requests | 5xx responses | Share of 5xx | 429 responses (rate limiting) |
|---|---|---|---|---|
| Public storefront | 25,320 | 17 | 0.067% | none |
| ERP | 115,172 | 7 | 0.006% | 134 |
The volumes are still low, so a few errors are enough to move the share. And this reading says nothing about availability as people experience it. You can replay it with vercel metrics vercel.request.count --prod --since 2026-10-16 --until 2026-11-14 --group-by httpStatus.
In production, the ERP’s daily check looks for anomalies in the data every morning (money received by Stripe with no sale, a pending refund, an unprocessed webhook, a gap in invoice numbering…) and sends them to the team. The list of those anomalies is measured at build. Their results stay in the production database and in the messages sent, so outside the repository.
- anomalies the ERP’s morning watch looks for in production
- 28
- apps/erp/modules/monitoring/constants/anomaly-readings.ts#ANOMALY_READINGS
According to a dated reading of November 7, 2026 (reports/Storefront fiabilité en production.md), an audit tested the storefront under production conditions, with database failures played out on a local production build. It found and fixed seventeen failures. Three of them blocked the storefront or charged people wrongly. Each fix has a test that fails without it.
What is not measured
| Indicator | State | Protocol |
|---|---|---|
| Availability | no external probe | failing that, the daily share of 5xx: the query above with -g 1d. An external probe on / and on a product page would give availability as seen from outside |
| Webhook processing delay | can be computed, never recorded | on a copy of the database: SELECT percentile_cont(ARRAY[0.5, 0.95]) WITHIN GROUP (ORDER BY "processedAt" - "receivedAt") FROM "WebhookEvent" WHERE "receivedAt" > now() - interval '28 days', and the number of events whose processedAt is empty |
| Restore time | a restore that was run leaves no trace in the repository | time pnpm db:restore to a local database, from the command to the end of its checks, and record the duration with the size of the archive (Backups and recovery) |
| Incidents and time to recovery | no incident log | record each production incident with its detection, its cause and its recovery, dated |
Quality
ESLint runs with --max-warnings=0 in the check of each application and of these docs. TypeScript is in strict mode, with noUncheckedIndexedAccess and exactOptionalPropertyTypes (packages/config/tsconfig.base.json). The pre-push hook runs type checks and lint for both applications on the pushed commit (Quality).
Except that a zero-warning rule says nothing about the exceptions written into the code. So they’re counted here.
- ESLint exemptions written in the code (eslint-disable)
- 18
- code excluding tests
- type-checking exemptions (@ts-expect-error, @ts-ignore)
- 0
- code excluding tests
- hand-written CHECK constraints, re-read on the database after every applied migration
- 169
- apps/erp/scripts/constants/db-invariants.ts#EXPECTED_CHECKS
Dependency vulnerabilities aren’t tracked over time. pnpm audit:prod is run by hand and looks for serious vulnerabilities in production dependencies, but no reading is recorded. The protocol is to run it at the start of each month and record the number of alerts by severity.
Maintainability
- lines of TypeScript excluding tests: routes, modules and shared code of both applications, package sources
- 408,398
- apps/{erp,site}/{app,modules,shared}, packages/*/src
- lines of tests: unit, on Postgres, source-reading, end-to-end
- 381,832
- *.test.ts(x) and *.spec.ts under apps/ and packages/
- components over 600 lines, the threshold of the maintainability rule
- 22
- *.tsx excluding tests · rule: AGENTS.md
- ERP services over 500 lines, where the rule asks for a split
- 1
- apps/erp/**/*.service.ts · rule: apps/erp/AGENTS.md
- code files still copied from one application to the other, a list that can only shrink
- 28
- scripts/twins.manifest.json
- accepted differences between the two applications, each recorded with its fingerprint
- 77
- scripts/twins.manifest.json
A dated reading of November 9, 2026 covers the ERP alone, by counting (find, grep, git log). It gives 295,000 lines of application code in 2,824 files, 302,000 lines of tests, 66 files over 500 lines including 15 components over 800, and 2,373 commits in 60 days. You can read it again with git show b3f1e845d2:docs/allegement-erp.md.
The measurements above cover both applications and the packages, with their own thresholds. So you can’t compare them with that reading, and I draw no trend from it. To follow a trend, you have to rerun the same command on a fixed date. For example, for the ERP’s pace since it moved into apps/erp (before October 18, that move would count as additions):
git log --since=2026-10-18 --numstat --format="" -- apps/erp \
| awk '{ added += $1; removed += $2 } END { print added " added, " removed " removed" }'What this page does not do
- It runs no tests. The measurements at build count the tests that are written. They don’t say whether they pass.
- Its production readings are a snapshot on a date. They don’t update. And since Vercel only keeps its data for a while, you won’t always be able to replay them identically.
- It sets no target the project hasn’t set itself. The thresholds quoted are the code’s own.