Stage 6: learn_call_flow rebuilt on the learner, docs truth sweep #6
Reference in New Issue
Block a user
Delete Branch "feature/stage6-learner-and-truth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stage 6 of the architecture-review roadmap (stacked on #5) — the final stage. The auto-learned IVR flows that are core to the vision actually work now, and the docs stop describing a system that doesn't exist.
learn_call_flow rebuilt (F1, F9)
The old tool crashed on a wrong constructor and a nonexistent method; worse,
run_explorationbuilt itsdiscovered_stepslist and threw it away — nothing ever fed the learner. Now:ActiveCall.exploration_steps) and persist into the CallRecord'smetadataJSON (durable per Stage 5).CallFlowLearnerwith its real contract:CallFlowLearner(llm_client=get_llm())— heuristic step labels when no LLM is available, LLM-enhanced when there is one.build_flow+save_learned_flow; existing flow for the number →merge_discoveriesrefines it (timeouts averaged, usage counters bumped). The CallFlow↔row mapping stays incall_persistence.py.Verified over the wire: a real streamable-HTTP MCP client lists 15 tools and
learn_call_flowanswers against the live DB.Test gaps closed (F10)
tests/test_learner.py(5): discoveries → linked DTMF/HOLD/TRANSFER steps, exploration data survives with the persisted record, learn-then-refine end-to-end through the in-memory MCP client on real SQLite, no-exploration-data and unknown-call answers.tests/test_websocket.py(3): socket refused with 4401 without the token, authorized connect gets the synthetic trunk-status event then the replayed history, per-call stream filters to its call.Docs truth sweep (F10)
pjsua2bindings are installed, Alembic + honest-/health checked off in the roadmap.hangup(not the fictionalend_call), real parameters for every tool, the 3 real resources (the doc listed 5, 4 of which never existed), correct/mcp/streamable-HTTP connection config with bearer auth.pyproject cleanup
Pruned dependencies with zero imports anywhere:
websockets,librosa,soundfile,python-multipart.alembicis now genuinely used (Stage 5).This completes the six-stage plan: #1 MCP real + safe → #2 concurrency correctness → #3 structure → #4 honest health → #5 data layer → #6 learner + truth. Merge order is bottom-up (#1 first, each PR's base retargets to main as its parent merges — Gitea does this automatically on branch deletion).
🤖 Generated with Claude Code