Documentation
¶
Index ¶
- Constants
- func ArtifactRuntimeDisabled(value artifact.Artifact) (bool, error)
- func DecodeArtifactData(raw json.RawMessage) (spec.ArtifactData, error)
- func EncodeArtifactData(value spec.ArtifactData) (json.RawMessage, error)
- func RuntimeDecisionDiagnostic(decision RuntimeDecision, value artifact.Artifact) diagnostic.Diagnostic
- func WorkspaceArtifactDiagnostics(locator basespec.Locator, code string, message string) []diagnostic.Diagnostic
- func WorkspaceArtifactErrorDiagnostics(locator basespec.Locator, err error) []diagnostic.Diagnostic
- type ArtifactIDProvider
- type ArtifactIDProviderFunc
- type ArtifactPolicy
- type ArtifactRuntimePolicy
- type QueryService
- func (q *QueryService) Catalog(ctx context.Context, workspace collection.CollectionRef) (spec.CatalogView, error)
- func (q *QueryService) ComposeLoadPlan(ctx context.Context, workspace collection.CollectionRef, ...) (spec.LoadPlan, error)
- func (q *QueryService) GetWorkspace(ctx context.Context, workspace collection.CollectionRef) (spec.Workspace, error)
- func (q *QueryService) Resolve(ctx context.Context, workspace collection.CollectionRef, ...) (spec.Resource, error)
- func (q *QueryService) ResolveArtifact(ctx context.Context, ref artifact.ArtifactRef) (spec.Workspace, spec.Resource, error)
- type RuntimeDecision
- type RuntimeDisposition
- type RuntimePolicyRequest
- type RuntimeUse
- type Service
- func (s *Service) Attach(ctx context.Context, request spec.AttachRequest) (spec.Workspace, error)
- func (s *Service) CreateEmpty(ctx context.Context, request spec.EmptyWorkspaceRequest) (spec.Workspace, error)
- func (s *Service) CreateFilesystem(ctx context.Context, request spec.FilesystemWorkspaceRequest) (spec.Workspace, error)
- func (s *Service) Detach(ctx context.Context, ref collection.CollectionRef, sourceID basespec.SourceID, ...) (spec.Workspace, error)
- func (s *Service) Get(ctx context.Context, ref collection.CollectionRef) (spec.Workspace, error)
- func (s *Service) List(ctx context.Context, rootID basespec.RootID) ([]spec.Workspace, error)
- func (s *Service) PrepareRefresh(ctx context.Context, ref collection.CollectionRef) (spec.Workspace, error)
- func (s *Service) Purge(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) error
- func (s *Service) ReplacePrimary(ctx context.Context, request spec.ReplacePrimaryRequest) (spec.Workspace, error)
- func (s *Service) Retire(ctx context.Context, ref collection.CollectionRef, expectedRevision uint64) (collection.Collection, error)
- func (s *Service) SetPrimary(ctx context.Context, request spec.SetPrimaryRequest) (spec.Workspace, error)
- func (s *Service) Update(ctx context.Context, request spec.UpdateRequest) (spec.Workspace, error)
- func (s *Service) UpdateAttachment(ctx context.Context, request spec.UpdateAttachmentRequest) (spec.Workspace, error)
- func (s *Service) ValidateFilesystemCreate(request spec.FilesystemWorkspaceRequest) error
- type SourceUsePolicy
Constants ¶
const ( DiagnosticCodeArtifactInvalid = "workspace.artifact.invalid" DiagnosticCodeContextInvalidContent = "workspace.context.invalid-content" DiagnosticCodeContextInvalidUTF8 = "workspace.context.invalid-utf8" DiagnosticCodeDefinitionInvalid = "workspace.definition.invalid" DiagnosticCodeArtifactSchemaUnsupported = "workspace.artifact.schema-unsupported" DiagnosticCodeArtifactKindMismatch = "workspace.artifact.kind-mismatch" DiagnosticCodeProjectionInvalid = "workspace.projection.invalid" DiagnosticCodeArtifactUnresolved = "workspace.artifact.unresolved" DiagnosticCodeRuntimeDenied = "workspace.runtime.denied" DiagnosticCodeCatalogStale = "workspace.catalog.stale" DiagnosticCodeCatalogDecoderStale = "workspace.catalog.decoder-stale" DiagnosticCodeCatalogPolicyStale = "workspace.catalog.policy-stale" DiagnosticCodeSkillInvalid = "workspace.skill.invalid" )
Variables ¶
This section is empty.
Functions ¶
func DecodeArtifactData ¶
func DecodeArtifactData( raw json.RawMessage, ) (spec.ArtifactData, error)
func EncodeArtifactData ¶
func EncodeArtifactData( value spec.ArtifactData, ) (json.RawMessage, error)
func RuntimeDecisionDiagnostic ¶
func RuntimeDecisionDiagnostic( decision RuntimeDecision, value artifact.Artifact, ) diagnostic.Diagnostic
func WorkspaceArtifactDiagnostics ¶
func WorkspaceArtifactDiagnostics( locator basespec.Locator, code string, message string, ) []diagnostic.Diagnostic
func WorkspaceArtifactErrorDiagnostics ¶
func WorkspaceArtifactErrorDiagnostics( locator basespec.Locator, err error, ) []diagnostic.Diagnostic
Types ¶
type ArtifactIDProvider ¶ added in v0.2.14
type ArtifactIDProvider interface {
NewArtifactID(ctx context.Context) (basespec.ArtifactID, error)
}
ArtifactIDProvider belongs to the Workspace feature. It is used only when Workspace policy elects to automatically adopt an observed occurrence.
Generic Artifact Store accepts the resulting artifact.Draft.ID but never allocates it.
type ArtifactIDProviderFunc ¶ added in v0.2.14
type ArtifactIDProviderFunc func( context.Context, ) (basespec.ArtifactID, error)
func (ArtifactIDProviderFunc) NewArtifactID ¶ added in v0.2.14
func (f ArtifactIDProviderFunc) NewArtifactID( ctx context.Context, ) (basespec.ArtifactID, error)
type ArtifactPolicy ¶
type ArtifactPolicy struct {
// contains filtered or unexported fields
}
func NewArtifactPolicy ¶
func NewArtifactPolicy( ids ArtifactIDProvider, supports ...spec.ArtifactSupport, ) (*ArtifactPolicy, error)
func (*ArtifactPolicy) Derive ¶
func (p *ArtifactPolicy) Derive( ctx context.Context, _ collection.Collection, occurrence catalog.Occurrence, value definition.Definition, ) (artifact.Draft, bool, []diagnostic.Diagnostic, error)
func (*ArtifactPolicy) Supports ¶
func (p *ArtifactPolicy) Supports( kind basespec.ArtifactKind, ) bool
type ArtifactRuntimePolicy ¶
type ArtifactRuntimePolicy struct{}
ArtifactRuntimePolicy is the default local Workspace trust boundary.
Discovery and management remain available. Runtime use is enabled by default unless the Artifact-local RuntimeDisabled flag explicitly disables it.
func NewArtifactRuntimePolicy ¶
func NewArtifactRuntimePolicy() *ArtifactRuntimePolicy
func (*ArtifactRuntimePolicy) Decide ¶
func (*ArtifactRuntimePolicy) Decide( ctx context.Context, request RuntimePolicyRequest, ) RuntimeDecision
type QueryService ¶
type QueryService struct {
// contains filtered or unexported fields
}
func NewQueryService ¶
func NewQueryService( workspaces *Service, catalogs catalogSnapshotReader, artifacts artifactLookup, definitions definitionLookup, decoderFingerprint func() (cryptoutil.Digest, error), discoveryPolicyRevision string, supports ...spec.ArtifactSupport, ) (*QueryService, error)
func (*QueryService) Catalog ¶
func (q *QueryService) Catalog( ctx context.Context, workspace collection.CollectionRef, ) (spec.CatalogView, error)
func (*QueryService) ComposeLoadPlan ¶
func (q *QueryService) ComposeLoadPlan( ctx context.Context, workspace collection.CollectionRef, artifactRefs []artifact.ArtifactRef, ) (spec.LoadPlan, error)
func (*QueryService) GetWorkspace ¶
func (q *QueryService) GetWorkspace( ctx context.Context, workspace collection.CollectionRef, ) (spec.Workspace, error)
func (*QueryService) Resolve ¶
func (q *QueryService) Resolve( ctx context.Context, workspace collection.CollectionRef, reference spec.Reference, ) (spec.Resource, error)
func (*QueryService) ResolveArtifact ¶
func (q *QueryService) ResolveArtifact( ctx context.Context, ref artifact.ArtifactRef, ) (spec.Workspace, spec.Resource, error)
type RuntimeDecision ¶
type RuntimeDecision struct {
Disposition RuntimeDisposition
Code string
Message string
}
func (RuntimeDecision) Validate ¶
func (d RuntimeDecision) Validate() error
type RuntimeDisposition ¶
type RuntimeDisposition string
const ( RuntimeAllowed RuntimeDisposition = "allowed" RuntimeDenied RuntimeDisposition = "denied" )
type RuntimePolicyRequest ¶
type RuntimePolicyRequest struct {
Use RuntimeUse
Workspace spec.Workspace
Artifact artifact.Artifact
DefinitionDigest cryptoutil.Digest
SourceID basespec.SourceID
}
type RuntimeUse ¶
type RuntimeUse string
const ( RuntimeUseContextPrompt RuntimeUse = "context-prompt" RuntimeUseSkill RuntimeUse = "skill" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( collections workspaceCollectionStore, sources sourceSummaryLookup, discoveryPolicyRevision string, workspaceRootID basespec.RootID, rootPolicy protection.RootPolicy, ) (*Service, error)
func (*Service) CreateEmpty ¶
func (*Service) CreateFilesystem ¶
func (*Service) Get ¶
func (s *Service) Get( ctx context.Context, ref collection.CollectionRef, ) (spec.Workspace, error)
func (*Service) PrepareRefresh ¶
func (s *Service) PrepareRefresh( ctx context.Context, ref collection.CollectionRef, ) (spec.Workspace, error)
PrepareRefresh converges the local policy revision before planning a publication. A policy revision is local metadata, so a user-triggered refresh is the appropriate point to persist an implementation upgrade.
func (*Service) Purge ¶
func (s *Service) Purge( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) error
Purge destructively removes a retired Workspace Collection and its Collection-scoped metadata. It deliberately verifies the persisted kind before delegating to generic Collection persistence, so Workspace APIs cannot purge another domain's retired Collection.
func (*Service) ReplacePrimary ¶
func (*Service) Retire ¶
func (s *Service) Retire( ctx context.Context, ref collection.CollectionRef, expectedRevision uint64, ) (collection.Collection, error)
func (*Service) SetPrimary ¶
func (s *Service) SetPrimary( ctx context.Context, request spec.SetPrimaryRequest, ) (spec.Workspace, error)
SetPrimary explicitly transitions a Workspace between empty and filesystem modes, or replaces its existing primary Source. Generic attachment APIs intentionally cannot mutate the primary relationship.
func (*Service) UpdateAttachment ¶
func (*Service) ValidateFilesystemCreate ¶ added in v0.2.14
func (s *Service) ValidateFilesystemCreate( request spec.FilesystemWorkspaceRequest, ) error
ValidateFilesystemCreate validates all Workspace-owned creation inputs that can be checked before provisioning a filesystem Source.
type SourceUsePolicy ¶
type SourceUsePolicy interface {
Decide(
ctx context.Context,
request RuntimePolicyRequest,
) RuntimeDecision
}