TASK-conversation-console-workflow: preserve strict navigation evidence

This commit is contained in:
thePR0M3TH3AN committed 2026-10-01 09:40:07 -04:00
1 parent cfb69b4900
commit e8c4c4249e
3 files changed
+12 -24

No files matched your search

+2 -1
View File
@@ -2620,13 +2620,14 @@ test_integrity_note:
determinism_controls:
- "The existing isolated sample Console, fixed Playwright clock, and fixed desktop/mobile viewports"
- "Manager-wakes routing uses the existing isolated sample Console, a deterministic two-frame first-generation layout-completion marker, and browser fragment history without changing project state"
- "The later-refresh viewport baseline is measured after the browser's scrollend event confirms the explicit wheel input has settled"
- "The test establishes a fixed nonzero numeric scroll baseline, observes that exact position, dispatches the actual non-scrolling Refresh button event, waits for generation two, and retains the exact scroll-position equality assertion"
- "Newer evidence is introduced through the sample's supported preview/confirm API before an explicit refresh"
- "The browser test advances only the isolated sample API; it never submits the priority form or mutates a live project"
- "No network, live project mutation, retry, sleep, timeout, golden update, or direct fixture-source change"
anti_cheat_rationale:
prevents:
- "Capturing a view other than the one named by the scenario while retaining a passing screenshot call"
- "Passing scroll-preservation coverage because an unsettled smooth-scroll or Playwright auto-scroll masks refresh movement"
- "Reusing a revision N preview after authoritative task evidence advances to N+1"
- "Treating an unchanged preview on refresh as proof of stale-preview invalidation"
- "Passing because of changed screenshot expectations, weakened assertions, or bypassed artifact provenance"
+5 -2
View File
@@ -231,7 +231,7 @@ try {
await page.locator('#owner-briefing .briefing-detail').first().locator('summary').click();
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false, 'expanded briefing evidence must fit mobile width');
await page.locator('#reset-demo').click();
await selectView(page, 'flow-watch');
await selectViewFor(page, '#approval-request-count');
await page.locator('#approval-request-count').filter({ hasText: '1 open' }).waitFor();
assert.equal(await page.locator('.priority-urgent').count(), 0);
assert.equal(await page.locator('.agent-row').count(), 6);
@@ -360,7 +360,10 @@ try {
assert.equal(await preservedForm.locator('[name="reason"]').inputValue(), 'Review this change against the current task evidence.');
assert.equal(await preservedForm.locator('[name="priority"]').isDisabled(), false);
assert.equal(await preservedForm.locator('[name="reason"]').isDisabled(), false);
await preservedTicket.locator('.priority-change > summary').click();
const priorityDetails = preservedTicket.locator('.priority-change');
if (!(await priorityDetails.evaluate((details) => details.open))) {
await priorityDetails.locator(':scope > summary').click();
}
await preservedForm.getByRole('button', { name: 'Review change', exact: true }).click();
await preservedForm.locator('[data-priority-confirm]').waitFor();
assert.equal(await preservedForm.locator('[data-priority-preview]').locator('dd').nth(2).innerText(), String(revisionN1));
+5 -21
View File
@@ -141,23 +141,11 @@ test('SCN-console-operational-deeplink-layout-history-and-refresh: Fleet deep li
await assertManagerWakes();
await page.locator('.console-rail a[href="#work"]').click();
await page.evaluate(() => {
globalThis.__scrollTrace = [];
const nativeScrollTo = globalThis.scrollTo.bind(globalThis);
globalThis.scrollTo = (...args) => {
globalThis.__scrollTrace.push({ type: 'scrollTo', args, y: scrollY });
return nativeScrollTo(...args);
};
for (const type of ['wheel', 'pointerdown', 'hashchange', 'popstate', 'scroll', 'scrollend']) {
globalThis.addEventListener(type, () => globalThis.__scrollTrace.push({ type, hash: location.hash, y: scrollY }), { passive: true });
}
const beforeRefreshRender = await page.evaluate(() => {
window.scrollTo({ top: 347, behavior: 'instant' });
return window.scrollY;
});
const scrollSettled = page.evaluate(() => new Promise((resolve) => {
globalThis.addEventListener('scrollend', resolve, { once: true });
}));
await page.mouse.wheel(0, 180);
await scrollSettled;
const beforeRefreshRender = await page.evaluate(() => scrollY);
assert.equal(beforeRefreshRender, 347, 'the deterministic scroll stimulus must establish its exact nonzero baseline');
await page.locator('#refresh-console').evaluate((button) => {
button.dispatchEvent(new MouseEvent('click', { bubbles: true }));
});
@@ -166,11 +154,7 @@ test('SCN-console-operational-deeplink-layout-history-and-refresh: Fleet deep li
await assertSelectedView(page, 'work', 'Work');
assert.notEqual(await page.evaluate(() => document.activeElement?.id), 'manager-wakes');
assert.equal(await page.evaluate(() => scrollY), beforeRefreshRender,
`a later refresh must retain the user’s scrolled position: ${JSON.stringify({
before: beforeRefreshRender,
after: await page.evaluate(() => scrollY),
trace: await page.evaluate(() => globalThis.__scrollTrace),
})}`);
'a later refresh must retain the exact pre-refresh user scroll position');
}
});