禁止 CLI 为结构题配置追问 - #4
Conversation
There was a problem hiding this comment.
Taste Rating: 🟡 可接受(Acceptable)
Linus-Style Analysis
创建路径校验直接且合理,但更新路径对陈述题的题型解码与校验函数不一致,导致可绕过本 PR 的限制。
[CRITICAL ISSUES]
- 已在内联标出:陈述题更新时会把
questionType: null误判为开放题。
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟡 MEDIUM
改动集中且无依赖变更,但该绕过会继续向后端写入本 PR 明确要禁止的无效追问字段。
VERDICT:
❌ Needs rework:修正陈述题回读的类型判定并补充覆盖该更新路径的回归测试后再合并。
KEY INSIGHT:
校验当前题型时必须复用创建路径对 itemType: statement 的语义,而不能仅依赖可为空的 questionType。
Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:
- Add a
.agents/skills/custom-codereview-guide.mdfile to your branch (or edit it if one already exists) with the/codereviewtrigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.- Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
- When your PR is merged, the guideline file goes through normal code review by repository maintainers.
Resolve with AI? Install the iterate skill in your agent and run
/iterateto automatically drive this PR through CI, review, and QA until it's merge-ready.Was this review helpful? React with 👍 or 👎 to give feedback.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/MizzenAI/mizzen-cli/actions/runs/31379320399
|
|
||
| async function getQuestionType(slug: string, questionId: string): Promise<string> { | ||
| const outline = await getClient().get<OutlineResponse>(`/interviews/${slug}/outline`) | ||
| return findQuestion(outline, questionId).questionType ?? "open_ended" |
There was a problem hiding this comment.
🟠 重要: OutlineItem.questionType 可为 null,而已有 statement 在大纲中由 itemType: "statement" 表示。这里将它回退为 open_ended,因此 outline question update <slug> <statement-id> --payload '{"followUp":"none"}' 会通过校验并继续 PATCH 无效字段,绕过了本 PR 宣称覆盖的“更新追问时按当前题型校验”。请像 assertFollowUpSupported 一样先根据 itemType 识别陈述题,并新增该更新路径的回归测试。
There was a problem hiding this comment.
Taste Rating: 🟢 好品味(Good taste)
Linus-Style Analysis
修复复用了同一题型解析逻辑,itemType: statement 不再因可空的 questionType 被误判为开放题;创建、更新和 --payload 的校验边界一致。未发现新的重要问题。
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
改动仅在 CLI 客户端拒绝无效字段,无依赖或 API 路径变更;既有陈述题更新路径已覆盖。
VERDICT:
✅ 值得合并:核心逻辑可靠。
KEY INSIGHT:
题型判定集中在 resolveQuestionType,避免创建与回读语义再次分叉。
本审查由 AI agent(OpenHands)代表用户生成。
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/MizzenAI/mizzen-cli/actions/runs/31379638686
问题
前端只为
open_ended保留followUp/timeBudget,但 CLI 此前会向所有题型透传--follow-up,导致结构题产生无效追问字段。修改
followUp/timeBudget,包括--payload。--follow-up。验证
bun test:8 passedbun run typecheckbun run bundlegit diff --check边界
本 PR 只阻止 CLI 新写入无效字段;历史数据清理和 Backend Open API 兜底校验不在本 PR。