Skip to content

sdk(knowledge): reject a section that heads one rule ID twice - #146

Merged
tzhouam merged 1 commit into
mainfrom
fix/knowledge-section-repeated-ids
Sep 10, 2026
Merged

tzhouam merged 1 commit into
mainfrom
fix/knowledge-section-repeated-ids

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Why

#142 made rule IDs unique tree-wide but collected a section's heading IDs deduplicated, so a proposal heading its own ID twice (## X-2 over ### X-2) or two nested headings sharing an ID passed validation and apply while the ID was otherwise free. The downstream validators do not enforce ID uniqueness, so that would land an ambiguous definition. Found by the local review gate while curating #144.

What

_section_rule_ids keeps repeats; validation rejects the proposal (section heads rule_id X more than once) and apply treats it as an integrity failure. Tests: parent-and-nested, two-nested, apply-time refusal. No API change; knowledge API stays 1.1.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_018MAFmwP3u5qAMDgHfM6LFi

#142 made rule IDs unique tree-wide, but collected a section's heading IDs
deduplicated, so a proposal heading its own ID twice (`## X-2` over
`### X-2`) or two nested headings sharing an ID (`### X-4` twice) passed
validation and apply while the ID was otherwise free. The downstream
validators do not enforce ID uniqueness, so that would land an ambiguous
definition.

`_section_rule_ids` now keeps repeats; validation rejects the proposal
("section heads rule_id X more than once") and apply treats it as an
integrity failure. Found by the commit gate while curating the 09-10
batch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MAFmwP3u5qAMDgHfM6LFi
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@tzhouam
tzhouam merged commit c4cdf5e into main Sep 10, 2026
2 checks passed
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