Commit graph

7 commits

Author SHA1 Message Date
jedarden
26ab25bc93 notes(bf-4k9): verify plan.md already up-to-date for dashboard 1.1.0
All required changes were already present in docs/plan/plan.md from
commit cadc7da. This note documents verification of acceptance criteria:
- Header versions match proxy/VERSION and dashboard/VERSION
- Tokens panel row includes cache-read/cache-write series
- Collector fields table includes cache token rates
- Docs inventory lists all four new documents
2026-07-02 13:53:45 -04:00
jedarden
906da31dec notes(bf-32n): document that bounds enforcement tests already exist
All acceptance criteria verified - TestAdaptiveRateLimiter_BasicBounds
already exists and passes with injected window duration.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 13:19:04 -04:00
jedarden
2cdef80126 test(bf-3zp): add mock upstream server test infrastructure
Add comprehensive test infrastructure for retry/response-validation tests
in proxy package. Provides httptest-based mock upstream server, test
helpers for request/response handling, and test-mode configuration for
fast test execution.

New file: proxy/helpers_test.go
- MockUpstream: Configurable HTTP server simulating Z.AI upstream
- Test scenarios: 429 with/without Retry-After, empty/invalid JSON body,
  empty streaming, 422/500/404 responses, network errors, success
- Request builders: CreateProxyRequest, CreateMessagesRequest,
  CreateStreaming/NonStreaming* helpers
- Response assertions: AssertStatusCode, AssertJSONBody, AssertResponseField,
  AssertEmptyBody, AssertHeader, AssertContentType
- Proxy handler factory: CreateTestProxyHandler for configured test handlers
- Test execution helpers: ExecuteProxyRequest, ExecuteMessagesRequest
- Test-mode config: ConfigureTestEnv, GetTestMaxRetries (defaults to 1 for fast tests)
- Backoff delay helpers: CalculateBackoffDelay, CalculateTotalMaxDelay

Acceptance criteria met:
 New test helpers with httptest servers
 Helper functions for requests and assertions
 Test-mode env var for fast tests (MAX_RETRIES=1 default)
 go test ./proxy/ -run TestHelper passes

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 12:45:10 -04:00
jedarden
49471e87a7 docs(bf-47d): document that TestAdaptiveRateLimiter_BasicState already exists
- TestAdaptiveRateLimiter_BasicState already exists in proxy/ratelimiter_test.go
- All acceptance criteria already met and verified passing
- No code changes required

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 12:30:34 -04:00
jedarden
ee39121cd9 test(ratelimiter): make AdaptiveRateLimiter testable via window duration injection
Add NewAdaptiveRateLimiterWithWindow constructor for test-only refactor:
- Production code uses NewAdaptiveRateLimiter with default 30s window
- Tests can inject shorter durations (e.g., 100ms) for fast execution
- No behavior changes to production rate limiting logic

Acceptance criteria:
- NewAdaptiveRateLimiterWithWindow accepts configurable window duration
- Production callers continue using default 30s window
- Tests can inject millisecond-scale windows for fast iteration
- No changes to rate limiting logic or defaults

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 10:55:06 -04:00
jedarden
769c33ea3a docs(notes): document bead bf-4co completion - README fixes already done in a106abd 2026-07-02 07:59:17 -04:00
jedarden
36727ac66d docs(plan): mark migration checklist complete
All migration items completed:
- Workflow templates pushed to declarative-config (May 17)
- Documentation updated to point to new repo (ardenone-cluster commit 79b9a9cf8)
- Old container directories retired (ardenone-cluster commit 4b4468842)

The zai-proxy project now lives at git.ardenone.com/jedarden/zai-proxy
with CI/CD workflow templates deployed via ArgoCD.

Note: Commit pending push due to Forgejo network connectivity issue.
Bead-Id: bf-4a2
2026-06-21 10:38:46 -04:00