Documentation
¶
Overview ¶
Package collector produces Git-aware ingestion requests. It has no server or database dependency; CLI and agent hooks use the same collection entrypoint.
Index ¶
- Variables
- func Collect(ctx context.Context, directory string, options Options) (ingestion.Request, error)
- func CollectChanged(ctx context.Context, directory string, options Options, ...) (ingestion.Request, string, error)
- func CollectPatch(ctx context.Context, raw, directory string, options Options) (ingestion.Request, error)
- func Fingerprint(request ingestion.Request) string
- func SourceID() (string, error)
- func SourceIdentity(ctx context.Context, root, sourceID, branch, base string) (string, error)
- type Discovery
- type DiscoverySource
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrUnchanged = errors.New("checkout unchanged")
ErrUnchanged means the checkout still matches its acknowledged fingerprint.
Functions ¶
func CollectChanged ¶
func CollectChanged(ctx context.Context, directory string, options Options, previousFingerprint string) (ingestion.Request, string, error)
CollectChanged checks complete content identity before constructing previews. A nonempty fingerprint is safe to persist only after successful ingestion. Unknown identities always produce a request, even when a prior value exists.
func CollectPatch ¶
func CollectPatch(ctx context.Context, raw, directory string, options Options) (ingestion.Request, error)
CollectPatch records immutable input with its submission directory as provenance.
func Fingerprint ¶
Fingerprint identifies checkout contents and stable provenance, excluding submission/agent/session/time and filesystem-based snapshot revisions. Empty means full identity cannot be proven; never use it to suppress a sync.
func SourceID ¶
SourceID identifies this installation independently of its hostname/path. Ephemeral environments can provide DIFFX_SOURCE_ID explicitly.
func SourceIdentity ¶
SourceIdentity uses persisted Git identities. Paths and branch labels are location hints, not the source's identity. Branch identifies object-only recovery; an empty branch identifies the live checkout.
Types ¶
type Discovery ¶
type Discovery struct {
Sources []DiscoverySource
Diagnostics []string
}