/** * SMI-4415: Signal-of-intent gate for the GitHub importer. * * Purpose: between the de-duplication step and the blocklist / saveOutput * step in `import-github-skills.ts`, drop repositories that do not exhibit * a *structural* signal of being a Claude Code skill. This is the Tier 2 * companion to SMI-4408's tactical blocklist — the blocklist catches known * bad repos by exact match, this gate catches the long tail by shape. * * Design: * - Multi-signal composite score (Option D in the SMI-4415 plan). * - **Structural-signal floor** (plan-review H4): `shouldIngest` requires * BOTH `hasStructuralSignal === true` AND `score >= threshold`. This * closes the pure-metadata gaming hole where description (+2) + name * regex (+2) alone could clear the threshold with zero structural proof. * - Zero extra GitHub API calls — only reads fields already present on * `ImportedSkill` (populated from the GitHub search response). * * Plan: docs/internal/implementation/smi-4415-indexer-signal-of-intent.md */ import type { ImportedSkill } from './types.js'; /** * Default signal-score threshold. Revisit against the Wave 0 evidence * before tuning; changes with a ≥20% `intent_admit_rate` delta against * the rolling baseline require plan-review. */ export declare const SIGNAL_THRESHOLD = 4; /** * Owner-level trust list. Any repository whose `author` matches an entry * here is deemed to carry author-vouched intent, worth +5 (enough to clear * the default threshold on its own). * * TRUTH SOURCE: `supabase/functions/indexer/high-trust-authors.ts` * (distinct `.owner` values from the `HIGH_TRUST_AUTHORS` array). * Cross-boundary imports from `supabase/functions/` into `packages/core/` * are unsupported (the Edge Function pipeline compiles under Deno, not * Node), so the values are duplicated here and must be **manually synced** * when that file changes. The two files are the authoritative pair for * "trusted owner." * * Wave 0 R2 added `daymade` — `daymade/claude-code-skills` (901⭐ community * marketplace) has no topics and would otherwise fail the structural floor * despite legitimate intent. Author manually verified 2026-04-21. * * Matching: case-insensitive (done in `isHighTrustOwner`). */ export declare const HIGH_TRUST_OWNERS: ReadonlySet; export interface SignalScore { /** Sum of weights for every signal that fired. */ score: number; /** * Human-readable labels for each fired signal — surfaced in import * stats (`rejected_for_intent_reasons`) for audit and debugging. */ signals: string[]; /** * True iff at least one structural signal fired. Required (in addition * to score >= threshold) by `shouldIngest` per plan-review H4. */ hasStructuralSignal: boolean; } /** * Compute the signal-of-intent score for a single imported skill candidate. * * Reads only fields already present on `ImportedSkill` — zero additional * GitHub API calls. Designed to be cheap enough to run on every deduped * repo per import run. */ export declare function computeSignalScore(skill: ImportedSkill): SignalScore; /** * Intent-gate decision for a single imported skill candidate. * * Requires BOTH: * 1. `hasStructuralSignal === true` — at least one structural signal * (topic tag OR HIGH_TRUST_OWNERS membership) fired. This is the * plan-review H4 floor. * 2. `score >= threshold` — the composite score clears the cutoff. * * Metadata-only matches (description + name + language + license + stars) * can contribute to the score but will fail on the floor regardless of * how high the sum reaches. * * @param skill - Deduped importer candidate. * @param threshold - Defaults to `SIGNAL_THRESHOLD` (4). */ export declare function shouldIngest(skill: ImportedSkill, threshold?: number): boolean; //# sourceMappingURL=signal-of-intent.d.ts.map