The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
test(studios): reach full viewer and native renderer coverage with captured previews
Deec33ddd9582ea
diff --git a/cli/src/dsh/studios.integration.spec.ts b/cli/src/dsh/studios.integration.spec.tsindex bbce16684..73b8c908f 100644--- a/cli/src/dsh/studios.integration.spec.ts+++ b/cli/src/dsh/studios.integration.spec.ts@@ -1,6 +1,7 @@// Explicit opt-in: these checks run the real package installers and native local simulations.// All index entries and workspaces stay in disposable directories.import { afterAll, beforeAll, describe, expect, it } from 'vitest'+import { execFileSync } from 'node:child_process'import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs'import { join } from 'node:path'import { tmpdir } from 'node:os'@@ -32,7 +33,7 @@ describe.runIf(process.env.HARNESS_STUDIO_INTEGRATION === '1')('specialist studiawait manager?.stopAll()const output = join(store, 'viewers/studio-viewer/test-results')mkdirSync(output, { recursive: true })- writeFileSync(join(output, 'lifecycle-report.json'), JSON.stringify(report, null, 2))+ if (report.length) writeFileSync(join(output, 'lifecycle-report.json'), JSON.stringify(report, null, 2))env.DSH_DIR = savedRootinvalidateInstalledDsh()if (root) rmSync(root, { recursive: true, force: true })@@ -83,4 +84,28 @@ describe.runIf(process.env.HARNESS_STUDIO_INTEGRATION === '1')('specialist studireport.push({ name, checks: ['install', 'setup', 'doctor', 'index', 'materialize', 'skill discovery', 'verdict','viewer launch', 'run', 'artifact downloads', 'stop', 'idempotent materialization', 'restore', 'remove'] })}, 900_000)+ it.runIf(process.env.HARNESS_STUDIO_FRESH_INSTALL === '1')('clean sparse install fetches the package and its viewer from the pushed branch', async () => {+ expect(removeDsh('autonomous/studio-viewer')).toEqual({ ok: true })+ const source = process.env.HARNESS_STUDIO_INSTALL_SOURCE ?? 'https://github.com/autonomous-ai/openharness.git'+ const ref = process.env.HARNESS_STUDIO_INSTALL_REF ?? execFileSync('git', ['rev-parse', 'HEAD'], { cwd: store, encoding: 'utf8' }).trim()+ const result = await installDsh({ source, ref, path: 'store/agents/ableton-ai', expectedId: 'autonomous/ableton-ai',+ registry: id => id === 'autonomous/studio-viewer' ? { id, kind: 'viewer', name: 'Studio Viewer', repo: source, ref,+ path: 'store/viewers/studio-viewer', tier: 2 } : undefined })+ expect(result.ok, JSON.stringify(result)).toBe(true)+ if (!result.ok) return+ expect(result.installed.linked).toBe(false)+ expect(installedDsh('autonomous/studio-viewer')?.linked).toBe(false)+ const workspace = join(root, 'fresh music workspace')+ mkdirSync(workspace)+ expect((await materializeWorkspace(result.installed, workspace)).warnings).toEqual([])+ await manager.start('fresh', result.installed, workspace)+ const state = await (await fetch(`${manager.url('fresh')}api/state`)).json()+ expect(state.result.engine).toBe('Local MIDI + synthesized audio')+ expect(state.result.artifacts).toHaveLength(3)+ await manager.stop('fresh')+ const output = join(store, 'viewers/studio-viewer/test-results')+ writeFileSync(join(output, 'fresh-install-report.json'), JSON.stringify({ status: 'passed', source, ref,+ commit: result.installed.commit, package: result.installed.id, viewer: 'autonomous/studio-viewer',+ checks: ['sparse clone', 'locked dependencies', 'upstream fetch', 'viewer dependency install', 'doctor', 'materialize', 'viewer launch', 'real artifacts'] }, null, 2))+ }, 600_000)})diff --git a/store/agents/ableton-ai/README.md b/store/agents/ableton-ai/README.mdindex 9ce83d092..1350d316c 100644--- a/store/agents/ableton-ai/README.md+++ b/store/agents/ableton-ai/README.md@@ -2,6 +2,8 @@A small pattern can become a whole mood. Make a loop, play with its pulse, and keep the happy accidents.++```shharness dsh install autonomous/ableton-ai```diff --git a/store/agents/ableton-ai/screenshots/narrow.png b/store/agents/ableton-ai/screenshots/narrow.pngnew file mode 100644index 000000000..0a62057c2Binary files /dev/null and b/store/agents/ableton-ai/screenshots/narrow.png differdiff --git a/store/agents/ableton-ai/screenshots/studio.png b/store/agents/ableton-ai/screenshots/studio.pngnew file mode 100644index 000000000..40028c59fBinary files /dev/null and b/store/agents/ableton-ai/screenshots/studio.png differdiff --git a/store/agents/autoresearch-mlx/README.md b/store/agents/autoresearch-mlx/README.mdindex 5859a2fbc..1becf13d7 100644--- a/store/agents/autoresearch-mlx/README.md+++ b/store/agents/autoresearch-mlx/README.md@@ -2,6 +2,8 @@Follow a small idea through a real experiment. Train, compare, and see what the evidence says.++```shharness dsh install autonomous/autoresearch-mlx```diff --git a/store/agents/autoresearch-mlx/screenshots/narrow.png b/store/agents/autoresearch-mlx/screenshots/narrow.pngnew file mode 100644index 000000000..7ff4c0f99Binary files /dev/null and b/store/agents/autoresearch-mlx/screenshots/narrow.png differdiff --git a/store/agents/autoresearch-mlx/screenshots/studio.png b/store/agents/autoresearch-mlx/screenshots/studio.pngnew file mode 100644index 000000000..e89f04610Binary files /dev/null and b/store/agents/autoresearch-mlx/screenshots/studio.png differdiff --git a/store/agents/bonsai-mcp/README.md b/store/agents/bonsai-mcp/README.mdindex e7e7466b8..b6c155982 100644--- a/store/agents/bonsai-mcp/README.md+++ b/store/agents/bonsai-mcp/README.md@@ -2,6 +2,8 @@Make room for a new idea. Shape a small building, inspect its spaces, and open the real IFC model anywhere.++```shharness dsh install autonomous/bonsai-mcp```diff --git a/store/agents/bonsai-mcp/screenshots/narrow.png b/store/agents/bonsai-mcp/screenshots/narrow.pngnew file mode 100644index 000000000..730b2b39dBinary files /dev/null and b/store/agents/bonsai-mcp/screenshots/narrow.png differdiff --git a/store/agents/bonsai-mcp/screenshots/studio.png b/store/agents/bonsai-mcp/screenshots/studio.pngnew file mode 100644index 000000000..c18d655cdBinary files /dev/null and b/store/agents/bonsai-mcp/screenshots/studio.png differdiff --git a/store/agents/comfy-mcp/README.md b/store/agents/comfy-mcp/README.mdindex 16112995e..ff51eeb92 100644--- a/store/agents/comfy-mcp/README.md+++ b/store/agents/comfy-mcp/README.md@@ -2,6 +2,8 @@Follow a visual thread. Explore a family of forms, collect your favourites, and keep the recipe with every image.++```shharness dsh install autonomous/comfy-mcp```diff --git a/store/agents/comfy-mcp/screenshots/narrow.png b/store/agents/comfy-mcp/screenshots/narrow.pngnew file mode 100644index 000000000..53a4b7e91Binary files /dev/null and b/store/agents/comfy-mcp/screenshots/narrow.png differdiff --git a/store/agents/comfy-mcp/screenshots/studio.png b/store/agents/comfy-mcp/screenshots/studio.pngnew file mode 100644index 000000000..dd5703d43Binary files /dev/null and b/store/agents/comfy-mcp/screenshots/studio.png differdiff --git a/store/agents/dimos/README.md b/store/agents/dimos/README.mdindex 296f704dd..bb6357ff5 100644--- a/store/agents/dimos/README.md+++ b/store/agents/dimos/README.md@@ -2,6 +2,8 @@Send a little rover on a small adventure. Pick a destination, watch it find a way, and replay the journey.++```shharness dsh install autonomous/dimos```diff --git a/store/agents/dimos/screenshots/narrow.png b/store/agents/dimos/screenshots/narrow.pngnew file mode 100644index 000000000..2774d7520Binary files /dev/null and b/store/agents/dimos/screenshots/narrow.png differdiff --git a/store/agents/dimos/screenshots/studio.png b/store/agents/dimos/screenshots/studio.pngnew file mode 100644index 000000000..b2003f4dcBinary files /dev/null and b/store/agents/dimos/screenshots/studio.png differdiff --git a/store/agents/foam-agent/README.md b/store/agents/foam-agent/README.mdindex 7cdcfb97f..6cbccc281 100644--- a/store/agents/foam-agent/README.md+++ b/store/agents/foam-agent/README.md@@ -2,6 +2,8 @@Give the wind something to move around. Explore shapes, trace the currents, and compare your experiments.++```shharness dsh install autonomous/foam-agent```diff --git a/store/agents/foam-agent/screenshots/narrow.png b/store/agents/foam-agent/screenshots/narrow.pngnew file mode 100644index 000000000..f175d2075Binary files /dev/null and b/store/agents/foam-agent/screenshots/narrow.png differdiff --git a/store/agents/foam-agent/screenshots/studio.png b/store/agents/foam-agent/screenshots/studio.pngnew file mode 100644index 000000000..1d77047d8Binary files /dev/null and b/store/agents/foam-agent/screenshots/studio.png differdiff --git a/store/agents/juce-agent-toolkit/README.md b/store/agents/juce-agent-toolkit/README.mdindex 8eb4b7056..db2e91c80 100644--- a/store/agents/juce-agent-toolkit/README.md+++ b/store/agents/juce-agent-toolkit/README.md@@ -2,6 +2,8 @@Find a sound that feels like you. Shape a synth, play a little, and take the recording with you.++```shharness dsh install autonomous/juce-agent-toolkit```diff --git a/store/agents/juce-agent-toolkit/screenshots/narrow.png b/store/agents/juce-agent-toolkit/screenshots/narrow.pngnew file mode 100644index 000000000..90855614fBinary files /dev/null and b/store/agents/juce-agent-toolkit/screenshots/narrow.png differdiff --git a/store/agents/juce-agent-toolkit/screenshots/studio.png b/store/agents/juce-agent-toolkit/screenshots/studio.pngnew file mode 100644index 000000000..0ce09a158Binary files /dev/null and b/store/agents/juce-agent-toolkit/screenshots/studio.png differdiff --git a/store/agents/simskill/README.md b/store/agents/simskill/README.mdindex 24053a0ce..86f3790d9 100644--- a/store/agents/simskill/README.md+++ b/store/agents/simskill/README.md@@ -2,6 +2,8 @@Make a little city flow better. Change the lights, watch the streets, and measure what happens.++```shharness dsh install autonomous/simskill```diff --git a/store/agents/simskill/screenshots/follow.png b/store/agents/simskill/screenshots/follow.pngnew file mode 100644index 000000000..b6ad22a01Binary files /dev/null and b/store/agents/simskill/screenshots/follow.png differdiff --git a/store/agents/simskill/screenshots/narrow.png b/store/agents/simskill/screenshots/narrow.pngnew file mode 100644index 000000000..efcdcfeb2Binary files /dev/null and b/store/agents/simskill/screenshots/narrow.png differdiff --git a/store/agents/simskill/screenshots/studio.png b/store/agents/simskill/screenshots/studio.pngnew file mode 100644index 000000000..2a2b06ab3Binary files /dev/null and b/store/agents/simskill/screenshots/studio.png differdiff --git a/store/viewers/studio-viewer/package.json b/store/viewers/studio-viewer/package.jsonindex 21026c842..e6ab51a6f 100644--- a/store/viewers/studio-viewer/package.json+++ b/store/viewers/studio-viewer/package.json@@ -11,7 +11,8 @@"coverage:browser": "node test/browser-coverage.mjs","test:workflows": "node test/workflows.mjs","test:workflow-coverage": "node test/workflows.mjs --coverage",- "test:result-views": "node test/result-views.e2e.mjs"+ "test:result-views": "node test/result-views.e2e.mjs",+ "test:native-coverage": "bash test/native-coverage.sh"},"devDependencies": {"playwright": "1.58.2",diff --git a/store/viewers/studio-viewer/server.mjs b/store/viewers/studio-viewer/server.mjsindex bbe6e9891..3c412e9db 100644--- a/store/viewers/studio-viewer/server.mjs+++ b/store/viewers/studio-viewer/server.mjs@@ -175,6 +175,7 @@ export async function createStudio({workspace, packageDir, port = 0, jobTimeoutconst data = req.method === 'HEAD' ? Buffer.alloc(0):await readFile(target);return send(200,data,type,true);} catch(error) {+ res.removeHeader('Content-Length');const status = error.status ?? (error.code === 'ENOENT' ? 404:500);return send(status,{error:status === 500 ? 'The studio could not read the project. Check studio.json and the latest result.':error.message});}diff --git a/store/viewers/studio-viewer/test/browser-coverage.mjs b/store/viewers/studio-viewer/test/browser-coverage.mjsindex ce083d895..05c1fccba 100644--- a/store/viewers/studio-viewer/test/browser-coverage.mjs+++ b/store/viewers/studio-viewer/test/browser-coverage.mjs@@ -37,3 +37,7 @@ await mkdir(join(viewer,'coverage'),{recursive:true});await writeFile(join(viewer,'coverage/browser-summary.json'),JSON.stringify(summary,null,2));await writeFile(join(viewer,'coverage/browser-final.json'),JSON.stringify(map.toJSON()));console.log('Browser total:',summary.total);+if(map.files().length!==11)throw Error('Coverage must include all eight domain views and the three shared browser modules.');+for(const metric of ['lines','statements','functions','branches']){+ if(summary.total[metric].pct!==100)throw Error(`Browser ${metric} coverage is below 100%.`);+}diff --git a/store/viewers/studio-viewer/test/native-coverage.sh b/store/viewers/studio-viewer/test/native-coverage.shnew file mode 100755index 000000000..c150382c4--- /dev/null+++ b/store/viewers/studio-viewer/test/native-coverage.sh@@ -0,0 +1,50 @@+#!/usr/bin/env bash+# Instrument only the original JUCE starter's coverage; JUCE itself is upstream code.+set -euo pipefail+studio_viewer="$(cd "$(dirname "$0")/.." && pwd)"+studio_package="$(cd "$studio_viewer/../../agents/juce-agent-toolkit" && pwd)"+studio_workspace="$studio_viewer/test-results/native-coverage-workspace"+mkdir -p "$studio_workspace/Source" "$studio_workspace/profiles"+cp "$studio_package/template/CMakeLists.txt" "$studio_workspace/"+cp "$studio_package/template/Source/main.cpp" "$studio_workspace/Source/"+studio_sdk="$(xcrun --show-sdk-path)"+export SDKROOT="$studio_sdk"+export CPLUS_INCLUDE_PATH="$studio_sdk/usr/include/c++/v1${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}"+studio_cmake="$studio_package/.venv/bin/cmake"+"$studio_cmake" -S "$studio_workspace" -B "$studio_workspace/build" \+ -DJUCE_ROOT="$studio_package/juce" -DCMAKE_BUILD_TYPE=Release \+ -DCMAKE_OSX_SYSROOT="$studio_sdk" \+ '-DCMAKE_CXX_FLAGS=-fprofile-instr-generate -fcoverage-mapping' \+ -DCMAKE_EXE_LINKER_FLAGS=-fprofile-instr-generate+"$studio_cmake" --build "$studio_workspace/build" --target HarnessTone -j 2+studio_binary="$studio_workspace/build/HarnessTone_artefacts/Release/HarnessTone"+rm -f "$studio_workspace"/profiles/*.profraw+export LLVM_PROFILE_FILE="$studio_workspace/profiles/run-%p.profraw"+for studio_wave in sine triangle saw; do+ "$studio_binary" "$studio_workspace/$studio_wave.wav" "$studio_wave" 220 .02 .6 1+done+studio_expect_exit() {+ local studio_expected="$1"+ shift+ local studio_status=0+ "$studio_binary" "$@" || studio_status=$?+ test "$studio_status" -eq "$studio_expected" || { echo "Expected exit $studio_expected, got $studio_status"; exit 1; }+}+studio_expect_exit 2+studio_expect_exit 3 "$studio_workspace/invalid.wav" sine 220 .02 .6 0+studio_expect_exit 3 "$studio_workspace/invalid.wav" sine 220 .02 .6 9+studio_expect_exit 3 "$studio_workspace/invalid.wav" sine 100 .02 .6 1+studio_expect_exit 3 "$studio_workspace/invalid.wav" sine 900 .02 .6 1+studio_expect_exit 4 "$studio_workspace/missing/output.wav" sine 220 .02 .6 1+xcrun llvm-profdata merge -sparse "$studio_workspace"/profiles/*.profraw -o "$studio_workspace/coverage.profdata"+xcrun llvm-cov export "$studio_binary" -instr-profile="$studio_workspace/coverage.profdata" \+ "$studio_workspace/Source/main.cpp" > "$studio_viewer/test-results/native-cpp-coverage.json"+"$studio_package/.venv/bin/python" - "$studio_viewer/test-results/native-cpp-coverage.json" <<'PY'+import json,sys+report=json.load(open(sys.argv[1]))['data'][0]['files']+assert len(report)==1, 'Only the original starter belongs in this coverage denominator'+for name in ['lines','functions','branches','regions']:+ metric=report[0]['summary'][name]+ print(f'Native C++ {name}: {metric["covered"]}/{metric["count"]} ({metric["percent"]}%)')+ assert metric['covered']==metric['count'], f'Incomplete native {name} coverage'+PYdiff --git a/store/viewers/studio-viewer/web/studio.css b/store/viewers/studio-viewer/web/studio.cssindex b06abf344..a9db8be14 100644--- a/store/viewers/studio-viewer/web/studio.css+++ b/store/viewers/studio-viewer/web/studio.css@@ -6,3 +6,4 @@@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}.domain-dialog::backdrop{background:#14241d99;backdrop-filter:blur(5px)}+.domain-toolbar button[aria-pressed=true]:hover{background:var(--stage-accent);color:var(--stage)}