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.

fix(tests): follow the forge narration, option echo and delivery contract the source now has

nirholasd4a1fb82f160
diff --git a/tests/agent-forge-run.test.js b/tests/agent-forge-run.test.js
index 490784ee2..d213f6855 100644
--- a/tests/agent-forge-run.test.js
+++ b/tests/agent-forge-run.test.js
@@ -19,9 +19,10 @@ import { describe, it, expect } from 'vitest';
import { runForge } from '../workers/agent-forge/forge-run.js';
import { forgeStageNarration } from '../src/shared/forge-frames.js';
-// The narration strings under test are produced by src/shared/forge-frames.js and
-// contain an em-dash. This repo bans that character in authored source, so the
-// expectations name it by code point instead of pasting the glyph.
+// The terminal line src/shared/forge-frames.js produces still carries an
+// em-dash. This repo bans that character in authored source, so the expectation
+// names it by code point instead of pasting the glyph. The in-flight lines
+// moved to a plain "(~Ns left)" suffix, so they are spelled out as-is.
const DASH = '\u2014';
const READY_LINE = `Model ready ${DASH} loading into the cam`;
@@ -112,8 +113,8 @@ describe('runForge poll walk', () => {
expect(result.glbUrl).toBe(GLB);
// queued → running → done; the repeated 'running' poll narrates nothing new.
expect(lines).toEqual([
- `Queued on the TRELLIS lane ${DASH} ~40s`,
- `Building geometry & texturing ${DASH} ~20s`,
+ 'Queued on the TRELLIS lane (~40s left)',
+ 'Building geometry & texturing (~20s left)',
READY_LINE,
]);
expect(fetchImpl.calls[1].url).toBe(`${BASE}/api/forge?job=job-1`);
diff --git a/tests/forge-options.test.js b/tests/forge-options.test.js
index e3e8fcde7..6c38522d1 100644
--- a/tests/forge-options.test.js
+++ b/tests/forge-options.test.js
@@ -114,6 +114,9 @@ describe('summarizeForgeOptions', () => {
output_format: 'glb-draco',
texture_size: 1024,
target_polycount: null,
+ // Material completion is on unless the caller opts out, and the echo
+ // says so, so a client can tell why its delivered file carries maps.
+ derive_pbr: true,
});
});
});
diff --git a/tests/forge-store-materialize.test.js b/tests/forge-store-materialize.test.js
index 1dfa56ffd..18642c834 100644
--- a/tests/forge-store-materialize.test.js
+++ b/tests/forge-store-materialize.test.js
@@ -86,9 +86,11 @@ afterEach(() => {
});
describe('materializeCreation — quality + compression (additive, opt-in)', () => {
- it('defaults run the geometry cleanup pass, shrinking the delivered mesh', async () => {
- // cleanup defaults ON: every forge mesh is raw marching-cubes geometry that
- // dedup/join/weld/simplify improves. quality + compression stay opt-in.
+ it('defaults run geometry cleanup, then material completion, and ship the completed mesh', async () => {
+ // cleanup and derivePbr default ON: every forge mesh is raw marching-cubes
+ // geometry that dedup/join/weld/simplify improves, and a lane bakes albedo
+ // only, so the material pass adds the derived maps a viewer needs. quality
+ // + compression stay opt-in.
stubFetch(FOX_GLB);
const out = await materializeCreation({
replicateJobId: 'job-1',
@@ -98,23 +100,31 @@ describe('materializeCreation — quality + compression (additive, opt-in)', ()
expect(out.glbUrl).toBe(`https://cdn.example.com/forge/client-1/${existingRow.id}.glb`);
expect(out.quality).toBeNull();
expect(out.compression).toBeNull();
- // The cleaned mesh is what ships, and it's smaller than the raw input.
+ // The geometry pass shrank the raw input.
expect(out.cleaned).not.toBeNull();
expect(out.cleaned.tris_after).toBeLessThanOrEqual(out.cleaned.tris_before);
+ expect(out.cleaned.output_bytes).toBeLessThan(FOX_GLB.length);
+ // The material pass then wrote its derived maps onto the cleaned geometry,
+ // so the file grows again by exactly what those maps weigh.
+ expect(out.pbr).not.toBeNull();
+ expect(out.pbr.input_bytes).toBe(out.cleaned.output_bytes);
+ expect(out.pbr.output_bytes).toBeGreaterThan(out.pbr.input_bytes);
+ // What ships is the completed mesh, nothing in between.
const written = putObjectMock.mock.calls[0][0];
- expect(written.body.length).toBeLessThan(FOX_GLB.length);
- expect(written.body.length).toBe(out.cleaned.output_bytes);
+ expect(written.body.length).toBe(out.pbr.output_bytes);
});
- it('cleanup:false delivers the provider bytes verbatim', async () => {
+ it('cleanup:false + derivePbr:false delivers the provider bytes verbatim', async () => {
stubFetch(FOX_GLB);
const out = await materializeCreation({
replicateJobId: 'job-1b',
clientKey: 'client-1',
glbUrl: 'https://provider.example/fox.glb',
cleanup: false,
+ derivePbr: false,
});
expect(out.cleaned).toBeNull();
+ expect(out.pbr).toBeNull();
const written = putObjectMock.mock.calls[0][0];
expect(written.body.length).toBe(FOX_GLB.length);
});