Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions policy/memory-action.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ const (
// MemorySearchAction - search (corpus-grep) the objects in a cortex.
MemorySearchAction MemoryAction = "memory:Search"

// MemoryGetObjectBioAction - read an object's biography from a cortex:
// who authored each version of it, when, from which agent and session,
// and what that version carries. Distinct from reading the object, which
// returns the bytes and says nothing about who put them there.
MemoryGetObjectBioAction MemoryAction = "memory:GetObjectBio"

// AllMemoryActions - all AIStor Memory API actions.
AllMemoryActions MemoryAction = "memory:*"
)
Expand All @@ -84,6 +90,7 @@ var SupportedMemoryActions = map[MemoryAction]struct{}{
MemoryDeleteAgentAction: {},
MemoryListAgentsAction: {},
MemorySearchAction: {},
MemoryGetObjectBioAction: {},
AllMemoryActions: {},
}

Expand Down
1 change: 1 addition & 0 deletions policy/memory-action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestMemoryActionIsValid(t *testing.T) {
{MemoryDeleteAgentAction, true},
{MemoryListAgentsAction, true},
{MemorySearchAction, true},
{MemoryGetObjectBioAction, true},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Cover the condition-key contract, not only action validity.

This case proves that MemoryGetObjectBioAction.IsValid() returns true. It does not verify that the action receives common condition keys but excludes MemoryPrefix and MemoryMaxKeys. Add or extend a focused test for createMemoryActionConditionKeyMap.

Based on the action-condition-key contract in policy/memory-action.go, test the non-enumeration behavior explicitly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@policy/memory-action_test.go` at line 42, Extend the focused tests in
memory-action_test.go to cover createMemoryActionConditionKeyMap, verifying that
a valid memory action includes the common condition keys while excluding
MemoryPrefix and MemoryMaxKeys. Keep the existing IsValid test, and assert the
non-enumeration contract explicitly using the definitions in memory-action.go.

{AllMemoryActions, true},
{MemoryAction("memory:FooBar"), false},
{MemoryAction("s3tables:CreateTable"), false},
Expand Down
Loading