@skyramp/testbot-core 0.12.0-v3.34 → 0.12.0-v3.35
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/main.js +163 -163
- package/dist/post.js +2 -2
- package/package.json +1 -1
package/dist/post.js
CHANGED
|
@@ -212,11 +212,11 @@ ${o?At().abandonedBody:At().cancelledBody}
|
|
|
212
212
|
${s.join(`
|
|
213
213
|
`)}
|
|
214
214
|
|
|
215
|
-
<sub>[${At().workflowRunLinkLabel}](${e})</sub>`}sT();sT();sT();hf();function XH(t,e){if(process.env.GITHUB_ACTIONS)return new Rg(t,SAe,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}ut();var Aw=(r=>(r.Sufficient="sufficient",r.Insufficient="insufficient",r))(Aw||{}),yw=(d=>(d.RelatedChangeConflict="related_change_conflict",d.ReferenceOutsideTarget="reference_outside_target",d.SourceAccessLost="source_access_lost",d.ConfigurationIncomplete="configuration_incomplete",d.CredentialUnavailable="credential_unavailable",d.WorkflowBindingUnverified="workflow_binding_unverified",d.WorkflowRefUnprotected="workflow_ref_unprotected",d.DeploymentReview="deployment_review",d.SutRevisionMismatch="sut_revision_mismatch",d.IsolationUnavailable="isolation_unavailable",d.EvidenceInsufficient="evidence_insufficient",d))(yw||{}),ju=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(ju||{}),oT=(n=>(n.Application="application",n.Environment="environment",n.TestDefect="test_defect",n))(oT||{}),aT=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(aT||{});var cT=(n=>(n.Seed="seed",n.RuntimeMock="runtime_mock",n.EnvOverride="env_override",n))(cT||{}),lT=(n=>(n.TestCode="test_code",n.SkyrampMocker="skyramp_mocker",n.RecipeOverride="recipe_override",n))(lT||{});var Tg=(r=>(r.Ready="ready",r.Blocked="blocked",r))(Tg||{}),vn=b.string().trim().min(1),Hnt=b.object({action:b.enum(["start","run","wait"]),text:vn,source:b.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:vn.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(t=>t.source==="file"==(t.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),ez={steps:b.array(Hnt).max(20).optional().describe("how it starts, in order"),kind:b.enum(["web_app","service","database","external_service"]).optional(),from:b.object({file:vn,service:vn.nullable()}).strict().optional()},znt=b.object({name:vn,repository:vn.describe("owner/repo of the repository the component is built from"),healthy:b.boolean(),...ez}),jnt=b.object({component:vn,problem:vn,evidence:vn.describe("the exact command and output that shows it"),fix:vn.describe("what the user must provide, and where")}),Vnt=b.object({framework:vn,file:vn.describe("the test file run, relative to its repository root"),result:b.enum(["pass","fail","error"])}),Wnt=b.object({input:vn.describe("the part of the user's SUT input, as given"),reason:vn}),Ew=b.object({schemaVersion:b.literal(1),status:b.nativeEnum(Tg).describe("ready only if every component came up healthy and the recipe is written"),components:b.array(znt),suites:b.array(Vnt).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:b.array(vn).default([]).describe("the parts of the user's SUT input the recipe used"),inputsUsedHow:b.array(b.object({input:vn.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:vn.describe("what the recipe did with it")})).optional(),inputsNotUsed:b.array(Wnt).default([]).describe("the parts it did not use, and why"),blockers:b.array(jnt).describe("required (non-empty) when status is blocked")});function tz(t){if(t.status==="blocked"&&!(Array.isArray(t.blockers)&&t.blockers.length>0))return['status "blocked" requires at least one blocker { component, problem, evidence, fix } \u2014 say what stopped the bring-up'];if(t.status==="ready"){let e=Array.isArray(t.components)?t.components:[];if(e.length===0)return['status "ready" requires at least one component \u2014 name each component the recipe brought up healthy'];let r=e.filter(n=>n?.healthy!==!0).map(n=>String(n?.name??"?"));if(r.length>0)return[`status "ready" requires every component healthy; not healthy: ${r.join(", ")} \u2014 answer "blocked" with a blocker for each, or bring them up and answer "ready" again`]}return[]}var mf=64*1024,gf=512*1024,uT=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var BAe=V(require("path"));var Af=(i=>(i.Clean="clean",i.RecipeDrift="recipe-drift",i.ChangeBrokeBringup="change-broke-bringup",i.BringupFailed="bringup-failed",i))(Af||{}),Vu=b.string().trim().min(1),Ynt=b.object({url:b.string().optional().describe("the URL probed, if the check is an HTTP request"),command:b.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:b.record(b.string()).optional(),status:b.union([b.number(),b.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Vu.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),bw=b.object({schemaVersion:b.literal(1),baseUrls:b.record(b.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:Ynt.optional(),teardown:Vu.describe("command that tears the SUT down"),dependencies:b.record(b.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:b.nativeEnum(Af).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:b.array(b.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:b.object({command:Vu,output:Vu}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:b.array(b.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:b.boolean(),startedAt:Vu.describe("ISO timestamp"),revisions:b.array(b.object({component:Vu.describe("a shared component listed above"),url:Vu.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Vu.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).optional().describe("only when shared components are listed above: one check per component whose deployed commit you found")});function rz(t){let e=[],r=i=>!!i&&typeof i=="object"&&!Array.isArray(i);return t.outcome!=="change-broke-bringup"&&t.outcome!=="bringup-failed"?(!r(t.baseUrls)||Object.keys(t.baseUrls).length===0?e.push("baseUrls must be a non-empty object of service \u2192 url"):Object.values(t.baseUrls).every(i=>typeof i=="string"&&i.trim())||e.push("every baseUrls value must be a non-empty url string"),r(t.health)?!(typeof t.health.url=="string"&&t.health.url.trim())&&!(typeof t.health.command=="string"&&t.health.command.trim())&&e.push("health must record a url or a command (what you actually ran)"):e.push("health must be an object"),(!r(t.dependencies)||Object.keys(t.dependencies).length===0)&&e.push("dependencies must be a non-empty object of name \u2192 boolean (real vs mocked) when the SUT came up \u2014 account for every backing service so a mocked one can't be hidden behind a green run")):(r(t.bringupError)||e.push(`outcome "${String(t.outcome)}" requires bringupError { command, output } \u2014 the exact failing bring-up command and what it printed`),t.outcome==="change-broke-bringup"&&!(Array.isArray(t.suspectFiles)&&t.suspectFiles.length>0&&t.suspectFiles.every(i=>typeof i=="string"&&i.trim()))&&e.push("change-broke-bringup requires non-empty suspectFiles[] \u2014 the changed file(s) the failure points at; if you cannot point at a file this PR changed, the outcome is bringup-failed (environment/harness), not the PR's fault")),t.outcome==="recipe-drift"&&!(Array.isArray(t.recipeFixes)&&t.recipeFixes.length>0)&&e.push("recipe-drift outcome requires a non-empty recipeFixes[] describing what was corrected"),e}var di=b.string().trim().min(1),vAe=b.object({schemaVersion:b.literal(1),status:b.enum(["ready","blocked"]),components:b.array(b.object({name:di,repository:di.describe("owner/repo"),healthy:b.boolean(),url:b.string().min(1).nullable(),...ez}).strict()),suites:b.array(b.object({framework:di,file:di,result:b.enum(["pass","fail","error"])}).strict()),inputsUsed:b.array(di),inputsUsedHow:b.array(b.object({input:di,how:di}).strict()).optional(),inputsNotUsed:b.array(b.object({input:di,reason:di}).strict()),blockers:b.array(b.object({component:di,problem:di,evidence:di,fix:di}).strict()),replay:b.object({outcome:di,durationSeconds:b.number().nonnegative().nullable()}).strict().nullable(),files:b.array(b.object({path:di,content:b.string()}).strict())}).strict().superRefine((t,e)=>{t.inputsUsedHow?.forEach((r,n)=>{t.inputsUsed.includes(r.input)||e.addIssue({code:b.ZodIssueCode.custom,path:["inputsUsedHow",n,"input"],message:"not one of inputsUsed"})})}),L2t=["clean","recipe-drift"];function dT(t){let e=BAe.posix.normalize(t);return e===t&&(e===".skyramp/workspace.yml"||e.startsWith(".skyramp/sut/")&&e.length>13)}var RAe=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"];var hT=(e=>(e.GitHub="github",e))(hT||{}),iz=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(iz||{}),mT=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s))(mT||{}),Jnt=["sut_setup"],Knt=["sut_setup","schedule"];var sz=(e=>(e.PullRequest="pull_request",e))(sz||{}),gT=(i=>(i.ModelProvider="model_provider",i.SutAccess="sut_access",i.Skyramp="skyramp",i.Other="other",i))(gT||{});var AT=(i=>(i.ReportUploaded="report_uploaded",i.NoReport="no_report",i.Cancelled="cancelled",i.RecipeUploaded="recipe_uploaded",i))(AT||{}),QAe=(r=>(r.Running="running",r.Ended="ended",r))(QAe||{}),yT=(s=>(s.TimedOut="timed_out",s.AgentFailed="agent_failed",s.SetupFailed="setup_failed",s.CredentialMissing="credential_missing",s.RunnerLost="runner_lost",s))(yT||{}),oz=(r=>(r.Onboard="onboard",r.Deploy="deploy",r))(oz||{}),az=(r=>(r.Started="started",r.Finished="finished",r))(az||{}),cz=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(cz||{});var ET=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(ET||{}),bT=(i=>(i.Found="found",i.Starting="starting",i.Up="up",i.OutOfScope="out_of_scope",i))(bT||{}),Wu=b.string().regex(/^[1-9][0-9]{0,18}$/),ww=b.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),yl=b.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),Ng=b.string().regex(/^[0-9a-f]{64}$/),fT=b.object({id:yl,revision:Wu}).strict(),Ho=b.object({provider:b.nativeEnum(hT),providerAccountId:Wu,providerRepositoryId:Wu}).strict(),nz=t=>`${t.provider}:${t.providerRepositoryId}`,_Ae=Ho.extend({namespace:b.string().min(1),name:b.string().min(1)}).strict(),Znt=b.object({repository:_Ae,revision:ww,ref:b.string().nullable(),reason:b.nativeEnum(iz),change:b.object({kind:b.nativeEnum(sz),number:Wu,base:b.object({ref:b.string().min(1),revision:ww}).strict().optional()}).strict().nullable()}).strict();function Xnt(t){let e=t.baseline.sources,r=t.trigger.kind==="schedule"&&t.baseline.confirmedRunId!==null;if(!e)return r?"names every source of the snapshot, once":null;if(t.baseline.confirmedRunId===null)return"a run with no Confirmed Baseline names no baseline sources";let n=new Set(t.sources.map(o=>nz(o.repository))),i=new Set(e.map(o=>nz(o.repository)));return i.size===e.length&&i.size===n.size&&[...i].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var eit=b.object({schemaVersion:b.literal(1),runId:yl,skyrampOrgId:yl,target:fT,policy:fT.nullable(),trigger:b.object({kind:b.nativeEnum(mT),requestedAt:b.string().datetime()}).strict(),configuration:b.object({captureId:yl,revision:Wu.nullable(),hash:Ng}).strict(),baseline:b.object({confirmedRunId:yl.nullable(),sources:b.array(b.object({repository:Ho,revision:ww}).strict()).optional()}).strict(),sources:b.array(Znt).min(1),execution:b.object({provider:b.nativeEnum(hT),repository:_Ae,workflowPath:b.string(),ref:b.string()}).strict(),credentials:b.array(b.object({name:b.string(),purpose:b.nativeEnum(gT),required:b.boolean()}).strict())}).strict().superRefine((t,e)=>{let r=t.trigger.kind,n=Jnt.includes(r);n!==(t.policy===null)&&e.addIssue({code:b.ZodIssueCode.custom,path:["policy"],message:n?`a ${r} run has no policy`:"names the policy revision"});let i=Xnt(t);i&&e.addIssue({code:b.ZodIssueCode.custom,path:["baseline","sources"],message:i}),Knt.includes(r)&&t.sources.forEach((s,o)=>{s.reason!=="BASELINE"&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",o,"reason"],message:`a ${r} run selects only BASELINE sources`})})});var z2t=b.object({schemaVersion:b.literal(1),attempt:b.object({id:yl,number:b.number().int().positive(),deadlineAt:b.string().datetime()}).strict(),manifest:eit,manifestHash:Ng,entitlements:b.array(b.string()).optional(),runToken:b.string().min(1).optional()}).strict(),j2t=b.object({schemaVersion:b.literal(1),runId:yl,execution:b.object({provider:b.nativeEnum(hT),repository:Ho,providerRunId:Wu,providerRunAttempt:b.number().int().positive(),workflowRef:b.string().min(1)}).strict()}).strict(),TAe=b.object({repository:Ho,number:Wu}).strict(),tit=b.discriminatedUnion("status",[b.object({status:b.literal("none")}).strict(),b.object({status:b.literal("delivered"),pullRequests:b.array(TAe).min(1)}).strict(),b.object({status:b.literal("partial"),pullRequests:b.array(TAe).min(1),failures:b.array(b.object({repository:Ho,message:b.string()}).strict()).min(1)}).strict(),b.object({status:b.literal("failed"),message:b.string()}).strict()]),rit=b.object({sufficiency:b.nativeEnum(Aw),rationale:b.string().min(1),gaps:b.array(b.string().min(1)),acceptedEvidence:b.array(b.object({kind:b.nativeEnum(ju),repository:b.string().min(1),revision:ww,reference:b.string().min(1),summary:b.string().min(1)}).strict()),actionRequired:b.array(b.nativeEnum(yw))}).strict().superRefine((t,e)=>{t.sufficiency==="sufficient"!=(t.gaps.length===0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["gaps"],message:"sufficient evidence has no gaps, and insufficient evidence names at least one"}),new Set(t.actionRequired).size!==t.actionRequired.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),kg=500,lz=2048,uz=1e3,nit=b.object({testResults:b.array(b.object({resultId:b.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:b.string().regex(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/),testType:b.string(),endpoint:b.string(),status:b.enum(["Pass","Fail","Skipped"]),details:b.string(),fileName:b.string().optional(),testId:b.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:b.object({kind:b.nativeEnum(oT),family:b.nativeEnum(aT).optional()}).strict().optional()}).strict()),validation:rit,changes:b.array(b.object({id:b.string().min(1).max(512),text:b.string().max(16384),source:b.string().max(lz),testedBy:b.array(b.string().min(1).max(1024)).max(kg),writtenBy:b.array(b.string().min(1).max(1024)).max(kg),maintainedBy:b.array(b.string().min(1).max(1024)).max(kg)}).strict()).max(uz).optional(),traceVersion:b.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,i)=>{let s=n.failureCause;s&&n.status==="Pass"&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",i,"failureCause"],message:"a passing result has no failure cause"}),s&&s.kind==="environment"!=(s.family!==void 0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",i,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",i,"resultId"],a=n.resultId.slice(`${n.repository}:${n.testType}:`.length);(!n.resultId.startsWith(`${n.repository}:${n.testType}:`)||a===""||a.startsWith("/")||a.startsWith("#"))&&e.addIssue({code:b.ZodIssueCode.custom,path:o,message:"is not repository:testType:path for this result"}),r.has(n.resultId)&&e.addIssue({code:b.ZodIssueCode.custom,path:o,message:"stable identity repeated"}),r.add(n.resultId)})}),kAe=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function dz(t,e,r,n){let i=r.replace(/\\/g,"/"),s=i.split("/").filter(c=>c!==""&&c!==".");if(i.startsWith("/")||/^[A-Za-z]:/.test(i)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=s.join("/"),a=`${t}:${e}:${kAe(o)}`;return n?`${a}#${kAe(n)}`:a}var iit=b.object({schemaVersion:b.literal(1),run:b.object({runId:yl,attemptNumber:b.number().int().positive(),manifestHash:Ng}).strict(),target:fT,policy:fT,provenance:b.object({sources:b.array(b.object({repository:Ho,revision:ww}).strict())}).strict(),delivery:b.object({generatedTests:tit}).strict(),producer:b.object({testbot:b.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:b.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:nit}).strict(),V2t=iit.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:vAe}).strict().superRefine(({recipe:t},e)=>{let r=(s,o)=>e.addIssue({code:b.ZodIssueCode.custom,path:["recipe",...s],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,i=0;t.files.forEach((s,o)=>{dT(s.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(s.path)&&r(["files",o,"path"],"file repeated"),n.add(s.path),uT.test(s.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(s.content,"utf8");i+=a,a>mf&&r(["files",o,"content"],`larger than ${mf} bytes`)}),i>gf&&r(["files"],`recipe text over ${gf} bytes in total`)}),sit=b.object({schemaVersion:b.literal(1),stage:b.nativeEnum(oz),event:b.nativeEnum(az),status:b.nativeEnum(cz).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),PAe=100,DAe=5e3,OAe=2e3,oit=100,ait=200,cit=500,pz=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,pT=t=>b.string().max(t).refine(e=>e.trim().length>0&&!pz.test(e),"blank, or not text"),NAe={sequence:b.number().int().min(1).max(DAe),at:b.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},MAe=b.discriminatedUnion("kind",[b.object({...NAe,kind:b.literal("log"),phase:b.nativeEnum(ET),text:pT(OAe)}).strict(),b.object({...NAe,kind:b.literal("component"),name:pT(oit),repository:pT(ait).refine(t=>/^[^/\s]+\/[^/\s]+$/.test(t),"not owner/name"),file:pT(cit).nullable(),status:b.nativeEnum(bT)}).strict()]),lit=b.object({schemaVersion:b.literal(1),events:b.array(MAe).max(PAe)}).strict(),uit=b.object({schemaVersion:b.literal(1),leftOut:b.array(b.string())}),dit=b.object({schemaVersion:b.literal(1),configuration:b.object({captureId:yl,revision:Wu.nullable(),hash:Ng}).strict(),capture:b.object({schemaVersion:b.literal(1),settings:b.object({target:b.object({environment:b.unknown()}).passthrough(),timeoutMinutes:b.number().int().positive()}).passthrough(),provenance:b.object({}).passthrough(),hash:Ng}).strict()}).strict(),pit=b.object({schemaVersion:b.literal(1),runtimePlan:b.object({version:b.number().int().positive(),contentHash:Ng,files:b.array(b.object({path:b.string().refine(dT,"not a recipe file path"),content:b.string()}).strict()).min(1)}).strict().nullable()}).strict(),fit=b.object({schemaVersion:b.literal(1),state:b.nativeEnum(QAe),ending:b.nativeEnum(AT).nullable(),cause:b.nativeEnum(yT).nullable(),deadlineAt:b.string().datetime()}).strict();function FAe(t){return t.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:t.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:t.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:{schemaVersion:1,reason:"no_report",cause:hit(t)}}function hit(t){return t.credentialMissing?"credential_missing":t.setupFailed?"setup_failed":t.timedOut?"timed_out":"agent_failed"}var Qg=(n=>(n.Unit="unit",n.Integration="integration",n.E2e="e2e",n))(Qg||{});ut();YH();hf();var LAe;(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(LAe||(LAe={}));var git=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),_g=200,Ait={" ":{"\n":new Array(_g).fill(0).map((t,e)=>`
|
|
215
|
+
<sub>[${At().workflowRunLinkLabel}](${e})</sub>`}sT();sT();sT();hf();function XH(t,e){if(process.env.GITHUB_ACTIONS)return new Rg(t,SAe,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}ut();var Aw=(r=>(r.Sufficient="sufficient",r.Insufficient="insufficient",r))(Aw||{}),yw=(d=>(d.RelatedChangeConflict="related_change_conflict",d.ReferenceOutsideTarget="reference_outside_target",d.SourceAccessLost="source_access_lost",d.ConfigurationIncomplete="configuration_incomplete",d.CredentialUnavailable="credential_unavailable",d.WorkflowBindingUnverified="workflow_binding_unverified",d.WorkflowRefUnprotected="workflow_ref_unprotected",d.DeploymentReview="deployment_review",d.SutRevisionMismatch="sut_revision_mismatch",d.IsolationUnavailable="isolation_unavailable",d.EvidenceInsufficient="evidence_insufficient",d))(yw||{}),ju=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(ju||{}),oT=(n=>(n.Application="application",n.Environment="environment",n.TestDefect="test_defect",n))(oT||{}),aT=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(aT||{});var cT=(n=>(n.Seed="seed",n.RuntimeMock="runtime_mock",n.EnvOverride="env_override",n))(cT||{}),lT=(n=>(n.TestCode="test_code",n.SkyrampMocker="skyramp_mocker",n.RecipeOverride="recipe_override",n))(lT||{});var Tg=(r=>(r.Ready="ready",r.Blocked="blocked",r))(Tg||{}),vn=b.string().trim().min(1),Hnt=b.object({action:b.enum(["start","run","wait"]),text:vn,source:b.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:vn.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(t=>t.source==="file"==(t.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),ez={steps:b.array(Hnt).max(20).optional().describe("how it starts, in order"),kind:b.enum(["web_app","service","database","external_service"]).optional(),from:b.object({file:vn,service:vn.nullable()}).strict().optional()},znt=b.object({name:vn,repository:vn.describe("owner/repo of the repository the component is built from"),healthy:b.boolean(),...ez}),jnt=b.object({component:vn,problem:vn,evidence:vn.describe("the exact command and output that shows it"),fix:vn.describe("what the user must provide, and where")}),Vnt=b.object({framework:vn,file:vn.describe("the test file run, relative to its repository root"),result:b.enum(["pass","fail","error"])}),Wnt=b.object({input:vn.describe("the part of the user's SUT input, as given"),reason:vn}),Ew=b.object({schemaVersion:b.literal(1),status:b.nativeEnum(Tg).describe("ready only if every component came up healthy and the recipe is written"),components:b.array(znt),suites:b.array(Vnt).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:b.array(vn).default([]).describe("the parts of the user's SUT input the recipe used"),inputsUsedHow:b.array(b.object({input:vn.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:vn.describe("what the recipe did with it")})).optional(),inputsNotUsed:b.array(Wnt).default([]).describe("the parts it did not use, and why"),blockers:b.array(jnt).describe("required (non-empty) when status is blocked")});function tz(t){if(t.status==="blocked"&&!(Array.isArray(t.blockers)&&t.blockers.length>0))return['status "blocked" requires at least one blocker { component, problem, evidence, fix } \u2014 say what stopped the bring-up'];if(t.status==="ready"){let e=Array.isArray(t.components)?t.components:[];if(e.length===0)return['status "ready" requires at least one component \u2014 name each component the recipe brought up healthy'];let r=e.filter(n=>n?.healthy!==!0).map(n=>String(n?.name??"?"));if(r.length>0)return[`status "ready" requires every component healthy; not healthy: ${r.join(", ")} \u2014 answer "blocked" with a blocker for each, or bring them up and answer "ready" again`]}return[]}var mf=64*1024,gf=512*1024,uT=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var BAe=V(require("path"));var Af=(i=>(i.Clean="clean",i.RecipeDrift="recipe-drift",i.ChangeBrokeBringup="change-broke-bringup",i.BringupFailed="bringup-failed",i))(Af||{}),Vu=b.string().trim().min(1),Ynt=b.object({url:b.string().optional().describe("the URL probed, if the check is an HTTP request"),command:b.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:b.record(b.string()).optional(),status:b.union([b.number(),b.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Vu.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),bw=b.object({schemaVersion:b.literal(1),baseUrls:b.record(b.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:Ynt.optional(),teardown:Vu.describe("command that tears the SUT down"),dependencies:b.record(b.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:b.nativeEnum(Af).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:b.array(b.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:b.object({command:Vu,output:Vu}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:b.array(b.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:b.boolean(),startedAt:Vu.describe("ISO timestamp"),revisions:b.array(b.object({component:Vu.describe("a shared component listed above"),url:Vu.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Vu.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).optional().describe("only when shared components are listed above: one check per component whose deployed commit you found")});function rz(t){let e=[],r=i=>!!i&&typeof i=="object"&&!Array.isArray(i);return t.outcome!=="change-broke-bringup"&&t.outcome!=="bringup-failed"?(!r(t.baseUrls)||Object.keys(t.baseUrls).length===0?e.push("baseUrls must be a non-empty object of service \u2192 url"):Object.values(t.baseUrls).every(i=>typeof i=="string"&&i.trim())||e.push("every baseUrls value must be a non-empty url string"),r(t.health)?!(typeof t.health.url=="string"&&t.health.url.trim())&&!(typeof t.health.command=="string"&&t.health.command.trim())&&e.push("health must record a url or a command (what you actually ran)"):e.push("health must be an object"),(!r(t.dependencies)||Object.keys(t.dependencies).length===0)&&e.push("dependencies must be a non-empty object of name \u2192 boolean (real vs mocked) when the SUT came up \u2014 account for every backing service so a mocked one can't be hidden behind a green run")):(r(t.bringupError)||e.push(`outcome "${String(t.outcome)}" requires bringupError { command, output } \u2014 the exact failing bring-up command and what it printed`),t.outcome==="change-broke-bringup"&&!(Array.isArray(t.suspectFiles)&&t.suspectFiles.length>0&&t.suspectFiles.every(i=>typeof i=="string"&&i.trim()))&&e.push("change-broke-bringup requires non-empty suspectFiles[] \u2014 the changed file(s) the failure points at; if you cannot point at a file this PR changed, the outcome is bringup-failed (environment/harness), not the PR's fault")),t.outcome==="recipe-drift"&&!(Array.isArray(t.recipeFixes)&&t.recipeFixes.length>0)&&e.push("recipe-drift outcome requires a non-empty recipeFixes[] describing what was corrected"),e}var di=b.string().trim().min(1),vAe=b.object({schemaVersion:b.literal(1),status:b.enum(["ready","blocked"]),components:b.array(b.object({name:di,repository:di.describe("owner/repo"),healthy:b.boolean(),url:b.string().min(1).nullable(),...ez}).strict()),suites:b.array(b.object({framework:di,file:di,result:b.enum(["pass","fail","error"])}).strict()),inputsUsed:b.array(di),inputsUsedHow:b.array(b.object({input:di,how:di}).strict()).optional(),inputsNotUsed:b.array(b.object({input:di,reason:di}).strict()),blockers:b.array(b.object({component:di,problem:di,evidence:di,fix:di}).strict()),replay:b.object({outcome:di,durationSeconds:b.number().nonnegative().nullable()}).strict().nullable(),files:b.array(b.object({path:di,content:b.string()}).strict())}).strict().superRefine((t,e)=>{t.inputsUsedHow?.forEach((r,n)=>{t.inputsUsed.includes(r.input)||e.addIssue({code:b.ZodIssueCode.custom,path:["inputsUsedHow",n,"input"],message:"not one of inputsUsed"})})}),L2t=["clean","recipe-drift"];function dT(t){let e=BAe.posix.normalize(t);return e===t&&(e===".skyramp/workspace.yml"||e.startsWith(".skyramp/sut/")&&e.length>13)}var RAe=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"];var hT=(e=>(e.GitHub="github",e))(hT||{}),iz=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(iz||{}),mT=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s))(mT||{}),Jnt=["sut_setup"],Knt=["sut_setup","schedule"];var sz=(e=>(e.PullRequest="pull_request",e))(sz||{}),gT=(i=>(i.ModelProvider="model_provider",i.SutAccess="sut_access",i.Skyramp="skyramp",i.Other="other",i))(gT||{});var AT=(i=>(i.ReportUploaded="report_uploaded",i.NoReport="no_report",i.Cancelled="cancelled",i.RecipeUploaded="recipe_uploaded",i))(AT||{}),QAe=(r=>(r.Running="running",r.Ended="ended",r))(QAe||{}),yT=(o=>(o.TimedOut="timed_out",o.AgentFailed="agent_failed",o.SetupFailed="setup_failed",o.CredentialMissing="credential_missing",o.RunnerLost="runner_lost",o.CheckoutFailed="checkout_failed",o))(yT||{}),oz=(r=>(r.Onboard="onboard",r.Deploy="deploy",r))(oz||{}),az=(r=>(r.Started="started",r.Finished="finished",r))(az||{}),cz=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(cz||{});var ET=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(ET||{}),bT=(i=>(i.Found="found",i.Starting="starting",i.Up="up",i.OutOfScope="out_of_scope",i))(bT||{}),Wu=b.string().regex(/^[1-9][0-9]{0,18}$/),ww=b.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),yl=b.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),Ng=b.string().regex(/^[0-9a-f]{64}$/),fT=b.object({id:yl,revision:Wu}).strict(),Ho=b.object({provider:b.nativeEnum(hT),providerAccountId:Wu,providerRepositoryId:Wu}).strict(),nz=t=>`${t.provider}:${t.providerRepositoryId}`,_Ae=Ho.extend({namespace:b.string().min(1),name:b.string().min(1)}).strict(),Znt=b.object({repository:_Ae,revision:ww,ref:b.string().nullable(),reason:b.nativeEnum(iz),change:b.object({kind:b.nativeEnum(sz),number:Wu,base:b.object({ref:b.string().min(1),revision:ww}).strict().optional()}).strict().nullable()}).strict();function Xnt(t){let e=t.baseline.sources,r=t.trigger.kind==="schedule"&&t.baseline.confirmedRunId!==null;if(!e)return r?"names every source of the snapshot, once":null;if(t.baseline.confirmedRunId===null)return"a run with no Confirmed Baseline names no baseline sources";let n=new Set(t.sources.map(o=>nz(o.repository))),i=new Set(e.map(o=>nz(o.repository)));return i.size===e.length&&i.size===n.size&&[...i].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var eit=b.object({schemaVersion:b.literal(1),runId:yl,skyrampOrgId:yl,target:fT,policy:fT.nullable(),trigger:b.object({kind:b.nativeEnum(mT),requestedAt:b.string().datetime()}).strict(),configuration:b.object({captureId:yl,revision:Wu.nullable(),hash:Ng}).strict(),baseline:b.object({confirmedRunId:yl.nullable(),sources:b.array(b.object({repository:Ho,revision:ww}).strict()).optional()}).strict(),sources:b.array(Znt).min(1),execution:b.object({provider:b.nativeEnum(hT),repository:_Ae,workflowPath:b.string(),ref:b.string()}).strict(),credentials:b.array(b.object({name:b.string(),purpose:b.nativeEnum(gT),required:b.boolean()}).strict())}).strict().superRefine((t,e)=>{let r=t.trigger.kind,n=Jnt.includes(r);n!==(t.policy===null)&&e.addIssue({code:b.ZodIssueCode.custom,path:["policy"],message:n?`a ${r} run has no policy`:"names the policy revision"});let i=Xnt(t);i&&e.addIssue({code:b.ZodIssueCode.custom,path:["baseline","sources"],message:i}),Knt.includes(r)&&t.sources.forEach((s,o)=>{s.reason!=="BASELINE"&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",o,"reason"],message:`a ${r} run selects only BASELINE sources`})})});var z2t=b.object({schemaVersion:b.literal(1),attempt:b.object({id:yl,number:b.number().int().positive(),deadlineAt:b.string().datetime()}).strict(),manifest:eit,manifestHash:Ng,entitlements:b.array(b.string()).optional(),runToken:b.string().min(1).optional()}).strict(),j2t=b.object({schemaVersion:b.literal(1),runId:yl,execution:b.object({provider:b.nativeEnum(hT),repository:Ho,providerRunId:Wu,providerRunAttempt:b.number().int().positive(),workflowRef:b.string().min(1)}).strict()}).strict(),TAe=b.object({repository:Ho,number:Wu}).strict(),tit=b.discriminatedUnion("status",[b.object({status:b.literal("none")}).strict(),b.object({status:b.literal("delivered"),pullRequests:b.array(TAe).min(1)}).strict(),b.object({status:b.literal("partial"),pullRequests:b.array(TAe).min(1),failures:b.array(b.object({repository:Ho,message:b.string()}).strict()).min(1)}).strict(),b.object({status:b.literal("failed"),message:b.string()}).strict()]),rit=b.object({sufficiency:b.nativeEnum(Aw),rationale:b.string().min(1),gaps:b.array(b.string().min(1)),acceptedEvidence:b.array(b.object({kind:b.nativeEnum(ju),repository:b.string().min(1),revision:ww,reference:b.string().min(1),summary:b.string().min(1)}).strict()),actionRequired:b.array(b.nativeEnum(yw))}).strict().superRefine((t,e)=>{t.sufficiency==="sufficient"!=(t.gaps.length===0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["gaps"],message:"sufficient evidence has no gaps, and insufficient evidence names at least one"}),new Set(t.actionRequired).size!==t.actionRequired.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),kg=500,lz=2048,uz=1e3,nit=b.object({testResults:b.array(b.object({resultId:b.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:b.string().regex(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/),testType:b.string(),endpoint:b.string(),status:b.enum(["Pass","Fail","Skipped"]),details:b.string(),fileName:b.string().optional(),testId:b.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:b.object({kind:b.nativeEnum(oT),family:b.nativeEnum(aT).optional()}).strict().optional()}).strict()),validation:rit,changes:b.array(b.object({id:b.string().min(1).max(512),text:b.string().max(16384),source:b.string().max(lz),testedBy:b.array(b.string().min(1).max(1024)).max(kg),writtenBy:b.array(b.string().min(1).max(1024)).max(kg),maintainedBy:b.array(b.string().min(1).max(1024)).max(kg)}).strict()).max(uz).optional(),traceVersion:b.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,i)=>{let s=n.failureCause;s&&n.status==="Pass"&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",i,"failureCause"],message:"a passing result has no failure cause"}),s&&s.kind==="environment"!=(s.family!==void 0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",i,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",i,"resultId"],a=n.resultId.slice(`${n.repository}:${n.testType}:`.length);(!n.resultId.startsWith(`${n.repository}:${n.testType}:`)||a===""||a.startsWith("/")||a.startsWith("#"))&&e.addIssue({code:b.ZodIssueCode.custom,path:o,message:"is not repository:testType:path for this result"}),r.has(n.resultId)&&e.addIssue({code:b.ZodIssueCode.custom,path:o,message:"stable identity repeated"}),r.add(n.resultId)})}),kAe=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function dz(t,e,r,n){let i=r.replace(/\\/g,"/"),s=i.split("/").filter(c=>c!==""&&c!==".");if(i.startsWith("/")||/^[A-Za-z]:/.test(i)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=s.join("/"),a=`${t}:${e}:${kAe(o)}`;return n?`${a}#${kAe(n)}`:a}var iit=b.object({schemaVersion:b.literal(1),run:b.object({runId:yl,attemptNumber:b.number().int().positive(),manifestHash:Ng}).strict(),target:fT,policy:fT,provenance:b.object({sources:b.array(b.object({repository:Ho,revision:ww}).strict())}).strict(),delivery:b.object({generatedTests:tit}).strict(),producer:b.object({testbot:b.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:b.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:nit}).strict(),V2t=iit.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:vAe}).strict().superRefine(({recipe:t},e)=>{let r=(s,o)=>e.addIssue({code:b.ZodIssueCode.custom,path:["recipe",...s],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,i=0;t.files.forEach((s,o)=>{dT(s.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(s.path)&&r(["files",o,"path"],"file repeated"),n.add(s.path),uT.test(s.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(s.content,"utf8");i+=a,a>mf&&r(["files",o,"content"],`larger than ${mf} bytes`)}),i>gf&&r(["files"],`recipe text over ${gf} bytes in total`)}),sit=b.object({schemaVersion:b.literal(1),stage:b.nativeEnum(oz),event:b.nativeEnum(az),status:b.nativeEnum(cz).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),PAe=100,DAe=5e3,OAe=2e3,oit=100,ait=200,cit=500,pz=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,pT=t=>b.string().max(t).refine(e=>e.trim().length>0&&!pz.test(e),"blank, or not text"),NAe={sequence:b.number().int().min(1).max(DAe),at:b.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},MAe=b.discriminatedUnion("kind",[b.object({...NAe,kind:b.literal("log"),phase:b.nativeEnum(ET),text:pT(OAe)}).strict(),b.object({...NAe,kind:b.literal("component"),name:pT(oit),repository:pT(ait).refine(t=>/^[^/\s]+\/[^/\s]+$/.test(t),"not owner/name"),file:pT(cit).nullable(),status:b.nativeEnum(bT)}).strict()]),lit=b.object({schemaVersion:b.literal(1),events:b.array(MAe).max(PAe)}).strict(),uit=b.object({schemaVersion:b.literal(1),leftOut:b.array(b.string())}),dit=b.object({schemaVersion:b.literal(1),configuration:b.object({captureId:yl,revision:Wu.nullable(),hash:Ng}).strict(),capture:b.object({schemaVersion:b.literal(1),settings:b.object({target:b.object({environment:b.unknown()}).passthrough(),timeoutMinutes:b.number().int().positive()}).passthrough(),provenance:b.object({}).passthrough(),hash:Ng}).strict()}).strict(),pit=b.object({schemaVersion:b.literal(1),runtimePlan:b.object({version:b.number().int().positive(),contentHash:Ng,files:b.array(b.object({path:b.string().refine(dT,"not a recipe file path"),content:b.string()}).strict()).min(1)}).strict().nullable()}).strict(),fit=b.object({schemaVersion:b.literal(1),state:b.nativeEnum(QAe),ending:b.nativeEnum(AT).nullable(),cause:b.nativeEnum(yT).nullable(),deadlineAt:b.string().datetime()}).strict();function FAe(t){return t.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:t.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:t.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:{schemaVersion:1,reason:"no_report",cause:hit(t)}}function hit(t){return t.credentialMissing?"credential_missing":t.checkoutFailed?"checkout_failed":t.setupFailed?"setup_failed":t.timedOut?"timed_out":"agent_failed"}var Qg=(n=>(n.Unit="unit",n.Integration="integration",n.E2e="e2e",n))(Qg||{});ut();YH();hf();var LAe;(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(LAe||(LAe={}));var git=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),_g=200,Ait={" ":{"\n":new Array(_g).fill(0).map((t,e)=>`
|
|
216
216
|
`+" ".repeat(e)),"\r":new Array(_g).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(_g).fill(0).map((t,e)=>`\r
|
|
217
217
|
`+" ".repeat(e))}," ":{"\n":new Array(_g).fill(0).map((t,e)=>`
|
|
218
218
|
`+" ".repeat(e)),"\r":new Array(_g).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(_g).fill(0).map((t,e)=>`\r
|
|
219
|
-
`+" ".repeat(e))}};var GAe;(function(t){t.DEFAULT={allowTrailingComma:!1}})(GAe||(GAe={}));var qAe;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(qAe||(qAe={}));var $Ae;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})($Ae||($Ae={}));var HAe;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(HAe||(HAe={}));ut();hf();var Sit=900*1e3;ut();var xit=`http.${(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/,"")}/.extraheader`,Bit=t=>t.replace(/[.[\]^$*+?(){}|\\]/g,"\\$&"),zqt=`^${Bit(xit)}$`;var vit=".skyramp/videos",jqt=`:(exclude)${vit}/`;var wT="\xABredacted\xBB";function Rn(t,e){if(!t||e.length===0)return t;let r=t;for(let n of e)!n||!r.includes(n)||(r=r.split(n).join(wT));return r}function hn(t,e){if(e.length===0)return t;let r=n=>typeof n=="string"?Rn(n,e):Array.isArray(n)?n.map(r):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[i,r(s)])):n;return r(t)}var Tit=10*6e4;function jAe(t,e){return t.getTime()-e.getTime()-Tit}var d$t=10*6e4,kit=3e4,Nit=3,Qit=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Pg=class extends Error{constructor(r,n,i){super(r);this.status=n;this.code=i}status;code};function _it(t){let e;try{e=new URL(t)}catch{throw new Error(`skyrampAppOrigin "${t}" is not a URL`)}if(e.protocol!=="https:"||e.origin!==t.replace(/\/+$/,""))throw new Error(`skyrampAppOrigin must be an https origin, got "${t}"`);return e.origin}function Pit(t,e){if(!Qit.test(t))throw new Error(`The ${e} "${t}" is not a uuid`);return t}async function Dit(t,e,r,n){let i=_it(t.origin),s;for(let o=1;o<=Nit;o+=1){o>1&&await new Promise(a=>setTimeout(a,(t.retryDelayMs??2e3)*(o-1)));try{let a=await t.idToken(i),c=await(t.fetch??fetch)(new URL(r,i).toString(),{method:e,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json",Accept:"application/json"},body:e==="GET"?void 0:JSON.stringify(n),redirect:"error",signal:AbortSignal.timeout(kit)}),l=await c.json().catch(()=>({}));if(c.ok)return l.data;let u=`The Skyramp app refused ${e} ${r}: ${c.status} ${l.error?.code??"no error code"}`;if(c.status<500&&c.status!==429)throw new Pg(u,c.status,l.error?.code);s=new Error(u)}catch(a){if(a instanceof Pg)throw a;s=a}}throw s}var p$t=10*6e4;var f$t=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE"];var h$t=b.object({tests:b.object({placements:b.array(b.unknown()).optional()}).passthrough().optional()}).passthrough(),m$t=b.object({repository:Ho.passthrough(),testType:b.nativeEnum(Qg),directory:b.string()}).passthrough();var g$t=b.object({environment:b.object({components:b.array(b.unknown()).optional(),dependencies:b.array(b.unknown()).optional()}).passthrough()}).passthrough(),A$t=b.object({name:b.string().min(1),provision:b.literal("existing"),url:b.string().min(1),repository:Ho.passthrough().optional(),revisionUrl:b.string().min(1).optional()}).passthrough(),y$t=b.object({name:b.string().min(1),url:b.string().nullable(),versionUrl:b.string().nullable(),notes:b.string().nullable()}).passthrough();async function VAe(t,e){return Pit(t.attemptId,"attempt id"),Dit(e,"POST",`/api/v1/runner/attempts/${t.attemptId}/end`,FAe({reportUploaded:t.reportUploaded,recipeUploaded:t.recipeUploaded,cancelled:t.cause==="cancelled",timedOut:t.cause==="timed_out",setupFailed:t.cause==="setup_failed",credentialMissing:t.cause==="credential_missing"}))}var YAe=V(require("path"));var Dg=V(require("fs")),ac=V(require("path"));function fz(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Oit=8;function fe(t,e,r={}){let n=e.slice(0,Oit),i=e.length-n.length;return{name:t,passed:!1,details:n.join("; ")+(i>0?`; \u2026and ${i} more`:""),...r.fatal?{fatal:!0}:{}}}function cc(t){if(Dg.existsSync(t))try{return JSON.parse(Dg.readFileSync(t,"utf-8"))}catch{return}}function he(t,e){return cc(ac.join(t.outputsDir,e))}function xt(t,e,r,n){if(!r)throw new Error(`${e}.json unexpectedly invalid at artifact time: ${n[0]}`);let i=ac.join(t.outputsDir,`${e}.json`);return Dg.writeFileSync(i,JSON.stringify(r,null,2)+`
|
|
219
|
+
`+" ".repeat(e))}};var GAe;(function(t){t.DEFAULT={allowTrailingComma:!1}})(GAe||(GAe={}));var qAe;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(qAe||(qAe={}));var $Ae;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})($Ae||($Ae={}));var HAe;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(HAe||(HAe={}));ut();hf();var Sit=900*1e3;ut();var xit=`http.${(process.env.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/,"")}/.extraheader`,Bit=t=>t.replace(/[.[\]^$*+?(){}|\\]/g,"\\$&"),zqt=`^${Bit(xit)}$`;var vit=".skyramp/videos",jqt=`:(exclude)${vit}/`;var wT="\xABredacted\xBB";function Rn(t,e){if(!t||e.length===0)return t;let r=t;for(let n of e)!n||!r.includes(n)||(r=r.split(n).join(wT));return r}function hn(t,e){if(e.length===0)return t;let r=n=>typeof n=="string"?Rn(n,e):Array.isArray(n)?n.map(r):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[i,r(s)])):n;return r(t)}var Tit=10*6e4;function jAe(t,e){return t.getTime()-e.getTime()-Tit}var d$t=10*6e4,kit=3e4,Nit=3,Qit=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Pg=class extends Error{constructor(r,n,i){super(r);this.status=n;this.code=i}status;code};function _it(t){let e;try{e=new URL(t)}catch{throw new Error(`skyrampAppOrigin "${t}" is not a URL`)}if(e.protocol!=="https:"||e.origin!==t.replace(/\/+$/,""))throw new Error(`skyrampAppOrigin must be an https origin, got "${t}"`);return e.origin}function Pit(t,e){if(!Qit.test(t))throw new Error(`The ${e} "${t}" is not a uuid`);return t}async function Dit(t,e,r,n){let i=_it(t.origin),s;for(let o=1;o<=Nit;o+=1){o>1&&await new Promise(a=>setTimeout(a,(t.retryDelayMs??2e3)*(o-1)));try{let a=await t.idToken(i),c=await(t.fetch??fetch)(new URL(r,i).toString(),{method:e,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json",Accept:"application/json"},body:e==="GET"?void 0:JSON.stringify(n),redirect:"error",signal:AbortSignal.timeout(kit)}),l=await c.json().catch(()=>({}));if(c.ok)return l.data;let u=`The Skyramp app refused ${e} ${r}: ${c.status} ${l.error?.code??"no error code"}`;if(c.status<500&&c.status!==429)throw new Pg(u,c.status,l.error?.code);s=new Error(u)}catch(a){if(a instanceof Pg)throw a;s=a}}throw s}var p$t=10*6e4;var f$t=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE"];var h$t=b.object({tests:b.object({placements:b.array(b.unknown()).optional()}).passthrough().optional()}).passthrough(),m$t=b.object({repository:Ho.passthrough(),testType:b.nativeEnum(Qg),directory:b.string()}).passthrough();var g$t=b.object({environment:b.object({components:b.array(b.unknown()).optional(),dependencies:b.array(b.unknown()).optional()}).passthrough()}).passthrough(),A$t=b.object({name:b.string().min(1),provision:b.literal("existing"),url:b.string().min(1),repository:Ho.passthrough().optional(),revisionUrl:b.string().min(1).optional()}).passthrough(),y$t=b.object({name:b.string().min(1),url:b.string().nullable(),versionUrl:b.string().nullable(),notes:b.string().nullable()}).passthrough();async function VAe(t,e){return Pit(t.attemptId,"attempt id"),Dit(e,"POST",`/api/v1/runner/attempts/${t.attemptId}/end`,FAe({reportUploaded:t.reportUploaded,recipeUploaded:t.recipeUploaded,cancelled:t.cause==="cancelled",timedOut:t.cause==="timed_out",setupFailed:t.cause==="setup_failed",checkoutFailed:t.cause==="checkout_failed",credentialMissing:t.cause==="credential_missing"}))}var YAe=V(require("path"));var Dg=V(require("fs")),ac=V(require("path"));function fz(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Oit=8;function fe(t,e,r={}){let n=e.slice(0,Oit),i=e.length-n.length;return{name:t,passed:!1,details:n.join("; ")+(i>0?`; \u2026and ${i} more`:""),...r.fatal?{fatal:!0}:{}}}function cc(t){if(Dg.existsSync(t))try{return JSON.parse(Dg.readFileSync(t,"utf-8"))}catch{return}}function he(t,e){return cc(ac.join(t.outputsDir,e))}function xt(t,e,r,n){if(!r)throw new Error(`${e}.json unexpectedly invalid at artifact time: ${n[0]}`);let i=ac.join(t.outputsDir,`${e}.json`);return Dg.writeFileSync(i,JSON.stringify(r,null,2)+`
|
|
220
220
|
`),{[e]:ac.relative(t.runDir,i)}}function Di(t,e){return{name:t,verify(r,n){let{errors:i}=e(r,n);return i.length===0?{name:this.name,passed:!0}:fe(this.name,i,{fatal:!0})}}}function WAe(t,e){return{...t,name:e}}function Xt(t,e){return ac.relative(t,ac.resolve(t,e)).replace(/\/+$/,"")}function Cw(t){return t.replace(/\s+/g," ").trim()}function Yu(t){return ac.basename(t).replace(/\.[^.]+$/,"").toLowerCase()}var yf=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");function Og(t){if(!t.inputs.skyrampMcp?.command)return!1;for(let e of Object.values(t.state.stages))for(let r of e.attempts??[]){let n=r.mcpServers?.skyramp;if(n!==void 0&&n!=="connected")return!1}return!0}var hz="outputs/preflight.json",Ef="pr-diff.txt";function Ju(t,e){return[...t.changedFiles.map(r=>({repository:e,path:r.path})),...(t.relatedChanges??[]).flatMap(r=>r.changedFiles.map(n=>({repository:r.repository,path:n.path})))]}function Mg(t,e,r){return t.some(n=>n.path===r&&n.repository.toLowerCase()===e.toLowerCase())}function fs(t){if(t.outputsDir)return cc(YAe.join(t.outputsDir,"preflight.json"))}var Fit={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};function IT(t,e){return Ju(t,e).length+(t.relatedChanges??[]).filter(r=>r.note).length}function ST(t,e){return t.confirmedRunId===null?"first_qualification":e>0?"delta":"unchanged"}var CT=t=>t.depth?` at depth ${Fit[t.depth]}`:"",JAe="Sweep the configured scope instead of a diff: every repository of the run, its public surface (endpoints, screens, exported functions) and its existing test suites, and list the behaviors they establish, so triage can plan evidence for them. A finding here is a latent defect of the current state.";function ZAe(t,e){switch(ST(t,e)){case"first_qualification":return["This is a scheduled validation, first qualification: the policy has no Confirmed Baseline yet, so this run establishes one. It validates the Target's configured state broadly, not a change.",JAe];case"delta":return[`This is a scheduled validation${CT(t)}. The diff below is everything that changed since the Confirmed Baseline (run ${t.confirmedRunId}), across every source: not one pull request. Review it as the change under validation; there is no PR description.`];case"unchanged":return[`This is a scheduled validation${CT(t)}. Nothing changed since the Confirmed Baseline (run ${t.confirmedRunId}), so there is no diff to review. The state is still under validation: shared services and dependencies can drift.`,JAe]}}var KAe="Plan evidence for the behaviors analyze found: run the existing suites (existing_unit), accept current approved CI evidence, and bring up the SUT only where only runtime evidence will do. The existing suites run under runtime_required too. Do not set a behavior aside as unaffected or out of scope because nothing changed: in a scheduled validation the state itself is under validation. Never conclude success because nothing changed; a run that obtains no evidence validated nothing.";function XAe(t,e){switch(ST(t,e)){case"first_qualification":return["Scheduled validation, first qualification: the policy has no Confirmed Baseline yet. Validate the configured scope broadly; this run's success becomes the Confirmed Baseline.",KAe];case"delta":return[`Scheduled validation${CT(t)}: the files below changed since the Confirmed Baseline (run ${t.confirmedRunId}), across every source. Judge the evidence the policy needs for them, at its depth, as for any change.`];case"unchanged":return[`Change under validation: no change since the Confirmed Baseline (run ${t.confirmedRunId}). This is a scheduled validation${CT(t)}, so decide what evidence the policy needs for the current state now.`,KAe]}}var Ug=V(require("fs")),BT=V(require("path"));var Iw=V(require("fs")),zo=V(require("path")),Fg=zo.join(".skyramp","sut"),eye=zo.join(".skyramp","workspace.yml");function Lit(t){return t.startsWith(`${Fg}${zo.sep}`)||t.startsWith(".skyramp/sut/")||t===eye||t===".skyramp/workspace.yml"||/(^|\/)(docker-compose|compose)[^/]*\.ya?ml$/.test(t)||/(^|\/)Dockerfile[^/]*$/.test(t)||/^\.github\/workflows\//.test(t)}function El(t,e,r={}){let n=e.split(/[\\/]+/).filter(Boolean),i=t;for(let[s,o]of n.entries()){i=zo.join(i,o);let a=Iw.lstatSync(i,{throwIfNoEntry:!1}),c=s===n.length-1;if(!a||a.isSymbolicLink()||(c?r.directory?!a.isDirectory():!a.isFile():!a.isDirectory()))return}return n.length?i:void 0}function Ku(t,e=[]){let r=p=>El(t,p),n=r(zo.join(Fg,"setup.sh")),i=r(zo.join(Fg,"teardown.sh")),s=r(zo.join(Fg,"get-auth-token.sh")),o=r(eye),a,c=r(zo.join(Fg,"health.json"));if(c)try{let p=JSON.parse(Iw.readFileSync(c,"utf-8"));p&&(p.url||p.command)&&(a=p)}catch{}let l,u=r(zo.join(Fg,"deploy-budget.json"));if(u)try{let p=JSON.parse(Iw.readFileSync(u,"utf-8"));typeof p?.minutes=="number"&&Number.isFinite(p.minutes)&&p.minutes>0&&(l=p.minutes)}catch{}let d=e.filter(Lit);return{setupScript:n,teardownScript:i,authTokenScript:s,workspaceFile:o,healthHint:a,budgetMinutes:l,present:!!(n||o),staleFiles:d,stale:d.length>0}}function er(t,e=[]){let r=t.trim();if(!r)return{error:"session produced no output"};let n=c=>{try{let l=JSON.parse(c);return typeof l=="object"&&l!==null&&!Array.isArray(l)?l:void 0}catch{return}},i=n(r);if(i!==void 0)return{value:i};let s;if(r.startsWith("{")&&r.endsWith("}"))try{JSON.parse(r)}catch(c){s=c instanceof Error?c.message:String(c)}let o=[...r.matchAll(/```(?:json)?\s*\n([\s\S]*?)```/g)];for(let c=o.length-1;c>=0;c--){let l=n(o[c][1].trim());if(l!==void 0)return{value:l}}let a;for(let c=r.indexOf("{");c!==-1;c=r.indexOf("{",c+1)){let l=0,u=!1,d=!1;for(let p=c;p<r.length;p++){let h=r[p];if(d){d=!1;continue}if(h==="\\"){d=u;continue}if(h==='"'){u=!u;continue}if(!u){if(h==="{")l++;else if(h==="}"&&(l--,l===0)){let y=n(r.slice(c,p+1));y!==void 0&&Object.keys(y).length>0&&(a=y,c=p);break}}}}return s&&(a===void 0||Object.keys(a).length<3)?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:a!==void 0?{value:a}:s?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:{error:`no parseable JSON object found in session output \u2014 the final message was: "${Uit(Rn(r,e))}"`}}var tye=240;function Uit(t){let e=t.replace(/\s+/g," ").trim();return e.length<=tye?e:`\u2026${e.slice(-tye)}`}function Sr(t,e=0){return Sw(t,e)}var rye=t=>" ".repeat(t);function Sw(t,e){let r=Git(t);switch(r._def.typeName){case"ZodObject":{let i=r.shape,s=Object.keys(i).filter(a=>!i[a].description?.startsWith("[derived]"));return s.length===0?"{}":`{
|
|
221
221
|
${s.map((a,c)=>{let l=i[a],u=l.isOptional()?" (optional)":"",d=l.description?` // ${l.description}`:"",p=Sw(l,e+2);return`${rye(e+2)}"${a}": ${p}${c<s.length-1?",":""}${u}${d}`}).join(`
|
|
222
222
|
`)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyramp/testbot-core",
|
|
3
|
-
"version": "0.12.0-v3.
|
|
3
|
+
"version": "0.12.0-v3.35",
|
|
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. eval-entry.js is a development entry and must not ship.",
|