Repository navigation
feat!: make every step a set of questions - #37
Merged
Merged
Conversation
A domain now gives an initial state, a question function and a transition function from the state and the answers. The run ends when the question function asks nothing. A pick is one choice question, which the new `picking` helper builds from a choice function; switch adds no stop choice. - Remove the final questions, the answer stages and `run --state-from`. `replay --fork` asks a case's last questions again. - The step limit is an optional safety net. A run ends as done, step limit or failed. - A replay checks that each recorded answer fits the questions asked now, and finds a recorded pick by its choice's key. - The trace has questions and answers entries; result.json loses answers, and run.json loses stateFrom. - The view function loses its purpose argument. - Chess resigns by a choice, WikiRace gives up by a choice, and rubric-judge asks its checks as its last step, with the verdicts in the outcome. - Update the README, docs/MATH.md, AGENTS.md, the example READMEs and the viewer, and add the plan in docs/2026-10-29-questions-as-steps.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
switch asked the model about a state in two ways: a pick at each step, and the final questions after the steps.
Now every step is one set of typed questions, and the domain's transition function gets the answers.
A pick is one choice question that a helper builds, so the final questions, the answer stages and
run --state-fromare gone.The plan, with every decision, is in docs/2026-10-29-questions-as-steps.md.
What Changed
The core loop has one path now. A domain gives
initial,questions(state)andtransition(state, answers), and the run ends whenquestionsgives nothing.StateMachinetype;picking,pickQuestionandpickedChoiceinsrc/core/pick.ts(waschoices.ts). switch adds no stop choice and no longer refuses a repeated pick. The limits arewindowShareand an optionalsteps. A run ends asdone,step limitorfailed. The view function loses its purpose argument. Large question sets are split into batches at every step.start,state,questions,answers,ended,noteandthrown. A replay checks that each recorded answer fits the questions asked now (ids, types, and for a pick, the choice's key). A fork repeats the first n steps.--state-from;result.jsonlosesanswers,run.jsonlosesstateFrom.scoreandcompareread.docs/MATH.md,AGENTS.mdand the example READMEs.Testing
All tests use the fake decider; no model was called.
pnpm checkat the root passes: format, lint, typecheck, tests with coverage, DRY, the viewer and the three examples, and slophammer.Risks
This is a breaking change for every domain and for old run folders.
replay --forkper case; there is no set command for it yet.Follow-ups