Unverified Commit 18415429 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

eval: allow static headings in prefetch-stage results (#100984)

## Summary

`049-prefetch-stage` can reject a solution for keeping a static “Related
products” heading in the App Shell, even when the related-product data
stays outside it and is ready before navigation. This affected six saved
attempts in the [Terra
results](https://github.com/vercel/next-evals-oss/pull/161).

Clarify the two grading criteria to allow a static heading, section
wrapper, or loading fallback. Keep the existing requirements for
prefetching, caching, and excluding related-product items from the
shell.

## Verification

- Reviewed all eight saved `049` patches and their recorded
production-payload checks.
- Formatting, ESLint, and `git diff --check` pass.
- Eval typechecking could not start because local dependencies are
missing `vitest` types.
- No model or judge reruns; existing scores are unchanged.

<!-- NEXT_JS_LLM -->
parent 889deb0a
...@@ -72,13 +72,13 @@ test('uses the prefetch cache stage', () => { ...@@ -72,13 +72,13 @@ test('uses the prefetch cache stage', () => {
test('keeps stable product content in the reusable shell', async () => { test('keeps stable product content in the reusable shell', async () => {
await expect(environment).toSatisfyCriterion( await expect(environment).toSatisfyCriterion(
`The product title and description must remain in the reusable product App Shell. The related-products section must remain outside that shell, beneath its own Suspense boundary. Reject solutions that put the whole product page behind the prefetch stage or move related products into the App Shell. Accept equivalent component and file organization.` `The product title and description must remain in the reusable product App Shell. The related-product data must remain outside that shell, beneath its own Suspense boundary. A static section wrapper, heading, or loading fallback may remain in the shell. Reject solutions that put the whole product page behind the prefetch stage or include the actual related-product items in the App Shell. Accept equivalent component and file organization.`
) )
}) })
test('includes related products only in the selected prefetch', async () => { test('includes related products only in the selected prefetch', async () => {
await expect(environment).toSatisfyCriterion( await expect(environment).toSatisfyCriterion(
`The related-products section must be available before navigation from the featured-product Link without joining the default product App Shell. `The related-product data must be available before navigation from the featured-product Link without joining the default product App Shell. Do not fail a static section wrapper, heading, or loading fallback that remains in the shell.
Render related products through an async component that awaits prefetch() before calling the cached getRelatedProducts() function. The prefetch() call must be outside every use cache scope, while the existing cached data function stays below it. Render related products through an async component that awaits prefetch() before calling the cached getRelatedProducts() function. The prefetch() call must be outside every use cache scope, while the existing cached data function stays below it.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment