Commit Graph

77 Commits

Author SHA1 Message Date
NiJingzhe 1330e7cf62 docs: point repo URLs at PhySpace/SimpleCADAPI
The repository moved to the PhySpace org: pyproject project.urls
(carry into wheel metadata on the next release) and the README star
history charts now reference the new location.
2026-09-22 23:02:23 +08:00
NiJingzhe 1f7d0cb9fa chore(release): 2.1.3
CHANGELOG added; version bumped to 2.1.3 across pyproject, skill
frontmatter, and README current-release lines; generated skill docs
refreshed via tools/auto_docs_gen.py.
2026-09-18 11:12:54 +08:00
NiJingzhe 264a904f8b feat(skill): 'sca skill targets|install' + skill source shipped in wheel
The wheel force-includes the uncompiled docs/skill source tree and
skillproj.toml as package resources; compilation happens at install
time on the user's machine, so no repository checkout is needed.

The compiler moves to simplecadapi.skill.compiler; tools/skillbuild.py
stays as the maintainer-side wrapper over the same code.

'sca skill install' compiles into <skills-dir>/simplecadapi (location
resolved through the existing addon config/env chain, default
~/.agents/skills; no sca init required) and refuses to overwrite
without --force, which only permits replacing a directory whose
SKILL.md declares the same skill name.
2026-09-18 10:54:13 +08:00
NiJingzhe eb2f2c08d3 feat(addon): runtime state outside the payload + 'sca addon check'
- per-addon runtime dirs (~/.sca/runtimes/<name>), created at install,
  untouched by update, removed with the addon; {runtime_dir} placeholder
  in command_prefix and check_cmd alongside {addon_dir}
- 'sca addon check [name]': re-probe the installed runtime NOW and
  refresh the cached registry record (install-time probe is a cache,
  not truth); list shows cached state with its timestamp
- sca addon use exports SCA_RUNTIME_DIR for self-locating provisioning
- update replaces the payload wholesale but preserves a legacy in-payload
  .venv (pre-runtime_dir addons keep working)
- remove: records without runtime_dir delete nothing extra — never
  interpret the missing field as Path('') == CWD (regression test pins
  the exact failure that motivated this guard)
- docs: Payload vs runtime state section, check verb, updated examples
- version 2.1.3b4
2026-09-17 05:18:43 +08:00
NiJingzhe b939f44043 feat(cli): single 'sca' entry point + 'sca init' shell integration
- simplecad-cache/simplecad-export entry points are gone (hard cut):
  the same commands live under the unified dispatcher
  (simplecadapi.cli) as 'sca cache ...' and 'sca export ...', each
  group registered at parser level so per-group --help works
- sca init now wires the shell by default (--no-shell skips): a
  ~/.sca/bin/sca shim (Windows sca.cmd) execs the installing venv's
  console script — the venv bin itself never goes on PATH — and the
  shim dir lands on PATH via a marked, removable block in ~/.zshenv
  (read by non-interactive shells, so agents see the command),
  ~/.bashrc, fish conf.d, or the Windows user PATH registry value
  with a change broadcast; rc files are created only for the login
  shell or when they already exist; re-running init refreshes the
  shim (target discovery is symlink-safe, no resolve() out of venv)
- addon/cache/export cli modules expose configure(subparsers) +
  _execute(args); module run() keeps the CLI-shaped argv
- docs: sca namespace across evergreen docs, shell-integration
  section, 'never writes shell profiles' contract line retired
- tests: +17 (dispatcher groups, shell integration, entry-point
  absence); cache/export suites moved to group-token argv
2026-09-13 04:19:17 +08:00
NiJingzhe 3224233a62 feat(addon): top-level 'sca init'; version 2.1.3b3; local installs skip envs/caches
- 'sca init' replaces 'sca addon init' (init configures the machine, it
  is not an addon operation); guidance text, config comment, and docs
  follow; the 2.1.3b1 changelogs keep the historical command name
- version 2.2.0 -> 2.1.3b3 (pyproject + uv.lock)
- local installs ignore virtualenvs and tool caches (.venv, venv,
  .pytest_cache, .mypy_cache, .ruff_cache, .tox): a real addon checkout
  carried a full .venv straight into the addon home
- validated end to end against sca-connectors-addone 0.6.0: prerelease
  compat floor parses, git-origin name consistency passes, probe runs
  through command_prefix in the final installed layout, use dispatch
  exports SCA_ADDON_DIR, update re-probes after wiping a provisioned
  .venv (loud FAILED warning, non-blocking)
2026-09-13 03:41:28 +08:00
NiJingzhe dd33c79982 Merge branch 'dev' into feat/sca-addon
# Conflicts:
#	pyproject.toml
#	uv.lock
2026-09-13 03:28:30 +08:00
NiJingzhe d73555fbe2 feat(addon): naming standard + command prefix + 'sca addon use' dispatch
- standard: repository name == [addon].name == SKILL.md frontmatter name,
  enforced at add/update (GitHub repo slug, or local git-origin basename
  falling back to directory name); skill dirs install as sca-<name>
  without doubling a leading sca-
- [runtime].command_prefix (optional): shell prelude joined in front of
  check_cmd and every use dispatch; single {addon_dir} placeholder,
  unknown placeholders rejected at descriptor load
- sca addon use NAME [CMD...]: run cmd inside the addon's declared
  environment (SCA_ADDON_DIR exported, exit code propagates, --capture
  for programmatic output); bare 'use NAME' reports prefix + dir
- runtime probe now executes AFTER the payload is committed, in the
  final installed layout, so prefixes referencing {addon_dir} resolve;
  failing probe remains a loud non-blocking warning
- use argv is shell-quoted per element so quoted args survive sh -c
- docs: descriptor reference, naming standard, use; SDK 2.1.2 -> 2.2.0
- tests: 12 new (descriptor prefix validation, name consistency, use
  flows, prefixed probe); addon suites 73 green
2026-09-13 02:51:17 +08:00
yuliuse 56bcc62e49 feat(whucad): WHUCAD vector → FTC translator toolset under tools/research
Decode the WHUCAD h5 vector sequences (256-level quantized CATIA/DeepCAD
command matrices) and translate them into SimpleCADAPI FTC sources,
mirroring the histjson tool suite:

- whucad_vec.py       self-contained decoder (numpy only; differential-
                      checked against the original cadlib, 1419/1419 exact)
- whucad_select.py    Topo/Select history references -> ql predicates
- whucad_to_ftc.py    translator (keyword-form call emission, histjson
                      convention; unsupported forms annotated, never
                      approximated)
- whucad_profile.py   feature/curve/select-form distribution + coverage
- whucad_validate.py  sampled build + BRep-truth volume reconciliation
                      (scale-corrected: vectors carry no absolute scale)
- whucad_batch.py     whole-dataset batch entry point
- check_port.py       differential check vs the original cadlib decode
- test_whucad_translation_output.py  output-contract tests (embedded
                      vectors; no dataset download needed)

Full-dataset run: 146,331 models -> 146,331 .py, 424,947 features decoded,
380,074 feature blocks emitted (89.4%). pyproject gains a 'whucad' extra
(h5py).
2026-09-10 22:07:28 +08:00
NiJingzhe be93122527 chore(release): bump version to 2.1.3b1 2026-09-10 14:50:05 +08:00
NiJingzhe 5cac586dfc feat(addon): sca addon manager — descriptor gates, platform enum, skill install, authoring doc 2026-09-10 03:05:09 +08:00
NiJingzhe aac0fbb29d feat(cache): script-anchored part cache, keyword-form corpus, 2.1.2
- @scad.part/@scad.assemble anchor defaults to the builder script's own
  directory: cache + interface state land beside the source, standalone
  scripts run anywhere, and the pyproject.toml walk-up requirement is
  gone (explicit project_root still relocates the anchor)
- file_input() paths resolve relative to the anchor; in-repo examples
  rewritten to script-relative declarations
- HistCAD translator emits keyword-form sketch-family calls (corpus
  self-documentation), pinned by tests; booleans stay positional by
  *solids signature
- both translators emit project_root=Path(__file__).parent explicitly;
  examples/histcad_demo regenerated (STEP volume reconciliation held)
- FTC convention documents @scad.part parameters and the cache contract
- version stamps 2.1.2 + bilingual update notes
2026-09-10 00:11:28 +08:00
NiJingzhe 197bf40c6b chore(release): bump version to 2.1.1
Tooling patch: SDK API unchanged. Adds the CadQuery→FTC translator toolset
with snapshot constraint recovery (merged in #49) and its bilingual update
notes; version stamps updated in pyproject+lock, SKILL frontmatter, and
both READMEs.
2026-09-09 22:12:13 +08:00
NiJingzhe 005427bdb9 fix(release): pin hatchling core metadata to 2.4
hatchling emits Metadata-Version 2.5, which twine 6.x (the whole 6.x line,
as of 6.1.0 in our lock) rejects during 'twine check' — the v2.1.0 release
run failed at Verify distributions. Publish metadata at 2.4 until the twine
line accepts 2.5.
2026-09-07 10:31:30 +08:00
NiJingzhe a45cbf280e chore(release): 2.1.0
- version 2.0.4b3 -> 2.1.0 (pyproject, uv.lock, skill frontmatter, READMEs)
- docs/updates/2.1.0.md + zh-CN: release notes spanning the 2.0.4b2 baseline
  (absorbs the unreleased 2.0.4b3 draft: product boundaries, incremental
  assembly, crash-safe cache) plus FTC authoring, DXF engine, external
  history import, reverse-engineering studio, unified rendering, Apache-2.0
  relicensing, harness-targeted skill builds, self-contained examples, and
  the geometry fingerprint round-trip fix
2026-09-07 09:45:57 +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
NiJingzhe fb29140206 merge: integrate dev (PR #36 viewer re-composer) into 2.1.0-open 2026-09-06 03:58:44 +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
auua 6c74001ab3 feat(cli): Encapsulate the export function into a CLI tool. 2026-09-05 23:51:42 +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
NiJingzhe 5ed62732f9 chore(ty): ignore injected globals in FreeCAD runtime payloads
translator/freecad_translator/runtime/**.py are exec'd inside
FreeCAD's embedded interpreter; GRAPH_NODES / App / Part and ~80 other
names are runtime-injected globals by design. An overrides section
silences unresolved-import/unresolved-reference for those files only,
cutting 495 known-noise diagnostics from the baseline.
2026-09-04 03:11:03 +08:00
NiJingzhe 77ad2c9440 chore(verifier): drop collision verifier module superseded by external implementation
Removes src/simplecadapi/verifier (current-pose mesh penetration checks
via python-fcl), its test, and the planetary-reducer collision probe
example. Collision verification now lives in an external implementation
outside this SDK.

The python-fcl>=0.7.0.11 dependency is dropped with it: the verifier
module was its only consumer.

BREAKING CHANGE: scad.verifier and check_collision_rcollisionreport are
no longer exported. Workflow docs mentioning 'verifier' refer to the
Verifier Planner role, not this module, and are unchanged.

Full suite: 1425 passed, 5 skipped.
2026-09-04 02:19:29 +08:00
NiJingzhe 600b03a157 feat(dxf): add DXF drafting engine with PDF sheet output
Add simplecadapi.dxf_engine: a declarative 2D drawing pipeline (SheetDecl/
ViewDecl/DimDecl/DatumDecl/CenterDecl/LeaderDecl) that plans views, runs
hidden-line removal, and renders annotated sheets to DXF/PDF via ezdxf +
pymupdf. Include the u_link_motor_mount drawing scripts as the worked
example.
2026-08-31 12:48:12 +08:00
NiJingzhe 932c70f254 chore(packaging): stop shipping docs in the wheel and drop sandbox refs
The wheel now contains code only: generated skill docs live in docs/skill
(built by tools/auto_docs_gen.py + tools/skillbuild.py) and ship as the
Agent Skill archive instead of polluting site-packages with a top-level
docs package. Remove the stale sandbox entries from sdist/ty config.
2026-08-31 12:46:58 +08:00
Ni Jingzhe c454a3af10 feat(skill): per-harness skillbuild toolchain replaces skill-pack (#18)
* feat(skill): replace skill-pack with per-harness conditional compiler

skillbuild compiles the skill tree into per-target harness builds:
- <!-- skill:if omp,!claude --> blocks include text only for matching
  targets; name-list conditions only, no else/nesting, fail-loud on
  unknown targets and unpaired/nested directives
- fence-aware: directive-looking lines inside code fences are literal
- layout is the filesystem; tree root configured in skillproj.toml
- post-build assertion: zero directive residue, SKILL.md frontmatter
  name check

Migration to the new model:
- docs/skill/ becomes the self-contained source root (SKILL.md,
  references/, generated api/stdlib/core/guides now under
  references/docs/; SDK_OVERVIEW/LICENSE/inspect are ordinary tree
  files)
- auto_docs_gen output redirected into the tree (docs/api ->
  docs/skill/references/docs/api, likewise stdlib)
- skills/simplecadapi/ is now the compiled omp target output;
  dist/generic/simplecadapi the generic target
- dropped skill-pack entry point (plus dangling evolve/make-export
  entries and their orphaned test), release workflow builds via
  skillbuild + tar; README updated

First real conditional block: harness reading paths in SKILL.md
(skill:// mount on omp vs disk-relative on generic).

Verified: 59 tests pass (skillbuild 31, auto_docs_gen 19, persistence
regression 9); both targets build; outputs residue-clean; full suite
collects (1376 tests).

* refactor(tools): auto_docs_gen moves out of the installed package

tools/ scripts are repo-checkout dev scripts, not packaged CLIs:
- auto_docs_gen.py now lives in tools/ beside the other generators;
  auto_tools/ package removed entirely
- path resolution simplifies: repo root = parent of tools/, fail-loud
  if pyproject.toml missing; site-packages/cwd fallback branches were
  dead code once the script stopped shipping in the wheel
- auto-docs-gen console script dropped from [project.scripts];
  release.yml and README invoke python tools/auto_docs_gen.py
- MANIFEST.in stale src/auto_tools include removed; CadQuery-free
  runtime scan no longer needs the auto_tools filter
- run_examples.py retired (user removal): README example-runner text
  updated to direct examples/ scripts; dangling runner-contract test
  (runpy.run_path into the deleted script) removed

Verified: 53 tests pass (auto_docs_gen + skill_build + ocp runtime
scan) and test_example_model_contract passes; regeneration from
tools/ is byte-identical (zero docs drift).

* refactor(skill): strip harness and build-tool content from the skill tree

The skill is plain harness-neutral content again:
- SKILL.md 'Reading skill files' section removed (the omp skill://
  mount block and its !omp complement were the only conditional
  blocks; the tree compiles identically for every target now)
- references/README.md: build-tool meta removed ('per-harness
  conditional compilation', skillbuild packaging/validation claims —
  link validation was never implemented, so the claim was false)
- live test now asserts the tree stays harness-neutral (zero blocks)
- skillproj.toml targets aligned with the user's output table
  (omp -> skills/simplecadapi-omp, opencode -> skills/simplecadapi-opencode;
  leftover 'generic' entry had no output and failed the build)
- compiled outputs are regenerable artifacts: skills/simplecadapi/
  untracked from git, skills/simplecadapi-*/ gitignored, release.yml
  and README build via skillbuild and tar the omp output directly
  (bsdtar has no --transform; inner dir keeps its suffixed name)

Verified: 49 tests pass; both targets build 372 files with zero
conditional blocks; no omp/conditional/directive residue in the tree
or outputs.

* chore(docs): drop stale architecture review and design notes
2026-08-22 20:20:49 +08:00
NiJingzhe 29ecf1a420 chore: configure ty language server 2026-08-20 14:55:27 +08:00
NiJingzhe ba1e06a489 feat: expand product exporters and FEM workflow 2026-08-18 01:36:44 +08:00
NiJingzhe 9d6703a786 feat: enforce canonical product capture workflow 2026-08-15 16:17:11 +08:00
NiJingzhe 89564ee1f5 Add durable part and assembly caching 2026-08-11 17:06:00 +08:00
NiJingzhe d7a6ba4dc3 feat: add replayable surface modeling APIs 2026-08-05 21:32:07 +08:00
NiJingzhe 675afb9b85 feat: consolidate BREP inspection workflow 2026-08-04 23:45:23 +08:00
NiJingzhe 9758542fbe Prepare 2.0.4b1 release 2026-08-02 15:56:49 +08:00
NiJingzhe 9e8450f192 feat: add py-slvs sketch solver backend 2026-07-30 01:00:01 +08:00
NiJingzhe b54a08d981 Release version 2.0.2 2026-07-28 12:34:01 +08:00
NiJingzhe 7914a3fede Release version 2.0.1 2026-07-28 12:29:51 +08:00
NiJingzhe 4214c66cd5 feat: add STEP BREP inverse engineering tools 2026-07-27 02:06:38 +08:00
NiJingzhe c9760f2866 Add replayable modeling and Scene packages 2026-07-23 03:15:43 +08:00
NiJingzhe 54920c76dc Add mesh extraction and collision verification 2026-07-10 23:02:21 +08:00
NiJingzhe c281928c34 Switch license from GPL-2.0 to AGPL-3.0 2026-07-10 10:35:29 +08:00
NiJingzhe 60bb2067f8 Remove legacy scripts and refactor plans; add Chinese README and skill release docs 2026-07-10 10:23:51 +08:00
NiJingzhe 4892e9f929 Set release version to 2.0.1b1 2026-06-29 15:20:32 +08:00
NiJingzhe 4dc8e2a21d Add standard gear library and release 2.0.1 2026-06-29 14:32:56 +08:00
NiJingzhe 2b5e5455a7 Prepare 2.0.0b4 release 2026-06-12 01:48:21 +08:00
NiJingzhe f185406516 Support indexed geo select nodes 2026-06-02 23:29:27 +08:00
NiJingzhe 3832f3c93e Prepare 2.0.0b2 beta release 2026-06-01 17:44:15 +08:00
NiJingzhe 65beee4c81 Prepare 2.0.0b1 beta release 2026-05-09 23:17:08 +08:00
NiJingzhe a05f1e90e6 Refactor runtime to OCP-native kernel 2026-05-03 03:03:29 +08:00
NiJingzhe 4500238e0e chore: bump version to 2.0.9 2026-04-06 00:01:04 +08:00
NiJingzhe ab36be0484 fix: align union defaults and bump release version
Route union through CadQuery-style fuse defaults, emit a clear warning when solids remain separated beyond tolerance, and document the updated behavior. Bump the package and skill runtime references to 2.0.8 for the next PyPI release.
2026-03-23 20:29:36 +08:00
NiJingzhe 7b77ad52a5 docs: clarify exporting boolean result lists
Document that STEP and STL exports accept mixed shape inputs and direct List[Solid] outputs from boolean operations, so downstream agents do not collapse results to a single solid unnecessarily. Refresh the generated docs and skill references and bump the runtime/version references to 2.0.7.
2026-03-22 20:08:27 +08:00