Merge remote-tracking branch 'origin/master' into codex/pr335-merge-master-20260719

# Conflicts:
#	packages/support/acp-snapshot/README.md
#	packages/support/acp-snapshot/src/harness.ts
#	packages/support/acp-snapshot/src/suite.ts
#	packages/support/acp-snapshot/tests/harness.spec.ts
#	packages/support/acp-snapshot/tests/suite.spec.ts
This commit is contained in:
Tianyi Cui
2026-07-19 11:41:10 +08:00
330 changed files with 7947 additions and 4450 deletions

View File

@@ -4,7 +4,7 @@ The `Branded<B>` nominal-typing primitive — a tiny, **type-only** package (no
## What `Branded` is
A brand makes structurally-identical strings non-interchangeable at the type level: an `AgentId` cannot be passed where a `CallId` is expected, even though both are plain `string`s at runtime.
A brand makes structurally-identical strings non-interchangeable at the type level: a `SessionId` cannot be passed where a `CallId` is expected, even though both are plain `string`s at runtime.
```ts
import type { Branded } from '@deepseek-ai/dsh-brand'
@@ -21,6 +21,6 @@ Construction goes through the per-id factory in the owning package. Comparison,
## Policy: brand ids that cross package boundaries
A package brands the ids it owns — `CallId` in `dsh-llm`, `SessionId` in `dsh-session`, `AgentId` in `dsh-agent`, and `TaskId` in `dsh-tasks`. Brand cross-package ids that could plausibly be confused; not every string needs one.
A package brands the ids it owns — `CallId` in `dsh-llm`, the shared agent/session `SessionId` in `dsh-session`, and `TaskId` in `dsh-tasks`. Brand cross-package ids that could plausibly be confused; not every string needs one.
This package owns only the primitive. Keeping it dependency-free lets `dsh-tasks`, for example, brand `TaskId` without importing an unrelated capability package merely to reach `Branded`.

View File

@@ -4,13 +4,13 @@
* cross-boundary id.
*
* A brand makes structurally-identical strings non-interchangeable at the type
* level: an `AgentId` cannot be passed where a `CallId` is expected, even
* level: a `SessionId` cannot be passed where a `CallId` is expected, even
* though both are plain strings at runtime. Construction goes through a per-id
* factory in the OWNING package (a plain cast inside — zero runtime cost);
* comparison, logging, and serialization all behave as ordinary strings.
*
* Policy: a package brands the ids it owns — `CallId` in dsh-llm (tool-call
* correlation), `SessionId` in dsh-session, `AgentId` in dsh-agent, and
* correlation), the shared agent/session `SessionId` in dsh-session, and
* `TaskId` in dsh-tasks. Branding is for ids that cross package boundaries and
* could plausibly be confused; not every string needs a brand.
* This package owns ONLY the primitive — no concrete id, no runtime code beyond