Commit Graph
17 Commits
Author SHA1 Message Date
Turtle 0daacca2ed feat(cli): leave heap diagnostics when a source launch runs out of memory
pnpm dsh, start:web, and dev:web now start Node with
--heapsnapshot-near-heap-limit=1 and --report-on-fatalerror, so a Host
that exhausts its V8 heap leaves a heap snapshot and a diagnostic report
in the repository root, which Git ignores.

Refs #9359
2026-11-27 00:44:30 +08:00
imccyu 897ab671f6 feat(ui-renderer): scope opted-in package styles on existing slot roots (#9033)
* feat(ui-renderer): scope opted-in package styles on existing slot roots

Share the package style policy between slot dispatch and stylesheet installation. Preserve global themes, root identity and component state through style-only toggles, including nested Factory, HOC and list output.

* fix(dev-web): keep launcher validation independent of package sources

* refactor(ui-renderer): identify generated scope CSS as stylesheet content

* fix(client): keep panel indicators visible under style isolation

Position a shared indicator area on the Session panel toggle. Jobs, Subagents, and Forge paint their own marks without crossing package scopes.

* refactor(ui-renderer): fix each package style scope for the page

Stamp the content supplier on existing slot roots. Read its page-owned mode when registering content and writing stylesheets instead of subscribing the render tree to live policy changes.

* fix(ui-renderer): keep scoped styles with their actual package

Resolve Loader aliases against the page module table and stamp contributions from the renderer’s own module source. Let a valid package stylesheet take over a path rejected during scope preflight or by the destination.

* fix(client-modules): declare the row callback receiver-free

* refactor(ui-renderer): scope styles from their module records

* test(ui-renderer): verify module-record style scoping

* chore(ui-renderer): restore scoped slots to the PR base

* fix(ui-renderer): mark slot roots with their supplying module

* refactor(ui-renderer): bind Factory child slots once per supplier

An outlet belongs to whoever called renderSlot for it, wherever it later
renders. A Factory's child-slot methods are now kept per Factory and per
supplier: the Factory itself for its own Component and fallback locals,
the occurrence's caller for a local it selected. One caller mounting its
local in several places shares one method, and no per-mount binding or
extra occurrence context field remains.

* refactor(ui-renderer): scan a Factory's chain children once

Whether a Factory declares a chain child is recorded once per Factory
beside its per-supplier child-slot methods, instead of once per
supplier. The Factory kit assigns `renderSlot` and `renderSlotChain`
by name rather than copying whichever keys the methods object holds.

* test(client-runtime): expect data-plugin on the mounted slot root

The slot outlet names its supplier on the existing root; the test runtime registers without a package, so the two DOM snapshots gain data-plugin="".

* test(web): launch the panel indicator scenario per isolation mode

The Host reads an entry's client isolation when its plugin starts, so
updating that field on a running entry never reached the boot graph and
the scenario waited forever. Each mode now starts its own Host: the
shipped composition, and one whose overlay declares style isolation for
the panel and the two packages drawing on its toggle. Both check the
boot graph first, then run the same interaction and indicator
assertions.
2026-11-25 02:52:49 +08:00
imccyu f5d022c58e feat(client): run script-isolated package bundles in iframe Realms
Publish the unstable per-entry script switch in the Host boot graph and keep opted-in bundles out of the Main Realm batches. Activate the Realm providers before isolated code, reuse a frame across its package-local chunks, and release it on replacement or teardown. Dev Web can opt entries in through a transient final overlay.

Refs #8131
2026-11-24 21:33:52 +08:00
imccyu f6b0c5af59 build: rename build:src and build:test to build:artifacts and build:check
build:artifacts produces every artifact, including the tsdown bundles,
the Desktop bundle, and Web, so naming it after sources undersold it;
build:check checks scripts, benchmarks, and website code besides tests.
The build.ts scopes, aggregate step ids, the Python builder flag
(--build-artifacts), workflows, callers, docs, and the build-split Agent
Note follow the new names. The note also records the naming
alternatives.

Refs #5852
2026-10-11 22:16:47 +08:00
imccyu 129c915498 build: split build:src and build:test, and schedule build in parallel
pnpm run build ran every step in one serial chain, including the two
noEmit aggregate programs (tests, scripts, benchmarks, website) that no
artifact step consumes, so the Host aggregate check alone delayed tsdown by
about 66 s.

- build:src (scripts/build.ts --scope src) builds every artifact in the
  existing order and writes the client build record; it replaces the
  removed --artifacts-only flag and the libraries CLI mode.
- build:test (--scope test) type-checks only the Host and Client aggregate
  programs with tsc -p, concurrently, without compiling references or
  checking prerequisites.
- build runs both as one dependency graph through run-gates' new
  runAggregate: each aggregate check starts once its face's packages are
  compiled, and Client compilation stays after the Host bundle that writes
  the Typert /remote declarations. DSH_GATE_CONCURRENCY=1 serializes it;
  DSH_GATE_FAIL_FAST=1 stops the remaining steps at the first failure.
  Passing steps print one PASS line (DSH_GATE_VERBOSE=1 shows their output).
- PR artifact builds (e2e, release, preview, Node 22 compatibility) and the
  Python builder (--build-src) use build:src; dev:web and dev:desktop use
  build:src. test:*, bench, typecheck and the required consumer/Windows
  lanes keep the complete build.
- lint, lint:fix, doc-typecheck and the Typert contracts gate prepare with
  host-libraries (Host package compilation + Host bundle) instead of
  build:lib:host; their own checks never read the aggregate root or the
  Desktop bundle.

Parallel and serial build produce byte-identical lib/, Web dist and client
build record; a test-only type error fails build and build:test while
build:src passes.

Refs #5852
2026-10-11 18:19:23 +08:00
Turtle 500614c0d5 fix(build): pin tsdown to the native config loader
Root build scripts, the desktop bundle and the dev:web watcher pass the
native loader so tsdown never selects the undeclared unrun fallback. A spec
covers the build.ts rejection path.
2026-10-02 12:48:01 +08:00
imccyu 0f2cda8c22 fix(dev): retain readiness hooks and stabilize Web scenario waits 2026-10-01 00:02:15 +08:00
Yichen Jiang 78dcbc8587 feat(infra): unify Web and Desktop launch commands
Web and Desktop now share one command pair: start:* launches the artifacts
of a prior complete build and dev:* builds first, then launches. start:web
is new and spells out the same source launch vector as `pnpm dsh web`;
dev:web runs `pnpm run build`, the three rebuild watchers, and `dsh web` in
one terminal, with --skip-build and --no-serve for the previous two-terminal
flow. The launcher gate pins both scripts to the dsh CLI, and a root
Makefile names the same commands as make web|dev-web|desktop|dev-desktop|build.

The dev-web stage supervisor waits for stages the terminal already
interrupted, escalates only survivors, forwards SIGTERM once, and reports a
stage that exits on its own. Signal listeners are persistent because the
tsdown watchers bundle signal-exit, which re-raises a signal when it finds
no other listener.
2026-09-20 15:50:41 +08:00
Turtle 749c4ef93e fix: sample dev web metadata at startup 2026-08-24 15:04:01 +08:00
Turtle 65a8d6be1b feat(client): show build version in local banner 2026-08-24 15:04:00 +08:00
imccyu aa03eff500 build(client): enforce client package boundaries 2026-08-18 01:34:53 +08:00
Turtle 341051603f refactor(web): remove --dev; mount the reload chain unconditionally
The client-hmr row joins the web bundle as an ordinary always-on roster
row: without a rebuild watcher rewriting client bundles it polls
unchanged files and stays idle. This deletes the --dev flag, the web
runtime's mode config, the mode-forked prompt contract, the DSH_WEB_MODE
bash variable, and the post-settlement row-creation machinery the
conditional row required. dsh web + pnpm run dev:web remains the
development loop.
2026-08-11 18:01:25 +08:00
imccyu 717792b631 refactor: nest client manifest metadata under dsh 2026-08-10 21:11:09 +08:00
imccyu 9a0a9350c4 fix(typert): satisfy workspace static gates 2026-08-07 21:47:14 +08:00
NI0317 cd88a339fa fix(web): verify current GUI updates end to end 2026-07-29 11:22:48 +08:00
Tianyi Cui c3873464ba refactor(scripts): consolidate gate scripts on mdast fences, parseArgs, and globSync
Implements the gate-consolidation Agent Note from the NIH dependency audit:

- Shared markdownFences helper in scripts/markdown.ts (mdast code-node visit);
  doc-typecheck and verify-type-equiv extract fences through it; md-fences.ts
  and the duplicated extractEquivBlocks regex scanner are deleted;
  markdownProseLines derives fenced lines from parsed code-node positions
  instead of a second fence regex.
- publint-all.ts and verify-built-package-invariants.mjs parse argv with
  node:util parseArgs instead of hand-stepped parseOptions copies.
- Five straggler readdirSync walks become globSync: verify-runtime-closure,
  dev-web discoverPluginDirs, verify-package-paths realPackageNames,
  verify-client-domain-graph listSources, publint-all addPath. The
  dirent-diagnostic walks in check-workspace-constraints.ts and clean.ts stay.

Behavior parity verified: pnpm run doc-sync and every rewritten gate produce
byte-identical output before and after on this tree.

Moves the owning Agent Note proposed -> implemented and re-records its pair.
2026-07-26 23:14:28 +08:00
imccyu 6512e57047 feat(gui): dsh-client-hmr reload driver and the dshClient-discovered watch-build script
client-hmr is a normal plugin package composed into dev graphs only. It
listens on /plugins/events and reloads one plugin per rebuilt frame,
serialized: invalidate, prefetch (fresh factory registers while the old
fiber still serves), registry.delete before touching the fiber, drain
disposers, drop owned style tags, entry.refresh(), fiber.await() loud.
Dependency cascade costs zero client code — fiber activation epochs
re-load dependents through cordis itself. Reload is coarse by design;
no rollback in v1; self-reload works with a frame gap the next rebuild
heals.

scripts/dev-web.ts (pnpm run dev:web) is the convenience watch-build:
it discovers its package list by scanning packages/*/*/package.json for
dshClient platform "web" at startup — no hardcoded roster — and talks
no protocol to the host. Gate bookkeeping rides along: knip entries for
the new packages, README model-experience allowlist rows.
2026-07-24 02:09:42 +08:00