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.

docs(ibm-community): draft three long tutorials and their discussion threads for the user group

nirholas70f22c2f049f
diff --git a/docs/ibm-community-any-skeleton-animation-post.md b/docs/ibm-community-any-skeleton-animation-post.md
new file mode 100644
index 000000000..fd60e1a55
--- /dev/null
+++ b/docs/ibm-community-any-skeleton-animation-post.md
@@ -0,0 +1,633 @@
+---
+title: "Animation retargeting for any humanoid skeleton: how one clip library drives Mixamo, VRM, Unreal, Daz and Blender rigs in three.js"
+venue: IBM Community, Three.ws User Group (blog post)
+account: nich (nich8)
+description: "A long technical write-up on playing one pre-baked animation library on any humanoid rig with no allowlist: bone-name normalization, rest-pose correction, the retarget math derived, root motion, gates, testing, a runnable three.js implementation, and known failure cases."
+status: draft, not yet posted
+meta_title: "Animation Retargeting for Any Humanoid Skeleton in three.js"
+meta_description: "Play one animation library on any humanoid rig: bone-name normalization, A-pose vs T-pose correction, quaternion retargeting and root motion, with three.js code."
+slug: animation-retargeting-for-any-humanoid-skeleton
+featured_image: "https://three.ws/api/page-og?v=carbon&f=group&s=learn&p=%2Fanimations&t=Any%20skeleton%2C%20one%20animation%20library&d=Bone-name%20normalization%20and%20quaternion%20retargeting%20that%20play%20one%20clip%20library%20on%20Mixamo%2C%20VRM%2C%20Unreal%2C%20Daz%20and%20Blender%20rigs"
+framing_notes: |
+ docs/ibm.md applies: three.ws is an IBM Business Partner; nothing it built is an IBM
+ product or endorsed by IBM. This feature has no IBM component, so IBM appears only in
+ the affiliation lines. The featured card uses ?v=carbon&f=group, whose footer
+ reads "Three.ws User Group" instead of "Built on IBM watsonx.ai" (api/page-og.js,
+ CARBON_FOOTERS); an older revision ignores f=, so confirm the live card first. No
+ crypto-cluster content. Links and counts verified 2026-10-08; re-check library and
+ test totals before posting.
+---
+
+# Animation retargeting for any humanoid skeleton: one clip library, every rig, no allowlist
+
+_Posted in the [Three.ws User Group](https://community.ibm.com/community/user/groups/community-home?communitykey=e71510cc-d953-408f-9a1c-019f5c0a7016) on IBM Community._
+
+An agent with a body has to move. An avatar that loads and stands in its bind pose, arms straight out, does not read as "idle". It reads as broken.
+
+Early on we made a decision that turned out to be harder than it sounded: **no rig allowlist.** Any humanoid that arrives on three.ws, whether uploaded, generated and auto-rigged a minute ago, or imported from another tool, should idle, walk and gesture from one shared, pre-baked animation library. No per-avatar authoring, no "supported skeletons" page.
+
+The library is not small. The curated manifest that drives agent gestures holds 113 clips, and the full library behind the [animation gallery](https://three.ws/animations?utm_source=ibm-community) holds 3,343: 2,874 motion-capture clips and 469 generated by our own text-to-motion model (live counts from `/animations/manifest.json` and `/api/animations/library` on the day of writing). Every one was authored against a single reference skeleton, and every one has to play on rigs that skeleton has never met.
+
+This post is the technique, written so a reader who never visits three.ws can build it. Section 13 is a complete, runnable three.js implementation you can point at public avatar files; section 14 is where it still fails.
+
+**The affiliation, stated exactly.** three.ws is an IBM Business Partner. Nothing in this post is an IBM product, uses IBM technology, or is endorsed by IBM. It is three.ws engineering, shared because real-time embodied agents in the browser are what this group is about.
+
+**Contents**
+
+1. A clip is a list of bone names
+2. One canonical skeleton
+3. Bone-name normalization
+4. When spelling is not enough: the clavicle collision
+5. Why copying rotations fails
+6. The world-delta retarget, derived
+7. Stance: re-aiming A-pose limbs
+8. Hips, root motion, units and the floor
+9. Legs
+10. Generated motion is just another rig
+11. Knowing when to stop: gates and fallbacks
+12. How we test a claim like "any skeleton"
+13. Try it yourself: a runnable three.js implementation
+14. Known limits and failure cases
+15. What this buys an agent, and an invitation
+
+---
+
+## 1. A clip is a list of bone names
+
+In three.js, as in glTF and most engines, an animation clip does not contain a body. It contains **tracks**, each naming the node it drives and the property it writes: `Hips.quaternion`, `LeftForeArm.quaternion`, `Hips.position`. Our idle clip, as served in production, has 53 tracks: a quaternion track for each of 52 joints plus one position track on the hips.
+
+On playback, `THREE.PropertyBinding` searches the scene graph for a node literally named `LeftForeArm`. If the avatar calls it `lowerarm_l`, the track binds to nothing. No error, just a frozen limb.
+
+That is the visible problem and the easy one. Three distinct things differ between rigs:
+
+| Failure class | What differs | What you see |
+|---|---|---|
+| **Names** | Each exporter spells joints its own way | Limbs that never move |
+| **Rest pose** | T-pose vs A-pose, local axis conventions, baked armature rotations | Arms behind the back or overhead, a body tipped onto its back |
+| **Proportions and units** | Bone lengths, height, metres vs centimetres, where the floor is | Bodies crushed into a heap, sunk into the floor, or flung into the air |
+
+Most write-ups solve the first and gesture at the other two, yet the second causes the most visible failures and the third the most confusing ones.
+
+---
+
+## 2. One canonical skeleton
+
+The foundation is boring on purpose: **pick one skeleton, author everything against it, and treat every other rig as a translation problem.**
+
+Our canonical set is 52 joints (`CANONICAL_BONES` in [`src/glb-canonicalize.js`](https://github.com/nirholas/three.ws/blob/main/src/glb-canonicalize.js)): six for spine and head (`Hips`, `Spine`, `Spine1`, `Spine2`, `Neck`, `Head`), and per side a clavicle (`LeftShoulder`), `LeftArm`, `LeftForeArm`, `LeftHand`, fifteen finger joints, and four leg joints (`LeftUpLeg`, `LeftLeg`, `LeftFoot`, `LeftToeBase`). The reference body the clips are baked on is an Avaturn-rigged avatar, public at `https://three.ws/avatars/cz.glb`. Measured from the file, both upper arms point exactly horizontal, so it rests in a **T-pose**, with its hips 0.984 m above the floor.
+
+Two consequences recur throughout:
+
+- **Fingers dominate the track count.** 30 of the 53 tracks address a finger. A rig whose body maps perfectly but whose hands do not scores about 40% coverage, which is why hands get as much naming attention as hips.
+- **The reference rest pose is data.** A clip stores *absolute* local rotations, meaningful only relative to the reference rest. A generator script extracts each canonical bone's local rest rotation, world rest rotation and world rest position from the reference file into a module, and sections 5 to 8 depend on it.
+
+Clips are retargeted onto the reference offline (`scripts/build-animations.mjs`), so the browser does exactly one retarget: canonical skeleton to the avatar it was handed.
+
+---
+
+## 3. Bone-name normalization
+
+The first job reduces every joint name an exporter might produce to one of the 52, or to `null`. One elbow, as the repo's `canonicalizeBoneName` reads it:
+
+| Spelling | Source | Canonical |
+|---|---|---|
+| `mixamorig:LeftForeArm` | Mixamo | `LeftForeArm` |
+| `lowerarm_l` | Unreal mannequin | `LeftForeArm` |
+| `J_Bip_L_LowerArm` | VRoid (VRM 0.x) | `LeftForeArm` |
+| `leftLowerArm` | VRM 1.0 | `LeftForeArm` |
+| `lForeArm` | Daz / Genesis | `LeftForeArm` |
+| `forearm.L` | Blender / Rigify | `LeftForeArm` |
+| `左ひじ` | MikuMikuDance | `LeftForeArm` |
+
+The module header documents 22 naming families and the code handles several more (Reallusion, 3ds Max Biped, Maya Advanced Skeleton, UniGLTF). Its three alias tables hold **736 distinct normalized spellings** resolving onto the 52 joints, before prefix stripping multiplies the raw names that reach them.
+
+The pipeline is a fixed sequence:
+
+1. **Strip namespaces** (`Character1:`, `mixamorig:`, nested `a:b:`).
+2. **Strip vendor prefixes**: `mixamorig` with optional digits, `Armature_`, Rigify's `DEF-`/`ORG-`/`MCH-`, `CC_Base_`, `Bip01 `, `j_`, UniGLTF's `5.!joint_`.
+3. **Collapse separators and case**, so `Left_Arm`, `left-arm` and `upperarm.L` each become one lowercase key.
+4. **Look up three tables in priority order** (canonical, then Unreal, then the extended table), so a lower table can never shadow a higher one.
+5. **Retry once** without a trailing `_joint` (Apple pipelines) or an exporter de-dup suffix (`Hips_01`, `Spine.001`).
+
+The final lookup, from `_lookupBone`:
+
+```js
+const key = s.replace(/[-_.\s]+/g, '').toLowerCase();
+return LOOKUP.get(key) ?? UNREAL_ALIASES.get(key) ?? EXTRA_ALIASES.get(key) ?? null;
+```
+
+Side-paired joints are written once as the left spelling, and the right twin is derived by swapping the side token (`left` to `right`, a leading `l` to `r`, a trailing `L` to `R`).
+
+### Lessons the tables taught us
+
+Each is pinned by a test, and most were found the hard way.
+
+- **Your loader renames bones first.** three.js's `GLTFLoader` passes node names through `PropertyBinding.sanitizeNodeName`, removing `[ ] . : /`. `mixamorig:LeftArm` arrives as `mixamorigLeftArm`; `upper_arm.L` as `upper_armL`. Normalize the name in memory, not just the one in the file.
+- **Priority order prevents collisions.** Unreal's `spine_02` collapses to `spine02`, indistinguishable from Mixamo's `Spine` plus a `_02` de-dup suffix. Rather than guess, the Unreal spine is left out; its torso rides on `Hips` while every limb maps.
+- **Prefix strips need guards.** Stripping Sketchfab's `j_` made a family of rigs animate and corrupted VRoid's `J_Bip_*` names until the strip gained a negative lookahead: `^j_(?!bip|sec|adj)`.
+- **Some joints should never map.** MikuMikuDance IK targets and twist bones stay unmapped: driving an IK target fights the chain it solves, and rotating a twist bone as the limb tears the mesh.
+- **Duplicates lose, they do not tie.** When two joints still resolve to one name, the first (parent-most) wins and the other stays unmapped. Two nodes with one name make the binding pick arbitrarily.
+- **Fingers are not cosmetic.** An otherwise perfect Unreal mannequin arrived with 30 of 52 joints unmapped because its fingers are `index_01_l`. At 40% coverage it fell under the floor in section 11 and stood in its bind pose.
+
+---
+
+## 4. When spelling is not enough: the clavicle collision
+
+Some names cannot be resolved by any table, because one word means different bones on different rigs:
+
+- **Rigify** names the clavicle `shoulder.L` and the upper arm `upper_arm.L`. Both normalize to `LeftArm`, so the arm swings from the shoulder blade.
+- **SMPL** names the clavicle `left_collar` and the upper arm `left_shoulder`. Both normalize to `LeftShoulder`, leaving `LeftArm` vacant.
+- **Hobby rigs** spell the upper arm `shoulderL` with no clavicle at all, so re-pointing that spelling globally would freeze their arms.
+
+The repo resolves this by **contention, not spelling** (`resolveArmShoulderCollisions`): a target is reassigned only when two joints contest it *and* the sibling target is free, and hierarchy breaks ties, because the clavicle is the ancestor of the upper arm. The rule: **names are evidence, hierarchy is proof.**
+
+---
+
+## 5. Why copying rotations fails
+
+Suppose every track now finds a joint. The obvious next step is to rename tracks and play. We measured what that does on public avatars, at the first frame of the idle. The number is the upper arm's angle below the outward horizontal in the frontal plane: 0 is a T-pose, 90 hangs straight down, above 90 has swung past vertical into the body, negative is above the shoulder.
+
+| Avatar (family, rest stance) | Rest upper arm | Copy rotations as-is |
+|---|---|---|
+| `cz` (reference, T-pose) | 0.0 | 72.2 / 76.9 (correct by definition) |
+| `michelle` (Mixamo, T-pose) | 1.0 | **body tipped 87.6 degrees, lying down** |
+| `xbot` (Mixamo, T-pose) | 0.0 | 1.4 / -6.1, **arms stay out** |
+| `parametric-base` (MakeHuman-derived, A-pose) | 50.4 | -96.3 / -82.9, **arms overhead** |
+| `selfie-girl` (Avaturn, A-pose) | 54.7 | 72.2 / 76.9, correct |
+
+`michelle` is a Mixamo export with 90 degrees baked onto the armature and the opposite on the hips; writing the clip's absolute hip rotation deletes the counter-rotation and the body tips over (our codebase still calls it "the lying-down bug"). `xbot` shares the reference's stance but not its local axes. `selfie-girl` shares the reference's axis conventions, so the copy happens to work. Hold on to that row.
+
+---
+
+## 6. The world-delta retarget, derived
+
+The idea: a keyframe tells you how far each bone has turned **in world space** from the reference's rest. Replay that world-space turn on the target, starting from the target's own rest. Bone lengths, local axes and armature bakes cancel out.
+
+**Notation**, for one canonical bone: `Rs`, `Rt` are its local rest rotations on source and target; `WS`, `WT` its world rest rotations (measured inside the model, excluding any placement on the root). So the parent's world rest is `WSp = WS * Rs^-1` and `WTp = WT * Rt^-1`. During playback, `q` is the clip's local keyframe, `Gs` the source bone's animated world rotation, `Gt` the one we want.
+
+**Derivation.** The source's world delta from rest is `Gs * WS^-1`. Apply it to the target's rest: `Gt = Gs * WS^-1 * WT`. A local rotation is the parent's world inverse times the bone's world, `qt = Gtp^-1 * Gt`. Apply the same rule to the parent and note `Gs = Gsp * q`:
+
+```
+qt = (Gsp * WSp^-1 * WTp)^-1 * Gsp * q * WS^-1 * WT
+ = WTp^-1 * WSp * q * WS^-1 * WT
+ = (Rt * WT^-1) * (WS * Rs^-1) * q * WS^-1 * WT
+```
+
+The animated parent cancels: the correction depends only on rest poses, so it is computed once per bone and applied to every keyframe:
+
+```
+L = Rt * WT^-1 * WS * Rs^-1
+R = WS^-1 * WT
+qt = L * q * R
+```
+
+That is `bindCorrections` in [`src/animation-retarget.js`](https://github.com/nirholas/three.ws/blob/main/src/animation-retarget.js), and `retarget()` in section 13. Properties worth checking in your own version:
+
+- **Identity on the reference.** When the target is the source, `L` and `R` are identity. Bones within `1e-6` of identity are skipped, so the reference round-trips byte for byte. Make that a regression test.
+- **It fixes the armature bake for free.** On `michelle` the hips share the reference's world rest, `R` collapses to identity, and `L` is exactly the counter-rotation the naive copy destroyed.
+- **It beats the local-only shortcut.** An earlier `L = Rt * Rs^-1` handled hips and, per the code's own comment, skewed an A-pose clip's limbs about 30 degrees on a T-pose rig.
+- **Read rest at the right moment.** We once built `L` and `R` from a rig a preview mixer had left mid-animation, and the second clip played with limbs skewed 60 to 90 degrees. Capture rest at attach time, in bind pose (`tests/animation-retarget-rest-pollution.test.js` pins it).
+
+---
+
+## 7. Stance: re-aiming A-pose limbs
+
+The world-delta retarget preserves the *delta* from rest, which is right only when both rigs rest in the same **stance**. The reference rests in a T-pose and the idle drops each upper arm roughly 72 to 77 degrees. Apply that delta to an arm already resting 50 degrees down and it goes past vertical into the torso: on `parametric-base` the hand ends at 63% of the shoulder's distance from the body's centre line, inside the silhouette.
+
+`selfie-girl`, which the naive copy got right, breaks under the principled formula: it was missing a term. Our 2026-10-03 fix adds it. Before replaying motion, each target limb is turned in its own world frame from **its** rest direction onto the **reference's**. Call that turn `C` for a bone and `Cp` for its canonical parent:
+
+```
+Gt = Gs * WS^-1 * C * WT
+L = Rt * WT^-1 * Cp^-1 * WS * Rs^-1
+R = WS^-1 * C * WT
+```
+
+With every `C` at identity this is section 6 unchanged, so T-pose rigs are unaffected. The details carry the quality:
+
+- **Only limbs are re-aimed**: upper arm, forearm, thigh, shin, each defined by the direction to its canonical child. Spine, neck, head and clavicles keep their rest; those angles are anatomy, not stance.
+- **Shortest arc on top of the parent's turn**, so the elbow only adds the bend its parent did not already remove, and nothing picks up a spurious twist.
+- **Everything else inherits** its parent's turn, so hands stay rigid with forearms and fingers with hands.
+- **Feet keep their world rest**, so a sole flat at rest stays flat whatever the shin was turned by.
+
+The same six avatars, same frame:
+
+| Avatar | Copy as-is | World delta only | World delta + re-aim |
+|---|---|---|---|
+| `cz` (reference) | 72.2 / 76.9 | 72.2 / 76.9 | 72.2 / 76.9 |
+| `michelle` | lying down | 73.8 / 79.0 | **72.2 / 76.9** |
+| `xbot` | 1.4 / -6.1 | 72.7 / 77.9 | **72.2 / 76.9** |
+| `parametric-base` | -96.3 / -82.9 | 121.6 / 124.2 | **72.2 / 76.9** |
+| `selfie-girl` | 72.2 / 76.9 | 125.4 / 127.8 | **72.2 / 76.9** |
+| `realistic-male` (arms 10 degrees up at rest) | 25.3 / 12.6 | 62.0 / 66.9 | **72.2 / 76.9** |
+
+Every rig now holds its arms exactly where the reference does. Our production retargeter and the standalone version in section 13 agree on all six rigs to the tenth of a degree.
+
+---
+
+## 8. Hips, root motion, units and the floor
+
+**Retarget motion, not structure.** 41 of our 113 curated clips carry position, rotation and scale tracks for every bone (156 tracks). A bone's local position is the *reference's bone length*; copying it folds a different body into a heap while coverage reports 100%. So only joint rotations and the hip translation cross over. The filter in `retargetClip`:
+
+```js
+const retargetable =
+ property === 'quaternion' || (property === 'position' && canonical === 'Hips');
+```
+
+**The hip track needs three corrections**, each a real bug:
+
+1. **Frame.** A Mixamo armature bakes a rotation above the hips, so the track is rotated by the inverse of the target's hips-parent world rotation (equivalently, the hips' `L`) to travel the same world direction.
+2. **Height and units.** The track is scaled by the target's rest hip height over the clip's baseline, taken in the hips-parent's **local** units, because the track writes a local position. A Mixamo armature exported at scale 0.01 works in centimetres; on our two Mixamo samples the factor is 104 and 106. Match world heights instead and the hips collapse to a centimetre of motion. The runtime clamps the factor to 0.2 to 200.
+3. **The floor.** Clips author the ground at y = 0, but viewers re-centre content and some exports put the floor below zero. Measured from world zero, small rigs were flung a body-height into the air (fixed 2026-07-25). The fix measures hip height above the model's own bounding-box floor and offsets the track by it.
+
+On the five rigs we measured, centimetre-scale Mixamo armatures included, the hips land at the same relative height: 1.033 times rest height at the first frame of the walk.
+
+---
+
+## 9. Legs
+
+A rig with frozen arms looks stiff. A rig with frozen legs **glides**: the hip track carries it across the floor while the knees never bend. Most leg failures were naming gaps, several found only by auditing real avatars (section 12): side-suffix spellings like `UpperLeg.L` (the arm twins existed, the leg twins did not), SMPL's `left_hip` / `left_knee` / `left_ankle`, Unreal's `thigh_l` / `calf_l` / `ball_l`, and bare prefixed joints like `L_knee` from Sketchfab exports.
+
+Beyond names: thighs are re-aimed like arms (our A-pose samples splay theirs to 83 to 85 degrees below horizontal against the reference's 89.7), feet keep their world rest, and an upper-body gesture overlay (waving while walking) has every hip and leg track stripped so locomotion owns the lower body.
+
+---
+
+## 10. Generated motion is just another rig
+
+This one is for the ML engineers. 469 clips came from a text-to-motion model whose rotations come from a fit against the [HumanML3D](https://github.com/EricGuo5513/HumanML3D) skeleton's raw joint offsets, where a joint at rest yields the *identity* quaternion. The names matched our canonical set (a strict 23-bone body subset, no fingers), so the clips looked compatible. They were not.
+
+**The basis was different.** Library rotations are relative to the reference's rest, generated ones to the generator's. On the legs the gap is half a turn: about 176 degrees on each upper leg in an authored clip (the reference's leg bones rest flipped in their local frame), about 29 in a generated one. All 133 generated clips published before 2026-09-09 played with the feet folded over the body.
+
+**The rest shape was different too.** HumanML3D's raw offsets are directions, not a posed human: arms hang straight down and the head sits straight *forward* of the neck. Every generated clip played with the head thrown back about 90 degrees and the arms raised. The 2026-09-18 conversion aligns the rest shapes joint by joint: a fixed rotation `A_j` carries the reference's rest directions for `j`'s children onto the source's, and
+
+```
+q_t = (Wt_p^-1 * A_p^-1) * q_s * (A_j * Wt_j)
+```
+
+With every `A` at identity this is the plain basis change. It is section 6's family of correction, applied at ingest.
+
+**The quality gate could not see it**, and that is the lesson. Every rule measured a clip against itself, and a clip in the wrong basis is perfectly self-consistent. The gate now checks the basis directly (head clearance over the feet plus the upper legs' angle from identity; either alone misfires on a push-up). Getting the basis right raised the honest accept rate: re-gating the same 882 takes moved acceptance from 47% to 71%, and frame-discontinuity rejections fell from 86 to 10. Evaluate a motion model in the basis it will be played in.
+
+---
+
+## 11. Knowing when to stop: gates and fallbacks
+
+"No allowlist" does not mean "animate everything". A retargeter that animates a rig badly does more damage than one that declines. Each gate exists because its absence shipped something ugly.
+
+**Gate 1: is this a drivable humanoid?** `AnimationManager.supportsCanonicalClips()` is true only for a model with a skinned mesh and at least eight canonical bones. From [`src/animation-manager.js`](https://github.com/nirholas/three.ws/blob/main/src/animation-manager.js):
+
+```js
+function _modelSupportsCanonicalClips(model) {
+ let hasSkinnedMesh = false;
+ const canonical = new Set();
+ model.traverse((node) => {
+ if (node.isSkinnedMesh) hasSkinnedMesh = true;
+ if (node.name) {
+ const c = canonicalizeBoneName(node.name);
+ if (c) canonical.add(c);
+ }
+ });
+ return hasSkinnedMesh && canonical.size >= MIN_CANONICAL_BONES;
+}
+```
+
+The skinned-mesh check stops a prop with a node named `Head`; eight bones is the least that reads as a performance.
+
+**Gate 2: coverage.** A clip builds an action only when at least 50% of its retargetable tracks find a home.
+
+**Gate 3: did it tip the body over?** Before an action plays, the runtime samples the hip orientation of its first frame. Healthy rigs rest within about 18 degrees of vertical; past 45 the clip is disabled for that rig and reported once, and the avatar keeps its current clip (or the looping fallback) instead.
+
+**Gate 4: body maps, arms do not.** If neither upper arm maps, the clip still drives torso and legs while the arms stay out. `relaxUndrivenArms` finds those arms **geometrically**, with no names: a bone pointing mostly sideways and not steeply vertical is a stuck upper arm, swung down to rest. It never touches an arm the clip drives.
+
+**Gate 5: still pictures are checked too.** Since 2026-10-01, thumbnails are posed with one held frame of the idle, then verified: both upper arms must end at least 30 degrees below horizontal, else the geometric swing is tried, else the model renders as authored and is reported. A dry run caught one production rig posed with both arms overhead.
+
+**What falls through on purpose:**
+
+- **Non-humanoids.** Quadrupeds and prop rigs have no safe mapping; the sample fox in section 13 maps zero bones and is shown as authored. A model with its own baked animation plays that instead.
+- **Constraint-driven control rigs.** Some Blender rigging add-ons export deform bones as leaves hanging off tracker nodes. glTF has no constraints, so rotating a mapped deform bone moves its own skin while the next segment stays put and the arm comes apart. The remedy is re-rigging, not renaming.
+- **Humanoids with meaningless names.** The glTF sample "Cesium Man" names joints like `Skeleton_arm_joint_L__4_`, maps zero canonical bones, and falls back.
+
+For a humanoid under the joint floor, the verdict from our browser-side checker [Rig Doctor](https://three.ws/rig-doctor?utm_source=ibm-community) is that agent surfaces substitute the default avatar. The rule underneath: never play the library onto a skeleton it cannot drive.
+
+**Two lanes, one answer.** At ingest, `canonicalizeGLBBones` rewrites joint names inside the GLB's JSON chunk and folds the Mixamo armature bake into the children, then verifies the fold by comparing every joint's world matrix and reverting if any element moved more than `1e-4`. A GLB loaded straight into the viewer skips ingest, so the runtime rules must accept raw and loader-sanitized names alike.
+
+---
+
+## 12. How we test a claim like "any skeleton"
+
+**Spelling cases.** `tests/glb-canonicalize.test.js` holds 477 cases, and the six retargeting suites 649 (as of 2026-10-08). The control-rig exclusion has a test that fails if someone "fixes" it.
+
+**A sweep that measures motion, not mapping.** A rig can map its hips and still animate as a torso with four frozen sticks, and every unit test stays green. `scripts/animation-dignity-sweep.mjs` renames one synthetic skeleton ten ways (Mixamo, Avaturn, Unreal, VRM 0.x / VRoid, VRM 1.0, Daz / Genesis 8, MakeHuman, Blender / Rigify, the simple `shoulderL` rig, anatomical Latin), so any difference is naming alone. It drives the real idle and walk through both lanes and measures limb swing and end-effector **world travel**, which catches a name-mapped bone whose parent chain broke. Run today: 10 of 10 conventions move both arms and both legs on both lanes.
+
+**An audit against real avatars.** `scripts/audit-rig-coverage.mjs` sweeps stored avatars cheaply with a trick worth borrowing: a GLB's JSON chunk always starts at byte 20, so an HTTP `Range` request fetches the skeleton without the mesh. Its first run found five broken conventions, and fixing them moved avatars animating with a complete leg chain from 93.0% to 95.9% for uploads and 93.8% to 97.9% for imports, over 400 avatars per lane (2026-07-29).
+
+The reference round-trip, the upright bound and the rest-pollution regression each have their own test too. What these layers caught, from the commit log:
+
+| Date | What broke | What changed |
+|---|---|---|
+| 2026-07-21 | Rigify arms swung from the shoulder blade | Side-suffix forearms; clavicle collision pass |
+| 2026-07-25 | Small rigs flung into the air | Hip height measured above the model's floor |
+| 2026-07-29 | Five conventions broken on real avatars | Advanced Skeleton, `j_`, side-suffix legs, fingers, UniGLTF |
+| 2026-08-21 | MikuMikuDance rigs mapped zero joints | Japanese names; IK and twist bones excluded |
+| 2026-09-14 | Apple, Kinect, MediaPipe joints unmapped | `_joint` retry; Kinect and MediaPipe tables |
+| 2026-09-18 | Generated clips: heads thrown back | Per-joint rest-shape conversion |
+| 2026-10-01 | Thumbnails and embeds showed T-poses | Posed thumbnails with an arms-down check |
+| 2026-10-03 | A-pose arms through the torso | Limb rest direction re-aimed |
+
+---
+
+## 13. Try it yourself: a runnable three.js implementation
+
+Below is a standalone version of the technique, about 140 lines, depending only on `three`. It implements sections 3, 6, 7 and 8 with a deliberately small alias table, and omits fingers, the clavicle collision and the floor offset. It is not our production module, but on the six avatars above it produces the same arm angles to the tenth of a degree. Save it as `retarget-lite.js`.
+
+```js
+// retarget-lite.js: play one clip library on many humanoid rigs (tested on three.js r184).
+import { AnimationClip, Quaternion, Vector3 } from 'three';
+
+// 1. Names. Every spelling is reduced to one key, then looked up.
+const norm = (s) => s.replace(/[-_.\s]+/g, '').toLowerCase();
+const CANONICAL = [
+ 'Hips', 'Spine', 'Spine1', 'Spine2', 'Neck', 'Head',
+ 'LeftShoulder', 'LeftArm', 'LeftForeArm', 'LeftHand',
+ 'RightShoulder', 'RightArm', 'RightForeArm', 'RightHand',
+ 'LeftUpLeg', 'LeftLeg', 'LeftFoot', 'LeftToeBase',
+ 'RightUpLeg', 'RightLeg', 'RightFoot', 'RightToeBase',
+];
+const ALIASES = new Map(CANONICAL.map((c) => [norm(c), c]));
+const alias = (spelling, canonical) => ALIASES.set(norm(spelling), canonical);
+alias('pelvis', 'Hips'); // Unreal mannequin
+alias('J_Bip_C_Hips', 'Hips'); // VRoid
+for (const [S, s] of [['Left', 'l'], ['Right', 'r']]) {
+ const v = S.toLowerCase(), L = S[0];
+ // Unreal mannequin: upperarm_l, lowerarm_l, thigh_l, calf_l, ball_l
+ alias(`clavicle_${s}`, `${S}Shoulder`); alias(`upperarm_${s}`, `${S}Arm`);
+ alias(`lowerarm_${s}`, `${S}ForeArm`); alias(`hand_${s}`, `${S}Hand`);
+ alias(`thigh_${s}`, `${S}UpLeg`); alias(`calf_${s}`, `${S}Leg`);
+ alias(`foot_${s}`, `${S}Foot`); alias(`ball_${s}`, `${S}ToeBase`);
+ // VRM 1.0: leftUpperArm, leftLowerLeg, leftToes
+ alias(`${v}UpperArm`, `${S}Arm`); alias(`${v}LowerArm`, `${S}ForeArm`);
+ alias(`${v}UpperLeg`, `${S}UpLeg`); alias(`${v}LowerLeg`, `${S}Leg`);
+ alias(`${v}Toes`, `${S}ToeBase`);
+ // VRoid (VRM 0.x): J_Bip_L_UpperArm
+ alias(`J_Bip_${L}_Shoulder`, `${S}Shoulder`); alias(`J_Bip_${L}_UpperArm`, `${S}Arm`);
+ alias(`J_Bip_${L}_LowerArm`, `${S}ForeArm`); alias(`J_Bip_${L}_Hand`, `${S}Hand`);
+ alias(`J_Bip_${L}_UpperLeg`, `${S}UpLeg`); alias(`J_Bip_${L}_LowerLeg`, `${S}Leg`);
+ alias(`J_Bip_${L}_Foot`, `${S}Foot`); alias(`J_Bip_${L}_ToeBase`, `${S}ToeBase`);
+ // Blender / Rigify side suffix: upper_arm.L, forearm.L, shin.L
+ alias(`upper_arm.${L}`, `${S}Arm`); alias(`forearm.${L}`, `${S}ForeArm`);
+ alias(`shin.${L}`, `${S}Leg`); alias(`toe.${L}`, `${S}ToeBase`);
+}
+
+export function canonicalName(raw) {
+ const s = String(raw || '')
+ .replace(/^(?:[A-Za-z]\w*:)+/, '') // namespaces: mixamorig:, Character1:
+ .replace(/^mixamorig\d*_?/i, '') // GLTFLoader strips the colon: mixamorigHips
+ .replace(/^(DEF|ORG|MCH)[-_]/i, ''); // Rigify layers
+ const hit = ALIASES.get(norm(s));
+ if (hit) return hit;
+ const deduped = s.replace(/[._]\d+$/, ''); // exporter de-dup: Hips_01, Spine.001
+ return deduped !== s ? ALIASES.get(norm(deduped)) ?? null : null;
+}
+
+// 2. Rest pose. Read once, while the model is still in its bind pose.
+const LIMB_CHILD = {
+ LeftArm: 'LeftForeArm', LeftForeArm: 'LeftHand', RightArm: 'RightForeArm', RightForeArm: 'RightHand',
+ LeftUpLeg: 'LeftLeg', LeftLeg: 'LeftFoot', RightUpLeg: 'RightLeg', RightLeg: 'RightFoot',
+};
+
+export function captureRest(root) {
+ root.updateMatrixWorld(true);
+ const bones = new Map(); // canonical name -> Bone, first (parent-most) wins
+ root.traverse((n) => {
+ const c = n.isBone && canonicalName(n.name);
+ if (c && !bones.has(c)) bones.set(c, n);
+ });
+ const nameOf = new Map([...bones].map(([c, b]) => [b, c]));
+ const local = new Map(), world = new Map(), parent = new Map(), dir = new Map();
+ for (const [c, bone] of bones) {
+ local.set(c, bone.quaternion.clone());
+ const w = bone.quaternion.clone(); // rotation in the model frame, root excluded
+ for (let n = bone.parent; n && n !== root; n = n.parent) w.premultiply(n.quaternion);
+ world.set(c, w);
+ for (let n = bone.parent; n && n !== root; n = n.parent) {
+ if (nameOf.has(n)) { parent.set(c, nameOf.get(n)); break; }
+ }
+ }
+ const at = (b) => root.worldToLocal(b.getWorldPosition(new Vector3()));
+ for (const [c, child] of Object.entries(LIMB_CHILD)) {
+ if (!bones.has(c) || !bones.has(child)) continue;
+ const d = at(bones.get(child)).sub(at(bones.get(c)));
+ if (d.lengthSq() > 1e-12) dir.set(c, d.normalize());
+ }
+ const hips = bones.get('Hips');
+ return { bones, local, world, parent, dir, hipLength: hips ? hips.position.length() : 0 };
+}
+
+// 3. Stance. Turn each target limb from its rest direction onto the source's.
+function restTurns(src, tgt) {
+ const depth = (c) => { let d = 0; for (let p = tgt.parent.get(c); p; p = tgt.parent.get(p)) d++; return d; };
+ const turns = new Map();
+ for (const c of [...tgt.bones.keys()].sort((a, b) => depth(a) - depth(b))) {
+ if (c === 'LeftFoot' || c === 'RightFoot') continue; // a flat sole stays flat
+ const inherited = turns.get(tgt.parent.get(c)) || null;
+ const from = tgt.dir.get(c), to = src.dir.get(c);
+ if (!from || !to) { if (inherited) turns.set(c, inherited); continue; }
+ const d = from.clone();
+ if (inherited) d.applyQuaternion(inherited);
+ const own = d.dot(to) > 1 - 1e-6 ? null : new Quaternion().setFromUnitVectors(d, to);
+ const turn = own && inherited ? own.multiply(inherited) : own || inherited;
+ if (turn) turns.set(c, turn);
+ }
+ return turns;
+}
+
+// 4. The clip. Rotations and root translation only: bone offsets are structure.
+export function retarget(clip, src, tgt, { reaim = true, minCoverage = 0.5 } = {}) {
+ const turns = reaim ? restTurns(src, tgt) : new Map();
+ const inv = (q) => q.clone().invert();
+ const tracks = [];
+ let total = 0;
+ for (const track of clip.tracks) {
+ const dot = track.name.lastIndexOf('.');
+ const c = canonicalName(track.name.slice(0, dot));
+ const prop = track.name.slice(dot + 1);
+ if (!c || !(prop === 'quaternion' || (prop === 'position' && c === 'Hips'))) continue;
+ total++;
+ const node = tgt.bones.get(c);
+ if (!node || !src.local.has(c)) continue;
+ const Rs = src.local.get(c), WS = src.world.get(c), Rt = tgt.local.get(c), WT = tgt.world.get(c);
+ const C = turns.get(c), Cp = turns.get(tgt.parent.get(c));
+ // L = Rt * WT^-1 * Cp^-1 * WS * Rs^-1 R = WS^-1 * C * WT
+ const L = Rt.clone().multiply(inv(WT));
+ if (Cp) L.multiply(inv(Cp));
+ L.multiply(WS).multiply(inv(Rs));
+ const out = track.clone();
+ out.name = `${node.name}.${prop}`;
+ const v = out.values;
+ if (prop === 'quaternion') {
+ const R = inv(WS);
+ if (C) R.multiply(C);
+ R.multiply(WT);
+ const q = new Quaternion();
+ for (let i = 0; i < v.length; i += 4) {
+ q.fromArray(v, i).premultiply(L).multiply(R).toArray(v, i);
+ }
+ } else {
+ // Root motion: re-express in the target hips-parent frame, then scale by
+ // the ratio of rest hip offsets (covers height and centimetre armatures).
+ const k = src.hipLength > 0 ? tgt.hipLength / src.hipLength : 1;
+ const p = new Vector3();
+ for (let i = 0; i < v.length; i += 3) {
+ p.fromArray(v, i).applyQuaternion(L).multiplyScalar(k).toArray(v, i);
+ }
+ }
+ tracks.push(out);
+ }
+ if (total === 0 || tracks.length / total < minCoverage) return null;
+ return new AnimationClip(`${clip.name}@${tgt.bones.get('Hips')?.name ?? 'rig'}`, clip.duration, tracks);
+}
+```
+
+The hip correction reuses the hips' `L` (section 8's frame fix), and the `hipLength` ratio covers both height and centimetre armatures, assuming the hips' parent sits at floor level.
+
+**Step 1: check the names.** In a folder with `three` installed (`npm i three`, and `"type": "module"` in `package.json`), run `node names.mjs`:
+
+```js
+import { canonicalName } from './retarget-lite.js';
+
+for (const raw of [
+ 'mixamorig:LeftForeArm', // Mixamo, as authored
+ 'mixamorigLeftForeArm', // the same bone after GLTFLoader sanitizes it
+ 'lowerarm_l', // Unreal mannequin
+ 'J_Bip_L_LowerArm', // VRoid (VRM 0.x)
+ 'leftLowerArm', // VRM 1.0
+ 'forearm.L', // Blender / Rigify
+ 'DEF-forearm.L', // Rigify deform layer
+ 'Character1:LeftForeArm', // Maya HumanIK namespace
+ 'LeftForeArm_01', // exporter de-dup suffix
+ 'b_Hip_01', // a fox: no humanoid meaning
+]) console.log(raw.padEnd(24), '->', canonicalName(raw));
+```
+
+```
+mixamorig:LeftForeArm -> LeftForeArm
+mixamorigLeftForeArm -> LeftForeArm
+lowerarm_l -> LeftForeArm
+J_Bip_L_LowerArm -> LeftForeArm
+leftLowerArm -> LeftForeArm
+forearm.L -> LeftForeArm
+DEF-forearm.L -> LeftForeArm
+Character1:LeftForeArm -> LeftForeArm
+LeftForeArm_01 -> LeftForeArm
+b_Hip_01 -> null
+```
+
+**Step 2: one idle, five bodies.** The avatars and the idle clip are public on three.ws and served with `Access-Control-Allow-Origin: *`, so this page works from any static server (`python3 -m http.server` beside `retarget-lite.js`). It retargets one clip from the reference onto four humanoids and a fox.
+
+```html
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>One idle, many skeletons</title>
+ <style>html, body { margin: 0; height: 100%; background: #f4f4f4; } canvas { display: block; }</style>
+ <script type="importmap">
+ {
+ "imports": {
+ "three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
+ "three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/"
+ }
+ }
+ </script>
+</head>
+<body>
+<script type="module">
+import * as THREE from 'three';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
+import { captureRest, retarget } from './retarget-lite.js';
+
+const BASE = 'https://three.ws';
+const loader = new GLTFLoader().setMeshoptDecoder(MeshoptDecoder);
+const load = (url) => loader.loadAsync(url).then((gltf) => gltf.scene);
+
+// The source: the rig the clip was authored on, and the clip itself.
+const [reference, idleJson] = await Promise.all([
+ load(`${BASE}/avatars/cz.glb`),
+ fetch(`${BASE}/animations/clips/idle.json`).then((r) => r.json()),
+]);
+const src = captureRest(reference);
+const idle = THREE.AnimationClip.parse(idleJson);
+
+const renderer = new THREE.WebGLRenderer({ antialias: true });
+renderer.setSize(innerWidth, innerHeight);
+document.body.append(renderer.domElement);
+const scene = new THREE.Scene();
+scene.add(new THREE.HemisphereLight(0xffffff, 0x666666, 3));
+const camera = new THREE.PerspectiveCamera(35, innerWidth / innerHeight, 0.1, 100);
+camera.position.set(0, 1.1, 7);
+camera.lookAt(0, 0.9, 0);
+
+const targets = ['michelle', 'xbot', 'parametric-base', 'selfie-girl', 'fox'];
+const mixers = [];
+window.results = [];
+for (const [i, name] of targets.entries()) {
+ const model = await load(`${BASE}/avatars/${name}.glb`);
+ const tgt = captureRest(model); // in the bind pose, before anything plays
+ const clip = retarget(idle, src, tgt);
+ const height = new THREE.Box3().setFromObject(model).getSize(new THREE.Vector3()).y;
+ model.scale.setScalar(1.7 / height); // display only: the root is outside the rest frame
+ model.position.x = (i - (targets.length - 1) / 2) * 1.3;
+ scene.add(model);
+ window.results.push({ name, mapped: tgt.bones.size, drivable: !!clip });
+ if (!clip) continue; // not a humanoid we can drive: leave it exactly as authored
+ const mixer = new THREE.AnimationMixer(model);
+ mixer.clipAction(clip).play();
+ mixers.push(mixer);
+}
+
+const timer = new THREE.Timer();
+renderer.setAnimationLoop((time) => {
+ timer.update(time);
+ const dt = timer.getDelta();
+ for (const m of mixers) m.update(dt);
+ renderer.render(scene, camera);
+});
+window.ready = true;
+</script>
+</body>
+</html>
+```
+
+You should see four humanoids idling with arms relaxed (two Mixamo T-pose rigs with centimetre armatures, two A-pose rigs), and a fox standing exactly as authored. `window.results` reports 22 mapped bones per humanoid and zero for the fox. We ran this page in headless Chromium before publishing: no console errors or warnings, and the screenshot showed exactly that.
+
+Then pass `{ reaim: false }` to watch the A-pose bodies push their arms into their torsos, swap in `walk.json` for root motion and legs, or point it at your own rigs (the source must be the rig your clips were authored on, in bind pose). The full alias tables in [`src/glb-canonicalize.js`](https://github.com/nirholas/three.ws/blob/main/src/glb-canonicalize.js) are Apache-2.0.
+
+Prefer no code? [Rig Doctor](https://three.ws/rig-doctor?utm_source=ibm-community) runs the production canonicalizer on a GLB you drop in: it names the convention (it fingerprints 15), scores torso, arms, hands and legs against the 52-joint skeleton, repairs names, and previews the result, in the browser with nothing uploaded. The [Animation Studio](https://three.ws/pose?utm_source=ibm-community) plays the rest of the library on a loaded avatar.
+
+---
+
+## 14. Known limits and failure cases
+
+- **Forward axis is assumed.** Source and target must face the same way in model space. Most glTF exports agree; not all.
+- **A full name map is not a good performance.** The stance turn aligns a bone's direction, not the roll around it, so unusual bone roll still shows. The mesh follows its skin weights: a sleeve weighted to the wrong bone bends with that bone.
+- **No inverse kinematics.** Rotation retargeting preserves angles, not contacts: feet can slide on different leg proportions, and a clap can miss on a wide costume.
+- **Unmapped intermediate joints ride along.** A five-joint spine bends only at mapped joints, and forearm twist bones do not twist.
+- **Fingers are fragile.** Finger rest poses vary most (flat, curled, splayed), and the stance turn does not apply to them.
+- **Meaningless names and control rigs fall back** (section 11). Correct, but some well-made characters need a re-export.
+- **Section 13 is a teaching implementation**: no fingers, clavicle resolution, floor offset or fallen-pose guard. Correct for what it covers.
+
+---
+
+## 15. What this buys an agent, and an invitation
+
+For an agent framework, a universal body changes what the runtime can promise. **Every body is expressive on arrival**: a generated, auto-rigged avatar's first frame is an idle, not a T-pose. **Animation becomes a vocabulary**: our agents express themselves through named slots (idle, wave, nod, think, point, celebrate and more) and tools declare animation hints, which only works if every clip plays on every body; the slots are in the [animation runtime docs](https://three.ws/docs/animations?utm_source=ibm-community). **Generated motion slots in**: once converted into the library's basis, a prompt becomes a gesture every avatar can perform.
+
+If your stack uses a convention our tables do not know, the [first-contribution guide](https://three.ws/docs/first-contribution?utm_source=ibm-community) walks through teaching the retargeter a new rig, using the MikuMikuDance change as the worked example. Source is Apache-2.0 at [github.com/nirholas/three.ws](https://github.com/nirholas/three.ws).
+
+What we would most like this group to argue about:
+
+1. **Names or geometry?** Everything above starts from names and uses hierarchy and geometry only to break ties. Cesium Man has no usable names at all. Is anyone matching joints purely from topology and rest geometry robustly enough to trust in production?
+2. **Where should IK enter?** Rotation-only retargeting is cheap and runs once per rig; contact preservation needs a per-frame solve. For browser avatars, where would you draw the line: feet, feet and hands, or a learned retargeter?
+3. **What basis does your motion model emit?** Section 10 cost us a library's worth of clips. If you train text-to-motion models, how do you validate the output's rest basis before it reaches a renderer?
+
+_three.ws is an IBM Business Partner. The animation system described here is three.ws engineering; it is not an IBM product, uses no IBM technology, and is not endorsed by IBM._
diff --git a/docs/ibm-community-any-skeleton-animation-thread.md b/docs/ibm-community-any-skeleton-animation-thread.md
new file mode 100644
index 000000000..d3c43ffc9
--- /dev/null
+++ b/docs/ibm-community-any-skeleton-animation-thread.md
@@ -0,0 +1,92 @@
+---
+title: "How do you retarget animation onto humanoid rigs you did not author?"
+venue: IBM Community, Three.ws User Group (discussion thread)
+account: nich (nich8)
+companion_to: docs/ibm-community-any-skeleton-animation-post.md (group blog post, not yet posted; link it here once it has a URL)
+status: draft, not yet posted
+framing_notes: |
+ Self-contained discussion piece. "The full write-up on the group blog" has no URL
+ because the post does not exist yet; link it once it does. docs/ibm.md applies, and
+ this feature has no IBM component, so IBM appears only in the affiliation line. No
+ crypto-cluster content. Snippet run on three.js r184 on 2026-10-08; output verbatim.
+---
+
+# How do you retarget animation onto humanoid rigs you did not author?
+
+Every embodied-agent project hits this wall. You have a library of animation clips authored on one skeleton, and avatars arriving from everywhere else: Mixamo, VRoid, Unreal mannequins, Daz, Blender, a text-to-3D pipeline that rigged a body a minute ago. Play a clip on the wrong rig and you get one of three things: limbs that never move, a body lying on its back, or an avatar standing in its bind pose with its arms straight out, which every viewer reads as "broken".
+
+At three.ws we decided early not to keep a list of supported skeletons. Any humanoid should idle, walk and gesture from one shared library, authored against a single 52-joint reference skeleton (the full library is 3,343 clips today). Here is what made that work and what surprised us, and then a question for you, because I do not think we have the last word.
+
+## The core idea in three problems
+
+A clip is a list of tracks, and each track names the joint it drives. Three things differ between rigs, and they need three different fixes:
+
+1. **Names.** `mixamorig:LeftForeArm`, `lowerarm_l`, `J_Bip_L_LowerArm`, `leftLowerArm`, `forearm.L` and `左ひじ` are all the same elbow. We reduce every name to a canonical one (strip namespaces and vendor prefixes, collapse separators and case, look up alias tables in priority order). Our tables hold 736 normalized spellings for the 52 joints.
+2. **Rest pose.** Even with names solved, copying a clip's rotations fails, because a clip stores absolute local rotations relative to the authoring rig's rest. Different local axes, a T-pose versus an A-pose, or a rotation an exporter baked onto the armature all change what those numbers mean.
+3. **Proportions and units.** Bone lengths, height, metres versus centimetres, and where the floor sits. Get these wrong and avatars sink, float, or fold into a heap.
+
+The fix for the second problem is to stop copying rotations and copy **world-space motion** instead. For each bone, with `Rs`/`Rt` its local rest rotation on source and target and `WS`/`WT` its world rest rotation, every keyframe `q` becomes `L * q * R`, where `L = Rt * WT^-1 * WS * Rs^-1` and `R = WS^-1 * WT`. Both factors depend only on rest poses, so you compute them once per bone and the animated parent cancels out of the derivation.
+
+Here is the smallest demonstration I could make: one arm, one keyframe, and a target rig whose exporter put 90 degrees on the armature and the opposite on the bone (exactly what Mixamo exports do). It runs with nothing but `three` installed:
+
+```js
+import { Quaternion, Vector3 } from 'three';
+
+const rot = (axis, deg) => new Quaternion().setFromAxisAngle(new Vector3(...axis), (deg * Math.PI) / 180);
+const inv = (q) => q.clone().invert();
+
+// Source rig: no armature rotation, the upper arm rests pointing +X (a T-pose).
+const Rs = new Quaternion(), WS = new Quaternion();
+// Target rig: an exporter put +90 deg X on the armature and -90 deg X on the bone
+// to cancel it. Same world rest, different local numbers.
+const parentT = rot([1, 0, 0], 90);
+const Rt = rot([1, 0, 0], -90), WT = parentT.clone().multiply(Rt);
+
+const key = rot([0, 0, 1], -70); // one clip keyframe: drop the arm 70 deg
+
+const L = Rt.clone().multiply(inv(WT)).multiply(WS).multiply(inv(Rs));
+const R = inv(WS).multiply(WT);
+const armDir = (local) => new Vector3(1, 0, 0).applyQuaternion(inv(WT)) // rest axis, bone frame
+ .applyQuaternion(parentT.clone().multiply(local)); // to world
+const fmt = (v) => v.toArray().map((n) => n.toFixed(2)).join(', ');
+
+console.log('copied as-is:', fmt(armDir(key))); // points backward
+console.log('L * q * R: ', fmt(armDir(L.clone().multiply(key).multiply(R)))); // points down and out
+```
+
+Output:
+
+```
+copied as-is: 0.34, -0.00, -0.94
+L * q * R: 0.34, -0.94, 0.00
+```
+
+Copied verbatim, the arm swings backward; corrected, it drops down and out as intended. Across a whole skeleton, the copied case is the avatar lying on its back.
+
+## Five things we learned the hard way
+
+**Your loader renames bones before you see them.** three.js's `GLTFLoader` strips the characters `[ ] . : /` from node names, because they are reserved in track paths. `mixamorig:LeftArm` in the file is `mixamorigLeftArm` in memory, and `upper_arm.L` becomes `upper_armL`. A normalizer that only knows the file's spelling will miss the scene's.
+
+**Names are evidence, hierarchy is proof.** Rigify calls the clavicle `shoulder.L`; SMPL calls the upper arm `left_shoulder`; hobby rigs call the upper arm `shoulderL` and have no clavicle. No spelling table handles all three. We resolve it by contention (only reassign a name two joints are fighting over, and only when the sibling slot is free), with the skeleton hierarchy breaking ties, since the clavicle is the upper arm's ancestor.
+
+**World-space motion is not enough: stance matters too.** The world-delta formula preserves the turn *from rest*. Our reference rests in a T-pose and the idle lowers its arms about 72 to 77 degrees. On a rig that already rests in an A-pose, that same turn put the upper arms at 122 to 128 degrees, past vertical and into the torso. The fix we shipped on 2026-10-03 turns each target limb (upper arm, forearm, thigh, shin) from its own rest direction onto the reference's by the shortest arc before replaying the motion, leaves the spine and clavicles alone, and lets feet keep their own rest so soles stay flat. Afterwards every rig we measured, T-pose, A-pose or arms slightly raised, held its arms at exactly the reference's angle at the first frame of the idle.
+
+**Retarget motion, not structure.** Many baked clips carry position and scale tracks for every bone. Those encode the authoring rig's bone lengths. Copy them and a differently proportioned body folds into a heap while your coverage metric cheerfully reports 100%, because every bone "matched". Only joint rotations and the hip translation should cross over, and the hip track needs rotating into the target's frame, scaling by hip height in the parent's local units (a Mixamo armature exported at scale 0.01 needs a factor of about 100), and offsetting to the model's real floor.
+
+**A clip in the wrong basis passes every self-consistency check.** Our text-to-motion clips came out relative to the generator's own skeleton (HumanML3D-style offsets: arms hanging, head forward of the neck), not our reference rest. They played with heads thrown back about 90 degrees, yet passed every quality rule we had, because each rule compared a clip to itself. Converting the clips into the right basis and adding a rule that checks the basis directly took the honest accept rate on the same 882 takes from 47% to 71%.
+
+And one process lesson: **measure motion, not mapping.** A rig can map every name and still animate as a torso with frozen limbs if a parent chain is broken. We drive real clips onto ten differently named copies of one skeleton and measure that hands and feet actually travel in world space. We also audit stored avatars cheaply by fetching only each GLB's JSON chunk (it always starts at byte 20) with an HTTP Range request, which is how we found five naming conventions our tables were missing.
+
+## The full write-up
+
+The full write-up on the group blog goes much further: the derivation step by step, the stance correction with before-and-after measurements on six public avatars, hips and units, the gates that decide when *not* to animate (a skinned mesh and at least eight mapped joints, 50% track coverage, a guard that rejects any clip that would tip the body more than 45 degrees), a 140-line standalone three.js implementation, and a browser page you can run against public avatar files to watch one idle play on four differently rigged humanoids while a fox is left alone. It also lists where it still fails.
+
+## Questions for the group
+
+1. **Names or geometry?** We start from names and use hierarchy only to break ties. A humanoid whose joints are named like `Skeleton_arm_joint_L__4_` (the glTF sample Cesium Man) gives us nothing to work with. Has anyone matched joints from topology and rest geometry alone (chain lengths, symmetry, which chain reaches the floor) reliably enough to ship?
+2. **Where does IK belong?** Rotation-only retargeting is cheap and runs once per rig, but it preserves angles, not contacts: feet can slide and claps can miss on different proportions. For real-time avatars in a browser, where would you add a solver: feet only, feet and hands, or a learned retargeter instead?
+3. **How do you validate generated motion?** If you train or fine-tune text-to-motion models, what checks do you run on the output's rest basis before it reaches a renderer? Our self-consistency rules missed an entire library's worth of inverted clips.
+
+I would especially like to hear from anyone who has tried learned retargeting in production.
+
+_three.ws is an IBM Business Partner. The animation system described here is three.ws engineering; it is not an IBM product, uses no IBM technology, and is not endorsed by IBM._
diff --git a/docs/ibm-community-doc-freshness-post.md b/docs/ibm-community-doc-freshness-post.md
index 00e839248..7b4bff5c9 100644
--- a/docs/ibm-community-doc-freshness-post.md
+++ b/docs/ibm-community-doc-freshness-post.md
@@ -2,12 +2,12 @@
title: "Documentation drift detection from git history: docs that tell readers, and AI agents, whether to trust them"
venue: IBM Community, Three.ws User Group (blog post)
account: nich (nich8)
-description: "A long technical write-up for IBM developers, engineering leads, and platform teams: how three.ws binds every doc to the source files it names, asks git what moved since the doc was last written or reviewed, records human reviews against a specific commit, exempts dated records from rewriting, regenerates the result inside the deploy build, and shows every reader a freshness status. Includes real command output, two months of measured history, a zero-dependency Node script readers can run on their own repo in an afternoon, the honest limits of git-history staleness, and the lesson for teams whose docs are now read as instructions by AI coding agents."
+description: "A long technical write-up for IBM developers, engineering leads, and platform teams: how three.ws binds every doc to the source files it names, asks git what moved since the doc was last written or reviewed, records human reviews against a specific commit, exempts dated records from rewriting, regenerates the result inside the deploy build, and shows every reader a freshness status. Includes real command output, ten weeks of measured history, a zero-dependency Node script readers can run on their own repo in an afternoon, the honest limits of git-history staleness, and the lesson for teams whose docs are now read as instructions by AI coding agents."
status: draft, not yet posted
meta_title: "Documentation Drift Detection from Git History"
meta_description: "Bind each doc to the code it names, ask git what changed since it was last checked, and show readers and AI agents a freshness status. Runnable script."
slug: documentation-drift-detection-git-history
-featured_image: "https://three.ws/api/page-og?v=carbon&s=learn&t=Documentation+that+tells+you+whether+to+trust+it&d=Measure+doc+drift+against+git+history%2C+record+human+reviews+against+a+commit%2C+and+show+every+reader+a+freshness+status.&p=%2Fdocs%2Ffreshness"
+featured_image: "https://three.ws/api/page-og?v=carbon&f=group&s=learn&t=Documentation+that+tells+you+whether+to+trust+it&d=Measure+doc+drift+against+git+history%2C+record+human+reviews+against+a+commit%2C+and+show+every+reader+a+freshness+status.&p=%2Fdocs%2Ffreshness"
framing_notes: |
Every framing rule in docs/ibm.md applies. three.ws is an IBM Business Partner, and
nothing in this post is an IBM product, uses an IBM service, or had IBM involvement:
@@ -15,16 +15,16 @@ framing_notes: |
affiliation line near the top says so and must survive any edit.
Per docs/ops/seo-keyword-plan.md this is a standalone tutorial with no crypto-cluster
content. Every quoted doc path, command row, and commit subject was chosen to carry
- none; rows of real output that did were trimmed and the trim is marked in the text.
- Featured image caveat: the ?v=carbon card renders a fixed "Built on IBM watsonx.ai"
- footer (api/page-og.js, carbonCard). The platform is built on watsonx.ai, but next to
- a docs-freshness title the line can read as if this feature were. If that matters at
- posting time, use the same URL without `v=carbon` (the default dark card), or drop the
- featured image.
+ none; rows of real output that did were removed and the removal is marked in the text.
+ Featured image: the ?v=carbon card with &f=group, which renders the footer
+ "Three.ws User Group" instead of "Built on IBM watsonx.ai" (api/page-og.js,
+ CARBON_FOOTERS). That footer needs the deploy carrying the f= parameter; on an older
+ revision the parameter is ignored and the watsonx footer renders, so confirm the live
+ card before setting it as the featured image.
All numbers are dated in the text. Production figures are from the deploy of commit
76081013b (2026-10-01); local figures are from commit fe2a8b24f (2026-10-08). Re-run
`npm run check:docs-freshness` and re-read https://three.ws/docs-freshness-summary.json
- before posting and refresh sections 9 and 10 if they moved.
+ before posting, and refresh sections 9 and 10 if they moved.
Canonical URL: leave blank (original post).
---
@@ -32,28 +32,28 @@ framing_notes: |
_Posted in the [Three.ws User Group](https://community.ibm.com/community/user/groups/community-home?communitykey=e71510cc-d953-408f-9a1c-019f5c0a7016) on IBM Community._
-Nobody edits a document to make it wrong. The code it describes moves, and the page keeps saying what used to be true. For most of software history the only signal that a doc had rotted was a confused reader, usually days after the rot set in.
+Nobody edits a document to make it wrong. The code it describes moves, and the page keeps saying what used to be true. For most of software history the only signal that a doc had rotted was a confused reader.
-That was tolerable when the only reader was a person who could notice that a command failed and go ask someone. It is not tolerable anymore. On a growing number of teams, documentation now has a second reader: the AI coding agent. Agents read your README, your runbooks, and your agent instruction files, and they act on what those say. A human treats a stale sentence as a hint that something is off. An agent treats it as an instruction.
+That was tolerable when every reader was a person who could notice a failed command and go ask someone. It is not tolerable anymore, because documentation now has a second reader: the AI coding agent. Agents read your README, your runbooks, and your agent instruction files, and they act on what those say. A human treats a stale sentence as a hint that something is off. An agent treats it as an instruction.
-This post is a complete tour of how three.ws handles that. Every doc in our repository is bound to the source files it names. Git decides whether any of those files moved after the doc was last written or last reviewed. The result is a status per doc (verified, watch, stale, conceptual, or record), a ranked work queue for the people who fix docs, and a small badge at the top of every published doc page that tells the reader how much to trust what they are about to read. The measurement is regenerated inside the deploy build, so the badge describes the commit that is actually serving.
+This post is a complete tour of how three.ws handles that. Every doc in our repository is bound to the source files it names, and git decides whether any of those files moved after the doc was last written or last reviewed. The result is a status per doc, a ranked work queue for the people who fix docs, and a small badge at the top of every published doc page that tells the reader how much to trust it. The measurement is regenerated inside the deploy build, so the badge describes the commit that is actually serving.
It is a general engineering practice, not a product. Nothing here depends on our stack beyond git and Node.js, and section 11 gives you a zero-dependency script you can run against your own repository this afternoon.
-**The affiliation, stated exactly.** three.ws is an IBM Business Partner. The system described in this post is three.ws's own engineering practice, built on git and Node.js. It is not an IBM product, it does not use any IBM service, and IBM had no involvement in it. I am sharing it here because the problem it solves is one every team adopting AI coding agents will meet.
+**The affiliation, stated exactly.** three.ws is an IBM Business Partner. The system described here is three.ws's own engineering practice, built on git and Node.js. It is not an IBM product, it does not use any IBM service, and IBM had no involvement in it. I am sharing it because the problem it solves is one every team adopting AI coding agents will meet.
**Contents**
-1. Why stale docs got more expensive: your docs now have a second reader
+1. Why stale docs got more expensive
2. The model in one paragraph
3. What "stale" is computed from
4. Five statuses, and why two of them are not failures
-5. The second clock: recording a human review against a commit
-6. Records of a moment: why dated docs are exempt from rewriting
+5. The second clock: recording a review against a commit
+6. Records of a moment: why dated docs are exempt
7. Working the queue
-8. Where it runs: the gate, and inside the deploy build
+8. Where it runs, and why it runs before the frontend build
9. What readers see
-10. What two months of history say
+10. What ten weeks of history say
11. Build your own in an afternoon
12. The neighbors: link audits and an instruction file that checks itself
13. Honest limits
@@ -62,114 +62,62 @@ It is a general engineering practice, not a product. Nothing here depends on our
---
-## 1. Why stale docs got more expensive: your docs now have a second reader
+## 1. Why stale docs got more expensive
-three.ws is built by a small human team working alongside AI coding agents. The agents write code, run builds, prepare deploys, and, as you will see, do most of the documentation repair. They all start from the same place: an operating file at the root of the repository (ours is `CLAUDE.md`; many teams use `AGENTS.md` or a similar convention) plus whatever docs the task leads them into.
+three.ws is built by a small human team working alongside AI coding agents. The agents write code, run builds, prepare deploys, and, as you will see, do most of the documentation repair. They all start from an operating file at the root of the repository (ours is `CLAUDE.md`; many teams use [AGENTS.md](https://agents.md/) or a similar convention) plus whatever docs the task leads them into.
-That operating file contains a section called "Keeping this file true", and its opening paragraph is the clearest statement of the problem I know:
+That file has a section called "Keeping this file true," which opens with the clearest statement of the problem I know:
> This file is the operating brain for every agent here, and agents execute what it says verbatim. A stale line in it does not read as stale, it reads as an instruction, and the cost is a wasted session per drift.
-That is not hypothetical. The guard script that checks the file (`scripts/check-claude-md.mjs`, covered in section 12) carries comments recording the drifts that actually happened:
+The script that guards that file (section 12) records in its comments the drifts that actually happened:
-- The file once described a database migration command as a dry run. The npm wrapper hardcodes `--apply`, so the "dry run" writes to the production database immediately. A human might hesitate. An agent told it is safe will run it.
+- The file once described a database migration command as a dry run. The npm wrapper hardcodes `--apply`, so the "dry run" writes to the production database immediately. An agent told a command is safe will run it.
- The file quoted a scheduled-job count. The real list in the config grew from 89 to 100 without anyone updating the sentence.
-- The file told agents to push with `git push threews main`. On 2026-07-30 one worktree had no remote by that name, so the exact push command the file prescribes failed. As the script's comment puts it, a push instruction that does not resolve "fails at the moment the owner asked to ship."
+- The file told agents to push with `git push threews main`. On 2026-07-30 one worktree had no remote by that name, so the exact command the file prescribes failed.
-Each of those cost a session. None of them was a dramatic failure. They were small truths that stopped being true, read by a reader that does not second-guess.
-
-The same is true of every other doc an agent is pointed at. A runbook that names a script, a tutorial that tells you to run a command, an API reference that lists a route: all of them are now executable in a loose sense. So the question "is this doc still true?" stopped being a documentation-quality question and became an operational one.
+None of these was dramatic. Each was a small truth that stopped being true, read by a reader that does not second-guess. The same applies to every runbook that names a script, every tutorial that says "run this," and every API reference that lists a route. "Is this doc still true?" stopped being a documentation-quality question and became an operational one.
---
## 2. The model in one paragraph
-A doc already tells you what it is about: it names files, `npm run` commands, and `/api/` routes in its own text. Read those references, resolve the ones that point at real source files, and treat them as the doc's dependencies. Then ask git one question per dependency: was this file committed to after the doc was last written or last reviewed? Code that moved after the page was last checked is code the page has never been checked against. Weight each moved file by how exclusively this doc claims it, sum the weights, and turn the sum into a status. Rank the stale ones into a queue, give each one the exact commits to read, let a reviewer record "I read it and it was right" against a specific commit, and publish the result to every reader.
+A doc already tells you what it is about: it names files, `npm run` commands, and `/api/` routes in its own text. Read those references, resolve the ones that point at real source files, and treat them as the doc's dependencies. Ask git one question per dependency: was this file committed to after the doc was last written or last reviewed? Code that moved since then is code the page has never been checked against. Weight each moved file by how exclusively this doc claims it, sum the weights, turn the sum into a status, rank the stale docs into a queue with the exact commits to read, let a reviewer record "I read it and it was right" against a specific commit, and publish the result to every reader.
-That is the whole system. Everything below is detail, and most of the detail exists because a simpler version produced noise that taught people to ignore it.
+Everything below is detail, and most of it exists because a simpler version produced noise that taught people to ignore it.
---
## 3. What "stale" is computed from
-The implementation is one script, [`scripts/doc-freshness.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/doc-freshness.mjs), run as `npm run docs:freshness`. It needs no annotations in the docs. It reads the references authors already write.
-
-### 3.1 Which docs
+The implementation is one script, [`scripts/doc-freshness.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/doc-freshness.mjs), run as `npm run docs:freshness`. It needs no annotations. It reads the references authors already write.
-Every Markdown file under `docs/`, plus three root files that matter: `README.md`, `STRUCTURE.md` (the map from product surface to directory), and `CLAUDE.md`. Three generated aggregates that restate the whole corpus (`docs/ALL.md`, `docs/EVERYTHING.md`, `EVERYTHING.md`) are skipped. More on why in section 3.5, because the reason is one of the most useful lessons in this post.
+**Which docs.** Every Markdown file under `docs/`, plus `README.md`, `STRUCTURE.md` (the map from product surface to directory), and `CLAUDE.md`. Generated aggregates that restate the whole corpus are skipped, for a reason section 3.3 measures.
-### 3.2 What a doc depends on
-
-Three reference shapes, because those are the three ways our docs actually name code:
+**What a doc depends on.** Three reference shapes, because those are the three ways our docs name code: literal paths (in backticks, links, or bare prose), `npm run <script>` commands, and `/api/` routes. The `npm run` rule is the one people underestimate. A doc that says "run `npm run docs:review`" never names `scripts/docs-review.mjs`, but depends on it completely, so the script reads `package.json` and binds the files that command executes:
```js
// scripts/doc-freshness.mjs (excerpt)
-function extractDeps(markdown, selfPath) {
- const deps = new Set();
-
- // Explicit paths. The character class is deliberately narrow so a sentence
- // ending in a period does not swallow the next word into the match.
- for (const m of markdown.matchAll(/(?:^|[\s`("'[<])((?:\.\/)?[\w.-]+(?:\/[\w.-]+)*\.\w{1,5})/g)) {
- const rel = resolveRef(m[1], selfPath);
- if (rel) deps.add(rel);
- }
-
- // npm scripts: a doc telling you to run something depends on what it runs.
- for (const m of markdown.matchAll(/npm run ([\w:-]+)/g)) {
- for (const rel of scriptTargets(m[1])) deps.add(rel);
- }
-
- // API routes documented as endpoints map to their handler. The two shapes
- // this repo uses are api/<route>.js and api/<route>/index.js.
- for (const m of markdown.matchAll(/\/api\/([\w/-]+)/g)) {
- const route = m[1].replace(/\/$/, '');
- for (const candidate of [`api/${route}.js`, `api/${route}/index.js`]) {
- if (existsSync(path.join(ROOT, candidate))) deps.add(candidate);
- }
- }
-
- return [...deps];
+// npm scripts: a doc telling you to run something depends on what it runs.
+for (const m of markdown.matchAll(/npm run ([\w:-]+)/g)) {
+ for (const rel of scriptTargets(m[1])) deps.add(rel);
}
```
-The `npm run` rule is the one people underestimate. A doc that says "run `npm run docs:review`" never names `scripts/docs-review.mjs`, but it depends on it completely. The script reads `package.json`, finds the files that script command executes, and binds them to the doc.
-
-Each candidate path then has to survive `resolveRef`, which rejects anything that would flood the graph with false positives: a file without a code extension, a path outside the top-level directories that hold shippable code, a directory rather than a file, a path that does not exist, and the doc's own filename echoing back at it.
+Each candidate must then survive a resolver that rejects what would flood the graph: files without a code extension, paths outside the directories that hold shippable code, directories, paths that do not exist, and the doc's own filename echoing back at it.
-### 3.3 One pass over history
+**One pass over history.** Asking git about each dependency separately would be thousands of invocations, so the script reads the whole log once (`git log --format=%x1e%H|%ct|%s --name-only --no-renames`) and indexes it by file and by commit. The committer timestamp, `%ct`, becomes the clock. Section 13 covers what that choice costs.
-Asking git about each dependency separately would be thousands of invocations. Instead the script reads the whole history once and indexes it two ways, by file and by commit:
-
-```js
-// scripts/doc-freshness.mjs (excerpt)
-const raw = execFileSync(
- 'git',
- ['log', '--format=%x1e%H|%ct|%s', '--name-only', '--no-renames'],
- { cwd: ROOT, maxBuffer: 256 * 1024 * 1024 },
-).toString();
-```
-
-The `%x1e` record separator keeps a commit subject containing odd characters from corrupting the parse. `%ct` is the committer timestamp, which becomes the clock everything is compared against. (Section 13 covers what that choice costs.)
-
-### 3.4 The baseline, and the weight
+### 3.1 The baseline and the weight
For each doc, the baseline is whichever is newer: the doc's last commit, or its last recorded review (section 5). Every dependency committed to after that baseline is drift.
-Not all drift means the same thing, and this is the refinement that made the ranking usable. Our route configuration file, `vercel.json` (a legacy name; the file is the live route table for our server), is named by 72 docs. If every one of them went red whenever a route was added, the dashboard would be red everywhere and nobody would read it. But excluding shared files outright is wrong too, because the doc that really is about the route table should notice when it changes.
-
-So each dependency is weighted by how exclusively this doc claims it:
+Not all drift means the same thing. Our route table, `vercel.json` (a legacy filename; it is the live route config for our own server), is named by 72 docs. If all 72 went red whenever a route was added, the dashboard would be red everywhere and nobody would read it. Excluding shared files outright is wrong too, because the doc that really is about the route table should notice when it changes. So each drifted file is weighted by how exclusively this doc claims it, and the sum becomes a status:
```js
// scripts/doc-freshness.mjs (excerpt)
const specificity = (share) => 1 / Math.max(1, share);
-```
-
-A file only one doc names counts fully. A file forty docs name counts for a fortieth. The comment in the source calls it what it is: the inverse-document-frequency idea from search ranking, applied to the binding between docs and code. The doc that is uniquely responsible for a file rises above the doc that happened to mention a busy one.
-The signal is the sum of the weights of the drifted files, and the status falls out of it:
-
-```js
-// scripts/doc-freshness.mjs (excerpt)
function classify(deps, signal) {
if (!deps.length) return 'unverifiable';
if (signal <= 0) return 'fresh';
@@ -178,19 +126,21 @@ function classify(deps, signal) {
}
```
-The threshold of 1.0 reads directly: "the equivalent of one file that only this doc documents has changed." That is exactly when a human should re-read the page.
+A file only one doc names counts fully; a file forty docs name counts for a fortieth. The source comment calls it what it is: the inverse-document-frequency idea from search ranking, applied to the binding between docs and code. The threshold of 1.0 reads directly as "the equivalent of one file that only this doc documents has changed," which is exactly when a human should re-read the page.
-### 3.5 What is excluded, and why exclusion beats down-weighting
+### 3.2 Exclude, do not down-weight
-Three classes of file are removed from the graph entirely rather than weighted lightly:
+Three classes of file are removed from the graph entirely:
-- **Build outputs.** The sitemap, the machine-readable `llms.txt`, the changelog feeds, page indexes, build info. The changelog gaining an entry is not evidence that a tutorial went wrong. Their churn is mechanical, not semantic.
-- **The machine-translated locale tree.** Locale files are extracted from annotated HTML and machine-translated into other languages. A translation pass that touches a hundred files was reading as a hundred docs going stale until commit `2bf55b582` (2026-08-14) excluded them.
-- **The system's own bookkeeping.** The review store and the budget file are rewritten by every review and every budget change. The doc that explains the system names both, so recording reviews pushed that very doc straight back to stale: a false positive produced by using the system exactly as intended. Commit `302d0ae31` (2026-09-18) removed them.
+- **Build outputs**: the sitemap, `llms.txt`, changelog feeds, page indexes. The changelog gaining an entry is not evidence that a tutorial went wrong.
+- **The machine-translated locale tree.** Until commit `2bf55b582` (2026-08-14), "a translation pass touching a hundred files was reading as a hundred docs going stale."
+- **The system's own bookkeeping.** The doc explaining the system names the review store and the budget file, so recording a review pushed that doc straight back to stale: a false positive produced by using the system as intended. Commit `302d0ae31` (2026-09-18) removed both.
-The generated aggregates (`docs/ALL.md` and friends) are excluded as docs for a reason that is easy to miss and worth measuring. They restate the whole corpus, so they name nearly every file every other doc names. That does not just make them permanently stale. It **doubles the share count of almost every file in the repo**, which halves every weight, which quietly pushes real drift below the threshold everywhere.
+### 3.3 One generated file can hide half your drift
-I measured this with the minimal script from section 11, run against our repository at commit `fe2a8b24f` on 2026-10-08. With `docs/ALL.md` included (it names 2,089 files):
+Generated aggregates (a concatenated handbook, a generated reference) name nearly every file every other doc names. That does not just make them permanently stale. It doubles the share count of almost every file, which halves every weight, which pushes real drift below the threshold everywhere.
+
+I measured it with the script from section 11, against our repository at commit `fe2a8b24f` on 2026-10-08. With our aggregate `docs/ALL.md` included (it names 2,089 files):
```
809 docs: 58 stale, 359 watch, 165 verified, 227 conceptual, 0 snapshot
@@ -202,33 +152,27 @@ With it excluded (`--ignore '^docs/(ALL|EVERYTHING)\.md$'`):
808 docs: 122 stale, 294 watch, 165 verified, 227 conceptual, 0 snapshot
```
-Removing one generated file more than doubled the number of docs that cross the stale line. Nothing about the other docs changed. The aggregate was simply diluting everyone's evidence. If you build this yourself, finding and excluding your own aggregates (generated API references, concatenated handbooks, search-index dumps) is the first thing to do.
+Removing one generated file more than doubled the stale count. Nothing about the other docs changed; the aggregate was diluting everyone's evidence. If you build this, finding your own aggregates is step one.
---
## 4. Five statuses, and why two of them are not failures
-| Status | Shown to readers as | Meaning |
+| Status | Readers see | Meaning |
|---|---|---|
| `fresh` | Verified | Nothing it documents has changed since it was written or reviewed. |
| `watch` | Watch | Some movement, below the threshold. Worth a skim, not urgent. |
-| `stale` | Stale | The equivalent of one file only this doc documents has changed. Someone should re-read it. |
-| `unverifiable` | Conceptual | Names no code, so there is nothing to check. Not a problem, and not counted as drift. |
+| `stale` | Stale | The equivalent of one file only this doc documents has changed. |
+| `unverifiable` | Conceptual | Names no code, so there is nothing to check. Not counted as drift. |
| `snapshot` | Record | A dated record of a moment. Code moving under it is not drift. |
-The two that are not failures matter as much as the three that might be.
-
-**Conceptual** exists because plenty of good docs name no code at all: architecture rationale, product narratives, design principles. Calling those stale, or calling them unknown in a way that looks like a warning, would be noise that trains people to ignore the signal. They are counted separately so coverage stays visible (128 of 809 docs in production on 2026-10-01) without polluting the queue.
-
-**Record** exists because some docs are not descriptions of current behavior at all. Section 6 covers them.
+**Conceptual** exists because many good docs name no code: architecture rationale, product narrative, design principles. Calling those stale would be noise that trains people to ignore the signal. They are counted separately (128 of 809 in production on 2026-10-01) so coverage stays visible. **Record** is section 6.
---
-## 5. The second clock: recording a human review against a commit
+## 5. The second clock: recording a review against a commit
-The first version of this system had one clock: the doc's last commit. That clock is wrong in one very common case. Someone reads a page end to end, checks every claim against the source, and finds nothing to fix. The work happened. The doc is verified. The measurement still says stale, because there is no diff to show for it.
-
-Before review stamps existed, the only ways to clear such a page were a cosmetic edit, which lies in the history about what happened, or leaving a permanent false positive, which teaches everyone that the dashboard cries wolf. The sweep on 2026-08-05 ended with 8 docs in exactly that state, and the 2026-09-01 sweep ended with 10.
+The first version had one clock, the doc's last commit, and that clock is wrong in a very common case. Someone reads a page end to end, checks every claim, and finds nothing to fix. The work happened and the doc is verified, but the measurement still says stale because there is no diff. The only ways out were a cosmetic edit, which lies in the history, or a permanent false positive, which teaches everyone that the dashboard cries wolf. Our 2026-08-05 sweep ended with 8 docs stuck like that, and the 2026-09-01 sweep with 10.
A review stamp is the second clock:
@@ -241,12 +185,9 @@ npm run docs:review -- docs/a.md docs/b.md --at 53f2a200f --note "checked in the
# A dated record that must not be rewritten to match today's code.
npm run docs:review -- docs/security/review-2026-06-24.md --snapshot
-
-npm run docs:review -- --list # every stamp, newest first
-npm run docs:review -- --prune # drop stamps for docs that no longer exist
```
-Stamps live in one JSON file, `data/docs-freshness-reviews.json`, keyed by doc path and sorted on write "so two agents stamping different docs never fight." This is the real entry for the doc that describes the freshness system itself:
+Stamps live in one JSON file, sorted by path on write "so two agents stamping different docs never fight." The real entry for the doc that describes this system:
```json
"docs/doc-freshness.md": {
@@ -257,54 +198,27 @@ Stamps live in one JSON file, `data/docs-freshness-reviews.json`, keyed by doc p
}
```
-Three design decisions are worth copying.
-
-**A stamp records a commit, not a date.** "Reviewed on Tuesday" says nothing about which version of the code the reviewer read. "Reviewed against `302d0ae31`" does. The freshness clock uses that commit's timestamp, and anyone can check out that commit and see exactly what the reviewer saw.
-
-**A stamp naming a commit the repository does not have is a hard error, not a silent skip.** It means someone hand-edited the store, or stamped against a branch that never landed. Either way the baseline it claims is fiction, and a fictional baseline silently suppresses real drift, which is the precise failure the system exists to prevent:
-
-```js
-// scripts/doc-freshness.mjs (excerpt)
-const commit = byCommit.get(entry.commit);
-if (!commit) {
- problems.push(`${docPath}: stamped at ${entry.commit}, which is not a commit in this repo`);
- continue;
-}
-```
-
-The gate refuses to pass with a broken stamp outstanding, and a separate unit test (`tests/docs-freshness-reviews.test.js`) checks the store on every test run: every stamped doc exists, every stamp names a Markdown file, every stamp names a commit the repository has, and every stamp declares a kind the analyzer understands. That test runs in the normal suite precisely because the full measurement is too slow for it, and a careless bulk commit or a hand edit is exactly what would break the store.
-
-**The newer clock wins, in both directions.** A doc edited after its last review is measured from the edit. A doc reviewed after its last edit is measured from the review. And if you stamp a doc that has uncommitted edits, the review script tells you so, because the stamp cannot mask the pending edit: the measurement will still count the doc's real last commit.
+Three decisions worth copying:
-The dashboard and the badge both surface the stamp. A row on the dashboard says who checked the page and against which commit, and a page nobody has checked says so plainly and gives the command to record a check after reading it.
+- **A stamp records a commit, not a date.** "Reviewed Tuesday" says nothing about which code the reviewer read. "Reviewed against `302d0ae31`" does, and anyone can check that commit out.
+- **A stamp naming a commit the repository does not have is a hard error, not a silent skip.** It means a hand edit or a branch that never landed, and a fictional baseline silently suppresses real drift, which is exactly what the system exists to prevent. The gate fails on one, and a unit test (`tests/docs-freshness-reviews.test.js`) checks on every test run that each stamp names an existing Markdown doc, a real commit, and a known kind.
+- **The newer clock wins.** A doc edited after its review is measured from the edit, and stamping a doc with uncommitted edits prints a warning, because the stamp cannot mask the pending change.
---
-## 6. Records of a moment: why dated docs are exempt from rewriting
-
-Some docs record a moment rather than describe current behavior: a dated security review, an incident writeup, a test log, a finished work order, an upstream bug report draft. They name plenty of code, so they will always look stale. And they must never be "fixed," because rewriting a security review to match today's code destroys the record it exists to keep.
+## 6. Records of a moment: why dated docs are exempt
-These get `--snapshot`. Their status becomes `snapshot` regardless of drift, and they are never ranked as work:
-
-```js
-// scripts/doc-freshness.mjs (excerpt)
-// A snapshot documents a moment, so today's code cannot make it wrong.
-// Its dependencies stay visible (the evidence is still useful) but it is
-// never ranked as work.
-status: review?.kind === 'snapshot' ? 'snapshot' : classify(deps, signal),
-```
+Some docs record a moment rather than describe current behavior: a dated security review, an incident writeup, a test log, a finished work order, an upstream bug report. They name plenty of code, so they always look stale, and they must never be "fixed," because rewriting a security review to match today's code destroys the record it exists to keep.
-Six docs carry this status today, including two security reviews, a production test log, and an upstream issue draft. The readers' badge says: "Written [date]. This page records what was true at that point, so it is kept as written rather than updated to match today's code."
+These get `--snapshot`. Their status becomes `snapshot` regardless of drift, their evidence stays visible, and they are never ranked as work. Six docs carry it today, including two security reviews and an upstream issue draft. Readers see: "This page records what was true at that point, so it is kept as written rather than updated to match today's code."
-There is a subtle benefit here beyond silencing noise. An agent asked to "bring the docs up to date" will happily rewrite an audit to match the current code, because from its point of view the audit is just another stale doc. The snapshot status is a machine-readable statement that this document is history, and our sweep workflow (section 7) tells its reviewers in so many words that a record must not be rewritten.
+This matters more with agents in the loop. An agent asked to "bring the docs up to date" will happily rewrite an audit to match current code, because to it the audit is just another stale doc. The snapshot status is a machine-readable statement that the document is history.
---
## 7. Working the queue
-`npm run docs:freshness` ranks everything and writes the report. The command a writer actually reaches for is `--doc`, which explains one page and prints its reading list: every drifted file, the commits behind it, and their subjects.
-
-Here is real output from 2026-10-08, for a doc about how avatar preview images are rendered:
+The command a writer reaches for is `--doc`, which explains one page and prints its reading list. Real output from 2026-10-08, for the doc about how avatar preview images are rendered:
```
$ npm run docs:freshness -- --doc docs/avatar-thumbnails.md
@@ -328,35 +242,15 @@ docs/avatar-thumbnails.md
npm run docs:review -- docs/avatar-thumbnails.md --note "<what you checked>"
```
-The arithmetic is visible in the output. The regeneration script is named only by this doc, so it counts 1.0. The animation file is shared with 21 other docs, so it counts 1/22, about 0.045. Total 1.045: just over the line, and the line was crossed by the file this doc is uniquely responsible for.
-
-Is the doc wrong? I read the commit. It added a two-minute cap per render, so one model that never finishes no longer holds a whole regeneration pass hostage (the commit's own comment says one once held a pass for seven hours). The doc's existing claims about the script (dry run by default, `--apply` to overwrite, resumable with `--offset`) are all still true. What it does not mention is the new cap. That is the typical case: not a lie, but a missing fact an operator would want. The reviewer's choice is a one-sentence addition or a stamp with a note saying the omission is deliberate, and either one clears the page honestly.
+The arithmetic is visible. The regeneration script is named only by this doc, so it counts 1.0; the animation file is shared with 21 other docs, so it counts 1/22. Total 1.045, and the line was crossed by the file this doc alone is responsible for.
-That judgment is the part the tool cannot make, and it is designed not to try.
+Is the doc wrong? I read the commit. It added a two-minute cap per render so one model that never finishes cannot hold a whole pass hostage. Everything the doc says about the script (dry run by default, `--apply` to overwrite, resumable with `--offset`) is still true; it just does not mention the cap. That is the typical case: not a lie, but a missing fact an operator would want. One added sentence or a stamp with a note clears it honestly. That judgment is the part the tool cannot make, and it does not try.
-### 7.1 The gate and the budget
-
-`npm run check:docs-freshness` is the same measurement in gate mode. It does not write anything. It counts stale docs against a budget in `data/docs-freshness-budget.json` and fails when the count is over:
-
-```js
-// scripts/doc-freshness.mjs (excerpt)
-if (over > 0) {
- printTable(results, 15);
- console.error(
- `\nOver budget by ${over}. Either refresh a doc above (run ` +
- `\`npm run docs:freshness -- --doc <path>\` for the exact commits to read), ` +
- `or raise maxStale in data/docs-freshness-budget.json with a reason.`,
- );
- process.exit(1);
-}
-// The budget only ever ratchets down. Reporting the slack is what makes that
-// happen: a number nobody sees is a number nobody lowers.
-if (over < 0) console.log(`${-over} under budget. Lower maxStale to lock the gain in.`);
-```
+### 7.1 The gate and the ratchet
-The budget is a ratchet with its reasons recorded in the file itself: 50 on 2026-07-31 (the first measurement), 15 on 2026-08-05 (after the first full sweep), 5 on 2026-09-17 (after the sweep that reached zero, with 5 kept "as deliberate headroom for normal churn between passes rather than a backlog allowance").
+`npm run check:docs-freshness` is the same measurement in gate mode. It writes nothing, counts stale docs against `maxStale` in a budget file, and fails when over. When under, it prints the slack and tells you to lower the budget, because "a number nobody sees is a number nobody lowers." The budget's history is recorded in the file: 50 at the first measurement (2026-07-31), 15 after the first sweep (2026-08-05), 5 after the sweep that reached zero (2026-09-17).
-Here is the gate as it stands on 2026-10-08, at commit `fe2a8b24f`. It took about two seconds, exited 1, and is honest about why. I removed ten of the fifteen table rows because they concern product areas outside this post's scope; the rows shown are untouched:
+The gate on 2026-10-08, at commit `fe2a8b24f`, took about two seconds and exited 1. I removed ten of its fifteen table rows because they concern product areas outside this post; the rows shown are untouched:
```
$ npm run check:docs-freshness
@@ -378,27 +272,25 @@ docs freshness: 69 stale / 470 watch / 144 fresh / 128 unverifiable / 6 snapshot
Over budget by 64. Either refresh a doc above (run `npm run docs:freshness -- --doc <path>` for the exact commits to read), or raise maxStale in data/docs-freshness-budget.json with a reason.
```
-Note who is on that list: `docs/guards.md` and `docs/ops/guard-wiring.md` are the docs that describe our quality gates. `STRUCTURE.md`, the map from every product surface to its directory, is in the omitted rows. The docs about the system that keeps docs honest drift like everything else, which is the strongest argument I know for measuring instead of trusting.
+Note who is on that list. `docs/guards.md` and `docs/ops/guard-wiring.md` describe our repository's quality checks, and `STRUCTURE.md`, the map of the whole repo, is in the omitted rows. The docs about the machinery that keeps docs honest drift like everything else, which is the best argument I know for measuring instead of trusting.
### 7.2 Sweeps, run by agents
-The queue is drained in sweeps, and on our team the sweeps are run by AI coding agents through a workflow script (`.claude/workflows/docs-freshness.js`). It has three phases:
+The queue is drained in sweeps, and ours are run by AI coding agents through a three-phase workflow script:
-1. **Queue.** One agent runs the measurement and groups the stale docs into batches of at most five by subject area, so one reviewer reads each product surface's code once.
-2. **Review.** One agent per batch, in parallel. Each must read the exact drifted commits and the current source, check every concrete claim (routes, environment variables, script and function names, behavior, numbers, paths, UI copy), correct rather than rewrite, and return one verdict per doc from a three-word vocabulary: `EDITED`, `VERIFIED`, or `SNAPSHOT`.
-3. **Stamp.** One agent records every verdict with `npm run docs:review`. Stamping is deliberately centralized: the store is one file, and several agents writing it at once would lose stamps to a last-write-wins race.
+1. **Queue.** One agent runs the measurement and groups stale docs into batches of at most five by subject, so one reviewer reads each product surface's code once.
+2. **Review.** One agent per batch, in parallel. Each must read the drifted commits and the current source, check every concrete claim (routes, environment variables, function names, numbers, paths, UI copy), correct rather than rewrite, and return one verdict per doc: `EDITED`, `VERIFIED`, or `SNAPSHOT`.
+3. **Stamp.** One agent records every verdict. Stamping is centralized because the store is one file, and parallel writers would lose stamps to a last-write-wins race.
-The comment above the verdict schema states the point of the whole second clock: "A doc that was read and found correct is as finished as one that needed a fix... without VERIFIED the queue can only be drained by editing."
+The workflow's own comment states the point of the second clock: "A doc that was read and found correct is as finished as one that needed a fix... without VERIFIED the queue can only be drained by editing."
---
-## 8. Where it runs: the gate, and inside the deploy build
-
-The measurement runs in two places, and the second is the one I would most encourage you to copy.
+## 8. Where it runs, and why it runs before the frontend build
-**In the gate.** `check:docs-freshness` is part of `npm run gate`, our umbrella of repository health checks. The gate is run on demand, not by the deploy pipeline. Section 13 is honest about what that has cost.
+The gate (`check:docs-freshness`) belongs to `npm run gate`, our umbrella of repository health checks, which is run on demand. Section 13 is honest about what that has cost.
-**Inside the deploy build, before the frontend build.** Our production build is one chained npm script, and its order is load-bearing:
+The measurement itself (`docs:freshness`) runs inside the production build, which is one chained script whose order is load-bearing:
```
check:conflicts → check:browser-graph → check:tdz-bootstrap → ensure:avatar-studio
@@ -406,21 +298,17 @@ check:conflicts → check:browser-graph → check:tdz-bootstrap → ensure:avata
→ build → publish:lib → build:info → check:dist → check:pages
```
-`docs:freshness` writes `public/docs-freshness.json` and its compact summary. The frontend build (`build`, a Vite build) copies `public/` into the deployable output. So the freshness step must run before the frontend build, and it does. That one placement decision is what makes the badge honest: every deploy measures the commit being deployed, and the published dashboard and badges describe exactly that code, not whatever a person last measured by hand.
+`docs:freshness` writes the report into `public/`, and the frontend build (`build`, a Vite build) copies `public/` into the deployable output. So the measurement must run before the frontend build, and it does. That placement is what makes the badge honest: every deploy measures the commit being deployed.
-You can check this from outside. On 2026-10-08, the live version endpoint reported:
+You can check this from outside. On 2026-10-08 the live version endpoint and the live summary agreed:
```
$ curl -s https://three.ws/api/version
{"status":"ok","version":"1.5.2","commit":"76081013b368d6754c427f304c14ee58bbc1112e",
"commitShort":"76081013b", ..., "commitTime":"2026-10-01T19:30:12+00:00",
"builtAt":"2026-10-01T19:31:45.051Z", ...}
-```
-
-And the live freshness summary:
-```
-$ curl -s https://three.ws/docs-freshness-summary.json | head -8
+$ curl -s https://three.ws/docs-freshness-summary.json | head -5
{
"$generated": "npm run docs:freshness (scripts/doc-freshness.mjs)",
"$doc": "/docs/freshness",
@@ -428,7 +316,7 @@ $ curl -s https://three.ws/docs-freshness-summary.json | head -8
"commit": "76081013b",
```
-Same commit. The measurement ran about 40 seconds after the commit and about 52 seconds before the build finished, inside the build. If you take one idea from this post into your own pipeline, take this one: generate trust signals at build time, from the commit being shipped, and ship them with the artifact.
+Same commit, measured about 40 seconds after the commit and about 52 seconds before the build finished. If you take one idea into your own pipeline, take this one: generate trust signals at build time, from the commit being shipped, and ship them with the artifact.
---
@@ -436,84 +324,67 @@ Same commit. The measurement ran about 40 seconds after the commit and about 52
### 9.1 The badge
-Every published doc page and every tutorial renders a small freshness line above the article. It is mounted by [`public/doc-freshness.js`](https://github.com/nirholas/three.ws/blob/main/public/doc-freshness.js), which the docs reader and the tutorial viewer load with a dynamic import, so pages that never show a doc never pay for it.
-
-These are real badge texts, read from the live site with a headless browser on 2026-10-08 (status glyphs omitted):
+Every published doc page and tutorial renders a small freshness line above the article, from [`public/doc-freshness.js`](https://github.com/nirholas/three.ws/blob/main/public/doc-freshness.js), loaded by dynamic import so pages without a doc never pay for it. Real badge text, read from the live site with a headless browser on 2026-10-08 (status glyphs omitted):
| Page | Badge |
|---|---|
| [/docs/forge](https://three.ws/docs/forge?utm_source=ibm-community) | **Verified against the code.** Last written Sep 30, 2026. None of the 12 source files this page documents has changed since. |
| /docs/doc-freshness | **Lightly out of date.** Checked against the code Sep 18, 2026. 1 file it documents changed since, so a detail here may have moved. *See what changed* |
-| /docs/how-it-works | **Lightly out of date.** Last written Aug 13, 2026. 6 files it documents changed since, so a detail here may have moved. *See what changed* |
| /docs/guards | **The code this page describes has changed.** Checked against the code Sep 17, 2026. 18 files it documents changed since, and nobody has re-checked the page against them. *See what changed* |
-Notice the wording rules, which are written into the module:
-
-- **It says what happened, never what the reader did wrong.** "18 files it documents changed since, and nobody has re-checked the page against them" is a fact the reader can weigh. It does not tell them to go away.
-- **A review leads when there is one.** "Checked against the code Sep 17" is a stronger promise than "last written," so the review date is shown first when a stamp exists.
-- **Only drifted pages link out.** On a verified page the dashboard is a distraction from what the reader came for, so the "See what changed" link appears only on watch and stale.
-- **A missing entry renders nothing.** A brand-new page, or a build where the generator never ran, shows no badge at all. The comment in the source: "an empty box that says 'unknown' is worse for the reader than no box."
-- **It never blocks the content.** The reader came for the doc. The honest thing is to tell them how much to trust it while they read.
-
-### 9.2 Keeping the badge cheap
+The wording rules are written into the module, and they are worth stealing:
-The full report is large because it carries every drifted file and every commit behind it. On 2026-10-08 the live file was 1.63 MB raw (about 238 KB gzipped). A badge needs five fields per doc, so the script writes a separate summary with single-letter keys, documented in place:
+- **Say what happened, never what the reader did wrong.** "18 files changed since, and nobody has re-checked the page" is a fact the reader can weigh.
+- **A review leads when there is one.** "Checked against the code Sep 17" is a stronger promise than "last written."
+- **Only drifted pages link out.** On a verified page the dashboard is a distraction.
+- **A missing entry renders nothing.** In the source's words, "an empty box that says 'unknown' is worse for the reader than no box."
+- **Never block the content.** The reader came for the doc. Tell them how much to trust it while they read.
-```js
-// scripts/doc-freshness.mjs (excerpt)
-// Short keys: this file is fetched by every docs page that renders a
-// badge, so its bytes are on the reader's critical path.
-// s status, g signal, d date last edited, f files drifted, n deps known,
-// v date last reviewed (absent when the doc has never been stamped)
-```
+### 9.2 Keeping it cheap
-That summary was 97 KB raw and about 13 KB gzipped for 809 docs, fetched once per page load and cached. A real entry:
+The full report carries every drifted file and commit, and on 2026-10-08 the live file was 1.63 MB raw (about 238 KB gzipped). A badge needs five fields per doc, so the script also writes a summary with single-letter keys: 97 KB raw and about 13 KB gzipped for 809 docs, fetched once per page load. A real entry:
```json
"docs/doc-freshness.md": {"s":"watch","g":0.014,"d":"2026-09-18","f":1,"n":5,"v":"2026-09-18"}
```
-That `g` of 0.014 is 1/72: the one drifted file is the route table, named by 72 docs. The doc is "lightly out of date" in the most honest sense possible.
+Status, signal, last edited, files drifted, files known, last reviewed. That signal of 0.014 is 1/72: the one drifted file is the route table. "Lightly out of date" in the most honest sense.
### 9.3 The dashboard
-[The docs freshness dashboard](https://three.ws/docs/freshness?utm_source=ibm-community) is the people-who-fix-docs view of the same data. On 2026-10-08 its header read "809 docs bound to 4101 source files. Measured at 76081013b on Oct 1, 2026." Each status is a toggle filter showing its count (64 stale, 472 watch, 139 verified, 128 conceptual, 6 records on that deploy), and there is a text filter that matches a title, a path, or a source file that drifted, so you can ask "which docs moved when this file changed?" Sorting covers most drift, most files drifted, oldest doc, and path.
-
-Each row expands to the evidence: every drifted file with its weight ("only this doc documents it" or "also documented by N other docs"), the commits behind it, who last checked the page and against which commit, a link to read the page, a link to edit it, and a button that copies the exact `--doc` command for that page.
+[The docs freshness dashboard](https://three.ws/docs/freshness?utm_source=ibm-community) is the same data for the people who fix docs. On 2026-10-08 its header read "809 docs bound to 4101 source files. Measured at 76081013b on Oct 1, 2026," with one toggle filter per status (64 stale, 472 watch, 139 verified, 128 conceptual, 6 records), a text filter that also matches drifted source files ("which docs moved when this file changed?"), and four sort orders. Each row expands to every drifted file with its weight ("only this doc documents it" or "also documented by N other docs"), the commits behind it, who last checked the page against which commit, and a button that copies that page's `--doc` command.
---
-## 10. What two months of history say
+## 10. What ten weeks of history say
-Because the report is committed alongside the code, its own git history is a time series of documentation health. These are the totals from every committed version of the report, read with `git show` on 2026-10-08 (selected rows; the rest follow the same pattern):
+The report is committed alongside the code, so its own git history is a time series of documentation health. Totals from committed versions of the report, read with `git show` on 2026-10-08:
| Report date | Docs | Stale | What happened |
|---|---|---|---|
| 2026-07-31 | 469 | 50 | Measurement and dashboard ship; budget set to 50 |
-| 2026-08-05 | 484 | 55 to 8 | First full sweep: 47 corrected, 8 verified accurate as written |
+| 2026-08-05 | 484 | 55 to 8 | First sweep: 47 corrected, 8 verified as written |
| 2026-08-14 | 551 | 148 | Nine days of feature work |
| 2026-09-01 | 628 | 174 to 14 | Second sweep: 164 corrected or extended, 10 verified |
| 2026-09-15 | 718 | 106 | Two weeks of feature work |
| 2026-09-18 | 733 | 0 | Third sweep plus review stamps: 82 corrected, 22 verified, 6 records |
| 2026-09-21 | 747 | 13 | Three days later |
| 2026-10-01 | 809 | 64 | Production deploy of `76081013b` |
-| 2026-10-08 | 809 | 69 | Local measurement at `fe2a8b24f`; gate over budget by 64 |
+| 2026-10-08 | 809 | 69 | Local measurement at `fe2a8b24f` |
Three things stand out.
-**When the tool says stale, the doc is usually actually wrong.** Across the three sweeps, 339 flagged docs were read against the code, and 293 of them were corrected or extended: about 86 percent. The commit messages list what was wrong, and it is exactly the kind of thing a reader acts on: an environment-variable reference listing two variables no code reads, a runbook whose teardown command now refuses to run without `--force`, a command documented as writing two files when it writes four to two destinations, a tutorial whose sanity check pointed at the hosted platform instead of the stack the reader had just built, retired model names, outdated tool and job counts, and the deploy runbook's build chain. A signal with that hit rate is worth putting in front of readers.
+**When it says stale, the doc is usually wrong.** Across the three sweeps, 339 flagged docs were read against the code and 293 were corrected or extended: about 86 percent. The commit messages list what was wrong, and it is the kind of thing readers act on: an environment-variable reference listing two variables no code reads, a runbook whose teardown command now refuses to run without `--force`, a command documented as writing two files when it writes four to two destinations, a tutorial whose sanity check pointed at the hosted platform instead of the stack the reader had just built, retired model names, outdated tool and job counts, and the deploy runbook's build chain.
-**The corpus grows faster than you think.** 469 docs to 809 in ten weeks. Every one of the new ones names code, and every one of them starts drifting the day it lands.
+**The corpus grows fast.** 469 docs to 809 in ten weeks, every new one naming code and drifting from the day it lands.
-**Drift comes back on a schedule.** Zero on 2026-09-18, 13 three days later, 64 at the next deploy two weeks after that. A sweep is not a fix. It is maintenance, and it has to recur. Section 13 is about what that means for where the gate lives.
+**Drift comes back on a schedule.** Zero on 2026-09-18, 13 three days later, 64 at the next deploy. A sweep is not a fix. It is maintenance, and it has to recur.
---
## 11. Build your own in an afternoon
-Here is a complete, zero-dependency Node.js script that implements the core model: extraction, the one-pass history index, specificity weighting, the five statuses, review stamps with a hard error on unknown commits, a budget gate, and JSON output. It needs Node 18 or newer and git. Save it anywhere and run it from inside any git repository.
-
-It is deliberately smaller than ours, and it fixes one blind spot ours has (section 13.3): it resolves `../` links relative to the doc's own directory.
+Here is a complete, zero-dependency Node.js script implementing the core model: extraction, the one-pass history index, specificity weighting, the five statuses, review stamps with a hard error on unknown commits, a budget gate, and JSON output. It needs Node 18 or newer and git, and it runs from inside any git repository. It is deliberately smaller than ours, and it closes one blind spot ours has (section 13.3) by resolving `../` links against the doc's own directory.
```js
#!/usr/bin/env node
@@ -643,11 +514,13 @@ if (max !== null && count('stale') > Number(max)) {
}
```
-One bug I hit while writing it, kept in as a comment because you will hit it too: the first version called `process.exit(0)` right after printing the JSON report, and piping that output into another program cut it off at exactly 128 KB. Setting `process.exitCode` and letting Node exit on its own fixed it.
+One bug from writing it, left in as a comment because you would hit it too: an early version called `process.exit(0)` right after printing the JSON, and piping that output into another program cut it off at exactly 128 KB.
+
+Against our repository (809 docs, 12,267 commits on 2026-10-08) it runs in 2 to 3 seconds.
-### 11.1 Watch it work in sixty seconds
+### 11.1 The full lifecycle in sixty seconds
-This builds a throwaway repository with three docs (a setup guide, an incident record, and a design note that names no code) and walks the full lifecycle. The `sleep 1` calls matter; section 13.4 explains why.
+This builds a throwaway repository with a setup guide, an incident record, and a design note that names no code. (The `sleep 1` calls matter; section 13.4 explains why. On macOS use `sed -i ''`.)
```bash
mkdir drift-demo && cd drift-demo && git init -q
@@ -667,7 +540,7 @@ git commit -qam "feat: port 9090, five boot retries"; sleep 1
node doc-drift.mjs --check 0
```
-Real output from running exactly that on 2026-10-08 (your hashes will differ):
+Real output from running exactly that on 2026-10-08 (your hashes will differ); the exit code is 1:
```
3 docs: 2 stale, 0 watch, 0 verified, 1 conceptual, 0 snapshot
@@ -680,46 +553,32 @@ Real output from running exactly that on 2026-10-08 (your hashes will differ):
2 stale docs, budget 0.
```
-The exit code is 1. Now resolve both, the right way for each: fix the setup guide, and mark the incident as a record, because an incident writeup that said "retried 3 times" was true on the day and must stay that way.
-
-```bash
-sed -i 's/8080/9090/' docs/setup.md && git commit -qam "docs(setup): the port is 9090 now"; sleep 1
-node doc-drift.mjs --stamp docs/incident-2026-03-02.md --snapshot
-node doc-drift.mjs --check 0
-```
+Resolve each the right way: fix the setup guide, and mark the incident as a record, because "retried 3 times" was true on the day and must stay that way.
```
+$ sed -i 's/8080/9090/' docs/setup.md && git commit -qam "docs(setup): the port is 9090 now"
+$ node doc-drift.mjs --stamp docs/incident-2026-03-02.md --snapshot
Stamped docs/incident-2026-03-02.md as snapshot at 7af8a68a8.
+$ node doc-drift.mjs --check 0
3 docs: 0 stale, 0 watch, 1 verified, 1 conceptual, 1 snapshot
```
-(On macOS, use `sed -i ''` instead of `sed -i`.) Now the false positive every team meets in week one: a commit that touches the file without changing anything the doc says.
-
-```bash
-echo '// bind on all interfaces' >> src/server.js && git commit -qam "chore(server): add a comment"; sleep 1
-node doc-drift.mjs
-```
+Now the false positive every team meets in week one, a commit that changes nothing the doc says, and the stamp that clears it honestly:
```
+$ echo '// bind on all interfaces' >> src/server.js && git commit -qam "chore(server): add a comment"
+$ node doc-drift.mjs
3 docs: 1 stale, 0 watch, 0 verified, 1 conceptual, 1 snapshot
1.00 docs/setup.md
src/server.js (weight 1.00): c029f69ba chore(server): add a comment
-```
-
-The setup guide is still correct. Without a second clock you would have to make a cosmetic edit to clear it. With one, you read it and record the fact:
-
-```bash
-node doc-drift.mjs --stamp docs/setup.md
-node doc-drift.mjs --check 0
-```
-
-```
+$ node doc-drift.mjs --stamp docs/setup.md
Stamped docs/setup.md as verified at c029f69ba.
+$ node doc-drift.mjs --check 0
3 docs: 0 stale, 0 watch, 1 verified, 1 conceptual, 1 snapshot
```
-Commit `.doc-reviews.json` along with any doc edits, so the review is part of history like everything else. Finally, prove the store cannot lie. Hand-edit a stamp to point at a commit that does not exist:
+Commit `.doc-reviews.json` with your doc edits, so reviews are history like everything else. Finally, prove the store cannot lie:
```
$ echo '{"docs/setup.md":{"commit":"deadbeef0","kind":"verified"}}' > .doc-reviews.json
@@ -727,39 +586,26 @@ $ node doc-drift.mjs
Error: docs/setup.md: stamped at deadbeef0, which is not a commit in this repo
```
-Exit code 1, as it should be. One more thing worth seeing for yourself: in an earlier version of this demo, both docs named `src/server.js`. Each then got a weight of 0.5 and both landed in watch rather than stale. That is the specificity rule working exactly as designed, and it is why the demo gives each doc its own file.
-
-Against our real repository (809 docs, 12,267 commits of history on 2026-10-08), the script runs in about 2 to 3 seconds.
+Exit code 1. One more thing to see for yourself: in my first draft of this demo, both docs named `src/server.js`, each got a weight of 0.5, and both landed in watch instead of stale. That is the specificity rule working as designed.
### 11.2 Adapting it to your repository
-A checklist for the afternoon:
-
-1. **Point it at your docs.** Change the `docs` filter on line 33 if your docs live elsewhere (a `handbook/` tree, `*.adoc`, per-package READMEs).
-2. **Teach it your reference shapes.** Paths and `npm run` are covered. If your docs name Make targets, Gradle tasks, CLI subcommands, or REST routes, add a rule that maps each to the file that implements it. The route rule in section 3.2 is a ten-line template.
-3. **Exclude generated output first.** Run it once with `--json`, look for docs with absurd dependency counts and files that appear in hundreds of docs, and add them to `--ignore`. Section 3.5 shows why this changes the answer, not just the noise.
-4. **Pick a budget you can hold.** Run it, take today's stale count, and set `--check` to that number. Ratchet it down after each sweep, and record the reason when you do.
-5. **Put it in the build that ships the docs.** Write the JSON into whatever your docs site publishes, at build time, from the commit being built. Then render a badge from it.
-6. **Give your agents the same view.** If your coding agents have an instruction file, tell them to run the `--doc`-style explanation before trusting a page, and to stamp or fix rather than make cosmetic edits.
+1. **Point it at your docs.** Edit the `docs` filter if yours live elsewhere.
+2. **Teach it your reference shapes.** If your docs name Make targets, Gradle tasks, CLI subcommands, or REST routes, add a rule mapping each to the file that implements it, the way the `npm run` rule does.
+3. **Exclude generated output first.** Run it once with `--json`, look for docs with absurd dependency counts and files named by hundreds of docs, and `--ignore` them. Section 3.3 shows this changes the answer, not just the noise.
+4. **Set a budget you can hold.** Start `--check` at today's stale count and ratchet it down after each sweep, recording why.
+5. **Run it in the build that ships the docs.** Write the JSON into what your docs site publishes, from the commit being built, and render a badge from it.
+6. **Give your agents the same view.** Tell them, in their instruction file, to check a page's drift before trusting it, and to stamp or fix rather than make cosmetic edits.
---
## 12. The neighbors: link audits and an instruction file that checks itself
-Freshness measures whether a doc's prose may have drifted. Two sibling checks cover what can be verified exactly.
+Freshness measures whether prose may have drifted. Two sibling checks cover what can be verified exactly.
-### 12.1 `npm run audit:docs`: the mechanical layer
+### 12.1 `npm run audit:docs`
-[`scripts/audit-docs.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/audit-docs.mjs) catches the classes of doc rot that have a yes-or-no answer:
-
-1. Relative links in Markdown resolve to a real file on disk.
-2. Site links (`/create`, `/docs/x`) resolve to a real route: declared in the page catalog, matched by a route rule, or backed by a file.
-3. `npm run <script>` references name a script that exists, and `node scripts/<x>` references name a file that exists.
-4. Every directory under `packages/` and `workers/` carries a README.
-5. Every public doc is registered in the page catalog, so it reaches the sitemap and `llms.txt` instead of being live and invisible to every crawler.
-6. The mirror of that: every doc route declared in the catalog has a Markdown file behind it.
-
-It deliberately skips fenced code and inline code spans (those show templates, not links), external URLs (network-dependent), and generated aggregates. Real output on 2026-10-08:
+[`scripts/audit-docs.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/audit-docs.mjs) catches the doc rot that has a yes-or-no answer: relative links that resolve to no file, site links that match no route, `npm run` commands naming scripts that no longer exist, `packages/` and `workers/` directories missing a README, and published docs missing from the page catalog (or catalog entries with no doc behind them). It skips code spans, external URLs, and generated aggregates. Real output on 2026-10-08, in about a second:
```
$ npm run audit:docs
@@ -776,33 +622,19 @@ Directories required to carry a README.md (7):
docs audit: 7 finding(s) across 1803 files.
```
-It ran in just over a second, and yes, it is currently red. One of the seven, `workers/browser-gateway`, is an empty directory on the machine I ran it on and is not in git at all (the audit reads the disk, which is the right call for a local check). The other six are real, committed directories. Hold that thought for section 13.
-
-### 12.2 `npm run check:claude`: the agent instruction file checks its own claims
+It is red. One of the seven, `workers/browser-gateway`, is an empty directory on the machine I ran it on and is not in git; the other six are real, committed directories. Hold that thought.
-This is the piece most directly relevant to teams adopting coding agents. [`scripts/check-claude-md.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/check-claude-md.mjs) treats the agent operating file as code with assertions. Its header explains why:
+### 12.2 `npm run check:claude`
-> CLAUDE.md is the operating brain for every agent in this workspace: it names npm scripts, file paths, and runbook steps that agents execute verbatim. When the repo moves and CLAUDE.md doesn't, agents follow instructions into dead ends (a renamed script, a moved runbook, a deleted directory) and burn a session discovering the drift. This check makes that drift a red build instead of a wasted session.
+This is the piece most relevant to teams adopting coding agents. [`scripts/check-claude-md.mjs`](https://github.com/nirholas/three.ws/blob/main/scripts/check-claude-md.mjs) treats the agent operating file as code with assertions, because when it drifts, "agents follow instructions into dead ends... and burn a session discovering the drift." It does not judge prose. It **re-derives each checkable claim from its source of truth** on every run:
-It does not check prose by vibes. It **re-derives each checkable claim from its source of truth** on every run:
-
-- Every `npm run <script>` and every backticked script name in the file must exist in `package.json`.
-- Every concrete repo path must exist on disk (placeholders, globs, URLs, and build artifacts are skipped, so it only fails on paths an agent would try to open and not find).
-- The scheduled-job count quoted in prose must equal the length of the `crons` array in the config.
-- The deploy runbook must list the real build chain, every step, in the real order. This is the assertion that keeps the chain in section 8 honest:
-
-```js
-// scripts/check-claude-md.mjs (excerpt)
-const chain = (scripts['build:gcp'] || '').match(/npm run ([a-z0-9:._-]+)/g)?.map((s) => s.replace('npm run ', '')) ?? [];
-const runbookOrder = chain.filter((step) => md.includes(`\`${step}\``));
-const positions = runbookOrder.map((step) => md.indexOf(`\`${step}\``));
-const documentedInOrder = positions.every((p, i) => i === 0 || p > positions[i - 1]);
-```
-
-- The migration warning must match what the migration script actually does: if the npm script passes `--apply`, the file must say it applies immediately, and if it stops passing `--apply`, the warning must go.
-- The documented push remote must actually be configured.
-- Every cloud build config must pin the service account the file says it must.
-- The subagent definition files are held to the same standard as the main file.
+- every `npm run` script and repo path the file names must exist;
+- the quoted scheduled-job count must equal the length of the config's job list;
+- the deploy runbook must list every step of the real build chain from section 8, in the real order;
+- the migration warning must match whether the npm script actually passes `--apply`;
+- the documented push remote must actually be configured;
+- every cloud build config must pin the service account the file says it must;
+- the agent subagent definitions are held to the same standard.
Real output on 2026-10-08:
@@ -811,81 +643,91 @@ $ npm run check:claude
[check-claude] OK: every script, path, and typography rule in CLAUDE.md matches the repo
```
-That "OK" turns out to be the most instructive line in this post. Keep reading.
+That "OK" turns out to be the most instructive line in this post. See section 13.8.
---
## 13. Honest limits
-Everything above is useful. None of it is magic. Here is what git-history staleness cannot do, with a real example for each where we have one.
-
### 13.1 It detects movement, not wrongness
-A comment-only commit makes a doc stale (the demo in 11.1 shows exactly that). A refactor that changes nothing observable makes a doc stale. Our sweeps measured about an 86 percent hit rate (section 10), which means roughly one flagged doc in seven was already right. That is good enough to act on and bad enough that you need the second clock, or people will learn to ignore the signal. The real example from section 7, the avatar thumbnails doc, is typical: the drifted commit added a behavior the doc does not mention, and a human has to decide whether that omission matters.
+A comment-only commit makes a doc stale, as the demo shows. Our sweeps measured about an 86 percent hit rate, so roughly one flagged doc in seven was already right. Good enough to act on, and bad enough that you need the second clock or people learn to ignore the signal.
### 13.2 It cannot see claims that name nothing
-If a doc says "the server listens on 8080" without naming the file that sets the port, the measurement has no edge to follow. The same goes for behavior that lives in environment configuration, infrastructure, a database, or a third-party API: none of it is in the file graph. Docs that name no code at all are honestly labeled conceptual and never measured. The practical consequence is a writing rule: **name the file that is the source of truth**, because a named file is a checkable claim and an unnamed one is not.
+If a doc says "the server listens on 8080" without naming the file that sets the port, there is no edge to follow. Behavior that lives in environment configuration, infrastructure, a database, or a third-party API is not in the file graph either. The practical consequence is a writing rule: **name the file that is the source of truth**, because a named file is a checkable claim.
### 13.3 Extraction has blind spots
-Our extractor binds a reference by its repo-relative path. A link like `[selfie-capture.js](../src/selfie-capture.js)` has a bare filename as its visible text and a parent-relative path as its target, and the extractor does not resolve `../` against the doc's directory, so neither form binds. I confirmed this on 2026-10-08 with our avatar creation doc: it links three such source files, all of which exist, and none of the three appears among the 7 files the live report says it documents. The script in section 11 resolves relative links against the doc's own directory and binds 10 files for the same doc; the difference is exactly those three links. There will be others in your repo, which is why the first `--json` run is worth reading by hand.
+Our extractor binds references by repo-relative path and does not resolve `../` against the doc's directory. A link like `[selfie-capture.js](../src/selfie-capture.js)` therefore binds in neither form. On 2026-10-08 our avatar creation doc linked three such source files, all of which exist, and none appeared among the 7 files the live report says it documents. The section 11 script binds 10 files for the same doc; the difference is exactly those three. Your repo will have its own gaps, which is why the first `--json` run is worth reading by hand.
### 13.4 Timestamps are not ancestry
-The clock is the committer timestamp, and comparisons are strict. That has three consequences. A code change committed in the same second as the doc edit is invisible (hence the `sleep 1` calls in the demo, which you will never need in a real repo but will notice in a scripted one). Rebases and cherry-picks rewrite committer dates. And a commit made on a long-lived branch before a doc was edited on main, then merged after, carries its older timestamp, so it is filtered out even though it landed after the doc was last checked. A fully correct version would ask "is this commit an ancestor of the doc's baseline commit?" instead of comparing dates. For trunk-based teams the date approximation is very close. For teams with long-lived branches, it is worth the extra `git merge-base --is-ancestor` calls.
+The clock is the committer timestamp, compared strictly. A code change in the same second as the doc edit is invisible (hence the `sleep 1` in the scripted demo). Rebases and cherry-picks rewrite committer dates. And a commit made on a long-lived branch before a doc was edited on main, then merged after, keeps its older timestamp and is filtered out even though it landed later. The fully correct question is "is this commit an ancestor of the doc's baseline?" (`git merge-base --is-ancestor`). For trunk-based teams the date approximation is close; for long-lived branches it is worth the extra calls.
-### 13.5 The weighting hides shared-file drift by design
+### 13.5 Weighting hides shared-file drift by design
-The route table is named by 72 docs. When it changes, each of them moves by 0.014, and the one doc that really is the route-table reference will not cross the line on that file alone. In production on 2026-10-01, 472 of 809 docs sat in watch. Watch is a large, quiet bucket, and in practice nobody works it. That is a deliberate tradeoff, but it is a tradeoff.
+When the route table changes, each of its 72 docs moves by 0.014, and the one doc that really is the route reference will not cross the line on that file alone. In production on 2026-10-01, 472 of 809 docs sat in watch, a large quiet bucket nobody works. A deliberate tradeoff, but a tradeoff.
### 13.6 A review stamp is trust, not proof
-A stamp records that someone claims to have checked a doc against a commit. It does not record what they checked. Every one of the 111 stamps in our store today says `"by": "agent"`, which is the default, and the sweeps that recorded them were run by AI coding agents. The note field is free text. If your team needs reviews to carry accountability, require a named reviewer and keep stamps in the same review process as code.
+A stamp records that someone claims to have checked a doc against a commit, not what they checked. All 111 stamps in our store today say `"by": "agent"`, the default, and the sweeps that recorded them were run by AI coding agents. If your reviews need accountability, require a named reviewer and keep stamps in your normal review process.
### 13.7 A gate that is not in the ship path drifts red
-This is the one I most want other teams to learn from us rather than repeat. `check:docs-freshness` runs in `npm run gate`, which is run on demand. The deploy pipeline regenerates the report (section 8) but does not enforce the budget. Stale went from 0 on 2026-09-18 to 64 at the 2026-10-01 deploy and 69 on 2026-10-08, more than ten times the budget of 5, and the 2026-10-01 deploy shipped normally with the gate in that state, because nothing in the deploy path asks. `audit:docs` is in the same position and is red today with 7 findings. The badges kept telling readers the truth the whole time, which is the system working. But the queue was not worked, because nothing forced it to be. If drift matters to you, either put the budget check in the path that ships, or schedule the sweep the way you schedule dependency updates.
+This is the one I most want other teams to learn from us rather than repeat. The budget check runs on demand. The deploy regenerates the report (section 8) but does not enforce the budget. Stale went from 0 on 2026-09-18 to 64 at the 2026-10-01 deploy and 69 on 2026-10-08, more than ten times the budget, and the 2026-10-01 deploy shipped normally because nothing in the deploy path asks. `audit:docs` is in the same position. The badges told readers the truth throughout, which is the system working, but the queue was not worked because nothing forced it. Put the budget in the path that ships, or schedule the sweep like dependency updates.
-### 13.8 A guard keyed to the wording of a claim stops guarding when the wording changes
+### 13.8 A guard keyed to wording stops guarding when the wording changes
-And now the "OK" from section 12.2. The agent operating file states that README coverage under `packages/`, `workers/`, and `services/` is 100 percent. One of its assertions exists to check exactly that claim, and it only fires when the file contains the phrase "is currently 100%":
+Now the "OK." The agent operating file states that README coverage under `packages/`, `workers/`, and `services/` is 100 percent, and one assertion exists to check that claim. It only fires when the file contains the phrase "is currently 100%":
```js
// scripts/check-claude-md.mjs (excerpt)
if (coverageGaps.length && /Coverage under `packages\/`, `workers\/`, and `services\/` is currently 100%/.test(md)) {
```
-On 2026-09-10, commit `5a431ea37` reworded that sentence for a good reason: it quoted directory counts that kept going stale, so the counts were replaced with a command that prints the gaps. That is exactly the advice the file gives itself ("name the source of truth instead of quoting a number from it"). The new sentence says "is 100%" instead of "is currently 100%". The assertion's pattern stopped matching, so the assertion stopped asserting, silently.
+On 2026-09-10, commit `5a431ea37` reworded that sentence for a good reason: it quoted directory counts that kept going stale, so the counts were replaced with a command that prints the gaps, exactly the file's own advice ("name the source of truth instead of quoting a number from it"). The new sentence says "is 100%," not "is currently 100%." The pattern stopped matching, so the assertion stopped asserting, silently.
+
+Between 2026-09-21 and 2026-09-25, seven directories were committed without a README: the six real ones `audit:docs` lists, plus one under `services/`, which `audit:docs` does not cover. Until 2026-10-08 the operating file said coverage was 100 percent, the guard said OK, and an agent reading the file had no reason to doubt it.
+
+We found it while writing this post, and fixed it the same day. The fix is the lesson. The pattern now accepts the sentence with or without "currently", a rewording that drops the claim entirely is itself a failure rather than a skip, and only directories with committed files count, so an empty scratch directory in a shared worktree cannot fail it:
+
+```js
+// scripts/check-claude-md.mjs (excerpt, after the fix)
+const claimsFullCoverage = /Coverage under `packages\/`, `workers\/`, and `services\/` is (?:currently )?100%/.test(md);
+if (!claimsFullCoverage) {
+ failures.push('CLAUDE.md no longer states the 100% README-coverage standard this check enforces; restore the sentence or update check 4d');
+} else if (coverageGaps.length) {
+```
-Between 2026-09-21 and 2026-09-25, seven new directories were committed without a README: the six real ones `audit:docs` lists in section 12.1, plus one under `services/`, which `audit:docs` does not cover. On 2026-10-08 the operating file still says coverage is 100 percent, the guard says OK, and an agent reading the file has no reason to doubt it.
+The first run after the fix went red immediately, naming the directories still without a README. That red is the check working.
-The lesson generalizes well beyond our repo. **A check that skips itself when its trigger text is missing has a failure mode that looks exactly like success.** If you write assertions about prose, make a missing claim an error ("the README-coverage sentence is gone, either restore it or remove this assertion"), the way the same script already does for its cron-count sentence. And do not take a green check on an instruction file as proof that the file is true; take it as proof that the specific assertions that ran passed.
+The lesson generalizes. **A check that skips itself when its trigger text is missing has a failure mode that looks exactly like success.** When you assert things about prose, make a missing claim an error, the way the same script already does for its job-count sentence. And treat a green check on an instruction file as proof that the assertions which ran passed, not that the file is true.
---
## 14. The lesson for teams adopting AI coding agents
-If your team is bringing coding agents into its workflow, your documentation just changed category. It used to be reference material that people consulted with judgment. It is now, in part, a program that agents execute. Three things follow.
+If your team is bringing coding agents into its workflow, your documentation changed category. It used to be reference material people consulted with judgment. It is now, in part, a program agents execute. Three things follow.
-**Treat your agent instruction file like code.** Every checkable claim in it (a script name, a path, a count, an order of steps, a safety property like "this command does not write") should be re-derived from its source of truth by a check that runs often. Prefer wording that cannot go stale: point at the source of truth rather than quoting a number from it. And make your checks fail loudly when the claim they guard disappears, not quietly pass.
+**Treat the agent instruction file like code.** Every checkable claim in it (a script name, a path, a count, an order of steps, a safety property like "this command does not write") should be re-derived from its source of truth by a check that runs often. Prefer wording that cannot go stale, and make checks fail loudly when the claim they guard disappears.
-**Give every doc a machine-readable trust signal, and put it where the agent will see it.** A human skims a "Lightly out of date" badge and adjusts. An agent can be told to run the per-doc explanation before trusting a page, and to treat a stale status as "verify before acting." The signal costs one build step and a few kilobytes per page.
+**Give every doc a machine-readable trust signal, where the agent will see it.** A human skims "Lightly out of date" and adjusts. An agent can be told to run the per-doc explanation before trusting a page, and to treat stale as "verify before acting." It costs one build step and a few kilobytes per page.
-**Let agents do the maintenance, inside guardrails that keep it honest.** On our team the documentation sweeps are run by agents: a queue agent, parallel reviewers with a three-word verdict vocabulary, and a single stamping agent. That works because the guardrails are mechanical. Reviewers must read the exact drifted commits. A verified verdict is as good as an edit, so nobody fakes a change. A dated record cannot be rewritten. A stamp against a commit that does not exist fails the build. Agents are very good at reading 110 docs against 110 sets of commits in an afternoon. They are not good at knowing which docs are history unless something tells them.
+**Let agents do the maintenance, inside guardrails that keep it honest.** Our sweeps work because the guardrails are mechanical: reviewers must read the exact drifted commits, a verified verdict counts as much as an edit so nobody fakes a change, dated records cannot be rewritten, and a stamp against a nonexistent commit fails the build. Agents are very good at reading 110 docs against 110 sets of commits in an afternoon. They are not good at knowing which docs are history unless something tells them.
-The underlying point is older than any of this. A document that cannot tell you whether to trust it is asking for blind trust, and blind trust in a document has always been a bad deal. The new part is that some of the readers now extend blind trust by default. Give them, and your people, a signal that is honest about its own age.
+A document that cannot tell you whether to trust it is asking for blind trust, and that has always been a bad deal. What is new is that some readers now extend blind trust by default. Give them, and your people, a signal that is honest about its own age.
---
## 15. Questions for the group
-If you want to see the moving parts, the [doc freshness reference](https://three.ws/docs/doc-freshness?utm_source=ibm-community) describes the system end to end, the [freshness dashboard](https://three.ws/docs/freshness?utm_source=ibm-community) shows the live ranking with every drifted file and commit, and the [three.ws changelog](https://three.ws/changelog?utm_source=ibm-community) carries the 2026-09-17 entry where this shipped to readers, titled "Documentation that tells you whether to trust it."
+To see the moving parts, the [doc freshness reference](https://three.ws/docs/doc-freshness?utm_source=ibm-community) describes the system end to end, the [live freshness dashboard](https://three.ws/docs/freshness?utm_source=ibm-community) shows every drifted file and commit, and the [three.ws changelog](https://three.ws/changelog?utm_source=ibm-community) carries the 2026-09-17 entry where this shipped to readers, titled "Documentation that tells you whether to trust it."
-I would genuinely like to hear how other teams in this group handle this:
+I would like to hear how other teams here handle this:
-1. **How do you keep agent instruction files true?** If your coding agents read an `AGENTS.md`, a rules file, or a runbook before they act, what checks it, and how often? Have you had an agent follow a stale instruction into a real incident?
-2. **Where does your docs check live relative to your ship path?** We regenerate the signal on every deploy but only enforce the budget on demand, and section 13.7 shows the result. Has anyone made a docs budget a hard deploy gate without it turning into a rubber stamp that everyone raises?
-3. **What do your docs depend on that is not a file?** Environment configuration, infrastructure definitions, third-party API behavior, database schemas: if you have bound docs to any of those, I would love to compare approaches.
+1. **How do you keep agent instruction files true?** If your coding agents read an `AGENTS.md`, a rules file, or a runbook before acting, what checks it, and how often? Has an agent ever followed a stale instruction into a real incident?
+2. **Where does your docs check live relative to your ship path?** We regenerate the signal on every deploy but enforce the budget only on demand, and section 13.7 shows the result. Has anyone made a docs budget a hard deploy gate without it becoming a number everyone just raises?
+3. **What do your docs depend on that is not a file?** Environment configuration, infrastructure definitions, third-party API behavior, schemas: if you have bound docs to any of those, I would love to compare approaches.
-Run the script from section 11 against your own repository and post your stale count and your weirdest false positive. Mine is a doc that went stale because someone added a comment.
+Run the section 11 script against your own repository and post your stale count and your strangest false positive. Mine is a doc that went stale because someone added a comment.
diff --git a/docs/ibm-community-doc-freshness-thread.md b/docs/ibm-community-doc-freshness-thread.md
new file mode 100644
index 000000000..d723e73f6
--- /dev/null
+++ b/docs/ibm-community-doc-freshness-thread.md
@@ -0,0 +1,88 @@
+---
+title: "Your docs are now instructions for AI agents. How do you know which ones to trust?"
+venue: IBM Community, Three.ws User Group (discussion thread)
+account: nich (nich8)
+companion_to: "the group blog post drafted in docs/ibm-community-doc-freshness-post.md (not yet posted; add its URL here once it is live, and link it from the paragraph that mentions the full write-up)"
+status: draft, not yet posted. Post after the companion blog post, so the reference to the full write-up resolves.
+framing_notes: |
+ A self-contained discussion piece, not a link teaser: a reader who never opens the blog
+ still gets the model, one runnable snippet, and the lessons. The affiliation line from
+ docs/ibm.md stays in. Nothing here touches payments, tokens, or any crypto-cluster topic,
+ and IBM had no involvement in the system described. Numbers are dated; re-check them
+ against `npm run check:docs-freshness` and https://three.ws/docs-freshness-summary.json
+ before posting.
+---
+
+# Your docs are now instructions for AI agents. How do you know which ones to trust?
+
+Documentation used to have one kind of reader: a person who could notice that a command failed and go ask someone. On a growing number of teams it now has a second: the AI coding agent. Agents read the README, the runbooks, and the agent instruction file (`AGENTS.md`, `CLAUDE.md`, or whatever your convention is), and they act on what those say.
+
+That changes what a stale doc costs. A human treats an outdated sentence as a hint that something is off. An agent treats it as an instruction.
+
+Our operating file at three.ws says it more bluntly than I can: "agents execute what it says verbatim. A stale line in it does not read as stale, it reads as an instruction, and the cost is a wasted session per drift." The comments in the script that guards that file record real examples. It once described a database migration command as a dry run, while the npm wrapper hardcodes `--apply`, so the "dry run" writes to production immediately. It quoted a scheduled-job count that quietly grew from 89 to 100. It told agents to push to a remote that, on one worktree, did not exist. None of these were dramatic. Each was a small truth that stopped being true, read by a reader that does not second-guess.
+
+So we stopped asking "are our docs good?" and started asking a narrower, answerable question for every doc: **has the code this page describes changed since anyone last checked the page?**
+
+## The idea in a few sentences
+
+A doc already tells you what it is about. It names files, `npm run` commands, and API routes in its own text. Treat every name that resolves to a real source file as a dependency of that doc. Then ask git: was any dependency committed to after the doc was last edited or last reviewed? Code that moved since then is code the page has never been checked against.
+
+You can try the core of it on your own repository right now. This is a portable shell version for a single doc (bash, git, grep; no other dependencies):
+
+```bash
+#!/usr/bin/env bash
+# drift.sh <doc.md>: which files named in this doc changed after it was last edited?
+doc="$1"
+since=$(git log -1 --format=%ct -- "$doc")
+grep -oE '[A-Za-z0-9_./-]+\.(js|mjs|ts|py|go|java|sh|sql|json|ya?ml)' "$doc" | sort -u |
+while read -r f; do
+ git ls-files --error-unmatch "$f" >/dev/null 2>&1 || continue
+ out=$(git log --since="@$((since + 1))" --format=" %h %cs %s" -- "$f")
+ [ -n "$out" ] && printf '%s\n%s\n' "$f" "$out"
+done
+```
+
+Run from the repository root against one of our docs on 2026-10-08, it printed:
+
+```
+$ ./drift.sh docs/avatar-thumbnails.md
+scripts/regenerate-avatar-thumbnails.mjs
+ 309cb37e8 2026-10-01 fix(avatars): give each thumbnail re-render two minutes, so one stuck model cannot stall the regeneration
+src/animation-retarget.js
+ 8561d5c5d 2026-10-03 fix(animation): re-aim limb rest direction so A-pose rigs stop clipping through the torso
+```
+
+That is the reading list for refreshing the page: two commits, with their intent in the subject line. I read the first one. It added a two-minute cap per render, and the doc does not mention it. Nothing the doc says is wrong, but an operator would want that fact. That is the typical shape of drift: not a lie, a missing truth.
+
+Our production version (a Node script that runs over the whole corpus of a little over 800 docs in about two seconds) adds the parts that turn this from a curiosity into something a team can live with:
+
+- **Weight by exclusivity.** Our route config file is named by 72 docs. If all 72 went red every time a route changed, nobody would read the dashboard. So each drifted file counts 1/N, where N is how many docs name it, and a doc is "stale" when the total reaches 1.0: the equivalent of one file only this doc documents having changed.
+- **A second clock for reviews.** Reading a page and finding it correct is real work with no diff. Without a way to record it, people either make cosmetic edits (a lie in the history) or leave permanent false positives (which teach everyone to ignore the signal). A review stamp records who checked the page against which commit, and freshness is measured from the newer of the last edit and the last review. A stamp that names a commit the repository does not have fails the build, because a fictional baseline silently hides real drift.
+- **Records of a moment are exempt.** A dated security review or incident writeup names lots of code and must never be "updated to match." Those are marked as records and never counted as drift. This matters double with agents in the loop: an agent asked to "bring the docs up to date" will happily rewrite an audit unless something tells it the doc is history.
+- **It runs inside the deploy build, before the frontend build.** The report is written into the static assets of the commit being shipped, and every published doc page shows a small badge from it: "Verified against the code," "Lightly out of date," or "The code this page describes has changed," with the number of files that moved and a link to the evidence. You can verify the placement from outside: on 2026-10-08 our live version endpoint and our live freshness report named the same commit.
+
+## What we learned (with numbers)
+
+**The signal is good enough to show readers.** Across three cleanup sweeps, 339 docs the tool flagged as stale were read against the code, and 293 of them needed a correction or an addition: about 86 percent. The errors were the kind people act on: environment variables no code reads, a teardown command that now requires `--force`, a command documented as writing two files when it writes four.
+
+**One generated file can hide half your drift.** A concatenated "all docs" file names nearly every file every other doc names, which doubles every share count and halves every weight. On our repository the same measurement reported 58 stale docs with that aggregate included and 122 with it excluded. Find your aggregates before you trust the numbers.
+
+**Drift comes back on a schedule.** We drove the stale count to zero on 2026-09-18. It was 13 three days later and 64 at the next production deploy. A sweep is maintenance, not a fix. (Our sweeps are run by coding agents in parallel, with a strict verdict vocabulary of edited, verified, or record, and a single agent recording the stamps so parallel writers cannot lose each other's work.)
+
+**A gate that is not in the ship path drifts red.** Our budget check lives in an on-demand gate, not in the deploy pipeline. The badges kept telling readers the truth the whole time, but nothing forced anyone to work the queue, and the deploy shipped with the count far over budget. If drift matters, enforce it where things ship, or schedule the sweep like dependency updates.
+
+**A guard keyed to wording stops guarding when the wording changes.** This one surprised us. The script that checks our agent instruction file has an assertion for the claim "README coverage is 100 percent," and it only fires when the file contains the phrase "is currently 100%." A well-intentioned edit replaced stale counts in that sentence with a command, and the phrase became "is 100%." The assertion silently stopped running. Seven directories later landed without a README while the instruction file claimed 100 percent and the guard printed OK. We found it while writing this up and fixed it the same day: the pattern now tolerates the rewording, and a missing claim is an error rather than a skip. The first run after the fix went red. A check that skips itself when its trigger text is missing fails in a way that looks exactly like success.
+
+## The full write-up
+
+The full write-up on the group blog walks through all of it with real command output and source excerpts: the extraction rules, the weighting, the five statuses (verified, watch, stale, conceptual, record), how a review is recorded against a commit, the time series of our documentation health over ten weeks, the honest limits of git-history staleness (it detects movement rather than wrongness, it cannot see claims that name no file, and committer timestamps are not ancestry), and a zero-dependency Node script you can run on your own repository in an afternoon. If you want to see the live result first, our [docs freshness dashboard](https://three.ws/docs/freshness?utm_source=ibm-community) ranks every doc and shows every drifted file and commit.
+
+## Questions for the group
+
+1. **How do you keep agent instruction files true?** If your coding agents read an `AGENTS.md`, a rules file, or a runbook before acting, what checks it, and how often? Has an agent ever followed a stale instruction into a real incident on your team?
+2. **Would you put a docs budget in the deploy path?** We regenerate the trust signal on every deploy but only enforce the budget on demand, and you can see where that led. Has anyone made documentation drift a hard gate without it turning into a number everyone just raises?
+3. **What do your docs depend on that is not a file?** Environment configuration, infrastructure definitions, third-party API behavior, database schemas. Git history cannot see any of those. If you have bound docs to them some other way, I would love to compare notes.
+
+Run the snippet above against the doc your team trusts most, and post what it finds. I suspect most of us will be surprised.
+
+_three.ws is an IBM Business Partner. The documentation freshness system described here is three.ws's own engineering practice, built on git and Node.js; it is not an IBM product, uses no IBM service, and IBM had no involvement in it._
diff --git a/docs/ibm-community-long-running-mcp-tools-post.md b/docs/ibm-community-long-running-mcp-tools-post.md
index 367979328..30451f3a6 100644
--- a/docs/ibm-community-long-running-mcp-tools-post.md
+++ b/docs/ibm-community-long-running-mcp-tools-post.md
@@ -7,7 +7,7 @@ status: draft, not yet posted
meta_title: "Long-running MCP tools: job handles, check_job and call budgets"
meta_description: "How to build MCP tools that outlive a host's tool-call timeout: job handles, a collector tool, call budgets, submit tickets and honest metadata, with live examples."
slug: long-running-mcp-tools-outlive-the-tool-call
-featured_image: "https://three.ws/api/page-og?v=carbon&s=build&t=Long-running%20MCP%20tools%20that%20outlive%20the%20call&d=Job%20handles%2C%20check_job%2C%20call%20budgets%2C%20and%20honest%20metadata%20from%20the%20three.ws%203D%20Studio%20MCP%20server&p=%2Fdocs%2Fmcp-studio"
+featured_image: "https://three.ws/api/page-og?v=carbon&f=group&s=build&t=Long-running%20MCP%20tools%20that%20outlive%20the%20call&d=Job%20handles%2C%20check_job%2C%20call%20budgets%2C%20and%20honest%20metadata%20from%20the%20three.ws%203D%20Studio%20MCP%20server&p=%2Fdocs%2Fmcp-studio"
framing_notes: |
Every framing rule in docs/ibm.md applies to this draft and must survive any edit:
three.ws is an IBM Business Partner; the /api/ibm/* surfaces and the open-source
@@ -23,9 +23,12 @@ framing_notes: |
carries no payment surface, and the account resources and guided prompts in section
11 are described only through their non-financial members. Keep it that way.
Every response below was captured live on 2026-10-08 against production and trimmed
- only where marked. Canonical URL blank (original post). The featured image card's
- fixed footer reads "Built on IBM watsonx.ai"; the post itself makes no claim that the
- 3D Studio runs on watsonx.ai (section 9 states the prompt director's actual status).
+ only where marked. Canonical URL blank (original post). The featured image is
+ the carbon card with &f=group, whose footer reads "Three.ws User Group" rather than
+ "Built on IBM watsonx.ai" (api/page-og.js, CARBON_FOOTERS); confirm the live card shows
+ that footer before posting, since an older revision ignores the parameter. The post makes
+ no claim that the 3D Studio runs on watsonx.ai (section 9 states the prompt director's
+ actual status).
---
# Long-running MCP tools: how to design a tool that outlives the tool call
@@ -252,7 +255,7 @@ That difference is the most instructive number here. The **first** check that fi
The lessons:
- **A collector may be slow exactly once.** Do the post-processing on the first collection; cache the terminal frame.
-- **Separate "the check failed" from "the job failed."** A check that failed while the job is fine (a timeout, a busy rate bucket, the slow first save-and-score) carries `retryable: true`.
+- **Separate "the check failed" from "the job failed."** A check that failed while the job is fine (a timeout, a busy rate bucket, the slow first save-and-score) carries `retryable: true`. We hit this live in a second run the same day: the first `check_job` on a brass desk lamp reached its 30-second bound and returned `isError` with `retryable: true`, and the next check returned the finished model.
- **Make the one final error say what to do.** An unknown handle:
```bash
diff --git a/docs/ibm-community-long-running-mcp-tools-thread.md b/docs/ibm-community-long-running-mcp-tools-thread.md
new file mode 100644
index 000000000..5eb3458ac
--- /dev/null
+++ b/docs/ibm-community-long-running-mcp-tools-thread.md
@@ -0,0 +1,79 @@
+---
+title: "Long-running MCP tools: what do you do when the work outlives the tool call?"
+venue: IBM Community, Three.ws User Group (discussion thread)
+account: nich (nich8)
+companion_to: docs/ibm-community-long-running-mcp-tools-post.md (the blog post, not yet posted; replace with its community.ibm.com URL once it is live)
+status: draft, not yet posted. Post after the companion blog is live, then link it where the thread says "the full write-up on the group blog"
+framing_notes: |
+ A self-contained discussion piece, not a link teaser: a reader who never opens the blog
+ should still leave with the core pattern, a runnable command, and the main lessons.
+ The affiliation line from docs/ibm.md stays in. Nothing here touches payments, tokens,
+ wallets or other crypto-cluster content; the server discussed is the free 3D Studio
+ MCP endpoint, which has no payment surface. Every number below was measured live on
+ 2026-10-08. Do not claim a watsonx Orchestrate listing or integration: there is none.
+---
+
+# Long-running MCP tools: what do you do when the work outlives the tool call?
+
+Here is a problem I suspect several people in this group have hit, and I would like to compare notes.
+
+An MCP tool call is, in practice, a function call with a timeout. Most tutorials build tools that answer in milliseconds, so the timeout never matters. But plenty of real agent work is slow: batch inference, document processing, a build, a forecast over a long series. Ours is 3D generation, where a text prompt becomes a textured GLB anywhere from about fifteen seconds to several minutes later. ChatGPT ends a tool call still open at 60 seconds. Other hosts wait longer, but none wait forever, and a model mid-turn has a limited budget of tool calls and a user watching.
+
+We shipped the naive version first: submit, poll, return. A fix commit from July records the result. Our generations were taking four to six minutes, our tool waited three, so every call reported "taking longer than expected" while the model quietly finished a few minutes later. We checked twice, and both "failed" jobs were sitting complete in our database after the tool had given up. The user saw a failure, the assistant retried (starting a second job), and we paid for work nobody received.
+
+The reframe that fixed it: **a timeout is a failure of the wait, not of the work.**
+
+## The core pattern
+
+When the wait runs out on work that was accepted, return a **success** result that carries a pollable handle, and publish a second tool that redeems it. You can watch it happen against our free endpoint, no account or key needed:
+
+```bash
+curl -s https://three.ws/api/mcp-chatgpt -H 'content-type: application/json' \
+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"forge_free","arguments":{"prompt":"a small cast-iron teapot with a bamboo handle","tier":"draft"}}}' \
+ | jq '.result.structuredContent'
+```
+
+When I ran it this morning, it answered after 40.16 seconds with this (handle trimmed):
+
+```json
+{
+ "status": "pending",
+ "jobId": "f1.eyJwIjoiZ2NwIiwiayI6bnVsbC...",
+ "pollUrl": "https://three.ws/api/gpt-forge?job=f1.eyJwIjoiZ2NwIiwiayI6bnVsbC...",
+ "stage": "mesh",
+ "etaRemainingSeconds": 14,
+ "prompt": "a small cast-iron teapot with a bamboo handle"
+}
+```
+
+Passing that `jobId` to the `check_job` tool on `https://three.ws/api/mcp-studio` returned the finished model: a real 1.5 MB GLB, with viewer and AR links. The first check took 15.9 seconds and the second took 0.136 seconds. That gap is one of the lessons below.
+
+## What we learned, in the order we learned it
+
+**1. The pending result must not be an error.** If it carries `isError`, the model's instinct is to retry the generator, which is the worst possible next move. Pending is a success that says where the work is.
+
+**2. The collector should be a tool, not a URL.** Our first fix returned only a poll URL. A model inside a host cannot browse. `check_job` makes one probe, never loops, and has exactly three outcomes: done (the same envelope the generator would have returned), still pending (with fresh timing), or failed. Only an unrecognized handle is final, and its message says to start a new generation.
+
+**3. A check that fails is not a job that fails.** Our first collection of a finished job does real work (it copies the model into durable storage and runs a quality gate), so it can be slow. In a second run today, the first check of a brass desk lamp hit its 30-second bound and came back with `retryable: true`; the next check returned the model. Later checks are served from a cached finished frame, which is where the 0.136 seconds comes from. Before that cache existed, every poll of a finished job re-ran the post-processing, 13 to 33 seconds per poll.
+
+**4. Budget against the host, not against the work.** If the host kills the call, you lose the response, including the handle you were about to return. Our ChatGPT surface converts a 40-second budget into one absolute deadline when the call arrives, and every wait inside the call (prompt rewriting, submit, polling) reads that deadline. Why 40 and not 59: a submit is guaranteed an 8-second floor even near the deadline, and the response still has to travel back through the host.
+
+**5. Name the work before you start it.** This was our subtlest bug. Submits themselves were taking up to 42 seconds in production. The client aborted at its deadline, the server finished anyway and created a real job, and nobody ever received its id. The fix is a submit ticket: the client mints an identifier and sends it with the submit, the server records the job under it whether or not anyone is still listening, and a timed-out caller returns the ticket as its handle. It is an idempotency key applied to the start of a long job, and the collector needed no changes.
+
+**6. Put the polling guidance where the model reads it.** The server instructions, the tool descriptions, and above all the result text itself ("call check_job with this job_id in ~14s") all say when to collect. Every number you show a model gets acted on, so we removed one that lied: our remaining-time estimate had been floored at five seconds, and one 12.5-minute job showed "roughly 5s to go" for its final eleven minutes. Past the estimate we now omit it and show real elapsed time.
+
+**7. Annotations are a contract.** We had marked `check_job` read-only and idempotent. It is neither: its first call persists the model. A client deciding what is safe to repeat without asking the user was being told the wrong thing. It is fixed, and a check in our build now compares every tool's annotations with what its handler actually does.
+
+**8. Auth is a property of a server, not a tool.** Our free catalog search lived on a server whose other tools need an account, and that server answers `initialize` with a 401 so clients start sign-in. That is correct MCP authorization, and it also meant our "free, no account" tool was not reachable without an account from any real client. We now serve keyless tools from a server that never challenges.
+
+The full write-up on the group blog walks through all ten patterns with the real code, request and response pairs for every step, the resources and guided-prompt side of MCP, a 150-line Node server you can run to try the pattern yourself, and a section on what IBM documents about remote MCP toolkits in watsonx Orchestrate. Two points from that section belong here too, because they apply to anyone building for Orchestrate: IBM's ADK docs say Orchestrate waits up to 30 seconds for your server's tool list at import, so keep `tools/list` cheap, and that end-of-file errors at execution "usually happen when the server times out or doesn't respond in time," which is exactly the failure a self-imposed budget prevents. We have not tested against an Orchestrate tenant ourselves, and three.ws has no Orchestrate listing or integration.
+
+## Questions for the group
+
+1. **Has anyone replaced polling with push in production?** MCP has progress notifications and resource subscriptions. If you have shipped a long-running tool on a host that honors them, did they let you drop the collector tool, or did you keep it as the fallback for hosts that do not?
+2. **What tool-call limits have you measured?** We designed to ChatGPT's 60 seconds because we observed it. If you build on watsonx Orchestrate, Claude, or another host, what have you seen at execution time, and do you think hosts should advertise their timeout to servers so nobody has to guess?
+3. **How strict should annotations be about bookkeeping writes?** Marking a status check as not read-only is accurate for us, but it may make a careful client ask the user before every check. Would a finer-grained hint help, or is "it writes, so say so" the right rule?
+
+If you are wrapping slow watsonx.ai workloads, or anything else, as MCP tools, I would especially like to hear what broke for you.
+
+_three.ws is an IBM Business Partner. The `/api/ibm/*` surfaces and the open-source `@three-ws/ibm-watsonx-mcp` connector are independent developer tools built on IBM's publicly available Granite models; they are not IBM products and not endorsed by IBM. The 3D Studio MCP server discussed here is a three.ws product._
diff --git a/docs/ibm-community.md b/docs/ibm-community.md
index 46c819eb3..23f01c055 100644
--- a/docs/ibm-community.md
+++ b/docs/ibm-community.md
@@ -200,8 +200,16 @@ A first-run walkthrough of the Forge from a user's perspective, no account, wall
| Draft | Subject |
|---|---|
| [ibm-community-governed-agents-thread.md](./ibm-community-governed-agents-thread.md) | Short companion thread for blog post 7: the four governance decisions in bullets, one runnable Granite Guardian `curl`, and an open question to the group on how they gate agent actions |
+| [ibm-community-any-skeleton-animation-post.md](./ibm-community-any-skeleton-animation-post.md) | Long engineer-facing tutorial on playing one pre-baked clip library (113 curated clips, 3,343 in the full library) on any humanoid rig with no allowlist: bone-name normalization (736 spellings onto 52 canonical joints), the clavicle collision resolved by hierarchy, measured proof that copying rotations fails, the world-delta retarget `q' = L*q*R` derived step by step, the A-pose limb re-aim with before/after tables on six public avatars, hips, units, legs, generated motion as a rest-basis problem, the gates and fallbacks, how "any skeleton" is tested, a standalone three.js implementation verified against production to 0.1 degree, known failure cases, and three questions for the group. IBM appears only in the affiliation line; no crypto content |
+| [ibm-community-any-skeleton-animation-thread.md](./ibm-community-any-skeleton-animation-thread.md) | Self-contained discussion companion: the three ways rigs differ, the `L*q*R` correction with a runnable 20-line snippet and its real output, five lessons, and three questions (names or geometry, where IK belongs, how to validate generated motion). Add the blog URL once the post is live |
+| [ibm-community-long-running-mcp-tools-post.md](./ibm-community-long-running-mcp-tools-post.md) | Long tutorial on MCP tools whose work outlives the host's timeout, using the free 3D Studio server as the worked example: ten patterns (pending results with a signed job handle, `check_job` as a first-class collector, call budgets, submit tickets, polling guidance in tool text, interface-side collection, `structuredContent` as the contract, verified annotations, tiers and refinement, searching the catalog before generating), each with real code, dated history and live JSON-RPC pairs captured 2026-10-08; plus splitting keyless tools from authenticated ones, resources and guided prompts, a checklist table, a runnable 150-line Node server, and IBM's documented remote-MCP toolkit path for watsonx Orchestrate (quoted, untested by us, no listing claimed) |
+| [ibm-community-long-running-mcp-tools-thread.md](./ibm-community-long-running-mcp-tools-thread.md) | Self-contained discussion companion: the job-handle pattern with one runnable `curl` pair against the live server, eight lessons, and three questions on how members handle slow tools across MCP hosts. Add the blog URL once the post is live |
+| [ibm-community-doc-freshness-post.md](./ibm-community-doc-freshness-post.md) | Long tutorial for IBM developers and platform teams on documentation drift detection from git history, framed by coding agents now executing docs as instructions: binding each doc to the files, scripts and routes it names, the five statuses, review stamps tied to a commit, dated records that are never rewritten, the agent-run sweep, why `docs:freshness` runs before the frontend build, the reader badge, ten weeks of measured history, a tested zero-dependency Node script, `audit:docs` and `check:claude`, and eight honest limits including the README-coverage guard that went silent after a rewording (found while writing the post and fixed the same day). No IBM involvement in the feature; no crypto content. Numbers are dated: re-run `npm run check:docs-freshness` before posting |
+| [ibm-community-doc-freshness-thread.md](./ibm-community-doc-freshness-thread.md) | Self-contained discussion companion: why stale docs now cost more, the git-history signal with one runnable shell snippet, concrete lessons including the self-skipping guard, and questions on how members keep agent instruction files true. Add the blog URL once the post is live |
| [ibm-community-defi-3d-sperax.md](./ibm-community-defi-3d-sperax.md) | Written for Jessica to publish in her own voice. Section 0 answers "why is an IBM employee writing about two crypto companies" as her own practitioner case (her field is decision integrity, this is the best material on it she has read) rather than as IBM partnership strategy, which she does not own. Then the triangle of three relationships (Sperax with three.ws, both as IBM Business Partners, and the three.ws runtime on Granite through watsonx.ai) split as body / DeFi domain / brain, with an explicit subsection denying that IBM commissioned or endorsed the integration itself, and framed through her decision-management day job. Section 1 makes DeFi a real subject rather than a backdrop (the four properties that break a chat box, the tool catalog, the approve-before-acting execution model): the two ways to embed an embodied agent in a host application (standalone manifest vs native component), the continuous emotion blend that replaced a state machine, why grounding the avatar in verified reads mattered more than the rendering, honest failure when a probe is bot-challenged, the hash-chained action ledger, the code that moved in both directions, what is planned, and AR flagged as the next surface rather than a shipped one. Carries four diagrams rendered by [scripts/render-ibm-sperax-diagrams.mjs](../scripts/render-ibm-sperax-diagrams.mjs) into [media/](./media), plus [ibm-community-defi-3d-sperax-post.md](./ibm-community-defi-3d-sperax-post.md) and its styled `-post.html` twin, both generated by [scripts/build-ibm-community-post.mjs](../scripts/build-ibm-community-post.mjs) with the frontmatter and editor notes stripped. Edit the draft, never the generated trio. Form values, the permalink slug, the meta description, and the image-placement sequence are in [ibm-community-defi-3d-sperax-publishing-kit.md](./ibm-community-defi-3d-sperax-publishing-kit.md). **Open question before posting:** the draft states that Sperax is also an IBM Business Partner, which came from the owner and is not evidenced anywhere in this repo; confirm the wording Sperax uses for its own partner status first |
+All three long posts use the carbon featured card with `&f=group`, whose footer reads "Three.ws User Group" instead of "Built on IBM watsonx.ai" (that line is only true of watsonx content). The parameter needs the deploy that carries it; confirm the live card before posting. Space the three posts a week apart per the cadence rule, each with its companion thread the same day.
+
The drafts carry the framing rules from [ibm.md](./ibm.md) in their frontmatter, including which section to cut first if the group's no-crypto-cluster rule is applied strictly.
## Keeping this catalog current