Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(city): face exploration avatar toward travel direction, not backward

[._.]/ Adam Eivyfd199cae16d0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 6f0f4ee2f6..a5052ae6d9 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -137,6 +137,8 @@
## Fixed
+- **The CyberCity exploration avatar now faces its direction of travel instead of moonwalking.** The runner is modeled facing +Z (visor, chest core, boot toes) while the player rig's forward convention is −Z, so `root.rotation.y = rig.facing` pointed the model's face 180° opposite to its movement — it walked away from the camera while facing it, and at drop-in faced *away* from the city center despite the "facing downtown" spawn intent. The rig math is internally consistent on the −Z convention, so the fix is a single +π yaw offset where the model meets the rig in `PlayerAvatar.jsx`. (`client/src/components/city/PlayerAvatar.jsx`)
+
- **Deleting a Brain memory imported from ChatGPT now removes its on-disk assets instead of orphaning them.** A `chatgpt-import` memory references an archived conversation transcript (`data/brain/imports/chatgpt/<sourceRef>`) and any number of served image/audio/PDF assets (`data/brain/imports/assets/`, embedded as `![](/data/brain-imports/…)` links in the transcript). Deleting the memory only tombstoned the JSON record, so those files lived on disk forever — repeatedly importing and deleting exports slowly filled the disk with orphans. The Brain service's `deleteMemoryEntry` now cleans up after a successful delete: it removes the 1:1 archived transcript and unlinks every asset the deleted memory referenced that **no surviving import memory still uses** (a ChatGPT `file-service://` id can legitimately recur across conversations, so shared assets are kept). Cleanup is best-effort — an already-missing file is a no-op and an unlink failure is logged, never thrown, so it can't turn a successful delete into an error. (`server/services/brain.js`, `server/services/chatgptImport.js`)
- **Memory cards now show a copyable short id.** Both the Brain memories list (Brain → Memory) and the CoS memories list (Chief of Staff → Memory) render each record's unique id as a click-to-copy badge in the card's metadata row — so you can read an id off the UI and ask the agent about that specific memory by id. The badge shows a short prefix with the full id in its tooltip; clicking copies the full id. (`client/src/components/ui/CopyableId.jsx`, `client/src/components/brain/tabs/MemoryTab.jsx`, `client/src/components/cos/tabs/MemoryTab.jsx`)
diff --git a/client/src/components/city/PlayerAvatar.jsx b/client/src/components/city/PlayerAvatar.jsx
index 26c01a1ce8..64e076cee8 100644
--- a/client/src/components/city/PlayerAvatar.jsx
+++ b/client/src/components/city/PlayerAvatar.jsx
@@ -105,7 +105,11 @@ export default function PlayerAvatar({ rigRef }) {
groundOffsetRef.current += (targetOffset - groundOffsetRef.current) * f;
const bob = state === 'idle' ? Math.sin(t * 1.6) * 0.03 : hovering ? Math.sin(t * 2.2) * 0.06 : 0;
root.position.set(rig.position.x, rig.position.y + groundOffsetRef.current + bob, rig.position.z);
- root.rotation.y = rig.facing;
+ // The avatar geometry is modeled facing +Z (visor/chest/toes at +z, jet vents at -z),
+ // but the rig's forward convention is -Z (rig.facing's 0 points toward -z). Bridge the
+ // model-vs-rig 180° with a +π yaw offset so the runner faces its direction of travel
+ // instead of walking backward toward the camera.
+ root.rotation.y = rig.facing + Math.PI;
root.rotation.z = rig.bank;
// Gait phase advances while moving, settles to neutral at rest.