Description
Runtime revision and environment
main (post #630). Found while converting recipes/middleware's constant-response functions for #599.
Minimal reproduction
packages/core/src/review.ts's constant-response signal uses a conservative word-boundary regex (matching words like state, env, etc.) to guess whether a function body is dynamic. A genuinely constant function whose literal JSON body happens to contain one of those words as a substring (e.g. a field named state in a fixed response) is treated as dynamic and never flagged, even though it's a fixed answer respond: {json: ...} could express directly. Confirmed with recipes/middleware/functions/status.mjs before it was converted in #630 — the detector reported 0 observations for it despite it being a hand-verified constant.
Suggested fix
Tighten the heuristic to distinguish an identifier reference (e.g. request.state, process.env.X) from the same word appearing inside a string/object-literal value. Not urgent; the recipe conversions in #630 didn't depend on the detector catching this specific case.
Activity