Skip to content

n_grind#29

Merged
offx-zinth merged 4 commits intomainfrom
master
Apr 19, 2026
Merged

n_grind#29
offx-zinth merged 4 commits intomainfrom
master

Conversation

@offx-zinth
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly expands the project's documentation and testing infrastructure, adding a Quick Start guide, project anatomy overview, and comprehensive MCP tool references. Functional updates include new handoff handlers for approvals and rejections, environment variable support via dotenv, and modernized Neo4j driver authentication. Review feedback identifies several instances of hardcoded local file paths and database credentials that compromise portability and security. Furthermore, there are naming inconsistencies between the new handlers and the MCP tool definitions, and the test suite's JSON output truncation should be revisited to ensure data integrity for downstream processing.

Comment thread full_test.py

def _save_results(self) -> None:
"""Save detailed results to JSON file."""
results_file = '/home/bhagyarekhab/SMP/FULL_TEST_RESULTS.json'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The results file path is hardcoded to an absolute path. This will cause the script to fail for other developers or in CI/CD environments. Please use a relative path to ensure the script is portable.

Suggested change
results_file = '/home/bhagyarekhab/SMP/FULL_TEST_RESULTS.json'
results_file = 'FULL_TEST_RESULTS.json'

}


class HandoffApproveHandler(MethodHandler):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This handler is correctly defined for the method smp/handoff/approve. However, in smp/protocol/mcp.py (line 765), the corresponding tool smp_handoff_approve incorrectly tries to call smp/handoff/review/approve. Please ensure the tool calls the correct method name to avoid 'Method not found' errors.

}


class HandoffRejectHandler(MethodHandler):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Similar to the approve handler, this handler for smp/handoff/reject is called incorrectly from smp/protocol/mcp.py (line 784) as smp/handoff/review/reject. Please correct the method name in the tool implementation to smp/handoff/reject to ensure it works as expected.

Comment thread test_mcp_tools.py

# Initialize state
print("Setting up SMP services...")
graph = Neo4jGraphStore(uri="bolt://localhost:7687", user="neo4j", password="123456789$Do")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Database credentials are hardcoded in this test file. This is a security risk and makes the test setup brittle. Please use environment variables to configure the database connection, consistent with the pattern used in smp/protocol/mcp.py. You'll also need to import os.

Suggested change
graph = Neo4jGraphStore(uri="bolt://localhost:7687", user="neo4j", password="123456789$Do")
graph = Neo4jGraphStore(
uri=os.environ.get("SMP_NEO4J_URI", "bolt://localhost:7687"),
user=os.environ.get("SMP_NEO4J_USER", "neo4j"),
password=os.environ.get("SMP_NEO4J_PASSWORD", "")
)

print("=" * 80 + "\n")

# Initialize with safety enabled
graph = Neo4jGraphStore(uri="bolt://localhost:7687", user="neo4j", password="123456789$Do")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Database credentials are hardcoded in this test file. This is a security risk and makes the test setup brittle. Please use environment variables to configure the database connection, consistent with the pattern used in smp/protocol/mcp.py. You'll also need to import os.

Suggested change
graph = Neo4jGraphStore(uri="bolt://localhost:7687", user="neo4j", password="123456789$Do")
graph = Neo4jGraphStore(
uri=os.environ.get("SMP_NEO4J_URI", "bolt://localhost:7687"),
user=os.environ.get("SMP_NEO4J_USER", "neo4j"),
password=os.environ.get("SMP_NEO4J_PASSWORD", "")
)

Comment thread MCP_TOOLS_REFERENCE.md
→ Use: `navigate`, `trace`, `context`, `community/get`

### I want to find something
→ Use: `locate`, `search`, `find_flow`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There's a small inconsistency in the tool name. The tool is defined as smp/flow, but in the 'Summary by Use Case' section, it's referred to as find_flow. For clarity, it would be best to use the actual tool name flow here.

Suggested change
→ Use: `locate`, `search`, `find_flow`
→ Use: `locate`, `search`, `flow`

Comment thread PROJECT_STRUCTURE.md
# SMP Project Structure Exploration Summary

## Overview
**SMP (Structural Memory Protocol)** is a graph-based codebase intelligence system that provides AI agents with a programmer's brain instead of flat-text retrieval. It's built on Python 3.11+, FastAPI, Neo4j, ChromaDB, and tree-sitter.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The project description mentions providing AI agents with a "programmer's brain". While evocative, this is informal language. For technical documentation, it's better to use more precise and professional terminology, such as "a structured, queryable representation of the codebase".

Comment thread QUICK_START_GUIDE.md
### Setup
```bash
# Clone and enter directory
cd /home/bhagyarekhab/SMP
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The file path cd /home/bhagyarekhab/SMP is hardcoded. This is specific to your local machine. Please replace it with a placeholder like /path/to/SMP or instruct the user to navigate to their cloned repository directory.

Suggested change
cd /home/bhagyarekhab/SMP
cd /path/to/your/SMP/clone

Comment thread docker-compose.yml
- .env
environment:
NEO4J_AUTH: neo4j/${SMP_NEO4J_PASSWORD:-neo4j_secure_password}
NEO4J_AUTH: neo4j/${SMP_NEO4J_PASSWORD}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Removing the default password is a good security improvement. However, if SMP_NEO4J_PASSWORD is not set in the .env file, it will be empty, potentially causing issues or leaving an empty password. To make the configuration more robust, you can enforce that the variable must be set by using the ? syntax in the variable substitution.

      NEO4J_AUTH: neo4j/${SMP_NEO4J_PASSWORD?Please set SMP_NEO4J_PASSWORD in .env}

Comment thread full_test.py
if 'review_id' in result:
self.last_review_id = result['review_id']

result_str = str(result)[:150] if result else 'None'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The test result strings are truncated to 150 characters before being written to the JSON output. While this might make the console output cleaner, it renders the FULL_TEST_RESULTS.json file less useful for machine processing or detailed analysis, as the JSON values are incomplete strings. Consider writing the full, valid JSON response to the file and only truncating for console display, or provide an option to control this behavior.

Updated CI workflow to activate virtual environment before running commands.
@offx-zinth offx-zinth merged commit ab9add9 into main Apr 19, 2026
1 check failed
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