feat(mlsp): Phase 3 MLSP for AI —— locate/syntax/validate/repair_targets/schema(T3.1/T3.2 + T2.6)
- src/mlsp.rs: 行分隔 JSON 协议 + 五 handler;语法唯一事实来源 = CORE_CONSTRUCTS(只加检索别名) - repair_targets 带有界护栏策略(anchored-local / 越界必拒 abstain / max_attempts=2) - schema 契约导出(T2.6):形参/返回/字段契约 + 升参清单 + 锚点 - marqdo mlsp 子命令:stdio 行分隔 JSON 服务 - tests/mlsp.rs 7 例全绿;全量回归零失败(含 262 gold) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7a449c40b1
commit
db5f0e830b
5 files changed
+414
No files matched your search
+17
@@ -80,6 +80,8 @@ enum Commands {
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
/// MLSP for AI: line-delimited JSON on stdio (locate / syntax / validate / repair_targets / schema)
|
||||
Mlsp,
|
||||
/// Browse `.mq.md` structure + execution (live server or static output)
|
||||
View {
|
||||
#[command(subcommand)]
|
||||
@@ -281,6 +283,21 @@ fn try_main(cli: Cli) -> Result<i32> {
|
||||
}
|
||||
Ok(errors.min(1))
|
||||
}
|
||||
Commands::Mlsp => {
|
||||
use std::io::{BufRead, Write};
|
||||
let stdin = std::io::stdin();
|
||||
let stdout = std::io::stdout();
|
||||
let mut out = stdout.lock();
|
||||
for line in stdin.lock().lines() {
|
||||
let line = line?;
|
||||
if line.trim().is_empty() {
|
||||
continue;
|
||||
}
|
||||
writeln!(out, "{}", marqdo::mlsp::handle_line(&line))?;
|
||||
out.flush()?;
|
||||
}
|
||||
Ok(0)
|
||||
}
|
||||
Commands::View {
|
||||
action,
|
||||
path,
|
||||
|
||||
Reference in new issue
Block a user