@agentguard-run/burn 0.3.6 → 0.3.7

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/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.7 (2026-09-22)
4
+
5
+ - Phone render: add one block per allowed copy under the spawn rate, filled from the recorded count, red with "next copy refused" at a STOP; grow the layout to 40 by 36 cells.
6
+
3
7
  ## 0.3.6 (2026-09-22)
4
8
 
5
- - Add `render --phone`: a 1080 by 1350 frame with a stacked 40 by 32 cell layout (spawn count, spawn rate, last three decisions, STOP card, two-line explainer) so recorded runs stay readable on a phone screen. Provenance records the layout and frame size. Wide renders are unchanged.
9
+ - Add `render --phone`: a 1080 by 1350 frame with a stacked 40 by 36 cell layout (spawn count, spawn rate, one block per allowed copy, last three decisions, STOP card, explainer) so recorded runs stay readable on a phone screen. Provenance records the layout and frame size. Wide renders are unchanged.
6
10
 
7
11
  ## 0.3.5 (2026-09-22)
8
12
 
package/README.md CHANGED
@@ -509,7 +509,7 @@ agentguard-burn render run.jsonl --mp4 run.mp4 --gif run.gif
509
509
  agentguard-burn render run.jsonl --mp4 run-phone.mp4 --phone
510
510
  ```
511
511
 
512
- `--phone` renders a 1080 by 1350 frame with a stacked 40 by 32 cell layout (spawn count, spawn rate, the last three decisions, the STOP card and a two-line explainer), so a recorded run stays readable on a phone screen. The provenance file records the layout and frame size.
512
+ `--phone` renders a 1080 by 1350 frame with a stacked 40 by 36 cell layout (spawn count, spawn rate, one block per allowed copy, the last three decisions, the STOP card and an explainer), so a recorded run stays readable on a phone screen. The provenance file records the layout and frame size.
513
513
 
514
514
  `record` writes each decision at its real timestamp, with one frame per second
515
515
  between decisions. Bounds are optional and otherwise use the session's first
@@ -42,7 +42,7 @@ export declare class SessionFollow {
42
42
  export declare function spawnBarColor(spawns: number | null, ceiling: number | null): CanvasColor;
43
43
  /** Recorded showcase layout: the spawn count is the hero, unrecorded panels are omitted, never faked. */
44
44
  export declare function renderShowcasePanel(snapshot: LivePanelSnapshot, options?: FrameOptions): Canvas;
45
- /** Recorded phone layout: 40 by 32 cells stacked for a 4:5 frame, the spawn count first, nothing faked. */
45
+ /** Recorded phone layout: 40 by 36 cells stacked for a 4:5 frame, the spawn count first, nothing faked. */
46
46
  export declare function renderPhonePanel(snapshot: LivePanelSnapshot, options?: FrameOptions): Canvas;
47
47
  export declare function renderLivePanel(snapshot: LivePanelSnapshot, options?: FrameOptions): Canvas;
48
48
  /** STOP report adaptation uses only already-computed metadata, never local I/O. */
@@ -96,9 +96,9 @@ function renderShowcasePanel(snapshot, options = {}) {
96
96
  c.put(h - 3, 0, snapshot.note.slice(0, w), 'slate');
97
97
  return c;
98
98
  }
99
- /** Recorded phone layout: 40 by 32 cells stacked for a 4:5 frame, the spawn count first, nothing faked. */
99
+ /** Recorded phone layout: 40 by 36 cells stacked for a 4:5 frame, the spawn count first, nothing faked. */
100
100
  function renderPhonePanel(snapshot, options = {}) {
101
- const c = new canvas_1.Canvas(options), w = c.width, h = c.height;
101
+ const c = new canvas_1.Canvas(options), w = c.width;
102
102
  const at = options.at ?? new Date(snapshot.observedAt).toISOString(), color = spawnBarColor(snapshot.spawns, snapshot.spawnCeiling);
103
103
  c.header('AGENTGUARD / BURN', 'RECORDED · 1x');
104
104
  c.footer('signed on this machine', `elapsed ${snapshot.elapsedMs === null ? 'unknown' : elapsed(snapshot.elapsedMs ?? snapshot.observedAt - snapshot.startedAt)}`);
@@ -110,29 +110,42 @@ function renderPhonePanel(snapshot, options = {}) {
110
110
  const rate = `${snapshot.spawns ?? '?'} / ${snapshot.spawnCeiling ?? '?'}`;
111
111
  c.put(12, 0, 'SPAWN RATE', 'slate').put(12, Math.max(11, w - rate.length), rate, color);
112
112
  c.bar(13, 0, w, fraction, color).bar(14, 0, w, fraction, color);
113
- c.put(16, 0, 'LAST 3 DECISIONS', 'slate');
113
+ // One block per allowed copy, filled from the recorded count. The grid only exists when the ceiling was recorded.
114
+ if (snapshot.spawnCeiling !== null && snapshot.spawnCeiling > 0) {
115
+ const ceiling = snapshot.spawnCeiling, filled = Math.min(ceiling, Math.max(0, snapshot.spawns ?? 0));
116
+ const perRow = Math.ceil(ceiling / 2), blockWidth = Math.max(1, Math.floor((w + 1) / perRow) - 1);
117
+ const refused = snapshot.stop !== undefined;
118
+ c.put(16, 0, 'AGENT COPIES', 'slate');
119
+ const tag = refused ? 'next copy refused' : 'one block per copy';
120
+ c.put(16, Math.max(13, w - tag.length), tag, refused ? 'red' : 'slate');
121
+ for (let index = 0; index < ceiling; index++) {
122
+ const row = 17 + Math.floor(index / perRow) * 2, col = (index % perRow) * (blockWidth + 1);
123
+ const on = index < filled, glyph = (on ? '█' : '░').repeat(blockWidth);
124
+ c.put(row, col, glyph, on ? color : 'slate').put(row + 1, col, glyph, on ? color : 'slate');
125
+ }
126
+ }
127
+ c.put(22, 0, 'LAST 3 DECISIONS', 'slate');
114
128
  snapshot.decisions.slice(-3).forEach((d, index) => {
115
- const row = 17 + index * 2, chip = d.verdict === 'OK' ? 'clean' : d.verdict, tint = d.verdict === 'STOP' ? 'red' : d.verdict === 'WARN' ? 'amber' : 'mint';
129
+ const row = 23 + index * 2, chip = d.verdict === 'OK' ? 'clean' : d.verdict, tint = d.verdict === 'STOP' ? 'red' : d.verdict === 'WARN' ? 'amber' : 'mint';
116
130
  c.put(row, 0, `${new Date(d.at).toISOString().slice(11, 19)} ${d.tool}`.slice(0, Math.max(0, w - 8)), 'white');
117
131
  c.put(row, Math.max(0, w - chip.length - 2), `[${chip}]`, tint);
118
132
  c.put(row + 1, 0, d.reason.slice(0, w), 'slate');
119
133
  });
120
134
  if (!snapshot.decisions.length)
121
- c.put(17, 0, 'No recorded decisions yet.', 'slate');
135
+ c.put(23, 0, 'No recorded decisions yet.', 'slate');
136
+ c.put(29, 0, 'Each spawn re-reads all the context.'.slice(0, w), 'white');
122
137
  if (snapshot.stop) {
123
- c.put(23, 0, '─'.repeat(w), 'red');
124
- c.put(24, 0, ('STOP · ' + (snapshot.stop.blocked === true ? 'blocked' : snapshot.stop.blocked === false ? 'shadow / allowed' : 'outcome unknown')).slice(0, w), 'red');
125
- c.put(25, 0, snapshot.stop.reason.slice(0, w), 'red');
126
- c.put(26, 0, '─'.repeat(w), 'red');
138
+ c.put(30, 0, '─'.repeat(w), 'red');
139
+ c.put(31, 0, ('STOP · ' + (snapshot.stop.blocked === true ? 'blocked' : snapshot.stop.blocked === false ? 'shadow / allowed' : 'outcome unknown') + ' · ' + snapshot.stop.reason).slice(0, w), 'red');
140
+ c.put(32, 0, '─'.repeat(w), 'red');
127
141
  }
128
- c.put(28, 0, 'Each spawn re-reads all the context.'.slice(0, w), 'white');
129
- c.put(29, 0, 'Past the limit, the next is refused.'.slice(0, w), 'white');
142
+ c.put(33, 0, 'Past the limit, the next is refused.'.slice(0, w), 'white');
130
143
  return c;
131
144
  }
132
145
  function renderLivePanel(snapshot, options = {}) {
133
146
  if (options.showcase && (options.height ?? 35) >= 30 && (options.width ?? 104) >= 80)
134
147
  return renderShowcasePanel(snapshot, options);
135
- if (options.showcase && (options.height ?? 35) >= 32 && (options.width ?? 104) >= 36 && (options.width ?? 104) < 80)
148
+ if (options.showcase && (options.height ?? 35) >= 36 && (options.width ?? 104) >= 36 && (options.width ?? 104) < 80)
136
149
  return renderPhonePanel(snapshot, options);
137
150
  const c = new canvas_1.Canvas(options), w = c.width, h = c.height, narrow = w < 80, split = narrow ? w : Math.floor(w * .45), right = narrow ? 0 : split + 3, room = w - right;
138
151
  const at = options.at ?? new Date(snapshot.observedAt).toISOString(), color = spawnBarColor(snapshot.spawns, snapshot.spawnCeiling);
@@ -10,7 +10,7 @@ export interface RenderRecordingResult {
10
10
  export type RenderStyle = 'default' | 'showcase' | 'phone';
11
11
  export declare const PHONE_VIEWPORT: Readonly<{
12
12
  width: 40;
13
- height: 32;
13
+ height: 36;
14
14
  }>;
15
15
  export declare const PHONE_FRAME: Readonly<{
16
16
  width: 1080;
@@ -69,7 +69,7 @@ function timestampMicros(at) {
69
69
  const fraction = /\.(\d+)(?:Z|[+-]\d{2}:?\d{2})$/i.exec(at)?.[1] ?? '';
70
70
  return BigInt(milliseconds) * 1000n + BigInt(fraction.slice(3, 6).padEnd(3, '0'));
71
71
  }
72
- exports.PHONE_VIEWPORT = Object.freeze({ width: 40, height: 32 });
72
+ exports.PHONE_VIEWPORT = Object.freeze({ width: 40, height: 36 });
73
73
  exports.PHONE_FRAME = Object.freeze({ width: 1080, height: 1350 });
74
74
  async function renderCanvasPng(snapshot, width = 1920, height = 1080, style = 'default') {
75
75
  await font();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentguard-run/burn",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Local session usage and runaway-agent circuit breaker. Explain tokens, cache rewrites and API list cost, track pace, warn on heavy turns, and gate agent fan-out with signed receipts. Developer command ranking requires explicit --rank.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "commonjs",