test(coverage): targeted unit tests for decision_api and saas_client (Issue #30)#31
Merged
levleontiev merged 2 commits intomainfrom Mar 14, 2026
Merged
Conversation
…(Issue #30) Add 29 new scenarios across decision_api and saas_client to raise coverage: decision_api.lua: - Jitter hash fallbacks (crc32_short, hmac_sha256, sha1_bin unavailable) - Provider detection (anthropic, openai_compatible, gemini, mistral, nil) - ip_tor normalization via normalize_boolish (yes/no/1/0) - Bundle descriptor hint suppresses user_agent when needs_user_agent=false - access_handler 503 paths (rule engine missing, no bundle loaded) - LLM rejection JSON body for tpm_exceeded and tpd_exceeded - Retry-after gt_3600 bucket metric - log_handler upstream error queues saas event, skips 429 - debug_session_handler: 404 (no secret), 405 (GET), 403 (wrong secret), 204 (valid) - debug_logout_handler: 404 (no secret), 405 (GET), 204 (POST) saas_client.lua: - flush_events/pull_config guard when not initialized - Edge token CR/LF injection uses empty bearer auth - Event coalescing: same signature increments counter, summary on flush - Subject ID hashing removes raw field, sets subject_id_hash - Non-retriable 401 on event flush counts as error - Bundle load rejection ack as rejected - Half-open circuit failure reopens circuit - Heartbeat JSON string body extract_payload branch - Timer premature=true callback returns without HTTP request Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decision_api.luaandsaas_client.luadecision_api.lua new coverage
needs_user_agent=falsesuppresses user_agentaccess_handler503 paths (no rule engine, no bundle)tpm_exceededandtpd_exceededlog_handlerupstream error event queuing, skips 429debug_session_handler: 404/405/403/204 all branchesdebug_logout_handler: 404/405/204 all branchessaas_client.lua new coverage
flush_events/pull_configguard when not initializedsubject_id_hashpremature=truereturns without HTTP requestTest plan
busted spec/unit/→ 523 successes / 0 failures🤖 Generated with Claude Code