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-python/README.md
README.md: 7aea5ee4c031a36718e66a583762f61832596d04
README.zh.md: 778cc61ef28be616b8b0ed1ce8f0c9396143a768
README.md: b6016837319200c55766a03f279ae3acf441d19f
README.zh.md: 0ba03ecbcb6924ccbfbfcede52d26dcea698187d
@@ -73,7 +73,7 @@ Completion values and binding arguments cross as exact JSON: values serialize wi
| [`src/protocol.ts`](src/protocol.ts) | Host side: frame codec, hostile-frame validators, lossless-JSON meters, shared marker text |
| [`py/protocol.py`](py/protocol.py) | Python side: `PROTOCOL_FD`, `TypedDict` frame mirrors, `log_truncation_marker` |
| [`tests/protocol-mirror.e2e.ts`](tests/protocol-mirror.e2e.ts) | Cross-language mirror test against a real `python3` |
| [`src/invariant.ts`](src/invariant.ts) | Invariant companion (no runtime invariant; the package registers no mutable data relation) |
| — | No runtime invariant companion is published; this package ships only the fd-3 wire-protocol codec and its Python mirror, exposing no runtime event sequence or mutable data relation; `protocol.spec.ts` and `protocol-mirror.e2e.ts` cover the protocol's behavior. |
</details>
@@ -73,7 +73,7 @@ host 侧校验会静默丢弃垃圾,因此格式错误或伪造的帧绝不会
| [`src/protocol.ts`](src/protocol.ts) | host 侧:帧编解码、敌意帧校验器、无损 JSON 计量器、共享标记文本 |
| [`py/protocol.py`](py/protocol.py) | Python 侧:`PROTOCOL_FD``TypedDict` 帧镜像、`log_truncation_marker` |
| [`tests/protocol-mirror.e2e.ts`](tests/protocol-mirror.e2e.ts) | 对照真实 `python3` 的跨语言镜像测试 |
| [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件(无运行时不变式;本包不注册任何可变数据关系 |
| — | 不发布运行时不变式伴生入口;本包不注册任何可变数据关系 |
</details>
@@ -18,25 +18,18 @@
"types": "./lib/types/index.d.ts",
"default": "./lib/index.js"
},
"./invariant": {
"types": "./lib/types/invariant.d.ts",
"default": "./lib/invariant.js"
},
"./package.json": "./package.json"
},
"files": [
"lib/index.js",
"lib/invariant.js",
"py/**/*.py",
"lib/types/**/*.d.ts"
],
"license": "MIT",
"peerDependencies": {
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/cordis": "workspace:^"
},
"devDependencies": {
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/cordis": "workspace:^"
}
}
@@ -1,31 +0,0 @@
/**
* Package-owned invariant companion for `@deepseek-ai/dsh-code-runtime-python`.
* @module @deepseek-ai/dsh-code-runtime-python/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-python'
/** Cordis companion plugin name. */
export const name = 'code-runtime-python-invariant'
/** Service required before the companion can reserve package ownership. */
export const inject = ['invariants']
/**
* No runtime invariant: this package ships only the fd-3 wire-protocol codec and its Python mirror,
* exposing no runtime event sequence or mutable data relation; `protocol.spec.ts` and
* `protocol-mirror.e2e.ts` cover the protocol's behavior.
*/
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 */
@@ -13,9 +13,6 @@
},
{
"path": "../../../vendor/cordis"
},
{
"path": "../../runtime-diagnostics/invariants"
}
]
}
@@ -5,7 +5,7 @@ import { defineConfig } from 'tsdown'
* under `py/` (whitelisted in package.json `files`) — no build step needed.
*/
export default defineConfig({
entry: ['lib/types/index.js', 'lib/types/invariant.js'],
entry: ['lib/types/index.js'],
outDir: 'lib',
format: ['esm'],
platform: 'node',