Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .claude/skills/queen-hive-visuals/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: queen-hive-visuals
description: Maintain QUEEN's floating hive, original point-down TRINITY logo, sharp issue displays and matching camera interactions.
---

# QUEEN hive

- Original TRINITY logo: flat top, apex DOWN, exact27 petals/135 edges, inside
the hub hexagon. Never substitute a generic triangle or mirror the mark.
The header SVG and central scene mark must agree on screen orientation.
- The field faces the viewer vertically. Its180-degree turn uses the shared
`queenHiveOrientation.ts` transform: local(x,height,z)→world(-x,z,height).
Camera stays at+Z. Changing camera alpha by pi is a back-side view, not a
half-turn; it reverses horizontal handedness. Do not revive that old patch.
- Match homepage Outfit for prose and JetBrains Mono for technical readouts,
using existing assets/tokens. Keep cells translucent and the viewport fully
filled after resize. Catalog stars require source, epoch, units and license;
the HYG4.1/J2000 projection is not live sky ephemerides or random decoration.
- All input uses the same coordinate convention: inverse ray-plane picking
including wall drift, pan, cursor zoom, Inspect and bounds. Cell lift still
comes toward the viewer. Native issue/epic text and HUD remain upright.
- Preserve original logo geometry in `QueenComb.tsx`, the same repo+issue
identity across polls, exact event joins and canonical GitHub links. Historical
GitHub titles are quoted source; only their individual nodes may be language
exempt, never controls or whole cards.
- Honey is hover/focus feedback. T27-yellow needs real coverage provenance;
red needs evidence of manual code. Missing issue→module proof is UNKNOWN,
not completed/generated code. Do not invent events or worker throughput.

Before changing orientation, add a failing projection/interaction regression.
Run `npm run check:queen-displays` in `apps/website` (includes Babylon projection
and roundtrip tests), the affected regressions and build. Inspect the actual
logo and cards on desktop/mobile, reduced-motion, and test tap, pan and zoom.
Do not treat a data attribute or old screenshot as proof. Production publication
requires explicit user authority and the existing site release checks.
2 changes: 2 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"check:queen-review": "node qa/queen-review-lifecycle-contract.mjs",
"check:queen-viewport": "node qa/queen-viewport-contract.mjs",
"check:queen-honesty": "node --experimental-strip-types qa/queen-honesty-contract.mjs",
"check:queen-coverage": "node --experimental-strip-types qa/queen-coverage-contract.mjs",
"check:queen-displays": "node --experimental-strip-types qa/queen-hive-display-contract.mjs",
"check:queen-dead-api": "node qa/queen-viewport-contract.mjs --dead-api",
"check:queen-touch": "node qa/queen-touch-contract.mjs",
"check:queen-round": "node qa/queen-round-contract.mjs",
Expand Down
69 changes: 69 additions & 0 deletions apps/website/qa/queen-coverage-contract.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import * as hud from "../src/components/queenHud.ts";

let checks = 0;
const failures = [];
function check(label, run) {
checks++;
try { run(); } catch (error) { failures.push(`${label}: ${error.message}`); }
}
const cover = hud.hiveCoverOf;
for (const path of ["rings/t27", "rings/t27-compiler", "specs", "specs/auth", "tests/t27/parser"]) {
check(`no yellow inferred from ${path}`, () => assert.notEqual(cover(path, new Set()), "t27"));
}
check("basename is not a claim on another path", () => assert.notEqual(cover("other/auth", new Set(["auth"])), "t27"));
check("punctuation is identity", () => assert.notEqual(cover("a/b-c", new Set(["abc"])), "t27"));
check("exact path is a claim", () => assert.equal(cover("agent-server/auth", new Set(["agent-server/auth"])), "t27"));
check("unknown corpus is not manual code", () => assert.equal(cover("rings/t27", null), "unknown"));
check("empty cell awaits a boundary", () => assert.equal(cover(null, null), "awaiting"));
check("known corpus without a claim is migration debt", () => assert.equal(cover("manual", new Set()), "manual"));

const manifest = {
coverageSchemaVersion: 1,
repos: [{ repo: "trios", commit: "abcdef1" }, { repo: "trinity", commit: "abcdef2" }],
specs: [
{ repo: "trios", module: "DisplayLabel", modulePath: "agent-server/auth", name: "OtherModule", path: "trios/specs/auth.t27" },
{ repo: "trinity", modulePath: "foreign", path: "trinity/specs/foreign.t27" },
],
};
const build = hud.hiveCoverageFromManifest;
check("manifest parsing is a testable production function", () => assert.equal(typeof build, "function"));
if (build) {
check("only exact module claims from the displayed repository", () => assert.deepEqual([...build(manifest, "gHashTag/trios")], ["agent-server/auth"]));
check("repository changes do not retain old claims", () => assert.deepEqual([...build(manifest, "gHashTag/trinity")], ["foreign"]));
for (const repo of [null, 17, "gHashTag/missing", "another-owner/trios"]) {
check(`unknown repository ${repo}`, () => assert.equal(build(manifest, repo), null));
}
for (const bad of [null, {}, { repos: manifest.repos }, { repos: manifest.repos, specs: [null] }]) {
check(`invalid manifest ${JSON.stringify(bad)}`, () => assert.equal(build(bad, "gHashTag/trios"), null));
}
check("known empty corpus is distinct from unknown", () => assert.equal(build({ ...manifest, specs: [] }, "gHashTag/trios").size, 0));
check("legacy module labels are not explicit path claims", () => {
assert.equal(build({ repos: manifest.repos, specs: [{ repo: "trios", module: "auth", path: "trios/specs/unrelated.t27" }] }, "gHashTag/trios"), null);
assert.equal(cover("DisplayLabel", build(manifest, "gHashTag/trios")), "manual");
});
check("primary t27 corpus has unprefixed source paths", () => {
const primary = { coverageSchemaVersion: 1, repos: [{ repo: "t27", commit: "abcdef1" }], specs: [{ repo: "t27", modulePath: "compiler/auth", path: "specs/auth.t27" }] };
assert.deepEqual([...build(primary, "gHashTag/t27")], ["compiler/auth"]);
});
check("versioned claims cannot omit the path mapping", () => assert.equal(build({ ...manifest, specs: [{ repo: "trios", module: "auth", path: "trios/specs/auth.t27" }] }, "gHashTag/trios"), null));
for (const path of ["trios/../trinity/specs/foreign.t27", "trios//auth.t27", "trinity/specs/auth.t27", "trios/notes.md"]) {
check(`invalid claim source ${path} is unknown`, () => assert.equal(build({ ...manifest, specs: [{ repo: "trios", modulePath: "auth", path }] }, "gHashTag/trios"), null));
}
check("unversioned corpus remains unknown", () => assert.equal(build({ ...manifest, repos: [{ repo: "trios" }] }, "gHashTag/trios"), null));
check("case and traversal cannot alias another module", () => {
const paths = ["../auth", "agent//auth", "/agent/auth", "agent/./auth", "agent/../auth", "agent\\auth"];
for (const modulePath of paths) assert.equal(build({ ...manifest, specs: [{ repo: "trios", modulePath, path: "trios/specs/x.t27" }] }, "gHashTag/trios"), null);
assert.equal(cover("Agent-Server/auth", build(manifest, "gHashTag/trios")), "manual");
});
check("display name does not claim a module", () => assert.equal(cover("OtherModule", build(manifest, "gHashTag/trios")), "manual"));
const actual = JSON.parse(readFileSync(new URL("../public/t27/manifest.json", import.meta.url), "utf8"));
const modules = JSON.parse(readFileSync(new URL("../public/queen/modules.json", import.meta.url), "utf8"));
check("current snapshot has no corpus and cannot claim yellow", () => {
assert.equal(build(actual, modules.repo), null);
assert.ok(modules.modules.every(m => cover(m.path, build(actual, modules.repo)) === "unknown"));
});
}
if (failures.length) { console.error(failures.join("\n")); console.error(`Hive coverage: FAIL (${failures.length}/${checks})`); process.exit(1); }
console.log(`Hive coverage: PASS (${checks} checks)`);
58 changes: 58 additions & 0 deletions apps/website/qa/queen-hive-display-contract.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
await import('./queen-hive-orientation.mjs');
await import('./queen-starfield-contract.mjs');
let h;
try { h = await import('../src/components/queenHiveDisplay.ts'); }
catch { console.error('RED: issue display model does not exist; close-up is still capped at8x and uses256px cards'); process.exit(1); }
const repo='gHashTag/trios';
const old={repo,closedIssues:[{number:7,title:'old title',closedAt:'2026-01-01T00:00:00Z',labels:[]}],epics:[{number:8,title:'Epic',state:'open',closedAt:null,labels:[],children:[{number:7,title:'Child',state:'closed',closedAt:'2026-01-01T00:00:00Z'}]}]};
const board=[{number:7,title:'Reopened',column:'running'},{number:9,title:'Live issue',column:'review'}];
const rows=h.hiveDisplayRecords(repo,board,old);
assert.equal(rows.length,3);
assert.equal(rows.find(r=>r.number===7).state,'running');
assert.equal(rows.find(r=>r.number===7).title,'Reopened');
assert.equal(rows.find(r=>r.number===7).closedAt,null);
assert.equal(rows.find(r=>r.number===8).kind,'epic');
assert.ok(rows.every(r=>r.coverage==='unknown'), 'issue closure/position never proves T27 coverage');
assert.equal(h.hiveSameRepositorySnapshot(repo,old),old);
assert.equal(h.hiveSameRepositorySnapshot(repo,{...old,repo:'gHashTag/trinity'}),null);
assert.equal(h.hiveSameRepositorySnapshot(repo,{...old,repo:undefined}),null);
assert.equal(h.hiveSameRepositorySnapshot(null,old),null);
assert.equal(h.hiveDisplayRecords(repo,[],{...old,repo:'gHashTag/trinity'}).length,0);
assert.equal(h.hiveDisplayRecords('javascript:evil',board,old).length,0);
const p=h.placeHiveDisplays(new Map(),rows,37);
const p2=h.placeHiveDisplays(p.ledger,[{...rows[0],number:999,key:`${repo}#999`},...rows].reverse(),37);
assert.equal(p.placed[0],null);
for(const r of rows) assert.equal(p2.ledger.get(r.key),p.ledger.get(r.key));
const e=(issue,id,at='2026-09-07T00:00:00Z')=>({issue,id,at,kind:'review',title:'same unrelated path',state:'wait'});
const events=[e(7,'a'),e(9,'b'),e(7,'a'),e(7,'bad','invalid')];
assert.deepEqual(h.hiveDisplayEvents(rows.find(r=>r.number===7),events).map(e=>e.id),['a']);
assert.equal(h.hiveDisplayEvents(rows.find(r=>r.number===8),events)[0].issue,7);
assert.equal(h.hiveDisplayEvents(rows.find(r=>r.number===9),[]).length,0);
assert.deepEqual(h.hiveDisplayEvents(rows[0],[e(7,'z-finished'),e(7,'a-dispatched')]).map(e=>e.id),['z-finished','a-dispatched'],'same-second ties preserve wire order, not alphabetical id order');
assert.deepEqual(h.hiveEpicProgress(rows.find(r=>r.number===8),rows),{done:0,total:1});
assert.equal(h.hiveDisplayLod(20),'overview');
assert.equal(h.hiveDisplayLod(75),'badge');
assert.equal(h.hiveDisplayLod(170),'title');
assert.equal(h.hiveDisplayLod(340),'detail');
assert.ok(h.hiveFocusZoom(10,390,650)>8);
assert.ok(h.hiveFocusZoom(10,390,650)<=128);
assert.equal(h.hiveFocusZoom(0,390,650),1);
assert.equal(h.hiveIssueUrl(repo,7),'https://github.com/gHashTag/trios/issues/7');
assert.equal(h.hiveIssueUrl('evil.example/a',NaN),null);
const scene=readFileSync(new URL('../src/components/QueenCombBabylon.tsx',import.meta.url),'utf8');
const page=readFileSync(new URL('../src/pages/Queen.tsx',import.meta.url),'utf8');
const cards=readFileSync(new URL('../src/components/QueenHiveDisplays.tsx',import.meta.url),'utf8');
assert.match(cards, /<option[^>]*data-lang-exempt="github-title"[^>]*>[^<]*\{row.title\}/, 'quoted option titles retain the existing source-language boundary');
assert.match(cards, /<h3 data-lang-exempt="github-title"[^>]*>\{row.title\}<\/h3>/, 'close-up source title is not mistranslated');
assert.doesNotMatch(cards, /<(?:article|select|button|div)[^>]*data-lang-exempt/, 'UI controls and card chrome remain audited');
assert.match(cards, /title=\{c.sourceTitle\}/, 'source-language explanation is localized');
assert.match(scene,/displaysRef.current\[i\]\?\.coverage \?\? 'awaiting'/,'issue coverage cannot use colocated module');
assert.match(scene,/\(displays \|\| t27Coverage === null\) && <span data-law="unknown"/,'issue overview stays unknown even with a known module corpus');
assert.match(scene,/const fallback = displaysRef.current \? undefined : running\[busyRank\]/,'unmapped Bee never falls back to module cells');
assert.match(scene,/const issue = displaysRef.current \? displaysRef.current\[i\] : fCells\?\.\[i\]/,'empty display never inherits historical identity');
assert.match(scene,/if \(displaysRef.current && index !== home\)/,'empty issue click has no legacy fallback');
assert.match(page,/const hiveFoundation = hiveSameRepositorySnapshot\(repo, foundationState.data\)/);
assert.match(page,/foundation=\{hiveFoundation \?/,'scene only receives repository-scoped foundation');
console.log('Hive display contract: PASS (identity, stable placement, exact events, epic counts, semantic zoom, URL safety)');
34 changes: 34 additions & 0 deletions apps/website/qa/queen-hive-orientation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { Matrix, Vector3 } from '@babylonjs/core/Maths/math.vector.js';
import { HIVE_WALL_ROTATION, hiveWallToWorld, hiveWorldToWall } from '../src/components/queenHiveOrientation.ts';

const close = (a,b) => assert.ok(Math.abs(a-b)<1e-5, `${a} != ${b}`);
const rotation = Matrix.RotationYawPitchRoll(HIVE_WALL_ROTATION.y,HIVE_WALL_ROTATION.x,HIVE_WALL_ROTATION.z);
const view = Matrix.LookAtLH(new Vector3(0,0,4000),Vector3.Zero(),Vector3.Up());
const screen = (x,z,height=0) => {
const p=Vector3.TransformCoordinates(new Vector3(x,height,z),rotation.multiply(view));
return {x:p.x,y:-p.y,depth:p.z};
};
// Screen axes retain the source handedness after the true half-turn.
assert.ok(screen(100,0).x>screen(0,0).x, 'local right must project right, not mirrored');
assert.ok(screen(0,100).y<screen(0,0).y, 'positive local z is above the hub after the turn');
assert.ok(screen(0,0,8).depth<screen(0,0).depth, 'hover lift remains toward the camera');
// The mark uses source SVG x/y with local z=-svgY. Base above, apex below.
const baseLeft=screen(-.5,Math.sqrt(3)/6),baseRight=screen(.5,Math.sqrt(3)/6);
const apex=screen(0,-Math.sqrt(3)/3);
assert.ok(apex.y>baseLeft.y && apex.y>baseRight.y, 'original logo apex points DOWN');
assert.ok(baseLeft.x<baseRight.x, 'original logo must not be mirrored');
for (const [x,z] of [[0,0],[123,-87],[-400,222]]) {
const expected=Vector3.TransformCoordinates(new Vector3(x,0,z),rotation);
const world=hiveWallToWorld(x,z); close(world.x,expected.x); close(world.y,expected.y);
const local=hiveWorldToWall(world.x,world.y+7,7); close(local.x,x); close(local.z,z);
}
const scene=readFileSync(new URL('../src/components/QueenCombBabylon.tsx',import.meta.url),'utf8');
assert.match(scene,/fieldRoot.rotation.copyFromFloats\(HIVE_WALL_ROTATION.x, HIVE_WALL_ROTATION.y, HIVE_WALL_ROTATION.z\)/);
assert.match(scene,/return hiveWorldToWall\(wx, wy, fieldRoot.position.y\)/, 'picking uses inverse including wall drift');
assert.match(scene,/hiveWallToWorld\(cells\[focusIndex\].x, cells\[focusIndex\].y\)/, 'inspect targets the rotated cell');
assert.match(scene,/hiveWallToWorld\(anchor.x, anchor.z\)/, 'cursor zoom targets the rotated cell');
assert.match(scene,/cells\[home\].y - ay \* k/, 'original SVG coordinates remain unchanged');
assert.match(scene,/new ArcRotateCamera\("cam", Math.PI \/ 2, Math.PI \/ 2/, 'camera stays in front');
console.log('Hive orientation: PASS (point-down logo, handedness, lift, inverse picking, focus, zoom)');
Loading
Loading