fix: standardize config paths and add sqlite3 prerequisite#317
fix: standardize config paths and add sqlite3 prerequisite#317marcusquinn merged 1 commit intomainfrom
Conversation
Addresses GitHub issues #272, #273, #276: - #276: Standardize config file paths to ~/.config/aidevops/ (XDG-compliant) - mainwp-helper.sh: Use ~/.config/aidevops/mainwp-config.json - wordpress-mcp-helper.sh: Use ~/.config/aidevops/wordpress-sites-config.json - onboarding-helper.sh: Check MainWP config at correct location - #273: Add sqlite3 to prerequisites (required by memory system) - setup.md: Add sqlite3 to required dependencies - memory/README.md: Add installation instructions for sqlite3 - onboarding-helper.sh: Check sqlite3 installation status - #272: Add NODE_PATH guidance for Node.js-based helper scripts - build-agent.md: Document NODE_PATH export for global npm modules
Summary of ChangesHello @marcusquinn, 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 significantly enhances the project's setup and configuration management by standardizing where user configuration files are stored, clarifying essential dependencies, and providing crucial guidance for Node.js environments. These changes aim to streamline the onboarding process, improve system compatibility, and ensure a more robust and predictable operational environment for all helper scripts and components. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThis pull request standardizes configuration file paths to XDG-compliant locations, adds sqlite3 as a required prerequisite for the memory system, updates helper scripts with new configuration paths and setup instructions, and documents NODE_PATH requirements for Node.js-based helper scripts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
Code Review
This pull request effectively standardizes configuration paths to be XDG-compliant, adds sqlite3 as a documented prerequisite, and provides guidance for NODE_PATH in Node.js scripts. The changes are well-organized and clearly address the linked issues. I have one suggestion regarding the method used for JSON generation in a shell script, which could be made more robust.
| json+='},"sqlite3":{"installed":' | ||
| is_installed "sqlite3" && json+='true' || json+='false' |
There was a problem hiding this comment.
While this works, building JSON by concatenating strings is very fragile and hard to maintain. A missing comma, brace, or quote will create invalid JSON that can be difficult to debug. This also makes the code harder to read and extend.
A much more robust and maintainable approach would be to use a dedicated JSON processing tool like jq. The entire output_json function could be rewritten to use jq to safely construct the JSON object, eliminating the risk of syntax errors and making future modifications much simpler.
Since jq is already listed as a dependency for the project, it would be beneficial to leverage it here.
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Feb 5 00:07:30 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Thank you for the review feedback! Regarding the JSON construction in Refactoring the entire
I'd be happy to create a follow-up issue to track the JSON construction refactoring as a separate improvement. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.agent/tools/build-agent/build-agent.md:
- Around line 397-405: The inline NODE_PATH snippet in the "Node.js-based helper
scripts" section should be moved into a dedicated subagent file and referenced
by file:line; create a new Markdown helper (suggested name
.agent/tools/build-agent/node-helpers.md) that contains the NODE_PATH export
snippet (export NODE_PATH="$(npm root -g):$NODE_PATH") and an explanatory note,
then replace the inline block in the original doc with a file:line reference
pointing to that new file and the relevant line(s); ensure the section header
"Node.js-based helper scripts" remains and that the new file mentions NODE_PATH
and the node -e usage so readers can locate it.
| # sqlite3 is required for memory system | ||
| if is_installed "sqlite3"; then | ||
| print_service "sqlite3" "ready" "memory system ready" | ||
| else | ||
| print_service "sqlite3" "needs-setup" "required for memory system" | ||
| fi |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the file exists and examine the relevant sections
if [ -f ".agent/scripts/onboarding-helper.sh" ]; then
echo "=== Lines 312-317 (sqlite3 check) ==="
sed -n '312,317p' ".agent/scripts/onboarding-helper.sh"
echo ""
echo "=== Lines 674-676 (JSON output) ==="
sed -n '674,676p' ".agent/scripts/onboarding-helper.sh"
echo ""
echo "=== Context around sqlite3 checks ==="
rg -n "sqlite3" ".agent/scripts/onboarding-helper.sh" -B 2 -A 2
else
echo "File not found"
fiRepository: marcusquinn/aidevops
Length of output: 1103
🌐 Web query:
sqlite3 FTS5 support detection command line programmatic
💡 Result:
Command-line (sqlite3 shell)
1) Check compile options (most direct):
sqlite3 -cmd "PRAGMA compile_options;" :memory: | grep -i ENABLE_FTS5If you see ENABLE_FTS5, the library was built with FTS5. (sqlite.org)
2) Check via SQL boolean (works anywhere SQL runs):
sqlite3 :memory: "SELECT sqlite_compileoption_used('ENABLE_FTS5');"Returns 1 if enabled, else 0. (sqlite.org)
3) Definitive runtime probe (works even if FTS5 is loadable/not compiled-in):
sqlite3 :memory: "CREATE VIRTUAL TABLE __fts5_probe USING fts5(x);"If it errors with no such module: fts5, FTS5 isn’t available to that connection (either not built in, or not loaded). (stackoverflow.com)
Programmatic detection
C / C++
int has_fts5 = sqlite3_compileoption_used("ENABLE_FTS5"); // 1 or 0(Option name may omit the SQLITE_ prefix.) (sqlite.org)
Any language with SQLite access (Python/Go/Rust/Node/etc.)
Run one of these:
Compile-option check:
SELECT sqlite_compileoption_used('ENABLE_FTS5');Runtime probe (most robust):
CREATE VIRTUAL TABLE __fts5_probe USING fts5(x);Catch the error to decide. (stackoverflow.com)
Notes (why there are two styles of checks)
FTS5 can be compiled in (via SQLITE_ENABLE_FTS5) or built/loaded as an extension, so “try to create an fts5 table” is the most certain availability test for the current connection. (www2.sqlite.org)
Citations:
- 1: https://www.sqlite.org/pragma.html?utm_source=openai
- 2: https://www.sqlite.org/c3ref/compileoption_get.html?utm_source=openai
- 3: https://stackoverflow.com/questions/36655777/python-and-sqlite3-check-if-i-can-use-fts5-extension?utm_source=openai
- 4: https://www.sqlite.org/c3ref/compileoption_get.html?utm_source=openai
- 5: https://docs.sqlitecloud.io/docs/sqlite/lang_corefunc?utm_source=openai
- 6: https://stackoverflow.com/questions/36655777/python-and-sqlite3-check-if-i-can-use-fts5-extension?utm_source=openai
- 7: https://www2.sqlite.org/fts5.html?utm_source=openai
🏁 Script executed:
# Search for memory system implementation and sqlite3 usage
echo "=== Searching for memory system code ==="
rg -i "memory.*system|fts5|virtual.*table" ".agent/scripts/" -A 2 -B 2 --max-count=20
echo ""
echo "=== Searching for how sqlite3 is used in scripts ==="
rg "sqlite3" ".agent/scripts/" --type sh -l
echo ""
echo "=== Check if there's a memory module or system documentation ==="
find . -type f \( -name "*memory*" -o -name "*fts*" \) 2>/dev/null | head -20Repository: marcusquinn/aidevops
Length of output: 7833
🌐 Web query:
sqlite3 FTS5 memory system use case why required
💡 Result:
In SQLite terms, the “memory system” is the global memory-allocation subsystem behind sqlite3_malloc()/sqlite3_free() (and friends). FTS5 relies on it because FTS5 is implemented as part of SQLite’s core/extension code and allocates lots of transient working memory (tokenization buffers, doclists/iterators, segment-merge work buffers, etc.) via SQLite’s allocator—so it must have a working SQLite memory allocator configured and initialized, and all allocations must be freed by the same allocator to avoid corruption/leaks. [1][2]
Why you might need to configure it (the “why required” part in real deployments):
- Custom/embedded memory control: On embedded or constrained systems you may want SQLite (and therefore FTS5) to allocate from a fixed pool (
SQLITE_CONFIG_HEAP) or use an allocator like memsys5 designed to reduce fragmentation and provide stronger guarantees. [1] - Instrumentation / limits: SQLite’s allocator supports memory limits and statistics (useful when FTS indexes/queries spike memory). [1]
- Non-default builds: Some builds omit the default allocator (e.g.,
SQLITE_ZERO_MALLOC/SQLITE_OMIT_MEMORY_ALLOCATION), in which case the application must provide/configure one before using SQLite/FTS5. [1][3]
Operationally, allocator configuration is global and generally must be done before sqlite3_initialize() (or after sqlite3_shutdown()), otherwise sqlite3_config() will fail with SQLITE_MISUSE. [4]
FTS5 itself can also be configured to trade memory for speed in some features (e.g., options that cause it to collect extra data up-front can “use more memory”). [5]
Sources: Dynamic memory allocation & custom allocators (SQLITE_CONFIG_HEAP, SQLITE_CONFIG_MALLOC, memsys5) [1]; memory-allocation API contract (sqlite3_malloc/free) [2]; allocator changes/omitting allocator [3]; sqlite3_config() timing rules [4]; FTS5 doc note on options increasing memory use [5].
Detect FTS5 support—it's a hard requirement for the memory system.
The memory and MCP indexing systems (memory-helper.sh, mcp-index-helper.sh) explicitly depend on SQLite FTS5 for full-text search. The current check only validates that sqlite3 is installed, which doesn't guarantee FTS5 is available. A system with sqlite3 but without FTS5 will silently fail when the memory system tries to initialize. Use the FTS5 probe to detect actual capability.
♻️ Suggested FTS5-aware check
- if is_installed "sqlite3"; then
- print_service "sqlite3" "ready" "memory system ready"
- else
- print_service "sqlite3" "needs-setup" "required for memory system"
- fi
+ if is_installed "sqlite3"; then
+ if sqlite3 :memory: 'CREATE VIRTUAL TABLE t USING fts5(content);' &>/dev/null; then
+ print_service "sqlite3" "ready" "memory system ready"
+ else
+ print_service "sqlite3" "partial" "installed, missing FTS5"
+ fi
+ else
+ print_service "sqlite3" "needs-setup" "required for memory system"
+ fiAlso update JSON at lines 674-676 to reflect FTS5 capability (optional):
json+='},"sqlite3":{"installed":'
is_installed "sqlite3" && json+='true' || json+='false'
+ json+=',"fts5":'
+ sqlite3 :memory: 'CREATE VIRTUAL TABLE t USING fts5(content);' &>/dev/null && json+='true' || json+='false'
json+='}}'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # sqlite3 is required for memory system | |
| if is_installed "sqlite3"; then | |
| print_service "sqlite3" "ready" "memory system ready" | |
| else | |
| print_service "sqlite3" "needs-setup" "required for memory system" | |
| fi | |
| # sqlite3 is required for memory system | |
| if is_installed "sqlite3"; then | |
| if sqlite3 :memory: 'CREATE VIRTUAL TABLE t USING fts5(content);' &>/dev/null; then | |
| print_service "sqlite3" "ready" "memory system ready" | |
| else | |
| print_service "sqlite3" "partial" "installed, missing FTS5" | |
| fi | |
| else | |
| print_service "sqlite3" "needs-setup" "required for memory system" | |
| fi |
| **Node.js-based helper scripts:** | ||
| If your helper script uses `node -e` with globally installed npm packages, add this near the top: | ||
|
|
||
| ```bash | ||
| # Set NODE_PATH so Node.js can find globally installed modules | ||
| export NODE_PATH="$(npm root -g):$NODE_PATH" | ||
| ``` | ||
|
|
||
| This is required because Node.js doesn't automatically search the global npm prefix when using inline evaluation (`node -e`). |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for existing Node.js helper templates/subagents in .agent directory
find .agent -name "*.md" | head -20Repository: marcusquinn/aidevops
Length of output: 687
🏁 Script executed:
# Look for NODE_PATH or node helper references in .agent
rg -i "node_path|node.*helper" .agent --type mdRepository: marcusquinn/aidevops
Length of output: 325
🏁 Script executed:
# Check the structure and content around the flagged lines
sed -n '390,410p' .agent/tools/build-agent/build-agent.mdRepository: marcusquinn/aidevops
Length of output: 797
🌐 Web query:
Node.js NODE_PATH environment variable behavior with node -e inline evaluation official documentation
💡 Result:
node -e "script"evaluates the argument as JavaScript (with the same “predefined” built-ins available as in the REPL). [1]NODE_PATHis a process environment variable: a:-separated (Windows;-separated) list of directories that are prefixed to Node’s CommonJS module search path. [2]- In the CommonJS loader, if
NODE_PATHis set, Node.js will search those directories for modules when they are not found elsewhere (i.e., after the normal resolution locations). [3] - This affects CommonJS
require()resolution (including code run vianode -ewhen it’s interpreted as CommonJS), but does not affect ESMimportspecifier resolution. [4]
Sources
[1] Node.js v22.15.0 CLI -e, --eval docs (nodejs.org)
[2] Node.js v22.15.0 CLI NODE_PATH env var docs (nodejs.org)
[3] Node.js v22.15.0 CommonJS modules docs (“Loading from the global folders”) (nodejs.org)
[4] Node.js v22.11.0 ESM docs (“No NODE_PATH”) (nodejs.org)
Citations:
- 1: https://nodejs.org/download/release/v22.15.0/docs/api/cli.html
- 2: https://nodejs.org/download/release/v22.15.0/docs/api/cli.html
- 3: https://nodejs.org/download/release/v22.15.0/docs/api/modules.html?utm_source=openai
- 4: https://nodejs.org/download/release/v22.11.0/docs/api/esm.html
Move Node.js helper snippet to a dedicated subagent and reference via file:line.
The NODE_PATH behavior is technically accurate (verified against Node.js v22.15.0 documentation—it extends CommonJS module search paths for node -e evaluation), but inline code placement violates the .agent/**/*.md progressive disclosure pattern and coding guidelines requiring file:line references instead of inline snippets.
Create a helper template (e.g., .agent/tools/build-agent/node-helpers.md or similar subagent) containing the NODE_PATH export snippet and reference it via file:line pointer here. This maintains information accuracy while ensuring maintainability and adherence to agent documentation patterns.
🤖 Prompt for AI Agents
In @.agent/tools/build-agent/build-agent.md around lines 397 - 405, The inline
NODE_PATH snippet in the "Node.js-based helper scripts" section should be moved
into a dedicated subagent file and referenced by file:line; create a new
Markdown helper (suggested name .agent/tools/build-agent/node-helpers.md) that
contains the NODE_PATH export snippet (export NODE_PATH="$(npm root
-g):$NODE_PATH") and an explanatory note, then replace the inline block in the
original doc with a file:line reference pointing to that new file and the
relevant line(s); ensure the section header "Node.js-based helper scripts"
remains and that the new file mentions NODE_PATH and the node -e usage so
readers can locate it.



Summary
Addresses GitHub issues #272, #273, #276:
~/.config/aidevops/(XDG-compliant)Changes
Issue #276: Config Path Standardization
mainwp-helper.sh${SCRIPT_DIR}/../configs/mainwp-config.json~/.config/aidevops/mainwp-config.jsonwordpress-mcp-helper.sh${SCRIPT_DIR}/../configs/wordpress-sites-config.json~/.config/aidevops/wordpress-sites-config.jsononboarding-helper.sh~/Git/aidevops/configs/mainwp-config.json~/.config/aidevops/mainwp-config.jsonAll scripts now:
~/.config/aidevops/for user runtime configs~/.aidevops/agents/configs/*.json.txtIssue #273: sqlite3 Prerequisite
sqlite3to required dependencies insetup.mdmemory/README.mdonboarding-helper.shIssue #272: NODE_PATH Guidance
Added documentation to
build-agent.mdexplaining how to setNODE_PATHfor helper scripts using globally installed npm packages withnode -e.Testing
Closes #272, #273, #276
Summary by CodeRabbit
Chores
Documentation