chore(dgx): snapshot consolidation WIP pour transfert poc DGX
Regroupe le WIP non committé requis pour le clone/runtime DGX (Option A) : - api_stream.py : préflight replay + smoke santé modèles + handler 403 WP-B - de-hardcode VLM : vlm_config, gpu/*, vram_orchestrator, ollama_manager - stream_processor, semantic_matcher, agent_chat (app/planner/intent) - workflows.db (acquis ; le transfert artifacts le mettra à jour + rewrite chemins) - docs : plans DGX, benchmarks VLM/grounders, recherche SOTA, coordination 8 juin Snapshot destiné à la branche poc-dgx poussée sur Gitea pour cloner le DGX. Scan anti-secret : clean. graphify (repo embarqué) exclu. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -196,6 +196,22 @@ class TestSemanticMatcher:
|
||||
|
||||
workflows = matcher.get_all_workflows()
|
||||
assert len(workflows) == 2
|
||||
|
||||
def test_load_workflows_recursively(self, temp_workflows_dir):
|
||||
"""Les workflows appris dans des sous-dossiers machine sont visibles."""
|
||||
machine_dir = temp_workflows_dir / "DESKTOP-TEST_windows"
|
||||
machine_dir.mkdir()
|
||||
nested = {
|
||||
"name": "Bloc-notes Enregistrer",
|
||||
"description": "Workflow appris dans un sous-dossier machine",
|
||||
"tags": ["bloc-notes"],
|
||||
}
|
||||
with open(machine_dir / "notepad_save.json", "w") as f:
|
||||
json.dump(nested, f)
|
||||
|
||||
matcher = SemanticMatcher(str(temp_workflows_dir), use_llm=False)
|
||||
|
||||
assert matcher.get_workflow("notepad_save") is not None
|
||||
|
||||
def test_find_workflow_exact_match(self, temp_workflows_dir):
|
||||
"""Test matching exact."""
|
||||
@@ -221,6 +237,52 @@ class TestSemanticMatcher:
|
||||
match = matcher.find_workflow("créer une facture")
|
||||
assert match is not None
|
||||
assert "Facturation" in match.workflow_name
|
||||
|
||||
def test_find_learned_save_workflow_from_node_text(self, temp_workflows_dir):
|
||||
"""Les textes appris dans les nodes alimentent le matching sémantique."""
|
||||
workflow = {
|
||||
"name": "Tâche Bloc-notes",
|
||||
"description": "Auto-generated workflow",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "State Pattern 0",
|
||||
"template": {
|
||||
"window": {
|
||||
"title_contains": "Sans titre – Bloc-notes",
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "State Pattern 1",
|
||||
"template": {
|
||||
"window": {
|
||||
"title_contains": "Enregistrer sous",
|
||||
},
|
||||
"text": {
|
||||
"required_texts": ["Nom du fichier", "Enregistrer"],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"action": {
|
||||
"type": "click",
|
||||
"target_text": "Enregistrer",
|
||||
},
|
||||
"expected_window_title": "Enregistrer sous",
|
||||
}
|
||||
],
|
||||
}
|
||||
with open(temp_workflows_dir / "notepad_save_as.json", "w") as f:
|
||||
json.dump(workflow, f)
|
||||
|
||||
matcher = SemanticMatcher(str(temp_workflows_dir), use_llm=False)
|
||||
|
||||
match = matcher.find_workflow("sauvegarde le fichier notepad", min_confidence=0.2)
|
||||
assert match is not None
|
||||
assert match.workflow_id == "notepad_save_as"
|
||||
assert "enregistrer" in matcher.get_workflow("notepad_save_as").keywords
|
||||
|
||||
def test_extract_params(self, temp_workflows_dir):
|
||||
"""Test extraction de paramètres."""
|
||||
|
||||
Reference in New Issue
Block a user