Skip to content

policy: Shorts_Director entities 契约声明收窄为显式枚举(ADR-0105,IR-0007) - #483

Merged
randypanding merged 2 commits into
mainfrom
policy/shorts-entities-enumerate
Sep 1, 2026
Merged

policy: Shorts_Director entities 契约声明收窄为显式枚举(ADR-0105,IR-0007)#483
randypanding merged 2 commits into
mainfrom
policy/shorts-entities-enumerate

Conversation

@randypanding

Copy link
Copy Markdown
Contributor

ADR-0105

Copilot AI lite review requested due to automatic review settings September 1, 2026 13:21
@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 9652fc36-5b87-46dc-9a54-619013d401d2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

枚举 Shorts_Director 实体契约以支持 ADR-0105 退役

⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• 将 Shorts_Director 实体契约从通配符改为七个现存 schema。
• 允许依据 ADR-0105 合法退役 shot_slot_query 契约。
• 保留 contracts/common 通配符,并记录新增实体需手工登记。
Diagram

graph TD
  ADR["ADR-0105"] -->|"授权收窄"| Policy["契约策略"] -->|"显式声明"| Schemas["7 个实体"] -->|"兼容性检查"| Gate["契约门"]
  Policy -.->|"排除"| Retired["退役 schema"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. 为契约门增加 ADR 删除豁免
  • ➕ 保留实体目录通配符,新 schema 可自动纳管
  • ➕ 将合法退役规则集中在检查引擎中
  • ➖ 需要修改并重新钉扎 CI-Workflows 引擎
  • ➖ 增加豁免解析和防滥用逻辑,扩大跨仓变更范围
2. 支持通配符排除规则
  • ➕ 保留目录自动发现能力
  • ➕ 仅需明确排除退役 schema
  • ➖ 当前契约策略和引擎未声明支持负向匹配
  • ➖ 排除项会随退役持续累积,增加维护成本

Recommendation: 当前显式枚举最适合此次退役:它兼容已钉扎引擎的无条件删除规则,变更局部且可审计。应接受新增实体需手工登记的代价,并通过评审及 ADR 索引持续检查漏登。

Files changed (1) +12 / -1

Other (1) +12 / -1
contracts.yaml显式枚举 Shorts_Director 实体契约 +12/-1

显式枚举 Shorts_Director 实体契约

• 将 'schema/entities/**' 替换为七个现存实体 schema 的明确路径,使已批准退役的 'shot_slot_query.schema.json' 不再触发 CONTRACT_REMOVED。保留 contracts 和 common 通配符,并记录新增实体必须手工登记的治理约束。

governance/policy/contracts.yaml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Shorts_Director 的实体 JSON Schema 契约声明从 schema/entities/** 的 glob 收窄为显式枚举,以配合 ADR-0105 / IR-0007 的契约退役流程,避免契约门引擎对声明路径下文件删除的无条件失败。

Changes:

  • Shorts_Director 的 entities 契约声明从 glob 改为 7 个 schema 文件的显式枚举。
  • 增补注释解释收窄声明的动机与代价(新增 schema 需手工登记)。

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +47
# ADR-0105(IR-0007 契约退役,archive/adr):entities 声明由 glob 收窄为
# 显式枚举——契约门引擎对声明路径下的文件删除(CONTRACT_REMOVED)无条件红
# 且无 ADR 豁免通道,合法退役的唯一通道即同步收窄本声明(引擎注释认可)。
# 代价(有意接受):新增实体 schema 不再被 glob 自动纳管,须在此登记一行;
# 漏登由 review + archive/adr/INDEX.yaml 追溯。
@randypanding
randypanding merged commit 83ec83c into main Sep 1, 2026
15 checks passed
@randypanding
randypanding deleted the policy/shorts-entities-enumerate branch September 1, 2026 13:28
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.

2 participants