a3bb78e06b
Security Quality Gate / npm audit, Bandit, pip-audit, detect-secrets (pull_request) Failing after 16m35s
44 lines
1.6 KiB
Markdown
44 lines
1.6 KiB
Markdown
# V2 Phase 3 Structured Review UI Read Path
|
|
|
|
Date: 2026-07-01
|
|
|
|
## Scope
|
|
|
|
This slice moves the contract detail review display toward the structured review result tables.
|
|
|
|
It keeps legacy `review_tasks.risk_items` and `review_tasks.citations` as fallback data. No database migration, column removal, or API response breaking change is included.
|
|
|
|
## Changes
|
|
|
|
- Added Contract Web proxy routes:
|
|
- `/api/contract-platform/contracts/{id}/review-risks`
|
|
- `/api/contract-platform/contracts/{id}/review-citations`
|
|
- Added frontend service types and readers for structured review risks/citations.
|
|
- Updated the contract detail page to:
|
|
- Load structured risks/citations for succeeded review tasks.
|
|
- Prefer structured risk rows when available.
|
|
- Prefer structured citation rows when available.
|
|
- Show citations under their linked risk item when `risk_item_id` is available.
|
|
- Keep legacy task JSON as fallback for old or partially backfilled data.
|
|
|
|
## Validation
|
|
|
|
Local validation:
|
|
|
|
```powershell
|
|
npm --workspace @yuqei/contract-web run typecheck
|
|
npm --workspace @yuqei/contract-web run build
|
|
python -m pytest yuqei-contract-platform\services\contract-api\tests\test_structured_review_results.py -q
|
|
```
|
|
|
|
Observed build result:
|
|
|
|
- Next.js build completed successfully.
|
|
- New proxy routes were included in the route table:
|
|
- `/api/contract-platform/contracts/[id]/review-citations`
|
|
- `/api/contract-platform/contracts/[id]/review-risks`
|
|
|
|
## Next Step
|
|
|
|
Continue the same migration pattern into admin/review management surfaces: prefer structured `review-risks` and `review-citations`, keep legacy task JSON fallback, then add UI regression coverage for risk-linked citation display.
|