@skyramp/testbot-core 0.13.3-v3.565 → 0.13.3-v3.566

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/dist/VERSION.json CHANGED
@@ -1 +1 @@
1
- {"version":"0.13.3-v3.565","commit":"0980b5b4d14527972e267501d356ec683ff19ea6"}
1
+ {"version":"0.13.3-v3.566","commit":"042552d0bdfd726e12284024b413dfd6e027daf2"}
package/dist/main.js CHANGED
@@ -355,7 +355,7 @@ ${g}`),...gXe(g,i,a,`${f}
355
355
  ${g}`).map(A=>({...A,at:A.at+f.length+1}))];if(!m.length)p.push(`never opens a page; start it with a navigation to the entry route ${t.entry}`);else{let A=m.findIndex(w=>w.route===void 0||$pe(w.route,t.entry));if(A<0)p.push(`does not open the journey's entry route ${t.entry} (it opens ${m.map(w=>w.route).join(", ")}); start there`);else{let w=t.steps.slice(1).filter(E=>E.route.trim()&&!$pe(E.route,t.entry));for(let E of m.slice(A+1)){let C=E.route!==void 0?w.find(I=>$pe(E.route,I.route)):void 0;C&&p.push(`jumps by URL to ${E.route} (step ${t.steps.indexOf(C)+1}) instead of getting there through the UI; use page.reload() where the outcome must persist`)}}}if(p.push(...EXe(g,t,i,n)),!n&&!i&&/@playwright\/test/.test(e)){let A=(g.match(/\btest\.step\s*\(/g)??[]).length;A<t.steps.length&&p.push(`marks ${A} of its ${t.steps.length} steps; wrap each in test.step, named for the step, so a failure names it`)}return p}function EXe(e,t,r,n=!1){let s=Math.max(-1,...[...e.matchAll(r?icr:ncr)].map(a=>a.index),...[...e.matchAll(Tcr)].map(a=>a.index)),i=[...e.matchAll(r?ocr:scr)].map(a=>a.index);if(!i.length)return[`asserts nothing; end it by asserting the journey's outcome: ${t.outcome}`];if(Math.max(...i)<s)return[`ends with a user action and no assertion after it; assert the journey's outcome after the last step: ${t.outcome}`];let o=r?[]:Icr(e,n);return i.some(a=>a>s&&!o.some(([c,u])=>a>c&&a<u))?i.length<t.steps.length?[`has ${i.length} assertion(s) for ${t.steps.length} steps; after each step, assert what the user then sees`]:[]:[`checks the outcome after the last step only under a condition (an if, else, try with a catch, or a .catch), so it can pass without checking it; assert the journey's outcome unconditionally: ${t.outcome}`]}function Icr(e,t=!1){return t?kcr(e):Rcr(e)}function vXe(e,t){for(let r=t,n=0;r<e.length;r++)if(e[r]==="(")n++;else if(e[r]===")"&&--n===0)return r+1;return e.length}function SXe(e,t){let r=t+(e.slice(t).match(/^\s*/)?.[0].length??0);if(e[r]==="{")return[r,sT(e,r)];let n=e.indexOf(`
356
356
  `,r);return[r,n<0?e.length:n]}function Rcr(e){let t=[];for(let r of e.matchAll(/\b(if|switch)\s*\(|\belse\b|\btry\s*\{|\.catch\s*\(/g)){let n=r.index;if(r[0].startsWith(".catch")){let s=Math.max(e.lastIndexOf(";",n),e.lastIndexOf("{",n),e.lastIndexOf("}",n),e.lastIndexOf(`
357
357
  `,n));t.push([s,vXe(e,n+r[0].length-1)])}else if(r[1])t.push(SXe(e,vXe(e,n+r[0].length-1)));else if(r[0].startsWith("else"))t.push(SXe(e,n+4));else{let s=n+r[0].length-1,i=sT(e,s),o=/^\s*catch\b\s*(?:\([^)]*\))?\s*\{/.exec(e.slice(i));if(!o)continue;let a=i+o[0].length-1,c=sT(e,a);/\bthrow\b/.test(e.slice(a,c))||t.push([s,i])}}return t}function kcr(e){let t=[],r=e.split(`
358
- `),n=[];r.reduce((i,o)=>(n.push(i),i+o.length+1),0);let s=i=>i.match(/^[ \t]*/)[0].length;return r.forEach((i,o)=>{let a=/^[ \t]*(if|elif|else|try|except)\b[^\n]*:\s*$/.exec(i);if(!a)return;let c=o+1;for(;c<r.length&&(!r[c].trim()||s(r[c])>s(i));)c++;if(a[1]==="try"){let u=r[c]&&/^[ \t]*except\b/.test(r[c])?c:-1;if(u<0)return;let l=u+1;for(;l<r.length&&(!r[l].trim()||s(r[l])>s(r[u]));)l++;if(r.slice(u+1,l).some(d=>/^\s*raise\b/.test(d)))return}t.push([n[o]+i.length,c<r.length?n[c]:e.length])}),t}var Tcr=/\b(?:userEvent|user|fireEvent)\.\w+\s*\(|\.(?:trigger|setValue)\s*\(/g,_cr=/^\s*pass(?:es|ed|ing)\b\s*(?:$|[:;,.(—–-])|\bcould[- ]break\s+(?:check|test|rule|case)s?\b|\b(?:removed|dropped|deleted)\b[^.;]{0,60}\b(?:because|as|since|for)\b[^.;]{0,40}\bpass(?:es|ed|ing)?\b|\bpass(?:es|ed)\b[^.;]{0,40}\b(?:and|so)\b[^.;]{0,20}\b(?:removed|dropped|deleted)\b/i;function eD(e,t,r,n=[]){return e.map(s=>{let i=t.notWritten?.find(g=>g.case.trim()===s.id)?.reason.trim(),o=t.tests.some(g=>g.covers.includes(s.id));if(i&&!o&&_cr.test(i))return{journey:s,uncovered:i,problems:["its test was removed because it passes; a journey's test stays whether it passes or fails: restore it"]};if(i&&!o)return{journey:s,uncovered:i,problems:[]};let a=t.journeys?.find(g=>g.journey.trim()===s.id),c=t.tests.filter(g=>g.covers.includes(s.id)).map(g=>g.file),u=a?.file?.trim()||c[0]||s.testFile,l=[...new Set([u,...c].filter(Boolean))].map(g=>({file:g,...Pcr(s,a?.test,g,r)})),d=l.find(g=>g.read&&!g.problems.length)??l.find(g=>g.read)??l[0];if(!d)return{journey:s,file:u,test:a?.test,problems:["has no test: no test file is named for it"]};let{file:p,problems:f}=d;if(!d.read)return{journey:s,file:p,test:a?.test,problems:f};let h=s.testFile.trim();return h&&CXe(p)!==CXe(h)&&!$cr(n,r(p),r(h))&&f.unshift(`is in ${p}, but the plan put it in ${h}: write it in the repo's suite there, in the same language`),{journey:s,file:p,test:a?.test,problems:f}})}var Ncr=/\.(?:[cm]?[jt]sx?|py|rb|java|kt)$/i;function Pcr(e,t,r,n){let s=n(r);if(!s)return{read:!1,problems:[`has no test: ${r||"no file"} is not on disk`]};let i;try{i=Po.readFileSync(s,"utf-8")}catch{return{read:!1,problems:[`has no test: ${r} cannot be read`]}}if(!Ncr.test(s)){let o=t?.trim();return{read:!0,problems:o?i.includes(o)?[]:[`has no test titled "${o}"`]:['names no test; say which one walks the journey ("test" in "journeys")']}}return{read:!0,problems:xcr(i,e,t,/\.py$/i.test(s),{ruby:/\.rb$/i.test(s),jvm:/\.(java|kt)$/i.test(s),helpers:Scr(s,i)})}}var Bcr=Object.fromEntries([...["ts","tsx","mts","cts","js","jsx","mjs","cjs"].map(e=>[e,"node"]),...["java","kt","kts","groovy","scala"].map(e=>[e,"jvm"]),["py","python"],["go","go"]]),CXe=e=>{let t=Zt.extname(e).slice(1).toLowerCase();return Bcr[t]??t};function $cr(e,t,r){let n=s=>!!s&&e.some(i=>{let o=Zt.relative(i,s);return!o.startsWith("..")&&!Zt.isAbsolute(o)});return n(t)&&!n(r)}function nu(e,t=[]){let r=[e,...t.map(n=>n.path)].map(n=>Zt.resolve(n));return n=>{let s=n.replace(/^\.\//,""),i=s.split("/")[0];return[Zt.resolve(e,s),...t.filter(a=>Zt.basename(Zt.resolve(a.path))===i).map(a=>Zt.resolve(a.path,s.slice(i.length+1)))].find(a=>r.some(c=>a.startsWith(c+Zt.sep))&&Po.existsSync(a)&&Po.statSync(a).isFile())}}function CV(e){return e.filter(t=>t.problems.length).map(t=>`journey ${t.journey.id} (${t.journey.name})${t.file?` in ${t.file}`:""}: ${t.problems.join("; ")}`)}var Vy=(e,t)=>e===t||e.endsWith(`/${t}`)||t.endsWith(`/${e}`);function jXe(e,t,r){if(!r||!t.journeys?.find(s=>s.journey.trim()===e.id)?.brokeAt)return!1;let n=new Set([e.id,...e.steps.flatMap(s=>s.clauses??[])].map(s=>s.trim()));return t.tests.some(s=>Vy(s.file,r)&&s.covers.some(i=>n.has(i.trim()))&&typeof s.result.exit=="number"&&s.result.exit!==0)}function qXe(e,t,r,n=[]){return(t?eD(e,t,r,n):e.map(i=>({journey:i,problems:["has no test"]}))).map(({journey:i,file:o,test:a,problems:c,uncovered:u})=>{if(u)return{id:i.id,name:i.name,entry:i.entry,steps:i.steps.length,source:i.source??"inferred",status:"Not written",problems:c,uncovered:u};let l=(t?.tests??[]).filter(m=>o&&Vy(m.file,o)),d=l.find(m=>m.covers.includes(i.id))??l[0],p=!!(o&&r(o)),f=d?.result.cases.find(m=>m.case===i.id)?.status,h=!f&&d&&!d.result.cases.length&&d.covers.every(m=>m===i.id)?d.result.exit:null,g=!f&&t!==void 0&&jXe(i,t,o),y=p?f==="pass"||h===0?"Pass":f==="fail"||h!==null&&h!==0||g?"Fail":"Not run":"Not written";return{id:i.id,name:i.name,entry:i.entry,steps:i.steps.length,source:i.source??"inferred",...p?{fileName:o}:{},...a?{test:a}:{},status:y,problems:p?c:[]}})}function zXe(e,t){if(!t)return[];let r=[];for(let n of e){let s=t.journeys?.find(g=>g.journey.trim()===n.id),i=s?.brokeAt,o=t.tests.flatMap(g=>g.result.cases.filter(y=>y.case===n.id).map(y=>y.status)),a=o.includes("fail")||!o.length&&jXe(n,t,s?.file?.trim());if(!i||!a)continue;let c=s?.file?.trim(),l=t.tests.filter(g=>g.covers.includes(n.id)||c&&Vy(g.file,c)).flatMap(g=>g.result.cases.filter(y=>y.status==="fail"));if(l.length&&l.every(g=>g.testProblem&&g.defect!==!0))continue;let d=n.steps[i.step-1],p=d?` (${d.route.trim()?`${d.route.trim()} \u2014 `:""}${d.action.trim()})`:"",f=i.notReached??[],h=f.length===1?` Step ${f[0]} was not reached.`:f.length?` Steps ${f.join(", ")} were not reached.`:"";r.push({description:`User journey "${n.name.trim()}" breaks at step ${i.step}${p}: expected ${i.expected.trim()}, got ${i.actual.trim()}.${h}`,severity:"medium",category:"bug",...s?.file?{test:s.file}:{},...d?.clauses?.length?{clauses:[...d.clauses]}:{}})}return r}var Ocr=["stale_test","open_question"],xXe=["low","medium","high","critical"],Dcr=(e,t)=>xXe.indexOf(t)>xXe.indexOf(e??"")?t:e??t;function GXe(e,t,r=[]){let n=new Map(r.flatMap(a=>[[a.id,a.id],...a.clauses.map(c=>[c.id,a.id])])),s=(a,c)=>a===c||(n.get(a)??a)===(n.get(c)??c),i=[...e],o=[...e];for(let{test:a,clauses:c=[],...u}of t){let l=a?o.flatMap((f,h)=>!Ocr.includes(f.category??"")&&Uz(f.description,a)?[h]:[]):[],d=f=>c.some(h=>(o[f].requirementIds??[]).some(g=>s(g,h))),p=l.find(d)??(l.length===1&&!o[l[0]].requirementIds?.length?l[0]:void 0);if(p===void 0){i.push({...u,description:a?`${u.description} (shown by ${a})`:u.description});continue}o[p]={...o[p],description:`${o[p].description} ${u.description}`,severity:Dcr(o[p].severity,u.severity)},i[p]=o[p]}return i}function HXe(e,t){if(!e)return;let r=t?.results??[];return{journeys:e.journeys,notWritten:(e.journeysNotWritten??[]).map(n=>({case:n.journey,reason:n.missing})),tests:e.tests.map(n=>{let s=r.filter(c=>n.covers.some(u=>c.behaviorIds.includes(u))),i=s.some(c=>c.status==="Fail"),o=s.some(c=>c.status==="Pass"),a=i?"fail":o?"pass":void 0;return{file:n.file,covers:n.covers,result:{exit:a?i?1:0:null,cases:a?n.covers.map(c=>({case:c,status:a})):[]}}})}}function dp(e){return e.replace(/[“”„«»]/g,'"').replace(/[‘’]/g,"'").replace(/^[ \t]*(?:[-*+]|\d+[.)]|>+|#{1,6})[ \t]+/gm,"").replace(/`+([^`]*?)`+/g,"$1").replace(/(^|[^\w*])(\*\*|\*|__|_)(?=\S)([^\n]*?\S)\2(?![\w*])/g,"$1$3").replace(/\s+/g," ").trim().toLowerCase()}var VXe=/^["'\u201c\u201d\u2018\u2019]+|["'\u201c\u201d\u2018\u2019]+$/g,Da=e=>dp(e.trim().replace(VXe,"")).replace(VXe,"").trim(),pp=12;function Yl(e,t){let r=Da(t);return r.length>0&&dp(e).includes(r)}var xV=/["\u201c]([^"\u201d]{3,300})["\u201d]|(?:^|[\s:(\[])['\u2018]([^\n]{3,300}?)['\u2019](?=[\s.,;:)\]]|$)/;function oT(e){let t=e.match(xV);return t?(t[1]??t[2]).trim():void 0}var WXe=String.raw`(?:\[[^\]]*\]|\([^)]*\))`,Mcr=String.raw`(?:["'\u201c\u2018\x60]|\*{1,2})?[^\s:"'\u201c\u201d\u2018\u2019\x60*()[\],]+(?:["'\u201d\u2019\x60]|\*{1,2})?`,JXe=String.raw`(?:${WXe}|${Mcr}(?:\s*${WXe})?)`,YXe=String.raw`(?:\s*:|\s+[\u2014\u2013-])`,KXe=new RegExp(String.raw`^\s*(?:${JXe}(?:,\s*${JXe})*(?::L?\d+(?:[-\u2013]\d+)?${YXe}?|${YXe})|\[[^\]\s]+\]|\([^)\s]+\))\s+`);function ZXe(e){let t=e;for(let r=t.replace(KXe,"");r!==t&&r.trim();r=t.replace(KXe,""))t=r;return t}var Fcr=/[\d/#]/;function Qcr(e){let t=e.match(xV),r=t?.[1]??t?.[2];if(!t||t.index===void 0||r===void 0)return;let n=e.slice(0,t.index+t[0].indexOf(r)-1),s=e.slice(t.index+t[0].length);return(/^\s*$/.test(n)||ZXe(`${n} .`)==="."||/(?::|\s[\u2014\u2013-])\s*$/.test(n)&&Fcr.test(n))&&/^[\s.,;]*$/.test(s)?r.trim():void 0}function IV(e){return[...new Set([e,ZXe(e),Qcr(e)??""])].filter(t=>Da(t).length>0)}function RV(e){return[...new Set([...IV(e),oT(e)??""])].filter(t=>Da(t).length>0)}function Qpe(e,t){return IV(t).some((r,n)=>(n===0||Da(r).length>=pp)&&Yl(e,r))}function Ucr(e,t){return e.some(r=>Yl(r.body,t))}function kV(e,t){let r=t.match(/^\s*([\w.-]+\/[\w.-]+#\d+)\s*[:—–-]?\s*([\s\S]+)$/),n=r&&e.find(s=>s.pullRequest?.toLowerCase()===r[1].toLowerCase());return r&&n?{quote:r[2],scope:[n],unknownPrefix:!1}:{quote:t,scope:e,unknownPrefix:!!r}}function tD(e,t){let{quote:r,scope:n,unknownPrefix:s}=kV(e,t);return s?Ucr(n,r):n.some(i=>Qpe(i.body,r))}var ng=Y(require("fs")),ys=Y(require("path"));var Zm=b.string().trim().min(1),fp=72,Lcr=b.object({repository:Zm.optional().describe("owner/repo of the checkout this lint ran in, when the run has several; omit for the working checkout"),tool:b.string(),command:b.string().describe("the exact command you ran, scoped to the changed files"),clean:b.boolean(),notRun:b.string().optional().describe("why no linter checked the files, when none could (SKYR-5827): then `clean` is false and does not hold the tests back"),fixed:b.array(b.string()).optional().describe("files you fixed"),uncovered:b.array(b.string()).describe("changed/new files this linter's own config does not match (wrong extension, wrong directory) \u2014 so `clean` never examined them, even though CI may still execute them. Empty array, not omitted, when every changed/new file IS covered.")});var Upe=b.object({schemaVersion:b.literal(1),lint:b.array(Lcr).min(1).describe("one entry per checkout this run wrote tests in, each run from that checkout"),fileConventions:b.object({ok:b.boolean(),notes:b.string().optional()}),ciReadiness:b.object({covered:b.boolean().describe("will the repo's CI run these tests?"),notes:b.string().optional(),unrecorded:b.array(b.string()).optional().describe("tests with no record of whether CI runs them: not covered, and not known to be left out")}),dependencies:b.object({added:b.array(b.object({package:b.string(),manifest:b.string(),repository:Zm.optional().describe("owner/repo of the manifest's checkout; omit for the working checkout"),reason:Zm.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).describe("every package added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own")}),support:b.array(b.object({file:Zm,repository:Zm.optional().describe("owner/repo of the file's checkout; omit for the working checkout")})).optional().describe("the files the tests need besides themselves (helper modules, page objects, fixtures, snapshots), delivered with them"),commit:b.object({message:Zm.refine(e=>e.split(`
358
+ `),n=[];r.reduce((i,o)=>(n.push(i),i+o.length+1),0);let s=i=>i.match(/^[ \t]*/)[0].length;return r.forEach((i,o)=>{let a=/^[ \t]*(if|elif|else|try|except)\b[^\n]*:\s*$/.exec(i);if(!a)return;let c=o+1;for(;c<r.length&&(!r[c].trim()||s(r[c])>s(i));)c++;if(a[1]==="try"){let u=r[c]&&/^[ \t]*except\b/.test(r[c])?c:-1;if(u<0)return;let l=u+1;for(;l<r.length&&(!r[l].trim()||s(r[l])>s(r[u]));)l++;if(r.slice(u+1,l).some(d=>/^\s*raise\b/.test(d)))return}t.push([n[o]+i.length,c<r.length?n[c]:e.length])}),t}var Tcr=/\b(?:userEvent|user|fireEvent)\.\w+\s*\(|\.(?:trigger|setValue)\s*\(/g,_cr=/^\s*pass(?:es|ed|ing)\b\s*(?:$|[:;,.(—–-])|\bcould[- ]break\s+(?:check|test|rule|case)s?\b|\b(?:removed|dropped|deleted)\b[^.;]{0,60}\b(?:because|as|since|for)\b[^.;]{0,40}\bpass(?:es|ed|ing)?\b|\bpass(?:es|ed)\b[^.;]{0,40}\b(?:and|so)\b[^.;]{0,20}\b(?:removed|dropped|deleted)\b/i;function eD(e,t,r,n=[]){return e.map(s=>{let i=t.notWritten?.find(g=>g.case.trim()===s.id)?.reason.trim(),o=t.tests.some(g=>g.covers.includes(s.id));if(i&&!o&&_cr.test(i))return{journey:s,uncovered:i,problems:["its test was removed because it passes; a journey's test stays whether it passes or fails: restore it"]};if(i&&!o)return{journey:s,uncovered:i,problems:[]};let a=t.journeys?.find(g=>g.journey.trim()===s.id),c=t.tests.filter(g=>g.covers.includes(s.id)).map(g=>g.file),u=a?.file?.trim()||c[0]||s.testFile,l=[...new Set([u,...c].filter(Boolean))].map(g=>({file:g,...Pcr(s,a?.test,g,r)})),d=l.find(g=>g.read&&!g.problems.length)??l.find(g=>g.read)??l[0];if(!d)return{journey:s,file:u,test:a?.test,problems:["has no test: no test file is named for it"]};let{file:p,problems:f}=d;if(!d.read)return{journey:s,file:p,test:a?.test,problems:f};let h=s.testFile.trim();return h&&CXe(p)!==CXe(h)&&!$cr(n,r(p),r(h))&&f.unshift(`is in ${p}, but the plan put it in ${h}: write it in the repo's suite there, in the same language`),{journey:s,file:p,test:a?.test,problems:f}})}var Ncr=/\.(?:[cm]?[jt]sx?|py|rb|java|kt)$/i;function Pcr(e,t,r,n){let s=n(r);if(!s)return{read:!1,problems:[`has no test: ${r||"no file"} is not on disk`]};let i;try{i=Po.readFileSync(s,"utf-8")}catch{return{read:!1,problems:[`has no test: ${r} cannot be read`]}}if(!Ncr.test(s)){let o=t?.trim();return{read:!0,problems:o?i.includes(o)?[]:[`has no test titled "${o}"`]:['names no test; say which one walks the journey ("test" in "journeys")']}}return{read:!0,problems:xcr(i,e,t,/\.py$/i.test(s),{ruby:/\.rb$/i.test(s),jvm:/\.(java|kt)$/i.test(s),helpers:Scr(s,i)})}}var Bcr=Object.fromEntries([...["ts","tsx","mts","cts","js","jsx","mjs","cjs"].map(e=>[e,"node"]),...["java","kt","kts","groovy","scala"].map(e=>[e,"jvm"]),["py","python"],["go","go"]]),CXe=e=>{let t=Zt.extname(e).slice(1).toLowerCase();return Bcr[t]??t};function $cr(e,t,r){let n=s=>!!s&&e.some(i=>{let o=Zt.relative(i,s);return!o.startsWith("..")&&!Zt.isAbsolute(o)});return n(t)&&!n(r)}function nu(e,t=[]){let r=[e,...t.map(n=>n.path)].map(n=>Zt.resolve(n));return n=>{let s=n.replace(/^\.\//,""),i=s.split("/")[0];return[Zt.resolve(e,s),...t.filter(a=>Zt.basename(Zt.resolve(a.path))===i).map(a=>Zt.resolve(a.path,s.slice(i.length+1)))].find(a=>r.some(c=>a.startsWith(c+Zt.sep))&&Po.existsSync(a)&&Po.statSync(a).isFile())}}function CV(e){return e.filter(t=>t.problems.length).map(t=>`journey ${t.journey.id} (${t.journey.name})${t.file?` in ${t.file}`:""}: ${t.problems.join("; ")}`)}var Vy=(e,t)=>e===t||e.endsWith(`/${t}`)||t.endsWith(`/${e}`);function jXe(e,t,r){if(!r||!t.journeys?.find(s=>s.journey.trim()===e.id)?.brokeAt)return!1;let n=new Set([e.id,...e.steps.flatMap(s=>s.clauses??[])].map(s=>s.trim()));return t.tests.some(s=>Vy(s.file,r)&&s.covers.some(i=>n.has(i.trim()))&&typeof s.result.exit=="number"&&s.result.exit!==0)}function qXe(e,t,r,n=[]){return(t?eD(e,t,r,n):e.map(i=>({journey:i,problems:["has no test"]}))).map(({journey:i,file:o,test:a,problems:c,uncovered:u})=>{if(u)return{id:i.id,name:i.name,entry:i.entry,steps:i.steps.length,source:i.source??"inferred",status:"Not written",problems:c,uncovered:u};let l=(t?.tests??[]).filter(m=>o&&Vy(m.file,o)),d=l.find(m=>m.covers.includes(i.id))??l[0],p=!!(o&&r(o)),f=d?.result.cases.find(m=>m.case===i.id)?.status,h=!f&&d&&!d.result.cases.length&&d.covers.every(m=>m===i.id)?d.result.exit:null,g=!f&&t!==void 0&&jXe(i,t,o),y=p?f==="pass"||h===0?"Pass":f==="fail"||h!==null&&h!==0||g?"Fail":"Not run":"Not written";return{id:i.id,name:i.name,entry:i.entry,steps:i.steps.length,source:i.source??"inferred",...p?{fileName:o}:{},...a?{test:a}:{},status:y,problems:p?c:[]}})}function zXe(e,t){if(!t)return[];let r=[];for(let n of e){let s=t.journeys?.find(g=>g.journey.trim()===n.id),i=s?.brokeAt,o=t.tests.flatMap(g=>g.result.cases.filter(y=>y.case===n.id).map(y=>y.status)),a=o.includes("fail")||!o.length&&jXe(n,t,s?.file?.trim());if(!i||!a)continue;let c=s?.file?.trim(),l=t.tests.filter(g=>g.covers.includes(n.id)||c&&Vy(g.file,c)).flatMap(g=>g.result.cases.filter(y=>y.status==="fail"));if(l.length&&l.every(g=>g.testProblem&&g.defect!==!0))continue;let d=n.steps[i.step-1],p=d?` (${d.route.trim()?`${d.route.trim()} \u2014 `:""}${d.action.trim()})`:"",f=i.notReached??[],h=f.length===1?` Step ${f[0]} was not reached.`:f.length?` Steps ${f.join(", ")} were not reached.`:"";r.push({description:`User journey "${n.name.trim()}" breaks at step ${i.step}${p}: expected ${i.expected.trim()}, got ${i.actual.trim()}.${h}`,severity:"medium",category:"bug",...s?.file?{test:s.file}:{},...d?.clauses?.length?{clauses:[...d.clauses]}:{}})}return r}var Ocr=["stale_test","open_question"],xXe=["low","medium","high","critical"],Dcr=(e,t)=>xXe.indexOf(t)>xXe.indexOf(e??"")?t:e??t;function GXe(e,t,r=[]){let n=new Map(r.flatMap(a=>[[a.id,a.id],...a.clauses.map(c=>[c.id,a.id])])),s=(a,c)=>a===c||(n.get(a)??a)===(n.get(c)??c),i=[...e],o=[...e];for(let{test:a,clauses:c=[],...u}of t){let l=a?o.flatMap((f,h)=>!Ocr.includes(f.category??"")&&Uz(f.description,a)?[h]:[]):[],d=f=>c.some(h=>(o[f].requirementIds??[]).some(g=>s(g,h))),p=l.find(d)??(l.length===1&&!o[l[0]].requirementIds?.length?l[0]:void 0);if(p===void 0){i.push({...u,description:a?`${u.description} (shown by ${a})`:u.description});continue}o[p]={...o[p],description:`${o[p].description} ${u.description}`,severity:Dcr(o[p].severity,u.severity)},i[p]=o[p]}return i}function HXe(e,t){if(!e)return;let r=t?.results??[];return{journeys:e.journeys,notWritten:(e.journeysNotWritten??[]).map(n=>({case:n.journey,reason:n.missing})),tests:e.tests.map(n=>{let s=r.filter(c=>n.covers.some(u=>c.behaviorIds.includes(u))),i=s.some(c=>c.status==="Fail"),o=s.some(c=>c.status==="Pass"),a=i?"fail":o?"pass":void 0;return{file:n.file,covers:n.covers,result:{exit:a?i?1:0:null,cases:a?n.covers.map(c=>({case:c,status:a})):[]}}})}}function dp(e){return e.replace(/[“”„«»]/g,'"').replace(/[‘’]/g,"'").replace(/^[ \t]*(?:[-*+]|\d+[.)]|>+|#{1,6})[ \t]+/gm,"").replace(/`+([^`]*?)`+/g,"$1").replace(/(^|[^\w*])(\*\*|\*|__|_)(?=\S)([^\n]*?\S)\2(?![\w*])/g,"$1$3").replace(/\s+/g," ").replace(/(^| )[-*+](?= )/g,"").trim().toLowerCase()}var VXe=/^["'\u201c\u201d\u2018\u2019]+|["'\u201c\u201d\u2018\u2019]+$/g,Da=e=>dp(e.trim().replace(VXe,"")).replace(VXe,"").trim(),pp=12;function Yl(e,t){let r=Da(t);return r.length>0&&dp(e).includes(r)}var xV=/["\u201c]([^"\u201d]{3,300})["\u201d]|(?:^|[\s:(\[])['\u2018]([^\n]{3,300}?)['\u2019](?=[\s.,;:)\]]|$)/;function oT(e){let t=e.match(xV);return t?(t[1]??t[2]).trim():void 0}var WXe=String.raw`(?:\[[^\]]*\]|\([^)]*\))`,Mcr=String.raw`(?:["'\u201c\u2018\x60]|\*{1,2})?[^\s:"'\u201c\u201d\u2018\u2019\x60*()[\],]+(?:["'\u201d\u2019\x60]|\*{1,2})?`,JXe=String.raw`(?:${WXe}|${Mcr}(?:\s*${WXe})?)`,YXe=String.raw`(?:\s*:|\s+[\u2014\u2013-])`,KXe=new RegExp(String.raw`^\s*(?:${JXe}(?:,\s*${JXe})*(?::L?\d+(?:[-\u2013]\d+)?${YXe}?|${YXe})|\[[^\]\s]+\]|\([^)\s]+\))\s+`);function ZXe(e){let t=e;for(let r=t.replace(KXe,"");r!==t&&r.trim();r=t.replace(KXe,""))t=r;return t}var Fcr=/[\d/#]/;function Qcr(e){let t=e.match(xV),r=t?.[1]??t?.[2];if(!t||t.index===void 0||r===void 0)return;let n=e.slice(0,t.index+t[0].indexOf(r)-1),s=e.slice(t.index+t[0].length);return(/^\s*$/.test(n)||ZXe(`${n} .`)==="."||/(?::|\s[\u2014\u2013-])\s*$/.test(n)&&Fcr.test(n))&&/^[\s.,;]*$/.test(s)?r.trim():void 0}function IV(e){return[...new Set([e,ZXe(e),Qcr(e)??""])].filter(t=>Da(t).length>0)}function RV(e){return[...new Set([...IV(e),oT(e)??""])].filter(t=>Da(t).length>0)}function Qpe(e,t){return IV(t).some((r,n)=>(n===0||Da(r).length>=pp)&&Yl(e,r))}function Ucr(e,t){return e.some(r=>Yl(r.body,t))}function kV(e,t){let r=t.match(/^\s*([\w.-]+\/[\w.-]+#\d+)\s*[:—–-]?\s*([\s\S]+)$/),n=r&&e.find(s=>s.pullRequest?.toLowerCase()===r[1].toLowerCase());return r&&n?{quote:r[2],scope:[n],unknownPrefix:!1}:{quote:t,scope:e,unknownPrefix:!!r}}function tD(e,t){let{quote:r,scope:n,unknownPrefix:s}=kV(e,t);return s?Ucr(n,r):n.some(i=>Qpe(i.body,r))}var ng=Y(require("fs")),ys=Y(require("path"));var Zm=b.string().trim().min(1),fp=72,Lcr=b.object({repository:Zm.optional().describe("owner/repo of the checkout this lint ran in, when the run has several; omit for the working checkout"),tool:b.string(),command:b.string().describe("the exact command you ran, scoped to the changed files"),clean:b.boolean(),notRun:b.string().optional().describe("why no linter checked the files, when none could (SKYR-5827): then `clean` is false and does not hold the tests back"),fixed:b.array(b.string()).optional().describe("files you fixed"),uncovered:b.array(b.string()).describe("changed/new files this linter's own config does not match (wrong extension, wrong directory) \u2014 so `clean` never examined them, even though CI may still execute them. Empty array, not omitted, when every changed/new file IS covered.")});var Upe=b.object({schemaVersion:b.literal(1),lint:b.array(Lcr).min(1).describe("one entry per checkout this run wrote tests in, each run from that checkout"),fileConventions:b.object({ok:b.boolean(),notes:b.string().optional()}),ciReadiness:b.object({covered:b.boolean().describe("will the repo's CI run these tests?"),notes:b.string().optional(),unrecorded:b.array(b.string()).optional().describe("tests with no record of whether CI runs them: not covered, and not known to be left out")}),dependencies:b.object({added:b.array(b.object({package:b.string(),manifest:b.string(),repository:Zm.optional().describe("owner/repo of the manifest's checkout; omit for the working checkout"),reason:Zm.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).describe("every package added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own")}),support:b.array(b.object({file:Zm,repository:Zm.optional().describe("owner/repo of the file's checkout; omit for the working checkout")})).optional().describe("the files the tests need besides themselves (helper modules, page objects, fixtures, snapshots), delivered with them"),commit:b.object({message:Zm.refine(e=>e.split(`
359
359
  `)[0].length<=fp,{message:`subject line must be <= ${fp} chars`})}),pr:b.object({title:Zm.max(fp,`must be <= ${fp} chars`),body:Zm}),ready:b.boolean().describe("a statement of fact: true only if the tests are fit to commit as they stand"),blockers:b.array(b.string()).describe("what blocks the commit \u2014 required non-empty when ready is false"),summary:Zm.describe("one paragraph")});function pS(e){return(e?.blockers??[]).slice(0,3).join("; ")}var Xm=Y(require("fs")),hS=Y(require("path"));var e7e=Y(require("fs")),aT=Y(require("path"));var os="{junit}",rD=(o=>(o.Junit="junit",o.Trx="trx",o.GoTestJson="go-test-json",o.JestJson="jest-json",o.PlaywrightList="playwright-list",o.Build="build",o))(rD||{}),Lpe=(t=>(t.Minitest="minitest",t))(Lpe||{}),XXe=b.string().trim().min(1),fS=b.object({cwd:XXe.describe('repo-relative directory the command starts in ("." for the root)'),argv:b.array(XXe).min(1).describe(`the command as separate arguments, run without a shell; for a junit or trx report an argument or env value holds ${os}, where the report is written (not for Maven or Gradle, whose build writes its own)`),env:b.record(b.string(),b.string()).optional().describe("plain test or reporter settings beyond the repository's CI test job (RAILS_ENV=test, PLAYWRIGHT_JUNIT_OUTPUT_FILE={junit}); never a credential, PATH, or a tool's install path"),report:b.object({format:b.nativeEnum(rD).describe(`junit (JUnit XML to ${os}), trx (to ${os}), jest-json (Jest's --json or Vitest's --reporter=json, --outputFile=${os}), go-test-json (go test -json on the command's output), or build (only in importerRun: a command that builds the test files without running them, and writes no report)`),reporter:b.nativeEnum(Lpe).optional().describe("a reporter Testbot loads for a runner that writes no report: minitest")}).optional().describe("the report the command writes; junit when omitted")}),Wy=e=>e.report?.format??"junit",TV=/(?:^|\/)(?:mvnw?|gradlew?)(?:\.cmd)?$/,jcr=e=>Wy(e)==="build"||Wy(e)==="go-test-json"||Wy(e)==="playwright-list"||Wy(e)==="junit"&&TV.test(e.argv[0]??""),qcr=new Set(["sh","bash","zsh","dash","ksh","fish","csh","tcsh","env","sudo","doas","eval","exec","xargs","nohup","nice","timeout","time","watch","cmd","cmd.exe","powershell","pwsh"]),zcr=/^(PATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|NODE_PATH|RUBYOPT|RUBYLIB|GEM_HOME|GEM_PATH|PERL5OPT|PERL5LIB|PYTHONSTARTUP|PYTHONPATH|PYTHONHOME|CLASSPATH|JAVA_HOME|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|JDK_JAVA_OPTIONS|MAVEN_OPTS|GRADLE_OPTS|DOTNET_STARTUP_HOOKS|DOTNET_ROOT|GOROOT|GOFLAGS|BASH_ENV|ENV|GH_TOKEN|(AWS|ANTHROPIC|CLAUDE_CODE|GITHUB|ACTIONS|RUNNER)_\w+)$/i,Gcr=4;function nD(e,t,r=[]){let n=[];aT.isAbsolute(t.cwd)?n.push(`starts in ${t.cwd}, which is not repo-relative`):sn(e,t.cwd)?e7e.statSync(aT.resolve(e,t.cwd),{throwIfNoEntry:!1})?.isDirectory()||n.push(`starts in ${t.cwd}, which is not a directory of the repository`):n.push(`starts in ${t.cwd}, outside the repository`);let s=aT.basename(t.argv[0]??"");qcr.has(s)&&n.push(`runs through ${s} \u2014 give the test runner's own command, without a shell or wrapper (a setting it needs goes in "env")`);for(let[i,o]of Object.entries(t.env??{}))/^[A-Za-z_][A-Za-z0-9_]*$/.test(i)?zcr.test(i)?n.push(`sets ${i} in env \u2014 env holds the tests' own settings, never a search path, a tool's install or Testbot's own configuration`):r.some(a=>a.length>=Gcr&&o.includes(a))&&n.push(`sets ${i} to a secret of this run \u2014 a credential is never written into a run`):n.push(`sets env "${i}", which is not a variable name`);return n}function Kl(e,t,r=[],n={}){let s=nD(e,t,r),i=Wy(t);i==="build"&&!n.build&&s.push(`reports ${i}, which reports no test: give the report its runner writes of the tests`);let o=[...t.argv,...Object.values(t.env??{})].some(a=>a.includes(os));return!o&&!t.report?.reporter&&!jcr(t)&&s.push(`never writes its report to ${os} \u2014 name it in the argument or env setting the runner's ${i==="trx"?"TRX logger":i==="jest-json"?"JSON report (--outputFile)":"JUnit reporter"} writes to, or give report.reporter when the runner has none`),(i==="go-test-json"||i==="playwright-list"||i==="build")&&o&&s.push(`reports ${i} on its output, so it names no ${os}`),t.report?.reporter&&i!=="junit"&&s.push(`names reporter ${t.report.reporter}, which writes junit, but its format is ${i}`),s}function t7e(e,t){return e.argv.map(r=>r.split(os).join(t))}function r7e(e,t){return Object.fromEntries(Object.entries(e.env??{}).map(([r,n])=>[r,n.split(os).join(t)]))}var cT="a framework other than pytest, jest, vitest and node --test (go test, rails test, mvn, dotnet test), or one the repository's test script runs through another command (ng test, nx test)",_V='When you mount the checkout into a container (docker run -v "$PWD":\u2026), pass --user "$(id -u):$(id -g)", or mount a copy of the checkout instead: a container that runs as root leaves files in the checkout (target/, build/) that this runner cannot change.',uT=`pytest, Jest, Vitest and node --test tests run as the run already knows them, unless the repository's test script runs them through another command (ng test, nx test), which may be the only one that compiles them. A test in any other framework, or one run that way, also gives "run": the repository's own command for only those tests, from the directory the repository runs it in, as separate arguments without a shell. Its "report" says what the runner writes: junit (JUnit XML to ${os} in the reporter's argument or env setting), trx (a TRX file to ${os}, which every dotnet test writes with its built-in logger), jest-json (Jest's --json --outputFile=${os}, or Vitest's --reporter=json --outputFile=${os}: built in, no reporter package), or go-test-json (go test -json, read from the command's output). A Maven or Gradle command names no ${os}: its build writes JUnit XML to its own report directory, which the run reads. Use a reporter the repository already has, or one of those; a reporter or converter the command fetches is the version the repository pins, or else its latest release (an older one may not build with the repository's toolchain). For minitest, which writes none, give report.reporter "minitest" and the run fills ${os} itself. A setting the tests or reporter read goes in "env" (RAILS_ENV=test, or PLAYWRIGHT_JUNIT_OUTPUT_FILE=${os} with playwright test --reporter=junit): the run sets it, so never wrap the command in a shell to set one. The run sets CI=1, as a CI job does: if your own run needed CI unset or set otherwise, give CI that value in "env" (empty when unset). The run replaces ${os} in argv and env with its report path, executes the command, and reads that report.`;var Zl=(s=>(s.ExistingEvidenceSufficient="existing_evidence_sufficient",s.TargetedUnit="targeted_unit",s.RuntimeRequired="runtime_required",s.BlockedPreflight="blocked_preflight",s))(Zl||{}),Sc=(i=>(i.ExistingEvidence="existing_evidence",i.Unaffected="unaffected",i.ExistingUnit="existing_unit",i.NewUnit="new_unit",i.Runtime="runtime",i))(Sc||{}),sD=(r=>(r.Repository="repository",r.Testbot="testbot",r))(sD||{}),jpe=(n=>(n.Identified="identified",n.Passed="passed",n.Failed="failed",n))(jpe||{}),su=b.string().trim().min(1),Hcr=b.string().regex(/^[a-z0-9][a-z0-9-]*$/,"must be a short lowercase slug").describe("short-slug"),n7e="When no native unit tests exercise the change, write no repository evidence. Absence of tests is not evidence: say in the rationale that no tests exist.",Vcr=b.object({id:Hcr,source:b.nativeEnum(sD),kind:b.nativeEnum(iy),outcome:b.nativeEnum(jpe),summary:su.max(400).describe("one line: what it shows"),tests:b.array(su).optional().describe("source repository: the existing tests, as repo-relative paths, optionally path::test-name"),repository:su.optional().describe("source repository: owner/repo the tests live in, when the run has several checkouts; omit for the working checkout"),command:su.optional().describe("source testbot: the exact command you ran, as you ran it"),run:fS.optional().describe(`source repository, for tests in ${cT}: how the run executes the whole of each of these test files, all of them in one command, never narrowed to the named tests and never only listed, with the repository's own runner writing JUnit XML to {junit}. A test is credited to a file only by its name or by a report that names the file`)}),Wcr=b.object({behaviorId:su.describe("an id from analyze's behaviors"),mechanism:b.nativeEnum(Sc),evidenceIds:b.array(su).default([]).describe("existing_evidence: the ci-<n> or evidence ids that establish it; existing_unit: the evidence id naming the tests to run"),covers:b.string().trim().optional().describe('new_unit / runtime: the missing evidence this obtains, e.g. "the boundary the change moved"; unaffected: why the change cannot reach it, citing path:line')}),NV=(n=>(n.Browser="browser",n.RunningApp="running-app",n.Outside="outside",n))(NV||{}),Jcr=b.object({behaviorId:b.string().trim().optional().describe("an id from analyze's behaviors, when it is about one"),missing:su.max(600).describe("the evidence that is required and cannot be obtained in this run"),needs:b.nativeEnum(NV).optional().describe("what that evidence needs: browser (only a real browser shows it), running-app (only the running app or its server shows it: its real requests, sign-in and permissions, what it saves), or outside (something the running app here could not give either: a third-party service it calls, hardware)")}),Ycr=b.object({file:su.describe("the changed file the failure is in"),repository:su.optional().describe("owner/repo the file is in, when the run has several checkouts; omit for the working checkout"),reason:su.max(300).describe("what prerequisite the change fails"),evidence:su.max(400).describe("the error line, quoted")}),Kcr=b.object({behaviorId:su.describe("an id from analyze's behaviors"),reason:su.max(600).describe("\u2264600 characters: why this change leaves the behavior's result as it was, citing the unchanged line that decides it (path:line)")}),iD=b.object({schemaVersion:b.literal(1),decision:b.nativeEnum(Zl),evidence:b.array(Vcr).describe("evidence this session found or produced; CI results are the ci-<n> items and are not restated here"),plan:b.array(Wcr).describe("how each changed behavior's evidence is obtained"),gaps:b.array(Jcr),outOfScope:b.array(Kcr).optional().describe("behaviors analyze found that this change neither changes nor states"),blocked:Ycr.optional().describe("only for blocked_preflight"),rationale:su.max(1200).describe("\u22641200 characters: why this evidence is enough, or what it still lacks \u2014 the scope you chose and why")}),oD=new Set(["runtime"]),s7e=new Set(["existing_unit","new_unit"]);function Kn(e){let t=ue(e,"recommend.json");if(!t||!Array.isArray(t.generate)||!Array.isArray(t.maintenance))return;let r=t;return{...r,maintenance:r.maintenance.map(({repository:n,...s})=>({...s,test:s.test.trim().replace(/^\.\//,""),...n?.trim()?{repository:n.trim()}:{}}))}}var zpe=".skyramp/staged";function Xcr(e){return zs(tse,e).errors}function eur(e,t=[]){let{value:r,error:n}=is(e,t);if(n)return{errors:[n]};let s=Xcr(r);return s.length>0?{errors:s}:{generate:r,errors:[]}}function PV(e,t=[]){return eur(e.stdout,t)}function tur(e){return e.generate.filter(t=>t.type!=="ui").map(t=>t.id)}function Gpe(e){return e.generate.filter(t=>t.type==="ui").map(t=>t.id)}var BV={backend:{stage:"generate",cases:tur,noRecommendCoverage:"recommend.json missing or malformed \u2014 cannot check coverage",noRecommendIntent:"recommend.json missing or malformed \u2014 cannot check intent",uncovered:e=>`recommend case "${e}" is not covered by any generated test`,unknownCovered:e=>`test covers unknown recommend id "${e}"`,unasserted:e=>`case "${e}" has no verified assertion enforcing its expected_observable`,usedCodegen:TZe,codegenHint:"These tests were hand-written. Skyramp codegen (skyramp_contract_test_generation / skyramp_integration_test_generation) was available but not used \u2014 it computes valid sample data and response correlations. Prefer scaffolding with it and then refining, especially for the failures above."},ui:{stage:"generate-ui",cases:Gpe,noRecommendCoverage:"recommend.json not found \u2014 cannot check UI coverage",noRecommendIntent:"recommend.json not found \u2014 cannot check UI intent",uncovered:e=>`UI case "${e}" is not covered by any generated UI test`,unknownCovered:e=>`test covers "${e}" which is not a recommend UI case`,unasserted:e=>`UI case "${e}" has no verified assertion enforcing its expected_observable`,usedCodegen:_Ze,codegenHint:"This UI test was hand-authored. Skyramp UI codegen (skyramp_ui_test_generation) was available but not used. Prefer scaffolding with it and then refining, especially for the failures above."}},oIn=ko("generate-schema",(e,t)=>PV(t,e.secretValues));function rur(e){let t=BV[e];return{name:`${t.stage}-coverage`,verify(r,n){let{generate:s,errors:i}=PV(n,r.secretValues);if(!s)return er(this.name,i);let o=Kn(r);if(!o)return er(this.name,[t.noRecommendCoverage]);let a=new Set(s.tests.flatMap(d=>d.covers)),c=[],u=t.cases(o);for(let d of u)a.has(d)||c.push(t.uncovered(d));let l=new Set(e==="ui"?u:o.generate.map(d=>d.id));for(let d of a)l.has(d)||c.push(t.unknownCovered(d));if(e==="backend"){let d=new Set(s.deferredUi),p=new Set(Gpe(o));for(let f of p)!d.has(f)&&!a.has(f)&&c.push(`UI case "${f}" is neither covered nor deferred to the UI stage`);for(let f of d)p.has(f)||c.push(`deferredUi lists "${f}" which is not a UI case`)}return c.length===0?{name:this.name,passed:!0}:er(this.name,c)}}}function nur(e){let t=BV[e];return{name:`${t.stage}-intent`,verify(r,n){let{generate:s,errors:i}=PV(n,r.secretValues);if(!s)return er(this.name,i);let o=Kn(r);if(!o)return er(this.name,[t.noRecommendIntent]);let{asserted:a,errors:c,badFiles:u}=pur(s,r.inputs.repositoryPath),l=c.length;for(let p of t.cases(o))a.has(p)||c.push(t.unasserted(p));if(c.length===0)return{name:this.name,passed:!0};let d=er(this.name,c);return l>0&&l===c.length&&u.size>0?{...d,droppable:[...u]}:d}}}function sur(e){let t=BV[e];return r=>{if(!r.inputs.skyrampMcp?.command||e==="backend"&&!mpe(r))return;let n=hS.join(r.outputsDir,`${t.stage}-stream.ndjson`);if(!(!Xm.existsSync(n)||t.usedCodegen(n)))return NZe(n)?t.codegenHint:"Skyramp codegen tools were configured but the MCP server did not connect this session, so they were not available. Hand-authoring was the only option; this is an environment problem, not yours."}}var aIn=rur("backend"),cIn=nur("backend"),uIn=sur("backend");var i7e=e=>e.replace(/\s+/g,"");function iur(e){let t=['"""',"'''"],r="",n=0,s=e.length;for(;n<s;){let i=e.slice(n,n+3),o=t.find(u=>u===i);if(o){let u=e.indexOf(o,n+3);n=u===-1?s:u+3;continue}let a=e.slice(n,n+2);if(a==="//"||a==="/*"){let u=a==="//"?e.indexOf(`
360
360
  `,n):e.indexOf("*/",n);n=u===-1?s:a==="//"?u:u+2;continue}let c=e[n];if(c==="#"){let u=e.indexOf(`
361
361
  `,n);n=u===-1?s:u;continue}if(c==='"'||c==="'"||c==="`"){for(n++;n<s&&e[n]!==c;)n+=e[n]==="\\"?2:1;n++;continue}r+=c,n++}return r}var aD={python:[/\bassert\s*[({\w"'`]/g,/\bpytest\.raises\s*\(/g,/\bself\.assert\w*\s*\(/g],typescript:[/\bexpect\s*\(/g,/\.should\b/g,/\bassert\s*[.(]/g],go:[/\bt\.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)\s*\(/g,/\b(assert|require)\.\w+\s*\(/g],java:[/\bassert\w*\s*\(/g,/\bassertThat\s*\(/g],ruby:[/\bexpect\s*[({]/g,/\bassert\w*\b/g,/\.should\b/g]};for(let[e,t]of[["javascript","typescript"],["kotlin","java"]])aD[e]=aD[t];function our(e){let t=Sf(e);return t!==void 0&&t in aD?t:void 0}function qpe(e,t){let r=our(t);if(!r)return;let n=iur(e);return aD[r].reduce((s,i)=>s+(n.match(i)?.length??0),0)}function $V(e,t,r){let n=i=>{try{return Xm.readFileSync(i,"utf-8")}catch{return""}},s=qpe(n(hS.resolve(e,t)),t);if(s!==void 0)return r(e,t).reduce((i,o)=>i+(qpe(n(o),o)??0),s)}function aur(e,t){if(e.includes(XB(t))||i7e(e).includes(i7e(t)))return!0;let r=t.split(/\r?\n/).map(n=>n.trim()).filter(n=>n&&!/^(\/\/|#|\*|\/\*)/.test(n));return r.length>0&&r.every(n=>e.includes(XB(n)))?!0:dur(e,t)}var cur=/\bassert\w*\b|\bexpect\s*\(|\.should\b|\brequire\s*\(/i,uur=12,lur=/,\s*\(\s*#|,\s*f?["'`]|\s+#\s|\s+\/\/|\s*\((?:line|lines|at line)\b|\s*,\s*$/i;function dur(e,t){let r=t.split(/\s*;\s*|\s*\.\.\.\s*|\r?\n/),n=0;for(let s of r){let i=cur.exec(s);if(!i)continue;let o=s.slice(i.index),a=lur.exec(o);if(a&&(o=o.slice(0,a.index)),o=XB(o).replace(/[,\s]+$/,""),o.length<uur||!e.includes(o))return!1;n++}return n>0}function pur(e,t){let r=new Set,n=[],s=new Set;for(let i of e.tests){let o=hS.resolve(t,i.file);if(!Xm.existsSync(o))continue;let a=XB(Xm.readFileSync(o,"utf-8"));for(let c of i.assertions??[]){if(!aur(a,c.evidence)){n.push(`assertion evidence for "${c.case}" not found in ${i.file} \u2014 cite the real assertion line`),s.add(i.file);continue}i.covers.includes(c.case)?r.add(c.case):(n.push(`assertion cites case "${c.case}" not in that test's covers[]`),s.add(i.file))}}return{asserted:r,errors:n,badFiles:s}}var fur=/\.(spec|test)\.[cm]?[jt]sx?$/i;function o7e(e){let t;try{t=mt([...yr,"status","--porcelain","--untracked-files=all"],{env:ze(),cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]})}catch{return}let r=s=>/_scaffold/i.test(s)||Hu.test(s),n=[];for(let s of t.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyramp/testbot-core",
3
- "version": "0.13.3-v3.565",
3
+ "version": "0.13.3-v3.566",
4
4
  "description": "Skyramp Testbot engine: AI-powered deterministic test generation, execution and maintenance",
5
5
  "main": "dist/main.js",
6
6
  "//files": "An explicit allowlist, never a glob. `dist/` is gitignored, so without this key npm's .gitignore fallback would publish a package with no engine in it; with a glob it would publish the sourcemaps, whose sourcesContent embeds every src/*.ts verbatim. dist/VERSION.json exists only in a release-engine.yml build.",