Help us shape the future of Go! Take the 2026 Go Developer Survey

reqdelta

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

ENGMODEL-OWNER-UNIT: FU-MODEL-CHANGE

ENGMODEL-OWNER-UNIT: FU-MODEL-CHANGE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequirementsDelta

type RequirementsDelta struct {
	Version      int                         `yaml:"version"`
	Requirements RequirementsDeltaOperations `yaml:"requirements"`
}

RequirementsDelta describes stable-ID operations against requirements.yml. Updates replace the complete requirement entity. ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

type RequirementsDeltaOperations

type RequirementsDeltaOperations struct {
	Add    []model.Requirement `yaml:"add"`
	Update []model.Requirement `yaml:"update"`
	Remove []string            `yaml:"remove"`
}

RequirementsDeltaOperations groups supported requirement mutations. ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DELTA

type RequirementsDeltaResult

type RequirementsDeltaResult struct {
	Candidate   model.RequirementsDocument
	YAML        []byte
	Diff        string
	Added       []string
	Updated     []string
	Removed     []string
	Diagnostics []validate.Diagnostic
}

RequirementsDeltaResult is the validated candidate and deterministic change summary. ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

func ApplyRequirementsDelta

func ApplyRequirementsDelta(root, deltaPath string) (result RequirementsDeltaResult, err error)

ApplyRequirementsDelta validates and atomically writes a requirements delta. TRLC-LINKS: REQ-EMG-031, REQ-EMG-032, REQ-EMG-033 ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-MODEL-LOADER, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT, DEP-LOCAL-WORKSPACE

func PlanRequirementsDelta

func PlanRequirementsDelta(root, deltaPath string) (RequirementsDeltaResult, error)

PlanRequirementsDelta loads a delta, applies it in memory, and validates the complete candidate. It never modifies requirements.yml. TRLC-LINKS: REQ-EMG-031, REQ-EMG-032 ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-MODEL-LOADER, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

type SpecDeltaOperation added in v0.6.0

type SpecDeltaOperation string

SpecDeltaOperation names the OpenSpec delta section to render.

const (
	// SpecDeltaAdded renders "## ADDED Requirements" (the default).
	SpecDeltaAdded SpecDeltaOperation = "ADDED"
	// SpecDeltaModified renders "## MODIFIED Requirements".
	SpecDeltaModified SpecDeltaOperation = "MODIFIED"
)

type SpecDeltaOptions added in v0.6.0

type SpecDeltaOptions struct {
	IDs        []string
	Prefix     string
	Capability string
	Operation  SpecDeltaOperation
}

SpecDeltaOptions selects the requirements to render: IDs (in model order) or every requirement whose ID starts with Prefix; at least one is required. Capability, when set, adds a "# <capability> spec delta" heading. ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DOCUMENT

type SpecDeltaResult added in v0.6.0

type SpecDeltaResult struct {
	Markdown string
	IDs      []string
	Warnings []string
}

SpecDeltaResult is the rendered OpenSpec spec delta: the markdown, the rendered requirement IDs in order and warnings about requirements whose output needs attention (no SHALL/MUST, no verificationCriteria). ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DOCUMENT

func RenderSpecDelta added in v0.6.0

func RenderSpecDelta(requirements []model.Requirement, options SpecDeltaOptions) (SpecDeltaResult, error)

RenderSpecDelta renders OpenSpec spec delta markdown from model requirements: per requirement a "### Requirement:" heading (title, else ID), the line "<ID>: <model text>" with shall and must capitalized and whitespace collapsed - so it starts with the model text under the normalization the engineering-flow consistency check applies - and one scenario built from verificationCriteria (WHEN/THEN when the criteria have that shape, else WHEN the requirement is verified / THEN the criteria). TRLC-LINKS: REQ-EMG-081 ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DOCUMENT

func RenderSpecDeltaFromModel added in v0.6.0

func RenderSpecDeltaFromModel(manifestPath string, options SpecDeltaOptions) (SpecDeltaResult, error)

RenderSpecDeltaFromModel loads the requirements of the model at manifestPath (engmod.yml) and renders them with RenderSpecDelta. TRLC-LINKS: REQ-EMG-081 ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-MODEL-LOADER, DO-REQUIREMENTS-DOCUMENT

Jump to

Keyboard shortcuts

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