test: drop obsolete streamparser dependency (#31835)

This commit is contained in:
Neil
2026-10-21 22:19:46 -07:00
committed by GitHub
parent f9c9cedad3
commit b342d29cc1
3 changed files with 15 additions and 45 deletions
-1
View File
@@ -237,7 +237,6 @@
"@sanity/diff-match-patch": "^3.2.1",
"@shadcn/lint": "~0.1.5",
"@stablyai/playwright-test": "^2.1.16",
"@streamparser/json": "0.0.26",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/react-virtual": "^3.14.13",
"@testing-library/jest-dom": "^6.9.1",
-8
View File
@@ -313,9 +313,6 @@ importers:
'@stablyai/playwright-test':
specifier: ^2.1.16
version: 2.1.16(@playwright/test@1.63.0(electron@43.7.8(supports-color@7.2.0)))(zod@4.6.7)
'@streamparser/json':
specifier: 0.0.26
version: 0.0.26
'@tailwindcss/vite':
specifier: ^4.3.3
version: 4.3.3(vite@8.3.4(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))
@@ -3164,9 +3161,6 @@ packages:
'@types/playwright__test':
optional: true
'@streamparser/json@0.0.26':
resolution: {integrity: sha512-46597LNFI+MFdUnzX2QJWwmdTRdq0XVD+vVNJTtGVzIrnCuhG9pFo1OAzbNBqci8UJgk/X5KJZ6LcV+y7PTuDQ==}
'@swc/core-darwin-arm64@1.16.2':
resolution: {integrity: sha512-i/j0HNbnn79qnTVPicvay92Nark8fW8NQqn1e2mGERjUXNpBV0+SwQxlRpk2zBhn6laJ8PDI6Kn1nHZhnz3LCA==}
engines: {node: '>=10'}
@@ -10211,8 +10205,6 @@ snapshots:
- '@types/zod'
- zod
'@streamparser/json@0.0.26': {}
'@swc/core-darwin-arm64@1.16.2':
optional: true
@@ -300,47 +300,26 @@ describe('release checkout materialization', () => {
expect(relative(cacheRoot, checkout.root)).not.toMatch(/^\.\./)
}, 180_000)
// Keep @streamparser/json in root devDependencies: v1.4.221's dense parser imports it.
// Default cache root: package resolution must walk up into the repo's node_modules.
it('runs the released dense parser with its retained test dependency', async () => {
// Default cache root lets released source resolve packages from the repo's node_modules.
it('runs a released schema with an existing package dependency', async () => {
const checkout = await materializeReleaseCheckout('v1.4.221')
const ripgrep = await importReleaseCheckoutModule(
const schema = await importReleaseCheckoutModule(
checkout,
'/src/shared/ripgrep-dense-match-json.ts'
'/src/shared/agent-session-context-usage-schema.ts'
)
const callExport = (name: string, ...args: unknown[]): unknown => {
const exported = ripgrep[name]
if (typeof exported !== 'function') {
throw new Error(`v1.4.221 ripgrep-dense-match-json has no ${name} export`)
}
return exported(...args)
const isAdmissible = schema.isAdmissibleAgentSessionContextUsage
if (typeof isAdmissible !== 'function') {
throw new Error('v1.4.221 has no isAdmissibleAgentSessionContextUsage export')
}
const limits = { structuralTokens: 64, nestingDepth: 8 }
expect(callExport('parseRipgrepMatchJson', '{"type":"match"}', 1, limits)).toEqual({
type: 'match'
})
expect(callExport('parseDenseRipgrepMatchJson', '{"type":"match"}', 1, 8)).toEqual({
type: 'match',
data: { submatches: [] }
})
const match = {
type: 'match',
data: {
path: { text: 'src/example.ts' },
lines: { text: 'hit hit\n' },
line_number: 7,
submatches: [
{ start: 0, end: 3 },
{ start: 4, end: 7 }
]
}
}
expect(callExport('parseDenseRipgrepMatchJson', JSON.stringify(match), 1, 8)).toEqual({
...match,
data: { ...match.data, submatches: [{ start: 0, end: 3 }] }
})
expect(() => callExport('parseDenseRipgrepMatchJson', '{"type":', 1, 8)).toThrow()
expect(
isAdmissible({
window: { tokens: 200_000, capturedAt: 1 },
used: { kind: 'unknown', capturedAt: 1 }
})
).toBe(true)
expect(isAdmissible({ window: { tokens: 0, capturedAt: 1 } })).toBe(false)
expect(isAdmissible({ used: { kind: 'invalid', capturedAt: 1 } })).toBe(false)
}, 180_000)
it('keeps an import live while another colliding release label materializes', async () => {