Skip to content

chore: add cf.add and cf.addnx docs#541

Open
kostasrim wants to merge 1 commit into
kcuckoo1from
kcuckoo2
Open

chore: add cf.add and cf.addnx docs#541
kostasrim wants to merge 1 commit into
kcuckoo1from
kcuckoo2

Conversation

@kostasrim

Copy link
Copy Markdown
Contributor
  • add cf.add docs
  • add cf.addnx docs

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Jun 26, 2026 2:40pm

Request Review

@kostasrim kostasrim self-assigned this Jun 26, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add command reference docs for CF.ADD and CF.ADDNX
📝 Documentation 🕐 Less than 10 minutes

Grey Divider

Description

• Document CF.ADD semantics, return codes, and duplicate-insertion behavior.
• Document CF.ADDNX semantics, return codes, and false-positive caveat.
• Add runnable CLI examples and cross-links to related Cuckoo filter commands.
Diagram

graph TD
  A["Docs navigation"] --> B["Cuckoo filter index"] --> C["cf.add.md"] --> D["cf.addnx.md"]
  C -. "See also" .-> E["Related CF.* docs"]
  D -. "See also" .-> E
  subgraph Legend
    direction LR
    _doc["Doc page"] ~~~ _xref["Cross-link"]
  end
Loading
High-Level Assessment

The chosen approach—adding dedicated command-reference pages per command with shared structure (syntax, complexity, return, examples, and cross-links)—is the most maintainable and consistent with typical command documentation. Alternatives like combining both commands into a single page would reduce discoverability and break the command-per-page pattern.

Files changed (2) +97 / -0

Documentation (2) +97 / -0
cf.add.mdAdd CF.ADD command reference page +48/-0

Add CF.ADD command reference page

• Introduces documentation for CF.ADD, including syntax, time complexity, ACL category, and return codes. Clarifies duplicate insertion behavior vs CF.ADDNX and provides CLI examples plus related-command links.

docs/command-reference/cuckoo-filter/cf.add.md

cf.addnx.mdAdd CF.ADDNX command reference page +49/-0

Add CF.ADDNX command reference page

• Introduces documentation for CF.ADDNX, detailing insert-if-not-exists behavior and the false-positive caveat inherent to Cuckoo filters. Includes return semantics, CLI examples, and cross-links to related CF commands.

docs/command-reference/cuckoo-filter/cf.addnx.md

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. cf.add.md import before H1 📘 Rule violation ⚙ Maintainability
Description
The page front matter is not immediately followed by the single H1 because an MDX import line
appears before the H1 (# CF.ADD / # CF.ADDNX). This breaks the required documentation page
structure and can lead to inconsistent rendering/metadata handling.
Code

docs/command-reference/cuckoo-filter/cf.add.md[R4-6]

+import PageTitle from '@site/src/components/PageTitle';
+
+# CF.ADD
Evidence
PR Compliance ID 1 requires YAML front matter to be followed immediately by a single H1 page title.
In docs/command-reference/cuckoo-filter/cf.add.md, line 4 (import PageTitle ...) appears between
the front matter and the H1 at line 6, and the same pattern occurs in
docs/command-reference/cuckoo-filter/cf.addnx.md where line 4 (import PageTitle ...) appears
between the front matter and the H1 at line 6, demonstrating that both pages violate the required
structure.

AGENTS.md: Documentation Pages Must Use Markdown with YAML Front Matter
docs/command-reference/cuckoo-filter/cf.add.md[1-6]
docs/command-reference/cuckoo-filter/cf.addnx.md[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`docs/command-reference/cuckoo-filter/cf.add.md` and `docs/command-reference/cuckoo-filter/cf.addnx.md` have YAML front matter, but the first content after it is an `import` statement rather than the required single H1 page title.

## Issue Context
Per documentation structure requirements (PR Compliance ID 1), after the YAML front matter block the page must immediately present a single H1 page title; imports should not appear between front matter and the H1.

## Fix Focus Areas
- docs/command-reference/cuckoo-filter/cf.add.md[1-8]
- docs/command-reference/cuckoo-filter/cf.addnx.md[1-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Full-filter response inconsistent 🐞 Bug ≡ Correctness
Description
docs/command-reference/cuckoo-filter/cf.add.md says CF.ADD returns an error when the filter is
full with EXPANSION 0, but the Return section documents an integer 0 for the same condition, so
the page is self-contradictory and unclear about what clients should handle.
Code

docs/command-reference/cuckoo-filter/cf.add.md[R24-32]

+If the filter is full and expansion is disabled (`EXPANSION 0`), an error is returned.
+
+## Return
+
+[Integer reply](https://valkey.io/topics/protocol/#integers):
+
+- `1` if the item was successfully added.
+- `0` if the filter is full and could not be expanded.
+
Evidence
The same file states “an error is returned” for full/unexpandable filters, but then immediately
documents an integer 0 return for that exact situation.

docs/command-reference/cuckoo-filter/cf.add.md[24-32]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`CF.ADD` docs currently describe two different behaviors for the same situation (full filter + `EXPANSION 0`): an error reply vs an integer `0`. This is internally inconsistent and will mislead users implementing error handling.

### Issue Context
The page should describe **one** expected response pattern for the full/unexpandable case, consistent across the prose and Return section.

### Fix Focus Areas
- docs/command-reference/cuckoo-filter/cf.add.md[24-32]

### Suggested fix approach
- Decide the intended behavior for Dragonfly:
 - If it returns an **error**: keep the “error is returned” sentence, remove/adjust the `0` bullet, and add an explicit **Error reply** description.
 - If it returns **`0`**: change the “error is returned” sentence to match the integer return semantics.
- Ensure the Return section fully lists all possible outcomes you mention in the body text.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Broken CF.DEL/EXISTS links 🐞 Bug ⚙ Maintainability
Description
The new CF.ADD and CF.ADDNX pages link to ./cf.del.md and ./cf.exists.md, but those pages are
not present in this docs tree, creating broken internal links (and warnings under the current
Docusaurus config).
Code

docs/command-reference/cuckoo-filter/cf.add.md[48]

+[`CF.ADDNX`](./cf.addnx.md) | [`CF.DEL`](./cf.del.md) | [`CF.EXISTS`](./cf.exists.md) | [`CF.RESERVE`](./cf.reserve.md)
Evidence
Both new pages contain markdown links pointing to ./cf.del.md and ./cf.exists.md. The docs site
is configured to warn on broken markdown links, so these dead targets will be flagged during the
docs build.

docs/command-reference/cuckoo-filter/cf.add.md[21-22]
docs/command-reference/cuckoo-filter/cf.add.md[48-48]
docs/command-reference/cuckoo-filter/cf.addnx.md[49-49]
docusaurus.config.mjs[15-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
New docs link to `./cf.del.md` and `./cf.exists.md`, but these docs are not available in the repository, so the links are dead.

### Issue Context
Docusaurus is configured to warn on broken markdown links; dead links also harm navigation and trust in the command reference.

### Fix Focus Areas
- docs/command-reference/cuckoo-filter/cf.add.md[21-22]
- docs/command-reference/cuckoo-filter/cf.add.md[48-48]
- docs/command-reference/cuckoo-filter/cf.addnx.md[49-49]

### Suggested fix approach
- Either:
 - Add the missing pages (`cf.del.md`, `cf.exists.md`) as part of this PR/series, OR
 - Remove/replace these links until the target docs exist (e.g., link only to `CF.RESERVE` / existing pages, or leave as inline code without a link).
- Keep “See also” limited to pages that are actually present.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. ADDNX return omits error 🐞 Bug ≡ Correctness
Description
docs/command-reference/cuckoo-filter/cf.addnx.md states an error is returned when the filter is
full and EXPANSION 0, but the Return section does not document this error case, leaving the
documented return values incomplete.
Code

docs/command-reference/cuckoo-filter/cf.addnx.md[R25-33]

+If the filter is full and expansion is disabled (`EXPANSION 0`), an error is returned.
+
+## Return
+
+[Integer reply](https://valkey.io/topics/protocol/#integers):
+
+- `1` if the item was successfully added.
+- `0` if the item already exists in the filter (or is a false positive match).
+
Evidence
The body text explicitly says an error is returned for full/unexpandable filters, but the Return
section does not mention any error reply at all.

docs/command-reference/cuckoo-filter/cf.addnx.md[25-33]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `CF.ADDNX` page mentions an error reply for the “full + `EXPANSION 0`” case, but the Return section lists only integer outcomes (`1`/`0`). This makes the Return section incomplete and inconsistent with the description.

### Issue Context
Readers rely on the Return section to implement protocol handling; if errors are possible they should be explicitly listed there.

### Fix Focus Areas
- docs/command-reference/cuckoo-filter/cf.addnx.md[25-33]

### Suggested fix approach
- Add an **Error reply** entry under Return covering the “full + expansion disabled” case, OR
- If the command does **not** error in that case, update the earlier sentence to match the actual return semantics and keep Return consistent.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines +4 to +6
import PageTitle from '@site/src/components/PageTitle';

# CF.ADD

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. cf.add.md import before h1 📘 Rule violation ⚙ Maintainability

The page front matter is not immediately followed by the single H1 because an MDX import line
appears before the H1 (# CF.ADD / # CF.ADDNX). This breaks the required documentation page
structure and can lead to inconsistent rendering/metadata handling.
Agent Prompt
## Issue description
`docs/command-reference/cuckoo-filter/cf.add.md` and `docs/command-reference/cuckoo-filter/cf.addnx.md` have YAML front matter, but the first content after it is an `import` statement rather than the required single H1 page title.

## Issue Context
Per documentation structure requirements (PR Compliance ID 1), after the YAML front matter block the page must immediately present a single H1 page title; imports should not appear between front matter and the H1.

## Fix Focus Areas
- docs/command-reference/cuckoo-filter/cf.add.md[1-8]
- docs/command-reference/cuckoo-filter/cf.addnx.md[1-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Signed-off-by: Kostas Kyrimis <kostas@dragonflydb.io>
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