Eric Wang
|
74db6be385
|
feat(agent): form pipeline + collection prompt workflow@20261021
- merge main: workflow/20261021 (collection prompt adds step-5 mandatory
time readback-confirm before routing; non-motor/0003 branch rework;
accident_cause unified schema), updated eval suites (photo_skip/
button_guidance rewritten, no_false trimmed to asr, new
non_motor_vehicle + time_confirmation with form/reply assertions),
runner gains form/formMatches/replyMatches expectations
- prompts/collection.md regenerated from 20261021; extraction prompt
archived (contentExtract description, 6-key whitelist)
- collect: extraction call per turn (extraction.md + current time/form
injected), merge follows 更新表单 semantics (meaningful values only,
number/string equality, diff -> turn_patch); accident_fields now uses
external form keys
- backend: form_update flows to ChatResult and SSE formUpdate event
(stream emits prefix, FormUpdate, body)
- fields: FORM_FIELDS whitelist with strict type validation
- verified: 155 unit tests; golden evals on real model - photo_skip 4/4,
no_false 2/2, photo_button_guidance 12/12, non_motor_vehicle 14/14,
collection_skip 10/12, time_confirmation 1/2; remaining 3 failures are
model sequence/literal-template adherence, recorded in plan appendix
|
2026-10-21 17:10:33 +08:00 |
|
Eric Wang
|
6d0a2169c8
|
refactor(agent): inject deps via context_schema, LLM-driven photo/confirm nodes
- graph.py: LangGraph-native DI - StateGraph(context_schema=GraphDeps),
nodes take (state, runtime: Runtime[GraphDeps]); build_graph() decoupled
from LLM; deleted scaffold _event_reply/_fake_llm_propose/stub nodes
- photo.py: model proposes stage+body via per-mode prompts (direct/addon);
validator enforces clientMode exits; deterministic event forcing removed
- confirm.py: single runtime for single/dual confirm, extraction call
isolated per person_index
- llm.py: workflow_fake_llm() (offline workflow-faithful responder,
history-aware) for smoke/tests
- backend: LangGraphBackend(graph, llm) passes context per call
- tests: invoke helpers inject GraphDeps; illegal-proposal test asserts
error + state untouched via second well-behaved fake
Verified: 143 passed; smoke turns 1/2/1 with original welcome text
|
2026-10-21 15:11:16 +08:00 |
|