MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / codebaseFitScore

Function codebaseFitScore

src/skills/learning/codebase-fit.ts:55–59  ·  view source on GitHub ↗
(hints: string[], exists: (name: string) => boolean)

Source from the content-addressed store, hash-verified

53 * Score how many of a skill's identifier hints exist in the codebase. `exists` is injected
54 * (e.g. name => codeGraph.findSymbolsByName(name).length > 0). PURE. */
55export function codebaseFitScore(hints: string[], exists: (name: string) => boolean): CodebaseFit {
56 if (hints.length === 0) return { score: 0, matched: [], total: 0, noSignal: true };
57 const matched = hints.filter(h => { try { return exists(h); } catch { return false; } });
58 return { score: matched.length / hints.length, matched, total: hints.length, noSignal: false };
59}
60
61/** A one-line note for the judge prompt / candidate metadata. Empty when there's no signal. */
62export function fitNote(fit: CodebaseFit): string {

Callers 3

fitNoteForFunction · 0.85
runSandboxedMethod · 0.85

Calls 1

existsFunction · 0.70

Tested by

no test coverage detected