From a065a4c30be748b0c8fc6dd0b5ee1dc4d3de4b1c Mon Sep 17 00:00:00 2001 From: Agando Date: Mon, 9 Nov 2026 15:36:23 +0100 Subject: chore(newos4): commit accumulated maintenance output The daily collector and the feedback pipeline had left 57 modified files uncommitted (skills, modules-index, CHANGELOG, feedback decisions, debug counters). The public mirror publishes git HEAD, so without this the published repo stayed behind the tree - and it blocked the publisher outright once uncommitted subtrees started failing loudly. --- .bkp-fix-20261023_143429/config.php | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .bkp-fix-20261023_143429/config.php (limited to '.bkp-fix-20261023_143429/config.php') diff --git a/.bkp-fix-20261023_143429/config.php b/.bkp-fix-20261023_143429/config.php new file mode 100644 index 0000000..9abc262 --- /dev/null +++ b/.bkp-fix-20261023_143429/config.php @@ -0,0 +1,59 @@ +1024 (2026-10-05): error batches with stacks legitimately exceed 64KB, causing endless 413s +define('CLUSTER_SIMILARITY_THRESHOLD', 0.35); +define('ERRORS_FILE', DEBUG_DATA_DIR . '/errors.json'); +define('SESSIONS_FILE', DEBUG_DATA_DIR . '/sessions.json'); +define('CLUSTERS_FILE', DEBUG_DATA_DIR . '/clusters.json'); + +if (!is_dir(DEBUG_DATA_DIR)) { + mkdir(DEBUG_DATA_DIR, 0755, true); +} + +function load_json($path) { + if (!file_exists($path)) return []; + $data = json_decode(file_get_contents($path), true); + return is_array($data) ? $data : []; +} + +function save_json($path, $data) { + $encoded = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + $fp = fopen($path, 'c'); + if ($fp && flock($fp, LOCK_EX)) { + ftruncate($fp, 0); + fwrite($fp, $encoded); + fflush($fp); + flock($fp, LOCK_UN); + fclose($fp); + } else { + // Fallback: write without lock + file_put_contents($path, $encoded); + } + @chmod($path, 0664); +} + +function json_response($data, $code = 200) { + http_response_code($code); + echo json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + exit; +} + +function error_response($msg, $code = 400) { + json_response(['success' => false, 'error' => $msg], $code); +} -- cgit v1.2.3