Strengthen mobile product acceptance gate
This commit is contained in:
parent
3b94787f08
commit
ea1850dde0
@ -157,7 +157,7 @@ server. Release checks fail on warnings.
|
||||
|
||||
For demo and handoff details, see
|
||||
[`docs/product-readiness.md`](docs/product-readiness.md). That document records
|
||||
the real backend topology, acceptance criteria, current 21/21 baseline, evidence
|
||||
the real backend topology, acceptance criteria, current 22/22 baseline, evidence
|
||||
paths, and known product boundaries.
|
||||
|
||||
For the Franka joint/gripper control path:
|
||||
|
||||
@ -106,6 +106,7 @@ The product acceptance gate must pass with zero failures. It checks:
|
||||
asset health evidence.
|
||||
- Nonblank WebGL rendering.
|
||||
- Expected object, mesh, and body binding counts.
|
||||
- Full mobile scene loading and mobile acceptance panel.
|
||||
- Pause/resume backend state and visible UI latency.
|
||||
|
||||
Evidence is written under:
|
||||
@ -121,9 +122,9 @@ handoff or upload them to the external report system when needed.
|
||||
|
||||
Latest verified product gate:
|
||||
|
||||
- Started: `2026-06-24T02:02:39.629Z`
|
||||
- Finished: `2026-06-24T02:05:17.285Z`
|
||||
- Result: `21 passed / 0 warned / 0 failed`
|
||||
- Started: `2026-06-24T02:21:00.779Z`
|
||||
- Finished: `2026-06-24T02:25:26.023Z`
|
||||
- Result: `22 passed / 0 warned / 0 failed`
|
||||
- Frontend mode: `preview`
|
||||
- Fail on warning: `true`
|
||||
- Frontend URL:
|
||||
@ -143,6 +144,9 @@ Scene evidence:
|
||||
- Meshes: `627`
|
||||
- Editable groups: `4 / 568`
|
||||
- Fallback meshes: `0`
|
||||
- Desktop acceptance: `9 通过 / 0 警告 / 0 失败,共 9 项`
|
||||
- Mobile preview: `636 objects / 635 bindings / 30 pixels`
|
||||
- Mobile acceptance: `9 通过 / 0 警告 / 0 失败,共 9 项`
|
||||
|
||||
Bundle evidence:
|
||||
|
||||
@ -153,14 +157,16 @@ Bundle evidence:
|
||||
|
||||
Control evidence:
|
||||
|
||||
- Resume backend state: `57ms paused=false`
|
||||
- Resume visible UI state: `47ms`
|
||||
- Pause backend state: `1304ms paused=true`
|
||||
- Pause visible UI state: `1297ms`
|
||||
- Resume backend state: `66ms paused=false`
|
||||
- Resume visible UI state: `68ms`
|
||||
- Pause backend state: `1927ms paused=true`
|
||||
- Pause visible UI state: `1917ms`
|
||||
- Desktop acceptance self-check: `5300ms`
|
||||
- Mobile acceptance self-check: `21271ms`
|
||||
- Runtime diagnostics panel:
|
||||
`state=http://127.0.0.1:18090/state`,
|
||||
`control=http://127.0.0.1:18090/control`,
|
||||
`latency=响应 1296 ms / 确认 1296 ms / 可见 1297 ms`,
|
||||
`latency=响应 1916 ms / 确认 1916 ms / 可见 1917 ms`,
|
||||
`binding=635/636; 4/568`.
|
||||
|
||||
Visible UI control sync is the product interaction SLA and must stay under the
|
||||
|
||||
@ -334,12 +334,21 @@ async function waitForProductScene(page) {
|
||||
async function waitForMobileScene(page) {
|
||||
await page.waitForFunction(([limits]) => {
|
||||
const num = (selector) => Number((document.querySelector(selector)?.textContent ?? "0").match(/-?\d+(?:\.\d+)?/)?.[0] ?? "0");
|
||||
return num("#stat-objects") >= limits.minMobileObjects
|
||||
&& num("#stat-meshes") >= limits.minMobileMeshes
|
||||
const status = document.querySelector("#status")?.textContent ?? "";
|
||||
const groupText = document.querySelector("#stat-groups")?.textContent ?? "";
|
||||
const groupMatch = groupText.match(/(\d+)\s*\/\s*(\d+)/);
|
||||
const groups = groupMatch ? Number(groupMatch[1]) : 0;
|
||||
const groupedObjects = groupMatch ? Number(groupMatch[2]) : 0;
|
||||
return /已加载 manifest|loaded manifest|manifest loaded/i.test(status)
|
||||
&& num("#stat-objects") >= limits.minObjects
|
||||
&& num("#stat-bindings") >= limits.minBodyBindings
|
||||
&& num("#stat-meshes") >= limits.minMeshes
|
||||
&& groups >= limits.minEditableGroups
|
||||
&& groupedObjects >= limits.minGroupedObjects
|
||||
&& num("#stat-pixels") > 0
|
||||
&& (document.querySelector("#stat-step")?.textContent ?? "-") !== "-";
|
||||
}, [thresholds], { timeout: 60000 });
|
||||
await page.waitForTimeout(500);
|
||||
}, [thresholds], { timeout: thresholds.browserReadyMs });
|
||||
await page.waitForTimeout(1000);
|
||||
}
|
||||
|
||||
async function safeScreenshot(id, page, filePath) {
|
||||
@ -384,6 +393,20 @@ async function clickButton(page, selector) {
|
||||
return Math.round(performance.now() - started);
|
||||
}
|
||||
|
||||
async function runAcceptanceReview(page) {
|
||||
const started = performance.now();
|
||||
const clickMs = await clickButton(page, "#acceptance-run");
|
||||
await page.waitForFunction(() => {
|
||||
const score = document.querySelector("#acceptance-score")?.textContent?.trim() ?? "";
|
||||
const verdict = document.querySelector("#acceptance-verdict")?.textContent?.trim() ?? "";
|
||||
const status = document.querySelector("#acceptance-status")?.textContent?.trim() ?? "";
|
||||
const hasScore = /\d+\s*(通过|passed)\s*\/\s*\d+\s*(警告|warnings?)\s*\/\s*\d+\s*(失败|failed)/i.test(score);
|
||||
const stillWaiting = /等待自检|waiting/i.test(`${verdict} ${status}`);
|
||||
return hasScore && !stillWaiting;
|
||||
}, undefined, { polling: 100, timeout: thresholds.browserReadyMs });
|
||||
return { clickMs, elapsedMs: Math.round(performance.now() - started) };
|
||||
}
|
||||
|
||||
async function waitForDom(page, predicate, arg) {
|
||||
const started = performance.now();
|
||||
try {
|
||||
@ -495,8 +518,7 @@ async function verifyBrowser() {
|
||||
const resumeControl = await controlThroughUi(desktop, "#viewport-resume", false);
|
||||
const resumed = await readBrowserStats(desktop);
|
||||
const pauseControl = await controlThroughUi(desktop, "#viewport-pause", true);
|
||||
await clickButton(desktop, "#acceptance-run");
|
||||
await desktop.waitForFunction(() => (document.querySelector("#acceptance-score")?.textContent ?? "").includes("/"), undefined, { timeout: 10000 });
|
||||
const desktopAcceptance = await runAcceptanceReview(desktop);
|
||||
const desktopStats = await readBrowserStats(desktop);
|
||||
const desktopScreenshot = await safeScreenshot("browser-desktop-screenshot", desktop, path.join(outDir, "product-readiness-desktop.jpg"));
|
||||
|
||||
@ -504,6 +526,7 @@ async function verifyBrowser() {
|
||||
await mobile.addInitScript(() => window.localStorage.removeItem("motrixsim-web-locale"));
|
||||
await mobile.goto(frontendUrl.href, { waitUntil: "domcontentloaded" });
|
||||
await waitForMobileScene(mobile);
|
||||
const mobileAcceptance = await runAcceptanceReview(mobile);
|
||||
const mobileStats = await readBrowserStats(mobile);
|
||||
const mobileScreenshot = await safeScreenshot("browser-mobile-screenshot", mobile, path.join(outDir, "product-readiness-mobile.jpg"));
|
||||
|
||||
@ -515,6 +538,7 @@ async function verifyBrowser() {
|
||||
const pixelCount = numericText(desktopStats.pixels);
|
||||
const sourceLabel = `${desktopStats.sourceLabel} ${desktopStats.projectSource}`;
|
||||
const acceptancePassed = acceptanceScoreHasNoFailures(desktopStats.acceptanceScore);
|
||||
const mobileAcceptancePassed = acceptanceScoreHasNoFailures(mobileStats.acceptanceScore);
|
||||
|
||||
check("browser-default-language", desktopStats.lang === "zh-CN", desktopStats.lang);
|
||||
check("browser-visible-preview", pixelCount > 0 && Boolean(desktopStats.canvas), `${pixelCount} non-background samples`);
|
||||
@ -538,12 +562,20 @@ async function verifyBrowser() {
|
||||
check("browser-resume-dom-sync", resumeControl.dom.ok && resumeControl.dom.elapsedMs <= thresholds.targetUiControlMs, `${resumeControl.dom.elapsedMs}ms`, resumeControl.dom.ok ? "warn" : "warn");
|
||||
check("browser-pause-backend-state", pauseControl.backend.ok, `${pauseControl.backend.elapsedMs}ms paused=true`);
|
||||
check("browser-pause-dom-sync", pauseControl.dom.ok && pauseControl.dom.elapsedMs <= thresholds.targetUiControlMs, `${pauseControl.dom.elapsedMs}ms`, pauseControl.dom.ok ? "warn" : "warn");
|
||||
check("browser-mobile-preview", numericText(mobileStats.pixels) > 0 && numericText(mobileStats.objects) >= thresholds.minMobileObjects, `${mobileStats.objects} objects / ${mobileStats.pixels} pixels`);
|
||||
check(
|
||||
"browser-mobile-preview",
|
||||
numericText(mobileStats.pixels) > 0
|
||||
&& numericText(mobileStats.objects) >= thresholds.minObjects
|
||||
&& numericText(mobileStats.bindings) >= thresholds.minBodyBindings,
|
||||
`${mobileStats.objects} objects / ${mobileStats.bindings} bindings / ${mobileStats.pixels} pixels`,
|
||||
);
|
||||
check("browser-mobile-acceptance-panel", mobileAcceptancePassed, mobileStats.acceptanceScore);
|
||||
|
||||
return {
|
||||
desktop: desktopStats,
|
||||
mobile: mobileStats,
|
||||
controlTimings: { resume: resumeControl, pause: pauseControl },
|
||||
acceptanceTimings: { desktop: desktopAcceptance, mobile: mobileAcceptance },
|
||||
paused,
|
||||
resumed,
|
||||
screenshots: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user