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

test: stop three suites depending on the wall clock and the live track registry

[._.]/ Adam Eivy15ca915acee7
diff --git a/server/routes/sprites.test.js b/server/routes/sprites.test.js
index 33e823bfd7..d6d11505c1 100644
--- a/server/routes/sprites.test.js
+++ b/server/routes/sprites.test.js
@@ -650,18 +650,28 @@ describe('sprites routes', () => {
const r = await request(app).get('/api/sprites/pioneer');
expect(r.body.walk).toEqual({ runs: [], selection: null, walkSet: null });
expect(walk.getWalkState).toHaveBeenCalledWith('pioneer');
- expect(r.body.trackDefinitions.map(({ id }) => id)).toEqual(['walk', 'scanner']);
+ // This route resolves the LIVE registry, which since #3152 also holds
+ // whatever tracks the operator authored — so assert the kind gate and the
+ // keyed-by-id contract, not a snapshot of one install's track list. (Pinning
+ // the exact array asserted that the developer running the suite had authored
+ // no character tracks, and went red the day one did.)
+ const characterTracks = r.body.trackDefinitions.map(({ id }) => id);
+ expect(characterTracks).toEqual(expect.arrayContaining(['walk', 'scanner']));
+ expect(characterTracks).not.toContain('ambient');
+ expect(characterTracks[0]).toBe('walk');
expect(r.body.trackDefinitions[0]).toMatchObject({
id: 'walk',
contractFrameCountField: 'walkFrameCount',
standaloneContract: true,
});
expect(r.body.atlas.current.geometry.walkFrameCount).toBe(3);
- // A character carries scanner but NOT ambient, so only scanner is keyed —
- // and each state passes through with the `definition` (registry row) the
- // service resolved, so the client renders the track's label/bounds from data
- // rather than mirroring them.
- expect(Object.keys(r.body.tracks)).toEqual(['scanner']);
+ // A character carries scanner but NOT ambient, and `tracks` keys EVERY
+ // non-walk track the kind carries by id — that equality is the contract, and
+ // it holds whatever the registry contains. Each state passes through with the
+ // `definition` (registry row) the service resolved, so the client renders the
+ // track's label/bounds from data rather than mirroring them.
+ expect(Object.keys(r.body.tracks)).toEqual(characterTracks.filter((id) => id !== 'walk'));
+ expect(Object.keys(r.body.tracks)).toContain('scanner');
expect(r.body.tracks.scanner).toMatchObject({
track: 'scanner', runs: [], selection: null, set: null,
definition: { id: 'scanner', directional: true },
@@ -675,8 +685,11 @@ describe('sprites routes', () => {
// A props family has no gait, so no walk — and ambient, not scanner. The
// whole point of keying by id: neither kind needs a route-level branch.
expect(props.body.walk).toBeNull();
- expect(props.body.trackDefinitions.map(({ id }) => id)).toEqual(['ambient']);
- expect(Object.keys(props.body.tracks)).toEqual(['ambient']);
+ const propsTracks = props.body.trackDefinitions.map(({ id }) => id);
+ expect(propsTracks).toContain('ambient');
+ expect(propsTracks).not.toContain('walk');
+ expect(propsTracks).not.toContain('scanner');
+ expect(Object.keys(props.body.tracks)).toEqual(propsTracks);
expect(props.body.tracks.ambient).toMatchObject({
track: 'ambient', definition: { id: 'ambient', directional: false },
});
diff --git a/server/services/layeredIntelligenceOutcomes.test.js b/server/services/layeredIntelligenceOutcomes.test.js
index 666fef57f6..9097369f42 100644
--- a/server/services/layeredIntelligenceOutcomes.test.js
+++ b/server/services/layeredIntelligenceOutcomes.test.js
@@ -15,12 +15,24 @@ import {
} from './layeredIntelligenceOutcomes.js';
import { computeExecutionByDomain } from './layeredIntelligence.js';
+// The suite's frozen "today". The reconcile fixtures below close their issues on
+// absolute dates (`closedAt: '2026-07-01T00:00:00Z'` and friends), while the
+// assertions read them back through `listOutcomes()` with no explicit `now` — so
+// the GC measures those fixtures against the real wall clock. That is a time
+// bomb: OUTCOME_RETENTION_MS is 30 days, so on 2026-07-31 every fixture closed on
+// 2026-07-01 aged out mid-suite and 20 tests began failing on a tree nobody had
+// touched. Freezing Date pins the fixtures inside the retention window forever.
+// Only Date is faked — the store's write queue runs on real timers.
+const SUITE_NOW = '2026-07-20T00:00:00Z';
+
// Build an isolated store over a temp dir so the suite never touches the real
// data/cos/li-outcomes collection. The store functions all take an injectable
// `store` param exactly so tests can drive them without PATHS.cos.
let dir;
let store;
beforeEach(async () => {
+ vi.useFakeTimers({ toFake: ['Date'] });
+ vi.setSystemTime(new Date(SUITE_NOW));
dir = await mkdtemp(join(tmpdir(), 'li-outcomes-'));
store = createCollectionStore({
dir,
@@ -30,6 +42,7 @@ beforeEach(async () => {
});
});
afterEach(async () => {
+ vi.useRealTimers();
await rm(dir, { recursive: true, force: true });
});
diff --git a/server/services/sprites/animationTracks.test.js b/server/services/sprites/animationTracks.test.js
index d41ab6d40b..ccdace0aea 100644
--- a/server/services/sprites/animationTracks.test.js
+++ b/server/services/sprites/animationTracks.test.js
@@ -26,7 +26,9 @@ import {
assertAnimationTrackRows, trackRowCount, tracksForKind, kindSupportsTrack,
sourceReferenceFor, primaryTrackForKind,
} from './animationTracks.js';
-import { getEffectiveAnimationTracks, getEffectiveAnimationTrackIds } from './animationTrackStore.js';
+import {
+ getEffectiveAnimationTracks, getEffectiveAnimationTrackIds, animationTrackSeedPath,
+} from './animationTrackStore.js';
import { SPRITE_RECORD_KINDS } from './recordsLogic.js';
import { AMBIENT_TRACK_ROW } from './spriteTestFixtures.js';
import {
@@ -42,12 +44,28 @@ import {
const SPRITES_DIR = dirname(fileURLToPath(import.meta.url));
const SERVER_DIR = dirname(dirname(SPRITES_DIR));
-// The merged table this install actually serves — compiled `walk` plus the seeded
-// store rows. Resolved once: the store caches its read, so every call in this file
-// sees one consistent table.
+// The merged table this install actually serves — compiled `walk` plus the store
+// rows, which on a machine that has authored its own tracks includes those too.
+// Resolved once: the store caches its read, so every call in this file sees one
+// consistent table. Use this for assertions about the SHAPE of whatever rows
+// exist (a hand-authored row must satisfy the same guards a seeded one does).
const EFFECTIVE = getEffectiveAnimationTracks();
const effectiveTrack = (id) => getAnimationTrack(id, EFFECTIVE);
+// The table a FRESH install serves — compiled `walk` plus `data.reference`'s seed,
+// with no user-authored rows. Use this for assertions that enumerate the exact
+// shipped set: against EFFECTIVE they assert that the developer running the suite
+// has authored no tracks of their own, which is not a property of this repo (#3152
+// exists to let them). One such assertion did read EFFECTIVE and turned red the
+// day a character track was added on the machine running it.
+const SHIPPED = Object.freeze({
+ ...ANIMATION_TRACKS,
+ ...Object.fromEntries(
+ (JSON.parse(readFileSync(animationTrackSeedPath(), 'utf-8')).tracks || [])
+ .map((row) => [row.id, Object.freeze({ ...row, builtin: false })]),
+ ),
+});
+
describe('the registry rows', () => {
it('reproduces the walk track\'s historical bounds and defaults exactly', () => {
// #3015 is a refactor — walk behaves identically end to end.
@@ -369,9 +387,11 @@ describe('directionality and record-kind support (#3017)', () => {
});
it('admits ambient loops for non-character sprite kinds', () => {
- expect(tracksForKind('character', EFFECTIVE).map((r) => r.id)).toEqual([WALK_TRACK, SCANNER_TRACK]);
+ // SHIPPED, not EFFECTIVE: this names the exact set a fresh install carries,
+ // so a track the developer authored locally must not appear in it.
+ expect(tracksForKind('character', SHIPPED).map((r) => r.id)).toEqual([WALK_TRACK, SCANNER_TRACK]);
for (const kind of ['place', 'object', 'props']) {
- expect(tracksForKind(kind, EFFECTIVE).map((r) => r.id), `${kind} carries the ambient loop`).toEqual([AMBIENT_TRACK]);
+ expect(tracksForKind(kind, SHIPPED).map((r) => r.id), `${kind} carries the ambient loop`).toEqual([AMBIENT_TRACK]);
}
});