feat(harness): complete protocol repair stop and archive ISS-016
Add repairable INVALID_PROGRESS_PROTOCOL observations, independent PROGRESS_PROTOCOL_VIOLATED saturation, and controlled release paths. Archive the OpenSpec change after syncing main specs and devflow.
This commit is contained in:
@@ -11,6 +11,7 @@ import com.superbiz.agent.harness.guard.evidence.EvidenceGuardResult;
|
||||
import com.superbiz.agent.harness.guard.evidence.EvidenceViolation;
|
||||
import com.superbiz.agent.harness.progress.DiagnosisProgressSnapshotState;
|
||||
import com.superbiz.agent.harness.progress.InformationGain;
|
||||
import com.superbiz.agent.harness.progress.ProgressProtocolViolationType;
|
||||
import com.superbiz.agent.harness.retry.RetryAttempt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -140,10 +141,33 @@ public final class TraceAuditEvents {
|
||||
|
||||
public static DiagnosisTraceAuditEvent toolRequestRejected(
|
||||
RunContext context, String toolCallId, String toolName, String errorCode) {
|
||||
return toolRequestRejected(context, toolCallId, toolName, errorCode,
|
||||
null, false, null);
|
||||
}
|
||||
|
||||
public static DiagnosisTraceAuditEvent toolRequestRejected(
|
||||
RunContext context,
|
||||
String toolCallId,
|
||||
String toolName,
|
||||
String errorCode,
|
||||
ProgressProtocolViolationType violationType,
|
||||
boolean repairPromptDelivered,
|
||||
DiagnosisProgressSnapshotState state) {
|
||||
Map<String, Object> details = new LinkedHashMap<>();
|
||||
details.put("tool_call_id", safeIdentifier(toolCallId));
|
||||
details.put("tool_name", safeIdentifier(toolName));
|
||||
details.put("error_code", safeIdentifier(errorCode));
|
||||
if (violationType != null) {
|
||||
details.put("violation_type", violationType.name());
|
||||
details.put("repair_prompt_delivered", repairPromptDelivered);
|
||||
}
|
||||
if (state != null && state.consecutiveProgressProtocolViolations() > 0) {
|
||||
details.put("consecutive_protocol_violations",
|
||||
state.consecutiveProgressProtocolViolations());
|
||||
}
|
||||
if (state != null && state.stopReason() != null) {
|
||||
details.put("stop_reason", state.stopReason().name());
|
||||
}
|
||||
return event(context, TracePhase.TOOL, TraceEventType.TOOL_REQUEST_REJECTED,
|
||||
TraceEventStatus.REJECTED, null, null, details);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user