Skip to main content

Module skills

Module skills 

Source

Re-exports§

pub use sweep::QuarantineReport;
pub use sweep::SweepOpts;
pub use sweep::SweepReport;
pub use sweep::quarantine_unguided_conv_reviews;
pub use sweep::sweep_stale_skills;

Modules§

sweep
Maintenance sweeps for stale or weakly grounded skills.

Structs§

CandidateRule
One row in the local candidate queue. Mirrors SkillRecord but drops the engine flags that aren’t actionable for a pending rule and adds the ingest-time provenance we surface in the UI.
CandidateSourceProof
ConfidenceChange
Return value of update_confidence so the caller can render a before/after message (“rule X: 0.65 → 0.70”). 2026-04-25: previously returned (), which made the feedback loop feel inert from the user’s POV. The before/name fields piggy-back on the SELECT we now do anyway to compute the clamped after value.
OriginCount
RememberOutcome
RulesStats
SearchSkillMeta
Lightweight metadata for recall/search flows. Returns just enough to explain why a rule surfaced (file_patterns + canonical source_repo). Uses dynamic SQL so it doesn’t pin the sqlx offline cache to current schema.
StrengthenedRule

Enums§

RuleStatus
Lifecycle status for a row in the local skills table.

Constants§

REMEMBER_BODY_CHAR_LIMIT
REMEMBER_CONVERSATION_CONFIDENCE_CAP
Confidence ceiling for conversation-channel rules. Agent-captured rules get a fidelity discount relative to manually curated local memory, and the cap prevents a looping agent from pushing one past manual rules in ranking.
REMEMBER_DAILY_LIMIT
Hard daily limit. At 50 captures in one day the most likely cause is an agent stuck in a loop calling remember_rule over and over — blocking protects the user’s rule corpus from being polluted faster than they can audit it. Reset is per-calendar-day local time.
REMEMBER_DEDUP_WINDOW_MS
Dedup window size in milliseconds. Identical content-hash captures within this window collapse into a single soft-accept bump so an agent in a tight loop cannot stack many +0.05 increments on one rule.
REMEMBER_EXAMPLE_CHAR_LIMIT
REMEMBER_FILE_PATTERN_CHAR_LIMIT
REMEMBER_FILE_PATTERN_LIMIT
REMEMBER_WARN_THRESHOLD
Soft warning threshold — at this count, MCP/CLI surfaces tell the user “you’ve captured a lot today, are you sure?” without blocking. Picked at 10 because the median user is unlikely to record more than a handful of rules in one session; ten is a strong signal of either an agent runaway or a deliberate batch import.

Functions§

add
add_example
apply_sync_result
backfill_cloud_rules_enabled_for_all_agents
Cloud review memory is agent-agnostic: once a team rule is synced locally, Codex/Cursor/Gemini should get the same protection Claude gets. Older syncs wrote only enabled_for_claude=1, which made the CLI look full of rules while Codex MCP recall returned nothing.
backfill_skills_confidence_from_tags
Re-stamp skills.confidence_score for every row whose tags carry a cluster-size:N / severity:X evidence signal but whose score is still at the historic flat default (0.7). Returns the number of rows updated. Tight tolerance (±0.001) so user-customized scores like 0.65 / 0.75 are left alone.
count_captures_today
How many conversation-channel captures landed today. Used both for the rate-limit warn threshold and for surfacing captures_today on the outcome so callers can render guidance like “12/50 today, getting close to the cap”. Returns 0 for non-conversation origins (the rate limit only protects against agent runaway).
count_pending_candidates
Count pending candidates, optionally filtered to a repo. Cheaper than list_candidates(...).len() when the caller only needs the total (e.g. the “+N more — --limit 0 to see all” hint in candidates list).
create_local
discover
expand_repo_scopes_with_source_aliases
Expand detected git remotes with a conservative source-repo alias.
export_rules_markdown
fetch_search_meta
list
list_all
Same SELECT as list() but without the status='active' filter. Used by review-memory surfaces that need to see pending rows alongside active ones.
list_all_skills
List skills across all types but active status only — pending candidates and soft-deleted rows are filtered out at the SQL level.
list_candidate_ids
list_candidates
List pending candidates, with high-leverage file-scoped work first.
list_examples
list_review_standards
list_source_repos
Sidecar query: (skill_id → source_repo) for every rule in the local skills table.
parse_candidate_drafted_rule
parse_candidate_source_proof
promote_candidate
reject_candidate
remember
remember_as_candidate
Insert a rule via remember() and downgrade it to status='pending' so MCP doesn’t serve it. Used by import/extraction flows to land agent memory as drafts pending review. Idempotent: dedup paths in remember() may return an existing row; if that row was already active we leave it alone (the user already reviewed it).
remember_as_candidate_with_confidence
Insert a rule as a status='pending' draft, seeding its confidence_score from a caller-computed value (e.g. the import gate’s capture_confidence) instead of the flat conversation default.
remove
remove_example
repos_add
repos_list
repos_remove
rule_status
stats
sync_links
toggle_engine
update_confidence