@oooooooooo/ch0de 0.0.0-stage → 1.9.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API-TESTING.md +76 -0
- package/DEBTAUR-INTEGRATION.md +71 -0
- package/EDITING.md +80 -0
- package/EXPERT-PANEL.md +16 -0
- package/INTEGRATIONS.md +75 -0
- package/LICENSE +21 -0
- package/MODELS-DEV-LICENSE +21 -0
- package/PROVIDER-CONNECTIONS.md +48 -0
- package/PROVIDERS.md +17 -0
- package/README.md +523 -2
- package/RELIABILITY.md +95 -0
- package/UX-1.3.md +83 -0
- package/UX-1.4.1.md +13 -0
- package/UX-1.4.md +48 -0
- package/UX-1.5.md +13 -0
- package/UX-1.6.md +7 -0
- package/UX-1.7.3.md +13 -0
- package/UX-1.7.4.md +13 -0
- package/UX-1.7.md +19 -0
- package/acceptance-check.js +27 -0
- package/agent-budget.js +4 -0
- package/api-testing.js +140 -0
- package/automatic-re.js +19 -0
- package/benchmarks/public-baselines.json +29 -0
- package/benchmarks/render-1.4.0.json +8 -0
- package/benchmarks/targets.js +11 -0
- package/browser-check.js +1062 -0
- package/build-progress.js +10 -0
- package/build-quality.js +49 -0
- package/chode.js +7937 -0
- package/debtaur-engine.js +305 -0
- package/debtaur-orchestration.js +456 -0
- package/debtaur-worker.cjs +76 -0
- package/doctor.js +24 -0
- package/edit-transactions.js +79 -0
- package/elapsed.js +28 -0
- package/evidence-ledger.js +26 -0
- package/expert-panel.cjs +42 -0
- package/helios-ledger.js +405 -0
- package/install.cjs +25 -0
- package/integrations.js +30 -0
- package/json-output.js +8 -0
- package/local-memory.js +613 -0
- package/local-models.js +52 -0
- package/mcp-client.js +50 -0
- package/memory.js +511 -0
- package/model-catalog.js +46 -0
- package/native-tools.js +27 -0
- package/nosignups.js +325 -0
- package/observation-progress.js +33 -0
- package/orchestrator.js +299 -0
- package/package.json +160 -6
- package/plan-z6.js +490 -0
- package/project-memory.js +27 -0
- package/provider-capacity.js +13 -0
- package/provider-catalog.js +246 -0
- package/provider-connect.js +66 -0
- package/provider-credentials.js +5 -0
- package/provider-directory.js +8 -0
- package/provider-directory.json +32300 -0
- package/provider-errors.js +11 -0
- package/provider-picker.js +188 -0
- package/provider-policy.js +4 -0
- package/provider-race.js +25 -0
- package/provider-request.js +45 -0
- package/provider-store.js +13 -0
- package/rea-environment.js +5 -0
- package/read-window.js +21 -0
- package/recovery-context.js +3 -0
- package/reliability-memory.js +38 -0
- package/reliability-services.js +34 -0
- package/reliability-store.js +16 -0
- package/request-deadline.js +4 -0
- package/serve-frontend.html +172 -0
- package/settings-reset.js +11 -0
- package/skill-catalog.js +16 -0
- package/task-group.js +22 -0
- package/terminal-graphics.js +39 -0
- package/terminal-logo.js +76 -0
- package/terminal-ui.js +79 -0
- package/tool-call-validation.js +26 -0
- package/tool-health.js +22 -0
- package/tool-history.js +5 -0
- package/toolbox.js +156 -0
- package/tui-provider-picker.js +134 -0
- package/tui-worker.js +32 -0
- package/web-context.js +232 -0
- package/wolfram-math.js +6 -0
- package/worker-transport.js +11 -0
- package/workspace-commands.js +45 -0
- package/workspace-log.js +56 -0
- package/workspace-store.js +7 -0
- package/workspace-tui.js +113 -0
- package/workspace-view.js +109 -0
- package/worktrees.js +18 -0
- package/z6-integration.js +227 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs=require('fs'),path=require('path'),crypto=require('crypto');
|
|
3
|
+
function open(root,request,session,digest=''){
|
|
4
|
+
const key=crypto.createHash('sha256').update(JSON.stringify([request,session||'default',digest])).digest('hex'),directory=path.join(root,'.chode','build-progress'),file=path.join(directory,key+'.json');
|
|
5
|
+
function read(){try{if(fs.statSync(file).size>1000000)return null;const r=JSON.parse(fs.readFileSync(file,'utf8'));return r.version===1&&r.request===request&&r.session===(session||'default')&&r.digest===digest&&(!r.drafterIds||Array.isArray(r.drafterIds)&&r.drafterIds.every(x=>typeof x==='string'&&x.length<=128))&&r.actions&&typeof r.actions==='object'&&['writes','edits','execs'].every(k=>Array.isArray(r.actions[k])&&r.actions[k].every(x=>typeof x==='string'))&&Array.isArray(r.planSteps)&&r.planSteps.every(s=>s&&typeof s==='object'&&(!s.files||Array.isArray(s.files))&&(!s.overwrites||Array.isArray(s.overwrites)))?r:null;}catch{return null;}}
|
|
6
|
+
function save(state){fs.mkdirSync(directory,{recursive:true});const data=JSON.stringify({version:1,request,session:session||'default',digest,updatedAt:Date.now(),...state});if(Buffer.byteLength(data)>1000000)throw Error('Build checkpoint exceeds 1 MB');const temp=file+'.'+process.pid+'.'+crypto.randomBytes(4).toString('hex')+'.tmp';try{fs.writeFileSync(temp,data,{flag:'wx',mode:0o600});fs.renameSync(temp,file);}finally{try{fs.unlinkSync(temp);}catch{}}}
|
|
7
|
+
function clear(){try{fs.unlinkSync(file);}catch{}}
|
|
8
|
+
return {read,save,clear,file};
|
|
9
|
+
}
|
|
10
|
+
module.exports={open};
|
package/build-quality.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs=require('fs'),path=require('path'),vm=require('vm');
|
|
3
|
+
function website(request){return (/\b(?:website|web\s*site|web\s*page|landing\s+page)\b/i.test(request)||(mechanisms(request).length>0&&/\b(?:(?:local|standalone)\s+html|html\s+(?:file|page|document|application))\b/i.test(request)))&&/\b(?:build|create|make|implement|recreate|copy|generate|write)\b/i.test(request);}
|
|
4
|
+
function mechanisms(request){const text=String(request||'');if(!/\b(?:build|create|make|implement|recreate|generate|write|port)\b/i.test(text)||/\b(?:static|nonfunctional)\s+(?:diagram|visualization|mockup)\b/i.test(text))return [];const groups={learning:/\blearn(?:ing)?\b/i,reasoning:/\breason(?:ing)?\b/i,pruning:/\bprun(?:e|ing)\b/i,grammar:/\bgrammar|grammatical\b/i,reinforcement:/\brewards?|punish(?:ment)?\b/i,inference:/\binference\b/i};const found=Object.keys(groups).filter(k=>groups[k].test(text));return found.length>=2?found:[];}
|
|
5
|
+
function functionalEvidence(root,actions={},checks=[]){
|
|
6
|
+
if(checks.some(c=>c.ok&&c.check==='independent acceptance test'))return true;
|
|
7
|
+
function behavioral(cmd,depth=0){if(depth>1||/\b(?:--check|py_compile|compileall|passWithNoTests)\b/.test(cmd))return false;
|
|
8
|
+
if(/^\s*(?:pytest\b|python(?:3)?\s+-m\s+(?:pytest|unittest)\b|node\s+--test\b|go\s+test\b|cargo\s+test\b|dotnet\s+test\b|(?:npx\s+)?(?:jest|vitest|mocha|playwright)\s*(?:test|run)?\b)/i.test(cmd))return true;
|
|
9
|
+
if(/^\s*(?:npm|pnpm|yarn)(?:\.cmd)?\s+(?:run\s+)?test\b/i.test(cmd)){try{return behavioral(JSON.parse(fs.readFileSync(path.join(root,'package.json'),'utf8')).scripts.test,depth+1);}catch{return false;}}
|
|
10
|
+
if(/^\s*(?:node|python(?:3)?)(?:\.exe)?\s+-(?:e|c)\s/i.test(cmd))return /\bassert\b/.test(cmd)&&!/assert\s*\(\s*(?:true|True|1)\s*\)/.test(cmd);
|
|
11
|
+
const match=/^\s*(?:node|python(?:3)?)(?:\.exe)?\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/i.exec(cmd);if(!match)return false;const name=match[1]||match[2]||match[3],file=path.resolve(root,name),rel=path.relative(root,file);if(rel.startsWith('..')||path.isAbsolute(rel)||!/(?:test|spec|check|acceptance)/i.test(name))return false;
|
|
12
|
+
try{const stat=fs.lstatSync(file);if(!stat.isFile()||stat.isSymbolicLink()||stat.size>200000)return false;const code=fs.readFileSync(file,'utf8');return /\b(?:assert(?:\.|\(|\s+)|unittest|test\s*\(|it\s*\()/.test(code)&&!/assert\s*\(\s*(?:true|True|1)\s*\)/.test(code);}catch{return false;}
|
|
13
|
+
}
|
|
14
|
+
if((actions.execResults||[]).some(r=>r.ok===true&&!r.pending&&!r.jobId&&!/\b(?:0 tests|tests\s*(?:[:=]\s*)?0)\b/i.test(r.output||'')&&behavioral(r.cmd||'')))return true;
|
|
15
|
+
return checks.some(c=>c.ok&&c.check==='repo tests pass'&&!/\b(?:0 tests|tests\s*(?:[:=]\s*)?0)\b/i.test(c.detail||''))&&behavioral('npm test');
|
|
16
|
+
}
|
|
17
|
+
function coreInstructions(request){const required=mechanisms(request);if(!required.length)return '';return '\n[CORE BEHAVIOR CONTRACT]\nImplement the actual requested mechanisms ('+required.join(', ')+'), not labels, random sample data or a visualization standing in for the system. Read supplied reference code before porting it; if unavailable, state that dependency rather than pretending it was read. Add and execute meaningful behavioral tests for every requested mechanism and their interaction. Check state changes and failure cases; compilation, screenshots and file existence do not prove these behaviors. Preserve the complete brief throughout repairs.\n[END CORE BEHAVIOR CONTRACT]\n';}
|
|
18
|
+
function multiPage(request){return /\b(?:multi[ -]?page|multiple pages|full[ -]?stack|backend|database|authentication|checkout)\b/i.test(request)||new Set((String(request).match(/\b[\w-]+\.html?\b/gi)||[]).map(x=>x.toLowerCase())).size>1||/\bpages\s*:\s*\S/i.test(request);}
|
|
19
|
+
function instructions(request){if(!website(request))return '';return '\n[BUILD COMPLETION CONTRACT]\nThe original brief is the acceptance contract. Inventory every requested page, section, interaction, data flow and constraint before implementation. Build the entire requested scope, not a landing-page substitute. Preserve existing working behavior. Use real navigation, responsive layouts, accessible controls, loading/empty/error states where needed, and working interactions. Do not use dummy links, fabricated success messages, placeholder content or pretend integrations. Run the available build/tests. The harness may exercise the rendered page in headless Chromium at desktop and mobile widths; when it reports console errors, failed assets, dead controls or horizontal overflow, fix them and recheck. Also exercise the requested user journeys directly. Fix observed failures and recheck. If an external credential/service is unavailable, implement and test the local behavior, and explicitly report the remaining dependency; never claim the live integration works. Finish with the actual entry point, checks run and remaining limitations. A file existing or a reviewer saying PASS alone does not demonstrate completeness.\n[END BUILD COMPLETION CONTRACT]\n';}
|
|
20
|
+
function attr(tag,name){const m=new RegExp('\\b'+name+'\\s*=\\s*(?:"([^"]*)"|\'([^\']*)\'|([^\\s>]+))','i').exec(tag);return m&&(m[1]??m[2]??m[3]);}
|
|
21
|
+
function htmlIssues(html,{root,file,selfContained=false,request=''}={}){
|
|
22
|
+
const issues=[],push=x=>{if(!issues.includes(x))issues.push(x);};
|
|
23
|
+
const markup=html.replace(/<!--[^]*?-->/g,'').replace(/<(script|style)\b([^>]*)>[^]*?<\/\1\s*>/gi,'<$1$2></$1>');
|
|
24
|
+
const visible=markup.replace(/<[^>]+>/g,' ');
|
|
25
|
+
if(!/\b(?:placeholder|lorem ipsum|coming soon)\b/i.test(request)&&/\b(?:lorem ipsum|coming soon|TODO:|your content here)\b/i.test(visible))push('replace unfinished placeholder content');
|
|
26
|
+
for(const m of markup.matchAll(/<(?:a|img|script|link|source)\b[^>]*>/gi)){
|
|
27
|
+
const tag=m[0],url=attr(tag,/^<(?:img|script|source)\b/i.test(tag)?'src':'href');if(url==null)continue;
|
|
28
|
+
if(/^<a\b/i.test(tag)&&(!url.trim()||url==='#'||/^javascript\s*:/i.test(url)))push('replace empty or dummy navigation links');
|
|
29
|
+
if(url.startsWith('#')&&url.length>1){let id;try{id=decodeURIComponent(url.slice(1));}catch{push('repair malformed fragment URL');continue;}if(![...markup.matchAll(/<[a-z][^>]*>/gi)].some(x=>attr(x[0],'id')===id||attr(x[0],'name')===id))push('missing anchor target: '+id+' — add id="'+id+'" to the matching section or point the link at an existing target');continue;}
|
|
30
|
+
if(!url||/^(?:[a-z][\w+.-]*:|\/\/|#)/i.test(url))continue;
|
|
31
|
+
if(selfContained){push('self-contained output references local dependency: '+url);continue;}
|
|
32
|
+
if(root&&file){let clean;try{clean=decodeURIComponent(url.split(/[?#]/)[0]);}catch{push('repair malformed local URL');continue;}const full=path.resolve(url.startsWith('/')?root:path.dirname(file),'.'+(url.startsWith('/')?'':'/')+clean),rel=path.relative(root,full);if(rel.startsWith('..')||path.isAbsolute(rel))push('local URL leaves the project: '+url);else if(!fs.existsSync(full))push('missing local link or asset: '+url);else if(/^<script\b/i.test(tag)){try{const source=fs.readFileSync(full,'utf8');if(/^\s*(?:const|let|var)\s+[^;=\n]+\s*=\s*require\s*\(/m.test(source)&&!/(?:function\s+require\b|(?:const|let|var)\s+require\s*=)/.test(source))push('browser script uses Node.js require without a browser loader: '+url);}catch{}}}
|
|
33
|
+
}
|
|
34
|
+
for(const m of html.matchAll(/<script\b([^>]*)>([^]*?)<\/script\s*>/gi)){if(attr(m[1],'src')||/\b(?:application\/ld\+json|application\/json|module|importmap)\b/i.test(attr(m[1],'type')||''))continue;try{new vm.Script(m[2]);}catch(e){push('inline JavaScript syntax: '+e.message);}}
|
|
35
|
+
return issues;
|
|
36
|
+
}
|
|
37
|
+
function documentIssues(html){
|
|
38
|
+
const issues=[];
|
|
39
|
+
for(const tag of ['html','head','body'])if(!new RegExp('<'+tag+'\\b','i').test(html))issues.push('missing document structure: '+tag);
|
|
40
|
+
if(!/<title\b[^>]*>\s*[^<\s][^<]*<\/title\s*>/i.test(html))issues.push('missing descriptive page title');
|
|
41
|
+
if(!/<meta\b[^>]*name\s*=\s*["']?viewport\b/i.test(html))issues.push('missing responsive viewport');
|
|
42
|
+
return issues;
|
|
43
|
+
}
|
|
44
|
+
function check(root,request,files,evidence={}){const required=mechanisms(request),checks=[];if(required.length&&!functionalEvidence(root,evidence.actions,evidence.checks))checks.push({check:'Core behavior requires functional evidence',ok:false,detail:'Requested mechanisms: '+required.join(', ')+'. Execute meaningful runtime/acceptance tests of these mechanisms and their interaction; random data, labels, screenshots and syntax checks do not establish implementation.'});if(!website(request))return checks;for(const f of files){if(/\.(?:[cm]?js|css)$/i.test(f)){const full=path.resolve(root,f),rel=path.relative(root,full);if(!rel.startsWith('..')&&!path.isAbsolute(rel))try{const text=fs.readFileSync(full,'utf8');if(/^\s*(?:(?:\/\/[^\n]*(?:\n|$))|(?:\/\*[\s\S]*?\*\/)|\s)*$/.test(text))checks.push({check:'Website implementation: '+f,ok:false,detail:'file is empty or contains only comments; implement the requested behavior'});}catch{}continue;}if(!/\.html?$/i.test(f))continue;const full=path.resolve(root,f),rel=path.relative(root,full);if(rel.startsWith('..')||path.isAbsolute(rel))continue;try{if(fs.statSync(full).size>2e6)continue;for(const issue of [...htmlIssues(fs.readFileSync(full,'utf8'),{root,file:full,request}),...documentIssues(fs.readFileSync(full,'utf8'))])checks.push({check:'Website integrity: '+f,ok:false,detail:issue});}catch(e){checks.push({check:'Website artifact: '+f,ok:false,detail:e.message});}}
|
|
45
|
+
// Only enforce literal HTML deliverable names, never invent framework route filenames.
|
|
46
|
+
const names=[...new Set((String(request).replace(/https?:\/\/\S+/g,'').match(/\b[\w-]+\.html?\b/gi)||[]))];
|
|
47
|
+
for(const name of names){if(!files.some(f=>path.basename(f).toLowerCase()===name.toLowerCase())&&!fs.existsSync(path.join(root,name)))checks.push({check:'Requested page: '+name,ok:false,detail:'requested HTML deliverable is missing'});}
|
|
48
|
+
return checks;}
|
|
49
|
+
module.exports={website,multiPage,instructions:request=>coreInstructions(request)+instructions(request),htmlIssues,check,mechanisms,coreInstructions,functionalEvidence};
|