Documentation
¶
Overview ¶
Package odcs preserves admitted ODCS documents and derives restricted executable shapes.
Index ¶
- Constants
- Variables
- func CheckRequestJSON(raw []byte) error
- func IsFlatCompiler(id string) bool
- func ParseArtifact(raw []byte, format string) (json.RawMessage, error)
- func Record(raw json.RawMessage, expectedID string) (*model.ODCSRevision, error)
- type ConversionResult
- type Diagnostic
- type PhysicalTypeMapping
- type ProjectedInput
- type ProjectedKey
- type ProjectedKeyPair
- type ProjectedRelationship
- type ProjectionDeclaration
- type ProjectionDefault
- type ProjectionDiagnostic
- type ProjectionInput
- type ProjectionMapping
- type ProjectionPlan
- type ProjectionRequest
- type ProjectionResolution
- type ProjectionResult
- type PropertyIdentity
- type RelationshipSelection
- type ResolutionValue
Constants ¶
const ( ProjectionCompilerID = "braidplane/odcs-structure/v1" MaxProjectionInputs = 64 )
const CompilerID = "braidplane/odcs-flat-port/v2"
const DecimalCompilerID = "braidplane/odcs-flat-port-decimal/v1"
const MaxCoverageEntries = 16384
const (
MaxDocumentBytes = 1 << 20
)
const MaxProjectionBytes = 8 << 20
MaxProjectionBytes also bounds aggregate pins and ODCS Proof inputs/claims.
const PinnedVersion = "v3.2.0"
Variables ¶
var ErrDocument = xerror.New(xerror.KindInvalidInput, "ODCS_DOCUMENT_INVALID", "invalid ODCS catalog document")
Functions ¶
func CheckRequestJSON ¶
CheckRequestJSON allows the request envelope around a document's 64-level bound.
func IsFlatCompiler ¶
IsFlatCompiler accepts retained shapes without recompiling their documents.
func ParseArtifact ¶
func ParseArtifact(raw []byte, format string) (json.RawMessage, error)
ParseArtifact validates JSON or converts a restricted YAML document to canonical JSON. It only parses submitted bytes; admission remains the caller's responsibility.
func Record ¶
func Record(raw json.RawMessage, expectedID string) (*model.ODCSRevision, error)
Record validates admission before deriving a digest; no declaration is removed.
Types ¶
type ConversionResult ¶
type ConversionResult struct {
CompilerID string `json:"compiler_id"`
Coverage []internalmodel.ODCSDeclarationCoverage `json:"coverage,omitempty"`
CoverageComplete bool `json:"coverage_complete"`
Properties []PropertyIdentity `json:"properties,omitempty"`
ODCSVersion string `json:"odcs_version"`
Digest string `json:"digest,omitempty"`
SchemaObjectID string `json:"schema_object_id"`
DocumentValid bool `json:"document_valid"`
Shape *payload.Contract `json:"shape,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
// contains filtered or unexported fields
}
func Convert ¶
func Convert(raw json.RawMessage, objectID string) (*ConversionResult, error)
Convert validates the entire document and converts exactly one stable object ID. Unsupported selected structure returns diagnostics without a partial shape. Preserved metadata and unevaluated checks are reported separately as coverage.
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Path string `json:"path"`
Message string `json:"message"`
}
Diagnostic never includes submitted values or arbitrary property names.
type PhysicalTypeMapping ¶
type PhysicalTypeMapping struct {
LogicalType string
Kind payload.StructuralKind
Bits, Precision, Scale int
}
type ProjectedInput ¶
type ProjectedInput struct {
Contract, Revision, ObjectID, Digest, ResolvedDigest string
ObjectName string
Mapping ProjectionMapping
Structure *payload.Structure
Defaults []ProjectionDefault
Resolutions []ProjectionResolution
Declarations []ProjectionDeclaration
Coverage []internalmodel.ODCSDeclarationCoverage
}
type ProjectedKey ¶
type ProjectedKey struct {
Path payload.StructuralPath
IDs []string
}
type ProjectedKeyPair ¶
type ProjectedKeyPair struct{ From, To ProjectedKey }
type ProjectedRelationship ¶
type ProjectedRelationship struct {
Input, Target int
Path string
Pairs []ProjectedKeyPair
}
type ProjectionDeclaration ¶
type ProjectionDefault ¶
type ProjectionDiagnostic ¶
type ProjectionDiagnostic struct {
Input int
Phase string
Diagnostic
}
type ProjectionInput ¶
type ProjectionInput struct {
Contract, Revision, ObjectID, Digest string
Document json.RawMessage
Mapping ProjectionMapping
Variables map[string]ResolutionValue
}
ProjectionInput must already be authorized in one project by the caller. No resolver, catalog, provider or credentials capability enters this compiler.
type ProjectionMapping ¶
type ProjectionMapping struct {
ID string
Representation model.ContractRepresentation
RootShape model.ContractRootShape
Types map[payload.StructuralKind]bool
Physical map[string]PhysicalTypeMapping
}
ProjectionMapping is a connector-owned capability snapshot, not an inferred provider conversion. Its identity and contents participate in the plan digest.
type ProjectionPlan ¶
type ProjectionPlan struct {
CompilerID string
Inputs []ProjectedInput
Relationships []ProjectedRelationship
}
type ProjectionRequest ¶
type ProjectionRequest struct {
Inputs []ProjectionInput
Relationships []RelationshipSelection
}
type ProjectionResolution ¶
type ProjectionResult ¶
type ProjectionResult struct {
Plan *ProjectionPlan
Digest string
Coverage [][]internalmodel.ODCSDeclarationCoverage
Diagnostics []ProjectionDiagnostic
}
func CompileProjection ¶
func CompileProjection(request ProjectionRequest) (*ProjectionResult, error)
CompileProjection is hermetic. Executable admission binds selected structures to exact ports in versioned immutable contract plans. Any selected failure returns coverage/diagnostics but no partial plan/digest.
type PropertyIdentity ¶
type RelationshipSelection ¶
RelationshipSelection explicitly maps one declaration to an input containing an exact, caller-authorized project-owned revision. URLs never select inputs.
type ResolutionValue ¶
ResolutionValue is explicitly supplied non-secret string data. Revision names its authoring snapshot; this compiler never consults environment or secrets.