Files
deepseek-harness/scripts/check-workspace-constraints.spec.ts
T
Tianyi Cui 1d4dcf3b57 refactor(python): remove the private direct-config carrier
Delete @deepseek-ai/dsh-sdk-python-runtime and its packaged-bin entry now that Python uses the repository's dsh application launcher. Remove the package's project reference, Knip entry, workspace-policy exception, executable allowlist entry, and README-model classification together so no tooling preserves the old exception.

This commit is deliberately mechanical: it removes the obsolete package and gate accommodations without introducing the replacement launch behavior. The following commits add the packaged dsh runtime and Python profile API, keeping the architecture change separate from deletion noise.
2026-08-24 17:28:26 +08:00

77 lines
2.9 KiB
TypeScript

/** Experimental-package publication and dependency constraints. */
import { describe, expect, it } from 'vitest'
import {
checkExperimentalDependencyIsolation,
checkExperimentalManifest,
type WorkspaceManifest,
} from './check-workspace-constraints.ts'
const experimental: WorkspaceManifest = {
dir: 'packages/experimental/prototype',
manifest: { name: '@deepseek-ai/dsh-experimental-prototype', private: true },
}
describe('experimental workspace constraints', () => {
it('requires the experimental package-name prefix', () => {
expect(checkExperimentalManifest({
...experimental,
manifest: { ...experimental.manifest, name: '@deepseek-ai/dsh-prototype' },
})).toEqual([
'@deepseek-ai/dsh-prototype: experimental package name must start with "@deepseek-ai/dsh-experimental-"',
])
})
it('requires private manifests without publication metadata', () => {
expect(checkExperimentalManifest(experimental)).toEqual([])
expect(checkExperimentalManifest({
...experimental,
manifest: { ...experimental.manifest, private: false, publishConfig: { access: 'public' } },
})).toEqual([
'@deepseek-ai/dsh-experimental-prototype: experimental package must set "private": true',
'@deepseek-ai/dsh-experimental-prototype: experimental package must omit publishConfig',
])
})
it.each(['dependencies', 'optionalDependencies', 'peerDependencies'] as const)(
'rejects release %s on an experimental package',
(section) => {
expect(checkExperimentalDependencyIsolation([experimental, {
dir: 'packages/core/consumer',
manifest: {
name: '@deepseek-ai/dsh-consumer',
[section]: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}])).toEqual([
`@deepseek-ai/dsh-consumer: ${section}.@deepseek-ai/dsh-experimental-prototype must not reference an experimental package`,
])
},
)
it('allows development and experimental consumers but rejects the Python release runtime', () => {
const manifests: WorkspaceManifest[] = [experimental, {
dir: 'packages/core/test-only',
manifest: {
name: '@deepseek-ai/dsh-test-only',
devDependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}, {
dir: 'packages/experimental/consumer',
manifest: {
name: '@deepseek-ai/dsh-experimental-consumer',
dependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}, {
dir: 'python/sdk-runtime',
manifest: {
name: '@deepseek-ai/dsh-python-runtime',
dependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}]
expect(checkExperimentalDependencyIsolation(manifests)).toEqual([
'@deepseek-ai/dsh-python-runtime: dependencies.@deepseek-ai/dsh-experimental-prototype must not reference an experimental package',
])
})
})