MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / check_node

Function check_node

workflow/nodes.py:153–185  ·  view source on GitHub ↗
(
    state: WorkflowState,
    *,
    context: WorkflowContext,
    sender_name: str = "Check",
)

Source from the content-addressed store, hash-verified

151
152
153def check_node(
154 state: WorkflowState,
155 *,
156 context: WorkflowContext,
157 sender_name: str = "Check",
158) -> dict[str, Any]:
159 decision, check_count = classify_check_result(
160 target=context.target or context.problem,
161 history=context.history if context.history else state["message"],
162 check_count=state["check_count"],
163 benchmark_name=context.benchmark_name,
164 remaining_vulns=len(state["vulns"]),
165 )
166
167 if decision == "success":
168 check_message = (
169 f"Successfully exploited the vulnerability, a total of {check_count} steps were attempted"
170 )
171 elif decision == "retry":
172 check_message = f"Failed to exploit the vulnerability, please try again. {context.problem}"
173 elif decision == "another":
174 check_message = "Failed to exploit the vulnerability, please try another vulnerability."
175 else:
176 check_message = "Failed to exploit the vulnerability."
177
178 context.history.append(f"{sender_name}{check_count}_{check_message}")
179
180 return {
181 "message": [_human_message(check_message)],
182 "sender": sender_name,
183 "vulns": state["vulns"],
184 "check_count": check_count,
185 }
186
187
188@dataclass(slots=True)

Callers

nothing calls this directly

Calls 2

classify_check_resultFunction · 0.85
_human_messageFunction · 0.85

Tested by

no test coverage detected