Documentation
¶
Index ¶
- Variables
- func AgentCanAccessMemory(ctx context.Context, db *sql.DB, memoryID, agentID, workspaceID string, ...) (bool, error)
- func GrantReadACL(ctx context.Context, db *sql.DB, memoryID, agentID, grantedBy string) error
- func RevokeACL(ctx context.Context, db *sql.DB, memoryID, agentID, permission string) error
- func ValidTier(raw string) bool
- func ValidateTierOrErr(raw string) error
- type ACLQuery
- type Tier
Constants ¶
This section is empty.
Variables ¶
var ValidTiers = []Tier{ TierGlobal, TierProject, TierTask, TierWorkspace, TierDecision, }
ValidTiers is the ordered set of accepted memory governance tiers.
Functions ¶
func AgentCanAccessMemory ¶
func AgentCanAccessMemory(ctx context.Context, db *sql.DB, memoryID, agentID, workspaceID string, readableTiers []Tier) (bool, error)
AgentCanAccessMemory checks explicit ACL grants, workspace tier visibility, and the agent's own workspace scratch memory allowance.
func GrantReadACL ¶
GrantReadACL grants one agent explicit read access to one memory item.
func ValidateTierOrErr ¶
ValidateTierOrErr rejects unknown tier names with a public error message.
Types ¶
type ACLQuery ¶
type ACLQuery struct {
AgentID string
IsParent bool
ReadTiers []Tier
WriteTier Tier
WorkspaceID string
}
ACLQuery captures the caller's memory tier window and explicit ACL identity.
func (ACLQuery) CanRead ¶
CanRead reports whether the query identity can read tier through its tier window.
func (ACLQuery) ReadScopeSQL ¶
ReadScopeSQL returns the SQL clause and args for readable memory rows.
type Tier ¶
type Tier string
Tier identifies the governance level that owns a memory item.
func DefaultTierForSource ¶
DefaultTierForSource assigns source kinds to conservative memory tiers.
func Hierarchy ¶
func Hierarchy() []Tier
Hierarchy returns tiers from broadest/global to most governed/decision.
func NormalizeTier ¶
NormalizeTier returns a valid tier, defaulting unknown input to global.
func ReadableBy ¶
ReadableBy returns the tier window visible to an agent at agentTier.
func WritableBy ¶
WritableBy returns the tiers an agent may write directly.