Skip to content

test(audit): restore the index_persist audit gating coverage - #1477

Merged
rohitg00 merged 1 commit into
mainfrom
test/audit-index-persist-gating
Oct 6, 2026
Merged

rohitg00 merged 1 commit into
mainfrom
test/audit-index-persist-gating

Conversation

@rohitg00

@rohitg00 rohitg00 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Restores the index_persist audit gating suite that the bucketed index rewrite (#1416) dropped when it replaced test/index-persistence.test.ts.

The suite runs against the current storage: index_persist rows now come from the legacy migration and its cleanup deletes, and audit rows land in the month scope. It checks that:

  • auditing is off by default, and AGENTMEMORY_AUDIT_INDEX_PERSIST is cleared going in and restored going out
  • trimmed and case-insensitive "1" and "true" turn it on, with migrate and delete rows
  • "0", "false", "yes" and blank values keep it off
  • the index still migrates and reloads from buckets when auditing is off

Test-only change. test/index-persistence.test.ts passes on main: 32 tests.

Moved out of the 0.9.30 release PR so it lands on its own with its co-author credit.

Summary by CodeRabbit

  • Tests
    • Added coverage for when index persistence audit entries are recorded, including enabled and disabled settings.
    • Verified index migration and persistence continue to work when auditing is off.

The bucketed index rewrite (#1416) replaced test/index-persistence.test.ts and
dropped the gating suite that #1182 added. Bring it back against the current
storage: index_persist rows now come from the legacy migration and its cleanup
deletes, and audit rows land in the month scope.

The suite clears AGENTMEMORY_AUDIT_INDEX_PERSIST going in and restores it on
the way out, then checks that auditing is off by default, that trimmed and
case-insensitive "1" and "true" turn it on (with migrate and delete rows),
that "0", "false", "yes" and blank values keep it off, and that the index
still migrates and reloads from buckets when auditing is off.

Co-authored-by: Dmitrii Zhukov <dmitry0983@gmail.com>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentmemory Building Building Preview Oct 6, 2026 6:38am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9f16009-ea69-48c2-a362-d298f45557b6
📥 Commits

Reviewing files that changed from the base of the PR and between c51bf3f and f908440.

📒 Files selected for processing (1)
  • test/index-persistence.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The persistence tests now check when index migration adds audit entries and verify that migration still persists and reloads the vector index when auditing is off.

Changes

Index persistence auditing

Layer / File(s) Summary
Audit gating and migration tests
test/index-persistence.test.ts
Tests cover default, enabled, and disabled audit flag values. They check for migrate and delete audit actions and verify migration persistence when auditing is off.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: dmazhukov

Merge Risk: ⚪ Minimal · up to f9084

No actionable merge-blocking risk is evident from the supplied change. Merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: restoring audit-gating test coverage for index_persist.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@rohitg00
rohitg00 merged commit a766b7c into main Oct 6, 2026
13 checks passed
@rohitg00
rohitg00 deleted the test/audit-index-persist-gating branch October 6, 2026 06:42
rohitg00 added a commit that referenced this pull request Oct 6, 2026
… notes

- CHANGELOG: add OpenCode 2 support (#1476, building on #1451 by Tyxiel),
  cite #1477 for the restored audit gating suite, credit Tyxiel, and date
  the release 2026-10-06.
- CONTRIBUTING: the release process now matches AGENTS.md. Bump
  package.json and let docs:sync carry the version.
- Test badges: the aria-label still read 1648+. docs:sync now rewrites the
  aria-label along with the visible number.
rohitg00 added a commit that referenced this pull request Oct 6, 2026
* chore: bump version to 0.10.0

Bump every manifest and the export-import contract to 0.10.0: package.json,
packages/mcp (and its @agentmemory/agentmemory range to ~0.10.0 so the shim
resolves the new release), the Claude, Codex, Cursor, Devin and OpenCode plugin
manifests, the hermes and openclaw integrations, src/version.ts, the
ExportData.version union and supportedVersions.

The deploy templates (fly, railway, render, coolify) now pin
AGENTMEMORY_VERSION 0.10.0 with III_VERSION and III_SDK_VERSION 0.22.1, the
engine and iii-sdk pair this release is built against.

* ci: sync documented numbers and versions automatically

Counts in the READMEs, the 11 translations, AGENTS.md, plugin manifests
and stat badges were kept by hand and had drifted: most translations
still said 124 REST endpoints, the test counts ranged from 596 to 1,674
against about 1,760, and the OpenClaw README said 43 MCP tools.

scripts/docs-sync.ts computes each fact from the source (MCP tools,
core and local-fallback tools, REST endpoints, skills, hooks, tests,
iii functions, source files, lines of code, KV scopes) and rewrites the
previously synced value wherever it is followed by that fact's noun in
any of the documented languages, so deliberate subset numbers are left
alone. scripts/docs-sync.state.json holds the last synced values. A
leftover report names any old value it could not place.

A version bump in package.json carries into src/version.ts, the export
format unions, every manifest that shared the old version, the deploy
templates, the AGENTS.md stats heading and CHANGELOG.md, where the
Unreleased section becomes the new release with its compare link.

npm run docs:sync applies it and npm run docs:check fails on drift; CI
runs the check. The Docs sync workflow runs the sync on each pull
request and commits the result to the branch, then re-dispatches CI
because pushes made with the workflow token start no runs. Fork pull
requests get a failing check with instructions. A drift on main opens
a sync pull request when a DOCS_SYNC_TOKEN secret is configured and
fails with instructions otherwise.

This commit also applies the first sync.

* chore: run docs sync locally before each commit instead of in CI

Drops the Docs sync workflow and the CI docs check. The sync stays a
local step: AGENTS.md now tells contributors and agents to run
`npm run docs:sync` before every commit, as part of the same build,
skills and test sequence CI runs, and to change the source rather than
hand-editing documented numbers or versions.

* docs: document the 0.10.0 features and sync the documented numbers

README: the viewer section now describes the snapshot plus live stream model,
the 12 tabs, the Memories, Sessions, Graph and Health pages and the empty
states. The environment block gains the storage and durability settings
(state backend, Redis URL, state save interval, index save interval, boot
graph compaction), the session sweep, the hook capture filters and the audit
log settings. The key endpoints table lists GET /agentmemory/status and
GET /agentmemory/viewer/snapshot.

npm run docs:sync updates the version, REST endpoint count, test count,
function count, source file and LOC counts and KV scope count across README,
the translated READMEs, AGENTS.md and the stat badges.

* docs(changelog): 0.10.0 release notes

Turn the Unreleased section into 0.10.0 and cover everything merged since
v0.9.29: upgrade notes (engine 0.22.1, boot graph compaction, monthly audit
scopes, bucketed index migration, opt-in Redis, 2 s state saves, stop waiting
for the engine flush, the session sweep, capture filters and the changed
response shapes), then Security, Added, Changed, Fixed and Infrastructure with
PR numbers and credit to the external contributors. Adds the compare link.

* docs(env): document AGENTMEMORY_AUDIT_INDEX_PERSIST

* docs: sync documented numbers after merging main

docs:sync after the main merge: 138 REST endpoints, 2,400+ tests,
311 iii functions, 218 source files, 52,000 lines and 60 KV scopes
across README, the translated READMEs, AGENTS.md and the test badge.

* docs(changelog): finalize the 0.10.0 release notes

Rewrite the 0.10.0 entry to cover everything merged since 0.9.29,
including durable capture, the offline hook spool, the vector pending
log, auth by default, request hardening, the verified engine download,
the release gate and the capture cost bench. Group it into breaking
changes, upgrade notes, first start migrations, added, fixed, security,
performance and docs. Date 2026-10-03.

* chore: release as 0.9.30 instead of 0.10.0

Sets the package, plugin manifests, bridge, deploy templates, export
format list and tests to 0.9.30, dates the changelog entry to the
release day, and adds the embedding key precedence, structured
SessionStart context and engine config docs merged from main.

* feat(website): rebuild agent-memory.dev around use cases and sourced proof

The site leads with what changes for the user instead of how the project
is tested, and every number on it links to where it came from.

- Monochrome design with Geist, a 1.25 type scale and shared motion
  tokens; light and dark themes with a toggle.
- Hero with a rotating headline across memory types and agents, the
  install command, a copyable setup prompt for coding agents, and a
  canvas of the local memory store that answers recall queries.
- Live numbers fetched at build time: GitHub stars, contributors,
  releases, and all-time npm installs of the CLI plus the MCP shim.
- Use cases rendered as agent sessions: one memory across Claude Code,
  Cursor and Codex, session start context, handoff, lessons, commit
  context and transcript import.
- "What your agent gets": a month of history reduced to the 1,571
  tokens the next session needs, with sourced recall, token and
  latency results.
- Scroll walkthrough from tool call to recall, LongMemEval-S question
  matrix, agents grid with connect commands, local-first boundary,
  viewer screenshots, quotes, FAQ with structured data, and install.
- New pages: /benchmarks, /security (including the release gate),
  /privacy, /changelog generated from CHANGELOG.md, and /vs comparison
  pages linked from the footer.
- robots.txt, sitemap.xml, llms.txt and llms-full.txt for agents and
  search, and a monochrome Open Graph image.
- metadataBase now points at agent-memory.dev instead of the parked
  agentmemory.dev domain, which broke link previews.
- Checked at 13 widths from 320 to 1920 pixels with visible scrollbars,
  in light and dark themes, with reduced motion respected throughout.

* feat(website): brand accent, star CTA and mobile hero hierarchy

Bring the docs orange into the monochrome site as the memory color:
recall hits, selected history squares, injected context slots, the
logo's hot tier and retrieval lines, eyebrows and the hero rank.
Buttons and agent logos stay ink and grayscale.

Add a Star on GitHub call to action with the live star count, fix the
mobile hero so the heading outranks the lede, and stop the outgoing
rotating word from peeking into the slot.

* feat(website): pill setup-prompt button with agent glyphs

Restyle the hero setup-prompt button as a mono pill carrying the
Claude, Codex and Cursor glyphs. It lifts on hover with a staggered
glyph rise, and on copy turns the brand orange and reads "Copied,
paste it into your agent". Hero action buttons share the pill radius.

* fix(website,docs): stop scroll jumps and address review findings

Website:
- How it works: step titles form a fixed index and the active step's
  text sits in one stacked slot, so the pinned panel no longer re-centers
  or changes height while scrolling. Short laptop screens get compact
  figure spacing so nothing clips inside the pin.
- Use cases: every scene is sized in one grid cell above 640px, so
  switching tabs no longer changes the section height.
- Reduced motion paints the walkthrough's end state, so Tuesday's
  session and the recall line are visible.
- Footer links Use cases, which the mobile nav hides.
- LongMemEval per-type hits use exact counts from the results file.

Docs:
- docs-sync inventories untracked files and fails check mode when a
  fact cannot be computed.
- OpenClaw README badge shows 54 tools.
- The #1415 changelog entry no longer describes a BM25 save.

* style(design): FINDING-001, agent cards show their connect command

The copy command was invisible until hover, so cards looked empty on
desktop and hid the command from keyboard and touch users. Show it
always, keep the slug unbroken, and use a compact two-column name grid
on phones, where the section was about 4000px tall.

* style(design): FINDING-002, footer divider sits on the content grid

The rule under the ask block was a border on the padded wrap, so it ran
40px past the content edges on both sides.

* style(design): FINDING-003, first stat starts on the content grid

Every cell carried the same left padding, so the first number sat 24px
inside the edge that every other section aligns to.

* style(design): FINDING-004, hero keeps two actions and a docs link

Three bordered buttons did not fit the copy column, so Read the docs
wrapped onto its own row and looked like a third primary action. It is
now a text link under the setup prompt and GitHub star.

* style(design): FINDING-005, use-case scenes sit centered in the stage

The stage keeps the tallest scene height so tab switches do not move
the page; shorter scenes were pinned to the top with a band of empty
space below. Center them vertically instead.

* style(design): FINDING-006, featured badges share the card left edge

On phones the two badge cards centered their image while the outlet
cards above were left aligned, so the strip had two alignments.

* style(design): FINDING-007, footer file link stays on one line

INSTALL_FOR_AGENTS.md broke before .md in the narrow last column. That
column now sizes to its content.

* style(website): show agent logos in color in the hero headline

The rotating agent logo next to the headline was forced to grayscale.
Show each logo in its real colors.

* docs(release): fold the OpenCode 2 and audit test PRs into the 0.9.30 notes

- CHANGELOG: add OpenCode 2 support (#1476, building on #1451 by Tyxiel),
  cite #1477 for the restored audit gating suite, credit Tyxiel, and date
  the release 2026-10-06.
- CONTRIBUTING: the release process now matches AGENTS.md. Bump
  package.json and let docs:sync carry the version.
- Test badges: the aria-label still read 1648+. docs:sync now rewrites the
  aria-label along with the visible number.

* fix(website): date the benchmark sources and align the data dir copy

- The 14 ms recall figure comes from coding-agent-life-v1 on v0.9.26 and
  the token figures from the v0.6.0 evaluation. Say so next to each
  number on the home page, the benchmarks page and llms.txt.
- The security page now lists $XDG_DATA_HOME for Linux, matching
  llms-full.txt and the CLI.
- Regenerate the build-time meta and changelog data for 0.9.30.

* fix(docs): auth note in translations and docs-sync version rules

- The translated READMEs still said protected endpoints need a bearer
  token only when AGENTMEMORY_SECRET is set. Auth is on by default; match
  the English README in all eleven.
- docs-sync resolves its root from import.meta.url, so it runs on every
  Node 20 release the package supports, not only 20.11 and later.
- A version bump now also moves the @agentmemory/agentmemory dependency
  in packages/mcp/package.json, and every matching version rule applies
  to a file instead of only the first.

* fix(copilot): validate bundled MCP and lifecycle capture

* fix(antigravity): validate native capture and shared configuration

This branch was successfully deployed

1 active deployment
Preview — f9084404 Deployed Oct 6, 2026 by vercel[bot]
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