Merge branch 'master' of https://github.com/deepseek-harness/deepseek-harness into xtr/react-loop-simplification

# Conflicts:
#	.agents/notes/implemented/feature/2026-07-17-dedicated-full-screen-tui-front-door.i18n.yaml
#	docs/architecture.i18n.yaml
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	docs/core-data-structures/core.md
#	docs/core-data-structures/core.zh.md
#	docs/core-data-structures/llm-streaming.i18n.yaml
#	docs/core-data-structures/llm-streaming.md
#	docs/core-data-structures/llm-streaming.zh.md
#	docs/core-data-structures/session.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-loop/README.i18n.yaml
#	packages/core/agent-loop/src/agent.ts
#	packages/core/agent/README.i18n.yaml
#	packages/core/session/README.i18n.yaml
#	packages/core/session/src/types.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/llm/llm/README.md
#	packages/llm/llm/README.zh.md
#	packages/llm/llm/src/index.ts
#	packages/llm/llm/tests/service.spec.ts
#	packages/sdk/sdk-client/README.i18n.yaml
#	packages/sdk/sdk-protocol/README.i18n.yaml
#	packages/sdk/sdk-protocol/README.md
#	packages/sdk/sdk-protocol/README.zh.md
#	packages/subagent/subagent-dsh-sdk/README.i18n.yaml
#	packages/ui/jsonrpc/README.i18n.yaml
#	packages/ui/jsonrpc/README.md
#	packages/ui/jsonrpc/README.zh.md
#	packages/ui/tui/src/index.ts
#	python/sdk/README.i18n.yaml
#	scripts/gen-cordis-catalog.ts
This commit is contained in:
_Kerman
2026-07-31 10:16:14 +08:00
1106 changed files with 33236 additions and 7168 deletions

View File

@@ -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/llm-replay/README.md
README.md: 6c934e01a5f13b94724d0e5435524d9d463adb2f
README.zh.md: d13d84ad95a6b63177ee0e2aa83965be19fdeeb8
README.md: 0deb6e76b29d40483b754ac01c98ee0e01bfcbe8
README.zh.md: 7720e2d1bc6eb7bc5c89d5c1708767a54a7b0080

View File

@@ -33,7 +33,7 @@ Replay keys every call by its calling session id (`GenerateOptions.sessionId`, s
name: '@deepseek-ai/dsh-llm-replay'
config:
providers:
- id: deepseek
- id: deepseek-official
name: DeepSeek
retryPolicy:
mode: normal

View File

@@ -33,7 +33,7 @@ fixture 就是持久化的会话日志(`<scenario>/session.jsonl`)。其 `as
name: '@deepseek-ai/dsh-llm-replay'
config:
providers:
- id: deepseek
- id: deepseek-official
name: DeepSeek
retryPolicy:
mode: normal

View File

@@ -141,6 +141,13 @@ export interface LoaderSmokeOptions {
readonly prepare?: (cwd: string) => Promise<void> | void
/** Optional world-state assertion run in the isolated cwd before cleanup. */
readonly inspect?: (cwd: string) => Promise<void> | void
/**
* Exact process exit code this smoke expects; defaults to `0`. Scenarios
* pinning a designed failure surface (a one-shot turn ending in an error
* result) declare its nonzero exit here, and a run that exits any other
* way — including succeeding — still fails the smoke.
*/
readonly expectedExitCode?: number
}
/** Captured output from a Loader smoke that exited successfully. */
@@ -187,8 +194,9 @@ export async function runLoaderSmoke(options: LoaderSmokeOptions): Promise<Loade
if (result.timedOut) {
throw new Error(`${options.label} did not exit within ${processTimeoutMs / 1_000}s. stdout:\n${result.stdout}\nstderr:\n${result.stderr}`)
}
if (result.failed) {
throw new Error(`${options.label} exited ${String(result.exitCode)}. stdout:\n${result.stdout}\nstderr:\n${result.stderr}`)
const expectedExitCode = options.expectedExitCode ?? 0
if (result.exitCode !== expectedExitCode) {
throw new Error(`${options.label} exited ${String(result.exitCode)} (expected ${expectedExitCode}). stdout:\n${result.stdout}\nstderr:\n${result.stderr}`)
}
await options.inspect?.(cwd)
return { stdout: result.stdout, stderr: result.stderr }

View File

@@ -74,7 +74,32 @@ describe('runLoaderSmoke', () => {
libBinScript: fixture('fail'),
configPath,
tsconfigPath,
})).rejects.toThrow('failure fixture exited 7. stdout:\n\nstderr:\nfixture failed')
})).rejects.toThrow('failure fixture exited 7 (expected 0). stdout:\n\nstderr:\nfixture failed')
})
it('accepts a declared expected failure exit and rejects any other outcome', async () => {
// A scenario pinning a designed failure surface declares its exit code…
const declared = await runLoaderSmoke({
label: 'declared failure fixture',
tempDirPrefix: 'loader-smoke-declared-fail-',
binScript: fixture('fail'),
libBinScript: fixture('fail'),
configPath,
tsconfigPath,
expectedExitCode: 7,
})
expect(declared.stderr).toBe('fixture failed\n')
// …and a run that succeeds instead still fails the smoke.
await expect(runLoaderSmoke({
label: 'unexpectedly clean fixture',
tempDirPrefix: 'loader-smoke-clean-',
binScript: fixture('success'),
libBinScript: fixture('success'),
configPath,
tsconfigPath,
expectedExitCode: 7,
})).rejects.toThrow(/exited 0 \(expected 7\)/)
})
it('kills a process at its deadline and reports captured output', async () => {