Documentation
¶
Overview ¶
Package application owns SDD's protocol-neutral runtime, public request and result types, and the infrastructure ports implemented by embedding hosts.
Index ¶
- Constants
- Variables
- func AttachmentDirRelPath(entryID string) (string, error)
- func MutationBatchDigest(batch MutationBatch) (string, error)
- type Access
- type AccessResolver
- type Application
- func (a *Application) AbandonWorkflowSession(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (WorkflowAbandonResult, error)
- func (a *Application) ApplyPrepared(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (TransitionResult, error)
- func (a *Application) BindSession(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (BindSessionResult, error)
- func (a *Application) CreateEntry(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (CreateEntryResult, error)
- func (a *Application) CurrentSnapshot(ctx context.Context, identity RequestIdentity, project ProjectID) (*Snapshot, error)
- func (a *Application) FinishWIP(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (MutationResult, error)
- func (a *Application) Info(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (InfoResult, error)
- func (a *Application) ListSessions(ctx context.Context, identity RequestIdentity, project ProjectID) (ListSessionsResult, error)
- func (a *Application) ListWorkflowSessions(ctx context.Context, identity RequestIdentity, project ProjectID) ([]WorkflowSessionSummary, error)
- func (a *Application) OpenWorkflow(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (*WorkflowSession, *WorkflowServe, error)
- func (a *Application) Procedures(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (ProcedureListResult, error)
- func (a *Application) ReadAttachment(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (ReadAttachmentResult, error)
- func (a *Application) RecoverPrepared(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (TransitionResult, error)
- func (a *Application) ReleaseSession(ctx context.Context, identity RequestIdentity, project ProjectID, ...) error
- func (a *Application) ReplaceSummary(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (MutationResult, error)
- func (a *Application) ResumeWorkflow(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (*WorkflowSession, WorkflowResumeResult, error)
- func (a *Application) Search(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (SearchResult, error)
- func (a *Application) Show(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (ShowResult, error)
- func (a *Application) StageBlob(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (StagedBlob, error)
- func (a *Application) StartWIP(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (string, MutationResult, error)
- func (a *Application) View(ctx context.Context, identity RequestIdentity, project ProjectID, ...) (ViewResult, error)
- func (a *Application) Vocabulary(ctx context.Context, identity RequestIdentity, project ProjectID) (string, error)
- type ApplicationError
- type AppliedMutation
- type ApplyResult
- type ApplyState
- type AttachmentMaterialization
- type AttachmentPage
- type Author
- type BindSessionRequest
- type BindSessionResult
- type BlobDigest
- type BlobOwner
- type CanonicalChunk
- type ChooserKind
- type CreateEntryResult
- type DocumentChange
- type EmbeddingExecutor
- type EmbeddingExecutorFuncs
- type EmbeddingInput
- type EmbeddingPurpose
- type EmbeddingSpec
- type EmbeddingVector
- type EntryDocument
- type EntryDraft
- type EntryRef
- type ErrorCode
- type FinalizerOutcome
- type Finding
- type GraphStore
- type IndexNamespace
- type IndexedChunk
- type InfoRequest
- type InfoResult
- type LLMExecutor
- type LLMExecutorFuncs
- type LLMRequest
- type LLMResult
- type LLMUsage
- type ListSessionsResult
- type MutationBatch
- type MutationFinalizer
- type MutationResult
- type PreparedTransition
- type Principal
- type ProcedureListRequest
- type ProcedureListResult
- type ProjectAction
- type ProjectConfigDocument
- type ProjectID
- type ProjectList
- type ProjectRef
- type ProjectRuntime
- type ProjectRuntimeOptions
- type ProjectState
- type ProjectSummary
- type ReadAttachmentRequest
- type ReadAttachmentResult
- type RegistryFunction
- type RequestIdentity
- type ScoredChunkHit
- type SearchIndexEntryManifest
- type SearchIndexStore
- type SearchIndexStoreFuncs
- func (f SearchIndexStoreFuncs) Manifest(ctx context.Context, namespace IndexNamespace) ([]StoredChunkRef, error)
- func (f SearchIndexStoreFuncs) Nearest(ctx context.Context, namespaces []IndexNamespace, vector []float32, limit int) ([]ScoredChunkHit, error)
- func (f SearchIndexStoreFuncs) Reconcile(ctx context.Context, namespace IndexNamespace, revision string, ...) error
- type SearchRequest
- type SearchResult
- type SessionAppend
- type SessionBinding
- type SessionFilter
- type SessionHolder
- type SessionHolderRecord
- type SessionID
- type SessionMetadata
- type SessionStore
- type SessionSummary
- type ShowRequest
- type ShowResult
- type Snapshot
- type SnapshotData
- type StagedBlob
- type StagedBlobReader
- type StagedBlobStore
- type StoredChunkRef
- type StoredEntryRef
- type StoredEvent
- type StoredSession
- type TransitionResult
- type ViewRequest
- type ViewResult
- type WIPDocument
- type WorkflowAbandonResult
- type WorkflowAdvanceRequest
- type WorkflowChooser
- type WorkflowChooserOption
- type WorkflowInstanceSummary
- type WorkflowOpenRequest
- type WorkflowParkResult
- type WorkflowResumeRequest
- type WorkflowResumeResult
- type WorkflowServe
- type WorkflowSession
- func (w *WorkflowSession) Abandon(ctx context.Context, identity RequestIdentity, instance, reason string) (WorkflowAbandonResult, error)
- func (w *WorkflowSession) Advance(ctx context.Context, identity RequestIdentity, request WorkflowAdvanceRequest) (*WorkflowServe, error)
- func (w *WorkflowSession) Binding() SessionBinding
- func (w *WorkflowSession) Framing(ctx context.Context, identity RequestIdentity) (string, error)
- func (w *WorkflowSession) ID() SessionID
- func (w *WorkflowSession) IsShell(instance string) bool
- func (w *WorkflowSession) Leave(ctx context.Context, identity RequestIdentity) error
- func (w *WorkflowSession) LogRead(ctx context.Context, identity RequestIdentity, tool string, ...) error
- func (w *WorkflowSession) OpenInstances() []WorkflowInstanceSummary
- func (w *WorkflowSession) Park(ctx context.Context, identity RequestIdentity, instance, note string) (WorkflowParkResult, error)
- func (w *WorkflowSession) Project() ProjectID
- func (w *WorkflowSession) Release(ctx context.Context, identity RequestIdentity) error
- func (w *WorkflowSession) Reopen(ctx context.Context, identity RequestIdentity, label string) (*WorkflowServe, error)
- func (w *WorkflowSession) ServeAll(ctx context.Context, identity RequestIdentity) (WorkflowResumeResult, error)
- func (w *WorkflowSession) ServeShell(ctx context.Context, identity RequestIdentity) (*WorkflowServe, error)
- func (w *WorkflowSession) StageAttachment(ctx context.Context, identity RequestIdentity, filename string, content []byte) (string, error)
- func (w *WorkflowSession) Start(ctx context.Context, identity RequestIdentity, request WorkflowStartRequest) (*WorkflowServe, error)
- type WorkflowSessionSummary
- type WorkflowStartRequest
Constants ¶
const ( DefaultShowUpDepth = query.DefaultUpDepth DefaultShowDownDepth = query.DefaultDownDepth )
Default show expansion depths favor grounding context while keeping the typically wider consumer side shallow.
const ( WorkflowEventCode = "workflow_event" DefaultShellCanonical = "user-dialogue" WorkflowMaxLabelLength = 120 ExecutionForkPreferred = "fork-preferred" )
const PreparedTransitionVersion uint32 = 1
const SessionCodecVersion uint32 = 1
Variables ¶
var ErrSessionNotFound = errors.New("sdd: session not found")
Functions ¶
func AttachmentDirRelPath ¶
AttachmentDirRelPath returns the graph-relative attachment directory for an entry ID.
func MutationBatchDigest ¶
func MutationBatchDigest(batch MutationBatch) (string, error)
MutationBatchDigest returns the SDD-owned digest over a storage-neutral batch. The Digest field itself is excluded.
Types ¶
type AccessResolver ¶
type AccessResolver interface {
ResolvePrincipal(context.Context, RequestIdentity) (Principal, error)
ListProjects(context.Context, Principal) (ProjectList, error)
ResolveProject(context.Context, Principal, ProjectID, Access) (*ProjectRuntime, error)
ResolveDependency(context.Context, Principal, ProjectID, string) (*ProjectRuntime, error)
}
AccessResolver is the single identity, project-access, and dependency authorization boundary. Implementations must resolve current authorization from ctx on every call; previously returned principals and runtimes are not proof of current access.
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application resolves current access and dispatches protocol-neutral SDD operations. Every method resolves identity and project afresh.
func NewApplication ¶
func NewApplication(access AccessResolver) (*Application, error)
func (*Application) AbandonWorkflowSession ¶
func (a *Application) AbandonWorkflowSession(ctx context.Context, identity RequestIdentity, project ProjectID, request WorkflowResumeRequest, reason string) (WorkflowAbandonResult, error)
func (*Application) ApplyPrepared ¶
func (a *Application) ApplyPrepared(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, prepared PreparedTransition) (TransitionResult, error)
ApplyPrepared durably records intent before canonical apply and outcome afterward. Unknown apply outcomes retain staged blobs for reconciliation; definitive outcomes release them after all applied finalizers succeed.
func (*Application) BindSession ¶
func (a *Application) BindSession(ctx context.Context, identity RequestIdentity, project ProjectID, request BindSessionRequest) (BindSessionResult, error)
BindSession establishes the user-level exclusive holder above SessionStore CAS. Expired holders are replaced and recorded; replacing a live holder requires an explicit takeover request.
func (*Application) CreateEntry ¶
func (a *Application) CreateEntry(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, draft EntryDraft) (CreateEntryResult, error)
CreateEntry runs SDD-owned validation and pre-flight, prepares canonical document/blob facts, then enters the durable transition protocol.
func (*Application) CurrentSnapshot ¶
func (a *Application) CurrentSnapshot(ctx context.Context, identity RequestIdentity, project ProjectID) (*Snapshot, error)
CurrentSnapshot resolves current read access and returns the opaque canonical snapshot for protocol adapters that host SDD's engine.
func (*Application) FinishWIP ¶
func (a *Application) FinishWIP(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, markerID string) (MutationResult, error)
func (*Application) Info ¶
func (a *Application) Info(ctx context.Context, identity RequestIdentity, project ProjectID, _ InfoRequest) (InfoResult, error)
func (*Application) ListSessions ¶
func (a *Application) ListSessions(ctx context.Context, identity RequestIdentity, project ProjectID) (ListSessionsResult, error)
func (*Application) ListWorkflowSessions ¶
func (a *Application) ListWorkflowSessions(ctx context.Context, identity RequestIdentity, project ProjectID) ([]WorkflowSessionSummary, error)
func (*Application) OpenWorkflow ¶
func (a *Application) OpenWorkflow(ctx context.Context, identity RequestIdentity, project ProjectID, request WorkflowOpenRequest) (*WorkflowSession, *WorkflowServe, error)
func (*Application) Procedures ¶
func (a *Application) Procedures(ctx context.Context, identity RequestIdentity, project ProjectID, _ ProcedureListRequest) (ProcedureListResult, error)
func (*Application) ReadAttachment ¶
func (a *Application) ReadAttachment(ctx context.Context, identity RequestIdentity, project ProjectID, request ReadAttachmentRequest) (ReadAttachmentResult, error)
func (*Application) RecoverPrepared ¶
func (a *Application) RecoverPrepared(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, mutationID string) (TransitionResult, error)
RecoverPrepared reconciles an intent that has no durable definitive outcome. It is safe after process restart and retries unfinished finalizers.
func (*Application) ReleaseSession ¶
func (a *Application) ReleaseSession(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding) error
func (*Application) ReplaceSummary ¶
func (a *Application) ReplaceSummary(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, entryID, summary string) (MutationResult, error)
func (*Application) ResumeWorkflow ¶
func (a *Application) ResumeWorkflow(ctx context.Context, identity RequestIdentity, project ProjectID, request WorkflowResumeRequest) (*WorkflowSession, WorkflowResumeResult, error)
func (*Application) Search ¶
func (a *Application) Search(ctx context.Context, identity RequestIdentity, project ProjectID, request SearchRequest) (SearchResult, error)
func (*Application) Show ¶
func (a *Application) Show(ctx context.Context, identity RequestIdentity, project ProjectID, request ShowRequest) (ShowResult, error)
func (*Application) StageBlob ¶
func (a *Application) StageBlob(ctx context.Context, identity RequestIdentity, project ProjectID, owner BlobOwner, filename string, content []byte) (StagedBlob, error)
StageBlob resolves current read access before placing immutable bytes in session-scoped scratch. Canonical write access is checked later at the mutation gate, so read-only principals can still conduct dialogue.
func (*Application) StartWIP ¶
func (a *Application) StartWIP(ctx context.Context, identity RequestIdentity, project ProjectID, binding SessionBinding, entryID, description string) (string, MutationResult, error)
func (*Application) View ¶
func (a *Application) View(ctx context.Context, identity RequestIdentity, project ProjectID, request ViewRequest) (ViewResult, error)
func (*Application) Vocabulary ¶
func (a *Application) Vocabulary(ctx context.Context, identity RequestIdentity, project ProjectID) (string, error)
type ApplicationError ¶
type ApplicationError struct {
Code ErrorCode
Message string
Project ProjectRef
Action *ProjectAction
ApplyState ApplyState
Revision string
Version uint32
Holder *SessionHolder
Cause error
}
func (*ApplicationError) Error ¶
func (e *ApplicationError) Error() string
func (*ApplicationError) Unwrap ¶
func (e *ApplicationError) Unwrap() error
type AppliedMutation ¶
type AppliedMutation struct {
Project ProjectID
BatchID string
Revision string
Batch MutationBatch
}
type ApplyResult ¶
type ApplyResult struct {
State ApplyState
Revision string
}
type ApplyState ¶
type ApplyState string
const ( MutationNotApplied ApplyState = "not_applied" MutationApplied ApplyState = "applied" MutationUnknown ApplyState = "unknown" )
type AttachmentMaterialization ¶
type AttachmentMaterialization struct {
BlobID string
Digest BlobDigest
Size int64
SourceName string
LogicalPath string
}
type AttachmentPage ¶
type BindSessionRequest ¶
type BindSessionResult ¶
type BindSessionResult struct {
Project ProjectRef
Binding SessionBinding
Created bool
}
type BlobDigest ¶
type CanonicalChunk ¶
type CanonicalChunk struct {
ID string
EntryID string
Ordinal int
// Revision is deprecated: graph revision is a mutation-concurrency token,
// never a vector-freshness token (d-cpt-65i). Reconciliation and hit
// validity ignore it. Retained only for source compatibility.
Revision string
ContentHash string
Text string
// The following persisted citation and identity fields carry everything a
// store needs to render a citation and answer entry-presence queries
// without re-deriving chunks. Both the CLI indexer and the application
// vector search populate them through the shared chunk-derivation helper.
Body string
Breadcrumb []string
Depth int
IsSummary bool
IsAttachment bool
SourceAttachmentPath string
// EntryHash is the entry-state hash (entry content + summary + attachment
// bytes) — the same definition as the CLI manifest state hash.
EntryHash string
}
type ChooserKind ¶
type ChooserKind string
const ( ChooserGate ChooserKind = "gate" ChooserAgent ChooserKind = "agent" ChooserUser ChooserKind = "user" )
type CreateEntryResult ¶
type CreateEntryResult struct {
Project ProjectRef
Binding SessionBinding
EntryID string
Summary string
Findings []Finding
}
type DocumentChange ¶
type DocumentChange struct {
LogicalPath string
Document *EntryDocument
CanonicalBytes []byte
Delete bool
}
DocumentChange is storage-neutral. CanonicalBytes are rendered once by SDD; Document is present when the logical artifact has structured entry form.
type EmbeddingExecutor ¶
type EmbeddingExecutor interface {
Spec(context.Context) (EmbeddingSpec, error)
Embed(context.Context, []EmbeddingInput) ([]EmbeddingVector, error)
}
type EmbeddingExecutorFuncs ¶
type EmbeddingExecutorFuncs struct {
SpecFunc func(context.Context) (EmbeddingSpec, error)
EmbedFunc func(context.Context, []EmbeddingInput) ([]EmbeddingVector, error)
}
EmbeddingExecutorFuncs adapts mechanical embedding functions to the public executor port.
func (EmbeddingExecutorFuncs) Embed ¶
func (f EmbeddingExecutorFuncs) Embed(ctx context.Context, inputs []EmbeddingInput) ([]EmbeddingVector, error)
func (EmbeddingExecutorFuncs) Spec ¶
func (f EmbeddingExecutorFuncs) Spec(ctx context.Context) (EmbeddingSpec, error)
type EmbeddingInput ¶
type EmbeddingInput struct {
ID string
Text string
Purpose EmbeddingPurpose
}
type EmbeddingPurpose ¶
type EmbeddingPurpose string
const ( EmbeddingDocument EmbeddingPurpose = "document" EmbeddingQuery EmbeddingPurpose = "query" )
type EmbeddingSpec ¶
type EmbeddingSpec struct {
Fingerprint string
}
EmbeddingSpec identifies the vector space an executor embeds into. The fingerprint must uniquely determine the embedding model and with it the vector dimensionality — dimensionality itself is discovered from the vectors on first real use, so lazy providers (ollama reports dimensions only with its first response) satisfy the contract without a probe call.
type EmbeddingVector ¶
type EntryDocument ¶
type EntryDocument struct {
LogicalPath string
Frontmatter map[string]any
Body string
Attachments []string
}
EntryDocument is the storage-neutral form of an entry. Frontmatter carries the canonical graph schema as structured values; SDD validates and normalizes it before constructing a Snapshot.
type EntryDraft ¶
type ErrorCode ¶
type ErrorCode string
const ( ErrorAuthenticationRequired ErrorCode = "authentication_required" ErrorInvalidArgument ErrorCode = "invalid_argument" ErrorProjectRequired ErrorCode = "project_required" ErrorActionRequired ErrorCode = "action_required" ErrorReadDenied ErrorCode = "read_denied" ErrorWriteDenied ErrorCode = "write_denied" ErrorSessionOwnership ErrorCode = "session_ownership_mismatch" ErrorSessionInUse ErrorCode = "session_in_use" ErrorSessionConflict ErrorCode = "session_conflict" ErrorGraphConflict ErrorCode = "graph_conflict" ErrorMigrationRequired ErrorCode = "migration_required" ErrorRecoveryRequired ErrorCode = "recovery_required" )
type FinalizerOutcome ¶
type GraphStore ¶
type GraphStore interface {
Current(context.Context) (*Snapshot, error)
Apply(context.Context, string, MutationBatch, StagedBlobReader) (ApplyResult, error)
Reconcile(context.Context, string, string) (ApplyResult, error)
ReadAttachmentPage(context.Context, string, string, int64, int) (AttachmentPage, error)
}
GraphStore is the canonical graph authority: snapshot reads, atomic mutation, reconciliation, and canonical attachment bytes.
type IndexNamespace ¶
IndexNamespace keys one reconciled vector index. The fingerprint pins the embedding model (and thus the dimensionality), so dimensions are not part of the identity — stores enforce vector-length consistency per namespace at reconcile and query time instead.
type IndexedChunk ¶
type IndexedChunk struct {
Chunk CanonicalChunk
Vector []float32
}
type InfoRequest ¶
type InfoRequest struct{}
type InfoResult ¶
type InfoResult struct {
Project ProjectRef
Participant string
Language string
Search string
}
type LLMExecutor ¶
type LLMExecutorFuncs ¶
type LLMExecutorFuncs struct {
CapabilitiesFunc func(context.Context) ([]string, error)
ExecuteFunc func(context.Context, LLMRequest) (LLMResult, error)
}
LLMExecutorFuncs adapts a raw model executor without moving prompt, parsing, validation, or gate semantics out of SDD.
func (LLMExecutorFuncs) Capabilities ¶
func (f LLMExecutorFuncs) Capabilities(ctx context.Context) ([]string, error)
func (LLMExecutorFuncs) Execute ¶
func (f LLMExecutorFuncs) Execute(ctx context.Context, request LLMRequest) (LLMResult, error)
type LLMRequest ¶
type ListSessionsResult ¶
type ListSessionsResult struct {
Project ProjectRef
Sessions []SessionSummary
}
type MutationBatch ¶
type MutationBatch struct {
ID string
Digest string
Changes []DocumentChange
Attachments []AttachmentMaterialization
Message string
Author Author
}
type MutationFinalizer ¶
type MutationFinalizer interface {
Name() string
Finalize(context.Context, AppliedMutation) error
}
MutationFinalizer is a named, idempotent post-apply effect. It cannot redefine or roll back the canonical MutationBatch.
type MutationResult ¶
type MutationResult struct {
Project ProjectRef
Binding SessionBinding
}
type PreparedTransition ¶
type PreparedTransition struct {
Version uint32
ExpectedGraphRevision string
Batch MutationBatch
BlobOwner BlobOwner
BlobIDs []string
}
PreparedTransition is the storage-neutral write-gate output. It contains only pinned v1 facts; adapters never reconstruct application intent.
type Principal ¶
Principal is the stable identity and graph participant resolved from a current request. It is binding and audit data, never cached authorization.
type ProcedureListRequest ¶
type ProcedureListRequest struct{}
type ProcedureListResult ¶
type ProcedureListResult struct {
Project ProjectRef
Procedures string
}
type ProjectAction ¶
type ProjectAction struct {
ID string
DisplayName string
State ProjectState
ActionURL string
Reason string
}
type ProjectConfigDocument ¶
type ProjectList ¶
type ProjectList struct {
Actions []ProjectAction
Projects []ProjectSummary
}
type ProjectRef ¶
ProjectRef is the only project identity exposed in project-scoped results.
type ProjectRuntime ¶
type ProjectRuntime struct {
// contains filtered or unexported fields
}
ProjectRuntime owns the immutable ports and project configuration resolved for one application operation.
func NewProjectRuntime ¶
func NewProjectRuntime(options ProjectRuntimeOptions) (*ProjectRuntime, error)
func (*ProjectRuntime) Project ¶
func (r *ProjectRuntime) Project() ProjectRef
type ProjectRuntimeOptions ¶
type ProjectRuntimeOptions struct {
Project ProjectRef
Language string
Dependencies []string
Graph GraphStore
Sessions SessionStore
StagedBlobs StagedBlobStore
Embeddings EmbeddingExecutor
SearchIndex SearchIndexStore
LLM LLMExecutor
Finalizers []MutationFinalizer
Now func() time.Time
// ExcludeEmbeddedFromIndex mirrors the CLI's excludeEmbedded semantics for
// the vector index: connected-repo runtimes set it so binary-shipped base
// entries embed once per machine (in the base store) rather than once per
// connected repo. The base runtime leaves it false — its store includes
// embedded entries. The rule is applied identically at index and read time.
ExcludeEmbeddedFromIndex bool
}
type ProjectState ¶
type ProjectState string
ProjectState describes whether a listed project can be used immediately.
const ( ProjectReady ProjectState = "ready" ProjectActionRequired ProjectState = "action_required" )
type ProjectSummary ¶
type ProjectSummary struct {
ProjectRef
SourceID string
CanRead bool
CanWrite bool
State ProjectState
}
type ReadAttachmentRequest ¶
type ReadAttachmentResult ¶
type ReadAttachmentResult struct {
Project ProjectRef
Page AttachmentPage
Available []string
}
type RegistryFunction ¶
func WorkflowRegistryDocs ¶
func WorkflowRegistryDocs(class string) ([]RegistryFunction, error)
type RequestIdentity ¶
RequestIdentity is current-request authentication material supplied by a transport composition. SDD treats Subject as opaque and does not interpret application-specific roles.
type ScoredChunkHit ¶
type ScoredChunkHit struct {
Namespace IndexNamespace
ChunkID string
EntryID string
// Revision is deprecated and ignored by hit validity (see CanonicalChunk).
Revision string
ContentHash string
Score float64
// Persisted citation fields, rendered directly into search citations so a
// hit needs no re-derivation of its source chunk.
Body string
Breadcrumb []string
Depth int
IsSummary bool
IsAttachment bool
SourceAttachmentPath string
}
type SearchIndexEntryManifest ¶ added in v0.16.2
type SearchIndexEntryManifest interface {
IndexedEntries(context.Context, IndexNamespace) ([]StoredEntryRef, error)
}
SearchIndexEntryManifest is an optional capability a persistent store implements so the application can reconcile on entry presence (monotonic accumulation of immutable-entry chunks) instead of chunk-identity comparison. A store that does not implement it falls back to the compatibility reconciliation path in vector search.
type SearchIndexStore ¶
type SearchIndexStore interface {
Manifest(context.Context, IndexNamespace) ([]StoredChunkRef, error)
Reconcile(context.Context, IndexNamespace, string, []IndexedChunk, []string) error
Nearest(context.Context, []IndexNamespace, []float32, int) ([]ScoredChunkHit, error)
}
type SearchIndexStoreFuncs ¶
type SearchIndexStoreFuncs struct {
ManifestFunc func(context.Context, IndexNamespace) ([]StoredChunkRef, error)
ReconcileFunc func(context.Context, IndexNamespace, string, []IndexedChunk, []string) error
NearestFunc func(context.Context, []IndexNamespace, []float32, int) ([]ScoredChunkHit, error)
}
SearchIndexStoreFuncs adapts an index implementation while SDD retains chunking, embedding input, reconciliation decisions, filtering, and ranking.
func (SearchIndexStoreFuncs) Manifest ¶
func (f SearchIndexStoreFuncs) Manifest(ctx context.Context, namespace IndexNamespace) ([]StoredChunkRef, error)
func (SearchIndexStoreFuncs) Nearest ¶
func (f SearchIndexStoreFuncs) Nearest(ctx context.Context, namespaces []IndexNamespace, vector []float32, limit int) ([]ScoredChunkHit, error)
func (SearchIndexStoreFuncs) Reconcile ¶
func (f SearchIndexStoreFuncs) Reconcile(ctx context.Context, namespace IndexNamespace, revision string, upserts []IndexedChunk, deletes []string) error
type SearchRequest ¶
type SearchResult ¶
type SearchResult struct {
Project ProjectRef
Results string
EntryIDs []string
}
type SessionAppend ¶
type SessionAppend struct {
Metadata *SessionMetadata
Events []StoredEvent
}
type SessionBinding ¶
type SessionFilter ¶
type SessionHolder ¶
type SessionHolderRecord ¶
type SessionHolderRecord struct {
Holder SessionHolder
EndedAt time.Time
Reason string
}
type SessionMetadata ¶
type SessionMetadata struct {
CodecVersion uint32
ID SessionID
Subject string
Project ProjectID
Participant string
Label string
Holder *SessionHolder
HolderHistory []SessionHolderRecord
UpdatedAt time.Time
}
SessionMetadata is structured routing and ownership data. Dialogue events remain opaque to the store.
type SessionStore ¶
type SessionStore interface {
Create(context.Context, SessionMetadata) (StoredSession, error)
Load(context.Context, SessionID) (StoredSession, error)
List(context.Context, SessionFilter) ([]StoredSession, error)
Append(context.Context, SessionID, uint64, SessionAppend) (uint64, error)
}
SessionStore persists structured metadata plus ordered opaque events. Append is the sole mutation primitive and must compare ExpectedVersion atomically.
type SessionSummary ¶
type ShowRequest ¶
type ShowResult ¶
type ShowResult struct {
Project ProjectRef
Entries string
FullIDs []string
SummaryIDs []string
}
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is an immutable, validated SDD graph snapshot. Its indexed model remains private; structured and filesystem stores both enter through SnapshotData.
func BuildSnapshot ¶
func BuildSnapshot(_ context.Context, data SnapshotData) (*Snapshot, error)
BuildSnapshot is the single in-memory graph construction path. It validates canonical documents, joins embedded base procedures, and constructs the private indexed model without requiring a filesystem.
type SnapshotData ¶
type SnapshotData struct {
Project ProjectID
Revision string
Config ProjectConfigDocument
Entries []EntryDocument
WIP []WIPDocument
}
SnapshotData contains canonical stored document facts, never derived graph indexes, status, or traversal state.
type StagedBlob ¶
type StagedBlobReader ¶
StagedBlobReader limits Apply to the blobs named by its prepared batch.
type StagedBlobStore ¶
type StagedBlobStore interface {
Stage(context.Context, BlobOwner, string, io.Reader) (StagedBlob, error)
Stat(context.Context, BlobOwner, string) (StagedBlob, error)
Open(context.Context, BlobOwner, string) (io.ReadCloser, error)
Retain(context.Context, BlobOwner, string, []string) error
Release(context.Context, BlobOwner, string) error
}
StagedBlobStore owns immutable session-scoped scratch bytes and durable retention. Sweeping is deliberately composition-side operations work.
type StoredChunkRef ¶
type StoredEntryRef ¶ added in v0.16.2
type StoredEntryRef struct {
EntryID string
}
StoredEntryRef identifies one graph entry represented in a persistent index. Slice 1 keys presence by entry ID alone.
type StoredEvent ¶
type StoredEvent struct {
CodecVersion uint32
Code string
Payload json.RawMessage
}
type StoredSession ¶
type StoredSession struct {
Metadata SessionMetadata
Version uint64
Events []StoredEvent
}
type TransitionResult ¶
type TransitionResult struct {
Project ProjectRef
Binding SessionBinding
Apply ApplyResult
Finalizers []FinalizerOutcome
}
type ViewRequest ¶
type ViewResult ¶
type ViewResult struct {
Project ProjectRef
Sections string
}
type WIPDocument ¶
type WorkflowAbandonResult ¶
type WorkflowAbandonResult struct {
Abandoned bool
Session SessionID
Label string
Discarded []WorkflowInstanceSummary
HeldMarkers []string
Base *WorkflowServe
}
type WorkflowAdvanceRequest ¶
type WorkflowChooser ¶
type WorkflowChooser struct {
Chooser string
Kind ChooserKind
Options []WorkflowChooserOption
}
type WorkflowChooserOption ¶
type WorkflowInstanceSummary ¶
type WorkflowOpenRequest ¶
type WorkflowParkResult ¶
type WorkflowParkResult struct {
Instance string
Procedure string
Step string
Base *WorkflowServe
}
type WorkflowResumeRequest ¶
type WorkflowResumeResult ¶
type WorkflowResumeResult struct {
Session SessionID
Participant string
Label string
Open []WorkflowServe
Instructions string
}
type WorkflowServe ¶
type WorkflowServe struct {
Session SessionID
Instance string
Procedure string
Status string
Step string
Goal string
Instructions string
Missing []string
ReportSchema map[string]any
PendingChooser *WorkflowChooser
Execution string
Produced map[string]any
Diagnostics []string
InstructionUnit string
Base *WorkflowServe
}
func (*WorkflowServe) ReminderInstructions ¶
func (s *WorkflowServe) ReminderInstructions() string
ReminderInstructions composes the short reminder used when a host has already served this instruction unit, while retaining any gate diagnostics.
type WorkflowSession ¶
type WorkflowSession struct {
// contains filtered or unexported fields
}
WorkflowSession is a protocol-neutral, durable engine session. It stores no authorization proof: every operation receives the current request identity and resolves access again before touching project state.
func (*WorkflowSession) Abandon ¶
func (w *WorkflowSession) Abandon(ctx context.Context, identity RequestIdentity, instance, reason string) (WorkflowAbandonResult, error)
func (*WorkflowSession) Advance ¶
func (w *WorkflowSession) Advance(ctx context.Context, identity RequestIdentity, request WorkflowAdvanceRequest) (*WorkflowServe, error)
func (*WorkflowSession) Binding ¶
func (w *WorkflowSession) Binding() SessionBinding
func (*WorkflowSession) Framing ¶
func (w *WorkflowSession) Framing(ctx context.Context, identity RequestIdentity) (string, error)
func (*WorkflowSession) ID ¶
func (w *WorkflowSession) ID() SessionID
func (*WorkflowSession) IsShell ¶
func (w *WorkflowSession) IsShell(instance string) bool
func (*WorkflowSession) Leave ¶
func (w *WorkflowSession) Leave(ctx context.Context, identity RequestIdentity) error
Leave releases the durable holder. A session with no open moves is also auto-concluded so it does not remain as an empty parked dialogue.
func (*WorkflowSession) LogRead ¶
func (w *WorkflowSession) LogRead(ctx context.Context, identity RequestIdentity, tool string, full, summary []string) error
func (*WorkflowSession) OpenInstances ¶
func (w *WorkflowSession) OpenInstances() []WorkflowInstanceSummary
func (*WorkflowSession) Park ¶
func (w *WorkflowSession) Park(ctx context.Context, identity RequestIdentity, instance, note string) (WorkflowParkResult, error)
func (*WorkflowSession) Project ¶
func (w *WorkflowSession) Project() ProjectID
func (*WorkflowSession) Release ¶
func (w *WorkflowSession) Release(ctx context.Context, identity RequestIdentity) error
func (*WorkflowSession) Reopen ¶
func (w *WorkflowSession) Reopen(ctx context.Context, identity RequestIdentity, label string) (*WorkflowServe, error)
func (*WorkflowSession) ServeAll ¶
func (w *WorkflowSession) ServeAll(ctx context.Context, identity RequestIdentity) (WorkflowResumeResult, error)
func (*WorkflowSession) ServeShell ¶
func (w *WorkflowSession) ServeShell(ctx context.Context, identity RequestIdentity) (*WorkflowServe, error)
func (*WorkflowSession) StageAttachment ¶
func (w *WorkflowSession) StageAttachment(ctx context.Context, identity RequestIdentity, filename string, content []byte) (string, error)
func (*WorkflowSession) Start ¶
func (w *WorkflowSession) Start(ctx context.Context, identity RequestIdentity, request WorkflowStartRequest) (*WorkflowServe, error)
type WorkflowSessionSummary ¶
type WorkflowSessionSummary struct {
Session SessionID
Label string
Participant string
Anchor string
Open []WorkflowInstanceSummary
LastActivity time.Time
Holder *SessionHolder
HolderLive bool
}