management

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 35 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package management defines the UI-independent OpenRealtime management-plane contracts. Browser, native, headless, and third-party inspectors consume the same versioned HTTP API; no view or gateway implementation is part of these interfaces.

Index

Constants

View Source
const (
	// CapabilityHeader carries a narrow management capability. Capabilities are
	// never accepted in URLs, where access logs and referrers can retain them.
	CapabilityHeader = "OpenRealtime-Management-Token"

	APIPrefix = "/openrealtime/v1"
)
View Source
const (

	// MaximumCapabilityTTL is the longest bearer lifetime accepted by the
	// in-memory authority. Callers should normally choose a much shorter,
	// session-scoped lifetime.
	MaximumCapabilityTTL = 24 * time.Hour
)
View Source
const SourceReadFormatVersion uint64 = 1

SourceReadFormatVersion identifies the rooted read request/result schema.

View Source
const SourceWriteFormatVersion uint64 = 1

SourceWriteFormatVersion identifies the request and receipt wire schema.

View Source
const ValuesSchemaResourceFormatVersion uint64 = 1

Variables

View Source
var (
	HTTPRoutesContract = semanticContract(
		"openrealtime.management.http_routes",
		"openrealtime/management/http-routes/v1:Register(owner,routes)->dispose",
	)
	HTTPHandlerContract = semanticContract(
		"openrealtime.management.http_handler",
		"openrealtime/management/http-handler/v1:http.Handler",
	)
	AuthorizerContract = semanticContract(
		"openrealtime.management.authorizer",
		"openrealtime/management/authorizer/v1:Authorize(capability,operation,resource)",
	)
	StaticCatalogContract = semanticContract(
		"openrealtime.management.static_catalog",
		"openrealtime/management/static-catalog/v1:graph-element-plugin-values-schema-by-immutable-identity",
	)
	SessionInspectionContract = semanticContract(
		"openrealtime.management.session_inspection",
		"openrealtime/management/session-inspection/v1:live-static-model-deltas-trace-by-session-cursor",
	)
	AuthoringContract = semanticContractRevision(
		"openrealtime.management.authoring",
		5,
		"openrealtime/management/authoring/v5:analyze-compile-render-and-canonical-ortg-yaml-json-rename-remove-create-edge-bounded-documents",
	)
	SourceReadingContract = semanticContract(
		"openrealtime.management.source_reading",
		"openrealtime/management/source-reading/v1:root-identity-path-bounded-utf8-result-digest",
	)
	SourcePublicationContract = semanticContract(
		"openrealtime.management.source_publication",
		"openrealtime/management/source-publication/v1:root-identity-create-update-stale-digest-atomic-receipt",
	)
	ReconciliationContract = semanticContract(
		"openrealtime.management.reconciliation",
		"openrealtime/management/reconciliation/v1:validate-premount-safe-point-swap-receipt",
	)
)
View Source
var (
	ErrNotFound     = errors.New("management resource not found")
	ErrUnauthorized = errors.New("management capability not authorized")
	ErrInvalid      = errors.New("invalid management request")
	ErrConflict     = errors.New("management resource conflict")
	ErrUnavailable  = errors.New("management service unavailable")
)

Functions

func CanonicalDigest

func CanonicalDigest(value string) bool

CanonicalDigest reports whether value is a lowercase, canonical SHA-256 content identity.

func CanonicalSessionID

func CanonicalSessionID(value string) bool

CanonicalSessionID reports whether value is safe as one opaque management resource segment. It deliberately rejects separators instead of trying to assign filesystem or URL semantics to a session identifier.

func RedactLive

func RedactLive(snapshot inspect.Live) inspect.Live

RedactLive removes free-form and item identifiers that can inherit request payload while retaining exact graph, configuration, runtime, queue, timing, closed categorical authority-decision and semantic-cause evidence, and direct causal topology. Flow-stage item and parent identities become snapshot-local pseudonyms. It is safe to apply more than once.

func ValidateAnalysisResult

func ValidateAnalysisResult(input AuthoringDocument, result AnalysisResult) error

ValidateAnalysisResult binds an untrusted authoring provider response to the exact source request and validates its bounded immutable editor metadata.

func ValidateCompileResult

func ValidateCompileResult(input AuthoringDocument, result CompileResult) error

ValidateCompileResult keeps recovery artifacts outside the mutation path and admits only independently valid immutable Graph IR plus a valid lock.

func ValidateCreateDocumentEdgeRequest

func ValidateCreateDocumentEdgeRequest(input CreateDocumentEdgeRequest) error

ValidateCreateDocumentEdgeRequest admits one named connection between exact declared nodes in a canonical in-memory .ortg or normalized YAML/JSON predecessor. The immutable predecessor fingerprint is recompiled and checked by AuthoringEngine.

func ValidateCreateDocumentEdgeResult

func ValidateCreateDocumentEdgeResult(
	input CreateDocumentEdgeRequest, result CreateDocumentEdgeResult,
) error

ValidateCreateDocumentEdgeResult proves the exact canonical syntax change and binds the response to both predecessor and compiler-produced candidate fingerprints. Catalog-dependent compilation remains the engine's duty.

func ValidateDeltaPage

func ValidateDeltaPage(session string, after uint64, limit uint32, page DeltaPage) error

ValidateDeltaPage verifies a bounded response against the request that selected it. Event payload structure is subsequently covered by the trace package when a complete recording is exported; this boundary additionally prevents cursor and resource substitution.

func ValidateInspectionModel

func ValidateInspectionModel(model inspect.Model) error

ValidateInspectionModel bounds and verifies the source-free static model returned under a session capability. It intentionally accepts only the frontend-neutral projection, never authoring source locations or values.

func ValidateReconciliationReceipt

func ValidateReconciliationReceipt(
	request ReconciliationRequest, receipt ReconciliationReceipt,
) error

ValidateReconciliationReceipt binds a mutation receipt to the exact request reviewed by the caller and rejects payload-shaped state or rollback identities before a provider result crosses the management boundary.

func ValidateReconciliationRequest

func ValidateReconciliationRequest(request ReconciliationRequest) error

ValidateReconciliationRequest verifies the complete immutable identity set selected by a reconciliation caller. StateMigration is an opaque policy or migrator identity, but it is still bounded canonical evidence rather than a payload or credential channel.

func ValidateRemoveDocumentEdgeRequest

func ValidateRemoveDocumentEdgeRequest(input RemoveDocumentEdgeRequest) error

ValidateRemoveDocumentEdgeRequest admits one unique edge from canonical, in-memory .ortg or normalized YAML/JSON source. Resolution, channel overrides, filesystem roots, and deployment state are deliberately outside this pure topology mutation.

func ValidateRemoveDocumentEdgeResult

func ValidateRemoveDocumentEdgeResult(
	input RemoveDocumentEdgeRequest, result RemoveDocumentEdgeResult,
) error

ValidateRemoveDocumentEdgeResult independently proves that the returned edit removes exactly the selected edge statement and its attached comments while preserving the canonical formatting of every remaining syntax statement.

func ValidateRenameDocumentRequest

func ValidateRenameDocumentRequest(input RenameDocumentRequest) error

ValidateRenameDocumentRequest admits only a canonical, in-memory .ortg or normalized YAML/JSON document and one unambiguous node-identifier replacement. Values, locks, filesystem roots, and deployment data are deliberately outside this pure operation.

func ValidateRenameDocumentResult

func ValidateRenameDocumentResult(input RenameDocumentRequest, result RenameDocumentResult) error

ValidateRenameDocumentResult independently proves that the returned edits perform exactly the requested graph-wide node rename and no other source mutation. It does not require an element catalog because node declarations, edge endpoints, and graph boundaries are syntax-level facts.

func ValidateSessionModel

func ValidateSessionModel(snapshot inspect.Live, model inspect.Model) error

ValidateSessionModel proves that one static model describes exactly the graph and node contracts named by the accompanying live snapshot.

func ValidateSessionSnapshot

func ValidateSessionSnapshot(snapshot inspect.Live) error

ValidateSessionSnapshot checks the identity-bearing evidence required at a public management boundary. Free-form fields are permitted here because a provider may validate before redaction; callers must still apply RedactLive before returning a snapshot to an inspector.

func ValidateSourceReadRequest

func ValidateSourceReadRequest(request SourceReadRequest) error

ValidateSourceReadRequest validates the complete rooted lookup envelope without opening a filesystem path or granting authority.

func ValidateSourceReadResult

func ValidateSourceReadResult(request SourceReadRequest, result SourceReadResult) error

ValidateSourceReadResult binds an untrusted provider response to the exact request, source bytes, and deterministic result digest.

func ValidateSourceWriteReceipt

func ValidateSourceWriteReceipt(request SourceWriteRequest, receipt SourceWriteReceipt) error

ValidateSourceWriteReceipt rebinds a payload-free receipt to the exact request and recomputes its tamper-evident digest.

func ValidateSourceWriteRequest

func ValidateSourceWriteRequest(request SourceWriteRequest) error

ValidateSourceWriteRequest validates the complete mutation envelope without reading a filesystem or granting authority.

Types

type Access

type Access struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
	Grants    []Grant   `json:"grants"`
}

type AnalysisResult

type AnalysisResult struct {
	SourceDigest string                  `json:"source_digest"`
	Parsed       bool                    `json:"parsed"`
	Recovered    bool                    `json:"recovered"`
	Canonical    bool                    `json:"canonical"`
	Diagnostics  editor.DiagnosticReport `json:"diagnostics"`
	Catalog      editor.MetadataReport   `json:"catalog"`
	Formatting   *editor.EditSet         `json:"formatting,omitempty"`
}

type AuthoringDocument

type AuthoringDocument struct {
	Path         string         `json:"path"`
	Source       string         `json:"source"`
	Lock         *resolve.Lock  `json:"lock,omitempty"`
	ChannelDepth map[string]int `json:"channel_depth,omitempty"`
	Revision     uint64         `json:"revision,omitempty"`
}

AuthoringDocument is in-memory source. Management services never infer a filesystem authority from Path and never write it directly.

type AuthoringEdgeEndpoint

type AuthoringEdgeEndpoint struct {
	Node string `json:"node"`
	Port string `json:"port"`
}

type AuthoringEngine

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

AuthoringEngine is a pure bounded implementation of the management authoring service. It reads no files unless the deployment explicitly supplies a constrained SourceLoader and it never writes source.

func NewAuthoringEngine

func NewAuthoringEngine(options AuthoringOptions) (*AuthoringEngine, error)

func (*AuthoringEngine) Analyze

func (engine *AuthoringEngine) Analyze(
	ctx context.Context, input AuthoringDocument,
) (AnalysisResult, error)

func (*AuthoringEngine) Compile

func (engine *AuthoringEngine) Compile(
	ctx context.Context, input AuthoringDocument,
) (CompileResult, error)

func (*AuthoringEngine) CreateEdge

func (*AuthoringEngine) RemoveEdge

func (*AuthoringEngine) Rename

func (*AuthoringEngine) Render

func (engine *AuthoringEngine) Render(
	ctx context.Context, input RenderRequest,
) (RenderResult, error)

type AuthoringOptions

type AuthoringOptions struct {
	Catalog        *resolve.Catalog
	Loader         graphcompiler.SourceLoader
	EditorLimits   editor.Limits
	SchemaResolver schema.Resolver
	SchemaLimits   schema.Limits
}

type AuthorizationRequest

type AuthorizationRequest struct {
	Capability string
	Operation  Operation
	Resource   string
}

AuthorizationRequest contains no request payload. Resource is a canonical immutable identity or session ID, never a human prompt or model output.

type Authorizer

type Authorizer interface {
	Authorize(context.Context, AuthorizationRequest) error
}

type CapabilityRegistry

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

CapabilityRegistry is an in-memory narrow-capability authority. It retains only SHA-256 lookup keys; the random bearer is returned exactly once by Issue.

func NewCapabilityRegistry

func NewCapabilityRegistry() *CapabilityRegistry

func (*CapabilityRegistry) Authorize

func (registry *CapabilityRegistry) Authorize(_ context.Context, request AuthorizationRequest) error

func (*CapabilityRegistry) Issue

func (registry *CapabilityRegistry) Issue(ttl time.Duration, grants []Grant) (Access, error)

func (*CapabilityRegistry) IssueScoped

func (registry *CapabilityRegistry) IssueScoped(
	ttl time.Duration, grants []Grant,
) (Access, func(), error)

IssueScoped returns an owner-specific idempotent revoker. The closure holds only the capability lookup key and generation, never the plaintext bearer, so a session can rotate or dispose its authority without retaining the token it already disclosed to its client.

func (*CapabilityRegistry) Revoke

func (registry *CapabilityRegistry) Revoke(token string)

type Catalog

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

Catalog adapts the immutable graph, element, plugin, and values-schema catalogs into one read-only management service. Registered JSON bytes are reparsed on each read so a caller can never mutate catalog state.

func NewCatalog

func NewCatalog(elements *resolve.Catalog, plugins *plugin.Catalog) (*Catalog, error)

func (*Catalog) ElementDescriptor

func (catalog *Catalog) ElementDescriptor(
	_ context.Context, identity element.Identity,
) (element.Descriptor, error)

func (*Catalog) Graph

func (catalog *Catalog) Graph(_ context.Context, fingerprint string) (ir.Graph, error)

func (*Catalog) PluginDescriptor

func (catalog *Catalog) PluginDescriptor(
	_ context.Context, identity plugin.Identity,
) (plugin.Descriptor, error)

func (*Catalog) RegisterGraph

func (catalog *Catalog) RegisterGraph(graph ir.Graph, values schema.Bundle) error

RegisterGraph publishes an exact Graph IR and its separately generated values-schema bundle. A fingerprint can be registered only once, even if a second caller supplies equal bytes, making ownership mistakes visible.

func (*Catalog) ValuesSchema

func (catalog *Catalog) ValuesSchema(_ context.Context, fingerprint string) (schema.Bundle, error)

type CompileResult

type CompileResult struct {
	Graph ir.Graph     `json:"graph"`
	Lock  resolve.Lock `json:"lock"`
}

type CreateDocumentEdgeRequest

type CreateDocumentEdgeRequest struct {
	Document            AuthoringDocument     `json:"document"`
	ExpectedFingerprint string                `json:"expected_fingerprint"`
	Edge                string                `json:"edge"`
	From                AuthoringEdgeEndpoint `json:"from"`
	To                  AuthoringEdgeEndpoint `json:"to"`
	Delivery            string                `json:"delivery"`
}

CreateDocumentEdgeRequest appends one named edge to exact canonical .ortg or normalized YAML/JSON source currently compiled under ExpectedFingerprint. The engine recompiles the candidate at the next revision before returning its edit set.

type CreateDocumentEdgeResult

type CreateDocumentEdgeResult struct {
	Edge                 string         `json:"edge"`
	PreviousFingerprint  string         `json:"previous_fingerprint"`
	CandidateFingerprint string         `json:"candidate_fingerprint"`
	Edits                editor.EditSet `json:"edits"`
}

type DeltaPage

type DeltaPage struct {
	FormatVersion uint64                 `json:"format_version"`
	SessionID     string                 `json:"session_id"`
	Graph         inspect.GraphReference `json:"graph"`
	After         uint64                 `json:"after"`
	Next          uint64                 `json:"next"`
	Compacted     bool                   `json:"compacted,omitempty"`
	Dropped       uint64                 `json:"dropped,omitempty"`
	Baseline      *inspect.TraceSnapshot `json:"baseline,omitempty"`
	Events        []inspect.TraceEvent   `json:"events"`
}

DeltaPage is a bounded resumable recording page. Baseline, Events, and Next share the trace recorder's sequence domain; the independently sampled Live endpoint keeps its own mount sequence. A baseline is included for a new or compacted cursor so replay never has to invent missing state.

type DeploymentAuthorizer

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

DeploymentAuthorizer binds one externally provisioned capability to an immutable grant set. It is intended for process-lifetime operator access: the deployment owns delivery and rotation, while the server retains only the capability's SHA-256 lookup key. Session-scoped capabilities should use CapabilityRegistry instead.

func NewDeploymentAuthorizer

func NewDeploymentAuthorizer(token string, grants []Grant) (*DeploymentAuthorizer, error)

NewDeploymentAuthorizer seals one canonical mgmt_ capability without retaining its plaintext representation.

func (*DeploymentAuthorizer) Authorize

func (authorizer *DeploymentAuthorizer) Authorize(
	_ context.Context, request AuthorizationRequest,
) error

type Grant

type Grant struct {
	Operation Operation `json:"operation"`
	Resource  string    `json:"resource"`
}

type Operation

type Operation string

Operation is the smallest management authority unit. Read capabilities and operator mutation capabilities are intentionally disjoint.

const (
	ReadGraph          Operation = "graph.read"
	ReadDescriptor     Operation = "descriptor.read"
	ReadSchema         Operation = "schema.read"
	ReadSession        Operation = "session.read"
	ReadTrace          Operation = "trace.read"
	AnalyzeDocument    Operation = "authoring.analyze"
	RenameDocument     Operation = "authoring.rename"
	RemoveDocumentEdge Operation = "authoring.edge.remove"
	CreateDocumentEdge Operation = "authoring.edge.create"
	CompileDocument    Operation = "authoring.compile"
	RenderGraph        Operation = "authoring.render"
	ReadSource         Operation = "authoring.source.read"
	CreateSource       Operation = "authoring.source.create"
	UpdateSource       Operation = "authoring.source.update"
	ApplyCandidate     Operation = "reconciliation.apply"
)

type Reconciliation

type Reconciliation interface {
	Apply(context.Context, ReconciliationRequest) (ReconciliationReceipt, error)
}

type ReconciliationReceipt

type ReconciliationReceipt struct {
	FormatVersion        uint64 `json:"format_version"`
	SessionID            string `json:"session_id"`
	PreviousFingerprint  string `json:"previous_fingerprint"`
	CandidateFingerprint string `json:"candidate_fingerprint"`
	State                string `json:"state"`
	SafePointSequence    uint64 `json:"safe_point_sequence,omitempty"`
	RollbackFingerprint  string `json:"rollback_fingerprint,omitempty"`
}

type ReconciliationRequest

type ReconciliationRequest struct {
	SessionID             string   `json:"session_id"`
	ExpectedFingerprint   string   `json:"expected_fingerprint"`
	Candidate             ir.Graph `json:"candidate"`
	ValuesFingerprint     string   `json:"values_fingerprint"`
	DeploymentFingerprint string   `json:"deployment_fingerprint"`
	StateMigration        string   `json:"state_migration,omitempty"`
}

ReconciliationRequest names the exact mounted predecessor and the complete immutable candidate. Values and deployment remain separately identified; credentials and secret locators are never carried by this public schema.

type RemoveDocumentEdgeRequest

type RemoveDocumentEdgeRequest struct {
	Document AuthoringDocument `json:"document"`
	Edge     string            `json:"edge"`
}

RemoveDocumentEdgeRequest identifies one edge in an exact canonical .ortg or normalized YAML/JSON document. Edge is the same stable identity emitted into compiled Graph IR. The operation returns edits only and performs no I/O.

type RemoveDocumentEdgeResult

type RemoveDocumentEdgeResult struct {
	Edge  string         `json:"edge"`
	Edits editor.EditSet `json:"edits"`
}

type RenameDocumentRequest

type RenameDocumentRequest struct {
	Document AuthoringDocument `json:"document"`
	Node     string            `json:"node"`
	NewName  string            `json:"new_name"`
}

RenameDocumentRequest identifies one node in an exact canonical .ortg or normalized YAML/JSON document. Node is the currently compiled identifier; NewName is its desired replacement. The operation returns edits only and performs no I/O.

type RenameDocumentResult

type RenameDocumentResult struct {
	Node    string         `json:"node"`
	NewName string         `json:"new_name"`
	Edits   editor.EditSet `json:"edits"`
}

type RenderFormat

type RenderFormat string
const (
	RenderModel   RenderFormat = "model"
	RenderMermaid RenderFormat = "mermaid"
	RenderDOT     RenderFormat = "dot"
)

type RenderRequest

type RenderRequest struct {
	Graph  ir.Graph     `json:"graph"`
	Format RenderFormat `json:"format"`
}

type RenderResult

type RenderResult struct {
	Fingerprint string         `json:"fingerprint"`
	Format      RenderFormat   `json:"format"`
	Model       *inspect.Model `json:"model,omitempty"`
	Text        string         `json:"text,omitempty"`
}

type RootedSourcePublisher

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

RootedSourcePublisher mediates create-only and stale-digest-bound source updates. Operations are serialized per publisher and use a held os.Root plus identity-checked directory handles; the service never creates directories.

func NewRootedSourcePublisher

func NewRootedSourcePublisher(
	options RootedSourcePublisherOptions,
) (*RootedSourcePublisher, error)

NewRootedSourcePublisher opens and retains the configured root without publishing a file. Platforms without both atomic replacement and atomic no-replace publication fail closed at construction.

func (*RootedSourcePublisher) Close

func (publisher *RootedSourcePublisher) Close() error

Close idempotently erases the publisher's filesystem authority.

func (*RootedSourcePublisher) Publish

func (publisher *RootedSourcePublisher) Publish(
	ctx context.Context, request SourceWriteRequest,
) (SourceWriteReceipt, error)

Publish validates and commits exactly one source mutation.

func (*RootedSourcePublisher) Read

func (publisher *RootedSourcePublisher) Read(
	ctx context.Context, request SourceReadRequest,
) (SourceReadResult, error)

Read returns one stable bounded source snapshot beneath the held root. It is serialized with publication so a single RootedSourcePublisher has one linear source-access history.

func (*RootedSourcePublisher) RootIdentity

func (publisher *RootedSourcePublisher) RootIdentity() string

RootIdentity returns the configured opaque identity, never the root path.

type RootedSourcePublisherOptions

type RootedSourcePublisherOptions struct {
	Root         string
	RootIdentity string
	MaxBytes     int
	CreateMode   os.FileMode
}

RootedSourcePublisherOptions grants one publisher authority beneath exactly one already-existing absolute non-root directory. RootIdentity is an opaque deployment identity returned in receipts; the filesystem path is never returned by the service.

type RuntimeSession

type RuntimeSession interface {
	Live() inspect.Live
	RecordedTrace() (inspect.LiveTrace, error)
}

RuntimeSession is satisfied by graph/runtime.Mounted without coupling this package to its concrete implementation.

type SessionInspection

type SessionInspection interface {
	Snapshot(context.Context, string) (inspect.Live, error)
	Model(context.Context, string) (inspect.Model, error)
	Deltas(context.Context, string, uint64, uint32) (DeltaPage, error)
	Trace(context.Context, string) (inspect.LiveTrace, error)
}

SessionInspection is the payload-free live observability boundary. Limit is an explicit caller hint and implementations still enforce their own ceiling.

type SessionRegistry

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

SessionRegistry is a dynamically scoped directory of live graph runtimes. Register returns an owner-specific disposer so an old session cleanup cannot remove a newer source that reused the public ID.

func NewSessionRegistry

func NewSessionRegistry() *SessionRegistry

func (*SessionRegistry) Deltas

func (registry *SessionRegistry) Deltas(
	ctx context.Context, session string, after uint64, limit uint32,
) (DeltaPage, error)

func (*SessionRegistry) Model

func (registry *SessionRegistry) Model(_ context.Context, session string) (inspect.Model, error)

func (*SessionRegistry) Register

func (registry *SessionRegistry) Register(session string, source RuntimeSession) (func(), error)

func (*SessionRegistry) Snapshot

func (registry *SessionRegistry) Snapshot(_ context.Context, session string) (inspect.Live, error)

func (*SessionRegistry) Trace

func (registry *SessionRegistry) Trace(_ context.Context, session string) (inspect.LiveTrace, error)

type SourcePublication

type SourcePublication interface {
	Publish(context.Context, SourceWriteRequest) (SourceWriteReceipt, error)
}

SourcePublication is the only management contract that can mutate authoring files. Pure analysis and LSP services deliberately do not implement it.

type SourceReadRequest

type SourceReadRequest struct {
	FormatVersion uint64 `json:"format_version"`
	RootIdentity  string `json:"root_identity"`
	Path          string `json:"path"`
}

SourceReadRequest names one canonical source artifact beneath an explicitly configured root. The relative path never grants filesystem authority.

type SourceReadResult

type SourceReadResult struct {
	FormatVersion uint64 `json:"format_version"`
	RootIdentity  string `json:"root_identity"`
	Path          string `json:"path"`
	Source        string `json:"source"`
	SourceDigest  string `json:"source_digest"`
	SourceBytes   uint64 `json:"source_bytes"`
	ResultDigest  string `json:"result_digest"`
}

SourceReadResult returns the exact bounded UTF-8 source plus deterministic evidence binding it to the requested root and path. ResultDigest covers the metadata and SourceDigest; SourceDigest independently covers Source.

func NewSourceReadResult

func NewSourceReadResult(request SourceReadRequest, source string) (SourceReadResult, error)

NewSourceReadResult constructs canonical response evidence for an alternate provider that has already acquired the exact requested source bytes.

type SourceReading

type SourceReading interface {
	Read(context.Context, SourceReadRequest) (SourceReadResult, error)
}

SourceReading is the only management contract that can acquire authoring source bytes from a configured filesystem root.

type SourceWriteMode

type SourceWriteMode string

SourceWriteMode separates create-only publication from stale-digest-bound replacement so capabilities can authorize the two effects independently.

const (
	SourceCreate SourceWriteMode = "create"
	SourceUpdate SourceWriteMode = "update"
)

type SourceWriteReceipt

type SourceWriteReceipt struct {
	FormatVersion        uint64          `json:"format_version"`
	RootIdentity         string          `json:"root_identity"`
	Mode                 SourceWriteMode `json:"mode"`
	Path                 string          `json:"path"`
	PreviousSourceDigest string          `json:"previous_source_digest,omitempty"`
	SourceDigest         string          `json:"source_digest"`
	SourceBytes          uint64          `json:"source_bytes"`
	CleanupPending       bool            `json:"cleanup_pending,omitempty"`
	ReceiptDigest        string          `json:"receipt_digest"`
}

SourceWriteReceipt is payload-free, deterministic evidence of the exact publication. ReceiptDigest binds every preceding field, including whether a superseded staging name could not be removed after an atomic update.

func NewSourceWriteReceipt

func NewSourceWriteReceipt(
	request SourceWriteRequest, cleanupPending bool,
) (SourceWriteReceipt, error)

NewSourceWriteReceipt constructs the canonical payload-free receipt for a provider that has already committed request. Alternate SourcePublication implementations use this instead of duplicating the receipt digest format.

type SourceWriteRequest

type SourceWriteRequest struct {
	FormatVersion        uint64          `json:"format_version"`
	RootIdentity         string          `json:"root_identity"`
	Mode                 SourceWriteMode `json:"mode"`
	Path                 string          `json:"path"`
	Source               string          `json:"source"`
	ExpectedSourceDigest string          `json:"expected_source_digest,omitempty"`
}

SourceWriteRequest carries an in-memory authoring document to one explicitly configured rooted publisher. Path is a canonical slash-separated path relative to that root; it never grants filesystem authority by itself.

type StaticCatalog

type StaticCatalog interface {
	Graph(context.Context, string) (ir.Graph, error)
	ElementDescriptor(context.Context, element.Identity) (element.Descriptor, error)
	PluginDescriptor(context.Context, plugin.Identity) (plugin.Descriptor, error)
	ValuesSchema(context.Context, string) (schema.Bundle, error)
}

StaticCatalog provides immutable management resources. Implementations must return independent copies because handlers encode concurrently.

type ValuesSchemaResource

type ValuesSchemaResource struct {
	FormatVersion uint64                      `json:"format_version"`
	Schema        string                      `json:"schema"`
	Digest        string                      `json:"digest"`
	Complete      bool                        `json:"complete"`
	Nodes         []schema.NodeContract       `json:"nodes"`
	Contracts     []schema.ContractResolution `json:"contracts"`
	Unresolved    []string                    `json:"unresolved"`
}

ValuesSchemaResource is the lossless HTTP representation of a generated values-schema bundle. Schema is a JSON string rather than an embedded JSON value because standard JSON encoders are allowed to compact RawMessage values. Compaction would make Bundle.Digest unverifiable and would discard the generator's canonical trailing newline.

func NewValuesSchemaResource

func NewValuesSchemaResource(bundle schema.Bundle) (ValuesSchemaResource, error)

func (ValuesSchemaResource) Bundle

func (resource ValuesSchemaResource) Bundle() (schema.Bundle, error)

func (ValuesSchemaResource) Validate

func (resource ValuesSchemaResource) Validate() error

Directories

Path Synopsis
Package client implements the UI-independent OpenRealtime management API.
Package client implements the UI-independent OpenRealtime management API.
Package server implements descriptor-locked server-realm plugins for the OpenRealtime management API.
Package server implements descriptor-locked server-realm plugins for the OpenRealtime management API.

Jump to

Keyboard shortcuts

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