@skyramp/testbot-core 0.13.0-v3.250 → 0.13.0-v3.251
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 +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.251","commit":"0f921fbbe74cadff1698d0d9cf658715392530b8"}
|
package/dist/main.js
CHANGED
|
@@ -636,7 +636,7 @@ export default {
|
|
|
636
636
|
`);let r=e.inputs.repositoryPath,n=t.recipe;return n.present?[`Bring the app up so the tests can run against it, and leave it running. The repo records how: ${[n.setupScript,n.teardownScript,n.authTokenScript,n.workspaceFile].filter(i=>!!i).map(i=>ws.relative(r,i)).join(", ")}.`,"Run it. If it has drifted, fix it and update those files to what actually worked. If this PR broke start-up, that's","a defect \u2014 say which changed file. Check that the app answers a real request with real data, not just an open port.",...PE,...n.budgetMinutes?[`Start-up can legitimately take up to ${n.budgetMinutes} minutes.`]:[],...n.healthHint?[`A known-good health check: ${JSON.stringify(n.healthHint)}`]:[],...n.stale?[`This PR changes start-up files (${n.staleFiles.join(", ")}), so the recipe may be out of date.`]:[],...uN(e,r2)].join(`
|
|
637
637
|
`):["Bring the app up so the tests can run against it, and leave it running. The repo has no recorded way to start it","(.skyramp/sut/setup.sh). Find how the repo starts it \u2014 a start or dev script, a Makefile target, a compose file,","its README or docs (a local or offline stack counts) \u2014 run that, save what worked as .skyramp/sut/setup.sh and",".skyramp/sut/teardown.sh, and set app.outcome to clean: there was no recorded way to drift. Set it to bringup-failed","only once a start you ran has failed, with the command and its error.",...PE,...uN(e,r2)].join(`
|
|
638
638
|
`)}var RN=e=>!!e.appRunning&&yl(e),Jor=new Set(["mutates"]);function Yor(e){return new Set([...RN(e.inputs)?[]:Jor,...sy(e.inputs).length?[]:["revisions"]])}function Kor(e){return RN(e.inputs)?[" The app runs in a shared environment this policy protects. A case or clause whose test changes state there (an"," API POST, PUT, PATCH or DELETE, in the test or its setup, or a UI flow that submits, creates, edits or deletes) is"," withheld by the runner and reported as a gap: prefer cases that only read, and mark each that still changes state,",' and each such maintenance item, "mutates": true.']:[]}function Att(e){return[" Under targeted_unit, probe in-process instead, the way the repo's own tests reach this code: one scratch test"," file, run with the repo's runner, that calls what decides each clause (the function or service, a handler through"," the repo's in-process test client, a component rendered as its tests render it), first with the input it normally"," gets, then with the same kinds of input, state and sequence. Put it where the runner finds it, name it so it is"," plainly scratch, keep a copy and its output",` under ${e}*, and delete it from the checkout once it has run. A flag that repeats there is a finding, with the`," call and its result as evidence, and gets its case as step 5 says."]}function Xor(e){if(!e.skyrampWalk)return[];let t=ws.join(ws.dirname(e.checkpoint),"journey-walks");return["10. Under runtime_required, walk each browser journey once against the running app with the Skyramp walk helper:",` a Node script that calls \`require(process.env.SKYRAMP_WALK).walk(...)\` (usage at the top of ${e.skyrampWalk.helper}),`,` with ${t} as its outputDir and the script there too, outside the checkout. Walk from the journey's entry`," through every step to the action that finishes it, checking at each step what the user should then see. When a"," step fails, the helper prints the page and an accessibility snapshot: where the selector or route was wrong, fix it"," and walk again; where the page does something other than what the change intends, walk it once more, and if it"," repeats it is a finding, as a flagged probe is. Then write each journey's steps with the selectors and routes that",` worked, and the updated plan to ${e.checkpoint}. The walk fixes how a step is done, never which steps there are: each`," journey keeps its entry, every step and its outcome as 5 planned them, and a step that could not be walked stays"," in, with what stopped it, for the test to reach."]}function Zor(e,t){if(e.inputs.planOnly)return[];if(!e.inputs.appRunning&&t.preflight&&!t.preflight.sutRequired)return[];let r=ws.join(ws.dirname(t.checkpoint),"probe");return RN(e.inputs)?["8. Probe before any test is written. Under runtime_required, probe the running app (skip it if the app isn't"," answering). It is a shared environment this policy protects: send only requests that change nothing (GET and"," HEAD: reads, lists, searches, filters, sorts) and never create, edit, delete, reset or seed anything there. Put",` every probe in one script under ${r}*, each tagged with the clause it checks, and run it, printing a line for`," each probe a check flags (what it read, the status codes, which check failed) and, per clause, how many probes it"," got. Probe each clause through reads, as widely as its code gives reason to: every state its records can be in,"," every field it adds through list, sort, filter and search, and odd query values (zero, negative, huge, empty, case"," variants). Flag any 5xx, and reads that disagree with each other or with derived values (totals, counts).",...Att(r),"9. Re-run each flagged probe once. Then probe once more where it is worth it: around each flag that repeated (the"," values and states next to it), for each clause a request could check that got no probe, and for each input or field"," the change adds that a kind of probe in 8 reached elsewhere but not there (a huge value sent to one number but not"," another, a field left out of one update but not another, a new field never sorted or filtered by); re-run what"," that flags. Each flag that repeats and involves what the change touched is a defect: add it to",' "findings" with the request and response as its evidence and the rule it breaks, as 3 says, and a case for it.',` Where 2 leaves the right behaviour open, it is a question instead. Then write the updated plan to ${t.checkpoint}`," again."]:["8. Probe before any test is written. Under runtime_required, probe the running app (skip it if the app isn't"," answering). Probe clause by clause: for each, first send what a user would normally send, to see it work and learn"," what the app answers, then the requests that would show it broken \u2014 wrong, missing and odd input, a limit and just"," past it, a user or record state that should be refused, a sequence that could leave it half done \u2014 as many as its"," code gives reason to. Go deepest where the change's own code decides the clause and where a"," failure would lose data, money or access; a cosmetic clause needs little. Put every probe in one script under",` ${r}*, each tagged with the clause it checks, and run it, printing a line for each probe a check flags (what it`," did, the status codes, which check failed) and, per clause, how many probes it got. In what the change touches, defects tend to hide in:"," - every state its records can be in (from the code's status fields and enums) \xD7 every operation the change adds or alters;"," - sequences: write then read back; set, reset, read; edit twice; delete then edit; write then list;"," - payloads: zero, negative, huge, empty, null, missing and extra fields, wrong types, case variants, more items"," than a page holds, one valid and one invalid item together;"," - every field the change adds, through the existing list, sort, filter and search."," Read the record before and after each action. Flag any 5xx; a rejected request that changed anything; a read that"," differs from what was written; a repeated request that changed something more; derived values (totals, counts)"," that disagree with their inputs; an operation that succeeds on a record in a final state (cancelled, shipped, deleted).",...Att(r),"9. Re-run each flagged probe once. Then probe once more where it is worth it: around each flag that repeated (the"," values and states next to it), for each clause a request could check that got no probe, and for each input or field"," the change adds that a kind of probe in 8 reached elsewhere but not there (a huge value sent to one number but not"," another, a field left out of one update but not another, a new field never sorted or filtered by); re-run what"," that flags. Each flag that repeats and involves what the change touched is a defect: add it to",' "findings" with the request and response as its evidence and the rule it breaks, as 3 says, and a case whose'," steps are that request sequence and whose expected outcome is the correct behaviour.",` Where 2 leaves the right behaviour open, it is a question instead. Then write the updated plan to ${t.checkpoint}`," again.",...Xor(t)]}function rce(e){let t=Zr(e);return t?C0(fl(t,"").map(r=>r.path)):[]}function Zae(e){let t=rce(e);if(!t.length&&!EM(e.inputs.repositoryPath))return[];let r=t.slice(0,8).join(", ")+(t.length>8?", \u2026":"");return[' User journeys: under "journeys", the flows a user walks through the UI, each from where a user normally starts it'," to the outcome they came for, that together pass through everything the change alters that a user sees or does:"," every ui clause is in some journey's steps (or under notInJourney, with why no journey reaches it). Use as many"," journeys as that takes. For each: the entry route; every step in order, with the clauses it exercises and what the user then sees;"," the outcome that shows the journey worked, in the spec's or PR description's own words: everything they say the"," user then sees (the exact message, the order a list is in, each field the page shows of what was saved), not a"," summary of it; under finishes, the user action that completes the task; its source \u2014"," the spec or PR description that describes the flow (quote it),"," else inferred; and the test file it belongs in. Each becomes one test of the whole flow as the PR intends it (its kind):"," in-process only where the repo's own in-process UI tests (component tests under jsdom or the like, for that code) can"," walk and check all of it \u2014 a request-level test client (Django's, Flask's, Rails integration tests) runs no page script"," and does not count \u2014 else a browser test, which needs the running app, so the decision is runtime_required (step 4)."," The changed step is inside the flow, not the whole of it. The journey starts where a user starts the task (the app's"," entry, its login, or the navigation a user would use), not at a link into the changed page unless reaching it by link"," is what the change is about, and gets to the changed step through the page: what an earlier step of the same flow"," creates (the record a change then edits) the journey creates through the app's own form, not through the API. That"," is for the journey only: the other"," cases keep using the records the app already has wherever the change reads or edits existing data, since a record"," made fresh for the test can hide a defect that shows only on older data. The journey goes on past the changed step"," to the action that finishes the user's task (save, submit, pick, open, run), and its last step checks on the page"," what that action produces. The journey ends where the user sees the result,"," which may be past the changed page: the next page built from what was saved, or a record it links to. After a"," change that saves something, a step reloads or reopens it and checks it held. Where the steps only a browser could"," walk pass through what the change leaves as it was (the login and the way to the page, the server keeping what an"," unchanged action saved), and the change does not alter how the page reaches the server (its requests, routes or"," guards), they set the journey up rather than check it: it is in-process where the repo's in-process UI tests can"," check the rest, starting on the page as they do, with the server's answers given the way they give them."," Code that decides what a page shows"," counts though no page changed (a composable, store, hook, style or theme it renders from): what the user then sees"," is in a journey, whatever unit test also checks it."," A repo with no browser tests is no reason to leave a clause out: its browser journeys go in a test package of their own."," Empty when the change alters nothing a user sees; then say so under notInJourney, per clause, with why. A change"," to UI code that alters what the page holds along a user flow (a DOM attribute, the theme, other client state the"," flow sets) owes a journey that asserts it, even when nothing in the repo reads it yet: that nothing reads it, or"," that the user cannot see it, is no reason to leave it out.",...t.length?[` The change touches UI files: ${r}.`]:[]]}function ear(e,t){let{budgetMinutes:r}=e.inputs;return["4. Validation triage, before anything is started: decide what evidence each clause still needs and the cheapest",' reliable way to get it, and save it as "triage" (its behaviorIds are your clause ids). The app is brought up only'," when the decision is runtime_required; existing evidence or native unit tests can often validate a change"," without it. You are not a code reviewer here: no style, naming or architecture commentary.","",...(s=>s.flatMap(i=>i.split(`
|
|
639
|
-
`)).map(i=>i?` ${i}`:""))([...Let(e,t.triage.change),"",...Uet(e,t.triage),...r?["",`Run budget: ${r} minutes for the whole run, including everything you plan. Name in gaps what it cannot cover.`]:[],"","Scope: validate what this change alters or newly reaches, and what the PR description or a spec states.","- Out of scope is only a clause the change cannot reach: its deciding code is unchanged and no changed path leads to it, or it lives in a checkout the change does not touch. List it under outOfScope with the unchanged line that decides it (path:line), and plan nothing for it. Code the change newly calls or feeds new values to is in scope; a defect found there in the base's own code is recorded as step 3 says. A path is one you can see in the code: a call, an import or a route that reaches the changed code (find its callers); a comment or a name saying code is shared is not one. Unchanged code that receives a new value is in scope for what it newly does with it: where it handles the value the way it already handled others (a new refusal through the error handling it already has), its behaviour has not changed, and it is what the change could break, not what it alters.","","The evidence ladder \u2014 use the cheapest mechanism that establishes each clause in scope:"," existing_evidence an accepted ci-<n> result. A check you ran (typecheck, compile, test collection) establishes only a prerequisite clause \u2014 that the change builds or its config parses \u2014 never a behaviour"," unaffected the change cannot reach this clause: no changed code path leads to it \u2014 cite the code that shows it (path:line); never for a clause decided in a changed file"," existing_unit existing native unit tests that exercise the clause"," new_unit a new in-process test, for evidence nothing provides yet"," runtime only the running application can establish it","A clause only the running app can check is runtime, not a gap, even when every other clause is in-process. It is a gap only when the app cannot be run here; then name what is missing.","Give each gap what it needs: browser (only a real browser shows it), running-app (only the running app or its server shows it: its real requests, sign-in and permissions, what it saves), or outside (something the running app here could not give either: a third-party service it calls, hardware). An app you have not tried to start is no reason for outside.","Give each clause the kind of test the repo already uses for the code it checks \u2014 in-process where the repo tests that code in-process, runtime where it tests it against the running app \u2014 unless that kind cannot check it; then the kind that can. Where it tests that code both ways, as component specs and an end-to-end suite, the in-process kind is the one when it can check the clause.",`Browser-only: for every clause, ask whether its behaviour happens only in a browser \u2014 real clicks or keys driving page script, client-side sorting or filtering, script-driven DOM updates, focus, drag-and-drop, navigation, rendering that depends on CSS or JavaScript \u2014 and if so mark it browserOnly. A test that only checks markup (a class or attribute present, the HTML a request returns) proves the precondition, not the behaviour: the header having the sort class does not show that "clicking a column header sorts the list". A browser-only clause is tested in a browser: in the repo's in-process browser harness where it has one \u2014 a Django LiveServerTestCase or StaticLiveServerTestCase, or pytest-django live_server, suite that drives Selenium or Playwright; component tests under jsdom only when the repo's own jsdom tests already drive that kind of interaction \u2014 named as its browserHarness (the suite's path), and the clause stays new_unit, with its triage item's covers saying it is driven in that browser suite; else decide runtime_required with a browser test of it. A markup check may be added, not substituted.`,"","Decisions:","- existing_evidence_sufficient means every clause in scope is established by existing evidence, with no gaps.","- A change that touches no application file (only docs, configuration or CI, in every checkout, and no lockfile) is existing_evidence_sufficient: the diff, and a check you ran that its configuration parses, establish what those files say. Plan no new test for it: a test that pins a file's contents (an action version, an editor setting, a README sentence) checks nothing a user does.","- targeted_unit plans unit tests and nothing that needs a running app.","- runtime_required marks at least one clause runtime, and plans no new unit tests: once the app is needed, this plan's cases are every new test, each still written the way the repo tests that code \u2014 in-process where that can check its clause, in the browser only where it cannot. The existing unit tests you identify still run, as existing_unit.","- The journeys and maintenance of step 5 can need the app too, so plan them before you decide. Decide runtime_required when any journey needs a browser \u2014 real JavaScript or htmx behaviour, navigation across pages or what persists after a reload, where the change alters either, or a server-rendered page the repo tests only at the request level \u2014 and mark runtime the clauses its steps exercise.",'- Decide runtime_required as well when any test under "maintenance" calls the deployed app \u2014 API, contract, integration, end-to-end or UI tests that reach it at its address (BASE_URL or the like), and Skyramp tests \u2014 and checks what the change itself alters, and mark runtime the clauses it checks, so it is verified against the app. So does a gap, for what the change itself alters, that needs a browser or the running app, and a browser-only clause the repo has no in-process browser harness for. A test under "maintenance" only to verify, whose clauses in-process tests run here establish (existing_unit or new_unit, not a CI result), does not: running it again against the app shows nothing they do not.',"- A test that starts its own live server in the test process and drives it in a browser (Django's LiveServerTestCase or StaticLiveServerTestCase, pytest-django's live_server, with Selenium or Playwright) needs no deployed app: under targeted_unit it is maintained and run in-process, with the repo's CI settings and a headless browser.","- When the app cannot be run here, list each such journey's clauses under notInJourney, and each such test under gaps, with what is missing: it is reported not covered, never dropped. So is a browser-only clause with no in-process browser harness: name it under gaps with what is missing.","- A defect you found (step 3) that only the running app can show makes the decision runtime_required wherever its code is, in the change or downstream of it: one in page script or in what the user sees after a click or a save, where the repo has no in-process browser harness for it, or in code the repo tests only against the running app's API. Mark it needsApp (browser or live-api) and give it its case. A defect an in-process test can show is not needsApp. When the app cannot be run here, name it under gaps with what is missing.","- Otherwise only what the change itself alters decides it. A journey or browser-only clause only for what the change could break elsewhere (a could-break requirement), or for UI code the change does not touch when it touches no UI code, does not make the decision runtime_required: off the runtime path list its clauses under notInJourney and the browser-only ones under gaps, with what is missing (a browser, downstream of this change), so it is reported not covered. Nor does a maintained test that calls the deployed app only for such clauses: give each maintained test the clauses it checks, and name such a test under gaps with what is missing (the running app, downstream of this change).","- blocked_preflight: the change cannot meet a basic prerequisite. It names the changed file the failure is in and quotes the error, and plans nothing. A check that fails for an environment reason (a dependency not installed, a missing tool) is not the change failing \u2014 never block on it.","","Rules:","- Every clause is planned, listed in gaps, or listed under outOfScope, by its id (R1a). A gap is evidence this run cannot obtain; a test this run will execute (existing_unit, new_unit, runtime) is not one, even when you could not run it while planning.","- Only accepted ci-<n> items, and passing checks you ran for prerequisite clauses, can establish a clause. A stale, untrusted, pending, failing or inconclusive result establishes nothing; a trusted result that failed is a reason to plan evidence, never a pass. AI review is advisory, never evidence.","- Find the existing tests yourself: where the repo keeps tests of the changed code, and their framework.",'- Existing tests that call a running app (API, contract, integration, end-to-end or UI tests) are never evidence: list them in "maintenance" (verify, or update).',"- Repository evidence is only native unit tests, which run without the app. Every repository evidence item lists its tests as repo-relative paths (path::test-name when the file holds more than the relevant ones) \u2014 only the tests that exercise the changed behavior, never the whole suite.",`- ${gDe}`,`- ${_S}`,"- Every repository evidence item is run: cite it from an existing_unit item for the clauses it exercises. Only under existing_evidence_sufficient is nothing run: cite it from the existing_evidence item it supports instead.","- Plan new_unit only for what no existing test asserts, or asserts differently from the requirement (the boundary the change moved); never for what existing tests already prove.","- When the PR description or a spec states the expected behavior, plan evidence for what it states, not for what the code does.","- Evidence items are existing repository tests (source repository) and checks you ran with Bash (source testbot), each with a unique id; the ci-<n> results above are not restated. Run each check as one plain command \u2014 no `&&`, pipes or `echo` \u2014 and copy it into its evidence exactly. Don't start the application, install dependencies or run test suites for triage."])]}function tar(e){let t=e.prepared,r=e.inputs.repositoryPath,n=t.preflight?.repository.currentBranch??"HEAD",s=t.preflight?.repository.baseBranch??e.inputs.baseBranch??"origin/main",i=TE(e.inputs,e.runDir);return["Plan functional tests for this PR. You won't write the tests: another session will, working from your plan alone,","so whatever it needs has to be in the plan.","",`The repo is at ${r}, checked out on branch \`${n}\`. You can see the change with \`git diff ${s}...HEAD\`.`,...nG(i,s),"Ignore .skyramp/ \u2014 it is Skyramp's own setup, not part of the change.",...tce(e),...YA(e.inputs,i.descriptions),...Yet(e.inputs),...Xet(e.inputs),"","1. Read the change: the diff, the description, and any spec, issue or design doc either of them points to.","2. List the requirements: everything the description or a spec states or clearly implies and, where they say"," nothing, what the change is evidently meant to do. Split each into independently testable clauses: each input"," class, boundary, error path, and anything that must stay unchanged. To find them, read the code that decides the"," requirement and ask where it would act differently \u2014 for example a value of the wrong type, missing or empty, one"," at a limit and one just past it, a user who may not do it, or a record in a state that should stop it. Each that"," could change the outcome is a clause; one that can't needs none. For each clause, write the expected outcome.",` Each requirement's id is the label the description or spec gives it ("AC-3", "REQ-12"; item 4 of a numbered list`," is R4), else R1, R2\u2026 in order, numbering on after the highest R-label the source uses (R6 after its R5). Where two"," items give the same label, put the item's key in front (PAY-184-AC1, PAY-185-AC1). A clause id is its"," requirement's id plus a letter (AC-3a), and each id is used once. Every case, clause and journey step keeps these"," ids and names a clause or finding the plan has; a finding names the requirement or clause it breaks.",` Where sources disagree, the higher one sets the expected outcome: ${Jet(e.inputs)}.`," Code that disagrees with what is stated is what's wrong. Two sources of the same rank that disagree leave it",' unsettled, whatever a lower one says: a question, as below, with each of them under its "sources". Where nothing'," is stated, take it from the change's evident intent; code that contradicts that intent, or itself"," elsewhere, is still a defect. Each expected outcome needs a reason the PR's author would accept: the words that"," state it, or an intent the change makes plain. Where more than one outcome would be reasonable and nothing you"," read says which is meant, don't choose one: expect only what every reading allows, such as no error and no data",' lost or stored wrongly (a check that rules one of them out has chosen), and put the rest under "questions", with'," each reading and what points to it. A question is for evidence that is really balanced. Where what you read leans"," one way \u2014 the description's words, what the page shows the user, how the code beside it does the same job \u2014 take"," that reading, expect it, and cite what leans; the reading you set aside is not a question. Data lost or stored"," wrongly, or an action that goes through on a record that should no longer allow it, is a defect whichever reading"," is meant, not a question."," Then list what the change could break that no requirement mentions \u2014 other callers of the functions it changed,"," other paths that read or write the same data, behaviour right next to the change \u2014 and add each as a requirement"," of its own (source could-break, evidence the code it could break), with its clauses. Could-break is only behaviour"," that worked before the change and that the change's own code does not decide: what a new or changed endpoint,"," page or function itself does belongs to the change's requirements (its description or spec, or its evident"," intent), even where nothing states it.",' For each clause, give under "code" the path:line of the code that decides it, when there is one.',"3. Note every defect you find in the change, with the line that shows it. Compare the change with the code beside it"," that does the same job \u2014 other routes answering the same kind of request, other reads of the same data, the other"," layer handling the same value, other code that copies the same record: where they handle a case the change handles"," differently (how a malformed id is answered, who may act, what a read leaves out, whether a value's case matters,"," which fields a copy carries) and the change's way is plainly the wrong one (it fails, loses data, or breaks a rule"," the code keeps everywhere else), the change is wrong unless the description asks for the difference. Where both"," ways are reasonable and nothing says which is meant, it is a question, as in 2, not a defect. A defect breaks a rule"," something you read states or leans to; a rule the app has nowhere (a field you think should be required, two"," values you think should match) is not one. On each page the"," change touches, follow what the user sees when its request fails, when they enter a value it refuses, and right"," after a save, without a reload."," A defect is the change's only where the change's own code does the wrong thing. Before you record one, look at the",` base (git show ${s}:<path>): where the base, left as it was, already does the same with the same kind of input,`,' the change only gives it a new way to be reached. Record such a defect with "existing" (where the base'," does it), and give it no case and no journey step that expects it fixed: it is reported as there before this"," change, not as this change's. A clause about code the change leaves as it was, which the base already does not"," meet, is such a defect, not a clause. But where the wrong outcome comes from something the change adds \u2014 a field,"," a route, a kind of input \u2014 that the base code it relies on was never set up to handle, the defect is the change's.",' Give each defect of the change the rule it breaks: under "conflictsWith", the requirements or clauses that state',` it, or, for a rule only the code beside it keeps, under "keeps" that code's path:line (the code beside it, which the change left as it was).`,' Some rules every app keeps and nothing needs to state; a defect that breaks one names it under "rule":',` ${CN()} A defect with no rule at all is a rule you chose, not one the app has: leave it out.`,...ear(e,t),"5. Write the test plan for the new tests your triage leaves \u2014 the clauses it marks runtime under runtime_required, or",' new_unit under targeted_unit \u2014 and for the defects. Under existing_evidence_sufficient leave "cases" empty and give'," no clause a test: the evidence comes from triage's plan."," Write the test plan on the clauses themselves: each clause gets the test that checks it, using the input or"," situation the clause is about (type, target, steps \u2014 where a probe already exercised the clause, its requests, so"," the tests send them rather than work them out again;",` its expected outcome is the clause's, and its kind the one the repo already uses for that code, unless that kind cannot check it), or, on the clause, why it can't be tested here. Add to "cases" a second`," test for a clause where one is needed, and one case for every defect you found \u2014 even where a clause's test"," covers the same ground. A defect's case reaches the defect itself (the state, input or sequence that shows it)"," and expects the correct behaviour, so it fails on this branch; where the requirement allows more than one correct"," outcome (reject, or cap), it accepts each of them, so it passes on any fix."," For each clause, ask how the change could get it wrong while its test still passes: another status or message"," than the one it states, a value left behind, the result kept somewhere other than where the user reads it, a path"," (an undo, a reset, an input it refuses) that no case takes. Where it could, write the steps and expected outcome"," that would catch it, within what the clause states.",' Under every decision, list under "maintenance" the existing tests you can see the change makes wrong or stale,'," and whether to update, delete, regenerate or just re-run (verify) each \u2014 a starting point: the step that writes"," the tests runs the affected tests and finds the rest. A test the change leaves passing, which you would only extend"," with new checks, is not one: those checks are this plan's cases, in the test file they belong in. One that calls the deployed app to check what the change itself alters makes the decision runtime_required (step 4), unless it is only to verify and in-process tests run here establish its clauses; a live-server test, which runs in-process, does not.",...Zae(e),`6. Write the plan as JSON (below), "triage" included, to ${t.checkpoint} now, before anything is started.`,`7. ${zor(e,t)}`,...Zor(e,t),...Kor(e),"",`Stay inside the checkout and don't commit or push. When you're done, update ${t.checkpoint} with "app" filled in;`,"that file is what's read. End with a one-line final message \u2014 don't repeat the plan in it. The plan's JSON:","",vu(Hi,0,Yor(e))].join(`
|
|
639
|
+
`)).map(i=>i?` ${i}`:""))([...Let(e,t.triage.change),"",...Uet(e,t.triage),...r?["",`Run budget: ${r} minutes for the whole run, including everything you plan. Name in gaps what it cannot cover.`]:[],"","Scope: validate what this change alters or newly reaches, and what the PR description or a spec states.","- Out of scope is only a clause the change cannot reach: its deciding code is unchanged and no changed path leads to it, or it lives in a checkout the change does not touch. List it under outOfScope with the unchanged line that decides it (path:line), and plan nothing for it. Code the change newly calls or feeds new values to is in scope; a defect found there in the base's own code is recorded as step 3 says. A path is one you can see in the code: a call, an import or a route that reaches the changed code (find its callers); a comment or a name saying code is shared is not one. Unchanged code that receives a new value is in scope for what it newly does with it: where it handles the value the way it already handled others (a new refusal through the error handling it already has), its behaviour has not changed, and it is what the change could break, not what it alters.","","The evidence ladder \u2014 use the cheapest mechanism that establishes each clause in scope:"," existing_evidence an accepted ci-<n> result. A check you ran (typecheck, compile, test collection) establishes only a prerequisite clause \u2014 that the change builds or its config parses \u2014 never a behaviour"," unaffected the change cannot reach this clause: no changed code path leads to it \u2014 cite the code that shows it (path:line); never for a clause decided in a changed file"," existing_unit existing native unit tests that exercise the clause"," new_unit a new in-process test, for evidence nothing provides yet"," runtime only the running application can establish it","A clause only the running app can check is runtime, not a gap, even when every other clause is in-process. It is a gap only when the app cannot be run here; then name what is missing.","Give each gap what it needs: browser (only a real browser shows it), running-app (only the running app or its server shows it: its real requests, sign-in and permissions, what it saves), or outside (something the running app here could not give either: a third-party service it calls, hardware). An app you have not tried to start is no reason for outside.","Give each clause the kind of test the repo already uses for the code it checks \u2014 in-process where the repo tests that code in-process, runtime where it tests it against the running app \u2014 unless that kind cannot check it; then the kind that can. Where it tests that code both ways, as component specs and an end-to-end suite, the in-process kind is the one when it can check the clause.",`Browser-only: for every clause, ask whether its behaviour happens only in a browser \u2014 real clicks or keys driving page script, client-side sorting or filtering, script-driven DOM updates, focus, drag-and-drop, navigation, rendering that depends on CSS or JavaScript \u2014 and if so mark it browserOnly. A test that only checks markup (a class or attribute present, the HTML a request returns) proves the precondition, not the behaviour: the header having the sort class does not show that "clicking a column header sorts the list". A browser-only clause is tested in a browser: in the repo's in-process browser harness where it has one \u2014 a Django LiveServerTestCase or StaticLiveServerTestCase, or pytest-django live_server, suite that drives Selenium or Playwright; component tests under jsdom only when the repo's own jsdom tests already drive that kind of interaction \u2014 named as its browserHarness (the suite's path), and the clause stays new_unit, with its triage item's covers saying it is driven in that browser suite; else decide runtime_required with a browser test of it. A markup check may be added, not substituted.`,"","Decisions:","- existing_evidence_sufficient means every clause in scope is established by existing evidence, with no gaps.","- A change that touches no application file (only docs, configuration or CI, in every checkout, and no lockfile) is existing_evidence_sufficient: the diff, and a check you ran that its configuration parses, establish what those files say. Plan no new test for it: a test that pins a file's contents (an action version, an editor setting, a README sentence) checks nothing a user does.","- targeted_unit plans unit tests and nothing that needs a running app.","- runtime_required marks at least one clause runtime, and plans no new unit tests: once the app is needed, this plan's cases are every new test, each still written the way the repo tests that code \u2014 in-process where that can check its clause, in the browser only where it cannot. The existing unit tests you identify still run, as existing_unit.","- The journeys and maintenance of step 5 can need the app too, so plan them before you decide. Decide runtime_required when any journey needs a browser \u2014 real JavaScript or htmx behaviour, navigation across pages or what persists after a reload, where the change alters either, or a server-rendered page the repo tests only at the request level \u2014 and mark runtime the clauses its steps exercise.",'- Decide runtime_required as well when any test under "maintenance" calls the deployed app \u2014 API, contract, integration, end-to-end or UI tests that reach it at its address (BASE_URL or the like), and Skyramp tests \u2014 and checks what the change itself alters, and mark runtime the clauses it checks, so it is verified against the app. So does a gap, for what the change itself alters, that needs a browser or the running app, and a browser-only clause the repo has no in-process browser harness for. A test under "maintenance" only to verify, whose clauses in-process tests run here establish (existing_unit or new_unit, not a CI result), does not: running it again against the app shows nothing they do not.',"- A test that starts its own live server in the test process and drives it in a browser (Django's LiveServerTestCase or StaticLiveServerTestCase, pytest-django's live_server, with Selenium or Playwright) needs no deployed app: under targeted_unit it is maintained and run in-process, with the repo's CI settings and a headless browser.","- When the app cannot be run here, list each such journey's clauses under notInJourney, and each such test under gaps, with what is missing: it is reported not covered, never dropped. So is a browser-only clause with no in-process browser harness: name it under gaps with what is missing.","- A defect you found (step 3) that only the running app can show makes the decision runtime_required wherever its code is, in the change or downstream of it: one in page script or in what the user sees after a click or a save, where the repo has no in-process browser harness for it, or in code the repo tests only against the running app's API. Mark it needsApp (browser or live-api) and give it its case. A defect an in-process test can show is not needsApp. When the app cannot be run here, name it under gaps with what is missing.","- Otherwise only what the change itself alters decides it. A journey or browser-only clause only for what the change could break elsewhere (a could-break requirement), or for UI code the change does not touch when it touches no UI code, does not make the decision runtime_required: off the runtime path list its clauses under notInJourney and the browser-only ones under gaps, with what is missing (a browser, downstream of this change), so it is reported not covered. Nor does a maintained test that calls the deployed app only for such clauses: give each maintained test the clauses it checks, and name such a test under gaps with what is missing (the running app, downstream of this change).","- blocked_preflight: the change cannot meet a basic prerequisite. It names the changed file the failure is in and quotes the error, and plans nothing. A check that fails for an environment reason (a dependency not installed, a missing tool) is not the change failing \u2014 never block on it.","","Rules:","- Every clause is planned, listed in gaps, or listed under outOfScope, by its id (R1a). A gap is evidence this run cannot obtain; a test this run will execute (existing_unit, new_unit, runtime) is not one, even when you could not run it while planning.","- Only accepted ci-<n> items, and passing checks you ran for prerequisite clauses, can establish a clause. A stale, untrusted, pending, failing or inconclusive result establishes nothing; a trusted result that failed is a reason to plan evidence, never a pass. AI review is advisory, never evidence.","- Find the existing tests yourself: where the repo keeps tests of the changed code, and their framework.",'- Existing tests that call a running app (API, contract, integration, end-to-end or UI tests) are never evidence: list them in "maintenance" (verify, or update).',"- Repository evidence is only native unit tests, which run without the app. Every repository evidence item lists its tests as repo-relative paths (path::test-name when the file holds more than the relevant ones) \u2014 only the tests that exercise the changed behavior, never the whole suite.",`- ${gDe}`,`- ${_S}`,"- Every repository evidence item is run: cite it from an existing_unit item for the clauses it exercises. Only under existing_evidence_sufficient is nothing run: cite it from the existing_evidence item it supports instead.","- Plan new_unit only for what no existing test asserts, or asserts differently from the requirement (the boundary the change moved); never for what existing tests already prove.","- When the PR description or a spec states the expected behavior, plan evidence for what it states, not for what the code does.","- Evidence items are existing repository tests (source repository) and checks you ran with Bash (source testbot), each with a unique id; the ci-<n> results above are not restated. Run each check as one plain command \u2014 no `&&`, pipes or `echo` \u2014 and copy it into its evidence exactly. Don't start the application, install dependencies or run test suites for triage."])]}function tar(e){let t=e.prepared,r=e.inputs.repositoryPath,n=t.preflight?.repository.currentBranch??"HEAD",s=t.preflight?.repository.baseBranch??e.inputs.baseBranch??"origin/main",i=TE(e.inputs,e.runDir);return["Plan functional tests for this PR. You won't write the tests: another session will, working from your plan alone,","so whatever it needs has to be in the plan.","",`The repo is at ${r}, checked out on branch \`${n}\`. You can see the change with \`git diff ${s}...HEAD\`.`,...nG(i,s),"Ignore .skyramp/ \u2014 it is Skyramp's own setup, not part of the change.",...tce(e),...YA(e.inputs,i.descriptions),...Yet(e.inputs),...Xet(e.inputs),"","1. Read the change: the diff, the description, and any spec, issue or design doc either of them points to.","2. List the requirements: everything the description or a spec states or clearly implies and, where they say"," nothing, what the change is evidently meant to do. Split each into independently testable clauses: each input"," class, boundary, error path, and anything that must stay unchanged. To find them, read the code that decides the"," requirement and ask where it would act differently \u2014 for example a value of the wrong type, missing or empty, one"," at a limit and one just past it, a user who may not do it, or a record in a state that should stop it. Each that"," could change the outcome is a clause; one that can't needs none. For each clause, write the expected outcome.",` Each requirement's id is the label the description or spec gives it ("AC-3", "REQ-12"; item 4 of a numbered list`," is R4), else R1, R2\u2026 in order, numbering on after the highest R-label the source uses (R6 after its R5). Where two"," items give the same label, put the item's key in front (PAY-184-AC1, PAY-185-AC1). A clause id is its"," requirement's id plus a letter (AC-3a), and each id is used once. Every case, clause and journey step keeps these"," ids and names a clause or finding the plan has; a finding names the requirement or clause it breaks.",` Where sources disagree, the higher one sets the expected outcome: ${Jet(e.inputs)}.`," Code that disagrees with what is stated is what's wrong. Two sources of the same rank that disagree leave it",' unsettled, whatever a lower one says: a question, as below, with each of them under its "sources". Where nothing'," is stated, take it from the change's evident intent; code that contradicts that intent, or itself"," elsewhere, is still a defect. Each expected outcome needs a reason the PR's author would accept: the words that"," state it, or an intent the change makes plain. Where more than one outcome would be reasonable and nothing you"," read says which is meant, don't choose one: expect only what every reading allows, such as no error and no data",' lost or stored wrongly (a check that rules one of them out has chosen), and put the rest under "questions", with'," each reading and what points to it. A question is for evidence that is really balanced. Where what you read leans"," one way \u2014 the description's words, what the page shows the user, how the code beside it does the same job \u2014 take"," that reading, expect it, and cite what leans; the reading you set aside is not a question. Data lost or stored"," wrongly, or an action that goes through on a record that should no longer allow it, is a defect whichever reading"," is meant, not a question."," Then list what the change could break that no requirement mentions \u2014 other callers of the functions it changed,"," other paths that read or write the same data, behaviour right next to the change \u2014 and add each as a requirement"," of its own (source could-break, evidence the code it could break), with its clauses. Could-break is only behaviour"," that worked before the change and that the change's own code does not decide: what a new or changed endpoint,"," page or function itself does belongs to the change's requirements (its description or spec, or its evident"," intent), even where nothing states it.",' For each clause, give under "code" the path:line of the code that decides it, when there is one.',"3. Note every defect you find in the change, with the line that shows it. Compare the change with the code beside it"," that does the same job \u2014 other routes answering the same kind of request, other reads of the same data, the other"," layer handling the same value, other code that copies the same record: where they handle a case the change handles"," differently (how a malformed id is answered, who may act, what a read leaves out, whether a value's case matters,"," which fields a copy carries) and the change's way is plainly the wrong one (it fails, loses data, or breaks a rule"," the code keeps everywhere else), the change is wrong unless the description asks for the difference. Where both"," ways are reasonable and nothing says which is meant, it is a question, as in 2, not a defect. A defect breaks a rule"," something you read states or leans to; a rule the app has nowhere (a field you think should be required, two"," values you think should match) is not one. On each page the"," change touches, follow what the user sees when its request fails, when they enter a value it refuses, and right"," after a save, without a reload."," A defect is the change's only where the change's own code does the wrong thing. Before you record one, look at the",` base (git show ${s}:<path>): where the base, left as it was, already does the same with the same kind of input,`,' the change only gives it a new way to be reached. Record such a defect with "existing" (where the base'," does it), and give it no case and no journey step that expects it fixed: it is reported as there before this"," change, not as this change's. A clause about code the change leaves as it was, which the base already does not"," meet, is such a defect, not a clause. But where the wrong outcome comes from something the change adds \u2014 a field,"," a route, a kind of input \u2014 that the base code it relies on was never set up to handle, the defect is the change's."," So is one where the description or spec states what something the change adds does (the status a new route"," answers, the message a new field shows) and it does otherwise: the base doing the same elsewhere does not make it"," existing.",' Give each defect of the change the rule it breaks: under "conflictsWith", the requirements or clauses that state',` it, or, for a rule only the code beside it keeps, under "keeps" that code's path:line (the code beside it, which the change left as it was).`,' Some rules every app keeps and nothing needs to state; a defect that breaks one names it under "rule":',` ${CN()} A defect with no rule at all is a rule you chose, not one the app has: leave it out.`,...ear(e,t),"5. Write the test plan for the new tests your triage leaves \u2014 the clauses it marks runtime under runtime_required, or",' new_unit under targeted_unit \u2014 and for the defects. Under existing_evidence_sufficient leave "cases" empty and give'," no clause a test: the evidence comes from triage's plan."," Write the test plan on the clauses themselves: each clause gets the test that checks it, using the input or"," situation the clause is about (type, target, steps \u2014 where a probe already exercised the clause, its requests, so"," the tests send them rather than work them out again;",` its expected outcome is the clause's, and its kind the one the repo already uses for that code, unless that kind cannot check it), or, on the clause, why it can't be tested here. Add to "cases" a second`," test for a clause where one is needed, and one case for every defect you found \u2014 even where a clause's test"," covers the same ground. A defect's case reaches the defect itself (the state, input or sequence that shows it)"," and expects the correct behaviour, so it fails on this branch; where the requirement allows more than one correct"," outcome (reject, or cap), it accepts each of them, so it passes on any fix."," For each clause, ask how the change could get it wrong while its test still passes: another status or message"," than the one it states, a value left behind, the result kept somewhere other than where the user reads it, a path"," (an undo, a reset, an input it refuses) that no case takes. Where it could, write the steps and expected outcome"," that would catch it, within what the clause states.",' Under every decision, list under "maintenance" the existing tests you can see the change makes wrong or stale,'," and whether to update, delete, regenerate or just re-run (verify) each \u2014 a starting point: the step that writes"," the tests runs the affected tests and finds the rest. A test the change leaves passing, which you would only extend"," with new checks, is not one: those checks are this plan's cases, in the test file they belong in. One that calls the deployed app to check what the change itself alters makes the decision runtime_required (step 4), unless it is only to verify and in-process tests run here establish its clauses; a live-server test, which runs in-process, does not.",...Zae(e),`6. Write the plan as JSON (below), "triage" included, to ${t.checkpoint} now, before anything is started.`,`7. ${zor(e,t)}`,...Zor(e,t),...Kor(e),"",`Stay inside the checkout and don't commit or push. When you're done, update ${t.checkpoint} with "app" filled in;`,"that file is what's read. End with a one-line final message \u2014 don't repeat the plan in it. The plan's JSON:","",vu(Hi,0,Yor(e))].join(`
|
|
640
640
|
`)}function rar(e,t){if(!t)return;let r=Wae(t);if(!r){Es(e).warn("[plan] app.login names a variable the environment does not set: no login for the tests");return}ott(e.runDir,t),e.secretValues=Hs([...e.secretValues??[],r.password]),e.provideSutLogin?.(JSON.stringify(r))}function nar(e){let t=e.app?.login;if(!e.app||!t||e2(t))return e;let{login:r,...n}=e.app;return{...e,app:n}}function IN(e,t,r){let n=ws.join(e.outputsDir,t);return Wm.writeFileSync(n,JSON.stringify(Br(r,e.secretValues??[]),null,2)+`
|
|
641
641
|
`),ws.relative(e.runDir,n)}function btt(e){let t=Ja(e.inputs.repositoryPath);return t.teardownScript?`bash ${ws.relative(e.inputs.repositoryPath,t.teardownScript)}`:void 0}function nce(e){return vh(e.inputs).map(t=>t.body)}function Stt(e,t){rar(e,t.app?.login),t=nar(t);let r=ctt(t);r!==t&&Es(e).warn("[plan] the plan used an id more than once: renamed the later ones so each is kept");let n=nce(e),s=Oae(r,e.inputs.requirementItems,e.inputs.repositoryPath,n);s.length&&Es(e).warn(`[plan] left out ${s.length} requirement(s) that do not hold to their item: ${s.map(m=>m.id).join(", ")}`);let i=s.map(({id:m,why:g})=>({id:m,reference:r.requirements.find(E=>E.id===m)?.reference,why:g})),o=_De(Qae(r,e.inputs.requirementItems,e.inputs.repositoryPath,n),m=>Es(e).warn(`[plan] case id ${m} is used twice: kept one case and left out the other`)),a=ftt(o,m=>Es(e).warn(`[plan] case ${m} left out: a maintained test checks its clause`)),c=NK(e,a.triage,!!a.app,g6(a,Rs(e.inputs.requirementItems))).length===0,l=!c||a.triage?.decision==="runtime_required",u=PDe(c?DDe(a):a,l),d=Zr(e),p=MDe(u,{repository:d?.repository??{path:e.inputs.repositoryPath,currentBranch:"HEAD",baseBranch:e.inputs.baseBranch??""},changedFiles:d?.changedFiles.map(m=>m.path)??[],nonApplicationOnly:d?.nonApplicationOnly??!1,defaultTeardown:btt(e),itemNames:Rs(e.inputs.requirementItems),related:e.inputs.relatedRepos,recipeRecorded:e.prepared?.recipeRecorded});p.ambiguous.length&&Es(e).warn(`[plan] maintained test in both the repo under test and a related checkout, kept the repo under test's: ${p.ambiguous.join(", ")}`);let h={plan:IN(e,"plan.json",u),analyze:IN(e,"analyze.json",p.analyze),recommend:IN(e,"recommend.json",RN(e.inputs)?b8(e.inputs,p.recommend):p.recommend)};return h.notPlanned=IN(e,HG,i),p.deploy&&(h.deploy=IN(e,"deploy.json",p.deploy)),c&&Object.assign(h,mMe(e,u.triage)),h}var sar={runtime_required:"validation triage: the change needs the running app \u2014 tests against it follow",targeted_unit:"validation triage: unit tests are enough \u2014 no app deployed",existing_evidence_sufficient:"validation triage: existing evidence is enough \u2014 no app deployed, no new tests",blocked_preflight:"validation triage: the change does not meet a prerequisite \u2014 nothing further runs"};function iar(e){let t=me(e,"triage.json");if(t)return sar[t.decision];let r=me(e,"plan.json");return r?NK(e,r.triage,!!r.app)[0]:void 0}async function oar(e,t){let r=e.inputs.sharedEnvironment;if(!e.inputs.appRunning||!bS(r))return{};let n=await wS(r,[],t,e.secretValues??[],e.platform,await tM(e,r));return Jr(e,xs,Br(n,e.secretValues??[]),[])}async function aar(e,t){let r=e.inputs.sharedEnvironment;if(!bS(r)||!Itt(e)||!par(e))return{};let n=await wS(r,t,void 0,e.secretValues??[],e.platform,await tM(e,r));return Jr(e,xs,Br(n,e.secretValues??[]),[])}async function car(e,t){let r=e.inputs.sharedEnvironment,n=me(e,`${xs}.json`);if(!r||!n||!t.length)return{};let s=await wS({...r,components:sy(e.inputs),dependencies:[]},t,void 0,e.secretValues??[],e.platform),i=n.components.map(o=>s.components.find(a=>a.name===o.name&&Oh(a.repository,o.repository))??o);return Jr(e,xs,Br({...n,components:i},e.secretValues??[]),[])}var Ctt=async(e,t)=>e.inputs.appRunning?car(e,t):aar(e,t),vtt="plan-shared-revisions",lar={name:vtt,async verify(e,t){let{value:r}=mr(Hi,t.stdout,Xi(e),e.secretValues),n=await x8(e,r?.app?.revisions??[]);return n.length?{name:this.name,passed:!1,details:n.join("; "),repairable:!0}:{name:this.name,passed:!0}}},sce="plan-no-secret-leak",uar=PS(sce,()=>[]),xtt={name:sce,verify:(e,t,r,n)=>uar.verify(e,{...t,stdout:""},r,n)};async function dar(e,t){if(t.some(o=>o.gates.some(a=>a.name===sce&&!a.passed)))return;let r=t.at(-1)?.session;if(!(await xtt.verify(e,r??{exitCode:1,stdout:"",stderr:"",timedOut:!0,durationMs:0},ice)).passed)return;let s=OS(ws.join(zE(e),ece)),i=IM(Hi,[...t.map(o=>o.session?.stdout).reverse(),s,ODe(s)]);return i?{...Stt(e,i),...await Ctt(e,[])}:void 0}function Itt(e){if(e.inputs.appRunning||e.inputs.planOnly)return!1;let t=Zr(e);if(t&&!t.sutRequired)return!1;let r=me(e,"plan.json");return!(r?.triage&&!iC(r.triage.plan)&&!r.app)}function par(e){let t=me(e,"plan.json")?.app?.outcome;return t==="clean"||t==="recipe-drift"}function ytt(e){if(!Itt(e))return;let t=me(e,"deploy.json")?.teardown??btt(e);!t||t==="true"||(0,wtt.spawnSync)(t,{shell:!0,cwd:e.inputs.repositoryPath,env:Tt(),timeout:12e4,stdio:"ignore"})}var Rtt="plan-triage-grounded",far={name:Rtt,verify(e,t){let{value:r}=mr(Hi,t.stdout,Xi(e),e.secretValues);if(!r)return{name:this.name,passed:!0};let n=Qae(r,e.inputs.requirementItems,e.inputs.repositoryPath,nce(e)),s=[...BK(e,n.triage,!!n.app,g6(n,Rs(e.inputs.requirementItems))),...Oet(n.triage,Zr(e))];return s.length?{name:this.name,passed:!1,details:s.join("; "),repairable:!0}:{name:this.name,passed:!0}}},Ttt="plan-journeys",har=[/\b(?:no|without|lacks?|missing)\b[^.;:]{0,30}\b(?:browser|e2e|end-to-end|playwright|cypress|selenium|ui|frontend|front-end)\b[^.;:]{0,30}\b(?:tests?|harness|runner|setup|framework|installed|suite)\b/i,/\bno\s+(?:tests?|harness)\s+(?:for|of)\s+the\s+(?:ui|frontend|front-end|browser|pages?)\b/i],mar=/\b(?:credentials?|log[- ]?ins?|sso|auth\w*|accounts?|seed(?:ed)?|external|third[- ]party|api[- ]keys?|secrets?|tokens?|observ\w*|visible|shows?|logs?|reach\w*|unreachable|behind|admin\w*|licen[cs]e\w*|hardware|devices?|e-?mail|sms|payment|stripe|host[- ]app|embedd\w*)\b/i,gar=e=>har.some(t=>t.test(e))&&!mar.test(e),Aar=/\b(?:not|never|isn'?t|aren'?t)\s+(?:visible|seen|shown|user[- ]visible)\b|\binvisible\b|\bno\s+(?:user[- ])?visible\b|\b(?:user|nobody|no one)\s+sees\s+no(?:thing)?\b|\bnothing\s+(?:a|the)\s+user\s+sees\b|\bnothing\b[^.;]{0,40}\b(?:styles?|reads?|renders?|consumes?|uses?)\b|\bno\s+(?:css|style|component|rendering)\b[^.;]{0,40}\b(?:reads?|consumes?|depends?|uses?)\b/i,yar=/\b(?:not reachable|unreachable|no (?:route|page|screen|flow|path|link) (?:reaches|renders|opens|leads to)|(?:rendered|used|mounted) only (?:by|in|from)\b[^;]{0,100}\bnothing (?:in the app )?(?:renders|uses|mounts))/i;function Ear(e){let t=!1,r=[];for(let n of e){let s=n.why??"",i=!yar.test(s)&&(Aar.test(s)||/^\s*same\b/i.test(s)&&t);i&&r.push(n.clause),t=i}return r}var war={name:Ttt,verify(e,t){let{value:r}=mr(Hi,t.stdout,Xi(e),e.secretValues);if(!r)return{name:this.name,passed:!0};let n=!r.triage||r.triage.decision==="runtime_required",s=r.requirements.flatMap(A=>A.clauses),i=new Set([...r.cases.map(A=>A.id),...s.map(A=>A.id)]),o=vh(e.inputs),a={takenIds:i,clauses:new Set(s.map(A=>A.id)),uiClauses:Zae(e).length?s.filter(A=>A.type==="ui"&&!A.skip?.trim()).map(A=>A.id):[],notInJourney:new Set((r.notInJourney??[]).map(A=>A.clause)),quoted:A=>W8(o,A)},c=Zr(e),l=c?fl(c,"").map(A=>A.path):[],u=n?[]:dMe(r,{locate:Q0(e.inputs.repositoryPath,e.inputs.relatedRepos??[]),runtimePossible:!!e.inputs.appRunning||c?.sutRequired!==!1,...c?{own:yF(r,l,C0(l).length>0)}:{}}),d=n?r.journeys:(r.journeys??[]).filter(A=>A.kind==="in-process"),p=(r.notInJourney??[]).filter(A=>gar(A.why??"")).map(A=>`clause ${A.clause} is under notInJourney because the repo has no browser tests, which is no reason to leave it out: put it in a journey \u2014 in-process where the repo's in-process tests can walk and check it, else a browser test in a test package of its own (decide runtime_required)`),h=Zae(e).length?rce(e):[],m=h.length&&!(r.journeys??[]).length&&!(r.notInJourney??[]).length?[`the change touches UI code (${h.slice(0,5).join(", ")}) and the plan has no journey: plan the journey through what a user then sees change, or, if the change alters nothing a user sees, list its clauses under notInJourney with why`]:[],g=h.length&&EM(e.inputs.repositoryPath)?Ear(r.notInJourney??[]).map(A=>`clause ${A} is under notInJourney because nothing reads it or the user cannot see it, and the change touches UI code: a change to UI code that alters what the page holds along a user flow owes a journey that asserts it, even when nothing reads it yet \u2014 put the clause in that flow's journey, at the step that sets it, and assert it there`):[],E=[...u,...p,...m,...g,...tDe(d,a)];return E.length?{name:this.name,passed:!1,details:E.join("; "),repairable:!0}:{name:this.name,passed:!0}}},ktt="plan-requirements-grounded",bar={name:ktt,async verify(e,t){let{value:r}=mr(Hi,t.stdout,Xi(e),e.secretValues);if(!r)return{name:this.name,passed:!0};e.reviewItemFile&&await Get(r,e.inputs.requirementItems,e.reviewItemFile);let n=Oae(r,e.inputs.requirementItems,e.inputs.repositoryPath,nce(e));return n.length?{name:this.name,passed:!1,repairable:!0,droppable:n.map(({id:s})=>s),details:n.map(({id:s,why:i})=>`${s}: ${i}`).join("; ")}:{name:this.name,passed:!0}}};function Sar(e,t,r){let n=r.some(u=>u.name===ktt)?`Repair "requirements" in ${Xi(e)}: give each requirement-reference requirement its item's key as "reference" and, as evidence, words copied exactly from that item's file. A requirement no item states is not requirement-reference: one a file of the repository states is spec, with that file as its evidence, and one a pull request description states is pr-description, with its words as evidence. One that still does not hold is dropped and reported as not planned.`:void 0,s=r.some(u=>u.name===Ttt)?`Repair "journeys" in ${Xi(e)} as named above: each needs an entry route, at least two steps each saying what the user then sees, the outcome, the action that finishes the task (walked to, not stopped short of) and a test file, and every ui clause is in some journey's steps or under notInJourney. Where a journey, maintained test or browser-only clause above needs the running app, decide runtime_required in "triage" and mark runtime the clauses it checks (keep existing_unit for the existing unit tests, and make new_unit clauses runtime).`:void 0,i=r.some(u=>u.name===Jae)?`Repair the ids in ${Xi(e)} as named above and keep the rest of the plan: each id is used once (where two items give the same label, put the item's key in front: PAY-185-AC1; unlabelled requirements number on after the highest R-label), a clause id is its requirement's id plus a letter, every case, clause and journey step names a clause or finding the plan has, and a finding names the requirement or clause it breaks.`:void 0,o=r.some(u=>u.name===Yae)?`Repair "findings" in ${Xi(e)} as named above and keep the rest of the plan: give each defect the rule it breaks, under "conflictsWith" the requirements or clauses that state it, under "rule" the rule every app keeps that it breaks, or under "keeps" the path:line of the code beside the change, which it left as it was, that keeps it. Remove a defect with none, and the cases that test it.`:void 0,a=r.some(u=>u.name===vtt)?`Repair "${r2}" in ${Xi(e)}: for each check named above, record what its url returns now, verbatim, or leave the component out.`:void 0,c=r.some(u=>u.name===Xae)?`Repair the clauses named above in ${Xi(e)} and keep the rest of the plan: a clause whose outcome this change cannot alter needs no test, so remove it with the cases and journey steps that name it; where a line this change wrote does alter its outcome, name that line under "code".`:void 0,l=Car(e,t,r);return[n,i,o,c,l,s,a].filter(Boolean).join(`
|
|
642
642
|
`)||void 0}function Car(e,t,r){let n=r.filter(o=>o.name===Rtt);if(!n.length)return;let s=$et(e,t,n),i=n.some(o=>/brought the app up/.test(o.details??""))?['Only runtime_required starts the app: when a clause needs it, decide runtime_required and mark that clause runtime; when none does, stop what you started and remove "app" from the plan.']:[];return[`Repair "triage" in ${Xi(e)} and keep the rest of the plan: its behaviorIds are your clause ids.`,...i,...s?[s]:[]].join(`
|
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.251",
|
|
4
4
|
"description": "Skyramp Testbot engine: AI-powered deterministic test generation, execution and maintenance",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"//files": "An explicit allowlist, never a glob. `dist/` is gitignored, so without this key npm's .gitignore fallback would publish a package with no engine in it; with a glob it would publish the sourcemaps, whose sourcesContent embeds every src/*.ts verbatim. dist/VERSION.json exists only in a release-engine.yml build.",
|