(area)
| 151 | await page.waitForFunction(() => document.querySelector('[data-testid="atlas-twin"]')?.getAttribute('data-status') === 'ready', undefined, { timeout: 40000 }); |
| 152 | }; |
| 153 | const guard = async (area) => { |
| 154 | const subject = await page.evaluate((name) => { |
| 155 | const seam = name === 'twin' ? globalThis.__atlasTwin : name === 'flow' ? globalThis.__atlasFlow : globalThis.__atlasChatReader; |
| 156 | return seam?.subject ?? []; |
| 157 | }, area); |
| 158 | const refusals = await page.evaluate(({ name, answers }) => { |
| 159 | const seam = name === 'twin' ? globalThis.__atlasTwin : name === 'flow' ? globalThis.__atlasFlow : globalThis.__atlasChatReader; |
| 160 | if (seam === undefined) throw new Error(`${name} reader guard is unavailable`); |
| 161 | return answers.map((answer) => ({ answer, ...seam.validateRewrite(answer) })); |
| 162 | }, { name: area, answers: corruptions(subject) }); |
| 163 | report.guardRefusals += refusals.filter((entry) => !entry.applied && entry.reason.length > 10).length; |
| 164 | return { guardIsTheRealOne: true, refusals }; |
| 165 | }; |
| 166 | const noAutoRequestDuring = async (area, action) => { |
| 167 | const before = sidecarRequests; |
| 168 | await action(); |
no test coverage detected