Documentation
¶
Overview ¶
Package ordinaryoutput owns construction-time policy for ordinary native receive output. It deliberately contains no persisted receive contract.
Index ¶
- Constants
- Variables
- type ArtifactPath
- type ArtifactPathProjection
- type ArtifactPathProjector
- type ArtifactProjectionKind
- type ArtifactRejectReason
- type AuthenticatedSourceNode
- type OpaqueSelectionTarget
- type Selection
- func NewCatalogPathSelection(share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, ...) (Selection, error)
- func NewOpaqueNodeSelection(share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, ...) (Selection, error)
- func NewWholeShareSelection(share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, ...) (Selection, error)
- type SelectionMode
- type ShapeCatalog
- type ShapeDecision
- func NewCompleteDirectoryShape(directory catalog.DirectoryID, sourcePath string) (ShapeDecision, error)
- func NewPartialDirectoryShape(directory catalog.DirectoryID, sourcePath string) (ShapeDecision, error)
- func NewSingleFileShape(file catalog.FileID, sourcePath string) (ShapeDecision, error)
- func NewSyntheticSelectionShape(reason ShapeFallbackReason) (ShapeDecision, error)
- func ResolveShape(ctx context.Context, source ShapeCatalog, selection Selection, ...) (ShapeDecision, error)
- func (decision ShapeDecision) DirectoryID() catalog.DirectoryID
- func (decision ShapeDecision) FallbackReason() ShapeFallbackReason
- func (decision ShapeDecision) FileID() catalog.FileID
- func (decision ShapeDecision) Kind() ShapeKind
- func (decision ShapeDecision) PreferredName() string
- func (decision ShapeDecision) SourcePath() string
- func (decision ShapeDecision) Valid() bool
- type ShapeFallbackReason
- type ShapeKind
- type ShapeProbeBudget
- func (budget ShapeProbeBudget) AuthenticatedMetadataBytes() uint64
- func (budget ShapeProbeBudget) AuthenticatedPages() uint32
- func (budget ShapeProbeBudget) Depth() uint32
- func (budget ShapeProbeBudget) DirectoryRequests() uint32
- func (budget ShapeProbeBudget) Entries() uint32
- func (budget ShapeProbeBudget) Valid() bool
- type SourceCatalogPath
- type SourceNodeRole
- type UnmatchedSelectionError
Constants ¶
const ( // OrdinaryOutputPolicyVersion separates active operations when any ordinary // layout, lookup, suffix, reservation, cleanup, or shape-budget semantic changes. OrdinaryOutputPolicyVersion = uint8(1) // MaximumResultNameReservationAttemptsV1 admits collision indexes 0 through 31. MaximumResultNameReservationAttemptsV1 = uint32(32) )
Variables ¶
var ( ErrInvalidSourceCatalogPath = errors.New("ordinary output source catalog path is invalid") ErrInvalidArtifactPath = errors.New("ordinary output artifact path is invalid") ErrInvalidAuthenticatedSource = errors.New("ordinary output authenticated source node is invalid") ErrInvalidArtifactProjector = errors.New("ordinary output artifact path projector is invalid") )
var ( ErrInvalidShapeResolution = errors.New("ordinary output shape resolution is invalid") // ErrSelectionUnmatched reports that construction-time shape resolution // proved every requested catalog path absent within the probe budget. ErrSelectionUnmatched = errors.New("ordinary output selection matched no catalog paths") )
var DefaultShapeProbeBudgetV1 = mustShapeProbeBudget( 32, 128, 32_768, 8*1024*1024, catalog.MaxPathDepth, )
Functions ¶
This section is empty.
Types ¶
type ArtifactPath ¶
type ArtifactPath struct {
// contains filtered or unexported fields
}
ArtifactPath is a logical output coordinate. It never contains the collision-adjusted physical reservation name.
func NewArtifactPath ¶
func NewArtifactPath(value string) (ArtifactPath, error)
func (ArtifactPath) String ¶
func (path ArtifactPath) String() string
func (ArtifactPath) Valid ¶
func (path ArtifactPath) Valid() bool
type ArtifactPathProjection ¶
type ArtifactPathProjection struct {
// contains filtered or unexported fields
}
func MaterializeArtifactProjection ¶
func MaterializeArtifactProjection(path ArtifactPath) (ArtifactPathProjection, error)
MaterializeArtifactProjection constructs one already-validated logical artifact claim. Production transfer code normally obtains this from Project; the constructor keeps executor tests explicit without exposing struct fields.
func TraverseOnlyProjection ¶
func TraverseOnlyProjection() ArtifactPathProjection
TraverseOnlyProjection constructs the absence of destination authority for a source directory that is needed solely to authenticate selected ancestry.
func (ArtifactPathProjection) ArtifactPath ¶
func (projection ArtifactPathProjection) ArtifactPath() (ArtifactPath, bool)
func (ArtifactPathProjection) Kind ¶
func (projection ArtifactPathProjection) Kind() ArtifactProjectionKind
func (ArtifactPathProjection) RejectReason ¶
func (projection ArtifactPathProjection) RejectReason() ArtifactRejectReason
type ArtifactPathProjector ¶
type ArtifactPathProjector struct {
// contains filtered or unexported fields
}
ArtifactPathProjector is immutable after construction. Project has no state, I/O, or destination authority.
func NewArtifactPathProjector ¶
func NewArtifactPathProjector( syntheticRoot catalog.DirectoryID, artifact receivecontract.ArtifactSpec, ) (ArtifactPathProjector, error)
NewArtifactPathProjector validates the canonical artifact once. There is no constructor that accepts a free-form preferred name, so receivecontract remains the only naming authority.
func (ArtifactPathProjector) Project ¶
func (projector ArtifactPathProjector) Project(node AuthenticatedSourceNode) ArtifactPathProjection
type ArtifactProjectionKind ¶
type ArtifactProjectionKind uint8
const ( ArtifactTraverseOnly ArtifactProjectionKind = iota + 1 ArtifactMaterialize ArtifactReject )
func (ArtifactProjectionKind) Valid ¶
func (kind ArtifactProjectionKind) Valid() bool
type ArtifactRejectReason ¶
type ArtifactRejectReason uint8
const ( ArtifactRejectNone ArtifactRejectReason = iota ArtifactRejectInvalidSource ArtifactRejectWrongRole ArtifactRejectWrongKind ArtifactRejectWrongIdentity )
func (ArtifactRejectReason) Valid ¶
func (reason ArtifactRejectReason) Valid() bool
type AuthenticatedSourceNode ¶
type AuthenticatedSourceNode struct {
// contains filtered or unexported fields
}
AuthenticatedSourceNode keeps sender identity and source ancestry independent from the projected artifact coordinate.
func NewAuthenticatedDirectorySourceNode ¶
func NewAuthenticatedDirectorySourceNode( directory catalog.DirectoryID, sourcePath SourceCatalogPath, role SourceNodeRole, ) (AuthenticatedSourceNode, error)
func NewAuthenticatedFileSourceNode ¶
func NewAuthenticatedFileSourceNode( file catalog.FileID, sourcePath SourceCatalogPath, role SourceNodeRole, ) (AuthenticatedSourceNode, error)
func (AuthenticatedSourceNode) Kind ¶
func (node AuthenticatedSourceNode) Kind() catalog.NodeKind
func (AuthenticatedSourceNode) NodeID ¶
func (node AuthenticatedSourceNode) NodeID() catalog.NodeID
func (AuthenticatedSourceNode) Role ¶
func (node AuthenticatedSourceNode) Role() SourceNodeRole
func (AuthenticatedSourceNode) SourcePath ¶
func (node AuthenticatedSourceNode) SourcePath() SourceCatalogPath
type OpaqueSelectionTarget ¶
type OpaqueSelectionTarget struct {
// contains filtered or unexported fields
}
func NewOpaqueDirectoryTarget ¶
func NewOpaqueDirectoryTarget( directory catalog.DirectoryID, selected bool, ) (OpaqueSelectionTarget, error)
func NewOpaqueFileTarget ¶
func NewOpaqueFileTarget(file catalog.FileID, selected bool) (OpaqueSelectionTarget, error)
func (OpaqueSelectionTarget) Kind ¶
func (target OpaqueSelectionTarget) Kind() catalog.NodeKind
func (OpaqueSelectionTarget) NodeID ¶
func (target OpaqueSelectionTarget) NodeID() catalog.NodeID
func (OpaqueSelectionTarget) Selected ¶
func (target OpaqueSelectionTarget) Selected() bool
type Selection ¶
type Selection struct {
// contains filtered or unexported fields
}
func NewCatalogPathSelection ¶
func NewCatalogPathSelection( share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, digest [32]byte, targets []string, ) (Selection, error)
func NewOpaqueNodeSelection ¶
func NewOpaqueNodeSelection( share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, digest [32]byte, defaultSelected bool, targets []OpaqueSelectionTarget, ) (Selection, error)
func NewWholeShareSelection ¶
func NewWholeShareSelection( share catalog.ShareInstance, syntheticRoot catalog.DirectoryID, digest [32]byte, ) (Selection, error)
type SelectionMode ¶
type SelectionMode uint8
SelectionMode is deliberately local: the parent transfer package lowers its closed canonical selection state into this immutable proof input.
const ( SelectionCatalogPaths SelectionOpaqueNodes )
type ShapeCatalog ¶
type ShapeCatalog interface {
OpenDirectoryPages(context.Context, catalog.DirectoryID) (catalog.DirectoryPageCursor, error)
}
type ShapeDecision ¶
type ShapeDecision struct {
// contains filtered or unexported fields
}
ShapeDecision contains only the immutable scalar result of construction-time proof. No generation, page, target list, manifest, or content fact survives.
func NewCompleteDirectoryShape ¶
func NewCompleteDirectoryShape( directory catalog.DirectoryID, sourcePath string, ) (ShapeDecision, error)
func NewPartialDirectoryShape ¶
func NewPartialDirectoryShape( directory catalog.DirectoryID, sourcePath string, ) (ShapeDecision, error)
func NewSingleFileShape ¶
func NewSingleFileShape(file catalog.FileID, sourcePath string) (ShapeDecision, error)
func NewSyntheticSelectionShape ¶
func NewSyntheticSelectionShape(reason ShapeFallbackReason) (ShapeDecision, error)
func ResolveShape ¶
func ResolveShape( ctx context.Context, source ShapeCatalog, selection Selection, budget ShapeProbeBudget, ) (ShapeDecision, error)
func (ShapeDecision) DirectoryID ¶
func (decision ShapeDecision) DirectoryID() catalog.DirectoryID
func (ShapeDecision) FallbackReason ¶
func (decision ShapeDecision) FallbackReason() ShapeFallbackReason
func (ShapeDecision) FileID ¶
func (decision ShapeDecision) FileID() catalog.FileID
func (ShapeDecision) Kind ¶
func (decision ShapeDecision) Kind() ShapeKind
func (ShapeDecision) PreferredName ¶
func (decision ShapeDecision) PreferredName() string
func (ShapeDecision) SourcePath ¶
func (decision ShapeDecision) SourcePath() string
func (ShapeDecision) Valid ¶
func (decision ShapeDecision) Valid() bool
type ShapeFallbackReason ¶
type ShapeFallbackReason uint8
const ( ShapeFallbackNone ShapeFallbackReason = iota ShapeFallbackMultipleRoots ShapeFallbackSyntheticNearestAncestor ShapeFallbackOpaqueAncestryUnprovable ShapeFallbackPageBudget ShapeFallbackEntryBudget ShapeFallbackMetadataBudget ShapeFallbackDepthBudget ShapeFallbackDirectoryRequestBudget ShapeFallbackUnsupportedRuleProof // ShapeFallbackUnresolvedTarget falls back when at least one requested // catalog-path target matched and another was unresolved, or when an // opaque-node selection has any unresolved target. Completely unmatched // catalog-path selections within budget return *UnmatchedSelectionError. ShapeFallbackUnresolvedTarget ShapeFallbackIncompleteGeneration )
func (ShapeFallbackReason) Valid ¶
func (reason ShapeFallbackReason) Valid() bool
type ShapeProbeBudget ¶
type ShapeProbeBudget struct {
// contains filtered or unexported fields
}
ShapeProbeBudget bounds authenticated metadata work before shape resolution freezes the synthetic ordinary-output fallback.
func NewShapeProbeBudget ¶
func (ShapeProbeBudget) AuthenticatedMetadataBytes ¶
func (budget ShapeProbeBudget) AuthenticatedMetadataBytes() uint64
func (ShapeProbeBudget) AuthenticatedPages ¶
func (budget ShapeProbeBudget) AuthenticatedPages() uint32
func (ShapeProbeBudget) Depth ¶
func (budget ShapeProbeBudget) Depth() uint32
func (ShapeProbeBudget) DirectoryRequests ¶
func (budget ShapeProbeBudget) DirectoryRequests() uint32
func (ShapeProbeBudget) Entries ¶
func (budget ShapeProbeBudget) Entries() uint32
func (ShapeProbeBudget) Valid ¶
func (budget ShapeProbeBudget) Valid() bool
type SourceCatalogPath ¶
type SourceCatalogPath struct {
// contains filtered or unexported fields
}
SourceCatalogPath is an authenticated sender-side coordinate. The synthetic root is represented only by EmptySourceCatalogPath.
func EmptySourceCatalogPath ¶
func EmptySourceCatalogPath() SourceCatalogPath
func NewSourceCatalogPath ¶
func NewSourceCatalogPath(value string) (SourceCatalogPath, error)
func (SourceCatalogPath) IsRoot ¶
func (path SourceCatalogPath) IsRoot() bool
func (SourceCatalogPath) String ¶
func (path SourceCatalogPath) String() string
func (SourceCatalogPath) Valid ¶
func (path SourceCatalogPath) Valid() bool
type SourceNodeRole ¶
type SourceNodeRole uint8
const ( SourceNodeSelected SourceNodeRole = iota + 1 SourceNodeConnectsSelection )
func (SourceNodeRole) Valid ¶
func (role SourceNodeRole) Valid() bool
type UnmatchedSelectionError ¶ added in v0.1.8
type UnmatchedSelectionError struct {
// contains filtered or unexported fields
}
UnmatchedSelectionError carries the canonical, sorted catalog paths that shape resolution proved absent when no requested target existed in the share. Error text intentionally omits raw catalog paths so diagnostic logs stay privacy-safe; callers inspect MissingPaths directly for user presentation.
func NewUnmatchedSelectionError ¶ added in v0.1.8
func NewUnmatchedSelectionError(paths []string) (*UnmatchedSelectionError, error)
func (*UnmatchedSelectionError) Error ¶ added in v0.1.8
func (err *UnmatchedSelectionError) Error() string
func (*UnmatchedSelectionError) MissingPaths ¶ added in v0.1.8
func (err *UnmatchedSelectionError) MissingPaths() []string
func (*UnmatchedSelectionError) Unwrap ¶ added in v0.1.8
func (err *UnmatchedSelectionError) Unwrap() error