fix: validate compaction config pairs

This commit is contained in:
Yichen Jiang
2026-07-21 14:49:57 +08:00
parent b6f6c58435
commit 49a9bca9f6
8 changed files with 96 additions and 16 deletions

View File

@@ -80,7 +80,9 @@ declare module 'cordis' {
/** Replay owner for one service-wide estimator and isolated per-session folds. */
export class TokenMeterService extends Service {
static Config: z<TokenMeterConfig> = z.object({})
// Schemastery preserves untrusted loader keys on an empty object schema;
// the public type excludes settings while validateConfigKeys rejects them.
static Config: z<TokenMeterConfig> = z.object({}) as unknown as z<TokenMeterConfig>
private readonly states = new WeakMap<Session, ReplayState>()

View File

@@ -7,7 +7,7 @@
import type { TokenUsage } from '@deepseek-ai/dsh-llm'
/** Token-meter plugin configuration; the fixed estimator has no settings. */
export type TokenMeterConfig = object
export type TokenMeterConfig = Record<string, never>
/** The baseline from which a signed surface delta produces current pressure. */
export type TokenMeasurementBaseline =