Docs  /  FileSystemUpdate

FileSystemUpdate

Background thread that inventories configured filesystem roots, tracks add/modify/remove events, and optionally persists everything to MySQL.

Code: FileSystemUpdate.hpp / FileSystemUpdate.cpp.

Safety

  • Only roots you add are scanned (default root = process working directory).
  • No recursive delete or whole-disk wipe.
  • Per-root walk is capped (50k entries) so a bad path cannot hang forever.
  • MySQL removal of inventory rows only runs when a scan completed without hitting the cap.

Commands

fs status
fs start [interval_seconds]
fs stop
fs interval <seconds>
fs add <path> [nowatch]
fs remove <path>
fs list
fs scan [path]
fs changes [n]
fs drives

fs mysql status
fs mysql on|off
fs mysql init          # CREATE TABLE IF NOT EXISTS …
fs mysql sync          # flush current state

Aliases: filesystem …, files ….

MySQL schema

Database: ai_settings (same host/user/password as other _AI settings).

Table Contents
fs_roots Root path, watch flag, last scan stats, error text
fs_inventory File path, root, fingerprint (mtime key), size, updated_epoch
fs_changes epoch, root, path, kind (added/modified/removed/scanned/error)
fs_scans Per-scan summary (counts, complete flag, error)

Uses _Settings::GetMySQLHostname/Username/Password. MySQL is on by default.

Operator SQL

USE ai_settings;
SHOW TABLES LIKE 'fs_%';
SELECT path, file_count, dir_count, last_scan_epoch FROM fs_roots;
SELECT kind, COUNT(*) FROM fs_changes GROUP BY kind;
SELECT root_path, COUNT(*) AS files FROM fs_inventory GROUP BY root_path;
SELECT * FROM fs_scans ORDER BY id DESC LIMIT 10;

Typical workflow

fs mysql init
fs add D:/ai_training
fs add E:/checkpoints
fs start 120
fs scan
fs changes 30
fs status
fs mysql status

Windows notes

Drive free-space summary uses Win32:

  • GetLogicalDriveStringsA
  • GetDiskFreeSpaceExA
  • GetDriveTypeA

Deep walks use std::filesystem with skip_permission_denied.

Integration ideas

  • RSI / executive plan step: fs scan then recall large new artifacts.
  • Perception: watch vision_memory / screenshot folders for new frames.
  • Minecraft / gaming: watch log/replay directories for offline RL import.
  • Developer: watch plugin or build output folders for CI-style signals.
Generated from the project markdown docs on 2026-07-24. This is a static, self-contained site.