{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stack\n\nPackage stack is a deterministic project tech-stack detector. It produces a StackFacts fact sheet from the repo on disk — language byte percentages plus frameworks/CLIs/databases/infra/CI parsed from manifests and config files — so \\`memcode stack\\` and /overview consume FACTS rather than inferring the stack from commit text or subsystem names (which hallucinates).\n\nDetection runs behind the StackDetector interface. LocalStackDetector is native, fast, dependency-free (the only path today). An APIStackDetector — heavier server-side classification — can slot in behind the same interface later.\n\n## Functions\n\n```go\nfunc Brief(f StackFacts) string\n```\nBrief is the stack as an indented block for embedding under an /overview \"Stack\" header — the same canonical facts as \\`memcode stack\\`, no outer labels.\n\n```go\nfunc FactSheet(f StackFacts) string\n```\nFactSheet is the compact, deterministic block injected into /overview so the model RENDERS the stack from facts instead of inferring it. One line per group.\n\n```go\nfunc Render(f StackFacts) string\n```\nRender formats StackFacts for \\`memcode stack\\` — repo shape + a language bar + a grouped detected-stack table. Plain text.\n\n```go\nfunc RepoLine(r RepoFacts) string\n```\nRepoLine summarizes the repository shape in one line: \"git · monorepo (4 modules) · pnpm workspaces, Turborepo\". Empty if nothing detected.\n\n## Types\n\n```go\ntype LanguageStat struct {\n\tName  string  `json:\"name\"`\n\tBytes int64   `json:\"bytes\"`\n\tPct   float64 `json:\"pct\"`\n}\n```\nLanguageStat is one language's share of the codebase, by bytes.\n\n```go\ntype LocalStackDetector struct{}\n```\nLocalStackDetector is the native, offline, dependency-free path.\n\n```go\nfunc (LocalStackDetector) Detect(ctx context.Context, root string) (StackFacts, error)\n```\n\n```go\ntype RepoFacts struct {\n\tVCS       string   `json:\"vcs,omitempty\"`       // \"git\"\n\tMonorepo  bool     `json:\"monorepo\"`            // multiple modules or a workspace file\n\tModules   int      `json:\"modules\"`             // count of manifest modules found\n\tWorkspace []string `json:\"workspace,omitempty\"` // Turborepo, pnpm workspaces, Go workspace, …\n}\n```\nRepoFacts describes the repository shape — VCS, whether it's a monorepo, and any workspace/build orchestrators — all from files on disk.\n\n```go\ntype StackDetector interface {\n\tDetect(ctx context.Context, root string) (StackFacts, error)\n}\n```\nStackDetector produces a StackFacts for a repo root.\n\n```go\ntype StackFacts struct {\n\tRepo       RepoFacts      `json:\"repo\"`\n\tLanguages  []LanguageStat `json:\"languages\"`\n\tRuntimes   []TechFact     `json:\"runtimes\"`\n\tFrameworks []TechFact     `json:\"frameworks\"`\n\tCLIs       []TechFact     `json:\"clis\"`\n\tDatabases  []TechFact     `json:\"databases\"`\n\tInfra      []TechFact     `json:\"infra\"`\n\tCI         []TechFact     `json:\"ci\"`\n}\n```\nStackFacts is the deterministic fact sheet. Every claim is backed by Evidence.\n\n```go\ntype TechFact struct {\n\tName       string   `json:\"name\"`\n\tCategory   string   `json:\"category\"`   // runtime|framework|cli|database|infra|ci\n\tConfidence string   `json:\"confidence\"` // high (manifest-declared) | medium (inferred)\n\tEvidence   []string `json:\"evidence\"`   // files the claim is grounded in\n}\n```\nTechFact is a detected technology with the file(s) that prove it.\n\n","path":"github.com/memcode-ai/memcode/internal/stack","name":"stack","synopsis":"Package stack is a deterministic project tech-stack detector.","isRedistributable":true}
