authoringop

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package authoringop owns semantic part resolution, complete candidate validation, confined source publication, and ordinary leased synchronization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePart

func ResolvePart(state *project.ProjectState, cfg *config.Config, kind, name, part string) (project.AuthoringTarget, error)

ResolvePart delegates semantic kind, catalog/configured name, and capability resolution to the project and configuration authorities.

func ResolveSidecar

func ResolveSidecar(state *project.ProjectState, cfg *config.Config, kind, name, field string) (project.AuthoringTarget, error)

Types

type LeaseAcquirer

type LeaseAcquirer func(context.Context, string) (*filesystem.Lease, func() error, error)

LeaseAcquirer is the narrow operation dependency used to retain the complete project lease and directly inject release faults without mutable globals.

type Mode

type Mode string

Mode is one closed part-authoring operation.

const (
	Edit  Mode = "edit"
	Reset Mode = "reset"
)

type Outcome

type Outcome struct {
	Kind, Name, Part string
	SourcePath       string
	Source           SourceEffect
	CreatedParents   []string
	Residue          []string
	Publisher        publisher.Result
}

Outcome retains authoring-owned source/setup effects separately from the Publisher-owned synchronization result.

func Run

func Run(ctx context.Context, root string, request Request, loader *project.Loader, acquire LeaseAcquirer) (Outcome, error)

Run executes one complete semantic authoring transaction.

func (Outcome) Document

func (o Outcome) Document() (presentation.Document, error)

Document maps a complete semantic result to the common presentation tree.

type PartialError

type PartialError struct {
	Outcome  Outcome
	Cause    error
	Recovery []string
}

PartialError retains every committed axis and the original typed cause.

func AsPartial

func AsPartial(err error) (*PartialError, bool)

AsPartial returns a retained partial outcome when err carries one.

func (*PartialError) Document

func (e *PartialError) Document() (presentation.Document, error)

Document maps a typed partial result to residue-first recovery guidance.

func (*PartialError) Error

func (e *PartialError) Error() string

func (*PartialError) Unwrap

func (e *PartialError) Unwrap() error

type Request

type Request struct {
	Mode             Mode
	Kind, Name, Part string
	Content          []byte
	// Sidecar selects a configuration-owned sidecar leaf. SidecarMode is value,
	// add, remove, or reset; Value is already typed by the CLI boundary.
	Sidecar     bool
	SidecarMode string
	Value       any
}

Request identifies one semantic part. Content is meaningful only for Edit; its empty value is a valid explicit authored override.

type SourceEffect

type SourceEffect string

SourceEffect identifies the authored source effect that committed.

const (
	SourceNone      SourceEffect = "none"
	SourceCreated   SourceEffect = "created"
	SourceReplaced  SourceEffect = "replaced"
	SourceRemoved   SourceEffect = "removed"
	SourceLocalBody SourceEffect = "local-body-replaced"
)

Jump to

Keyboard shortcuts

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