Documentation
¶
Index ¶
- Variables
- func ApplyModeOverrides(cfg *Config, mode Mode, stdoutIsTTY bool)
- func IsNonInteractive() bool
- func ReadLanguageOnly(dir string) string
- func RegisterFlags(cmd *cobra.Command)
- func ResolveStateDir(workDir string, cfg *Config, mode Mode) string
- func ValidateDraftOfflineInvariant() error
- type AIConfig
- type AngelaConfig
- type Config
- type ConfigReport
- type CorruptQuarantineConfig
- type DecisionConfig
- type DraftAutofixConfig
- type DraftChecksConfig
- type DraftConfig
- type DraftDifferentialConfig
- type DraftInteractiveConfig
- type EvidenceConfig
- type ExitCodeConfig
- type GCConfig
- type HallucinationCheckConfig
- type HooksConfig
- type I18nConfig
- type Mode
- type NotificationConfig
- type OutputConfig
- type OutputFormatConfig
- type PersonasConfig
- type PolishAudienceConfig
- type PolishBackupConfig
- type PolishConfig
- type PolishIncrementalConfig
- type PolishInteractiveConfig
- type PolishLogConfig
- type ReviewConfig
- type ReviewDifferentialConfig
- type ReviewExitCodeConfig
- type ReviewInteractiveConfig
- type SamplingConfig
- type ScoringConfig
- type SynthesizersConfig
- type TemplatesConfig
Constants ¶
This section is empty.
Variables ¶
var WarnWriter io.Writer = os.Stderr
WarnWriter is the destination for config warnings (e.g. unknown fields). It defaults to os.Stderr but can be overridden in tests.
Functions ¶
func ApplyModeOverrides ¶ added in v1.1.0
ApplyModeOverrides mutates cfg in-place to apply mode-specific defaults that the user has not explicitly overridden. Called once at command startup, AFTER config load and mode detection.
The only automatic override in MVP v1:
- Standalone mode + non-TTY stdout + output.format still at "human" → promote to "json". This makes `lore angela draft ./docs` produce machine-readable output in a CI container without the user having to remember the flag.
Explicit user choices (the user wrote format: json OR human in their .lorerc) are respected — the auto-promotion only fires when the field is still at its zero-config default.
The caller signals whether stdout is a TTY via stdoutIsTTY. Tests pass a controlled value; the production caller uses isNonInteractive().
func IsNonInteractive ¶ added in v1.1.0
func IsNonInteractive() bool
IsNonInteractive reports whether stdout is NOT a terminal. Used by root command wiring to decide whether ApplyModeOverrides should promote draft output to json. Exposed for testing and for other packages that need the same signal.
func ReadLanguageOnly ¶ added in v1.0.0
ReadLanguageOnly reads only the language field from .lorerc without full config loading. This is used before Cobra command construction so that i18n.T() returns the correct language for command Short/Long strings. Returns "" if the file is absent, unreadable, or has no language field. No validation, no Viper, no error surfacing — silent fallback.
func RegisterFlags ¶
RegisterFlags declares persistent CLI flags on the given command. Called by cmd/root.go — no Viper dependency is exposed.
Shell completion: --ai-provider and --language expose closed enums, so they get explicit value-completion registered here. The boolean flags don't need completion (cobra auto-completes --flag with no value).
func ResolveStateDir ¶ added in v1.1.0
ResolveStateDir returns the absolute path to the state directory that should be used for differential caches, backups, and ignore rules. Resolution rules:
- cfg.Angela.StateDir wins when set (joined with workDir if relative).
- lore-native mode → <workDir>/.lore/angela/
- hybrid / standalone modes → <workDir>/.angela-state/
The returned path is not guaranteed to exist — callers that need to write into it should os.MkdirAll first.
func ValidateDraftOfflineInvariant ¶ added in v1.1.0
func ValidateDraftOfflineInvariant() error
ValidateDraftOfflineInvariant enforces Invariant I1: DraftConfig and its nested sub-configs must not contain any field whose CamelCase-split name hints at AI or network dependency. The invariant is structural — the type system already prevents most violations because DraftConfig has no provider fields — but this check adds a runtime guard against accidents during refactors.
Called from ValidateConfig() at config load time and from the unit test TestDraftConfig_NoAIFields.
Types ¶
type AIConfig ¶
type AIConfig struct {
Provider string `yaml:"provider" mapstructure:"provider"`
Model string `yaml:"model" mapstructure:"model"`
APIKey string `yaml:"api_key" mapstructure:"api_key"`
Endpoint string `yaml:"endpoint" mapstructure:"endpoint"`
Timeout time.Duration `yaml:"timeout" mapstructure:"timeout"`
}
type AngelaConfig ¶
type AngelaConfig struct {
// Mode is retained for backward compatibility with existing .lorerc
// files but has no runtime effect. The mode is selected by the sub-
// command: `lore angela draft`, `polish`, or `review`.
//
// Deprecated: unused. ValidateConfig emits a deprecation warning when
// this field is set in a config file. Will be removed in v2.
Mode string `yaml:"mode" mapstructure:"mode"`
MaxTokens int `yaml:"max_tokens" mapstructure:"max_tokens"`
StyleGuide map[string]interface{} `yaml:"style_guide" mapstructure:"style_guide"`
// ModeDetection drives how AngelaConfig resolves the operating mode
// (lore-native / hybrid / standalone). Valid values: "auto" (default,
// probes the filesystem), "lore-native", "hybrid", "standalone".
// The detection logic probes the filesystem at runtime.
ModeDetection string `yaml:"mode_detection" mapstructure:"mode_detection"`
// StateDir overrides the default state directory location. Empty means
// "resolve from mode" — `.lore/angela/` for lore-native, `.angela-state/`
// otherwise. Relative paths are interpreted relative to the working dir.
StateDir string `yaml:"state_dir" mapstructure:"state_dir"`
// I18n controls suggestion language selection.
I18n I18nConfig `yaml:"i18n" mapstructure:"i18n"`
// Personas holds the GLOBAL defaults for persona selection across
// all three sub-commands. Per-command configs (Draft.Personas, etc.)
// can override individual fields at the YAML level; the global values
// serve as the fallback when per-command fields are unset.
Personas PersonasConfig `yaml:"personas" mapstructure:"personas"`
// Per-command sub-configs.
Draft DraftConfig `yaml:"draft" mapstructure:"draft"`
Review ReviewConfig `yaml:"review" mapstructure:"review"`
Polish PolishConfig `yaml:"polish" mapstructure:"polish"`
// Synthesizers controls the Example Synthesizer family.
// Synthesizers enrich docs with literal recompositions of information
// already present (Postman examples, SQL queries, env templates). The
// framework enforces invariants I4 (zero-hallucination), I5 (security-
// first projection), I6 (idempotency), I7 (no silent merge).
Synthesizers SynthesizersConfig `yaml:"synthesizers" mapstructure:"synthesizers"`
// GC drives the retention policies consumed by the Pruner registry
// at `internal/angela/gc/`. Pruners run on demand via
// `lore doctor --prune` and automatically via each producer
// (polish backups today, others as they register). Story 8-23.
GC GCConfig `yaml:"gc" mapstructure:"gc"`
}
AngelaConfig groups all configuration for the `lore angela` sub-commands (draft / polish / review). Legacy fields (Mode, MaxTokens, StyleGuide) are retained for backward compatibility with existing .lorerc files. Per-command sub-configs (Draft, Review, Polish) give each sub-command its own namespace.
Invariant I1 (draft is offline forever): DraftConfig and its sub-configs MUST NOT contain any AI-related fields. This invariant is enforced by ValidateDraftOfflineInvariant() at config load time using reflection.
type Config ¶
type Config struct {
Language string `yaml:"language" mapstructure:"language"`
AI AIConfig `yaml:"ai"`
Angela AngelaConfig `yaml:"angela"`
Decision DecisionConfig `yaml:"decision"`
Notification NotificationConfig `yaml:"notification"`
Templates TemplatesConfig `yaml:"templates"`
Hooks HooksConfig `yaml:"hooks"`
Output OutputConfig `yaml:"output"`
// DetectedMode is populated at command startup by root.go via
// DetectMode(). It is NOT loaded from .lorerc — the user-facing
// override is cfg.Angela.ModeDetection. The yaml:"-" tag keeps this
// field out of Viper's key set so `validate.go` does not flag it as
// an unknown field in a user's config file.
//
// Downstream code (Angela sub-commands, storage helpers) should read
// DetectedMode instead of re-probing the filesystem.
DetectedMode Mode `yaml:"-" mapstructure:"-"`
}
func LoadFromDir ¶
LoadFromDir loads configuration from a specific directory.
type ConfigReport ¶ added in v1.0.0
type ConfigReport struct {
Valid bool // true if no errors (warnings are OK)
Warnings []string // unknown fields, suggestions
Errors []string // invalid values, parse errors
Active map[string]string // resolved values after cascade
}
ConfigReport holds the results of config validation.
func ValidateConfig ¶ added in v1.0.0
func ValidateConfig(dir string) *ConfigReport
ValidateConfig validates .lorerc and .lorerc.local files in dir. It checks for unknown fields (with "did you mean?" suggestions) and collects the active resolved values.
func (*ConfigReport) OK ¶ added in v1.0.0
func (r *ConfigReport) OK() bool
OK returns true when validation found no errors and no warnings.
type CorruptQuarantineConfig ¶ added in v1.2.3
type CorruptQuarantineConfig struct {
RetentionDays int `yaml:"retention_days" mapstructure:"retention_days"`
}
CorruptQuarantineConfig controls how long `<state>.corrupt-<ts>` files produced by angela.QuarantineCorruptState are kept before `doctor --prune` removes them. Default 14 days.
type DecisionConfig ¶ added in v1.0.0
type DecisionConfig struct {
ThresholdFull int `yaml:"threshold_full" mapstructure:"threshold_full"`
ThresholdReduced int `yaml:"threshold_reduced" mapstructure:"threshold_reduced"`
ThresholdSuggest int `yaml:"threshold_suggest" mapstructure:"threshold_suggest"`
AlwaysAsk []string `yaml:"always_ask" mapstructure:"always_ask"`
AlwaysSkip []string `yaml:"always_skip" mapstructure:"always_skip"`
CriticalScopes []string `yaml:"critical_scopes" mapstructure:"critical_scopes"`
Learning bool `yaml:"learning" mapstructure:"learning"`
LearningMinCommits int `yaml:"learning_min_commits" mapstructure:"learning_min_commits"`
}
type DraftAutofixConfig ¶ added in v1.1.0
type DraftAutofixConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Mode string `yaml:"mode" mapstructure:"mode"` // "safe" | "aggressive"
Backup bool `yaml:"backup" mapstructure:"backup"`
}
DraftAutofixConfig controls the autofix engine. Autofix is 100% local — it uses existing helpers like DetectLanguage(). No AI calls, no network. Invariant I1 holds.
type DraftChecksConfig ¶ added in v1.1.0
type DraftChecksConfig struct {
Structure bool `yaml:"structure" mapstructure:"structure"`
Completeness bool `yaml:"completeness" mapstructure:"completeness"`
Coherence bool `yaml:"coherence" mapstructure:"coherence"`
Personas bool `yaml:"personas" mapstructure:"personas"`
Scoring bool `yaml:"scoring" mapstructure:"scoring"`
}
DraftChecksConfig toggles individual analyzer categories in draft.
type DraftConfig ¶ added in v1.1.0
type DraftConfig struct {
Checks DraftChecksConfig `yaml:"checks" mapstructure:"checks"`
Scoring ScoringConfig `yaml:"scoring" mapstructure:"scoring"`
SeverityOverride map[string]string `yaml:"severity_override" mapstructure:"severity_override"`
Differential DraftDifferentialConfig `yaml:"differential" mapstructure:"differential"`
Autofix DraftAutofixConfig `yaml:"autofix" mapstructure:"autofix"`
Interactive DraftInteractiveConfig `yaml:"interactive" mapstructure:"interactive"`
Personas PersonasConfig `yaml:"personas" mapstructure:"personas"`
Output OutputFormatConfig `yaml:"output" mapstructure:"output"`
ExitCode ExitCodeConfig `yaml:"exit_code" mapstructure:"exit_code"`
IgnoreFile string `yaml:"ignore_file" mapstructure:"ignore_file"`
}
DraftConfig holds all configuration for the `lore angela draft` command. Draft is guaranteed offline: no field in this struct (or its sub-configs) triggers network I/O. This invariant is structural — do not add any field whose name contains ai/model/provider/escalate/token.
type DraftDifferentialConfig ¶ added in v1.1.0
type DraftDifferentialConfig struct {
// Enabled turns differential mode on or off.
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
// StateFile is the filename (not path) where state is persisted,
// relative to AngelaConfig.StateDir. Example: "draft-state.json".
StateFile string `yaml:"state_file" mapstructure:"state_file"`
// DiffOnly hides PERSISTING findings in the report, showing only
// NEW and RESOLVED. Ideal for CI pipelines.
DiffOnly bool `yaml:"diff_only" mapstructure:"diff_only"`
}
DraftDifferentialConfig controls hash/state-based incremental analysis for `lore angela draft`. Draft is strictly offline and per-machine so this struct intentionally OMITS the `state_shared` review-future field — users who set that key under `angela.draft.differential` will get a "strict unmarshal" warning instead of a silent no-op that implies a feature that doesn't exist.
Draft and review use separate config types so `state_shared` (a review-only placeholder) does not pollute draft's schema.
type DraftInteractiveConfig ¶ added in v1.1.0
type DraftInteractiveConfig struct {
// Enabled toggles the TUI mode on. Auto-downgraded to printf output
// when stdout is not a TTY.
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}
DraftInteractiveConfig controls the draft fix-it TUI.
type EvidenceConfig ¶ added in v1.1.0
type EvidenceConfig struct {
// Required: when true, findings without verifiable quotes are rejected.
Required bool `yaml:"required" mapstructure:"required"`
// MinConfidence filters findings whose AI-reported confidence is below
// this threshold (0.0 - 1.0).
MinConfidence float64 `yaml:"min_confidence" mapstructure:"min_confidence"`
// Validation strictness: "strict" | "lenient" | "off".
Validation string `yaml:"validation" mapstructure:"validation"`
}
EvidenceConfig controls finding evidence validation.
type ExitCodeConfig ¶ added in v1.1.0
type ExitCodeConfig struct {
// FailOn: minimum severity that triggers a non-zero exit code.
// Valid values: "error" | "warning" | "info" | "never".
FailOn string `yaml:"fail_on" mapstructure:"fail_on"`
// Strict promotes all warnings to errors for exit-code purposes.
Strict bool `yaml:"strict" mapstructure:"strict"`
}
ExitCodeConfig controls shell exit code resolution for a sub-command.
type GCConfig ¶ added in v1.2.3
type GCConfig struct {
CorruptQuarantine CorruptQuarantineConfig `yaml:"corrupt_quarantine" mapstructure:"corrupt_quarantine"`
}
GCConfig collects the cross-feature garbage-collection retention knobs. Per-feature retention (polish backups, polish.log) lives on the feature config where it was originally declared; GCConfig holds retention for artifacts that don't belong to a single feature.
type HallucinationCheckConfig ¶ added in v1.1.0
type HallucinationCheckConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Strictness string `yaml:"strictness" mapstructure:"strictness"` // "warn" | "reject" | "off"
}
HallucinationCheckConfig controls post-polish claim verification.
type HooksConfig ¶
type HooksConfig struct {
PostCommit bool `yaml:"post_commit" mapstructure:"post_commit"`
StarPrompt bool `yaml:"star_prompt" mapstructure:"star_prompt"`
StarPromptAfter int `yaml:"star_prompt_after" mapstructure:"star_prompt_after"`
AmendPrompt bool `yaml:"amend_prompt" mapstructure:"amend_prompt"`
}
type I18nConfig ¶ added in v1.1.0
type I18nConfig struct {
// SuggestionsLanguage selects the language for locally-generated
// suggestions. "auto" follows the top-level `language` config.
// Valid values: "auto", "fr", "en".
SuggestionsLanguage string `yaml:"suggestions_language" mapstructure:"suggestions_language"`
}
I18nConfig controls how suggestion messages are localized.
type Mode ¶ added in v1.1.0
type Mode int
Mode describes how Angela is operating in the current working directory. This abstraction lets draft/review/polish apply mode-aware defaults (e.g. auto-JSON output on standalone CI) without scattering filesystem probes across the codebase.
const ( // ModeLoreNative is selected when a .lore/ directory is present. The // full feature set is available: scope/related conventions, LKS // signals, commit-linked docs, personas tuned for lore types. ModeLoreNative Mode = iota // ModeHybrid is selected when .git/ exists but .lore/ does not. // Git-based signals (commit history, diff size) are still available, // but lore-specific conventions (related:, scope:) are skipped. ModeHybrid // ModeStandalone is selected when neither .lore/ nor .git/ is found. // This is the canonical CI mode — the user is running Angela on a // pure-markdown repository (mkdocs, docusaurus, hugo, ...) that was // never initialized with lore. Defaults lean toward machine-readable // output and skip lore-specific suggestions. ModeStandalone )
func DetectMode ¶ added in v1.1.0
DetectMode returns the operating mode for a working directory. The resolution rules are:
- If cfg.Angela.ModeDetection is explicit (anything but "auto" or empty), parse it and return.
- Otherwise, probe the filesystem: .lore/ wins, then .git/, then standalone as the final fallback.
DetectMode never returns an error. Unreadable directories are treated as "not a lore project" — the same outcome as a missing directory.
type NotificationConfig ¶ added in v1.0.0
type OutputConfig ¶
type OutputFormatConfig ¶ added in v1.1.0
type OutputFormatConfig struct {
// Format: "human" (colored terminal output) | "json" (machine-parseable).
// In standalone + non-TTY mode, mode detection auto-promotes
// "human" → "json" when the user hasn't made an explicit choice.
Format string `yaml:"format" mapstructure:"format"`
// Color: "auto" (colorize only when TTY) | "always" | "never".
Color string `yaml:"color" mapstructure:"color"`
// Progress: "auto" | "always" | "never".
Progress string `yaml:"progress" mapstructure:"progress"`
// Verbose enables detailed output (breakdowns, rejected findings, etc.).
Verbose bool `yaml:"verbose" mapstructure:"verbose"`
}
OutputFormatConfig controls the CLI output rendering for a sub-command.
type PersonasConfig ¶ added in v1.1.0
type PersonasConfig struct {
// Selection mode: "auto" (smart per doc type), "manual" (use ManualList),
// "all" (all 6 personas), "none" (no persona checks).
Selection string `yaml:"selection" mapstructure:"selection"`
// Max caps the number of active personas. Max <= 0 means use default (3).
// To select all matching personas, use Selection: "all".
Max int `yaml:"max" mapstructure:"max"`
// ManualList is consulted when Selection == "manual". Contains persona
// names (e.g., "tech-writer", "architect"). Empty otherwise.
ManualList []string `yaml:"manual_list" mapstructure:"manual_list"`
// FreeFormMode controls persona activation for free-form doc types
// (tutorial, guide, landing, etc.). Valid values:
// "none" — no personas for free-form docs (current behavior before 8-11)
// "minimal" — only tech-writer (default)
// "full" — smart per-type selection
FreeFormMode string `yaml:"free_form_mode" mapstructure:"free_form_mode"`
}
PersonasConfig controls persona selection for draft / review / polish. Used both globally (angela.personas) and per-command. Empty fields in a per-command config inherit from the global config via ResolvePersonasConfig.
type PolishAudienceConfig ¶ added in v1.1.0
type PolishAudienceConfig struct {
Default string `yaml:"default" mapstructure:"default"`
Allowed []string `yaml:"allowed" mapstructure:"allowed"` // empty = any audience allowed
}
PolishAudienceConfig controls audience-targeted polish rewrites.
type PolishBackupConfig ¶ added in v1.1.0
type PolishBackupConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Path string `yaml:"path" mapstructure:"path"` // relative to StateDir
RetentionDays int `yaml:"retention_days" mapstructure:"retention_days"` // 0 = forever
}
PolishBackupConfig controls automatic backup of files before polish writes.
type PolishConfig ¶ added in v1.1.0
type PolishConfig struct {
DryRun bool `yaml:"dry_run" mapstructure:"dry_run"`
Backup PolishBackupConfig `yaml:"backup" mapstructure:"backup"`
HallucinationCheck HallucinationCheckConfig `yaml:"hallucination_check" mapstructure:"hallucination_check"`
Incremental PolishIncrementalConfig `yaml:"incremental" mapstructure:"incremental"`
Interactive PolishInteractiveConfig `yaml:"interactive" mapstructure:"interactive"`
Personas PersonasConfig `yaml:"personas" mapstructure:"personas"`
Audience PolishAudienceConfig `yaml:"audience" mapstructure:"audience"`
Log PolishLogConfig `yaml:"log" mapstructure:"log"`
}
PolishConfig holds all configuration for the `lore angela polish` command.
type PolishIncrementalConfig ¶ added in v1.1.0
type PolishIncrementalConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
MinChangeLines int `yaml:"min_change_lines" mapstructure:"min_change_lines"`
}
PolishIncrementalConfig enables section-level re-polish.
type PolishInteractiveConfig ¶ added in v1.1.0
type PolishInteractiveConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Granularity string `yaml:"granularity" mapstructure:"granularity"` // "section" | "paragraph"
}
PolishInteractiveConfig controls the polish diff-per-section TUI.
type PolishLogConfig ¶ added in v1.2.3
type PolishLogConfig struct {
// RetentionDays: entries older than this are eligible for pruning
// via `lore doctor --prune`. 0 = keep forever.
RetentionDays int `yaml:"retention_days" mapstructure:"retention_days"`
// MaxSizeMB: hard cap on polish.log size; when exceeded, the oldest
// lines are truncated until the cap is respected. 0 = no cap.
MaxSizeMB int `yaml:"max_size_mb" mapstructure:"max_size_mb"`
}
PolishLogConfig controls the polish.log JSONL audit trail. Story 8-21 defines the schema and the write path (invariant I30); retention + size cap are consumed by story 8-23's Pruner registry (doctor --prune). Keeping the keys here so the schema lands in one place and is visible to config validation.
type ReviewConfig ¶ added in v1.1.0
type ReviewConfig struct {
Evidence EvidenceConfig `yaml:"evidence" mapstructure:"evidence"`
Differential ReviewDifferentialConfig `yaml:"differential" mapstructure:"differential"`
Sampling SamplingConfig `yaml:"sampling" mapstructure:"sampling"`
Interactive ReviewInteractiveConfig `yaml:"interactive" mapstructure:"interactive"`
Personas PersonasConfig `yaml:"personas" mapstructure:"personas"`
Output OutputFormatConfig `yaml:"output" mapstructure:"output"`
ExitCode ReviewExitCodeConfig `yaml:"exit_code" mapstructure:"exit_code"`
}
ReviewConfig holds all configuration for the `lore angela review` command.
type ReviewDifferentialConfig ¶ added in v1.1.0
type ReviewDifferentialConfig struct {
// Enabled turns differential mode on or off.
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
// StateFile is the filename (not path) where state is persisted,
// relative to AngelaConfig.StateDir. Example: "review-state.json".
StateFile string `yaml:"state_file" mapstructure:"state_file"`
// DiffOnly hides PERSISTING findings in the report, showing only
// NEW, REGRESSED, and RESOLVED. Ideal for CI pipelines.
DiffOnly bool `yaml:"diff_only" mapstructure:"diff_only"`
// reserved for a future v1.1 feature where teams could share
// review state across machines (with merge-conflict handling). In
// MVP v1 it is a no-op — left in the schema so users can set it
// without errors and so the YAML key stays stable across versions.
StateShared bool `yaml:"state_shared" mapstructure:"state_shared"`
}
ReviewDifferentialConfig controls hash/state-based incremental analysis for `lore angela review`. Differs from the draft variant by the presence of `state_shared` (placeholder for v1.1 shared-team review state) and by supporting the REGRESSED lifecycle status in its diff surface.
type ReviewExitCodeConfig ¶ added in v1.1.0
type ReviewExitCodeConfig struct {
// FailOnSeverity: minimum severity for non-zero exit.
// Valid values: "contradiction" | "gap" | "obsolete" | "style" | "never".
FailOnSeverity string `yaml:"fail_on_severity" mapstructure:"fail_on_severity"`
}
ReviewExitCodeConfig controls exit codes specific to review findings. Review uses severity levels from the AI ("contradiction" > "gap" > ...) so its threshold semantics differ from draft's ExitCodeConfig.
type ReviewInteractiveConfig ¶ added in v1.1.0
type ReviewInteractiveConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Editor string `yaml:"editor" mapstructure:"editor"` // "" means use $EDITOR
}
ReviewInteractiveConfig controls the review TUI.
type SamplingConfig ¶ added in v1.1.0
type SamplingConfig struct {
// Mode: "smart" (25 recent + 25 oldest), "all", "recent".
Mode string `yaml:"mode" mapstructure:"mode"`
// Limit caps the number of docs sent to the AI in a single call.
Limit int `yaml:"limit" mapstructure:"limit"`
}
SamplingConfig controls how many docs are passed to the AI per review call.
type ScoringConfig ¶ added in v1.1.0
type ScoringConfig struct {
// Profile: "auto" (select by doc type), "strict", "free-form".
Profile string `yaml:"profile" mapstructure:"profile"`
// ShowBreakdown prints the per-category point breakdown in verbose mode.
ShowBreakdown bool `yaml:"show_breakdown" mapstructure:"show_breakdown"`
// FailBelow sets a minimum score threshold. Documents scoring below this
// cause draft to exit non-zero. 0 means "never fail on score".
FailBelow int `yaml:"fail_below" mapstructure:"fail_below"`
}
ScoringConfig tunes the scoring profile and failure threshold.
type SynthesizersConfig ¶ added in v1.2.0
type SynthesizersConfig struct {
// Enabled is the ordered list of synthesizer names to activate. Empty
// means the framework runs zero synthesizers - safe default pre-8-18.
// Post-8-18 default becomes ["api-postman"].
Enabled []string `yaml:"enabled" mapstructure:"enabled"`
// WellKnownServerFields is the list of field names treated as server-
// injected by default when a doc's Security section is missing (I5-bis
// degraded mode). Editable per-project; additions tighten the fail-safe
// filter.
//
// Matching is EXACT-STRING only - a listed name like "tenantId" does
// not filter a close-but-different field like "tenantIdFormatted". The
// design choice favors predictability (users see exactly what is
// filtered, no surprise) over recall. Projects that need substring
// filtering can either add every variant explicitly or declare a
// Security section in the doc and rely on I5 strict projection.
WellKnownServerFields []string `yaml:"well_known_server_fields" mapstructure:"well_known_server_fields"`
// PerSynthesizer carries synthesizer-specific options keyed by
// synthesizer Name. Unknown keys are ignored by design - lets config
// reference options for synthesizers that ship in later binaries.
PerSynthesizer map[string]map[string]any `yaml:"per_synthesizer" mapstructure:"per_synthesizer"`
}
SynthesizersConfig activates and configures the Example Synthesizer family.
type TemplatesConfig ¶
type TemplatesConfig struct {
Dir string `yaml:"dir" mapstructure:"dir"`
}