Skip to content

feat(memory): memory system v2 with search, metadata, and lite recall - #175

Merged
w0wl0lxd merged 23 commits into
mainfrom
feat/memory-system-v2
Jul 29, 2026
Merged

w0wl0lxd merged 23 commits into
mainfrom
feat/memory-system-v2

Conversation

@w0wl0lxd

@w0wl0lxd w0wl0lxd commented Jul 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Identifies memory as the underserved first-class feature (flat view/write/delete vs skill v2 depth).
  • Adds memory v2: YAML frontmatter (tags, topic, importance, layer, synopsis), search with keyword/tag ranking, append, enriched write, and lite-layer session prompt injection with sanitization.
  • Speckit artifacts under specs/007-memory-system-v2/ including adversarial review notes and trimmed scope (no paths frontmatter, no telemetry/index cache in v2).

Research workflow

  • Codegraph / Semble: mapped plugin maturity gaps vs skill/blackboard.
  • Context7 (Letta): archival memory + tags + search patterns.
  • Exa: Claude Code auto-memory, community hybrid-search plugins.
  • Adversarial subagent critique: trimmed scope (defer telemetry, index file, paths field); hardened lite injection.

Test plan

  • cargo test -p n00n-lua spec (34 passed, +5 memory cases)
  • cargo test -p n00n-lua memory_tool_ (2 integration tests)
  • just gen-docs
  • CI full workspace pass

Deferred (v2.1)

  • JSONL telemetry, compaction hooks, auto-recall on user messages
  • Optional semblem/embedding search adapter
  • Append file locking for concurrent multi-agent writes

Note

Medium Risk
Untrusted memory content is injected into system prompts after sanitization, and write/merge semantics changed; risk is moderate but bounded by caps and existing path sandboxing.

Overview
Memory tool v2 expands the project scratchpad from view/write/delete into searchable, metadata-rich notes with safer session hints.

New commands and behavior: search ranks memories by keyword/token overlap and optional tag filters (explicitly not semantic search); append adds body text while preserving YAML frontmatter. write accepts tags, topic, importance, layer (lite/deep), and synopsis; updates merge metadata without wiping omitted fields. view without a path can rank listings via an optional query.

Helpers and injection: memory_helpers.lua gains frontmatter parse/build, ranking/scoring, lite-hint building with sanitization (caps, injection-pattern stripping), and path-safe listing. Session prompt hints inject capped lite-layer summaries instead of only a file count.

Tests and docs: Lua unit tests, plugin_host integration tests for search ranking and append, updated tool docs and cold-start token baselines, and a raised tool-definition byte budget in docgen. Spec artifacts under specs/007-memory-system-v2/ document contracts and deferred v2.1 items (index cache, telemetry).

Reviewed by Cursor Bugbot for commit ee00c14. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Memory System v2 adds YAML metadata, keyword/tag search with ranking, append behavior, sanitized lite-layer hints, expanded command handling, updated UI integration, tests, documentation, and token baselines.

Changes

Memory System v2

Layer / File(s) Summary
Memory v2 contracts and scope
specs/007-memory-system-v2/*
Defines frontmatter, search, append, lite-layer recall, sanitization, and deferred functionality.
Memory parsing and recall pipeline
plugins/memory/memory_helpers.lua
Adds metadata parsing, ranking, entry loading, append handling, path validation, and sanitized lite hints.
Memory commands and UI integration
plugins/memory/init.lua
Adds search and append, updates write and view, enforces limits, and rewires /memory entry handling.
Validation, documentation, and recorded outputs
plugins/memory/tests/spec.lua, n00n-lua/tests/plugin_host.rs, site/docs/content/tools/_index.md, changelog.d/175.added.md, n00n-token-profile/baselines/cold_start.json
Adds coverage for metadata, ranking, append, and sanitization while updating documentation, changelog text, and token baselines.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant MemoryTool
  participant memory_helpers
  participant MemoryFiles
  Caller->>MemoryTool: invoke search or append
  MemoryTool->>memory_helpers: parse input and process entries
  memory_helpers->>MemoryFiles: read or update memory file
  MemoryFiles-->>memory_helpers: memory content and metadata
  memory_helpers-->>MemoryTool: ranked results or rendered entry
  MemoryTool-->>Caller: formatted response
Loading

Suggested reviewers: tontinton

Poem

A rabbit finds notes in a burrow so bright,
Tags hop into order and scores take flight.
Frontmatter stays safe when new lines arrive,
Lite hints are cleaned so good thoughts survive.
Search, append, and memories grow—
Bunny-approved, ready to go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main memory system v2 changes, including search, metadata, and lite recall.
Description check ✅ Passed The description is directly related to the PR and accurately covers the memory v2 feature set and deferred scope.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/memory-system-v2

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.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions 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.

Criterion

Details
Benchmark suite Current: ee00c14 Previous: c2985e6 Ratio
fib/jit_mlua_hook 6447516 ns/iter (± 81665) 4999316 ns/iter (± 145075) 1.29
fib/jit_watchdog 2447082 ns/iter (± 3924) 1893452 ns/iter (± 26503) 1.29
fib/jit_none 2460041 ns/iter (± 33378) 1894198 ns/iter (± 4439) 1.30
fib/interp_mlua_hook 7632705 ns/iter (± 75749) 5867928 ns/iter (± 14819) 1.30
fib/interp_watchdog 3850008 ns/iter (± 13312) 2977370 ns/iter (± 8039) 1.29
fib/interp_none 3751734 ns/iter (± 23345) 2907536 ns/iter (± 14737) 1.29
buffer_rw/jit_mlua_hook 554431 ns/iter (± 3533) 430103 ns/iter (± 3394) 1.29
buffer_rw/jit_watchdog 168272 ns/iter (± 241) 130297 ns/iter (± 138) 1.29
buffer_rw/jit_none 167986 ns/iter (± 415) 130303 ns/iter (± 134) 1.29
buffer_rw/interp_mlua_hook 1039253 ns/iter (± 3981) 827688 ns/iter (± 3964) 1.26
buffer_rw/interp_watchdog 636521 ns/iter (± 6360) 512252 ns/iter (± 13857) 1.24
buffer_rw/interp_none 658001 ns/iter (± 7817) 512467 ns/iter (± 5133) 1.28
splash_render_120x40 68227 ns/iter (± 5717) 55866 ns/iter (± 3080) 1.22
splash_render_200x60 161748 ns/iter (± 15894) 129118 ns/iter (± 10787) 1.25

This comment was automatically generated by workflow using github-action-benchmark.

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_522c13d0-27f0-4c1e-aade-9ac43e85e136)

@w0wl0lxd

Copy link
Copy Markdown
Owner Author

cursor review

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c518f952-6089-4a3e-9013-c33c15f62145)

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_97e02194-4a00-4618-8ac0-03de57e48f04)

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bd43606a-c2aa-4441-bdca-e1154a545056)

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e5c2ff4a-8d7a-46fe-8937-24a24f51670e)

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

w0wl0lxd added 4 commits July 28, 2026 19:58
…call

Structured persistence was the main gap: flat view/write/delete with no search,
tags, append, or session-start recall. Adds frontmatter metadata, keyword search
ranking, append, lite-layer prompt injection with sanitization, and speckit docs.
Filter search to keyword/phrase matches only, encode frontmatter via
n00n.yaml.encode, strengthen lite-hint sanitization, fail append on read
errors, and restore append from merged on-disk body.
The branch adds a default tool, raising main_tools_schemas tool_count from 27 to 28.
Regenerate baselines/cold_start.json in the same PR.
@w0wl0lxd
w0wl0lxd force-pushed the feat/memory-system-v2 branch from c26a794 to 5a5e64b Compare July 29, 2026 00:07
Comment thread plugins/memory/init.lua
Merge prior YAML metadata when write omits optional fields so tags,
topic, layer, synopsis, and importance survive view-then-rewrite.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@linear-code
linear-code Bot marked this pull request as ready for review July 29, 2026 00:12
Comment thread plugins/memory/init.lua
Comment thread plugins/memory/memory_helpers.lua Outdated
Comment thread plugins/memory/memory_helpers.lua
Validate write against the full on-disk payload including frontmatter,
reserve header/newlines in the lite hint byte cap, and drop empty topic
or synopsis after normalize_metadata like parse_frontmatter.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Lite hint skips valid entries
    • build_lite_hint now walks the full sorted lite list until LITE_HINT_LIMIT non-empty sanitized lines are collected instead of stopping after the first five entries.

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 4eea5d3. Configure here.

Comment thread plugins/memory/memory_helpers.lua
Skip empty sanitized summaries by walking the full sorted lite list
until LITE_HINT_LIMIT injectable lines are filled.
@cursor

This comment has been minimized.

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Write skips frontmatter line limit
    • cmd_write now counts lines on the full frontmatter+body payload after build_frontmatter, matching append validation.
  • ✅ Fixed: Lite hint exceeds byte budget
    • build_lite_hint reserves header, inter-line separators, and trailing newline within the 800-byte total before accepting lines.
  • ✅ Fixed: Empty topic kept in metadata
    • normalize_metadata now drops empty/whitespace topic and synopsis to nil, matching parse_frontmatter clearing behavior.

You can send follow-ups to the cloud agent here.

@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: 10

🤖 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 `@n00n-lua/tests/plugin_host.rs`:
- Around line 5081-5118: The test memory_tool_append_preserves_frontmatter only
checks the body returned by cmd_view and does not verify metadata. Extend it
with a follow-up memory search for notes.md (or the seeded topic) and assert the
result includes the preserved topic= and layer= metadata, using the search
output path that formats entry metadata.

In `@plugins/memory/init.lua`:
- Around line 127-130: Wrap the filesystem error values with tostring before
concatenating them into tool error messages: update the read-error handling in
cmd_view at plugins/memory/init.lua lines 127-130, and the delete-error handling
in cmd_delete at plugins/memory/init.lua lines 240-253. Both sites must safely
handle nil errors without changing the existing return behavior.
- Around line 29-41: Export the existing normalize_string_list helper from
memory_helpers.lua, then update parse_tag_filter to reuse that shared helper
instead of duplicating comma-splitting and whitespace-trimming logic. Preserve
the current nil behavior for non-string, empty, or delimiter-only input, and
remove the redundant local parsing implementation.
- Around line 372-387: Replace the `/memory` picker’s `load_entries(dir)` call
with the lightweight `helpers.collect_file_entries(dir)` flow, since
`build_items()` only needs each entry’s path and size. Preserve sorting and
display behavior, and update the edit/delete handlers below to use the resulting
item/entry shape rather than relying on parsed `load_entries` fields.

In `@plugins/memory/memory_helpers.lua`:
- Around line 463-491: Update sanitize_hint_text to strip every injection phrase
and role prefix case-insensitively, including fully uppercase variants, using a
shared case-insensitive matching helper or equivalent approach. Replace the
first-letter-only patterns and remove the string.char obfuscation in
role_prefix_pattern usage, using clear literal patterns for ignore phrases,
developer mode, system, user, assistant, and human prefixes. Extend
sanitize_hint_strips_injection_patterns to cover uppercase or mixed-case inputs.
- Around line 434-441: Remove the unused local `meta` declaration from the loop
in the search-result formatting flow, while preserving the existing `size`,
`lines`, and `total` calculations.
- Around line 150-181: Update parse_frontmatter to preserve and propagate
n00n.yaml.decode errors instead of replacing a failed decode with an empty
metadata table. Extend its return values with the decode error, then update
parse_memory_file, cmd_write, cmd_append, and append_body to handle that error
path and abort without overwriting existing metadata; retain normal
normalization and save behavior for valid frontmatter.

In `@specs/007-memory-system-v2/spec.md`:
- Around line 58-67: Update specs/007-memory-system-v2/spec.md lines 58-67:
revise FR-003 to remove or mark the paths frontmatter field as deferred, and
mark FR-007’s discovery-index caching requirement as deferred or out of scope,
matching tasks.md T004 and contracts/memory_recall.md. Update
specs/007-memory-system-v2/plan.md lines 15-36: annotate or remove the Phase 3/4
commitments and file-map entries for memory_index.lua and memory_telemetry.lua
because neither was delivered.
- Line 15: Update the table row containing the inline code `layer: lite|deep` so
the literal pipe is escaped within the code span, preserving the intended
six-column Markdown table structure.

In `@specs/007-memory-system-v2/tasks.md`:
- Line 19: Correct the typo in the “Optional semblem/embedding search adapter”
task description by replacing “semblem” with “semantic,” leaving the rest of the
wording unchanged.
🪄 Autofix (Beta)

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: 67f02312-a8c3-43bd-94cd-589db74b6f1a

📥 Commits

Reviewing files that changed from the base of the PR and between d464812 and fa6bc4c.

📒 Files selected for processing (12)
  • changelog.d/175.added.md
  • n00n-lua/tests/plugin_host.rs
  • n00n-token-profile/baselines/cold_start.json
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
  • plugins/memory/tests/spec.lua
  • site/docs/content/tools/_index.md
  • specs/007-memory-system-v2/contracts/memory_recall.md
  • specs/007-memory-system-v2/plan.md
  • specs/007-memory-system-v2/research.md
  • specs/007-memory-system-v2/spec.md
  • specs/007-memory-system-v2/tasks.md
📜 Review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: Cursor Bugbot Autofix
  • GitHub Check: Test (Windows)
  • GitHub Check: Rustdoc
  • GitHub Check: MSRV (1.97)
  • GitHub Check: Coverage
  • GitHub Check: Build (Windows)
  • GitHub Check: Test (macOS)
  • GitHub Check: Lint (macOS)
  • GitHub Check: Test
  • GitHub Check: Lint (Windows)
  • GitHub Check: Build
  • GitHub Check: Docs
  • GitHub Check: Analyze (rust)
  • GitHub Check: Criterion
🧰 Additional context used
📓 Path-based instructions (6)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Non-trivial or multi-file changes should use a dedicated git worktree and new branch; do not modify unrelated user changes, force-push, or push to main.
Ship finished work with a clear Conventional Commit message, a pushed branch, and a draft pull request; never add AI-agent attribution to authored content.
Before investigating unfamiliar failures or third-party behavior, research documented behavior first and distinguish unrelated baseline failures from regressions in the touched surface.
Use structural tools before broad searches: prefer codegraph or arbor for cross-file relationships, index before reading files, targeted reads, parallel calls, and code_execution for filtering large outputs.

Files:

  • changelog.d/175.added.md
  • specs/007-memory-system-v2/tasks.md
  • site/docs/content/tools/_index.md
  • specs/007-memory-system-v2/spec.md
  • n00n-token-profile/baselines/cold_start.json
  • specs/007-memory-system-v2/plan.md
  • specs/007-memory-system-v2/research.md
  • specs/007-memory-system-v2/contracts/memory_recall.md
  • n00n-lua/tests/plugin_host.rs
  • plugins/memory/tests/spec.lua
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
site/docs/**/*

📄 CodeRabbit inference engine (AGENTS.md)

User documentation should be warm, simple, concise, easy for non-native English speakers, story-oriented, and contain no em-dashes, emojis, or AI-like tone.

Files:

  • site/docs/content/tools/_index.md
**/*.{rs,ron,json,toml,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Treat LLM and provider output as untrusted input; validate it against schemas, domain constraints, and source evidence before persistence or action.

Files:

  • n00n-token-profile/baselines/cold_start.json
  • n00n-lua/tests/plugin_host.rs
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Workspace Rust lint rules are mandatory: deny unsafe code, production unwrap_used, expect_used, panic, todo!, unimplemented!, dbg!, wildcard imports, and silent-default error handling.
Do not add unsafe code, FFI, global mutable state, static mut, or unchecked transmute-like behavior without written review and an explicit crate-level lint exception.
Use explicit error handling with Result<T, E> rather than panics; propagate typed errors with ?, ok_or_else, and map_err.
Use thiserror for library and domain-specific errors, and color-eyre at binary edges.
Do not silently discard errors with .ok(), unwrap_or, unwrap_or_default, or equivalent defaults; return an error, reject the operation, or use an explicitly named fallback with sanitized structured logging.
Follow Rust idioms, use descriptive variable and function names, avoid unnecessary state and bloat, and keep each line justified.
Import types at the top of the file, use short imported names instead of inline qualified paths, and place constants immediately after imports.
Do not use inline magic numbers or strings; derive Copy only for structs with one primitive field.
Use structured logging with useful fields and provide helpful, sanitized error messages.
Do not commit credentials, API keys, tokens, cookies, authorization headers, or user data, and do not log raw provider payloads, prompts, credentials, or session data.
Validate and authorize HTTP, file, queue, configuration/environment, LLM output, and provider callbacks before mutation or persistence.
Tool execution requires allowlisted tools, scoped credentials, explicit user context, audit events, and refusal or denial tests.
Write meaningful, non-tautological, non-flaky tests; avoid arbitrary sleeps, and define shared constant error/status messages for assertions.

Files:

  • n00n-lua/tests/plugin_host.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (AGENTS.md)

All crates must opt into the workspace lint configuration with [lints] workspace = true; the root workspace lint configuration is authoritative.

Files:

  • n00n-lua/tests/plugin_host.rs
plugins/**/*.lua

📄 CodeRabbit inference engine (AGENTS.md)

Built-in Lua plugins belong under ./plugins and should use the repository's plugin tooling and conventions.

Files:

  • plugins/memory/tests/spec.lua
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
🪛 LanguageTool
specs/007-memory-system-v2/spec.md

[grammar] ~39-~39: Ensure spelling is correct
Context: ...rontmatter, When view loads file, Then body excludes frontmatter. 3. Given...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

specs/007-memory-system-v2/contracts/memory_recall.md

[uncategorized] ~14-~14: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...t is sanitized: control chars stripped, markdown heading/list prefixes removed, `ignore ...

(MARKDOWN_NNP)

🪛 Luacheck (1.2.0)
plugins/memory/memory_helpers.lua

[warning] 437-437: unused variable 'meta'

(W211)

🪛 markdownlint-cli2 (0.23.1)
changelog.d/175.added.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

specs/007-memory-system-v2/spec.md

[warning] 15-15: Table column count
Expected: 6; Actual: 7; Too many cells, extra data will be missing

(MD056, table-column-count)

🔇 Additional comments (9)
specs/007-memory-system-v2/contracts/memory_recall.md (1)

1-29: LGTM!

specs/007-memory-system-v2/research.md (1)

1-40: LGTM!

plugins/memory/tests/spec.lua (2)

162-277: LGTM!


278-282: 📐 Maintainability & Code Quality

Test only covers the casing that already passes; doesn't catch the bypass.

See consolidated comment shared with memory_helpers.lua's sanitization case-sensitivity gap — this test's input phrasing happens to match the only casing the current patterns strip.

n00n-lua/tests/plugin_host.rs (1)

5039-5079: LGTM!

Also applies to: 5120-5147

site/docs/content/tools/_index.md (1)

285-302: LGTM!

changelog.d/175.added.md (1)

1-1: LGTM!

n00n-token-profile/baselines/cold_start.json (1)

7-20: LGTM!

plugins/memory/init.lua (1)

78-86: 🚀 Performance & Scalability

Manual verification needed for register_prompt_hint invocation frequency.

plugins/memory/init.lua unconditionally reads and parses every memory entry in its system prompt-hint content function. The current repo search did not find the register_prompt_hint implementation/call site, so this cannot be classified as per-turn disk I/O without determining whether this content callback is re-evaluated each turn or only at session start.

Comment thread n00n-lua/tests/plugin_host.rs
Comment thread plugins/memory/init.lua
Comment thread plugins/memory/init.lua
Comment thread plugins/memory/init.lua Outdated
Comment thread plugins/memory/memory_helpers.lua
Comment thread plugins/memory/memory_helpers.lua
Comment thread plugins/memory/memory_helpers.lua Outdated
Comment thread specs/007-memory-system-v2/spec.md Outdated
Comment thread specs/007-memory-system-v2/spec.md Outdated
Comment thread specs/007-memory-system-v2/tasks.md Outdated
Harden lite-hint sanitization to be fully case-insensitive, surface
invalid frontmatter YAML instead of silent wipe, share tag parsing,
and align deferred-index/spec docs with what shipped.
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b6ad18c6-5223-4f11-af65-94314f1b2d76)

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c0ba12f0-e29f-4f6d-9bae-bf0c56a6fbb5)

Refresh cold_start baseline and start the cursor pace timer before
the first frame read to avoid flaky FIRST_FRAME_PACE assertions.
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c652103a-a916-4f6b-9141-b1e6de067191)

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
site/docs/content/tools/_index.md (1)

317-317: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document tags as write metadata too.

write accepts tags for frontmatter, but this says they are only a search filter.

Proposed fix
-| `tags` | string | no |  | Comma-separated tags filter for 'search' |
+| `tags` | string | no |  | Comma-separated tags metadata for 'write' and filter for 'search' |
🤖 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 `@site/docs/content/tools/_index.md` at line 317, Update the `tags` entry in
the tools parameter table to document that tags are accepted as write
frontmatter metadata as well as used for the `search` filter; preserve the
existing type and optionality details.
n00n-providers/src/providers/cursor/run.rs (1)

614-656: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Remove raw provider-payload diagnostics.

The global dump retains every decoded provider frame without a bound, then Line 553 writes it to a fixed /tmp path and Lines 560-566 return a payload-derived sample in an API error. This can persist or expose prompts, model output, checkpoint data, or session content.

  • n00n-providers/src/providers/cursor/run.rs#L614-L656: retain only bounded, sanitized counters or protocol metadata; do not clone raw frame payloads or derive textual previews.
  • n00n-providers/src/providers/cursor/run.rs#L546-L566: remove the raw frame dump and payload sample from timeout diagnostics; return non-sensitive frame/count metadata only.

As per coding guidelines, “Do not log raw provider payloads, prompts, credentials, or session data.”

🤖 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 `@n00n-providers/src/providers/cursor/run.rs` around lines 614 - 656, Remove
raw payload retention and textual preview generation from the frame-processing
logic around iter_fields in n00n-providers/src/providers/cursor/run.rs lines
614-656; keep only bounded, sanitized counters or protocol metadata and do not
clone payloads. Update the timeout diagnostics around lines 546-566 to remove
the global raw-frame dump and payload-derived sample, returning only
non-sensitive frame/count metadata.

Source: Coding guidelines

🤖 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 `@n00n-lua/tests/plugin_host.rs`:
- Around line 5923-5927: Update the search assertion in the test around the
existing auth.md and score checks to verify ordering, not merely inclusion:
capture the positions of both auth.md and lua.md in out and assert that auth.md
appears before lua.md. Retain the score assertion and make the position checks
fail clearly if either result is missing.

---

Outside diff comments:
In `@n00n-providers/src/providers/cursor/run.rs`:
- Around line 614-656: Remove raw payload retention and textual preview
generation from the frame-processing logic around iter_fields in
n00n-providers/src/providers/cursor/run.rs lines 614-656; keep only bounded,
sanitized counters or protocol metadata and do not clone payloads. Update the
timeout diagnostics around lines 546-566 to remove the global raw-frame dump and
payload-derived sample, returning only non-sensitive frame/count metadata.

In `@site/docs/content/tools/_index.md`:
- Line 317: Update the `tags` entry in the tools parameter table to document
that tags are accepted as write frontmatter metadata as well as used for the
`search` filter; preserve the existing type and optionality details.
🪄 Autofix (Beta)

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: 1afd8fc8-a909-437f-a36c-4fd5af835787

📥 Commits

Reviewing files that changed from the base of the PR and between 5effec1 and 72e122b.

📒 Files selected for processing (10)
  • n00n-lua/tests/plugin_host.rs
  • n00n-providers/src/providers/cursor/run.rs
  • n00n-token-profile/baselines/cold_start.json
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
  • plugins/memory/tests/spec.lua
  • site/docs/content/tools/_index.md
  • specs/007-memory-system-v2/plan.md
  • specs/007-memory-system-v2/spec.md
  • specs/007-memory-system-v2/tasks.md
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Test (Windows)
  • GitHub Check: Docs
  • GitHub Check: Test (macOS)
  • GitHub Check: Test
  • GitHub Check: Build
  • GitHub Check: Build (Windows)
  • GitHub Check: Lint (Windows)
  • GitHub Check: Lint
  • GitHub Check: Criterion
  • GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (6)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Non-trivial or multi-file changes should use a dedicated git worktree and new branch; do not modify unrelated user changes, force-push, or push to main.
Ship finished work with a clear Conventional Commit message, a pushed branch, and a draft pull request; never add AI-agent attribution to authored content.
Before investigating unfamiliar failures or third-party behavior, research documented behavior first and distinguish unrelated baseline failures from regressions in the touched surface.
Use structural tools before broad searches: prefer codegraph or arbor for cross-file relationships, index before reading files, targeted reads, parallel calls, and code_execution for filtering large outputs.

Files:

  • specs/007-memory-system-v2/tasks.md
  • specs/007-memory-system-v2/plan.md
  • specs/007-memory-system-v2/spec.md
  • site/docs/content/tools/_index.md
  • n00n-providers/src/providers/cursor/run.rs
  • n00n-token-profile/baselines/cold_start.json
  • n00n-lua/tests/plugin_host.rs
  • plugins/memory/tests/spec.lua
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
site/docs/**/*

📄 CodeRabbit inference engine (AGENTS.md)

User documentation should be warm, simple, concise, easy for non-native English speakers, story-oriented, and contain no em-dashes, emojis, or AI-like tone.

Files:

  • site/docs/content/tools/_index.md
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Workspace Rust lint rules are mandatory: deny unsafe code, production unwrap_used, expect_used, panic, todo!, unimplemented!, dbg!, wildcard imports, and silent-default error handling.
Do not add unsafe code, FFI, global mutable state, static mut, or unchecked transmute-like behavior without written review and an explicit crate-level lint exception.
Use explicit error handling with Result<T, E> rather than panics; propagate typed errors with ?, ok_or_else, and map_err.
Use thiserror for library and domain-specific errors, and color-eyre at binary edges.
Do not silently discard errors with .ok(), unwrap_or, unwrap_or_default, or equivalent defaults; return an error, reject the operation, or use an explicitly named fallback with sanitized structured logging.
Follow Rust idioms, use descriptive variable and function names, avoid unnecessary state and bloat, and keep each line justified.
Import types at the top of the file, use short imported names instead of inline qualified paths, and place constants immediately after imports.
Do not use inline magic numbers or strings; derive Copy only for structs with one primitive field.
Use structured logging with useful fields and provide helpful, sanitized error messages.
Do not commit credentials, API keys, tokens, cookies, authorization headers, or user data, and do not log raw provider payloads, prompts, credentials, or session data.
Validate and authorize HTTP, file, queue, configuration/environment, LLM output, and provider callbacks before mutation or persistence.
Tool execution requires allowlisted tools, scoped credentials, explicit user context, audit events, and refusal or denial tests.
Write meaningful, non-tautological, non-flaky tests; avoid arbitrary sleeps, and define shared constant error/status messages for assertions.

Files:

  • n00n-providers/src/providers/cursor/run.rs
  • n00n-lua/tests/plugin_host.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (AGENTS.md)

All crates must opt into the workspace lint configuration with [lints] workspace = true; the root workspace lint configuration is authoritative.

Files:

  • n00n-providers/src/providers/cursor/run.rs
  • n00n-lua/tests/plugin_host.rs
**/*.{rs,ron,json,toml,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Treat LLM and provider output as untrusted input; validate it against schemas, domain constraints, and source evidence before persistence or action.

Files:

  • n00n-providers/src/providers/cursor/run.rs
  • n00n-token-profile/baselines/cold_start.json
  • n00n-lua/tests/plugin_host.rs
plugins/**/*.lua

📄 CodeRabbit inference engine (AGENTS.md)

Built-in Lua plugins belong under ./plugins and should use the repository's plugin tooling and conventions.

Files:

  • plugins/memory/tests/spec.lua
  • plugins/memory/init.lua
  • plugins/memory/memory_helpers.lua
🔇 Additional comments (8)
specs/007-memory-system-v2/plan.md (1)

12-35: LGTM!

specs/007-memory-system-v2/spec.md (1)

15-15: LGTM!

Also applies to: 50-76

specs/007-memory-system-v2/tasks.md (1)

19-19: LGTM!

plugins/memory/memory_helpers.lua (1)

10-36: LGTM!

Also applies to: 161-170, 200-200, 261-265, 472-515, 582-586

plugins/memory/init.lua (1)

33-33: LGTM!

Also applies to: 122-126, 167-170, 233-235, 252-252, 374-425

plugins/memory/tests/spec.lua (1)

281-303: LGTM!

n00n-lua/tests/plugin_host.rs (1)

5931-5984: LGTM!

Also applies to: 5986-6013

n00n-token-profile/baselines/cold_start.json (1)

7-25: LGTM!

Comment thread n00n-lua/tests/plugin_host.rs Outdated
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2f6869f8-595c-47a2-b88f-665f55435c38)

Memory system v2 pushes definitions to ~39.4k; raise the ceiling to
40k so CI's tool_definitions_fit_byte_budget stays green.
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8db3dca4-6f58-473f-8cd8-fc0bd6e5f2b8)

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_df84799f-e3ff-4b8d-81ec-3034bc544224)

- Update search test to verify ordering with position checks
- Document tags as write metadata and search filter in docs
- Skip cursor provider security comment (out of scope for memory PR)
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c206b9bc-11c1-4b82-8b00-f63b348ea878)

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e01b16e4-f59f-45ed-82cf-f62155bccf41)

w0wl0lxd added 2 commits July 29, 2026 00:02
CodeRabbit's docs edit drifted from the memory tool schema source;
update the schema description so gen-docs-check stays green.
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6f65d3b3-074e-4a16-b2de-0f953012584a)

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4c6b6625-a6d7-485e-adc5-bd17e3510d24)

@w0wl0lxd
w0wl0lxd merged commit 33401ff into main Jul 29, 2026
32 checks passed
@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

N00N-110

w0wl0lxd added a commit that referenced this pull request Jul 29, 2026
w0wl0lxd added a commit that referenced this pull request Jul 29, 2026
w0wl0lxd added a commit that referenced this pull request Jul 29, 2026
@w0wl0lxd
w0wl0lxd deleted the feat/memory-system-v2 branch July 29, 2026 22:18
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.

2 participants