Documentation
¶
Index ¶
- Constants
- 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(t string) bool
- func ValidateTierOrErr(raw string) error
- type ACLQuery
- type MemoryProposal
- type MemoryTier
- type ProposalKind
- type ProposalRef
- type ProposalStatus
Constants ¶
const ( TierGlobal = memorypolicy.TierGlobal TierProject = memorypolicy.TierProject TierTask = memorypolicy.TierTask TierWorkspace = memorypolicy.TierWorkspace TierDecision = memorypolicy.TierDecision )
Variables ¶
var ValidMemoryTiers = memorypolicy.ValidTiers
Functions ¶
func AcceptProposal ¶
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 GrantReadACL ¶
func RejectProposal ¶
RejectProposal marks a proposal as rejected. The reviewedBy field identifies the parent agent that rejected the proposal.
func ValidProposalKind ¶
ValidProposalKind returns true if k is a recognized proposal kind.
func ValidateTierOrErr ¶
Types ¶
type ACLQuery ¶
type ACLQuery = memorypolicy.ACLQuery
type MemoryProposal ¶
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 MemoryTier `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 ¶
GetProposal fetches a single proposal by its ID.
func ListPendingProposals ¶
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 MemoryTier ¶
type MemoryTier = memorypolicy.Tier
func DefaultTierForSource ¶
func DefaultTierForSource(sourceKind string) MemoryTier
func NormalizeTier ¶
func NormalizeTier(raw string) MemoryTier
func TierHierarchy ¶
func TierHierarchy() []MemoryTier
func TiersReadableBy ¶
func TiersReadableBy(agentTier MemoryTier) []MemoryTier
func TiersWritableBy ¶
func TiersWritableBy(isParent bool) []MemoryTier
type ProposalKind ¶
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 ¶
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 ¶
func SubmitProposal(ctx context.Context, db *sql.DB, subtaskID, childAgentID, parentAgentID, content string, tier MemoryTier, 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 ¶
type ProposalStatus string
ProposalStatus tracks the lifecycle state of a memory proposal.
const ( StatusPending ProposalStatus = "pending" StatusAccepted ProposalStatus = "accepted" StatusRejected ProposalStatus = "rejected" )