mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-14 04:01:35 +00:00
fix(session): validate seeded projection boundary
This commit is contained in:
@@ -199,8 +199,8 @@ export class SessionProjectionRegistry extends Service {
|
||||
constructor(ctx: Context) {
|
||||
super(ctx, 'sessionProjections')
|
||||
ctx.on('session/created', (session: Session) => {
|
||||
if (session.seq !== 0) return
|
||||
validateSeedLength(session.header, session.seq)
|
||||
if (session.seq !== 0) return
|
||||
for (const registration of this.registrations.values()) {
|
||||
if (registration.cells.has(session)) continue
|
||||
registration.cells.set(session, {
|
||||
|
||||
@@ -152,6 +152,10 @@ describe('SessionProjectionRegistry drive', () => {
|
||||
expect(() => ctx.sessions.create(undefined, {
|
||||
meta: { seedLength: 1 },
|
||||
})).toThrow(/seedLength 1 exceeds observed log length 0/)
|
||||
expect(() => ctx.sessions.create(undefined, {
|
||||
seed: [{ type: 'turn/start', seq: 0, time: 0, data: { turn: 1 } }],
|
||||
meta: { seedLength: 3 },
|
||||
})).toThrow(/seedLength 3 exceeds observed log length 2/)
|
||||
})
|
||||
|
||||
it('notifies onChanged with the validated view and the causing seq, and skips same-reference applies', async () => {
|
||||
|
||||
Reference in New Issue
Block a user