Skip to content

Turn Run off where there is nothing to run - #31

Merged
onatozmenn merged 1 commit into
mainfrom
run-is-the-wrong-button
Jul 31, 2026
Merged

Turn Run off where there is nothing to run#31
onatozmenn merged 1 commit into
mainfrom
run-is-the-wrong-button

Conversation

@onatozmenn

Copy link
Copy Markdown
Contributor

Follow-up to #30, which was not the fix.

Explaining the refusal after the fact is still telling somebody afterwards. Twenty-two of the twenty-nine examples are libraries, so for most of the corpus the first thing a reader does is press a button that cannot work.

The picker knows now. examples/index.json records, per example, whether it has a main and how many tests it has, and Run is off before it is reached for, with the reason beside it:

A library: no main to run, 3 tests to press Test on.

Both facts are asked, not guessed

tools/examples.mjs runs the pinned artifact over each file and reads its answer. Looking for fn main in the text would be a small parser written here, which is the thing this repository does not do.

$ node tools/examples.mjs
29 examples at v0.2.2: 7 with a `main`, 22 libraries.

It is a maintenance script, run when the pin moves, alongside the two commands already documented for that. tools/check.mjs fails if any entry is missing summary, runs or tests, so an index regenerated by an older version of the script cannot ship quietly.

The button comes back

The moment the text is edited, because what was known was known about the example and not about whatever it has become. A shared link is not an example either.

The note added in #30 stays, for a program somebody wrote themselves with no main. That is the path that cannot be known in advance.

Checked

example Run note
calendar off A library: no main to run, 3 tests to press Test on.
tic_tac_toe off A library: no main to run, 3 tests to press Test on.
hello on
todo on

Then typing one character into calendar: Run on, note gone.

Written with AI assistance.

Explaining the refusal after the fact was not the fix. Twenty-two of the
twenty-nine examples are libraries, so for most of the corpus the first thing
somebody does is press a button that cannot work, and being told why
afterwards is still being told afterwards.

So the picker knows. `examples/index.json` now records, per example, whether
it has a `main` and how many tests it has, and Run is off before it is
reached for, with the reason next to it.

Both facts are asked, not guessed. `tools/examples.mjs` runs the pinned
artifact over each file and reads its answer, because looking for `fn main` in
the text would be a small parser written here, which is the thing this
repository does not do. Seven of twenty-nine have a `main`.

The button comes back the moment the text is edited, since what was known was
known about the example and not about whatever it has become. A shared link
is not an example either.

The note under the last change stays, for a program somebody wrote themselves
that has no `main`. That path is the one that cannot be known in advance.

Co-authored-by: GitHub Copilot <copilot@github.com>
@onatozmenn
onatozmenn merged commit 606ea24 into main Jul 31, 2026
1 check passed
@onatozmenn
onatozmenn deleted the run-is-the-wrong-button branch July 31, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant