Spaces:
Sleeping
Sleeping
Deploy repair agent from GitHub Actions
Browse files
app.py
CHANGED
|
@@ -1764,7 +1764,12 @@ def validate_plan(plan, request, findings):
|
|
| 1764 |
if PRIORITY_ORDER[plan.overall_priority] < PRIORITY_ORDER[highest_contract_priority]:
|
| 1765 |
plan.overall_priority = highest_contract_priority
|
| 1766 |
|
| 1767 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1768 |
plan.current_knowledge_reason = ""
|
| 1769 |
|
| 1770 |
return plan
|
|
@@ -1848,6 +1853,12 @@ def merge_model_plan(plan, request, findings, overflow_findings=None):
|
|
| 1848 |
"Overflow repair contracts use conservative deterministic planning because the AI reasoning window is intentionally bounded for CPU reliability."
|
| 1849 |
)
|
| 1850 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1851 |
return {
|
| 1852 |
"agent_id": AGENT_ID,
|
| 1853 |
"display_name": DISPLAY_NAME,
|
|
@@ -1862,8 +1873,7 @@ def merge_model_plan(plan, request, findings, overflow_findings=None):
|
|
| 1862 |
"auto_apply": False,
|
| 1863 |
"summary": clean_text(
|
| 1864 |
f"Prepared {len(contracts)} prioritized evidence-linked repair contract"
|
| 1865 |
-
f"{'s' if len(contracts) != 1 else ''}; start with "
|
| 1866 |
-
f"{contracts[0]['repair_strategy'] if contracts else 'the highest-priority validated repair target'}.",
|
| 1867 |
360,
|
| 1868 |
),
|
| 1869 |
"stitch_repair_contracts": contracts,
|
|
|
|
| 1764 |
if PRIORITY_ORDER[plan.overall_priority] < PRIORITY_ORDER[highest_contract_priority]:
|
| 1765 |
plan.overall_priority = highest_contract_priority
|
| 1766 |
|
| 1767 |
+
grounded_current_knowledge = any(
|
| 1768 |
+
finding_may_need_current_knowledge(finding)
|
| 1769 |
+
for finding in findings
|
| 1770 |
+
)
|
| 1771 |
+
plan.current_knowledge_required = grounded_current_knowledge
|
| 1772 |
+
if not grounded_current_knowledge:
|
| 1773 |
plan.current_knowledge_reason = ""
|
| 1774 |
|
| 1775 |
return plan
|
|
|
|
| 1853 |
"Overflow repair contracts use conservative deterministic planning because the AI reasoning window is intentionally bounded for CPU reliability."
|
| 1854 |
)
|
| 1855 |
|
| 1856 |
+
summary_strategy = (
|
| 1857 |
+
clean_text(contracts[0]["repair_strategy"], 300).rstrip(" .")
|
| 1858 |
+
if contracts
|
| 1859 |
+
else "the highest-priority validated repair target"
|
| 1860 |
+
)
|
| 1861 |
+
|
| 1862 |
return {
|
| 1863 |
"agent_id": AGENT_ID,
|
| 1864 |
"display_name": DISPLAY_NAME,
|
|
|
|
| 1873 |
"auto_apply": False,
|
| 1874 |
"summary": clean_text(
|
| 1875 |
f"Prepared {len(contracts)} prioritized evidence-linked repair contract"
|
| 1876 |
+
f"{'s' if len(contracts) != 1 else ''}; start with {summary_strategy}.",
|
|
|
|
| 1877 |
360,
|
| 1878 |
),
|
| 1879 |
"stitch_repair_contracts": contracts,
|