harness

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HarnessContextV1Version = "1.0.0"
	HarnessPlanV1Version    = "1.0.0"
)

Variables

This section is empty.

Functions

func ComputeHarnessContextHash

func ComputeHarnessContextHash(context *HarnessContextV1) (string, error)

func WriteHarnessContextV1

func WriteHarnessContextV1(path string, context *HarnessContextV1) error

func WriteHarnessPlanV1

func WriteHarnessPlanV1(path string, plan *HarnessPlanV1) error

Types

type AmbiguousResolution

type AmbiguousResolution struct {
	CaseID         string  `json:"case_id"`
	Classification string  `json:"classification"`
	Decision       string  `json:"decision"`
	Rationale      string  `json:"rationale"`
	Confidence     float64 `json:"confidence"`
}

type CandidateDecision

type CandidateDecision struct {
	GroupID    string  `json:"group_id"`
	Decision   string  `json:"decision"`
	Rationale  string  `json:"rationale"`
	Confidence float64 `json:"confidence"`
}

type ContextAmbiguousCase

type ContextAmbiguousCase struct {
	Type             string   `json:"type,omitempty"`
	Summary          string   `json:"summary,omitempty"`
	Reason           string   `json:"reason,omitempty"`
	RawSQLExcerpt    string   `json:"raw_sql_excerpt,omitempty"`
	Context          string   `json:"context,omitempty"`
	CaseID           string   `json:"case_id"`
	MigrationID      string   `json:"migration_id"`
	RiskLevel        string   `json:"risk_level"`
	AllowedDecisions []string `json:"allowed_decisions"`
}

type ContextConfigSnapshot

type ContextConfigSnapshot struct {
	SafetyLevel    string `json:"safety_level,omitempty"`
	ValidationMode string `json:"validation_mode,omitempty"`
}

type ContextDependencyEdge

type ContextDependencyEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
	Type string `json:"type,omitempty"`
}

type ContextDependencyGraph

type ContextDependencyGraph struct {
	Nodes  []ContextDependencyNode `json:"nodes"`
	Edges  []ContextDependencyEdge `json:"edges"`
	Cycles [][]string              `json:"cycles,omitempty"`
}

type ContextDependencyNode

type ContextDependencyNode struct {
	ID   string `json:"id"`
	Kind string `json:"kind,omitempty"`
}

type ContextMetrics

type ContextMetrics struct {
	OriginalFileCount      int    `json:"original_file_count,omitempty"`
	OriginalStatementCount int    `json:"original_statement_count,omitempty"`
	DataOperationCount     int    `json:"data_operation_count,omitempty"`
	ObjectsConsolidated    int    `json:"objects_consolidated,omitempty"`
	WarningsCount          int    `json:"warnings_count,omitempty"`
	ProcessingTime         string `json:"processing_time,omitempty"`
}

type ContextMigrationNode

type ContextMigrationNode struct {
	MigrationID        string   `json:"migration_id"`
	Sequence           int      `json:"sequence"`
	Checksum           string   `json:"checksum,omitempty"`
	OperationTypes     []string `json:"operation_types,omitempty"`
	AffectedObjects    []string `json:"affected_objects,omitempty"`
	SemanticOperations []string `json:"semantic_operations,omitempty"`
	DependsOn          []string `json:"depends_on,omitempty"`
	Reversible         bool     `json:"reversible"`
	SquashSafe         bool     `json:"squash_safe"`
	RiskFlags          []string `json:"risk_flags,omitempty"`
}

type ContextSchemaObject

type ContextSchemaObject struct {
	ID   string `json:"id"`
	Kind string `json:"kind"`
}

type ContextSchemaState

type ContextSchemaState struct {
	SchemaSQLPath  string                `json:"schema_sql_path,omitempty"`
	SchemaSQLHash  string                `json:"schema_sql_hash,omitempty"`
	StatementCount int                   `json:"statement_count,omitempty"`
	ObjectCount    int                   `json:"object_count,omitempty"`
	Objects        []ContextSchemaObject `json:"objects,omitempty"`
	Extensions     []string              `json:"extensions,omitempty"`
}

type ContextSquashCandidate

type ContextSquashCandidate struct {
	GroupID        string   `json:"group_id"`
	MigrationIDs   []string `json:"migration_ids,omitempty"`
	Confidence     string   `json:"confidence,omitempty"`
	Reason         string   `json:"reason,omitempty"`
	BlockedBy      []string `json:"blocked_by,omitempty"`
	AllowedActions []string `json:"allowed_actions"`
}

type ContextWorkspace

type ContextWorkspace struct {
	ProjectRoot      string `json:"project_root,omitempty"`
	OutputDirectory  string `json:"output_directory,omitempty"`
	OriginalFileRoot string `json:"original_file_root,omitempty"`
	FileCount        int    `json:"file_count,omitempty"`
	WorkspaceHash    string `json:"workspace_hash,omitempty"`
}

type HarnessContextV1

type HarnessContextV1 struct {
	ContextVersion        string                   `json:"context_version"`
	GeneratedAt           time.Time                `json:"generated_at"`
	EngineVersion         string                   `json:"engine_version"`
	ContextHash           string                   `json:"context_hash"`
	Workspace             ContextWorkspace         `json:"workspace"`
	ConfigSnapshot        ContextConfigSnapshot    `json:"config_snapshot"`
	SchemaState           ContextSchemaState       `json:"schema_state"`
	MigrationChain        []ContextMigrationNode   `json:"migration_chain"`
	DependencyGraph       ContextDependencyGraph   `json:"dependency_graph"`
	SquashCandidates      []ContextSquashCandidate `json:"squash_candidates"`
	AmbiguousCases        []ContextAmbiguousCase   `json:"ambiguous_cases"`
	DeterministicWarnings []string                 `json:"deterministic_warnings,omitempty"`
	Metrics               ContextMetrics           `json:"metrics"`
}

func LoadHarnessContextV1

func LoadHarnessContextV1(path string) (*HarnessContextV1, error)

type HarnessPlanModel

type HarnessPlanModel struct {
	Provider string `json:"provider"`
	Model    string `json:"model"`
}

type HarnessPlanV1

type HarnessPlanV1 struct {
	PlanVersion           string                   `json:"plan_version"`
	ContextVersion        string                   `json:"context_version"`
	ContextHash           string                   `json:"context_hash"`
	GeneratedAt           time.Time                `json:"generated_at"`
	Model                 HarnessPlanModel         `json:"model"`
	CandidateDecisions    []CandidateDecision      `json:"candidate_decisions"`
	AmbiguousResolutions  []AmbiguousResolution    `json:"ambiguous_resolutions"`
	GlobalRecommendations []string                 `json:"global_recommendations"`
	RequiresHumanReview   []HumanReviewRequirement `json:"requires_human_review"`
}

func LoadHarnessPlanV1

func LoadHarnessPlanV1(path string) (*HarnessPlanV1, error)

type HumanReviewRequirement

type HumanReviewRequirement struct {
	ID         string  `json:"id"`
	Reason     string  `json:"reason"`
	Confidence float64 `json:"confidence"`
	RiskLevel  string  `json:"risk_level"`
}

type PlanValidationIssue

type PlanValidationIssue struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Field   string `json:"field,omitempty"`
	ItemID  string `json:"item_id,omitempty"`
}

type PlanValidationOptions

type PlanValidationOptions struct {
	ConfidenceThreshold         float64
	RequireCriticalManualReview bool
}

type PlanValidationResult

type PlanValidationResult struct {
	Valid    bool                  `json:"valid"`
	Errors   []PlanValidationIssue `json:"errors"`
	Warnings []PlanValidationIssue `json:"warnings"`
}

func ValidateHarnessPlanV1

func ValidateHarnessPlanV1(plan *HarnessPlanV1, context *HarnessContextV1, options *PlanValidationOptions) (*PlanValidationResult, error)

Jump to

Keyboard shortcuts

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