test: restore taskdoc truncation regression

This commit is contained in:
2026-08-08 21:50:25 +02:00
parent 569bb7f1db
commit ffe0afb6a7
3 changed files with 21 additions and 1 deletions
@@ -179,3 +179,11 @@ def test_vector_migrate_command_is_absent():
assert res.exit_code != 0
assert "No such command 'migrate'" in res.output
def test_memory_solved_index_help_uses_semantic_store_wording():
res = CliRunner().invoke(app, ["memory", "solved-index", "--help"])
assert res.exit_code == 0, res.output
assert "semantic" in res.output.lower() or "qdrant" in res.output.lower()
assert "vectordb" not in res.output.lower()
+12
View File
@@ -45,6 +45,18 @@ def test_task_doc_byte_budget_violation_flagged(tmp_path):
assert doc.byte_budget_ok is False
def test_taskdoc_truncates_over_budget(tmp_path):
s = tmp_path / "sess"
s.mkdir()
(s / "question.md").write_text("# Domanda\n" + "x" * 200_000)
doc = generate_task_doc(session_dir=s, phase=1)
assert doc.byte_budget_ok is False
assert len(doc.body.encode()) <= 80_000
assert "troncato" in doc.body
def test_task_doc_carries_phase_header(tmp_path):
s = tmp_path / "sess"
s.mkdir()