Files
Neo-ZQYY/docs/audit/changes/2026-03-06__fix-api-client-post-method.md
Neo 14a12342b5 chore(audit): 补追 96 份未入仓审计孤本 — 覆盖 2026-02-26 ~ 2026-04-08
这些审计记录原本堆积在 docs/audit/changes/changes/ 嵌套误产物目录下(由开发机迁移
79d3c2e 前后的不明批量操作产生)。由于同期 .gitignore 屏蔽了 docs/audit/ 全目录,
它们从未入过 git 任何分支 history。删除即永久丢失。

按 docs/specs/audit-gap-recovery/tasks.md 阶段 1 执行,将全部 96 份 D 类孤本
(主目录无同名、git history 亦无记录)复制到 docs/audit/changes/ 主目录入仓。

涵盖主题: P1-P18 全栈集成 / 多模块累积变更 / ETL bug 修复 / 业务日切 /
   召回与任务引擎改造 / 租户管理与审批 / 董事会财务 / 客户与助教详情 /
   DDL 基线合并 / Kiro 到 Claude Code 迁移

阶段 2(B 类内容漂移 1 份)和阶段 4(嵌套目录删除)独立推进。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 06:35:42 +08:00

53 lines
2.9 KiB
Markdown
Raw Permalink 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.
# 变更审计记录:修复 RecordingAPIClient 缺少 post 方法
| 字段 | 值 |
|------|-----|
| 日期 | 2026-03-06 08:37:26 |
| Prompt-ID | P20260306-083206 |
| Session-ID | f1836fa4 |
| Session 路径 | docs/audit/session_logs/2026-03/06/34_a8dca428_070120 |
| 风险等级 | 极低 |
| 影响范围 | ETL API 客户端层 |
## 操作摘要
修复 ETL 运行时错误:`RecordingAPIClient` 缺少 `post` 方法,导致 `ODS_GROUP_PACKAGE` 任务的详情拉取阶段(非预取模式)调用 `self.api.post()` 时抛出 `AttributeError`。在 `APIClient` 新增 `post()` 作为 `_post_json()` 的公共别名,在 `RecordingAPIClient` 新增 `post()` 委托给 `self.base.post()`
## 根因分析
- `UnifiedPipeline` 在非预取模式下调用 `self.api.post(endpoint, params)`unified_pipeline.py:262
- `APIClient` 只有 `get()`(实际是 POST JSON 的历史命名)和私有 `_post_json()`,没有公共 `post()` 方法
- `RecordingAPIClient` 作为代理只转发了 `iter_paginated` / `get_paginated`,未覆盖 `post`
- 新增的 `ODS_GROUP_PACKAGE` 详情拉取阶段首次触发了非预取模式的 `post()` 调用路径
## 触发场景
用户从 admin-web 启动 ETL 任务,任务开始时间 2026/3/6 07:32:40错误日志`'RecordingAPIClient' object has no attribute 'post'`
## 验证
- getDiagnostics 两个文件均无问题
- 166 个单元测试通过2 个 hypothesis deadline 超时与本次修改无关)
## 本次对话文件变更
### 新增文件
- `docs/audit/prompt_logs/prompt_log_20260306_083206.md`
- `docs/audit/session_logs/2026-03/06/34_a8dca428_070120/main_02_f1836fa4.md`
- `docs/audit/session_logs/2026-03/06/34_a8dca428_070120/sub_01_f1836fa4.md`
- `docs/audit/session_logs/2026-03/06/37_e5276b93_082544/main_06_dfa80d9e.md`
## 改动注解
### `apps/etl/connectors/feiqiu/api/client.py`
- 变更类型:修改
- 原始原因:`APIClient` 缺少公共 `post()` 方法,导致 `UnifiedPipeline` 在详情拉取模式下调用失败
- 思路分析:`get()` 方法实际执行 POST JSON 请求(历史命名),新增 `post()` 作为 `_post_json()` 的语义明确别名,与 `get()` 平行放置,不改变任何请求逻辑
- 修改结果:`APIClient` 公共接口补齐 `post()` 方法,所有通过 `APIClient` 或其代理发起的非分页 POST 请求均可正常工作
### `apps/etl/connectors/feiqiu/api/recording_client.py`
- 变更类型:修改
- 原始原因:`RecordingAPIClient` 作为 `APIClient` 的代理,未转发 `post()` 方法,导致详情拉取阶段 `AttributeError`
- 思路分析:与已有的 `iter_paginated` / `get_paginated` 代理模式一致,新增 `post()` 直接委托给 `self.base.post()`。详情请求不需要落盘(非分页数据),因此不做额外录制
- 修改结果:`RecordingAPIClient` 完整覆盖 `APIClient` 的公共接口,`UnifiedPipeline` 在在线拉取模式下可正常调用 `self.api.post()`