adapters

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package adapters defines the Adapter interface and shared types for artifact discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Name() string
	Discover(ctx context.Context, repoRoot string, cfg *config.RepoConfig) ([]Candidate, error)
	Parse(ctx context.Context, c Candidate) (Artifact, []Source, todoparse.ParseResult, error)
}

Adapter discovers and parses artifacts of a specific type.

type Artifact

type Artifact struct {
	SourceIdentity string
	Kind           string
	Subtype        string
	Title          string
	Status         string
	PrimaryPath    string
	Body           string
	Extracted      map[string]any
	Tags           []string
	FormatProfile  string
	LayoutGroup    string
}

Artifact holds the parsed metadata for an artifact.

type Candidate

type Candidate struct {
	PrimaryPath string // absolute path to the primary file
	RelPath     string // relative to repo root
	AdapterName string
	// FormatProfile and LayoutGroup may be set by adapters; scan persists them on Source rows.
	FormatProfile string
	LayoutGroup   string
	// MarkdownPaths and MarkdownRules apply when AdapterName is "markdown".
	MarkdownPaths []string
	MarkdownRules []config.SourceRule
}

Candidate is a file or directory discovered by an adapter for further parsing.

type Source

type Source struct {
	SourceType     string
	Path           string
	SourceIdentity string
	FormatProfile  string
	LayoutGroup    string
}

Source represents where an artifact came from.

Directories

Path Synopsis
Package adr implements the ADR (Architecture Decision Record) adapter.
Package adr implements the ADR (Architecture Decision Record) adapter.
Package markdown implements the generic markdown plan/spec adapter.
Package markdown implements the generic markdown plan/spec adapter.
Package openspec implements the OpenSpec change proposal adapter.
Package openspec implements the OpenSpec change proposal adapter.
Package todoparse extracts markdown checklist items from text content.
Package todoparse extracts markdown checklist items from text content.

Jump to

Keyboard shortcuts

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