Commit Graph

4 Commits

Author SHA1 Message Date
NiJingzhe bf5853bbca fix(run): suppress the degraded-cache warning on the logger marimo actually logs to
suppress_warnings_logs("lazy") targeted a logger nobody writes to — "lazy"
is the file name in the log record, the logger is "marimo" — so 2.2.5's
quieter-runs promise never held on a cache-initializing run. A regression
test pins it with a capture handler on the marimo logger (mutation-checked:
with the old name the test fails).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 03:11:06 +08:00
NiJingzhe b2eaf51ae6 feat(run): validate a stage — through/, product=False, a timeout, quieter logs
sca run --through N runs the first N cells the way the editor numbers them
(the setup cell takes no number), --no-product runs a work-in-progress
notebook that has no product yet, and --timeout (default 120s) fails a run
that takes longer instead of hanging the agent. The cache loaders' degraded-
state warnings (unsigned entries, stub restores) no longer print at WARNING,
and VTK's own chatter (a missing X server) is off; a real failure is still
raised and named.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 20:02:04 +08:00
NiJingzhe cb7a5369aa feat(runtime): per-cell cache dependencies, shared with the editor kernel; faster packages
The cell cache is stored under a digest of the files each cell depends on
(modules reached through the names it reads, through the notebook functions it
calls, and through the cells it reads from; child notebooks; inputs) instead
of one digest for the notebook: a changed module recomputes what reads it and
restores the rest, and going back restores everything. The editor kernel runs
cells through the same cache (cells downstream of saved parameter values are
keyed by them; cells that run child notebooks are not cached there).

The render mesh of a face is computed with numpy in the profile's fixed
operation order: identical bytes, package builds about twice as fast.

The editor also watches the data files a notebook lists in 'inputs'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 18:28:45 +08:00
NiJingzhe 3dd8c77b8d refactor!: replace the part cache with the marimo notebook runtime
A SimpleCAD model is now a marimo notebook: a PEP 723 header with a
[tool.simplecadapi] table (id, revision, tolerance_profile, inputs), one
FTC block per cell, and the product is the top-level value whose id is the
notebook id. The notebook file is the only source of truth; .scadpkg is
only for exchange and publishing.

Runtime (simplecadapi.runtime):
- run_notebook(path, *, id=None, overrides=None, cache=True) and
  sca run <notebook.py> [--id] [--set NAME=VALUE] [--no-cache] [--out]
- use(path, id=..., **overrides) composes child notebooks; notebook_id()
  lets one notebook serve a part family under per-use ids
- each cell records into its own session; cells are the unit of caching,
  keyed by the notebook dependency digest (deps.json)
- marimo cell executor entry point, so marimo edit runs the same way
- shapes and read-only definition mappings pickle for the cell cache

Removed: the content-addressed part cache (simplecadapi.cache,
CachePolicy, CacheReport, sca cache ...), the incremental assembly solver
and its dependency/state modules, and part-interface diffs with latest-
state persistence. Part and assembly builds and the notebook projection
now share one definition writer (build/definition.py).

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-02 17:16:16 +08:00