Fix #289: internal/server coverage gate #291
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!291
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-289"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #289 — raises the coverage gate back to green with real behavioral tests (no coverage theater: every test pins a status, wire shape, or error contract).
Results (measured with a full
make webdist, as CI builds)internal/server: 95.6% → 98.5% (floor 95%)internal/store: 94.97% → 95.1% (was the actual local gate failure — #234 addedStatsKey/OwnerProfileKeyuncovered; one statement short)make cover: fully green, all packages;go vetclean;go test -racegreen on both packages (async adoption test also ×5).Tests (issue value order)
wgt_401, unknown-kid/dead-issuer → unavailable, RSA/ECDSA type-mismatch + bad-signature rejections, malformed-claims after a valid sig, JWKS fetch negatives (bad/refused/truncated jwks_uri, torn discovery), exchangeCode negatives (bad/refused/500/junk → "").Authenticateunknown-mode → anonymous;wgtPrincipalround-trip + reject;PrincipalForNameOIDC admission;VerifyTokenwire table (malformed/tampered/expired/no-secret).PublishSettingsrevision report (invalid TOML rejected, rev 1→2) + unknown-repo publish/sync → not-found; placeholder adoption (zero ops hintless, consume-once, marker key layout, failures swallowed async).Two real bugs found by the tests (fixed in this change, per AGENTS.md law 12 — doc updated via this description)
equalFoldLastpanicked onlen(s) < len(suf)(only reachable today via direct call;hasSuffixFoldguards it). Added the length guard.serveStaticmapped a store outage (nilmeta + non-NotFound error) to 404; error kind is now checked first (miss → 404, outage → 503). This also makes the previously dead 503 branch reachable.Deliberately NOT covered (defensive-dead, for a separate deletion pass per the issue — not excluded from the gate)
verifyStateTicketpayload re-checks (subsumed byverifyState),MintToken/MintSessionerror returns (mintcannot fail), template-error returns (const templates), dist-miss branches (embed always has dist in CI),matchAnyGlobsubsumed case, nil-manifest/nil-settings returns,streamRangenon-Object,newRequestIDrand failure,refreshfollower + stale branches,remaining<0clamp, spool-rewind/client-error paths. Package totals clear the floor with margin regardless.No production behavior change besides the two fixes above. No new dependencies. No doc edits needed (no interface/behavior contracts changed beyond the outage-status fix, recorded here).