43 Commits
Author SHA1 Message Date
imccyu b2b3bf4568 fix(typert): reject ambiguous and multiple default resource identities 2026-10-23 16:13:38 +08:00
Tianyi Cui 4d33f27225 Prepare metadata in public library builds 2026-10-18 14:29:23 +08:00
imccyu a18488955d docs: sync subsystem docs and regenerate catalogs 2026-10-13 23:03:15 +08:00
imccyu 8a6c68fc34 docs: state review-requested invariants and current command names
gen-doc-graphs states that its probe memo patches the system and needs a synchronous, non-nested caller; the typecheck graph comments why host-check does not wait for host-typert; the API gateway guide names the CI build lanes as the bundling Typert path; and the build-split Note marks its host-libraries measurement as superseded by host-contracts.

Refs #5852
2026-10-12 11:06:56 +08:00
imccyu 04af9a1df7 perf(build): generate Typert contracts without bundling for typecheck and lint
Type checks only need Host declarations and Typert-generated
declarations, but typecheck, lint, lint:fix, doc-typecheck, and the CI
typert-contracts gate rebuilt the whole Host tsdown pass, Desktop bundle
included, to obtain them. A source-only scripts/generate-typert.ts now
runs the same generator and artifact writer as the tsdown plugin, beside
Host package compilation: Typert reads only sources once the missing
@deepseek-ai/dsh-client-file-upload/types path alias exists, and
rejectBuildOutputs fails the pass when a workspace lib/ declaration
enters its program. typecheck runs as a build.ts scope that checks both
aggregates in build mode after their own face compiles.

Refs #5852
2026-10-12 11:06:49 +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
imccyu 32aba5ea37 docs: address review comments on the rules directory
- package-surface: split the two plugin forms (a function plugin named-exports
  the Loader four, a service plugin default-exports its class), keep Host
  Service Definition exports and the Client `/client` export discipline, replace
  the wrong example that quoted live production code, state that the static
  client libraries and `packages/util/*` are closed to new members, and drop
  census numbers that rot on the next package.
- client-components: use the real Slot API — the inject face with the reserved
  `hooks` compartment, the parent's derived `renderSlot`, `registerFactory`
  scope declarations with local components at `renderFactorySlot` — drop the
  string seat, pass the injected `useResource` explicitly with a protocol key,
  and describe persistence as the spec's framework-run `persist` key.
- conversation-and-session: rewrite the reasoning example on the real
  `conversation.chat.reasoning.body` seat and the published `reasoning.content`
  Factory, and drop status annotations and future-tense spec-speak.
- remote-and-api: scope the JSON requirement to the wire payload so
  `@Remote({ mode: 'stream' })`, lookup arguments, and a trailing `AbortSignal`
  stay valid; drop a leaked Chinese parenthetical from the English page.
- general: measure through `benchmarks/` (`test:bench`, `check:ci:bench`,
  `test:bench:memory`) instead of an invented command, state the baseline
  without presuming a hook, and drop a leaked exception line.
- api-gateway: link the Remote and API rules instead of restating them.
- development.zh and AGENTS: drop an orphan anchor and widen the standing
  order's trigger to the directory's scope.

The earlier "retired routing skill" claim was wrong and is dropped: that skill
was never committed, so the diff deletes nothing under `.agents/skills/`.
2026-10-09 23:03:57 +08:00
imccyu 73dbbb751c docs: give architecture review rules a per-artifact home
Move `docs/defensive-patterns.md` into `docs/defensive-patterns/`, one page per
artifact plus a README router, and state each rule as its requirement, the
condition a reviewer judges it by, its boundary and approver, and a correct and
a wrong example.

- `general.md` (the moved page): the existing bug-class rules plus timing,
  value representation, shared-state ownership, decentralization, performance
  evidence, and migrations.
- `package-surface.md`, `remote-and-api.md`, `client-components.md`,
  `conversation-and-session.md`: the review requirements for those artifacts,
  linking type definitions and semantics to `docs/subsystems/` instead of
  restating them.
- `README.md`: the habits behind the rules and the route from artifact to page.
- `dsh-code-review` reads the owning pages before judging a diff; the
  `dsh-architecture-discipline` routing skill is retired in favour of the
  directory, and every inbound reference is repaired.
- Chinese counterparts, pairing records, and the documentation tier table are
  updated together.
2026-10-09 23:03:56 +08:00
winewill 4e41ccadcc build(desktop): check every import record and mirror the bundle step in the wine gate
The packaged-imports plugin moves from generateBundle to moduleParsed so
external dynamic import() and require() targets, which chunk metadata
omits, fail the bundle too. Each bundle now carries an import policy:
the main process allows Node builtins, sandboxed preloads only the
modules Electron's require polyfill resolves, and the failure names the
importing module and the allowed set. The wine Windows gate bundles
apps/desktop after the Host tsdown pass like build:lib:host, the
ts-build-config note lists that step, and the tsdown docs name the
workspace match exactly.

Fixes #4993
2026-09-23 12:03:48 +08:00
winewill 06717aebbb build(desktop): bundle the main process after the workspace tsdown pass
The root tsdown workspace pass builds every member concurrently, so the
Desktop main bundle could resolve its inlined workspace devDependencies
(dsh-home-paths, dsh-app-boot, dsh-deepseek-account) before their lib/
output existed. rolldown then kept them as external imports, which the
asar does not ship, and the packaged application failed at launch with
ERR_MODULE_NOT_FOUND on a clean checkout; stale lib/ output on long-lived
checkouts hid the defect.

apps/desktop leaves the root workspace list and build:lib:host bundles it
after the Host pass. Every Desktop bundle now runs a rolldown plugin that
fails the build when a chunk imports a bare specifier the packaged
application cannot resolve: electron and the manifest dependencies for
the main bundle, electron alone for sandboxed preloads.
2026-09-22 20:11:51 +08:00
Yudong Han e98b5703c7 refactor(api): move Remote result projection to gateway 2026-09-21 12:50:42 +08:00
Yudong ecf6acfb15 feat(api): support binary fields in Remote results 2026-09-21 12:50:40 +08:00
imccyu ffea3c8818 fix(gateway): close the remaining uplink lifecycle gaps 2026-09-20 17:53:18 +08:00
imccyu 35602063d7 refactor(typert): name the client stream handle RemoteStreamHandle everywhere 2026-09-20 17:53:17 +08:00
imccyu 089004c418 test(gateway): cover the Remote uplink and document it
Tests bring the changed sources to full per-file coverage, the READMEs and
docs describe the uplink, the invocation context, and the Peer registry in
both languages, and the generated catalogs are refreshed.
2026-09-20 17:53:17 +08:00
imccyu 021bd03b70 feat(gateway): let every Remote stream carry a client uplink
Every Typert Remote stream accepts client-to-Host items on the same
logical stream. A method declares the uplink item type in its return
type, RemoteStream<Out, In>, and reads the items through
this.ctx.invocation.uplink(); the invocation also carries the calling
Peer. Client generated methods return a handle that iterates the
downlink and exposes send/end/dispose for the uplink.
2026-09-20 17:53:16 +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
imccyu 7c74636892 perf(api-gateway): avoid duplicate client input parsing 2026-09-15 20:45:49 +08:00
imccyu 795d8ec985 docs: describe runtime dependency ownership 2026-08-30 02:29:53 +08:00
imccyu 73a723f37f docs(api): correct the api-gateway reference codes and the failure-vocabulary note
- api-gateway reference (en/zh): gateway/lookup-unavailable and
  gateway/internal replace the pre-convergence codes, and the resolver
  paragraph states the RemoteError pass-through semantics.
- failure-vocabulary note (en/zh): the package is dsh-util-time, the
  marker is isDSHRemoteError, and discrimination requires no
  instanceof at all.
2026-08-29 03:12:46 +08:00
imccyu e57e7c3f25 docs(api): describe Connection-owned transport 2026-08-27 22:26:30 +08:00
Magolor 0b5eba0c8d docs: rebuild the documentation skill and standards (#2983) 2026-08-25 23:47:20 +08:00
imccyu dc92793f10 fix(client): align domain split with repository gates 2026-08-23 16:28:19 +08:00
Tianyi Cui a2d0f7f411 refactor: apply repository naming contract
Apply the accepted pre-release package, service, type, directory, and role renames as one repository-wide change.
2026-08-13 00:54:38 +08:00
xjt ce883ffea3 Merge remote-tracking branch 'origin/master' into docs/post-v3-release-proofreading
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-20-generic-long-running-tool-runtime.i18n.yaml
#	.agents/notes/implemented/architecture/2026-06-20-generic-long-running-tool-runtime.zh.md
#	README.i18n.yaml
#	README.zh.md
#	scripts/snapshots/translation-prompt-v4/request-response.expected.json
2026-08-12 16:45:48 +08:00
Turtle 4c49e7109b fix(cli): separate dsh from repository build 2026-08-12 15:37:03 +08:00
xjt 4806d94715 docs(i18n): include complete proofreading corpus 2026-08-12 12:30:19 +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
Turtle ee9465e4b3 build before source dsh launch 2026-08-11 11:22:08 +08:00
Turtle 34abf69730 cleanup: remove managed source installer 2026-08-11 11:22:08 +08:00
imccyu ec601ca13d build(vendor): rescope the vendored Cordis packages into @deepseek-ai
Machine-produced by `pnpm run rescope-vendor --apply` plus the regeneration it
prints: `pnpm install` for the lockfile, `pnpm run gen-third-party-notices`,
`verify-translation-pairing --write` for the touched bilingual pairs,
`gen-doc-graphs`, and one typert snapshot whose ids embed character offsets.
`pnpm run rescope-vendor --check` verifies the result.

Renames nine vendored packages (cordis, cosmokit, schemastery and the six
@cordisjs plugins) and every reference that resolves them: manifest names and
dependency keys, module specifiers including declare-module merges, cordis.yml
plugin names, tsconfig paths, every Markdown fence, and `docs/` prose.
Directory names, upstream versions, and dependency ranges are unchanged, so
vendor/README.md still reads as an upstream snapshot; its manifest table gains
an upstream-name column so THIRD_PARTY_NOTICES keeps MIT attribution pointed
at each fork's origin.

The tutorial tier follows the rename end to end: its yaml fences named plugins
the Loader can no longer resolve, its `ts ignore-check` fences disagreed with
the compiled fences beside them, and its prose quoted both. The contracts that
told readers to keep upstream names — the root convention and the vendoring
cookbook's tree comment and manifest invariant — now say to rescope instead.

Two rules read `@deepseek-ai/` as "another workspace plugin": the client bundle
purity gate now names the vendored libraries a browser bundle inlines, and the
files where a bare `cordis` is an agent-preset id keep that product data.
2026-08-10 22:04:13 +08:00
imccyu 854f6623bb docs: rename client manifest field references 2026-08-10 21:11:09 +08:00
Turtle a27efdef36 docs: make technical prose concrete 2026-08-10 16:34:20 +08:00
Tianyi Cui 25dcd7293c docs: purge chain-of-thought leakage from prose
Delete design-session citations (decision/audit/plan ordinals, stack
positions), change narration, review choreography, and reviewer-addressed
justification from comments, JSDoc, docs, READMEs, Agent Notes, tests, and
generator templates; restate every affected fact as current-state contract
prose. Fix generated docs at their sources and regenerate the catalogs and
cordis-surface regions; re-paste type-equiv blocks; update every bilingual
counterpart and re-record the pairs. Record the citation rule in the
committed-artifact-citations Agent Note.
2026-08-09 21:10:59 +08:00
xjt a7af54a8d3 docs(i18n): standardize contract terminology 2026-08-09 11:33:14 +08:00
imccyu 2a7c1175be fix(docs): keep doc typecheck on Host sources 2026-08-08 11:52:18 +08:00
imccyu 8865548ee2 docs: explain generated Remote build order 2026-08-08 04:20:39 +08:00
imccyu 71ebeaa559 fix(client-runtime): localize remote namespace dependency 2026-08-07 21:47:18 +08:00
imccyu d362cdb54f refactor(typert): rename RemoteContext to RemoteScope 2026-08-07 21:47:18 +08:00
imccyu d6ffd87c5f refactor(api): expose traced remote namespaces 2026-08-07 21:47:18 +08:00
imccyu bb61dc13f2 refactor(api): colocate gateway and remote assembly 2026-08-07 21:47:17 +08:00
imccyu d941350227 fix(typert): preserve remote lookup semantics 2026-08-07 21:47:17 +08:00
imccyu 2f619b1b88 docs: document TypeRT API-Gateway 2026-08-07 21:47:15 +08:00