feat(mcp): FU-14 GAP-48 פרוסה 3 — envelope למשפחת drafting (סגירת GAP-48)
הפרוסה האחרונה של GAP-48 (INV-TOOL1). 18 כלי drafting הומרו ל-{status,data,message}
דרך tools/envelope.py — כולל מסלול הפקת-ההחלטה הקריטי.
עיקרון לכלים עם כשל משמעותי (export_docx/revise_draft/apply_user_edit): err()
ברמת-המעטפת — כך שהסוכן והמשתמש רואים את הכשל; failed_gates רוכב ב-data.
שאר הכלים: ok(data=payload) להצלחה, err להיעדר-תיק/קלט-שגוי/חריגה.
6 צרכני-app.py חוּוטו (get_decision_template, apply_user_edit ×2, revise_draft,
list_bookmarks, export_docx) עם envelope_unwrap + בדיקת status=="error"→4xx,
לשמירת חוזה-ה-API (X6) ללא-שינוי. test_export_qa_gate עודכן לחוזה החדש.
בדיקות: 182/182 עוברים (כולל שערי-QA של הייצוא).
GAP-48 סגור: כל ~12 משפחות-הכלים אחידות. נותר ב-FU-14: GAP-49/50 (שובר), GAP-54.
Invariants: משלים INV-TOOL1 + G2. מתועד ב-X9 (נסגר) + gap-audit פרוסה 7.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -125,8 +125,9 @@ def test_export_blocked_when_critical_failures(
|
||||
monkeypatch.setattr(db, "get_critical_qa_failures", _get_critical)
|
||||
|
||||
out = json.loads(_run(drafting.export_docx("8001-24")))
|
||||
# GAP-48: {status,data,message} envelope; failed_gates rides in data.
|
||||
assert out["status"] == "error"
|
||||
assert out["failed_gates"] == ["claims_coverage", "structural_integrity"]
|
||||
assert out["data"]["failed_gates"] == ["claims_coverage", "structural_integrity"]
|
||||
assert "claims_coverage" in out["message"]
|
||||
assert patched_export["exported"] is False, "must not call the exporter"
|
||||
assert patched_export["committed"] is False, "must not git-commit"
|
||||
@@ -145,7 +146,8 @@ def test_export_proceeds_when_clean(
|
||||
monkeypatch.setattr(db, "get_critical_qa_failures", _get_critical)
|
||||
|
||||
out = json.loads(_run(drafting.export_docx("8001-24")))
|
||||
assert out["status"] == "completed", out
|
||||
assert out["path"] == "/tmp/decision.docx"
|
||||
# GAP-48: success is envelope status "ok"; payload (path) rides in data.
|
||||
assert out["status"] == "ok", out
|
||||
assert out["data"]["path"] == "/tmp/decision.docx"
|
||||
assert patched_export["exported"] is True, "clean QA must allow export"
|
||||
assert patched_export["set_draft"] is True, "active_draft_path must be set"
|
||||
|
||||
Reference in New Issue
Block a user