Skip to content

feat: geometry repair pipeline backend (inspect/repair, repair decisions, simulation compatibility) - #143

Open
dhimashary wants to merge 42 commits into
choras-org:devfrom
dhimashary:feat/geometry-repair-pipeline
Open

feat: geometry repair pipeline backend (inspect/repair, repair decisions, simulation compatibility)#143
dhimashary wants to merge 42 commits into
choras-org:devfrom
dhimashary:feat/geometry-repair-pipeline

Conversation

@dhimashary

Copy link
Copy Markdown
Contributor

Geometry Repair Pipeline – Backend

Adds backend support for the geometry inspection & repair workflow: a unified
inspect+repair pipeline run in the background, per-model repair decisions,
stage-aware simulation compatibility, and variant-aware model downloads.

New endpoints

  • POST /models/:id/repair-decision — accept/reject repaired geometry.
    Accepting switches the model's active geometry (viewer URL + simulation
    .geo/.msh) to the repaired files; rejecting reverts to the original.
  • POST /models/:id/reprocess-geometry — re-run the pipeline (e.g. after a
    failure). Clears stale issues + repair decision, resets status to Pending,
    redispatches the background task (202).
  • GET /models/:id/simulation-compatibility — per-method compatibility for
    the model, returning both initialCompatibility (AfterUpload) and
    repairedCompatibility (AfterRepair).
  • GET /models/:id/download?variant=repaired|initial — download the model's
    .obj; defaults to repaired if accepted, else original.
  • GET /geometry/simulation-compatibility — baseline per-method compatibility
    merged with each method's override.

Pipeline & processing

  • Merged inspect + repair into a single pipeline run, offloaded to a
    background Celery task.
  • New status/stage enums: GeometryProcessingStatus (Pending / Processing /
    Completed / Failed), RepairStatus (Pending / Accepted / Rejected),
    DetectionStage (AfterUpload / AfterRepair).
  • New geometry_compatibility_service resolving method-specific geometry
    validation across stages.

Data model / schemas

  • Model: added geometry processing status + repair status tracking.
  • ModelIssue: added geometryPath, modelFileUrl/fileUrl exposure, and
    issueCount (fixed initialization via dump_default).
  • New schemas: repair decision, download query (variant), simulation
    compatibility (model + baseline).

Fixes

  • Model ID field NumberInteger; unknown-model responses 404400.
  • obj → 3dm/geo conversion no longer creates unneeded/merged triangles.
  • Dockerfile: reworked into a multi-stage build. A builder stage compiles
    the native volume_detector (CGAL/Eigen) from the geometry-pipeline submodule
    and the final stage copies just the binary.

notes

  • Requires the geometry-pipeline dependencies.

dhimashary and others added 30 commits June 11, 2026 14:00
…eSchema

fix(geometry_service): update issue file naming convention in inspect pipeline
- Add GeometryProcessingStatus enum and Model.geometryStatus/geometryProgress columns
- Move inspect+repair pipeline into process_model_geometry @shared_task
- create_new_model now commits the model then dispatches the task (returns immediately, avoids gunicorn worker timeout and rolled-back transactions)
- Build upload URLs via file_service.upload_dir() instead of request.host_url (no request context in worker)
- Report coarse stage-based progress (5/35/90/100)
- Expose geometryStatus/geometryProgress in model schemas
- Add plan.md documenting the strategy
- Add _load_validation_callable() to dynamically import validation modules
- Add _run_method_validation() to execute validation and handle errors safely
- Update _method_result() to apply validation override with reason
- Update _compatibility_block() to resolve geometry input file for validation
- Update get_simulation_compatibility() to carry methodValidation in method dict
- Add reason field to ModelMethodCompatibilitySchema
- Validation result now combines with generic verdict using AND logic
- Result is compatible only if BOTH generic and validation are compatible
- If either is incompatible, final result is incompatible
- Reason is included when validation runs
- Uses worst-case severity ranking for merged verdict
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