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
import {test,after} from 'node:test';import assert from 'node:assert/strict';import {spawnSync} from 'node:child_process';import {accessSync,constants,mkdtempSync,readFileSync,writeFileSync,rmSync,cpSync,chmodSync} from 'node:fs';import {tmpdir} from 'node:os';import {join} from 'node:path';import {fileURLToPath} from 'node:url';
const root=fileURLToPath(new URL('..',import.meta.url)),dirs=[];const temp=()=>{const d=mkdtempSync(join(tmpdir(),'godot-test-'));dirs.push(d);return d;};after(()=>dirs.forEach(d=>rmSync(d,{recursive:true,force:true})));
function fake(){const dir=temp(),bin=join(dir,'godot');writeFileSync(bin,'#!'+process.execPath+'\n'+`const fs=require('node:fs'),path=require('node:path'),args=process.argv.slice(2);if(args.includes('--script')&&!process.env.NO_RECEIPT)fs.writeFileSync(path.join(process.env.HARNESS_BUILD_DIR,'proof.json'),JSON.stringify({passed:true,checks:['test transport']}));if(args.includes('--export-release')){const file=args.at(-1);for(const ext of ['html','js','pck','wasm'])fs.writeFileSync(file.replace(/html$/,ext),'fresh export');}if(process.env.FAIL_EXPORT&&args.includes('--export-release'))process.exitCode=1;`);chmodSync(bin,0o755);return bin;}
const build=(ws,bin,extra={})=>spawnSync(process.execPath,[join(root,'skills/godot/scripts/build.mjs')],{cwd:ws,env:{...process.env,GODOT_BIN:bin,...extra},encoding:'utf8'});
test('manifest entrypoints stay executable',()=>{for(const p of ['toolchain/init-workspace.sh','toolchain/setup.sh','toolchain/doctor.sh','skills/godot/scripts/export-web.sh'])accessSync(join(root,p),constants.X_OK);});
test('export is accepted only after a fresh explicit gameplay proof receipt',()=>{const ws=temp(),bin=fake();cpSync(join(root,'template'),ws,{recursive:true});const r=build(ws,bin);assert.equal(r.status,0,r.stderr);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,true);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');const failed=build(ws,bin,{NO_RECEIPT:'1'});assert.notEqual(failed.status,0);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,false);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');});
test('a failed native export or missing executable clears ready and preserves prior output',()=>{const ws=temp(),bin=fake();cpSync(join(root,'template'),ws,{recursive:true});assert.equal(build(ws,bin).status,0);for(const [tool,extra]of [[bin,{FAIL_EXPORT:'1'}],[join(ws,'missing'),{}]]){assert.notEqual(build(ws,tool,extra).status,0);const verdict=JSON.parse(readFileSync(join(ws,'.harness/verdict.json')));assert.equal(verdict.ready,false);assert.equal(verdict.artifact,null);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');}});
test('source game and proof use real mechanics; single-threaded compatibility export configured',()=>{const cfg=readFileSync(join(root,'template/export_presets.cfg'),'utf8');assert.match(cfg,/variant\/thread_support=false/);assert.match(readFileSync(join(root,'template/scripts/proof.gd'),'utf8'),/game\.advance/);});