feat: retain managed visual objects and dispatch native input through Endor
Verify Tessera GUI / verify (push) Successful in 9m28s

This commit is contained in:
2026-10-21 01:49:35 +08:00
parent 757fa22d9b
commit 0d5e4b318d
21 changed files with 3295 additions and 892 deletions
+21 -21
View File
@@ -5,11 +5,14 @@
| main.rs | Native window event loop, namespace state and API startup |
| api.rs | Code CRUD, live Console/reset and compatibility evaluation endpoints, worker-owned session, request observation and diagnostics |
| activity.rs | Bounded in-memory HTTP exchanges with marked previews and allowlisted request headers |
| endor_host.rs | Aster compilation, fresh PUT candidates, worker-owned live REPL VM, bounded execution, root cleanup and AST developer tree |
| endor_host.rs | Aster compilation, fresh PUT candidates retained after successful publication, shared Console/program VM, bounded execution, root cleanup and AST developer tree for function/class/member assignment nodes |
| endor_script.rs | Batch complete inputs for Aster's Interactive parser/compiler, retain Module entry, and rebase Aster spans to the original snapshot |
| ui_bridge.rs | Tessera UI/page payloads and bound render methods, reusable node/page pools, explicit native-edge VM roots, live mounts/unmount and native frame extraction |
| live_ui.rs | Stable native UI references, alias-preserving replacement, cycle/depth checks and immutable frame extraction |
| layout.rs | Native UI tree to Frame; expanded-tree and coordinate budgets |
| ui_bridge.rs | Managed nominal type constructors, shared type method tables and bound receiver dispatch, tab registry, Page lifecycle/navigation and immutable frame extraction |
| block.rs | Aster-managed Block/Cell/data graph, stable child slots, shared assignment, cycle validation and explicit text bindings |
| snapshot.rs | Property dependencies, reverse parent links and cached immutable visual derivation |
| mount.rs | Managed per-occurrence contexts, weak reverse links, geometry and focus queries |
| events.rs | Managed Event marker and bounded native input transport to the owning VM |
| layout.rs | Iterative measurement/arrangement, stable occurrence IDs, measurement cache and geometry budgets |
| document.rs | Published source/AST/UI snapshot, revisions, invalidation, frame validation and display commands |
| app.rs | Window events, redraw and system widget pointer/keyboard/IME routing |
| clipboard.rs | UTF-8 macOS clipboard adapter independent of Finder locale, with strict decoding and surfaced errors |
@@ -23,22 +26,20 @@
| text.rs | Shared system font discovery, shaping, real measurements, antialiased glyphs and bounded caches |
| README.md | Module map |
Aster is an unmodified source submodule. Language parsing, AST definitions,
Aster is an independent source submodule pinned to the published managed type/native-call implementation. Language parsing, AST definitions,
compilation, bytecode and VM execution come from its libraries. Tessera implements
only host UI behavior and layout. No CLI, HTTP server or Docker process is needed
to execute Endor in the application.
A complete-PUT execution candidate owns all external VM roots, including the 4096-node pool
and 64 pages with bound render callbacks. Script units share one globals dictionary
inside the candidate; no variables or VM handles persist across successful PUTs.
Callbacks return borrowed, preallocated real VM objects. UI payloads opt into Aster
shared-reference assignment. Native live child/forward edges contain owned Arcs;
Console registers corresponding external VM roots through retain/release, without
mutable untraced VM edges in payloads. Window frames contain only immutable native data. Page rendering stores native root data in the build session;
the final render selects the snapshot after all script units succeed. Once
extraction finishes, release temporary results, clear
globals, release roots, collect cycles and require an empty VM. The window keeps
only source, developer metadata, frame commands and native UI data.
A complete-PUT candidate owns the desktop and UI service roots, with dynamic
Block allocation through scoped NativeContext. Block -> Cell -> data and all
child/history/forwarding references are managed VM edges. Native functions declare
their captured owner edges. The bridge holds only weak diagnostic references to
allocated Blocks; the tab registry owns open Pages. Closing a tab releases that
edge, without destroying a still-referenced Page. Console retains the actual VM;
a successful complete PUT also retains its candidate as the active program, accessible from Console and native input. Failed PUT preserves the previous heap. Cleanup releases
globals/service roots, collects cycles and requires an empty VM. Window frames
contain only immutable native data.
Tests in api.rs execute real HTTP CRUD, persistent Console/reset/PUT isolation and a controlled queued-PUT/DELETE race
without opening a window. Tests in endor_host.rs cover lifecycle, direct script and
@@ -66,13 +67,12 @@ interaction. It imports no Endor runtime or guest UI bridge; developer tools sup
typed actions and keep all execution/source behavior outside the widget layer.
Console sessions use `endor_host::ReplSession` on the same worker thread. Real VM
globals, UI pools and `_` survive between inputs. Parse/compile precede execution;
globals, live Blocks and `_` survive between inputs. Parse/compile precede execution;
only a successful input commits a pending mount or publishes changes to an existing mount.
Runtime-failed input can retain earlier completed bindings, but cannot publish its
pending render. Session budgets cover cumulative source/AST and fixed UI pools.
page.unmount releases a mount; unused node/page pool slots are reclaimed between inputs.
Explicit reset drops the VM; accepted PUT/code DELETE change the publication epoch
and invalidate the old context. Source snapshots carry annotated AST ranges for the
pending render. Session budgets cover cumulative source/AST and live Block counts.
page.unmount releases current content; unreachable object cycles are reclaimed between inputs.
Explicit reset drops the VM. Successful PUT replaces it with the fresh program; failed PUT restores the displayed program’s event epoch. Code DELETE invalidates the context. Source snapshots carry annotated AST ranges for the
actual Console transcript; source history is never rerun to reconstruct memory.
The Aster pin includes independent Assignment syntax and generic opt-in assign_from support.
Live reference tests cover alias updates, nested mounts, cycle rejection, detached branch release and unmount/remount.