Skip to content

feat: reindex:all and daemon:install commands#137

Merged
github-actions[bot] merged 1 commit intomasterfrom
feature/code-vectorization-mcp
Mar 6, 2026
Merged

feat: reindex:all and daemon:install commands#137
github-actions[bot] merged 1 commit intomasterfrom
feature/code-vectorization-mcp

Conversation

@jordanpartridge
Copy link
Copy Markdown
Contributor

@jordanpartridge jordanpartridge commented Mar 6, 2026

Summary

  • reindex:all — Incrementally re-indexes and vectorizes all git repos in a configurable base path. Supports --kind, --skip-vectorize, --path flags.
  • daemon:install — Generates and installs systemd timer units using the current user/paths at install time. Three timers: enhance (15min), sync (30min), reindex (6h). --status to check, --uninstall to remove.
  • No bash scripts, no hardcoded server names. Portable across any systemd host.

Test plan

  • 1177 tests pass, coverage 96.1% (threshold 95%)
  • PHPStan level 8 clean
  • Pint formatted
  • know daemon:install on target server
  • systemctl list-timers | grep knowledge shows 3 timers

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added daemon installation and management command for installing, uninstalling, and monitoring background services.
    • Added batch command to incrementally reindex and vectorize multiple git repositories with configurable options.
  • Tests

    • Added comprehensive test coverage for daemon installation command.
    • Added comprehensive test coverage for repository reindexing command.

- `reindex:all` incrementally re-indexes and vectorizes all git repos
  in a configurable base path (default ~/projects). Supports --kind,
  --skip-vectorize filters.

- `daemon:install` generates and installs systemd timer units with
  the current user/paths. Three timers: enhance (15min), sync (30min),
  reindex (6h). Supports --status and --uninstall.

No bash scripts, no hardcoded paths. Portable across any systemd host.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ee71a1e-1816-44cf-b5ae-42a2e89afd70

📥 Commits

Reviewing files that changed from the base of the PR and between 6020a3f and 2cf8c44.

📒 Files selected for processing (4)
  • app/Commands/DaemonInstallCommand.php
  • app/Commands/ReindexAllCommand.php
  • tests/Feature/Commands/DaemonInstallCommandTest.php
  • tests/Feature/Commands/ReindexAllCommandTest.php

📝 Walkthrough

Walkthrough

This PR introduces two new Laravel Zero commands: DaemonInstallCommand manages systemd timers and services for knowledge daemons (enhance, sync, reindex), while ReindexAllCommand orchestrates incremental reindexing and vectorization across multiple git repositories. Both commands include comprehensive tests.

Changes

Cohort / File(s) Summary
Daemon Management
app/Commands/DaemonInstallCommand.php, tests/Feature/Commands/DaemonInstallCommandTest.php
New command for installing/uninstalling/managing systemd timers and services. Builds service and timer unit definitions, manages lifecycle via systemctl, and reports status. Tests cover non-systemd scenarios, timer presence detection, and status output.
Repository Reindexing
app/Commands/ReindexAllCommand.php, tests/Feature/Commands/ReindexAllCommandTest.php
New command that iterates git repositories and orchestrates incremental symbol reindexing via SymbolIndexService and optional vectorization via CodeIndexerService. Validates paths, enumerates repos, reports per-repo and aggregate results. Tests cover invalid paths, empty/missing repos, indexing failures, and skip-vectorize flag behavior.

Sequence Diagrams

sequenceDiagram
    participant User
    participant DaemonCommand as DaemonInstallCommand
    participant Process as Process Facade
    participant SystemD as systemd
    participant FileSystem as /etc/systemd/system

    User->>DaemonCommand: handle() with --install
    DaemonCommand->>DaemonCommand: determine user, home, PHP binary
    loop for each unit (enhance, sync, reindex)
        DaemonCommand->>DaemonCommand: buildService() & buildTimer()
        DaemonCommand->>FileSystem: write temp files
        DaemonCommand->>Process: copy to /etc/systemd/system
        DaemonCommand->>Process: systemctl daemon-reload
        DaemonCommand->>Process: systemctl enable timer
        DaemonCommand->>Process: systemctl start timer
    end
    DaemonCommand->>DaemonCommand: showStatus()
    DaemonCommand->>User: display timer status
Loading
sequenceDiagram
    participant User
    participant ReindexCommand as ReindexAllCommand
    participant FileSystem as File System
    participant SymbolService as SymbolIndexService
    participant CodeService as CodeIndexerService

    User->>ReindexCommand: handle() with --path --skip-vectorize
    ReindexCommand->>FileSystem: validate base path
    ReindexCommand->>FileSystem: enumerate git repositories
    loop for each git repository
        ReindexCommand->>SymbolService: indexFolder() with symbol kinds
        SymbolService-->>ReindexCommand: success + symbol_count
        alt skip-vectorize not set
            ReindexCommand->>CodeService: ensureCollection()
            ReindexCommand->>CodeService: vectorizeFromIndex()
        end
        ReindexCommand->>User: report per-repo results
    end
    ReindexCommand->>User: display aggregate results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A daemon hops through systemd land,
Timers tick and services expand,
Knowledge blooms across each repo bright,
Reindexing magic, vectorizing light!
Burrow deep, the wisdom grows—
Where knowledge daemons go! 🌱

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/code-vectorization-mcp

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

📊 Coverage Report

Metric Coverage Threshold Status
Lines 96.1% 95%

Files Below Threshold

File Coverage Uncovered Lines
app/Enums/ObservationType.php 0% None
app/Exceptions/Qdrant/QdrantException.php 0% None
app/Integrations/Qdrant/Requests/ScrollPoints.php 0% None
app/Mcp/Servers/KnowledgeServer.php 0% None
app/Services/AgentHealthService.php 0% None
app/Commands/DaemonInstallCommand.php 23.1% 57, 58, 61, 66, 67... (+55 more)
app/Mcp/Tools/RememberTool.php 66.7% 106, 107, 108, 109, 110... (+19 more)
app/Commands/ReindexAllCommand.php 67.3% 31, 32, 91, 92, 94... (+13 more)
app/Mcp/Tools/CorrectTool.php 70.4% 53, 54, 55, 56, 57... (+3 more)
app/Mcp/Tools/SearchCodeTool.php 72.7% 72, 73, 74, 75, 76... (+7 more)

🏆 Synapse Sentinel Gate

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

🏆 Sentinel Certified

Tests & Coverage: 0 tests passed
Security Audit: No security vulnerabilities found
Pest Syntax: All test files use describe/it syntax


Add this badge to your README:

[![Sentinel Certified](https://img.shields.io/github/actions/workflow/status/conduit-ui/knowledge/gate.yml?label=Sentinel%20Certified&style=flat-square)](https://github.com/conduit-ui/knowledge/actions/workflows/gate.yml)

@github-actions github-actions bot merged commit 6863551 into master Mar 6, 2026
1 of 2 checks passed
@github-actions github-actions bot deleted the feature/code-vectorization-mcp branch March 6, 2026 17:28
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