# SSHConfig Resolve 项目申报书

## 基本信息

- 项目名称：SSHConfig Resolve：OpenSSH 配置解析与可解释求值器
- 参赛者：jingmo653
- 联系方式：2624019073@qq.com
- GitHub 仓库链接：https://github.com/jingmo653/sshconfig-resolve
- 项目方向：MoonBit 工程基础设施 / 开发与运维工具 / 可复用配置库
- 是否为移植项目：否

## 项目简介

`sshconfig-resolve` 是 OpenSSH client configuration 的 MoonBit 解析器和可解释求值器。
它读取主配置及 `Include` 文件，应用 `Host`/受支持的 `Match` 条件、首值/累积语义和
`%` token 展开，输出目标 host 的最终配置及每个值的来源。项目面向 Git/SSH 工具、IDE、
运维审计和 CI，不建立 SSH 连接、不读私钥、不执行 ProxyCommand/Match exec。

## 核心功能范围

- 带恢复诊断和 source span 的 tokenizer/parser
- 确定性、有资源上限的 virtual/native Include loader（含环检测、glob 展开、文件/深度限制）
- 非指数 Host glob 与否定 pattern-list 匹配
- P0 directive 的 validation/merge（scalar 首值、list 累积、special directive）
- effective context 与 `%h/%n/%p/%r/%u/%d/%%` token 展开
- portable facade（`pub using` 重导出，all-target）
- native resolve/explain/lint/JSON/redaction CLI
- 原创 conformance/property fixtures 和隔离 `ssh -G` 差分验证

## 原创或参考说明

本项目是原创 MoonBit 实现，行为参考
[OpenSSH ssh_config manual](https://man.openbsd.org/ssh_config) 与
[OpenSSH portable](https://github.com/openssh/openssh-portable) 的公开配置语义。
不复制 OpenSSH 源码或测试套件。依赖 `moonbitlang/x`，使用 Apache-2.0 许可证。

核心独立设计决策包括：parser 与 IO 分离、ordered AST + source span、
FileSystem trait + MemoryFS 支持 all-target 测试、directive spec table 替代
巨型 if/else、root `pub using` facade、显式拒绝 Match exec/canonical/final、
以及有限黑盒差分验证策略。
