Dialogic Teaching: Basic State Machine with Abstraction Routine

Live and Text are parameterized model roles. Chunk-grill and Synthesis-grill are independent FSM harnesses that both reuse the Open-response protocol. Every learner response longer than yes or no is collected, paraphrased, and confirmed by the Open-response protocol, which returns the complete answer to the active teaching node as OPEN_RESPONSE_CONFIRMED. Text generates a persistent mental model. Live presents it, confirms learner understanding, and selects improve or regenerate.

[Live Model + FSM harness]
Open-response protocol
App owns answer buffer and transitions
[Live Model]
real-time duplex action or analysis
default Gemini Live
[Text Model]
request-response
default Gemini 3.7 Flash
25%

1 - Prerequisite Gate

2 - Concept Body / Single-chunk Loop

3 - Synthesis and Completion

Abstraction routine (available at any time)

Chunk-grill harness

Synthesis-grill harness

BEGIN

READY

YES: Prerequisite = prereqs[cursor]

NO: enter concept body

OPEN_RESPONSE_STARTED

OPEN_RESPONSE_CONFIRMED

YES: Prerequisite confirmed

NO: teach Prerequisite first

Prerequisite complete

Check next Prerequisite

ENTERED

READY

YES: take next chunk

NO: all chunks complete

PRESENTED

RESPONSE

YES: verification still required

NO: ask what is unclear

OPEN_RESPONSE_CONFIRMED

OPEN_RESPONSE_CONFIRMED

App atomically applies tool calls

PASS: all aspects passed

FAIL: attempt limit or surrender

CONTINUE: Live receives remaining aspects and asks follow-up

BAD_DELIVERY

Missing Prerequisite

Present the same chunk again

Prerequisite complete -> retry original chunk

Return to chunk cursor

OPEN_RESPONSE_CONFIRMED

App atomically applies tool calls

PASS: all aspects passed

FAIL: attempt limit or surrender

CONTINUE: Live receives remaining aspects and asks follow-up

Repeat synthesis verification

INFERRED

YES

NO

TARGET_RESOLVED

OPEN_RESPONSE_CONFIRMED

MENTAL_MODEL_READY

CHECK_UNDERSTANDING

NO: ask what is unclear

OPEN_RESPONSE_CONFIRMED

same mental model, clearer

different mental model

YES: adopt abstraction

Prerequisite

chunk -> next chunk

next Prerequisite

NEXT

I don't want to unpack this

Begin teach(Concept)

[Text Model]
listPrerequisites()
ordered prerequisites; cursor = 0

Any unprocessed prerequisites?
cursor < prereqs.length

Probe next Prerequisite
probe_knows(Prerequisite)

[Live Model + FSM harness]
Open-response protocol
prerequisite probe -> confirmed answer

[Live Model]
Prerequisite known?

Recursively call teach(Prerequisite)
return_to = advance_prereq_cursor

Complete current Prerequisite
cursor += 1

[Live Model + FSM harness]
Open-response protocol
solicitation -> confirmed answer

[Text Model]
Live says Checking and spinner is shown
Text assesses confirmed answer
passAspect(aspects[])
incrementAttemptOnAspects(aspects[])

App checks aspect status
pass checkboxes + attempt counters

Enter concept body
mastery[Concept] = TEACHING

[Text Model]
decompose()
ordered chunks

Any unpresented chunks?

Present current chunk
retry address for the same chunk

Await confirmation or question
ask_confirm()

[Live Model]
Did the learner answer YES?
YES still does not establish understanding

[Live Model + FSM harness]
Open-response protocol
what is unclear -> confirmed answer

[Live Model]
Diagnose the failure
missing prerequisite or failed delivery?

Try a different explanation
reframe(chunk)

Recursively call teach(Prerequisite)
return_to = present_chunk

Complete current chunk
advance chunk cursor

[Live Model + FSM harness]
Open-response protocol
solicitation -> confirmed answer

[Text Model]
Live says Checking and spinner is shown
Text assesses confirmed answer
passAspect(aspects[])
incrementAttemptOnAspects(aspects[])

App checks aspect status
pass checkboxes + attempt counters

Add an integration explanation
reframe_integration(Concept)

Complete Concept
MASTERED - return

Infer 'this' from conversation context
focused Prerequisite or chunk

[Live Model]
Can the target be identified?

Propose the inferred target for learner confirmation or correction

[Live Model + FSM harness]
Open-response protocol
resolve parked target -> confirmed answer

[Text Model]
generate / improve / regenerate mental model

[Live Model]
present mental model
ask if learner understands

[Live Model]
Does the learner understand the mental model?

[Live Model + FSM harness]
Open-response protocol
mental-model confusion -> confirmed answer

[Live Model]
improve or regenerate mental model?

Return to main loop
return according to the focused object

Record Prerequisite as abstracted
preserve abstraction contract

Record chunk as abstracted
advance chunk cursor

Any active Prerequisite or chunk state

VALID - 39 states - 65 transitions - Mermaid static render