Recollect.Learner.Git.StackDetector (recollect v0.5.1)

Copy Markdown View Source

Detects the project's technology stack from config files and tracks framework transitions across git history.

Two modes of operation:

  1. Snapshot — reads current config files to determine the present stack
  2. Diff — walks git history for config-file changes to discover transitions (additions and removals of build tools, test runners, frameworks, etc.)

When a technology is removed (e.g. webpack disappears, esbuild appears), the detector returns a %{type: :deprecation, from: ..., to: ...} transition that the caller feeds into Recollect.Invalidation.deprecate/3 to weaken memories about the old technology.

Summary

Functions

Get the technology category for a given tech name.

Detect the current technology stack by reading config files on disk.

Detect technology transitions from git history by comparing config files at two points in time.

Detect transitions from a list of git log entries (commit maps with :subject).

Check if a from→to transition is a known migration path.

Functions

category_for(tech)

Get the technology category for a given tech name.

detect_current()

Detect the current technology stack by reading config files on disk.

Returns a map of %{technology => %{category: atom, evidence: [String.t()]}}.

detect_transitions(since \\ "30 days ago")

Detect technology transitions from git history by comparing config files at two points in time.

Returns a list of %{type: :deprecation, from: tech, to: tech, category: atom, evidence: String.t()}.

detect_transitions_from_commits(commits)

Detect transitions from a list of git log entries (commit maps with :subject).

This is the path used by the Git learner's summarize/2 callback — it inspects commit subjects for technology change patterns in addition to config file diffs.

known_transition?(from, to)

Check if a from→to transition is a known migration path.