LearnNewsExamplesServices
Frontmatter
id10086
title[enhancement] Promote GUIDE_GAP_WEIGHT_THRESHOLD to aiConfig.data for human tuning
stateClosed
labels
enhancementai
assigneestobiu
createdAtApr 19, 2026, 12:31 PM
updatedAtApr 19, 2026, 6:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/10086
authortobiu
commentsCount0
parentIssue10030
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 19, 2026, 5:33 PM

[enhancement] Promote GUIDE_GAP_WEIGHT_THRESHOLD to aiConfig.data for human tuning

Closedenhancementai
tobiu
tobiu commented on Apr 19, 2026, 12:31 PM

Context

PR #10084 (resolves #10035) introduced GUIDE_GAP_WEIGHT_THRESHOLD = 0.8 as a named constant inside ai/daemons/services/GapInferenceEngine.mjs with documented derivation from the ConceptService weight formula. Deferred config-lifting to this follow-up ticket to keep the refactor's scope focused on the architectural change (regex + LLM → graph traversal).

The threshold governs when a concept lacking an EXPLAINED_BY edge emits a [GUIDE_GAP]. Default value 0.8 means "at least tier-1 baseline priority" — every tier-1 concept without a guide qualifies; tier-2/3 concepts qualify only if uniqueness + coverage-deficit bump them above. The derivation is stable, but future ontology growth (post-#10050/#10036/#10037) may reveal the default needs tuning without triggering a code change.

The Fix

  1. Promote the constant to aiConfig.data.guideGapWeightThreshold in ai/mcp/server/memory-core/config.template.mjs
  2. Preserve the default value (0.8)
  3. Preserve the derivation comment — move it from the constant's JSDoc to the config-template comment so curators see the rationale when tuning
  4. Import + consume the config value in GapInferenceEngine.inferConceptGraphGaps
  5. Run node ./buildScripts/ai/initServerConfigs.mjs will pick up the new config key on install — verify no regeneration needed on existing installs (should be fine since it's additive)

Acceptance Criteria

  • aiConfig.data.guideGapWeightThreshold exists in config.template.mjs with default 0.8 + derivation comment
  • GapInferenceEngine reads the value from config, not from a file-local constant
  • Existing PR #10084 tests still pass (regression guard)
  • New test: threshold override via config produces different gap-emission behavior

Origin Session ID

62d6f155-e57f-4279-9b59-36c9e4ecbc5e — flagged as out-of-scope in PR #10084 body

Related

  • Parent epic: #10030
  • Origin PR: #10084
  • Weight formula: ConceptService.calculateWeighttier_score (0.8/0.5/0.3) + uniqueness (0.2) + coverage_deficit (0.3)
tobiu added the enhancement label on Apr 19, 2026, 12:31 PM
tobiu added the ai label on Apr 19, 2026, 12:31 PM
tobiu added parent issue #10030 on Apr 19, 2026, 12:32 PM
tobiu cross-referenced by #10030 on Apr 19, 2026, 12:33 PM
tobiu cross-referenced by PR #10100 on Apr 19, 2026, 4:17 PM
tobiu cross-referenced by PR #10101 on Apr 19, 2026, 4:59 PM
tobiu assigned to @tobiu on Apr 19, 2026, 5:15 PM
tobiu referenced in commit db5bdae - "feat(ai): config-lift guideGapWeightThreshold to aiConfig.data (#10086) on Apr 19, 2026, 5:19 PM
tobiu cross-referenced by PR #10102 on Apr 19, 2026, 5:20 PM
tobiu cross-referenced by #10103 on Apr 19, 2026, 5:31 PM
tobiu closed this issue on Apr 19, 2026, 5:33 PM
tobiu cross-referenced by #10104 on Apr 19, 2026, 5:39 PM
tobiu cross-referenced by PR #10105 on Apr 19, 2026, 6:05 PM
tobiu referenced in commit 4df4b09 - "feat(ai): config-lift ConceptDiscoveryService tuning knobs (#10036) on Apr 19, 2026, 6:26 PM
tobiu referenced in commit a5802d7 - "feat(ai): ConceptDiscoveryService + validated flag for mined candidates (#10036) (#10105) on Apr 19, 2026, 6:30 PM
tobiu cross-referenced by PR #10116 on Apr 20, 2026, 1:40 AM