251 Commits

Author SHA1 Message Date
.CooCoo dcb7085b2a Merge pull request #9139 from dotCooCoo/feat/plugin-api-events
Plug-ins: react to selection, layer, open and save events
2026-12-02 11:15:23 -08:00
dotCooCoo 70e69a1750 Merge main into fix/plugins-tree-audit-in-checks 2026-12-02 02:13:53 -08:00
dotCooCoo ccf5765419 Tests: assert counts and saved names in tool, path, 3D, brush and CAD tests
Tests whose all() passed on an empty list now check the list's length or
that it is not empty:
- huge_circles_bridge_with_finite_anchors_or_are_refused (pathops bridge)
- smooth_rounds_corners (pathops ops): the four corners stay, smoothed
- a_held_rotation_turns_the_art_around_its_pin (tools ARAP): one point
  per mesh vertex
- the_eraser_drag_area_matches_the_release_when_pressure_or_a_mode_starts_during_the_drag
  (tools gesture): one released point per press
- every_effect_casts_a_shadow, inflate_cells_across_a_hole_edge_are_cut_to_the_shape,
  a_plane_has_only_a_front_and_a_hollow_solid_none and
  perspective_runs_0_to_160_degrees_with_the_eye_outside_the_object (three-d)
- a_file_two_branches_include_is_followed_from_the_shallower_one
  (scriptcheck): one row per include line
- pens_pick_colors_and_widths (cad HP-GL): four widths
- junk_pressure_brushes_draw_finite_art (brush): all 12 cases draw

Round trips that hold by construction (parse finds the id in ALL) are
replaced with one saved name that must parse and one that must not:
follow_names_parse (pathops shared edge), the shape kinds (pathops
shapes), surfaces_parse_from_their_ids (three-d), the Quick Pen actions
(tools), names_parse_and_serialize_as_names (plugins) and the brush
variation modes, which also compare the serde names with the ids.

crop_keeps_an_instance_whose_art_reaches_the_region (cad) names the
entities written instead of checking that some were.
the_saved_engine_preference_is_found (app) pins the GPU choices the
preferences offer to the three the app reads.
timing_unite_1000_circles (pathops) gets an ignore reason and checks
that Unite gives one shape.

Each changed assertion fails when the code under test is broken (an id
renamed, a list emptied, a flush or instance dropped) and passes when it
is restored.
2026-12-01 17:35:21 -08:00
dotCooCoo a9467c2b7e CI: the plug-in grant call-site audit runs in the checks shard
The audit that lists the shipped code allowed to make a plug-in grant
token or record a grant read the sources of every crate from a
vectorcraft-plugins integration test. That test needed
`reads-every-member` in the crate's metadata, so test selection picked
shard 5 for every Rust change.

The audit is now `cargo xtask grant-sites`, a step of `cargo xtask ci`
that runs in shard 6 on every event. It keeps the same list, the same
walk and the same filters, and leaves its own file out. vectorcraft-plugins
no longer sets `reads-every-member`, and the old test is removed.
2026-11-30 05:49:45 -08:00
dotCooCoo dcdbd3cc1b CI: declare the files each crate reads in other crates, for test selection
Test selection in the shared gate (`select-tests`) runs the tests of the
crates a change reaches. A crate that compiles or reads another crate's
files lists them under `[package.metadata.craft]` in its Cargo.toml:

- vectorcraft-plugins sets `reads-every-member = true`, because
  `tests/grant_sites.rs` reads the sources of every crate.
- vectorcraft-cli, vectorcraft-affinity, vectorcraft-engine,
  vectorcraft-mcp, vectorcraft-ui-egui and xtask list the files they
  compile through `#[path]` or read with `include_str!`/`include_bytes!`
  or from `CARGO_MANIFEST_DIR`.

Cargo ignores this table. Only the gate's selection step reads it, and that
step fails when a read is missing from it.
2026-11-30 02:38:02 -08:00
dotCooCoo 6227297ae4 Merge main into feat/plugin-api-events
# Conflicts:
#	crates/engine/src/cmd/plugin.rs
#	crates/plugins/src/lib.rs
#	crates/plugins/src/manifest.rs
#	crates/ui-egui/src/tests/plugins.rs
#	docs/plugins.md
2026-11-28 23:13:20 -08:00
dotCooCoo 828eb27097 Merge main into feat/plugin-api-localized-labels
# Conflicts:
#	crates/plugins/src/manifest.rs
#	crates/ui-egui/src/tests/panel_harness.rs
2026-11-28 19:28:43 -08:00
dotCooCoo ebeaa1d91f Merge main into feat/plugin-api-localized-labels 2026-11-28 19:20:09 -08:00
dotCooCoo 2974180502 Merge main into feat/plugin-api-importer-output-kinds
# Conflicts:
#	crates/engine/src/cmd/plugin.rs
#	crates/plugins/src/lib.rs
#	crates/plugins/src/manifest.rs
#	crates/plugins/src/permissions.rs
#	docs/plugins.md
#	docs/target-app-parity.md
2026-11-28 14:21:28 -08:00
dotCooCoo 5f907f863a Merge main into feat/plugin-api-context-menus 2026-11-28 08:46:27 -08:00
.CooCoo ab4b8bb64a Merge pull request #9136 from dotCooCoo/feat/plugin-api-generated-art
Plug-ins: generators draw generated art objects that keep their parameters
2026-11-28 08:06:06 -08:00
.CooCoo 57b715c359 Merge pull request #9829 from dotCooCoo/fix/previewbounds-memo-flake
Tests: hover memo counts hold plug-ins and hyphenation steady
2026-11-28 08:03:26 -08:00
dotCooCoo cae99fee0c Merge main into feat/plugin-api-generated-art 2026-11-28 07:15:42 -08:00
dotCooCoo 6eb0428586 Merge main into feat/plugin-api-context-menus 2026-11-28 05:32:32 -08:00
dotCooCoo 338a5c7a32 Merge main into fix/previewbounds-memo-flake 2026-11-28 05:18:26 -08:00
dotCooCoo 404776ac04 Plug-ins: the failed-stage deferral test no longer depends on CPU load
effect::tests::failed_and_missing_stages_are_deferred_with_their_reason
installed a plug-in that runs to the default instruction budget (about 51
million instructions for its input) inside a first view, whose budget is
2,000 ms of real time. Under heavy CPU load the run took longer than that,
the view's budget cut it short, and the stage was deferred for time
instead of as failed, so last_error was empty and the assertion at
effect.rs:722 failed. With the test pinned to one core beside 15 busy
loops it failed 3 runs of 3 that way.

The test now gives the plug-in a budget of 100,000 instructions, so the
run ends in an instruction-budget failure long before the view's budget
runs out, and it checks that the error is the instruction budget. The
same test passes 5 runs of 5 beside 15 busy loops and 5 of 5 beside 100.
2026-11-28 04:04:07 -08:00
dotCooCoo d22402c570 Merge main into feat/plugin-api-events 2026-11-28 02:31:56 -08:00
.CooCoo 0b933e7a36 Merge pull request #9127 from dotCooCoo/feat/plugins-web-worker
Plug-ins: the web build checks plug-ins and runs filters in a Web Worker
2026-11-28 01:04:54 -08:00
dotCooCoo ab75ac0c13 Plug-ins: a module with a manifest section that lists events must export vc_event
Changes on main needed the events code and its tests to follow them.

- A module that carries its manifest in the `vc_manifest`
  custom section is loaded without being instantiated, and its exports
  are checked by `check_exports`. That check now also requires
  `vc_event` with the type (param i32 i32) (result i32) when the
  manifest lists `events`, as the instantiated path already did. The
  `an_event_plugin_exports_vc_event` test covers a sectioned module
  without `vc_event`, with the wrong type and with the right one.
- JavaScript plug-ins have no `vc_event`, so their manifest may not
  list the permission `events`, next to `settings`, `cache` and
  `commands`. The JavaScript bundle test and docs/plugins.md say so.
- The craft UI framework port removed
  `VectorcraftApp::begin_host_iteration`, so the two UI-pass event
  tests no longer call it.
- On the framework, the whole window draws only on a context with the
  framework's runtime installed. `a_change_made_in_a_ui_pass_is_delivered_in_that_pass`
  drew it on a plain `egui::Context`, where the runtime panics ("the
  runtime plugin's hooks did not run for the previous pass") and the
  test did not finish. It now draws its passes with
  `testing::ui_context` and `testing::part_frame`, as the window tests
  on main do.
2026-11-28 00:19:30 -08:00
dotCooCoo 1ad7a1134f Merge main into feat/plugin-api-generated-art 2026-11-27 23:35:47 -08:00
dotCooCoo 875f49fc8d Merge main into feat/plugins-web-worker
The plug-in runtime keeps main's JavaScript plug-ins beside the web worker's module bytes and checked loads: a JavaScript plug-in's bundle is kept for the worker like a module, and load_checked loads it from its bundle.
2026-11-27 23:05:07 -08:00
dotCooCoo 5a771c52f7 Merge main into feat/plugin-api-live-effect-appearance 2026-11-27 22:50:09 -08:00
dotCooCoo 5b57a9dbe5 Merge main into feat/plugin-api-context-menus 2026-11-27 22:33:09 -08:00
dotCooCoo f850b6b7a3 Merge main into feat/plugin-api-importer-output-kinds 2026-11-27 22:24:08 -08:00
.CooCoo c45a9a2781 Merge pull request #9870 from dotCooCoo/feat/plugins-failed-load-retry
Plug-ins: a plug-in that fails to load is listed and can be retried
2026-11-27 22:17:31 -08:00
dotCooCoo 156fdce3f4 Merge main into feat/plugin-api-events
# Conflicts:
#	crates/engine/src/cmd/plugin.rs
#	crates/plugins/src/lib.rs
#	crates/plugins/src/manifest.rs
#	crates/plugins/src/runtime.rs
#	crates/ui-egui/src/app.rs
#	crates/ui-egui/src/dialogs/tests.rs
#	crates/ui-egui/src/i18n/tests.rs
#	docs/target-app-parity.md
2026-11-27 22:08:03 -08:00
.CooCoo 235c89c476 Merge pull request #9788 from dotCooCoo/fix/plugin-example-desaturate-keeps-path
Plug-ins: the example Desaturate filter leaves paths as they were
2026-11-27 21:42:06 -08:00
.CooCoo 990637f30d Merge pull request #9839 from dotCooCoo/fix/plugins-tests-without-timing
Plug-ins: loader, registry and dialog tests wait on handshakes instead of spin counts
2026-11-27 21:36:45 -08:00
.CooCoo 35e192f177 Merge pull request #9836 from dotCooCoo/chore/wasmi-2-0-3
Plug-ins: a multi-value br_table gives every target its values (wasmi 2.0.3)
2026-11-27 21:15:11 -08:00
dotCooCoo 41706a3867 Plug-ins: a plug-in that fails to load is listed and can be retried
A stored plug-in that didn't install, for example because its load
panicked or its module is broken, was only written to the log. The
person could not see it or load it again without restarting.

- plugin.list gains failed: [{file, error, from}], the plug-in files
  that didn't load in this process: those of the Plug-ins folder, and
  those the folder report of the Additional Plug-ins Folder (or the
  folder plugin.reload loaded last) lists as failed. Disabled plug-ins,
  files turned off since they failed, and modules skipped because
  another install or removal of their id came first are left out. A
  file that both loads list is listed once, as a stored file. A
  plugin.reload replaces only the folder's rows. Installing or removing
  a plug-in whose module is in a stored file that failed, or a later
  load that installs it, takes the file off the list.
- plugin.retry {file?} loads one of those files again, or all of them,
  with the same checks as the load it failed in, and reports for each
  whether this retry installed it. A folder file's row in the folder
  report moves to loaded or keeps its new error. Under automation read
  roots, a file outside them is not read again, its row stays listed,
  and the reply names it and its folder by their names. Safe Mode
  returns an error.
- plugin.setEnabled {file} also takes the name failed gives a file
  outside the read roots.
- Object › Plug-ins › Plug-ins That Didn't Load… lists the files with
  why; Retry All loads them again under the read roots the list opened
  under, and the status bar says how many loaded. The item is disabled
  while nothing failed.
- A command.batch that runs a filter and then retries a module with
  its id turns Apply Last Filter off, as a reinstall does.

Docs: docs/plugins.md (Plug-ins that didn't load), docs/mcp.md.
2026-11-27 21:06:29 -08:00
dotCooCoo 64eb88e604 Plug-ins: web worker runs end on failure, deadline and automation as on the page
- A panic while a held run's output is applied ends the run, so the
  documents go back to their state before it, and ending a held run
  drops the output handed in for it.
- The worker loads a plug-in with the limits the page sends with the
  run, so its memory limit applies.
- A worker that is ready only after the run's deadline is not sent the
  run, with or without a dialog open.
- A run that holds the documents and fails while a dialog is open ends
  at once and frees them.
- A plug-in command's dialog that automation confirms runs the command
  on the page and returns its result.
- A plug-in file opened or dropped on the web whose worker check fails
  is reported in the Can't open dialog, not only in the status bar.
- The web README lists connect-src among the CSP directives the app
  needs.
2026-11-27 18:39:30 -08:00
dotCooCoo 6e88608a4d Plug-ins: loader, registry and dialog tests wait on handshakes instead of spin counts
The plug-in loader, registry and dialog unit tests decided their results with
yield-count spins (up to 100,000,000 tries) and a 10 s recv_timeout. On a
loaded machine a spin could run out before a worker sent, and a test failed
without a fault.

- Loader tests block on the workers' outcome channel (Loads::record_next) and
  on the jobs' start channel. The stuck-thread tests keep the outcome channel
  of the dropped load and receive the stuck job's outcome, which its worker
  sends after it stops counting the thread as stuck. The window test checks
  that taking outcomes leaves the start limit where it was.
- The registry revision test holds the set and waits for a hook that install
  runs right before it asks for the write lock. The folder-order test drives
  the load on the test thread and receives the other two files' outcomes
  while the first file waits.
- The dialog test counts the conditions Manifest::visible checks and fails
  once it checks more than one per named parameter, so a check that does not
  end fails the test.

Every assertion is kept.
2026-11-27 17:11:33 -08:00
dotCooCoo de8c87c194 Plugins: test-steady is on when the crate is tested in its own shard
The gate's test shard 4 builds vectorcraft-plugins without
vectorcraft-engine, which was the only crate that turned the
test-steady feature on, so `cargo xtask ci shard` stopped at its
feature check on every shard. vectorcraft-plugins now turns the
feature on in its own dev-dependencies, as vectorcraft-pdf and
vectorcraft-affinity do for their test features.
2026-11-27 16:51:29 -08:00
dotCooCoo a93ba163b6 Plug-ins: hostile, time budget and cancel tests check errors, not elapsed time
Three tests in crates/plugins/tests/abi.rs passed or failed on how long a
run took (under 5 s or 3 s), so a slow or loaded runner could fail them and
a fast one could hide a run stopped by the wrong limit.

- hostile_modules_fail_within_their_budget (was _fail_quickly) checks each
  module's error. The endless ones must end with the instruction budget, so
  a run stopped by the 60 s time budget fails the test.
- wall_clock_budget_stops_runaway_plugins gives an endless loop two slices
  of instructions: with a time budget of 0 it ends with the time budget at
  the end of the first slice, and with the default one it ends with the
  instruction budget.
- cancelling_stops_a_run_between_two_slices_of_its_budget gives the loop
  two slices: cancelled, it comes back Cancelled; not cancelled, the same
  plug-in ends with the instruction budget.

Each test fails when its check in Plugin::call_with is removed.
2026-11-27 16:25:42 -08:00
dotCooCoo 57230b2fe4 Plug-ins: a multi-value br_table gives every target its values (wasmi 2.0.3)
wasmi 2.0.0 miscompiles a multi-value br_table whose targets take the
same values when another operand sits under those values: the targets
read their values from slots the branch never wrote
(https://github.com/wasmi-labs/wasmi/pull/2106, fixed in 2.0.2). A
plug-in that branched that way got wrong results. 2.0.1 to 2.0.3 also
fix other miscompilations, a use-after-free on resuming a call on
another store, and memory.grow past a declared maximum bypassing the
resource limiter
(https://github.com/wasmi-labs/wasmi/blob/main/CHANGELOG.md).

Only Cargo.lock changes: the workspace requirement "2.0.0" allows
2.0.3, and wasmi 2.0.3 still uses wasmparser 0.228.

The new abi test runs such a branch table for each of its targets; it
fails on 2.0.0 with the plug-in's unreachable trap.
2026-11-27 15:53:05 -08:00
dotCooCoo 64ada8e7fc Tests: hover memo counts hold plug-ins and hyphenation steady
The Preview Bounds memo checks the fonts, the hyphenation exceptions and
the plug-in revisions on every lookup. Other engine tests change the
hyphenation exceptions and install plug-ins on other threads, so a
change between two hovers refreshed one memo slot and
a_hover_checks_the_memo_as_often_however_many_objects_are_selected
counted 5 checks instead of 4.

- set_hyphenation_exceptions takes the font gate (test_fonts::font_change),
  as composite font changes do, so steady_fonts holds it back too.
- vectorcraft_plugins::steady (feature test-steady) gates every revision
  bump in the plug-in registry and the deferred stages the same way.
- Both counting tests in previewbounds.rs hold both guards, and the
  hyphenation round-trip test holds steady_fonts through its sequence.
2026-11-27 15:23:49 -08:00
dotCooCoo 8c9c5146c4 Plug-ins: the example Desaturate filter leaves paths as they were
The example filter parsed its input with serde_json's default float
parser and handed every object back with its `path`. A coordinate could
come back changed in its last digit, which the host reads as a new path:
a live shape became a plain path after a color-only run, and a compound
path with a hidden, locked or guide member was refused.

The filter now leaves `path` out of each object it returns, so each
object keeps its geometry, as docs/plugins.md advises for a filter that
does not change it. The fixture desaturate.wasm is rebuilt from the
source with build.sh.

Docs: docs/plugins.md.
2026-11-27 12:25:16 -08:00
dotCooCoo 38bffbe8b5 Fix generated art editing in containers and after parameter updates 2026-11-26 12:30:45 -08:00
dotCooCoo dc333ada97 Merge main into feat/plugins-web-worker
Worker completion preserves unapplied typing and discards stale output.
2026-11-26 10:21:21 -08:00
dotCooCoo 4431c965f4 Merge main into feat/plugin-api-javascript-runtime
JavaScript plug-in runtime errors preserve the jobs limit classification.
2026-11-26 10:19:52 -08:00
dotCooCoo f7d39bce07 Merge main into feat/plugin-api-generated-art 2026-11-26 10:13:31 -08:00
dotCooCoo 6ec635ff43 Merge main into feat/plugin-api-context-menus 2026-11-26 09:35:47 -08:00
dotCooCoo f64d743ffb Importers: validate paths, artboards, and placed bounds 2026-11-26 08:38:17 -08:00
dotCooCoo 2274a3416d Merge main into feat/plugin-api-importer-output-kinds 2026-11-26 07:25:04 -08:00
BFlat 2fcfa504fb Merge pull request #9085 from dotCooCoo/feat/plugin-slider-param
Plug-ins: a number parameter can show a slider beside its field
2026-11-26 16:59:14 +07:00
dotCooCoo d71d4092e6 Merge main into feat/plugin-slider-param 2026-11-26 00:17:16 -08:00
dotCooCoo 1332a448a5 Merge main into feat/plugin-api-importer-output-kinds
Importers at API level 4 also place their type, images and visible layers with File › Place; their artboards are left out.
2026-11-25 19:03:39 -08:00
dotCooCoo 132d2da4a1 Merge main into feat/plugin-api-filter-type-images-symbols 2026-11-25 19:01:04 -08:00
dotCooCoo 594ebcb6e3 Merge main into feat/plugin-api-generated-art 2026-11-25 18:46:05 -08:00
dotCooCoo cb1361c889 Merge main into feat/plugins-web-worker 2026-11-25 18:45:04 -08:00