Merge branch 'master' into feat/read-image-context
# Conflicts: # docs/module-graph.i18n.yaml # docs/module-graph.md # docs/module-graph.zh.md
This commit is contained in:
@@ -436,7 +436,7 @@ export function formatToolSchemasSnapshot(initial: readonly unknown[], changes:
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and validate the stable top-level shape of a tool-schema sidecar.
|
||||
* Parse and validate the stable top-level fields of a tool-schema sidecar.
|
||||
*
|
||||
* @param snapshot The JSON sidecar text.
|
||||
* @returns Its initial and changed-header schema sets.
|
||||
|
||||
@@ -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/support/invariants/README.md
|
||||
README.md: 71f7fb8b913610aad03694effad7746c0cb16499
|
||||
README.zh.md: ce2fc593a294a7f870bb42faa980fab462348e3b
|
||||
README.md: 9a93187032b6f8e4f5d89e17e742baba41196ff9
|
||||
README.zh.md: 7f3fa1e23337e55a73928c3952aa4c925a5fb4e9
|
||||
|
||||
@@ -30,7 +30,7 @@ Session itself owns immutable, surface-valid log storage in every composition: i
|
||||
|
||||
Publication and registration are exhaustive; runtime assertions are deliberately not synthetic. A companion installs a check only when its package owns an observable event relationship or relevant mutable-data relationship. Confirming a required method, plugin name, injection, effect, or fixed pure-function result is a type, load, or unit-test concern rather than a runtime invariant.
|
||||
|
||||
When no plausible runtime relationship exists, the companion uses an empty installer with a package-specific leading `No runtime invariant:` comment explaining why. This is common for pure utilities, thin implementations whose behavior is already observed through their seam, composition-only packages, binaries, persistence adapters whose contracts require crash/round-trip tests, and test-support packages. The explanation must be revisited when the owner gains mutable state or an event protocol.
|
||||
When no plausible runtime relationship exists, the companion uses an empty installer with a package-specific leading `No runtime invariant:` comment explaining why. This is common for pure utilities, thin implementations whose behavior is already observed through their interface package, composition-only packages, binaries, persistence adapters whose contracts require crash and round-trip tests, and test-support packages. The explanation must be revisited when the owner gains mutable state or an event protocol.
|
||||
|
||||
The current executable companions protect these relationships:
|
||||
|
||||
@@ -66,7 +66,7 @@ ctx.plugin(InvariantService, {
|
||||
ctx.plugin(SessionInvariant)
|
||||
```
|
||||
|
||||
The standard agent spine mounts the service and its four core stateful companions. Custom compositions explicitly add companions for other loaded packages whose contracts they want checked; filters can disable or select registrations without changing package entrypoints.
|
||||
The standard agent composition mounts the service and its four core stateful companions. Custom compositions explicitly add companions for other loaded packages whose contracts they want checked; filters can disable or select registrations without changing package entrypoints.
|
||||
|
||||
Every ordinary Vitest topology mounts an explicitly enabled service and the current test package's companion. Focused suites cover valid and invalid observations for executable companions, while one exhaustive topology mounts all companions to prove registration and disposal wiring.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ interface Config {
|
||||
|
||||
发布和注册覆盖全部包;但不会为了覆盖全部包而人为编造运行时断言。只有当包拥有可观察事件关系或相关可变数据关系时,配套入口才安装检查。确认必需方法、插件名称、注入、effect 或固定纯函数结果属于类型、加载或单元测试关注点,而非运行时不变量。
|
||||
|
||||
如果不存在合理的运行时关系,配套入口使用空 installer,并以包专用的前置 `No runtime invariant:` 注释说明原因。纯工具、行为已通过 seam 观察的薄实现、仅组合包、二进制程序、约定需要崩溃/往返测试的持久化适配器和测试支持包通常属于此类。当 owner 获得可变状态或事件协议时,必须重新审视该说明。
|
||||
如果不存在合理的运行时关系,配套入口使用空 installer,并以包专用的前置 `No runtime invariant:` 注释说明原因。纯工具、行为已通过其接口包观察的薄实现、仅组合包、二进制程序、需要通过崩溃测试和往返测试验证其约定的持久化适配器和测试支持包通常属于此类。当 owner 获得可变状态或事件协议时,必须重新审视该说明。
|
||||
|
||||
当前可执行配套入口保护以下关系:
|
||||
|
||||
@@ -66,7 +66,7 @@ ctx.plugin(InvariantService, {
|
||||
ctx.plugin(SessionInvariant)
|
||||
```
|
||||
|
||||
标准 agent 主干挂载服务和 4 个核心有状态配套入口。自定义组合为希望检查其约定的其他已加载包显式添加配套入口;过滤器可以在不改变包入口的情况下禁用或选择注册。
|
||||
标准 agent 组合挂载服务和 4 个核心有状态配套入口。自定义组合为希望检查其约定的其他已加载包显式添加配套入口;过滤器可以在不改变包入口的情况下禁用或选择注册。
|
||||
|
||||
每个普通 Vitest 拓扑都挂载显式启用的服务和当前测试包的配套入口。聚焦套件覆盖可执行配套入口的合法与违规观测,一个穷尽拓扑则挂载全部配套入口,以证明注册和 dispose 接线。
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ const REPLAY_CHUNK_TYPES = new Set<StreamChunk['type']>([
|
||||
const FROM_REQUEST_OPEN = '{{fromRequest:'
|
||||
const FROM_REQUEST_CLOSE = '}}'
|
||||
|
||||
/** Collect every string leaf of one JSON-shaped value, in traversal order. */
|
||||
/** Collect every string leaf of one JSON-compatible value, in traversal order. */
|
||||
function collectStrings(value: unknown, out: string[]): void {
|
||||
if (typeof value === 'string') {
|
||||
out.push(value)
|
||||
@@ -336,7 +336,7 @@ function substituteString(text: string, corpus: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
/** Deep-copy one JSON-shaped value with scripted placeholders resolved. */
|
||||
/** Deep-copy one JSON-compatible value with scripted placeholders resolved. */
|
||||
function substituteValue(value: unknown, corpus: string): unknown {
|
||||
if (typeof value === 'string') {
|
||||
return value.includes(FROM_REQUEST_OPEN) ? substituteString(value, corpus) : value
|
||||
|
||||
Reference in New Issue
Block a user