Documentation
¶
Index ¶
- Variables
- func AcceptProposal(ctx context.Context, db *sql.DB, proposalID, reviewedBy string, ...) error
- 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 RejectProposal(ctx context.Context, db *sql.DB, proposalID, reviewedBy string) error
- func RevokeACL(ctx context.Context, db *sql.DB, memoryID, agentID, permission string) error
- func ValidProposalKind(k string) bool
- func ValidTier(raw string) bool
- func ValidateTierOrErr(raw string) error
- type ACLQuery
- type MemoryProposal
- type ProposalKind
- type ProposalRef
- type ProposalStatus
- 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 AcceptProposal ¶ added in v0.3.1
func AcceptProposal(ctx context.Context, db *sql.DB, proposalID, reviewedBy string, committedMemoryID *string) error
AcceptProposal marks a proposal as accepted and optionally records the committed memory ID. The reviewedBy field identifies the parent agent that approved the proposal.
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 RejectProposal ¶ added in v0.3.1
RejectProposal marks a proposal as rejected. The reviewedBy field identifies the parent agent that rejected the proposal.
func ValidProposalKind ¶ added in v0.3.1
ValidProposalKind returns true if k is a recognized proposal kind.
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 MemoryProposal ¶ added in v0.3.1
type MemoryProposal struct {
ID int64 `json:"id"`
ProposalID string `json:"proposal_id"`
SubtaskID string `json:"subtask_id"`
ChildAgentID string `json:"child_agent_id"`
ParentAgentID string `json:"parent_agent_id"`
ProposedTier Tier `json:"proposed_tier"`
Kind ProposalKind `json:"kind"`
Content string `json:"content"`
EvidenceJSON json.RawMessage `json:"evidence_json"`
Status ProposalStatus `json:"status"`
ReviewedBy *string `json:"reviewed_by,omitempty"`
ReviewedAt *int64 `json:"reviewed_at,omitempty"`
CommittedMemoryID *string `json:"committed_memory_id,omitempty"`
CreatedAt int64 `json:"created_at"`
}
MemoryProposal represents a child agent's tentative write to durable memory. Children propose; parents review and commit.
func GetProposal ¶ added in v0.3.1
GetProposal fetches a single proposal by its ID.
func ListPendingProposals ¶ added in v0.3.1
func ListPendingProposals(ctx context.Context, db *sql.DB, parentAgentID string) ([]MemoryProposal, error)
ListPendingProposals returns all pending proposals for a given parent agent, ordered by creation time (newest first).
type ProposalKind ¶ added in v0.3.1
type ProposalKind string
ProposalKind enumerates the types of memory a child agent can propose.
const ( KindFact ProposalKind = "fact" KindPreference ProposalKind = "preference" KindDecision ProposalKind = "decision" KindObservation ProposalKind = "observation" KindReport ProposalKind = "report" KindArtifact ProposalKind = "artifact" )
type ProposalRef ¶ added in v0.3.1
type ProposalRef struct {
ProposalID string `json:"proposal_id"`
ChildAgentID string `json:"child_agent_id"`
ParentAgentID string `json:"parent_agent_id"`
Status ProposalStatus `json:"status"`
}
ProposalRef is a lightweight handle returned when submitting a proposal.
func SubmitProposal ¶ added in v0.3.1
func SubmitProposal(ctx context.Context, db *sql.DB, subtaskID, childAgentID, parentAgentID, content string, tier Tier, kind ProposalKind, evidence any) (*ProposalRef, error)
SubmitProposal inserts a child agent's memory proposal into the database. The proposal enters "pending" status awaiting parent review. Returns a ProposalRef for the caller to track the submission.
type ProposalStatus ¶ added in v0.3.1
type ProposalStatus string
ProposalStatus tracks the lifecycle state of a memory proposal.
const ( StatusPending ProposalStatus = "pending" StatusAccepted ProposalStatus = "accepted" StatusRejected ProposalStatus = "rejected" )
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.