Documentation
¶
Overview ¶
Package home owns the single-replica POSIX workspace layout beneath STELLA_HOME.
Index ¶
- Variables
- func IsOutcomeUnknown(err error) bool
- type ListOptions
- type MkdirOptions
- type OwnerDeletion
- type OwnerFenceAcquirer
- type OwnerFenceLease
- type OwnerKind
- type PrincipalKind
- type ProjectCoordinateReconcileResult
- type ReadOptions
- type RemoveOptions
- type RenameOptions
- type Root
- func (r *Root) Close() error
- func (r *Root) List(ctx context.Context, name string, o ListOptions) ([]fs.DirEntry, error)
- func (r *Root) Lstat(ctx context.Context, name string) (fs.FileInfo, error)
- func (r *Root) Mkdir(ctx context.Context, name string, mode fs.FileMode, o MkdirOptions) error
- func (r *Root) Read(ctx context.Context, name string, dst io.Writer, o ReadOptions) error
- func (r *Root) Readlink(ctx context.Context, name string) (string, error)
- func (r *Root) Remove(ctx context.Context, name string, o RemoveOptions) error
- func (r *Root) Rename(ctx context.Context, old, new string, o RenameOptions) error
- func (r *Root) Stat(ctx context.Context, name string) (fs.FileInfo, error)
- func (r *Root) Symlink(ctx context.Context, target, name string) error
- func (r *Root) SyncDirectory(ctx context.Context, name string) error
- func (r *Root) Upload(ctx context.Context, name string, src io.Reader, o WriteOptions) error
- func (r *Root) Write(ctx context.Context, name string, src io.Reader, o WriteOptions) error
- type RootAccess
- type RootOpener
- type RootOperations
- type RootScope
- type SkillRootOpener
- type SkillRootOperations
- type Workspace
- type WorkspaceManager
- func (m *WorkspaceManager) AgentIDOccupied(_ context.Context, id string) (bool, error)
- func (m *WorkspaceManager) Close() error
- func (m *WorkspaceManager) OpenExistingSkillRoot(ctx context.Context, req WorkspaceRequest, scope RootScope) (SkillRootOperations, error)
- func (m *WorkspaceManager) OpenRoot(ctx context.Context, req WorkspaceRequest, scope RootScope, access RootAccess) (RootOperations, error)
- func (m *WorkspaceManager) OpenSkillRoot(ctx context.Context, req WorkspaceRequest, scope RootScope, access RootAccess) (SkillRootOperations, error)
- func (m *WorkspaceManager) ReconcileProjectCoordinates(ctx context.Context) (ProjectCoordinateReconcileResult, error)
- func (m *WorkspaceManager) WorkspaceView(ctx context.Context, req WorkspaceRequest) (WorkspaceView, error)
- type WorkspaceRequest
- type WorkspaceView
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrReadLimit = errors.New("home: read limit exceeded") ErrUploadLimit = errors.New("home: upload limit exceeded") ErrListLimit = errors.New("home: list limit exceeded") ErrReadOnly = errors.New("home: root is read-only") ErrOutcomeUnknown = errors.New("home: mutation outcome unknown") )
Functions ¶
func IsOutcomeUnknown ¶
Types ¶
type ListOptions ¶
type ListOptions struct{ Limit int }
type MkdirOptions ¶
type MkdirOptions struct{ Parents bool }
type OwnerDeletion ¶
type OwnerDeletion struct {
// contains filtered or unexported fields
}
func NewOwnerDeletion ¶
func NewOwnerDeletion(db *pgxpool.Pool, manager *WorkspaceManager, fencer OwnerFenceAcquirer) (*OwnerDeletion, error)
func (*OwnerDeletion) DeleteAgent ¶
func (d *OwnerDeletion) DeleteAgent(ctx context.Context, id, actor string) error
func (*OwnerDeletion) DeleteGroup ¶
func (d *OwnerDeletion) DeleteGroup(ctx context.Context, id, actor string) error
func (*OwnerDeletion) DeleteUser ¶
func (d *OwnerDeletion) DeleteUser(ctx context.Context, id, actor string) error
type OwnerFenceAcquirer ¶
type OwnerFenceLease ¶
type OwnerFenceLease interface {
Commit()
Release()
}
type PrincipalKind ¶
type PrincipalKind string
const ( UserPrincipal PrincipalKind = "user" GroupPrincipal PrincipalKind = "group" )
type ProjectCoordinateReconcileResult ¶ added in v0.64.1
ProjectCoordinateReconcileResult reports legacy rows that cannot be mapped without guessing. They remain rejected by runtime coordinate validation, but no longer prevent unrelated Projects from being served.
type ReadOptions ¶
type ReadOptions struct{ MaxBytes int64 }
type RemoveOptions ¶
type RemoveOptions struct{ Recursive bool }
type RenameOptions ¶
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
func (*Root) Close ¶
Close waits for active operations before releasing the owner gate. Callers must not invoke it synchronously from a Read or Write stream callback.
type RootOpener ¶
type RootOpener interface {
OpenRoot(context.Context, WorkspaceRequest, RootScope, RootAccess) (RootOperations, error)
}
RootOpener is the narrow capability-minting port for direct durable file consumers. WorkspaceManager is the production implementation.
type RootOperations ¶
type RootOperations interface {
Close() error
Stat(context.Context, string) (fs.FileInfo, error)
List(context.Context, string, ListOptions) ([]fs.DirEntry, error)
Read(context.Context, string, io.Writer, ReadOptions) error
Write(context.Context, string, io.Reader, WriteOptions) error
Upload(context.Context, string, io.Reader, WriteOptions) error
Mkdir(context.Context, string, fs.FileMode, MkdirOptions) error
Remove(context.Context, string, RemoveOptions) error
Rename(context.Context, string, string, RenameOptions) error
}
RootOperations is the callback-scoped durable filesystem capability exposed to post-authorization consumers. It intentionally contains no physical root path or provider/session coordinate.
type RootScope ¶
type RootScope uint8
const ( RootAgentWorkspace RootScope RootPrincipalData RootSystemSkills RootSystemAgentSkills RootUserSkills RootUserAgentSkills )
type SkillRootOpener ¶
type SkillRootOpener interface {
OpenSkillRoot(context.Context, WorkspaceRequest, RootScope, RootAccess) (SkillRootOperations, error)
OpenExistingSkillRoot(context.Context, WorkspaceRequest, RootScope) (SkillRootOperations, error)
}
SkillRootOpener mints the complete immutable-publication capability for a typed Skill root. Opening an existing root never materializes a missing chain, so offline migration dry-runs remain free of Home writes.
type SkillRootOperations ¶
type SkillRootOperations interface {
RootOperations
Lstat(context.Context, string) (fs.FileInfo, error)
Symlink(context.Context, string, string) error
Readlink(context.Context, string) (string, error)
SyncDirectory(context.Context, string) error
}
SkillRootOperations is the POSIX-only extension needed to publish immutable Skill revisions beneath an already-authorized typed Home root.
type Workspace ¶
type Workspace interface {
WorkspaceView(context.Context, WorkspaceRequest) (WorkspaceView, error)
RootOpener
}
Workspace is the complete control-plane Home boundary: callers may resolve physical roots for provider-private wiring and mint typed rooted capabilities.
type WorkspaceManager ¶
type WorkspaceManager struct {
// contains filtered or unexported fields
}
WorkspaceManager is the sole production materializer of typed workspace roots. PostgreSQL remains owner authority; the filesystem is layout and data authority.
func NewWorkspaceManager ¶
func NewWorkspaceManager(db *pgxpool.Pool, base string) (*WorkspaceManager, error)
func (*WorkspaceManager) AgentIDOccupied ¶
AgentIDOccupied reserves deterministic global Agent roots. Any entry type is occupied and inspection errors fail closed.
func (*WorkspaceManager) Close ¶
func (m *WorkspaceManager) Close() error
Close releases the pinned STELLA_HOME descriptor. The manager must not be used after Close.
func (*WorkspaceManager) OpenExistingSkillRoot ¶
func (m *WorkspaceManager) OpenExistingSkillRoot(ctx context.Context, req WorkspaceRequest, scope RootScope) (SkillRootOperations, error)
func (*WorkspaceManager) OpenRoot ¶
func (m *WorkspaceManager) OpenRoot(ctx context.Context, req WorkspaceRequest, scope RootScope, access RootAccess) (RootOperations, error)
func (*WorkspaceManager) OpenSkillRoot ¶
func (m *WorkspaceManager) OpenSkillRoot(ctx context.Context, req WorkspaceRequest, scope RootScope, access RootAccess) (SkillRootOperations, error)
func (*WorkspaceManager) ReconcileProjectCoordinates ¶ added in v0.64.1
func (m *WorkspaceManager) ReconcileProjectCoordinates(ctx context.Context) (ProjectCoordinateReconcileResult, error)
ReconcileProjectCoordinates converts every safely resolvable legacy row and leaves ambiguous rows isolated behind runtime coordinate validation. The pending CHECK continues to reject new noncanonical values; it is validated only after the final historical row has been reconciled.
func (*WorkspaceManager) WorkspaceView ¶
func (m *WorkspaceManager) WorkspaceView(ctx context.Context, req WorkspaceRequest) (WorkspaceView, error)
type WorkspaceRequest ¶
type WorkspaceRequest struct{ UserID, GroupID, AgentID string }
type WorkspaceView ¶
type WorkspaceView struct {
PrincipalRoot, DataRoot, AgentRoot string
}