Skip to content

fix: address PR #44 release review comments#46

Merged
fvadicamo merged 2 commits into
developfrom
fix/pr44-review-fixes
Mar 22, 2026
Merged

fix: address PR #44 release review comments#46
fvadicamo merged 2 commits into
developfrom
fix/pr44-review-fixes

Conversation

@fvadicamo

@fvadicamo fvadicamo commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

What

  • Disallow empty namespace in TokenRequest (min_length=1)
  • Update ingest.sh help text to include Markdown
  • Normalize safeguard mode with strip().lower()

Why

Review comments on PR #44 (release v0.3.0, develop -> main) identified these issues.
Fixes go to develop first, then PR #44 picks them up.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Help text for the ingest script now indicates Markdown (MD) files are supported alongside PDF, DOCX, and PPTX formats.
  • Bug Fixes

    • Improved safeguard mode handling with case-insensitive input normalization for consistent behavior.
    • Added validation to enforce minimum length of 1 character for namespace fields when provided.

- service.py: disallow empty namespace in TokenRequest (min_length=1)
- ingest.sh: update help text to include MD format
- safeguards: normalize mode with strip().lower() before matching

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fvadicamo fvadicamo added this to the v0.3.0 milestone Mar 22, 2026
@github-actions github-actions Bot added the component:core vektra-core component label Mar 22, 2026
@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@fvadicamo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d2b9b05-7b7a-4556-8546-42a075318cd8

📥 Commits

Reviewing files that changed from the base of the PR and between 11861af and a78d5d9.

📒 Files selected for processing (1)
  • scripts/ingest.sh
📝 Walkthrough

Walkthrough

Three utility updates across the Vektra stack: help text documentation now includes Markdown as an accepted file type, the safeguards mode argument receives normalization before comparison, and token request namespace field adds minimum length validation.

Changes

Cohort / File(s) Summary
Documentation & Help Text
scripts/ingest.sh
Updated --help output to include Markdown (MD) in the list of accepted FILE types (PDF, DOCX, PPTX, MD).
Validation & Normalization
vektra-core/src/vektra_core/safeguards/__init__.py
Added strip() and lower() normalization to mode argument before mode comparisons; normalized value drives conditional logic for Presidio selection and fallback warnings.
Field Constraints
vektra-learn/src/vektra_learn/service.py
Added min_length=1 constraint to TokenRequest.namespace field (nullable) alongside existing max_length=64.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

documentation, component:core

Poem

🐰 Hop hop, the formats now gleam,
Markdown joins the ingest team!
Modes normalized, clean and trim,
Namespaces bounded on a whim—
Small tweaks that make the system shine,
Our validation flow divine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references PR #44 review comments but does not clearly specify what was fixed, making it vague and generic. Consider using a more specific title that describes the main changes, such as: 'fix: normalize safeguard mode, validate namespace, and update ingest help text' or focus on the most impactful change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr44-review-fixes

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 and usage tips.

@fvadicamo fvadicamo mentioned this pull request Mar 22, 2026
5 tasks
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses review comments from PR #44, focusing on input validation, documentation, and normalization within the vektra-core and vektra-learn modules. These changes enhance the robustness and clarity of the system.

Highlights

  • Namespace Validation: The TokenRequest now disallows empty namespaces by enforcing a minimum length of 1.
  • Help Text Update: The ingest.sh script's help text was updated to include Markdown as a supported file type.
  • Safeguard Mode Normalization: Safeguard mode is now normalized by stripping whitespace and converting to lowercase for consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

🧹 Nitpick comments (1)
scripts/ingest.sh (1)

61-67: Consider adding .markdown extension support for completeness.

The script currently handles only .md files (line 65), but the backend detection mapping (context snippet 1 from vektra-ingest/src/vektra_ingest/detection.py) supports both .md and .markdown extensions. Users with .markdown files would currently get application/octet-stream as the content type, which may cause processing issues.

📝 Proposed enhancement to support .markdown extension
 case "${FILENAME##*.}" in
   pdf)  CONTENT_TYPE="application/pdf" ;;
   docx) CONTENT_TYPE="application/vnd.openxmlformats-officedocument.wordprocessingml.document" ;;
   pptx) CONTENT_TYPE="application/vnd.openxmlformats-officedocument.presentationml.presentation" ;;
   md)   CONTENT_TYPE="text/markdown" ;;
+  markdown) CONTENT_TYPE="text/markdown" ;;
   *)    CONTENT_TYPE="application/octet-stream" ;;
 esac
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/ingest.sh` around lines 61 - 67, The case block that sets
CONTENT_TYPE based on "${FILENAME##*.}" currently handles "md" but not
"markdown", so files with a .markdown extension fall through to
application/octet-stream; update the shell case in scripts/ingest.sh (the
section handling FILENAME expansion and setting CONTENT_TYPE) to add a
"markdown) CONTENT_TYPE=\"text/markdown\" ;;" arm (or combine "md|markdown") so
.markdown files are treated as text/markdown consistently with
vektra_ingest/detection.py.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/ingest.sh`:
- Around line 61-67: The case block that sets CONTENT_TYPE based on
"${FILENAME##*.}" currently handles "md" but not "markdown", so files with a
.markdown extension fall through to application/octet-stream; update the shell
case in scripts/ingest.sh (the section handling FILENAME expansion and setting
CONTENT_TYPE) to add a "markdown) CONTENT_TYPE=\"text/markdown\" ;;" arm (or
combine "md|markdown") so .markdown files are treated as text/markdown
consistently with vektra_ingest/detection.py.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3e08475-8b17-4a4c-a367-d9ed322036a1

📥 Commits

Reviewing files that changed from the base of the PR and between d0a7c86 and 11861af.

📒 Files selected for processing (3)
  • scripts/ingest.sh
  • vektra-core/src/vektra_core/safeguards/__init__.py
  • vektra-learn/src/vektra_learn/service.py

@gemini-code-assist gemini-code-assist 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.

Code Review

The ingest script was updated to support MD files. The safeguard creation logic was updated to normalize the mode string by stripping whitespace and lowercasing it. A minimum length validation was added to the namespace field in the TokenRequest model.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fvadicamo

Copy link
Copy Markdown
Contributor Author

Fixed in a78d5d9. Added .markdown extension support alongside .md (CodeRabbit nitpick on ingest.sh:61-67).

@fvadicamo fvadicamo merged commit a36b191 into develop Mar 22, 2026
19 checks passed
@fvadicamo fvadicamo deleted the fix/pr44-review-fixes branch March 22, 2026 11:56
@fvadicamo fvadicamo self-assigned this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:core vektra-core component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant