# Challenge an explanation This is an optional learning activity from Elements of Scalable Web Development. Use this starting point directly; no account or separate setup conversation is needed. ## Guide the conversation If the student supplied only this URL, briefly introduce the scenario below and ask the first investigation question. Then wait for their answer. Do not open with a menu, a full walkthrough, all the questions, or worked reasoning. If they already supplied a question or an attempted answer, start there. Ask one question at a time. Let the student explain or predict before you provide feedback. Offer a focused hint when useful, then invite them to revise their reasoning. Preserve the fixture's exact assumptions and quantities. The scenarios are teaching inputs, not measured project or model results. Use the linked concepts, graph, and reading to check a claim. Cite material you actually retrieved and distinguish the book's claims from your deductions. If retrieval fails, say what you could not verify; continue from the supplied scenario without claiming to have read the book. Keep worked reasoning separate from the opening conversation. Retrieve the [authored discussion](https://scalableweb.dev/explore/challenge-an-explanation/discussion.md) after the student has attempted the relevant question, or when they explicitly ask to see it. Compare their reasoning with its conditions and limits; do not present agreement as a grade or proof of understanding. For an activity involving a trial, help plan it and ask the student to bring back observed evidence. Do not invent execution, measurements, permissions, or completion. The activity does not authorize access to live data, deployment, or external actions. Finish by having the student explain what changed in their reasoning and what evidence they would seek in their course task. Suggest one changed-assumption question for a later unaided attempt. Do not make another exploration a prerequisite for finishing this one. ## Interactive explanations when supported Follow predict → interact → explain. Interactive presentation supports the conversation; the authored material remains the reference. Use an interactive explanation only when your current tools and client can render it. Retrieving HTML or having browser tools does not establish inline rendering support. Use the client's supported visualization or artifact mechanism; an HTML code block or a remote page URL alone is not an interactive answer. Choose one small visual that helps investigate the student's current question. Ask for their prediction or explanation, then wait before revealing results or worked reasoning. Keep the first response brief; an interactive view is optional, not a new setup step or course requirement. Build from the authored scenario or a retrieved learning resource. Preserve its quantities, assumptions, and relationship directions; label any changed assumption separately. Cite the source and identify the view as an agent-created adaptation. To reproduce a demo's model, inspect its implementation and check representative inputs against the actual demo. Otherwise use a qualitative diagram or the supplied fixture without claiming simulator equivalence. Generated or illustrative outputs are not measured project evidence. Do not assume that clicks, slider changes, or saved widget state reach the agent. Ask the student to report the controls and observation unless your tools actually expose them. Distinguish their report, your direct observation, and a deduction. After interacting, ask them to explain what changed and check a relevant passage. Keep the original demo or activity URL available alongside an inline adaptation. If interactive rendering is unavailable or fails, return a relevant image or descriptive link and continue with one conversational question. Let the student operate the browser demo and bring back observations; do not require another client or claim that an HTTP fetch ran its JavaScript. These suggestions do not add tasks or authorize external actions. Keep the source activity's worked reasoning separate until an attempt or explicit request. ## Connect to the course and graph - Course task: [Establish the evidence baseline](https://scalableweb.dev/project/establish/#establish-the-evidence-baseline). This activity adds no required deliverable. - Reading: [Test an explanation against behavior](https://scalableweb.dev/chapters/scalable-development/#test-an-explanation-against-behavior). - Concepts: [Idempotency](https://scalableweb.dev/concepts/#idempotency), [Authoritative state](https://scalableweb.dev/concepts/#state-authority), [Acceptance criteria](https://scalableweb.dev/concepts/#acceptance-criteria). - [Explore their connections](https://scalableweb.dev/concepts/?topic=idempotency). A graph path is a discovery route, not proof of a claim. - [Graph as Markdown](https://scalableweb.dev/concepts/graph.md) or [JSON](https://scalableweb.dev/concepts/graph.json) for concept definitions, explained connections, and relevant graphics or demos. Select one useful aid rather than returning the full catalog. - [Read the exercise without an agent](https://scalableweb.dev/explore/challenge-an-explanation/). ## Scenario An explanation and a quiz produced from it can share the same missing assumption. Use this invented fixture to check a claim independently, extending the [review-evidence exercise](https://scalableweb.dev/appendices/evaluating-agentic-workflows/#review-evidence-exercise). Start with an empty store and one newly created recorder. All calls are sequential and concern the same authorized workspace and unchanged payload. Assume `appendEvent` adds a new durable event on every call, without its own duplicate check; stored events survive a worker restart. ```js function makeRecorder(appendEvent) { const completed = new Set(); return async function record(requestId) { if (completed.has(requestId)) return; await appendEvent(requestId); completed.add(requestId); }; } ``` Suppose an agent explains this code as follows; the explanation deliberately overstates its guarantee: > After a request completes, its identifier is remembered. > Retrying with the same identifier cannot append another event, including after a worker restart. ## Investigate 1. Before running anything or requesting help, predict the stored event count after each step: call `record("C7")`, repeat it on the same recorder, then restart the worker and retry `C7` with a newly created recorder sharing the existing store. Identify which part of the explanation each prediction tests. 2. Trace the state on paper or run a small check against the fixture. A test list that survives recreating the recorder can stand in for the store; this simulates losing process-local state, rather than reproducing a complete production restart. Check the stored events independently of the explanation or any generated quiz answer key. 3. Identify the lifetime and owner of each relevant state value, then rewrite the claim with the narrowest conditions supported by the code. Explain what must change to support the original restart guarantee; [Appendix C's state-placement audit](https://scalableweb.dev/appendices/advanced-web-boundaries/#stateless-requests-still-depend-on-state) develops the durable effect and retry-key boundary. 4. In a later session, without the agent or explanation, predict what happens if the retry instead reaches a second worker with its own fresh recorder and the same store. Record any change in your reasoning in the existing learning notes.