Internal

internal/core/hardengate

Package hardengate projects draft hardening evidence into the single state used by harden, approve, status, and handoff surfaces.

import "github.com/nilstate/scafld/v2/internal/core/hardengate"

Package hardengate projects draft hardening evidence into the single state used by harden, approve, status, and handoff surfaces.

Constants

Source: internal/core/hardengate/projection.go:16

const (
	KindNotRun                Kind = "not_run"
	KindRoundOpen             Kind = "round_open"
	KindNeedsOperatorDecision Kind = "needs_operator_decision"
	KindPassed                Kind = "passed"
	KindStaleAfterDraft       Kind = "stale_after_draft"
	KindOverridden            Kind = "overridden"
	KindError                 Kind = "error"
	KindInvalid               Kind = "invalid"
)

Functions

func ApproveCommand(taskID string) string

Source: internal/core/hardengate/projection.go:189

ApproveCommand formats the approval command.

func HardenCommand(taskID string) string

Source: internal/core/hardengate/projection.go:194

HardenCommand formats the harden command.

func LatestRound(model spec.Model) (spec.HardenRound, bool)

Source: internal/core/hardengate/projection.go:175

LatestRound returns the latest harden round when present.

func MarkPassedCommand(taskID string) string

Source: internal/core/hardengate/projection.go:209

MarkPassedCommand formats the manual harden close command.

func NeedsRevisionFollowUp(taskID string, provider bool) string

Source: internal/core/hardengate/projection.go:214

NeedsRevisionFollowUp formats the operator decision prompt after findings.

func Project(model spec.Model) State

Source: internal/core/hardengate/projection.go:47

Project reduces the current draft spec into harden gate state. The latest harden round is authoritative; top-level harden_status is treated as a projection that may be stale.

func RepairPacketCommand(taskID string, path string) string

Source: internal/core/hardengate/projection.go:200

RepairPacketCommand records a locally repaired HardenDossier without spending another external harden call.

func SameDraft(round spec.HardenRound, digest string) bool

Source: internal/core/hardengate/projection.go:184

SameDraft reports whether round was recorded against digest. Legacy rounds without a digest are never considered same-draft provider-blocking evidence.

Types

type Kind

Source: internal/core/hardengate/projection.go:13

Kind is the stable harden gate projection state.

type Kind string

type State

Source: internal/core/hardengate/projection.go:27

State is the single read model for draft hardening decisions.

type State struct {
	Kind                   Kind
	TaskID                 string
	Reason                 string
	Next                   string
	CurrentDigest          string
	LatestRound            spec.HardenRound
	HasRound               bool
	SameDraft              bool
	CanOpenRound           bool
	CanStartProvider       bool
	ProviderRerunBlocked   bool
	ApprovalReasonRequired bool
	Evidence               []string
	Blockers               []string
}
Fields
  • Kind Kind
  • TaskID string
  • Reason string
  • Next string
  • CurrentDigest string
  • LatestRound spec.HardenRound
  • HasRound bool
  • SameDraft bool
  • CanOpenRound bool
  • CanStartProvider bool
  • ProviderRerunBlocked bool
  • ApprovalReasonRequired bool
  • Evidence []string
  • Blockers []string