cleanup: omit unneeded invariant companions

This commit is contained in:
Turtle
2026-08-28 13:12:52 +08:00
parent 6d38ba8656
commit 15f2997bcb
1407 changed files with 1986 additions and 11398 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/code-runtime/code-runtime-worker-thread/README.md
README.md: 683a774b00a2305b0489a62b1b33f9d20dddffe8
README.zh.md: 34b828081ebbde7fea70f4dd409e2980c6942eea
README.md: 38c977ca3b387b4d8e5e9fb998a202a21a6d2415
README.zh.md: 30825aa81a268ea0c61021e98eb0cb8237a3a756
@@ -100,7 +100,7 @@ Two independent budgets exist because the peer is hostile: `computeMs` meters th
| [`src/protocol.ts`](src/protocol.ts) | Port message vocabulary between host and worker |
| [`src/worker-json.ts`](src/worker-json.ts) | Worker-side lossless-JSON encode/decode |
| [`src/output-json.ts`](src/output-json.ts) | Byte metering and truncation for the outer ledger |
| [`src/invariant.ts`](src/invariant.ts) | Invariant companion (no runtime invariant; see its reason) |
| — | No runtime invariant companion is published; this process-boundary implementation exposes no same-process event relation; worker protocol and built-worker tests cover it. |
### The worker entry, unbuilt and built
@@ -100,7 +100,7 @@ kind: "package-reference"
| [`src/protocol.ts`](src/protocol.ts) | host 与 worker 之间的端口消息词汇 |
| [`src/worker-json.ts`](src/worker-json.ts) | worker 侧无损 JSON 编解码 |
| [`src/output-json.ts`](src/output-json.ts) | 外层账本的字节计量与截断 |
| [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件(无运行时不变式;理由见其说明) |
| — | 不发布运行时不变式伴生入口;本进程边界实现不暴露可在同一进程内对照的事件关系,worker 协议测试与构建后 worker 测试负责覆盖。 |
### 未构建与已构建的 worker 入口
@@ -18,10 +18,6 @@
"types": "./lib/types/index.d.ts",
"default": "./lib/index.js"
},
"./invariant": {
"types": "./lib/types/invariant.d.ts",
"default": "./lib/invariant.js"
},
"./worker": {
"types": "./lib/types/worker.d.ts",
"default": "./lib/worker.cjs"
@@ -30,14 +26,12 @@
},
"files": [
"lib/index.js",
"lib/invariant.js",
"lib/worker.cjs",
"lib/types/**/*.d.ts"
],
"license": "MIT",
"peerDependencies": {
"@deepseek-ai/dsh-code-runtime": "workspace:^",
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/dsh-session": "workspace:^",
"@deepseek-ai/dsh-timeout": "workspace:^",
"@deepseek-ai/cordis": "workspace:^"
@@ -47,7 +41,6 @@
},
"devDependencies": {
"@deepseek-ai/dsh-code-runtime": "workspace:^",
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/dsh-session": "workspace:^",
"@deepseek-ai/dsh-timeout": "workspace:^",
"@deepseek-ai/cordis": "workspace:^"
@@ -1,30 +0,0 @@
/**
* Package-owned invariant companion for `@deepseek-ai/dsh-code-runtime-worker-thread`.
* @module @deepseek-ai/dsh-code-runtime-worker-thread/invariant
*/
/* jscpd:ignore-start */
import type { Context } from '@deepseek-ai/cordis'
import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
const PACKAGE_NAME = '@deepseek-ai/dsh-code-runtime-worker-thread'
/** Cordis companion plugin name. */
export const name = 'code-runtime-worker-thread-invariant'
/** Service required before the companion can reserve package ownership. */
export const inject = ['invariants']
/**
* No runtime invariant: this process-boundary implementation exposes no same-process event relation;
* worker protocol and built-worker tests cover it.
*/
const install: InvariantInstaller = () => {}
/**
* Register this package's invariant companion.
* @param ctx - Cordis context carrying the invariant service.
* @returns the installed registration's disposer after setup succeeds.
*/
export const apply = (ctx: Context): Promise<() => void> =>
Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
/* jscpd:ignore-end */
@@ -23,9 +23,6 @@
{
"path": "../code-runtime"
},
{
"path": "../../runtime-diagnostics/invariants"
},
{
"path": "../../util/timeout"
}
@@ -7,7 +7,7 @@ import { defineConfig } from 'tsdown'
*/
export default defineConfig([
{
entry: ['lib/types/index.js', 'lib/types/invariant.js'],
entry: ['lib/types/index.js'],
outDir: 'lib',
format: ['esm'],
platform: 'node',