@skyramp/testbot-core 0.13.0-v3.114 → 0.13.0-v3.115
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/main.js +5 -5
- package/dist/post.js +1 -1
- package/package.json +1 -1
package/dist/VERSION.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.13.0-v3.
|
|
1
|
+
{"version":"0.13.0-v3.115","commit":"fdd5e69bb2fc27270ccc34b066a74f68b3aaaee9"}
|
package/dist/main.js
CHANGED
|
@@ -175,8 +175,8 @@ The generated tests for this run were delivered to the configured test repo;
|
|
|
175
175
|
this change only records the workspace/service configuration (including any
|
|
176
176
|
additional repositories analyzed in a multi-repo run).`,devPrMergedBreadcrumb:(t,e,r)=>`Dev PR merged \u2014 Testbot PR [#${t}](${e}) is still open, now targeting \`${r}\`.`,devPrClosedBreadcrumb:(t,e)=>`Dev PR closed \u2014 Testbot PR [#${t}](${e}) has been closed automatically.`,testbotPrMergeHint:"Merging this PR adds the generated/maintained tests to the feature branch. Close it if you want to discard them.",testbotPrBacklink:t=>`Generated by Skyramp Testbot for ${t}.`,testbotPrDispatchBacklink:t=>`Generated by Skyramp Testbot from a manual run against \`${t}\`.`,testbotPrMergedBacklink:t=>`Generated by Skyramp Testbot for ${t}, which has since merged; these tests target the base branch.`,staleBannerNoChanges:t=>`> \u26A0\uFE0F The latest push on ${t} did not require any new test changes.`,staleBannerStillOpen:"> This PR still reflects testbot's analysis from an earlier push; consider regenerating via `@skyramp-testbot` or merging as-is if still relevant.",testbotPrNoBaseBranchError:"Skyramp Testbot could not open a Testbot PR because no base branch could be determined (no pull_request context and no checked-out branch). This usually means the workflow ran outside a `pull_request` event and `actions/checkout` left a detached HEAD. Set `generatedTestsMode: same-branch` to commit directly to the feature branch instead.",commitFailureGeneric:(t,e)=>e?`Failed to commit generated tests to the Testbot PR branch: \`${t}\`.`:`Failed to commit generated tests: \`${t}\`.`,commitFailureHookWhereTestbotPr:"so no Testbot PR was created",commitFailureHookWhereSameBranch:"so no changes were committed to the branch",commitFailureHook:(t,e)=>`Your repository's pre-commit hook rejected the generated-test commit, ${e}. Hook error: \`${t}\`.`,gitVerificationBypassed:(t,e,r)=>`Git verification issues: your repository's hooks rejected the \`git ${t}\` of the generated tests, and Testbot tried repairing them first, but ${e}, so they were delivered with \`--no-verify\`. Hook error: \`${r}\`.`,repairTimedOut:t=>`the ${t}-minute repair time ran out`,repairSessionFailed:t=>`the repair session failed (${t})`,gitVerificationBypassedNextStep:"Testbot delivered the generated tests without passing your repository's git hooks. Fix the issues the hooks reported in those tests before merging.",commitFailureHookNextStep:"A pre-commit hook rejected Testbot's generated tests. Fix the issue it reported in the generated tests, or configure the hook/linter to skip Testbot's generated test files. (Both delivery modes run `git commit`, so switching `generatedTestsMode` will not skip the hook.)",testbotPrCreationFailure:(t,e)=>`Could not open the Testbot PR for the generated tests. Error: \`${t}\`. The tests were committed and pushed to \`${e}\` \u2014 open a pull request from that branch to review them.`,sameBranchTestRepoConflictError:"`generatedTestsMode: same-branch` is incompatible with a configured `testRepoPath`: tests were generated into the test repo checkout, but same-branch mode only commits to the primary repo checkout. Use `generatedTestsMode: separate-branch` (the default) with `testRepoPath`, or remove `testRepoPath` to commit generated tests to the same branch.",noNewTestChangesBreadcrumb:t=>`This push produced no new test changes. The prior [testbot PR](${t}) from an earlier push is still open for review.`,testbotPrLabel:(t,e)=>`Testbot PR : [${t}](${e})`,sutAppCrashDetected:t=>`**Application crash detected:** Services (${t}) failed to start due to a code error.`,sutErrorLine:t=>`
|
|
177
177
|
**Error:** \`${t}\``,sutFixPrefix:"**Fix:** ",sutServiceNotReachable:t=>`**Service not reachable:** Service at ${t} did not respond before the health-check timeout. The service may still be starting, or the startup command may not have brought it up at all.`,sutServiceNotReachableFix:"**Fix:** Check that `targetSetupCommand` actually starts this service and listens on the expected port. If the command is correct but the service is slow to start, increase `targetReadyCheckTimeout`. For a more reliable readiness signal, configure `targetReadyCheckCommand` to probe a specific health endpoint.",staged:{requestedByPerson:t=>`Requested by ${t}`,requestedByPolicy:t=>`Started by the Validation Policy ${t}`,noLiveApp:t=>`> \u26A0\uFE0F **No live app (SUT) was available this run** \u2014 the ${t} test(s) below were **not executed** (there was no app to run them against). Run them against a running app to confirm they pass (and that any repro test fails as intended).`,unitTestsInFile:(t,e,r)=>`**${t}**: ${e} unit test${e===1?"":"s"}${r?` for ${r}`:""}`,addedToExistingFile:"added to an existing test file",testPackagesHeader:"### \u{1F4E6} Running these tests",testPackageLine:(t,e)=>`\`${t}/\` is a self-contained test package Skyramp Testbot owns and maintains, with its own manifest, lockfile and runner config. Run it with \`${e}\`; to run it on every pull request, add that one command to CI.`,appManifestsUntouched:"The application's own manifests and lockfiles were not changed.",dependencyChangesHeader:"### \u{1F4E6} Changes to the application's dependencies",dependencyChangeLine:(t,e,r)=>`Added \`${t}\` to \`${e}\` (and its lockfile)${r?`: ${r}`:""}`,testMaintenanceHeader:"\u2705 Test Maintenance",keptNot:"kept, not ",declinedPlanned:"(declined the planned ",declinedMaintenanceHeader:"\u21A9\uFE0F Declined Maintenance",existingEvidenceHeader:"\u2705 Existing Evidence",trustedCheckPassed:(t,e)=>`Trusted CI check ${t} passed${e?` on ${e}`:""}, establishing:`,testResultsHeader:"\u{1F9EA} Test Results",resultsTableHeader:"| Test ID | Test Type | Endpoint | Status | Details |",unitResultsTableHeader:"| Test ID | Test Type | Code under test | Test | Cases | Status | Details |",casesPassed:(t,e,r)=>`${t}/${e} passed${r?`, ${r} skipped`:""}`,behaviourCoverageHeader:"\u{1F517} Behaviour Coverage",coverageCaption:(t,e,r,n)=>` (${t} generated \xB7 ${e} modified \xB7 ${r} verified \xB7 ${n} executed)`,coverageTableHeader:"| Behaviour | Source | Tested By | Maintained By |",writtenNotRun:"written, not run",issuesFoundHeader:"\u26A0\uFE0F Issues Found",caveatsHeader:"### \u26A0\uFE0F What This Run Could Not Prove",commentHeader:"### Skyramp Testbot",timedOut:"> \u26A0\uFE0F Run timed out \u2014 the results below are partial.",stopReasons:{},publishFailures:{},maintenanceActions:{},stoppedEarly:(t,e)=>`> \u26A0\uFE0F Run stopped early \u2014 ${t}. The results below are partial.${e}`,viewInSkyramp:t=>` [View in Skyramp](${t})`,setupRunEnds:{finished:"Setup run finished. Skyramp is checking the result.",failed:"Setup run failed.",timedOut:"Setup run ran out of time.",cancelledInSkyramp:"Setup run was cancelled in Skyramp.",stoppedToResume:"Setup run stopped. Resume it in Skyramp."},appUnreachable:t=>`Unable to contact the mothership ${t}. Please try again later.`,couldNotStart:t=>`Skyramp Testbot could not start: ${t}`,assembledAfterFailedChecks:t=>`> \u26A0\uFE0F This report was assembled automatically after the write-up step failed its checks; ${t} check(s) remain unmet \u2014 see the run log for details.`,testbotPrLine:(t,e,r)=>`Testbot PR${t?` (${t})`:""} : [${e}](${r})`,viewRun:t=>`_[View run](${t})_`,testsPrNotOpened:(t,e)=>`The tests PR could not be opened (${t}); the tests were pushed to branch \`${e}\`.`,testsNotPushed:(t,e)=>`The tests could not be pushed (${t}); they remain on the local branch \`${e}\`.`,testsPrRetargeted:t=>`The dev PR merged while tests were being generated \u2014 the tests PR targets its base branch${t?` (\`${t}\`)`:""} instead.`,testsPrUnchanged:"This push required no new test changes; the tests PR below is from an earlier run and was left as is.",committedNoPr:t=>`The tests were committed but no PR was opened: ${t}.`}};var zVe={defaultProgressHeadline:"\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u78BA\u8A8D\u3057\u3066\u30C6\u30B9\u30C8\u3092\u63A8\u5968\u3057\u3066\u3044\u307E\u3059\u3002",stepSettingUpEnvironment:"\u74B0\u5883\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7",stepAnalyzingUserRequest:"\u30E6\u30FC\u30B6\u30FC\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u5206\u6790",stepAnalyzingCodeChanges:"\u30B3\u30FC\u30C9\u5909\u66F4\u306E\u5206\u6790",stepRecommendingTests:"\u30C6\u30B9\u30C8\u306E\u63A8\u5968",stepGeneratingTests:"\u30C6\u30B9\u30C8\u306E\u751F\u6210",stepExecutingTests:"\u30C6\u30B9\u30C8\u306E\u5B9F\u884C",stepGeneratingReport:"\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3068\u30EC\u30DD\u30FC\u30C8\u306E\u751F\u6210",workflowRunLinkLabel:"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u5B9F\u884C",noReportAvailable:"\u30EC\u30DD\u30FC\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\u3002",cancelledHeader:"### Skyramp Testbot \u2014 \u30AD\u30E3\u30F3\u30BB\u30EB",cancelledBody:"\u3053\u306E\u5B9F\u884C\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F\u3002",cancelledStepSuffix:"\u30AD\u30E3\u30F3\u30BB\u30EB",abandonedHeader:"### Skyramp Testbot \u2014 \u505C\u6B62",abandonedBody:"\u3053\u306E\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u306F\u30DE\u30FC\u30B8\u3055\u308C\u305A\u306B\u30AF\u30ED\u30FC\u30BA\u3055\u308C\u305F\u305F\u3081\u3001\u30C6\u30B9\u30C8\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u306F\u5B8C\u4E86\u524D\u306B\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002",abandonedStepSuffix:"\u505C\u6B62",followingUserInstruction:t=>`> \u30E6\u30FC\u30B6\u30FC\u6307\u793A\u306B\u5F93\u3063\u3066\u3044\u307E\u3059: *${t}*`,minimalReportHeader:"### \u26A0\uFE0F Skyramp Testbot",testRecommendationsImplementedHeader:t=>`\u{1F4A1} \u5B9F\u88C5\u3057\u305F\u30C6\u30B9\u30C8\u63A8\u5968\uFF08${t}\u4EF6\uFF09`,additionalRecommendationsHeader:t=>`\u{1F4CC} \u8FFD\u52A0\u306E\u30C6\u30B9\u30C8\u63A8\u5968\uFF08${t}\u4EF6\uFF09`,additionalRecommendationsCta:"\u3053\u308C\u3089\u306E\u30C6\u30B9\u30C8\u3092\u751F\u6210\u3059\u308B\u306B\u306F\u3001\u30B3\u30E1\u30F3\u30C8\u3067 `@skyramp-testbot` \u3092\u30E1\u30F3\u30B7\u30E7\u30F3\u3057\u3066\u8FFD\u52A0\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: `@skyramp-testbot /products \u306E\u30B3\u30F3\u30C8\u30E9\u30AF\u30C8\u30C6\u30B9\u30C8\u3092\u8FFD\u52A0\u3057\u3066`\uFF09\u3002",testTypeLabels:{contract:"\u{1F4CB} \u30B3\u30F3\u30C8\u30E9\u30AF\u30C8",integration:"\u{1F517} \u7D71\u5408",e2e:"\u{1F310} E2E",ui:"\u{1F5A5}\uFE0F UI"},testTypeCellLabels:{smoke:"\u30B9\u30E2\u30FC\u30AF",fuzz:"\u30D5\u30A1\u30BA",contract:"\u30B3\u30F3\u30C8\u30E9\u30AF\u30C8",load:"\u8CA0\u8377",integration:"\u7D71\u5408",e2e:"E2E",ui:"UI",unit:"\u30E6\u30CB\u30C3\u30C8"},statusLabels:{Pass:"\u5408\u683C",Fail:"\u4E0D\u5408\u683C",Error:"\u30A8\u30E9\u30FC",Skipped:"\u30B9\u30AD\u30C3\u30D7"},severityLabels:{critical:"\u91CD\u5927",high:"\u9AD8",medium:"\u4E2D",low:"\u4F4E"},reuse:{label:"POM \u518D\u5229\u7528",noPomLayer:"\u30B9\u30AD\u30C3\u30D7 \u2014 \u3053\u306E\u30C6\u30B9\u30C8\u306B\u518D\u5229\u7528\u3067\u304D\u308B\u30DA\u30FC\u30B8\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u5C64\u306F\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",reusedAndVerified:t=>`POM \u547C\u3073\u51FA\u3057 ${t} \u4EF6\u3092\u518D\u5229\u7528\u30FB\u691C\u8A3C\u6E08\u307F`,reusedThenVerified:(t,e)=>`POM \u547C\u3073\u51FA\u3057 ${t} \u4EF6\u3092\u518D\u5229\u7528\uFF08\u3046\u3061 ${e} \u4EF6\u3092\u691C\u8A3C\u6E08\u307F\uFF09`,reused:t=>`POM \u547C\u3073\u51FA\u3057 ${t} \u4EF6\u3092\u518D\u5229\u7528`,verified:t=>`POM \u547C\u3073\u51FA\u3057 ${t} \u4EF6\u3092\u691C\u8A3C\u6E08\u307F`,unresolved:t=>`${t} \u4EF6\u306F POM \u30BD\u30FC\u30B9\u307E\u3067\u89E3\u6C7A\u3067\u304D\u305A\uFF08\u53C2\u8003\u60C5\u5831\u3067\u3042\u308A\u3001\u9664\u5916\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09`,candidates:t=>`\u5019\u88DC\u3068\u306A\u308B POM \u30D5\u30A1\u30A4\u30EB ${t} \u4EF6\u3092\u691C\u51FA`,verificationPassed:"\u691C\u8A3C\u306B\u5408\u683C",verificationFailed:"\u26A0\uFE0F \u691C\u8A3C\u306B\u5408\u683C\u3057\u307E\u305B\u3093\u3067\u3057\u305F",keptInline:t=>`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u307E\u307E: ${t}`,gate:{"not-mapped":"\u30DE\u30C3\u30D4\u30F3\u30B0\u5BFE\u8C61\u5916","demoted-by-verify":"\u691C\u8A3C\u3067\u5DEE\u3057\u623B\u3057"}},testMaintenanceHeader:t=>`\u2705 \u30C6\u30B9\u30C8\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\uFF08${t}\u4EF6\uFF09`,maintenanceTableHeader:"| \u30C6\u30B9\u30C8\u7A2E\u5225 | \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8 | \u30D5\u30A1\u30A4\u30EB | \u5909\u66F4\u5185\u5BB9 | \u5909\u66F4\u524D | \u5909\u66F4\u5F8C |",testResultsHeader:t=>`\u{1F9EA} \u30C6\u30B9\u30C8\u7D50\u679C\uFF08${t}\u4EF6\uFF09`,columnTestType:"\u30C6\u30B9\u30C8\u7A2E\u5225",columnEndpoint:"\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8",columnStatus:"\u30B9\u30C6\u30FC\u30BF\u30B9",columnDetails:"\u8A73\u7D30",columnRepo:"\u30EA\u30DD\u30B8\u30C8\u30EA",repoColumnPrimary:"\u30D7\u30E9\u30A4\u30DE\u30EA",columnVideo:"\u30D3\u30C7\u30AA",videoDownloadLink:t=>`[\u{1F4F9} \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9](${t})`,videosArtifactFallback:t=>`\u{1F4F9} \u9332\u753B\u3055\u308C\u305F UI \u30C6\u30B9\u30C8\u30D3\u30C7\u30AA: [\u5B9F\u884C\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9](${t})`,issuesFoundHeader:t=>`\u26A0\uFE0F \u691C\u51FA\u3055\u308C\u305F\u554F\u984C\uFF08${t}\u4EF6\uFF09`,configErrorsHeader:"\u2699\uFE0F \u8A2D\u5B9A\u30A8\u30E9\u30FC",nextStepsHeader:"### \u{1F4A1} \u6B21\u306E\u30B9\u30C6\u30C3\u30D7",caveatsHeader:"### \u26A0\uFE0F \u3053\u306E\u5B9F\u884C\u3067\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u3053\u3068",caveats:{deployFailed:"\u30A2\u30D7\u30EA\u3092\u8D77\u52D5\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u3053\u3053\u306B\u793A\u3059\u5185\u5BB9\u306F\u7A3C\u50CD\u4E2D\u306E\u30B7\u30B9\u30C6\u30E0\u306B\u5BFE\u3057\u3066\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",changeBrokeBringup:"\u3053\u306E\u5909\u66F4\u306B\u3088\u308A\u30A2\u30D7\u30EA\u306E\u8D77\u52D5\u304C\u58CA\u308C\u305F\u3068\u601D\u308F\u308C\u307E\u3059\u3002PR \u3092\u9069\u7528\u3057\u305F\u72B6\u614B\u3067\u8D77\u52D5\u3067\u304D\u305A\u3001\u30C6\u30B9\u30C8\u306F\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",bringupFailed:"\u3053\u306E PR \u3068\u306F\u7121\u95A2\u4FC2\u306E\u7406\u7531\u3067\u30A2\u30D7\u30EA\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\u306B\u5BFE\u3059\u308B\u30C6\u30B9\u30C8\u306F\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",testsNotExecuted:"\u3053\u306E\u5B9F\u884C\u3067\u306F\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\u306B\u5BFE\u3057\u3066\u30C6\u30B9\u30C8\u304C\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u672A\u5B9F\u884C\u306E\u30C6\u30B9\u30C8\u306F\u5909\u66F4\u304C\u6B63\u3057\u304F\u52D5\u4F5C\u3059\u308B\u8A3C\u62E0\u306B\u306A\u308A\u307E\u305B\u3093\u3002",recipeDrift:"\u8A18\u9332\u3055\u308C\u3066\u3044\u305F\u30A2\u30D7\u30EA\u306E\u8D77\u52D5\u624B\u9806\u304C\u53E4\u304F\u306A\u3063\u3066\u304A\u308A\u3001\u8D77\u52D5\u524D\u306B\u4FEE\u6B63\u304C\u5FC5\u8981\u3067\u3057\u305F\u3002",mockedDependency:t=>`${t} \u306F\u5B9F\u969B\u306B\u30C7\u30D7\u30ED\u30A4\u3055\u308C\u305A\u30E2\u30C3\u30AF\u5316\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306B\u5BFE\u3059\u308B\u6210\u529F\u7D50\u679C\u306F\u8A3C\u660E\u306B\u306F\u306A\u308A\u307E\u305B\u3093\u3002`,finalizeNotReady:t=>`\u30C6\u30B9\u30C8\u306F\u73FE\u72B6\u3067\u306F\u30DE\u30FC\u30B8\u53EF\u80FD\u306A\u72B6\u614B\u3067\u306F\u3042\u308A\u307E\u305B\u3093${t?`: ${t}`:"\u3002"}`,ciNotCovered:"\u3053\u308C\u3089\u306E\u30C6\u30B9\u30C8\u3092\u5B9F\u884C\u3059\u308B CI \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304C\u306A\u3044\u305F\u3081\u3001\u4ECA\u5F8C\u306E\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u306F\u5B9F\u884C\u3055\u308C\u307E\u305B\u3093\u3002",sutNotRequired:"\u30A2\u30D7\u30EA\u306F\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u691C\u8A3C\u30C8\u30EA\u30A2\u30FC\u30B8\u306B\u3088\u308A\u3001\u3053\u306E\u5909\u66F4\u3067\u691C\u8A3C\u304C\u5FC5\u8981\u306A\u30C7\u30D7\u30ED\u30A4\u5F8C\u306E\u632F\u308B\u821E\u3044\u306F\u306A\u3044\u3068\u5224\u65AD\u3055\u308C\u307E\u3057\u305F\u3002",lintNotCovered:t=>`\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30EA\u30F3\u30BF\u30FC\u306F ${t} \u3092\u30C1\u30A7\u30C3\u30AF\u3057\u307E\u305B\u3093\u3002\u30B9\u30BF\u30A4\u30EB\u3084\u578B\u306E\u554F\u984C\u304C\u81EA\u52D5\u7684\u306B\u306F\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3002`,analysisUnverified:t=>`\u5909\u66F4\u306E\u5206\u6790\u306E\u4E00\u90E8\u3092\u691C\u8A3C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u672A\u89E3\u6C7A\u306E\u30C1\u30A7\u30C3\u30AF ${t} \u4EF6\uFF09\u3002\u8A72\u5F53\u3059\u308B\u4E3B\u5F35\u306F\u672A\u78BA\u8A8D\u3068\u3057\u3066\u6271\u3044\u3001\u30C6\u30B9\u30C8\u3092\u8A08\u753B\u3057\u307E\u3057\u305F\u3002`,unitTestsNotRun:t=>`Testbot \u306F\u9078\u629E\u3057\u305F\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3053\u3053\u306B\u3042\u308B\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8\u306E\u7D50\u679C\u306F Testbot \u81EA\u8EAB\u306E\u518D\u5B9F\u884C\u306B\u3088\u308B\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${t}`},autoCommitHint:"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3067 `autoCommit: true` \u3092\u6709\u52B9\u306B\u3059\u308B\u3068\u3001Skyramp Testbot \u304C\u751F\u6210\u3057\u305F\u30C6\u30B9\u30C8\u3092\u81EA\u52D5\u7684\u306B\u30B3\u30DF\u30C3\u30C8\u3057\u307E\u3059\u3002",implementRecommendationsCta:"\u8FFD\u52A0\u306E\u30C6\u30B9\u30C8\u63A8\u5968\u3092\u5B9F\u88C5\u3059\u308B\u306B\u306F `@skyramp-testbot` \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u5DEE\u5206\u306E\u5206\u6790\u306B\u57FA\u3065\u304D\u3001\u4EE5\u4E0B\u3092\u63A8\u5968\u3057\u307E\u3059:",sutServiceErrorsHeadline:":warning: **\u30B5\u30FC\u30D3\u30B9\u304C\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u3066\u3044\u307E\u3059**",sutCheckedEndpoints:"Testbot \u306F\u30C6\u30B9\u30C8\u5B9F\u884C\u524D\u306B\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u3092\u5F85\u6A5F\u3057\u307E\u3057\u305F\u304C\u3001\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u304C\u901A\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002",sutCheckCodeChanges:"**\u3053\u306E PR \u306E\u30B3\u30FC\u30C9\u5909\u66F4\u304C\u30B5\u30FC\u30D3\u30B9\u969C\u5BB3\u306E\u539F\u56E0\u306B\u306A\u3063\u3066\u3044\u306A\u3044\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044** \u2014 \u65B0\u305F\u306B\u6DF7\u5165\u3057\u305F\u30D0\u30B0\u3001\u4F9D\u5B58\u95A2\u4FC2\u306E\u4E0D\u8DB3\u3001\u8A2D\u5B9A\u30DF\u30B9\u306B\u3088\u308A\u3001\u30B5\u30FC\u30D3\u30B9\u304C\u8D77\u52D5\u3067\u304D\u306A\u3044\u30FB\u6B63\u3057\u304F\u5FDC\u7B54\u3067\u304D\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002",viewWorkflowLogs:t=>`[\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30ED\u30B0\u5168\u6587\u3092\u898B\u308B \u2197](${t})`,sutFixAndRetry:"_\u554F\u984C\u3092\u4FEE\u6B63\u3057\u3066\u518D\u5EA6\u30D7\u30C3\u30B7\u30E5\u3059\u308B\u304B\u3001\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002_",internalErrorHeader:"### \u5185\u90E8\u30A8\u30E9\u30FC",internalErrorRenderFailed:"Testbot \u306F\u5B9F\u884C\u3092\u5B8C\u4E86\u3057\u307E\u3057\u305F\u304C\u3001\u30EC\u30DD\u30FC\u30C8\u306E\u751F\u6210\u4E2D\u306B\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002",internalErrorNoReport:"Testbot \u3067\u4E88\u671F\u3057\u306A\u3044\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u6B63\u5E38\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F\u304C\u3001\u30EC\u30DD\u30FC\u30C8\u304C\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",internalErrorAgentStopped:"Testbot \u306F\u30EC\u30DD\u30FC\u30C8\u3092\u751F\u6210\u3059\u308B\u524D\u306B\u505C\u6B62\u3057\u307E\u3057\u305F\u3002\u539F\u56E0\u306F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30ED\u30B0\u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002",internalErrorRawReportAvailable:"\u751F\u6210\u3055\u308C\u305F `report.json` \u306F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u304B\u3089\u53D6\u5F97\u3067\u304D\u307E\u3059\u3002\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\uFF08\u3042\u308C\u3070\uFF09\u306F\u901A\u5E38\u3069\u304A\u308A\u30B3\u30DF\u30C3\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002",internalErrorRetriedTimes:t=>`${t} \u56DE\u30EA\u30C8\u30E9\u30A4\u3057\u307E\u3057\u305F\u304C\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,internalErrorFileIssue:"\u554F\u984C\u304C\u89E3\u6C7A\u3057\u306A\u3044\u5834\u5408\u306F https://github.com/skyramp/testbot/issues \u306B\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u5B9F\u884C\u3078\u306E\u30EA\u30F3\u30AF\u3092\u6DFB\u3048\u3066 issue \u3092\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",providerNotYourCode:"\u3053\u306E\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u5909\u66F4\u304C\u539F\u56E0\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30C6\u30B9\u30C8\u306F\u751F\u6210\u3082\u5B9F\u884C\u3082\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",providerOutageHeadline:(t,e)=>`${t} \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002Testbot \u306F ${e} \u56DE\u8A66\u884C\u3057\u307E\u3057\u305F\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002`,providerOutageActionStatusPage:t=>`${t} \u3067\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B5\u30FC\u30D3\u30B9\u304C\u5FA9\u65E7\u3057\u305F\u3089\u3001Actions \u30BF\u30D6\u306E\u5B9F\u884C\u30DA\u30FC\u30B8\u304B\u3089\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,providerRateLimitHeadline:t=>`${t} \u306E\u30EC\u30FC\u30C8\u5236\u9650\u306B\u3088\u308A\u5B9F\u884C\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F (HTTP 429)\u3002`,providerRateLimitAction:"\u5236\u9650\u304C\u89E3\u9664\u3055\u308C\u308B\u307E\u3067\u5F85\u3063\u3066\u304B\u3089\u3001Actions \u30BF\u30D6\u306E\u5B9F\u884C\u30DA\u30FC\u30B8\u304B\u3089\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u7E70\u308A\u8FD4\u3059\u5834\u5408\u306F\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304C\u4F7F\u7528\u3059\u308B\u8A8D\u8A3C\u60C5\u5831\u306E\u30EC\u30FC\u30C8\u5236\u9650\u3092\u5F15\u304D\u4E0A\u3052\u308B\u304B\u3001\u540C\u6642\u306B\u5B9F\u884C\u3059\u308B PR \u306E\u6570\u3092\u6E1B\u3089\u3057\u3066\u304F\u3060\u3055\u3044\u3002",providerUsageLimitHeadline:t=>`${t} \u306E\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u5229\u7528\u4E0A\u9650\u306B\u9054\u3057\u307E\u3057\u305F\u3002`,providerUsageLimitAction:"\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u8A8D\u8A3C\u60C5\u5831\u306B\u7D10\u3065\u304F\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u5229\u7528\u4E0A\u9650\u3092\u5F15\u304D\u4E0A\u3052\u3066\u304B\u3089\u3001Actions \u30BF\u30D6\u306E\u5B9F\u884C\u30DA\u30FC\u30B8\u304B\u3089\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",providerAuthExpiredHeadline:t=>`\u5B9F\u884C\u4E2D\u306B\u3001Testbot \u304C ${t} \u3078\u63A5\u7D9A\u3059\u308B\u305F\u3081\u306E\u8A8D\u8A3C\u60C5\u5831\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u307E\u3057\u305F\u3002`,providerAuthExpiredAction:"\u8A8D\u8A3C\u60C5\u5831\u306E\u6709\u52B9\u671F\u9593\u306F\u56FA\u5B9A\u306E\u305F\u3081\u3001\u5B9F\u884C\u6642\u9593\u304C\u9577\u3044\u3068\u305D\u306E\u671F\u9593\u3092\u8D85\u3048\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002Actions \u30BF\u30D6\u306E\u5B9F\u884C\u30DA\u30FC\u30B8\u304B\u3089\u3053\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u5B9F\u884C\u304C\u6709\u52B9\u671F\u9593\u3092\u5E38\u306B\u8D85\u3048\u308B\u5834\u5408\u306F\u3001\u30B8\u30E7\u30D6\u3054\u3068\u306B\u8A8D\u8A3C\u60C5\u5831\u3092\u767A\u884C\u3059\u308B\u304B\u3001\u5404\u30B8\u30E7\u30D6\u304C\u6709\u52B9\u671F\u9593\u5185\u306B\u53CE\u307E\u308B\u3088\u3046\u5B9F\u884C\u3092\u5206\u5272\u3057\u3066\u304F\u3060\u3055\u3044\u3002",providerTimeoutHeadline:t=>`Testbot \u306F\u5236\u9650\u6642\u9593 ${t} \u5206\u3092\u8D85\u3048\u305F\u305F\u3081\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002`,providerTimeoutAction:"\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u5B9F\u884C\u306B\u672C\u5F53\u306B\u6642\u9593\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E `testbotTimeout` \u5165\u529B\u5024\u3092\u5927\u304D\u304F\u3057\u3066\u304F\u3060\u3055\u3044\u3002",workspaceTestbotPrTitle:"Skyramp Testbot: \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u8A2D\u5B9A\u306E\u66F4\u65B0",workspaceTestbotPrHeader:"### Skyramp Testbot \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u8A2D\u5B9A\u306E\u66F4\u65B0",workspaceTestbotPrBody:"\u3053\u306E PR \u306F\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u7D71\u5408 `.skyramp/workspace.yml` \u3092\u66F4\u65B0\u3057\u307E\u3059\u3002\n\u4ECA\u56DE\u306E\u5B9F\u884C\u3067\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306F\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u30C6\u30B9\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u306B\u914D\u7F6E\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u306E\u5909\u66F4\u306F\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\uFF0F\u30B5\u30FC\u30D3\u30B9\u8A2D\u5B9A\uFF08\u30DE\u30EB\u30C1\u30EA\u30DD\u30B8\u30C8\u30EA\u5B9F\u884C\u3067\u5206\u6790\u3055\u308C\u305F\u8FFD\u52A0\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u542B\u3080\uFF09\u306E\u307F\u3092\u8A18\u9332\u3057\u307E\u3059\u3002",devPrMergedBreadcrumb:(t,e,r)=>`\u958B\u767A PR \u304C\u30DE\u30FC\u30B8\u3055\u308C\u307E\u3057\u305F \u2014 Testbot PR [#${t}](${e}) \u306F\u5F15\u304D\u7D9A\u304D\u30AA\u30FC\u30D7\u30F3\u3067\u3001\u73FE\u5728\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u306F \`${r}\` \u3067\u3059\u3002`,devPrClosedBreadcrumb:(t,e)=>`\u958B\u767A PR \u304C\u30AF\u30ED\u30FC\u30BA\u3055\u308C\u307E\u3057\u305F \u2014 Testbot PR [#${t}](${e}) \u306F\u81EA\u52D5\u7684\u306B\u30AF\u30ED\u30FC\u30BA\u3055\u308C\u307E\u3057\u305F\u3002`,testbotPrMergeHint:"\u3053\u306E PR \u3092\u30DE\u30FC\u30B8\u3059\u308B\u3068\u3001\u751F\u6210/\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u3055\u308C\u305F\u30C6\u30B9\u30C8\u304C\u30D5\u30A3\u30FC\u30C1\u30E3\u30FC\u30D6\u30E9\u30F3\u30C1\u306B\u8FFD\u52A0\u3055\u308C\u307E\u3059\u3002\u7834\u68C4\u3057\u305F\u3044\u5834\u5408\u306F\u30AF\u30ED\u30FC\u30BA\u3057\u3066\u304F\u3060\u3055\u3044\u3002",testbotPrBacklink:t=>`${t} \u7528\u306B Skyramp Testbot \u304C\u751F\u6210\u3057\u307E\u3057\u305F\u3002`,testbotPrDispatchBacklink:t=>`\`${t}\` \u306B\u5BFE\u3059\u308B\u624B\u52D5\u5B9F\u884C\u306B\u3088\u308A Skyramp Testbot \u304C\u751F\u6210\u3057\u307E\u3057\u305F\u3002`,testbotPrMergedBacklink:t=>`${t} \u7528\u306B Skyramp Testbot \u304C\u751F\u6210\u3057\u307E\u3057\u305F\u3002\u5143\u306E PR \u306F\u3059\u3067\u306B\u30DE\u30FC\u30B8\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u3053\u308C\u3089\u306E\u30C6\u30B9\u30C8\u306F\u30D9\u30FC\u30B9\u30D6\u30E9\u30F3\u30C1\u3092\u5BFE\u8C61\u3068\u3057\u3066\u3044\u307E\u3059\u3002`,staleBannerNoChanges:t=>`> \u26A0\uFE0F ${t} \u3078\u306E\u6700\u65B0\u306E\u30D7\u30C3\u30B7\u30E5\u3067\u306F\u3001\u65B0\u3057\u3044\u30C6\u30B9\u30C8\u5909\u66F4\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,staleBannerStillOpen:"> \u3053\u306E PR \u306F\u4EE5\u524D\u306E\u30D7\u30C3\u30B7\u30E5\u6642\u70B9\u306E testbot \u306E\u5206\u6790\u7D50\u679C\u306E\u307E\u307E\u3067\u3059\u3002`@skyramp-testbot` \u3067\u518D\u751F\u6210\u3059\u308B\u304B\u3001\u5185\u5BB9\u304C\u4ECA\u3082\u6709\u52B9\u3067\u3042\u308C\u3070\u305D\u306E\u307E\u307E\u30DE\u30FC\u30B8\u3059\u308B\u3053\u3068\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\u3002",testbotPrNoBaseBranchError:"\u30D9\u30FC\u30B9\u30D6\u30E9\u30F3\u30C1\u3092\u7279\u5B9A\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001Skyramp Testbot \u306F Testbot PR \u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F\uFF08pull_request \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3082\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8\u6E08\u307F\u30D6\u30E9\u30F3\u30C1\u3082\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\u901A\u5E38\u306F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304C `pull_request` \u30A4\u30D9\u30F3\u30C8\u4EE5\u5916\u3067\u5B9F\u884C\u3055\u308C\u3001`actions/checkout` \u304C detached HEAD \u306E\u72B6\u614B\u3092\u6B8B\u3057\u305F\u3053\u3068\u304C\u539F\u56E0\u3067\u3059\u3002\u4EE3\u308F\u308A\u306B\u30D5\u30A3\u30FC\u30C1\u30E3\u30FC\u30D6\u30E9\u30F3\u30C1\u3078\u76F4\u63A5\u30B3\u30DF\u30C3\u30C8\u3059\u308B\u306B\u306F `generatedTestsMode: same-branch` \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",commitFailureGeneric:(t,e)=>e?`\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306E Testbot PR \u30D6\u30E9\u30F3\u30C1\u3078\u306E\u30B3\u30DF\u30C3\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F: \`${t}\`\u3002`:`\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306E\u30B3\u30DF\u30C3\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F: \`${t}\`\u3002`,commitFailureHookWhereTestbotPr:"\u305D\u306E\u305F\u3081 Testbot PR \u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",commitFailureHookWhereSameBranch:"\u305D\u306E\u305F\u3081\u5909\u66F4\u306F\u30D6\u30E9\u30F3\u30C1\u306B\u30B3\u30DF\u30C3\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F",commitFailureHook:(t,e)=>`\u30EA\u30DD\u30B8\u30C8\u30EA\u306E pre-commit \u30D5\u30C3\u30AF\u304C\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306E\u30B3\u30DF\u30C3\u30C8\u3092\u62D2\u5426\u3057\u305F\u305F\u3081\u3001${e}\u3002\u30D5\u30C3\u30AF\u306E\u30A8\u30E9\u30FC: \`${t}\`\u3002`,gitVerificationBypassed:(t,e,r)=>`Git \u306E\u691C\u8A3C\u306E\u554F\u984C: \u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30D5\u30C3\u30AF\u304C\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306E \`git ${t}\` \u3092\u62D2\u5426\u3057\u305F\u305F\u3081 Testbot \u306F\u307E\u305A\u4FEE\u6B63\u3092\u8A66\u307F\u307E\u3057\u305F\u304C\u3001${e}\u305F\u3081\u3001\`--no-verify\` \u3067\u914D\u4FE1\u3057\u307E\u3057\u305F\u3002\u30D5\u30C3\u30AF\u306E\u30A8\u30E9\u30FC: \`${r}\`\u3002`,repairTimedOut:t=>`${t} \u5206\u306E\u4FEE\u6B63\u6642\u9593\u3092\u4F7F\u3044\u5207\u3063\u305F`,repairSessionFailed:t=>`\u4FEE\u6B63\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5931\u6557\u3057\u305F\uFF08${t}\uFF09`,gitVerificationBypassedNextStep:"Testbot \u306F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E git \u30D5\u30C3\u30AF\u3092\u901A\u904E\u3057\u306A\u3044\u307E\u307E\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u3092\u914D\u4FE1\u3057\u307E\u3057\u305F\u3002\u30DE\u30FC\u30B8\u3059\u308B\u524D\u306B\u3001\u30D5\u30C3\u30AF\u304C\u5831\u544A\u3057\u305F\u554F\u984C\u3092\u305D\u308C\u3089\u306E\u30C6\u30B9\u30C8\u3067\u4FEE\u6B63\u3057\u3066\u304F\u3060\u3055\u3044\u3002",commitFailureHookNextStep:"pre-commit \u30D5\u30C3\u30AF\u304C Testbot \u306E\u751F\u6210\u3057\u305F\u30C6\u30B9\u30C8\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\u3002\u30D5\u30C3\u30AF\u304C\u5831\u544A\u3057\u305F\u554F\u984C\u3092\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u5185\u3067\u4FEE\u6B63\u3059\u308B\u304B\u3001Testbot \u306E\u751F\u6210\u3057\u305F\u30C6\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u3092\u30B9\u30AD\u30C3\u30D7\u3059\u308B\u3088\u3046\u30D5\u30C3\u30AF\uFF0F\u30EA\u30F3\u30BF\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\uFF08\u3069\u3061\u3089\u306E\u914D\u4FE1\u30E2\u30FC\u30C9\u3067\u3082 `git commit` \u3092\u5B9F\u884C\u3059\u308B\u305F\u3081\u3001`generatedTestsMode` \u3092\u5207\u308A\u66FF\u3048\u3066\u3082\u30D5\u30C3\u30AF\u306F\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u305B\u3093\u3002\uFF09",testbotPrCreationFailure:(t,e)=>`\u751F\u6210\u3055\u308C\u305F\u30C6\u30B9\u30C8\u306E Testbot PR \u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30A8\u30E9\u30FC: \`${t}\`\u3002\u30C6\u30B9\u30C8\u306F \`${e}\` \u306B\u30B3\u30DF\u30C3\u30C8\u30FB\u30D7\u30C3\u30B7\u30E5\u6E08\u307F\u3067\u3059\u3002\u3053\u306E\u30D6\u30E9\u30F3\u30C1\u304B\u3089\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u4F5C\u6210\u3057\u3066\u30EC\u30D3\u30E5\u30FC\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,sameBranchTestRepoConflictError:"`generatedTestsMode: same-branch` \u306F `testRepoPath` \u306E\u8A2D\u5B9A\u3068\u4F75\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u30C6\u30B9\u30C8\u306F\u30C6\u30B9\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8\u5074\u306B\u751F\u6210\u3055\u308C\u307E\u3057\u305F\u304C\u3001same-branch \u30E2\u30FC\u30C9\u306F\u30D7\u30E9\u30A4\u30DE\u30EA\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8\u306B\u306E\u307F\u30B3\u30DF\u30C3\u30C8\u3057\u307E\u3059\u3002`testRepoPath` \u3092\u4F7F\u3046\u5834\u5408\u306F `generatedTestsMode: separate-branch`\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\uFF09\u3092\u4F7F\u7528\u3059\u308B\u304B\u3001`testRepoPath` \u3092\u524A\u9664\u3057\u3066\u540C\u3058\u30D6\u30E9\u30F3\u30C1\u306B\u30C6\u30B9\u30C8\u3092\u30B3\u30DF\u30C3\u30C8\u3057\u3066\u304F\u3060\u3055\u3044\u3002",noNewTestChangesBreadcrumb:t=>`\u3053\u306E\u30D7\u30C3\u30B7\u30E5\u3067\u306F\u65B0\u3057\u3044\u30C6\u30B9\u30C8\u5909\u66F4\u306F\u767A\u751F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u4EE5\u524D\u306E\u30D7\u30C3\u30B7\u30E5\u3067\u4F5C\u6210\u3055\u308C\u305F [testbot PR](${t}) \u306F\u5F15\u304D\u7D9A\u304D\u30EC\u30D3\u30E5\u30FC\u5F85\u3061\u3067\u30AA\u30FC\u30D7\u30F3\u3067\u3059\u3002`,testbotPrLabel:(t,e)=>`Testbot PR: [${t}](${e})`,sutAppCrashDetected:t=>`**\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30AF\u30E9\u30C3\u30B7\u30E5\u3092\u691C\u51FA:** \u30B5\u30FC\u30D3\u30B9\uFF08${t}\uFF09\u304C\u30B3\u30FC\u30C9\u30A8\u30E9\u30FC\u306B\u3088\u308A\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,sutErrorLine:t=>`
|
|
178
|
-
**\u30A8\u30E9\u30FC:** \`${t}\``,sutFixPrefix:"**\u4FEE\u6B63\u65B9\u6CD5:** ",sutServiceNotReachable:t=>`**\u30B5\u30FC\u30D3\u30B9\u306B\u5230\u9054\u3067\u304D\u307E\u305B\u3093:** ${t} \u306E\u30B5\u30FC\u30D3\u30B9\u304C\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u306E\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u307E\u3067\u306B\u5FDC\u7B54\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B5\u30FC\u30D3\u30B9\u304C\u307E\u3060\u8D77\u52D5\u4E2D\u3067\u3042\u308B\u304B\u3001\u8D77\u52D5\u30B3\u30DE\u30F3\u30C9\u304C\u30B5\u30FC\u30D3\u30B9\u3092\u7ACB\u3061\u4E0A\u3052\u3089\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002`,sutServiceNotReachableFix:"**\u4FEE\u6B63\u65B9\u6CD5:** `targetSetupCommand` \u304C\u3053\u306E\u30B5\u30FC\u30D3\u30B9\u3092\u5B9F\u969B\u306B\u8D77\u52D5\u3057\u3001\u60F3\u5B9A\u3057\u305F\u30DD\u30FC\u30C8\u3067\u5F85\u3061\u53D7\u3051\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B3\u30DE\u30F3\u30C9\u81EA\u4F53\u306F\u6B63\u3057\u3044\u304C\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u304C\u9045\u3044\u5834\u5408\u306F\u3001`targetReadyCheckTimeout` \u3092\u5897\u3084\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3088\u308A\u78BA\u5B9F\u306A\u8D77\u52D5\u5224\u5B9A\u3092\u884C\u3046\u306B\u306F\u3001`targetReadyCheckCommand` \u3067\u7279\u5B9A\u306E\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u30D7\u30ED\u30FC\u30D6\u3059\u308B\u3088\u3046\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",staged:{requestedByPerson:t=>`${t} \u3055\u3093\u306E\u4F9D\u983C\u3067\u5B9F\u884C`,requestedByPolicy:t=>`\u691C\u8A3C\u30DD\u30EA\u30B7\u30FC ${t} \u306B\u3088\u308A\u5B9F\u884C`,noLiveApp:t=>`> \u26A0\uFE0F **\u3053\u306E\u5B9F\u884C\u3067\u306F\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\uFF08SUT\uFF09\u304C\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F** \u2014 \u4EE5\u4E0B\u306E ${t} \u4EF6\u306E\u30C6\u30B9\u30C8\u306F**\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u305B\u3093**\uFF08\u5B9F\u884C\u5BFE\u8C61\u306E\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF09\u3002\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\u306B\u5BFE\u3057\u3066\u5B9F\u884C\u3057\u3001\u5408\u683C\u3059\u308B\u3053\u3068\uFF08\u304A\u3088\u3073\u518D\u73FE\u30C6\u30B9\u30C8\u304C\u610F\u56F3\u3069\u304A\u308A\u5931\u6557\u3059\u308B\u3053\u3068\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,unitTestsInFile:(t,e,r)=>`**${t}**: ${r?`${r} \u306E`:""}\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8 ${e} \u4EF6`,addedToExistingFile:"\u65E2\u5B58\u306E\u30C6\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u306B\u8FFD\u52A0",testPackagesHeader:"### \u{1F4E6} \u3053\u308C\u3089\u306E\u30C6\u30B9\u30C8\u306E\u5B9F\u884C\u65B9\u6CD5",testPackageLine:(t,e)=>`\`${t}/\` \u306F Skyramp Testbot \u304C\u6240\u6709\u30FB\u4FDD\u5B88\u3059\u308B\u72EC\u7ACB\u3057\u305F\u30C6\u30B9\u30C8\u30D1\u30C3\u30B1\u30FC\u30B8\u3067\u3001\u72EC\u81EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3001\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u3001\u30E9\u30F3\u30CA\u30FC\u8A2D\u5B9A\u3092\u6301\u3061\u307E\u3059\u3002\`${e}\` \u3067\u5B9F\u884C\u3067\u304D\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u5B9F\u884C\u3059\u308B\u306B\u306F\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092 CI \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,appManifestsUntouched:"\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u81EA\u8EAB\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3068\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u306F\u5909\u66F4\u3057\u3066\u3044\u307E\u305B\u3093\u3002",dependencyChangesHeader:"### \u{1F4E6} \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u4F9D\u5B58\u95A2\u4FC2\u306E\u5909\u66F4",dependencyChangeLine:(t,e,r)=>`\`${e}\`\uFF08\u304A\u3088\u3073\u305D\u306E\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\uFF09\u306B \`${t}\` \u3092\u8FFD\u52A0${r?`: ${r}`:""}`,testMaintenanceHeader:"\u2705 \u30C6\u30B9\u30C8\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9",keptNot:"\u5909\u66F4\u305B\u305A\u7DAD\u6301 \u2014 \u898B\u9001\u3063\u305F\u64CD\u4F5C: ",declinedPlanned:"(\u4E88\u5B9A\u3057\u3066\u3044\u305F\u64CD\u4F5C\u3092\u898B\u9001\u308A: ",declinedMaintenanceHeader:"\u21A9\uFE0F \u898B\u9001\u3063\u305F\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9",existingEvidenceHeader:"\u2705 \u65E2\u5B58\u306E\u30A8\u30D3\u30C7\u30F3\u30B9",trustedCheckPassed:(t,e)=>`\u4FE1\u983C\u6E08\u307F\u306E CI \u30C1\u30A7\u30C3\u30AF ${t} \u304C${e?` ${e} \u3067`:""}\u5408\u683C\u3057\u3001\u6B21\u3092\u78BA\u8A8D\u3057\u307E\u3057\u305F:`,testResultsHeader:"\u{1F9EA} \u30C6\u30B9\u30C8\u7D50\u679C",resultsTableHeader:"| \u30C6\u30B9\u30C8 ID | \u30C6\u30B9\u30C8\u7A2E\u5225 | \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8 | \u30B9\u30C6\u30FC\u30BF\u30B9 | \u8A73\u7D30 |",unitResultsTableHeader:"| \u30C6\u30B9\u30C8 ID | \u30C6\u30B9\u30C8\u7A2E\u5225 | \u30C6\u30B9\u30C8\u5BFE\u8C61\u306E\u30B3\u30FC\u30C9 | \u30C6\u30B9\u30C8 | \u30B1\u30FC\u30B9\u6570 | \u30B9\u30C6\u30FC\u30BF\u30B9 | \u8A73\u7D30 |",casesPassed:(t,e,r)=>`${e} \u4EF6\u4E2D ${t} \u4EF6\u5408\u683C${r?`\u3001${r} \u4EF6\u30B9\u30AD\u30C3\u30D7`:""}`,behaviourCoverageHeader:"\u{1F517} \u632F\u308B\u821E\u3044\u306E\u30AB\u30D0\u30EC\u30C3\u30B8",coverageCaption:(t,e,r,n)=>`\uFF08\u751F\u6210 ${t} \xB7 \u5909\u66F4 ${e} \xB7 \u691C\u8A3C ${r} \xB7 \u5B9F\u884C ${n}\uFF09`,coverageTableHeader:"| \u632F\u308B\u821E\u3044 | \u30BD\u30FC\u30B9 | \u30C6\u30B9\u30C8 | \u30E1\u30F3\u30C6\u30CA\u30F3\u30B9 |",writtenNotRun:"\u4F5C\u6210\u6E08\u307F\u30FB\u672A\u5B9F\u884C",issuesFoundHeader:"\u26A0\uFE0F \u691C\u51FA\u3055\u308C\u305F\u554F\u984C",caveatsHeader:"### \u26A0\uFE0F \u3053\u306E\u5B9F\u884C\u3067\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u3053\u3068",commentHeader:"### Skyramp Testbot",timedOut:"> \u26A0\uFE0F \u5B9F\u884C\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F \u2014 \u4EE5\u4E0B\u306E\u7D50\u679C\u306F\u4E00\u90E8\u306E\u307F\u3067\u3059\u3002",stopReasons:{"pr-closed":"\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u30DE\u30FC\u30B8\u3055\u308C\u305A\u306B\u30AF\u30ED\u30FC\u30BA\u3055\u308C\u307E\u3057\u305F",cancelled:"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u305F\u304B\u3001\u30E9\u30F3\u30CA\u30FC\u304C\u505C\u6B62\u3057\u307E\u3057\u305F","attempt-cancelled":"Skyramp \u3067\u3053\u306E\u5B9F\u884C\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F","attempt-closed":"Skyramp \u304C\u3053\u306E\u5B9F\u884C\u3092\u7D42\u4E86\u3057\u307E\u3057\u305F"},maintenanceActions:{update:"\u66F4\u65B0",regenerate:"\u518D\u751F\u6210",delete:"\u524A\u9664",verify:"\u691C\u8A3C",updated:"\u66F4\u65B0",regenerated:"\u518D\u751F\u6210",deleted:"\u524A\u9664",verified:"\u691C\u8A3C"},publishFailures:{push:"\u30D7\u30C3\u30B7\u30E5\u306B\u5931\u6557",auth:"\u8A8D\u8A3C\u30A8\u30E9\u30FC",conflict:"\u7AF6\u5408",unknown:"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"},stoppedEarly:(t,e)=>`> \u26A0\uFE0F \u5B9F\u884C\u304C\u9014\u4E2D\u3067\u505C\u6B62\u3057\u307E\u3057\u305F \u2014 ${t}\u3002\u4EE5\u4E0B\u306E\u7D50\u679C\u306F\u4E00\u90E8\u306E\u307F\u3067\u3059\u3002${e}`,viewInSkyramp:t=>` [Skyramp \u3067\u8868\u793A](${t})`,setupRunEnds:{finished:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002Skyramp \u304C\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059\u3002",failed:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002",timedOut:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u304C\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3057\u305F\u3002",cancelledInSkyramp:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u306F Skyramp \u3067\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F\u3002",stoppedToResume:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u3092\u505C\u6B62\u3057\u307E\u3057\u305F\u3002Skyramp \u3067\u518D\u958B\u3067\u304D\u307E\u3059\u3002"},appUnreachable:t=>`Skyramp\uFF08${t}\uFF09\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002`,couldNotStart:t=>`Skyramp Testbot \u3092\u958B\u59CB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t}`,assembledAfterFailedChecks:t=>`> \u26A0\uFE0F \u4F5C\u6210\u30B9\u30C6\u30C3\u30D7\u304C\u30C1\u30A7\u30C3\u30AF\u306B\u5408\u683C\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u3053\u306E\u30EC\u30DD\u30FC\u30C8\u306F\u81EA\u52D5\u3067\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u3057\u305F\u3002${t} \u4EF6\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u672A\u9054\u6210\u3067\u3059 \u2014 \u8A73\u7D30\u306F\u5B9F\u884C\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,testbotPrLine:(t,e,r)=>`Testbot PR${t?`\uFF08${t}\uFF09`:""}: [${e}](${r})`,viewRun:t=>`_[\u5B9F\u884C\u3092\u8868\u793A](${t})_`,testsPrNotOpened:(t,e)=>`\u30C6\u30B9\u30C8 PR \u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${t}\uFF09\u3002\u30C6\u30B9\u30C8\u306F\u30D6\u30E9\u30F3\u30C1 \`${e}\` \u306B\u30D7\u30C3\u30B7\u30E5\u3055\u308C\u3066\u3044\u307E\u3059\u3002`,testsNotPushed:(t,e)=>`\u30C6\u30B9\u30C8\u3092\u30D7\u30C3\u30B7\u30E5\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${t}\uFF09\u3002\u30C6\u30B9\u30C8\u306F\u30ED\u30FC\u30AB\u30EB\u30D6\u30E9\u30F3\u30C1 \`${e}\` \u306B\u6B8B\u3063\u3066\u3044\u307E\u3059\u3002`,testsPrRetargeted:t=>`\u30C6\u30B9\u30C8\u306E\u751F\u6210\u4E2D\u306B\u958B\u767A PR \u304C\u30DE\u30FC\u30B8\u3055\u308C\u307E\u3057\u305F \u2014 \u30C6\u30B9\u30C8 PR \u306F\u4EE3\u308F\u308A\u306B\u30D9\u30FC\u30B9\u30D6\u30E9\u30F3\u30C1${t?`\uFF08\`${t}\`\uFF09`:""}\u3092\u5BFE\u8C61\u306B\u3057\u3066\u3044\u307E\u3059\u3002`,testsPrUnchanged:"\u3053\u306E\u30D7\u30C3\u30B7\u30E5\u3067\u306F\u65B0\u3057\u3044\u30C6\u30B9\u30C8\u306E\u5909\u66F4\u306F\u4E0D\u8981\u3067\u3057\u305F\u3002\u4EE5\u4E0B\u306E\u30C6\u30B9\u30C8 PR \u306F\u4EE5\u524D\u306E\u5B9F\u884C\u306E\u3082\u306E\u3067\u3001\u305D\u306E\u307E\u307E\u306B\u3057\u3066\u3044\u307E\u3059\u3002",committedNoPr:t=>`\u30C6\u30B9\u30C8\u306F\u30B3\u30DF\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F\u304C\u3001PR \u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${t}\u3002`}};var SI=(r=>(r.En="en",r.Ja="ja",r))(SI||{}),GVe={en:Ko,ja:zVe},Zne="en";function gq(t){let e=t.trim().toLowerCase();if(e==="")return"en";let r=Object.values(SI);return r.includes(e)?e:(X(`Invalid language '${t}'. Supported: ${r.join(", ")}. Falling back to 'en'.`),"en")}function uB(t){Zne=t}function jVe(){return Zne}function mA(t,e){return(Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0)??e}function ne(){return GVe[Zne]}function VVe(){let e=[];for(let r of Object.values(GVe))for(let n of[r.testbotPrBacklink,r.testbotPrDispatchBacklink,r.testbotPrMergedBacklink]){let s=n("\0");if(s.indexOf("\0")<0){X("A Testbot PR backlink template does not interpolate its argument; skipping it for stale-backlink stripping.");continue}e.push({prefix:s.slice(0,s.indexOf("\0")),suffix:s.slice(s.lastIndexOf("\0")+1)})}return e}var OE=(a=>(a.ProviderOutage="provider_outage",a.ProviderRateLimit="provider_rate_limit",a.ProviderUsageLimit="provider_usage_limit",a.ProviderAuthExpired="provider_auth_expired",a.Timeout="timeout",a.NoReport="no_report",a.RenderFailure="render_failure",a))(OE||{});(e=>{function t(r,n){switch(r){case"provider_outage":return{headline:ne().providerOutageHeadline(n.provider.name,n.maxRetries),action:ne().providerOutageActionStatusPage(n.provider.statusUrl)};case"provider_rate_limit":return{headline:ne().providerRateLimitHeadline(n.provider.name),action:ne().providerRateLimitAction};case"provider_usage_limit":return{headline:ne().providerUsageLimitHeadline(n.provider.name),action:ne().providerUsageLimitAction};case"provider_auth_expired":return{headline:ne().providerAuthExpiredHeadline(n.provider.name),action:ne().providerAuthExpiredAction};case"timeout":return{headline:ne().providerTimeoutHeadline(n.timeoutMinutes),action:ne().providerTimeoutAction};case"no_report":case"render_failure":return}}e.buildNotice=t})(OE||={});var Aq=(r=>(r.SameBranch="same-branch",r.SeparateBranch="separate-branch",r))(Aq||{}),Vs="skyramp",qf=class{supportsNdjsonLog=!1;reusesPreinstalledCli=!0;skillsPluginDir(){}setupAgentEnv(e,r){let n=e[this.apiKeyField];n&&ei(this.envVar,n)}};dB();dB();dB();Sc();function mB(t,e){if(process.env.GITHUB_ACTIONS)return new ME(t,vp,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}Ke();zKe();var GKe=t=>gae({...t});var Aae=(r=>(r.Sonnet="sonnet",r.Opus="opus",r))(Aae||{}),jKe="opus",VKe={sonnet:"claude-sonnet-5[1m]",opus:"claude-opus-5-5[1m]"},WKe=VKe[jKe],M7t={sonnet:"anthropic.claude-sonnet-5[1m]",opus:"anthropic.claude-opus-5-5[1m]"};function JI(t){return Object.values(Aae).includes(t)}function yae(t){let e=(t??"").trim();if(e==="")return jKe;let r=e.toLowerCase();return JI(r)?r:e}function Q7t(t){let e=(t??"").trim().toLowerCase();return e.startsWith("us-gov-")?"us-gov":e.startsWith("eu-")?"eu":e.startsWith("ap-")?"apac":"us"}function KH(t,e){return`${Q7t(e)}.${M7t[t]}`}function bae(t){return t||process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||""}function YKe(t,e){if(e)return e;let r=yae(t.model);return JI(r)?t.useBedrock?KH(r,bae(t.awsRegion)):VKe[r]:r}async function L7t(t){return GKe({roleArn:t.roleArn,webIdentityToken:t.webIdentityToken,roleSessionName:t.roleSessionName,durationSeconds:t.durationSeconds,clientConfig:{region:t.region}})()}var nP=3600,F7t=43200,U7t=15;function $7t(t){let e=Math.ceil((t+U7t)*60);return Math.min(F7t,Math.max(nP,e))}function q7t(t){return t instanceof Error?t.name==="ValidationError"&&/MaxSessionDuration|DurationSeconds/i.test(t.message):!1}async function XH(t){let e=t.env??process.env,r=e.AWS_ROLE_ARN?.trim(),n=e.AWS_REGION?.trim()||e.AWS_DEFAULT_REGION?.trim();if(e.SKYRAMP_REFRESH_BEDROCK_SESSION!=="1"||e.CLAUDE_CODE_USE_BEDROCK!=="1")return!1;let s=t.identity;if(!r||!s||!n)return t.debug("Bedrock session refresh skipped: needs AWS_ROLE_ARN, AWS_REGION (or AWS_DEFAULT_REGION) and a web identity from the job"),!1;try{let i=await s.token("sts.amazonaws.com");if(!i)throw new Error("OIDC response carried no token value");let o=`testbot-agent-${s.runId??"local"}`.replace(/[^A-Za-z0-9=,.@_-]/g,"").slice(0,64),a=t.assumeRole??L7t,c={roleArn:r,webIdentityToken:i,roleSessionName:o,region:n},l=$7t(t.timeoutMinutes),u,d=nP;try{u=await a({...c,durationSeconds:l}),d=l}catch(p){if(l<=nP||!q7t(p))throw p;t.warning(`The Bedrock role rejected a ${l}s session (its MaxSessionDuration is lower). Minting a ${nP}s session instead, which is shorter than the ${t.timeoutMinutes}m testbotTimeout; raise MaxSessionDuration on ${r} to at least ${l}s or the agent can lose its credentials mid-run.`),u=await a({...c,durationSeconds:nP})}if(!u.accessKeyId||!u.secretAccessKey||!u.sessionToken)throw new Error("assume-role returned an incomplete credential triple");return t.setSecret(u.accessKeyId),t.setSecret(u.secretAccessKey),t.setSecret(u.sessionToken),e.AWS_ACCESS_KEY_ID=u.accessKeyId,e.AWS_SECRET_ACCESS_KEY=u.secretAccessKey,e.AWS_SESSION_TOKEN=u.sessionToken,t.debug(`Minted a fresh Bedrock session for this agent attempt (${d}s)`),t.onMinted?.(u.expiration?.getTime()??Date.now()+d*1e3),!0}catch(i){return t.warning(`Could not refresh the Bedrock session; continuing with existing credentials: ${i instanceof Error?i.message:String(i)}`),!1}}var ZH=(i=>(i.Low="low",i.Medium="medium",i.High="high",i.XHigh="xhigh",i.Max="max",i))(ZH||{}),KI="high",JKe="medium";function KKe(t){return Object.values(ZH).includes(t)}var XKe=5;function H7t(t){let e=t.split(/\r?\n/).map(r=>r.trim()).filter(Boolean);if(e.length>XKe)throw new Error(`relatedRepoPaths supports at most ${XKe} entries (got ${e.length}); the cap limits how much cross-repo context is loaded to avoid overflowing Testbot's context window.`);return e}function z7t(t){let e=t.trim().toLowerCase();return e===""?"separate-branch":Object.values(Aq).includes(e)?e:(X(`Invalid generatedTestsMode '${t}'. Falling back to 'separate-branch'.`),"separate-branch")}function G7t(t){let e=(t??"").trim();if(e!==""){if(/^(?:[1-9]|10)$/.test(e))return Number(e);X(`Ignoring perTestMaxFixAttempts="${t}": expected a whole number from 1 to 10; the Skyramp MCP default applies`)}}function j7t(t){let e=(t??"").trim().toLowerCase();return e===""?KI:KKe(e)?e:(X(`Ignoring effort="${t}": expected one of ${Object.values(ZH).join(", ")}; using "${KI}"`),KI)}function e2(){let t=yae(qe("model"));return JI(t)||X(`model '${t}' is not a tested alias (sonnet, opus); passing it to the agent verbatim as a raw model id.`),{skyrampLicenseFile:qe("skyrampLicenseFile"),cursorApiKey:qe("cursorApiKey"),copilotApiKey:qe("copilotApiKey"),anthropicApiKey:qe("anthropicApiKey"),useBedrock:Cd("useBedrock"),awsRegion:qe("awsRegion"),useLocalAuth:qe("useLocalAuth").toLowerCase()==="true",model:t,effort:j7t(qe("effort")),targetSetupCommand:qe("targetSetupCommand"),authTokenCommand:qe("authTokenCommand"),uiCredentials:qe("uiCredentials"),targetTeardownCommand:qe("targetTeardownCommand"),skipTargetTeardown:Cd("skipTargetTeardown"),skyrampExecutorVersion:qe("skyrampExecutorVersion"),skyrampMcpVersion:qe("skyrampMcpVersion"),skyrampMcpSource:qe("skyrampMcpSource"),skyrampMcpGithubToken:qe("skyrampMcpGithubToken"),skyrampMcpGithubRef:qe("skyrampMcpGithubRef"),nodeVersion:qe("nodeVersion"),skipTargetSetup:Cd("skipTargetSetup"),targetReadyCheckCommand:qe("targetReadyCheckCommand"),targetReadyCheckTimeout:(()=>{let r=parseInt(qe("targetReadyCheckTimeout"),10)||1800;return r<1?(X(`targetReadyCheckTimeout must be at least 1 second, got ${r}. Using 1s.`),1):r})(),targetReadyCheckInterval:(()=>{let r=parseInt(qe("targetReadyCheckInterval"),10),n=isNaN(r)?30:r;return n<1?(X(`targetReadyCheckInterval must be at least 1 second, got ${n}. Using 1s.`),1):n})(),targetReadyCheckDiagnosticsCommand:(()=>{let r=qe("targetReadyCheckDiagnosticsCommand");return r.trim().toLowerCase()==="none"?"":r})(),workingDirectory:qe("workingDirectory"),autoCommit:Cd("autoCommit"),commitMessage:qe("commitMessage"),generatedTestsMode:z7t(qe("generatedTestsMode")),postPrComment:Cd("postPrComment"),testExecutionTimeout:parseInt(qe("testExecutionTimeout"),10)||300,maxRecommendations:(()=>{let r=parseInt(qe("maxRecommendations"),10);return isNaN(r)?void 0:Math.max(0,r)})(),maxGenerate:(()=>{let r=parseInt(qe("maxGenerate"),10);return isNaN(r)?void 0:Math.max(0,r)})(),perTestMaxFixAttempts:G7t(qe("perTestMaxFixAttempts")),testbotMaxRetries:parseInt(qe("testbotMaxRetries"),10)||3,testbotRetryDelay:parseInt(qe("testbotRetryDelay"),10)||10,testbotTimeout:parseInt(qe("testbotTimeout"),10)||60,targetSetupRetries:parseInt(qe("targetSetupRetries"),10)||3,targetSetupRetryDelay:parseInt(qe("targetSetupRetryDelay"),10)||10,authTokenRetries:(()=>{let r=parseInt(qe("authTokenRetries"),10);return Number.isFinite(r)&&r>=1?r:6})(),authTokenRetryDelay:(()=>{let r=parseInt(qe("authTokenRetryDelay"),10);return Number.isFinite(r)&&r>=0?r:10})(),reportCollapsed:Cd("reportCollapsed"),language:gq(qe("language")),enableDebug:Cd("enableDebug"),testRepoPath:qe("testRepoPath")||void 0,relatedRepoPaths:H7t(qe("relatedRepoPaths")),allowedAuthors:qe("allowedAuthors").split(/\r?\n/).map(r=>r.trim()).filter(Boolean)}}function ZKe(t){let e=!!t.cursorApiKey,r=!!t.copilotApiKey,n=!!t.anthropicApiKey;if(t.useBedrock){if(e||r)throw new Error("useBedrock cannot be combined with cursorApiKey or copilotApiKey. Bedrock is a provider for the Claude Code agent.");return n&&X("anthropicApiKey is ignored when useBedrock is true \u2014 Bedrock provides model credentials via AWS."),t.useLocalAuth&&X("useLocalAuth is ignored when useBedrock is true \u2014 Bedrock provides model credentials via AWS."),Ne("Using Claude Code CLI agent (AWS Bedrock)"),"claude"}if(t.useLocalAuth){if(e||r)throw new Error("useLocalAuth cannot be combined with cursorApiKey or copilotApiKey. Local auth is a provider for the Claude Code agent.");return n&&X("anthropicApiKey is ignored when useLocalAuth is true \u2014 the already-logged-in claude CLI session is used instead."),Ne("Using Claude Code CLI agent (local auth)"),"claude"}if([e,r,n].filter(Boolean).length>1)throw new Error("Multiple agent API keys provided. Please provide only one of: cursorApiKey, copilotApiKey, anthropicApiKey.");if(e)return Ne("Using Cursor CLI agent"),"cursor";if(r)return Ne("Using GitHub Copilot CLI agent"),"copilot";if(n)return Ne("Using Claude Code CLI agent"),"claude";throw new Error("No agent API key provided. Please provide one of: cursorApiKey, copilotApiKey, or anthropicApiKey.")}Ke();var r2=q(require("fs")),Eae=q(require("path"));Ke();uN();var t9e=q(require("child_process")),dw=class extends Error{constructor(e){super(e),this.name="ExecTimeoutError"}},XI=class extends Error{constructor(e){super(e),this.name="ExecAbortedError"}};function e9e(t,e){if(!(!t||t.destroyed||t.writableEnded))try{t.write(e)}catch(r){X(`stream write failed: ${r instanceof Error?r.message:String(r)}`)}}async function Be(t,e=[],r={}){let n="",s="",i={cwd:r.cwd,silent:r.silent??!1,ignoreReturnCode:r.ignoreReturnCode??!1,env:r.env?{...process.env,...r.env}:void 0,input:r.input,listeners:{stdout:a=>{n+=a.toString(),e9e(r.stdoutStream,a)},stderr:a=>{s+=a.toString()}}};if(r.timeout||r.signal){let a=r.signal;return a?.aborted?Promise.reject(new XI(`Command aborted before start: ${t}`)):new Promise((c,l)=>{let u=t9e.spawn(t,e,{cwd:r.cwd,env:r.env?{...process.env,...r.env}:process.env,stdio:["pipe","pipe","pipe"],shell:!1});u.stdout?.on("data",h=>{n+=h.toString(),r.silent||process.stdout.write(h),e9e(r.stdoutStream,h)}),u.stderr?.on("data",h=>{s+=h.toString(),r.silent||process.stderr.write(h)}),r.input&&u.stdin?.end(r.input);let d=()=>{f&&clearTimeout(f),a?.removeEventListener("abort",m)},p=h=>{d();try{u.kill("SIGTERM")}catch{}l(h)},m=()=>p(new XI(`Command aborted: ${t}`)),f=r.timeout?setTimeout(()=>p(new dw(`Command timed out after ${Math.round(r.timeout/6e4)}m: ${t}`)),r.timeout):void 0;a?.addEventListener("abort",m,{once:!0}),u.on("close",h=>{d();let A=h??1;A!==0&&!r.ignoreReturnCode?l(new Error(`The process '${t}' failed with exit code ${A}`)):c({exitCode:A,stdout:n,stderr:s})}),u.on("error",h=>{d(),l(h)})})}return{exitCode:await SS(t,e,i),stdout:n,stderr:s}}function iP(t){return(e,r)=>{let n=t?{...r,cwd:t}:r;return n?Be("git",e,n):Be("git",e)}}function NA(t){return new Promise(e=>setTimeout(e,t*1e3))}async function li(t,e){for(let r=1;r<=e.retries;r++)try{return await t()}catch(n){if(r<e.retries)X(`${e.label} failed, retrying (${r}/${e.retries})...`),await NA(e.delay);else throw n}throw new Error("unreachable")}async function Xn(t,e){wi(t);try{return await e()}finally{ss()}}async function r9e(t){let e=process.getuid?.(),r=process.getgid?.();if(!(e===void 0||r===void 0))try{let{exitCode:n,stderr:s}=await Be("sudo",["-n","chown","-R","-h",`${e}:${r}`,"."],{cwd:t,silent:!0,ignoreReturnCode:!0});n!==0&&Rt(`worktree chown skipped (exit ${n}): ${s.trim()}`)}catch(n){Rt(`worktree chown skipped: ${n instanceof Error?n.message:String(n)}`)}}var n9e=!1;function s9e(t){n9e=t}function Rt(t){n9e&&ee(`[debug] ${t}`)}var V7t=1e3;function Qa(t){return t*V7t}function Dl(t){let e=t.split("/");return e.length===2&&e[0]&&e[1]?{owner:e[0],repo:e[1]}:null}var sP=/^[A-Za-z_][A-Za-z0-9_.-]*$/;function i9e(t){if(t.startsWith("{"))try{let o=JSON.parse(t);return{username:typeof o.username=="string"?o.username:void 0,password:typeof o.password=="string"?o.password:void 0,role:typeof o.role=="string"?o.role:void 0}}catch{return{}}let e=t.indexOf(":"),n=!(e>=0&&!/[=;]/.test(t.slice(0,e)))&&/(^|;)\s*role\s*=/.test(t);if(/(^|;)\s*(username|password)\s*=/.test(t)||n){let o=new Map;for(let a of t.split(";")){let c=a.indexOf("=");c>0&&sP.test(a.slice(0,c).trim())&&o.set(a.slice(0,c).trim(),a.slice(c+1).trim())}return{username:o.get("username"),password:o.get("password"),role:o.get("role")}}if(t==="")return{};if(!t.includes(":"))for(let o of t.split(";")){let a=o.indexOf("=");if(a>0&&sP.test(o.slice(0,a).trim()))return{}}let[s,...i]=t.split(":");return{username:s,password:i.join(":")}}function o9e(t){let e=t.split(/\r?\n/).map(s=>s.trim()).find(s=>s!=="")??"",{username:r,password:n}=i9e(e);return{username:r,password:n}}function W7t(t){return t.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function Y7t(t){let e=t.split(/\r?\n/).map(n=>n.trim()).filter(n=>n!==""),r=new Set;return e.map((n,s)=>{let{username:i,password:o,role:a}=i9e(n),c=s+1,l=a?W7t(a):"";for(l||(l=String(c));r.has(l);)l=`${l}_${c}`;return r.add(l),{key:l,username:i,password:o}})}function a9e(t){let e=Y7t(t);if(e.length<2)return[];let r=[];for(let{key:n,username:s,password:i}of e)s!==void 0&&r.push({envName:`SKYRAMP_UI_USERNAME_${n}`,value:s}),i!==void 0&&r.push({envName:`SKYRAMP_UI_PASSWORD_${n}`,value:i});return r}var t2=class extends qf{label="Cursor";provider={name:"Cursor",statusUrl:"https://status.cursor.com/"};binary="agent";envVar="CURSOR_API_KEY";apiKeyField="cursorApiKey";supportsNdjsonLog=!0;async install(){await Be("bash",["-c","set -o pipefail; curl https://cursor.com/install -fsS | bash"]),ARe(`${process.env.HOME}/.local/bin`),await Be("agent",["--version"],{silent:!0})}async initialize(){let{exitCode:e}=await Be("agent",["mcp","enable",Vs],{ignoreReturnCode:!0});if(e!==0)throw new Error(`Failed to enable MCP server '${Vs}' (exit code ${e})`);try{let{stdout:r}=await Be("agent",["mcp","list"]);r.includes(Vs)?Ne(`Cursor MCP server verified: ${Vs} is listed`):X(`${Vs} not found in MCP server list`)}catch{X("Could not list MCP servers")}}async configureMcp(e,r,n,s){let i=Eae.join(process.env.HOME??"~",".cursor");r2.mkdirSync(i,{recursive:!0});let o={mcpServers:{[Vs]:{command:e,args:r,env:n,timeout:Qa(s)}}};r2.writeFileSync(Eae.join(i,"mcp.json"),JSON.stringify(o,null,2))}buildCommand(e){return{command:"agent",args:["-f","-p","--model","claude-4.6-sonnet-medium","--output-format","stream-json"]}}};Ke();var ZI=q(require("fs")),oP=q(require("path"));var n2=class extends qf{label="GitHub Copilot";provider={name:"GitHub Copilot",statusUrl:"https://www.githubstatus.com/"};binary="copilot";envVar="GH_TOKEN";apiKeyField="copilotApiKey";async install(){await Be("npm",["install","-g","@github/copilot"])}async initialize(){try{await Be("copilot",["--version"]),Ne("GitHub Copilot CLI initialized successfully")}catch{X("Could not verify Copilot CLI version")}}async configureMcp(e,r,n,s){let i=oP.join(process.env.HOME??"~",".copilot");ZI.mkdirSync(i,{recursive:!0});let o={mcpServers:{[Vs]:{type:"local",command:e,args:r,tools:["*"],env:n,timeout:Qa(s)}}},a=JSON.stringify(o,null,2);ZI.writeFileSync(oP.join(i,"mcp-config.json"),a);let c=oP.join(process.cwd(),".copilot");ZI.mkdirSync(c,{recursive:!0}),ZI.writeFileSync(oP.join(c,"mcp-config.json"),a)}buildCommand(e){return{command:"copilot",args:["--additional-mcp-config",`@${process.env.HOME}/.copilot/mcp-config.json`,"--allow-all-tools","--allow-all-paths","-p"]}}};Ke();var aP=q(require("fs")),p9e=q(require("os")),c2=q(require("path"));var c9e=require("node:module"),l9e=q(require("node:path")),J7t="SKYRAMP_MCP_INSTALL_PATH";function s2(t){let e=process.env[J7t];if(e)try{return(0,c9e.createRequire)(l9e.join(e,"package.json"))(`@skyramp/mcp/${t}`)}catch{return}}var u9e=q(require("fs")),i2=q(require("path")),K7t="SKYRAMP_FEATURE_SKILLS",o2="SKYRAMP_SKILLS_LOADED";function a2(t={}){if(!t.ignoreFeatureFlag&&process.env[K7t]!=="1")return;let e=process.env.SKYRAMP_MCP_INSTALL_PATH;return e?[i2.join(e,"node_modules","@skyramp","mcp","plugin"),i2.join(e,"plugin")].find(n=>u9e.existsSync(i2.join(n,".claude-plugin","plugin.json"))):void 0}var wae="CLAUDE_CODE_EFFORT_LEVEL";function d9e(){return c2.join(process.env.RUNNER_TEMP??p9e.tmpdir(),"claude-code")}var X7t=["TodoWrite","TodoRead","Write","CronCreate","CronDelete","CronList","AskUserQuestion","NotebookEdit"];function Z7t(){return s2("personas")}var eer=Z7t;function ter(){try{let e=eer().SKYRAMP_QA_PERSONA;if(typeof e=="string"&&e.length>0)return Rt("Loaded SKYRAMP_QA_PERSONA from @skyramp/mcp"),e}catch{Rt("Could not load SKYRAMP_QA_PERSONA from @skyramp/mcp, running without persona")}return""}var TA=class extends qf{label="Claude Code";provider={name:"Claude API",statusUrl:"https://status.claude.com/"};reusesPreinstalledCli=!1;get binary(){return c2.join(d9e(),"node_modules",".bin","claude")}envVar="ANTHROPIC_API_KEY";apiKeyField="anthropicApiKey";supportsNdjsonLog=!0;model;effort;cleanupRegistered=!1;constructor(e=WKe,r=KI){super(),this.model=e,this.effort=r}async install(){let e=d9e();aP.rmSync(e,{recursive:!0,force:!0}),this.cleanupRegistered||(this.cleanupRegistered=!0,process.on("exit",()=>aP.rmSync(e,{recursive:!0,force:!0}))),await Be("npm",["install","--prefix",e,"@anthropic-ai/claude-code@latest"]);let r=c2.join(e,"node_modules","@anthropic-ai","claude-code","install.cjs");aP.existsSync(r)&&await Be("node",[r]);let{stdout:n}=await Be(this.binary,["--version"],{silent:!0});Ne(`Claude Code CLI ${n.trim()} installed at ${this.binary}`)}async initialize(){try{await Be(this.binary,["--version"]),Ne("Claude Code CLI initialized successfully")}catch{X("Could not verify Claude Code CLI version")}await this.verifyMcpConnectivity()}async verifyMcpConnectivity(){try{let{stdout:e}=await Be(this.binary,["mcp","list"]);e.split(`
|
|
179
|
-
`).some(n=>n.includes(Vs)&&n.toLowerCase().includes("connected"))?Ne(`Claude MCP server verified: ${Vs} is connected`):/no mcp servers configured/i.test(e)?ee(`${Vs} is not registered with the Claude Code CLI; a staged run attaches it to each session and warns if it does not connect`):X(`${Vs} does not appear connected in MCP server list`)}catch{X("Could not verify MCP server connectivity")}}async configureMcp(e,r,n,s){await Be(this.binary,["mcp","remove","--scope","user",Vs],{ignoreReturnCode:!0});let i=["mcp","add","--scope","user",Vs];for(let[o,a]of Object.entries(n))i.push("-e",`${o}=${a}`);i.push("--",e,...r),await Be(this.binary,i)}skillsPluginDir(){return a2()}buildCommand(e,r=[]){let n=ter(),s=["--dangerously-skip-permissions","--model",this.model],i=this.skillsPluginDir();i&&s.push("--plugin-dir",i),n&&s.push("--append-system-prompt",n),s.push("--settings",JSON.stringify({outputStyle:"Concise"})),s.push(...r),s.push("-p","--output-format","stream-json","--verbose");let o=process.env.SKYRAMP_THINKING_DISPLAY;return o&&s.push("--thinking-display",o),s.push("--disallowedTools",...X7t,"--"),{command:this.binary,args:s}}pinEffortEnv(){let e=process.env[wae];e&&e!==this.effort&&X(`${wae}=${e} from the environment is overridden by the effort input ("${this.effort}").`),process.env[wae]=this.effort,ee(`Agent effort level: ${this.effort}`)}setupAgentEnv(e,r){!e.useBedrock&&!e.anthropicApiKey||(process.env.MCP_TIMEOUT=String(Qa(r.testExecutionTimeout)),process.env.ENABLE_TOOL_SEARCH="false",this.pinEffortEnv(),e.useBedrock?(process.env.CLAUDE_CODE_USE_BEDROCK="1",e.awsRegion&&(process.env.AWS_REGION=e.awsRegion),delete process.env.ANTHROPIC_API_KEY,process.env.AWS_ACCESS_KEY_ID||process.env.AWS_BEARER_TOKEN_BEDROCK||process.env.AWS_PROFILE||process.env.AWS_WEB_IDENTITY_TOKEN_FILE||X("useBedrock is set but no AWS credentials were detected in the environment. Add an aws-actions/configure-aws-credentials step (OIDC) before Testbot.")):e.anthropicApiKey&&(process.env.ANTHROPIC_API_KEY=e.anthropicApiKey,delete process.env.CLAUDE_CODE_USE_BEDROCK))}};var l2=class extends TA{provider={name:"Amazon Bedrock",statusUrl:"https://health.aws.amazon.com/health/status"}};Ke();var Jf=q(require("fs")),xae=q(require("path"));Sc();var u2=class extends TA{mcpConfigPath;setupAgentEnv(e,r){process.env.MCP_TIMEOUT=String(Qa(r.testExecutionTimeout)),process.env.ENABLE_TOOL_SEARCH="false",this.pinEffortEnv(),delete process.env.ANTHROPIC_API_KEY,delete process.env.CLAUDE_CODE_USE_BEDROCK,process.env.CLAUDE_CODE_DISABLE_CLAUDE_MDS="1"}async configureMcp(e,r,n,s){let i=xae.join(Bl(),"local-auth");Jf.mkdirSync(i,{recursive:!0,mode:448}),Jf.chmodSync(i,448);let o=xae.join(i,`mcp-config-${process.pid}.json`);Jf.writeFileSync(o,JSON.stringify({mcpServers:{[Vs]:{command:e,args:r,env:n}}}),{mode:384}),Jf.chmodSync(o,384),this.mcpConfigPath=o,process.on("exit",()=>{try{Jf.unlinkSync(o)}catch{}})}async verifyMcpConnectivity(){Ne("Skipping MCP connectivity check for local auth \u2014 nothing is registered via `claude mcp add` to list.")}buildCommand(e){let r=["--setting-sources","project","--no-session-persistence"];return this.mcpConfigPath&&r.push("--mcp-config",this.mcpConfigPath,"--strict-mcp-config"),super.buildCommand(e,r)}};function d2(t,e){switch(t){case"cursor":return new t2;case"copilot":return new n2;case"claude":return e?.useBedrock?new l2(e.model,e.effort):e?.useLocalAuth?new u2(e.model,e.effort):new TA(e?.model,e?.effort);default:{let r=t;throw new Error(`Unsupported agent type: ${r}`)}}}Ke();var tZe=q(require("path"));var ev=require("fs"),Kf=q(require("path"),1),iXe=require("child_process"),oXe=require("util");function rer(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xo={},p2={},kA={},m9e;function cP(){if(m9e)return kA;m9e=1;function t(o){return typeof o>"u"||o===null}function e(o){return typeof o=="object"&&o!==null}function r(o){return Array.isArray(o)?o:t(o)?[]:[o]}function n(o,a){if(a){let c=Object.keys(a);for(let l=0,u=c.length;l<u;l+=1){let d=c[l];o[d]=a[d]}}return o}function s(o,a){let c="";for(let l=0;l<a;l+=1)c+=o;return c}function i(o){return o===0&&Number.NEGATIVE_INFINITY===1/o}return kA.isNothing=t,kA.isObject=e,kA.toArray=r,kA.repeat=s,kA.isNegativeZero=i,kA.extend=n,kA}var Sae,f9e;function lP(){if(f9e)return Sae;f9e=1;function t(r,n){let s="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(s+='in "'+r.mark.name+'" '),s+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!n&&r.mark.snippet&&(s+=`
|
|
178
|
+
**\u30A8\u30E9\u30FC:** \`${t}\``,sutFixPrefix:"**\u4FEE\u6B63\u65B9\u6CD5:** ",sutServiceNotReachable:t=>`**\u30B5\u30FC\u30D3\u30B9\u306B\u5230\u9054\u3067\u304D\u307E\u305B\u3093:** ${t} \u306E\u30B5\u30FC\u30D3\u30B9\u304C\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u306E\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u307E\u3067\u306B\u5FDC\u7B54\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B5\u30FC\u30D3\u30B9\u304C\u307E\u3060\u8D77\u52D5\u4E2D\u3067\u3042\u308B\u304B\u3001\u8D77\u52D5\u30B3\u30DE\u30F3\u30C9\u304C\u30B5\u30FC\u30D3\u30B9\u3092\u7ACB\u3061\u4E0A\u3052\u3089\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002`,sutServiceNotReachableFix:"**\u4FEE\u6B63\u65B9\u6CD5:** `targetSetupCommand` \u304C\u3053\u306E\u30B5\u30FC\u30D3\u30B9\u3092\u5B9F\u969B\u306B\u8D77\u52D5\u3057\u3001\u60F3\u5B9A\u3057\u305F\u30DD\u30FC\u30C8\u3067\u5F85\u3061\u53D7\u3051\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B3\u30DE\u30F3\u30C9\u81EA\u4F53\u306F\u6B63\u3057\u3044\u304C\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u304C\u9045\u3044\u5834\u5408\u306F\u3001`targetReadyCheckTimeout` \u3092\u5897\u3084\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3088\u308A\u78BA\u5B9F\u306A\u8D77\u52D5\u5224\u5B9A\u3092\u884C\u3046\u306B\u306F\u3001`targetReadyCheckCommand` \u3067\u7279\u5B9A\u306E\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u30D7\u30ED\u30FC\u30D6\u3059\u308B\u3088\u3046\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",staged:{requestedByPerson:t=>`${t} \u3055\u3093\u306E\u4F9D\u983C\u3067\u5B9F\u884C`,requestedByPolicy:t=>`\u691C\u8A3C\u30DD\u30EA\u30B7\u30FC ${t} \u306B\u3088\u308A\u5B9F\u884C`,noLiveApp:t=>`> \u26A0\uFE0F **\u3053\u306E\u5B9F\u884C\u3067\u306F\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\uFF08SUT\uFF09\u304C\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F** \u2014 \u4EE5\u4E0B\u306E ${t} \u4EF6\u306E\u30C6\u30B9\u30C8\u306F**\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u305B\u3093**\uFF08\u5B9F\u884C\u5BFE\u8C61\u306E\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF09\u3002\u7A3C\u50CD\u4E2D\u306E\u30A2\u30D7\u30EA\u306B\u5BFE\u3057\u3066\u5B9F\u884C\u3057\u3001\u5408\u683C\u3059\u308B\u3053\u3068\uFF08\u304A\u3088\u3073\u518D\u73FE\u30C6\u30B9\u30C8\u304C\u610F\u56F3\u3069\u304A\u308A\u5931\u6557\u3059\u308B\u3053\u3068\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,unitTestsInFile:(t,e,r)=>`**${t}**: ${r?`${r} \u306E`:""}\u30E6\u30CB\u30C3\u30C8\u30C6\u30B9\u30C8 ${e} \u4EF6`,addedToExistingFile:"\u65E2\u5B58\u306E\u30C6\u30B9\u30C8\u30D5\u30A1\u30A4\u30EB\u306B\u8FFD\u52A0",testPackagesHeader:"### \u{1F4E6} \u3053\u308C\u3089\u306E\u30C6\u30B9\u30C8\u306E\u5B9F\u884C\u65B9\u6CD5",testPackageLine:(t,e)=>`\`${t}/\` \u306F Skyramp Testbot \u304C\u6240\u6709\u30FB\u4FDD\u5B88\u3059\u308B\u72EC\u7ACB\u3057\u305F\u30C6\u30B9\u30C8\u30D1\u30C3\u30B1\u30FC\u30B8\u3067\u3001\u72EC\u81EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3001\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u3001\u30E9\u30F3\u30CA\u30FC\u8A2D\u5B9A\u3092\u6301\u3061\u307E\u3059\u3002\`${e}\` \u3067\u5B9F\u884C\u3067\u304D\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u5B9F\u884C\u3059\u308B\u306B\u306F\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092 CI \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,appManifestsUntouched:"\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u81EA\u8EAB\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u3068\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u306F\u5909\u66F4\u3057\u3066\u3044\u307E\u305B\u3093\u3002",dependencyChangesHeader:"### \u{1F4E6} \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u4F9D\u5B58\u95A2\u4FC2\u306E\u5909\u66F4",dependencyChangeLine:(t,e,r)=>`\`${e}\`\uFF08\u304A\u3088\u3073\u305D\u306E\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\uFF09\u306B \`${t}\` \u3092\u8FFD\u52A0${r?`: ${r}`:""}`,testMaintenanceHeader:"\u2705 \u30C6\u30B9\u30C8\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9",keptNot:"\u5909\u66F4\u305B\u305A\u7DAD\u6301 \u2014 \u898B\u9001\u3063\u305F\u64CD\u4F5C: ",declinedPlanned:"(\u4E88\u5B9A\u3057\u3066\u3044\u305F\u64CD\u4F5C\u3092\u898B\u9001\u308A: ",declinedMaintenanceHeader:"\u21A9\uFE0F \u898B\u9001\u3063\u305F\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9",existingEvidenceHeader:"\u2705 \u65E2\u5B58\u306E\u30A8\u30D3\u30C7\u30F3\u30B9",trustedCheckPassed:(t,e)=>`\u4FE1\u983C\u6E08\u307F\u306E CI \u30C1\u30A7\u30C3\u30AF ${t} \u304C${e?` ${e} \u3067`:""}\u5408\u683C\u3057\u3001\u6B21\u3092\u78BA\u8A8D\u3057\u307E\u3057\u305F:`,testResultsHeader:"\u{1F9EA} \u30C6\u30B9\u30C8\u7D50\u679C",resultsTableHeader:"| \u30C6\u30B9\u30C8 ID | \u30C6\u30B9\u30C8\u7A2E\u5225 | \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8 | \u30B9\u30C6\u30FC\u30BF\u30B9 | \u8A73\u7D30 |",unitResultsTableHeader:"| \u30C6\u30B9\u30C8 ID | \u30C6\u30B9\u30C8\u7A2E\u5225 | \u30C6\u30B9\u30C8\u5BFE\u8C61\u306E\u30B3\u30FC\u30C9 | \u30C6\u30B9\u30C8 | \u30B1\u30FC\u30B9\u6570 | \u30B9\u30C6\u30FC\u30BF\u30B9 | \u8A73\u7D30 |",casesPassed:(t,e,r)=>`${e} \u4EF6\u4E2D ${t} \u4EF6\u5408\u683C${r?`\u3001${r} \u4EF6\u30B9\u30AD\u30C3\u30D7`:""}`,behaviourCoverageHeader:"\u{1F517} \u632F\u308B\u821E\u3044\u306E\u30AB\u30D0\u30EC\u30C3\u30B8",coverageCaption:(t,e,r,n)=>`\uFF08\u751F\u6210 ${t} \xB7 \u5909\u66F4 ${e} \xB7 \u691C\u8A3C ${r} \xB7 \u5B9F\u884C ${n}\uFF09`,coverageTableHeader:"| \u632F\u308B\u821E\u3044 | \u30BD\u30FC\u30B9 | \u30C6\u30B9\u30C8 | \u30E1\u30F3\u30C6\u30CA\u30F3\u30B9 |",writtenNotRun:"\u4F5C\u6210\u6E08\u307F\u30FB\u672A\u5B9F\u884C",issuesFoundHeader:"\u26A0\uFE0F \u691C\u51FA\u3055\u308C\u305F\u554F\u984C",caveatsHeader:"### \u26A0\uFE0F \u3053\u306E\u5B9F\u884C\u3067\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u3053\u3068",commentHeader:"### Skyramp Testbot",timedOut:"> \u26A0\uFE0F \u5B9F\u884C\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F \u2014 \u4EE5\u4E0B\u306E\u7D50\u679C\u306F\u4E00\u90E8\u306E\u307F\u3067\u3059\u3002",stopReasons:{"pr-closed":"\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u30DE\u30FC\u30B8\u3055\u308C\u305A\u306B\u30AF\u30ED\u30FC\u30BA\u3055\u308C\u307E\u3057\u305F",cancelled:"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u305F\u304B\u3001\u30E9\u30F3\u30CA\u30FC\u304C\u505C\u6B62\u3057\u307E\u3057\u305F","attempt-cancelled":"Skyramp \u3067\u3053\u306E\u5B9F\u884C\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F","attempt-closed":"Skyramp \u304C\u3053\u306E\u5B9F\u884C\u3092\u7D42\u4E86\u3057\u307E\u3057\u305F"},maintenanceActions:{update:"\u66F4\u65B0",regenerate:"\u518D\u751F\u6210",delete:"\u524A\u9664",verify:"\u691C\u8A3C",updated:"\u66F4\u65B0",regenerated:"\u518D\u751F\u6210",deleted:"\u524A\u9664",verified:"\u691C\u8A3C"},publishFailures:{push:"\u30D7\u30C3\u30B7\u30E5\u306B\u5931\u6557",auth:"\u8A8D\u8A3C\u30A8\u30E9\u30FC",conflict:"\u7AF6\u5408",unknown:"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"},stoppedEarly:(t,e)=>`> \u26A0\uFE0F \u5B9F\u884C\u304C\u9014\u4E2D\u3067\u505C\u6B62\u3057\u307E\u3057\u305F \u2014 ${t}\u3002\u4EE5\u4E0B\u306E\u7D50\u679C\u306F\u4E00\u90E8\u306E\u307F\u3067\u3059\u3002${e}`,viewInSkyramp:t=>` [Skyramp \u3067\u8868\u793A](${t})`,setupRunEnds:{finished:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002Skyramp \u304C\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059\u3002",failed:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002",timedOut:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u304C\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3057\u305F\u3002",cancelledInSkyramp:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u306F Skyramp \u3067\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F\u3002",stoppedToResume:"\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B9F\u884C\u3092\u505C\u6B62\u3057\u307E\u3057\u305F\u3002Skyramp \u3067\u518D\u958B\u3067\u304D\u307E\u3059\u3002"},appUnreachable:t=>`Skyramp\uFF08${t}\uFF09\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002`,couldNotStart:t=>`Skyramp Testbot \u3092\u958B\u59CB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t}`,assembledAfterFailedChecks:t=>`> \u26A0\uFE0F \u4F5C\u6210\u30B9\u30C6\u30C3\u30D7\u304C\u30C1\u30A7\u30C3\u30AF\u306B\u5408\u683C\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u3053\u306E\u30EC\u30DD\u30FC\u30C8\u306F\u81EA\u52D5\u3067\u7D44\u307F\u7ACB\u3066\u3089\u308C\u307E\u3057\u305F\u3002${t} \u4EF6\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u672A\u9054\u6210\u3067\u3059 \u2014 \u8A73\u7D30\u306F\u5B9F\u884C\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,testbotPrLine:(t,e,r)=>`Testbot PR${t?`\uFF08${t}\uFF09`:""}: [${e}](${r})`,viewRun:t=>`_[\u5B9F\u884C\u3092\u8868\u793A](${t})_`,testsPrNotOpened:(t,e)=>`\u30C6\u30B9\u30C8 PR \u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${t}\uFF09\u3002\u30C6\u30B9\u30C8\u306F\u30D6\u30E9\u30F3\u30C1 \`${e}\` \u306B\u30D7\u30C3\u30B7\u30E5\u3055\u308C\u3066\u3044\u307E\u3059\u3002`,testsNotPushed:(t,e)=>`\u30C6\u30B9\u30C8\u3092\u30D7\u30C3\u30B7\u30E5\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${t}\uFF09\u3002\u30C6\u30B9\u30C8\u306F\u30ED\u30FC\u30AB\u30EB\u30D6\u30E9\u30F3\u30C1 \`${e}\` \u306B\u6B8B\u3063\u3066\u3044\u307E\u3059\u3002`,testsPrRetargeted:t=>`\u30C6\u30B9\u30C8\u306E\u751F\u6210\u4E2D\u306B\u958B\u767A PR \u304C\u30DE\u30FC\u30B8\u3055\u308C\u307E\u3057\u305F \u2014 \u30C6\u30B9\u30C8 PR \u306F\u4EE3\u308F\u308A\u306B\u30D9\u30FC\u30B9\u30D6\u30E9\u30F3\u30C1${t?`\uFF08\`${t}\`\uFF09`:""}\u3092\u5BFE\u8C61\u306B\u3057\u3066\u3044\u307E\u3059\u3002`,testsPrUnchanged:"\u3053\u306E\u30D7\u30C3\u30B7\u30E5\u3067\u306F\u65B0\u3057\u3044\u30C6\u30B9\u30C8\u306E\u5909\u66F4\u306F\u4E0D\u8981\u3067\u3057\u305F\u3002\u4EE5\u4E0B\u306E\u30C6\u30B9\u30C8 PR \u306F\u4EE5\u524D\u306E\u5B9F\u884C\u306E\u3082\u306E\u3067\u3001\u305D\u306E\u307E\u307E\u306B\u3057\u3066\u3044\u307E\u3059\u3002",committedNoPr:t=>`\u30C6\u30B9\u30C8\u306F\u30B3\u30DF\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F\u304C\u3001PR \u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${t}\u3002`}};var SI=(r=>(r.En="en",r.Ja="ja",r))(SI||{}),GVe={en:Ko,ja:zVe},Zne="en";function gq(t){let e=t.trim().toLowerCase();if(e==="")return"en";let r=Object.values(SI);return r.includes(e)?e:(X(`Invalid language '${t}'. Supported: ${r.join(", ")}. Falling back to 'en'.`),"en")}function uB(t){Zne=t}function jVe(){return Zne}function mA(t,e){return(Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0)??e}function ne(){return GVe[Zne]}function VVe(){let e=[];for(let r of Object.values(GVe))for(let n of[r.testbotPrBacklink,r.testbotPrDispatchBacklink,r.testbotPrMergedBacklink]){let s=n("\0");if(s.indexOf("\0")<0){X("A Testbot PR backlink template does not interpolate its argument; skipping it for stale-backlink stripping.");continue}e.push({prefix:s.slice(0,s.indexOf("\0")),suffix:s.slice(s.lastIndexOf("\0")+1)})}return e}var OE=(a=>(a.ProviderOutage="provider_outage",a.ProviderRateLimit="provider_rate_limit",a.ProviderUsageLimit="provider_usage_limit",a.ProviderAuthExpired="provider_auth_expired",a.Timeout="timeout",a.NoReport="no_report",a.RenderFailure="render_failure",a))(OE||{});(e=>{function t(r,n){switch(r){case"provider_outage":return{headline:ne().providerOutageHeadline(n.provider.name,n.maxRetries),action:ne().providerOutageActionStatusPage(n.provider.statusUrl)};case"provider_rate_limit":return{headline:ne().providerRateLimitHeadline(n.provider.name),action:ne().providerRateLimitAction};case"provider_usage_limit":return{headline:ne().providerUsageLimitHeadline(n.provider.name),action:ne().providerUsageLimitAction};case"provider_auth_expired":return{headline:ne().providerAuthExpiredHeadline(n.provider.name),action:ne().providerAuthExpiredAction};case"timeout":return{headline:ne().providerTimeoutHeadline(n.timeoutMinutes),action:ne().providerTimeoutAction};case"no_report":case"render_failure":return}}e.buildNotice=t})(OE||={});var Aq=(r=>(r.SameBranch="same-branch",r.SeparateBranch="separate-branch",r))(Aq||{}),Vs="skyramp",qf=class{supportsNdjsonLog=!1;reusesPreinstalledCli=!0;skillsPluginDir(){}setupAgentEnv(e,r){let n=e[this.apiKeyField];n&&ei(this.envVar,n)}};dB();dB();dB();Sc();function mB(t,e){if(process.env.GITHUB_ACTIONS)return new ME(t,vp,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}Ke();zKe();var GKe=t=>gae({...t});var Aae=(r=>(r.Sonnet="sonnet",r.Opus="opus",r))(Aae||{}),jKe="opus",VKe={sonnet:"claude-sonnet-5[1m]",opus:"claude-opus-5-5[1m]"},WKe=VKe[jKe],M7t={sonnet:"anthropic.claude-sonnet-5[1m]",opus:"anthropic.claude-opus-5-5[1m]"};function JI(t){return Object.values(Aae).includes(t)}function yae(t){let e=(t??"").trim();if(e==="")return jKe;let r=e.toLowerCase();return JI(r)?r:e}function Q7t(t){let e=(t??"").trim().toLowerCase();return e.startsWith("us-gov-")?"us-gov":e.startsWith("eu-")?"eu":e.startsWith("ap-")?"apac":"us"}function KH(t,e){return`${Q7t(e)}.${M7t[t]}`}function bae(t){return t||process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||""}function YKe(t,e){if(e)return e;let r=yae(t.model);return JI(r)?t.useBedrock?KH(r,bae(t.awsRegion)):VKe[r]:r}async function L7t(t){return GKe({roleArn:t.roleArn,webIdentityToken:t.webIdentityToken,roleSessionName:t.roleSessionName,durationSeconds:t.durationSeconds,clientConfig:{region:t.region}})()}var nP=3600,F7t=43200,U7t=15;function $7t(t){let e=Math.ceil((t+U7t)*60);return Math.min(F7t,Math.max(nP,e))}function q7t(t){return t instanceof Error?t.name==="ValidationError"&&/MaxSessionDuration|DurationSeconds/i.test(t.message):!1}async function XH(t){let e=t.env??process.env,r=e.AWS_ROLE_ARN?.trim(),n=e.AWS_REGION?.trim()||e.AWS_DEFAULT_REGION?.trim();if(e.SKYRAMP_REFRESH_BEDROCK_SESSION!=="1"||e.CLAUDE_CODE_USE_BEDROCK!=="1")return!1;let s=t.identity;if(!r||!s||!n)return t.debug("Bedrock session refresh skipped: needs AWS_ROLE_ARN, AWS_REGION (or AWS_DEFAULT_REGION) and a web identity from the job"),!1;try{let i=await s.token("sts.amazonaws.com");if(!i)throw new Error("OIDC response carried no token value");let o=`testbot-agent-${s.runId??"local"}`.replace(/[^A-Za-z0-9=,.@_-]/g,"").slice(0,64),a=t.assumeRole??L7t,c={roleArn:r,webIdentityToken:i,roleSessionName:o,region:n},l=$7t(t.timeoutMinutes),u,d=nP;try{u=await a({...c,durationSeconds:l}),d=l}catch(p){if(l<=nP||!q7t(p))throw p;t.warning(`The Bedrock role rejected a ${l}s session (its MaxSessionDuration is lower). Minting a ${nP}s session instead, which is shorter than the ${t.timeoutMinutes}m testbotTimeout; raise MaxSessionDuration on ${r} to at least ${l}s or the agent can lose its credentials mid-run.`),u=await a({...c,durationSeconds:nP})}if(!u.accessKeyId||!u.secretAccessKey||!u.sessionToken)throw new Error("assume-role returned an incomplete credential triple");return t.setSecret(u.accessKeyId),t.setSecret(u.secretAccessKey),t.setSecret(u.sessionToken),e.AWS_ACCESS_KEY_ID=u.accessKeyId,e.AWS_SECRET_ACCESS_KEY=u.secretAccessKey,e.AWS_SESSION_TOKEN=u.sessionToken,t.debug(`Minted a fresh Bedrock session for this agent attempt (${d}s)`),t.onMinted?.(u.expiration?.getTime()??Date.now()+d*1e3),!0}catch(i){return t.warning(`Could not refresh the Bedrock session; continuing with existing credentials: ${i instanceof Error?i.message:String(i)}`),!1}}var ZH=(i=>(i.Low="low",i.Medium="medium",i.High="high",i.XHigh="xhigh",i.Max="max",i))(ZH||{}),KI="high",JKe="medium";function KKe(t){return Object.values(ZH).includes(t)}var XKe=5;function H7t(t){let e=t.split(/\r?\n/).map(r=>r.trim()).filter(Boolean);if(e.length>XKe)throw new Error(`relatedRepoPaths supports at most ${XKe} entries (got ${e.length}); the cap limits how much cross-repo context is loaded to avoid overflowing Testbot's context window.`);return e}function z7t(t){let e=t.trim().toLowerCase();return e===""?"separate-branch":Object.values(Aq).includes(e)?e:(X(`Invalid generatedTestsMode '${t}'. Falling back to 'separate-branch'.`),"separate-branch")}function G7t(t){let e=(t??"").trim();if(e!==""){if(/^(?:[1-9]|10)$/.test(e))return Number(e);X(`Ignoring perTestMaxFixAttempts="${t}": expected a whole number from 1 to 10; the Skyramp MCP default applies`)}}function j7t(t){let e=(t??"").trim().toLowerCase();return e===""?KI:KKe(e)?e:(X(`Ignoring effort="${t}": expected one of ${Object.values(ZH).join(", ")}; using "${KI}"`),KI)}function e2(){let t=yae(qe("model"));return JI(t)||X(`model '${t}' is not a tested alias (sonnet, opus); passing it to the agent verbatim as a raw model id.`),{skyrampLicenseFile:qe("skyrampLicenseFile"),cursorApiKey:qe("cursorApiKey"),copilotApiKey:qe("copilotApiKey"),anthropicApiKey:qe("anthropicApiKey"),useBedrock:Cd("useBedrock"),awsRegion:qe("awsRegion"),useLocalAuth:qe("useLocalAuth").toLowerCase()==="true",model:t,effort:j7t(qe("effort")),targetSetupCommand:qe("targetSetupCommand"),authTokenCommand:qe("authTokenCommand"),uiCredentials:qe("uiCredentials"),targetTeardownCommand:qe("targetTeardownCommand"),skipTargetTeardown:Cd("skipTargetTeardown"),skyrampExecutorVersion:qe("skyrampExecutorVersion"),skyrampMcpVersion:qe("skyrampMcpVersion"),skyrampMcpSource:qe("skyrampMcpSource"),skyrampMcpGithubToken:qe("skyrampMcpGithubToken"),skyrampMcpGithubRef:qe("skyrampMcpGithubRef"),nodeVersion:qe("nodeVersion"),skipTargetSetup:Cd("skipTargetSetup"),targetReadyCheckCommand:qe("targetReadyCheckCommand"),targetReadyCheckTimeout:(()=>{let r=parseInt(qe("targetReadyCheckTimeout"),10)||1800;return r<1?(X(`targetReadyCheckTimeout must be at least 1 second, got ${r}. Using 1s.`),1):r})(),targetReadyCheckInterval:(()=>{let r=parseInt(qe("targetReadyCheckInterval"),10),n=isNaN(r)?30:r;return n<1?(X(`targetReadyCheckInterval must be at least 1 second, got ${n}. Using 1s.`),1):n})(),targetReadyCheckDiagnosticsCommand:(()=>{let r=qe("targetReadyCheckDiagnosticsCommand");return r.trim().toLowerCase()==="none"?"":r})(),workingDirectory:qe("workingDirectory"),autoCommit:Cd("autoCommit"),commitMessage:qe("commitMessage"),generatedTestsMode:z7t(qe("generatedTestsMode")),postPrComment:Cd("postPrComment"),testExecutionTimeout:parseInt(qe("testExecutionTimeout"),10)||300,maxRecommendations:(()=>{let r=parseInt(qe("maxRecommendations"),10);return isNaN(r)?void 0:Math.max(0,r)})(),maxGenerate:(()=>{let r=parseInt(qe("maxGenerate"),10);return isNaN(r)?void 0:Math.max(0,r)})(),perTestMaxFixAttempts:G7t(qe("perTestMaxFixAttempts")),testbotMaxRetries:parseInt(qe("testbotMaxRetries"),10)||3,testbotRetryDelay:parseInt(qe("testbotRetryDelay"),10)||10,testbotTimeout:parseInt(qe("testbotTimeout"),10)||60,targetSetupRetries:parseInt(qe("targetSetupRetries"),10)||3,targetSetupRetryDelay:parseInt(qe("targetSetupRetryDelay"),10)||10,authTokenRetries:(()=>{let r=parseInt(qe("authTokenRetries"),10);return Number.isFinite(r)&&r>=1?r:6})(),authTokenRetryDelay:(()=>{let r=parseInt(qe("authTokenRetryDelay"),10);return Number.isFinite(r)&&r>=0?r:10})(),reportCollapsed:Cd("reportCollapsed"),language:gq(qe("language")),enableDebug:Cd("enableDebug"),testRepoPath:qe("testRepoPath")||void 0,relatedRepoPaths:H7t(qe("relatedRepoPaths")),allowedAuthors:qe("allowedAuthors").split(/\r?\n/).map(r=>r.trim()).filter(Boolean)}}function ZKe(t){let e=!!t.cursorApiKey,r=!!t.copilotApiKey,n=!!t.anthropicApiKey;if(t.useBedrock){if(e||r)throw new Error("useBedrock cannot be combined with cursorApiKey or copilotApiKey. Bedrock is a provider for the Claude Code agent.");return n&&X("anthropicApiKey is ignored when useBedrock is true \u2014 Bedrock provides model credentials via AWS."),t.useLocalAuth&&X("useLocalAuth is ignored when useBedrock is true \u2014 Bedrock provides model credentials via AWS."),Ne("Using Claude Code CLI agent (AWS Bedrock)"),"claude"}if(t.useLocalAuth){if(e||r)throw new Error("useLocalAuth cannot be combined with cursorApiKey or copilotApiKey. Local auth is a provider for the Claude Code agent.");return n&&X("anthropicApiKey is ignored when useLocalAuth is true \u2014 the already-logged-in claude CLI session is used instead."),Ne("Using Claude Code CLI agent (local auth)"),"claude"}if([e,r,n].filter(Boolean).length>1)throw new Error("Multiple agent API keys provided. Please provide only one of: cursorApiKey, copilotApiKey, anthropicApiKey.");if(e)return Ne("Using Cursor CLI agent"),"cursor";if(r)return Ne("Using GitHub Copilot CLI agent"),"copilot";if(n)return Ne("Using Claude Code CLI agent"),"claude";throw new Error("No agent API key provided. Please provide one of: cursorApiKey, copilotApiKey, or anthropicApiKey.")}Ke();var r2=q(require("fs")),Eae=q(require("path"));Ke();uN();var t9e=q(require("child_process")),dw=class extends Error{constructor(e){super(e),this.name="ExecTimeoutError"}},XI=class extends Error{constructor(e){super(e),this.name="ExecAbortedError"}};function e9e(t,e){if(!(!t||t.destroyed||t.writableEnded))try{t.write(e)}catch(r){X(`stream write failed: ${r instanceof Error?r.message:String(r)}`)}}async function Be(t,e=[],r={}){let n="",s="",i={cwd:r.cwd,silent:r.silent??!1,ignoreReturnCode:r.ignoreReturnCode??!1,env:r.env?{...process.env,...r.env}:void 0,input:r.input,listeners:{stdout:a=>{n+=a.toString(),e9e(r.stdoutStream,a)},stderr:a=>{s+=a.toString()}}};if(r.timeout||r.signal){let a=r.signal;return a?.aborted?Promise.reject(new XI(`Command aborted before start: ${t}`)):new Promise((c,l)=>{let u=t9e.spawn(t,e,{cwd:r.cwd,env:r.env?{...process.env,...r.env}:process.env,stdio:["pipe","pipe","pipe"],shell:!1});u.stdout?.on("data",h=>{n+=h.toString(),r.silent||process.stdout.write(h),e9e(r.stdoutStream,h)}),u.stderr?.on("data",h=>{s+=h.toString(),r.silent||process.stderr.write(h)}),r.input&&u.stdin?.end(r.input);let d=()=>{f&&clearTimeout(f),a?.removeEventListener("abort",m)},p=h=>{d();try{u.kill("SIGTERM")}catch{}l(h)},m=()=>p(new XI(`Command aborted: ${t}`)),f=r.timeout?setTimeout(()=>p(new dw(`Command timed out after ${Math.round(r.timeout/6e4)}m: ${t}`)),r.timeout):void 0;a?.addEventListener("abort",m,{once:!0}),u.on("close",h=>{d();let A=h??1;A!==0&&!r.ignoreReturnCode?l(new Error(`The process '${t}' failed with exit code ${A}`)):c({exitCode:A,stdout:n,stderr:s})}),u.on("error",h=>{d(),l(h)})})}return{exitCode:await SS(t,e,i),stdout:n,stderr:s}}function iP(t){return(e,r)=>{let n=t?{...r,cwd:t}:r;return n?Be("git",e,n):Be("git",e)}}function NA(t){return new Promise(e=>setTimeout(e,t*1e3))}async function li(t,e){for(let r=1;r<=e.retries;r++)try{return await t()}catch(n){if(r<e.retries)X(`${e.label} failed, retrying (${r}/${e.retries})...`),await NA(e.delay);else throw n}throw new Error("unreachable")}async function Xn(t,e){wi(t);try{return await e()}finally{ss()}}async function r9e(t){let e=process.getuid?.(),r=process.getgid?.();if(!(e===void 0||r===void 0))try{let{exitCode:n,stderr:s}=await Be("sudo",["-n","chown","-R","-h",`${e}:${r}`,"."],{cwd:t,silent:!0,ignoreReturnCode:!0});n!==0&&Rt(`worktree chown skipped (exit ${n}): ${s.trim()}`)}catch(n){Rt(`worktree chown skipped: ${n instanceof Error?n.message:String(n)}`)}}var n9e=!1;function s9e(t){n9e=t}function Rt(t){n9e&&ee(`[debug] ${t}`)}var V7t=1e3;function Qa(t){return t*V7t}function Dl(t){let e=t.split("/");return e.length===2&&e[0]&&e[1]?{owner:e[0],repo:e[1]}:null}var sP=/^[A-Za-z_][A-Za-z0-9_.-]*$/;function i9e(t){if(t.startsWith("{"))try{let o=JSON.parse(t);return{username:typeof o.username=="string"?o.username:void 0,password:typeof o.password=="string"?o.password:void 0,role:typeof o.role=="string"?o.role:void 0}}catch{return{}}let e=t.indexOf(":"),n=!(e>=0&&!/[=;]/.test(t.slice(0,e)))&&/(^|;)\s*role\s*=/.test(t);if(/(^|;)\s*(username|password)\s*=/.test(t)||n){let o=new Map;for(let a of t.split(";")){let c=a.indexOf("=");c>0&&sP.test(a.slice(0,c).trim())&&o.set(a.slice(0,c).trim(),a.slice(c+1).trim())}return{username:o.get("username"),password:o.get("password"),role:o.get("role")}}if(t==="")return{};if(!t.includes(":"))for(let o of t.split(";")){let a=o.indexOf("=");if(a>0&&sP.test(o.slice(0,a).trim()))return{}}let[s,...i]=t.split(":");return{username:s,password:i.join(":")}}function o9e(t){let e=t.split(/\r?\n/).map(s=>s.trim()).find(s=>s!=="")??"",{username:r,password:n}=i9e(e);return{username:r,password:n}}function W7t(t){return t.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function Y7t(t){let e=t.split(/\r?\n/).map(n=>n.trim()).filter(n=>n!==""),r=new Set;return e.map((n,s)=>{let{username:i,password:o,role:a}=i9e(n),c=s+1,l=a?W7t(a):"";for(l||(l=String(c));r.has(l);)l=`${l}_${c}`;return r.add(l),{key:l,username:i,password:o}})}function a9e(t){let e=Y7t(t);if(e.length<2)return[];let r=[];for(let{key:n,username:s,password:i}of e)s!==void 0&&r.push({envName:`SKYRAMP_UI_USERNAME_${n}`,value:s}),i!==void 0&&r.push({envName:`SKYRAMP_UI_PASSWORD_${n}`,value:i});return r}var t2=class extends qf{label="Cursor";provider={name:"Cursor",statusUrl:"https://status.cursor.com/"};binary="agent";envVar="CURSOR_API_KEY";apiKeyField="cursorApiKey";supportsNdjsonLog=!0;async install(){await Be("bash",["-c","set -o pipefail; curl https://cursor.com/install -fsS | bash"]),ARe(`${process.env.HOME}/.local/bin`),await Be("agent",["--version"],{silent:!0})}async initialize(){let{exitCode:e}=await Be("agent",["mcp","enable",Vs],{ignoreReturnCode:!0});if(e!==0)throw new Error(`Failed to enable MCP server '${Vs}' (exit code ${e})`);try{let{stdout:r}=await Be("agent",["mcp","list"]);r.includes(Vs)?Ne(`Cursor MCP server verified: ${Vs} is listed`):X(`${Vs} not found in MCP server list`)}catch{X("Could not list MCP servers")}}async configureMcp(e,r,n,s){let i=Eae.join(process.env.HOME??"~",".cursor");r2.mkdirSync(i,{recursive:!0});let o={mcpServers:{[Vs]:{command:e,args:r,env:n,timeout:Qa(s)}}};r2.writeFileSync(Eae.join(i,"mcp.json"),JSON.stringify(o,null,2))}buildCommand(e){return{command:"agent",args:["-f","-p","--model","claude-4.6-sonnet-medium","--output-format","stream-json"]}}};Ke();var ZI=q(require("fs")),oP=q(require("path"));var n2=class extends qf{label="GitHub Copilot";provider={name:"GitHub Copilot",statusUrl:"https://www.githubstatus.com/"};binary="copilot";envVar="GH_TOKEN";apiKeyField="copilotApiKey";async install(){await Be("npm",["install","-g","@github/copilot"])}async initialize(){try{await Be("copilot",["--version"]),Ne("GitHub Copilot CLI initialized successfully")}catch{X("Could not verify Copilot CLI version")}}async configureMcp(e,r,n,s){let i=oP.join(process.env.HOME??"~",".copilot");ZI.mkdirSync(i,{recursive:!0});let o={mcpServers:{[Vs]:{type:"local",command:e,args:r,tools:["*"],env:n,timeout:Qa(s)}}},a=JSON.stringify(o,null,2);ZI.writeFileSync(oP.join(i,"mcp-config.json"),a);let c=oP.join(process.cwd(),".copilot");ZI.mkdirSync(c,{recursive:!0}),ZI.writeFileSync(oP.join(c,"mcp-config.json"),a)}buildCommand(e){return{command:"copilot",args:["--additional-mcp-config",`@${process.env.HOME}/.copilot/mcp-config.json`,"--allow-all-tools","--allow-all-paths","-p"]}}};Ke();var aP=q(require("fs")),p9e=q(require("os")),c2=q(require("path"));var c9e=require("node:module"),l9e=q(require("node:path")),J7t="SKYRAMP_MCP_INSTALL_PATH";function s2(t){let e=process.env[J7t];if(e)try{return(0,c9e.createRequire)(l9e.join(e,"package.json"))(`@skyramp/mcp/${t}`)}catch{return}}var u9e=q(require("fs")),i2=q(require("path")),K7t="SKYRAMP_FEATURE_SKILLS",o2="SKYRAMP_SKILLS_LOADED";function a2(t={}){if(!t.ignoreFeatureFlag&&process.env[K7t]!=="1")return;let e=process.env.SKYRAMP_MCP_INSTALL_PATH;return e?[i2.join(e,"node_modules","@skyramp","mcp","plugin"),i2.join(e,"plugin")].find(n=>u9e.existsSync(i2.join(n,".claude-plugin","plugin.json"))):void 0}var wae="CLAUDE_CODE_EFFORT_LEVEL";function d9e(){return c2.join(process.env.RUNNER_TEMP??p9e.tmpdir(),"claude-code")}var X7t=["TodoWrite","TodoRead","Write","CronCreate","CronDelete","CronList","AskUserQuestion","NotebookEdit"];function Z7t(){return s2("personas")}var eer=Z7t;function ter(){try{let e=eer().SKYRAMP_QA_PERSONA;if(typeof e=="string"&&e.length>0)return Rt("Loaded SKYRAMP_QA_PERSONA from @skyramp/mcp"),e}catch{Rt("Could not load SKYRAMP_QA_PERSONA from @skyramp/mcp, running without persona")}return""}var TA=class extends qf{label="Claude Code";provider={name:"Claude API",statusUrl:"https://status.claude.com/"};reusesPreinstalledCli=!1;get binary(){return c2.join(d9e(),"node_modules",".bin","claude")}envVar="ANTHROPIC_API_KEY";apiKeyField="anthropicApiKey";supportsNdjsonLog=!0;model;effort;cliVersion;cleanupRegistered=!1;constructor(e=WKe,r=KI,n="latest"){super(),this.model=e,this.effort=r,this.cliVersion=n}async install(){let e=d9e();aP.rmSync(e,{recursive:!0,force:!0}),this.cleanupRegistered||(this.cleanupRegistered=!0,process.on("exit",()=>aP.rmSync(e,{recursive:!0,force:!0}))),await Be("npm",["install","--prefix",e,`@anthropic-ai/claude-code@${this.cliVersion}`]);let r=c2.join(e,"node_modules","@anthropic-ai","claude-code","install.cjs");aP.existsSync(r)&&await Be("node",[r]);let{stdout:n}=await Be(this.binary,["--version"],{silent:!0});Ne(`Claude Code CLI ${n.trim()} installed at ${this.binary}`)}async initialize(){try{await Be(this.binary,["--version"]),Ne("Claude Code CLI initialized successfully")}catch{X("Could not verify Claude Code CLI version")}await this.verifyMcpConnectivity()}async verifyMcpConnectivity(){try{let{stdout:e}=await Be(this.binary,["mcp","list"]);e.split(`
|
|
179
|
+
`).some(n=>n.includes(Vs)&&n.toLowerCase().includes("connected"))?Ne(`Claude MCP server verified: ${Vs} is connected`):/no mcp servers configured/i.test(e)?ee(`${Vs} is not registered with the Claude Code CLI; a staged run attaches it to each session and warns if it does not connect`):X(`${Vs} does not appear connected in MCP server list`)}catch{X("Could not verify MCP server connectivity")}}async configureMcp(e,r,n,s){await Be(this.binary,["mcp","remove","--scope","user",Vs],{ignoreReturnCode:!0});let i=["mcp","add","--scope","user",Vs];for(let[o,a]of Object.entries(n))i.push("-e",`${o}=${a}`);i.push("--",e,...r),await Be(this.binary,i)}skillsPluginDir(){return a2()}buildCommand(e,r=[]){let n=ter(),s=["--dangerously-skip-permissions","--model",this.model],i=this.skillsPluginDir();i&&s.push("--plugin-dir",i),n&&s.push("--append-system-prompt",n),s.push("--settings",JSON.stringify({outputStyle:"Concise"})),s.push(...r),s.push("-p","--output-format","stream-json","--verbose");let o=process.env.SKYRAMP_THINKING_DISPLAY;return o&&s.push("--thinking-display",o),s.push("--disallowedTools",...X7t,"--"),{command:this.binary,args:s}}pinEffortEnv(){let e=process.env[wae];e&&e!==this.effort&&X(`${wae}=${e} from the environment is overridden by the effort input ("${this.effort}").`),process.env[wae]=this.effort,ee(`Agent effort level: ${this.effort}`)}setupAgentEnv(e,r){!e.useBedrock&&!e.anthropicApiKey||(process.env.MCP_TIMEOUT=String(Qa(r.testExecutionTimeout)),process.env.ENABLE_TOOL_SEARCH="false",this.pinEffortEnv(),e.useBedrock?(process.env.CLAUDE_CODE_USE_BEDROCK="1",e.awsRegion&&(process.env.AWS_REGION=e.awsRegion),delete process.env.ANTHROPIC_API_KEY,process.env.AWS_ACCESS_KEY_ID||process.env.AWS_BEARER_TOKEN_BEDROCK||process.env.AWS_PROFILE||process.env.AWS_WEB_IDENTITY_TOKEN_FILE||X("useBedrock is set but no AWS credentials were detected in the environment. Add an aws-actions/configure-aws-credentials step (OIDC) before Testbot.")):e.anthropicApiKey&&(process.env.ANTHROPIC_API_KEY=e.anthropicApiKey,delete process.env.CLAUDE_CODE_USE_BEDROCK))}};var l2=class extends TA{provider={name:"Amazon Bedrock",statusUrl:"https://health.aws.amazon.com/health/status"}};Ke();var Jf=q(require("fs")),xae=q(require("path"));Sc();var u2=class extends TA{mcpConfigPath;setupAgentEnv(e,r){process.env.MCP_TIMEOUT=String(Qa(r.testExecutionTimeout)),process.env.ENABLE_TOOL_SEARCH="false",this.pinEffortEnv(),delete process.env.ANTHROPIC_API_KEY,delete process.env.CLAUDE_CODE_USE_BEDROCK,process.env.CLAUDE_CODE_DISABLE_CLAUDE_MDS="1"}async configureMcp(e,r,n,s){let i=xae.join(Bl(),"local-auth");Jf.mkdirSync(i,{recursive:!0,mode:448}),Jf.chmodSync(i,448);let o=xae.join(i,`mcp-config-${process.pid}.json`);Jf.writeFileSync(o,JSON.stringify({mcpServers:{[Vs]:{command:e,args:r,env:n}}}),{mode:384}),Jf.chmodSync(o,384),this.mcpConfigPath=o,process.on("exit",()=>{try{Jf.unlinkSync(o)}catch{}})}async verifyMcpConnectivity(){Ne("Skipping MCP connectivity check for local auth \u2014 nothing is registered via `claude mcp add` to list.")}buildCommand(e){let r=["--setting-sources","project","--no-session-persistence"];return this.mcpConfigPath&&r.push("--mcp-config",this.mcpConfigPath,"--strict-mcp-config"),super.buildCommand(e,r)}};function d2(t,e){switch(t){case"cursor":return new t2;case"copilot":return new n2;case"claude":return e?.useBedrock?new l2(e.model,e.effort,e.claudeCodeVersion):e?.useLocalAuth?new u2(e.model,e.effort,e.claudeCodeVersion):new TA(e?.model,e?.effort,e?.claudeCodeVersion);default:{let r=t;throw new Error(`Unsupported agent type: ${r}`)}}}Ke();var tZe=q(require("path"));var ev=require("fs"),Kf=q(require("path"),1),iXe=require("child_process"),oXe=require("util");function rer(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xo={},p2={},kA={},m9e;function cP(){if(m9e)return kA;m9e=1;function t(o){return typeof o>"u"||o===null}function e(o){return typeof o=="object"&&o!==null}function r(o){return Array.isArray(o)?o:t(o)?[]:[o]}function n(o,a){if(a){let c=Object.keys(a);for(let l=0,u=c.length;l<u;l+=1){let d=c[l];o[d]=a[d]}}return o}function s(o,a){let c="";for(let l=0;l<a;l+=1)c+=o;return c}function i(o){return o===0&&Number.NEGATIVE_INFINITY===1/o}return kA.isNothing=t,kA.isObject=e,kA.toArray=r,kA.repeat=s,kA.isNegativeZero=i,kA.extend=n,kA}var Sae,f9e;function lP(){if(f9e)return Sae;f9e=1;function t(r,n){let s="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(s+='in "'+r.mark.name+'" '),s+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!n&&r.mark.snippet&&(s+=`
|
|
180
180
|
|
|
181
181
|
`+r.mark.snippet),i+" "+s):i}function e(r,n){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(n){return this.name+": "+t(this,n)},Sae=e,Sae}var Cae,h9e;function ner(){if(h9e)return Cae;h9e=1;let t=cP();function e(s,i,o,a,c){let l="",u="",d=Math.floor(c/2)-1;return a-i>d&&(l=" ... ",i=a-d+l.length),o-a>d&&(u=" ...",o=a+d-u.length),{str:l+s.slice(i,o).replace(/\t/g,"\u2192")+u,pos:a-i+l.length}}function r(s,i){return t.repeat(" ",i-s.length)+s}function n(s,i){if(i=Object.create(i||null),!s.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);let o=/\r?\n|\r|\0/g,a=[0],c=[],l,u=-1;for(;l=o.exec(s.buffer);)c.push(l.index),a.push(l.index+l[0].length),s.position<=l.index&&u<0&&(u=a.length-2);u<0&&(u=a.length-1);let d="",p=Math.min(s.line+i.linesAfter,c.length).toString().length,m=i.maxLength-(i.indent+p+3);for(let h=1;h<=i.linesBefore&&!(u-h<0);h++){let A=e(s.buffer,a[u-h],c[u-h],s.position-(a[u]-a[u-h]),m);d=t.repeat(" ",i.indent)+r((s.line-h+1).toString(),p)+" | "+A.str+`
|
|
182
182
|
`+d}let f=e(s.buffer,a[u],c[u],s.position,m);d+=t.repeat(" ",i.indent)+r((s.line+1).toString(),p)+" | "+f.str+`
|
|
@@ -314,7 +314,7 @@ Other caches with similar key:`);for(let a of i?.artifactCaches||[])oe(`Cache Ke
|
|
|
314
314
|
.catch(e => { console.error(e.message); process.exit(1); });
|
|
315
315
|
`],{silent:!0,env:{NODE_PATH:process.env.NODE_PATH||"",LICENSE_FILE:r,CI:"true"}})}function m_(t=__dirname){try{let e=Rv.readFileSync(qrt.join(t,"VERSION.json"),"utf-8"),r=JSON.parse(e);if(typeof r.version=="string"&&typeof r.commit=="string")return{version:r.version,commit:r.commit}}catch{}return{version:"unknown",commit:"unknown"}}async function zrt(t){if(!Rv.existsSync(t))return{usage:null,model:null,skills:[]};let e=Hrt.createInterface({input:Rv.createReadStream(t),crlfDelay:1/0}),r=null,n=null,s=[];for await(let i of e)if(i.trim())try{let o=JSON.parse(i);if(o.type==="assistant"){let a=o.message?.model;!n&&typeof a=="string"&&(n=a);let c=o.message?.content;if(Array.isArray(c))for(let l of c){if(l?.type!=="tool_use"||l.name!=="Skill")continue;let u=l.input?.skill;typeof u=="string"&&u.length>0&&s.push(u)}}if(o.type==="result"){let a=o.usage??{};r={inputTokens:a.input_tokens??0,outputTokens:a.output_tokens??0,cacheCreationInputTokens:a.cache_creation_input_tokens??0,cacheReadInputTokens:a.cache_read_input_tokens??0,totalCostUsd:o.total_cost_usd??0,numTurns:o.num_turns??0,durationMs:o.duration_ms??0,durationApiMs:o.duration_api_ms??0}}}catch{continue}return{usage:r,model:n,skills:s}}async function Grt(t,e,r){for(let n of t){let s={skill:n,agentType:e,...sme()};Rt(`Pushing skill invocation telemetry: ${JSON.stringify(s)}`),await ime("testbot_skill_invoked",s,r)}}async function jrt(t,e,r){let n={inputTokens:String(t.inputTokens),outputTokens:String(t.outputTokens),cacheCreationInputTokens:String(t.cacheCreationInputTokens),cacheReadInputTokens:String(t.cacheReadInputTokens),totalCostUsd:String(t.totalCostUsd),numTurns:String(t.numTurns),durationMs:String(t.durationMs),durationApiMs:String(t.durationApiMs),model:e,...sme()},s=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//);s&&(n.prNumber=s[1]);let{totalCostUsd:i,...o}=n;Rt(`Pushing agent usage telemetry: ${JSON.stringify(o)}`),await ime("testbot_agent_usage",n,r)}async function Vrt(t,e){let{version:r,commit:n}=m_(),s={testbotVersion:r,testbotCommit:n,actionVersion:process.env.TESTBOT_ACTION_VERSION||"unknown",actionCommit:process.env.TESTBOT_ACTION_COMMIT||"unknown",agentType:t,...sme()};Rt(`Pushing testbot run info telemetry: ${JSON.stringify(s)}`),await ime("testbot_run_info",s,e)}Ke();var es=q(require("fs")),T_=q(require("path"));Ke();var C_=require("node:crypto");var Bw=(i=>(i.NotFound="not_found",i.NoAccess="no_access",i.Unavailable="unavailable",i.AccessLost="access_lost",i.CannotOpen="cannot_open",i))(Bw||{}),jA=t=>t.source==="other"?{source:t.source,key:t.key}:{source:t.source,site:t.site,key:t.key},_c=t=>`${t.source}:${t.site??""}:${t.key}`;var f_=/^pasted-[0-9a-f]{16}$/,Pw=/^file-[0-9a-f]{16}$/,Tv=(s=>(s.Pdf="application/pdf",s.Csv="text/csv",s.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",s.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",s))(Tv||{}),Ua=t=>t.trim().toUpperCase(),Nv=(t,e)=>{let r=t.trim();return f_.test(r.toLowerCase())?"Pasted text":Pw.test(r.toLowerCase())?e?.get(Ua(r))??"Uploaded document":/^\d+$/.test(r)?`Confluence page ${r}`:r.toUpperCase()},nm=(t,e,r)=>e?`${Nv(t,r)} AC${e}`:Nv(t,r),h_=(r=>(r.Sufficient="sufficient",r.Insufficient="insufficient",r))(h_||{}),g_=(p=>(p.RelatedChangeConflict="related_change_conflict",p.ReferenceOutsideTarget="reference_outside_target",p.SourceAccessLost="source_access_lost",p.ConfigurationIncomplete="configuration_incomplete",p.CredentialUnavailable="credential_unavailable",p.WorkflowBindingUnverified="workflow_binding_unverified",p.WorkflowRefUnprotected="workflow_ref_unprotected",p.BedrockWorkflowRequired="bedrock_workflow_required",p.DeploymentReview="deployment_review",p.SutRevisionMismatch="sut_revision_mismatch",p.IsolationUnavailable="isolation_unavailable",p.EvidenceInsufficient="evidence_insufficient",p))(g_||{}),VA=(i=>(i.CiCheck="ci_check",i.TestReport="test_report",i.StaticAnalysis="static_analysis",i.CodeReview="code_review",i.Other="other",i))(VA||{}),A_=(n=>(n.Application="application",n.Environment="environment",n.TestDefect="test_defect",n))(A_||{}),cG=(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))(cG||{});var lG=(n=>(n.Seed="seed",n.RuntimeMock="runtime_mock",n.EnvOverride="env_override",n))(lG||{}),uG=(n=>(n.TestCode="test_code",n.SkyrampMocker="skyramp_mocker",n.RecipeOverride="recipe_override",n))(uG||{});var kv=(r=>(r.Ready="ready",r.Blocked="blocked",r))(kv||{}),gs=b.string().trim().min(1),Iar=b.object({action:b.enum(["start","run","wait"]),text:gs,source:b.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:gs.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"}),Rar=/^[A-Za-z_][A-Za-z0-9_]*$/,WA=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,dG=(i=>(i.VersionEndpoint="version_endpoint",i.DeployWorkflow="deploy_workflow",i.KubernetesLabels="kubernetes_labels",i.Command="command",i.Api="api",i))(dG||{}),An="shared",Nar=gs.refine(t=>{try{let e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}},"an http(s) URL with no login in it"),Bv=b.object({address:Nar,readyWhen:gs.nullable(),credentials:b.array(b.string().regex(WA)).max(50),revisionSources:b.array(b.object({method:b.nativeEnum(dG),detail:gs.describe("what Testbot reads, such as GET /version or the deploy workflow's name"),components:b.array(gs).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),ome={steps:b.array(Iar).max(20).optional().describe("how it starts, in order"),kind:b.enum(["web_app","service","database","external_service"]).optional(),from:b.object({file:gs,service:gs.nullable()}).strict().optional(),credentials:b.array(b.string().max(100).regex(Rar)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},Tar=b.object({name:gs,repository:gs.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:b.boolean(),...ome,deployed:gs.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),kar=b.object({component:gs,problem:gs,evidence:gs.describe("the exact command and output that shows it"),fix:gs.describe("what the user must provide, and where")}),Bar=b.object({framework:gs,file:gs.describe("the test file run, relative to its repository root"),result:b.enum(["pass","fail","error"])}),Par=b.object({input:gs.describe("the part of the user's SUT input, as given"),reason:gs}),y_=b.object({schemaVersion:b.literal(1),status:b.nativeEnum(kv).describe("ready only if every component came up healthy and the recipe is written"),components:b.array(Tar),suites:b.array(Bar).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:b.array(gs).default([]).describe("the parts of the user's SUT input the recipe used"),inputsUsedHow:b.array(b.object({input:gs.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:gs.describe("what the recipe did with it")})).optional(),inputsNotUsed:b.array(Par).default([]).describe("the parts it did not use, and why"),blockers:b.array(kar).describe("required (non-empty) when status is blocked"),environment:Bv.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});function ame(t){let e=_ar(t);if(e.length>0)return e;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 r=Array.isArray(t.components)?t.components:[];if(r.length===0)return['status "ready" requires at least one component \u2014 name each component the recipe brought up healthy'];let n=r.filter(s=>s?.healthy!==!0).map(s=>String(s?.name??"?"));if(n.length>0)return[`status "ready" requires every component healthy; not healthy: ${n.join(", ")} \u2014 answer "blocked" with a blocker for each, or bring them up and answer "ready" again`]}return[]}function _ar(t){let e=Array.isArray(t.components)?t.components:[],r=t.environment;if(!r){let a=e.filter(c=>c?.deployed!==void 0||c?.repository===An).map(c=>String(c?.name??"?"));return a.length>0?[`"deployed" and a "${An}" repository belong only to an answer with "environment"; remove them from: ${a.join(", ")}`]:[]}let n=[],s=e.filter(a=>a?.deployed===void 0).map(a=>String(a?.name??"?"));s.length>0&&n.push(`with "environment", every component says what it runs in "deployed" (null when you could not tell); missing for: ${s.join(", ")}`);let i=new Set(e.map(a=>a?.name)),o=(r.revisionSources??[]).flatMap(a=>a?.components??[]).filter(a=>!i.has(a));return o.length>0&&n.push(`each revision source names components of this answer; not one of them: ${o.map(String).join(", ")}`),n}var _w=64*1024,Dw=512*1024,pG=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var Wrt=q(require("path"));var sm=(s=>(s.Clean="clean",s.RecipeDrift="recipe-drift",s.ChangeBrokeBringup="change-broke-bringup",s.BringupFailed="bringup-failed",s))(sm||{}),YA=b.string().trim().min(1),Dar=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:YA.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),b_=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:Dar.optional(),teardown:YA.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(sm).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:YA,output:YA}).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:YA.describe("ISO timestamp"),revisions:b.array(b.object({component:YA.describe("a shared component listed above"),url:YA.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:YA.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 cme(t){let e=[],r=s=>!!s&&typeof s=="object"&&!Array.isArray(s);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(s=>typeof s=="string"&&s.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(s=>typeof s=="string"&&s.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 Io=b.string().trim().min(1),lme=(r=>(r.TestbotManaged="testbot_managed",r.CustomerDeployed="customer_deployed",r))(lme||{}),Pv=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],mG=b.object({schemaVersion:b.literal(1),type:b.nativeEnum(lme).optional(),status:b.enum(["ready","blocked"]),environment:Bv.optional(),components:b.array(b.object({name:Io,repository:Io.describe(`owner/repo, or "${An}" for a customer-deployed component no repository builds`),healthy:b.boolean(),url:b.string().min(1).nullable(),...ome,credentials:b.array(b.string().regex(WA)).max(50).optional(),deployed:Io.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:b.array(b.object({framework:Io,file:Io,result:b.enum(["pass","fail","error"])}).strict()),inputsUsed:b.array(Io),inputsUsedHow:b.array(b.object({input:Io,how:Io}).strict()).optional(),inputsNotUsed:b.array(b.object({input:Io,reason:Io}).strict()),blockers:b.array(b.object({component:Io,problem:Io,evidence:Io,fix:Io}).strict()),replay:b.object({outcome:Io,durationSeconds:b.number().nonnegative().nullable()}).strict().nullable(),files:b.array(b.object({path:Io,content:b.string()}).strict())}).strict().superRefine((t,e)=>{t.inputsUsedHow?.forEach((s,i)=>{t.inputsUsed.includes(s.input)||e.addIssue({code:b.ZodIssueCode.custom,path:["inputsUsedHow",i,"input"],message:"not one of inputsUsed"})}),t.components.forEach((s,i)=>{s.credentials&&new Set(s.credentials).size!==s.credentials.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["components",i,"credentials"],message:"names a credential twice"})});let r=t.type==="customer_deployed";r!==(t.environment!==void 0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),t.environment&&new Set(t.environment.credentials).size!==t.environment.credentials.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let n=new Set(t.components.map(s=>s.name));if(t.environment?.revisionSources.forEach((s,i)=>{s.components.forEach((o,a)=>{n.has(o)||e.addIssue({code:b.ZodIssueCode.custom,path:["environment","revisionSources",i,"components",a],message:"not one of components"})})}),t.components.forEach((s,i)=>{s.deployed!==void 0!==r&&e.addIssue({code:b.ZodIssueCode.custom,path:["components",i,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),s.repository===An&&!r&&e.addIssue({code:b.ZodIssueCode.custom,path:["components",i,"repository"],message:`only a customer_deployed component is ${An}`})}),r&&(t.components.forEach((s,i)=>{t.components.findIndex(o=>o.name===s.name)!==i&&e.addIssue({code:b.ZodIssueCode.custom,path:["components",i,"name"],message:"names a component twice"})}),t.replay!==null&&e.addIssue({code:b.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),t.files.forEach((s,i)=>{Pv.includes(s.path)&&e.addIssue({code:b.ZodIssueCode.custom,path:["files",i,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),r&&t.status==="ready"){let s=new Set(t.environment?.revisionSources.flatMap(i=>i.components));t.components.forEach((i,o)=>{i.repository!==An&&!s.has(i.name)&&e.addIssue({code:b.ZodIssueCode.custom,path:["components",o,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var Oar=["clean","recipe-drift"];function JA(t){let e=Wrt.posix.normalize(t);return e===t&&(e===".skyramp/workspace.yml"||e.startsWith(".skyramp/sut/")&&e.length>13)}function Mar(t,e){let r=e.bringupError;if(t.environment)return{component:t.components.map(s=>s.name).join(", ")||"SUT",problem:`onboard reached the deployment, but deploy's fresh check of it ended ${e.outcome}`,evidence:r?`$ ${r.command}
|
|
316
316
|
${r.output}`:`deploy reported ${e.outcome} without the failing command`,fix:"make .skyramp/sut/health.json's check pass from a fresh session (its address, sign-in and ready route), then set it up again"};let n=e.suspectFiles?.length?` \u2014 it points at ${e.suspectFiles.join(", ")}`:"";return{component:t.components.map(s=>s.name).join(", ")||"SUT",problem:`the recipe worked once but not from nothing: deploy's fresh replay of .skyramp/sut/setup.sh ended ${e.outcome}`,evidence:r?`$ ${r.command}
|
|
317
|
-
${r.output}`:`deploy reported ${e.outcome} without the failing command`,fix:e.outcome==="change-broke-bringup"?`fix the change that broke bring-up${n}, then onboard again`:"make .skyramp/sut/setup.sh bring the SUT up from a clean checkout (what onboard's session had that a fresh run lacks), then onboard again"}}function Qar(t){return t.environment?{component:t.components.map(e=>e.name).join(", ")||"SUT",problem:"the deployment was never checked from a fresh session: deploy did not run or wrote no deploy.json",evidence:"outputs/deploy.json is missing from this run",fix:"run deploy after onboard in the same run so it checks the deployment is ready; if deploy ran, its stage log says why it wrote no deploy.json"}:{component:t.components.map(e=>e.name).join(", ")||"SUT",problem:"the recipe was never replayed: deploy did not run or wrote no deploy.json",evidence:"outputs/deploy.json is missing from this run",fix:"run deploy after onboard in the same run so it replays .skyramp/sut/setup.sh from a clean start; if deploy ran, its stage log says why it wrote no deploy.json"}}function Lar(t){return{component:"SUT recipe",problem:"deploy fixed recipe drift, but the recipe it fixed was not collected \u2014 onboard's copy is the recipe from before the fix",evidence:`deploy reported recipe-drift: ${(t.recipeFixes??[]).join("; ")||"no fixes listed"}`,fix:"collect .skyramp/sut/ and .skyramp/workspace.yml after deploy (collectRecipeFiles) and build the plan from that collection"}}var ume=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"],dme=[".skyramp/sut/health.json",".skyramp/workspace.yml"];function Far(t){return`Onboard again so it leaves the whole recipe in the checkout: ${t.map(r=>r===".skyramp/workspace.yml"?"create .skyramp/workspace.yml with skyramp_init_scan and skyramp_init_workspace":`write ${r} as a regular file (a symlink is not uploaded)`).join("; ")}.`}function pme(t,e,r){return e&&r||t}function mme(t,e,r={}){let n=e!==void 0&&!Oar.includes(e.outcome),s=pme(t,e,r.recipeFiles),i=e?.outcome==="recipe-drift"&&!r.recipeFiles,o=(s.recipeFilesOmitted??[]).filter(w=>JA(w.path)),a=o.length?[{component:"SUT recipe",problem:`The recipe could not be uploaded whole: ${o.map(w=>w.path).join(", ")} left out.`,evidence:o.map(w=>`${w.path}: ${w.reason}`).join("; "),fix:"Keep each recipe file text-only and under 64 KiB, and the recipe under 512 KiB in total \u2014 move large generated content out of .skyramp/sut/ and have setup.sh produce it."}]:[],c=t.status==="ready",l=t.environment,u=new Set(s.recipeFiles.map(w=>w.path)),d=c?(l?dme:ume).filter(w=>!u.has(w)):[],p=d.length?[{component:"SUT recipe",problem:`The recipe is missing ${d.join(", ")}, so it cannot be replayed.`,evidence:`collected: ${[...u].sort().join(", ")||"nothing"}`,fix:Far(d)}]:[],m=e?n?[Mar(t,e)]:[]:c?[Qar(t)]:[],f=new Set(l?.revisionSources.flatMap(w=>w.components)),h=l&&c?t.components.filter(w=>w.repository!==An&&!f.has(w.name)).map(w=>w.name):[],A=h.length?[{component:h.join(", "),problem:`Testbot cannot tell which revision ${h.join(" and ")} ${h.length>1?"run":"runs"}, so a run could not say which changes it tested.`,evidence:`revision sources: ${l.revisionSources.map(w=>`${w.detail} (${w.components.join(", ")})`).join("; ")||"none"}`,fix:"Say in the Test Environment's notes how to tell what is deployed, such as a version route (GET /version), then set it up again."}]:[],E=[...t.blockers,...m,...i&&e?[Lar(e)]:[],...a,...p,...A,...r.revisionCheck?.blockers??[],...r.credentialBlockers??[]],y=e?.baseUrls??{};return{schemaVersion:1,...l?{type:"customer_deployed",environment:Yrt(l)}:{},status:c&&e!==void 0&&!n&&!i&&o.length===0&&d.length===0&&h.length===0&&!r.revisionCheck?.blockers.length&&!r.credentialBlockers?.length?"ready":"blocked",components:t.components.map(w=>({name:w.name,repository:w.repository,healthy:w.healthy&&!n,url:Object.hasOwn(y,w.name)&&y[w.name]||null,...w.steps?{steps:w.steps.map(C=>({action:C.action,text:C.text,source:C.source,file:C.file}))}:{},...w.kind?{kind:w.kind}:{},...w.from?{from:{file:w.from.file,service:w.from.service}}:{},...w.credentials?{credentials:[...new Set(w.credentials)].filter(C=>WA.test(C))}:{},...l?{deployed:Uar(w,r)}:{}})),suites:t.suites.map(w=>({framework:w.framework,file:w.file,result:w.result})),inputsUsed:[...t.inputsUsed],...t.inputsUsedHow?{inputsUsedHow:t.inputsUsedHow.filter(w=>t.inputsUsed.includes(w.input)).map(w=>({input:w.input,how:w.how}))}:{},inputsNotUsed:t.inputsNotUsed.map(w=>({input:w.input,reason:w.reason})),blockers:E.map(w=>({component:w.component,problem:w.problem,evidence:w.evidence,fix:w.fix})),replay:e&&!l?{outcome:e.outcome,durationSeconds:r.deployDurationSeconds??null}:null,files:s.recipeFiles.filter(w=>JA(w.path)&&!(l&&Pv.includes(w.path))).map(w=>({path:w.path,content:w.content}))}}function Uar(t,e){return t.repository===An?null:e.revisionCheck?e.revisionCheck.deployed[t.name]??null:e.deployed?.[t.name]??t.deployed??null}function Yrt(t){return{address:t.address,readyWhen:t.readyWhen,credentials:[...new Set(t.credentials)],revisionSources:t.revisionSources.map(e=>({method:e.method,detail:e.detail,components:[...e.components]}))}}function Jrt(t){return{schemaVersion:1,status:"ready",components:t.components.map(({url:e,deployed:r,...n})=>({...n,healthy:!0})),suites:t.suites,inputsUsed:t.inputsUsed,...t.inputsUsedHow?{inputsUsedHow:t.inputsUsedHow}:{},inputsNotUsed:t.inputsNotUsed,blockers:[],recipeFiles:t.files,recipeFilesOmitted:[],...t.environment?{environment:Yrt(t.environment)}:{}}}var int={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file"},I_=(r=>(r.GitHub="github",r.AzureDevOps="azure-devops",r))(I_||{}),hme=(i=>(i.Trigger="TRIGGER",i.Baseline="BASELINE",i.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",i.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",i.ManualOverride="MANUAL_OVERRIDE",i))(hme||{}),gG=(i=>(i.PullRequest="pull_request",i.ReadyForReview="ready_for_review",i.Schedule="schedule",i.Manual="manual",i.SutSetup="sut_setup",i))(gG||{}),$ar=["sut_setup"],qar=["sut_setup","schedule"],Har=["sut_setup"],AG=(e=>(e.PullRequest="pull_request",e))(AG||{}),yG=(s=>(s.ModelProvider="model_provider",s.SutAccess="sut_access",s.Skyramp="skyramp",s.Other="other",s))(yG||{});var bG=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s))(bG||{}),ont=(r=>(r.Running="running",r.Ended="ended",r))(ont||{}),EG=(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))(EG||{}),gme=(n=>(n.Onboard="onboard",n.Deploy="deploy",n.Recheck="recheck",n))(gme||{}),Ame=(r=>(r.Started="started",r.Finished="finished",r))(Ame||{}),yme=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(yme||{}),bme=(o=>(o.Log="log",o.Component="component",o.Reply="reply",o.Question="question",o.Delivered="delivered",o.Credentials="credentials",o))(bme||{}),wG=(n=>(n.ChooseCredential="choose_credential",n.FreeText="free_text",n.ChooseSource="choose_source",n))(wG||{});var Ov=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(Ov||{}),v_=(s=>(s.Found="found",s.Starting="starting",s.Up="up",s.OutOfScope="out_of_scope",s))(v_||{}),Gu=b.string().regex(/^[1-9][0-9]{0,18}$/),Mv=b.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Hl=b.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),la=b.string().regex(/^[0-9a-f]{64}$/),hG=b.object({id:Hl,revision:Gu}).strict(),Dc=b.object({provider:b.nativeEnum(I_),providerAccountId:Gu,providerRepositoryId:Gu}).strict(),E_=t=>`${t.provider}:${t.providerRepositoryId}`,ant=Dc.extend({namespace:b.string().min(1),name:b.string().min(1)}).strict(),Krt=b.object({ref:b.string().min(1),revision:Mv}).strict(),zar=b.object({repository:ant,revision:Mv,ref:b.string().nullable(),reason:b.nativeEnum(hme),change:b.object({kind:b.nativeEnum(AG),number:Gu,base:Krt.optional()}).strict().nullable(),compareWith:Krt.optional()}).strict();function Gar(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=>E_(o.repository))),s=new Set(e.map(o=>E_(o.repository)));return s.size===e.length&&s.size===n.size&&[...s].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var cnt=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,lnt=/^[1-9][0-9]{0,18}$/,Xrt=new RegExp(`${cnt.source}|${lnt.source}`),Zrt=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,jar=b.union([b.object({source:b.literal("jira"),site:b.string().regex(Zrt),key:b.string().regex(cnt),updated:b.string().datetime(),contentHash:la}).strict(),b.object({source:b.literal("confluence"),site:b.string().regex(Zrt),key:b.string().regex(lnt),version:b.number().int().positive(),contentHash:la}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),contentHash:la}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),contentHash:la,fileName:b.string().min(1).max(255),mediaType:b.nativeEnum(Tv)}).strict()]),ent=b.union([b.literal("jira"),b.literal("confluence")]),unt=b.object({schemaVersion:b.literal(1),items:b.array(b.union([b.object({source:ent,site:b.string(),key:b.string().regex(Xrt),state:b.literal("read"),text:b.string(),version:b.string().min(1),contentMatches:b.boolean()}).strict(),b.object({source:ent,site:b.string(),key:b.string().regex(Xrt),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),state:b.literal("read"),text:b.string(),version:b.string().min(1),contentMatches:b.boolean()}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),state:b.literal("read"),version:la,fileName:b.string().min(1).max(255),mediaType:b.nativeEnum(Tv)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict()])),instructions:b.array(b.string()).optional()}).strict(),Var=b.object({schemaVersion:b.literal(1),runId:Hl,skyrampOrgId:Hl,target:hG,policy:hG.nullable(),trigger:b.object({kind:b.nativeEnum(gG),requestedAt:b.string().datetime()}).strict(),configuration:b.object({captureId:Hl,revision:Gu.nullable(),hash:la}).strict(),baseline:b.object({confirmedRunId:Hl.nullable(),sources:b.array(b.object({repository:Dc,revision:Mv}).strict()).optional()}).strict(),sources:b.array(zar).min(1),execution:b.object({provider:b.nativeEnum(I_),repository:ant,workflowPath:b.string(),ref:b.string()}).strict(),credentials:b.array(b.object({name:b.string(),purpose:b.nativeEnum(yG),required:b.boolean()}).strict()),requirements:b.array(jar).min(1).optional(),instructions:b.object({contentHash:la}).strict().optional()}).strict().superRefine((t,e)=>{let r=new Set;(t.requirements??[]).forEach((o,a)=>{let c="fileName"in o?"file":"pasted";o.source==="other"&&o.key!==`${c}-${o.contentHash.slice(0,16)}`&&e.addIssue({code:b.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",a,"key"]});let l=_c({source:o.source,key:o.key});r.has(l)&&e.addIssue({code:b.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",a,"key"]}),r.add(l)});let n=t.trigger.kind,s=$ar.includes(n);s!==(t.policy===null)&&e.addIssue({code:b.ZodIssueCode.custom,path:["policy"],message:s?`a ${n} run has no policy`:"names the policy revision"});let i=Gar(t);i&&e.addIssue({code:b.ZodIssueCode.custom,path:["baseline","sources"],message:i}),qar.includes(n)&&t.sources.forEach((o,a)=>{o.reason!=="BASELINE"&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",a,"reason"],message:`a ${n} run selects only BASELINE sources`})}),t.sources.forEach((o,a)=>{o.compareWith&&(o.reason!=="MANUAL_OVERRIDE"||o.change)&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",a,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"})})});var Eme=(r=>(r.Person="person",r.Policy="policy",r))(Eme||{}),War=b.object({kind:b.nativeEnum(Eme),name:b.string().min(1).max(256)}).strict(),Yar=b.object({schemaVersion:b.literal(1),attempt:b.object({id:Hl,number:b.number().int().positive(),deadlineAt:b.string().datetime()}).strict(),manifest:Var,manifestHash:la,entitlements:b.array(b.string()).optional(),runToken:b.string().min(1).optional(),requestedBy:War.nullable().optional(),writeAllowed:b.boolean().optional()}).strict(),Jar=b.object({schemaVersion:b.literal(1),runId:Hl,execution:b.object({provider:b.nativeEnum(I_),repository:Dc,providerRunId:Gu,providerRunAttempt:b.number().int().positive(),workflowRef:b.string().min(1)}).strict(),requester:b.literal(!0).optional(),writeCheck:b.literal(!0).optional()}).strict(),tnt=b.object({repository:Dc,number:Gu}).strict(),Kar=b.discriminatedUnion("status",[b.object({status:b.literal("none")}).strict(),b.object({status:b.literal("delivered"),pullRequests:b.array(tnt).min(1)}).strict(),b.object({status:b.literal("partial"),pullRequests:b.array(tnt).min(1),failures:b.array(b.object({repository:Dc,message:b.string()}).strict()).min(1)}).strict(),b.object({status:b.literal("failed"),message:b.string()}).strict()]),Xar=b.object({sufficiency:b.nativeEnum(h_),rationale:b.string().min(1),gaps:b.array(b.string().min(1)),acceptedEvidence:b.array(b.object({kind:b.nativeEnum(VA),repository:b.string().min(1),revision:Mv,reference:b.string().min(1),summary:b.string().min(1)}).strict()),actionRequired:b.array(b.nativeEnum(g_))}).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"})}),Dv=500,wme=2048,xme=1e3,Zar=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(A_),family:b.nativeEnum(cG).optional()}).strict().optional()}).strict()),validation:Xar,changes:b.array(b.object({id:b.string().min(1).max(512),text:b.string().max(16384),source:b.string().max(wme),testedBy:b.array(b.string().min(1).max(1024)).max(Dv),writtenBy:b.array(b.string().min(1).max(1024)).max(Dv),maintainedBy:b.array(b.string().min(1).max(1024)).max(Dv)}).strict()).max(xme).optional(),traceVersion:b.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,s)=>{let i=n.failureCause;i&&n.status==="Pass"&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),i&&i.kind==="environment"!=(i.family!==void 0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",s,"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)})}),rnt=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function xG(t,e,r,n){let s=r.replace(/\\/g,"/"),i=s.split("/").filter(c=>c!==""&&c!==".");if(s.startsWith("/")||/^[A-Za-z]:/.test(s)||i.length===0||i.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=i.join("/"),a=`${t}:${e}:${rnt(o)}`;return n?`${a}#${rnt(n)}`:a}var Sme=50,nnt=b.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Cme=b.discriminatedUnion("kind",[b.object({kind:b.literal("branch_pushed"),repository:Dc,branch:nnt,commit:Mv}).strict(),b.object({kind:b.enum(["pull_request_opened","pull_request_edited"]),repository:Dc,number:Gu,branch:nnt}).strict()]),dnt=b.object({schemaVersion:b.literal(1),run:b.object({runId:Hl,attemptNumber:b.number().int().positive(),manifestHash:la}).strict(),target:hG,policy:hG,provenance:b.object({sources:b.array(b.object({repository:Dc,revision:Mv}).strict())}).strict(),delivery:b.object({generatedTests:Kar}).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:Zar,githubWrites:b.array(Cme).max(Sme).optional()}).strict(),ecr=dnt.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:mG}).strict().superRefine(({recipe:t},e)=>{let r=(i,o)=>e.addIssue({code:b.ZodIssueCode.custom,path:["recipe",...i],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,s=0;t.files.forEach((i,o)=>{JA(i.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(i.path)&&r(["files",o,"path"],"file repeated"),n.add(i.path),pG.test(i.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(i.content,"utf8");s+=a,a>_w&&r(["files",o,"content"],`larger than ${_w} bytes`)}),s>Dw&&r(["files"],`recipe text over ${Dw} bytes in total`)}),pnt=b.object({schemaVersion:b.literal(1),stage:b.nativeEnum(gme),event:b.nativeEnum(Ame),status:b.nativeEnum(yme).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Qv=100,SG=5e3,fme=2e3,w_=100,CG=/^[A-Za-z0-9_-]{1,64}$/,Ime=20,vme=200,Rme=100,Nme=100,tcr=200,rcr=/^[^/\s]+\/[^/\s]+$/,Tme=500,kme=50,Bme=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,im=t=>b.string().max(t).refine(e=>e.trim().length>0&&!Bme.test(e),"blank, or not text"),_v={sequence:b.number().int().min(1).max(SG),at:b.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},Pme=b.discriminatedUnion("kind",[b.object({..._v,kind:b.literal("log"),phase:b.nativeEnum(Ov),text:im(fme)}).strict(),b.object({..._v,kind:b.literal("component"),name:im(w_),repository:im(tcr).refine(t=>rcr.test(t)||t===An,"not owner/name"),file:im(Tme).nullable(),status:b.nativeEnum(v_),version:im(Nme).optional()}).strict(),b.object({..._v,kind:b.literal("reply"),to:b.string().uuid(),accepted:b.boolean(),text:im(fme)}).strict(),b.object({..._v,kind:b.literal("question"),id:b.string().regex(CG),type:b.nativeEnum(wG),text:im(fme),component:im(w_).nullable(),choices:b.array(im(vme)).max(Ime),placeholder:im(Rme).optional()}).strict(),b.object({..._v,kind:b.literal("delivered"),ids:b.array(b.string().uuid()).max(Qv)}).strict(),b.object({..._v,kind:b.literal("credentials"),names:b.array(b.string().regex(WA)).min(1).max(kme)}).strict()]).superRefine((t,e)=>{t.kind==="credentials"&&new Set(t.names).size!==t.names.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["names"],message:"a name twice"}),t.kind==="question"&&(t.type==="free_text"!=(t.choices.length===0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(t.choices).size!==t.choices.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),mnt=b.object({schemaVersion:b.literal(1),events:b.array(Pme).max(Qv)}).strict(),snt={id:b.string().uuid(),text:b.string(),by:b.string().nullable(),at:b.string()},ncr=b.discriminatedUnion("kind",[b.object({...snt,kind:b.literal("instruction"),question:b.null()}),b.object({...snt,kind:b.literal("answer"),question:b.string().regex(CG)})]),fnt=b.string().regex(/^[A-Za-z0-9+/]{43}=$/),hnt=b.object({schemaVersion:b.literal(1),leftOut:b.array(b.string()),messages:b.array(ncr).optional(),stop:b.object({key:fnt}).optional()}),R_=7,IG=500*1024*1024,gnt=b.object({id:Gu,name:b.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Gu,expiresAt:b.string().datetime()}).strict(),Ant=b.object({schemaVersion:b.literal(1),artifact:gnt,sessionId:Hl,contentHash:la,bytes:b.number().int().min(1).max(IG)}).strict(),ynt=b.object({schemaVersion:b.literal(1),checkpoint:b.object({artifact:gnt,repository:b.object({namespace:b.string().min(1),name:b.string().min(1)}).strict(),sessionId:Hl,contentHash:la,key:fnt}).strict().nullable()}).strict(),scr=200,fG=100,vG=(n=>(n.Resume="resume",n.Retry="retry",n.Update="update",n))(vG||{}),icr=b.object({kind:b.nativeEnum(vG),setup:b.object({runId:Hl,endedAt:b.string().nullable(),outcome:b.string().nullable()}).strict(),components:b.array(b.object({name:b.string().min(1),repository:b.string().min(1),status:b.nativeEnum(v_)}).strict()).max(fG),credentials:b.array(b.string().min(1)).max(fG),answers:b.array(b.object({question:b.string(),answer:b.string().nullable()}).strict()).max(fG),instructions:b.array(b.object({text:b.string(),reply:b.string().nullable()}).strict()).max(fG),log:b.array(b.object({phase:b.nativeEnum(Ov),text:b.string()}).strict()).max(scr)}).strict(),bnt=b.object({schemaVersion:b.literal(1),context:icr.nullable()}).strict(),Ent=b.object({schemaVersion:b.literal(1),configuration:b.object({captureId:Hl,revision:Gu.nullable(),hash:la}).strict(),capture:b.object({schemaVersion:b.literal(1),settings:b.object({target:b.object({environment:b.unknown()}).passthrough(),timeoutMinutes:b.number().int().positive(),answerWaitMinutes:b.number().int().positive().optional(),testEnvironment:b.object({name:b.string().min(1),address:b.string().min(1).optional(),readyWhen:b.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:b.object({}).passthrough(),hash:la}).strict()}).strict(),ocr=Bv.extend({version:b.number().int().positive(),components:b.array(b.object({name:b.string().min(1),repository:b.string().min(1)}).strict()),contentHash:la.optional(),files:b.array(b.object({path:b.string().refine(t=>JA(t)&&!Pv.includes(t),"not a file of a customer_deployed plan"),content:b.string()}).strict()).optional()}).strict(),wnt=b.object({schemaVersion:b.literal(1),testEnvironment:ocr.nullable().optional(),runtimePlan:b.object({version:b.number().int().positive(),contentHash:la,files:b.array(b.object({path:b.string().refine(JA,"not a recipe file path"),content:b.string()}).strict()).min(1),recipe:b.record(b.unknown()).optional()}).strict().nullable()}).strict().refine(t=>!(t.runtimePlan&&t.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),xnt=b.object({schemaVersion:b.literal(1),state:b.nativeEnum(ont),ending:b.nativeEnum(bG).nullable(),cause:b.nativeEnum(EG).nullable(),deadlineAt:b.string().datetime()}).strict();function _me(t,e){return t.state==="ended"?t.ending==="cancelled"?"cancelled":t.cause==="runner_lost"?"expired":"ended":e.getTime()>=Date.parse(t.deadlineAt)?"expired":null}function KA(t){if(typeof t=="number"&&!Number.isFinite(t))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(t))return`[${t.map(KA).join(",")}]`;if(t!==null&&typeof t=="object"){let r=t;return`{${Object.keys(r).sort().map(n=>`${JSON.stringify(n)}:${KA(r[n])}`).join(",")}}`}let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Canonical JSON requires JSON values");return e}function Dme(t){return(0,C_.createHash)("sha256").update(KA(t),"utf8").digest("hex")}function Snt(t){let e=[...t].sort((r,n)=>r.path<n.path?-1:r.path>n.path?1:0).map(r=>({path:r.path,content:r.content}));return(0,C_.createHash)("sha256").update(KA(e),"utf8").digest("hex")}function Cnt(t){let e=(i,o)=>i<o?-1:i>o?1:0,r=[...t.files].sort((i,o)=>e(i.path,o.path)).map(i=>({path:i.path,content:i.content})),n={address:t.address,readyWhen:t.readyWhen,credentials:[...t.credentials].sort(e),revisionSources:t.revisionSources.map(i=>KA({method:i.method,detail:i.detail,components:[...i.components].sort(e)})).sort(e)},s=t.components.map(i=>KA({name:i.name,repository:i.repository})).sort(e);return(0,C_.createHash)("sha256").update(KA({type:"customer_deployed",environment:n,components:s,files:r}),"utf8").digest("hex")}function Int(t){return(0,C_.createHash)("sha256").update(KA({schemaVersion:t.schemaVersion,settings:t.settings,provenance:t.provenance}),"utf8").digest("hex")}var x_=t=>({provider:t.provider,providerAccountId:t.providerAccountId,providerRepositoryId:t.providerRepositoryId});function vnt(t,e){return Jar.parse({schemaVersion:1,runId:t,execution:e.execution(),requester:!0,writeCheck:!0})}function Rnt(t){let e=Yar.parse(t);if(Dme(e.manifest)!==e.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return e}function acr(t){let e=r=>r.map(n=>({repository:x_(n.repository),number:n.number}));return t.status==="delivered"?{status:t.status,pullRequests:e(t.pullRequests)}:t.status==="partial"?{status:t.status,pullRequests:e(t.pullRequests),failures:t.failures.map(r=>({repository:x_(r.repository),message:r.message}))}:t}function Nnt(t){return t.issues.map(e=>`${e.path.map((n,s)=>typeof n=="number"?`[${n}]`:s===0?n:`.${n}`).join("")}: ${e.message}`).join("; ")}function Tnt(t){let{manifest:e}=t;if(Har.includes(e.trigger.kind))throw new Error(`The report upload is invalid: a ${e.trigger.kind} run uploads its SUT recipe, never a report`);let r=dnt.safeParse({schemaVersion:1,run:{runId:e.runId,attemptNumber:t.attemptNumber,manifestHash:Dme(e)},target:{id:e.target.id,revision:e.target.revision},policy:e.policy&&{id:e.policy.id,revision:e.policy.revision},provenance:{sources:t.checkedOut.map(n=>({repository:x_(n.repository),revision:n.revision}))},delivery:{generatedTests:acr(t.generatedTests)},producer:t.producer,report:t.report,...t.githubWrites?.length?{githubWrites:t.githubWrites.map(n=>({...n,repository:x_(n.repository)}))}:{}});if(!r.success)throw new Error(`The report upload is invalid: ${Nnt(r.error)}`);return ccr(r.data,e),r.data}function knt(t,e,r,n,s){let i=ecr.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e,manifestHash:Dme(t)},target:{id:t.target.id,revision:t.target.revision},provenance:{sources:r.map(o=>({repository:x_(o.repository),revision:o.revision}))},producer:s,recipe:n});if(!i.success)throw new Error(`The SUT recipe upload is invalid: ${Nnt(i.error)}`);return i.data}function ccr(t,e){let r=new Map(e.sources.map(n=>[`${n.repository.namespace}/${n.repository.name}`.toLowerCase(),n.revision]));t.report.validation.acceptedEvidence.forEach((n,s)=>{let i=`report.validation.acceptedEvidence[${s}]`,o=r.get(n.repository.toLowerCase());if(!o)throw new Error(`${i}.repository: ${n.repository} is outside the run's snapshot`);if(n.revision!==o)throw new Error(`${i}.revision: evidence is not from the frozen revision ${o}`)})}var lcr=3e4;function Bnt(t,e={}){let r=i=>{let o=t[i];if(!o)throw new Error(`${i} is not set; the V3 runner handshake needs it`);return o},n=t.GITHUB_REPOSITORY_ID,s=t.GITHUB_REPOSITORY;return{runnerPlatform:t.GITHUB_ACTIONS==="true"?"github":void 0,workspace:t.GITHUB_WORKSPACE||void 0,serverUrl:(t.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/,""),apiUrl:(t.GITHUB_API_URL||"https://api.github.com").replace(/\/+$/,""),repository:n&&s?{id:n,slug:s}:void 0,runId:t.GITHUB_RUN_ID||void 0,runAttempt:t.GITHUB_RUN_ATTEMPT||void 0,job:t.GITHUB_JOB||void 0,execution(){let i=r("GITHUB_RUN_ATTEMPT");if(!/^[1-9][0-9]*$/.test(i))throw new Error(`GITHUB_RUN_ATTEMPT is "${i}", not a positive whole number`);return{provider:"github",repository:{provider:"github",providerAccountId:r("GITHUB_REPOSITORY_OWNER_ID"),providerRepositoryId:r("GITHUB_REPOSITORY_ID")},providerRunId:r("GITHUB_RUN_ID"),providerRunAttempt:Number(i),workflowRef:r("GITHUB_WORKFLOW_REF")}},takeIdToken(){let i=t.ACTIONS_ID_TOKEN_REQUEST_URL,o=t.ACTIONS_ID_TOKEN_REQUEST_TOKEN;return delete t.ACTIONS_ID_TOKEN_REQUEST_URL,delete t.ACTIONS_ID_TOKEN_REQUEST_TOKEN,async a=>{if(!i||!o)throw new Error("The job cannot request an OIDC token. Give it the `id-token: write` permission.");let c=new URL(i);c.searchParams.set("audience",a);let l=await fetch(c,{headers:{Authorization:`Bearer ${o}`,Accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(lcr)});if(!l.ok)throw new Error(`GitHub refused the OIDC token request: ${l.status}`);let u=(await l.json().catch(()=>({}))).value;if(typeof u!="string"||!u)throw new Error("GitHub's OIDC token response carried no token");return Ot(u),u}},webIdentity(){return!t.ACTIONS_ID_TOKEN_REQUEST_TOKEN?.trim()||!t.ACTIONS_ID_TOKEN_REQUEST_URL?.trim()?void 0:{token:e.getIDToken??(o=>yRe(o)),runId:t.GITHUB_RUN_ID}}}}function Os(t=process.env){return Bnt(t)}Ke();var Ow=q(require("fs"));Ke();var RG=q(require("fs")),XA=q(require("path"));function N_(t){return t.match(/\.skyramp\/videos\/([^/]+)\//)?.[1]}function Ome(t){if(!RG.existsSync(t))return[];let e=[],r=n=>{let s;try{s=RG.readdirSync(n,{withFileTypes:!0})}catch(i){X(`Skipping unreadable video dir ${n}: ${i instanceof Error?i.message:String(i)}`);return}for(let i of s){let o=XA.join(n,i.name);i.isDirectory()?r(o):i.isFile()&&i.name.endsWith(".webm")&&e.push(o)}};return r(t),e}async function Pnt(t,e,r){let n={};if(r.size===0)return n;let s=XA.resolve(t),i=()=>[...r].flatMap(c=>{let l=XA.resolve(t,c);return l!==s&&!l.startsWith(s+XA.sep)?(X(`Skipping video subdir outside the videos tree: ${c}`),[]):Ome(XA.join(t,c))}),o=i();if(o.length===0&&(X(`Expected ${r.size} test video(s) but found none under ${t}; retrying collection once`),await NA(3),o=i()),o.length===0)return n;let a=new Map;for(let c of o){let l=N_(c);if(!l)continue;let u=a.get(l);u?u.push(c):a.set(l,[c])}for(let[c,l]of a)try{let u=await Mme(`skyramp-video-${c}`,l,t);u&&(n[c]=e.getArtifactUrl(u))}catch(u){X(`Failed to upload video artifact for ${c} after retry: ${u instanceof Error?u.message:String(u)}`)}return Ne(`Uploaded ${Object.keys(n).length} of ${a.size} test execution video artifact(s)`),n}async function Mme(t,e,r,n){let{DefaultArtifactClient:s}=await Promise.resolve().then(()=>(pI(),iB)),i=new s,{id:o}=await li(()=>i.uploadArtifact(t,e,r,n),{retries:2,delay:3,label:`Video artifact upload for ${t}`});return o}function ucr(t){return Ow.existsSync(t.summaryPath)?t.summaryPath:Ow.existsSync(t.agentStdoutPath)?(ee("Using agent stdout as fallback (agent did not write to summary file)"),t.agentStdoutPath):null}var Qme=t=>t.replace(/\s*[\r\n]+\s*/g," ").trim(),Lme=t=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:void 0;function dcr(t){if(typeof t!="object"||t===null)return;let e=t,r=Object.values(Ip).includes(e.verification)?e.verification:void 0,n=(Array.isArray(e.skipped)?e.skipped:[]).map(o=>typeof o=="object"&&o!==null?o:{}).filter(o=>typeof o.pageObject=="string"&&o.pageObject.trim()!=="").map(o=>({pageObject:Qme(o.pageObject),member:typeof o.member=="string"?Qme(o.member):void 0,declinedBy:Object.values(pA).includes(o.declinedBy)?o.declinedBy:void 0,reason:typeof o.reason=="string"?Qme(o.reason):""})),s={candidatesDetected:Lme(e.candidatesDetected),callsReused:Lme(e.callsReused),callsVerified:Lme(e.callsVerified),verification:r,skipped:n.length>0?n:void 0};return Object.values(s).some(o=>o!==void 0)?s:void 0}function pcr(t){let e=typeof t=="object"&&t!==null?t:{},{reuse:r,...n}=e,s=dcr(r);return s?{...n,reuse:s}:n}function mcr(t){try{let e=t.replace(/^```(?:json)?\s*\n?/m,"").replace(/\n?```\s*$/m,"").trim(),r=JSON.parse(e);if(typeof r.businessCaseAnalysis=="string"&&Array.isArray(r.testResults)){for(let n of["newTestsCreated","testMaintenance","issuesFound"])Array.isArray(r[n])||(r[n]=[]);return Array.isArray(r.nextSteps)||(r.nextSteps=[]),r.commitMessage!==void 0&&typeof r.commitMessage!="string"&&delete r.commitMessage,r.newTestsCreated=r.newTestsCreated.map(pcr),r.testResults=r.testResults.map(n=>{let s=typeof n=="object"&&n!==null?n:{},i={...s,testType:typeof s.testType=="string"?s.testType:"",endpoint:typeof s.endpoint=="string"?s.endpoint:"",status:typeof s.status=="string"?s.status:"",details:typeof s.details=="string"?s.details:""};for(let o of["repository","videoPath"])i[o]!==void 0&&typeof i[o]!="string"&&delete i[o];return i}),r}return null}catch{return null}}var _nt={high:0,medium:1,low:2},Dnt={security_boundary:0,breaking_change:1,data_integrity:2,business_rule:3,workflow:4};function Ont(t,e,r,n){let s=r[n(t.testType)]??99,i=r[n(e.testType)]??99;if(s!==i)return s-i;let o=_nt[(t.priority??"").toLowerCase()]??99,a=_nt[(e.priority??"").toLowerCase()]??99;if(o!==a)return o-a;let c=Dnt[t.category??""]??99,l=Dnt[e.category??""]??99;if(c!==l)return c-l;let u=(t.steps??[]).some(p=>(p.expectedStatusCode??0)>=400)?0:1,d=(e.steps??[]).some(p=>(p.expectedStatusCode??0)>=400)?0:1;return u!==d?u-d:(t.scenarioName??"").localeCompare(e.scenarioName??"")}function fcr(t){if(!t)return;let e=ne().reuse,{callsReused:r,callsVerified:n,candidatesDetected:s,verification:i}=t,o=[];r!==void 0&&n!==void 0?(o.push(r===n?e.reusedAndVerified(r):e.reusedThenVerified(r,n)),i===Ip.Passed&&r>n&&o.push(e.unresolved(r-n))):r!==void 0?o.push(e.reused(r)):n!==void 0&&o.push(e.verified(n)),s!==void 0&&o.push(e.candidates(s));let a=r!==void 0&&r===n;i===Ip.SkippedNoPom?o.push(e.noPomLayer):i===Ip.Passed&&!a?o.push(e.verificationPassed):i===Ip.Failed&&o.push(e.verificationFailed);let c=t.skipped??[];if(c.length>0){let l=d=>{let p=d.member||d.pageObject,f=[d.declinedBy?e.gate[d.declinedBy]:"",d.reason].filter(Boolean).join(" \u2014 ");return f?`${p} (${f})`:p},u=[...c].sort((d,p)=>+(p.declinedBy===pA.DemotedByVerify)-+(d.declinedBy===pA.DemotedByVerify));o.push(e.keptInline(u.map(l).join("; ")))}if(o.length!==0)return`${e.label}: ${o.join(" \xB7 ")}`}function Mnt(t){return(t.testMaintenance??[]).filter(e=>e.action!==mI.Ignore&&e.action!==mI.Verify)}function Mw(t,e={}){let r=ne(),{collapsed:n=!1,userPrompt:s,autoCommit:i=!1,audience:o,primaryRepo:a}=e,c=[],l=Y=>Y&&Y.toLowerCase()!==a?.toLowerCase()?Y:void 0,u=Y=>{let te=l(Y);return te?` \`[${te}]\``:""},d=t.newTestsCreated.some(Y=>l(Y.repository))||t.testResults.some(Y=>l(Y.repository))||t.issuesFound.some(Y=>l(Y.repository))||!!t.additionalRecommendations?.some(Y=>l(Y.repository)),p=o!=="testbot-pr",m=o!=="comment",f=o!=="testbot-pr",h=o!=="testbot-pr",A=o==="testbot-pr";c.push("<!-- skyramp-testbot -->");let E=Mnt(t),y=new Set([Oa.Lint,Oa.Type,Oa.Config]),w=Y=>Y.category!==void 0&&y.has(Y.category),C=t.issuesFound.filter(Y=>!w(Y)),v=t.issuesFound.filter(w),k={critical:0,high:1,medium:2,low:3},N=(Y,te)=>(k[Y.severity??""]??4)-(k[te.severity??""]??4),M=(Y,te)=>(Object.prototype.hasOwnProperty.call(Y,te)?Y[te]:void 0)??te,T=Y=>`- ${Y.severity?`**[${M(r.severityLabels,Y.severity).toUpperCase()}]** `:""}${Y.description}${u(Y.repository)}`;if(t.newTestsCreated.length===0&&t.testResults.length===0&&E.length===0&&t.issuesFound.length>0&&(!t.additionalRecommendations||t.additionalRecommendations.length===0)){c.push(r.minimalReportHeader),c.push("");for(let te of C)c.push(te.description);if(v.length>0){C.length>0&&c.push(""),c.push(`### ${r.configErrorsHeader}`);for(let te of[...v].sort(N))c.push(T(te))}let Y=t.caveats??[];if(Y.length>0){c.push(""),c.push(r.caveatsHeader),c.push("");for(let te of Y)c.push(`- ${te.text}`)}if(t.nextSteps?.length>0){c.push(""),c.push(r.nextStepsHeader),c.push("");for(let te of t.nextSteps)c.push(`- ${te}`)}return Fme(c.join(`
|
|
317
|
+
${r.output}`:`deploy reported ${e.outcome} without the failing command`,fix:e.outcome==="change-broke-bringup"?`fix the change that broke bring-up${n}, then onboard again`:"make .skyramp/sut/setup.sh bring the SUT up from a clean checkout (what onboard's session had that a fresh run lacks), then onboard again"}}function Qar(t){return t.environment?{component:t.components.map(e=>e.name).join(", ")||"SUT",problem:"the deployment was never checked from a fresh session: deploy did not run or wrote no deploy.json",evidence:"outputs/deploy.json is missing from this run",fix:"run deploy after onboard in the same run so it checks the deployment is ready; if deploy ran, its stage log says why it wrote no deploy.json"}:{component:t.components.map(e=>e.name).join(", ")||"SUT",problem:"the recipe was never replayed: deploy did not run or wrote no deploy.json",evidence:"outputs/deploy.json is missing from this run",fix:"run deploy after onboard in the same run so it replays .skyramp/sut/setup.sh from a clean start; if deploy ran, its stage log says why it wrote no deploy.json"}}function Lar(t){return{component:"SUT recipe",problem:"deploy fixed recipe drift, but the recipe it fixed was not collected \u2014 onboard's copy is the recipe from before the fix",evidence:`deploy reported recipe-drift: ${(t.recipeFixes??[]).join("; ")||"no fixes listed"}`,fix:"collect .skyramp/sut/ and .skyramp/workspace.yml after deploy (collectRecipeFiles) and build the plan from that collection"}}var ume=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"],dme=[".skyramp/sut/health.json",".skyramp/workspace.yml"];function Far(t){return`Onboard again so it leaves the whole recipe in the checkout: ${t.map(r=>r===".skyramp/workspace.yml"?"create .skyramp/workspace.yml with skyramp_init_scan and skyramp_init_workspace":`write ${r} as a regular file (a symlink is not uploaded)`).join("; ")}.`}function pme(t,e,r){return e&&r||t}function mme(t,e,r={}){let n=e!==void 0&&!Oar.includes(e.outcome),s=pme(t,e,r.recipeFiles),i=e?.outcome==="recipe-drift"&&!r.recipeFiles,o=(s.recipeFilesOmitted??[]).filter(w=>JA(w.path)),a=o.length?[{component:"SUT recipe",problem:`The recipe could not be uploaded whole: ${o.map(w=>w.path).join(", ")} left out.`,evidence:o.map(w=>`${w.path}: ${w.reason}`).join("; "),fix:"Keep each recipe file text-only and under 64 KiB, and the recipe under 512 KiB in total \u2014 move large generated content out of .skyramp/sut/ and have setup.sh produce it."}]:[],c=t.status==="ready",l=t.environment,u=new Set(s.recipeFiles.map(w=>w.path)),d=c?(l?dme:ume).filter(w=>!u.has(w)):[],p=d.length?[{component:"SUT recipe",problem:`The recipe is missing ${d.join(", ")}, so it cannot be replayed.`,evidence:`collected: ${[...u].sort().join(", ")||"nothing"}`,fix:Far(d)}]:[],m=e?n?[Mar(t,e)]:[]:c?[Qar(t)]:[],f=new Set(l?.revisionSources.flatMap(w=>w.components)),h=l&&c?t.components.filter(w=>w.repository!==An&&!f.has(w.name)).map(w=>w.name):[],A=h.length?[{component:h.join(", "),problem:`Testbot cannot tell which revision ${h.join(" and ")} ${h.length>1?"run":"runs"}, so a run could not say which changes it tested.`,evidence:`revision sources: ${l.revisionSources.map(w=>`${w.detail} (${w.components.join(", ")})`).join("; ")||"none"}`,fix:"Say in the Test Environment's notes how to tell what is deployed, such as a version route (GET /version), then set it up again."}]:[],E=[...t.blockers,...m,...i&&e?[Lar(e)]:[],...a,...p,...A,...r.revisionCheck?.blockers??[],...r.credentialBlockers??[]],y=e?.baseUrls??{};return{schemaVersion:1,...l?{type:"customer_deployed",environment:Yrt(l)}:{},status:c&&e!==void 0&&!n&&!i&&o.length===0&&d.length===0&&h.length===0&&!r.revisionCheck?.blockers.length&&!r.credentialBlockers?.length?"ready":"blocked",components:t.components.map(w=>({name:w.name,repository:w.repository,healthy:w.healthy&&!n,url:Object.hasOwn(y,w.name)&&y[w.name]||null,...w.steps?{steps:w.steps.map(C=>({action:C.action,text:C.text,source:C.source,file:C.file}))}:{},...w.kind?{kind:w.kind}:{},...w.from?{from:{file:w.from.file,service:w.from.service}}:{},...w.credentials?{credentials:[...new Set(w.credentials)].filter(C=>WA.test(C))}:{},...l?{deployed:Uar(w,r)}:{}})),suites:t.suites.map(w=>({framework:w.framework,file:w.file,result:w.result})),inputsUsed:[...t.inputsUsed],...t.inputsUsedHow?{inputsUsedHow:t.inputsUsedHow.filter(w=>t.inputsUsed.includes(w.input)).map(w=>({input:w.input,how:w.how}))}:{},inputsNotUsed:t.inputsNotUsed.map(w=>({input:w.input,reason:w.reason})),blockers:E.map(w=>({component:w.component,problem:w.problem,evidence:w.evidence,fix:w.fix})),replay:e&&!l?{outcome:e.outcome,durationSeconds:r.deployDurationSeconds??null}:null,files:s.recipeFiles.filter(w=>JA(w.path)&&!(l&&Pv.includes(w.path))).map(w=>({path:w.path,content:w.content}))}}function Uar(t,e){return t.repository===An?null:e.revisionCheck?e.revisionCheck.deployed[t.name]??null:e.deployed?.[t.name]??t.deployed??null}function Yrt(t){return{address:t.address,readyWhen:t.readyWhen,credentials:[...new Set(t.credentials)],revisionSources:t.revisionSources.map(e=>({method:e.method,detail:e.detail,components:[...e.components]}))}}function Jrt(t){return{schemaVersion:1,status:"ready",components:t.components.map(({url:e,deployed:r,...n})=>({...n,healthy:!0})),suites:t.suites,inputsUsed:t.inputsUsed,...t.inputsUsedHow?{inputsUsedHow:t.inputsUsedHow}:{},inputsNotUsed:t.inputsNotUsed,blockers:[],recipeFiles:t.files,recipeFilesOmitted:[],...t.environment?{environment:Yrt(t.environment)}:{}}}var int={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file"},I_=(r=>(r.GitHub="github",r.AzureDevOps="azure-devops",r))(I_||{}),hme=(i=>(i.Trigger="TRIGGER",i.Baseline="BASELINE",i.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",i.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",i.ManualOverride="MANUAL_OVERRIDE",i))(hme||{}),gG=(i=>(i.PullRequest="pull_request",i.ReadyForReview="ready_for_review",i.Schedule="schedule",i.Manual="manual",i.SutSetup="sut_setup",i))(gG||{}),$ar=["sut_setup"],qar=["sut_setup","schedule"],Har=["sut_setup"],AG=(e=>(e.PullRequest="pull_request",e))(AG||{}),yG=(s=>(s.ModelProvider="model_provider",s.SutAccess="sut_access",s.Skyramp="skyramp",s.Other="other",s))(yG||{});var bG=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s))(bG||{}),ont=(r=>(r.Running="running",r.Ended="ended",r))(ont||{}),EG=(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))(EG||{}),gme=(n=>(n.Onboard="onboard",n.Deploy="deploy",n.Recheck="recheck",n))(gme||{}),Ame=(r=>(r.Started="started",r.Finished="finished",r))(Ame||{}),yme=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(yme||{}),bme=(o=>(o.Log="log",o.Component="component",o.Reply="reply",o.Question="question",o.Delivered="delivered",o.Credentials="credentials",o))(bme||{}),wG=(n=>(n.ChooseCredential="choose_credential",n.FreeText="free_text",n.ChooseSource="choose_source",n))(wG||{});var Ov=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(Ov||{}),v_=(s=>(s.Found="found",s.Starting="starting",s.Up="up",s.OutOfScope="out_of_scope",s))(v_||{}),Gu=b.string().regex(/^[1-9][0-9]{0,18}$/),Mv=b.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Hl=b.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),la=b.string().regex(/^[0-9a-f]{64}$/),hG=b.object({id:Hl,revision:Gu}).strict(),Dc=b.object({provider:b.nativeEnum(I_),providerAccountId:Gu,providerRepositoryId:Gu}).strict(),E_=t=>`${t.provider}:${t.providerRepositoryId}`,ant=Dc.extend({namespace:b.string().min(1),name:b.string().min(1)}).strict(),Krt=b.object({ref:b.string().min(1),revision:Mv}).strict(),zar=b.object({repository:ant,revision:Mv,ref:b.string().nullable(),reason:b.nativeEnum(hme),change:b.object({kind:b.nativeEnum(AG),number:Gu,base:Krt.optional()}).strict().nullable(),compareWith:Krt.optional()}).strict();function Gar(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=>E_(o.repository))),s=new Set(e.map(o=>E_(o.repository)));return s.size===e.length&&s.size===n.size&&[...s].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var cnt=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,lnt=/^[1-9][0-9]{0,18}$/,Xrt=new RegExp(`${cnt.source}|${lnt.source}`),Zrt=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,jar=b.union([b.object({source:b.literal("jira"),site:b.string().regex(Zrt),key:b.string().regex(cnt),updated:b.string().datetime(),contentHash:la}).strict(),b.object({source:b.literal("confluence"),site:b.string().regex(Zrt),key:b.string().regex(lnt),version:b.number().int().positive(),contentHash:la}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),contentHash:la}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),contentHash:la,fileName:b.string().min(1).max(255),mediaType:b.nativeEnum(Tv)}).strict()]),ent=b.union([b.literal("jira"),b.literal("confluence")]),unt=b.object({schemaVersion:b.literal(1),items:b.array(b.union([b.object({source:ent,site:b.string(),key:b.string().regex(Xrt),state:b.literal("read"),text:b.string(),version:b.string().min(1),contentMatches:b.boolean()}).strict(),b.object({source:ent,site:b.string(),key:b.string().regex(Xrt),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),state:b.literal("read"),text:b.string(),version:b.string().min(1),contentMatches:b.boolean()}).strict(),b.object({source:b.literal("other"),key:b.string().regex(f_),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),state:b.literal("read"),version:la,fileName:b.string().min(1).max(255),mediaType:b.nativeEnum(Tv)}).strict(),b.object({source:b.literal("other"),key:b.string().regex(Pw),state:b.literal("not_read"),reason:b.nativeEnum(Bw)}).strict()])),instructions:b.array(b.string()).optional()}).strict(),Var=b.object({schemaVersion:b.literal(1),runId:Hl,skyrampOrgId:Hl,target:hG,policy:hG.nullable(),trigger:b.object({kind:b.nativeEnum(gG),requestedAt:b.string().datetime()}).strict(),configuration:b.object({captureId:Hl,revision:Gu.nullable(),hash:la}).strict(),baseline:b.object({confirmedRunId:Hl.nullable(),sources:b.array(b.object({repository:Dc,revision:Mv}).strict()).optional()}).strict(),sources:b.array(zar).min(1),execution:b.object({provider:b.nativeEnum(I_),repository:ant,workflowPath:b.string(),ref:b.string()}).strict(),credentials:b.array(b.object({name:b.string(),purpose:b.nativeEnum(yG),required:b.boolean()}).strict()),requirements:b.array(jar).min(1).optional(),instructions:b.object({contentHash:la}).strict().optional()}).strict().superRefine((t,e)=>{let r=new Set;(t.requirements??[]).forEach((o,a)=>{let c="fileName"in o?"file":"pasted";o.source==="other"&&o.key!==`${c}-${o.contentHash.slice(0,16)}`&&e.addIssue({code:b.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",a,"key"]});let l=_c({source:o.source,key:o.key});r.has(l)&&e.addIssue({code:b.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",a,"key"]}),r.add(l)});let n=t.trigger.kind,s=$ar.includes(n);s!==(t.policy===null)&&e.addIssue({code:b.ZodIssueCode.custom,path:["policy"],message:s?`a ${n} run has no policy`:"names the policy revision"});let i=Gar(t);i&&e.addIssue({code:b.ZodIssueCode.custom,path:["baseline","sources"],message:i}),qar.includes(n)&&t.sources.forEach((o,a)=>{o.reason!=="BASELINE"&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",a,"reason"],message:`a ${n} run selects only BASELINE sources`})}),t.sources.forEach((o,a)=>{o.compareWith&&(o.reason!=="MANUAL_OVERRIDE"||o.change)&&e.addIssue({code:b.ZodIssueCode.custom,path:["sources",a,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"})})});var Eme=(r=>(r.Person="person",r.Policy="policy",r))(Eme||{}),War=b.object({kind:b.nativeEnum(Eme),name:b.string().min(1).max(256)}).strict(),Yar=b.object({schemaVersion:b.literal(1),attempt:b.object({id:Hl,number:b.number().int().positive(),deadlineAt:b.string().datetime()}).strict(),manifest:Var,manifestHash:la,entitlements:b.array(b.string()).optional(),runToken:b.string().min(1).optional(),requestedBy:War.nullable().optional(),writeAllowed:b.boolean().optional(),claudeCodeVersion:b.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional()}).strict(),Jar=b.object({schemaVersion:b.literal(1),runId:Hl,execution:b.object({provider:b.nativeEnum(I_),repository:Dc,providerRunId:Gu,providerRunAttempt:b.number().int().positive(),workflowRef:b.string().min(1)}).strict(),requester:b.literal(!0).optional(),writeCheck:b.literal(!0).optional(),claudeCodePin:b.literal(!0).optional()}).strict(),tnt=b.object({repository:Dc,number:Gu}).strict(),Kar=b.discriminatedUnion("status",[b.object({status:b.literal("none")}).strict(),b.object({status:b.literal("delivered"),pullRequests:b.array(tnt).min(1)}).strict(),b.object({status:b.literal("partial"),pullRequests:b.array(tnt).min(1),failures:b.array(b.object({repository:Dc,message:b.string()}).strict()).min(1)}).strict(),b.object({status:b.literal("failed"),message:b.string()}).strict()]),Xar=b.object({sufficiency:b.nativeEnum(h_),rationale:b.string().min(1),gaps:b.array(b.string().min(1)),acceptedEvidence:b.array(b.object({kind:b.nativeEnum(VA),repository:b.string().min(1),revision:Mv,reference:b.string().min(1),summary:b.string().min(1)}).strict()),actionRequired:b.array(b.nativeEnum(g_))}).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"})}),Dv=500,wme=2048,xme=1e3,Zar=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(A_),family:b.nativeEnum(cG).optional()}).strict().optional()}).strict()),validation:Xar,changes:b.array(b.object({id:b.string().min(1).max(512),text:b.string().max(16384),source:b.string().max(wme),testedBy:b.array(b.string().min(1).max(1024)).max(Dv),writtenBy:b.array(b.string().min(1).max(1024)).max(Dv),maintainedBy:b.array(b.string().min(1).max(1024)).max(Dv)}).strict()).max(xme).optional(),traceVersion:b.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,s)=>{let i=n.failureCause;i&&n.status==="Pass"&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),i&&i.kind==="environment"!=(i.family!==void 0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",s,"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)})}),rnt=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function xG(t,e,r,n){let s=r.replace(/\\/g,"/"),i=s.split("/").filter(c=>c!==""&&c!==".");if(s.startsWith("/")||/^[A-Za-z]:/.test(s)||i.length===0||i.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=i.join("/"),a=`${t}:${e}:${rnt(o)}`;return n?`${a}#${rnt(n)}`:a}var Sme=50,nnt=b.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Cme=b.discriminatedUnion("kind",[b.object({kind:b.literal("branch_pushed"),repository:Dc,branch:nnt,commit:Mv}).strict(),b.object({kind:b.enum(["pull_request_opened","pull_request_edited"]),repository:Dc,number:Gu,branch:nnt}).strict()]),dnt=b.object({schemaVersion:b.literal(1),run:b.object({runId:Hl,attemptNumber:b.number().int().positive(),manifestHash:la}).strict(),target:hG,policy:hG,provenance:b.object({sources:b.array(b.object({repository:Dc,revision:Mv}).strict())}).strict(),delivery:b.object({generatedTests:Kar}).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:Zar,githubWrites:b.array(Cme).max(Sme).optional()}).strict(),ecr=dnt.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:mG}).strict().superRefine(({recipe:t},e)=>{let r=(i,o)=>e.addIssue({code:b.ZodIssueCode.custom,path:["recipe",...i],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,s=0;t.files.forEach((i,o)=>{JA(i.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(i.path)&&r(["files",o,"path"],"file repeated"),n.add(i.path),pG.test(i.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(i.content,"utf8");s+=a,a>_w&&r(["files",o,"content"],`larger than ${_w} bytes`)}),s>Dw&&r(["files"],`recipe text over ${Dw} bytes in total`)}),pnt=b.object({schemaVersion:b.literal(1),stage:b.nativeEnum(gme),event:b.nativeEnum(Ame),status:b.nativeEnum(yme).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Qv=100,SG=5e3,fme=2e3,w_=100,CG=/^[A-Za-z0-9_-]{1,64}$/,Ime=20,vme=200,Rme=100,Nme=100,tcr=200,rcr=/^[^/\s]+\/[^/\s]+$/,Tme=500,kme=50,Bme=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,im=t=>b.string().max(t).refine(e=>e.trim().length>0&&!Bme.test(e),"blank, or not text"),_v={sequence:b.number().int().min(1).max(SG),at:b.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},Pme=b.discriminatedUnion("kind",[b.object({..._v,kind:b.literal("log"),phase:b.nativeEnum(Ov),text:im(fme)}).strict(),b.object({..._v,kind:b.literal("component"),name:im(w_),repository:im(tcr).refine(t=>rcr.test(t)||t===An,"not owner/name"),file:im(Tme).nullable(),status:b.nativeEnum(v_),version:im(Nme).optional()}).strict(),b.object({..._v,kind:b.literal("reply"),to:b.string().uuid(),accepted:b.boolean(),text:im(fme)}).strict(),b.object({..._v,kind:b.literal("question"),id:b.string().regex(CG),type:b.nativeEnum(wG),text:im(fme),component:im(w_).nullable(),choices:b.array(im(vme)).max(Ime),placeholder:im(Rme).optional()}).strict(),b.object({..._v,kind:b.literal("delivered"),ids:b.array(b.string().uuid()).max(Qv)}).strict(),b.object({..._v,kind:b.literal("credentials"),names:b.array(b.string().regex(WA)).min(1).max(kme)}).strict()]).superRefine((t,e)=>{t.kind==="credentials"&&new Set(t.names).size!==t.names.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["names"],message:"a name twice"}),t.kind==="question"&&(t.type==="free_text"!=(t.choices.length===0)&&e.addIssue({code:b.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(t.choices).size!==t.choices.length&&e.addIssue({code:b.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),mnt=b.object({schemaVersion:b.literal(1),events:b.array(Pme).max(Qv)}).strict(),snt={id:b.string().uuid(),text:b.string(),by:b.string().nullable(),at:b.string()},ncr=b.discriminatedUnion("kind",[b.object({...snt,kind:b.literal("instruction"),question:b.null()}),b.object({...snt,kind:b.literal("answer"),question:b.string().regex(CG)})]),fnt=b.string().regex(/^[A-Za-z0-9+/]{43}=$/),hnt=b.object({schemaVersion:b.literal(1),leftOut:b.array(b.string()),messages:b.array(ncr).optional(),stop:b.object({key:fnt}).optional()}),R_=7,IG=500*1024*1024,gnt=b.object({id:Gu,name:b.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Gu,expiresAt:b.string().datetime()}).strict(),Ant=b.object({schemaVersion:b.literal(1),artifact:gnt,sessionId:Hl,contentHash:la,bytes:b.number().int().min(1).max(IG)}).strict(),ynt=b.object({schemaVersion:b.literal(1),checkpoint:b.object({artifact:gnt,repository:b.object({namespace:b.string().min(1),name:b.string().min(1)}).strict(),sessionId:Hl,contentHash:la,key:fnt}).strict().nullable()}).strict(),scr=200,fG=100,vG=(n=>(n.Resume="resume",n.Retry="retry",n.Update="update",n))(vG||{}),icr=b.object({kind:b.nativeEnum(vG),setup:b.object({runId:Hl,endedAt:b.string().nullable(),outcome:b.string().nullable()}).strict(),components:b.array(b.object({name:b.string().min(1),repository:b.string().min(1),status:b.nativeEnum(v_)}).strict()).max(fG),credentials:b.array(b.string().min(1)).max(fG),answers:b.array(b.object({question:b.string(),answer:b.string().nullable()}).strict()).max(fG),instructions:b.array(b.object({text:b.string(),reply:b.string().nullable()}).strict()).max(fG),log:b.array(b.object({phase:b.nativeEnum(Ov),text:b.string()}).strict()).max(scr)}).strict(),bnt=b.object({schemaVersion:b.literal(1),context:icr.nullable()}).strict(),Ent=b.object({schemaVersion:b.literal(1),configuration:b.object({captureId:Hl,revision:Gu.nullable(),hash:la}).strict(),capture:b.object({schemaVersion:b.literal(1),settings:b.object({target:b.object({environment:b.unknown()}).passthrough(),timeoutMinutes:b.number().int().positive(),answerWaitMinutes:b.number().int().positive().optional(),testEnvironment:b.object({name:b.string().min(1),address:b.string().min(1).optional(),readyWhen:b.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:b.object({}).passthrough(),hash:la}).strict()}).strict(),ocr=Bv.extend({version:b.number().int().positive(),components:b.array(b.object({name:b.string().min(1),repository:b.string().min(1)}).strict()),contentHash:la.optional(),files:b.array(b.object({path:b.string().refine(t=>JA(t)&&!Pv.includes(t),"not a file of a customer_deployed plan"),content:b.string()}).strict()).optional()}).strict(),wnt=b.object({schemaVersion:b.literal(1),testEnvironment:ocr.nullable().optional(),runtimePlan:b.object({version:b.number().int().positive(),contentHash:la,files:b.array(b.object({path:b.string().refine(JA,"not a recipe file path"),content:b.string()}).strict()).min(1),recipe:b.record(b.unknown()).optional()}).strict().nullable()}).strict().refine(t=>!(t.runtimePlan&&t.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),xnt=b.object({schemaVersion:b.literal(1),state:b.nativeEnum(ont),ending:b.nativeEnum(bG).nullable(),cause:b.nativeEnum(EG).nullable(),deadlineAt:b.string().datetime()}).strict();function _me(t,e){return t.state==="ended"?t.ending==="cancelled"?"cancelled":t.cause==="runner_lost"?"expired":"ended":e.getTime()>=Date.parse(t.deadlineAt)?"expired":null}function KA(t){if(typeof t=="number"&&!Number.isFinite(t))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(t))return`[${t.map(KA).join(",")}]`;if(t!==null&&typeof t=="object"){let r=t;return`{${Object.keys(r).sort().map(n=>`${JSON.stringify(n)}:${KA(r[n])}`).join(",")}}`}let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Canonical JSON requires JSON values");return e}function Dme(t){return(0,C_.createHash)("sha256").update(KA(t),"utf8").digest("hex")}function Snt(t){let e=[...t].sort((r,n)=>r.path<n.path?-1:r.path>n.path?1:0).map(r=>({path:r.path,content:r.content}));return(0,C_.createHash)("sha256").update(KA(e),"utf8").digest("hex")}function Cnt(t){let e=(i,o)=>i<o?-1:i>o?1:0,r=[...t.files].sort((i,o)=>e(i.path,o.path)).map(i=>({path:i.path,content:i.content})),n={address:t.address,readyWhen:t.readyWhen,credentials:[...t.credentials].sort(e),revisionSources:t.revisionSources.map(i=>KA({method:i.method,detail:i.detail,components:[...i.components].sort(e)})).sort(e)},s=t.components.map(i=>KA({name:i.name,repository:i.repository})).sort(e);return(0,C_.createHash)("sha256").update(KA({type:"customer_deployed",environment:n,components:s,files:r}),"utf8").digest("hex")}function Int(t){return(0,C_.createHash)("sha256").update(KA({schemaVersion:t.schemaVersion,settings:t.settings,provenance:t.provenance}),"utf8").digest("hex")}var x_=t=>({provider:t.provider,providerAccountId:t.providerAccountId,providerRepositoryId:t.providerRepositoryId});function vnt(t,e){return Jar.parse({schemaVersion:1,runId:t,execution:e.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0})}function Rnt(t){let e=Yar.parse(t);if(Dme(e.manifest)!==e.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return e}function acr(t){let e=r=>r.map(n=>({repository:x_(n.repository),number:n.number}));return t.status==="delivered"?{status:t.status,pullRequests:e(t.pullRequests)}:t.status==="partial"?{status:t.status,pullRequests:e(t.pullRequests),failures:t.failures.map(r=>({repository:x_(r.repository),message:r.message}))}:t}function Nnt(t){return t.issues.map(e=>`${e.path.map((n,s)=>typeof n=="number"?`[${n}]`:s===0?n:`.${n}`).join("")}: ${e.message}`).join("; ")}function Tnt(t){let{manifest:e}=t;if(Har.includes(e.trigger.kind))throw new Error(`The report upload is invalid: a ${e.trigger.kind} run uploads its SUT recipe, never a report`);let r=dnt.safeParse({schemaVersion:1,run:{runId:e.runId,attemptNumber:t.attemptNumber,manifestHash:Dme(e)},target:{id:e.target.id,revision:e.target.revision},policy:e.policy&&{id:e.policy.id,revision:e.policy.revision},provenance:{sources:t.checkedOut.map(n=>({repository:x_(n.repository),revision:n.revision}))},delivery:{generatedTests:acr(t.generatedTests)},producer:t.producer,report:t.report,...t.githubWrites?.length?{githubWrites:t.githubWrites.map(n=>({...n,repository:x_(n.repository)}))}:{}});if(!r.success)throw new Error(`The report upload is invalid: ${Nnt(r.error)}`);return ccr(r.data,e),r.data}function knt(t,e,r,n,s){let i=ecr.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e,manifestHash:Dme(t)},target:{id:t.target.id,revision:t.target.revision},provenance:{sources:r.map(o=>({repository:x_(o.repository),revision:o.revision}))},producer:s,recipe:n});if(!i.success)throw new Error(`The SUT recipe upload is invalid: ${Nnt(i.error)}`);return i.data}function ccr(t,e){let r=new Map(e.sources.map(n=>[`${n.repository.namespace}/${n.repository.name}`.toLowerCase(),n.revision]));t.report.validation.acceptedEvidence.forEach((n,s)=>{let i=`report.validation.acceptedEvidence[${s}]`,o=r.get(n.repository.toLowerCase());if(!o)throw new Error(`${i}.repository: ${n.repository} is outside the run's snapshot`);if(n.revision!==o)throw new Error(`${i}.revision: evidence is not from the frozen revision ${o}`)})}var lcr=3e4;function Bnt(t,e={}){let r=i=>{let o=t[i];if(!o)throw new Error(`${i} is not set; the V3 runner handshake needs it`);return o},n=t.GITHUB_REPOSITORY_ID,s=t.GITHUB_REPOSITORY;return{runnerPlatform:t.GITHUB_ACTIONS==="true"?"github":void 0,workspace:t.GITHUB_WORKSPACE||void 0,serverUrl:(t.GITHUB_SERVER_URL||"https://github.com").replace(/\/+$/,""),apiUrl:(t.GITHUB_API_URL||"https://api.github.com").replace(/\/+$/,""),repository:n&&s?{id:n,slug:s}:void 0,runId:t.GITHUB_RUN_ID||void 0,runAttempt:t.GITHUB_RUN_ATTEMPT||void 0,job:t.GITHUB_JOB||void 0,execution(){let i=r("GITHUB_RUN_ATTEMPT");if(!/^[1-9][0-9]*$/.test(i))throw new Error(`GITHUB_RUN_ATTEMPT is "${i}", not a positive whole number`);return{provider:"github",repository:{provider:"github",providerAccountId:r("GITHUB_REPOSITORY_OWNER_ID"),providerRepositoryId:r("GITHUB_REPOSITORY_ID")},providerRunId:r("GITHUB_RUN_ID"),providerRunAttempt:Number(i),workflowRef:r("GITHUB_WORKFLOW_REF")}},takeIdToken(){let i=t.ACTIONS_ID_TOKEN_REQUEST_URL,o=t.ACTIONS_ID_TOKEN_REQUEST_TOKEN;return delete t.ACTIONS_ID_TOKEN_REQUEST_URL,delete t.ACTIONS_ID_TOKEN_REQUEST_TOKEN,async a=>{if(!i||!o)throw new Error("The job cannot request an OIDC token. Give it the `id-token: write` permission.");let c=new URL(i);c.searchParams.set("audience",a);let l=await fetch(c,{headers:{Authorization:`Bearer ${o}`,Accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(lcr)});if(!l.ok)throw new Error(`GitHub refused the OIDC token request: ${l.status}`);let u=(await l.json().catch(()=>({}))).value;if(typeof u!="string"||!u)throw new Error("GitHub's OIDC token response carried no token");return Ot(u),u}},webIdentity(){return!t.ACTIONS_ID_TOKEN_REQUEST_TOKEN?.trim()||!t.ACTIONS_ID_TOKEN_REQUEST_URL?.trim()?void 0:{token:e.getIDToken??(o=>yRe(o)),runId:t.GITHUB_RUN_ID}}}}function Os(t=process.env){return Bnt(t)}Ke();var Ow=q(require("fs"));Ke();var RG=q(require("fs")),XA=q(require("path"));function N_(t){return t.match(/\.skyramp\/videos\/([^/]+)\//)?.[1]}function Ome(t){if(!RG.existsSync(t))return[];let e=[],r=n=>{let s;try{s=RG.readdirSync(n,{withFileTypes:!0})}catch(i){X(`Skipping unreadable video dir ${n}: ${i instanceof Error?i.message:String(i)}`);return}for(let i of s){let o=XA.join(n,i.name);i.isDirectory()?r(o):i.isFile()&&i.name.endsWith(".webm")&&e.push(o)}};return r(t),e}async function Pnt(t,e,r){let n={};if(r.size===0)return n;let s=XA.resolve(t),i=()=>[...r].flatMap(c=>{let l=XA.resolve(t,c);return l!==s&&!l.startsWith(s+XA.sep)?(X(`Skipping video subdir outside the videos tree: ${c}`),[]):Ome(XA.join(t,c))}),o=i();if(o.length===0&&(X(`Expected ${r.size} test video(s) but found none under ${t}; retrying collection once`),await NA(3),o=i()),o.length===0)return n;let a=new Map;for(let c of o){let l=N_(c);if(!l)continue;let u=a.get(l);u?u.push(c):a.set(l,[c])}for(let[c,l]of a)try{let u=await Mme(`skyramp-video-${c}`,l,t);u&&(n[c]=e.getArtifactUrl(u))}catch(u){X(`Failed to upload video artifact for ${c} after retry: ${u instanceof Error?u.message:String(u)}`)}return Ne(`Uploaded ${Object.keys(n).length} of ${a.size} test execution video artifact(s)`),n}async function Mme(t,e,r,n){let{DefaultArtifactClient:s}=await Promise.resolve().then(()=>(pI(),iB)),i=new s,{id:o}=await li(()=>i.uploadArtifact(t,e,r,n),{retries:2,delay:3,label:`Video artifact upload for ${t}`});return o}function ucr(t){return Ow.existsSync(t.summaryPath)?t.summaryPath:Ow.existsSync(t.agentStdoutPath)?(ee("Using agent stdout as fallback (agent did not write to summary file)"),t.agentStdoutPath):null}var Qme=t=>t.replace(/\s*[\r\n]+\s*/g," ").trim(),Lme=t=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:void 0;function dcr(t){if(typeof t!="object"||t===null)return;let e=t,r=Object.values(Ip).includes(e.verification)?e.verification:void 0,n=(Array.isArray(e.skipped)?e.skipped:[]).map(o=>typeof o=="object"&&o!==null?o:{}).filter(o=>typeof o.pageObject=="string"&&o.pageObject.trim()!=="").map(o=>({pageObject:Qme(o.pageObject),member:typeof o.member=="string"?Qme(o.member):void 0,declinedBy:Object.values(pA).includes(o.declinedBy)?o.declinedBy:void 0,reason:typeof o.reason=="string"?Qme(o.reason):""})),s={candidatesDetected:Lme(e.candidatesDetected),callsReused:Lme(e.callsReused),callsVerified:Lme(e.callsVerified),verification:r,skipped:n.length>0?n:void 0};return Object.values(s).some(o=>o!==void 0)?s:void 0}function pcr(t){let e=typeof t=="object"&&t!==null?t:{},{reuse:r,...n}=e,s=dcr(r);return s?{...n,reuse:s}:n}function mcr(t){try{let e=t.replace(/^```(?:json)?\s*\n?/m,"").replace(/\n?```\s*$/m,"").trim(),r=JSON.parse(e);if(typeof r.businessCaseAnalysis=="string"&&Array.isArray(r.testResults)){for(let n of["newTestsCreated","testMaintenance","issuesFound"])Array.isArray(r[n])||(r[n]=[]);return Array.isArray(r.nextSteps)||(r.nextSteps=[]),r.commitMessage!==void 0&&typeof r.commitMessage!="string"&&delete r.commitMessage,r.newTestsCreated=r.newTestsCreated.map(pcr),r.testResults=r.testResults.map(n=>{let s=typeof n=="object"&&n!==null?n:{},i={...s,testType:typeof s.testType=="string"?s.testType:"",endpoint:typeof s.endpoint=="string"?s.endpoint:"",status:typeof s.status=="string"?s.status:"",details:typeof s.details=="string"?s.details:""};for(let o of["repository","videoPath"])i[o]!==void 0&&typeof i[o]!="string"&&delete i[o];return i}),r}return null}catch{return null}}var _nt={high:0,medium:1,low:2},Dnt={security_boundary:0,breaking_change:1,data_integrity:2,business_rule:3,workflow:4};function Ont(t,e,r,n){let s=r[n(t.testType)]??99,i=r[n(e.testType)]??99;if(s!==i)return s-i;let o=_nt[(t.priority??"").toLowerCase()]??99,a=_nt[(e.priority??"").toLowerCase()]??99;if(o!==a)return o-a;let c=Dnt[t.category??""]??99,l=Dnt[e.category??""]??99;if(c!==l)return c-l;let u=(t.steps??[]).some(p=>(p.expectedStatusCode??0)>=400)?0:1,d=(e.steps??[]).some(p=>(p.expectedStatusCode??0)>=400)?0:1;return u!==d?u-d:(t.scenarioName??"").localeCompare(e.scenarioName??"")}function fcr(t){if(!t)return;let e=ne().reuse,{callsReused:r,callsVerified:n,candidatesDetected:s,verification:i}=t,o=[];r!==void 0&&n!==void 0?(o.push(r===n?e.reusedAndVerified(r):e.reusedThenVerified(r,n)),i===Ip.Passed&&r>n&&o.push(e.unresolved(r-n))):r!==void 0?o.push(e.reused(r)):n!==void 0&&o.push(e.verified(n)),s!==void 0&&o.push(e.candidates(s));let a=r!==void 0&&r===n;i===Ip.SkippedNoPom?o.push(e.noPomLayer):i===Ip.Passed&&!a?o.push(e.verificationPassed):i===Ip.Failed&&o.push(e.verificationFailed);let c=t.skipped??[];if(c.length>0){let l=d=>{let p=d.member||d.pageObject,f=[d.declinedBy?e.gate[d.declinedBy]:"",d.reason].filter(Boolean).join(" \u2014 ");return f?`${p} (${f})`:p},u=[...c].sort((d,p)=>+(p.declinedBy===pA.DemotedByVerify)-+(d.declinedBy===pA.DemotedByVerify));o.push(e.keptInline(u.map(l).join("; ")))}if(o.length!==0)return`${e.label}: ${o.join(" \xB7 ")}`}function Mnt(t){return(t.testMaintenance??[]).filter(e=>e.action!==mI.Ignore&&e.action!==mI.Verify)}function Mw(t,e={}){let r=ne(),{collapsed:n=!1,userPrompt:s,autoCommit:i=!1,audience:o,primaryRepo:a}=e,c=[],l=Y=>Y&&Y.toLowerCase()!==a?.toLowerCase()?Y:void 0,u=Y=>{let te=l(Y);return te?` \`[${te}]\``:""},d=t.newTestsCreated.some(Y=>l(Y.repository))||t.testResults.some(Y=>l(Y.repository))||t.issuesFound.some(Y=>l(Y.repository))||!!t.additionalRecommendations?.some(Y=>l(Y.repository)),p=o!=="testbot-pr",m=o!=="comment",f=o!=="testbot-pr",h=o!=="testbot-pr",A=o==="testbot-pr";c.push("<!-- skyramp-testbot -->");let E=Mnt(t),y=new Set([Oa.Lint,Oa.Type,Oa.Config]),w=Y=>Y.category!==void 0&&y.has(Y.category),C=t.issuesFound.filter(Y=>!w(Y)),v=t.issuesFound.filter(w),k={critical:0,high:1,medium:2,low:3},N=(Y,te)=>(k[Y.severity??""]??4)-(k[te.severity??""]??4),M=(Y,te)=>(Object.prototype.hasOwnProperty.call(Y,te)?Y[te]:void 0)??te,T=Y=>`- ${Y.severity?`**[${M(r.severityLabels,Y.severity).toUpperCase()}]** `:""}${Y.description}${u(Y.repository)}`;if(t.newTestsCreated.length===0&&t.testResults.length===0&&E.length===0&&t.issuesFound.length>0&&(!t.additionalRecommendations||t.additionalRecommendations.length===0)){c.push(r.minimalReportHeader),c.push("");for(let te of C)c.push(te.description);if(v.length>0){C.length>0&&c.push(""),c.push(`### ${r.configErrorsHeader}`);for(let te of[...v].sort(N))c.push(T(te))}let Y=t.caveats??[];if(Y.length>0){c.push(""),c.push(r.caveatsHeader),c.push("");for(let te of Y)c.push(`- ${te.text}`)}if(t.nextSteps?.length>0){c.push(""),c.push(r.nextStepsHeader),c.push("");for(let te of t.nextSteps)c.push(`- ${te}`)}return Fme(c.join(`
|
|
318
318
|
`))}let U=Y=>Y.replace(/\|/g,"\\|").replace(/\n/g,"<br>");s&&(c.push(r.followingUserInstruction(s)),c.push(""));let J=Y=>{n?(c.push("<details>"),c.push(`<summary>${Y}</summary>`),c.push("")):c.push(`### ${Y}`)},z=()=>{n&&(c.push(""),c.push("</details>")),c.push("")};if(p){let Y=h?"> ":"";for(let te of t.businessCaseAnalysis.split(/\r?\n/))c.push(`${Y}${te}`);c.push("")}if(m&&t.newTestsCreated.length>0){let Y=r.testRecommendationsImplementedHeader(t.newTestsCreated.length);A?c.push(`### ${Y}`):J(Y);for(let te of t.newTestsCreated){let Ae=te.testId?`\`${te.testId}\``:te.testType,pe=te.endpoint?`
|
|
319
319
|
\`${te.endpoint}\``:"",ye=te.description?`
|
|
320
320
|
${te.description}`:"",Je=te.fileName?` (\`${te.fileName}\`)`:"";c.push(`- ${Ae}${Je}${u(te.repository)}${pe}${ye}`)}A?c.push(""):z()}if(m&&t.additionalRecommendations&&t.additionalRecommendations.length>0){let Y=t.additionalRecommendations,te=Y.length,Ae={contract:0,integration:1,e2e:2,ui:3},pe=at=>at.toLowerCase(),ye=[...Y].sort((at,$e)=>Ont(at,$e,Ae,pe)),Je=new Map;for(let at of ye){let $e=pe(at.testType);Je.has($e)||Je.set($e,[]),Je.get($e).push(at)}J(r.additionalRecommendationsHeader(te)),c.push(r.additionalRecommendationsCta),c.push("");for(let[at,$e]of Je){let we=r.testTypeLabels[at]??at;c.push(`**${we}**`),c.push("");for(let Dt of $e){let Or=Dt.steps&&Dt.steps.length>0&&Dt.steps[0].method&&Dt.steps[0].path?`\`${Dt.steps[0].method} ${Dt.steps[0].path}\``:"",jt=`- ${Dt.testId?`\`${Dt.testId}\``:Dt.scenarioName?`\`${Dt.scenarioName}\``:`\`${Dt.testType} test\``}`,he=Or?`
|
|
@@ -554,7 +554,7 @@ ${s}`}var MD=require("child_process");var dx=q(require("fs")),rd=q(require("path
|
|
|
554
554
|
`)}function bhr(t,e,r){let n=r.map(i=>i.details??"").join(`
|
|
555
555
|
`),s=[];return/over the 400 cap/.test(n)&&s.push("The length caps are the ONLY thing wrong with those findings \u2014 keep each one, keep its id, and trim the named field. Do not drop a finding to get under a cap."),/changed file|changedFiles/.test(n)&&s.push('diff.changedFiles must be paths git reports. A glob is accepted for a run of near-identical files (`dir/<star>/x.json`), but it must match them and any "(N files)" count must be right \u2014 so list them plainly if you are unsure.'),/is not in requirements\[\]/.test(n)&&s.push("Every satisfies/conflictsWith id must be one you declared in requirements[] \u2014 check the spelling, don't invent one."),/nothing satisfies or conflictsWith it/.test(n)&&s.push("Every requirements[] entry needs a link: add its id to a behavior's satisfies when the diff implements it correctly, or to a finding's conflictsWith when the diff doesn't (or implements something else)."),s.length?s.join(`
|
|
556
556
|
`):void 0}var $lt=bn({name:"analyze",requires:["preflight"],model:"opus",timeoutMinutes:20,validateInput:phr,prepare:Ult,buildPrompt:yhr,allowedTools:["Read","Grep","Glob","Bash(git diff:*)","Bash(git log:*)","Bash(git show:*)","Bash(git blame:*)","Bash(git status:*)"],selfVerification:['Every finding is behavior a test could catch, and one this change causes \u2014 a pre-existing defect is "latent".',"No two behaviors state the same obligation: if ONE test would pin both, they are one entry. Spend the room on a surface nothing describes yet.","You swept every changed file, not only the biggest one \u2014 a file with a single behavior beside one with a dozen is a sweep that stopped early.","Your final message is one JSON object matching the schema."],buildReadDirs:t=>(t.inputs.relatedRepos??[]).map(e=>e.path),exitGates:[vlt,Rlt],retryHint:bhr,adversarialReview:Tlt,onPassed:(t,e)=>({...Nlt(t,e),diff:Yhe}),salvage:(t,e)=>Llt(t,e,{diff:Yhe})});var Gut=q(require("fs")),fx=q(require("path")),jut=require("child_process");var QD=["browser_assert","browser_assert_api_request","browser_assert_hidden","browser_assert_table_cell","browser_blueprint","browser_click","browser_drag","browser_evaluate","browser_file_upload","browser_gojs_add_node","browser_gojs_link","browser_hover","browser_mouse_action","browser_navigate","browser_navigate_back","browser_press_key","browser_select_option","browser_snapshot","browser_tabs","browser_take_screenshot","browser_type","browser_visual_snapshot","browser_wait_for"],Ehr=[...QD,"skyramp_export_zip","skyramp_actions","skyramp_analyze_changes","skyramp_analyze_test_health","skyramp_batch_mock_generation","skyramp_batch_scenario_test_generation","skyramp_contract_test_generation","skyramp_e2e_test_generation","skyramp_enhance_assertions","skyramp_enrich_test_with_mocks","skyramp_execute_test","skyramp_fix_errors","skyramp_fuzz_test_generation","skyramp_generate_enriched_integration_test","skyramp_init_scan","skyramp_init_workspace","skyramp_integration_test_generation","skyramp_load_test_generation","skyramp_login","skyramp_logout","skyramp_mock_generation","skyramp_modularization","skyramp_one_click_tool","skyramp_preflight_mock_check","skyramp_query_proxy_mocks","skyramp_recommend_tests","skyramp_register_test_plan","skyramp_reuse_code","skyramp_run_existing_tests","skyramp_setup_local_dev_worker","skyramp_smoke_test_generation","skyramp_start_trace_collection","skyramp_stop_trace_collection","skyramp_submit_report","skyramp_ui_test_generation"],Jhe=["skyramp_init_workspace","skyramp_contract_test_generation","skyramp_integration_test_generation","skyramp_mock_generation","skyramp_fix_errors"],Khe=["skyramp_init_workspace","skyramp_ui_test_generation","skyramp_mock_generation","skyramp_fix_errors","skyramp_start_trace_collection","skyramp_stop_trace_collection","skyramp_export_zip",...QD],Xhe=["skyramp_reuse_code","skyramp_modularization","skyramp_enhance_assertions","skyramp_fix_errors","skyramp_execute_test","skyramp_run_existing_tests"],Zhe=["skyramp_init_scan","skyramp_init_workspace"],dV=["Bash(ls:*)","Bash(cat:*)","Bash(head:*)","Bash(tail:*)","Bash(wc:*)","Bash(find:*)","Bash(grep:*)","Bash(rg:*)","Bash(diff:*)","Bash(sort:*)","Bash(env:*)","Bash(echo:*)","Bash(pwd:*)","Bash(which:*)","Bash(cp:*)","Bash(curl:*)","Bash(jq:*)","Bash(true:*)"],whr=t=>`mcp__${yR}__${t}`;function Nm(t){let e=new Set(t);return Ehr.filter(r=>!e.has(r)).map(whr).sort()}var LD=q(require("fs")),nd=q(require("path")),QR=nd.join(".skyramp","sut"),qlt=nd.join(".skyramp","workspace.yml");function xhr(t){return t.startsWith(`${QR}${nd.sep}`)||t.startsWith(".skyramp/sut/")||t===qlt||t===".skyramp/workspace.yml"||/(^|\/)(docker-compose|compose)[^/]*\.ya?ml$/.test(t)||/(^|\/)Dockerfile[^/]*$/.test(t)||/^\.github\/workflows\//.test(t)}function Wa(t,e,r={}){let n=e.split(/[\\/]+/).filter(Boolean),s=t;for(let[i,o]of n.entries()){s=nd.join(s,o);let a=LD.lstatSync(s,{throwIfNoEntry:!1}),c=i===n.length-1;if(!a||a.isSymbolicLink()||(c?r.directory?!a.isDirectory():!a.isFile():!a.isDirectory()))return}return n.length?s:void 0}function Vc(t,e=[]){let r=p=>Wa(t,p),n=r(nd.join(QR,"setup.sh")),s=r(nd.join(QR,"teardown.sh")),i=r(nd.join(QR,"get-auth-token.sh")),o=r(qlt),a,c=r(nd.join(QR,"health.json"));if(c)try{let p=JSON.parse(LD.readFileSync(c,"utf-8"));p&&(p.url||p.command)&&(a=p)}catch{}let l,u=r(nd.join(QR,"deploy-budget.json"));if(u)try{let p=JSON.parse(LD.readFileSync(u,"utf-8"));typeof p?.minutes=="number"&&Number.isFinite(p.minutes)&&p.minutes>0&&(l=p.minutes)}catch{}let d=e.filter(xhr);return{setupScript:n,teardownScript:s,authTokenScript:i,workspaceFile:o,healthHint:a,budgetMinutes:l,present:!!(n||o),staleFiles:d,stale:d.length>0}}var Shr=50,Chr=50,Ihr=4096,vhr=8e3,Rhr=2048,ege=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/,Nhr=/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/ -]{1,255}$/,Thr=/^\.github\/workflows\/[A-Za-z0-9._-]+\.ya?ml$/,khr=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,zlt=(i=>(i.Command="command",i.ComposeFile="compose_file",i.DeploymentWorkflow="deployment_workflow",i.Url="url",i.Guidance="guidance",i))(zlt||{}),Bhr={command:"optional",compose_file:"required",deployment_workflow:"required",url:"none",guidance:"none"},Hlt=t=>b.string().max(t).refine(e=>e.trim().length>0&&!ege.test(e),"must be non-blank text with no control characters other than tab, LF and CR");function Phr(t){let e;try{e=new URL(t)}catch{return"invalid URL"}if(e.protocol!=="https:"&&e.protocol!=="http:")return"only http and https URLs";if(e.username||e.password)return"a URL cannot carry a login"}var _hr={command:Hlt(Ihr),compose_file:b.string().regex(Nhr,"must be a relative path inside the repository"),deployment_workflow:b.string().regex(Thr,"must be a .github/workflows/*.yml path"),url:b.string().max(Rhr).superRefine((t,e)=>{let r=Phr(t);r&&e.addIssue({code:b.ZodIssueCode.custom,message:r})}),guidance:Hlt(vhr)},Dhr=b.object({kind:b.nativeEnum(zlt),value:b.string(),repository:Dc.nullable()}).strict().superRefine((t,e)=>{let r=Bhr[t.kind];r==="required"&&!t.repository&&e.addIssue({code:b.ZodIssueCode.custom,path:["repository"],message:"a file belongs to a repository"}),r==="none"&&t.repository&&e.addIssue({code:b.ZodIssueCode.custom,path:["repository"],message:`a ${t.kind} names no repository`});let n=_hr[t.kind].safeParse(t.value);if(!n.success)for(let s of n.error.issues)e.addIssue({code:b.ZodIssueCode.custom,path:["value"],message:s.message})}),Ohr=b.object({name:b.string().regex(khr,"must be a GitHub Actions secret name (A-Z, 0-9, _; not GITHUB_ or SKYRAMP_RUNNER_)"),purpose:b.nativeEnum(yG),required:b.boolean()}).strict(),Mhr=b.object({knowledge:b.array(Dhr).max(Shr),credentials:b.array(Ohr).max(Chr)}).strict().superRefine((t,e)=>{let r=new Set;t.credentials.forEach((n,s)=>{r.has(n.name)&&e.addIssue({code:b.ZodIssueCode.custom,path:["credentials",s,"name"],message:"named twice"}),r.add(n.name)})});function Qhr(t){return t.map(e=>`$${e.path.map(r=>typeof r=="number"?`[${r}]`:`.${r}`).join("")}: ${e.message}`).join("; ")}function tge(t,e="SUT environment"){let r=Mhr.safeParse(t);if(!r.success)throw new Error(`${e} is not valid SUT / Environment settings \u2014 ${Qhr(r.error.issues)}`);return r.data}function Glt(t,e="SUT environment"){if(!t.trim())return;let r;try{r=JSON.parse(t)}catch(n){throw new Error(`${e} is not JSON: ${n instanceof Error?n.message:String(n)}`)}return tge(r,e)}function pV(t,e=process.env){return(t?.credentials??[]).map(r=>e[r.name]).filter(r=>!!r?.trim())}var Lhr={command:"command",compose_file:"compose file",deployment_workflow:"deployment workflow",url:"URL",guidance:"guidance"},Fhr={model_provider:"model provider",sut_access:"SUT access",skyramp:"Skyramp",other:"other"};function jlt(t,e){let r=t.knowledge.map(n=>{let s=n.repository,i=s?` in ${e(s)??`the Target repository with ${s.provider} id ${s.providerRepositoryId}`}`:"";return`- ${Lhr[n.kind]}${i}: ${n.value.trim().split(/\r?\n/).join(`
|
|
557
|
-
`)}`});if(t.credentials.length>0){let n=t.credentials.map(s=>`${s.name} (${Fhr[s.purpose]}${s.required?"":", optional"})`);r.push(`- Secrets the workflow provides as environment variables: ${n.join(", ")} \u2014 the recipe reads each by exactly that variable name.`)}return r}var LR=q(require("fs")),fV=q(require("path"));function rge(t,e){let{value:r,error:n}=Yr(t);if(n)return{errors:[n]};let s=e&&!e.testEnvironment?Uhr(r,e):r,i=jv(s)&&s.schemaVersion===void 0?{schemaVersion:1,...s}:s,{value:o,errors:a}=Vv(y_,ame,i);return o?{onboard:o,errors:[]}:{errors:a}}function Uhr(t,e){if(!jv(t))return t;let{environment:r,...n}=t,s=[...e.repositorySlug?[{slug:e.repositorySlug,path:e.repositoryPath}]:[],...(e.relatedRepos??[]).map(a=>({slug:a.slug,path:a.path}))],i=a=>typeof a=="string"?s.find(c=>Wa(c.path,a))?.slug:void 0,o=Array.isArray(n.components)?n.components.map(a=>{if(!jv(a))return a;let{deployed:c,...l}=a;if(l.repository!==An)return l;let u=jv(l.from)?l.from.file:void 0,d=i(u)??s[0]?.slug;return d?{...l,repository:d}:l}):n.components;return{...n,components:o}}var mV=".skyramp/sut/health.json",$hr={[mV]:`${mV} (with a url or command)`,".skyramp/workspace.yml":".skyramp/workspace.yml (create it with skyramp_init_scan and skyramp_init_workspace)"};function Vlt(){return{name:"onboard-recipe",verify(t,e){let{onboard:r,errors:n}=rge(e.stdout,t.inputs);if(!r)return ve(this.name,n,{fatal:!0});let s=r.environment!==void 0;if(r.status==="blocked")return{name:this.name,passed:!0};let i=t.inputs.repositoryPath,o=Vc(i),a=s?Pv.filter(u=>Wa(i,u)):[];if(a.length>0)return ve(this.name,[`an answer with "environment" tests a deployment where it runs and never starts or stops it: delete ${a.join(" and ")}, keep the health check, and answer "ready" again`]);let l=(s?dme:ume).filter(u=>!Wa(i,u)).map(u=>$hr[u]??u);return Wa(i,mV)&&!o.healthHint&&l.push(`${mV} (with a url or command)`),o.present&&l.length===0?{name:this.name,passed:!0}:ve(this.name,[`status is "ready" but the recipe deploy replays is incomplete in ${t.inputs.repositoryPath} \u2014 missing (each must be a regular file, not a symlink): ${l.join(", ")}. Write the missing files as the skill specifies and answer "ready" again, or answer "blocked" with the blocker that stopped you.`])}}}function Wlt(t,e,r=process.env){let n=[...t.components.flatMap(s=>s.credentials??[]),...t.environment?.credentials??[]];return[...new Set(n)].filter(s=>e.includes(s)&&!r[s])}function Ylt(t,e){let r=t.components.filter(s=>s.credentials?.some(i=>e.includes(i))).map(s=>s.name),n=e.join(", ");return{component:(r.length>0?r:t.components.map(s=>s.name)).join(", ")||"SUT",problem:`${n} ${e.length===1?"has":"have"} no value in this setup`,evidence:`The workflow supplies ${e.length===1?"it":"each"} from a GitHub Actions secret, which is missing or empty.`,fix:`Set that secret in the workflow host's repository, or choose the secret that supplies ${e.length===1?"it":"each"} under Credentials, then run setup again.`}}function Jlt(){return{name:"deployed-revisions",async verify(t,e,r,n){let s={name:this.name,passed:!0},i=t.checkDeployedRevisions;if(!i)return s;let{onboard:o}=rge(e.stdout,t.inputs);if(!o?.environment||o.status==="blocked")return s;let a=Yw(FD(t.inputs.repositoryPath).recipeFiles);if(!a)return s;let c=o.components.map(({name:d,repository:p})=>({name:d,repository:p})),{blockers:l}=await i(a.content,c,o.environment.credentials);if(l.length===0)return s;let u=l.map(d=>`${d.component}: ${d.problem} (${d.evidence})`).join("; ");return n?.retryLeft?ve(this.name,[`Testbot ran ${Ha} twice, with GH_TOKEN, and it failed the check the setup's plan must pass: ${u}. Your session has no GH_TOKEN, so the part that reads GitHub ran in full only there. Fix the script so each component a repository builds gets the full commit it runs, the same on each run, from its own repository, then answer "ready" again, or answer "blocked" with the blocker that stops you.`]):{...s,details:`${Ha} still fails Testbot's check, so the plan is saved blocked: ${u}`}}}}function qhr(t){try{return new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t)}catch{return}}function FD(t){let e=[],r=o=>{let a;try{a=LR.readdirSync(fV.join(t,o),{withFileTypes:!0})}catch{return}for(let c of a.sort((l,u)=>l.name.localeCompare(u.name))){let l=fV.posix.join(o,c.name);c.isDirectory()&&!c.name.startsWith(".")?r(l):c.isFile()&&e.push(l)}};Wa(t,".skyramp/sut",{directory:!0})&&r(".skyramp/sut"),Wa(t,".skyramp/workspace.yml")&&e.push(".skyramp/workspace.yml");let n=[],s=[],i=0;for(let o of e){let a=Wa(t,o);if(!a)continue;let l=LR.statSync(a).size;if(l>_w){s.push({path:o,reason:`larger than ${_w} bytes`});continue}if(i+l>Dw){s.push({path:o,reason:`recipe text over ${Dw} bytes in total`});continue}let u=qhr(LR.readFileSync(a));if(u===void 0||pG.test(u)){s.push({path:o,reason:"not text"});continue}n.push({path:o,content:u}),i+=l}return{recipeFiles:n,recipeFilesOmitted:s}}function Klt(t,e){let{onboard:r,errors:n}=rge(e.stdout,t.inputs),s=r&&{...r,...FD(t.inputs.repositoryPath)};return tr(t,"onboard",Xr(s,t.secretValues??[]),n)}function hV(t){if(t.state.stages.onboard?.status==="passed")return ae(t,"onboard.json")}var As=q(require("fs")),Tm=q(require("path"));var iut=require("child_process"),out=require("crypto"),co=q(require("fs")),sd=q(require("path"));var Xlt=q(require("fs")),Ay=q(require("path"));var nge={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"},Zlt=t=>nge[t].toLowerCase(),ha=t=>new Map((t??[]).flatMap(e=>e.file?[[Ua(e.key),e.file.name]]:[])),eut=10*1024*1024,px=t=>t?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||t?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",tut=(t,e)=>Ay.join(Ay.dirname(t),`${Ay.basename(t,Ay.extname(t))}${e}`),mx=t=>tut(t,".extracted.txt");function sge(t){try{return/\S/.test(Xlt.readFileSync(mx(t),"utf-8"))}catch{return!1}}var ige=t=>tut(t,".quotes.txt");function rut(t){return px(t.file)?mx(t.path):t.file?.mediaType==="application/pdf"?ige(t.path):t.path}function gV(t){return t.map(e=>e.state!=="read"||!px(e.file)||sge(e.path)?e:{...jA(e),file:e.file,state:"not_read",reason:"cannot_open"})}var Hhr=10*6e4;function aut(t,e){return t.getTime()-e.getTime()-Hhr}var nut="This attempt revoked its scoped GitHub credentials; it mints no more.",zhr=5e3,Ghr=10*6e4,cge=3e4,jhr=3,Vhr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function lge(t=Os()){return t.apiUrl}var ao=class extends Error{constructor(r,n,s){super(r);this.status=n;this.code=s}status;code},FR=class extends Error{};function uge(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 Whr(t,e){if(!Vhr.test(t))throw new Error(`The ${e} "${t}" is not a uuid`);return t}function dge(t,e){return`${t.replace(/\/+$/,"")}/runs/${e}`}function cut(t,e,r){throw e<500&&e!==429?new ao(t,e,r):new FR(t)}async function lut(t,e,r,n){let s=uge(t.origin),i;for(let o=1;o<=jhr;o+=1){o>1&&await new Promise(a=>setTimeout(a,(t.retryDelayMs??2e3)*(o-1)));try{let a=await t.idToken(s),c=await(t.fetch??fetch)(new URL(e,s).toString(),{...r(a),redirect:"error",signal:AbortSignal.timeout(cge)}).catch(l=>{throw new FR(l instanceof Error?l.message:String(l),{cause:l})});return await n(c)}catch(a){if(a instanceof ao)throw a;i=a}}throw i}function uut(t,e,r,n){return lut(t,r,i=>({method:e,headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"application/json"},body:e==="GET"?void 0:JSON.stringify(n)}),async i=>{let o=await i.json().catch(()=>({}));if(i.ok)return o.data;let a=o.error?.fields,c=typeof a?.path=="string"&&typeof a.reason=="string"?` at ${a.path}: ${a.reason}`:"",l=`The Skyramp app refused ${e} ${r}: ${i.status} ${o.error?.code??"no error code"}${c}`;return cut(l,i.status,o.error?.code)})}function Yhr(t,e,r){return lut(t,e,s=>({method:"GET",headers:{Authorization:`Bearer ${s}`,Accept:"application/octet-stream"}}),async s=>{if(!s.ok)return cut(`The Skyramp app refused GET ${e}: ${s.status}`,s.status);let i=Buffer.from(await s.arrayBuffer());if(i.length>r)throw new ao(`The Skyramp app answered GET ${e} with more than ${r} bytes`,s.status);return i})}var oge=class{constructor(e,r,n,s,i,o,a,c){this.attemptId=e;this.attemptNumber=r;this.deadlineAt=n;this.manifest=s;this.deps=i;this.license=o;this.requestedBy=a;this.writeAllowed=c}attemptId;attemptNumber;deadlineAt;manifest;deps;license;requestedBy;writeAllowed;budgetMs(e){return aut(this.deadlineAt,e)}get skyrampRunUrl(){return dge(uge(this.deps.origin),this.manifest.runId)}send(e,r,n){return uut(this.deps,e,r,n)}readBytes(e,r){return Yhr(this.deps,e,r)}issuedTokens=[];closure;modelKey;credentials;revocation;async token(){if(this.revocation)throw new Error(nut);let e=(this.deps.now??(()=>new Date))().getTime(),r=this.credentials,n=r&&await r.catch(()=>{});if(this.credentials!==r)return(await this.credentials).token;if(n&&n.expiresAt-e>=Ghr)return n.token;if(this.revocation)throw new Error(nut);let s=this.send("POST",`/api/v1/runner/attempts/${this.attemptId}/credentials`,{schemaVersion:1}).then(i=>{this.issuedTokens.push(i.token),this.deps.mask?.(i.token),!n&&i.anthropicApiKey&&(this.modelKey=i.anthropicApiKey,this.deps.mask?.(i.anthropicApiKey));let o=n?"Renewed":"Received";return this.deps.log?.(`${o} scoped GitHub credentials; they expire at ${i.expiresAt}.`),{token:i.token,expiresAt:new Date(i.expiresAt).getTime()}},i=>{if(!(i instanceof ao)||i.code!=="CREDENTIALS_UNAVAILABLE")throw i;let o=l=>[...new Set(l.map(u=>u.namespace))].join(", "),a=this.manifest.sources.map(l=>l.repository);if(new Set(a.map(l=>l.providerAccountId)).size>1)throw new ao(`${i.message}. The run's repositories are on more than one GitHub account (${o(a)}), which Skyramp does not support yet.`,i.status,i.code);let c=o([...a,this.manifest.execution.repository]);throw new ao(`${i.message}. Check the Skyramp GitHub App installation on ${c}: it must be installed and not suspended, have access to these repositories, and have accepted the App's current permissions. Each account must also be connected to your Skyramp organization.`,i.status,i.code)});return this.credentials=s,(await s).token}githubFetch(e){return e.fetch??this.deps.fetch??fetch}revokeTokens(e={}){return this.revocation??=this.revokeIssued(e),this.revocation}async revokeIssued(e){let r=[...this.issuedTokens],n=Promise.all(r.map(o=>this.revokeOne(o,e)));await this.credentials?.catch(()=>{});let s=this.issuedTokens.filter(o=>!r.includes(o));return[...await n,...await Promise.all(s.map(o=>this.revokeOne(o,e)))].filter(o=>o!==void 0)}async revokeOne(e,r){try{let n=await this.githubFetch(r)(`${lge(r.host)}/installation/token`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(zhr)});if(!n.ok&&n.status!==401)throw new Error(`GitHub answered ${n.status}`);return}catch(n){return`token ${this.issuedTokens.indexOf(e)+1} of ${this.issuedTokens.length}: ${n instanceof Error?n.message:String(n)}`}}};async function dut(t,e,r){Whr(t,"run id"),uge(r.origin);let n=vnt(t,e),s=Rnt(await uut(r,"POST",`/api/v1/runner/runs/${t}/attempts`,n));if(s.manifest.runId!==t)throw new Error(`The app answered the handshake of run ${t} with the manifest of another run (${s.manifest.runId})`);let i=s.manifest.sources.find(a=>a.repository.provider!==n.execution.provider);if(i)throw new Error(`The manifest of run ${t} names ${i.repository.namespace}/${i.repository.name} on ${i.repository.provider}, but this job runs on ${n.execution.provider}`);s.runToken&&r.mask?.(s.runToken);let o=s.runToken?{entitlements:s.entitlements??[],runToken:s.runToken}:void 0;return new oge(s.attempt.id,s.attempt.number,new Date(s.attempt.deadlineAt),s.manifest,r,o,s.requestedBy??void 0,s.writeAllowed)}var Jhr=6e4;async function put(t){return xnt.parse(await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/heartbeat`,{schemaVersion:1}))}async function mut(t,e=()=>new Date){if(t.closure)return t.closure;let r=await put(t).then(n=>_me(n,e())).catch(()=>null);return r&&(t.closure=r),r}function fut(t,e,r={}){let n=!1,s,i=async()=>{try{let a=_me(await put(t),(r.now??(()=>new Date))());a&&!n&&(n=!0,t.closure=a,e(a))}catch(a){a instanceof ao&&(n=!0)}n||o(r.intervalMs??Jhr)},o=a=>{s=setTimeout(()=>{i()},a),s.unref?.()};return o(0),{stop(){n=!0,clearTimeout(s)}}}var Khr=10*6e4,Xhr=(t,e,r)=>(0,iut.execFileSync)("git",e,{cwd:t,encoding:"utf-8",stdio:["ignore","pipe","pipe"],env:r??process.env,timeout:Khr}).trim(),pge=/^(?!\.\.?$)[A-Za-z0-9._-]{1,100}$/,Zhr=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE"];function egr(t,e=Os()){return`${e.serverUrl}/${t.namespace}/${t.name}.git`}async function hut(t,e){let r=e.git??Xhr,n=e.cloneUrl??(a=>egr(a,e.host)),{sources:s}=t.manifest;for(let a of s){if(Zhr.includes(a.reason)&&!a.change?.base)throw new Error(`${a.repository.namespace}/${a.repository.name} was selected as ${a.reason}, but its change names no base revision to compare it with`);if(a.change?.kind==="pull_request"&&!a.change.base)throw new Error(`${a.repository.namespace}/${a.repository.name} pull request ${a.change.number} names no base revision to compare it with`);for(let c of[a.repository.namespace,a.repository.name])if(!pge.test(c))throw new Error(`"${c}" is not a repository name`)}if(co.existsSync(e.workspace)&&co.lstatSync(e.workspace).isSymbolicLink())throw new Error(`The sources workspace ${e.workspace} is a symlink; refusing to clear it`);co.rmSync(e.workspace,{recursive:!0,force:!0});let i=new Map((t.manifest.baseline.sources??[]).map(a=>[E_(a.repository),a.revision])),o=[];for(let a of s){let{namespace:c,name:l}=a.repository,u=sd.join(e.workspace,c,l);co.mkdirSync(u,{recursive:!0});let d={...process.env,GIT_TERMINAL_PROMPT:"0",...Zme(await t.token())};r(u,["init","-q"]),r(u,["remote","add","origin",n(a.repository)]);let p=a.change?.base??a.compareWith,m=i.get(E_(a.repository)),f=p?.revision??(m!==a.revision?m:void 0);r(u,["fetch","-q","--no-tags","origin",a.revision,...f?[f]:[]],d);let h=p??(a.ref?{ref:a.ref,revision:m??a.revision}:null);h&&(r(u,["update-ref",`refs/remotes/origin/${h.ref}`,h.revision]),r(u,["symbolic-ref","refs/remotes/origin/HEAD",`refs/remotes/origin/${h.ref}`])),a.ref?r(u,["checkout","-q","-B",a.ref,a.revision]):r(u,["checkout","-q","--detach",a.revision]),o.push({repository:a.repository,revision:r(u,["rev-parse","HEAD"]),path:u,slug:`${c}/${l}`})}return o}async function gut(t,e={}){let r=lge(e.host),n=[];for(let s of t.manifest.sources){if(s.change?.kind!=="pull_request")continue;let{namespace:i,name:o}=s.repository,a=`${i}/${o}`,c=s.change.number;try{if(![i,o].every(d=>pge.test(d)))throw new Error("the repository name is not valid");let l=await t.githubFetch(e)(`${r}/repos/${i}/${o}/pulls/${c}`,{headers:{Authorization:`Bearer ${await t.token()}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(cge)});if(!l.ok)throw new Error(`GitHub answered ${l.status}`);let u=await l.json();n.push({repository:a,number:c,...typeof u.title=="string"?{title:u.title}:{},...typeof u.body=="string"?{body:u.body}:{},...typeof u.merged=="boolean"?{merged:u.merged}:{},...u.merged===!0&&typeof u.merge_commit_sha=="string"?{mergeCommit:u.merge_commit_sha}:{},...u.merged===!0&&typeof u.head?.sha=="string"?{mergedHead:u.head.sha}:{}})}catch(l){let u=l instanceof Error?l.message:String(l);n.push({repository:a,number:c,note:`could not be read: ${u}`})}}return n}async function Aut(t,e,r,n={}){let[s,i,...o]=e.split("/");if(o.length||![s,i].every(a=>a!==void 0&&pge.test(a)))return"unknown";try{let a=await t.githubFetch(n)(`${lge(n.host)}/repos/${s}/${i}/commits/${encodeURIComponent(r)}`,{headers:{Authorization:`Bearer ${await t.token()}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(cge)});if(a.status===404||a.status===422)return"missing";if(!a.ok)return"unknown";let c=await a.json();return typeof c.sha=="string"&&c.sha.toLowerCase()===r.toLowerCase()?"found":"missing"}catch{return"unknown"}}function yut(t,e){let r=t.sources.find(s=>s.reason==="TRIGGER"&&s.change?.kind==="pull_request"),n=r&&e.find(s=>s.repository.providerRepositoryId===r.repository.providerRepositoryId);return n&&r.change?{repository:n.slug,path:n.path,number:Number(r.change.number)}:void 0}var tgr=[".skyramp/sut/setup.sh",".skyramp/workspace.yml"];function but(t){let e=t.find(r=>tgr.some(n=>co.existsSync(sd.join(r.path,n))))??t[0];return{repositoryPath:e.path,repositorySlug:e.slug,relatedRepos:t.filter(r=>r!==e).map(r=>({slug:r.slug,path:r.path,writable:!0}))}}var rgr=b.object({tests:b.object({placements:b.array(b.unknown()).optional()}).passthrough().optional()}).passthrough(),ngr=b.object({repository:Dc.passthrough(),testType:b.nativeEnum(qw),directory:b.string()}).passthrough();function Eut(t,e){let r=rgr.safeParse(t.settings.target??{}),n=[];for(let s of(r.success?r.data.tests?.placements:void 0)??[]){let i=ngr.safeParse(s);if(!i.success)continue;let{repository:o,testType:a}=i.data,c=e.find(d=>d.repository.provider===o.provider&&d.repository.providerRepositoryId===o.providerRepositoryId),l=i.data.directory.trim(),u=!l||sd.isAbsolute(l)||l.split(/[\\/]/).includes("..");!c||u||n.push({repository:c.slug,testType:a,directory:l})}return n}var sgr=b.object({report:b.object({language:b.string()}).passthrough()}).passthrough();function mge(t){let e=sgr.safeParse(t?.settings.target);return e.success?gq(e.data.report.language):"en"}var igr=b.object({environment:b.object({components:b.array(b.unknown()).optional(),dependencies:b.array(b.unknown()).optional()}).passthrough()}).passthrough(),ogr=b.object({name:b.string().min(1),provision:b.literal("existing"),url:b.string().min(1),repository:Dc.passthrough().optional(),revisionUrl:b.string().min(1).optional()}).passthrough(),agr=b.object({name:b.string().min(1),url:b.string().nullable(),versionUrl:b.string().nullable(),notes:b.string().nullable()}).passthrough();function wut(t,e){let r=igr.safeParse(t.settings.target),n=r.success?r.data.environment:{},s=(n.components??[]).flatMap(a=>{let c=ogr.safeParse(a);if(!c.success)return[];let{name:l,url:u,repository:d,revisionUrl:p}=c.data;if(!d)return[{name:l,url:u}];let m=e.sources.find(f=>f.repository.provider===d.provider&&f.repository.providerRepositoryId===d.providerRepositoryId);return m?[{name:l,url:u,repository:`${m.repository.namespace}/${m.repository.name}`,expectedRevision:m.revision,...p?{revisionUrl:p}:{}}]:[{name:l,url:u,repository:`${d.provider} repository ${d.providerRepositoryId}`}]}),i=(n.dependencies??[]).flatMap(a=>{let c=agr.safeParse(a);return c.success?[{name:c.data.name,url:c.data.url,versionUrl:c.data.versionUrl,notes:c.data.notes}]:[]});if(s.length===0&&i.length===0)return;let o=b.object({allowSharedEnvironmentMutation:b.boolean()}).passthrough().safeParse(t.settings.policy);return{components:s,dependencies:i,allowMutation:o.success&&o.data.allowSharedEnvironmentMutation}}var cgr=new Set(["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"]);function sut(t,e){if(!cgr.has(t.reason))return{};let r=`${t.repository.namespace}/${t.repository.name}`,n=t.change?.kind==="pull_request"?t.change.number:void 0,s=n===void 0?void 0:e.find(a=>rj(a.repository,r)&&a.number===n),i=s?.merged===!0?s.mergeCommit:void 0,o=i&&s?.mergedHead?{mergedHead:s.mergedHead}:{};return{touched:!0,acceptedRevisions:{frozen:t.revision,...i&&i!==t.revision?{mergeCommit:i,...o}:{}}}}function xut(t,e,r,n,s){let i=u=>r.sources.find(d=>rj(`${d.repository.namespace}/${d.repository.name}`,u)),o=(t?.components??[]).map(u=>{let d=u.expectedRevision?i(u.repository):void 0;return d?{...u,...sut(d,s)}:u}),a=Yw(e.files)!==void 0,c=e.components.map(u=>{if(u.repository===An)return{name:u.name,url:e.address};let d=i(u.repository),p=a?void 0:Sfe(e,u.name);return{name:u.name,url:e.address,repository:u.repository,...d?{expectedRevision:d.revision}:{},...p?{revisionUrl:p}:{},...a?{revisionScript:!0}:{},...d?sut(d,s):{}}}),l=b.object({allowSharedEnvironmentMutation:b.boolean()}).passthrough().safeParse(n?.settings.policy);return{components:[...o,...c],dependencies:t?.dependencies??[],allowMutation:t?.allowMutation??(l.success&&l.data.allowSharedEnvironmentMutation)}}function Sut(t){let e=r=>t.testResults.filter(n=>n.status===r).length;return{passed:e("Pass"),failed:e("Fail"),skipped:e("Skipped")}}function lgr(t){let{passed:e,failed:r,skipped:n}=Sut(t);return e+r===0?{sufficiency:"insufficient",rationale:n>0?`Every test was skipped (${n}), so nothing was validated.`:"No test ran, so nothing was validated.",gaps:["No test ran against the frozen sources."],acceptedEvidence:[],actionRequired:[]}:{sufficiency:"sufficient",rationale:`${e+r} tests ran against the frozen sources: ${e} passed, ${r} failed${n?`, ${n} skipped`:""}.`,gaps:[],acceptedEvidence:[],actionRequired:[]}}function ugr(t,e){let r=t.testResults.map(c=>({result:c,repository:c.repository??e,path:c.fileName||c.testType})),n=new Map;for(let c of r){let l=`${c.repository}:${c.result.testType}:${c.path}`;n.set(l,(n.get(l)??0)+1)}let s=r.map(({result:c,repository:l,path:u})=>{let d=(n.get(`${l}:${c.testType}:${u}`)??0)>1;return c.resultId??xG(l,c.testType,u,d&&c.endpoint||void 0)}),i=new Map;for(let c of s)i.set(c,(i.get(c)??0)+1);let o=new Set(s.filter(c=>i.get(c)===1)),a=r.map(({result:c,repository:l},u)=>{let d=s[u],p=d;if(i.get(d)>1&&o.has(d))for(let m=2;o.has(p)||p===d;m+=1)p=d.includes("#")?`${d}.${m}`:`${d}#${m}`;return o.add(p),{...c,repository:l,resultId:p}});return{...t,testResults:a,...dgr(t,a,e),validation:pgr(t,t.validation??lgr(t)),traceVersion:1}}function dgr(t,e,r){if(!t.testExecutionContexts)return{};let n=new Set,s=a=>{let c=a;for(let l=2;n.has(c);l+=1)c=`${a}#${l}`;return n.add(c),c},i=[],o=new Map;for(let{repository:a,...c}of t.testExecutionContexts){let l=c.status==="not_run"?[]:e.filter(u=>u.fileName===c.test&&u.repository===(a?.trim()||r));l.length||i.push(c);for(let{resultId:u}of l){let d=o.get(u),p=d!==void 0&&i[d].cleanup.status==="failed"?i[d].cleanup:c.cleanup,m={...c,cleanup:p,test:u,resultId:u};d===void 0?o.set(u,i.push(m)-1):i[d]=m}}for(let a of i)a.resultId&&n.add(a.resultId);return{testExecutionContexts:i.map(a=>a.resultId?a:{...a,test:s(a.test.slice(0,512))}).slice(0,5e3)}}function pgr(t,e){let{passed:r,failed:n}=Sut(t);return e.sufficiency!=="sufficient"||r+n>0||e.acceptedEvidence.length>0?e:{...e,sufficiency:"insufficient",gaps:["No test ran and no existing evidence was accepted, so nothing was validated."]}}async function Cut(t,e){let r=ju([...t.issuedTokens,...e.secrets??[]]),n=Tnt({manifest:t.manifest,attemptNumber:t.attemptNumber,checkedOut:e.sources.map(s=>({repository:s.repository,revision:s.revision})),generatedTests:Xr(e.delivery,r),producer:e.producer,report:Xr(ugr(e.report,e.workingSlug),r),githubWrites:e.githubWrites});await t.send("PUT",`/api/v1/runner/attempts/${t.attemptId}/report`,n)}async function fge(t){let e=Ent.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/configuration`,void 0)),r=t.manifest.configuration,{configuration:n,capture:s}=e;if(n.captureId!==r.captureId||n.revision!==r.revision||n.hash!==r.hash||s.hash!==r.hash||Int(s)!==r.hash)throw new Error("The app answered the configuration of another capture than the manifest names");return e}var age=class extends Error{};async function AV(t){let{runtimePlan:e,testEnvironment:r}=wnt.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/runtime-plan`,void 0));if(e&&Snt(e.files)!==e.contentHash)throw new age(`Stored SUT recipe version ${e.version} does not match its hash`);return{runtimePlan:e,testEnvironment:r??null}}async function Iut(t,e,r=()=>{}){try{co.rmSync(e,{recursive:!0,force:!0})}catch{}let n=t.manifest.requirements??[];if(n.length===0&&!t.manifest.instructions)return{items:[],instructions:[]};let s,i=[];try{let a=unt.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/requirements`,void 0));s=new Map(a.items.map(c=>[_c(c),c])),i=t.manifest.instructions?a.instructions??[]:[]}catch(a){let c=a instanceof Error?a.message:String(a);r(`Testbot V3: could not read the run's requirement items: ${c}`),s=new Map}try{co.mkdirSync(e,{recursive:!0,mode:448})}catch{}let o=[];for(let a of n){let c={...jA(a),..."fileName"in a?{file:{name:a.fileName,mediaType:a.mediaType}}:{}},l=s.get(_c(c));if(!l)o.push({...c,state:"not_read",reason:Pw.test(c.key)?"cannot_open":"unavailable"});else if(l.state==="not_read")o.push({...c,state:"not_read",reason:l.reason});else if(!("text"in l))o.push(await mgr(t,e,c,a.contentHash,r));else{let u=sd.join(e,vut(c));try{co.writeFileSync(u,l.text,{mode:384}),o.push({...c,state:"read",path:u,contentMatches:l.contentMatches,version:l.version})}catch(d){r(`Testbot V3: could not write the requirement item ${c.key}: ${d instanceof Error?d.message:String(d)}`),o.push({...c,state:"not_read",reason:"unavailable"})}}}return{items:o,instructions:i}}async function mgr(t,e,r,n,s){let i=c=>(s(`Testbot V3: could not open the uploaded document ${r.key}: ${c}`),{...r,state:"not_read",reason:"cannot_open"});if(!r.file)return i("the manifest names no file");let o;try{let c=int.requirementFile.replace(":attemptId",t.attemptId).replace(":key",r.key);o=await t.readBytes(c,eut)}catch(c){return i(c instanceof Error?c.message:String(c))}if((0,out.createHash)("sha256").update(o).digest("hex")!==n)return i("its bytes do not match its hash");let a=sd.join(e,vut(r));try{co.writeFileSync(a,o,{mode:384})}catch(c){return i(c instanceof Error?c.message:String(c))}return{...r,state:"read",path:a,contentMatches:!0,version:n}}function vut(t){let e=t.source==="other"?[]:[new URL(t.site).hostname],r=t.file?Zlt(t.file.mediaType):"txt";return`${[t.source,...e,t.key].join("-")}.${r}`}async function hge(t,e){await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/progress`,pnt.parse(e))}async function Rut(t,e){return hnt.parse(await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/setup-events`,mnt.parse(e)))}async function Nut(t,e){await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/setup-checkpoint`,Ant.parse(e))}async function Tut(t){return(await But(t,"setup-checkpoint",ynt))?.checkpoint??null}async function kut(t){return(await But(t,"setup-context",bnt))?.context??null}async function But(t,e,r){try{return r.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/${e}`,void 0))}catch(n){if(n instanceof ao&&n.status===404)return null;throw n}}async function gge(t,e){let r=ju([...t.issuedTokens,...e.secrets??[]]),n=knt(t.manifest,t.attemptNumber,e.sources.map(s=>({repository:s.repository,revision:s.revision})),Xr(e.recipe,r),e.producer);await t.send("PUT",`/api/v1/runner/attempts/${t.attemptId}/sut-recipe`,n)}function Put(t,e,r,n=e[0].slug,s,i={}){let{record:o,entries:a}=Dut(t,e,n),c=td({outputsDir:t,state:sV(sd.join(sd.dirname(t),"state.json"))});if(!o&&ij(i,r.system,c?.sutRequired).length>0)return{status:"none"};let l=f=>_ut(e,f),u=[],d=[];for(let{record:f,repository:h,number:A}of a)if(h&&A)u.push({repository:h,number:A});else if(h&&f.prFailure){let E=f.prDetail?`${f.prFailure}: ${f.prDetail}`:f.prFailure;d.push({repository:h,message:E,slug:f.repository??n})}else h&&f.committed&&d.push({repository:h,message:f.reason??"The tests were committed but no pull request was opened.",slug:f.repository??n});let p=new Set([...u,...d].map(({repository:f})=>f.providerRepositoryId)),m=[...new Set(r.newTestsCreated.map(f=>(f.repository??n).toLowerCase()))];for(let f of m){let h=l(f);h&&!p.has(h.providerRepositoryId)&&d.push({repository:h,message:s??"Generated tests were not proposed in a pull request.",slug:f})}return u.length&&d.length?{status:"partial",pullRequests:u,failures:d.map(({repository:f,message:h})=>({repository:f,message:h}))}:u.length?{status:"delivered",pullRequests:u}:d.length?{status:"failed",message:o?.deliveries?d.map(f=>`${f.slug}: ${f.message}`).join("; "):d[0].message}:r.newTestsCreated.length>0?{status:"failed",message:s??"Generated tests were not proposed in a pull request."}:{status:"none"}}function _ut(t,e){let r=t.find(n=>n.slug.toLowerCase()===e.toLowerCase());return r&&{provider:r.repository.provider,providerAccountId:r.repository.providerAccountId,providerRepositoryId:r.repository.providerRepositoryId}}function Dut(t,e,r){let n=sd.join(t,"deliver.json"),s=co.existsSync(n)?JSON.parse(co.readFileSync(n,"utf-8")):void 0,i=s?.deliveries??(s?[s]:[]);return{record:s,entries:i.map(o=>({record:o,repository:_ut(e,o.repository??r),number:/\/pull\/([1-9][0-9]*)$/.exec(o.prUrl??"")?.[1]}))}}function Out(t,e,r=e[0].slug){let n=new Map,s=(i,o)=>{Cme.safeParse(i).success&&n.set(`${i.kind}:${i.repository.providerRepositoryId}:${o}`,i)};for(let{record:i,repository:o,number:a}of Dut(t,e,r).entries){if(!o||!i.branch)continue;let c=i.pushedCommits??(i.pushed&&i.commitSha?[i.commitSha]:[]);for(let u of c)s({kind:"branch_pushed",repository:o,branch:i.branch,commit:u},`${i.branch}:${u}`);if(!a)continue;let l=i.prAction==="retargeted"?i.retargetedAs??"created":i.prAction;l==="created"?s({kind:"pull_request_opened",repository:o,number:a,branch:i.branch},a):(l==="updated"||l==="unchanged")&&s({kind:"pull_request_edited",repository:o,number:a,branch:i.branch},a)}return[...n.values()].slice(0,Sme)}function Mut(t,e){return t.credentials.filter(r=>r.required&&!e[r.name]).map(r=>r.name)}var Age=[/\bgh[pousr]_[A-Za-z0-9]{36,}/g,/\bgithub_pat_[A-Za-z0-9_]{22,}/g,/\bsk-ant-[A-Za-z0-9_-]{20,}/g,/\bsk-[A-Za-z0-9]{32,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g],Qut=t=>Age.some(e=>new RegExp(e.source).test(t));var Ph=".skyramp/setup-events.ndjson",UD=".skyramp/setup-left-out.json",$D=".skyramp/setup-inbox.json",yge=".skyramp/setup-inbox-read.json",wV=".skyramp/setup-hook-ran",fgr=6e4,hgr=5e3,ggr=300,Zs=t=>{let e=typeof t=="string"?t:typeof t=="number"?String(t):"";return e.trim()==="null"?"":e},yV=t=>Array.isArray(t)?t:[],EV=(t,e)=>Object.values(t).find(r=>r===Zs(e).trim().toLowerCase()),Agr={running:"up",healthy:"up",ready:"up",started:"up",building:"starting",pending:"starting",installing:"starting",skipped:"out_of_scope",excluded:"out_of_scope","out-of-scope":"out_of_scope"},ygr=t=>EV(v_,t)??Agr[Zs(t).trim().toLowerCase()]??"found",Lut=t=>b.string().uuid().safeParse(t).success,bgr=t=>CG.test(t)?t:t.replace(/[^A-Za-z0-9_-]+/g,"-").slice(0,64).replace(/^-+|-+$/g,"")||"question",Egr=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,wgr=/github\.com[/:]([^/\s]+)\/([^/\s?#]+?)(?:\.git)?(?:[/?#]|$)/i;function xgr(t){if(t.kind!=="question"||t.placeholder===void 0)return t;let{placeholder:e,...r}=t;return r}var Fut=new RegExp(Bme.source,"g"),xV=class{constructor(e,r,n){this.checkout=e;this.send=r;this.opts=n}checkout;send;opts;offset=0;sequence=1;pending=[];started=!1;closed=!1;capped=!1;flushing=0;emptyRefused=!1;placeholderRefused=!1;unreadSince;saidHookSilent=!1;timer;queue=Promise.resolve();phase="discover";messageIds=new Set;stopHeard=!1;start(){if(!this.timer){if(!this.started){this.started=!0;let e=Tm.join(this.checkout,Ph);As.mkdirSync(Tm.dirname(e),{recursive:!0}),As.writeFileSync(e,"");for(let r of[UD,$D,yge,wV])As.rmSync(Tm.join(this.checkout,r),{force:!0})}this.timer=setInterval(()=>{this.flushing===0&&this.flush()},this.opts.intervalMs??hgr),this.timer.unref?.()}}async stop(){this.timer&&clearInterval(this.timer),this.timer=void 0,await this.flush()}flush(){return this.flushing+=1,this.queue=this.queue.then(()=>this.drain()).catch(e=>this.opts.warn(`Testbot V3: could not send setup events: ${bV(e)}`)).finally(()=>{this.flushing-=1}),this.queue}async drain(){if(!this.closed){if(this.collect(),this.pending.length===0&&!this.emptyRefused){await this.sendBatch([]);return}for(;this.pending.length>0&&!this.closed;){let e=this.pending.slice(0,Qv);if(await this.sendBatch(e)==="unanswered")return;this.pending.splice(0,e.length)}}}async sendBatch(e){this.placeholderRefused&&(e=e.map(xgr));let r;try{r=await this.send({schemaVersion:1,events:e})}catch(n){if(n instanceof ao&&n.code==="RUN_CLOSED")return this.closed=!0,this.pending=[],"done";if(n instanceof ao&&e.length===0)return this.emptyRefused=!0,"done";if(n instanceof ao){if(e.length>1){for(let i of e){if(this.closed)return"done";if(await this.sendBatch([i])==="unanswered")return"unanswered"}return"done"}if(e[0].kind==="question"&&e[0].placeholder!==void 0)return this.placeholderRefused=!0,this.sendBatch(e);let s=e[0].kind==="log"?void 0:Sgr(e[0]);return s?(this.opts.warn(`Testbot V3: the app refused setup event ${e[0].sequence}, so it is sent as a log line: ${n.message}`),this.sendBatch([{sequence:e[0].sequence,at:e[0].at,kind:"log",phase:this.phase,text:s}])):(this.opts.warn(`Testbot V3: the app refused setup event ${e[0].sequence}, so it is dropped: ${n.message}`),"done")}return n instanceof b.ZodError?(this.opts.warn(`Testbot V3: the app's answer to setup events was not understood: ${n.issues[0]?.message}`),"done"):(this.opts.warn(`Testbot V3: could not send setup events, trying again: ${bV(n)}`),"unanswered")}try{this.writeLeftOut(r.leftOut)}catch(n){this.opts.warn(`Testbot V3: could not write ${UD}: ${bV(n)}`)}try{this.writeInbox(r.messages??[])}catch(n){this.opts.warn(`Testbot V3: could not write ${$D}: ${bV(n)}`)}return r.stop&&!this.stopHeard&&(this.stopHeard=!0,this.opts.onStop?.(r.stop.key)),"done"}collect(){if(this.capped)return;let e=Tm.join(this.checkout,Ph),r;try{r=As.statSync(e).size}catch{return}if(r<this.offset&&(this.offset=0),r===this.offset)return;let n=Buffer.alloc(r-this.offset),s=As.openSync(e,"r");try{As.readSync(s,n,0,n.length,this.offset)}finally{As.closeSync(s)}let i=n.lastIndexOf(10);if(i<0)return;let o=n.subarray(0,i).toString("utf-8").split(`
|
|
557
|
+
`)}`});if(t.credentials.length>0){let n=t.credentials.map(s=>`${s.name} (${Fhr[s.purpose]}${s.required?"":", optional"})`);r.push(`- Secrets the workflow provides as environment variables: ${n.join(", ")} \u2014 the recipe reads each by exactly that variable name.`)}return r}var LR=q(require("fs")),fV=q(require("path"));function rge(t,e){let{value:r,error:n}=Yr(t);if(n)return{errors:[n]};let s=e&&!e.testEnvironment?Uhr(r,e):r,i=jv(s)&&s.schemaVersion===void 0?{schemaVersion:1,...s}:s,{value:o,errors:a}=Vv(y_,ame,i);return o?{onboard:o,errors:[]}:{errors:a}}function Uhr(t,e){if(!jv(t))return t;let{environment:r,...n}=t,s=[...e.repositorySlug?[{slug:e.repositorySlug,path:e.repositoryPath}]:[],...(e.relatedRepos??[]).map(a=>({slug:a.slug,path:a.path}))],i=a=>typeof a=="string"?s.find(c=>Wa(c.path,a))?.slug:void 0,o=Array.isArray(n.components)?n.components.map(a=>{if(!jv(a))return a;let{deployed:c,...l}=a;if(l.repository!==An)return l;let u=jv(l.from)?l.from.file:void 0,d=i(u)??s[0]?.slug;return d?{...l,repository:d}:l}):n.components;return{...n,components:o}}var mV=".skyramp/sut/health.json",$hr={[mV]:`${mV} (with a url or command)`,".skyramp/workspace.yml":".skyramp/workspace.yml (create it with skyramp_init_scan and skyramp_init_workspace)"};function Vlt(){return{name:"onboard-recipe",verify(t,e){let{onboard:r,errors:n}=rge(e.stdout,t.inputs);if(!r)return ve(this.name,n,{fatal:!0});let s=r.environment!==void 0;if(r.status==="blocked")return{name:this.name,passed:!0};let i=t.inputs.repositoryPath,o=Vc(i),a=s?Pv.filter(u=>Wa(i,u)):[];if(a.length>0)return ve(this.name,[`an answer with "environment" tests a deployment where it runs and never starts or stops it: delete ${a.join(" and ")}, keep the health check, and answer "ready" again`]);let l=(s?dme:ume).filter(u=>!Wa(i,u)).map(u=>$hr[u]??u);return Wa(i,mV)&&!o.healthHint&&l.push(`${mV} (with a url or command)`),o.present&&l.length===0?{name:this.name,passed:!0}:ve(this.name,[`status is "ready" but the recipe deploy replays is incomplete in ${t.inputs.repositoryPath} \u2014 missing (each must be a regular file, not a symlink): ${l.join(", ")}. Write the missing files as the skill specifies and answer "ready" again, or answer "blocked" with the blocker that stopped you.`])}}}function Wlt(t,e,r=process.env){let n=[...t.components.flatMap(s=>s.credentials??[]),...t.environment?.credentials??[]];return[...new Set(n)].filter(s=>e.includes(s)&&!r[s])}function Ylt(t,e){let r=t.components.filter(s=>s.credentials?.some(i=>e.includes(i))).map(s=>s.name),n=e.join(", ");return{component:(r.length>0?r:t.components.map(s=>s.name)).join(", ")||"SUT",problem:`${n} ${e.length===1?"has":"have"} no value in this setup`,evidence:`The workflow supplies ${e.length===1?"it":"each"} from a GitHub Actions secret, which is missing or empty.`,fix:`Set that secret in the workflow host's repository, or choose the secret that supplies ${e.length===1?"it":"each"} under Credentials, then run setup again.`}}function Jlt(){return{name:"deployed-revisions",async verify(t,e,r,n){let s={name:this.name,passed:!0},i=t.checkDeployedRevisions;if(!i)return s;let{onboard:o}=rge(e.stdout,t.inputs);if(!o?.environment||o.status==="blocked")return s;let a=Yw(FD(t.inputs.repositoryPath).recipeFiles);if(!a)return s;let c=o.components.map(({name:d,repository:p})=>({name:d,repository:p})),{blockers:l}=await i(a.content,c,o.environment.credentials);if(l.length===0)return s;let u=l.map(d=>`${d.component}: ${d.problem} (${d.evidence})`).join("; ");return n?.retryLeft?ve(this.name,[`Testbot ran ${Ha} twice, with GH_TOKEN, and it failed the check the setup's plan must pass: ${u}. Your session has no GH_TOKEN, so the part that reads GitHub ran in full only there. Fix the script so each component a repository builds gets the full commit it runs, the same on each run, from its own repository, then answer "ready" again, or answer "blocked" with the blocker that stops you.`]):{...s,details:`${Ha} still fails Testbot's check, so the plan is saved blocked: ${u}`}}}}function qhr(t){try{return new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t)}catch{return}}function FD(t){let e=[],r=o=>{let a;try{a=LR.readdirSync(fV.join(t,o),{withFileTypes:!0})}catch{return}for(let c of a.sort((l,u)=>l.name.localeCompare(u.name))){let l=fV.posix.join(o,c.name);c.isDirectory()&&!c.name.startsWith(".")?r(l):c.isFile()&&e.push(l)}};Wa(t,".skyramp/sut",{directory:!0})&&r(".skyramp/sut"),Wa(t,".skyramp/workspace.yml")&&e.push(".skyramp/workspace.yml");let n=[],s=[],i=0;for(let o of e){let a=Wa(t,o);if(!a)continue;let l=LR.statSync(a).size;if(l>_w){s.push({path:o,reason:`larger than ${_w} bytes`});continue}if(i+l>Dw){s.push({path:o,reason:`recipe text over ${Dw} bytes in total`});continue}let u=qhr(LR.readFileSync(a));if(u===void 0||pG.test(u)){s.push({path:o,reason:"not text"});continue}n.push({path:o,content:u}),i+=l}return{recipeFiles:n,recipeFilesOmitted:s}}function Klt(t,e){let{onboard:r,errors:n}=rge(e.stdout,t.inputs),s=r&&{...r,...FD(t.inputs.repositoryPath)};return tr(t,"onboard",Xr(s,t.secretValues??[]),n)}function hV(t){if(t.state.stages.onboard?.status==="passed")return ae(t,"onboard.json")}var As=q(require("fs")),Tm=q(require("path"));var iut=require("child_process"),out=require("crypto"),co=q(require("fs")),sd=q(require("path"));var Xlt=q(require("fs")),Ay=q(require("path"));var nge={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"},Zlt=t=>nge[t].toLowerCase(),ha=t=>new Map((t??[]).flatMap(e=>e.file?[[Ua(e.key),e.file.name]]:[])),eut=10*1024*1024,px=t=>t?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||t?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",tut=(t,e)=>Ay.join(Ay.dirname(t),`${Ay.basename(t,Ay.extname(t))}${e}`),mx=t=>tut(t,".extracted.txt");function sge(t){try{return/\S/.test(Xlt.readFileSync(mx(t),"utf-8"))}catch{return!1}}var ige=t=>tut(t,".quotes.txt");function rut(t){return px(t.file)?mx(t.path):t.file?.mediaType==="application/pdf"?ige(t.path):t.path}function gV(t){return t.map(e=>e.state!=="read"||!px(e.file)||sge(e.path)?e:{...jA(e),file:e.file,state:"not_read",reason:"cannot_open"})}var Hhr=10*6e4;function aut(t,e){return t.getTime()-e.getTime()-Hhr}var nut="This attempt revoked its scoped GitHub credentials; it mints no more.",zhr=5e3,Ghr=10*6e4,cge=3e4,jhr=3,Vhr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function lge(t=Os()){return t.apiUrl}var ao=class extends Error{constructor(r,n,s){super(r);this.status=n;this.code=s}status;code},FR=class extends Error{};function uge(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 Whr(t,e){if(!Vhr.test(t))throw new Error(`The ${e} "${t}" is not a uuid`);return t}function dge(t,e){return`${t.replace(/\/+$/,"")}/runs/${e}`}function cut(t,e,r){throw e<500&&e!==429?new ao(t,e,r):new FR(t)}async function lut(t,e,r,n){let s=uge(t.origin),i;for(let o=1;o<=jhr;o+=1){o>1&&await new Promise(a=>setTimeout(a,(t.retryDelayMs??2e3)*(o-1)));try{let a=await t.idToken(s),c=await(t.fetch??fetch)(new URL(e,s).toString(),{...r(a),redirect:"error",signal:AbortSignal.timeout(cge)}).catch(l=>{throw new FR(l instanceof Error?l.message:String(l),{cause:l})});return await n(c)}catch(a){if(a instanceof ao)throw a;i=a}}throw i}function uut(t,e,r,n){return lut(t,r,i=>({method:e,headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"application/json"},body:e==="GET"?void 0:JSON.stringify(n)}),async i=>{let o=await i.json().catch(()=>({}));if(i.ok)return o.data;let a=o.error?.fields,c=typeof a?.path=="string"&&typeof a.reason=="string"?` at ${a.path}: ${a.reason}`:"",l=`The Skyramp app refused ${e} ${r}: ${i.status} ${o.error?.code??"no error code"}${c}`;return cut(l,i.status,o.error?.code)})}function Yhr(t,e,r){return lut(t,e,s=>({method:"GET",headers:{Authorization:`Bearer ${s}`,Accept:"application/octet-stream"}}),async s=>{if(!s.ok)return cut(`The Skyramp app refused GET ${e}: ${s.status}`,s.status);let i=Buffer.from(await s.arrayBuffer());if(i.length>r)throw new ao(`The Skyramp app answered GET ${e} with more than ${r} bytes`,s.status);return i})}var oge=class{constructor(e,r,n,s,i,o,a,c,l){this.attemptId=e;this.attemptNumber=r;this.deadlineAt=n;this.manifest=s;this.deps=i;this.license=o;this.requestedBy=a;this.writeAllowed=c;this.claudeCodeVersion=l}attemptId;attemptNumber;deadlineAt;manifest;deps;license;requestedBy;writeAllowed;claudeCodeVersion;budgetMs(e){return aut(this.deadlineAt,e)}get skyrampRunUrl(){return dge(uge(this.deps.origin),this.manifest.runId)}send(e,r,n){return uut(this.deps,e,r,n)}readBytes(e,r){return Yhr(this.deps,e,r)}issuedTokens=[];closure;modelKey;credentials;revocation;async token(){if(this.revocation)throw new Error(nut);let e=(this.deps.now??(()=>new Date))().getTime(),r=this.credentials,n=r&&await r.catch(()=>{});if(this.credentials!==r)return(await this.credentials).token;if(n&&n.expiresAt-e>=Ghr)return n.token;if(this.revocation)throw new Error(nut);let s=this.send("POST",`/api/v1/runner/attempts/${this.attemptId}/credentials`,{schemaVersion:1}).then(i=>{this.issuedTokens.push(i.token),this.deps.mask?.(i.token),!n&&i.anthropicApiKey&&(this.modelKey=i.anthropicApiKey,this.deps.mask?.(i.anthropicApiKey));let o=n?"Renewed":"Received";return this.deps.log?.(`${o} scoped GitHub credentials; they expire at ${i.expiresAt}.`),{token:i.token,expiresAt:new Date(i.expiresAt).getTime()}},i=>{if(!(i instanceof ao)||i.code!=="CREDENTIALS_UNAVAILABLE")throw i;let o=l=>[...new Set(l.map(u=>u.namespace))].join(", "),a=this.manifest.sources.map(l=>l.repository);if(new Set(a.map(l=>l.providerAccountId)).size>1)throw new ao(`${i.message}. The run's repositories are on more than one GitHub account (${o(a)}), which Skyramp does not support yet.`,i.status,i.code);let c=o([...a,this.manifest.execution.repository]);throw new ao(`${i.message}. Check the Skyramp GitHub App installation on ${c}: it must be installed and not suspended, have access to these repositories, and have accepted the App's current permissions. Each account must also be connected to your Skyramp organization.`,i.status,i.code)});return this.credentials=s,(await s).token}githubFetch(e){return e.fetch??this.deps.fetch??fetch}revokeTokens(e={}){return this.revocation??=this.revokeIssued(e),this.revocation}async revokeIssued(e){let r=[...this.issuedTokens],n=Promise.all(r.map(o=>this.revokeOne(o,e)));await this.credentials?.catch(()=>{});let s=this.issuedTokens.filter(o=>!r.includes(o));return[...await n,...await Promise.all(s.map(o=>this.revokeOne(o,e)))].filter(o=>o!==void 0)}async revokeOne(e,r){try{let n=await this.githubFetch(r)(`${lge(r.host)}/installation/token`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(zhr)});if(!n.ok&&n.status!==401)throw new Error(`GitHub answered ${n.status}`);return}catch(n){return`token ${this.issuedTokens.indexOf(e)+1} of ${this.issuedTokens.length}: ${n instanceof Error?n.message:String(n)}`}}};async function dut(t,e,r){Whr(t,"run id"),uge(r.origin);let n=vnt(t,e),s=Rnt(await uut(r,"POST",`/api/v1/runner/runs/${t}/attempts`,n));if(s.manifest.runId!==t)throw new Error(`The app answered the handshake of run ${t} with the manifest of another run (${s.manifest.runId})`);let i=s.manifest.sources.find(a=>a.repository.provider!==n.execution.provider);if(i)throw new Error(`The manifest of run ${t} names ${i.repository.namespace}/${i.repository.name} on ${i.repository.provider}, but this job runs on ${n.execution.provider}`);s.runToken&&r.mask?.(s.runToken);let o=s.runToken?{entitlements:s.entitlements??[],runToken:s.runToken}:void 0;return new oge(s.attempt.id,s.attempt.number,new Date(s.attempt.deadlineAt),s.manifest,r,o,s.requestedBy??void 0,s.writeAllowed,s.claudeCodeVersion??void 0)}var Jhr=6e4;async function put(t){return xnt.parse(await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/heartbeat`,{schemaVersion:1}))}async function mut(t,e=()=>new Date){if(t.closure)return t.closure;let r=await put(t).then(n=>_me(n,e())).catch(()=>null);return r&&(t.closure=r),r}function fut(t,e,r={}){let n=!1,s,i=async()=>{try{let a=_me(await put(t),(r.now??(()=>new Date))());a&&!n&&(n=!0,t.closure=a,e(a))}catch(a){a instanceof ao&&(n=!0)}n||o(r.intervalMs??Jhr)},o=a=>{s=setTimeout(()=>{i()},a),s.unref?.()};return o(0),{stop(){n=!0,clearTimeout(s)}}}var Khr=10*6e4,Xhr=(t,e,r)=>(0,iut.execFileSync)("git",e,{cwd:t,encoding:"utf-8",stdio:["ignore","pipe","pipe"],env:r??process.env,timeout:Khr}).trim(),pge=/^(?!\.\.?$)[A-Za-z0-9._-]{1,100}$/,Zhr=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE"];function egr(t,e=Os()){return`${e.serverUrl}/${t.namespace}/${t.name}.git`}async function hut(t,e){let r=e.git??Xhr,n=e.cloneUrl??(a=>egr(a,e.host)),{sources:s}=t.manifest;for(let a of s){if(Zhr.includes(a.reason)&&!a.change?.base)throw new Error(`${a.repository.namespace}/${a.repository.name} was selected as ${a.reason}, but its change names no base revision to compare it with`);if(a.change?.kind==="pull_request"&&!a.change.base)throw new Error(`${a.repository.namespace}/${a.repository.name} pull request ${a.change.number} names no base revision to compare it with`);for(let c of[a.repository.namespace,a.repository.name])if(!pge.test(c))throw new Error(`"${c}" is not a repository name`)}if(co.existsSync(e.workspace)&&co.lstatSync(e.workspace).isSymbolicLink())throw new Error(`The sources workspace ${e.workspace} is a symlink; refusing to clear it`);co.rmSync(e.workspace,{recursive:!0,force:!0});let i=new Map((t.manifest.baseline.sources??[]).map(a=>[E_(a.repository),a.revision])),o=[];for(let a of s){let{namespace:c,name:l}=a.repository,u=sd.join(e.workspace,c,l);co.mkdirSync(u,{recursive:!0});let d={...process.env,GIT_TERMINAL_PROMPT:"0",...Zme(await t.token())};r(u,["init","-q"]),r(u,["remote","add","origin",n(a.repository)]);let p=a.change?.base??a.compareWith,m=i.get(E_(a.repository)),f=p?.revision??(m!==a.revision?m:void 0);r(u,["fetch","-q","--no-tags","origin",a.revision,...f?[f]:[]],d);let h=p??(a.ref?{ref:a.ref,revision:m??a.revision}:null);h&&(r(u,["update-ref",`refs/remotes/origin/${h.ref}`,h.revision]),r(u,["symbolic-ref","refs/remotes/origin/HEAD",`refs/remotes/origin/${h.ref}`])),a.ref?r(u,["checkout","-q","-B",a.ref,a.revision]):r(u,["checkout","-q","--detach",a.revision]),o.push({repository:a.repository,revision:r(u,["rev-parse","HEAD"]),path:u,slug:`${c}/${l}`})}return o}async function gut(t,e={}){let r=lge(e.host),n=[];for(let s of t.manifest.sources){if(s.change?.kind!=="pull_request")continue;let{namespace:i,name:o}=s.repository,a=`${i}/${o}`,c=s.change.number;try{if(![i,o].every(d=>pge.test(d)))throw new Error("the repository name is not valid");let l=await t.githubFetch(e)(`${r}/repos/${i}/${o}/pulls/${c}`,{headers:{Authorization:`Bearer ${await t.token()}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(cge)});if(!l.ok)throw new Error(`GitHub answered ${l.status}`);let u=await l.json();n.push({repository:a,number:c,...typeof u.title=="string"?{title:u.title}:{},...typeof u.body=="string"?{body:u.body}:{},...typeof u.merged=="boolean"?{merged:u.merged}:{},...u.merged===!0&&typeof u.merge_commit_sha=="string"?{mergeCommit:u.merge_commit_sha}:{},...u.merged===!0&&typeof u.head?.sha=="string"?{mergedHead:u.head.sha}:{}})}catch(l){let u=l instanceof Error?l.message:String(l);n.push({repository:a,number:c,note:`could not be read: ${u}`})}}return n}async function Aut(t,e,r,n={}){let[s,i,...o]=e.split("/");if(o.length||![s,i].every(a=>a!==void 0&&pge.test(a)))return"unknown";try{let a=await t.githubFetch(n)(`${lge(n.host)}/repos/${s}/${i}/commits/${encodeURIComponent(r)}`,{headers:{Authorization:`Bearer ${await t.token()}`,Accept:"application/vnd.github+json"},redirect:"error",signal:AbortSignal.timeout(cge)});if(a.status===404||a.status===422)return"missing";if(!a.ok)return"unknown";let c=await a.json();return typeof c.sha=="string"&&c.sha.toLowerCase()===r.toLowerCase()?"found":"missing"}catch{return"unknown"}}function yut(t,e){let r=t.sources.find(s=>s.reason==="TRIGGER"&&s.change?.kind==="pull_request"),n=r&&e.find(s=>s.repository.providerRepositoryId===r.repository.providerRepositoryId);return n&&r.change?{repository:n.slug,path:n.path,number:Number(r.change.number)}:void 0}var tgr=[".skyramp/sut/setup.sh",".skyramp/workspace.yml"];function but(t){let e=t.find(r=>tgr.some(n=>co.existsSync(sd.join(r.path,n))))??t[0];return{repositoryPath:e.path,repositorySlug:e.slug,relatedRepos:t.filter(r=>r!==e).map(r=>({slug:r.slug,path:r.path,writable:!0}))}}var rgr=b.object({tests:b.object({placements:b.array(b.unknown()).optional()}).passthrough().optional()}).passthrough(),ngr=b.object({repository:Dc.passthrough(),testType:b.nativeEnum(qw),directory:b.string()}).passthrough();function Eut(t,e){let r=rgr.safeParse(t.settings.target??{}),n=[];for(let s of(r.success?r.data.tests?.placements:void 0)??[]){let i=ngr.safeParse(s);if(!i.success)continue;let{repository:o,testType:a}=i.data,c=e.find(d=>d.repository.provider===o.provider&&d.repository.providerRepositoryId===o.providerRepositoryId),l=i.data.directory.trim(),u=!l||sd.isAbsolute(l)||l.split(/[\\/]/).includes("..");!c||u||n.push({repository:c.slug,testType:a,directory:l})}return n}var sgr=b.object({report:b.object({language:b.string()}).passthrough()}).passthrough();function mge(t){let e=sgr.safeParse(t?.settings.target);return e.success?gq(e.data.report.language):"en"}var igr=b.object({environment:b.object({components:b.array(b.unknown()).optional(),dependencies:b.array(b.unknown()).optional()}).passthrough()}).passthrough(),ogr=b.object({name:b.string().min(1),provision:b.literal("existing"),url:b.string().min(1),repository:Dc.passthrough().optional(),revisionUrl:b.string().min(1).optional()}).passthrough(),agr=b.object({name:b.string().min(1),url:b.string().nullable(),versionUrl:b.string().nullable(),notes:b.string().nullable()}).passthrough();function wut(t,e){let r=igr.safeParse(t.settings.target),n=r.success?r.data.environment:{},s=(n.components??[]).flatMap(a=>{let c=ogr.safeParse(a);if(!c.success)return[];let{name:l,url:u,repository:d,revisionUrl:p}=c.data;if(!d)return[{name:l,url:u}];let m=e.sources.find(f=>f.repository.provider===d.provider&&f.repository.providerRepositoryId===d.providerRepositoryId);return m?[{name:l,url:u,repository:`${m.repository.namespace}/${m.repository.name}`,expectedRevision:m.revision,...p?{revisionUrl:p}:{}}]:[{name:l,url:u,repository:`${d.provider} repository ${d.providerRepositoryId}`}]}),i=(n.dependencies??[]).flatMap(a=>{let c=agr.safeParse(a);return c.success?[{name:c.data.name,url:c.data.url,versionUrl:c.data.versionUrl,notes:c.data.notes}]:[]});if(s.length===0&&i.length===0)return;let o=b.object({allowSharedEnvironmentMutation:b.boolean()}).passthrough().safeParse(t.settings.policy);return{components:s,dependencies:i,allowMutation:o.success&&o.data.allowSharedEnvironmentMutation}}var cgr=new Set(["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"]);function sut(t,e){if(!cgr.has(t.reason))return{};let r=`${t.repository.namespace}/${t.repository.name}`,n=t.change?.kind==="pull_request"?t.change.number:void 0,s=n===void 0?void 0:e.find(a=>rj(a.repository,r)&&a.number===n),i=s?.merged===!0?s.mergeCommit:void 0,o=i&&s?.mergedHead?{mergedHead:s.mergedHead}:{};return{touched:!0,acceptedRevisions:{frozen:t.revision,...i&&i!==t.revision?{mergeCommit:i,...o}:{}}}}function xut(t,e,r,n,s){let i=u=>r.sources.find(d=>rj(`${d.repository.namespace}/${d.repository.name}`,u)),o=(t?.components??[]).map(u=>{let d=u.expectedRevision?i(u.repository):void 0;return d?{...u,...sut(d,s)}:u}),a=Yw(e.files)!==void 0,c=e.components.map(u=>{if(u.repository===An)return{name:u.name,url:e.address};let d=i(u.repository),p=a?void 0:Sfe(e,u.name);return{name:u.name,url:e.address,repository:u.repository,...d?{expectedRevision:d.revision}:{},...p?{revisionUrl:p}:{},...a?{revisionScript:!0}:{},...d?sut(d,s):{}}}),l=b.object({allowSharedEnvironmentMutation:b.boolean()}).passthrough().safeParse(n?.settings.policy);return{components:[...o,...c],dependencies:t?.dependencies??[],allowMutation:t?.allowMutation??(l.success&&l.data.allowSharedEnvironmentMutation)}}function Sut(t){let e=r=>t.testResults.filter(n=>n.status===r).length;return{passed:e("Pass"),failed:e("Fail"),skipped:e("Skipped")}}function lgr(t){let{passed:e,failed:r,skipped:n}=Sut(t);return e+r===0?{sufficiency:"insufficient",rationale:n>0?`Every test was skipped (${n}), so nothing was validated.`:"No test ran, so nothing was validated.",gaps:["No test ran against the frozen sources."],acceptedEvidence:[],actionRequired:[]}:{sufficiency:"sufficient",rationale:`${e+r} tests ran against the frozen sources: ${e} passed, ${r} failed${n?`, ${n} skipped`:""}.`,gaps:[],acceptedEvidence:[],actionRequired:[]}}function ugr(t,e){let r=t.testResults.map(c=>({result:c,repository:c.repository??e,path:c.fileName||c.testType})),n=new Map;for(let c of r){let l=`${c.repository}:${c.result.testType}:${c.path}`;n.set(l,(n.get(l)??0)+1)}let s=r.map(({result:c,repository:l,path:u})=>{let d=(n.get(`${l}:${c.testType}:${u}`)??0)>1;return c.resultId??xG(l,c.testType,u,d&&c.endpoint||void 0)}),i=new Map;for(let c of s)i.set(c,(i.get(c)??0)+1);let o=new Set(s.filter(c=>i.get(c)===1)),a=r.map(({result:c,repository:l},u)=>{let d=s[u],p=d;if(i.get(d)>1&&o.has(d))for(let m=2;o.has(p)||p===d;m+=1)p=d.includes("#")?`${d}.${m}`:`${d}#${m}`;return o.add(p),{...c,repository:l,resultId:p}});return{...t,testResults:a,...dgr(t,a,e),validation:pgr(t,t.validation??lgr(t)),traceVersion:1}}function dgr(t,e,r){if(!t.testExecutionContexts)return{};let n=new Set,s=a=>{let c=a;for(let l=2;n.has(c);l+=1)c=`${a}#${l}`;return n.add(c),c},i=[],o=new Map;for(let{repository:a,...c}of t.testExecutionContexts){let l=c.status==="not_run"?[]:e.filter(u=>u.fileName===c.test&&u.repository===(a?.trim()||r));l.length||i.push(c);for(let{resultId:u}of l){let d=o.get(u),p=d!==void 0&&i[d].cleanup.status==="failed"?i[d].cleanup:c.cleanup,m={...c,cleanup:p,test:u,resultId:u};d===void 0?o.set(u,i.push(m)-1):i[d]=m}}for(let a of i)a.resultId&&n.add(a.resultId);return{testExecutionContexts:i.map(a=>a.resultId?a:{...a,test:s(a.test.slice(0,512))}).slice(0,5e3)}}function pgr(t,e){let{passed:r,failed:n}=Sut(t);return e.sufficiency!=="sufficient"||r+n>0||e.acceptedEvidence.length>0?e:{...e,sufficiency:"insufficient",gaps:["No test ran and no existing evidence was accepted, so nothing was validated."]}}async function Cut(t,e){let r=ju([...t.issuedTokens,...e.secrets??[]]),n=Tnt({manifest:t.manifest,attemptNumber:t.attemptNumber,checkedOut:e.sources.map(s=>({repository:s.repository,revision:s.revision})),generatedTests:Xr(e.delivery,r),producer:e.producer,report:Xr(ugr(e.report,e.workingSlug),r),githubWrites:e.githubWrites});await t.send("PUT",`/api/v1/runner/attempts/${t.attemptId}/report`,n)}async function fge(t){let e=Ent.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/configuration`,void 0)),r=t.manifest.configuration,{configuration:n,capture:s}=e;if(n.captureId!==r.captureId||n.revision!==r.revision||n.hash!==r.hash||s.hash!==r.hash||Int(s)!==r.hash)throw new Error("The app answered the configuration of another capture than the manifest names");return e}var age=class extends Error{};async function AV(t){let{runtimePlan:e,testEnvironment:r}=wnt.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/runtime-plan`,void 0));if(e&&Snt(e.files)!==e.contentHash)throw new age(`Stored SUT recipe version ${e.version} does not match its hash`);return{runtimePlan:e,testEnvironment:r??null}}async function Iut(t,e,r=()=>{}){try{co.rmSync(e,{recursive:!0,force:!0})}catch{}let n=t.manifest.requirements??[];if(n.length===0&&!t.manifest.instructions)return{items:[],instructions:[]};let s,i=[];try{let a=unt.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/requirements`,void 0));s=new Map(a.items.map(c=>[_c(c),c])),i=t.manifest.instructions?a.instructions??[]:[]}catch(a){let c=a instanceof Error?a.message:String(a);r(`Testbot V3: could not read the run's requirement items: ${c}`),s=new Map}try{co.mkdirSync(e,{recursive:!0,mode:448})}catch{}let o=[];for(let a of n){let c={...jA(a),..."fileName"in a?{file:{name:a.fileName,mediaType:a.mediaType}}:{}},l=s.get(_c(c));if(!l)o.push({...c,state:"not_read",reason:Pw.test(c.key)?"cannot_open":"unavailable"});else if(l.state==="not_read")o.push({...c,state:"not_read",reason:l.reason});else if(!("text"in l))o.push(await mgr(t,e,c,a.contentHash,r));else{let u=sd.join(e,vut(c));try{co.writeFileSync(u,l.text,{mode:384}),o.push({...c,state:"read",path:u,contentMatches:l.contentMatches,version:l.version})}catch(d){r(`Testbot V3: could not write the requirement item ${c.key}: ${d instanceof Error?d.message:String(d)}`),o.push({...c,state:"not_read",reason:"unavailable"})}}}return{items:o,instructions:i}}async function mgr(t,e,r,n,s){let i=c=>(s(`Testbot V3: could not open the uploaded document ${r.key}: ${c}`),{...r,state:"not_read",reason:"cannot_open"});if(!r.file)return i("the manifest names no file");let o;try{let c=int.requirementFile.replace(":attemptId",t.attemptId).replace(":key",r.key);o=await t.readBytes(c,eut)}catch(c){return i(c instanceof Error?c.message:String(c))}if((0,out.createHash)("sha256").update(o).digest("hex")!==n)return i("its bytes do not match its hash");let a=sd.join(e,vut(r));try{co.writeFileSync(a,o,{mode:384})}catch(c){return i(c instanceof Error?c.message:String(c))}return{...r,state:"read",path:a,contentMatches:!0,version:n}}function vut(t){let e=t.source==="other"?[]:[new URL(t.site).hostname],r=t.file?Zlt(t.file.mediaType):"txt";return`${[t.source,...e,t.key].join("-")}.${r}`}async function hge(t,e){await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/progress`,pnt.parse(e))}async function Rut(t,e){return hnt.parse(await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/setup-events`,mnt.parse(e)))}async function Nut(t,e){await t.send("POST",`/api/v1/runner/attempts/${t.attemptId}/setup-checkpoint`,Ant.parse(e))}async function Tut(t){return(await But(t,"setup-checkpoint",ynt))?.checkpoint??null}async function kut(t){return(await But(t,"setup-context",bnt))?.context??null}async function But(t,e,r){try{return r.parse(await t.send("GET",`/api/v1/runner/attempts/${t.attemptId}/${e}`,void 0))}catch(n){if(n instanceof ao&&n.status===404)return null;throw n}}async function gge(t,e){let r=ju([...t.issuedTokens,...e.secrets??[]]),n=knt(t.manifest,t.attemptNumber,e.sources.map(s=>({repository:s.repository,revision:s.revision})),Xr(e.recipe,r),e.producer);await t.send("PUT",`/api/v1/runner/attempts/${t.attemptId}/sut-recipe`,n)}function Put(t,e,r,n=e[0].slug,s,i={}){let{record:o,entries:a}=Dut(t,e,n),c=td({outputsDir:t,state:sV(sd.join(sd.dirname(t),"state.json"))});if(!o&&ij(i,r.system,c?.sutRequired).length>0)return{status:"none"};let l=f=>_ut(e,f),u=[],d=[];for(let{record:f,repository:h,number:A}of a)if(h&&A)u.push({repository:h,number:A});else if(h&&f.prFailure){let E=f.prDetail?`${f.prFailure}: ${f.prDetail}`:f.prFailure;d.push({repository:h,message:E,slug:f.repository??n})}else h&&f.committed&&d.push({repository:h,message:f.reason??"The tests were committed but no pull request was opened.",slug:f.repository??n});let p=new Set([...u,...d].map(({repository:f})=>f.providerRepositoryId)),m=[...new Set(r.newTestsCreated.map(f=>(f.repository??n).toLowerCase()))];for(let f of m){let h=l(f);h&&!p.has(h.providerRepositoryId)&&d.push({repository:h,message:s??"Generated tests were not proposed in a pull request.",slug:f})}return u.length&&d.length?{status:"partial",pullRequests:u,failures:d.map(({repository:f,message:h})=>({repository:f,message:h}))}:u.length?{status:"delivered",pullRequests:u}:d.length?{status:"failed",message:o?.deliveries?d.map(f=>`${f.slug}: ${f.message}`).join("; "):d[0].message}:r.newTestsCreated.length>0?{status:"failed",message:s??"Generated tests were not proposed in a pull request."}:{status:"none"}}function _ut(t,e){let r=t.find(n=>n.slug.toLowerCase()===e.toLowerCase());return r&&{provider:r.repository.provider,providerAccountId:r.repository.providerAccountId,providerRepositoryId:r.repository.providerRepositoryId}}function Dut(t,e,r){let n=sd.join(t,"deliver.json"),s=co.existsSync(n)?JSON.parse(co.readFileSync(n,"utf-8")):void 0,i=s?.deliveries??(s?[s]:[]);return{record:s,entries:i.map(o=>({record:o,repository:_ut(e,o.repository??r),number:/\/pull\/([1-9][0-9]*)$/.exec(o.prUrl??"")?.[1]}))}}function Out(t,e,r=e[0].slug){let n=new Map,s=(i,o)=>{Cme.safeParse(i).success&&n.set(`${i.kind}:${i.repository.providerRepositoryId}:${o}`,i)};for(let{record:i,repository:o,number:a}of Dut(t,e,r).entries){if(!o||!i.branch)continue;let c=i.pushedCommits??(i.pushed&&i.commitSha?[i.commitSha]:[]);for(let u of c)s({kind:"branch_pushed",repository:o,branch:i.branch,commit:u},`${i.branch}:${u}`);if(!a)continue;let l=i.prAction==="retargeted"?i.retargetedAs??"created":i.prAction;l==="created"?s({kind:"pull_request_opened",repository:o,number:a,branch:i.branch},a):(l==="updated"||l==="unchanged")&&s({kind:"pull_request_edited",repository:o,number:a,branch:i.branch},a)}return[...n.values()].slice(0,Sme)}function Mut(t,e){return t.credentials.filter(r=>r.required&&!e[r.name]).map(r=>r.name)}var Age=[/\bgh[pousr]_[A-Za-z0-9]{36,}/g,/\bgithub_pat_[A-Za-z0-9_]{22,}/g,/\bsk-ant-[A-Za-z0-9_-]{20,}/g,/\bsk-[A-Za-z0-9]{32,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g],Qut=t=>Age.some(e=>new RegExp(e.source).test(t));var Ph=".skyramp/setup-events.ndjson",UD=".skyramp/setup-left-out.json",$D=".skyramp/setup-inbox.json",yge=".skyramp/setup-inbox-read.json",wV=".skyramp/setup-hook-ran",fgr=6e4,hgr=5e3,ggr=300,Zs=t=>{let e=typeof t=="string"?t:typeof t=="number"?String(t):"";return e.trim()==="null"?"":e},yV=t=>Array.isArray(t)?t:[],EV=(t,e)=>Object.values(t).find(r=>r===Zs(e).trim().toLowerCase()),Agr={running:"up",healthy:"up",ready:"up",started:"up",building:"starting",pending:"starting",installing:"starting",skipped:"out_of_scope",excluded:"out_of_scope","out-of-scope":"out_of_scope"},ygr=t=>EV(v_,t)??Agr[Zs(t).trim().toLowerCase()]??"found",Lut=t=>b.string().uuid().safeParse(t).success,bgr=t=>CG.test(t)?t:t.replace(/[^A-Za-z0-9_-]+/g,"-").slice(0,64).replace(/^-+|-+$/g,"")||"question",Egr=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,wgr=/github\.com[/:]([^/\s]+)\/([^/\s?#]+?)(?:\.git)?(?:[/?#]|$)/i;function xgr(t){if(t.kind!=="question"||t.placeholder===void 0)return t;let{placeholder:e,...r}=t;return r}var Fut=new RegExp(Bme.source,"g"),xV=class{constructor(e,r,n){this.checkout=e;this.send=r;this.opts=n}checkout;send;opts;offset=0;sequence=1;pending=[];started=!1;closed=!1;capped=!1;flushing=0;emptyRefused=!1;placeholderRefused=!1;unreadSince;saidHookSilent=!1;timer;queue=Promise.resolve();phase="discover";messageIds=new Set;stopHeard=!1;start(){if(!this.timer){if(!this.started){this.started=!0;let e=Tm.join(this.checkout,Ph);As.mkdirSync(Tm.dirname(e),{recursive:!0}),As.writeFileSync(e,"");for(let r of[UD,$D,yge,wV])As.rmSync(Tm.join(this.checkout,r),{force:!0})}this.timer=setInterval(()=>{this.flushing===0&&this.flush()},this.opts.intervalMs??hgr),this.timer.unref?.()}}async stop(){this.timer&&clearInterval(this.timer),this.timer=void 0,await this.flush()}flush(){return this.flushing+=1,this.queue=this.queue.then(()=>this.drain()).catch(e=>this.opts.warn(`Testbot V3: could not send setup events: ${bV(e)}`)).finally(()=>{this.flushing-=1}),this.queue}async drain(){if(!this.closed){if(this.collect(),this.pending.length===0&&!this.emptyRefused){await this.sendBatch([]);return}for(;this.pending.length>0&&!this.closed;){let e=this.pending.slice(0,Qv);if(await this.sendBatch(e)==="unanswered")return;this.pending.splice(0,e.length)}}}async sendBatch(e){this.placeholderRefused&&(e=e.map(xgr));let r;try{r=await this.send({schemaVersion:1,events:e})}catch(n){if(n instanceof ao&&n.code==="RUN_CLOSED")return this.closed=!0,this.pending=[],"done";if(n instanceof ao&&e.length===0)return this.emptyRefused=!0,"done";if(n instanceof ao){if(e.length>1){for(let i of e){if(this.closed)return"done";if(await this.sendBatch([i])==="unanswered")return"unanswered"}return"done"}if(e[0].kind==="question"&&e[0].placeholder!==void 0)return this.placeholderRefused=!0,this.sendBatch(e);let s=e[0].kind==="log"?void 0:Sgr(e[0]);return s?(this.opts.warn(`Testbot V3: the app refused setup event ${e[0].sequence}, so it is sent as a log line: ${n.message}`),this.sendBatch([{sequence:e[0].sequence,at:e[0].at,kind:"log",phase:this.phase,text:s}])):(this.opts.warn(`Testbot V3: the app refused setup event ${e[0].sequence}, so it is dropped: ${n.message}`),"done")}return n instanceof b.ZodError?(this.opts.warn(`Testbot V3: the app's answer to setup events was not understood: ${n.issues[0]?.message}`),"done"):(this.opts.warn(`Testbot V3: could not send setup events, trying again: ${bV(n)}`),"unanswered")}try{this.writeLeftOut(r.leftOut)}catch(n){this.opts.warn(`Testbot V3: could not write ${UD}: ${bV(n)}`)}try{this.writeInbox(r.messages??[])}catch(n){this.opts.warn(`Testbot V3: could not write ${$D}: ${bV(n)}`)}return r.stop&&!this.stopHeard&&(this.stopHeard=!0,this.opts.onStop?.(r.stop.key)),"done"}collect(){if(this.capped)return;let e=Tm.join(this.checkout,Ph),r;try{r=As.statSync(e).size}catch{return}if(r<this.offset&&(this.offset=0),r===this.offset)return;let n=Buffer.alloc(r-this.offset),s=As.openSync(e,"r");try{As.readSync(s,n,0,n.length,this.offset)}finally{As.closeSync(s)}let i=n.lastIndexOf(10);if(i<0)return;let o=n.subarray(0,i).toString("utf-8").split(`
|
|
558
558
|
`);this.offset+=i+1;for(let a of o){if(a.trim()==="")continue;if(this.sequence>SG){this.opts.warn(`Testbot V3: the setup sent ${SG} events, the most a run may; the rest are not sent.`),this.capped=!0;return}let c=this.toEvent(a);c&&(this.pending.push(c),this.sequence+=1)}}toEvent(e){let r;try{r=JSON.parse(e)}catch{r=void 0}let n=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:void 0,s=this.opts.secrets(),i=(m,f=1/0)=>Age.reduce((A,E)=>A.replace(E,F_),Dr(m,s)).replace(Fut," ").trim().slice(0,f).replace(Fut," ").trim(),o=m=>i(i(m).replace(/\s+/g," "),ggr),a={sequence:this.sequence,at:(this.opts.now?.()??new Date).toISOString()};if(!n)return this.asLog(a,o(e),"a setup event line that is not one JSON event");let c=this.putRight(n,a,i,o),l=c?Pme.safeParse(c):void 0;if(l?.success)return l.data.kind==="log"&&(this.phase=l.data.phase),l.data;let u=l&&!l.success?` (${l.error.issues[0]?.path.join(".")}: ${l.error.issues[0]?.message})`:"",d=yV(n.names).map(Zs).filter(Boolean),p=o(Zs(n.text)||[Zs(n.name),Zs(n.status)].filter(Boolean).join(": ")||(d.length?`Needs credentials: ${d.join(", ")}`:""))||o(e);return this.asLog(a,p,`a setup event the app would refuse${u}`)}putRight(e,r,n,s){let i=EV(bme,e.kind);if(i==="log")return{...r,kind:i,phase:EV(Ov,e.phase)??this.phase,text:s(Zs(e.text))};if(i==="component"){let o=n(Zs(e.file),Tme)||null,a=n(Zs(e.version),Nme);return{...r,kind:i,name:n(Zs(e.name),w_),repository:this.repositoryOf(n(Zs(e.repository)),o),file:o,status:ygr(e.status),...a&&{version:a}}}if(i==="reply")return{...r,kind:i,to:this.messageIdOf(Zs(e.to).trim()),accepted:e.accepted!==!1,text:s(Zs(e.text))};if(i==="question"){let o=[...new Set(yV(e.choices).map(d=>n(n(Zs(d)).replace(/\s+/g," "),vme)).filter(Boolean))].slice(0,Ime),a=EV(wG,e.type)??"free_text";o.length===0&&(a="free_text");let c=Zs(e.text);a==="free_text"&&o.length>0&&([c,o]=[`${c} (${o.join(", ")})`,[]]);let l=Zs(e.id).trim(),u=n(Zs(e.placeholder)).replace(/\s+/g," ");return{...r,kind:i,id:bgr(l),type:a,text:s(c),component:n(Zs(e.component),w_)||null,choices:o,...u&&u.length<=Rme&&{placeholder:u}}}if(i==="credentials"){let o=[...new Set(yV(e.names).map(a=>Zs(a).trim().toUpperCase()).filter(a=>WA.test(a)))].slice(0,kme);return{...r,kind:i,names:o}}if(i==="delivered")return{...r,kind:i,ids:[...new Set(yV(e.ids).map(o=>this.messageIdOf(Zs(o).trim())).filter(Lut))]}}repositoryOf(e,r){let n=this.opts.repositories??[],s=c=>n.find(l=>l.slug.toLowerCase()===c.toLowerCase())?.slug;if(Egr.test(e)){let c=s(e);if(c||n.length===0)return c??e}if(e===An&&this.opts.shared)return An;let i=wgr.exec(e);if(i){let c=`${i[1]}/${i[2]}`,l=s(c);if(l||n.length===0)return l??c}let o=n.find(c=>c.slug.split("/").pop()?.toLowerCase()===e.toLowerCase());if(o)return o.slug;let a=r?n.find(c=>As.existsSync(Tm.join(c.path,r))):void 0;return a?a.slug:this.opts.shared?An:n[0]?.slug??e}messageIdOf(e){if(Lut(e))return e;let r=[...this.messageIds],n=e?r.filter(s=>s.startsWith(e.toLowerCase())||e.toLowerCase().includes(s)):[];return n.length===1?n[0]:r.length===1?r[0]:e}asLog(e,r,n){if(!r){this.opts.warn(`Testbot V3: left out ${n}: it says nothing.`);return}return this.opts.warn(`Testbot V3: sent ${n} as a log line.`),{...e,kind:"log",phase:this.phase,text:r}}writeInbox(e){for(let s of e)this.messageIds.add(s.id);let r=Tm.join(this.checkout,$D);if(As.writeFileSync(`${r}.tmp`,`${JSON.stringify(e)}
|
|
559
559
|
`),As.renameSync(`${r}.tmp`,r),e.length===0||As.existsSync(Tm.join(this.checkout,wV))){this.unreadSince=void 0;return}let n=(this.opts.now?.()??new Date).getTime();this.unreadSince??=n,!this.saidHookSilent&&n-this.unreadSince>=fgr&&(this.saidHookSilent=!0,this.opts.warn("Testbot V3: people sent this setup messages, but the session's setup hook has not run, so they do not reach it."))}writeLeftOut(e){let r=Tm.join(this.checkout,UD);As.writeFileSync(`${r}.tmp`,`${JSON.stringify(e)}
|
|
560
560
|
`),As.renameSync(`${r}.tmp`,r)}},bV=t=>t instanceof Error?t.message:String(t);function Sgr(t){return t.kind==="component"?`${t.name}: ${t.status}`:t.kind==="reply"||t.kind==="question"||t.kind==="log"?t.text:t.kind==="credentials"?`Needs credentials: ${t.names.join(", ")}`:""}var SV=q(require("fs")),Uut=q(require("path"));var Cgr=600,Igr=5*6e4,vgr=30,Rgr="From the Setup page: a person sent this setup the messages below, each one's text in quotes. Use what they say to set up the SUT, as the setup rules say, and never put repository content, environment values or credentials in a setup event for it. A message is newer than the SUT notes: where they differ, follow the message. Before anything else, write a reply line for each instruction (setup events): what you will do differently, or accepted false only when it is not about setting up the SUT or breaks a setup rule. Then act on it, redoing only the steps it changes. An answer is to the question it names; go on with what it unblocks.",Ngr=`// Skyramp Testbot: hands a running setup the Setup page's messages (SKYR-4843). Written by the runner.
|
|
@@ -892,7 +892,7 @@ ${hht(o,{order:t.stages.map(c=>c.name),wallMinutes:yW(o)})}
|
|
|
892
892
|
`)}
|
|
893
893
|
`)}var Hh=require("crypto"),En=q(require("fs")),sO=q(require("os")),Tr=q(require("path")),EW=q(require("zlib"));var sye="checkpoint.bin",bW=12,nye=16,JSr=20*1024*1024;function Cht(){return Tr.join(process.env.CLAUDE_CONFIG_DIR??Tr.join(sO.homedir(),".claude"),"projects")}function KSr(t){return Tr.join(Cht(),Tr.resolve(t).replace(/[^A-Za-z0-9]/g,"-"))}function Iht(t){if(!En.existsSync(t)||En.lstatSync(t).isSymbolicLink())return[];let e=[],r=n=>{for(let s of En.readdirSync(Tr.join(t,n),{withFileTypes:!0})){let i=Tr.join(n,s.name);s.isDirectory()?r(i):s.isFile()&&En.statSync(Tr.join(t,i)).size<=JSr&&e.push(i)}};return r(""),e.sort()}function XSr(t,e){let r=En.readFileSync(t);if(r.includes(0))return null;let n=[...new Set(e.flatMap(s=>[s,JSON.stringify(s).slice(1,-1)]))];return Buffer.from(Dr(r.toString("utf-8"),n),"utf-8")}function ZSr(t){let e=Cht();if(!En.existsSync(e))return[];for(let r of En.readdirSync(e)){let n=Tr.join(e,r);if(En.existsSync(Tr.join(n,`${t}.jsonl`)))return[{dir:n,rel:`${t}.jsonl`},...Iht(Tr.join(n,t)).map(s=>({dir:n,rel:Tr.join(t,s)}))]}return[]}function eCr(t,e){let r=(0,Hh.randomBytes)(bW),n=(0,Hh.createCipheriv)("aes-256-gcm",Buffer.from(e,"base64"),r);return Buffer.concat([r,n.update(t),n.final(),n.getAuthTag()])}function tCr(t,e){if(t.length<=bW+nye)throw new Error("the checkpoint is too short to be one");let r=(0,Hh.createDecipheriv)("aes-256-gcm",Buffer.from(e,"base64"),t.subarray(0,bW));return r.setAuthTag(t.subarray(t.length-nye)),Buffer.concat([r.update(t.subarray(bW,t.length-nye)),r.final()])}async function vht(t){let e=ZSr(t.sessionId);if(e.length===0)throw new Error(`onboard's session ${t.sessionId} left no transcript to save`);let r=(a,c)=>{let l=XSr(a,t.secrets);return l?[{...c,content:l.toString("base64")}]:[]},n=[...e.flatMap(({dir:a,rel:c})=>r(Tr.join(a,c),{root:"session",path:c})),...t.checkouts.flatMap(a=>Iht(Tr.join(a.path,".skyramp")).flatMap(c=>r(Tr.join(a.path,".skyramp",c),{root:"checkout",repository:a.slug,path:Tr.join(".skyramp",c)})))],s={schemaVersion:1,sessionId:t.sessionId,files:n},i=eCr(EW.gzipSync(Buffer.from(JSON.stringify(s),"utf-8")),t.key);if(i.length>IG)throw new Error(`the checkpoint is ${i.length} bytes, over the ${IG} a setup may save`);let o=En.mkdtempSync(Tr.join(sO.tmpdir(),"skyramp-checkpoint-"));try{En.writeFileSync(Tr.join(o,sye),i);let a=await t.artifacts.uploadArtifact(t.name,[Tr.join(o,sye)],o,{retentionDays:R_});if(!a.id)throw new Error("GitHub created no artifact for the checkpoint");let c=new Date(t.now.getTime()+R_*864e5-36e5).toISOString();return{schemaVersion:1,sessionId:t.sessionId,bytes:i.length,contentHash:(0,Hh.createHash)("sha256").update(i).digest("hex"),artifact:{id:String(a.id),name:t.name,providerRunId:t.providerRunId,expiresAt:c}}}finally{En.rmSync(o,{recursive:!0,force:!0})}}function rCr(t,e){let r=Tr.resolve(t),n=Tr.resolve(r,e);if(Tr.isAbsolute(e)||!n.startsWith(r+Tr.sep))throw new Error(`the checkpoint names a path outside its place: ${e}`);let s=r;for(let i of Tr.relative(r,n).split(Tr.sep))if(s=Tr.join(s,i),En.lstatSync(s,{throwIfNoEntry:!1})?.isSymbolicLink())throw new Error(`the checkpoint would write through a symlink: ${e}`);return n}async function Rht(t){let{checkpoint:e}=t,r=En.mkdtempSync(Tr.join(sO.tmpdir(),"skyramp-checkpoint-"));try{let n=await t.artifacts.downloadArtifact(Number(e.artifact.id),{path:r,findBy:{token:t.token,workflowRunId:Number(e.artifact.providerRunId),repositoryOwner:e.repository.namespace,repositoryName:e.repository.name}}),s=En.readFileSync(Tr.join(n.downloadPath??r,sye));if((0,Hh.createHash)("sha256").update(s).digest("hex")!==e.contentHash)throw new Error("the checkpoint does not match the hash Skyramp recorded");let i=JSON.parse(EW.gunzipSync(tCr(s,e.key)).toString("utf-8"));if(i.schemaVersion!==1||i.sessionId!==e.sessionId)throw new Error("the checkpoint is not of the session Skyramp recorded");let o=KSr(t.cwd),a=new Map(t.checkouts.map(c=>[c.slug,c.path]));for(let c of i.files){let l=c.root==="session"?o:a.get(c.repository??"");if(!l)continue;let u=rCr(l,c.path);En.mkdirSync(Tr.dirname(u),{recursive:!0}),En.writeFileSync(u,Buffer.from(c.content,"base64"))}return{sessionId:i.sessionId}}finally{En.rmSync(r,{recursive:!0,force:!0})}}var nCr="https://testbot.skyramp.dev",zh={attemptId:"v3AttemptId",origin:"v3Origin",deadlineAt:"v3DeadlineAt",reportUploaded:"v3ReportUploaded",recipeUploaded:"v3RecipeUploaded",cause:"v3Cause"},sCr="skyramp-sources",xW=()=>su.join(Bl(),"requirements");function iCr(t,e){return{origin:t,idToken:e,mask:r=>Ot(r),log:r=>ee(r)}}function iu(t){dN(zh.attemptId)&&!dN(zh.cause)&&jn(zh.cause,t)}function Cx(){iu("setup_failed")}function Pht(){iu("timed_out")}var iye={cancelled:"Skyramp cancelled this run",expired:"this attempt passed its deadline in Skyramp",ended:"Skyramp already ended this attempt"},_ht={cancelled:"attempt-cancelled",expired:"attempt-closed",ended:"attempt-closed"},Dht={cancelled:"cancelled",expired:"timed_out",ended:"agent_failed"};function Oht(t,e){return _ht[e]==="attempt-cancelled"?` View in Skyramp: ${t.attempt.skyrampRunUrl}`:""}function Mht(t){return e=>(t.requestStop=r=>{t.stopKey||(t.stopKey=r,ee("Testbot V3: a person stopped this setup to resume it later; stopping onboard to save where it is."),e("setup-stopped","a person stopped this setup to resume it later"))},fut(t.attempt,r=>{iu(Dht[r]),X(`Testbot V3: ${iye[r]}; stopping the run, and uploading nothing.${Oht(t,r)}`),e(_ht[r],iye[r])}))}async function oye(t){let e=await mut(t.attempt);return e?(iu(Dht[e]),X(`Testbot V3: ${iye[e]}, so nothing is uploaded.${Oht(t,e)}`),!0):!1}function Ix(t){return[...t.attempt.manifest.credentials.map(e=>process.env[e.name]??""),t.attempt.license?.runToken??"",t.attempt.modelKey??"",...t.heldInputs??[]].filter(Boolean)}var Qht={analyze:"analyze",triage:"analyze",recommend:"recommend",generate:"generate","generate-ui":"generate","generate-unit":"generate",adapt:"generate",write:"generate",onboard:"execute",deploy:"execute","native-run":"execute",deliver:"deliver"},oCr={analyze:"change analysis",recommend:"test recommendations",generate:"test generation",execute:"test execution",deliver:"opening a pull request with the tests"};function aCr(t){return t.change?.kind==="pull_request"&&t.ref===`pull/${t.change.number}/head`}function Lht(t,e){let r={};for(let[n,s]of Object.entries(Qht))t&&!t.includes(s)&&(r[n]=`your Skyramp plan does not include ${oCr[s]}`);return!r.deliver&&e.some(aCr)&&(r.deliver="the pull request comes from a fork, so Testbot opens no pull request with the tests"),!t||t.includes("generate")?{withheld:r}:{stages:["analyze","recommend"],planOnly:!0,withheld:r}}function Fht(t,e){for(let r of Object.keys(Qht))r!=="analyze"&&r!=="triage"&&r!=="recommend"&&(t[r]??=e);return{stages:["analyze","recommend"],planOnly:!0,withheld:t}}function Uht(t){if(t!==!0)return t===!1?"The person this run acts for cannot push to every repository of this run, so Testbot only recommends tests":"Testbot could not confirm that the person this run acts for can push to every repository of this run, so it only recommends tests"}async function SW(t){t.cancelWatch?.stop();let e=await t.attempt.revokeTokens();for(let r of e)X(`Testbot V3: could not revoke a scoped GitHub token (${r}); it stays valid until it expires.`)}function cCr(t){let e=["SIGINT","SIGTERM"],r=()=>{n(),SW({attempt:t})},n=()=>{for(let s of e)process.removeListener(s,r)};for(let s of e)process.on(s,r);return{stop:n}}function aye(){return qe("skyrampAppOrigin").trim()||nCr}async function $ht(t,e){let r=Os(),n=r.takeIdToken(),s=aye(),i=await dut(t,r,iCr(s,n)),o=cCr(i);jn(zh.attemptId,i.attemptId),jn(zh.origin,s),jn(zh.deadlineAt,i.deadlineAt.toISOString());let a=Sy({attempt:i})?"Setup Run":"Validation Run";ee(`Testbot V3: attempt ${i.attemptNumber} of ${a} ${t}, deadline ${i.deadlineAt.toISOString()}`);try{return{...await lCr(i,e),cancelWatch:o}}catch(c){throw await SW({attempt:i,cancelWatch:o}),Xa.rmSync(xW(),{recursive:!0,force:!0}),c}}async function lCr(t,e){await uCr(t,e);let r=Mut(t.manifest,process.env);if(r.length>0)throw iu("credential_missing"),new Error(`The workflow does not supply the required credential${r.length>1?"s":""} ${r.join(", ")}. Add ${r.length>1?"them":"it"} to the Testbot step's env.`);let n;try{n=await hut(t,{workspace:su.join(Os().workspace||process.cwd(),sCr)})}catch(A){throw iu("checkout_failed"),A}for(let A of n)ee(`Testbot V3: ${A.slug} at ${A.revision}`);let s=await pCr({attempt:t,sources:n}),i=Sy({attempt:t})?await mCr({attempt:t,sources:n}):void 0,o=but(n);ee(`Testbot V3: working checkout ${o.repositorySlug}`);let a=yut(t.manifest,n);a&&ee(`Testbot V3: the pull request is ${a.repository}#${a.number}`);let c=await gut(t);for(let A of c)ee([`Testbot V3: Change Set ${A.repository}#${A.number}`,A.note].filter(Boolean).join(": "));let{items:l,instructions:u}=await Iut(t,xW(),A=>X(A));for(let A of l){let E=A.state==="read"?"read":`not read (${A.reason})`;ee(`Testbot V3: requirement ${A.key} ${E}`)}u.length&&ee(`Testbot V3: Instructions: ${u.length}`);let d=Sy({attempt:t})?void 0:await dCr({attempt:t});uB(mge(d));let p=d?Eut(d,n):[];for(let A of p)ee(`Testbot V3: ${A.testType} tests in ${A.repository} go in ${A.directory}`);let m=d&&wut(d,t.manifest),f=s?xut(m,s,t.manifest,d,c):m;for(let A of f?.components??[])ee(`Testbot V3: shared component ${A.name} at ${A.url}${A.repository?`, running ${A.repository}`:""}`);let h=_lt(t.manifest,d?.settings??null);return h&&ee(h.confirmedRunId?`Testbot V3: scheduled validation of the delta since Confirmed Baseline run ${h.confirmedRunId}`:"Testbot V3: scheduled validation, first qualification: no Confirmed Baseline yet"),{attempt:t,sources:n,layout:o,pullRequests:c,pullRequest:a,testPlacements:p,...f?{sharedEnvironment:f}:{},scheduledValidation:h,...s?{testEnvironment:s}:{},...l.length?{requirementItems:l}:{},...u.length?{instructions:u}:{},...i?{recheck:i}:{}}}async function uCr(t,e){if(e.useBedrock)return;if(!e.anthropicApiKey&&!process.env.ANTHROPIC_API_KEY)try{await t.token()}catch(n){throw Cx(),n}let r=e.anthropicApiKey||process.env.ANTHROPIC_API_KEY||t.modelKey;r&&(e.anthropicApiKey=r,process.env.ANTHROPIC_API_KEY=r)}async function dCr(t){try{return(await fge(t.attempt)).capture}catch(e){if(!(e instanceof ao&&e.status===404))throw Cx(),e;X(`Testbot V3: this Skyramp app does not serve the run's configuration (${e.message}); each test goes where its repository's convention puts it, and no shared environment is verified.`);return}}async function pCr(t){for(let e of t.sources)rye(e.path);return Sy(t)?void 0:hCr(t)}async function mCr(t){try{let{runtimePlan:e}=await AV(t.attempt);if(!e?.recipe)return;let r=mG.parse(e.recipe);return r.status!=="ready"?void 0:(nO(t.sources[0].path,e.files),ee(`Testbot V3: rechecking SUT recipe version ${e.version} with the credentials as they are now; deploying it again.`),{version:e.version,recipe:r})}catch(e){X(`Testbot V3: could not read the recipe to recheck, so this setup sets up from nothing: ${e instanceof Error?e.message:String(e)}`);return}}async function qht(t){try{let{runtimePlan:e}=await AV(t.attempt);return!e||e.recipe?void 0:(nO(t.sources[0].path,e.files),ee(`Testbot V3: starting from SUT recipe version ${e.version}, a ready recipe of this Target.`),{version:e.version})}catch(e){X(`Testbot V3: could not read the recipe to start from, so this setup starts from nothing: ${e instanceof Error?e.message:String(e)}`);return}}function Hht(t){return({stage:e,event:r,status:n})=>{if(e!=="deploy")return;let s=r==="finished",i=n==="aborted"?"skipped":n;hge(t.attempt,{schemaVersion:1,stage:"recheck",event:s?"finished":"started",...s&&i?{status:i}:{}}).catch(o=>X(`Testbot V3: could not report the recheck ${r}: ${o instanceof Error?o.message:String(o)}`))}}async function zht(t,e,r){let n=t.recheck,s=e.outputsDir?t0(su.join(e.outputsDir,"deploy.json")):void 0,i=s&&(s.outcome==="clean"||s.outcome==="recipe-drift");if(e.aborted||e.timedOut){iu(e.aborted?"cancelled":"timed_out");return}if(await oye(t))return;let o=Jrt(n.recipe),a=FD(t.layout.repositoryPath),c=i?Wlt(o,t.attempt.manifest.credentials.map(m=>m.name)):[],l=i&&o.environment&&c.length===0?await Yht(t,o,a):void 0,d=(e.stateFilePath?t0(e.stateFilePath):void 0)?.stages.deploy?.attempts?.reduce((m,f)=>m+(f.totalMs??f.durationMs??0),0),p=mme(o,s,{deployDurationSeconds:d?Math.round(d/1e3):void 0,recipeFiles:a,revisionCheck:l,credentialBlockers:c.length>0?[Ylt(o,c)]:[]});i||await fCr(t,t.attempt.budgetMs(new Date));try{await gge(t.attempt,{recipe:p,sources:t.sources,producer:{testbot:m_().version,mcp:lye(r)},secrets:[...Ix(t),...Mm()]}),jn(zh.recipeUploaded,"true"),p.status==="ready"?ee(`Testbot V3: recipe version ${n.version} came up with the credentials as they are now; uploaded it again (ready).`):X(`Testbot V3: recipe version ${n.version} did not come up with the credentials as they are now (${p.blockers.map(m=>m.problem).join("; ")}); uploaded it blocked.`)}catch(m){X(`Testbot V3: the rechecked recipe's upload failed: ${m instanceof Error?m.message:String(m)}`)}}var Nht=10*6e4,Tht=[".skyramp/sut",".skyramp/workspace.yml"];async function fCr(t,e=Nht){let r=t.layout.repositoryPath,n=Wa(r,".skyramp/sut/teardown.sh"),s=Math.max(0,Math.min(Nht,e));s>0&&n&&await new Promise(c=>{let l=(0,wW.spawn)("bash",[n],{cwd:r,env:wt(),stdio:"inherit",detached:!0}),u=setTimeout(()=>{try{l.pid!==void 0&&process.kill(-l.pid,"SIGKILL")}catch{l.kill("SIGKILL")}},s),d=()=>{clearTimeout(u),c()};l.on("close",d),l.on("error",d)});let i=c=>(0,wW.spawnSync)("git",["-c","core.fsmonitor=false","-c","core.hooksPath=/dev/null",...c],{cwd:r,env:wt(),encoding:"utf-8"}),o=su.join(r,".skyramp");Xa.lstatSync(o,{throwIfNoEntry:!1})?.isSymbolicLink()&&Xa.rmSync(o,{force:!0});for(let c of Tht)Xa.rmSync(su.join(r,c),{recursive:!0,force:!0});let a=i(["ls-tree","-r","--name-only","HEAD","--",...Tht]).stdout.split(`
|
|
894
894
|
`).filter(Boolean);a.length>0&&i(["checkout","HEAD","--",...a])}var kht=".skyramp/sut/health-check.sh",Bht=".skyramp/sut/get-auth-token.sh";function cye(t){let e=s=>t.files?.some(i=>i.path===s)??!1,r=t.components.map(s=>`${s.name} (${s.repository===An?"shared, built by none of the Target's repositories":s.repository})`),n=t.revisionSources.map(s=>`${s.method.replace(/_/g," ")} ${s.detail} for ${s.components.join(" and ")}`);return[`The app is the customer's Test Environment at ${t.address}, already deployed and running.`,"Never start, stop, redeploy or change it: only read from it and test against it.",t.readyWhen&&`It is ready when ${t.readyWhen}.`,t.credentials.length>0&&`Sign in with ${t.credentials.join(", ")}, which the workflow supplies as environment variables of those names.`,r.length>0&&`Its components: ${r.join(", ")}.`,n.length>0&&`What each runs is read from: ${n.join("; ")}.`,e(kht)&&`Check it is ready with \`bash ${kht}\`.`,e(Bht)&&`Sign in with the token \`bash ${Bht}\` prints, never echoed.`,"Never edit the recipe files."].filter(Boolean).join(" ")}async function hCr(t){let e=t.sources[0],r;try{r=await AV(t.attempt)}catch(i){if(!(i instanceof ao&&i.status===404))throw Cx(),i;X(`Testbot V3: this Skyramp app does not serve the stored SUT recipe (${i.message}); deploy uses a source's own recipe, if one has it.`);return}let{runtimePlan:n,testEnvironment:s}=r;if(s){if(s.files){if(!s.contentHash||Cnt({...s,files:s.files})!==s.contentHash)throw Cx(),new Error(`The Test Environment's plan (version ${s.version}) does not match the hash Skyramp stored`);nO(e.path,s.files)}return ee(`Testbot V3: testing the customer's Test Environment at ${s.address} (version ${s.version}, ${s.files?.length??0} files); Testbot does not start or change it`),s}if(!n){ee("Testbot V3: no stored SUT recipe for this Target yet; deploy uses a source's own recipe, if one has it.");return}nO(e.path,n.files),ee(`Testbot V3: SUT recipe version ${n.version}, ${n.files.length} files, for ${e.slug} (uncommitted)`)}function lye(t){try{let e=JSON.parse(Xa.readFileSync(su.join(t,"@skyramp","mcp","package.json"),"utf-8")).version;return typeof e=="string"&&/^[0-9A-Za-z.+-]{1,64}$/.test(e)?e:"unknown"}catch{return"unknown"}}async function Ght(t,e,r){e.aborted?iu("cancelled"):e.timedOut&&iu("timed_out");let n=e.outputsDir?su.join(e.outputsDir,"report.json"):void 0;if(!n||!Xa.existsSync(n)){e.abortReason==="attempt-cancelled"?ee("Testbot V3: Skyramp cancelled this run, so Testbot uploads no report."):X("Testbot V3: the run wrote no report, so Skyramp records it as an infrastructure error.");return}if(!await oye(t))try{let s=JSON.parse(Xa.readFileSync(n,"utf-8"));await Cut(t.attempt,{report:s,sources:t.sources,workingSlug:t.layout.repositorySlug,delivery:Put(e.outputsDir,t.sources,s,t.layout.repositorySlug,e.deliverWithheld,{...t.testEnvironment?{appRunning:cye(t.testEnvironment)}:{},sharedEnvironment:t.sharedEnvironment}),githubWrites:Out(e.outputsDir,t.sources,t.layout.repositorySlug),producer:{testbot:m_().version,mcp:lye(r)},secrets:[...Ix(t),...Mm()]}),jn(zh.reportUploaded,"true"),ee("Testbot V3: report uploaded; Skyramp derives the outcome.")}catch(s){X(`Testbot V3: the report upload failed: ${s instanceof Error?s.message:String(s)}`)}}function Sy(t){return t.attempt.manifest.trigger.kind==="sut_setup"}async function jht(t){let{capture:e}=await fge(t.attempt);uB(mge(e));let{components:r,dependencies:n,runner:s,...i}=e.settings.target.environment??{},{answerWaitMinutes:o,testEnvironment:a}=e.settings;return{sutEnvironment:tge(i,"the run's SUT / Environment settings"),...o!==void 0&&{answerWaitMinutes:o},...a&&{testEnvironment:{name:a.name,...a.address&&{address:a.address},...a.readyWhen&&{readyWhen:a.readyWhen}}}}}var gCr={onboard:"onboard",deploy:"deploy"};function Vht(t,e,r=!1){return({stage:n,event:s,status:i})=>{if(n==="onboard"&&s==="started"){t.setupEvents??=new xV(e,l=>Rut(t.attempt,l),{secrets:()=>ju([...t.attempt.issuedTokens,...Ix(t),...Mm()]),warn:l=>X(l),repositories:[{slug:t.layout.repositorySlug,path:t.layout.repositoryPath},...t.layout.relatedRepos],shared:r,onStop:l=>t.requestStop?.(l)});try{t.setupEvents.start();let l=t.setupLines?.splice(0)??[];l.length>0&&Xa.appendFileSync(su.join(e,Ph),l.map(u=>`${JSON.stringify({kind:"log",phase:"discover",text:u})}
|
|
895
|
-
`).join(""))}catch(l){X(`Testbot V3: could not start setup events: ${l instanceof Error?l.message:String(l)}`)}}n==="deploy"&&s==="finished"&&t.setupEvents?.stop();let o=gCr[n];if(!o)return;let a=s==="finished",c=i==="aborted"?"skipped":i;hge(t.attempt,{schemaVersion:1,stage:o,event:a?"finished":"started",...a&&c?{status:c}:{}}).catch(l=>X(`Testbot V3: could not report ${n} ${s}: ${l instanceof Error?l.message:String(l)}`))}}var t0=t=>{try{return JSON.parse(Xa.readFileSync(t,"utf-8"))}catch{return}};async function Wht(t,e,r){try{await t.setupEvents?.stop(),t.stopKey?await yCr(t,t.stopKey,e.outputsDir):await ACr(t,e,r)}finally{await t.setupEvents?.stop()}}async function ACr(t,e,r){e.aborted?iu("cancelled"):e.timedOut&&iu("timed_out");let n=e.outputsDir?t0(su.join(e.outputsDir,"onboard.json")):void 0;if(!n){X("Testbot V3: onboard wrote no answer, so there is no SUT recipe to send; Skyramp records the run as an infrastructure error.");return}if(await oye(t))return;let s=t0(su.join(e.outputsDir,"deploy.json")),o=(e.stateFilePath?t0(e.stateFilePath):void 0)?.stages.deploy?.attempts?.reduce((a,c)=>a+(c.totalMs??c.durationMs??0),0);try{let a=s?FD(t.layout.repositoryPath):void 0,c=n.environment?await Yht(t,n,pme(n,s,a)):void 0,l=n.environment&&!c?await Eit(n.environment,n.components.map(d=>d.name),void 0,[...Ix(t),...Mm()]):void 0,u=mme(n,s,{deployed:l,revisionCheck:c,recipeFiles:a,deployDurationSeconds:o?Math.round(o/1e3):void 0});await gge(t.attempt,{recipe:u,sources:t.sources,producer:{testbot:m_().version,mcp:lye(r)},secrets:[...Ix(t),...Mm()]}),jn(zh.recipeUploaded,"true"),ee(`Testbot V3: SUT recipe uploaded (${u.status}); Skyramp derives the outcome.`)}catch(a){X(`Testbot V3: the SUT recipe upload failed: ${a instanceof Error?a.message:String(a)}`)}}async function Yht(t,e,r){let n=Yw(r.recipeFiles);return n?uye(t)(n.content,e.components,e.environment?.credentials??[]):void 0}function uye(t){return(e,r,n)=>Ait({content:e,components:r,read:s=>Jht(t,s,n),resolveCommit:(s,i)=>Aut(t.attempt,s,i)})}async function Jht(t,e,r){let n;try{n=await t.attempt.token()}catch(i){return{ok:!1,error:`deployed-revisions.sh was not run: no scoped GitHub token (${i instanceof Error?i.message:String(i)})`}}let s=ju([...t.attempt.issuedTokens,...Ix(t),...Mm()]);return git({content:e,env:hit(n,r),secrets:s})}function Kht(t){let e=Yw(t.testEnvironment?.files),r=t.testEnvironment?.credentials??[];return e?{deployedRevisions:()=>Jht(t,e.content,r)}:{}}var Xht=t=>[{slug:t.layout.repositorySlug,path:t.layout.repositoryPath},...t.layout.relatedRepos];async function yCr(t,e,r){iu("cancelled");try{let n=r?t0(su.join(r,"onboard-session.json"))?.sessionId:void 0;if(!n)throw new Error("onboard had not started a session");let{DefaultArtifactClient:s}=await Promise.resolve().then(()=>(pI(),iB)),i=Os(),o=await vht({sessionId:n,key:e,checkouts:Xht(t),secrets:ju([...t.attempt.issuedTokens,...Ix(t),...Mm()]),artifacts:new s,name:["skyramp-setup-checkpoint",t.attempt.manifest.runId,i.runAttempt].filter(Boolean).join("-"),providerRunId:i.runId??"",now:new Date});await Nut(t.attempt,o),ee(`Testbot V3: saved where onboard was (${o.bytes} bytes, kept ${R_} days); resume the setup from Skyramp to continue it.`)}catch(n){X(`Testbot V3: could not save where onboard was, so a resume of this setup starts over: ${n instanceof Error?n.message:String(n)}`)}}var dye="Could not restore where the setup stopped, so it starts over with the notes as they are now.",bCr="Could not restore where the setup stopped, so it starts from the Target's ready recipe, with the notes as they are now.",Zht="Could not restore where the setup stopped, so it continues from what it found, with the notes as they are now.",ECr="Could not restore where the setup stopped, so it continues from what it found and the Target's ready recipe, with the notes as they are now.";function egt(t){t.setupLines=t.setupLines?.map(e=>e===dye?bCr:e===Zht?ECr:e)}async function tgt(t){if(!(!Sy(t)||t.recheck))try{return await kut(t.attempt)??void 0}catch(e){X(`Testbot V3: could not read what the setup before this one found: ${e instanceof Error?e.message:String(e)}`);return}}function rgt(t,e){if(e.kind!=="resume")return;let r=(t.setupLines??[]).filter(n=>n!==dye);t.setupLines=[...r,Zht]}async function ngt(t,e){if(!(!Sy(t)||t.recheck))try{let r=await Tut(t.attempt);if(!r)return;if(!e)throw new Error("the workflow gives Testbot no githubToken to download it with");let{DefaultArtifactClient:n}=await Promise.resolve().then(()=>(pI(),iB)),s=await Rht({checkpoint:r,token:e,cwd:t.layout.repositoryPath,checkouts:Xht(t),artifacts:new n});return ee(`Testbot V3: resuming the stopped setup's onboard session ${s.sessionId.slice(0,8)} where it was.`),s}catch(r){X(`Testbot V3: could not restore where the stopped setup was, so this setup starts over: ${r instanceof Error?r.message:String(r)}`),(t.setupLines??=[]).push(dye);return}}function wCr(t){let e=t.split(/[\n,]/).map(r=>r.trim()).filter(Boolean);return e.length?e:void 0}function xCr(t,e={}){if(!e.sutSetup&&(t("onboard")??"").trim().toLowerCase()==="true")return"onboard is not supported on a run that tests a change \u2014 in the two-step pipeline a SUT setup runs on its own (preflight, onboard, deploy) and ends with a recipe, not a report. Set up the SUT from the Skyramp app's Setup page, or locally with the CLI's --onboard, and remove the input.";if((t("testRepoPath")??"").trim())return"testRepoPath is not supported by the staged pipeline (pipeline: staged) \u2014 it writes tests into the application checkout only, and the Action's token has no write access to another repository. Use pipeline: classic for cross-repository delivery, or remove the input."}async function SCr(t,e,r,n=Os().workspace||process.cwd()){let s=(t("relatedRepoPaths")??"").trim();if(!s)return[];let i=[];for(let o of s.split(/[\n,]/).map(a=>a.trim()).filter(Boolean)){let a=Cy.resolve(n,o);if(!Ks(n,o)){r(`relatedRepoPaths: ${o} is outside the workspace \u2014 skipping`);continue}if(!Iy.existsSync(a)){r(`relatedRepoPaths: no checkout at ${o} \u2014 skipping`);continue}let c=await e(a);if(!c){r(`relatedRepoPaths: could not resolve owner/repo for ${o} (no origin remote?) \u2014 skipping`);continue}i.push({slug:c,path:a})}return i}async function CCr(t,e,r=Os()){if(!r.repository)return;let{id:n,slug:s}=r.repository;return(await e(t).catch(()=>{}))?.toLowerCase()===s.toLowerCase()?{[n]:s}:void 0}var pye=class{constructor(e){this.link=e}link;settled=!1;async couldNotStart(e){this.settled||(this.settled=!0,await eye(e,this.link))}runBegins(){this.settled=!0}};async function sgt(){let t=qe("skyrampRunId").trim(),e=t?new pye({origin:aye(),runId:t}):void 0,r;try{let n=e2();delete process.env.INPUT_SKYRAMPLICENSEFILE;let s=bht(process.env);r=t?await $ht(t,n):void 0,await ICr(n,s,r,e)}catch(n){throw await e?.couldNotStart(n),n}finally{r&&await SW(r),r&&Iy.rmSync(xW(),{recursive:!0,force:!0})}}async function ICr(t,e,r,n){let s=r!==void 0&&Sy(r);r&&(r.heldInputs=[t.skyrampLicenseFile].filter(Boolean));let i=r?r.layout.repositoryPath:Cy.resolve(t.workingDirectory||"."),o=r?()=>r.attempt.token():Eht(),a=r?void 0:e;a&&Ot(a);let c=Aht(),l=new eV({repositoryPath:r?.pullRequest?.path??i,prNumber:c.prNumber,tokenProvider:o,githubToken:a,repoSlug:r?r.pullRequest?.repository??r.layout.repositorySlug:void 0,allowedAuthors:!s&&t.allowedAuthors?.length?t.allowedAuthors:void 0,log:Y=>ee(Y)});c=yht(c,await l.resolveContext().catch(()=>({}))),ee(`Staged pipeline \u2014 event: ${c.eventName??"?"}${c.action?`/${c.action}`:""}${c.prNumber?`, PR #${c.prNumber}`:""}${c.headRef?` (${c.headRef} \u2192 ${c.baseRef??"?"})`:""}`);let u=Bl(),d=Cy.join(u,"staged");if(c.eventName==="pull_request"&&c.action==="closed"){let Y=c.merged===!1,te=Y?`PR #${c.prNumber} was closed without merging`:`PR #${c.prNumber} was merged`;if(Y&&c.headRef){let Ae=await l.closeTestsPr({branch:qAe(c.headRef,qe("deliverBranch")||void 0),reason:`Closing: the pull request this tests PR targeted (#${c.prNumber}) was closed without being merged.`});Ae.closed&&(te+=`; closed the tests PR ${Ae.url??""}`.trimEnd())}ee(`Staged pipeline \u2014 ${te}; nothing to run.`);for(let[Ae,pe]of Object.entries(rO({admission:{admit:!1,reason:te}},{skippedPrClosed:Y})))Et(Ae,pe);jn("completed","true");return}let p=await l.admitRun();if(!p.admit){ee(`Staged pipeline \u2014 run skipped: ${p.reason}`);for(let[Y,te]of Object.entries(rO({admission:p},{skippedSelfTrigger:!0})))Et(Y,te);jn("completed","true");return}let m=r?r.layout.relatedRepos:await SCr(Y=>qe(Y),Y=>gh(Y),Y=>X(Y)),f=xCr(Y=>qe(Y),{sutSetup:s});if(f)throw new Error(f);let h=s,A=uht(qe("sutGuidance"),"sutGuidance input"),E=uW(qe("unitPath")),y,w,C;try{s?{sutEnvironment:y,answerWaitMinutes:w,testEnvironment:C}=await jht(r):y=Glt(qe("sutEnvironment"),"sutEnvironment input")}catch(Y){throw r&&Cx(),Y}for(let Y of pV(y))Ot(Y);let v=r?Object.fromEntries(r.sources.map(Y=>[Y.repository.providerRepositoryId,Y.slug])):await CCr(i,Y=>gh(Y)),k,N,M=r?.attempt.license?.runToken,T;try{if(e||o){let te=Os().workspace,Ae=[...new Set([i,...m.map(Je=>Je.path),...te?ylt(te):[]].map(Je=>Cy.resolve(Je)))],pe;for(let Je of Ae){let at=Je===Cy.resolve(i)?we=>{/^\s*authorization\s*:/i.test(we)&&(pe??=we)}:void 0,$e=glt(Je,void 0,at);$e.length&&ee(`Removed the persisted checkout credential from ${Je} (${$e.length} entr${$e.length===1?"y":"ies"}).`)}let ye=Alt();ye.length&&ee(`Removed ${ye.length} persisted checkout credential(s) from RUNNER_TEMP.`),pe&&(Ot(pe.replace(/^AUTHORIZATION:\s*\S+\s+/i,"")),l.adoptCheckoutAuthHeader(pe),ee("Deliver pushes with the credential the checkout was made with."))}else X("No githubToken or GitHub App credentials: the checkout's persisted git credential (if any) is left in place, and the stage sessions can reach it. Set persist-credentials: false on actions/checkout, or pass githubToken.");if(Iy.mkdirSync(u,{recursive:!0}),!M){if(T=Cy.join(u,"skyramp_license.lic"),!t.skyrampLicenseFile)throw new Error("skyrampLicenseFile input is required");Iy.writeFileSync(T,t.skyrampLicenseFile,{mode:384})}let Y=await fP(t);k=await oG(Y,t,u),N=d2("claude",{model:t.model||void 0,effort:vCr(qe("effort"),t.effort),useLocalAuth:t.useLocalAuth&&!t.useBedrock}),await NG(N),await TG(N),N.setupAgentEnv(t,Y)}catch(Y){r&&Cx(),await n?.couldNotStart(Y);let te=Y instanceof Error?Y.message:String(Y);await l.createProgressSink().render(Xj(te,{runUrl:l.runUrl})).catch(()=>{}),await l.endRun({status:"failure",summary:`could not start: ${te}`});for(let[Ae,pe]of Object.entries(rO({admission:{admit:!0},startupError:Y instanceof Error?Y:new Error(te)})))Et(Ae,pe);jn("completed","true"),il(`Skyramp Testbot could not start: ${te}`);return}t.generatedTestsMode!=="separate-branch"&&X(`pipeline: staged delivers only as a separate tests PR; generatedTestsMode=${t.generatedTestsMode} means nothing is committed or pushed this run`);let O=r?r.attempt.budgetMs(new Date):(t.testbotTimeout||60)*6e4;if(O<=0)throw Pht(),new Error("Testbot V3: setup used the run's whole budget; no time is left before the attempt deadline");let{stages:U,planOnly:J,withheld:z}=r&&!s?Lht(r.attempt.license?.entitlements,r.attempt.manifest.sources):{};J&&ee("Testbot V3: this organization's plan does not include test generation, so this run only analyzes the change and recommends tests.");let H=!s&&t.generatedTestsMode==="separate-branch"&&!J,Q=r&&H&&!z?.deliver?Uht(r.attempt.writeAllowed):void 0;Q&&(ee(`Testbot V3: ${Q}.`),{stages:U,planOnly:J,withheld:z}=Fht(z??{},Q));let L=s?await ngt(r,e):void 0,Z=s&&!L?await tgt(r):void 0;Z&&rgt(r,Z);let de=s&&!r.recheck&&!L?await qht(r):void 0;de&&egt(r);let ge={admission:p,platform:l,watch:r?Mht(r):void 0,log:JD,skipReport:s,run:{runDir:d,fresh:!0,budgetMs:O,...s?{stages:["onboard","deploy"],skipReport:!0,onStageEvent:Vht(r,i,!!C)}:{},...U?{stages:U}:{},withheld:z,skyrampRunUrl:r?.attempt.skyrampRunUrl,...r&&!s?Kht(r):{},...r&&s?{checkDeployedRevisions:uye(r)}:{},model:qe("model").trim()||void 0,resolveModel:wht(t),inputs:{repositoryPath:i,repositorySlug:r?.layout.repositorySlug,pullRequestRepository:r?.pullRequest?.repository,baseBranch:!r&&c.baseRef?`origin/${c.baseRef}`:void 0,relatedRepos:m,headBranch:r?void 0:c.headRef,prTitle:c.title,prDescription:c.body,...r?.pullRequests?.length?{pullRequests:r.pullRequests}:{},...r?.requirementItems?.length?{requirementItems:r.requirementItems}:{},...r?.instructions?.length?{instructions:r.instructions}:{},...r?.attempt.requestedBy?{requestedBy:r.attempt.requestedBy}:{},...r?.testPlacements?.length?{testPlacements:r.testPlacements}:{},...r?.sharedEnvironment?{sharedEnvironment:r.sharedEnvironment}:{},...r?.scheduledValidation?{scheduledValidation:r.scheduledValidation}:{},...r?.testEnvironment?{appRunning:cye(r.testEnvironment)}:{},planOnly:J,unitPath:E,skyrampMcp:{command:k.command,args:k.args.split(" ").filter(Boolean),licensePath:T,runToken:M},deliver:H&&!Q,deliverBranch:qe("deliverBranch")||void 0,trustedChecks:wCr(qe("trustedChecks")),deliverMode:c.eventName==="issue_comment"?"append":"replace",provisionRuntime:!0,testPackageDir:qe("testPackageDir").trim()||void 0,runnerPlatform:"github",onboard:h&&!J,sutGuidance:A,sutEnvironment:y,setupEvents:s,answerWaitMinutes:w,...L?{resumeSetup:L}:{},...Z?{previousSetup:Z}:{},...de?{setupBase:de}:{},...C?{testEnvironment:C}:{},repositoryIds:v},sessionRunner:cht(N.binary),sutAuth:{tokenCommand:t.authTokenCommand||void 0,uiCredentials:t.uiCredentials||void 0,sessionEnv:jft(qe("sessionEnv")),maskSecret:Y=>Ot(Y),attempts:t.authTokenRetries,retryDelaySec:t.authTokenRetryDelay}}};n?.runBegins();let be;s&&r.recheck?(be=await XAe({...ge,run:{...ge.run,stages:["deploy"],skipReport:!0,onStageEvent:Hht(r),inputs:{...ge.run.inputs,onboard:!1,recheck:!0,...r.recheck.recipe.environment?{recheckEnvironment:{address:r.recheck.recipe.environment.address}}:{}}}}),be.summary&&await zht(r,be.summary,k.nodeModulesDir)):be=await XAe(ge),r&&s?be.summary?r.recheck||await Wht(r,be.summary,k.nodeModulesDir):X("Testbot V3: the run ran no stages, so there is no SUT recipe to send; Skyramp records the run as an infrastructure error."):r&&await Ght(r,{...be.summary,deliverWithheld:z?.deliver},k.nodeModulesDir),be.admission.admit&&await xht(d);let ce=rO(be,{skippedSelfTrigger:!be.admission.admit});for(let[Y,te]of Object.entries(ce))Et(Y,te);if(jn("completed","true"),be.summary){await Sht(be.summary,be.outcome,r?.attempt.skyrampRunUrl,{sutSetup:s,closure:r?.attempt.closure}),ee(`Staged run ${be.summary.runId}: ${be.outcome?.summary} (state: ${be.summary.stateFilePath})`);let Y=AW(be.summary.stateFilePath);Y&&(wi("Stage breakdown (time / cost / context)"),ee(fht(Y,{order:be.summary.stages.map(te=>te.name),wallMinutes:yW(Y)})),ss())}n&&be.startupError&&await eye(be.startupError,n.link),be.startupError?il(`Skyramp Testbot could not start: ${be.startupError.message}`):be.outcome&&be.outcome.status==="failure"&&il(`Skyramp Testbot: ${be.outcome.summary}`)}function vCr(t,e){return(t??"").trim()?e:JKe}var RCr={useBedrock:"false",skipTargetTeardown:"false",skyrampMcpSource:"npm",skyrampMcpGithubRef:"main",nodeVersion:"lts/*",skipTargetSetup:"false",targetReadyCheckTimeout:"1800",targetReadyCheckInterval:"30",targetReadyCheckDiagnosticsCommand:`docker ps -a --format 'table {{.Names}} {{.Status}} {{.Ports}}' && docker ps -a --format '{{.Names}}' | while read name; do [ -n "$name" ] && echo "--- logs $name (last 30) ---" && docker logs --tail 30 "$name"; done`,workingDirectory:".",autoCommit:"true",commitMessage:"Skyramp Testbot: test maintenance suggestions",generatedTestsMode:"separate-branch",pipeline:"classic",postPrComment:"true",testbotMaxRetries:"3",testbotRetryDelay:"10",testExecutionTimeout:"300",testbotTimeout:"60",targetSetupRetries:"3",targetSetupRetryDelay:"10",authTokenRetries:"6",authTokenRetryDelay:"10",reportCollapsed:"true",language:"en",enableDebug:"true",sutSetupMode:"none"};function igt(t=process.env){for(let[e,r]of Object.entries(RCr)){let n=`INPUT_${e.replace(/ /g,"_").toUpperCase()}`;(t[n]??"").trim()===""&&(t[n]=r)}}var NCr="1.0.0";function agt(t,e=NCr){let r=ogt(t??""),n=ogt(e);if(!r||!n)return;let s=()=>`This Testbot engine needs the Skyramp Testbot action ${e} or later, and this workflow uses ${t}. Change the workflow to skyramp/testbot@v${n.core[0]}, or set engineVersion to an older engine.`;for(let i=0;i<3;i++){if(r.core[i]>n.core[i])return;if(r.core[i]<n.core[i])return s()}return r.preRelease&&!n.preRelease?s():void 0}function ogt(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(-)?/.exec(t.trim());return e?{core:[Number(e[1]),Number(e[2]),Number(e[3])],preRelease:e[4]==="-"}:void 0}igt();var TCr=qe("pipeline").trim().toLowerCase(),kCr=TCr==="staged"?sgt:Mst,cgt=agt(process.env.TESTBOT_ACTION_VERSION);cgt?il(cgt):kCr().catch(async t=>{il(t instanceof Error?t.message:String(t))});
|
|
895
|
+
`).join(""))}catch(l){X(`Testbot V3: could not start setup events: ${l instanceof Error?l.message:String(l)}`)}}n==="deploy"&&s==="finished"&&t.setupEvents?.stop();let o=gCr[n];if(!o)return;let a=s==="finished",c=i==="aborted"?"skipped":i;hge(t.attempt,{schemaVersion:1,stage:o,event:a?"finished":"started",...a&&c?{status:c}:{}}).catch(l=>X(`Testbot V3: could not report ${n} ${s}: ${l instanceof Error?l.message:String(l)}`))}}var t0=t=>{try{return JSON.parse(Xa.readFileSync(t,"utf-8"))}catch{return}};async function Wht(t,e,r){try{await t.setupEvents?.stop(),t.stopKey?await yCr(t,t.stopKey,e.outputsDir):await ACr(t,e,r)}finally{await t.setupEvents?.stop()}}async function ACr(t,e,r){e.aborted?iu("cancelled"):e.timedOut&&iu("timed_out");let n=e.outputsDir?t0(su.join(e.outputsDir,"onboard.json")):void 0;if(!n){X("Testbot V3: onboard wrote no answer, so there is no SUT recipe to send; Skyramp records the run as an infrastructure error.");return}if(await oye(t))return;let s=t0(su.join(e.outputsDir,"deploy.json")),o=(e.stateFilePath?t0(e.stateFilePath):void 0)?.stages.deploy?.attempts?.reduce((a,c)=>a+(c.totalMs??c.durationMs??0),0);try{let a=s?FD(t.layout.repositoryPath):void 0,c=n.environment?await Yht(t,n,pme(n,s,a)):void 0,l=n.environment&&!c?await Eit(n.environment,n.components.map(d=>d.name),void 0,[...Ix(t),...Mm()]):void 0,u=mme(n,s,{deployed:l,revisionCheck:c,recipeFiles:a,deployDurationSeconds:o?Math.round(o/1e3):void 0});await gge(t.attempt,{recipe:u,sources:t.sources,producer:{testbot:m_().version,mcp:lye(r)},secrets:[...Ix(t),...Mm()]}),jn(zh.recipeUploaded,"true"),ee(`Testbot V3: SUT recipe uploaded (${u.status}); Skyramp derives the outcome.`)}catch(a){X(`Testbot V3: the SUT recipe upload failed: ${a instanceof Error?a.message:String(a)}`)}}async function Yht(t,e,r){let n=Yw(r.recipeFiles);return n?uye(t)(n.content,e.components,e.environment?.credentials??[]):void 0}function uye(t){return(e,r,n)=>Ait({content:e,components:r,read:s=>Jht(t,s,n),resolveCommit:(s,i)=>Aut(t.attempt,s,i)})}async function Jht(t,e,r){let n;try{n=await t.attempt.token()}catch(i){return{ok:!1,error:`deployed-revisions.sh was not run: no scoped GitHub token (${i instanceof Error?i.message:String(i)})`}}let s=ju([...t.attempt.issuedTokens,...Ix(t),...Mm()]);return git({content:e,env:hit(n,r),secrets:s})}function Kht(t){let e=Yw(t.testEnvironment?.files),r=t.testEnvironment?.credentials??[];return e?{deployedRevisions:()=>Jht(t,e.content,r)}:{}}var Xht=t=>[{slug:t.layout.repositorySlug,path:t.layout.repositoryPath},...t.layout.relatedRepos];async function yCr(t,e,r){iu("cancelled");try{let n=r?t0(su.join(r,"onboard-session.json"))?.sessionId:void 0;if(!n)throw new Error("onboard had not started a session");let{DefaultArtifactClient:s}=await Promise.resolve().then(()=>(pI(),iB)),i=Os(),o=await vht({sessionId:n,key:e,checkouts:Xht(t),secrets:ju([...t.attempt.issuedTokens,...Ix(t),...Mm()]),artifacts:new s,name:["skyramp-setup-checkpoint",t.attempt.manifest.runId,i.runAttempt].filter(Boolean).join("-"),providerRunId:i.runId??"",now:new Date});await Nut(t.attempt,o),ee(`Testbot V3: saved where onboard was (${o.bytes} bytes, kept ${R_} days); resume the setup from Skyramp to continue it.`)}catch(n){X(`Testbot V3: could not save where onboard was, so a resume of this setup starts over: ${n instanceof Error?n.message:String(n)}`)}}var dye="Could not restore where the setup stopped, so it starts over with the notes as they are now.",bCr="Could not restore where the setup stopped, so it starts from the Target's ready recipe, with the notes as they are now.",Zht="Could not restore where the setup stopped, so it continues from what it found, with the notes as they are now.",ECr="Could not restore where the setup stopped, so it continues from what it found and the Target's ready recipe, with the notes as they are now.";function egt(t){t.setupLines=t.setupLines?.map(e=>e===dye?bCr:e===Zht?ECr:e)}async function tgt(t){if(!(!Sy(t)||t.recheck))try{return await kut(t.attempt)??void 0}catch(e){X(`Testbot V3: could not read what the setup before this one found: ${e instanceof Error?e.message:String(e)}`);return}}function rgt(t,e){if(e.kind!=="resume")return;let r=(t.setupLines??[]).filter(n=>n!==dye);t.setupLines=[...r,Zht]}async function ngt(t,e){if(!(!Sy(t)||t.recheck))try{let r=await Tut(t.attempt);if(!r)return;if(!e)throw new Error("the workflow gives Testbot no githubToken to download it with");let{DefaultArtifactClient:n}=await Promise.resolve().then(()=>(pI(),iB)),s=await Rht({checkpoint:r,token:e,cwd:t.layout.repositoryPath,checkouts:Xht(t),artifacts:new n});return ee(`Testbot V3: resuming the stopped setup's onboard session ${s.sessionId.slice(0,8)} where it was.`),s}catch(r){X(`Testbot V3: could not restore where the stopped setup was, so this setup starts over: ${r instanceof Error?r.message:String(r)}`),(t.setupLines??=[]).push(dye);return}}function wCr(t){let e=t.split(/[\n,]/).map(r=>r.trim()).filter(Boolean);return e.length?e:void 0}function xCr(t,e={}){if(!e.sutSetup&&(t("onboard")??"").trim().toLowerCase()==="true")return"onboard is not supported on a run that tests a change \u2014 in the two-step pipeline a SUT setup runs on its own (preflight, onboard, deploy) and ends with a recipe, not a report. Set up the SUT from the Skyramp app's Setup page, or locally with the CLI's --onboard, and remove the input.";if((t("testRepoPath")??"").trim())return"testRepoPath is not supported by the staged pipeline (pipeline: staged) \u2014 it writes tests into the application checkout only, and the Action's token has no write access to another repository. Use pipeline: classic for cross-repository delivery, or remove the input."}async function SCr(t,e,r,n=Os().workspace||process.cwd()){let s=(t("relatedRepoPaths")??"").trim();if(!s)return[];let i=[];for(let o of s.split(/[\n,]/).map(a=>a.trim()).filter(Boolean)){let a=Cy.resolve(n,o);if(!Ks(n,o)){r(`relatedRepoPaths: ${o} is outside the workspace \u2014 skipping`);continue}if(!Iy.existsSync(a)){r(`relatedRepoPaths: no checkout at ${o} \u2014 skipping`);continue}let c=await e(a);if(!c){r(`relatedRepoPaths: could not resolve owner/repo for ${o} (no origin remote?) \u2014 skipping`);continue}i.push({slug:c,path:a})}return i}async function CCr(t,e,r=Os()){if(!r.repository)return;let{id:n,slug:s}=r.repository;return(await e(t).catch(()=>{}))?.toLowerCase()===s.toLowerCase()?{[n]:s}:void 0}var pye=class{constructor(e){this.link=e}link;settled=!1;async couldNotStart(e){this.settled||(this.settled=!0,await eye(e,this.link))}runBegins(){this.settled=!0}};async function sgt(){let t=qe("skyrampRunId").trim(),e=t?new pye({origin:aye(),runId:t}):void 0,r;try{let n=e2();delete process.env.INPUT_SKYRAMPLICENSEFILE;let s=bht(process.env);r=t?await $ht(t,n):void 0,await ICr(n,s,r,e)}catch(n){throw await e?.couldNotStart(n),n}finally{r&&await SW(r),r&&Iy.rmSync(xW(),{recursive:!0,force:!0})}}async function ICr(t,e,r,n){let s=r!==void 0&&Sy(r);r&&(r.heldInputs=[t.skyrampLicenseFile].filter(Boolean));let i=r?r.layout.repositoryPath:Cy.resolve(t.workingDirectory||"."),o=r?()=>r.attempt.token():Eht(),a=r?void 0:e;a&&Ot(a);let c=Aht(),l=new eV({repositoryPath:r?.pullRequest?.path??i,prNumber:c.prNumber,tokenProvider:o,githubToken:a,repoSlug:r?r.pullRequest?.repository??r.layout.repositorySlug:void 0,allowedAuthors:!s&&t.allowedAuthors?.length?t.allowedAuthors:void 0,log:Y=>ee(Y)});c=yht(c,await l.resolveContext().catch(()=>({}))),ee(`Staged pipeline \u2014 event: ${c.eventName??"?"}${c.action?`/${c.action}`:""}${c.prNumber?`, PR #${c.prNumber}`:""}${c.headRef?` (${c.headRef} \u2192 ${c.baseRef??"?"})`:""}`);let u=Bl(),d=Cy.join(u,"staged");if(c.eventName==="pull_request"&&c.action==="closed"){let Y=c.merged===!1,te=Y?`PR #${c.prNumber} was closed without merging`:`PR #${c.prNumber} was merged`;if(Y&&c.headRef){let Ae=await l.closeTestsPr({branch:qAe(c.headRef,qe("deliverBranch")||void 0),reason:`Closing: the pull request this tests PR targeted (#${c.prNumber}) was closed without being merged.`});Ae.closed&&(te+=`; closed the tests PR ${Ae.url??""}`.trimEnd())}ee(`Staged pipeline \u2014 ${te}; nothing to run.`);for(let[Ae,pe]of Object.entries(rO({admission:{admit:!1,reason:te}},{skippedPrClosed:Y})))Et(Ae,pe);jn("completed","true");return}let p=await l.admitRun();if(!p.admit){ee(`Staged pipeline \u2014 run skipped: ${p.reason}`);for(let[Y,te]of Object.entries(rO({admission:p},{skippedSelfTrigger:!0})))Et(Y,te);jn("completed","true");return}let m=r?r.layout.relatedRepos:await SCr(Y=>qe(Y),Y=>gh(Y),Y=>X(Y)),f=xCr(Y=>qe(Y),{sutSetup:s});if(f)throw new Error(f);let h=s,A=uht(qe("sutGuidance"),"sutGuidance input"),E=uW(qe("unitPath")),y,w,C;try{s?{sutEnvironment:y,answerWaitMinutes:w,testEnvironment:C}=await jht(r):y=Glt(qe("sutEnvironment"),"sutEnvironment input")}catch(Y){throw r&&Cx(),Y}for(let Y of pV(y))Ot(Y);let v=r?Object.fromEntries(r.sources.map(Y=>[Y.repository.providerRepositoryId,Y.slug])):await CCr(i,Y=>gh(Y)),k,N,M=r?.attempt.license?.runToken,T;try{if(e||o){let te=Os().workspace,Ae=[...new Set([i,...m.map(Je=>Je.path),...te?ylt(te):[]].map(Je=>Cy.resolve(Je)))],pe;for(let Je of Ae){let at=Je===Cy.resolve(i)?we=>{/^\s*authorization\s*:/i.test(we)&&(pe??=we)}:void 0,$e=glt(Je,void 0,at);$e.length&&ee(`Removed the persisted checkout credential from ${Je} (${$e.length} entr${$e.length===1?"y":"ies"}).`)}let ye=Alt();ye.length&&ee(`Removed ${ye.length} persisted checkout credential(s) from RUNNER_TEMP.`),pe&&(Ot(pe.replace(/^AUTHORIZATION:\s*\S+\s+/i,"")),l.adoptCheckoutAuthHeader(pe),ee("Deliver pushes with the credential the checkout was made with."))}else X("No githubToken or GitHub App credentials: the checkout's persisted git credential (if any) is left in place, and the stage sessions can reach it. Set persist-credentials: false on actions/checkout, or pass githubToken.");if(Iy.mkdirSync(u,{recursive:!0}),!M){if(T=Cy.join(u,"skyramp_license.lic"),!t.skyrampLicenseFile)throw new Error("skyrampLicenseFile input is required");Iy.writeFileSync(T,t.skyrampLicenseFile,{mode:384})}let Y=await fP(t);k=await oG(Y,t,u),N=d2("claude",{model:t.model||void 0,effort:vCr(qe("effort"),t.effort),useLocalAuth:t.useLocalAuth&&!t.useBedrock,claudeCodeVersion:r?.attempt.claudeCodeVersion}),await NG(N),await TG(N),N.setupAgentEnv(t,Y)}catch(Y){r&&Cx(),await n?.couldNotStart(Y);let te=Y instanceof Error?Y.message:String(Y);await l.createProgressSink().render(Xj(te,{runUrl:l.runUrl})).catch(()=>{}),await l.endRun({status:"failure",summary:`could not start: ${te}`});for(let[Ae,pe]of Object.entries(rO({admission:{admit:!0},startupError:Y instanceof Error?Y:new Error(te)})))Et(Ae,pe);jn("completed","true"),il(`Skyramp Testbot could not start: ${te}`);return}t.generatedTestsMode!=="separate-branch"&&X(`pipeline: staged delivers only as a separate tests PR; generatedTestsMode=${t.generatedTestsMode} means nothing is committed or pushed this run`);let O=r?r.attempt.budgetMs(new Date):(t.testbotTimeout||60)*6e4;if(O<=0)throw Pht(),new Error("Testbot V3: setup used the run's whole budget; no time is left before the attempt deadline");let{stages:U,planOnly:J,withheld:z}=r&&!s?Lht(r.attempt.license?.entitlements,r.attempt.manifest.sources):{};J&&ee("Testbot V3: this organization's plan does not include test generation, so this run only analyzes the change and recommends tests.");let H=!s&&t.generatedTestsMode==="separate-branch"&&!J,Q=r&&H&&!z?.deliver?Uht(r.attempt.writeAllowed):void 0;Q&&(ee(`Testbot V3: ${Q}.`),{stages:U,planOnly:J,withheld:z}=Fht(z??{},Q));let L=s?await ngt(r,e):void 0,Z=s&&!L?await tgt(r):void 0;Z&&rgt(r,Z);let de=s&&!r.recheck&&!L?await qht(r):void 0;de&&egt(r);let ge={admission:p,platform:l,watch:r?Mht(r):void 0,log:JD,skipReport:s,run:{runDir:d,fresh:!0,budgetMs:O,...s?{stages:["onboard","deploy"],skipReport:!0,onStageEvent:Vht(r,i,!!C)}:{},...U?{stages:U}:{},withheld:z,skyrampRunUrl:r?.attempt.skyrampRunUrl,...r&&!s?Kht(r):{},...r&&s?{checkDeployedRevisions:uye(r)}:{},model:qe("model").trim()||void 0,resolveModel:wht(t),inputs:{repositoryPath:i,repositorySlug:r?.layout.repositorySlug,pullRequestRepository:r?.pullRequest?.repository,baseBranch:!r&&c.baseRef?`origin/${c.baseRef}`:void 0,relatedRepos:m,headBranch:r?void 0:c.headRef,prTitle:c.title,prDescription:c.body,...r?.pullRequests?.length?{pullRequests:r.pullRequests}:{},...r?.requirementItems?.length?{requirementItems:r.requirementItems}:{},...r?.instructions?.length?{instructions:r.instructions}:{},...r?.attempt.requestedBy?{requestedBy:r.attempt.requestedBy}:{},...r?.testPlacements?.length?{testPlacements:r.testPlacements}:{},...r?.sharedEnvironment?{sharedEnvironment:r.sharedEnvironment}:{},...r?.scheduledValidation?{scheduledValidation:r.scheduledValidation}:{},...r?.testEnvironment?{appRunning:cye(r.testEnvironment)}:{},planOnly:J,unitPath:E,skyrampMcp:{command:k.command,args:k.args.split(" ").filter(Boolean),licensePath:T,runToken:M},deliver:H&&!Q,deliverBranch:qe("deliverBranch")||void 0,trustedChecks:wCr(qe("trustedChecks")),deliverMode:c.eventName==="issue_comment"?"append":"replace",provisionRuntime:!0,testPackageDir:qe("testPackageDir").trim()||void 0,runnerPlatform:"github",onboard:h&&!J,sutGuidance:A,sutEnvironment:y,setupEvents:s,answerWaitMinutes:w,...L?{resumeSetup:L}:{},...Z?{previousSetup:Z}:{},...de?{setupBase:de}:{},...C?{testEnvironment:C}:{},repositoryIds:v},sessionRunner:cht(N.binary),sutAuth:{tokenCommand:t.authTokenCommand||void 0,uiCredentials:t.uiCredentials||void 0,sessionEnv:jft(qe("sessionEnv")),maskSecret:Y=>Ot(Y),attempts:t.authTokenRetries,retryDelaySec:t.authTokenRetryDelay}}};n?.runBegins();let be;s&&r.recheck?(be=await XAe({...ge,run:{...ge.run,stages:["deploy"],skipReport:!0,onStageEvent:Hht(r),inputs:{...ge.run.inputs,onboard:!1,recheck:!0,...r.recheck.recipe.environment?{recheckEnvironment:{address:r.recheck.recipe.environment.address}}:{}}}}),be.summary&&await zht(r,be.summary,k.nodeModulesDir)):be=await XAe(ge),r&&s?be.summary?r.recheck||await Wht(r,be.summary,k.nodeModulesDir):X("Testbot V3: the run ran no stages, so there is no SUT recipe to send; Skyramp records the run as an infrastructure error."):r&&await Ght(r,{...be.summary,deliverWithheld:z?.deliver},k.nodeModulesDir),be.admission.admit&&await xht(d);let ce=rO(be,{skippedSelfTrigger:!be.admission.admit});for(let[Y,te]of Object.entries(ce))Et(Y,te);if(jn("completed","true"),be.summary){await Sht(be.summary,be.outcome,r?.attempt.skyrampRunUrl,{sutSetup:s,closure:r?.attempt.closure}),ee(`Staged run ${be.summary.runId}: ${be.outcome?.summary} (state: ${be.summary.stateFilePath})`);let Y=AW(be.summary.stateFilePath);Y&&(wi("Stage breakdown (time / cost / context)"),ee(fht(Y,{order:be.summary.stages.map(te=>te.name),wallMinutes:yW(Y)})),ss())}n&&be.startupError&&await eye(be.startupError,n.link),be.startupError?il(`Skyramp Testbot could not start: ${be.startupError.message}`):be.outcome&&be.outcome.status==="failure"&&il(`Skyramp Testbot: ${be.outcome.summary}`)}function vCr(t,e){return(t??"").trim()?e:JKe}var RCr={useBedrock:"false",skipTargetTeardown:"false",skyrampMcpSource:"npm",skyrampMcpGithubRef:"main",nodeVersion:"lts/*",skipTargetSetup:"false",targetReadyCheckTimeout:"1800",targetReadyCheckInterval:"30",targetReadyCheckDiagnosticsCommand:`docker ps -a --format 'table {{.Names}} {{.Status}} {{.Ports}}' && docker ps -a --format '{{.Names}}' | while read name; do [ -n "$name" ] && echo "--- logs $name (last 30) ---" && docker logs --tail 30 "$name"; done`,workingDirectory:".",autoCommit:"true",commitMessage:"Skyramp Testbot: test maintenance suggestions",generatedTestsMode:"separate-branch",pipeline:"classic",postPrComment:"true",testbotMaxRetries:"3",testbotRetryDelay:"10",testExecutionTimeout:"300",testbotTimeout:"60",targetSetupRetries:"3",targetSetupRetryDelay:"10",authTokenRetries:"6",authTokenRetryDelay:"10",reportCollapsed:"true",language:"en",enableDebug:"true",sutSetupMode:"none"};function igt(t=process.env){for(let[e,r]of Object.entries(RCr)){let n=`INPUT_${e.replace(/ /g,"_").toUpperCase()}`;(t[n]??"").trim()===""&&(t[n]=r)}}var NCr="1.0.0";function agt(t,e=NCr){let r=ogt(t??""),n=ogt(e);if(!r||!n)return;let s=()=>`This Testbot engine needs the Skyramp Testbot action ${e} or later, and this workflow uses ${t}. Change the workflow to skyramp/testbot@v${n.core[0]}, or set engineVersion to an older engine.`;for(let i=0;i<3;i++){if(r.core[i]>n.core[i])return;if(r.core[i]<n.core[i])return s()}return r.preRelease&&!n.preRelease?s():void 0}function ogt(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(-)?/.exec(t.trim());return e?{core:[Number(e[1]),Number(e[2]),Number(e[3])],preRelease:e[4]==="-"}:void 0}igt();var TCr=qe("pipeline").trim().toLowerCase(),kCr=TCr==="staged"?sgt:Mst,cgt=agt(process.env.TESTBOT_ACTION_VERSION);cgt?il(cgt):kCr().catch(async t=>{il(t instanceof Error?t.message:String(t))});
|
|
896
896
|
/*! Bundled license information:
|
|
897
897
|
|
|
898
898
|
undici/lib/web/fetch/body.js:
|
package/dist/post.js
CHANGED
|
@@ -216,7 +216,7 @@ ${o?xe().abandonedBody:xe().cancelledBody}
|
|
|
216
216
|
${i.join(`
|
|
217
217
|
`)}
|
|
218
218
|
|
|
219
|
-
<sub>[${xe().workflowRunLinkLabel}](${e})</sub>`}QP();QP();QP();qp();function z3(t,e){if(process.env.GITHUB_ACTIONS)return new cE(t,uBe,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}yt();qp();var bm=(i=>(i.NotFound="not_found",i.NoAccess="no_access",i.Unavailable="unavailable",i.AccessLost="access_lost",i.CannotOpen="cannot_open",i))(bm||{}),wm=t=>t.source==="other"?{source:t.source,key:t.key}:{source:t.source,site:t.site,key:t.key},za=t=>`${t.source}:${t.site??""}:${t.key}`;var UI=/^pasted-[0-9a-f]{16}$/,uE=/^file-[0-9a-f]{16}$/,dE=(s=>(s.Pdf="application/pdf",s.Csv="text/csv",s.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",s.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",s))(dE||{}),gi=t=>t.trim().toUpperCase(),lE=(t,e)=>{let r=t.trim();return UI.test(r.toLowerCase())?"Pasted text":uE.test(r.toLowerCase())?e?.get(gi(r))??"Uploaded document":/^\d+$/.test(r)?`Confluence page ${r}`:r.toUpperCase()},Al=(t,e,r)=>e?`${lE(t,r)} AC${e}`:lE(t,r),$I=(r=>(r.Sufficient="sufficient",r.Insufficient="insufficient",r))($I||{}),qI=(p=>(p.RelatedChangeConflict="related_change_conflict",p.ReferenceOutsideTarget="reference_outside_target",p.SourceAccessLost="source_access_lost",p.ConfigurationIncomplete="configuration_incomplete",p.CredentialUnavailable="credential_unavailable",p.WorkflowBindingUnverified="workflow_binding_unverified",p.WorkflowRefUnprotected="workflow_ref_unprotected",p.BedrockWorkflowRequired="bedrock_workflow_required",p.DeploymentReview="deployment_review",p.SutRevisionMismatch="sut_revision_mismatch",p.IsolationUnavailable="isolation_unavailable",p.EvidenceInsufficient="evidence_insufficient",p))(qI||{}),Gp=(i=>(i.CiCheck="ci_check",i.TestReport="test_report",i.StaticAnalysis="static_analysis",i.CodeReview="code_review",i.Other="other",i))(Gp||{}),GI=(n=>(n.Application="application",n.Environment="environment",n.TestDefect="test_defect",n))(GI||{}),OP=(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))(OP||{});var MP=(n=>(n.Seed="seed",n.RuntimeMock="runtime_mock",n.EnvOverride="env_override",n))(MP||{}),FP=(n=>(n.TestCode="test_code",n.SkyrampMocker="skyramp_mocker",n.RecipeOverride="recipe_override",n))(FP||{});var pE=(r=>(r.Ready="ready",r.Blocked="blocked",r))(pE||{}),qr=g.string().trim().min(1),LEt=g.object({action:g.enum(["start","run","wait"]),text:qr,source:g.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:qr.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"}),UEt=/^[A-Za-z_][A-Za-z0-9_]*$/,fE=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,LP=(i=>(i.VersionEndpoint="version_endpoint",i.DeployWorkflow="deploy_workflow",i.KubernetesLabels="kubernetes_labels",i.Command="command",i.Api="api",i))(LP||{}),$n="shared",$Et=qr.refine(t=>{try{let e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}},"an http(s) URL with no login in it"),hE=g.object({address:$Et,readyWhen:qr.nullable(),credentials:g.array(g.string().regex(fE)).max(50),revisionSources:g.array(g.object({method:g.nativeEnum(LP),detail:qr.describe("what Testbot reads, such as GET /version or the deploy workflow's name"),components:g.array(qr).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),V3={steps:g.array(LEt).max(20).optional().describe("how it starts, in order"),kind:g.enum(["web_app","service","database","external_service"]).optional(),from:g.object({file:qr,service:qr.nullable()}).strict().optional(),credentials:g.array(g.string().max(100).regex(UEt)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},qEt=g.object({name:qr,repository:qr.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:g.boolean(),...V3,deployed:qr.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),GEt=g.object({component:qr,problem:qr,evidence:qr.describe("the exact command and output that shows it"),fix:qr.describe("what the user must provide, and where")}),HEt=g.object({framework:qr,file:qr.describe("the test file run, relative to its repository root"),result:g.enum(["pass","fail","error"])}),jEt=g.object({input:qr.describe("the part of the user's SUT input, as given"),reason:qr}),HI=g.object({schemaVersion:g.literal(1),status:g.nativeEnum(pE).describe("ready only if every component came up healthy and the recipe is written"),components:g.array(qEt),suites:g.array(HEt).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:g.array(qr).default([]).describe("the parts of the user's SUT input the recipe used"),inputsUsedHow:g.array(g.object({input:qr.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:qr.describe("what the recipe did with it")})).optional(),inputsNotUsed:g.array(jEt).default([]).describe("the parts it did not use, and why"),blockers:g.array(GEt).describe("required (non-empty) when status is blocked"),environment:hE.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});function W3(t){let e=zEt(t);if(e.length>0)return e;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 r=Array.isArray(t.components)?t.components:[];if(r.length===0)return['status "ready" requires at least one component \u2014 name each component the recipe brought up healthy'];let n=r.filter(s=>s?.healthy!==!0).map(s=>String(s?.name??"?"));if(n.length>0)return[`status "ready" requires every component healthy; not healthy: ${n.join(", ")} \u2014 answer "blocked" with a blocker for each, or bring them up and answer "ready" again`]}return[]}function zEt(t){let e=Array.isArray(t.components)?t.components:[],r=t.environment;if(!r){let a=e.filter(c=>c?.deployed!==void 0||c?.repository===$n).map(c=>String(c?.name??"?"));return a.length>0?[`"deployed" and a "${$n}" repository belong only to an answer with "environment"; remove them from: ${a.join(", ")}`]:[]}let n=[],s=e.filter(a=>a?.deployed===void 0).map(a=>String(a?.name??"?"));s.length>0&&n.push(`with "environment", every component says what it runs in "deployed" (null when you could not tell); missing for: ${s.join(", ")}`);let i=new Set(e.map(a=>a?.name)),o=(r.revisionSources??[]).flatMap(a=>a?.components??[]).filter(a=>!i.has(a));return o.length>0&&n.push(`each revision source names components of this answer; not one of them: ${o.map(String).join(", ")}`),n}var Cm=64*1024,Sm=512*1024,UP=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var pBe=V(require("path"));var yl=(s=>(s.Clean="clean",s.RecipeDrift="recipe-drift",s.ChangeBrokeBringup="change-broke-bringup",s.BringupFailed="bringup-failed",s))(yl||{}),Hp=g.string().trim().min(1),VEt=g.object({url:g.string().optional().describe("the URL probed, if the check is an HTTP request"),command:g.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:g.record(g.string()).optional(),status:g.union([g.number(),g.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Hp.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),jI=g.object({schemaVersion:g.literal(1),baseUrls:g.record(g.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:VEt.optional(),teardown:Hp.describe("command that tears the SUT down"),dependencies:g.record(g.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:g.nativeEnum(yl).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:g.array(g.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:g.object({command:Hp,output:Hp}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:g.array(g.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:g.boolean(),startedAt:Hp.describe("ISO timestamp"),revisions:g.array(g.object({component:Hp.describe("a shared component listed above"),url:Hp.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Hp.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 Y3(t){let e=[],r=s=>!!s&&typeof s=="object"&&!Array.isArray(s);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(s=>typeof s=="string"&&s.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(s=>typeof s=="string"&&s.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 Es=g.string().trim().min(1),J3=(r=>(r.TestbotManaged="testbot_managed",r.CustomerDeployed="customer_deployed",r))(J3||{}),zI=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],K3=g.object({schemaVersion:g.literal(1),type:g.nativeEnum(J3).optional(),status:g.enum(["ready","blocked"]),environment:hE.optional(),components:g.array(g.object({name:Es,repository:Es.describe(`owner/repo, or "${$n}" for a customer-deployed component no repository builds`),healthy:g.boolean(),url:g.string().min(1).nullable(),...V3,credentials:g.array(g.string().regex(fE)).max(50).optional(),deployed:Es.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:g.array(g.object({framework:Es,file:Es,result:g.enum(["pass","fail","error"])}).strict()),inputsUsed:g.array(Es),inputsUsedHow:g.array(g.object({input:Es,how:Es}).strict()).optional(),inputsNotUsed:g.array(g.object({input:Es,reason:Es}).strict()),blockers:g.array(g.object({component:Es,problem:Es,evidence:Es,fix:Es}).strict()),replay:g.object({outcome:Es,durationSeconds:g.number().nonnegative().nullable()}).strict().nullable(),files:g.array(g.object({path:Es,content:g.string()}).strict())}).strict().superRefine((t,e)=>{t.inputsUsedHow?.forEach((s,i)=>{t.inputsUsed.includes(s.input)||e.addIssue({code:g.ZodIssueCode.custom,path:["inputsUsedHow",i,"input"],message:"not one of inputsUsed"})}),t.components.forEach((s,i)=>{s.credentials&&new Set(s.credentials).size!==s.credentials.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"credentials"],message:"names a credential twice"})});let r=t.type==="customer_deployed";r!==(t.environment!==void 0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),t.environment&&new Set(t.environment.credentials).size!==t.environment.credentials.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let n=new Set(t.components.map(s=>s.name));if(t.environment?.revisionSources.forEach((s,i)=>{s.components.forEach((o,a)=>{n.has(o)||e.addIssue({code:g.ZodIssueCode.custom,path:["environment","revisionSources",i,"components",a],message:"not one of components"})})}),t.components.forEach((s,i)=>{s.deployed!==void 0!==r&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),s.repository===$n&&!r&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"repository"],message:`only a customer_deployed component is ${$n}`})}),r&&(t.components.forEach((s,i)=>{t.components.findIndex(o=>o.name===s.name)!==i&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"name"],message:"names a component twice"})}),t.replay!==null&&e.addIssue({code:g.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),t.files.forEach((s,i)=>{zI.includes(s.path)&&e.addIssue({code:g.ZodIssueCode.custom,path:["files",i,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),r&&t.status==="ready"){let s=new Set(t.environment?.revisionSources.flatMap(i=>i.components));t.components.forEach((i,o)=>{i.repository!==$n&&!s.has(i.name)&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",o,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var dnr=["clean","recipe-drift"];function VI(t){let e=pBe.posix.normalize(t);return e===t&&(e===".skyramp/workspace.yml"||e.startsWith(".skyramp/sut/")&&e.length>13)}var fBe=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"],hBe=[".skyramp/sut/health.json",".skyramp/workspace.yml"];var YI=(r=>(r.GitHub="github",r.AzureDevOps="azure-devops",r))(YI||{}),t4=(i=>(i.Trigger="TRIGGER",i.Baseline="BASELINE",i.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",i.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",i.ManualOverride="MANUAL_OVERRIDE",i))(t4||{}),GP=(i=>(i.PullRequest="pull_request",i.ReadyForReview="ready_for_review",i.Schedule="schedule",i.Manual="manual",i.SutSetup="sut_setup",i))(GP||{}),WEt=["sut_setup"],YEt=["sut_setup","schedule"];var HP=(e=>(e.PullRequest="pull_request",e))(HP||{}),jP=(s=>(s.ModelProvider="model_provider",s.SutAccess="sut_access",s.Skyramp="skyramp",s.Other="other",s))(jP||{});var zP=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s))(zP||{}),SBe=(r=>(r.Running="running",r.Ended="ended",r))(SBe||{}),VP=(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))(VP||{}),r4=(n=>(n.Onboard="onboard",n.Deploy="deploy",n.Recheck="recheck",n))(r4||{}),n4=(r=>(r.Started="started",r.Finished="finished",r))(n4||{}),s4=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(s4||{});var i4=(n=>(n.ChooseCredential="choose_credential",n.FreeText="free_text",n.ChooseSource="choose_source",n))(i4||{});var JI=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(JI||{}),WP=(s=>(s.Found="found",s.Starting="starting",s.Up="up",s.OutOfScope="out_of_scope",s))(WP||{}),Va=g.string().regex(/^[1-9][0-9]{0,18}$/),AE=g.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),ta=g.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),Hs=g.string().regex(/^[0-9a-f]{64}$/),qP=g.object({id:ta,revision:Va}).strict(),to=g.object({provider:g.nativeEnum(YI),providerAccountId:Va,providerRepositoryId:Va}).strict(),Z3=t=>`${t.provider}:${t.providerRepositoryId}`,IBe=to.extend({namespace:g.string().min(1),name:g.string().min(1)}).strict(),mBe=g.object({ref:g.string().min(1),revision:AE}).strict(),JEt=g.object({repository:IBe,revision:AE,ref:g.string().nullable(),reason:g.nativeEnum(t4),change:g.object({kind:g.nativeEnum(HP),number:Va,base:mBe.optional()}).strict().nullable(),compareWith:mBe.optional()}).strict();function KEt(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=>Z3(o.repository))),s=new Set(e.map(o=>Z3(o.repository)));return s.size===e.length&&s.size===n.size&&[...s].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var xBe=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,vBe=/^[1-9][0-9]{0,18}$/,gBe=new RegExp(`${xBe.source}|${vBe.source}`),ABe=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,XEt=g.union([g.object({source:g.literal("jira"),site:g.string().regex(ABe),key:g.string().regex(xBe),updated:g.string().datetime(),contentHash:Hs}).strict(),g.object({source:g.literal("confluence"),site:g.string().regex(ABe),key:g.string().regex(vBe),version:g.number().int().positive(),contentHash:Hs}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),contentHash:Hs}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),contentHash:Hs,fileName:g.string().min(1).max(255),mediaType:g.nativeEnum(dE)}).strict()]),yBe=g.union([g.literal("jira"),g.literal("confluence")]),ZEt=g.object({schemaVersion:g.literal(1),items:g.array(g.union([g.object({source:yBe,site:g.string(),key:g.string().regex(gBe),state:g.literal("read"),text:g.string(),version:g.string().min(1),contentMatches:g.boolean()}).strict(),g.object({source:yBe,site:g.string(),key:g.string().regex(gBe),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),state:g.literal("read"),text:g.string(),version:g.string().min(1),contentMatches:g.boolean()}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),state:g.literal("read"),version:Hs,fileName:g.string().min(1).max(255),mediaType:g.nativeEnum(dE)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict()])),instructions:g.array(g.string()).optional()}).strict(),ebt=g.object({schemaVersion:g.literal(1),runId:ta,skyrampOrgId:ta,target:qP,policy:qP.nullable(),trigger:g.object({kind:g.nativeEnum(GP),requestedAt:g.string().datetime()}).strict(),configuration:g.object({captureId:ta,revision:Va.nullable(),hash:Hs}).strict(),baseline:g.object({confirmedRunId:ta.nullable(),sources:g.array(g.object({repository:to,revision:AE}).strict()).optional()}).strict(),sources:g.array(JEt).min(1),execution:g.object({provider:g.nativeEnum(YI),repository:IBe,workflowPath:g.string(),ref:g.string()}).strict(),credentials:g.array(g.object({name:g.string(),purpose:g.nativeEnum(jP),required:g.boolean()}).strict()),requirements:g.array(XEt).min(1).optional(),instructions:g.object({contentHash:Hs}).strict().optional()}).strict().superRefine((t,e)=>{let r=new Set;(t.requirements??[]).forEach((o,a)=>{let c="fileName"in o?"file":"pasted";o.source==="other"&&o.key!==`${c}-${o.contentHash.slice(0,16)}`&&e.addIssue({code:g.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",a,"key"]});let l=za({source:o.source,key:o.key});r.has(l)&&e.addIssue({code:g.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",a,"key"]}),r.add(l)});let n=t.trigger.kind,s=WEt.includes(n);s!==(t.policy===null)&&e.addIssue({code:g.ZodIssueCode.custom,path:["policy"],message:s?`a ${n} run has no policy`:"names the policy revision"});let i=KEt(t);i&&e.addIssue({code:g.ZodIssueCode.custom,path:["baseline","sources"],message:i}),YEt.includes(n)&&t.sources.forEach((o,a)=>{o.reason!=="BASELINE"&&e.addIssue({code:g.ZodIssueCode.custom,path:["sources",a,"reason"],message:`a ${n} run selects only BASELINE sources`})}),t.sources.forEach((o,a)=>{o.compareWith&&(o.reason!=="MANUAL_OVERRIDE"||o.change)&&e.addIssue({code:g.ZodIssueCode.custom,path:["sources",a,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"})})});var o4=(r=>(r.Person="person",r.Policy="policy",r))(o4||{}),tbt=g.object({kind:g.nativeEnum(o4),name:g.string().min(1).max(256)}).strict(),ynr=g.object({schemaVersion:g.literal(1),attempt:g.object({id:ta,number:g.number().int().positive(),deadlineAt:g.string().datetime()}).strict(),manifest:ebt,manifestHash:Hs,entitlements:g.array(g.string()).optional(),runToken:g.string().min(1).optional(),requestedBy:tbt.nullable().optional(),writeAllowed:g.boolean().optional()}).strict(),Enr=g.object({schemaVersion:g.literal(1),runId:ta,execution:g.object({provider:g.nativeEnum(YI),repository:to,providerRunId:Va,providerRunAttempt:g.number().int().positive(),workflowRef:g.string().min(1)}).strict(),requester:g.literal(!0).optional(),writeCheck:g.literal(!0).optional()}).strict(),EBe=g.object({repository:to,number:Va}).strict(),rbt=g.discriminatedUnion("status",[g.object({status:g.literal("none")}).strict(),g.object({status:g.literal("delivered"),pullRequests:g.array(EBe).min(1)}).strict(),g.object({status:g.literal("partial"),pullRequests:g.array(EBe).min(1),failures:g.array(g.object({repository:to,message:g.string()}).strict()).min(1)}).strict(),g.object({status:g.literal("failed"),message:g.string()}).strict()]),nbt=g.object({sufficiency:g.nativeEnum($I),rationale:g.string().min(1),gaps:g.array(g.string().min(1)),acceptedEvidence:g.array(g.object({kind:g.nativeEnum(Gp),repository:g.string().min(1),revision:AE,reference:g.string().min(1),summary:g.string().min(1)}).strict()),actionRequired:g.array(g.nativeEnum(qI))}).strict().superRefine((t,e)=>{t.sufficiency==="sufficient"!=(t.gaps.length===0)&&e.addIssue({code:g.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:g.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),gE=500,a4=2048,c4=1e3,sbt=g.object({testResults:g.array(g.object({resultId:g.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:g.string().regex(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/),testType:g.string(),endpoint:g.string(),status:g.enum(["Pass","Fail","Skipped"]),details:g.string(),fileName:g.string().optional(),testId:g.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:g.object({kind:g.nativeEnum(GI),family:g.nativeEnum(OP).optional()}).strict().optional()}).strict()),validation:nbt,changes:g.array(g.object({id:g.string().min(1).max(512),text:g.string().max(16384),source:g.string().max(a4),testedBy:g.array(g.string().min(1).max(1024)).max(gE),writtenBy:g.array(g.string().min(1).max(1024)).max(gE),maintainedBy:g.array(g.string().min(1).max(1024)).max(gE)}).strict()).max(c4).optional(),traceVersion:g.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,s)=>{let i=n.failureCause;i&&n.status==="Pass"&&e.addIssue({code:g.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),i&&i.kind==="environment"!=(i.family!==void 0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",s,"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:g.ZodIssueCode.custom,path:o,message:"is not repository:testType:path for this result"}),r.has(n.resultId)&&e.addIssue({code:g.ZodIssueCode.custom,path:o,message:"stable identity repeated"}),r.add(n.resultId)})}),bBe=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function l4(t,e,r,n){let s=r.replace(/\\/g,"/"),i=s.split("/").filter(c=>c!==""&&c!==".");if(s.startsWith("/")||/^[A-Za-z]:/.test(s)||i.length===0||i.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=i.join("/"),a=`${t}:${e}:${bBe(o)}`;return n?`${a}#${bBe(n)}`:a}var RBe=50,wBe=g.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),BBe=g.discriminatedUnion("kind",[g.object({kind:g.literal("branch_pushed"),repository:to,branch:wBe,commit:AE}).strict(),g.object({kind:g.enum(["pull_request_opened","pull_request_edited"]),repository:to,number:Va,branch:wBe}).strict()]),ibt=g.object({schemaVersion:g.literal(1),run:g.object({runId:ta,attemptNumber:g.number().int().positive(),manifestHash:Hs}).strict(),target:qP,policy:qP,provenance:g.object({sources:g.array(g.object({repository:to,revision:AE}).strict())}).strict(),delivery:g.object({generatedTests:rbt}).strict(),producer:g.object({testbot:g.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:g.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:sbt,githubWrites:g.array(BBe).max(RBe).optional()}).strict(),bnr=ibt.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:K3}).strict().superRefine(({recipe:t},e)=>{let r=(i,o)=>e.addIssue({code:g.ZodIssueCode.custom,path:["recipe",...i],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,s=0;t.files.forEach((i,o)=>{VI(i.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(i.path)&&r(["files",o,"path"],"file repeated"),n.add(i.path),UP.test(i.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(i.content,"utf8");s+=a,a>Cm&&r(["files",o,"content"],`larger than ${Cm} bytes`)}),s>Sm&&r(["files"],`recipe text over ${Sm} bytes in total`)}),obt=g.object({schemaVersion:g.literal(1),stage:g.nativeEnum(r4),event:g.nativeEnum(n4),status:g.nativeEnum(s4).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),KI=100,kBe=5e3,X3=2e3,e4=100,u4=/^[A-Za-z0-9_-]{1,64}$/,TBe=20,NBe=200,_Be=100,PBe=100,abt=200,cbt=/^[^/\s]+\/[^/\s]+$/,QBe=500,DBe=50,d4=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,El=t=>g.string().max(t).refine(e=>e.trim().length>0&&!d4.test(e),"blank, or not text"),mE={sequence:g.number().int().min(1).max(kBe),at:g.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},OBe=g.discriminatedUnion("kind",[g.object({...mE,kind:g.literal("log"),phase:g.nativeEnum(JI),text:El(X3)}).strict(),g.object({...mE,kind:g.literal("component"),name:El(e4),repository:El(abt).refine(t=>cbt.test(t)||t===$n,"not owner/name"),file:El(QBe).nullable(),status:g.nativeEnum(WP),version:El(PBe).optional()}).strict(),g.object({...mE,kind:g.literal("reply"),to:g.string().uuid(),accepted:g.boolean(),text:El(X3)}).strict(),g.object({...mE,kind:g.literal("question"),id:g.string().regex(u4),type:g.nativeEnum(i4),text:El(X3),component:El(e4).nullable(),choices:g.array(El(NBe)).max(TBe),placeholder:El(_Be).optional()}).strict(),g.object({...mE,kind:g.literal("delivered"),ids:g.array(g.string().uuid()).max(KI)}).strict(),g.object({...mE,kind:g.literal("credentials"),names:g.array(g.string().regex(fE)).min(1).max(DBe)}).strict()]).superRefine((t,e)=>{t.kind==="credentials"&&new Set(t.names).size!==t.names.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["names"],message:"a name twice"}),t.kind==="question"&&(t.type==="free_text"!=(t.choices.length===0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(t.choices).size!==t.choices.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),lbt=g.object({schemaVersion:g.literal(1),events:g.array(OBe).max(KI)}).strict(),CBe={id:g.string().uuid(),text:g.string(),by:g.string().nullable(),at:g.string()},ubt=g.discriminatedUnion("kind",[g.object({...CBe,kind:g.literal("instruction"),question:g.null()}),g.object({...CBe,kind:g.literal("answer"),question:g.string().regex(u4)})]),MBe=g.string().regex(/^[A-Za-z0-9+/]{43}=$/),dbt=g.object({schemaVersion:g.literal(1),leftOut:g.array(g.string()),messages:g.array(ubt).optional(),stop:g.object({key:MBe}).optional()});var FBe=500*1024*1024,LBe=g.object({id:Va,name:g.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Va,expiresAt:g.string().datetime()}).strict(),pbt=g.object({schemaVersion:g.literal(1),artifact:LBe,sessionId:ta,contentHash:Hs,bytes:g.number().int().min(1).max(FBe)}).strict(),fbt=g.object({schemaVersion:g.literal(1),checkpoint:g.object({artifact:LBe,repository:g.object({namespace:g.string().min(1),name:g.string().min(1)}).strict(),sessionId:ta,contentHash:Hs,key:MBe}).strict().nullable()}).strict(),hbt=200,$P=100,YP=(n=>(n.Resume="resume",n.Retry="retry",n.Update="update",n))(YP||{}),mbt=g.object({kind:g.nativeEnum(YP),setup:g.object({runId:ta,endedAt:g.string().nullable(),outcome:g.string().nullable()}).strict(),components:g.array(g.object({name:g.string().min(1),repository:g.string().min(1),status:g.nativeEnum(WP)}).strict()).max($P),credentials:g.array(g.string().min(1)).max($P),answers:g.array(g.object({question:g.string(),answer:g.string().nullable()}).strict()).max($P),instructions:g.array(g.object({text:g.string(),reply:g.string().nullable()}).strict()).max($P),log:g.array(g.object({phase:g.nativeEnum(JI),text:g.string()}).strict()).max(hbt)}).strict(),gbt=g.object({schemaVersion:g.literal(1),context:mbt.nullable()}).strict(),Abt=g.object({schemaVersion:g.literal(1),configuration:g.object({captureId:ta,revision:Va.nullable(),hash:Hs}).strict(),capture:g.object({schemaVersion:g.literal(1),settings:g.object({target:g.object({environment:g.unknown()}).passthrough(),timeoutMinutes:g.number().int().positive(),answerWaitMinutes:g.number().int().positive().optional(),testEnvironment:g.object({name:g.string().min(1),address:g.string().min(1).optional(),readyWhen:g.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:g.object({}).passthrough(),hash:Hs}).strict()}).strict(),ybt=hE.extend({version:g.number().int().positive(),components:g.array(g.object({name:g.string().min(1),repository:g.string().min(1)}).strict()),contentHash:Hs.optional(),files:g.array(g.object({path:g.string().refine(t=>VI(t)&&!zI.includes(t),"not a file of a customer_deployed plan"),content:g.string()}).strict()).optional()}).strict(),Ebt=g.object({schemaVersion:g.literal(1),testEnvironment:ybt.nullable().optional(),runtimePlan:g.object({version:g.number().int().positive(),contentHash:Hs,files:g.array(g.object({path:g.string().refine(VI,"not a recipe file path"),content:g.string()}).strict()).min(1),recipe:g.record(g.unknown()).optional()}).strict().nullable()}).strict().refine(t=>!(t.runtimePlan&&t.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),bbt=g.object({schemaVersion:g.literal(1),state:g.nativeEnum(SBe),ending:g.nativeEnum(zP).nullable(),cause:g.nativeEnum(VP).nullable(),deadlineAt:g.string().datetime()}).strict();function UBe(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:wbt(t)}}function wbt(t){return t.credentialMissing?"credential_missing":t.checkoutFailed?"checkout_failed":t.setupFailed?"setup_failed":t.timedOut?"timed_out":"agent_failed"}var $Be=V(require("fs")),jp=V(require("path"));var qBe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var js=t=>new Map((t??[]).flatMap(e=>e.file?[[gi(e.key),e.file.name]]:[])),Cbt=10*1024*1024,Im=t=>t?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||t?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",GBe=(t,e)=>jp.join(jp.dirname(t),`${jp.basename(t,jp.extname(t))}${e}`),xm=t=>GBe(t,".extracted.txt");function p4(t){try{return/\S/.test($Be.readFileSync(xm(t),"utf-8"))}catch{return!1}}var f4=t=>GBe(t,".quotes.txt");function HBe(t){return Im(t.file)?xm(t.path):t.file?.mediaType==="application/pdf"?f4(t.path):t.path}function JP(t){return t.map(e=>e.state!=="read"||!Im(e.file)||p4(e.path)?e:{...wm(e),file:e.file,state:"not_read",reason:"cannot_open"})}var ns=t=>t.slice(0,12);var Sbt=["generate-unit","native-run"],Ibt=["preflight","plan","write",...Sbt,"report","deliver"];var vm=(n=>(n.Unit="unit",n.Integration="integration",n.E2e="e2e",n))(vm||{});var KP=1440;var yE=V(require("fs")),bl=V(require("path"));function EE(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var xbt=8;function ce(t,e,r={}){let n=e.slice(0,xbt),s=e.length-n.length;return{name:t,passed:!1,details:n.join("; ")+(s>0?`; \u2026and ${s} more`:""),...r.fatal?{fatal:!0}:{}}}function wl(t){if(yE.existsSync(t))try{return JSON.parse(yE.readFileSync(t,"utf-8"))}catch{return}}function ee(t,e){return wl(bl.join(t.outputsDir,e))}function ot(t,e,r,n){if(!r)throw new Error(`${e}.json unexpectedly invalid at artifact time: ${n[0]}`);let s=bl.join(t.outputsDir,`${e}.json`);return yE.writeFileSync(s,JSON.stringify(r,null,2)+`
|
|
219
|
+
<sub>[${xe().workflowRunLinkLabel}](${e})</sub>`}QP();QP();QP();qp();function z3(t,e){if(process.env.GITHUB_ACTIONS)return new cE(t,uBe,e);throw new Error("Unrecognized CI environment. Set GITHUB_ACTIONS=true for GitHub Actions, or use EvalPlatform directly for eval/testing.")}yt();qp();var bm=(i=>(i.NotFound="not_found",i.NoAccess="no_access",i.Unavailable="unavailable",i.AccessLost="access_lost",i.CannotOpen="cannot_open",i))(bm||{}),wm=t=>t.source==="other"?{source:t.source,key:t.key}:{source:t.source,site:t.site,key:t.key},za=t=>`${t.source}:${t.site??""}:${t.key}`;var UI=/^pasted-[0-9a-f]{16}$/,uE=/^file-[0-9a-f]{16}$/,dE=(s=>(s.Pdf="application/pdf",s.Csv="text/csv",s.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",s.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",s))(dE||{}),gi=t=>t.trim().toUpperCase(),lE=(t,e)=>{let r=t.trim();return UI.test(r.toLowerCase())?"Pasted text":uE.test(r.toLowerCase())?e?.get(gi(r))??"Uploaded document":/^\d+$/.test(r)?`Confluence page ${r}`:r.toUpperCase()},Al=(t,e,r)=>e?`${lE(t,r)} AC${e}`:lE(t,r),$I=(r=>(r.Sufficient="sufficient",r.Insufficient="insufficient",r))($I||{}),qI=(p=>(p.RelatedChangeConflict="related_change_conflict",p.ReferenceOutsideTarget="reference_outside_target",p.SourceAccessLost="source_access_lost",p.ConfigurationIncomplete="configuration_incomplete",p.CredentialUnavailable="credential_unavailable",p.WorkflowBindingUnverified="workflow_binding_unverified",p.WorkflowRefUnprotected="workflow_ref_unprotected",p.BedrockWorkflowRequired="bedrock_workflow_required",p.DeploymentReview="deployment_review",p.SutRevisionMismatch="sut_revision_mismatch",p.IsolationUnavailable="isolation_unavailable",p.EvidenceInsufficient="evidence_insufficient",p))(qI||{}),Gp=(i=>(i.CiCheck="ci_check",i.TestReport="test_report",i.StaticAnalysis="static_analysis",i.CodeReview="code_review",i.Other="other",i))(Gp||{}),GI=(n=>(n.Application="application",n.Environment="environment",n.TestDefect="test_defect",n))(GI||{}),OP=(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))(OP||{});var MP=(n=>(n.Seed="seed",n.RuntimeMock="runtime_mock",n.EnvOverride="env_override",n))(MP||{}),FP=(n=>(n.TestCode="test_code",n.SkyrampMocker="skyramp_mocker",n.RecipeOverride="recipe_override",n))(FP||{});var pE=(r=>(r.Ready="ready",r.Blocked="blocked",r))(pE||{}),qr=g.string().trim().min(1),LEt=g.object({action:g.enum(["start","run","wait"]),text:qr,source:g.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:qr.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"}),UEt=/^[A-Za-z_][A-Za-z0-9_]*$/,fE=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,LP=(i=>(i.VersionEndpoint="version_endpoint",i.DeployWorkflow="deploy_workflow",i.KubernetesLabels="kubernetes_labels",i.Command="command",i.Api="api",i))(LP||{}),$n="shared",$Et=qr.refine(t=>{try{let e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}},"an http(s) URL with no login in it"),hE=g.object({address:$Et,readyWhen:qr.nullable(),credentials:g.array(g.string().regex(fE)).max(50),revisionSources:g.array(g.object({method:g.nativeEnum(LP),detail:qr.describe("what Testbot reads, such as GET /version or the deploy workflow's name"),components:g.array(qr).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),V3={steps:g.array(LEt).max(20).optional().describe("how it starts, in order"),kind:g.enum(["web_app","service","database","external_service"]).optional(),from:g.object({file:qr,service:qr.nullable()}).strict().optional(),credentials:g.array(g.string().max(100).regex(UEt)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},qEt=g.object({name:qr,repository:qr.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:g.boolean(),...V3,deployed:qr.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),GEt=g.object({component:qr,problem:qr,evidence:qr.describe("the exact command and output that shows it"),fix:qr.describe("what the user must provide, and where")}),HEt=g.object({framework:qr,file:qr.describe("the test file run, relative to its repository root"),result:g.enum(["pass","fail","error"])}),jEt=g.object({input:qr.describe("the part of the user's SUT input, as given"),reason:qr}),HI=g.object({schemaVersion:g.literal(1),status:g.nativeEnum(pE).describe("ready only if every component came up healthy and the recipe is written"),components:g.array(qEt),suites:g.array(HEt).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:g.array(qr).default([]).describe("the parts of the user's SUT input the recipe used"),inputsUsedHow:g.array(g.object({input:qr.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:qr.describe("what the recipe did with it")})).optional(),inputsNotUsed:g.array(jEt).default([]).describe("the parts it did not use, and why"),blockers:g.array(GEt).describe("required (non-empty) when status is blocked"),environment:hE.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});function W3(t){let e=zEt(t);if(e.length>0)return e;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 r=Array.isArray(t.components)?t.components:[];if(r.length===0)return['status "ready" requires at least one component \u2014 name each component the recipe brought up healthy'];let n=r.filter(s=>s?.healthy!==!0).map(s=>String(s?.name??"?"));if(n.length>0)return[`status "ready" requires every component healthy; not healthy: ${n.join(", ")} \u2014 answer "blocked" with a blocker for each, or bring them up and answer "ready" again`]}return[]}function zEt(t){let e=Array.isArray(t.components)?t.components:[],r=t.environment;if(!r){let a=e.filter(c=>c?.deployed!==void 0||c?.repository===$n).map(c=>String(c?.name??"?"));return a.length>0?[`"deployed" and a "${$n}" repository belong only to an answer with "environment"; remove them from: ${a.join(", ")}`]:[]}let n=[],s=e.filter(a=>a?.deployed===void 0).map(a=>String(a?.name??"?"));s.length>0&&n.push(`with "environment", every component says what it runs in "deployed" (null when you could not tell); missing for: ${s.join(", ")}`);let i=new Set(e.map(a=>a?.name)),o=(r.revisionSources??[]).flatMap(a=>a?.components??[]).filter(a=>!i.has(a));return o.length>0&&n.push(`each revision source names components of this answer; not one of them: ${o.map(String).join(", ")}`),n}var Cm=64*1024,Sm=512*1024,UP=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var pBe=V(require("path"));var yl=(s=>(s.Clean="clean",s.RecipeDrift="recipe-drift",s.ChangeBrokeBringup="change-broke-bringup",s.BringupFailed="bringup-failed",s))(yl||{}),Hp=g.string().trim().min(1),VEt=g.object({url:g.string().optional().describe("the URL probed, if the check is an HTTP request"),command:g.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:g.record(g.string()).optional(),status:g.union([g.number(),g.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Hp.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),jI=g.object({schemaVersion:g.literal(1),baseUrls:g.record(g.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:VEt.optional(),teardown:Hp.describe("command that tears the SUT down"),dependencies:g.record(g.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:g.nativeEnum(yl).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:g.array(g.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:g.object({command:Hp,output:Hp}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:g.array(g.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:g.boolean(),startedAt:Hp.describe("ISO timestamp"),revisions:g.array(g.object({component:Hp.describe("a shared component listed above"),url:Hp.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Hp.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 Y3(t){let e=[],r=s=>!!s&&typeof s=="object"&&!Array.isArray(s);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(s=>typeof s=="string"&&s.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(s=>typeof s=="string"&&s.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 Es=g.string().trim().min(1),J3=(r=>(r.TestbotManaged="testbot_managed",r.CustomerDeployed="customer_deployed",r))(J3||{}),zI=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],K3=g.object({schemaVersion:g.literal(1),type:g.nativeEnum(J3).optional(),status:g.enum(["ready","blocked"]),environment:hE.optional(),components:g.array(g.object({name:Es,repository:Es.describe(`owner/repo, or "${$n}" for a customer-deployed component no repository builds`),healthy:g.boolean(),url:g.string().min(1).nullable(),...V3,credentials:g.array(g.string().regex(fE)).max(50).optional(),deployed:Es.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:g.array(g.object({framework:Es,file:Es,result:g.enum(["pass","fail","error"])}).strict()),inputsUsed:g.array(Es),inputsUsedHow:g.array(g.object({input:Es,how:Es}).strict()).optional(),inputsNotUsed:g.array(g.object({input:Es,reason:Es}).strict()),blockers:g.array(g.object({component:Es,problem:Es,evidence:Es,fix:Es}).strict()),replay:g.object({outcome:Es,durationSeconds:g.number().nonnegative().nullable()}).strict().nullable(),files:g.array(g.object({path:Es,content:g.string()}).strict())}).strict().superRefine((t,e)=>{t.inputsUsedHow?.forEach((s,i)=>{t.inputsUsed.includes(s.input)||e.addIssue({code:g.ZodIssueCode.custom,path:["inputsUsedHow",i,"input"],message:"not one of inputsUsed"})}),t.components.forEach((s,i)=>{s.credentials&&new Set(s.credentials).size!==s.credentials.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"credentials"],message:"names a credential twice"})});let r=t.type==="customer_deployed";r!==(t.environment!==void 0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),t.environment&&new Set(t.environment.credentials).size!==t.environment.credentials.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let n=new Set(t.components.map(s=>s.name));if(t.environment?.revisionSources.forEach((s,i)=>{s.components.forEach((o,a)=>{n.has(o)||e.addIssue({code:g.ZodIssueCode.custom,path:["environment","revisionSources",i,"components",a],message:"not one of components"})})}),t.components.forEach((s,i)=>{s.deployed!==void 0!==r&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),s.repository===$n&&!r&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"repository"],message:`only a customer_deployed component is ${$n}`})}),r&&(t.components.forEach((s,i)=>{t.components.findIndex(o=>o.name===s.name)!==i&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",i,"name"],message:"names a component twice"})}),t.replay!==null&&e.addIssue({code:g.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),t.files.forEach((s,i)=>{zI.includes(s.path)&&e.addIssue({code:g.ZodIssueCode.custom,path:["files",i,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),r&&t.status==="ready"){let s=new Set(t.environment?.revisionSources.flatMap(i=>i.components));t.components.forEach((i,o)=>{i.repository!==$n&&!s.has(i.name)&&e.addIssue({code:g.ZodIssueCode.custom,path:["components",o,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var dnr=["clean","recipe-drift"];function VI(t){let e=pBe.posix.normalize(t);return e===t&&(e===".skyramp/workspace.yml"||e.startsWith(".skyramp/sut/")&&e.length>13)}var fBe=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh",".skyramp/sut/health.json",".skyramp/workspace.yml"],hBe=[".skyramp/sut/health.json",".skyramp/workspace.yml"];var YI=(r=>(r.GitHub="github",r.AzureDevOps="azure-devops",r))(YI||{}),t4=(i=>(i.Trigger="TRIGGER",i.Baseline="BASELINE",i.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",i.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",i.ManualOverride="MANUAL_OVERRIDE",i))(t4||{}),GP=(i=>(i.PullRequest="pull_request",i.ReadyForReview="ready_for_review",i.Schedule="schedule",i.Manual="manual",i.SutSetup="sut_setup",i))(GP||{}),WEt=["sut_setup"],YEt=["sut_setup","schedule"];var HP=(e=>(e.PullRequest="pull_request",e))(HP||{}),jP=(s=>(s.ModelProvider="model_provider",s.SutAccess="sut_access",s.Skyramp="skyramp",s.Other="other",s))(jP||{});var zP=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s))(zP||{}),SBe=(r=>(r.Running="running",r.Ended="ended",r))(SBe||{}),VP=(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))(VP||{}),r4=(n=>(n.Onboard="onboard",n.Deploy="deploy",n.Recheck="recheck",n))(r4||{}),n4=(r=>(r.Started="started",r.Finished="finished",r))(n4||{}),s4=(n=>(n.Passed="passed",n.Failed="failed",n.Skipped="skipped",n))(s4||{});var i4=(n=>(n.ChooseCredential="choose_credential",n.FreeText="free_text",n.ChooseSource="choose_source",n))(i4||{});var JI=(n=>(n.Discover="discover",n.Start="start",n.Check="check",n))(JI||{}),WP=(s=>(s.Found="found",s.Starting="starting",s.Up="up",s.OutOfScope="out_of_scope",s))(WP||{}),Va=g.string().regex(/^[1-9][0-9]{0,18}$/),AE=g.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),ta=g.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),Hs=g.string().regex(/^[0-9a-f]{64}$/),qP=g.object({id:ta,revision:Va}).strict(),to=g.object({provider:g.nativeEnum(YI),providerAccountId:Va,providerRepositoryId:Va}).strict(),Z3=t=>`${t.provider}:${t.providerRepositoryId}`,IBe=to.extend({namespace:g.string().min(1),name:g.string().min(1)}).strict(),mBe=g.object({ref:g.string().min(1),revision:AE}).strict(),JEt=g.object({repository:IBe,revision:AE,ref:g.string().nullable(),reason:g.nativeEnum(t4),change:g.object({kind:g.nativeEnum(HP),number:Va,base:mBe.optional()}).strict().nullable(),compareWith:mBe.optional()}).strict();function KEt(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=>Z3(o.repository))),s=new Set(e.map(o=>Z3(o.repository)));return s.size===e.length&&s.size===n.size&&[...s].every(o=>n.has(o))?null:"names every source of the snapshot, once"}var xBe=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,vBe=/^[1-9][0-9]{0,18}$/,gBe=new RegExp(`${xBe.source}|${vBe.source}`),ABe=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,XEt=g.union([g.object({source:g.literal("jira"),site:g.string().regex(ABe),key:g.string().regex(xBe),updated:g.string().datetime(),contentHash:Hs}).strict(),g.object({source:g.literal("confluence"),site:g.string().regex(ABe),key:g.string().regex(vBe),version:g.number().int().positive(),contentHash:Hs}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),contentHash:Hs}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),contentHash:Hs,fileName:g.string().min(1).max(255),mediaType:g.nativeEnum(dE)}).strict()]),yBe=g.union([g.literal("jira"),g.literal("confluence")]),ZEt=g.object({schemaVersion:g.literal(1),items:g.array(g.union([g.object({source:yBe,site:g.string(),key:g.string().regex(gBe),state:g.literal("read"),text:g.string(),version:g.string().min(1),contentMatches:g.boolean()}).strict(),g.object({source:yBe,site:g.string(),key:g.string().regex(gBe),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),state:g.literal("read"),text:g.string(),version:g.string().min(1),contentMatches:g.boolean()}).strict(),g.object({source:g.literal("other"),key:g.string().regex(UI),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),state:g.literal("read"),version:Hs,fileName:g.string().min(1).max(255),mediaType:g.nativeEnum(dE)}).strict(),g.object({source:g.literal("other"),key:g.string().regex(uE),state:g.literal("not_read"),reason:g.nativeEnum(bm)}).strict()])),instructions:g.array(g.string()).optional()}).strict(),ebt=g.object({schemaVersion:g.literal(1),runId:ta,skyrampOrgId:ta,target:qP,policy:qP.nullable(),trigger:g.object({kind:g.nativeEnum(GP),requestedAt:g.string().datetime()}).strict(),configuration:g.object({captureId:ta,revision:Va.nullable(),hash:Hs}).strict(),baseline:g.object({confirmedRunId:ta.nullable(),sources:g.array(g.object({repository:to,revision:AE}).strict()).optional()}).strict(),sources:g.array(JEt).min(1),execution:g.object({provider:g.nativeEnum(YI),repository:IBe,workflowPath:g.string(),ref:g.string()}).strict(),credentials:g.array(g.object({name:g.string(),purpose:g.nativeEnum(jP),required:g.boolean()}).strict()),requirements:g.array(XEt).min(1).optional(),instructions:g.object({contentHash:Hs}).strict().optional()}).strict().superRefine((t,e)=>{let r=new Set;(t.requirements??[]).forEach((o,a)=>{let c="fileName"in o?"file":"pasted";o.source==="other"&&o.key!==`${c}-${o.contentHash.slice(0,16)}`&&e.addIssue({code:g.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",a,"key"]});let l=za({source:o.source,key:o.key});r.has(l)&&e.addIssue({code:g.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",a,"key"]}),r.add(l)});let n=t.trigger.kind,s=WEt.includes(n);s!==(t.policy===null)&&e.addIssue({code:g.ZodIssueCode.custom,path:["policy"],message:s?`a ${n} run has no policy`:"names the policy revision"});let i=KEt(t);i&&e.addIssue({code:g.ZodIssueCode.custom,path:["baseline","sources"],message:i}),YEt.includes(n)&&t.sources.forEach((o,a)=>{o.reason!=="BASELINE"&&e.addIssue({code:g.ZodIssueCode.custom,path:["sources",a,"reason"],message:`a ${n} run selects only BASELINE sources`})}),t.sources.forEach((o,a)=>{o.compareWith&&(o.reason!=="MANUAL_OVERRIDE"||o.change)&&e.addIssue({code:g.ZodIssueCode.custom,path:["sources",a,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"})})});var o4=(r=>(r.Person="person",r.Policy="policy",r))(o4||{}),tbt=g.object({kind:g.nativeEnum(o4),name:g.string().min(1).max(256)}).strict(),ynr=g.object({schemaVersion:g.literal(1),attempt:g.object({id:ta,number:g.number().int().positive(),deadlineAt:g.string().datetime()}).strict(),manifest:ebt,manifestHash:Hs,entitlements:g.array(g.string()).optional(),runToken:g.string().min(1).optional(),requestedBy:tbt.nullable().optional(),writeAllowed:g.boolean().optional(),claudeCodeVersion:g.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional()}).strict(),Enr=g.object({schemaVersion:g.literal(1),runId:ta,execution:g.object({provider:g.nativeEnum(YI),repository:to,providerRunId:Va,providerRunAttempt:g.number().int().positive(),workflowRef:g.string().min(1)}).strict(),requester:g.literal(!0).optional(),writeCheck:g.literal(!0).optional(),claudeCodePin:g.literal(!0).optional()}).strict(),EBe=g.object({repository:to,number:Va}).strict(),rbt=g.discriminatedUnion("status",[g.object({status:g.literal("none")}).strict(),g.object({status:g.literal("delivered"),pullRequests:g.array(EBe).min(1)}).strict(),g.object({status:g.literal("partial"),pullRequests:g.array(EBe).min(1),failures:g.array(g.object({repository:to,message:g.string()}).strict()).min(1)}).strict(),g.object({status:g.literal("failed"),message:g.string()}).strict()]),nbt=g.object({sufficiency:g.nativeEnum($I),rationale:g.string().min(1),gaps:g.array(g.string().min(1)),acceptedEvidence:g.array(g.object({kind:g.nativeEnum(Gp),repository:g.string().min(1),revision:AE,reference:g.string().min(1),summary:g.string().min(1)}).strict()),actionRequired:g.array(g.nativeEnum(qI))}).strict().superRefine((t,e)=>{t.sufficiency==="sufficient"!=(t.gaps.length===0)&&e.addIssue({code:g.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:g.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),gE=500,a4=2048,c4=1e3,sbt=g.object({testResults:g.array(g.object({resultId:g.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:g.string().regex(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/),testType:g.string(),endpoint:g.string(),status:g.enum(["Pass","Fail","Skipped"]),details:g.string(),fileName:g.string().optional(),testId:g.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:g.object({kind:g.nativeEnum(GI),family:g.nativeEnum(OP).optional()}).strict().optional()}).strict()),validation:nbt,changes:g.array(g.object({id:g.string().min(1).max(512),text:g.string().max(16384),source:g.string().max(a4),testedBy:g.array(g.string().min(1).max(1024)).max(gE),writtenBy:g.array(g.string().min(1).max(1024)).max(gE),maintainedBy:g.array(g.string().min(1).max(1024)).max(gE)}).strict()).max(c4).optional(),traceVersion:g.literal(1)}).passthrough().superRefine((t,e)=>{let r=new Set;t.testResults.forEach((n,s)=>{let i=n.failureCause;i&&n.status==="Pass"&&e.addIssue({code:g.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),i&&i.kind==="environment"!=(i.family!==void 0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let o=["testResults",s,"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:g.ZodIssueCode.custom,path:o,message:"is not repository:testType:path for this result"}),r.has(n.resultId)&&e.addIssue({code:g.ZodIssueCode.custom,path:o,message:"stable identity repeated"}),r.add(n.resultId)})}),bBe=t=>t.replace(/[%:#]/g,e=>encodeURIComponent(e));function l4(t,e,r,n){let s=r.replace(/\\/g,"/"),i=s.split("/").filter(c=>c!==""&&c!==".");if(s.startsWith("/")||/^[A-Za-z]:/.test(s)||i.length===0||i.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${r}"`);let o=i.join("/"),a=`${t}:${e}:${bBe(o)}`;return n?`${a}#${bBe(n)}`:a}var RBe=50,wBe=g.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),BBe=g.discriminatedUnion("kind",[g.object({kind:g.literal("branch_pushed"),repository:to,branch:wBe,commit:AE}).strict(),g.object({kind:g.enum(["pull_request_opened","pull_request_edited"]),repository:to,number:Va,branch:wBe}).strict()]),ibt=g.object({schemaVersion:g.literal(1),run:g.object({runId:ta,attemptNumber:g.number().int().positive(),manifestHash:Hs}).strict(),target:qP,policy:qP,provenance:g.object({sources:g.array(g.object({repository:to,revision:AE}).strict())}).strict(),delivery:g.object({generatedTests:rbt}).strict(),producer:g.object({testbot:g.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:g.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:sbt,githubWrites:g.array(BBe).max(RBe).optional()}).strict(),bnr=ibt.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:K3}).strict().superRefine(({recipe:t},e)=>{let r=(i,o)=>e.addIssue({code:g.ZodIssueCode.custom,path:["recipe",...i],message:o});t.status==="blocked"&&t.blockers.length===0&&r(["blockers"],"a blocked recipe names at least one blocker");let n=new Set,s=0;t.files.forEach((i,o)=>{VI(i.path)||r(["files",o,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),n.has(i.path)&&r(["files",o,"path"],"file repeated"),n.add(i.path),UP.test(i.content)&&r(["files",o,"content"],"is not text");let a=Buffer.byteLength(i.content,"utf8");s+=a,a>Cm&&r(["files",o,"content"],`larger than ${Cm} bytes`)}),s>Sm&&r(["files"],`recipe text over ${Sm} bytes in total`)}),obt=g.object({schemaVersion:g.literal(1),stage:g.nativeEnum(r4),event:g.nativeEnum(n4),status:g.nativeEnum(s4).optional()}).strict().refine(t=>t.status===void 0||t.event==="finished",{path:["status"],message:"only a finished stage has a status"}),KI=100,kBe=5e3,X3=2e3,e4=100,u4=/^[A-Za-z0-9_-]{1,64}$/,TBe=20,NBe=200,_Be=100,PBe=100,abt=200,cbt=/^[^/\s]+\/[^/\s]+$/,QBe=500,DBe=50,d4=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,El=t=>g.string().max(t).refine(e=>e.trim().length>0&&!d4.test(e),"blank, or not text"),mE={sequence:g.number().int().min(1).max(kBe),at:g.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},OBe=g.discriminatedUnion("kind",[g.object({...mE,kind:g.literal("log"),phase:g.nativeEnum(JI),text:El(X3)}).strict(),g.object({...mE,kind:g.literal("component"),name:El(e4),repository:El(abt).refine(t=>cbt.test(t)||t===$n,"not owner/name"),file:El(QBe).nullable(),status:g.nativeEnum(WP),version:El(PBe).optional()}).strict(),g.object({...mE,kind:g.literal("reply"),to:g.string().uuid(),accepted:g.boolean(),text:El(X3)}).strict(),g.object({...mE,kind:g.literal("question"),id:g.string().regex(u4),type:g.nativeEnum(i4),text:El(X3),component:El(e4).nullable(),choices:g.array(El(NBe)).max(TBe),placeholder:El(_Be).optional()}).strict(),g.object({...mE,kind:g.literal("delivered"),ids:g.array(g.string().uuid()).max(KI)}).strict(),g.object({...mE,kind:g.literal("credentials"),names:g.array(g.string().regex(fE)).min(1).max(DBe)}).strict()]).superRefine((t,e)=>{t.kind==="credentials"&&new Set(t.names).size!==t.names.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["names"],message:"a name twice"}),t.kind==="question"&&(t.type==="free_text"!=(t.choices.length===0)&&e.addIssue({code:g.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(t.choices).size!==t.choices.length&&e.addIssue({code:g.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),lbt=g.object({schemaVersion:g.literal(1),events:g.array(OBe).max(KI)}).strict(),CBe={id:g.string().uuid(),text:g.string(),by:g.string().nullable(),at:g.string()},ubt=g.discriminatedUnion("kind",[g.object({...CBe,kind:g.literal("instruction"),question:g.null()}),g.object({...CBe,kind:g.literal("answer"),question:g.string().regex(u4)})]),MBe=g.string().regex(/^[A-Za-z0-9+/]{43}=$/),dbt=g.object({schemaVersion:g.literal(1),leftOut:g.array(g.string()),messages:g.array(ubt).optional(),stop:g.object({key:MBe}).optional()});var FBe=500*1024*1024,LBe=g.object({id:Va,name:g.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Va,expiresAt:g.string().datetime()}).strict(),pbt=g.object({schemaVersion:g.literal(1),artifact:LBe,sessionId:ta,contentHash:Hs,bytes:g.number().int().min(1).max(FBe)}).strict(),fbt=g.object({schemaVersion:g.literal(1),checkpoint:g.object({artifact:LBe,repository:g.object({namespace:g.string().min(1),name:g.string().min(1)}).strict(),sessionId:ta,contentHash:Hs,key:MBe}).strict().nullable()}).strict(),hbt=200,$P=100,YP=(n=>(n.Resume="resume",n.Retry="retry",n.Update="update",n))(YP||{}),mbt=g.object({kind:g.nativeEnum(YP),setup:g.object({runId:ta,endedAt:g.string().nullable(),outcome:g.string().nullable()}).strict(),components:g.array(g.object({name:g.string().min(1),repository:g.string().min(1),status:g.nativeEnum(WP)}).strict()).max($P),credentials:g.array(g.string().min(1)).max($P),answers:g.array(g.object({question:g.string(),answer:g.string().nullable()}).strict()).max($P),instructions:g.array(g.object({text:g.string(),reply:g.string().nullable()}).strict()).max($P),log:g.array(g.object({phase:g.nativeEnum(JI),text:g.string()}).strict()).max(hbt)}).strict(),gbt=g.object({schemaVersion:g.literal(1),context:mbt.nullable()}).strict(),Abt=g.object({schemaVersion:g.literal(1),configuration:g.object({captureId:ta,revision:Va.nullable(),hash:Hs}).strict(),capture:g.object({schemaVersion:g.literal(1),settings:g.object({target:g.object({environment:g.unknown()}).passthrough(),timeoutMinutes:g.number().int().positive(),answerWaitMinutes:g.number().int().positive().optional(),testEnvironment:g.object({name:g.string().min(1),address:g.string().min(1).optional(),readyWhen:g.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:g.object({}).passthrough(),hash:Hs}).strict()}).strict(),ybt=hE.extend({version:g.number().int().positive(),components:g.array(g.object({name:g.string().min(1),repository:g.string().min(1)}).strict()),contentHash:Hs.optional(),files:g.array(g.object({path:g.string().refine(t=>VI(t)&&!zI.includes(t),"not a file of a customer_deployed plan"),content:g.string()}).strict()).optional()}).strict(),Ebt=g.object({schemaVersion:g.literal(1),testEnvironment:ybt.nullable().optional(),runtimePlan:g.object({version:g.number().int().positive(),contentHash:Hs,files:g.array(g.object({path:g.string().refine(VI,"not a recipe file path"),content:g.string()}).strict()).min(1),recipe:g.record(g.unknown()).optional()}).strict().nullable()}).strict().refine(t=>!(t.runtimePlan&&t.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),bbt=g.object({schemaVersion:g.literal(1),state:g.nativeEnum(SBe),ending:g.nativeEnum(zP).nullable(),cause:g.nativeEnum(VP).nullable(),deadlineAt:g.string().datetime()}).strict();function UBe(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:wbt(t)}}function wbt(t){return t.credentialMissing?"credential_missing":t.checkoutFailed?"checkout_failed":t.setupFailed?"setup_failed":t.timedOut?"timed_out":"agent_failed"}var $Be=V(require("fs")),jp=V(require("path"));var qBe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var js=t=>new Map((t??[]).flatMap(e=>e.file?[[gi(e.key),e.file.name]]:[])),Cbt=10*1024*1024,Im=t=>t?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||t?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",GBe=(t,e)=>jp.join(jp.dirname(t),`${jp.basename(t,jp.extname(t))}${e}`),xm=t=>GBe(t,".extracted.txt");function p4(t){try{return/\S/.test($Be.readFileSync(xm(t),"utf-8"))}catch{return!1}}var f4=t=>GBe(t,".quotes.txt");function HBe(t){return Im(t.file)?xm(t.path):t.file?.mediaType==="application/pdf"?f4(t.path):t.path}function JP(t){return t.map(e=>e.state!=="read"||!Im(e.file)||p4(e.path)?e:{...wm(e),file:e.file,state:"not_read",reason:"cannot_open"})}var ns=t=>t.slice(0,12);var Sbt=["generate-unit","native-run"],Ibt=["preflight","plan","write",...Sbt,"report","deliver"];var vm=(n=>(n.Unit="unit",n.Integration="integration",n.E2e="e2e",n))(vm||{});var KP=1440;var yE=V(require("fs")),bl=V(require("path"));function EE(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var xbt=8;function ce(t,e,r={}){let n=e.slice(0,xbt),s=e.length-n.length;return{name:t,passed:!1,details:n.join("; ")+(s>0?`; \u2026and ${s} more`:""),...r.fatal?{fatal:!0}:{}}}function wl(t){if(yE.existsSync(t))try{return JSON.parse(yE.readFileSync(t,"utf-8"))}catch{return}}function ee(t,e){return wl(bl.join(t.outputsDir,e))}function ot(t,e,r,n){if(!r)throw new Error(`${e}.json unexpectedly invalid at artifact time: ${n[0]}`);let s=bl.join(t.outputsDir,`${e}.json`);return yE.writeFileSync(s,JSON.stringify(r,null,2)+`
|
|
220
220
|
`),{[e]:bl.relative(t.runDir,s)}}function qn(t,e){return{name:t,verify(r,n){let{errors:s}=e(r,n);return s.length===0?{name:this.name,passed:!0}:ce(this.name,s,{fatal:!0})}}}function jBe(t,e){return{...t,name:e}}function Ot(t,e){return bl.relative(t,bl.resolve(t,e)).replace(/\/+$/,"")}function XI(t){return t.replace(/\s+/g," ").trim()}function zp(t){return bl.basename(t).replace(/\.[^.]+$/,"").toLowerCase()}var zs=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");function Yu(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 zBe=V(require("fs")),XP=V(require("path"));function Ju(t,e,r={}){let n=r.maxDepth??1/0,s=!1,i=(o,a)=>{let c;try{c=zBe.readdirSync(o,{withFileTypes:!0})}catch{return}for(let l of c){if(s)return;let u=XP.join(o,l.name);if(l.isDirectory())!r.skip?.has(l.name)&&a<n&&i(u,a+1);else if(e(u,XP.relative(t,u))===!1){s=!0;return}}};i(t,0)}var ZP="\xABredacted\xBB";function Gr(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(ZP));return r}function hr(t,e){if(e.length===0)return t;let r=n=>typeof n=="string"?Gr(n,e):Array.isArray(n)?n.map(r):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[s,r(i)])):n;return r(t)}var _nr=new TextDecoder("utf-8",{fatal:!0});var bE=(r=>(r.Full="full",r.Static="static",r))(bE||{}),ra=(n=>(n.Contract="contract",n.Integration="integration",n.Ui="ui",n))(ra||{}),ZI=(i=>(i.OwnSurface="own_surface",i.StateReadBack="state_read_back",i.Referential="referential",i.Lifecycle="lifecycle",i.Boundaries="boundaries",i))(ZI||{}),Rm=(s=>(s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s))(Rm||{}),ex=(l=>(l.Equals="equals",l.NotEquals="not_equals",l.GreaterThan="greater_than",l.LessThan="less_than",l.Contains="contains",l.NotContains="not_contains",l.Matches="matches",l.Absent="absent",l.Present="present",l))(ex||{}),eQ=["absent","present"],ro=g.string().trim().min(1),vbt=g.object({subject:ro.describe('what the test READS: a response field path, the literal "status", or the on-screen text for a ui case \u2014 the FINAL read in a multi-step case'),comparator:g.nativeEnum(ex),value:g.union([g.string(),g.number(),g.boolean(),g.null()]).optional().describe("the ONE value a broken build would not produce; OMIT for absent/present")}),Rbt=g.object({test:ro.describe("existing test path, relative to its repository"),repository:ro.optional().describe("owner/repo the test lives in, when the run has several checkouts; omit for the working checkout"),action:g.nativeEnum(Rm),evidence:ro.describe("why \u2014 drift vs the diff, or a finding"),covers_behaviors:g.array(g.string()).optional().describe("analyze behavior ids this maintenance covers")}),Bbt=g.object({surface:ro.describe("a surface from the list, copied verbatim"),axis:g.nativeEnum(ZI)}),kbt=g.object({id:ro.describe("short-slug, unique across generate[]"),type:g.nativeEnum(ra),target:ro.describe('"METHOD /path", or a business-flow name'),from_finding:g.string().optional().describe("analyze finding id this case catches"),from_behavior:g.string().optional().describe("analyze behavior id this case pins"),derived_from:Bbt.optional().describe("the surface \xD7 axis this case pins when no analyze behavior or finding names it \u2014 one of the three is required"),rationale:ro.describe("why this test matters"),expected_observable:ro.describe("one sentence for a human: what a catching test asserts, and what a broken build does instead"),expected:vbt.describe("the same intent AS DATA \u2014 see the rules below"),seededPrecondition:ro.optional().describe("seeded non-initial state + how to reach it; only when a seeded-state transition applies"),verifiable:g.boolean().describe("true only when a live SUT could confirm this test (full mode)")}),Tbt=g.object({covered:g.array(g.string()).optional(),abstain:g.string().optional()}).superRefine((t,e)=>{let r=Array.isArray(t.covered),n=typeof t.abstain=="string";if(r===n)return void e.addIssue({code:g.ZodIssueCode.custom,message:"must have exactly one of covered[] or abstain"});r&&t.covered.length===0&&e.addIssue({code:g.ZodIssueCode.custom,path:["covered"],message:"must list at least one id (else abstain)"}),n&&!t.abstain.trim()&&e.addIssue({code:g.ZodIssueCode.custom,path:["abstain"],message:"must give a reason"})}).describe('{ "covered": [ids] } OR { "abstain": "reason" } \u2014 exactly one'),Nbt=g.object({surface:ro.describe("a surface from the list, copied verbatim"),axes:g.object(Object.fromEntries(Object.values(ZI).map(t=>[t,Tbt])))}),tx=g.object({schemaVersion:g.literal(1),mode:g.nativeEnum(bE),maintenance:g.array(Rbt),generate:g.array(kbt),surfaces:g.array(Nbt).describe("one entry per changed surface in the list \u2014 none missing, none invented"),budget:g.object({total:g.number().describe("case count"),rationale:ro}),summary:ro.describe("one paragraph")});function tQ(t,e,r){let n=s=>{if(!s||!Array.isArray(s.covered))return s;let i=s.covered.filter(o=>!e.has(o));return i.length>0?{covered:i}:{abstain:`its only case(s) were ${r}: ${s.covered.join(", ")}`}};return t.map(s=>({...s,axes:Object.fromEntries(Object.entries(s.axes??{}).map(([i,o])=>[i,n(o)]))}))}function VBe(t){let e=[],r=new Set;if(Array.isArray(t.generate)&&t.generate.forEach((n,s)=>{let i=n?.id;typeof i=="string"&&(r.has(i)&&e.push(`generate[${s}].id "${i}" is duplicated`),r.add(i))}),Array.isArray(t.generate)&&t.generate.forEach((n,s)=>{let i=n;!i.from_finding&&!i.from_behavior&&!i.derived_from&&e.push(`generate[${s}] carries none of from_behavior, from_finding or derived_from \u2014 say what obligation it pins`)}),Array.isArray(t.surfaces)){let n=new Set;t.surfaces.forEach((s,i)=>{let o=s;if(typeof o.surface=="string"){let a=o.surface.trim().toLowerCase();n.has(a)&&e.push(`surfaces[${i}] "${o.surface}" is listed twice`),n.add(a)}for(let[a,c]of Object.entries(o.axes??{})){let l=c?.covered;if(Array.isArray(l))for(let u of l)(typeof u!="string"||!r.has(u))&&e.push(`surfaces[${i}].axes.${a}.covered references unknown generate id ${JSON.stringify(u)}`)}})}return e}var bs=["-c","core.fsmonitor=false"],_bt=new Set(["GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","ACTIONS_RUNTIME_TOKEN","ACTIONS_ID_TOKEN_REQUEST_TOKEN","ACTIONS_ID_TOKEN_REQUEST_URL","SSH_AUTH_SOCK","GIT_SSH","GIT_SSH_COMMAND","GITHUB_STEP_SUMMARY"]),h4=new Set(["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK","AWS_PROFILE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN","AWS_ROLE_SESSION_NAME","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"]);function Ye(t=process.env,e,r="repo-command"){let n={};for(let[s,i]of Object.entries(t))r==="repo-command"&&h4.has(s)||(n[s]=i);Object.assign(n,e??{});for(let s of Object.keys(n))(_bt.has(s)||s.startsWith("INPUT_"))&&delete n[s];return n}var Bm=".skyramp/sut/deployed-revisions.sh",m4=(r=>(r.Running="running",r.Requested="requested",r))(m4||{});var $nr=new Set(Object.values(m4));var Pbt=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/,WBe=t=>Pbt.test(t);function rQ(t){return t?.find(e=>e.path===Bm)}var qnr=`Fix ${Bm} so it prints the full commit each component runs, then set it up again.`;var Vs="shared-environment",Qbt=1e4,YBe=5,y4=300,Dbt=200,Obt=/\b[0-9a-fA-F]{7,64}\b/g,Mbt=/\b(commit|sha|revision|rev|hash)\b/i,wE=t=>t.slice(0,y4),rx=t=>wE(t.trim())||"(empty response)";function JBe(t,e){let r=t.split(/\r?\n/).find(s=>s.toLowerCase().includes(e)).trim(),n=r.toLowerCase().indexOf(e);return r.length<=y4?r:r.slice(Math.max(0,n-100),Math.max(0,n-100)+y4)}function nx(t,e){if("error"in e)return{status:"unverifiable",observedRevision:null,evidence:rx(e.error)};let r=t.toLowerCase(),n=c=>Mbt.test(JBe(e.body,c)),s=(e.body.match(Obt)??[]).map(c=>c.toLowerCase()).filter(c=>/[a-f]/.test(c)||r.startsWith(c)&&n(c)),i=[...new Set(s)].filter((c,l,u)=>!u.some(d=>d!==c&&d.startsWith(c)));if(i.length>1)return{status:"unverifiable",observedRevision:null,evidence:rx(`The answer names more than one revision: ${i.join(", ")}`)};let[o]=i;return o?{status:r.startsWith(o)?"verified":"mismatch",observedRevision:o,evidence:JBe(e.body,o)}:{status:"unverifiable",observedRevision:null,evidence:rx(e.body)}}async function sx(t,e=fetch){try{let r=AbortSignal.timeout(Qbt),n=new URL(t).origin,s=new URL(t);for(let i=0;;i+=1){let o=await e(s,{redirect:"manual",signal:r}),a=o.status>=300&&o.status<400?o.headers.get("location"):null;if(a){let l=new URL(a,s);if(l.origin!==n)return{error:`${t} redirects to another origin (${l.origin})`};if(i>=YBe)return{error:`${t} redirects more than ${YBe} times`};s=l;continue}let c=await o.text();return o.ok?{body:c}:{error:`${t} answered ${o.status}: ${c.trim()}`}}}catch(r){let n=r instanceof Error&&r.cause instanceof Error?`: ${r.cause.message}`:"";return{error:`${t} could not be read: ${r instanceof Error?r.message:String(r)}${n}`}}}var tsr=new Set(["version_endpoint","api"]);function ix(t){return(t?.components??[]).filter(e=>!!e.repository&&!!e.expectedRevision)}function nQ(t){return ix(t.sharedEnvironment).filter(e=>!e.revisionUrl&&!e.revisionScript)}async function Fbt(t,e,r=[]){let{name:n,url:s}=t;if(!t.versionUrl)return{name:n,url:s,version:null,evidence:"No version URL is configured."};let i=hr(await sx(t.versionUrl,e),r);if("error"in i)return{name:n,url:s,version:null,evidence:rx(i.error)};let o=i.body.split(/\r?\n/).map(a=>a.trim()).find(Boolean);return{name:n,url:s,version:o?o.slice(0,Dbt):null,evidence:rx(o??"")}}var KBe=(t,e)=>!!t&&!!e&&t.toLowerCase()===e.toLowerCase(),XBe=(t,e)=>t.name===e.name&&KBe(t.repository,e.repository);async function Lbt(t,e,r){let{frozen:n,mergeCommit:s,mergedHead:i}=e;return!s||!i?"not_contained":i.toLowerCase()===n.toLowerCase()?"contained":r?.commitContains?r.commitContains({repository:t,ancestor:n,descendant:i}):"unknown"}async function g4(t,e,r){let n=e.observedRevision;if(e.status!=="mismatch"||!n||!t.acceptedRevisions)return e;let{frozen:s,mergeCommit:i,mergedHead:o}=t.acceptedRevisions,a=await Lbt(t.repository,t.acceptedRevisions,r),c=[s,...i&&a==="contained"?[i]:[]],l=f=>`${f===s?"the frozen revision":"the merge commit"} ${ns(f)}`,u=(f,h)=>({status:f,observedRevision:n,evidence:wE(`${h} (${e.evidence})`)}),d=c.find(f=>f.toLowerCase().startsWith(n));if(d)return u("verified",`observed ${ns(n)} is ${l(d)}`);if(!r?.commitContains)return u("unverifiable",`could not tell whether observed ${ns(n)} contains ${c.map(ns).join(" or ")}: this run cannot compare commits`);let p=[];for(let f of c){let h=await r.commitContains({repository:t.repository,ancestor:f,descendant:n});if(h==="contained")return u("verified",`observed ${ns(n)} contains ${l(f)}`);h==="unknown"&&p.push(f)}return p.length?u("unverifiable",`could not tell whether observed ${ns(n)} contains ${p.map(ns).join(" or ")}: GitHub did not answer the compare`):a==="unknown"&&o?u("unverifiable",`could not tell whether the merged head ${ns(o)} contains ${ns(s)}: GitHub did not answer the compare`):u("mismatch",`observed ${ns(n)} does not contain ${c.map(ns).join(" or ")}`)}function ZBe(t,e){let r=(i,o=null)=>({status:"unverifiable",observedRevision:o,evidence:wE(i)});if(!e)return r("Not checked: this run cannot run deployed-revisions.sh.");if(!e.ok)return r(e.error);let n=e.revisions[t.name];return n?WBe(n.revision)?n.state==="requested"?r(`deployed-revisions.sh reports only the requested state for ${t.name} (${n.revision}), which alone does not show what runs.`,n.revision):{status:t.expectedRevision.toLowerCase().startsWith(n.revision)?"verified":"mismatch",observedRevision:n.revision,evidence:wE(`deployed-revisions.sh: ${t.name} runs ${n.revision}`)}:r(`deployed-revisions.sh printed ${n.revision} for ${t.name}, which is not a full commit.`):r(`deployed-revisions.sh printed no revision for ${t.name}.`)}async function sQ(t,e,r,n=[],s,i){let o=(c,l)=>nx(c,hr(l,n));return{components:await Promise.all(ix(t).map(async c=>{let l={name:c.name,repository:c.repository,url:c.url,expectedRevision:c.expectedRevision};if(c.revisionScript)return{...l,source:"probe",...await g4(c,ZBe(c,i),s)};if(c.revisionUrl)return{...l,source:"probe",...await g4(c,o(c.expectedRevision,await sx(c.revisionUrl,r)),s)};let u=e.find(p=>p.component===c.name),d=o(c.expectedRevision,u?{body:u.output}:{error:"Deploy cited no check of its deployed revision."});return{...l,source:"agent",...await g4(c,d,s)}})),dependencies:await Promise.all(t.dependencies.map(c=>Fbt(c,r,n)))}}async function Ubt(t,e,r,n){if(t.revisionScript){let o=ZBe(t,n);return{failed:!n?.ok,now:o,noCommit:o.status==="unverifiable"}}let s=hr(await sx(t.revisionUrl,e),r),i=nx(t.expectedRevision,s);return{failed:"error"in s,now:i,noCommit:!i.observedRevision}}async function $bt(t,e,r,n=[],s){let i=await Promise.all(e.components.map(async o=>{let a=t.components.find(p=>XBe(p,o)),c=o.observedRevision?.toLowerCase();if(!c||!(a?.revisionUrl||a?.revisionScript))return o;let{failed:l,now:u,noCommit:d}=await Ubt({...a,expectedRevision:o.expectedRevision},r,n,s);if(d){let p=l?"second read failed":"second read names no one commit",f=`first read ${ns(o.observedRevision??c)}; ${p}: ${u.evidence}`;return{...o,status:"unverifiable",observedRevision:null,evidence:wE(f)}}return u.observedRevision.startsWith(c)||c.startsWith(u.observedRevision)?o:{...o,status:"unverifiable",observedRevision:u.observedRevision,evidence:wE(`changed from ${o.observedRevision} to ${u.observedRevision} during the run`)}}));return{...e,components:i}}async function E4(t,e){return e.components.some(r=>r.revisionScript)?t.deployedRevisions?.():void 0}async function eke(t,e){let r=t.inputs.sharedEnvironment,n=ee(t,`${Vs}.json`);if(!t.inputs.appRunning||!r||!n)return;let s=await $bt(r,n,e,t.secretValues??[],await E4(t,r));ot(t,Vs,hr(s,t.secretValues??[]),[])}function ox(t){return ix(t).length>0||(t?.dependencies.length??0)>0}function b4(t){let e=t.inputs?.sharedEnvironment;if(!ox(e))return;let r=ee(t,`${Vs}.json`);if(r)return{components:rke(e,r.components),dependencies:r.dependencies};let n="Not checked: deploy did not complete.";return{components:ix(e).map(s=>tke(s,n)),dependencies:e.dependencies.map(s=>({name:s.name,url:s.url,version:null,evidence:n}))}}function iQ(t){return t?.components.length?[`Testbot read which commit each component runs, before this session: ${t.components.map(r=>{let n=r.observedRevision?`${r.name} runs ${ns(r.observedRevision)}`:`${r.name} answered no commit`,s=r.status==="verified"?"verified":"not proven to run the change";return`${n}, ${s} (${r.evidence})`}).join("; ")}.`,"Which commit is deployed is Testbot's to check, not yours: record no gap, finding, issue or next step about it, and don't compare the deployed commit with your checkout."].join(" "):void 0}var tke=(t,e)=>({name:t.name,repository:t.repository,url:t.url,expectedRevision:t.expectedRevision,observedRevision:null,status:"unverifiable",source:t.revisionUrl||t.revisionScript?"probe":"agent",evidence:e});function rke(t,e){let r=new Set(e.map(s=>s.name.toLowerCase())),n=ix(t).filter(s=>s.touched&&!r.has(s.name.toLowerCase()));return[...e,...n.map(s=>tke(s,"Not checked: the run recorded no read of it."))]}function CE(t){return(b4(t)?.components??[]).filter(e=>e.status!=="verified")}function w4(t,e,r){if(!t.appRunning||r===!1)return[];let n=(t.sharedEnvironment?.components??[]).filter(s=>s.touched);return rke(t.sharedEnvironment,e?.components??[]).filter(s=>s.status!=="verified"&&n.some(i=>XBe(i,s)))}function nke(t){let e=r=>{let n=r.observedRevision?`runs ${ns(r.observedRevision)}`:"no revision could be read";return`${r.name} (${r.repository}) must run ${ns(r.expectedRevision)}, but ${n}: ${r.evidence}`};return t.length?`the Test Environment does not verifiably run the change: ${t.map(e).join("; ")}`:void 0}function oQ(t){return(t?.components??[]).filter(e=>!!e.repository&&!e.expectedRevision)}function ske(t,e=!1){return`${t.name}: ${t.repository} is not one of the run's sources, so its revision cannot be verified and ${ike(e)}`}var ike=t=>t?"runtime tests against it do not validate this change":"no runtime test ran against it";function oke(t,e=!1){let r=ns(t.expectedRevision),n=t.status==="mismatch"?`the shared environment runs ${t.repository} at ${t.observedRevision}, not ${r}`:`could not verify that the shared environment runs ${t.repository} at ${r}`;return`${t.name}: ${n}, so ${ike(e)}`}var qbt=/^\s*(POST|PUT|PATCH|DELETE)\s/i,A4=t=>t.mutates===!0;function km(t){return(t?.components??[]).filter(e=>!!e.repository)}function no(t){let e=t.sharedEnvironment;return!!e&&km(e).length>0&&!e.allowMutation&&!t.planOnly}function Gbt(t){let e=n=>qbt.test(n.target)||A4(n),r=[...t.generate.filter(e).map(n=>({id:n.id,target:n.target})),...t.maintenance.filter(A4).map(n=>({id:n.test}))];return{...t,generate:t.generate.filter(n=>!e(n)),surfaces:tQ(t.surfaces,new Set(r.map(n=>n.id)),"withheld because they change a shared environment the policy protects"),maintenance:t.maintenance.filter(n=>!A4(n)),withheld:r}}function SE(t,e){return e&&no(t)?Gbt(e):e}function aQ(t){return ee(t,"recommend.json")?.withheld??[]}function ake(t){return`${t.id}${t.target?` (${t.target})`:""}: needs a shared-environment mutation the policy does not allow`}var XE=V(require("fs")),KE=V(require("path"));function Kt(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}},s=n(r);if(s!==void 0)return{value:s};let i;if(r.startsWith("{")&&r.endsWith("}"))try{JSON.parse(r)}catch(c){i=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 f=r[p];if(d){d=!1;continue}if(f==="\\"){d=u;continue}if(f==='"'){u=!u;continue}if(!u){if(f==="{")l++;else if(f==="}"&&(l--,l===0)){let h=n(r.slice(c,p+1));h!==void 0&&Object.keys(h).length>0&&(a=h,c=p);break}}}}return i&&(a===void 0||Object.keys(a).length<3)?{error:`final message is not valid JSON \u2014 ${i}. 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}:i?{error:`final message is not valid JSON \u2014 ${i}. 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: "${Hbt(Gr(r,e))}"`}}var cke=240;function Hbt(t){let e=t.replace(/\s+/g," ").trim();return e.length<=cke?e:`\u2026${e.slice(-cke)}`}function or(t,e=0,r=new Set){return ax(t,e,r)}var lke=t=>" ".repeat(t);function ax(t,e,r){let n=jbt(t);switch(n._def.typeName){case"ZodObject":{let i=n.shape,o=Object.keys(i).filter(c=>!r.has(c)&&!i[c].description?.startsWith("[derived]"));return o.length===0?"{}":`{
|
|
221
221
|
${o.map((c,l)=>{let u=i[c],d=u.isOptional()?" (optional)":"",p=u.description?` // ${u.description}`:"",f=ax(u,e+2,r);return`${lke(e+2)}"${c}": ${f}${l<o.length-1?",":""}${d}${p}`}).join(`
|
|
222
222
|
`)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyramp/testbot-core",
|
|
3
|
-
"version": "0.13.0-v3.
|
|
3
|
+
"version": "0.13.0-v3.115",
|
|
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. dist/VERSION.json exists only in a release-engine.yml build. assets/gen-reference/ is the staged codegen reference corpus, which generate.ts finds at ../assets from dist/.",
|