Files
thejayman77 89c0fbe1f6 Sync repo to deployed state: SEO recovery, Publishing Desk, Play games, emoji picker
The deploy pipeline runs from the working tree, so a wave of shipped features
had never been committed. This snapshots git to what's actually running.

SEO impression recovery (live + verified):
- Duplicate /a/{id} now 301-redirect to their canonical twin instead of 404
  (a hard 404 silently dropped already-indexed URLs and tanked impressions).
- Dedup representative selection reworked: accepted/serveable -> established
  rep (URL stability) -> quality score, so an accepted page never retires to a
  rejected rep and an indexed canonical doesn't churn when a newer twin arrives.
- HEAD /a/{id} returns the same status as GET (api_route GET+HEAD) instead of
  falling through to the static mount and 404ing.
- `dedup --force-recluster`: cycle-locked, model-free re-cluster to re-apply the
  policy to the existing corpus (shared cycle_lock context manager).
- CLI honors GOODNEWS_DB for its default --db (was silently ignored).

Publishing Desk (admin tool to post highlights to X via Web Intents):
- publishing.py queue/rank/handle-resolution; admin UI; full searchable emoji
  picker (bundled data, no CDN) for the blurb editor.

Play games + site:
- Bloom (word-wheel), Memory Match, daily ritual set, Zen Den (dev-gated).
- English-only language gate; source prospecting; paywall + dedup hardening.

Tests: full suite green (349). Ignores tightened (node_modules, data/*.db).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 11:32:27 -04:00

52 lines
2.5 KiB
JavaScript

// Measure the two tail lobes separately. For each of Tail_Fork_Top and
// Tail_Fork_Bottom (subtree), report the vertex centroid + bbox. If the lobes are
// separated in Y → a normal vertical fork (upper/lower). If separated in X →
// a genuine LEFT/RIGHT double tail (two tails side by side), which is what reads
// as "two tails" and is a geometry problem, not a render one.
import { NodeIO } from '@gltf-transform/core';
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
const io = new NodeIO().registerExtensions(ALL_EXTENSIONS);
const doc = await io.read(process.argv[2]);
const root = doc.getRoot();
const joints = root.listSkins()[0].listJoints();
const idxOf = new Map(joints.map((n, i) => [n, i]));
const subtree = (rootName) => {
const set = new Set();
const start = joints.find((n) => n.getName() === rootName);
if (!start) return set;
const mark = (n) => { if (idxOf.has(n)) set.add(idxOf.get(n)); n.listChildren().forEach(mark); };
mark(start);
return set;
};
const topSet = subtree('Tail_Fork_Top');
const botSet = subtree('Tail_Fork_Bottom');
console.log(`Top subtree joints: ${topSet.size}, Bottom subtree joints: ${botSet.size}`);
const mesh = root.listMeshes()[0];
const prim = mesh.listPrimitives().reduce((a, b) => (b.getIndices().getCount() > a.getIndices().getCount() ? b : a));
const pos = prim.getAttribute('POSITION');
const jA = prim.getAttribute('JOINTS_0'), wA = prim.getAttribute('WEIGHTS_0');
const n = pos.getCount();
const acc = { top: mk(), bot: mk() };
function mk() { return { c: 0, sum: [0, 0, 0], min: [1e9, 1e9, 1e9], max: [-1e9, -1e9, -1e9] }; }
function add(e, p) { e.c++; for (let d = 0; d < 3; d++) { e.sum[d] += p[d]; e.min[d] = Math.min(e.min[d], p[d]); e.max[d] = Math.max(e.max[d], p[d]); } }
const p = [0, 0, 0], j = [0, 0, 0, 0], w = [0, 0, 0, 0];
for (let i = 0; i < n; i++) {
jA.getElement(i, j); wA.getElement(i, w);
let top = 0, bot = 0;
for (let k = 0; k < 4; k++) { if (topSet.has(j[k])) top += w[k]; if (botSet.has(j[k])) bot += w[k]; }
if (top < 0.5 && bot < 0.5) continue;
pos.getElement(i, p);
add(top >= bot ? acc.top : acc.bot, p);
}
const f = (x) => x.toFixed(3).padStart(8);
for (const [k, e] of Object.entries(acc)) {
if (!e.c) { console.log(`${k}: (no verts)`); continue; }
const ctr = e.sum.map((s) => s / e.c);
console.log(`${k.padEnd(4)} n=${String(e.c).padStart(4)} centroid[${ctr.map(f).join(',')}] X:[${f(e.min[0])},${f(e.max[0])}] Y:[${f(e.min[1])},${f(e.max[1])}] Z:[${f(e.min[2])},${f(e.max[2])}]`);
}