feat: add compact dictionary codebook
CI / validate (push) Successful in 37s

This commit is contained in:
2026-07-21 11:25:45 -05:00
parent 084f76d3c1
commit 52c56f7fed
13 changed files with 673 additions and 53 deletions
+5 -2
View File
@@ -1,12 +1,15 @@
# mp-ai-module-controller
Rust CLI for local llama.cpp action dispatch.
Rust CLI for local llama.cpp action dispatch with verbose and compact dictionary-coded model outputs.
Important files:
- `src/main.rs`: CLI entrypoint.
- `src/registry.rs`: source-of-truth action registry.
- `src/dictionary.rs`: generates `dictionary/actions.jsonl` and `dictionary/actions.index.json`.
- `dictionary/static-base.json`: tracked static compact-code base.
- `dictionary/model.codebook.json`: generated compact codebook.
- `dictionary/model.examples.jsonl`: generated templates/examples for future synthetic-data tooling.
- `src/llm.rs`: sends OpenAI-compatible chat requests to the local llama.cpp server and parses action JSON.
- `src/dispatcher.rs`: exact-match runtime dispatch and detached script spawning.
- `src/scripts/logger.rs`: proof-of-concept logger script.
@@ -37,7 +40,7 @@ Environment:
- `LLAMA_EXTRA_ARGS`: optional extra llama-server args.
- `CONTROLLER_LOG_LEVEL`: default `info`.
The LLM must return compact JSON like `{"action_id":"logger","payload":{"message":"hello"}}`. The runtime only executes exact `action_id` matches from `dictionary/actions.index.json`; aliases are not executable. Invalid or unknown outputs are rejected without running anything.
The LLM may return verbose JSON like `{"action_id":"logger","payload":{"message":"hello"}}` or compact codebook JSON like `{"v":"1.0.0","c":"<codebook_checksum>","a":"A001","p":{"F001":"hello"}}`. Compact outputs must match `dictionary/model.codebook.json` version and checksum before expansion. The runtime only executes exact `action_id` matches from `dictionary/actions.index.json`; aliases are not executable. Invalid or unknown outputs are rejected without running anything.
Codex environment: `.codex/environments/environment.toml` defines setup plus Build, Test, Generate Dictionary, Precommit Check, Run Logger, Query Logger, and Serve Llama actions.