docs(metrics): clarify projection and latency contracts

This commit is contained in:
imccyu
2026-08-06 00:22:09 +08:00
parent aaca2fa52f
commit a17eebcaca
8 changed files with 13 additions and 13 deletions

View File

@@ -59,8 +59,8 @@ interface TurnFold {
/**
* Fold assistant nodes into per-turn footer metrics.
*
* TTFT is the turn's lowest-step reading — the user-perceived wait before
* output appeared — so it is only meaningful when the turn's start is inside
* TTFT is the turn's lowest-step request-dispatch-to-first-token reading, so
* it is only meaningful when the turn's start is inside
* the loaded window (the caller gates on `turnTimings`, which shares that
* window). Throughput divides summed output tokens by summed decode wall time,
* counting only steps that carry both.

View File

@@ -1040,7 +1040,7 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [
},
{
signature: 'estimateMessage(message: Message): number',
jsDoc: '/**\n * Heuristically price one model-visible message (instance face of the pure\n * {@link estimateMessage}).\n * @param message - message to price without mutation.\n * @returns content and role-framing tokens under the fixed service heuristic.\n */',
jsDoc: '/**\n * Heuristically price one model-visible message (instance face of the pure\n * `estimateMessage` export from `estimate.ts`).\n * @param message - message to price without mutation.\n * @returns content and role-framing tokens under the fixed service heuristic.\n */',
},
],
},

View File

@@ -685,8 +685,8 @@ export class Session {
}
/**
* Instance face of the pure per-node projection rule
* {@link deriveEventMessage} (see its contract in `surface.ts`).
* Instance face of the pure per-node `deriveEventMessage` export from
* `surface.ts`.
* @param event - the event to project.
* @returns the derived message, or null when the event produces none.
*/

View File

@@ -148,7 +148,7 @@ export class TokenMeterService extends Service {
/**
* Heuristically price one model-visible message (instance face of the pure
* {@link estimateMessage}).
* `estimateMessage` export from `estimate.ts`).
* @param message - message to price without mutation.
* @returns content and role-framing tokens under the fixed service heuristic.
*/