[quality] cover match engine gaps: ScoreForRepo, PersistRematchResults, LLMFromEnv (pkg/match 70.5%→85.8%) - #147
Conversation
…s, LLMFromEnv Adds engine_gap_test.go covering previously 0% functions in pkg/match: - ScoreForRepo: fresh score + persist + notify, cache hit (no gateway traffic), RepoHash invalidation replacing in place, append for new repos, weak-score notify suppression, store error propagation - PersistRematchResults: happy path with threshold-gated notifications, ErrRepoChanged on stale hash or vanished repo, ErrIdeaChanged on concurrent idea edit - LLMFromEnv/envValue: disabled without base URL, trailing-slash trim, default model, legacy IDEATE_ prefix fallback, DIBS_ precedence - firstNonEmpty and nonHiveCNCF (registry filtering, nil registry) pkg/match coverage: 70.5% -> 85.8%. Test-only change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <sec-check@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Test Improvement
Adds
pkg/match/engine_gap_test.gocovering the previously 0% match-engine functions:ScoreForRepo(0% → 100%): fresh score persisted + notified atNotifyThreshold, cache hit with zero gateway traffic,RepoHashinvalidation replacing the cached entry in place, append path for a second repo, weak-score notify suppression, and store-error propagation for an unknown idea.PersistRematchResults(0% → 100%): happy path persisting TLDR/matches/CNCF with threshold-gated notifications;ErrRepoChangedon staleRepoHashand on a repo missing from the registry (nothing persisted on abort);ErrIdeaChangedonexpectedUpdatedAtmismatch.LLMFromEnv/envValue(0% → 100%): nil without base URL, trailing-slash trim,DefaultModelfallback, model/key trimming, legacyIDEATE_prefix fallback per-var, andDIBS_precedence.firstNonEmpty(0% → 100%) andnonHiveCNCF(42.9% → 100%, registry filtering + nil registry).pkg/match: 70.5% → 85.8%. Test-only; reuses the existingfakeGateway/newFixtureshelpers.go vetclean, fullgo test ./...green.Disjoint from open PR #145 (which touches only
pkg/intake/intake_gap_test.go).Related Issue
Closes #146
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88