ci: clear the snapshots-and-artifacts lane — lint sweep and TUI snapshot re-record

Lint: eslint --fix over the merge-crossed projection/command files (arrow
parens, trailing commas, unnecessary assertions), Extract<> replaces the
keyof-map & string intersections no-redundant-type-constituents rejects,
the fold-adapter's merge loop drops its non-null assertions for a
bounds-carrying cursor, one JSDoc line wrapped under max-len (api-catalog
regenerated). Snapshots: the four TUI goldens re-recorded for the merged
event-count shift (the durable command lifecycle adds one event to the
seeded diagnostics log). The headless advanced-toolchain snapshot passes
on CI and fails locally in this sandbox both with and without these
changes (30s child timeout — environment-bound, tracked in the ledger).
This commit is contained in:
imccyu
2026-07-28 11:48:01 +08:00
parent 5cb3b5595a
commit e2791107c4
16 changed files with 115 additions and 112 deletions

View File

@@ -80,7 +80,7 @@ export interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
*/
export type ProjectionChangeListener = (
session: Session,
key: keyof SessionProjectionMap & string,
key: Extract<keyof SessionProjectionMap, string>,
value: unknown,
seq: number,
) => void
@@ -165,7 +165,7 @@ export class SessionProjectionRegistry extends Service {
if (this.registrations.has(key)) {
throw new Error(`session projection key ${JSON.stringify(key)} is already registered`)
}
this.registrations.set(key, { def: definition as unknown as ErasedDefinition, cells: new WeakMap() })
this.registrations.set(key, { def: definition, cells: new WeakMap() })
yield () => {
this.registrations.delete(key)
}
@@ -203,7 +203,7 @@ export class SessionProjectionRegistry extends Service {
const cell = this.cellFor(registration, session)
values[registration.def.key] = registration.def.schema.parse(registration.def.view(cell.state))
}
return { asOfSeq: session.seq - 1, values: values as ProjectionSnapshot['values'] }
return { asOfSeq: session.seq - 1, values: values }
}
/** Fold one unit from init over `events`, producing a cell watermarked at the last folded event. */
@@ -240,7 +240,7 @@ export class SessionProjectionRegistry extends Service {
if (changed && this.listeners.size > 0) {
const value = registration.def.schema.parse(registration.def.view(next))
for (const listener of this.listeners) {
listener(session, registration.def.key as keyof SessionProjectionMap & string, value, event.seq)
listener(session, registration.def.key as Extract<keyof SessionProjectionMap, string>, value, event.seq)
}
}
}

View File

@@ -38,7 +38,7 @@ const marksUnit = (): ProjectionDefinition<'test/marks', MarksState> => ({
key: 'test/marks',
schema: z.object({ marks: z.array(z.string()) }),
init: () => null,
apply: (state, event) => (event.type === 'test/mark' ? (event as SessionEvent<'test/mark'>).data : state),
apply: (state, event) => (event.type === 'test/mark' ? (event).data : state),
view: state => state ?? { marks: [] },
stateVersion: 1,
})