Skip to content

[quality] cover match engine gaps: ScoreForRepo, PersistRematchResults, LLMFromEnv (pkg/match 70.5%→85.8%) - #147

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-match-engine-gaps
Sep 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-match-engine-gaps

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds pkg/match/engine_gap_test.go covering the previously 0% match-engine functions:

  • ScoreForRepo (0% → 100%): fresh score persisted + notified at NotifyThreshold, cache hit with zero gateway traffic, RepoHash invalidation 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; ErrRepoChanged on stale RepoHash and on a repo missing from the registry (nothing persisted on abort); ErrIdeaChanged on expectedUpdatedAt mismatch.
  • LLMFromEnv / envValue (0% → 100%): nil without base URL, trailing-slash trim, DefaultModel fallback, model/key trimming, legacy IDEATE_ prefix fallback per-var, and DIBS_ precedence.
  • firstNonEmpty (0% → 100%) and nonHiveCNCF (42.9% → 100%, registry filtering + nil registry).

pkg/match: 70.5% → 85.8%. Test-only; reuses the existing fakeGateway/newFixtures helpers. go vet clean, full go 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

…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>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 26, 2026
@hivecommons-hive hivecommons-hive Bot removed the hold label Sep 27, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit cdab79d into main Sep 27, 2026
5 of 6 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-match-engine-gaps branch September 27, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] pkg/match engine persistence & config seams untested: ScoreForRepo, PersistRematchResults, LLMFromEnv at 0%

0 participants