Wait, What?
Code on the screen can be correct while the output underneath it comes from an older version.
In notebooks, browser IDEs and classroom coding platforms, learners do not interact with code as static text. They interact with a runtime state: variables already exist, cells may have run out of order, files may not be saved, inputs may differ, and an output may survive after its source has changed. That means “the code looks right” and “this is what just ran” are not automatically the same statement.
The Student/Studying Interface job is to make the transition from visible code to executed state operable enough that the learner knows what ran, under which inputs, what output returned, and what to do next.
Quick Answer
The Code-Execution Interface converts editable source code into a traceable run. The learner identifies the exact cell, file or program to execute, preserves the current source, checks required inputs and prior state, runs deliberately, reads the returned output or error, distinguishes source problems from stale runtime state, and returns the evidence to the programming task rather than repeatedly pressing Run.
Owned Interface Job
VISIBLE SOURCE CODE → KNOWN EXECUTION STATE → OBSERVABLE OUTPUT/ERROR → NEXT PROGRAMMING ACTION.
This page does not own programming concepts, debugging strategy as an internal reasoning operation, algorithm design, teacher feedback, assessment validity or performance calibration. MindOS owns the learner’s internal representation, comparison and explanation operations. Bolt owns what a coding performance later justifies believing. This page owns the external source-to-runtime handoff.
Observable Interface Signatures
- The learner edits code but does not rerun it, then interprets an old output as current.
- A notebook cell uses a variable created several cells earlier, but the learner cannot identify that dependency.
- Cells are executed out of order and produce a state that would not exist in a clean top-to-bottom run.
- The student repeatedly clicks Run after an error without changing either source, input or state.
- A program works only because a previous run created hidden state.
- The learner reads an exception message as proof that the whole idea is wrong rather than as a signal about a specific execution point.
- The visible file differs from the saved or submitted file.
- The program produces output, but the learner cannot state which input produced it.
Mechanism: Code Has Source State and Runtime State
A programming environment has at least two visible-to-learner layers. Source state is the code currently written. Runtime state is what exists after execution: variables, files, imports, outputs, errors and other effects. In a simple script, restarting the program may recreate runtime state from the source. In notebooks, state can persist across cells and across many partial runs.
Jupyter’s documentation explicitly notes that notebook cells can be executed in different orders and that execution counts record that order. Its guidance on restarting and running all cells reflects the practical need to test whether a notebook works from a clean state rather than only inside a history of hidden prior executions.
The Seven-Step Code-Execution Route
- Name the run target. Which cell, file, function or program should execute?
- Preserve source state. Know whether the current code is saved and whether the submitted version will match it.
- Check dependencies. What inputs, variables, files, imports or previous cells must already exist?
- Run deliberately. Execute once under a known state rather than using repeated Run as a search strategy.
- Read the return. Output, warning and error messages are different kinds of signals.
- Discriminate the failure. Is the problem in the source, input, environment, dependency or stale runtime state?
- Return to the programming job. Make one justified next change, rerun or clean-state check.
Clean-State Check
When a notebook behaves strangely, a clean-state run is a powerful discrimination check: restart the runtime when safe, then run the required sequence from the beginning. If the result changes, the earlier success or failure depended on hidden execution history. If it remains the same, the learner has stronger evidence that the visible source and required inputs are sufficient to reproduce the result.
This is an interface check, not a universal debugging cure. Restarting can destroy unsaved state, so learners should preserve needed work first.
Competing Explanations When Code “Does Not Work”
- The code may contain a genuine syntax or logic error.
- The expected file or input may be missing.
- A variable may contain an old value from a previous run.
- The environment may be using a different library, version or path.
- The wrong cell or file may have executed.
- The output may actually be correct but unexpected because the learner’s prediction was wrong.
- The environment may have timed out, disconnected or reset.
Do not infer weak programming knowledge until execution state has been separated from source reasoning.
Staged Use and Scaffold Fade
- Stage 1: adult or teacher models source → dependencies → run → return.
- Stage 2: learner records which cell/file ran and checks one dependency before rerunning.
- Stage 3: learner independently distinguishes source errors from environment or stale-state errors.
- Stage 4: learner can enter an unfamiliar coding environment, reproduce the run from a clean state and preserve the state needed for submission or continuation.
The scaffold should fade toward selective state checks. Expert operation is not constant restarting; it is knowing when hidden state is a plausible competing explanation.
Transfer and Independence Test
Give the learner a short notebook with cells that have been executed out of order. Can they identify that the visible output may be stale, reconstruct the required execution order, perform a clean run and explain which output belongs to which source state? That is the transfer test.
Return Test
Ask: “What exactly ran, under what state, and what does the return tell you to do next?” A strong answer names the source, dependencies and next action. A weak answer is: “I pressed Run and it gave an error.”
Examples Across Subjects and Ages
Introductory coding: a learner edits a print statement, reruns the correct cell and verifies the new output instead of reading an older result.
Secondary Computing: a variable unexpectedly retains yesterday’s value in a persistent environment; the learner resets state before deciding the algorithm is wrong.
Science: a notebook loads a dataset, transforms it and graphs the result. The learner checks that the graph came from the latest transformed data rather than a previous run.
Mathematics: code explores a numerical sequence. The learner keeps parameter values attached to each output before comparing patterns.
Higher education: a reproducible notebook is restarted and run from top to bottom before submission so hidden local state does not carry the result.
Examination Implications
Programming assessments vary widely: some use locked IDEs, some use notebooks, some require handwritten code, and some evaluate executable projects. Students should practise under the target environment where possible. If execution tools are available, interface fluency should not consume the cognitive capacity needed for the coding task. Later interpretation of supported versus unsupported performance belongs to Bolt.
Parent Usefulness
Parents can ask: “What exactly did you run?”, “Is that output from the code you can see now?”, and “Would it still work if you restarted and ran it cleanly?” These questions expose runtime state without requiring the parent to know the programming language.
Do not infer that repeated errors mean the learner lacks the concept. The failure may sit in execution order, environment state or input. Equally, do not infer mastery merely because one persistent notebook eventually produces the expected output.
Tutor and Teacher Guide
Teach runtime state explicitly when using notebooks or persistent coding environments. Model stale outputs, out-of-order execution and clean-state reproduction rather than presenting every error as a source-code problem. Keep file/version state visible before submission.
When learners debug, require a discriminating next action rather than repeated execution. “Change one thing, predict what should happen, run, inspect the return” preserves agency and makes the environment an instrument rather than a slot machine.
How Do We Know?
Project Jupyter’s documentation explains notebook execution order, execution counts and kernel state, and provides explicit restart-and-run workflows for restoring a clean execution sequence. These platform mechanics support the core interface distinction between visible source and runtime history. The seven-step route in this manual is an operational educational synthesis rather than a claim that one debugging protocol is universally optimal.
- Project Jupyter — Notebook documentation
- Project Jupyter — Running kernels and terminals
- CAST UDL 3.0 — Action & Expression
Evidence and Uncertainty Boundary
Coding environments differ in persistence, execution model, sandboxing and error reporting. A clean restart is not appropriate in every environment and can erase unsaved work. This manual therefore makes a narrower claim: learners should know which source state executed, what dependencies were active and what output or error actually returned before deciding what the programming result means.
MindOS and Bolt Handoffs
If execution state is clear but the learner cannot explain the algorithm or choose a repair, route to MindOS. If later performance is interpreted, Bolt should preserve whether code execution, autocomplete, external libraries or other supports were available. Student/Studying Interface owns only the source-to-runtime-to-return boundary.
Student/Studying Interface Direction Graph
CODE READY TO RUN ├── Source state uncertain? → SAVE / IDENTIFY VERSION ├── Required dependency/input uncertain? → CHECK STATE ├── Run target clear? → EXECUTE ├── Output/error returned? → READ RETURN ├── Result inconsistent with visible source? → CHECK STALE RUNTIME / EXECUTION ORDER ├── Clean-state reproduction needed? → PRESERVE WORK → RESTART/RUN WHEN SAFE ├── Programming reasoning still unclear? → MINDOS └── Result understood? → NEXT CODE ACTION / OUTPUT
Student/Studying Interface rule: code execution becomes operable when the learner can connect the visible source to the exact runtime state and return that produced the result.
