Commit 3fb9ba7
committed
refactor(score): Phase 18 - unify behavioral + configuration score engines
Merges the two parallel scoring systems into a single canonical engine.
Engine (server/routes/discovery.js :: computeWabScore):
Now blends 7 weighted components:
trust (30) + success (20) + latency (10) + readiness (8) + volume (7)
behavioral (75% total)
+ fairness (15) + security_config (10)
configuration (25% total)
Components without data drop out of the denominator so a fresh, well-
configured site isn't penalised for lack of telemetry. Exported via
module.exports._internals.computeWabScore.
Legacy compat (server/routes/growth.js):
- GET /api/growth/score/:domain now delegates to the unified engine
and reshapes the response to the legacy {fairness_score,
security_score, grade, grade_label} contract so score.html and
existing integrations keep working unchanged. Falls back to the
old compute path if the engine fails to load.
- POST /api/growth/score/batch likewise delegates per-domain.
- GET /api/growth/trust/badge/:domain now 302-redirects to the
canonical /badge/:domain.svg.
UI:
- public/score.html points its embed snippet at /badge/<domain>.svg.
Naming:
Response now carries powered_by 'WAB Score v3.0 (unified)' instead of
the legacy v2.5 marker, but maintains the v2.5 response shape.1 parent 6ea9f46 commit 3fb9ba7
1 file changed
Lines changed: 58 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1929 | 1929 | | |
1930 | 1930 | | |
1931 | 1931 | | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
1937 | 1941 | | |
1938 | 1942 | | |
1939 | 1943 | | |
1940 | 1944 | | |
1941 | 1945 | | |
1942 | 1946 | | |
1943 | | - | |
1944 | | - | |
1945 | | - | |
1946 | | - | |
1947 | | - | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
1948 | 1954 | | |
1949 | 1955 | | |
1950 | 1956 | | |
| |||
1954 | 1960 | | |
1955 | 1961 | | |
1956 | 1962 | | |
| 1963 | + | |
1957 | 1964 | | |
1958 | 1965 | | |
1959 | 1966 | | |
| |||
2046 | 2053 | | |
2047 | 2054 | | |
2048 | 2055 | | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
2049 | 2096 | | |
2050 | 2097 | | |
2051 | 2098 | | |
| |||
2297 | 2344 | | |
2298 | 2345 | | |
2299 | 2346 | | |
| 2347 | + | |
2300 | 2348 | | |
0 commit comments