@skyramp/testbot-core 0.13.0-v3.421 → 0.13.0-v3.422
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 +1 -1
- package/dist/data-safety-worker.js +1 -1
- package/dist/main.js +375 -375
- package/dist/post.js +1 -1
- package/dist/runner-client.cjs +41 -41
- package/package.json +1 -1
package/dist/post.js
CHANGED
|
@@ -57,7 +57,7 @@ ${i}
|
|
|
57
57
|
`),a=[er(e,["diff","--stat",i,...fk],ly),er(e,["diff","--stat",i,"HEAD",...s],ly)].filter(Boolean).join(`
|
|
58
58
|
`);return{baseRef:n,diffContent:o,diffStat:a,...jce(o)}}function dy(e,t){if(!Ak(e))return;let n=yl(e,t);if(!n)return;let i=er(e,["rev-parse","--abbrev-ref","HEAD"])??"HEAD",r=new Map,s=er(e,["diff","--name-status",`${n}...HEAD`]);for(let c of(s??"").split(`
|
|
59
59
|
`)){if(!c.trim())continue;let[u,...d]=c.split(" "),p=d[d.length-1];p&&r.set(p,u.charAt(0))}let o=er(e,["status","--porcelain",...fk]);for(let c of(o??"").split(`
|
|
60
|
-
`)){if(!c.trim())continue;let u=c.slice(0,2).trim().charAt(0)||"M",d=c.slice(3).trim(),p=d.indexOf(" -> ");p!==-1&&(d=d.slice(p+4)),d&&r.set(d,u==="?"?"A":u)}let a=[...r.entries()].map(([c,u])=>({path:c,status:u})).sort((c,u)=>c.path.localeCompare(u.path));return{currentBranch:i,baseBranch:n,changedFiles:a}}mn();mn();var yc=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(yc||{});var yk=e=>`${e.source}:${e.site??""}:${e.key}`;var of=/^pasted-[0-9a-f]{16}$/,ko=/^file-[0-9a-f]{16}$/,af=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(af||{}),cf=e=>e.trim().toUpperCase(),z1=(e,t)=>{let n=e.trim();return of.test(n.toLowerCase())?"Pasted text":ko.test(n.toLowerCase())?t?.get(cf(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()};var py=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(py||{}),zi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(zi||{}),Ro=(v=>(v.RelatedChangeConflict="related_change_conflict",v.ReferenceOutsideTarget="reference_outside_target",v.SourceAccessLost="source_access_lost",v.ConfigurationIncomplete="configuration_incomplete",v.CredentialUnavailable="credential_unavailable",v.WorkflowBindingUnverified="workflow_binding_unverified",v.WorkflowRefUnprotected="workflow_ref_unprotected",v.BedrockWorkflowRequired="bedrock_workflow_required",v.DeploymentReview="deployment_review",v.SutRevisionMismatch="sut_revision_mismatch",v.IsolationUnavailable="isolation_unavailable",v.EvidenceInsufficient="evidence_insufficient",v.ConfigurationUnresolved="configuration_unresolved",v.ModelProviderDenied="model_provider_denied",v.ModelProviderUnavailable="model_provider_unavailable",v.RunnerProviderNotReady="runner_provider_not_ready",v.MergeConflict="merge_conflict",v))(Ro||{}),Bo=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(Bo||{}),uf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(uf||{}),lf=(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))(lf||{});var fy=(n=>(n.Probe="probe",n.Agent="agent",n))(fy||{}),hy=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(hy||{}),gy=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(gy||{});var Kt=e=>e.slice(0,12);var Gce=["generate-unit","native-run"],Axe=["preflight","plan","write",...Gce,"report","deliver"];var my=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(my||{}),zce=Object.values(my);var df=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(df||{}),Hi=l.string().trim().min(1),Hce=l.object({case:Hi.describe("recommend id this assertion enforces"),evidence:Hi.describe("the exact assertion line from the file that checks that case's observable")}),pf=l.object({kind:l.nativeEnum(hy).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Hi.describe("the dependency, endpoint or data it affects"),mechanism:l.nativeEnum(gy).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Hi.describe("what it sets up"),worker:Hi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),cleanup:Hi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Hi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),Jce=l.object({file:Hi.describe("staged path under .skyramp/staged/"),source:l.nativeEnum(df),language:Hi,covers:l.array(l.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:l.array(Hce).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:l.array(pf).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),Ek=l.object({schemaVersion:l.literal(1),tests:l.array(Jce),deferredUi:l.array(l.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Hi.describe("one paragraph")});var xs=(o=>(o.Place="place",o.Update="update",o.Regenerate="regenerate",o.Delete="delete",o.Verify="verify",o.None="none",o))(xs||{}),zr=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(zr||{}),tr=l.string().trim().min(1),H1=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(H1||{}),yy=l.object({kind:l.nativeEnum(H1),reason:tr.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),ff=l.array(l.string().url().max(2048).regex(/^https?:\/\//i)).max(50),J1=l.object({case:tr.describe("a covers id \u2014 the recommend case this test realizes"),status:l.nativeEnum(zr),runtimeTargets:ff.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),fromJourney:l.boolean().optional(),testProblem:yy.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault")}),q1=l.object({started:l.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:l.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:l.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:l.array(J1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),Y1=l.object({context:l.array(pf).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:l.string().optional().describe("staged path \u2014 required for placements"),file:tr.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:tr.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:l.nativeEnum(xs),covers:l.array(l.string()).optional().describe("recommend ids a placed test covers"),repro:l.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:l.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:l.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:tr.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:tr.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:q1,assertionCount:l.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:l.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:l.array(tr).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:l.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),W1=(n=>(n.Junit="junit",n.Converter="converter",n))(W1||{}),qce=tr.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Yce=l.object({results:tr.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:l.nativeEnum(W1),run:tr.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:l.array(tr).min(1).describe("the items[].file paths this run covered"),cases:l.array(l.object({test:tr.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:tr.describe("the covers id it realizes"),file:qce})).describe("map each reported test name to the case it covers")}),Wce=l.object({suites:l.array(Yce).min(1)}),vk=l.object({schemaVersion:l.literal(1),items:l.array(Y1),runnerResults:Wce.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:l.array(l.string()).describe("existing tests assessed and deliberately left untouched"),summary:tr.describe("one paragraph")});var gf=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(gf||{}),Iy=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(Iy||{}),Af=(o=>(o.PullRequest="pull_request",o.ReadyForReview="ready_for_review",o.Schedule="schedule",o.Manual="manual",o.SutSetup="sut_setup",o.RevisionRead="revision_read",o))(Af||{}),Zce=["sut_setup"],Kce=["sut_setup","schedule","revision_read"];var Cy=(t=>(t.PullRequest="pull_request",t))(Cy||{}),Ik=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(Ik||{}),Z1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var Sy=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(Sy||{}),lV=(n=>(n.Running="running",n.Ended="ended",n))(lV||{}),ky=(p=>(p.TimedOut="timed_out",p.AgentFailed="agent_failed",p.SetupFailed="setup_failed",p.CredentialMissing="credential_missing",p.RunnerLost="runner_lost",p.CheckoutFailed="checkout_failed",p.EnvironmentUnverified="environment_unverified",p.ModelProviderDenied="model_provider_denied",p.ModelProviderUnavailable="model_provider_unavailable",p.RunnerProviderNotReady="runner_provider_not_ready",p.MergeConflict="merge_conflict",p))(ky||{}),Ck=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(Ck||{}),mf=(n=>(n.Started="started",n.Finished="finished",n))(mf||{}),Sk=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(Sk||{});var kk=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(kk||{});var Ry=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(Ry||{}),yf=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(yf||{}),hf=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(hf||{});var Ef=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Ef||{}),Hr=l.string().regex(/^[1-9][0-9]{0,18}$/),Jr=l.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),bk=l.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),bl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var vn=l.string().regex(bl),_n=l.string().regex(/^[0-9a-f]{64}$/),wy=l.object({id:vn,revision:Hr}).strict(),By={provider:l.literal("github"),providerAccountId:Hr,providerRepositoryId:Hr},xy={provider:l.literal("azure-devops"),providerAccountId:vn,providerRepositoryId:vn},Sr=l.discriminatedUnion("provider",[l.object(By).strict(),l.object(xy).strict()]),Rk=l.discriminatedUnion("provider",[l.object(By).passthrough(),l.object(xy).passthrough()]),Ec=e=>`${e.provider}:${e.providerRepositoryId}`,K1={namespace:l.string().min(1),name:l.string().min(1)},dV=l.discriminatedUnion("provider",[l.object({...By,...K1}).strict(),l.object({...xy,...K1}).strict()]),X1=l.object({ref:l.string().min(1),revision:Jr}).strict(),Xce=l.object({kind:l.nativeEnum(Ik),number:Hr.optional(),ref:l.string().min(1),revision:Jr,reason:l.nativeEnum(Iy)}).strict(),eue=l.object({repository:dV,revision:Jr,ref:l.string().nullable(),reason:l.nativeEnum(Iy),change:l.object({kind:l.nativeEnum(Cy),number:Hr,base:X1.optional()}).strict().nullable(),compareWith:X1.optional(),merge:l.array(Xce).min(2).optional()}).strict();function tue(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,o]of t.entries()){if(o.kind==="pull_request"!=(o.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!Z1.includes(o.reason))return{path:["merge",s,"reason"],message:`${o.reason} does not select a merged revision`};if(o.kind==="branch"&&o.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(o.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(o.number!==void 0&&n.has(o.number)||i.has(o.ref))return{path:["merge",s],message:"names a revision the source already merges"};o.number!==void 0&&n.add(o.number),i.add(o.ref)}let r=Z1.find(s=>t.some(o=>o.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function nue(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(u=>u!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let o=new Set(e.sources.map(u=>Ec(u.repository))),a=new Set(r.map(u=>Ec(u.repository)));return a.size===r.length&&a.size===o.size&&[...a].every(u=>o.has(u))?null:"names every source of the snapshot, once"}var pV=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,fV=/^[1-9][0-9]{0,18}$/,eV=new RegExp(`${pV.source}|${fV.source}`),tV=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,rue=l.union([l.object({source:l.literal("jira"),site:l.string().regex(tV),key:l.string().regex(pV),updated:l.string().datetime(),contentHash:_n}).strict(),l.object({source:l.literal("confluence"),site:l.string().regex(tV),key:l.string().regex(fV),version:l.number().int().positive(),contentHash:_n}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),contentHash:_n}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),contentHash:_n,fileName:l.string().min(1).max(255),mediaType:l.nativeEnum(af)}).strict()]),nV=l.union([l.literal("jira"),l.literal("confluence")]),iue=l.object({schemaVersion:l.literal(1),items:l.array(l.union([l.object({source:nV,site:l.string(),key:l.string().regex(eV),state:l.literal("read"),text:l.string(),version:l.string().min(1),contentMatches:l.boolean()}).strict(),l.object({source:nV,site:l.string(),key:l.string().regex(eV),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),state:l.literal("read"),text:l.string(),version:l.string().min(1),contentMatches:l.boolean()}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),state:l.literal("read"),version:_n,fileName:l.string().min(1).max(255),mediaType:l.nativeEnum(af)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict()])),instructions:l.array(l.string()).optional()}).strict(),sue=l.object({resultId:l.string().min(1),repository:l.string().min(1),testType:l.string().min(1),path:l.string(),finding:l.string().min(1)}).strict(),oue=l.object({schemaVersion:l.literal(1),runId:vn,skyrampOrgId:vn,target:wy,policy:wy.nullable(),trigger:l.object({kind:l.nativeEnum(Af),requestedAt:l.string().datetime()}).strict(),configuration:l.object({captureId:vn,revision:Hr.nullable(),hash:_n}).strict(),baseline:l.object({confirmedRunId:vn.nullable(),initialBaselineId:vn.optional(),comparisonBaselineId:vn.optional(),knownFailures:l.array(sue).optional(),sources:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional()}).strict().optional(),sources:l.array(eue).min(1).max(1e3),execution:l.object({provider:l.nativeEnum(gf),repository:dV,workflowPath:l.string(),ref:l.string()}).strict(),credentials:l.array(l.object({name:l.string(),purpose:l.nativeEnum(gl),required:l.boolean()}).strict()),requirements:l.array(rue).min(1).optional(),instructions:l.object({contentHash:_n}).strict().optional(),deployedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((c,u)=>{let d="fileName"in c?"file":"pasted";c.source==="other"&&c.key!==`${d}-${c.contentHash.slice(0,16)}`&&t.addIssue({code:l.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",u,"key"]});let p=yk({source:c.source,key:c.key});n.has(p)&&t.addIssue({code:l.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",u,"key"]}),n.add(p)});let i=e.trigger.kind,r=Zce.includes(i);r!==(e.policy===null)&&t.addIssue({code:l.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:l.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=nue(e);s&&t.addIssue({code:l.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),Kce.includes(i)&&e.sources.forEach((c,u)=>{c.reason!=="BASELINE"&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let o=new Set(e.sources.map(c=>Ec(c.repository))),a=new Set;(e.deployedRevisions??[]).forEach((c,u)=>{let d=Ec(c.repository);o.has(d)?a.has(d)&&t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions",u,"repository"],message:"repository appears twice"}):t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions",u,"repository"],message:"names a repository outside the snapshot"}),a.add(d)}),e.sources.forEach((c,u)=>{c.compareWith&&(c.reason!=="MANUAL_OVERRIDE"||c.change)&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(c.change?.base||c.compareWith||c.merge)&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let d=tue(c);d&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,...d.path],message:d.message})})});var Bk=(n=>(n.Person="person",n.Policy="policy",n))(Bk||{}),aue=l.object({kind:l.nativeEnum(Bk),name:l.string().min(1).max(256)}).strict(),cue=l.object({mcp:l.discriminatedUnion("source",[l.object({source:l.literal("npm"),version:l.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),l.object({source:l.literal("github"),ref:l.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:l.object({region:l.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:l.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Txe=l.object({schemaVersion:l.literal(1),attempt:l.object({id:vn,number:l.number().int().positive(),deadlineAt:l.string().datetime()}).strict(),manifest:oue,manifestHash:_n,entitlements:l.array(l.string()).optional(),runToken:l.string().min(1).optional(),requestedBy:aue.nullable().optional(),writeAllowed:l.boolean().optional(),claudeCodeVersion:l.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional(),statedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional(),runSettings:cue.optional()}).strict(),rV={providerRunAttempt:l.number().int().positive(),workflowRef:l.string().min(1)},uue=l.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),_xe=l.object({schemaVersion:l.literal(1),runId:vn,execution:l.discriminatedUnion("provider",[l.object({...rV,provider:l.literal("github"),repository:l.object(By).strict(),providerRunId:Hr}).strict(),l.object({...rV,provider:l.literal("azure-devops"),repository:l.object(xy).strict(),providerRunId:uue}).strict()]),requester:l.literal(!0).optional(),writeCheck:l.literal(!0).optional(),claudeCodePin:l.literal(!0).optional(),deployedPins:l.literal(!0).optional(),statedPins:l.literal(!0).optional(),runSettings:l.literal(!0).optional()}).strict(),iV=l.object({repository:Sr,number:Hr,commitSha:Jr.optional()}).strict(),Ey=l.array(l.object({repository:Sr,reason:l.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),hV=l.object({branch:bk.optional(),commitSha:Jr.optional()}).strict(),sV=l.object({repository:Sr,message:l.string(),...hV.shape}).strict(),lue=l.discriminatedUnion("status",[l.object({status:l.literal("none"),noTests:Ey}).strict(),l.object({status:l.literal("delivered"),noTests:Ey,pullRequests:l.array(iV).min(1)}).strict(),l.object({status:l.literal("partial"),noTests:Ey,pullRequests:l.array(iV).min(1),failures:l.array(sV).min(1)}).strict(),l.object({status:l.literal("failed"),message:l.string(),noTests:Ey,failures:l.array(sV).min(1).optional()}).strict()]),xk=1024*1024,gV=16*1024*1024,vy=e=>l.array(l.object({[e]:l.string()}).strict()).optional(),due=l.object({language:l.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:l.string(),validation:l.object({rationale:l.string(),gaps:l.array(l.string())}).strict().optional(),changes:l.array(l.object({id:l.string(),text:l.string()}).strict()).optional(),issuesFound:vy("description"),newTestsCreated:vy("description"),testResults:vy("details"),caveats:vy("text")}).strict(),pue=l.object({blockedPreflight:l.object({file:l.string().min(1),repository:l.string().min(1).optional(),reason:l.string().min(1).max(300),evidence:l.string().min(1).max(400)}).strict().optional(),sufficiency:l.nativeEnum(zi),rationale:l.string().min(1),gaps:l.array(l.string().min(1)),acceptedEvidence:l.array(l.object({kind:l.nativeEnum(Bo),repository:l.string().min(1),revision:Jr,reference:l.string().min(1),summary:l.string().min(1)}).strict()),actionRequired:l.array(l.nativeEnum(Ro))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:l.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),by=500,AV=2048,mV=1e3,fue=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,oV=e=>e.length>0&&e.length<=64&&e===e.trim()&&!fue.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),yV=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&oV(n)&&oV(i)},hue=l.object({testResults:l.array(l.object({resultId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:l.string().refine(yV,"Invalid"),testType:l.string(),runtimeTargets:ff.optional(),endpoint:l.string(),status:l.enum(["Pass","Fail","Skipped"]),details:l.string(),fileName:l.string().optional(),testId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:l.object({kind:l.nativeEnum(uf),family:l.nativeEnum(lf).optional()}).strict().optional(),origin:l.nativeEnum(py).optional()}).strict()),validation:pue,changes:l.array(l.object({id:l.string().min(1).max(512),text:l.string().max(16384),source:l.string().max(AV),testedBy:l.array(l.string().min(1).max(1024)).max(by),writtenBy:l.array(l.string().min(1).max(1024)).max(by),maintainedBy:l.array(l.string().min(1).max(1024)).max(by)}).strict()).max(mV).optional(),traceVersion:l.literal(1),display:due.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let o=n?.[s];o&&o.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,o)=>{let a=s.failureCause;a&&s.status==="Pass"&&t.addIssue({code:l.ZodIssueCode.custom,path:["testResults",o,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["testResults",o,"failureCause"],message:"an environment cause names its family, and no other cause does"});let c=["testResults",o,"resultId"],u=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||u===""||u.startsWith("/")||u.startsWith("#"))&&t.addIssue({code:l.ZodIssueCode.custom,path:c,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:l.ZodIssueCode.custom,path:c,message:"stable identity repeated"}),r.add(s.resultId)})});var EV=50,vV=l.discriminatedUnion("kind",[l.object({kind:l.literal("branch_pushed"),repository:Sr,branch:bk,commit:Jr}).strict(),l.object({kind:l.enum(["pull_request_opened","pull_request_edited"]),repository:Sr,number:Hr,branch:bk}).strict()]),gue=l.object({schemaVersion:l.literal(1),run:l.object({runId:vn,attemptNumber:l.number().int().positive(),manifestHash:_n}).strict(),target:wy,policy:wy,provenance:l.object({sources:l.array(l.object({repository:Sr,revision:Jr}).strict()),firstQualification:l.literal(!0).optional()}).strict(),delivery:l.object({generatedTests:lue}).strict(),producer:l.object({testbot:l.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:l.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:hue,githubWrites:l.array(vV).max(EV).optional()}).strict(),Qk=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Qk||{}),$k=200,Aue=l.object({cause:l.nativeEnum(Qk),credential:l.string().regex(Vr).optional(),reason:l.string().trim().min(1).max($k).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),mue=l.object({name:l.string().regex(Vr),purpose:l.enum(["sut_access","other"]),required:l.boolean(),how:l.string().trim().min(1).max(sy)}).strict(),Dxe=gue.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:lk,check:Aue.optional(),inputs:l.array(mue).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(s,o)=>t.addIssue({code:l.ZodIssueCode.custom,path:["recipe",...s],message:o});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,o)=>{sf(s.path)||n(["files",o,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",o,"path"],"file repeated"),i.add(s.path),ok.test(s.content)&&n(["files",o,"content"],"is not text");let a=Buffer.byteLength(s.content,"utf8");r+=a,a>tf&&n(["files",o,"content"],`larger than ${tf} bytes`)}),r>nf&&n(["files"],`recipe text over ${nf} bytes in total`)}),Nxe=l.object({components:l.array(l.object({name:l.string().min(1),repository:l.string().refine(yV,"Invalid"),observedRevision:l.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:l.nativeEnum(fy),evidence:l.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var yue=l.object({schemaVersion:l.literal(1),stage:l.nativeEnum(Ck),event:l.nativeEnum(mf),status:l.nativeEnum(Sk).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),wl=100,Tk=5e3,xo=2e3,wk=100,_k=/^[A-Za-z0-9_-]{1,64}$/,bV=20,wV=200,IV=100,CV=100,Eue=200,aV="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",vue=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${aV}/${aV})$`),SV=500,kV=50,RV=10,BV=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,Il=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Cr=e=>l.string().max(e).refine(t=>t.trim().length>0&&!Il.test(t),"blank, or not text"),Ji={sequence:l.number().int().min(1).max(Tk),at:l.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},xV=l.object({...Ji,kind:l.literal("reply"),to:l.string().uuid(),outcome:l.nativeEnum(Ry),accepted:l.boolean(),text:Cr(xo),note:l.object({source:l.enum(["target","environment"]),quote:Cr(xo)}).strict().optional(),kept:Cr(xo).optional()}).strict();function QV(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:l.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:l.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:l.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var $V=l.discriminatedUnion("kind",[l.object({...Ji,kind:l.literal("log"),phase:l.nativeEnum(yf),text:Cr(xo)}).strict(),l.object({...Ji,kind:l.literal("component"),name:Cr(wk),repository:Cr(Eue).refine(e=>vue.test(e)||e===Xn,"not owner/name"),file:Cr(SV).nullable(),status:l.nativeEnum(Ef),version:Cr(CV).optional()}).strict(),xV,l.object({...Ji,kind:l.literal("question"),id:l.string().regex(_k),type:l.nativeEnum(kk),text:Cr(xo),component:Cr(wk).nullable(),choices:l.array(Cr(wV)).max(bV),placeholder:Cr(IV).optional()}).strict(),l.object({...Ji,kind:l.literal("delivered"),ids:l.array(l.string().uuid()).max(wl)}).strict(),l.object({...Ji,kind:l.literal("credentials"),names:l.array(l.string().regex(Vr)).min(1).max(kV),logins:l.array(l.object({key:l.string().regex(BV),usernameVariable:l.string().regex(Vr),passwordVariable:l.string().regex(Vr)}).strict()).min(1).max(RV).optional()}).strict()]).superRefine((e,t)=>{if(QV(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>WS(i.key));new Set(n).size!==n.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:l.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),bue=l.object({schemaVersion:l.literal(1),events:l.array($V).max(wl)}).strict(),TV=l.discriminatedUnion("kind",[l.object({...Ji,kind:l.literal("log"),stage:l.nativeEnum(hf),text:Cr(xo)}).strict(),xV,l.object({...Ji,kind:l.literal("delivered"),ids:l.array(l.string().uuid()).max(wl)}).strict(),l.object({...Ji,kind:l.literal("stage"),stage:l.nativeEnum(hf),event:l.nativeEnum(mf)}).strict(),l.object({...Ji,kind:l.literal("test"),resultId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:l.enum(["Pass","Fail","Skipped"]),details:l.string().max(xo).refine(e=>!Il.test(e),"not text")}).strict()]).superRefine(QV),wue=l.object({schemaVersion:l.literal(1),events:l.array(TV).max(wl)}).strict(),cV={id:l.string().uuid(),text:l.string(),by:l.string().nullable(),at:l.string(),replied:l.literal(!0).optional()},_V=l.discriminatedUnion("kind",[l.object({...cV,kind:l.literal("instruction"),question:l.null()}),l.object({...cV,kind:l.literal("answer"),question:l.string().regex(_k)})]),DV=l.string().regex(/^[A-Za-z0-9+/]{43}=$/),Iue=l.object({id:l.string().uuid(),revision:l.string(),by:l.string().nullable(),at:l.string(),target:l.string(),own:l.object({source:l.enum(["policy","test_environment"]),text:l.string()}).nullable()}),Cue=l.object({schemaVersion:l.literal(1),leftOut:l.array(l.string()),messages:l.array(_V).optional(),stop:l.object({key:DV}).optional(),notes:Iue.optional()}),Sue=l.object({schemaVersion:l.literal(1),messages:l.array(_V).optional()});var NV=500*1024*1024,PV=l.object({id:Hr,name:l.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Hr,expiresAt:l.string().datetime()}).strict(),kue=l.object({schemaVersion:l.literal(1),artifact:PV,sessionId:vn,contentHash:_n,bytes:l.number().int().min(1).max(NV)}).strict(),Rue=l.object({schemaVersion:l.literal(1),checkpoint:l.object({artifact:PV,repository:l.object({namespace:l.string().min(1),name:l.string().min(1)}).strict(),sessionId:vn,contentHash:_n,key:DV}).strict().nullable()}).strict(),Bue=200,vl=100,Dk=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(Dk||{}),xue=l.object({kind:l.nativeEnum(Dk),setup:l.object({runId:vn,endedAt:l.string().nullable(),outcome:l.string().nullable()}).strict(),components:l.array(l.object({name:l.string().min(1),repository:l.string().min(1),status:l.nativeEnum(Ef)}).strict()).max(vl),credentials:l.array(l.string().min(1)).max(vl),answers:l.array(l.object({question:l.string(),answer:l.string().nullable()}).strict()).max(vl),instructions:l.array(l.object({text:l.string(),reply:l.string().nullable()}).strict()).max(vl),log:l.array(l.object({phase:l.nativeEnum(yf),text:l.string()}).strict()).max(Bue),recipe:l.object({files:l.array(l.object({path:l.string().min(1),content:l.string()}).strict()).max(vl),blockers:l.array(l.object({component:l.string(),problem:l.string(),evidence:l.string(),fix:l.string()}).strict()).max(vl)}).strict().optional()}).strict(),Que=l.object({schemaVersion:l.literal(1),context:xue.nullable()}).strict(),$ue=l.object({schemaVersion:l.literal(1),configuration:l.object({captureId:vn,revision:Hr.nullable(),hash:_n}).strict(),capture:l.object({schemaVersion:l.literal(1),settings:l.object({target:l.object({environment:l.unknown()}).passthrough(),timeoutMinutes:l.number().int().positive(),answerWaitMinutes:l.number().int().positive().optional(),testEnvironment:l.object({name:l.string().min(1),address:l.string().min(1).optional(),readyWhen:l.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:l.object({}).passthrough(),hash:_n}).strict()}).strict(),Tue=ml.extend({version:l.number().int().positive(),components:l.array(l.object({name:l.string().min(1),repository:l.string().min(1)}).strict()),contentHash:_n.optional(),files:l.array(l.object({path:l.string().refine(e=>sf(e)&&!cy.includes(e),"not a file of a customer_deployed plan"),content:l.string()}).strict()).optional()}).strict(),_ue=l.object({schemaVersion:l.literal(1),testEnvironment:Tue.nullable().optional(),runtimePlan:l.object({version:l.number().int().positive(),contentHash:_n,files:l.array(l.object({path:l.string().refine(sf,"not a recipe file path"),content:l.string()}).strict()).min(1),repository:ay.optional(),recipeRepository:ay.optional(),recipe:l.record(l.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),Due=l.object({schemaVersion:l.literal(1),state:l.nativeEnum(lV),ending:l.nativeEnum(Sy).nullable(),cause:l.nativeEnum(ky).nullable(),deadlineAt:l.string().datetime()}).strict();var OV=50,UV=l.object({repository:Sr,revisions:l.array(l.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:l.array(l.string().min(1)).min(1).max(OV)}).strict();function FV(e){return e.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:e.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:e.revisionsUploaded?{schemaVersion:1,reason:"revisions_uploaded",cause:null}:e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:e.mergeConflict&&uV(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:uV({...e,mergeConflict:void 0})}}function uV(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":"agent_failed"}var Nk=se(require("path"));var Cl=se(require("fs")),vc=se(require("path"));var Nue=8;function Xt(e,t,n={}){let i=t.slice(0,Nue),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}function Qs(e){if(Cl.existsSync(e))try{return JSON.parse(Cl.readFileSync(e,"utf-8"))}catch{return}}function He(e,t){return Qs(vc.join(e.outputsDir,t))}function bn(e,t,n,i){if(!n)throw new Error(`${t}.json unexpectedly invalid at artifact time: ${i[0]}`);let r=vc.join(e.outputsDir,`${t}.json`);return Cl.writeFileSync(r,JSON.stringify(n,null,2)+`
|
|
60
|
+
`)){if(!c.trim())continue;let u=c.slice(0,2).trim().charAt(0)||"M",d=c.slice(3).trim(),p=d.indexOf(" -> ");p!==-1&&(d=d.slice(p+4)),d&&r.set(d,u==="?"?"A":u)}let a=[...r.entries()].map(([c,u])=>({path:c,status:u})).sort((c,u)=>c.path.localeCompare(u.path));return{currentBranch:i,baseBranch:n,changedFiles:a}}mn();mn();var yc=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(yc||{});var yk=e=>`${e.source}:${e.site??""}:${e.key}`;var of=/^pasted-[0-9a-f]{16}$/,ko=/^file-[0-9a-f]{16}$/,af=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(af||{}),cf=e=>e.trim().toUpperCase(),z1=(e,t)=>{let n=e.trim();return of.test(n.toLowerCase())?"Pasted text":ko.test(n.toLowerCase())?t?.get(cf(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()};var py=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(py||{}),zi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(zi||{}),Ro=(v=>(v.RelatedChangeConflict="related_change_conflict",v.ReferenceOutsideTarget="reference_outside_target",v.SourceAccessLost="source_access_lost",v.ConfigurationIncomplete="configuration_incomplete",v.CredentialUnavailable="credential_unavailable",v.WorkflowBindingUnverified="workflow_binding_unverified",v.WorkflowRefUnprotected="workflow_ref_unprotected",v.BedrockWorkflowRequired="bedrock_workflow_required",v.DeploymentReview="deployment_review",v.SutRevisionMismatch="sut_revision_mismatch",v.IsolationUnavailable="isolation_unavailable",v.EvidenceInsufficient="evidence_insufficient",v.ConfigurationUnresolved="configuration_unresolved",v.ModelProviderDenied="model_provider_denied",v.ModelProviderUnavailable="model_provider_unavailable",v.RunnerProviderNotReady="runner_provider_not_ready",v.MergeConflict="merge_conflict",v))(Ro||{}),Bo=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(Bo||{}),uf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(uf||{}),lf=(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))(lf||{});var fy=(n=>(n.Probe="probe",n.Agent="agent",n))(fy||{}),hy=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(hy||{}),gy=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(gy||{});var Kt=e=>e.slice(0,12);var Gce=["generate-unit","native-run"],Axe=["preflight","plan","write",...Gce,"report","deliver"];var my=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(my||{}),zce=Object.values(my);var df=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(df||{}),Hi=l.string().trim().min(1),Hce=l.object({case:Hi.describe("recommend id this assertion enforces"),evidence:Hi.describe("the exact assertion line from the file that checks that case's observable")}),pf=l.object({kind:l.nativeEnum(hy).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Hi.describe("the dependency, endpoint or data it affects"),mechanism:l.nativeEnum(gy).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Hi.describe("what it sets up"),worker:Hi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),cleanup:Hi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Hi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),Jce=l.object({file:Hi.describe("staged path under .skyramp/staged/"),source:l.nativeEnum(df),language:Hi,covers:l.array(l.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:l.array(Hce).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:l.array(pf).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),Ek=l.object({schemaVersion:l.literal(1),tests:l.array(Jce),deferredUi:l.array(l.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Hi.describe("one paragraph")});var xs=(o=>(o.Place="place",o.Update="update",o.Regenerate="regenerate",o.Delete="delete",o.Verify="verify",o.None="none",o))(xs||{}),zr=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(zr||{}),tr=l.string().trim().min(1),H1=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(H1||{}),yy=l.object({kind:l.nativeEnum(H1),reason:tr.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),ff=l.array(l.string().url().max(2048).regex(/^https?:\/\//i)).max(50),J1=l.object({case:tr.describe("a covers id \u2014 the recommend case this test realizes"),status:l.nativeEnum(zr),runtimeTargets:ff.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),fromJourney:l.boolean().optional(),testProblem:yy.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:l.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:l.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}),q1=l.object({started:l.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:l.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:l.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:l.array(J1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),Y1=l.object({context:l.array(pf).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:l.string().optional().describe("staged path \u2014 required for placements"),file:tr.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:tr.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:l.nativeEnum(xs),covers:l.array(l.string()).optional().describe("recommend ids a placed test covers"),repro:l.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:l.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:l.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:tr.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:tr.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:q1,assertionCount:l.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:l.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:l.array(tr).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:l.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),W1=(n=>(n.Junit="junit",n.Converter="converter",n))(W1||{}),qce=tr.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Yce=l.object({results:tr.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:l.nativeEnum(W1),run:tr.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:l.array(tr).min(1).describe("the items[].file paths this run covered"),cases:l.array(l.object({test:tr.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:tr.describe("the covers id it realizes"),file:qce})).describe("map each reported test name to the case it covers")}),Wce=l.object({suites:l.array(Yce).min(1)}),vk=l.object({schemaVersion:l.literal(1),items:l.array(Y1),runnerResults:Wce.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:l.array(l.string()).describe("existing tests assessed and deliberately left untouched"),summary:tr.describe("one paragraph")});var gf=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(gf||{}),Iy=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(Iy||{}),Af=(o=>(o.PullRequest="pull_request",o.ReadyForReview="ready_for_review",o.Schedule="schedule",o.Manual="manual",o.SutSetup="sut_setup",o.RevisionRead="revision_read",o))(Af||{}),Zce=["sut_setup"],Kce=["sut_setup","schedule","revision_read"];var Cy=(t=>(t.PullRequest="pull_request",t))(Cy||{}),Ik=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(Ik||{}),Z1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var Sy=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(Sy||{}),lV=(n=>(n.Running="running",n.Ended="ended",n))(lV||{}),ky=(p=>(p.TimedOut="timed_out",p.AgentFailed="agent_failed",p.SetupFailed="setup_failed",p.CredentialMissing="credential_missing",p.RunnerLost="runner_lost",p.CheckoutFailed="checkout_failed",p.EnvironmentUnverified="environment_unverified",p.ModelProviderDenied="model_provider_denied",p.ModelProviderUnavailable="model_provider_unavailable",p.RunnerProviderNotReady="runner_provider_not_ready",p.MergeConflict="merge_conflict",p))(ky||{}),Ck=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(Ck||{}),mf=(n=>(n.Started="started",n.Finished="finished",n))(mf||{}),Sk=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(Sk||{});var kk=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(kk||{});var Ry=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(Ry||{}),yf=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(yf||{}),hf=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(hf||{});var Ef=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Ef||{}),Hr=l.string().regex(/^[1-9][0-9]{0,18}$/),Jr=l.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),bk=l.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),bl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var vn=l.string().regex(bl),_n=l.string().regex(/^[0-9a-f]{64}$/),wy=l.object({id:vn,revision:Hr}).strict(),By={provider:l.literal("github"),providerAccountId:Hr,providerRepositoryId:Hr},xy={provider:l.literal("azure-devops"),providerAccountId:vn,providerRepositoryId:vn},Sr=l.discriminatedUnion("provider",[l.object(By).strict(),l.object(xy).strict()]),Rk=l.discriminatedUnion("provider",[l.object(By).passthrough(),l.object(xy).passthrough()]),Ec=e=>`${e.provider}:${e.providerRepositoryId}`,K1={namespace:l.string().min(1),name:l.string().min(1)},dV=l.discriminatedUnion("provider",[l.object({...By,...K1}).strict(),l.object({...xy,...K1}).strict()]),X1=l.object({ref:l.string().min(1),revision:Jr}).strict(),Xce=l.object({kind:l.nativeEnum(Ik),number:Hr.optional(),ref:l.string().min(1),revision:Jr,reason:l.nativeEnum(Iy)}).strict(),eue=l.object({repository:dV,revision:Jr,ref:l.string().nullable(),reason:l.nativeEnum(Iy),change:l.object({kind:l.nativeEnum(Cy),number:Hr,base:X1.optional()}).strict().nullable(),compareWith:X1.optional(),merge:l.array(Xce).min(2).optional()}).strict();function tue(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,o]of t.entries()){if(o.kind==="pull_request"!=(o.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!Z1.includes(o.reason))return{path:["merge",s,"reason"],message:`${o.reason} does not select a merged revision`};if(o.kind==="branch"&&o.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(o.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(o.number!==void 0&&n.has(o.number)||i.has(o.ref))return{path:["merge",s],message:"names a revision the source already merges"};o.number!==void 0&&n.add(o.number),i.add(o.ref)}let r=Z1.find(s=>t.some(o=>o.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function nue(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(u=>u!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let o=new Set(e.sources.map(u=>Ec(u.repository))),a=new Set(r.map(u=>Ec(u.repository)));return a.size===r.length&&a.size===o.size&&[...a].every(u=>o.has(u))?null:"names every source of the snapshot, once"}var pV=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,fV=/^[1-9][0-9]{0,18}$/,eV=new RegExp(`${pV.source}|${fV.source}`),tV=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,rue=l.union([l.object({source:l.literal("jira"),site:l.string().regex(tV),key:l.string().regex(pV),updated:l.string().datetime(),contentHash:_n}).strict(),l.object({source:l.literal("confluence"),site:l.string().regex(tV),key:l.string().regex(fV),version:l.number().int().positive(),contentHash:_n}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),contentHash:_n}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),contentHash:_n,fileName:l.string().min(1).max(255),mediaType:l.nativeEnum(af)}).strict()]),nV=l.union([l.literal("jira"),l.literal("confluence")]),iue=l.object({schemaVersion:l.literal(1),items:l.array(l.union([l.object({source:nV,site:l.string(),key:l.string().regex(eV),state:l.literal("read"),text:l.string(),version:l.string().min(1),contentMatches:l.boolean()}).strict(),l.object({source:nV,site:l.string(),key:l.string().regex(eV),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),state:l.literal("read"),text:l.string(),version:l.string().min(1),contentMatches:l.boolean()}).strict(),l.object({source:l.literal("other"),key:l.string().regex(of),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),state:l.literal("read"),version:_n,fileName:l.string().min(1).max(255),mediaType:l.nativeEnum(af)}).strict(),l.object({source:l.literal("other"),key:l.string().regex(ko),state:l.literal("not_read"),reason:l.nativeEnum(yc)}).strict()])),instructions:l.array(l.string()).optional()}).strict(),sue=l.object({resultId:l.string().min(1),repository:l.string().min(1),testType:l.string().min(1),path:l.string(),finding:l.string().min(1)}).strict(),oue=l.object({schemaVersion:l.literal(1),runId:vn,skyrampOrgId:vn,target:wy,policy:wy.nullable(),trigger:l.object({kind:l.nativeEnum(Af),requestedAt:l.string().datetime()}).strict(),configuration:l.object({captureId:vn,revision:Hr.nullable(),hash:_n}).strict(),baseline:l.object({confirmedRunId:vn.nullable(),initialBaselineId:vn.optional(),comparisonBaselineId:vn.optional(),knownFailures:l.array(sue).optional(),sources:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional()}).strict().optional(),sources:l.array(eue).min(1).max(1e3),execution:l.object({provider:l.nativeEnum(gf),repository:dV,workflowPath:l.string(),ref:l.string()}).strict(),credentials:l.array(l.object({name:l.string(),purpose:l.nativeEnum(gl),required:l.boolean()}).strict()),requirements:l.array(rue).min(1).optional(),instructions:l.object({contentHash:_n}).strict().optional(),deployedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((c,u)=>{let d="fileName"in c?"file":"pasted";c.source==="other"&&c.key!==`${d}-${c.contentHash.slice(0,16)}`&&t.addIssue({code:l.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",u,"key"]});let p=yk({source:c.source,key:c.key});n.has(p)&&t.addIssue({code:l.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",u,"key"]}),n.add(p)});let i=e.trigger.kind,r=Zce.includes(i);r!==(e.policy===null)&&t.addIssue({code:l.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:l.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=nue(e);s&&t.addIssue({code:l.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),Kce.includes(i)&&e.sources.forEach((c,u)=>{c.reason!=="BASELINE"&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let o=new Set(e.sources.map(c=>Ec(c.repository))),a=new Set;(e.deployedRevisions??[]).forEach((c,u)=>{let d=Ec(c.repository);o.has(d)?a.has(d)&&t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions",u,"repository"],message:"repository appears twice"}):t.addIssue({code:l.ZodIssueCode.custom,path:["deployedRevisions",u,"repository"],message:"names a repository outside the snapshot"}),a.add(d)}),e.sources.forEach((c,u)=>{c.compareWith&&(c.reason!=="MANUAL_OVERRIDE"||c.change)&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(c.change?.base||c.compareWith||c.merge)&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let d=tue(c);d&&t.addIssue({code:l.ZodIssueCode.custom,path:["sources",u,...d.path],message:d.message})})});var Bk=(n=>(n.Person="person",n.Policy="policy",n))(Bk||{}),aue=l.object({kind:l.nativeEnum(Bk),name:l.string().min(1).max(256)}).strict(),cue=l.object({mcp:l.discriminatedUnion("source",[l.object({source:l.literal("npm"),version:l.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),l.object({source:l.literal("github"),ref:l.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:l.object({region:l.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:l.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Txe=l.object({schemaVersion:l.literal(1),attempt:l.object({id:vn,number:l.number().int().positive(),deadlineAt:l.string().datetime()}).strict(),manifest:oue,manifestHash:_n,entitlements:l.array(l.string()).optional(),runToken:l.string().min(1).optional(),requestedBy:aue.nullable().optional(),writeAllowed:l.boolean().optional(),claudeCodeVersion:l.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional(),statedRevisions:l.array(l.object({repository:Sr,revision:Jr}).strict()).optional(),runSettings:cue.optional()}).strict(),rV={providerRunAttempt:l.number().int().positive(),workflowRef:l.string().min(1)},uue=l.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),_xe=l.object({schemaVersion:l.literal(1),runId:vn,execution:l.discriminatedUnion("provider",[l.object({...rV,provider:l.literal("github"),repository:l.object(By).strict(),providerRunId:Hr}).strict(),l.object({...rV,provider:l.literal("azure-devops"),repository:l.object(xy).strict(),providerRunId:uue}).strict()]),requester:l.literal(!0).optional(),writeCheck:l.literal(!0).optional(),claudeCodePin:l.literal(!0).optional(),deployedPins:l.literal(!0).optional(),statedPins:l.literal(!0).optional(),runSettings:l.literal(!0).optional()}).strict(),iV=l.object({repository:Sr,number:Hr,commitSha:Jr.optional()}).strict(),Ey=l.array(l.object({repository:Sr,reason:l.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),hV=l.object({branch:bk.optional(),commitSha:Jr.optional()}).strict(),sV=l.object({repository:Sr,message:l.string(),...hV.shape}).strict(),lue=l.discriminatedUnion("status",[l.object({status:l.literal("none"),noTests:Ey}).strict(),l.object({status:l.literal("delivered"),noTests:Ey,pullRequests:l.array(iV).min(1)}).strict(),l.object({status:l.literal("partial"),noTests:Ey,pullRequests:l.array(iV).min(1),failures:l.array(sV).min(1)}).strict(),l.object({status:l.literal("failed"),message:l.string(),noTests:Ey,failures:l.array(sV).min(1).optional()}).strict()]),xk=1024*1024,gV=16*1024*1024,vy=e=>l.array(l.object({[e]:l.string()}).strict()).optional(),due=l.object({language:l.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:l.string(),validation:l.object({rationale:l.string(),gaps:l.array(l.string())}).strict().optional(),changes:l.array(l.object({id:l.string(),text:l.string()}).strict()).optional(),issuesFound:vy("description"),newTestsCreated:vy("description"),testResults:vy("details"),caveats:vy("text")}).strict(),pue=l.object({blockedPreflight:l.object({file:l.string().min(1),repository:l.string().min(1).optional(),reason:l.string().min(1).max(300),evidence:l.string().min(1).max(400)}).strict().optional(),sufficiency:l.nativeEnum(zi),rationale:l.string().min(1),gaps:l.array(l.string().min(1)),acceptedEvidence:l.array(l.object({kind:l.nativeEnum(Bo),repository:l.string().min(1),revision:Jr,reference:l.string().min(1),summary:l.string().min(1)}).strict()),actionRequired:l.array(l.nativeEnum(Ro))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:l.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),by=500,AV=2048,mV=1e3,fue=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,oV=e=>e.length>0&&e.length<=64&&e===e.trim()&&!fue.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),yV=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&oV(n)&&oV(i)},hue=l.object({testResults:l.array(l.object({resultId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:l.string().refine(yV,"Invalid"),testType:l.string(),runtimeTargets:ff.optional(),endpoint:l.string(),status:l.enum(["Pass","Fail","Skipped"]),details:l.string(),fileName:l.string().optional(),testId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:l.object({kind:l.nativeEnum(uf),family:l.nativeEnum(lf).optional()}).strict().optional(),origin:l.nativeEnum(py).optional()}).strict()),validation:pue,changes:l.array(l.object({id:l.string().min(1).max(512),text:l.string().max(16384),source:l.string().max(AV),testedBy:l.array(l.string().min(1).max(1024)).max(by),writtenBy:l.array(l.string().min(1).max(1024)).max(by),maintainedBy:l.array(l.string().min(1).max(1024)).max(by)}).strict()).max(mV).optional(),traceVersion:l.literal(1),display:due.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let o=n?.[s];o&&o.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,o)=>{let a=s.failureCause;a&&s.status==="Pass"&&t.addIssue({code:l.ZodIssueCode.custom,path:["testResults",o,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["testResults",o,"failureCause"],message:"an environment cause names its family, and no other cause does"});let c=["testResults",o,"resultId"],u=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||u===""||u.startsWith("/")||u.startsWith("#"))&&t.addIssue({code:l.ZodIssueCode.custom,path:c,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:l.ZodIssueCode.custom,path:c,message:"stable identity repeated"}),r.add(s.resultId)})});var EV=50,vV=l.discriminatedUnion("kind",[l.object({kind:l.literal("branch_pushed"),repository:Sr,branch:bk,commit:Jr}).strict(),l.object({kind:l.enum(["pull_request_opened","pull_request_edited"]),repository:Sr,number:Hr,branch:bk}).strict()]),gue=l.object({schemaVersion:l.literal(1),run:l.object({runId:vn,attemptNumber:l.number().int().positive(),manifestHash:_n}).strict(),target:wy,policy:wy,provenance:l.object({sources:l.array(l.object({repository:Sr,revision:Jr}).strict()),firstQualification:l.literal(!0).optional()}).strict(),delivery:l.object({generatedTests:lue}).strict(),producer:l.object({testbot:l.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:l.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:hue,githubWrites:l.array(vV).max(EV).optional()}).strict(),Qk=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Qk||{}),$k=200,Aue=l.object({cause:l.nativeEnum(Qk),credential:l.string().regex(Vr).optional(),reason:l.string().trim().min(1).max($k).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),mue=l.object({name:l.string().regex(Vr),purpose:l.enum(["sut_access","other"]),required:l.boolean(),how:l.string().trim().min(1).max(sy)}).strict(),Dxe=gue.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:lk,check:Aue.optional(),inputs:l.array(mue).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(s,o)=>t.addIssue({code:l.ZodIssueCode.custom,path:["recipe",...s],message:o});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,o)=>{sf(s.path)||n(["files",o,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",o,"path"],"file repeated"),i.add(s.path),ok.test(s.content)&&n(["files",o,"content"],"is not text");let a=Buffer.byteLength(s.content,"utf8");r+=a,a>tf&&n(["files",o,"content"],`larger than ${tf} bytes`)}),r>nf&&n(["files"],`recipe text over ${nf} bytes in total`)}),Nxe=l.object({components:l.array(l.object({name:l.string().min(1),repository:l.string().refine(yV,"Invalid"),observedRevision:l.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:l.nativeEnum(fy),evidence:l.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var yue=l.object({schemaVersion:l.literal(1),stage:l.nativeEnum(Ck),event:l.nativeEnum(mf),status:l.nativeEnum(Sk).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),wl=100,Tk=5e3,xo=2e3,wk=100,_k=/^[A-Za-z0-9_-]{1,64}$/,bV=20,wV=200,IV=100,CV=100,Eue=200,aV="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",vue=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${aV}/${aV})$`),SV=500,kV=50,RV=10,BV=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,Il=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Cr=e=>l.string().max(e).refine(t=>t.trim().length>0&&!Il.test(t),"blank, or not text"),Ji={sequence:l.number().int().min(1).max(Tk),at:l.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},xV=l.object({...Ji,kind:l.literal("reply"),to:l.string().uuid(),outcome:l.nativeEnum(Ry),accepted:l.boolean(),text:Cr(xo),note:l.object({source:l.enum(["target","environment"]),quote:Cr(xo)}).strict().optional(),kept:Cr(xo).optional()}).strict();function QV(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:l.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:l.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:l.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var $V=l.discriminatedUnion("kind",[l.object({...Ji,kind:l.literal("log"),phase:l.nativeEnum(yf),text:Cr(xo)}).strict(),l.object({...Ji,kind:l.literal("component"),name:Cr(wk),repository:Cr(Eue).refine(e=>vue.test(e)||e===Xn,"not owner/name"),file:Cr(SV).nullable(),status:l.nativeEnum(Ef),version:Cr(CV).optional()}).strict(),xV,l.object({...Ji,kind:l.literal("question"),id:l.string().regex(_k),type:l.nativeEnum(kk),text:Cr(xo),component:Cr(wk).nullable(),choices:l.array(Cr(wV)).max(bV),placeholder:Cr(IV).optional()}).strict(),l.object({...Ji,kind:l.literal("delivered"),ids:l.array(l.string().uuid()).max(wl)}).strict(),l.object({...Ji,kind:l.literal("credentials"),names:l.array(l.string().regex(Vr)).min(1).max(kV),logins:l.array(l.object({key:l.string().regex(BV),usernameVariable:l.string().regex(Vr),passwordVariable:l.string().regex(Vr)}).strict()).min(1).max(RV).optional()}).strict()]).superRefine((e,t)=>{if(QV(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>WS(i.key));new Set(n).size!==n.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:l.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:l.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:l.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),bue=l.object({schemaVersion:l.literal(1),events:l.array($V).max(wl)}).strict(),TV=l.discriminatedUnion("kind",[l.object({...Ji,kind:l.literal("log"),stage:l.nativeEnum(hf),text:Cr(xo)}).strict(),xV,l.object({...Ji,kind:l.literal("delivered"),ids:l.array(l.string().uuid()).max(wl)}).strict(),l.object({...Ji,kind:l.literal("stage"),stage:l.nativeEnum(hf),event:l.nativeEnum(mf)}).strict(),l.object({...Ji,kind:l.literal("test"),resultId:l.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:l.enum(["Pass","Fail","Skipped"]),details:l.string().max(xo).refine(e=>!Il.test(e),"not text")}).strict()]).superRefine(QV),wue=l.object({schemaVersion:l.literal(1),events:l.array(TV).max(wl)}).strict(),cV={id:l.string().uuid(),text:l.string(),by:l.string().nullable(),at:l.string(),replied:l.literal(!0).optional()},_V=l.discriminatedUnion("kind",[l.object({...cV,kind:l.literal("instruction"),question:l.null()}),l.object({...cV,kind:l.literal("answer"),question:l.string().regex(_k)})]),DV=l.string().regex(/^[A-Za-z0-9+/]{43}=$/),Iue=l.object({id:l.string().uuid(),revision:l.string(),by:l.string().nullable(),at:l.string(),target:l.string(),own:l.object({source:l.enum(["policy","test_environment"]),text:l.string()}).nullable()}),Cue=l.object({schemaVersion:l.literal(1),leftOut:l.array(l.string()),messages:l.array(_V).optional(),stop:l.object({key:DV}).optional(),notes:Iue.optional()}),Sue=l.object({schemaVersion:l.literal(1),messages:l.array(_V).optional()});var NV=500*1024*1024,PV=l.object({id:Hr,name:l.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Hr,expiresAt:l.string().datetime()}).strict(),kue=l.object({schemaVersion:l.literal(1),artifact:PV,sessionId:vn,contentHash:_n,bytes:l.number().int().min(1).max(NV)}).strict(),Rue=l.object({schemaVersion:l.literal(1),checkpoint:l.object({artifact:PV,repository:l.object({namespace:l.string().min(1),name:l.string().min(1)}).strict(),sessionId:vn,contentHash:_n,key:DV}).strict().nullable()}).strict(),Bue=200,vl=100,Dk=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(Dk||{}),xue=l.object({kind:l.nativeEnum(Dk),setup:l.object({runId:vn,endedAt:l.string().nullable(),outcome:l.string().nullable()}).strict(),components:l.array(l.object({name:l.string().min(1),repository:l.string().min(1),status:l.nativeEnum(Ef)}).strict()).max(vl),credentials:l.array(l.string().min(1)).max(vl),answers:l.array(l.object({question:l.string(),answer:l.string().nullable()}).strict()).max(vl),instructions:l.array(l.object({text:l.string(),reply:l.string().nullable()}).strict()).max(vl),log:l.array(l.object({phase:l.nativeEnum(yf),text:l.string()}).strict()).max(Bue),recipe:l.object({files:l.array(l.object({path:l.string().min(1),content:l.string()}).strict()).max(vl),blockers:l.array(l.object({component:l.string(),problem:l.string(),evidence:l.string(),fix:l.string()}).strict()).max(vl)}).strict().optional()}).strict(),Que=l.object({schemaVersion:l.literal(1),context:xue.nullable()}).strict(),$ue=l.object({schemaVersion:l.literal(1),configuration:l.object({captureId:vn,revision:Hr.nullable(),hash:_n}).strict(),capture:l.object({schemaVersion:l.literal(1),settings:l.object({target:l.object({environment:l.unknown()}).passthrough(),timeoutMinutes:l.number().int().positive(),answerWaitMinutes:l.number().int().positive().optional(),testEnvironment:l.object({name:l.string().min(1),address:l.string().min(1).optional(),readyWhen:l.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:l.object({}).passthrough(),hash:_n}).strict()}).strict(),Tue=ml.extend({version:l.number().int().positive(),components:l.array(l.object({name:l.string().min(1),repository:l.string().min(1)}).strict()),contentHash:_n.optional(),files:l.array(l.object({path:l.string().refine(e=>sf(e)&&!cy.includes(e),"not a file of a customer_deployed plan"),content:l.string()}).strict()).optional()}).strict(),_ue=l.object({schemaVersion:l.literal(1),testEnvironment:Tue.nullable().optional(),runtimePlan:l.object({version:l.number().int().positive(),contentHash:_n,files:l.array(l.object({path:l.string().refine(sf,"not a recipe file path"),content:l.string()}).strict()).min(1),repository:ay.optional(),recipeRepository:ay.optional(),recipe:l.record(l.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),Due=l.object({schemaVersion:l.literal(1),state:l.nativeEnum(lV),ending:l.nativeEnum(Sy).nullable(),cause:l.nativeEnum(ky).nullable(),deadlineAt:l.string().datetime()}).strict();var OV=50,UV=l.object({repository:Sr,revisions:l.array(l.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:l.array(l.string().min(1)).min(1).max(OV)}).strict();function FV(e){return e.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:e.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:e.revisionsUploaded?{schemaVersion:1,reason:"revisions_uploaded",cause:null}:e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:e.mergeConflict&&uV(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:uV({...e,mergeConflict:void 0})}}function uV(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":"agent_failed"}var Nk=se(require("path"));var Cl=se(require("fs")),vc=se(require("path"));var Nue=8;function Xt(e,t,n={}){let i=t.slice(0,Nue),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}function Qs(e){if(Cl.existsSync(e))try{return JSON.parse(Cl.readFileSync(e,"utf-8"))}catch{return}}function He(e,t){return Qs(vc.join(e.outputsDir,t))}function bn(e,t,n,i){if(!n)throw new Error(`${t}.json unexpectedly invalid at artifact time: ${i[0]}`);let r=vc.join(e.outputsDir,`${t}.json`);return Cl.writeFileSync(r,JSON.stringify(n,null,2)+`
|
|
61
61
|
`),{[t]:vc.relative(e.runDir,r)}}function nr(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:Xt(this.name,r,{fatal:!0})}}}function vf(e){return e.replace(/\s+/g," ").trim()}var bf=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(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");var Pk="outputs/preflight.json",bc="pr-diff.txt",Ok="related-diffs";function Uk(e){return Nk.join(Ok,`${e.toLowerCase().replace(/\//g,"__").replace(/[^a-z0-9._-]/g,"_")}.diff`)}function Qy(e,t,n){return e.some(i=>i.path===n&&i.repository.toLowerCase()===t.toLowerCase())}function Ai(e){if(e.outputsDir)return Qs(Nk.join(e.outputsDir,"preflight.json"))}var Ts=se(require("path"));var wf=se(require("path"));var $s="Skyramp Testbot",Qo="test-bot@skyramp.dev";var Pue=(e,t)=>Vt(t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim();function MV(e){let t="";try{t=Pue(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${wf.basename(wf.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}var Hxe=new Set(Object.values(Bo));var Jxe=l.object({checks:l.array(l.object({repository:l.string().optional(),name:l.string().min(1),headSha:l.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:l.string().default("completed"),conclusion:l.string().nullable().optional(),url:l.string().optional(),summary:l.string().optional()}))});var LV=8e3,Fk=new Map;function Uue(e){return e.repositorySlug?e.repositorySlug:(Fk.has(e.repositoryPath)||Fk.set(e.repositoryPath,MV(e.repositoryPath)),Fk.get(e.repositoryPath))}function en(e){return[{slug:Uue(e),path:e.repositoryPath,writable:!0,working:!0},...(e.relatedRepos??[]).map(t=>({slug:t.slug,path:t.path,writable:t.writable===!0,working:!1}))]}function _s(e){return en(e)[0]}function Mk(e,t){return jV(en(e),t)}function jV(e,t){return[...e].sort((n,i)=>i.path.length-n.path.length).find(n=>{let i=Ts.relative(n.path,t);return!i.startsWith("..")&&!Ts.isAbsolute(i)})}var wc=(e,t)=>e.toLowerCase()===t.toLowerCase();function $y(e,t){return t?.trim()?e.find(n=>wc(n.slug,t.trim())):e[0]}function qr(e,t){return $y(en(e),t)}var Fue=(e,t)=>`${t} is not a repository of this run (${en(e).map(n=>n.slug).join(", ")})`;function Sl(e,t){let n=qr(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${en(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:Fue(e,t)}}var rQe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var kl=e=>!!e.inputs?.scheduledValidation?.comparisonBaselineId;var i4=se(require("path"));var Ty="\xABredacted\xBB";function Lue(e){return e.replace(/AUTHORIZATION: (basic|bearer) \S+/gi,"AUTHORIZATION: $1 ***").replace(/x-access-token:[^@\s]+@/gi,"x-access-token:***@")}function If(e){return e.replace(/(https?:\/\/)[^\s/@]+@/gi,"$1[redacted]@")}function zt(e,t){if(!e||t.length===0)return e;let n=e;for(let i of t)!i||!n.includes(i)||(n=n.split(i).join(Ty));return n}function jk(e,t,n){let i=e;for(let r of[...new Set(t.filter(Boolean))].sort((s,o)=>o.length-s.length))i=i.split(r).join("*".repeat(r.length));return i.slice(-n)}function Cf(e,t){return zt(Lue(e),t)}function jue(e,t){let n=i=>typeof i=="string"?t(i):Array.isArray(i)?i.map(n):i&&typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,n(s)])):i;return n(e)}function mi(e,t){return t.length===0?e:jue(e,n=>zt(n,t))}var uQe=new TextDecoder("utf-8",{fatal:!0});function Dt(e,t=[]){let n=e.trim();if(!n)return{error:"session produced no output"};let i=c=>{try{let u=JSON.parse(c);return typeof u=="object"&&u!==null&&!Array.isArray(u)?u:void 0}catch{return}},r=i(n);if(r!==void 0)return{value:r};let s;if(n.startsWith("{")&&n.endsWith("}"))try{JSON.parse(n)}catch(c){s=c instanceof Error?c.message:String(c)}let o=[...n.matchAll(/```(?:json)?\s*\n([\s\S]*?)```/g)];for(let c=o.length-1;c>=0;c--){let u=i(o[c][1].trim());if(u!==void 0)return{value:u}}let a;for(let c=n.indexOf("{");c!==-1;c=n.indexOf("{",c+1)){let u=0,d=!1,p=!1;for(let h=c;h<n.length;h++){let g=n[h];if(p){p=!1;continue}if(g==="\\"){p=d;continue}if(g==='"'){d=!d;continue}if(!d){if(g==="{")u++;else if(g==="}"&&(u--,u===0)){let A=i(n.slice(c,h+1));A!==void 0&&Object.keys(A).length>0&&(a=A,c=h);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: "${Vue(zt(n,t))}"`}}var VV=240;function Vue(e){let t=e.replace(/\s+/g," ").trim();return t.length<=VV?t:`\u2026${t.slice(-VV)}`}function zV(e,t=0,n=new Set){return Sf(e,t,n)}var GV=e=>" ".repeat(e);function Sf(e,t,n){let i=Gue(e);switch(i._def.typeName){case"ZodObject":{let s=i.shape,o=Object.keys(s).filter(c=>!n.has(c)&&!s[c].description?.startsWith("[derived]"));return o.length===0?"{}":`{
|
|
62
62
|
${o.map((c,u)=>{let d=s[c],p=d.isOptional()?" (optional)":"",h=d.description?` // ${d.description}`:"",g=Sf(d,t+2,n);return`${GV(t+2)}"${c}": ${g}${u<o.length-1?",":""}${p}${h}`}).join(`
|
|
63
63
|
`)}
|