diffformat

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package diffformat produces the simple "before vs after" diff text CodeDB indexes for diff search and re-derives at search-read time for snippets (ADR-018 phase 2 Option A). The format is intentionally minimal — not a unified diff — and MUST stay byte-stable across producers: the indexer writes it into the Bleve diff index for tokenization; the search assemble path re-computes it from blobs for the snippet shown to agents.

Bump the diff mapping version in store.bleveMappingVersion("diff") and force a reindex if you change the format here — drift would split-brain the inverted index against the regenerated snippet.

Index

Constants

View Source
const MaxLines = 100

MaxLines caps each of the "before" and "after" sides at 100 lines, matching the indexer's historical cap.

Variables

This section is empty.

Functions

func Format

func Format(path, oldText, newText string) string

Format returns the diff text for one file change. Pass "" for oldText when the file was added (no prior content) and "" for newText when deleted.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL