Commit Graph

382 Commits

Author SHA1 Message Date
NiJingzhe f2ceed75a3 chore(examples): track bowl_connector target STEP (reverse-eng example input) 2026-09-07 05:47:34 +08:00
NiJingzhe fc6b36b127 Merge branch 'feat/examples-cleanup' into dev 2026-09-07 05:46:21 +08:00
NiJingzhe 237702c7a8 feat(examples): unnumbered self-contained layout with per-example out/
- rename every numbered example (04/08/10/11/7ep scripts, 12/16/20/21 dirs)
  to clean names; each example now writes artifacts to its own out/ folder
- examples/README rewritten as a category index (part / assembly / reverse
  engineering / FEM); stale run_examples.py reference removed
- flange_plate gains the quickstart FTC part (model.py + external verify.py
  + README); u_link/ap242/flange demo builders read the new asset paths
- ap242_gmsh_volume_mesh gains render_views.py for the demo gallery

fix(artifacts): round-trip-stable geometry fingerprint bounds

AddOptimal bounds wobble by one shape-tolerance quantum between a fresh
shape and the same shape read back from BRep bytes, so definitions sitting
on a quantization cell edge failed every package re-validation. Quantize
bounds at a fixed 1e-4 mm grid, far coarser than the wobble; full suite
green (1503 passed). Stored packages captured before this change must be
recaptured.
2026-09-07 05:46:15 +08:00
NiJingzhe b808c3570c Merge branch 'feat/restudio-react-skill-harnesses' into dev 2026-09-07 02:29:38 +08:00
NiJingzhe 7a8404f03e feat(skill): harness-specific host bindings for 7 compile targets
- skillproj.toml: targets omp,opencode + zcode,claudecode,codex,dsh,kimicode
- single-part-modeling: 5 host-binding pairs -> 10 (ask tool, TODO tool,
  REPL/script hypothesis loop, plan state machine, isolated image review)
- zcode+claudecode share one block per binding (AskUserQuestion/TodoWrite/
  Agent-Task); codex = plain-text batched questions + update_plan + user as
  fallback reviewer; dsh/kimicode = conservative fallback pending native
  tool mapping
- references README generalizes the omp-only wording
2026-09-07 02:29:24 +08:00
NiJingzhe 6dc9fee702 feat(viewer): re-studio React 19 + shadcn rebuild with composer fixes
- remode UI migrated to React 19 + Tailwind 4 + shadcn-style components
  (tabs/toggles/tooltips/resizable/sonner); imperative kernel (SceneView,
  TokenComposer, OpSuggest, PythonEditor, FeatureTreeView) bridged via refs
- composer: same op tip can be cited twice (dedupe guard removed; backspace
  deletes the exact chip); capsule hover bubble is content-sized with a
  560px/72vw max width
- renderer: shift+left-drag pan via TrackballControls keyState borrow
- server: submit payload never truncates user entity selections (cap
  removed, regression test added)
- shared style.css imported into a cascade layer so Tailwind utilities win
2026-09-07 02:29:20 +08:00
Ni Jingzhe 19bb3bd588 Merge pull request #43 from So3Lab/feat/ql-playbook-absorb-guide
docs(skill): absorb QL selection guide into the verified playbook
2026-09-06 20:52:25 +08:00
NiJingzhe 3f9d52d155 docs(skill): elevate in-time tagging to a playbook ground rule
State the ordering discipline positively: a tag lands in the step right
after the operation that produced its targets, because projections into
later outputs are computed at op time. Rule 2 keeps the ownership
half (resolved-list targets), rule 3 owns the timing half, and both name
the same surface error so the misleading 'not owned' message resolves to
the right defect.
2026-09-06 19:56:29 +08:00
NiJingzhe c35bddd6bd docs(skill): absorb QL selection guide into the verified playbook
The hand-written guide at references/docs/guides/ql-selection-playbook.md
sat inside the generated-docs mirror directory under a title identical to
the verified playbook, so agents entering via SKILL.md saw only the older
unpinned copy. Merge its unique content (selection loop, predicate
vocabulary, shared-boundary failure signatures, bore->rim chamfer and
face->datum recipes, lineage routes, facts printing) into
references/ql-playbook.md and retire the guide.

Recipe snippets were re-executed against dev @ 94e3e3e (11/11) before
merging; two session-path corrections came out of that run and are now
documented in Ground rule 2: apply_tag_rselection targets must be a
resolved list, and tags must land before the next operation consumes the
shape.
2026-09-06 19:49:11 +08:00
Ni Jingzhe 77bfdaa4c5 Merge pull request #42 from So3Lab/chore/apache-2.0-license
chore: relicense to Apache-2.0
2026-09-06 18:55:08 +08:00
NiJingzhe c0bfabb3a3 chore: relicense to Apache-2.0
Replaces the AGPL-3.0 license text with the canonical Apache License 2.0
and updates every reference: pyproject trove classifier, both README
license sections, and the skill frontmatter. The article drafts under
docs/ are untracked and were updated separately.
2026-09-06 18:42:33 +08:00
Ni Jingzhe 94e3e3e602 Merge pull request #41 from So3Lab/bugfix/connector-interface-hash
fix(placement): integer-tick canonical identity for all hashed frames
2026-09-06 18:32:56 +08:00
NiJingzhe fb1e1f4182 Merge remote-tracking branch 'cadir/dev' into bugfix/connector-interface-hash 2026-09-06 18:30:49 +08:00
NiJingzhe 4be52a66c4 fix(placement): integer-tick canonical identity for all hashed frames
Float frames re-normalized on every Placement reconstruction, so
canonical JSON bytes and content hashes drifted across save/load cycles
(connector interface_hash mismatch, unstable PartInstance placement
identity, spurious cache/dirty misses).

Store every hashed/persisted frame as exact integer ticks at 1e-9
resolution instead:

- placement.py: placement_ticks / validate_placement_ticks (pure integer
  unit-orthogonal-handedness checks) / placement_from_canonical with a
  from_exact_frame constructor that keeps durable components verbatim;
  tick frames short-circuit re-quantization; placement_frame_mm exports
  millimetre floats for translators
- ConnectorInterface.local_frame and PartInstance.placement store ticks;
  definition content hashes are byte-stable across round trips
- solved snapshots, authored placements, assembly state, solve keys and
  component cache payloads compare tick-to-tick; rebuilds reuse
  from_exact_frame so verification is exact instead of tolerance-based
- occurrence-graph transforms and scene product ingestion convert ticks
  at the runtime boundary only
- FreeCAD runtime and Fusion360/SolidWorks translators convert recorded
  tick frames back to millimetre floats when emitting target payloads

Derived z_axis is authoritative (computed once at write time) and is
never recomputed on read. BREP/zip/package integrity checks remain
strict byte hashes. Existing pre-tick packages must be recaptured;
examples/22_mecanum_wheel was rebuilt and revalidated.
2026-09-06 18:30:16 +08:00
Ni Jingzhe ba9d96e4b5 Merge pull request #39 from So3Lab/showcase/reverse-video-trim
showcase: full-length reverse-studio GIF, dashboard opening trimmed
2026-09-06 14:52:13 +08:00
NiJingzhe 4a8aa7d65d showcase: full-length reverse-studio GIF, dashboard opening trimmed
User review: the GIF should cover the whole session, not a highlight window —
regenerated at 10 fps over the full duration. The source recording's first
7 seconds (a personal API billing dashboard, unrelated to the demo) are cut
from both the MP4 and the GIF; both now start directly in re-studio.
GIF 5.0 -> 4.5 MB (70 s), MP4 6.1 -> 5.6 MB.
2026-09-06 14:39:31 +08:00
Ni Jingzhe e068ce3e6d Merge pull request #38 from So3Lab/showcase/capability-videos
showcase: real videos for the simulation and reverse-engineering sections
2026-09-06 14:18:29 +08:00
NiJingzhe b25b55e802 showcase: re-studio reverse-engineering MVP video
The reverse-engineering section ships its demo: the re-studio MVP session —
click faces on the STEP target, stack operation-intent chips and notes per
pick, submit, and the agent takes over from your context (classifying all 37
faces of a link rod before rebuilding). UI selections plus the operator's
hunches become the agent's narrowed search space.

Source recording (78 MB, 1668x1080@60, 78 s) stays local via gitignore; the
repo tracks a 6.1 MB H.264 MP4 (full session) and a 770 KB GIF preview of
the annotate-and-submit window (30-50 s) inline in both READMEs.
2026-09-06 14:06:43 +08:00
NiJingzhe 2e0577df48 showcase: four-bar MuJoCo virtual-collision before/after pair
The simulation-plugin section ships its real evidence now: two screen
recordings of the MuJoCo replay viewer — the first assembly pass where the
links crash through each other mid-cycle (wrong assembly), and the corrected
assembly sweeping the full crank cycle clean in the same sim.

Source recordings (74 MB, 2410x1844@60) stay local; the repo tracks lean
derivatives: 1450px/30fps H.264 MP4s (0.6 + 0.9 MB) as click-through full
videos and 700px/10fps palette GIFs (1.1 + 2.3 MB) inline in both READMEs.
Drops the bracket-STL placeholder image that stood in for this cell.
2026-09-06 14:00:56 +08:00
Ni Jingzhe 1fcbebefbc Merge pull request #37 from So3Lab/2.1.0-open
open-source showcase: capability README, session replay demos, one-pipeline studio rendering
2026-09-06 04:46:34 +08:00
NiJingzhe e4a59955e1 fix(render): drop stray style conditional in step-comparison renderer
render_step_comparison_rpath never had a style parameter; the one-pipeline
sweep (26da5e2) rewrote its label color into a style == "studio" conditional,
raising NameError on the STEP comparison path. The comparison renderer keeps
its light standard look, so the label returns to unconditional dark ink.

Caught by CI (test_step_comparison_render_uses_shared_views_and_writes_image
on all four Python versions); ty does flag the unbound name — the local gate
missed it by diff-counting diagnostics instead of reading them, and by running
a test subset instead of the full suite. Full suite now green locally:
1525 passed, 5 skipped.
2026-09-06 04:24:00 +08:00
NiJingzhe fb29140206 merge: integrate dev (PR #36 viewer re-composer) into 2.1.0-open 2026-09-06 03:58:44 +08:00
NiJingzhe 3e319e4987 feat(render): agent-facing guard + readable labels
Two agent-SDK quality rulings from the u_link misrender review:

- zero-hit guard: requesting a highlight tag that matches no geometry now
  raises with the missing tag names and likely causes (typo / wrong build
  stage) instead of silently labelling empty air — the guard immediately
  caught two real misuses (S1 blank labelled with S3-stage tags; flange
  fillet tag lost to a downstream feature rewrite)
- label typography: all font sizes move to final-image-pixel semantics
  scaled by supersample; callout lower bound 12->18, legend 10->12 with
  wider cap, panel title floor raised; margins scale with font size so
  large text does not overflow panels
- fix surfaced while verifying: candidate dataset names referenced by
  callouts did not survive the macOS worker hop (surface_group_N vs
  surface_groups_N) — re-anchoring silently no-op'd on darwin; naming
  aligned and verified end-to-end (occluded rim-fillet anchor re-anchors
  onto the visible lower half of the same ring)
2026-09-06 03:41:15 +08:00
NiJingzhe 93af318d60 feat(render): per-view callout admission — occlusion test, surface re-anchoring
Fixes 'flange shows no labels': callout anchors used face centers of mass,
which for annular/toroidal faces (both fillet tags) lands on the rotation
axis INSIDE the solid — occluded from every view, so the labels pointed at
nothing. Callouts now carry their tagged surface as re-anchor candidates
(referenced through the dataset channel so the macOS worker can serialize
it) and each panel admits them via a deterministic geometry pass:

- _view_ray_occluded: parallel-projection-safe ray test against a cell
  locator built over base + highlight surfaces (surface tolerance scales
  with model span so anchors resting on their own face pass)
- occluded anchors re-anchor to the nearest visible sampled point of the
  SAME tagged surface (lateral screen distance + depth-weighted); a callout
  whose whole region is hidden in a panel is suppressed there — a label
  pointing at empty space is worse than no label
- flange review after fix: both fillet labels visible, leaders land on the
  actual fillet geometry, 10/10
- tests: front/back face tags of a box — labels must appear from the side
  that sees them (callouts-on differs from callouts-off per view)
- fixes caught by ty along the way: SCREENSHOT_VIEWS referenced but only
  defined in operators/features (latent NameError on the internal auto
  path; the constant now lives in the engine, features re-exports lazily
  via module __getattr__) and callout tuple annotations extended to the
  optional candidate element
- 32/32 render+integration tests
2026-09-06 03:19:50 +08:00
Ni Jingzhe d8c5b4e8fe Merge pull request #36 from So3Lab/feat/viewer-re-composer
feat(viewer): re-studio composer round — BRep renderer component, flat UI, context injection
2026-09-06 03:13:00 +08:00
NiJingzhe 26da5e2170 feat(render)!: one pipeline — annotated 1-4 panel grid, studio by default
Design ruling: exactly one way to produce annotated multi-view renders.

- render_screenshot_rpath always routes through the multi-view grid
  engine: view='auto' = the default four-view set, an explicit preset
  name or (elevation, azimuth) pair = a single full-frame panel, views=
  accepts up to four (elevation, azimuth, label) triples (more are
  rejected). The separate single-view code path is deleted (engine,
  worker 'sdk' mode and its dispatch), along with the studio-vs-grid
  rejection contract
- style defaults to 'studio': the default output is now a black-stage
  four-panel grid with camera-derived three-point lighting per panel,
  tubed edge ink, supersampling and light-on-dark labels/legend;
  style='standard' remains the explicit flat diagnostic look
  (render_shape_views_rpath pins standard to keep its inspect semantics)
- zoom applies to single-panel renders; view_up applies to every panel
- framing parity verified at pixel level: single-panel studio through
  the new path matches the deleted single-view path output (mean diff
  0.59, 1.38% pixels), so render_showcase.py and existing studio assets
  are stable
- tests: >4 views rejected, explicit view routes through the grid
  engine as one panel, default style is studio (differs from explicit
  standard), real-render assertions made behavioral instead of size
  thresholds; 31/31 incl. integration suite; API doc regenerated
2026-09-06 03:06:18 +08:00
NiJingzhe 5bf082f444 showcase: refresh BLDC stills and exploding turntable with the tuned edge ink
Re-rendered through render_showcase.py after 94f3b16 landed (0.04mm
edge deflection cap, ink 0.0019 span fraction, 14-side tubes, SSAA2):
gear teeth, bearing balls and stator laminations read sharply, curved
edges smooth; exploded GIF frame review 9/10.
2026-09-06 02:50:48 +08:00
NiJingzhe 0e240e3f70 feat(render): unify SDK rendering into one API over one engine
- render_screenshot_rpath now accepts raw TopoDS_Shape entries alongside
  SDK solids: the STEP inspection family renders through the same public
  entry with the same edge ink, supersampling and (for solids) tag
  highlights/callouts — one API at SDK level, one engine below it
- edge ink + supersampling pushed DOWN into the shared multi-view grid
  engine (_render_polydata_views_in_process): the default 4-panel
  diagnostic grid and render_shape_views_rpath (inspect channel) now
  draw tubed BRep edges with LANCZOS supersampling like the single-view
  path; grid review score 9/10 (was thin 1px lines)
- render_shape_views_rpath keeps its signature as the inspect-family
  convenience entry (dpi sizing contract preserved: 3240x2160) and gains
  the 0.04mm edge deflection cap; it is no longer the only way to render
  raw shapes
- ty config: unresolved-import ignored repo-wide — OCP/VTK ship no .pyi
  stubs and examples import sibling modules, so import resolution was
  ~900 diagnostics of environmental noise (verified: zero real defects
  in the class); replaces the duck-typing workaround with natural
  isinstance(TopoDS_Shape) checks
- gates: 13/13 render tests, mixed [Solid, raw] input smoke, grid visual
  review, API docs regenerated, step-inspection domain doc notes the
  unified entry
2026-09-06 02:41:44 +08:00
NiJingzhe 8fa738806e feat(viewer): re-studio flat UI round — drag resizers, icons, code theme, tab fix
- workspace: column resizer between the two panes and row resizer between
  rebuilt viewport and the dock (lime highlight, same interaction as the
  scadpkg viewer); [hidden] display guard fixes tab switching (source
  panel's display:flex used to override the UA hidden rule)
- composer: single clean input ('whats your idea to rebuild ?'), round-note
  removed, ADD becomes a square + button; draft highlight #00c8ff replaces
  lemon yellow; feature rows are informational (no click-to-code)
- flat restyle on the viewer token system: square corners, #10141a/#202832
  chrome, lime accent, DM Mono micro labels, lucide SVG icons throughout
- CodeMirror: PythonEditor gains a theme option; new remode/code-theme.ts
  flat dark theme replaces the oneDark+CSS-override patchwork
- visible horizontal scrollbars for the code areas; FIT root-cause fix in
  the renderer (radius floor and minDistance clamps now derive from model
  radius; multiplier 2.3)
- RESTUDIO_UI_REDESIGN.md documents every round and acceptance result
2026-09-06 02:35:25 +08:00
NiJingzhe f8793ca7ce feat(viewer): standalone BRep renderer component with layered pipeline
- viewer/src/renderer: BRepRenderer owns scene assembly, materials, PMREM
  studio lighting, GTAO, trackball camera, seam-split edge visuals, FIT and
  snapshot; face pass renders into MSAA RT, edges/overlays composite after
  AO so wireframes keep a constant ink color, and scene.background is
  deliberately unused (a Color background force-clears every render pass)
- scene-view.ts shrinks to the selection/marks composition layer over the
  engine; public picking/marks API unchanged
- cad-three: fixed dark edge color #3a414d; faces get polygonOffset(1,1),
  lines slope-scaled polygonOffset(-2,-2) so silhouette edges stop breaking
  into dashes at glancing angles
- click-selection restores the camera up vector; README documents the
  component entry points
2026-09-06 02:35:10 +08:00
NiJingzhe ec4bb31ae8 feat(viewer): submission context gains per-entity neighborhood cards; op registry 7 categories
- runtime.entity_neighborhood: one-level adjacency cards (face→edges with
  adjacent faces + vertices; edge→vertices/faces/adjacent edges; vertex→
  edges/faces), truncated lists name their totals
- compose_submission passes BRepModel.adjacency_details into the context
- scene_build tags edges with seam/degenerate flags and meshes edges at a
  finer tolerance (lin 0.1 / ang 0.1)
- operation registry: boolean.md split into union/cut/intersect; new
  box/cylinder/cone/sphere/shell/mirror/twisted_sweep/helical_sweep docs
  (5 → 7 categories, 23 operations)
- tests: seam flags, neighborhood cards per entity kind, registry shape
2026-09-06 02:32:49 +08:00
NiJingzhe 94f3b1657f feat(render): three.js-grade BRep edge ink for the VTK single-view path
Closes the edge-crispness gap against the three.js viewer; the single-view
standard style now matches its 'light metal + dark ink' look (8/10 vs 9/10
in side-by-side review; remaining gap is lighting, not edges):

- tubed edge ink enabled for BOTH styles (was studio-only): dark
  (0.145, 0.165, 0.196) vtkTubeFilter tubes, width as span fraction
  (default lowered 0.0026 -> 0.0019 after visual iteration); tube sides
  10 -> 14; edge_width_scale=0 falls back to the legacy thin lines
- edge discretization decoupled from the surface tessellation: dedicated
  0.04 mm chord-error cap (was the shared 0.35 surface deflection), so
  curved edges stay smooth once tubed — same philosophy as the viewer's
  .lines.glb assets
- deterministic supersampling: render at integer factor (default 2,
  validated 1-3) and LANCZOS-downsample; FXAA off when supersampling;
  legend text scales with the factor so the final look is preserved
- coincident-topology polygon offset added (shared walls after booleans)
- tests: supersample writes the requested image size at factors 1/2/3,
  out-of-range factor rejected; 13/13 pass; API doc regenerated

Default single-view output changes once, deliberately (thin light lines
-> crisp dark ink); supersample=1 + edge_width_scale=0 restores the
legacy 1:1 look.
2026-09-06 02:15:38 +08:00
NiJingzhe bdee2e16c4 feat(render): opt-in studio style, tubed BRep edges, tessellation and camera-roll controls
Reviewed keep of the BLDC-GIF render pipeline changes (all opt-in; the
default inspection path is byte-identical, verified by A/B render):

- render_screenshot_rpath: + linear_deflection / angular_deflection
  (tighten tessellation for high-res diagnosis), style='studio'
  (product-shot look: black stage, camera-derived three-point lighting,
  metal specular), edge_width_scale (tubed-edge radius as span fraction,
  validated [0, 0.02]), view_up (explicit camera roll for inclined
  orbits)
- BRep edges as vtkTubeFilter geometry in studio style: LineWidth is
  capped ~3px on macOS, so edges must be geometry to stay readable at
  high resolution / for small features
- contracts: unknown style, studio+views grid and out-of-range
  edge_width_scale are rejected with guidance errors
- tests: three rejection contracts + studio/standard divergence smoke
  (size-threshold assertion replaced with a behavioral one: outputs must
  differ); 11/11 pass
- API doc regenerated via tools/auto_docs_gen.py (also picked up the
  view_up parameter the hand edit had missed)
- examples/20 render_showcase.py: four-module axial explode (ESC /
  motor / two-stage reducer / output shaft) with concentric radius-band
  peeling, inclined camera orbit, exploded turntable GIF export
2026-09-06 02:01:27 +08:00
NiJingzhe 47b0636da2 showcase: BLDC assembly section upgraded to new studio renders + exploding turntable GIF
- img/capability: refreshed bldc_assembly/front/exploded studio stills
  and added bldc_exploded.gif (72-frame inclined-orbit exploding
  turntable; four modules separate axially, concentric parts peel into
  radius bands)
- README EN/zh assembly cards: exploded still replaced by the turntable
  GIF with captions describing the four-module axial explode
2026-09-06 01:54:58 +08:00
xingyao huang bfed7c942f Merge pull request #27 from So3Lab/feat/add-exporter
Feat/add exporter
2026-09-06 00:05:53 +08:00
auua 0068ed8f92 fix: load scadpkg file correctly 2026-09-05 23:51:42 +08:00
auua 6c74001ab3 feat(cli): Encapsulate the export function into a CLI tool. 2026-09-05 23:51:42 +08:00
NiJingzhe cbb0e33154 showcase: prompt + BRep turntable GIF table for single-part cases
- README.md / README.zh-CN.md section 1: each case now shows the
  first-turn requirement (verbatim excerpt) next to a turntable GIF of
  the delivered model; flange row notes the 6->8-hole re-parameterization
  so the 8-hole GIF cannot read as inconsistent with the prompt
- turntables rendered by the in-repo Scene Viewer BRep renderer through
  the new viewer/src/embed-bundle.ts (reusable mountScene + camera utils)
  and viewer/gif-harness.html (deterministic azimuth stepping, 48 frames
  per turn), captured headless and assembled as looping GIFs
- img/capability: three turntable GIFs (0.7-1.6 MB each)
- vite build gains the gif-harness input
2026-09-05 21:54:12 +08:00
NiJingzhe f53dec2f70 showcase: viewer BRep renders + before/after re-parameterization slots
- flange/bracket demo images re-rendered through the in-repo Scene Viewer
  (BRep face shading + edges, camera normalized to the scene bounding
  sphere) via headless Chrome capture; raw-solid VTK renders replaced
- flange demo: caption bug fixed ('六特征块' read as six holes vs the
  8-hole final model); renders tab now leads with the 6-hole @PCD 78
  initial state next to the final 8-hole @PCD 84.5, making the turn-2
  re-parameterization visible; glCap states the final state explicitly
- bracket demo: three viewer views (iso/top/detail)
- README cards: flange/bracket images swapped to viewer renders; captions
  clarified to '6→8-bolt'
2026-09-05 21:26:53 +08:00
NiJingzhe f65109c6e7 docs(showcase): four-capability README front section with session replay demos
- README.md / README.zh-CN.md: capability pillars (single part / assembly /
  reverse engineering / simulation) with case images and replay demo links
- examples/demo_kit: config-driven single-file replay demo builder
  (generalized from u_link demo; app.js consumes per-case config payload)
- examples/flange_plate: full single-part-modeling workflow case (agent
  session transcript + verifier scripts + 8-hole re-parameterization with
  guard rejection chain) + replay demo
- examples/12_ap242_gmsh_volume_mesh: model.py rebuilt through the workflow
  (FTC feature blocks, named vars; volume rel 0.00e+00 vs legacy, FEM
  interface tags preserved) + REQUIREMENTS/BUILD_PLAN/verify + replay demo
- examples/u_link_motor_mount/demo: committed single-file replay demo,
  rebuilt via demo_kit
- examples/20_integrated_bldc_joint_actuator/render_showcase.py: assembled
  + staged cylindrical exploded views from the captured package
- img/capability: showcase renders (BLDC assembly/exploded, bracket FEM
  von Mises, case ISO views)
2026-09-05 21:02:43 +08:00
NiJingzhe cdfc0ee904 docs(skill): re-studio workflow rewritten for the composer round
- reverse-engineering-studio.md: free-form composer (entity/op chips,
  [label](token) serialization, IME-safe Enter), operation tips as a
  markdown registry (viewer/server/operations/, mtime-hot, errors named),
  submission schema incl. operations + operation_context, self-contained
  artifact rule (transcription = literals, extraction harnesses beside
  the case), kernel-ordering facts (bores before blend fillets; fitter
  to_dict unique_knots contract), artifact names the UI polls
- step-reconstruction.md: route to the studio variant when a human
  operator is available
- SKILL.md: workflow count corrected to six; viewer/README.md updated
  for the composer + tips registry
2026-09-05 14:35:20 +08:00
NiJingzhe 22d19263a7 feat(viewer): re-studio free-form composer with entity/op tags, highlighted source, feature DAG
- composer: contenteditable input where viewport picks and operation tips
  land as atomic colored chips ([face:6](face:6) / [fillet](op:fillet)),
  peers of free text; IME-safe Enter (composition never submits);
  atomic chip backspace; plain-text paste
- operation tips are markdown content, not code: viewer/server/operations/
  <op_id>.md (frontmatter label/category/api/reads/doc_refs + hint body),
  loaded by a stdlib frontmatter parser with mtime cache; broken files are
  named in payload errors, never silently skipped
- five categories per the human's classification (sketch / solid / modify /
  surface / pattern); palette rendered from GET /api/operations
- compose_submission embeds operation_context for every referenced op
- SOURCE tab: read-only CodeMirror python view (PythonEditor extracted from
  SourceDock, shared extensions) with file tabs and line-range reveal
- FEATURE TREE: viewer's DAG algorithm extracted as FeatureTreeView
  (apply_tag hidden, REF/USED/IN badges); clicking a feature switches to
  SOURCE and highlights its source span; FTC-header fallback before the
  first captured package
- tests: registry load + broken-file naming + operation context (9 pass)
2026-09-05 03:10:36 +08:00
Ni Jingzhe bfb39ec251 Merge pull request #35 from So3Lab/feat/viewer-re-mode
feat(viewer): reverse-engineering studio — human-annotated STEP reconstruction loop
2026-09-05 00:45:31 +08:00
NiJingzhe e5ed7b547e feat(viewer): reverse-engineering studio — human-annotated STEP reconstruction loop
Interactive re-mode (re.html) plus a local case server implementing the
ppt-master handshake: the human selects faces / draws regions / labels intent
on the original STEP, the browser composes a submission with server-side
entity context, and a waiting agent reconstructs per the existing
reconstruction contract and writes artifacts the UI polls back.

- viewer/server (stdlib-only): STEP -> synthesized Scene 2.0 projection
  (GLB + entity sidecars, same shape as package scenes), region resolve
  (centroid projection + front-facing filter), entity descriptors,
  atomic submissions, ndjson side recording, --daemon/--wait/--wait-only/
  --shutdown CLI with lockfile and 590s budget
- viewer/src: extract shared cad-three/entity-facts modules (main.ts now
  consumes them), new SceneView class (assembly/picking/highlight) reused
  by both studio viewports
- re-mode UI: annotation canvas (circle/lasso), intent palette, context
  preview, submit flow, rebuilt v3 package loading, comparison image,
  feature tree, evaluation tab
- governance: only the browser writes submission.json; UI never edits
  geometry — code stays the single source of truth
- tests: 6 server tests (scene contract, region math, submission context
  + named failures, wait handshake exit codes, HTTP endpoints)
2026-09-05 00:30:46 +08:00
Ni Jingzhe 4e8f2159bb Merge pull request #34 from So3Lab/feat/viewer-v3-package-loader
feat(viewer): load canonical v3 product packages
2026-09-04 23:46:56 +08:00
NiJingzhe 9092a3c8eb feat(viewer): load canonical v3 product packages
Migrate the browser viewer from package schema 2.0 (objects array +
nested scene/scene.zip) to the canonical v3 layout (themed subpackages,
flat scene projection, content-addressed blob store); v2 packages are
rejected as unsupported.

- product-package.ts: v3 manifest gate plus structural validation
  mirroring ProductPackage._validate_manifest (exact manifest key set,
  path/hash-sorted unique records, root resolution, archive blob member
  declarations, projection asset source resolution), exact member-set
  closure with per-record sha256/byte_length verification, content_hash
  and scene revision recomputation, and a definitions-vs-product_assets
  identity multiset check. Scene geometry/entity/source assets are
  materialized from blobs/<sha256> members through the projection
  sources; product and feature-graph ZIP payloads are integrity-checked
  as members but never re-packed, since the viewer never consumes them.
- main.ts: thread the loaded package schema into the footer label and
  drop a dead constant; scene/entity sidecar 2.0 checks are unchanged.
- loader.test.ts: first viewer test suite (node:test via tsx, fixture
  regenerated through prepare:example) covering the happy path and the
  tamper matrix: mutated blob member, smuggled extra member, wrong
  content_hash, and v2 manifest rejection.
2026-09-04 23:44:14 +08:00
Ni Jingzhe 39dc6b6098 Merge pull request #33 from So3Lab/feat/histcad-ftc-support
feat: HistCAD dataset -> FTC translation stack (SDK extensions + tool suite)
2026-09-04 16:59:21 +08:00
NiJingzhe 54017d0f3d docs(histcad): usage guide for the histjson tool suite
Covers the five user questions in reading order: how to translate (single
case / batch / demos), what the output is (annotated FTC anatomy, tier
annotation semantics, constraint_id channel), coverage (structure 100% ops,
geometry channel 85.0%/76.7% pass, constraint channel 90.3%/93.0% solvable
on the standard 100-case samples), why things fail (four-way taxonomy:
unmapped forms / dataset-side constraint errors / build-level union
contract / known dataset artifacts), and how to find the non-translatable
entries (conflicts analyzer cross-tables + dump-uid, validate reports,
in-source notes, profiler). Numbers reproduce with the pinned
count/stride commands at the end.
2026-09-04 16:40:37 +08:00
NiJingzhe cc2946dd2e refactor(histcad): translator only translates — no preflight, no tier decisions
Per user ruling: the translator unconditionally translates what the dataset
carries (constraints included, --constraints on|off, default on). The auto
mode, in-process preflight, drift gate and sidecar conflict report are gone
from the translator — auditing now lives entirely in histcad_conflicts.py,
which renders each feature's translated prefix with the same StepEmitter
and classifies the solve itself (solved / drifted >1e-3 / conflicting /
exec_error) on top of the residual + dof + halfSpace analysis.
histcad_validate.py is build + STEP volume reconciliation only.

Generated sources are unchanged in shape (single path, constraint_id tags,
pure FTC blocks); demos regenerated with full constraint sets and still
reconcile to STEP at machine precision. Purity tests updated to pin the
sharper contract: unconditional constraint translation, pooled-coincident
elision, and that the translator module never imports the SDK.
2026-09-04 15:15:24 +08:00
NiJingzhe 48c77c2055 feat(histcad): pure training-data translation, tools under research/histjson
Generated sources carry the model only: the dual-path constraint fallback,
SKETCH_CONFLICTS/SKETCH_TIER_FALLBACKS audit globals and strict=False
inspection are gone from translated code. Tier decisions and conflict
auditing moved to translation time: auto mode solves each feature's
constrained sketch prefix in-process (preflight), emits sketch tier when it
solves AND reproduces the transcribed coordinates (max point move <= 1e-3,
the drift gate), otherwise transcribed geometry; diagnostics go to the
sidecar report (<case>.ftc.py.report.json).

Root causes found by the new histcad_conflicts.py residual analyzer and
fixed in the translator:
- point-pair H/V distances are directed: sign now taken from coordinates
  (the stored length is a magnitude) — was the top Fusion conflict source
- Tangent on arcs needs an endpoint selector: picked as the nearest shared
  junction with the other curve
- MajorRadius/MinorRadius store full axis lengths: halved to semi-axes
  (solver was stretching ellipses 2x)
- Horizontal/Vertical flat line lists map each line individually
- variadic Equal chains get per-pair constraint ids (duplicate-id crash)
- Coincident entries whose refs pooled onto the same point are elided:
  degenerate point-coincident equations made the solver Jacobian singular
  and showed exact-geometry sketches as conflicting

SDK: constrain_concentric_rsketch now accepts ellipse targets (backend
resolves the ellipse center point).

Validation (100-case samples, constraints=auto): Fusion360 72 pass,
sketch-tier retention 77.5% (conflicts: 19 diverged + 1 conflicting);
DeepCAD 83 pass, retention 85.0% (9 diverged, 0 solver-conflicting).
Demos regenerated, volumes reconcile to STEP. Purity pinned by
test/test_histcad_translation_output.py (9 tests). Full suite 1489 passed.
2026-09-04 14:28:49 +08:00