Commit Graph

18 Commits

Author SHA1 Message Date
NiJingzhe e9d5749f7c fix(windows): unblock builds — binary opens, guarded dir fsync, evidence-based stale locks
Reported by the OmniSim evaluation of the public u-link example
(2026-09-11): pip install + export.py on Windows died three times in
the build layer before any geometry was built.

- Binary-mode opens: every byte-exact os.open site now sets O_BINARY
  via _internal/os_compat.with_binary_flag. autocrlf=true clones read
  builder sources in text mode, stripped CR, and aborted with a false
  file_input_changed (25579-byte u_link.py read back as 25092); the
  same hazard expanded LF on cache writes and would corrupt CAS
  hashes. Sites: build/dependencies.py, artifacts/feature_graph.py,
  scene/archive.py, cache/store.py (object/record writes, lock
  create), artifacts/interface.py (lock create).
- Directory fsync is POSIX-only: os.open(<dir>)+fsync raised
  PermissionError on Windows in cache/store.py and
  artifacts/interface.py; both now no-op off POSIX via one helper.
- Stale-lock recovery by evidence: a lock whose recorded owner pid is
  provably dead is recovered immediately (unreadable owners still wait
  out the age gate, live owners are never broken). Windows liveness
  probing uses OpenProcess/GetExitCodeProcess — os.kill(pid, 0) maps
  to TerminateProcess there and kills the process being probed.
- Console hardening at import: non-UTF strict streams are reconfigured
  to backslashreplace so a cp1252 console cannot raise
  UnicodeEncodeError from a diagnostic print inside an error handler
  and mask the real failure.
- .gitattributes: byte-exact by default, LF pinned for text formats,
  so builder-source digests stop depending on core.autocrlf.

Tests: test_os_compat.py (15) + dead-owner immediate recovery in
test_cache_store.py; full suite 1799 passed, 5 skipped. ty: zero new
diagnostics.
2026-09-11 20:55:14 +08:00
NiJingzhe be93122527 chore(release): bump version to 2.1.3b1 2026-09-10 14:50:05 +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 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
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 bc0a967c85 feat: propagate public connectors to exporters 2026-08-20 14:52:47 +08:00
NiJingzhe e1df185f5b Merge cadir/dev into feat/prt-and-assemble 2026-08-19 14:42: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
yuliuse 9d7092860a feat: group BREP comparison diagnostics 2026-08-13 00:00:57 +08:00
yuliuse 3fc96f67d8 feat: add STEP reconstruction inspection helpers 2026-08-12 23:27:48 +08:00
NiJingzhe 89564ee1f5 Add durable part and assembly caching 2026-08-11 17:06:00 +08:00
NiJingzhe 675afb9b85 feat: consolidate BREP inspection workflow 2026-08-04 23:45:23 +08:00
Codex c5217dc0d5 docs: add 2.0.4b2 reconstruction notes 2026-08-03 14:30:05 +08:00
NiJingzhe a2b0c40297 Move update notes to 2.0.4b1 2026-08-02 15:36:14 +08:00
NiJingzhe a9acf38c0e Document FreeCAD and bearing updates 2026-08-02 04:07:15 +08:00
NiJingzhe aa2f0e2ab9 docs: add bilingual 2.0.2 update notes 2026-07-28 13:13:09 +08:00