Store.Project.CommitDocument (fnord v0.9.29)

View Source

Builds the bounded canonical text used to embed git commits for a project.

The document keeps commit semantics isolated from file and conversation indexing while still producing a stable text form that can be hashed for stale detection when the document format or embedding model changes.

Summary

Functions

Builds the bounded canonical commit document used for embeddings.

Hashes the canonical commit document so callers can compare stable semantic content rather than raw commit metadata.

Types

commit()

@type commit() :: %{
  sha: String.t(),
  parent_shas: [String.t()],
  subject: String.t(),
  body: String.t(),
  author: String.t(),
  committed_at: String.t() | DateTime.t() | non_neg_integer(),
  changed_files: [String.t()],
  diffstat: String.t() | [map()]
}

Functions

build(commit)

@spec build(%{
  sha: binary(),
  parent_shas: [binary()],
  subject: binary(),
  body: binary(),
  author: binary(),
  committed_at: binary() | non_neg_integer() | DateTime.t(),
  changed_files: [binary()],
  diffstat: binary() | [map()]
}) :: {binary(), binary()}

Builds the bounded canonical commit document used for embeddings.

The shape stays deliberately small so commit histories can be hashed and reindexed deterministically without embedding unbounded patch text.

doc_hash(document)

@spec doc_hash(binary()) :: binary()

Hashes the canonical commit document so callers can compare stable semantic content rather than raw commit metadata.

version()

@spec version() :: non_neg_integer()