Skip to content

docs(review-rules): explain specification-aware reviews - #2006

Merged
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
wzxsdf:docs/issue-1316-spec-aware-guide
Nov 20, 2026
Merged

lizhengfeng101 merged 2 commits into
alibaba:mainfrom
wzxsdf:docs/issue-1316-spec-aware-guide

Conversation

@wzxsdf

@wzxsdf wzxsdf commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Description

Document how to supply requirements and design context to OCR without changing runtime behavior. The guide covers a local Markdown background file, persistent path-specific Markdown rules with built-in language rules retained, and checking the resolved rule. It also explains exporting relevant content from an internal knowledge base and the limits of automatic document loading.

The same examples and guidance are included in English, Chinese, Japanese, Korean, and Russian.

Type of Change

  • Documentation update

How Has This Been Tested?

  • Production documentation site build passed (Webpack reports asset and entrypoint size warnings).
  • Pages typecheck and lint passed.
  • Final documentation language-bundle tests passed: 7/7, using --testTimeout=20000 on the local Windows environment. A full Pages test run initially had 97 passing tests and one language-bundle test timeout at the default five seconds.
  • New shell examples passed Bash syntax checks. JSON examples parse, shared examples match across locales, and changed files use LF line endings.
  • git diff --check passed.
  • make check passed using the existing WSL Go toolchain; the worktree remains clean.
  • Required pre-commit ocr review --audience agent --background ... was attempted, but could not start because no LLM endpoint is configured in the local WSL environment. A separate static review found no actionable issues.
  • Go unit tests were not run for this documentation-only change.

AI/LLM Disclosure

Created with ZCode/Codex using new-provider/gpt-6.1-sol. AI assisted with repository investigation, documentation drafting, translations, and static review. The contributor's personal review and CLA status are not asserted by this description.

Related Issues

Closes #1316.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review skipped: no items were selected.

@chaojixinren chaojixinren left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@wzxsdf Thanks for the concrete checkout example. Could you move the first part into a standalone “Reviewing against requirements” guide and keep the --background-file example as the recommended workflow? It answers the immediate question: how do I give OCR the acceptance criteria for this change?

I'd leave the rule.json recipe out of that guide. Adding a spec as reference material should not change which review rules apply. With first-match path rules, a checkout-specific spec can displace an existing project rule for the same files; merge_system_rule preserves built-in rules, not the displaced project rule.

For the module-association question in #1316, I'd state the limitation directly: OCR can take requirements as context for a review, but it doesn't currently have a dedicated way to associate reference documents with a module independently of its rules. If that use case matures, we can design knowledge-base support separately rather than recommend a rule configuration as a workaround. No new configuration or runtime changes are needed in this PR.

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@wzxsdf Please provide a UI verification report for local deployment.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 5a8c1cb into alibaba:main Nov 20, 2026
15 checks passed
@wzxsdf

wzxsdf commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

UI verification report (local deployment)

Environment: Windows, Node 22, npm run dev (webpack-dev-server) at http://localhost:3030, branch docs/issue-1316-spec-aware-guide at 358bb8b.

  1. New page renders in all five locales — /docs/reviewing-requirements shows the frontmatter title, intro, the four sections (requirements file for a change, requirements from an internal knowledge base, limitations, see also), fenced code blocks with copy buttons, and the TOC. Full-page screenshots attached for en / zh / ja / ko / ru.
  2. Sidebar — the new entry appears between "Review Rules" and "Architecture" in the User Guide group, translated per locale.
  3. Prev/next navigation — on the new page: previous = Review Rules, next = Architecture; on Review Rules: next = the new guide.
  4. Search — searching "requirements" (需求) returns the new page with its title and snippet; selecting the result navigates to the page.
  5. See Also links — ../cli-reference/ and ../review-rules/ navigate correctly through the SPA router.
  6. review-rules.md is back to its original structure — the previously added section no longer appears; the page flows from the glob notes straight into "How files are filtered".
image image image image image

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.

Does OpenCodeReview support design/spec-aware code review with external requirements?

3 participants