{ "schema_version": "1.0", "name": "mp-ai-module-controller", "description": "Rust CLI controller for llama.cpp-backed local action dispatch.", "project_type": "cli", "language": "rust", "package_manager": "cargo", "entrypoints": { "main": "src/main.rs", "action_registry": "src/registry.rs", "dictionary_generator": "src/dictionary.rs", "llm_client": "src/llm.rs", "dispatcher": "src/dispatcher.rs", "logger_script": "src/scripts/logger.rs", "codex_environment": ".codex/environments/environment.toml" }, "commands": { "build": "cargo build", "test": "cargo test", "generate_dictionary": "cargo run -- dictionary generate", "serve": "cargo run -- serve", "query": "cargo run -- query \"log hello from codex\"", "run_logger": "cargo run -- run logger --payload '{\"message\":\"hello from codex\"}'", "run_calculate": "cargo run -- run calculate --payload '{\"expression\":\"2 + 2 * 3\"}'", "run_to_slug": "cargo run -- run to_slug --payload '{\"text\":\"Hello, World!\"}'", "run_write_note": "cargo run -- run write_note --payload '{\"filename\":\"hello.txt\",\"content\":\"hello\"}'", "codex_setup": "scripts/codex-setup.sh", "codex_logger_smoke": "scripts/codex-run-logger.sh", "precommit_check": "scripts/precommit-check.sh", "training_data_dry_run": "python3 scripts/generate_training_data.py --dry-run", "generate_training_data": "python3 scripts/generate_training_data.py", "deploy_training_data": "scripts/deploy_training_data.sh", "install_hooks": "git config core.hooksPath .githooks" }, "environment": { "example_file": ".env.example", "variables": [ { "name": "LLAMA_MODEL_PATH", "required": true, "secret": false, "description": "Absolute path to a local GGUF model used by llama-server." }, { "name": "LLAMA_HOST", "required": false, "secret": false, "default": "127.0.0.1", "description": "Host for the local llama.cpp server." }, { "name": "LLAMA_PORT", "required": false, "secret": false, "default": "8080", "description": "Port for the local llama.cpp server." }, { "name": "LLAMA_CONTEXT_SIZE", "required": false, "secret": false, "description": "Optional context size passed to llama-server as --ctx-size." }, { "name": "LLAMA_EXTRA_ARGS", "required": false, "secret": false, "description": "Optional shell-split extra arguments appended to llama-server." }, { "name": "CONTROLLER_LOG_LEVEL", "required": false, "secret": false, "default": "info", "description": "Tracing log level for the controller." } ] }, "llama_cpp": { "server_binary": "/opt/homebrew/bin/llama-server", "fallback_binary": "llama-server", "api": "OpenAI-compatible /v1/chat/completions", "response_contract": { "format": "verbose JSON or compact codebook JSON", "example": { "action_id": "logger", "payload": { "message": "hello" } }, "compact_example": { "v": "1.0.0", "c": "", "a": "A001", "p": { "F001": "hello" } } } }, "dictionary": { "source_of_truth": "src/registry.rs", "static_base": "dictionary/static-base.json", "generated_jsonl": "dictionary/actions.jsonl", "generated_index": "dictionary/actions.index.json", "generated_codebook": "dictionary/model.codebook.json", "generated_examples": "dictionary/model.examples.jsonl", "dictionary_version": "1.0.0", "metadata": [ "registry_checksum", "static_base_checksum", "codebook_checksum" ], "runtime_policy": "Verbose outputs require exact action_id matches; compact outputs require matching version/checksum and exact codebook expansion before dispatch." }, "actions": [ { "action_id": "calculate", "suite": "Math & Conversion", "payload_example": { "expression": "2 + 2 * 3" } }, { "action_id": "convert_units", "suite": "Math & Conversion", "payload_example": { "value": 100, "from": "km", "to": "miles" } }, { "action_id": "generate_uuid", "suite": "Math & Conversion", "payload_example": {} }, { "action_id": "random_number", "suite": "Math & Conversion", "payload_example": { "min": 1, "max": 100 } }, { "action_id": "count_words", "suite": "Text Utilities", "payload_example": { "text": "hello from codex" } }, { "action_id": "to_slug", "suite": "Text Utilities", "payload_example": { "text": "Hello, World!" } }, { "action_id": "hash_string", "suite": "Text Utilities", "payload_example": { "text": "hello", "algorithm": "sha256" } }, { "action_id": "truncate_text", "suite": "Text Utilities", "payload_example": { "text": "hello from codex", "max_chars": 5 } }, { "action_id": "write_note", "suite": "File Operations", "payload_example": { "filename": "hello.txt", "content": "hello" }, "sandbox": "notes/" }, { "action_id": "append_to_file", "suite": "File Operations", "payload_example": { "filename": "hello.txt", "content": " world" }, "sandbox": "notes/" }, { "action_id": "read_file", "suite": "File Operations", "payload_example": { "filename": "hello.txt" }, "sandbox": "notes/" }, { "action_id": "delete_file", "suite": "File Operations", "payload_example": { "filename": "hello.txt" }, "sandbox": "notes/" }, { "action_id": "logger", "suite": "Logger", "script": "src/scripts/logger.rs", "description": "Proof-of-concept script that writes structured JSONL log records.", "payload_example": { "message": "hello from codex" }, "output": "logs/controller-actions.jsonl" } ], "generated_paths": [ "target/", "logs/", "runtime/", "notes/", "dictionary/actions.jsonl", "dictionary/actions.index.json", "dictionary/model.codebook.json", "dictionary/model.examples.jsonl" ], "sdg_bridge": { "design_doc": "SDG_BRIDGE_PLAN.md", "script": "scripts/generate_training_data.py", "deploy_script": "scripts/deploy_training_data.sh", "custom_local_llm_root": "/Volumes/Zoe/custom-local-llm", "default_output_dir": "/Volumes/Zoe/custom-local-llm/training-data/", "default_manifest": "/Volumes/Zoe/custom-local-llm/manifest.llm.json", "dataset_prefix": "module_controller_intents", "schema_profile": "instruction", "dry_run": "python3 scripts/generate_training_data.py --dry-run", "optional_sdg_host": "mimir (100.80.52.47)", "sdg_engine": "data-designer" }, "ci": { "codex_environment": ".codex/environments/environment.toml", "gitea_actions": ".gitea/workflows/ci.yml", "woodpecker": ".woodpecker.yml", "woodpecker_deploy": "scripts/deploy_training_data.sh", "precommit_hook": ".githooks/pre-commit", "shared_check": "scripts/precommit-check.sh", "checks": [ "cargo fmt --check", "cargo test", "cargo run -- dictionary generate", "test -s dictionary/actions.jsonl", "test -s dictionary/actions.index.json", "test -s dictionary/model.codebook.json", "test -s dictionary/model.examples.jsonl", "test -s dictionary/static-base.json", "python3 -m unittest tests/test_generate_training_data.py", "python3 scripts/generate_training_data.py --dry-run" ] }, "agent_guidance": "See AGENTS.md. Keep src/registry.rs as the source of truth, regenerate dictionary files after action changes, and reject non-exact LLM action outputs." }