diff --git a/docs/flow-authoring.svg b/docs/flow-authoring.svg new file mode 100644 index 0000000..8d39d5b --- /dev/null +++ b/docs/flow-authoring.svg @@ -0,0 +1,99 @@ +

category

skill

no / already approved

yes

approved

denied / timeout

category

skill

answers

timeout

reconsider

accept

fail

pass

CodegenError / ValueError

budget exhausted

CreateCategory / CreateSkill / repair_skill

single-slot llm worker
DraftAuthor queue

category
or skill?

generate_category()
title + description

generate_skill()
title + description

creation_approval
on?

register stub in registry + tree
trace 'category_created' / 'skill_created'

Output: approval prompt
REPL / dashboard / gateway
deny or timeout aborts

Output: creation aborted
nothing registered, not re-dispatched

chain into skill job
approved=true

single-slot codegen worker
SkillWrite queue
leaf.writing = true

generate_elicitation()
implementation questions +
integration hint

Output: questions
posted one at a time
answer_timeout per question

generate_skill_body()
or regenerate_skill_body() for repair
SKILL.md + bridge catalog
declares INTEGRATION + flat CONTRACT

SemIf choice
phase 'authoring:fidelity'
accept / reconsider
+ static integration_findings

parse_contract()
read body's CONTRACT constant

SemIf choice per variable
phase 'config:search'
global -> category -> skill

generate_skill_tests()
hermetic mechanics test

run_skill_test()
subprocess in skill folder

SemIf choice
phase 'codegen_regen'
regenerate code / test
bounded by test_max_attempts

materialize_skill()
write body + contract to data/skills/
hot-merge into tree

requeue original request
meta awaiting_skill_body
trace 'skill_requeued'

back to main pipeline
re-runs navigation onto new leaf

Output: skill_write_failed
leaf stays a restartable stub
restart cat skill

\ No newline at end of file diff --git a/docs/flow-main.svg b/docs/flow-main.svg new file mode 100644 index 0000000..afa413b --- /dev/null +++ b/docs/flow-main.svg @@ -0,0 +1,99 @@ +

idle

busy

defer

full

ok

run_queue when idle

interrupt

yes

no

rejected

covers

yes (response)

no

none

one

many

different

same

yes

no (noop stub)

runnable

yes

answer() bypasses gate

no

yes

answer()

no

yes

no

retry

complete

user confirms

canned category skips assess

Input
REPL text · gateway DM · dashboard submit

Scheduler.submit_request()
create Request, trace 'submit'

current process?

SemIf score
phase 'score'
How urgent is this?

Scheduler._dispatch()

SemIf choice
phase 'choice'
may this interrupt?

SemIf score
phase 'score'

UrgencyQueue.push
max-heap: weight desc, FIFO seq
age pulls low items toward 1.0

Output: rejected
'queue is full'

Output: queued
urgency label + weight

Abandon pending run
requeue previous at its weight
trace 'preempted'

navigate()
descend tree, one SemIf choice per level

SemIf choice
phase 'navigate:category'
options = categories + descriptions
+ create_category

winner =
create_category
or tree empty?

CreateCategory

SemIf choice
phase 'navigate:category_scope'
P covers >= category_tau?

category in
CANNED_CATEGORIES?

_navigate_canned
phase 'navigate:response'
closed canned reply tree

_run_skill()

skills in
category?

CreateSkill

sole skill
softmax skipped

SemIf choice
phase 'navigate:leaf'
options = existing skills only

picked skill

SemIf choice
phase 'navigate:intent'
P same >= intent_tau?
sole reuse-vs-create guard

authoring pipeline
see below

leaf still
writing?

Output: error
'body still being written'

Output: error
'no body yet; restart cat skill'

SkillRunner.run()
resolve tiered config
global -> category -> skill

contract variable
unresolved?

Output: needs_input
pre_act pause
ask one variable

SemIf choice
phase 'config:record'
record as config vs ask each fire

skill.act(ctx, request)
REAL action via stdlib transport
values from ctx.config

act asks
for input?

Output: needs_input
act pause

SemIf choice
phase 'assess:outcome'
P success >= tau?

success?

deterministic summary
category.name: ok/failed - action_log

SemIf choice
phase 'assess:requeue'
complete vs retry

requeue original request
bounded by max_reentries

SemIf choice
phase 'repair:choice'
retry / repair_skill / ask_user / no_repair

Output: ran
REPL print · gateway reply · dashboard trace

Output: repair offer
surfaced in REPL/dashboard/gateway

\ No newline at end of file diff --git a/docs/flow.md b/docs/flow.md index 8b5caca..dfa2097 100644 --- a/docs/flow.md +++ b/docs/flow.md @@ -10,6 +10,8 @@ output) and the **authoring pipeline** (what happens when navigation decides a category or skill does not exist yet). Authoring is asynchronous: the main gate is freed immediately and the original request is re-queued once the body lands. +Rendered SVG: [flow-main.svg](flow-main.svg) · [flow-authoring.svg](flow-authoring.svg) + --- ## Main pipeline