0b58286ca2
Separate *http.Server + *http.ServeMux (AD-024), default disabled. Operator opts in via --pprof <addr>. WARN logged on startup. All pprof handlers explicitly registered on dedicated mux (no DefaultServeMux side-effect). I-308 deferred since v0.2 now implemented. 6 new tests. ---ci--- project: orca phase: 4 milestone: v0.7 status: verify requirements: covered: [REQ-056] partial: [] ---/ci---
2.9 KiB
2.9 KiB
Phase 4 Verification Report — v0.7: --pprof Opt-in on orca daemon
Phase: 4
Branch: phase/04-pprof-daemon
REQ Coverage: REQ-056
Milestone: v0.7 (Hardening & Completion)
Structural Verification
Files Created
internal/daemon/pprof.go—StartPprof(addr, log) (*http.Server, error): dedicated mux + server, disabled by default, WARN loginternal/daemon/pprof_test.go— 5 tests (disabled, enabled, shutdown, mux isolation, full server lifecycle)internal/cli/daemon_test.go—TestDaemonPprofFlag(flag registration + default)
Files Modified
internal/daemon/server.go—PprofAddrin Options,pprofServerfield,NewServerstarts pprof,Shutdownstops bothinternal/cli/daemon.go—--pprofflag,PprofAddrin daemon.Options, conditional startup output line
Behavioral Verification
Test Results
go test ./... → all PASS (exit 0)
go test -race ./internal/daemon/... ./internal/cli/... → all PASS
go vet ./... → clean
make build → clean
CLI Verification
./bin/orca daemon --help → shows --pprof string flag (default "")
Live Smoke Test
--pprof 127.0.0.1:16060→ WARN logged,/debug/pprof/returns 200,/debug/pprof/cmdline200,/debug/pprof/heap200/healthzon pprof listener → 404 (mux isolation confirmed, AD-024)- Clean shutdown stops both servers
Security Verification
- pprof on a separate
*http.Server+*http.ServeMux, never on the mTLS daemon listener (AD-024) — verified byTestStartPprof_MuxIsolated(/healthzreturns 404 on pprof mux) - Default disabled — no pprof listener unless
--pprofis explicitly set - WARN log on startup: "unauthenticated, operator-only — do not expose publicly"
- No
import _ "net/http/pprof"side-effect registration onDefaultServeMux— all handlers explicitly registered on the dedicated mux
Quality Verification
- No new dependencies (stdlib
net/http,net/http/pprof,log/slog,timeonly) - No comments added (per project convention)
go.modunchanged- Test style matches existing
server_test.go
Must-Haves Checklist
internal/daemon/pprof.go—StartPprofwith dedicated mux, all pprof handlersinternal/daemon/server.go—PprofAddrin Options,pprofServerfield, lifecycle integrationinternal/cli/daemon.go—--pprofflag, passed to Options, conditional startup outputinternal/daemon/pprof_test.go— 5 tests (disabled, enabled, shutdown, mux isolation, lifecycle)internal/cli/daemon_test.go— flag registration test- AD-024: pprof mux separate from mTLS daemon mux (verified by test)
Verdict
PASS — all 4 verification layers pass. REQ-056 is fully covered. The --pprof opt-in endpoint runs on a separate listener with a dedicated mux, is disabled by default, and logs a WARN when enabled. I-308 (deferred since v0.2) is now implemented.