11 KiB
11 KiB
执行进度记录
本文件是只追加的历史流水,用来记录任务执行过程、验证命令、阻塞点和关键决策。 当前目录、当前命令、下一个可领取任务等可覆盖快照,写入 docs/current-state.md。
职责边界
docs/06-tasks.md:任务看板,维护任务状态、依赖和验收要点。progress.md:历史流水,只追加记录每轮执行发生了什么。docs/current-state.md:当前快照,可覆盖更新仓库现实、可运行命令和下一步。
记录格式
每完成或中断一轮任务,在文件末尾追加一条记录:
## YYYY-MM-DD T-编号 任务名
- 状态:DONE / BLOCKED / PARTIAL
- 变更:修改了哪些文件或模块
- 验证:运行的真实命令和结果
- 阻塞:如有,写明原因和需要谁决策
- 决策:如有,记录本轮确定的关键取舍
- 下一步:建议下一个任务 ID 或待确认事项
执行记录
2026-07-04 DOC-001 建立 harness coding 项目文档
- 状态:DONE
- 变更:新增根目录入口文档和
docs/项目文档。 - 验证:已执行
Get-ChildItem -Recurse -File | Select-Object FullName,Length | Sort-Object FullName、rg检查 Markdown 链接和关键占位 / 敏感词;发现并修正根目录任务编号漂移。 - 阻塞:无。
- 决策:当前文档只记录已确认事实;CHIS 登录、会话有效性、字段转换细节等待后续代码和样例补充。
- 下一步:T-001 初始化 Flask 项目骨架。
2026-07-04 DOC-002 更新 CHIS 登录与只读查询验证路线
- 状态:DONE
- 变更:更新
docs/06-tasks.md、docs/04-architecture.md、docs/api.md、docs/02-requirements.md、docs/current-state.md、docs/00-ai-start-here.md、docs/03-tech-stack.md、README.md和tasks.md。 - 验证:已执行
Get-ChildItem -Recurse -File、rg检查任务编号、查询 HAR、public key、登录代码引用和 Markdown 链接;发现并修正AGENTS.md中过时的“后续补充登录代码”描述。 - 阻塞:无。
- 决策:public key 由配置提供;
D:\hans\chupd\chis\login_client_v2.py作为登录链路参考但不能原样依赖 Django;保存上报前新增只读体检详情查询阶段;第一版详情查询需要healthCheck + phrId + idCard + checkDate,不假设只传体检 id 即可查询。 - 下一步:T-001 初始化 Flask 项目骨架。
2026-07-04 DOC-003 明确使用系统 Python 3.8
- 状态:DONE
- 变更:更新
docs/06-tasks.md、docs/03-tech-stack.md、docs/current-state.md和README.md。 - 验证:已执行
rg检查虚拟环境、venv、requirements.txt、pip install等关键词,并执行git diff确认仅包含系统 Python 3.8 环境决策相关文档变更。 - 阻塞:无。
- 决策:项目使用当前系统 Python 3.8,不创建虚拟环境;T-001 创建
requirements.txt并固定Flask==3.0.3;依赖安装命令使用python -m pip install -r requirements.txt。 - 下一步:T-001 初始化 Flask 项目骨架。
2026-07-04 DOC-004 明确 Flask factory 模式
- 状态:DONE
- 变更:更新
docs/03-tech-stack.md、docs/04-architecture.md、docs/06-tasks.md、docs/current-state.md和README.md。 - 验证:已执行
rg检查factory、application factory、create_app、Flask 3.0.3等关键词,并执行git diff确认仅包含 Flask factory 模式相关文档变更。 - 阻塞:无。
- 决策:Flask 应用使用 application factory 模式;T-001 实现
app/__init__.py:create_app(config_object=None);测试通过 factory 注入测试配置。 - 下一步:T-001 初始化 Flask 项目骨架。
2026-07-04 DOC-005 明确日志与请求归档方案
- 状态:DONE
- 变更:更新
.gitignore、docs/03-tech-stack.md、docs/04-architecture.md、docs/05-coding-rules.md、docs/02-requirements.md、docs/api.md、docs/06-tasks.md和docs/current-state.md。 - 验证:已执行
rg检查logs/、archives/、不脱敏、保留 1 年、archive、原子写入、.gitignore、每天一个等关键词,并执行git diff检查日志与归档方案相关文档变更。 - 阻塞:无。
- 决策:运行日志写入
logs/,每天一个综合日志文件,包含多级别摘要日志,保留 1 年;每个 API 请求在archives/写入一个完整原始 JSON 归档文件,包含api和chis请求 / 响应数组,archive 不脱敏,仅用于内网前置机本地受控排查;logs/和archives/不提交 git。 - 下一步:T-001 初始化 Flask 项目骨架。
2026-07-04 T-001 初始化 Flask 项目骨架
- 状态:DONE
- 变更:新增
requirements.txt、run.py、app/__init__.py、app/config.py、app/api/__init__.py、app/api/health.py、tests/test_app_factory.py;更新任务状态、技术栈命令和当前状态。 - 验证:先执行
python -m unittest discover -s tests看到ModuleNotFoundError: No module named 'app';实现后执行python -m pip install -r requirements.txt成功,执行python -m unittest discover -s tests结果Ran 1 test ... OK,临时启动python run.py后用curl.exe --noproxy "*" -s http://127.0.0.1:5000/health返回{"ok":true}。 - 阻塞:无。
- 决策:T-001 采用标准库
unittest做最小 factory / health check 验证;后续 T-003 再建立 pytest 测试框架。 - 下一步:T-002 建立基础配置与目录。
2026-07-04 T-002 建立基础配置与目录
- 状态:DONE
- 变更:新增
app/middleware/、app/services/、app/mappers/、app/chis/、app/repositories/、app/validators/包目录;新增.env.example;更新app/config.py从环境变量读取基础配置;更新create_app加载基础配置;新增tests/test_config_and_structure.py;更新任务和当前状态文档。 - 验证:先执行
python -m unittest discover -s tests看到CHIS_BASE_URL缺失和架构包不可导入;实现后执行python -m unittest discover -s tests结果Ran 3 tests ... OK;临时启动python run.py后请求/health返回{"ok":true};执行git diff --check未发现空白错误;检查.env.example仅包含占位符和非敏感默认值。 - 阻塞:无。
- 决策:T-002 只建立基础配置和包目录,不引入真实密钥、不连接 Redis、不实现 CHIS 业务逻辑。
- 下一步:T-003 建立最小测试框架。
2026-07-04 DOC-006 明确 CHIS SOCKS5 代理配置
- 状态:DONE
- 变更:新增
CHIS_PROXY配置读取和.env.example占位;更新README.md、tasks.md、docs/02-requirements.md、docs/03-tech-stack.md、docs/04-architecture.md、docs/05-coding-rules.md、docs/06-tasks.md、docs/api.md、docs/current-state.md。 - 验证:先执行
python -m unittest discover -s tests -p test_config_and_structure.py看到KeyError: 'CHIS_PROXY';实现后执行python -m unittest discover -s tests结果Ran 3 tests ... OK;执行rg "CHIS_PROXY|SOCKS|proxy|代理" README.md .env.example docs app tests确认文档和配置覆盖代理规则。 - 阻塞:无。
- 决策:CHIS 出站请求支持可选 SOCKS5 代理;
CHIS_PROXY为空时直连,有值时 CHIS 登录、会话验证、查询和保存请求统一走代理;代理只作用于访问 CHIS 的出站请求,不影响第三方访问chisup的入站请求。 - 下一步:T-003 建立最小测试框架;后续 T-101 / T-201 实现登录和通用 CHIS client 时落地代理调用。
2026-07-04 T-003 建立最小测试框架
- 状态:DONE
- 变更:新增
pytest.ini,固定 pytest 测试目录为tests;requirements.txt增加pytest==8.3.5;新增tests/test_project_setup.py校验 Flask 与 pytest 依赖固定;更新任务看板、技术栈、编码规则、当前状态、README 和根目录任务总览。 - 验证:先执行
python -m pytest tests/test_project_setup.py看到AssertionError: assert 'pytest==8.3.5' in ['Flask==3.0.3'];实现后执行python -m pip install -r requirements.txt显示 Flask 与 pytest 均已满足,执行python -m pytest tests/test_project_setup.py结果1 passed,执行python -m pytest结果4 passed,执行python -m unittest discover -s tests结果Ran 3 tests ... OK,临时启动python run.py后请求/health返回{"ok":true},执行git diff --check未发现空白错误。 - 阻塞:无。
- 决策:T-003 后标准测试入口改为
python -m pytest;保留既有 unittest 风格测试,pytest 可正常收集运行。 - 下一步:T-101 迁移 CHIS 登录链路。
2026-07-04 T-101 迁移 CHIS 登录链路
- 状态:DONE
- 变更:新增
app/chis/auth.py和app/chis/crypto.py;新增tests/test_chis_auth.py;requirements.txt增加requests[socks]==2.32.4、gmssl==3.2.2;更新任务看板、技术栈、架构、API 合约、当前状态和根目录任务总览。 - 验证:先执行
python -m pytest tests/test_chis_auth.py看到ModuleNotFoundError: No module named 'app.chis.auth';新增依赖测试后执行python -m pytest tests/test_project_setup.py看到requests[socks]==2.32.4未固定;补充 host 兼容测试时先看到assert 'chis.example.test:9002/chis' == 'http://chis.example.test:9002/chis';实现后执行python -m pytest tests/test_chis_auth.py结果6 passed,执行python -m pytest tests/test_project_setup.py结果1 passed,执行python -m pip install -r requirements.txt显示 Flask、pytest、requests、gmssl 均已满足,执行python -m pytest结果10 passed,临时启动python run.py后请求/health返回{"ok":true},执行git diff --check未发现空白错误。 - 阻塞:无。
- 决策:T-101 只迁移登录链路,不接 Redis,不做会话有效性查询;登录客户端从
CHIS_BASE_URL、CHIS_PUBLIC_KEY、CHIS_PROXY创建,完成myRoles、角色选择、myApps、JSESSIONID 提取和 cookie 组装。 - 下一步:T-102 接入账号信息查询验证会话。
2026-07-05 T-102 接入账号信息查询验证会话
- 状态:DONE
- 变更:
app/chis/auth.py新增ChisLoginClient.get_lander_info(cookie),使用已有 cookie 调用chis.myPageService / getLanderInfo;tests/test_chis_auth.py新增会话验证成功和会话失效测试;更新任务看板、API 合约、当前状态和根目录任务总览。 - 验证:先执行
python -m pytest tests\test_chis_auth.py -k lander,看到AttributeError: 'ChisLoginClient' object has no attribute 'get_lander_info';实现后执行同一命令结果2 passed, 6 deselected;执行python -m pytest结果12 passed。 - 阻塞:无。
- 决策:T-102 只做已有 cookie 的账号信息查询和失效判断;Redis 缓存、清理缓存和重登策略留给 T-103 / T-104。
- 下一步:T-103 实现 Redis 会话缓存。