Files
chis_osi/docs/current-state.md
T
2026-07-06 20:54:23 +08:00

64 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 当前实现状态
> 可覆盖的当前快照:记录仓库现实、可运行命令、blocker 和下一步,防止只看计划而忽略现状。
> 历史流水追加到 [`../progress.md`](../progress.md);任务状态以 [`../tasks.md`](../tasks.md) 为准。
## 当前快照
- 日期:2026-07-06
- 阶段:**Phase 0 已起步**;T-001 已完成,Go module 与 CLI/config 骨架已建立
- 技术栈:Go 1.24 单二进制;`main.go -mode server|deliver`;配置读取使用 viper
- 生产代码:已有 `main.go`、`config/`、`go.mod`/`go.sum`;`osi/ contract/ mapping/` 等业务目录仍待后续任务建立
- 联调现实:**JKDA00002 个人档案查询已用 Python 脚本打通真实沙箱**(`code="01"`),实测契约沉淀在 `docs/04 §8`
- 测试:`go test ./...` 通过;当前测试覆盖 mode 解析与 `config.yaml.example` 加载
- 标准启动路径:`./init.sh`(需要 bash/WSL 环境;当前 Windows 环境未安装 WSL,直接运行会失败)
- 标准验证路径:`go test ./...`、`go build ./...`
- 当前 blocker:无硬 blocker。软阻塞:厂家侧 B1/B2/B4/B5 契约缺口(见 `docs/06`),只影响阶段 4,不阻塞阶段 0~3
## 当前目录要点
| 路径 | 状态 | 说明 |
| --- | --- | --- |
| `main.go` | 已有 | 单入口,解析 `-mode server|deliver` 与 `-config` |
| `config/` | 已有 | viper 配置加载,含最小单测 |
| `config.yaml.example` | 已有 | 占位配置,不含真实凭据 |
| `go.mod` `go.sum` | 已有 | module `chis_osi`,依赖 viper |
| `docs/` | 已有 | 设计文档集 01~06 + 本快照;`账号.txt` 本地留存不入库 |
| `tasks.md` `progress.md` | 已有 | 任务看板 / 执行流水(根目录) |
| `scripts/` | 已有·不入库 | Python 联调脚本(硬编码真实凭据与身份证,勿提交) |
| `config.yaml` | 已有·不入库 | 真实凭据;不要提交 |
| `osi/` `contract/` `mapping/` 等 | 待建 | 路线图阶段 0~2 后续任务 |
## 已验证事实(写代码时直接依赖)
- 签名:`password = md5("ts=<13位毫秒ts>&ask=<ask>")` 32 位小写,与平台一致(Python 已打通)。
- 信封:查询也走 `{"serviceId", "uploadinfo": {"baseInfo", "manageInfo"}}`,见 `docs/04 §8`。
- 成功码:字符串 `"01"`(判定按去前导零 == `"1"`),见 `docs/01 §1`。
- 机构码分层:请求头 `orgCode`=18 位统信码 ≠ `manaUnitId`=9 位机构码 ≠ 12 位区划码,见 `docs/01 §3`。
- `deviceSN` 查询可空。
## 当前可运行内容
```bash
# Go 骨架验证
go test ./...
go build ./...
go run . -mode server -config config.yaml.example
go run . -mode deliver -config config.yaml.example
# 统一入口(需要 bash/WSL)
./init.sh
# 本地联调查询(脚本硬编码凭据,勿提交)
python3 scripts/query_health_record.py
```
## 下一步
1. T-002:`osi/sign.go` MD5 头签名 + 单测。
2. T-003:`osi/transport.go` 传输层骨架。
## 维护规则
发生以下变化时覆盖更新本文:入口/目录变动、任务状态变化、新增可运行命令、发现文档与代码现实不一致。本文只留当前快照,不留历史。