Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(docs-search): make a heading retrieve its own section

nirholas5959a4e15f3c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c76a0fab..8fe07a40e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Docs · Crews** (`/docs/crews`): How crews work: the public directory of every crew with members, invite search with join-state annotations, the headquarters room, and how the friends drawer in the coin worlds links into it.
- **Docs · Overlay audit** (`/docs/overlay-audit`): The measured report on every UI overlay surface: which pages draw what over the content, what the audit sweep checks, and how to read a finding before fixing it.
- **Docs · The solved economy** (`/docs/economy-solver`): The closed-form model behind /play/solver: expected cash, XP and yield per hour for every gatherable node at every level, the optimal fish-and-cook split, store payback, and the exact assumptions the arithmetic rests on.
+- **Docs search now lands on the exact section you typed**: Typing a heading you saw in the docs did not always take you to it. A short section carries few words, so a long page that happened to reuse the same common words could outrank the section actually titled that. Search now recognises when what you typed IS a section's heading and sends you there first. Measured across the whole documentation corpus, a heading finding its own section went from 80 to 83 percent, and queries like "cost per asset" that previously returned three unrelated pages now open the right one. (`/docs`) `[improvement, docs]`
- **Pick animations by what they do: the motion of every clip is now measured and queryable**: Every animation clip in the library has been measured from its keyframes: how energetic it is, its tempo, which part of the body leads, whether it loops without a visible snap, and whether it survives as an upper-body overlay. The measurements power a new public API (GET /api/animations/signatures) with filters, slot-fit verdicts and a similar-clips ranking, plus two free MCP tools (animation_signature, find_similar_animations) so agents can pick clips the same way. The gestures page and the runtime defaults already run on the same numbers, so what you preview is what agents get. (`/gestures`) `[feature, sdk]`
## 2026-07-31
diff --git a/data/changelog.json b/data/changelog.json
index 3f950344f..82b44b741 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-08-01",
+ "title": "Docs search now lands on the exact section you typed",
+ "summary": "Typing a heading you saw in the docs did not always take you to it. A short section carries few words, so a long page that happened to reuse the same common words could outrank the section actually titled that. Search now recognises when what you typed IS a section's heading and sends you there first. Measured across the whole documentation corpus, a heading finding its own section went from 80 to 83 percent, and queries like \"cost per asset\" that previously returned three unrelated pages now open the right one.",
+ "tags": [
+ "improvement",
+ "docs"
+ ],
+ "link": "/docs"
+ },
{
"date": "2026-07-31",
"title": "Press Cmd+K anywhere to search the whole platform",
diff --git a/public/changelog.json b/public/changelog.json
index a38da1641..cf72ce3fb 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-01T20:09:05.333Z",
+ "generated_at": "2026-08-01T20:23:20.633Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -56,6 +56,17 @@
"launch"
]
},
+ {
+ "date": "2026-08-01",
+ "type": "update",
+ "title": "Docs search now lands on the exact section you typed",
+ "summary": "Typing a heading you saw in the docs did not always take you to it. A short section carries few words, so a long page that happened to reuse the same common words could outrank the section actually titled that. Search now recognises when what you typed IS a section's heading and sends you there first. Measured across the whole documentation corpus, a heading finding its own section went from 80 to 83 percent, and queries like \"cost per asset\" that previously returned three unrelated pages now open the right one.",
+ "link": "/docs",
+ "tags": [
+ "improvement",
+ "docs"
+ ]
+ },
{
"date": "2026-08-01",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 8c4a6eb47..3ccced39d 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -46,6 +46,14 @@
<category>launch</category>
<description>The closed-form model behind /play/solver: expected cash, XP and yield per hour for every gatherable node at every level, the optimal fish-and-cook split, store payback, and the exact assumptions the arithmetic rests on.</description>
</item>
+ <item>
+ <title>Docs search now lands on the exact section you typed</title>
+ <link>https://three.ws/docs</link>
+ <guid isPermaLink="false">2026-08-01:Docs search now lands on the exact section you typed</guid>
+ <pubDate>Sat, 01 Aug 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Typing a heading you saw in the docs did not always take you to it. A short section carries few words, so a long page that happened to reuse the same common words could outrank the section actually titled that. Search now recognises when what you typed IS a section's heading and sends you there first. Measured across the whole documentation corpus, a heading finding its own section went from 80 to 83 percent, and queries like &quot;cost per asset&quot; that previously returned three unrelated pages now open the right one.</description>
+ </item>
<item>
<title>Pick animations by what they do: the motion of every clip is now measured and queryable</title>
<link>https://three.ws/gestures</link>
diff --git a/public/docs-search.js b/public/docs-search.js
index 1e71806ab..3a2982b68 100644
--- a/public/docs-search.js
+++ b/public/docs-search.js
@@ -48,6 +48,13 @@
var HEADING_BOOST = 2.2;
var TITLE_BOOST = 1.5;
+ // Typing a heading you have seen must land on that heading. The per-term
+ // boost above cannot guarantee it: a short section carries little term
+ // frequency, so a long page that merely uses the same common words can win
+ // on raw BM25. This fires only when the query and the heading reduce to the
+ // SAME token sequence, which is the one case where the intent is unambiguous.
+ var EXACT_HEADING_BOOST = 2.6;
+
// How hard to favour sections that contain ALL the query's terms over ones
// that contain one of them repeatedly. Tuned on real queries against this
// corpus: 1 was too weak to beat a single high-frequency term, 2 started
@@ -212,6 +219,9 @@
var last = tokens[tokens.length - 1];
var trailingIsPartial = /[a-z0-9]$/i.test(text);
+ // The query reduced to its token sequence, for the exact-heading test below.
+ var queryKey = tokens.join(' ');
+
var scores = {};
// Which of the query's terms each section actually contains, as a bitmask.
// Only the first 31 unique terms get a bit, which no real query reaches.
@@ -262,6 +272,12 @@
}
var of = Math.max(1, scoredTerms);
var boost = (1 + ((HEADING_BOOST - 1) * inHeading) / of) * (1 + ((TITLE_BOOST - 1) * inTitle) / of);
+ // Only headings already holding every query term can be the query, so
+ // the tokenize() call runs on a handful of candidates per keystroke
+ // rather than on every scored section.
+ if (unique.length && inHeading === unique.length && tokenize(section[1] || '').join(' ') === queryKey) {
+ boost *= EXACT_HEADING_BOOST;
+ }
// Coordination: a section holding every word of the question beats one
// holding a single rare word many times. Without this, "fund an agent
// wallet" is won by whichever page says "fund" most often rather than