Internal

internal/adapters/cli/review

Package review selects review providers and pass agendas for the CLI adapter.

import "github.com/nilstate/scafld/v2/internal/adapters/cli/review"

Package review selects review providers and pass agendas for the CLI adapter.

Functions

func BuildInput(opts InputOptions, selected Selection) appreview.Input

Source: internal/adapters/cli/review/options.go:26

BuildInput maps CLI selection and flags to the app-layer review input.

func FirstNonEmpty(values ...string) string

Source: internal/adapters/cli/review/options.go:82

FirstNonEmpty returns the first non-blank value.

func ModeFromValue(mode string) corereview.Mode

Source: internal/adapters/cli/review/options.go:52

ModeFromValue resolves the CLI mode value into the provider review mode.

func PositiveInt(value string) int

Source: internal/adapters/cli/review/options.go:61

PositiveInt parses non-negative integer CLI values. Invalid values use the unset value because review budgets are advisory, not gate inputs.

func PositiveOrDefault(value int, fallback int) int

Source: internal/adapters/cli/review/options.go:74

PositiveOrDefault returns fallback when value is unset.

func PrintHelp(w io.Writer)

Source: internal/adapters/cli/review/help.go:9

PrintHelp writes command-specific review help.

func Select(ctx context.Context, opts Options) (Selection, error)

Source: internal/adapters/cli/review/selection.go:52

Select loads config, applies CLI overrides, and returns a review provider.

func SplitScope(value string) []string

Source: internal/adapters/cli/review/scope.go:6

SplitScope parses comma-separated review scope paths.

Types

type InputOptions

Source: internal/adapters/cli/review/options.go:12

InputOptions carries CLI review flags into the app input assembler.

type InputOptions struct {
	TaskID          string
	Mode            string
	ReviewScope     string
	MaxFindings     string
	MinAttackAngles string
	ReviewDepth     string
	ForceReview     bool
	PrintContext    bool
	HumanReviewed   bool
	Reason          string
}
Fields
  • TaskID string
  • Mode string
  • ReviewScope string
  • MaxFindings string
  • MinAttackAngles string
  • ReviewDepth string
  • ForceReview bool
  • PrintContext bool
  • HumanReviewed bool
  • Reason string

type Options

Source: internal/adapters/cli/review/selection.go:25

Options configures review-provider selection for the CLI.

type Options struct {
	Root            string
	TaskID          string
	Provider        string
	Command         string
	ProviderBinary  string
	Model           string
	DiagnosticsPath string
	Progress        io.Writer
	PrintContext    bool
}
Fields
  • Root string
  • TaskID string
  • Provider string
  • Command string
  • ProviderBinary string
  • Model string
  • DiagnosticsPath string
  • Progress io.Writer
  • PrintContext bool

type Selection

Source: internal/adapters/cli/review/selection.go:38

Selection is the provider and review agenda chosen for a review run.

type Selection struct {
	Provider                appreview.Provider
	ProviderName            string
	ProviderModel           string
	Passes                  []appreview.Pass
	Invariants              map[string]string
	ContextSections         []reviewcontext.Section
	ContextMaxBytes         int
	RequiredContextMaxBytes int
	Contract                corecontract.Contract
	Dossier                 configadapter.ReviewDossierConfig
}
Fields
  • Provider appreview.Provider
  • ProviderName string
  • ProviderModel string
  • Passes []appreview.Pass
  • Invariants map[string]string
  • ContextSections []reviewcontext.Section
  • ContextMaxBytes int
  • RequiredContextMaxBytes int
  • Contract corecontract.Contract
  • Dossier configadapter.ReviewDossierConfig