Skip to content

fix(selling): distinguish new vs existing VPC in architecture planning - #197

Open
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/41588cce
Open

fix(selling): distinguish new vs existing VPC in architecture planning#197
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/41588cce

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

背景

针对 Session 5bed835ca9c84c7d9e3ec57fbc95c0e9intent_parsing 只解析出 VPC、VSwitch 两个 product 且未声明 VPC 已存在,但 architecture_planning 仍预设已有 VPC,只产出单一候选「已有 VPC 下新建 VSwitch」,evaluate_candidates 沿用该候选,导致候选集完全遗漏用户的 VPC 创建需求。

根因

iac-aliyun-architecture skill 的「资源生命周期约束」只规定了 intent 已显式声明 resource_intents 时如何执行硬约束,缺少未声明时的默认语义;同时「简单明确需求 → 单候选」的口径让 VPC+VSwitch 这类需求被判成简单需求而直接收敛,收敛过程中把未声明的 VPC 悄悄预设成已有资源。iac-aliyun-intent 侧已有的「用户没说明就不要标 use_existing」约束没有对称下传到 architecture 侧。

变更

  • skills/iac-aliyun-architecture/SKILL.md
    • 新增「未声明的资源默认是新建」:use_existing / reference 只能来自 intent 显式声明;未声明的 product 以及 resource_intents 整体缺失时一律按 action=create 处理;写入本 Session 的反例。
    • 新增「依赖资源生命周期未确认时的候选覆盖」:承载关系(VSwitch→VPC、ECS→VSwitch、安全组→VPC)中被依赖资源生命周期未确认时,必须同时给出「新建 VPC + 新建 VSwitch」与「复用已有 VPC + 新建 VSwitch」两个候选;「已确认」仅限 intent 显式 resource_intentsnon_functional.network_constraints 中的具体已有资源标识,确认后收敛单候选;每个候选的 resource_intents 必须与该候选自身语义一致。
    • 收紧「简单明确需求给单候选」口径为「资源清单和生命周期都已确定」。
  • prompts/architecture_planning.md:方案数量规则补充「生命周期未确认时至少 2 个方案」;注意事项补充「未显式声明即按新建处理,不要预设已有资源」。
  • skills/iac-aliyun-architecture/evals.json:新增 eval 9(未声明已有 VPC → 覆盖新建 VPC、候选 ≥2)、eval 10(已给出 VPC ID → 收敛单候选且 VPC 为 use_existing)。
  • tests/pipeline/selling/skills/test_iac_aliyun_architecture_skill.py:新增 4 个契约测试锁定上述规则。

evaluate_candidates 是引擎驱动的 parallel_sub_pipelineprompts/evaluate_candidates.md 明确无 agent 介入),只消费 architecture.candidates、不产生候选,因此未改动。

验证

  • uv run pytest tests/pipeline -n auto1533 passed(含 tests/pipeline/selling 352 项)
  • uv run ruff check src/ tests/ → All checks passed
  • uv run ty check src/ → All checks passed

architecture_planning 在 intent 未声明 VPC 已存在时仍预设已有 VPC,
只产出「已有 VPC 下新建 VSwitch」单候选,候选集遗漏用户的 VPC 创建需求。

- iac-aliyun-architecture skill 明确 use_existing/reference 只能来自 intent
  显式声明,未声明的资源(含 resource_intents 缺失)默认按 create 处理
- 承载关系中被依赖资源生命周期未确认时,要求同时给出「新建 VPC + 新建
  VSwitch」和「复用已有 VPC + 新建 VSwitch」两个候选;仅在 intent 显式
  声明或 network_constraints 给出已有资源标识后才收敛为单候选
- 收紧「简单明确需求给单候选」口径为资源清单与生命周期均已确定
- 补充两个 eval 用例与契约测试覆盖未确认/已确认两种语义

evaluate_candidates 为引擎驱动的 parallel_sub_pipeline,只消费
architecture.candidates,不产生候选,无需改动。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant