Internal

internal/adapters/cli/finalize

Package finalize composes the scafld finalize CLI boundary.

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

Package finalize composes the scafld finalize CLI boundary.

Functions

func Handler(stdin io.Reader) func(context.Context, []string, io.Writer, io.Writer) int

Source: internal/adapters/cli/finalize/run.go:48

Handler returns a CLI-compatible handler for the host-facing finalize command.

func Run(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer) error

Source: internal/adapters/cli/finalize/run.go:93

Run handles the public scafld finalize <task_id> command and the scafld finalize --json --stdin child process invoked by the finalize MCP transport. It composes deterministic snapshot, acceptance, and signing adapters around the accepted review evidence already sealed in the session ledger, then persists the signed receipt and archives the matching spec.

Types

type Request

Source: internal/adapters/cli/finalize/run.go:81

Request is the finalize stdin payload sent by the MCP transport.

type Request struct {
	TaskID    string   `json:"task_id"`
	Root      string   `json:"root,omitempty"`
	BaseRef   string   `json:"base_ref,omitempty"`
	ScopeHint []string `json:"scope_hint,omitempty"`
}
Fields
  • TaskID string `json:"task_id"`
  • Root string `json:"root,omitempty"`
  • BaseRef string `json:"base_ref,omitempty"`
  • ScopeHint []string `json:"scope_hint,omitempty"`