feat(schema): enforce no-whitespace in tags via pattern ^\\S+$#197
Closed
mingcha-dev wants to merge 1 commit into
Closed
feat(schema): enforce no-whitespace in tags via pattern ^\\S+$#197mingcha-dev wants to merge 1 commit into
^\\S+$#197mingcha-dev wants to merge 1 commit into
Conversation
Adds hard schema-level enforcement that tags must not contain whitespace. This prevents tags like 'economic growth' from being introduced — authors must use 'economic-growth' instead. Changes: - tags.items gains 'pattern': '^\\S+$' - Description updated with explicit rule + case preservation convention Prereq satisfied by PR #196 (cleanup of 322 existing files to remove whitespace before enforcing the pattern). Tested: 'make validate' passes against current main (0 violations). Ref: three-way review 2026-04-30 (明鉴/墨子/明察)
Collaborator
Author
|
protect-schema CI 规则:schema 改动必须直接 commit to main by maintainer,不能走 PR。 关闭此 PR。合适做法:
schema 改动内容(pattern + description 更新)已 ready,可由有权限人直接 commit。 |
firstdata-dev
approved these changes
Apr 30, 2026
Collaborator
firstdata-dev
left a comment
There was a problem hiding this comment.
Approved ✅
- Schema change 最小:items 加
"pattern": "^\\S+$"+ description 标注
firstdata-dev
approved these changes
Apr 30, 2026
Collaborator
firstdata-dev
left a comment
There was a problem hiding this comment.
Approved ✅ schema 变更最小(items pattern + description)。本地 make validate 在 origin/main 全库通过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds hard schema-level enforcement that tags must not contain whitespace.
"items": { - "type": "string" + "type": "string", + "pattern": "^\\\\S+$" }Also updates description to state the rule + acronym-case convention.
Why
Tags containing spaces (e.g.
"economic growth") break tokenizer/index semantics. Schema description has always said "mixed Chinese/English keywords" and examples always used hyphens (economic-growth), but there was no enforcement. This PR closes the gap.Prereq
Merged PR #196 cleaned up 322 existing files (2967 space-tag violations → 0). Main is clean; this PR just locks the door behind us.
Validation
Ran
make validateagainst current main — all files pass.Three-way context
Ref: 2026-04-30 alignment (明鉴/墨子/明察). This is the 2nd of 2 back-to-back PRs.
Convention (documented in description)
Checklist
make validatepasses on main