feat(guard): a judge record keeps the request, response, path, status and latency of every model call

This commit is contained in:
sam committed 2026-11-16 12:06:05 +11:00
1 parent e909aee155
commit 124d2033fc
7 files changed
+120 -4

No files matched your search

+11 -1
View File
@@ -34,6 +34,7 @@ const approvalRows = computed(() => {
});
const json = (v: unknown) => JSON.stringify(v, null, 2);
const body = (v: unknown) => (typeof v === "string" ? v : json(v));
const ceilingTone = (v: Verdict): Tone => (v.failed ? "warn" : "secondary");
</script>
@@ -76,9 +77,18 @@ const ceilingTone = (v: Verdict): Tone => (v.failed ? "warn" : "secondary");
<span v-if="j.eval_date" class="text-caption text-muted-foreground">Eval {{ j.eval_date }}</span>
<span v-if="j.basis_digest" class="text-caption text-muted-foreground">Basis {{ j.basis_digest.slice(0, 12) }}</span>
<span v-if="j.result_id" class="text-caption text-muted-foreground">Result {{ j.result_id }}</span>
<details v-if="j.basis || j.answers" class="text-caption text-muted-foreground">
<details v-if="j.basis || j.answers || j.request || j.response" class="text-caption text-muted-foreground">
<summary>Judge record</summary>
<span v-if="j.endpoint_path" class="block">
{{ j.endpoint_path }}<template v-if="j.http_status"> · HTTP {{ j.http_status }}</template><template v-if="j.latency_ms !== undefined"> · {{ j.latency_ms }} ms</template>
</span>
<span v-if="j.basis" class="block">Basis</span>
<pre v-if="j.basis" class="whitespace-pre-wrap">{{ j.basis }}</pre>
<span v-if="j.request" class="block">Request body</span>
<pre v-if="j.request" class="whitespace-pre-wrap">{{ body(j.request) }}</pre>
<span v-if="j.response" class="block">Response body</span>
<pre v-if="j.response" class="whitespace-pre-wrap">{{ body(j.response) }}</pre>
<span v-if="j.answers" class="block">Answers</span>
<pre v-if="j.answers" class="whitespace-pre-wrap">{{ json(j.answers) }}</pre>
</details>
</div>
+5
View File
@@ -91,6 +91,11 @@ export interface JudgeRecord {
trusted?: boolean;
advisory_reason?: string;
eval_date?: string;
request?: unknown;
response?: unknown;
endpoint_path?: string;
http_status?: number;
latency_ms?: number;
}
export interface Verdict {