Skip to content

feat(policy): add MemoryGetObjectBioAction - #256

Closed
harshavardhana wants to merge 1 commit into
minio:mainfrom
harshavardhana:feat/memory-getobjectbio-action
Closed

feat(policy): add MemoryGetObjectBioAction#256
harshavardhana wants to merge 1 commit into
minio:mainfrom
harshavardhana:feat/memory-getobjectbio-action

Conversation

@harshavardhana

@harshavardhana harshavardhana commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

Adds memory:GetObjectBio to the Memory API action set.

Motivation

AIStor's Memory API is growing an object-bio route that returns one object's
version history and per-version provenance. Every other Memory surface
authorizes a memory:* action via authorizeMemoryAction; without this
constant the route has to borrow an S3 action, which grants the caller more
than the route needs and makes it the one inconsistent member of the family.

Registered as a read rather than an enumeration: it names one record in its
resource and has no query to constrain, so MemoryPrefix/MemoryMaxKeys do
not apply.

How to test

go test ./policy/ -run MemoryTestMemoryActionIsValid covers the new
constant.

Summary by CodeRabbit

  • New Features
    • Added support for the memory:GetObjectBio action.
    • The action is now recognized as valid and available for action-based conditions.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@harshavardhana, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f625d49c-dfc4-407b-8fc7-16ac88922bba

📥 Commits

Reviewing files that changed from the base of the PR and between d7a15e3 and 1dacab2.

📒 Files selected for processing (1)
  • policy/memory-action.go
📝 Walkthrough

Walkthrough

The PR adds MemoryGetObjectBioAction as a supported Memory API action and updates the validity test to accept it.

Changes

Memory action support

Layer / File(s) Summary
Register and validate the new action
policy/memory-action.go, policy/memory-action_test.go
Adds MemoryGetObjectBioAction, registers it in SupportedMemoryActions, and verifies that the action is valid.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • minio/pkg#248: Adds and registers new MemoryAction constants and updates validity tests.
  • minio/pkg#255: Contains the same action registration and validation changes.
  • minio/pkg#246: Modifies MemoryAction constant declarations in the same file.

Suggested reviewers: dilverse

Poem

A rabbit hops through memory’s gate,
MemoryGetObjectBioAction joins the state.
The registry knows its name,
Tests confirm the claim,
And provenance follows in its wake.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the addition of the MemoryGetObjectBioAction feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with 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.

Inline comments:
In `@policy/memory-action_test.go`:
- 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.

In `@policy/memory-action.go`:
- Around line 68-69: Update the GoDoc for MemoryGetObjectBioAction to state that
it targets a single object and therefore does not use enumeration condition
keys, while retaining the existing description of its version history and
provenance behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36d765ac-d816-4e72-b158-9803207073d3

📥 Commits

Reviewing files that changed from the base of the PR and between 57f7db9 and d7a15e3.

📒 Files selected for processing (2)
  • policy/memory-action.go
  • policy/memory-action_test.go

{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.

Comment thread policy/memory-action.go Outdated
Comment on lines +68 to +69
// MemoryGetObjectBioAction - read one object's version history and
// per-version provenance from a cortex.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the non-enumeration rationale in the GoDoc comment.

The current comment describes what the action returns. Repository guidance requires comments to explain why the code exists. State that this action targets one object and therefore does not use enumeration condition keys.

Proposed comment
-	// MemoryGetObjectBioAction - read one object's version history and
-	// per-version provenance from a cortex.
+	// MemoryGetObjectBioAction targets one object's history instead of
+	// enumerating records, so enumeration condition keys do not apply.

As per coding guidelines, keep comments minimal and explain why the code exists.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// MemoryGetObjectBioAction - read one object's version history and
// per-version provenance from a cortex.
// MemoryGetObjectBioAction targets one object's history instead of
// enumerating records, so enumeration condition keys do not apply.
🤖 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.go` around lines 68 - 69, Update the GoDoc for
MemoryGetObjectBioAction to state that it targets a single object and therefore
does not use enumeration condition keys, while retaining the existing
description of its version history and provenance behavior.

Source: Coding guidelines

An object's biography is who authored each version of it, when, from
which agent and session, and what that version carries. Reading it is a
different question from reading the object, which returns bytes and says
nothing about who put them there, so it needs an action of its own.

Registered as a read: it names one record in its resource and has no
query to constrain, so the enumeration condition keys do not apply.
@harshavardhana
harshavardhana force-pushed the feat/memory-getobjectbio-action branch from d7a15e3 to 1dacab2 Compare August 9, 2026 01:18
@harshavardhana

Copy link
Copy Markdown
Member Author

Closing in favour of #255, which Dil opened first and which carries the same change. I pushed the doc-comment wording onto that branch instead — an object biography is who authored each version, when, from which agent and session, not a version history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant