Skip to content

fix(test/requirement-review): allow degraded review when requirement doc is missing#53

Merged
Jun-Hex merged 5 commits intomainfrom
fix/test-rr-degraded-mode
Apr 22, 2026
Merged

fix(test/requirement-review): allow degraded review when requirement doc is missing#53
Jun-Hex merged 5 commits intomainfrom
fix/test-rr-degraded-mode

Conversation

@Jun-Hex
Copy link
Copy Markdown
Collaborator

@Jun-Hex Jun-Hex commented Apr 21, 2026

Summary

  • Requirement review previously rejected any Story without a "requirement doc" link, even when the Story description and design link were available.
  • Now degrades gracefully: as long as one of requirement_doc_link / story_description / design_link is present, the review proceeds and the skill is told (via a banner injected from the backend) to inform the user that the result has reduced reliability.
  • Stage 2.6 of PHASES.md is updated to reflect the relaxed blocking condition; stages 1 and 2.1 add the banner-detection and skip-fetch instructions.
  • Plugin version bumped to 0.0.6, marketplace metadata to 0.1.36.

Test plan

  • Trigger requirement review on a Story that has no requirement_doc_link but has a description and/or design link → should run in degraded mode and surface the banner in chat + report
  • Trigger requirement review on a Story with all three sources empty → should still be rejected with the new guidance message
  • Trigger requirement review on a Story with a valid requirement_doc_link that fails to download → should still be rejected (permission-fix guidance unchanged)
  • Trigger requirement review on a Story with a valid requirement_doc_link that downloads cleanly → happy path unchanged

Cross-repo dependency

Paired backend change in ai-case: https://git.tapsvc.com/qa/automated-test-cases/ai-case/-/merge_requests/24 (validate_prefetch_data + prompt builder updates that surface this skill change).

🤖 Generated with Claude Code

…doc is missing

## Changes
- PHASES stage 1: detect the "degraded review mode" banner and inform the user upfront
- PHASES stage 2.1: skip requirement-doc fetch in degraded mode
- PHASES stage 2.6: relax the blocking condition so at least one of requirement doc / story description / design link is enough
- Bump test plugin to 0.0.6 and marketplace metadata to 0.1.36

## Impact
- Requirement review no longer rejects Stories that lack the "requirement doc" field, as long as the description or design link can serve as input
- The existing happy path is unchanged: Stories with a valid requirement doc still go through the full 5-stage flow
- Requires the paired ai-case backend change (validate_prefetch_data + prompt builder) to take effect

Generated-By: Claude Code <https://claude.ai/code>

Co-Authored-By: Claude <noreply@anthropic.com>
@Jun-Hex Jun-Hex requested a review from em0t as a code owner April 21, 2026 12:24
@github-actions github-actions Bot added scope:plugins Changes one or more plugins. kind:fix Fixes a bug or regression. size:s Small PR. labels Apr 21, 2026
Jun-Hex and others added 3 commits April 21, 2026 20:32
…work class

ai-case backend ai_assistant_service.py:_setup_conventions_in_dir reads
plugin's CONVENTIONS.md and symlinks it to work_dir/.claude/CONVENTIONS.md
as Claude Code SDK input. It is plugin configuration documentation, not a
skill output, so it belongs in the framework allowlist alongside
PHASES.md / SKILL.md / plugin.json etc.

Without this entry, the contract-bridge-check pre-commit hook fails on
ai-case with "❌ 缺失声明: CONVENTIONS.md" (1 missing declaration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PHASES.md and test-case-writer agent now instruct the model to call the
in-process MCP tool save_test_cases for writing *_cases.json. The tool's
input_schema (built from the backend Pydantic TestCase) enforces field
constraints at generation time, replacing the post-hoc PreToolUse hook
schema validation.

Bash escape hatch retained for >50-case merges (test_cases.json,
final_cases.json) where pure LLM output paths risk token truncation.

Bump test plugin to 0.0.7, marketplace metadata to 0.1.37.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update CONVENTIONS.md "strict validation" section to describe the new
layered defense (input_schema -> tool-side validate_cases -> hook redirect)
instead of the obsolete PreToolUse hook narrative.

Drop "post_complete auto-fix / fallback" framing from
test-case-generation/PHASES.md; schema is now enforced at the tool input
layer at generation time.

Note in _shared/LARGE_FILE_HANDLING.md that mcp__cases__save_test_cases
input is subject to the same LLM token limit as Write, so the >50-case
Bash-merge rule still applies.

Bump marketplace metadata 0.1.37 -> 0.1.38; CHANGELOG and READMEs synced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added scope:docs Changes documentation or contributor guidance. size:m Medium PR. and removed size:s Small PR. scope:docs Changes documentation or contributor guidance. labels Apr 22, 2026
Resolve conflicts:
- marketplace.json: keep our 0.1.38 (production+1 from main 0.1.37) and
  test plugin 0.0.7
- CHANGELOG.md: keep 0.1.38 entry on top, then main's 0.1.37 / 0.1.36
- README.md / README.en.md: take main's spec/git/sync versions, keep our
  test 0.0.7
- plugins/test/.claude-plugin/plugin.json: keep 0.0.7
- plugins/test/.codex-plugin/plugin.json: keep 0.0.7 (interface block from
  main retained)
- plugins/test/README.md: keep both v0.0.7 (ours) and v0.0.6 (main) entries

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added scope:docs Changes documentation or contributor guidance. and removed scope:docs Changes documentation or contributor guidance. labels Apr 22, 2026
@Jun-Hex Jun-Hex merged commit def5a37 into main Apr 22, 2026
4 checks passed
@Jun-Hex Jun-Hex deleted the fix/test-rr-degraded-mode branch April 22, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:fix Fixes a bug or regression. scope:plugins Changes one or more plugins. size:m Medium PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants