FIST commander task orchestration rewritten in pure MoonBit, exposed as an MCP server.
Dependencies
该项目为 E:\IDEProjects\AI\FIST(Python)的 MoonBit 原生重写 + MCP 化,非原代码搬运。
# 依赖解析 & 编译
moon check
moon build --target native
# 运行测试(7 项核心状态机单测)
moon test
# 启动 MCP Server(STDIO 传输)
moon run
# 或直接运行编译产物(等价)
./_build/native/debug/build/cmd/main/main.exe{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{
"name":"publish",
"arguments":{"project_dir":"E:/proj/demo","description":"示例根任务","created_by":"human_steward","now":"2026-09-05T10:00:00Z"},
"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}
}}| 工具 | 说明 | 关键参数 |
|---|---|---|
| publish | 发布根任务(仅 human_steward/human) | project_dir, description, created_by, now |
| plan | 对已认领任务拆分为子任务 | task_id, split_n, by, now |
| claim | 认领任务(待领取 → 已领取) | task_id, assignee, now |
| execute | 记录执行交付物(→ 执行中) | task_id, deliverable, now |
| submit | 提交验收(→ 待验收) | task_id, now |
| verify | 验收(→ 已完成) | task_id, verifier, now |
| archive | 归档(→ 已归档,仅人类指挥官) | task_id, by, now |
| list | 列出全部任务,可按状态过滤 | status(可选) |
| get | 查询单个任务详情 | task_id |
| delete | 删除任务(仅限已归档) | task_id |
| URI | 内容 |
|---|---|
| fist://principles | FIST 七条金条原则(JSON) |
| fist://overview | 任务体系概览 |
| 名称 | 用途 |
|---|---|
| fist:check_in | 执行者开工打卡自查模板 |
| fist:verify | 验收人验收要点模板 |
E:\IDEProjects\AI\FIST-Mbt
├── core_task.mbt # 任务实体 + 七态状态机(待领取/已领取/拆分中/执行中/待验收/已完成/已归档)
├── core_role.mbt # 八角色权限矩阵(human_steward/leader/executor/searcher/reviewer/cleaner/verifier/documenter)
├── core_principle.mbt # 七条金条原则常量
├── store.mbt # Store trait + MemoryStore 内存实现(后续可换 SQLite)
├── engine.mbt # FistEngine:publish/plan/claim/execute/submit/verify/archive/list/get/delete 完整闭环
├── server.mbt # MCPServer 装配:tools/resources/prompts 注册 + run_stdio
├── cmd/main/ # 可执行入口(async fn main → run_server)
├── fist-mbt_test.mbt # 黑盒单测(moon test)
├── README.mbt.md # 本文档
└── CHANGELOG.md待领取 --claim--> 已领取 --plan--> 拆分中 --execute--> 执行中
已领取 --execute--> 执行中
执行中 --submit--> 待验收 --verify--> 已完成 --archive--> 已归档 --delete--> 移除
待验收 --reopen--> 已领取(被打回重做)moon test # 7 项黑盒测试全部通过fn FistEngine::archive(self : FistEngine, task_id~ : String, by~ : String, now~ : String) -> Result[Task, String]fn FistEngine::claim(self : FistEngine, task_id~ : String, assignee~ : String, now~ : String) -> Result[Task, String]fn FistEngine::execute(self : FistEngine, task_id~ : String, deliverable~ : String, now~ : String) -> Result[Task, String]fn FistEngine::plan(self : FistEngine, task_id~ : String, split_n? : Int, by~ : String, now~ : String) -> Result[Array[String], String]fn FistEngine::plan_deep(self : FistEngine, task_id~ : String, split_n? : Int, by~ : String, spec? : Json?, now~ : String) -> Result[Json, String]fn FistEngine::publish(self : FistEngine, project_dir~ : String, description~ : String, created_by~ : String, now~ : String) -> Result[String, String]fn FistEngine::reopen_task(self : FistEngine, task_id : String, now : String) -> Result[Task, String]fn FistEngine::verify(self : FistEngine, task_id~ : String, verifier~ : String, now~ : String) -> Result[Task, String]fn SqliteStore::archive_task(self : SqliteStore, t : Task, archived_at~ : String) -> Result[Unit, String]pub struct Task {
id : String
parent_id : String?
project_dir : String
priority : String
importance : String
depth : Int
split_n : Int
status : TaskStatus
assignee : String?
description : String
deliverable : String
created_at : String
updated_at : String
completed_by : String?
cleanup_mode : String
} derive(Eq, Debug)fn cleanup_archived(engine : FistEngine, now : String, retention_days? : Int) -> Result[Array[String], String]fn heal_stale_tasks(engine : FistEngine, hb : Heartbeat, now : String, timeout_sec? : Int) -> Result[Array[String], String]fn iso_to_secs(s : String) -> IntInstall
Download zipFIST commander task orchestration rewritten in pure MoonBit, exposed as an MCP server.
Dependencies