Skip to content

Collect explicitly requested rule entries and localize the rule view - #40

Merged
Qiuner merged 3 commits into
Qiuner:mainfrom
Cardosao:fix/explicit-entries-and-rule-view-language
Nov 14, 2026
Merged

Qiuner merged 3 commits into
Qiuner:mainfrom
Cardosao:fix/explicit-entries-and-rule-view-language

Conversation

@Cardosao

@Cardosao Cardosao commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem 1. The constraint collector only starts from AGENTS, CLAUDE, GEMINI and SKILL files, CONTRIBUTING.md, Copilot instructions and Cursor rules. Projects that keep their rules in another file, such as CONTEXT.md, get an empty catalog and the delivery ends with no rules at all. On a real Godot project the collector found 0 sources. 2. The rule view text is hardcoded in Chinese (src/constraint-rule-view.mts). A map authored in another language, for example pt-BR, shows Chinese headings and labels mixed with English controls, which contradicts references/bilingual.md ("other languages use English controls with authored project text"). ## Changes - discover-constraints: new repeatable --entry <path> option (and an entries option in the API). Requested files are treated as instruction entries and their local Markdown references are followed. Missing or non-Markdown paths are reported in coverage.unresolved instead of failing. - constraint-rule-view: generated text follows the architecture map language. Maps in zh keep the existing Chinese text; any other language gets English. Without a language the legacy default stays Chinese, so existing outputs do not change. - render and render-constraints pass the map language to the rule view. - references/constraint-graph.md and .zh.md document --entry; docs/i18n.json updated with check-docs --update. ## Tests - New test: explicit entries are collected, referenced files are followed, and missing or non-Markdown entries land in coverage.unresolved. - New test: no CJK text in the rule view for pt-BR and en maps; Chinese text kept for zh-CN and for the legacy default. - Both new tests fail on the previous code (the option and the language parameter did not exist). - npm test: 101 passed, 0 failed. npm run check:build and scripts/check-docs.mjs pass. - On the Godot project mentioned above: 0 sources before, 11 sources and 192 sections with --entry CONTEXT.md --entry README.md.

Maintainer completion

Generated rule content now follows language changes after the page opens, including category cards, coverage, directory/source documents and open detail dialogs. Authored rules and source quotations retain their original text. Selection, grouping, filters and camera state are preserved.

Added browser regression coverage for Chinese/English switching, directory and dialog content, mobile layout and initial language selection. Updated both constraint-graph guides and regenerated distribution artifacts and the demo.

Validation: local npm run check:pr passed (101 unit tests and all browser suites), and npm run check:install passed on the committed snapshot. Desktop English and mobile Chinese screenshots were inspected. The browser CI runner is pinned to Ubuntu 24.04 because Playwright 1.56.1 cannot install Chromium on the new Ubuntu 26.04 ubuntu-latest image.

Cardosao and others added 3 commits October 26, 2026 16:53
- discover-constraints: new repeatable --entry option (and entries API option)
  for projects that keep their rules outside AGENTS/CLAUDE files, such as
  CONTEXT.md. Missing or non-Markdown paths are reported in coverage.unresolved.
- constraint-rule-view: generated text follows the architecture map language.
  zh maps keep the Chinese text; other languages get English, as described in
  references/bilingual.md. The legacy default without a language stays Chinese.
- Tests for both changes; documentation updated in English and Chinese.
@Qiuner
Qiuner merged commit c3f6c0a into Qiuner:main Nov 14, 2026
5 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.

2 participants