diff --git a/src/control_ops.c b/src/control_ops.c index 2f092ab..ac3b136 100644 --- a/src/control_ops.c +++ b/src/control_ops.c @@ -83,19 +83,33 @@ static char *ops_rules_list(size_t *len) cu += (size_t)w; } - char model[256], path[256], tgt[1024]; + char judges[512]; + size_t ju = 0; + judges[0] = '\0'; + for (int j = 0; j < r->judge_count && ju < sizeof judges - 1; j++) { + int w = snprintf(judges + ju, sizeof judges - ju, "%s%d:%s%s%s", + j ? "," : "", r->judges[j].every, r->judges[j].target, + r->judges[j].as[0] ? " as " : "", r->judges[j].as); + if (w < 0) + break; + ju += (size_t)w; + } + + char model[256], path[256], tgt[1024], jgt[1024]; esc(r->model_glob, model, sizeof model); esc(r->path_glob, path, sizeof path); esc(chain, tgt, sizeof tgt); + esc(judges, jgt, sizeof jgt); - char one[2048]; + char one[4096]; int n = snprintf(one, sizeof one, "%s{\"index\":%d,\"line\":%d,\"model\":\"%s\",\"path\":\"%s\"," "\"block\":%s,\"need_min\":%ld,\"need_max\":%ld," - "\"ctx_min\":%ld,\"ctx_max\":%ld,\"vision\":%d,\"targets\":\"%s\"}", + "\"ctx_min\":%ld,\"ctx_max\":%ld,\"vision\":%d,\"targets\":\"%s\"," + "\"judge\":\"%s\"}", i ? "," : "", i, r->line, model, path, r->block ? "true" : "false", r->need_min, r->need_max, - r->ctx_min, r->ctx_max, r->vision, tgt); + r->ctx_min, r->ctx_max, r->vision, tgt, jgt); j_buf_append(&b, one, (size_t)n); } j_rules_write_unlock(); diff --git a/src/junction.c b/src/junction.c index 10e62b2..90970d9 100644 --- a/src/junction.c +++ b/src/junction.c @@ -827,7 +827,7 @@ static char *build_metrics(size_t *len_out); * Dashboard und HTTP dieselben Zahlen sehen — zwei Quellen wären zwei Wahrheiten. */ static char *build_status(size_t *len_out) { - size_t cap = 8192 + (size_t)CFG.endpoint_count * 1400 + (size_t)CFG.rule_count * 220 + + size_t cap = 8192 + (size_t)CFG.endpoint_count * 1400 + (size_t)CFG.rule_count * 800 + (size_t)CFG.vkey_count * 420; char *out = calloc(1, cap); if (!out) { *len_out = 0; return NULL; } @@ -917,13 +917,22 @@ static char *build_status(size_t *len_out) if (wrote < 0) break; cu += (size_t)wrote; } + char judges[512] = ""; + size_t ju = 0; + for (int j = 0; j < r->judge_count && ju < sizeof judges - 1; j++) { + int wrote = snprintf(judges + ju, sizeof judges - ju, "%s%d:%s%s%s", + j ? "," : "", r->judges[j].every, r->judges[j].target, + r->judges[j].as[0] ? " as " : "", r->judges[j].as); + if (wrote < 0) break; + ju += (size_t)wrote; + } used += (size_t)snprintf(out + used, cap - used, "%s{\"line\":%d,\"model\":\"%s\",\"path\":\"%s\",\"block\":%s,\"need_min\":%ld," "\"need_max\":%ld,\"ctx_min\":%ld,\"ctx_max\":%ld,\"vision\":%d," - "\"targets\":\"%s\"}", + "\"targets\":\"%s\",\"judge\":\"%s\"}", i ? "," : "", r->line, r->model_glob, r->path_glob, r->block ? "true" : "false", r->need_min, r->need_max, - r->ctx_min, r->ctx_max, r->vision, chain); + r->ctx_min, r->ctx_max, r->vision, chain, judges); } used += (size_t)snprintf(out + used, cap - used, "],"); /* MCP: welche Server angebunden sind, wie viele Werkzeuge sie liefern und diff --git a/tests/judge.sh b/tests/judge.sh index eeee6d6..b364023 100644 --- a/tests/judge.sh +++ b/tests/judge.sh @@ -216,6 +216,9 @@ contains "$(grep 'step=1 every=5 target=judge2' "$TMP/judge_chain.log" | head -1 CHAIN_A_CALLS=$(grep -c 'target=judgea' "$TMP/judge_chain.log") [ "$CHAIN_A_CALLS" = "2" ] && ok "the chain reset after its last step and started again" \ || bad "the chain did not reset: $CHAIN_A_CALLS deepseek judge calls" +ST=$(curl -s -m 10 "http://127.0.0.1:$JP4/status") +contains "$ST" '"judge":"3:judgea,5:judge2 as judge-b-model"' \ + "the status names the judge chain" # Konfigurationsfehler müssen laut sein. printf 'endpoint e {\n base http://127.0.0.1:9995/v1\n}\nreq for "vm" judge every 2 missing as "m" pass e\n' \