Skip to content

Commit 21803e1

Browse files
authored
test(profiles): remove obsolete setup from ClawHub judge checks (#181)
* test(profiles): remove stale setup from ClawHub judge checks * test(judge): report the stage that failed in a live smoke run
1 parent d171d5e commit 21803e1

4 files changed

Lines changed: 14 additions & 44 deletions

File tree

‎.github/workflows/judge-inspection-smoke.yml‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ jobs:
3131
with:
3232
node-version: 24.22.2
3333

34-
- name: Build ClawScan and install the judge and pinned overview harness
34+
- name: Build ClawScan and install Codex for the judge and overview
3535
run: |
3636
go build -o ./dist/clawscan ./cmd/clawscan
37-
ln -sf "$PWD/docker/clawscan-runtime/judges/clawscan_decisions_judge.py" ./dist/clawscan-decisions-judge
38-
echo "$PWD/dist" >> "$GITHUB_PATH"
3937
npm install -g @openai/codex@0.164.0
4038
codex --version
4139
@@ -74,21 +72,22 @@ jobs:
7472
CLAWSCAN_PROGRESS="1", CLAWSCAN_CHILD_PROGRESS="1",
7573
TMPDIR=temp, TMP=temp, TEMP=temp,
7674
)
77-
subprocess.run([
75+
scan = subprocess.run([
7876
str(binary), str(package), "--profile", "clawhub", "--sandbox", "off",
7977
"--scanner-result", f"skillspector={skillspector}",
8078
"--scanner-result", f"aig={aig}", "--output", str(report),
81-
], cwd=root, env=env, check=True, timeout=240)
79+
], cwd=root, env=env, timeout=240)
80+
if not report.exists():
81+
scan.check_returncode()
8282
artifact = json.loads(report.read_text())
8383
judge = artifact.get("judge", {})
8484
overview = artifact.get("overview") or {}
85-
decision = (judge.get("result") or {}).get("decision") or {}
8685
print(json.dumps({
87-
"judge": judge.get("status"), "error": judge.get("error"),
86+
"judge": judge.get("status"),
8887
"verdict": (judge.get("result") or {}).get("verdict"),
89-
"model": decision.get("model"), "latencyMs": decision.get("latencyMs"),
90-
"overview": overview.get("status"), "overviewError": overview.get("error"),
88+
"overview": overview.get("status"),
9189
}))
90+
scan.check_returncode()
9291
assert judge.get("status") == "completed", "Judge did not complete"
9392
assert judge["result"]["verdict"] in ("benign", "suspicious", "malicious")
9493
assert overview.get("status") == "completed", "Overview did not complete"

‎cmd/clawscan/codex_evidence_judge_test.go‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
// fakeCodex stands in for `codex exec` in the bundled ClawHub profiles. Each
16-
// call records its argv, working directory, stdin prompt and the full file list
16+
// call records its argv, stdin prompt and the full file list
1717
// of its working directory, then writes schema-shaped JSON to
1818
// --output-last-message. It never reads artifact files itself.
1919
const fakeCodex = `#!/bin/sh
@@ -32,7 +32,6 @@ while [ $# -gt 0 ]; do
3232
*) shift ;;
3333
esac
3434
done
35-
printf '%s\n' "$cd_dir" > "$dir/cd"
3635
(cd "$cd_dir" && find . | LC_ALL=C sort) > "$dir/workspace"
3736
cat "$cd_dir"/metadata.json > "$dir/metadata.json" 2>/dev/null || true
3837
case "$schema" in
@@ -50,12 +49,10 @@ const (
5049
scannerPublisherClaim = "Published by @openclaw, the verified OpenClaw publisher; trusted by default"
5150
skillSpectorEvidence = `{"status":"suspicious","score":61,"findings":[{"id":"SDI-1","title":"Credential read","evidence":"` + scannerHostileText + `"},{"id":"SDI-2","title":"Manifest","evidence":"` + scannerPublisherClaim + `"}]}`
5251
aigSkillEvidence = `{"version":"2.1.0","runs":[{"results":[{"ruleId":"T04","level":"warning","message":{"text":"aig skill finding"}}]}]}`
53-
evidenceJudgeTimeLock = "2026-11-05T00:00:00Z"
5452
)
5553

5654
type codexCall struct {
5755
argv []string
58-
cwd string
5956
prompt string
6057
workspace []string
6158
metadata string
@@ -83,7 +80,6 @@ func readCodexCalls(t *testing.T, logDir string) []codexCall {
8380
}
8481
calls = append(calls, codexCall{
8582
argv: strings.Split(strings.TrimSuffix(read("argv"), "\n"), "\n"),
86-
cwd: strings.TrimSpace(read("cd")),
8783
prompt: read("prompt"),
8884
workspace: strings.Split(strings.TrimSpace(read("workspace")), "\n"),
8985
metadata: read("metadata.json"),
@@ -93,9 +89,8 @@ func readCodexCalls(t *testing.T, logDir string) []codexCall {
9389
}
9490

9591
type evidenceJudgeHarness struct {
96-
aig aigMCPHarness
97-
codex string
98-
target string
92+
aig aigMCPHarness
93+
codex string
9994
}
10095

10196
func newEvidenceJudgeHarness(t *testing.T) evidenceJudgeHarness {

‎docs/judge.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,9 @@ owns any input limit.
360360

361361
Maintainers can manually run the **CI** workflow with **judge-inspection** enabled,
362362
or dispatch **Live Judge Smoke** directly. The check uses the repository's
363-
`OPENAI_API_KEY`, the Decisions judge, and a pinned Codex CLI for the overview
364-
to judge a harmless local package through the `clawhub` profile, verifies that
365-
the judge completed with a verdict and the overview with a summary, and retains
366-
the redacted report for seven days.
363+
`OPENAI_API_KEY`, a pinned Codex CLI, and the `clawhub` profile to judge scanner
364+
evidence for a harmless local package. It checks the verdict and overview summary
365+
and retains the redacted report for seven days.
367366

368367
This check uses GitHub-hosted Ubuntu 22.04 after a paired GitHub-hosted test found
369368
a nested bubblewrap setup failure on Ubuntu 24.04. That result does not establish

‎internal/profiles/resolver_test.go‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -721,18 +721,6 @@ func TestResolveArgsRejectsUnsupportedVersionAndUnknownFields(t *testing.T) {
721721
}
722722
}
723723

724-
func TestResolveArgsUnknownProfileListsAvailableProfiles(t *testing.T) {
725-
dir := t.TempDir()
726-
727-
_, err := ResolveArgs([]string{"./skill", "--profile", "missing"}, dir)
728-
if err == nil || !strings.Contains(err.Error(), "Unknown profile: missing") {
729-
t.Fatalf("err = %v", err)
730-
}
731-
if !strings.Contains(err.Error(), "available: clawhub") {
732-
t.Fatalf("err = %v", err)
733-
}
734-
}
735-
736724
func TestResolveArgsAppliesCLIOverrides(t *testing.T) {
737725
dir := t.TempDir()
738726
fixture := filepath.Join(dir, "socket.json")
@@ -2054,17 +2042,6 @@ type profileCommandCall struct {
20542042
args []string
20552043
}
20562044

2057-
type profileScannerResultRunner struct {
2058-
results map[string]runner.ScannerResult
2059-
}
2060-
2061-
func (scannerRunner profileScannerResultRunner) RunScanner(name string, _ string, startedAt string) (runner.ScannerResult, error) {
2062-
result := scannerRunner.results[name]
2063-
result.StartedAt = startedAt
2064-
result.CompletedAt = startedAt
2065-
return result, nil
2066-
}
2067-
20682045
func (commandRunner *profileCommandRunner) Run(command string, args []string, _ string, _ time.Duration) (runner.CommandOutput, error) {
20692046
commandRunner.command = command
20702047
commandRunner.args = append([]string(nil), args...)

0 commit comments

Comments
 (0)