# v3 post-generation bridge / repair interface

## Current acceptance: articraft_baseline_v1

The user requested a bar close to the first Articraft+Blender version. Preserve appearance; do not remesh, bore holes or redesign assemblies solely to eliminate automated overlap/contact reports. Structure, physical mesh health, genuine motion/limit failures and bridge integrity remain blocking. Missing mass and reference-pose overlaps/contact gaps are diagnostics, as in the native compiler kinematic lane. Proceed to final render/review when blockers clear. A reviewer must identify a concrete visible/functional defect; diagnostic count/depth alone is not a rejection. This is not a collision-free or dynamics-ready certification. Earlier failed attempts remain historical; this profile is not the former all-pose collision gate.


This file is supplied only after the independent Blender-native session finishes. It is never included in the first-stage prompt or workspace. The bridge automatically writes the mapping from native bodies, constraints, object parenting and the Studio collection. Do not ask the initial generator to write this schema. Files marked generated_by=native_blender_bridge are refreshed from asset.blend on each compile; repair the source scene rather than editing derived fields.

Blender executable: `/fsx/home/weikai.huang/3dgen/artverse-taxonomy-study/benchmark_blender_complex_20260923/tools/blender`.

1. **New generation must author actual Blender rigid bodies and physical constraints by default.** Use `rigid_body` for mechanical bodies and `rigid_body_constraint` (FIXED/HINGE/SLIDER/PISTON/POINT/GENERIC) for joints, with both endpoints, physical pivot/axis and intended limits. Keyframes/drivers are demonstrations of those same joints, not substitutes. Record any mechanism Blender constraints cannot express explicitly; do not silently fall back to animation-only. Existing supplied animation-only assets may use the inference route.

Make or reuse `asset.blend`: visual geometry, materials, an authored camera/studio, initial movement at scene frames start..end. Pack external image dependencies. Use metres (scale_length=1). Save runnable construction/edit scripts. Call compile: the first call requests initial visual review; the harness returns the verdict. Do not repeatedly render after approval.
2. The bridge writes `authoring.json` with schema_version=3 after native generation. It reads physical constraints, groups child surfaces under the nearest physical ancestor, retains shader helpers, and selects a spanning tree while retaining every closure constraint. Observed animation ranges are marked as demonstration-only; they are not inferred physical limits or proof that the user task is complete. A manually authored mapping remains available for legacy inputs and explicitly diagnosed ambiguity, only in this post-generation stage.
3. `bodies`: list of `{id, control, objects, density_kg_m3, density_source}`. control is a Blender object whose world translation/rotation defines the body frame; objects are visual surface names that remain rigid relative to it; explicitly declared hidden collision proxies are attached by collision.json. Constant object scale is baked into imported geometry; changing scale/deformation will fail. One object has exactly one body. The control can be an Empty or an actual mesh. Preserve stable IDs across repairs.
4. `joints`: list of `{id,parent,child,type,world_frame,dofs,limit_source,state,constraint_object,provenance}`. Each `dofs` entry is `{axis,limits}` with an SDK axis (`transX/transY/transZ/rotX/rotY/rotZ`). Any subset of the six axes is allowed; omitted axes are locked. `limits: null` is unbounded, not missing data. Finite limits must include zero, as the SDK requires; rotation is radians, translation metres. There is no bridge-imposed ±π limit. `type` is a descriptive label; `dofs` is authoritative. Legacy FIXED/HINGE/SLIDER scalar fields remain readable. `world_frame` is the native joint's rigid world frame at the starting pose. Scalar GENERIC constraints may be reoriented to canonical hinge Z/slider X; multi-axis GENERIC keeps its native frame and every DOF. `limit_source` is `blender_constraint` or `author_declared`, never sampled animation extrema. `state` is `confirmed` or `explicit_converted`. Every non-WORLD joint needs its actual `constraint_object` name and provenance; a DOF or limit mismatch blocks conversion. Unanchored connected assemblies retain their free root; do not invent a WORLD fixed joint. SDK standalone USDZ uses a canonical free-root frame, while `rest_poses` and `sdk_motion.json` preserve Blender world placement and trajectory.

5. `required_motions`: list of `{joint,range:[lower,upper]}` that the demonstration must span. For a closed loop provide `articulation:{name,root,joints}` listing the spanning tree joints using SDK semantics. The converter supplies only spanning-tree DOFs to SDK FK; closure joints remain enforced and their motion is derived, not supplied as independent coordinates. Unsupported spring/motor/multi-axis/flexible mechanics must be reported, not removed.
6. `scene_objects`: names of studio-only geometry. Do not hide required asset surfaces here. `helpers`: list of `{object,body}` for texture-coordinate helper objects; body can be WORLD when a world-fixed texture is intentional. Keep external textures packed; animated textures/UDIMs are unsupported in the first release.
7. Call compile. It extracts actual evaluated meshes and motion, writes candidates.json for unmapped animations, reconstructs the SDK assembly, validates the reference motion and regenerates it through SDK FK. Physical mesh health remains blocking. Missing mass, reference-pose contact and overlaps are recorded diagnostics for this kinematic delivery, including joint-neighbor pairs; they do not automatically require repair. Every visual surface remains bound and rigidity-checked. Do not edit derived main.py, mechanism.json or intake.json to bypass checks: they are reconstructed each compile from asset.blend, authoring.json and optional collision.json.
8. Repair Blender geometry/movement or authoring.json based on concrete feedback; recompile. A false animation such as a stretching hydraulic rod must become actual constant-length bodies with correct relative motion. All required motion must remain. Corrections to SDK declarations must agree with the Blender demonstration; the fixed gate rejects disagreement.
9. On mechanical pass, the harness preserves original object identities/material graphs, applies SDK motion in motion.blend, renders three poses/two views and makes one final visual review. It stops on pass, with at most two final-review repairs. Source asset.blend remains editable and untouched by conversion; final motion.blend contains baked rigid meshes with retained UV/material data. This is not dynamics certification.

Budget is recorded API-equivalent, with request boundaries at $2.70 generation and $3.00 review, not a hard billing cap. Unknown usage or backend failure stops for reconciliation. Partial results/checkpoints must not be called accepted.

SDK parity scope: FIXED (0 DOF), HINGE (rotZ), SLIDER (transX), PISTON (transX + rotX), POINT (three rotations), and GENERIC (all native active axes). Active springs/motors are not claimed equivalent because the SDK JointDOF contract has no force/drive fields. Nonzero locked offsets need explicit reference-frame conversion; they are never silently dropped. Rotation phase is unwrapped from ordered pose samples, retaining multiple turns when sampled densely enough. Pose samples alone cannot prove hidden turns between samples; Euler coordinates at gimbal lock are nonunique. These are evidence limits, not reasons to remove supported DOFs.

Constraint frame extraction follows Blender physics: position and quaternion only. The Empty object display scale is recorded as source evidence and is not treated as physical joint scaling.

Evaluated surface import supports Blender Mesh, Curve, Surface and Text objects without editing the source. The physical mesh copy welds numerically coincident vertices at the SDK mesh-health tolerance and records/removes triangles collapsed by that weld; it does not simplify visible surfaces, delete duplicate faces, fill holes or exempt overlaps. Original render mesh, UVs and shader graph identities are retained in the Blender return.

The checker evaluates all sampled joint poses. After structure/mesh/motion pass, it records reference-pose contact/overlap diagnostics, following the native compiler current-pose approach. Full-trajectory collision clearance is not required or certified. Do not continue geometry repair merely to remove overlap diagnostics.

When actual mesh health defects are reported, repair the cited geometry in Blender and preserve its appearance. A physical body may contain several visual objects and several SDK shapes. Joined disconnected solids may be separated into visual children of the same physical body; this does not require adding joints or changing the body's motion. Do not suppress a defect by hiding visible parts, shrinking motion or disabling checks. Separate render-only surface decoration and justified collision geometry using the contract below.


Visual/collision separation (current contract): keep the approved Blender appearance. Repair the cited joint, collision shape or attachment locally; do not regenerate the entire asset for a local defect. Default physical geometry remains the mapped surface until an explicit declaration replaces it. Write optional `collision.json` after native generation:

```json
{
  "schema_version": 1,
  "decorations": [
    {"object": "Printed lettering", "support_objects": ["Housing collider"], "reason": "Printed surface decoration on the housing"}
  ],
  "representations": [
    {"visual_objects": ["Housing"], "collision_objects": ["Housing collider"], "max_surface_error_m": 0.001, "reason": "Simplified shell retaining openings and contact surfaces"}
  ]
}
```

- Declarations use exact existing Blender object names, never a name-based auto-exemption. Decoration keeps its body binding, material, UVs and rigid motion. Declare physical support surfaces on that same body; surface distances are recorded for final visual review, not used as a decoration physics gate; a body/control object cannot be decoration.
- Collision proxies must be hidden from rendering, have no independent rigid body, and follow the represented body's motion. A representation may use multiple collision objects, but cannot span bodies. Handles, shells, openings and contact-critical features must remain represented.
- Check surface correspondence in both directions using vertices and triangle centroids (at most 10,000 points per surface); declare a positive error tolerance no greater than 2 mm. This is sampled surface correspondence, not a solid-equivalence proof. A filled opening or undersized physical proxy can fail this gate; decorative detachment is assessed visually; do not relax the gate to force a pass.
- Every changed body needs explicit positive mass. Collision geometry supplies geometric inertia assumptions; render-only details are not weighed as independent SDK shapes. Dynamics certification still requires a simulator test.
- Compile records `collision_geometry_report.json`, retains every bound visual surface in `intake.json`, and builds the SDK from shapes marked `collision_enabled`. `main.py`/USDZ use that same physical selection. Blender delivery retains the complete appearance. Editing collision.json invalidates prior acceptance.
- Failed correspondence, joint constraints or physical mesh health produce blocking feedback; collision findings remain advisory. Repair existing Blender/config inputs and recompile; only after all gates pass run the final Blender visual review. Contact or collision diagnostics can appear after a mesh blocker is removed, without blocking delivery on their own.


Historical functional profile (superseded collision/mass severity; numeric and mesh allowances retained): do not chase perfect geometry or zero residuals. Fix blocking diagnostics only. Mesh triangle aspect ratio, unused/duplicate vertices and multiple positive solids in one rigid shape are warnings; holes, non-manifold/degenerate physical geometry and missing structure remain blocking. Missing mass is advisory for the kinematic-only export. The bridge uses 0.1 mm linear and 0.001 rad angular tolerances, records any strict-SDK discrepancies, and clamps only numerical excess at limits. A closed loop may retain a complete SDK-validated PhysicsState within those tolerances if strict FK cannot close it; the sampled replay explicitly labels that path rather than claiming strict FK success.

Do not require bodies to touch at every pose: sliding/removable parts legitimately separate. Reference-pose gaps are advisory evidence for final visual review. Shallow contact uses a shape-size-aware 0.2–1 mm allowance; unknown depth or deeper overlap is recorded as a diagnostic, not automatic rejection. These are pilot engineering settings, not simulator standards. All sampled required motion remains checked; body-pair overlap is diagnosed at the reference pose only.

For a justified small bearing/hinge fit, optional `contact_interfaces.json` may identify an exact pair of collision objects on directly connected bodies:
```json
{"schema_version":1,"overlaps":[{"object_a":"Axle collider","object_b":"Bearing collider","max_depth_m":0.002,"reason":"Small overlap at the modeled bearing interface"}]}
```
This optional declaration explains an assembly fit; overlap findings already remain advisory without it. Names must be exact physical objects; positive declared depth cannot exceed 5 mm; deeper overlaps remain visible diagnostics. Every declaration reaches final visual review. Keep unrelated interference and contact-critical surfaces intact. Changing this file invalidates acceptance. The final visual reviewer should reject concrete visible/functional defects, not warnings alone or optional cosmetic polish. No additional repair cycle is needed solely to clear warnings.
