@tanqory/dev-mcp 0.1.0-alpha.1 → 0.1.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.
@@ -105,9 +105,9 @@ Status per check: `pass`, `fail`, `warn` (reported, never fails the tier), `not_
105
105
 
106
106
  **What is approximated (exactly).** Lighthouse is not run: its own navigation would bypass the gateway
107
107
  that answers every request in-process. The runner measures in its own Chromium instead:
108
- - mobile 390×844 DPR 2; CPU slowed 4× (`Emulation.setCPUThrottlingRate`); every response delayed by
109
- 150 ms + (bytes on the wire × 8 / 1638.4 kbps) by the gateway, text counted gzipped (Lighthouse's
110
- "slow 4G" figures applied per response, not a simulated connection pool);
108
+ - mobile 390×844 DPR 2; CPU slowed 4× relative to the **uncontended** host (see "Busy hosts" below);
109
+ every response delayed by 150 ms + (bytes on the wire × 8 / 1638.4 kbps) by the gateway, text counted
110
+ gzipped (Lighthouse's "slow 4G" figures applied per response, not a simulated connection pool);
111
111
  - FCP, LCP and CLS from `PerformanceObserver`; TBT = Σ(long task − 50 ms) after FCP over load + 3 s;
112
112
  - **Speed Index is not measured** (no filmstrip); it is taken as (FCP + LCP) / 2;
113
113
  - the score uses Lighthouse's mobile log-normal curves and weights (FCP 10, SI 10, LCP 25, TBT 30, CLS 25);
@@ -116,6 +116,35 @@ that answers every request in-process. The runner measures in its own Chromium i
116
116
 
117
117
  Both scores are labelled `lab-approximation` in the report and are not Lighthouse scores.
118
118
 
119
+ **Busy hosts (host calibration).** `Emulation.setCPUThrottlingRate` slows the renderer relative to the machine
120
+ it runs on, so on a machine whose cores are busy with other work the page is slowed by the throttle *and* by
121
+ the contention: the same theme scored 96–99 on a quiet 6-core host and 76–83 at load 50–240. The runner
122
+ therefore measures and removes the contention instead of letting it count against the theme:
123
+
124
+ 1. *Before* each lab run it times a fixed busy loop in the page's renderer, unthrottled: wall-clock ÷ the main
125
+ thread's CPU time (`Performance.getMetrics` `ThreadTime`) is the host contention, 1.0 on an idle core. The
126
+ CDP rate is `4 ÷ contention`, never below 1.
127
+ 2. *During* the run it records a `toplevel` trace. Σ wall ÷ Σ CPU time (`dur` / `tdur`) of the renderer main
128
+ thread's tasks is the contention the measured page actually saw (the throttle burns CPU on that thread,
129
+ so it cancels out). `effectiveSlowdown = rate × that factor` is the slowdown the page really got.
130
+ 3. A run *decides* the verdict when its effective slowdown is 4× within ×1.25 (3.2–5×). A run slowed more
131
+ than that still proves a **pass** (the theme passed under a harsher device); a run slowed less still
132
+ proves a **fail**. A run off the target is repeated with the rate corrected by its own measured contention,
133
+ kept strictly between the highest rate that slowed the page too little and the lowest that slowed it too
134
+ much (the contention depends on the rate: a heavily throttled renderer burns CPU and is scheduled like a
135
+ batch job, a lightly throttled one stays interactive, so a plain correction can overshoot the band).
136
+ 4. One run per page is enough when it decides and is ≥ 5 points from the budget; otherwise up to four.
137
+ The page score is the lower median of its deciding runs; the check is the minimum over the pages.
138
+ 5. If a page has no deciding run (every run was over-slowed and below 85, or under-slowed and above it) and
139
+ no decided page failed, `budgets:performance` is **`warn`** with `inconclusive: this host was too busy…`
140
+ and the measured factors — not a failure, and not a pass of the theme. Re-run on a quieter machine.
141
+
142
+ On a quiet host the contention is ~1.0, the rate stays 4× and the result is what it was before calibration.
143
+ The busy-loop is not an absolute reference device: throttling stays relative to the machine's own idle
144
+ speed, as before, so a quiet fast machine and a quiet slow one judge a theme exactly as they did. Every run's
145
+ `hostFactor`, `cpuRate`, `windowFactor` and `effectiveSlowdown` is in the check's `evidence.details.pages[].runs`,
146
+ and the maxima in the `performanceScoreMobile` measurement note.
147
+
119
148
  ## 4. Locale-key patterns (the semantic fallback)
120
149
 
121
150
  When no hook is present, a control is a button/link (by ARIA role) whose accessible name equals one of the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@tanqory/theme-abi": "2.0.0-alpha.14",
3
- "@tanqory/theme-conformance": "0.1.0-alpha.14",
3
+ "@tanqory/theme-conformance": "0.1.0-alpha.15",
4
4
  "@tanqory/theme-kit": "2.0.0-alpha.3",
5
5
  "examples": {
6
6
  "blank": "create-tanqory-theme templates/blank"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanqory/dev-mcp",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0",
4
4
  "description": "Local MCP server (stdio) for building Tanqory storefront themes with coding agents: versioned docs and schemas, kit examples, section scaffolding, theme checks, and pages and screenshots of the running dev server.",
5
5
  "keywords": [
6
6
  "tanqory",
@@ -43,7 +43,7 @@
43
43
  "zod": "^3.25.76"
44
44
  },
45
45
  "devDependencies": {
46
- "create-tanqory-theme": "0.2.1"
46
+ "create-tanqory-theme": "0.2.3"
47
47
  },
48
48
  "publishConfig": {
49
49
  "registry": "https://npm.pkg.github.com"