Skip to content

fix(tier3): align Anthropic endpoints and fail closed on judge errors - #56

Merged
chrisknvidia merged 5 commits into
mainfrom
fix/christopherk/issue-55-anthropic-base-url
Aug 21, 2026
Merged

chrisknvidia merged 5 commits into
mainfrom
fix/christopherk/issue-55-anthropic-base-url

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #55

Summary

  • Give Anthropic evaluator and Claude Code routes one API-root contract. Unversioned roots and legacy terminal /v1 roots produce exactly one /v1/messages suffix while preserving path prefixes, ports, IPs, IDNs, internal hostnames, and safe percent escapes.
  • Validate malformed or ambiguous Anthropic roots before Harbor starts, including independently credentialed Claude Code routes used with another evaluator provider. OpenAI-compatible URL behavior is unchanged.
  • Treat required Tier 3 judge transport, authentication, HTTP, timeout, and exhausted parse failures as unscoreable evaluation failures rather than numeric zeroes. default_plus_custom cannot rescue a failed standard judge; custom_only remains independent.
  • Validate authoritative and fallback multi-step rewards before scoring, fail closed when judge-sidecar inspection is incomplete, and weight scores/pass@k/lift/findings once per logical Harbor trial while preserving raw step artifacts and backward-compatible row counts.
  • Suppress score, dimension, pass@k, lift, and finding claims for failed conditions. HTML renders missing evidence as N/A/with-skill unavailable, while preserving a legitimate numeric 0.0.
  • Retain bounded, credential-redacted diagnostics without following symlinks, junctions, hard links, FIFOs, malformed JSON, or escaped paths. Atomic output publication is pinned against concurrent parent-directory replacement on POSIX and Windows.
  • Document the endpoint/failure/artifact contracts and include the bounded idna dependency/license notice used to match Anthropic/httpx hostname behavior.

This PR does not change agent-model defaults or the separate judge-model override behavior covered by #38 and #54.

Verification for 01a5612

  • Full repository suite before the final two-line Windows test-fixture correction (production code unchanged): 4303 passed, 17 skipped, 5 deselected in 3m14s. One explicit deselection is the occupied fixed-port bridge test described below; four are repository defaults. The exact final fixture file then passed 93 passed, 4 skipped locally.
  • Final affected collector/report/judge/output suite: 872 passed, 5 skipped; broader issue-specific suite before the final report-only guard: 1197 passed, 5 skipped, 1 deselected.
  • Independent final code review: no remaining Critical or Important findings; reviewer sweep 348 passed, 5 Windows-only skipped.
  • Real installed Claude Code loopback on this head: 1 passed; the CLI used the canonical prefixed /v1/messages route with no doubled /v1/v1.
  • Real Anthropic SDK plus bundled urllib verifier endpoint parity: 8 passed, covering ASCII/Unicode paths, IDNA, percent escapes, and scoped IPv6.
  • Static/package/docs: Ruff lint passed; all 12 changed Python files are formatted; git diff --check, uv lock --check, Fern (0 errors, one unauthenticated redirect warning), and 187 CI/OSS/package tests passed; wheel and sdist built successfully.
  • Secret scanning: changed-file scan and exact one-commit range scan found no leaks. The commit contains a DCO signoff and PR history contains exactly one commit.
  • Fresh hosted CI: every check passed, including Python 3.12/3.13, CodeQL, DCO, Gitleaks, dependency/package/RHEL checks, macOS, the native Windows fail-closed gate, and the 980-test Windows Tier 2 matrix.

End-to-end evidence and limits

  • An earlier real Harbor 0.13.2 + Docker 29.2.1 run on the PR branch used the real Claude Code CLI and a recording Anthropic-compatible gateway. It covered default with two cases/both arms, forced-401 default_plus_custom, and custom_only; every request used exactly /<prefix>/v1/messages, the 401 condition was failed/unscoreable, and custom-only issued zero standard-judge requests.
  • That full Docker matrix could not be repeated on 01a5612: Docker Desktop is running locally, but its server API times out. The final-head real Claude loopback and SDK/verifier parity checks above did run; all collector/report/filesystem changes are covered by the full local suite.
  • Native Windows parent-pinning and junction regressions cannot run on this macOS host; fresh hosted Windows CI on 01a5612 passed both the dedicated fail-closed gate and the broader 980-test Tier 2 matrix.
  • No paid Anthropic, Bedrock, NV Build, or cloud Harbor backend was called.
  • A pre-existing native-Harbor behavior permits task-authored verifier provider variables to override operator routing. This PR fixes the generated/default path reported in [BUG]: Custom ANTHROPIC_BASE_URL cannot satisfy both the judge and the agent #55; native provider isolation remains separate work relevant to fix(tier3): propagate judge model overrides to Harbor verifiers #54.
  • tests/test_nvidia_build_bridge.py::test_dynamic_bridge_ignores_prebound_old_port_and_checker_authenticates_health cannot bind 127.0.0.1:18080 because an unrelated existing process owns it. The process was not terminated.

@chrisknvidia chrisknvidia added the bug Something isn't working label Aug 20, 2026
@chrisknvidia
chrisknvidia force-pushed the fix/christopherk/issue-55-anthropic-base-url branch 3 times, most recently from ca8c056 to 2b833e9 Compare August 20, 2026 07:04
@chrisknvidia
chrisknvidia marked this pull request as ready for review August 20, 2026 07:10
@chrisknvidia
chrisknvidia force-pushed the fix/christopherk/issue-55-anthropic-base-url branch from 2b833e9 to f3093f9 Compare August 20, 2026 10:32
Normalize Anthropic evaluator and Claude Code API roots so legacy terminal /v1 inputs and unversioned roots produce exactly one /v1/messages endpoint.

Treat required Tier 3 judge transport, authentication, timeout, and exhausted parsing failures as unscoreable; suppress derived quality output for failed conditions while preserving bounded redacted diagnostics and safe result-directory reuse.

Add URL, judge, collector, report, packaging, documentation, and end-to-end regression coverage.

Fixes #55

Signed-off-by: Christopher Kevin <[email protected]>
@chrisknvidia
chrisknvidia force-pushed the fix/christopherk/issue-55-anthropic-base-url branch from f3093f9 to 01a5612 Compare August 20, 2026 10:39

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focused judge/collector/report/security suites were clean apart from an unsupported host-interpreter mismatch; one root-artifact publication vulnerability reproduces on the supported Python runtime.

@rng1995
rng1995 enabled auto-merge August 20, 2026 21:04
@chrisknvidia
chrisknvidia disabled auto-merge August 20, 2026 23:16
@chrisknvidia
chrisknvidia force-pushed the fix/christopherk/issue-55-anthropic-base-url branch from 33c89d2 to 84e0583 Compare August 21, 2026 00:02
@chrisknvidia
chrisknvidia merged commit 799f9d6 into main Aug 21, 2026
15 checks passed
@chrisknvidia
chrisknvidia deleted the fix/christopherk/issue-55-anthropic-base-url branch August 21, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Custom ANTHROPIC_BASE_URL cannot satisfy both the judge and the agent

2 participants