verify

Verifikasi perubahan harness secara end-to-end tanpa docker — jalankan CLI pinned nyata terhadap server stub penangkap header dengan env resolve_auth_env() yang tepat…

npx skills add https://github.com/anthropics/defending-code-reference-harness --skill verify

Verifying harness changes on a docker-less host

The pipeline's real surface is the in-container claude -p process and its outbound API requests. Without docker, drive the same pinned CLI binary directly with the env dict the harness would inject via docker -e.

Recipe

  1. Get the pinned CLI (version from harness/agent_image.py:CLAUDE_CODE_VERSION): npm install --no-save @anthropic-ai/claude-code@<pin> in a temp dir → binary at node_modules/@anthropic-ai/claude-code/bin/claude.exe (the .exe name is the real native-binary entry on Linux too, filled in by the package's postinstall — not a Windows leftover).
  2. Stub API server: a tiny HTTP server that appends each request's headers to a JSONL file and returns a 400 invalid_request_error (non-retryable, so the CLI exits fast; exit=1 is expected).
  3. Build the agent env exactly as the pipeline does: python3 -c "from harness.auth import resolve_auth_env; ..." and dump to an export-lines file with shlex.quote (values contain newlines — NEVER pass via env $(...), word-splitting mangles them; source the file).
  4. Emulate the container env: unset ANTHROPIC_CUSTOM_HEADERS (and any other ambient var not in the resolved dict) before sourcing — a Claude Code session in this repo injects .claude/settings.json env into shells, which containers never see.
  5. Run: ANTHROPIC_BASE_URL=http://127.0.0.1:<port> CLAUDECODE= IS_SANDBOX=1 timeout 30 <cli> -p hi --model claude-sonnet-4-5 --max-turns 1, then read the captured JSONL.

Gotchas

  • Unit tests in tests/test_patch.py / tests/test_patch_grade.py need docker and fail on docker-less hosts — pre-existing, not your change.
  • The docker -e injection leg itself can't be exercised without docker; it's the same mechanism that carries ANTHROPIC_API_KEY in production.
  • For the interactive-skills surface, copy .claude/settings.json into a fresh temp dir and run the host claude from there (with ambient ANTHROPIC_CUSTOM_HEADERS unset so settings.json is the only source).

Lebih banyak skill dari anthropic

access
anthropic
Kelola akses saluran Discord — setujui pasangan, edit daftar izin, atur kebijakan DM/grup. Gunakan saat pengguna meminta untuk memasangkan, menyetujui seseorang, memeriksa siapa yang diizinkan,…
official
session-report
anthropic
Hasilkan laporan HTML yang dapat dijelajahi dari penggunaan sesi Claude Code (token, cache, subagen, skill, prompt mahal) dari transkrip ~/.claude/projects.
official
build-mcp-server
anthropic
Keterampilan ini harus digunakan ketika pengguna meminta untuk "membangun server MCP", "membuat MCP", "membuat integrasi MCP", "membungkus API untuk Claude", "mengekspos alat ke…
official
cookbook-audit
anthropic
Audit buku catatan Anthropic Cookbook berdasarkan rubrik. Gunakan saat diminta peninjauan atau audit buku catatan.
official
handle-complaint
anthropic
Menangani keluhan pelanggan yang masuk secara end-to-end — mengambil konteks, menyusun tanggapan, dan menyarankan perbaikan operasional. Menerima email atau ID tiket opsional…
official
use-case-triage
anthropic
Dengan cepat menentukan apakah suatu aktivitas pemrosesan memerlukan PIA, DPIA wajib GDPR, atau dapat dilanjutkan — menampilkan konflik kebijakan privasi dan mengarahkan ke langkah yang tepat…
official
board-minutes
anthropic
Menyusun notulen rapat dewan atau komite dalam format rumah Anda. Mendeteksi secara otomatis rapat dewan dan komite yang akan datang dari kalender Anda, meminta agenda dan…
official
renewal-tracker
anthropic
Tampilkan kontrak dengan tenggat pembatalan yang akan datang dan peringatkan sebelum jendela pemberitahuan ditutup, berdasarkan daftar perpanjangan yang terpelihara. Gunakan saat pengguna meminta…
official