{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sources\n\nPackage sources discovers the instruction/memory/doc artifacts left by AI coding tools and humans (CLAUDE.md, .claude/, .cursor/rules, AGENTS.md, copilot/windsurf/aider configs, README, docs, ADRs) and records them as doctrine \\*candidates\\*.\n\nPrinciple: these are EVIDENCE, not truth. Each source is scoped to the directory it governs and carries recency, so memcode can tell when a source is likely stale relative to the code it describes. Turning candidates into current doctrine — and reconciling conflicts — is the reducer's job (\\`learn\\`).\n\n## Functions\n\n```go\nfunc Persist(ctx context.Context, st store.Store, srcs []Source) error\n```\nPersist stores discovered sources as doctrine candidates (doctrine entities) so context/why and the agent can surface the ones applicable to an area.\n\n## Types\n\n```go\ntype Source struct {\n\tKind        string    `json:\"kind\"`  // claude | cursor | codex/agents | copilot | windsurf | aider | readme | docs\n\tPath        string    `json:\"path\"`  // relative to repo root\n\tScope       string    `json:\"scope\"` // directory it governs (\".\" = whole repo)\n\tBytes       int64     `json:\"bytes\"`\n\tModTime     time.Time `json:\"mod_time\"`\n\tGitDate     string    `json:\"git_date\"` // last commit date touching it (YYYY-MM-DD)\n\tStale       bool      `json:\"stale\"`    // code in scope changed after this last did\n\tStaleReason string    `json:\"stale_reason,omitempty\"`\n}\n```\nSource is one discovered evidence document.\n\n```go\nfunc Discover(ctx context.Context, root string) ([]Source, error)\n```\nDiscover returns every recognized source document among the project's non-ignored files (so vendored/cached/gitignored files never count). Tracked AI-config files (CLAUDE.md, .claude/\\*, .cursor/rules) are included; purely local-ignored ones are not.\n\n```go\nfunc Load(ctx context.Context, st store.Store) ([]Source, error)\n```\nLoad reads previously discovered sources back from the store.\n\n```go\nfunc (s Source) AppliesTo(rel string) bool\n```\nAppliesTo reports whether a source governs the given path.\n\n","path":"github.com/memcode-ai/memcode/internal/sources","name":"sources","synopsis":"Package sources discovers the instruction/memory/doc artifacts left by AI coding tools and humans (CLAUDE.md, .claude/, .cursor/rules, AGENTS.md, copilot/windsurf/aider configs, README, docs, ADRs) and records them as doctrine *candidates*.","isRedistributable":true}
