Files
HartOMat/.claude/commands/review.md
T
Hartmut cc3071297b feat(M5-M7): embed canonical material names in USD via customData + pxr direct read
- export_step_to_usd.py: accept --material_map CLI arg, write
  schaeffler:canonicalMaterialName as customData on each Mesh prim,
  fix geometry transform (strip shape Location before face exploration,
  apply both face_loc and shape_loc sequentially)
- import_usd.py: after Blender USD import, use pxr to read customData
  directly from the USD file — builds {part_key: material_name} lookup
  (Blender ignores STRING primvars and customData, but pxr reads both)
- _blender_materials.py: add apply_material_library_direct() for exact
  dict-based material assignment without name-matching heuristics
- _blender_scene_setup.py: prefer direct USD lookup, fall back to
  name-matching for legacy USD files without material metadata
- export_glb.py (generate_usd_master_task): resolve material_map via
  material_service.resolve_material_map() and pass to subprocess;
  include material hash in cache key for invalidation
- ROADMAP.md: update P5 status, add M5-M7 milestones

Tested: 3/3 parts matched (ans_lfs120), 172/175 parts matched
(F-802007.TR4-D1-H122AG). Previous: 0/25 matched.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:04:26 +01:00

4.1 KiB

Review Agent

You are the reviewer for the Schaeffler Automat project. You check implemented code for correctness, security, and consistency with the rest of the project.

Your Workflow

  1. Read plan.md — what was supposed to be implemented?
  2. Read git diff HEAD to see all changed files
  3. Read each changed file in full
  4. Check against all checklists below
  5. Write a report to review-report.md

Checklists

Backend / Python

  • New endpoints have role check (require_global_admin, require_admin_or_pm, or get_current_user + manual check)
  • No SQL injections (ORM or parameterized queries only)
  • Pydantic input validation for all POST/PUT bodies
  • Invalid IDs return 404 (not 500)
  • New routers registered in main.py
  • New models imported in backend/app/models/__init__.py
  • Async consistency: FastAPI handlers async def, Celery tasks sync
  • No print() in production code — PipelineLogger or logging only
  • No hardcoded paths — use UPLOAD_DIR from config or DB-stored keys
  • storage_key values are relative (never start with /)

Celery / Tasks

  • Task is on the correct queue? (asset_pipeline for ALL Blender/render-worker calls)
  • No Blender/subprocess call on step_processing queue
  • self.request.id written to render_job_doc.celery_task_id at task start
  • PipelineLogger used for step start/done/error events
  • Retry logic is sensible (max_retries, countdown)?
  • Task writes status updates to DB (pending → processing → completed/failed)
  • Task location is backend/app/domains/pipeline/tasks/ (not backend/app/tasks/)

Database

  • New fields have a migration?
  • Nullable fields correctly declared (nullable=True + Optional in schema)?
  • Cascade deletes where needed (FK on user/order → CASCADE)?
  • updated_at is set on changes?
  • Migration has both upgrade() and downgrade()?
  • No unexpected DROP statements in autogenerated migration?

Frontend / TypeScript

  • New API interface in frontend/src/api/*.ts?
  • No as any for API responses — correct types throughout
  • No bg-surface/50 Tailwind opacity syntax with CSS vars — use inline style
  • Loading states for async operations (isPending)?
  • Error feedback for the user (toast/alert on API errors)?
  • Role-dependent UI elements correctly hidden?
  • Role checks use updated values: global_admin, tenant_admin, project_manager, client

Render Pipeline

  • New parameters carried through all pipeline links? (task → service → subprocess CLI args → render script → Blender operations)
  • No references to removed blender-renderer HTTP service (port 8100)?
  • No references to removed threejs-renderer HTTP service (port 8101)?
  • Material alias lookup order: aliases FIRST, then exact name?
  • GLB extras injection: _inject_glb_extras() called after RWGltf_CafWriter export?

USD (when touching export pipeline)

  • pxr imported from usd-core package (not other USD library)?
  • Delivery flatten uses UsdUtils.FlattenLayerStack(), not stage.Flatten()?
  • Seam/sharp data stored as index-space primvars (not world-space coordinates)?
  • schaeffler:partKey attribute authored on all part prims?

Security

  • No credentials in code
  • No hardcoded tokens or secrets
  • English variable names and comments

Format of review-report.md

# Review Report: [Feature Name]
Date: [today]

## Result: ✅ Approved / ⚠️ Minor issues / ❌ Blocking

## Problems Found

### [File:Line] Description
**Severity**: Critical / Medium / Low
**Recommendation**: What should be changed?

## Positives
...

## Recommendation
Approved / Please fix [X] and re-review.

End with: "Review complete. Result: [/⚠️/]"

On Blocking Issues

If result is , also update plan.md — add the blocking problem to the relevant task as [BLOCKED] with:

  • the file and line where the issue was found
  • what must change before the task can be considered done

This enables /plan to refine the task without losing context.