Automate XL-Vask invoice-period resolution (#340)

Deploy the revision-aware XL-Vask import and guarded autopilot infrastructure. Automatic actions remain fail-closed pending production readiness, calibration, dry-run, and canary gates.
This commit is contained in:
Jeppe B
2026-08-03 15:33:55 +02:00
committed by GitHub
parent 0b304a2203
commit 6d888a455d
17 changed files with 3637 additions and 223 deletions
@@ -28,10 +28,12 @@ class xlvask_request implements xlvask_request_i
};
// Set the headers
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// Set options to return the response and handle SSL
// Verify the upstream certificate and keep requests bounded.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// Execute the request
$response = curl_exec($ch);
// Check for errors
@@ -45,9 +47,12 @@ class xlvask_request implements xlvask_request_i
// Check if the response is successful
if ($httpCode < 200 || $httpCode >= 300) {
$slack = new slack();
$urlParts = parse_url($url);
$safeEndpoint = (string)($urlParts['host'] ?? 'unknown-host') . (string)($urlParts['path'] ?? '');
$slack->send_message(
'XLVask API Request Failed',
"URL: $url\nMethod: $method\nData: " . json_encode($data) . "\nHeaders: " . implode(', ', $headers) . "\nHTTP Code: $httpCode\nResponse: $response"
"Endpoint: {$safeEndpoint}\nMethod: {$method}\nHTTP Code: {$httpCode}\n"
. 'Request fields: ' . count($data) . "\nResponse bytes: " . strlen((string)$response)
);
throw new \Exception('Request failed with status code ' . $httpCode);
}
@@ -71,4 +76,4 @@ class xlvask_request implements xlvask_request_i
{
return 'Authorization: Basic ' . base64_encode($username . ':' . $password);
}
}
}