workflow

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 23 Imported by: 0

Documentation

Overview

Package workflow implements the CEM producer/verifier operations — begin, prepare, cite, mark, status, verify, and report — over the CEM seams, with the frozen CEM-CB envelope table, validation precedence, and resume rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeginOptions

type BeginOptions struct {
	PatchPath string // out-of-band patch input; absolute or root-relative
	Base      string // revision; empty means HEAD
	Output    string // required root-relative map output
}

BeginOptions configure the low-level exact-patch producer entry.

type CiteOptions

type CiteOptions struct {
	MapPath      string
	Hunk         string
	EvidencePath string
	Bytes        string // START:END zero-based byte span
	Lines        string // START:END one-based inclusive line span
	Relation     string
	Output       string // optional root-relative output; empty rewrites in place
}

CiteOptions attach one evidence span to one hunk.

type MarkOptions

type MarkOptions struct {
	MapPath     string
	Hunk        string
	Disposition string
	Reason      string
	Output      string
}

MarkOptions set one hunk's explicit unknown or mechanical disposition.

type PolicyLimits

type PolicyLimits struct {
	MaxUnknown    *int
	MaxMechanical *int
}

PolicyLimits are optional disposition-count ceilings.

type PrepareOptions

type PrepareOptions struct {
	Base    string // required independent producer baseline
	Target  string // required code revision
	MapPath string // must be empty or the frozen default
	Cache   string // optional root-relative convenience-cache selection
	Replace bool
}

PrepareOptions configure candidate generation.

type ReadOptions

type ReadOptions struct {
	MapPath      string
	PatchPath    string // 0.1 only: explicit out-of-band patch
	PatchGiven   bool   // whether --patch appeared at all
	ExpectedBase string
	Target       string
	Limits       PolicyLimits
	Output       string // report only
}

ReadOptions configure status, verify, and report.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is one opened worktree root; the repository boundary is validated separately by openRepository at its frozen precedence position.

func Open

func Open(root string) (*Session, error)

Open validates the worktree root as a publication root only. Repository validation (precedence stages 5–6) is deferred to openRepository so each command judges argument and map validation (stages 1–4) first.

func (*Session) Begin

func (s *Session) Begin(ctx context.Context, options BeginOptions) (map[string]any, error)

Begin builds a cem/0.1 candidate from exact out-of-band patch bytes.

func (*Session) Cite

func (s *Session) Cite(ctx context.Context, options CiteOptions) (map[string]any, error)

Cite compiles the requested span into the normative byte span and records the typed evidence reference, preserving the input profile.

func (*Session) Mark

func (s *Session) Mark(ctx context.Context, options MarkOptions) (map[string]any, error)

Mark records an explicit unknown or mechanical disposition and prunes evidence left uncited, preserving the input profile.

func (*Session) Prepare

func (s *Session) Prepare(ctx context.Context, options PrepareOptions) (map[string]any, error)

Prepare derives the canonical patch and writes or resumes the candidate map. It ignores target-side sidecar state entirely: candidate generation precedes the commit that creates the final revision.

func (*Session) Read

func (s *Session) Read(ctx context.Context, action string, options ReadOptions) (map[string]any, error)

Read runs one of the three verification-consuming commands. The action is "status", "verify", or "report"; rendering is not a second trust path.

Jump to

Keyboard shortcuts

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