@trazum/cli 1.81.0 → 1.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/markdown.ts CHANGED
@@ -169,6 +169,14 @@ export interface CheckMarkdownInput {
169
169
  verdicts: MarkdownFileVerdict[];
170
170
  level: RuleLevel;
171
171
  tokenSource: 'heuristic' | 'external';
172
+ /**
173
+ * The widest band across the prompts this report covers.
174
+ *
175
+ * Widest and never averaged: a report over a prose prompt and a CSV covers
176
+ * text the estimator is 6% and 33% out on, and a figure between them
177
+ * describes neither. The caller holds the texts and computes it.
178
+ */
179
+ band: number;
172
180
  /** True when a walk limit stopped the run early. */
173
181
  truncated: boolean;
174
182
  /** Absent when no baseline governed the run. */
@@ -270,7 +278,7 @@ function baselineBlock(baseline: BaselineMarkdown, t: CliMessages): string[] {
270
278
  }
271
279
 
272
280
  export function renderCheckMarkdown(input: CheckMarkdownInput): string {
273
- const { target, verdicts, level, tokenSource, truncated, t } = input;
281
+ const { target, verdicts, level, tokenSource, band, truncated, t } = input;
274
282
  const n = (value: number): string => value.toLocaleString(t.numberLocale);
275
283
  const md = t.markdown;
276
284
 
@@ -347,7 +355,7 @@ export function renderCheckMarkdown(input: CheckMarkdownInput): string {
347
355
 
348
356
  lines.push(
349
357
  `<sub>${md.footer(
350
- tokenSource === 'external' ? md.sourceExact() : md.sourceEstimated(),
358
+ tokenSource === 'external' ? md.sourceExact() : md.sourceEstimated(band),
351
359
  level,
352
360
  )}</sub>`,
353
361
  );
@@ -600,6 +608,8 @@ export interface BlameMarkdownInput {
600
608
  truncated: boolean;
601
609
  /** The priced movement across the history, when a model was resolved. */
602
610
  netCost: { amount: string; modelDisplayName: string; callsPerMonth: number } | null;
611
+ /** This file's own measured band, computed by the caller that holds its text. */
612
+ band: number;
603
613
  t: CliMessages;
604
614
  }
605
615
 
@@ -617,7 +627,7 @@ export interface BlameMarkdownInput {
617
627
  * `|` in the output to split a row and no backtick arithmetic to get wrong.
618
628
  */
619
629
  export function renderBlameMarkdown(input: BlameMarkdownInput): string {
620
- const { repoPath, rows, truncated, netCost, t } = input;
630
+ const { repoPath, rows, truncated, netCost, band, t } = input;
621
631
  const n = (value: number): string => value.toLocaleString(t.numberLocale);
622
632
  const cols = t.blame.columns;
623
633
 
@@ -713,7 +723,7 @@ export function renderBlameMarkdown(input: BlameMarkdownInput): string {
713
723
  lines.push('');
714
724
  }
715
725
 
716
- lines.push(`<sub>${mdText(t.blame.estimateNote())}</sub>`);
726
+ lines.push(`<sub>${mdText(t.blame.estimateNote(band))}</sub>`);
717
727
 
718
728
  return lines.join('\n');
719
729
  }