⚠️ Disclaimer: This document is a translation from the original Russian version (README.ru.md) and may contain inaccuracies or minor errors. For the original documentation, please refer to the Russian README.
Safe AI Patch Orchestrator (FS-XML v2.0)
English | Русский
A desktop orchestrator (Python + FastAPI + Vue 3 + PyWebView) that turns regular AI web chats into safe, semi-autonomous AI agents: controlled project context bundling and one-click multi-file code patching using the FS-XML v2.0 specification.
Most developers already copy code from AI web chats (Gemini, ChatGPT, Claude, DeepSeek, Qwen). The model already understands your project structure and is fully capable of creating files and making targeted edits — it just lacks a safe bridge to your disk.
Meanwhile, fully autonomous AI agents inside IDEs come with two major drawbacks:
- Token burn & unguarded edits: the agent decides what to read on its own, crawls the entire repository, burns millions of API tokens on unnecessary file reads, and may accidentally rewrite critical code.
- Working "blind" for hours: an autonomous agent can spend a long time applying dozens of edits, leaving the project broken or altering business logic behind your back.
FS-XML Interpreter gives you full control at every step:
- Modular isolation: you decide which files and modules the AI gets to see. If you have a finished module that already does its job, you only need to expose its exported functions/interfaces (or mark critical files as
Read-Only). The AI doesn't even need to know the module's internals — it can cleanly write a new module against it without wasting context or risking breaking working code. - Step-by-step verification: apply a batch of changes in one click and immediately verify the result: does the program run, did the AI understand you correctly, and did it preserve your logic?
Web chats offer huge context windows without per-token API billing, but have no direct disk access.
- Bundle a clean
context_dump.txtdirectly into your project root in 1 click (without overwriting your clipboard). - Attach the file to the chat, then paste the AI's XML response into the app to apply all changes in 1 click.
- Per-file Rollback & Re-apply stored in SQLite history with manual edit detection (warns you before overwriting changes you made by hand after the AI patch).
- Fast failure recovery: clicking an error record in history immediately copies the failed
<fs_search>/<fs_replace>block and the actual file content from disk to your clipboard — just paste it back into the chat. - Project Snapshots: checkpoints of marked files and profile permissions before major refactorings.
-
Projects & Profiles (Separation of Concerns):
- Manage multiple projects, change root directories, and open the project folder directly from the top bar.
- Independent Profiles for different tasks (e.g., a
Backendprofile keeps frontend files out of context so the AI stays strictly within its area of responsibility).
-
Context Tree & Attached Files Viewer:
- Tree-view file marking (
W—Writable,RO—Read-Only) with substring, wildcard (*.ts), and regex (^src/) search, plus bulk permission actions. - Dual-pane Attached Files Viewer with search and one-click code copy.
- Tree-view file marking (
-
Smart Context Dump (
context_dump.txt):- Saved directly to
<project_root>/context_dump.txtwithout overwriting your clipboard. - Automatic binary file skipping (
[BINARY FILE EXCLUDED]). - "Include unmarked file names" option — appends a list of paths (
UNMARKED PROJECT STRUCTURE) so the AI knows other files exist without reading their contents. - "Ignore tests" option (
test_*,*_test,*.test.*,*.spec.*) — excludes unmarked test files from the dump and replaces marked test bodies with# [TEST FILE EXCLUDED - EXISTS ON DISK].
- Saved directly to
-
Two-Level Ignore System (
fsignore):- Global (
fsignore_global) + per-project (.fsignore) using.gitignoresyntax, inline#comments, escaped\#, and dynamic reload. - Excludes heavy folders like
node_modules/,.venv/,.git/,dist/from scanning and context dumps.
- Global (
-
Resilient FS-XML v2.0 Parser & Sandbox (
Sandbox):<fs_create>(forbids overwriting existing files) and<fs_edit>(multiple<fs_search>/<fs_replace>pairs, trailing-whitespace tolerance,CRLF/LFpreservation, full overwrite via<all />).- Path traversal protection outside the project root, per-file write permission enforcement, and local-origin CORS filtering.
- Extensible handler registry (
BaseCommandHandler+ custom commands incore/handlers/custom/).
-
Snapshots & Portable Configuration (
fs_orchestrator_config.json):- Create and restore snapshots for the active profile or all profiles in a project.
- Export and import
fs_orchestrator_config.jsonto transfer a project, its profiles, and file permissions to another machine.
-
Desktop UI & Personalization:
- Resizable and collapsible side panels, collapsible system log, built-in Instruction modal, and background image toggle/selector.
No installation, compilation, or setup is required — the pre-built FS-XML.exe launcher is already included in the project root and in the release package (release/FS-XML.exe):
- Download the release (or clone the repository).
- Run
FS-XML.exe.
For Developers: Running from Source, Dev Mode & Building a Release
- Python 3.10+ (
fastapi,uvicorn[standard],pydantic,pywebview,pytest,httpx) - Node.js / npm (to build or develop the Vue 3 frontend)
install.bat :: Creates .venv, installs Python/NPM dependencies, and builds frontend\dist
run.bat :: Rebuilds the frontend and launches desktop_app.py# Terminal 1 — Backend API (port 18420)
python server/main.py
# Terminal 2 — Frontend Vite HMR (port 18421)
cd frontend && npm run dev- Place Windows Embeddable Python into
python/and runsetup_embed_python.bat. - Run
build_exe.bat(compileslauncher.csintoFS-XML.exevia.NET Framework csc.exe) orbuild_release.bat(builds the frontend,FS-XML.exe, and packages everything intorelease/).
[ Project on Disk ] ──> (Mark W / RO in Profile) ──> [ Generate context_dump.txt ]
│
▼
[ Dump + Prompt in AI Chat ]
│
▼
[ Human Verification ] <── (Click "RUN") <── [ AI XML Response ]
│
├──> Patch Error? ──> [ Click Error in History ] ──> (Copies Search + Disk File)
└──> Wrong Logic? ──> [ Rollback / Re-apply ] or [ Restore Snapshot ]
- Provide the System Prompt Once:
Click КОПИРОВАТЬ ПРОМПТ (Copy Prompt, loaded from
FS-XML.txt) and paste it into System Instructions (Google AI Studio, API, Custom Instructions) or send it as the first message in your chat. - Paste AI Responses "As-Is": It doesn't matter whether the AI wraps XML in markdown blocks or adds explanations around the tags — copy the entire response and paste it into the central editor. The parser extracts valid commands automatically.
- If
Search block not foundOccurs: Click the failed row in the right-hand history panel — the broken search block and the current file from disk are copied to your clipboard. Send them to the AI so it can fix the patch. <fs_create>Is Only for New Files: Existing files must be modified via<fs_edit>(use<all />inside search for full overwrites).- Keep Chat Context Clean:
When sending a fresh
context_dump.txt, remove outdated dumps from the chat history or start a new conversation so the model doesn't mix up old and new file versions.
<fs_create path="src/utils/logger.py">
import datetime
def log(msg: str):
print(f"[{datetime.datetime.now()}] {msg}")
</fs_create>Multiple <fs_search> / <fs_replace> pairs are supported inside a single <fs_edit> block:
<fs_edit path="src/utils/logger.py">
<fs_search>
def log(msg: str):
print(f"[{datetime.datetime.now()}] {msg}")
</fs_search>
<fs_replace>
def log(msg: str, level: str = "INFO"):
print(f"[{datetime.datetime.now()}] [{level}] {msg}")
</fs_replace>
</fs_edit><fs_edit path="config.py">
<fs_search><all /></fs_search>
<fs_replace>
DEBUG = True
DATABASE_URL = "sqlite:///app.db"
</fs_replace>
</fs_edit>These commands allow the AI to automatically manage your context organization: creating new profiles and changing file access permissions (Writable / Read-Only / Unmarked) so you don't have to manually toggle dozens of files in the tree.
Example: you tell the AI: "Create a separate profile for the auth task, set legacy configs to Read-Only, and mark the new routers as Writable" — the model reconfigures the workspace in a single response.
Note: Changing file permissions only affects the currently active profile. The AI does not have a command to switch the active profile.
- Protected by default: as long as the "Management Commands" (
Управляющие команды) checkbox in the bottom-right panel is unchecked, the orchestrator blocks all management commands with an access error (meanwhile, standard<fs_create>and<fs_edit>commands in the same response still execute normally). - When enabled:
- changes apply to the current session and are persisted in the SQLite database;
- updated permissions appear immediately in the file tree and take effect on the next
context_dump.txtgeneration and subsequent sandbox write checks.
- Important: management commands modify profile and permission metadata, not file contents on disk (so per-file rollback in history is not applicable to them).
-
<fs_profile_create>— create a new profile: Creates a new configuration profile in the current project (if no profile with that name exists yet).<fs_profile_create name="Backend-Focus" />
-
<fs_file_state>— change a file's state in the active profile: Sets one of the three states (writable,readonly, orunmarked) for the specified file:<fs_file_state path="src/config.py" state="readonly" /> <fs_file_state path="src/api/routes.py" state="writable" /> <fs_file_state path="src/legacy/old.py" state="unmarked" />
writable— include the file in context and allow the AI to edit it;readonly— include the file in context strictly for reading (write-protected);unmarked— remove the file from the active profile's context.
(Additionally, developers can extend the system with custom commands via BaseCommandHandler in core/handlers/custom/.)
- Detailed project structure:
архитектура.txt. - Run all tests (Backend + Frontend):
run_all_tests.bat- Backend (
pytest):python -m pytest backend_tests -v(run_backend_tests.bat) - Frontend (
vitest):cd frontend && npm run test(run_web_tests.bat)
- Backend (