-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispatch_viewer.html
More file actions
627 lines (553 loc) · 21.3 KB
/
dispatch_viewer.html
File metadata and controls
627 lines (553 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Trace — Dispatch Viewer</title>
<style>
/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #faf9f7;
--surface: #ffffff;
--border: #e8e4de;
--border-soft: #f0ece6;
--text: #1e1c1a;
--text-muted: #7a7570;
--text-faint: #b5b0aa;
--accent: #5c6f5a; /* muted sage */
--accent-soft: #eef2ec;
--loops: #6b5c3e; /* warm brown for open loops */
--loops-soft: #f5f0e8;
--dev: #4a5f6e; /* slate for developments */
--dev-soft: #edf1f4;
--serif: Georgia, 'Times New Roman', serif;
--sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
--radius: 6px;
}
html { font-size: 17px; }
body {
background: var(--bg);
color: var(--text);
font-family: var(--serif);
line-height: 1.75;
min-height: 100vh;
}
/* ── Layout ───────────────────────────────────────────────────── */
.page { max-width: 740px; margin: 0 auto; padding: 40px 24px 80px; }
/* ── Input state ──────────────────────────────────────────────── */
#input-view { display: block; }
#render-view { display: none; }
.input-header {
margin-bottom: 32px;
border-bottom: 1px solid var(--border);
padding-bottom: 20px;
}
.input-header .eyebrow {
font-family: var(--sans);
font-size: 11px;
letter-spacing: .12em;
text-transform: uppercase;
color: var(--text-faint);
margin-bottom: 8px;
}
.input-header h1 {
font-size: 22px;
font-weight: 400;
color: var(--text);
}
.input-area {
margin-bottom: 20px;
}
.input-area label {
display: block;
font-family: var(--sans);
font-size: 12px;
color: var(--text-muted);
margin-bottom: 8px;
}
#md-input {
width: 100%;
min-height: 280px;
padding: 16px;
font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
font-size: 13px;
line-height: 1.6;
color: var(--text);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
resize: vertical;
outline: none;
transition: border-color .15s;
}
#md-input:focus { border-color: var(--accent); }
#md-input::placeholder { color: var(--text-faint); }
.input-actions {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.btn-primary {
font-family: var(--sans);
font-size: 13px;
font-weight: 500;
padding: 9px 20px;
background: var(--accent);
color: #fff;
border: none;
border-radius: var(--radius);
cursor: pointer;
transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }
.btn-ghost {
font-family: var(--sans);
font-size: 13px;
color: var(--text-muted);
background: none;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 8px 16px;
cursor: pointer;
transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--text-muted); }
#file-input { display: none; }
.or-divider {
font-family: var(--sans);
font-size: 12px;
color: var(--text-faint);
}
.demo-hint {
font-family: var(--sans);
font-size: 12px;
color: var(--text-faint);
margin-top: 12px;
}
.demo-hint a { color: var(--accent); cursor: pointer; text-decoration: underline; }
/* ── Dispatch render ──────────────────────────────────────────── */
.dispatch-header {
margin-bottom: 44px;
padding-bottom: 20px;
border-bottom: 1px solid var(--border);
}
.dispatch-header .eyebrow {
font-family: var(--sans);
font-size: 11px;
letter-spacing: .12em;
text-transform: uppercase;
color: var(--text-faint);
margin-bottom: 8px;
}
.dispatch-header h1 {
font-size: 24px;
font-weight: 400;
color: var(--text);
}
.dispatch-header .back-btn {
margin-top: 14px;
font-family: var(--sans);
font-size: 12px;
color: var(--text-faint);
background: none;
border: none;
cursor: pointer;
padding: 0;
display: inline-flex;
align-items: center;
gap: 5px;
}
.dispatch-header .back-btn:hover { color: var(--text-muted); }
/* ── Sections ─────────────────────────────────────────────────── */
.section + .section { margin-top: 10px; }
.section-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
}
.section-card .section-head {
display: flex;
align-items: center;
gap: 10px;
padding: 18px 24px 16px;
border-left: 3px solid var(--border);
}
.section-card .section-head h2 {
font-family: var(--sans);
font-size: 12px;
font-weight: 600;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--text-muted);
}
.section-card .section-body {
padding: 0 24px 22px;
border-left: 3px solid var(--border);
}
/* per-section accent colours */
.section-themes .section-head,
.section-themes .section-body { border-left-color: var(--accent); }
.section-methods .section-head,
.section-methods .section-body { border-left-color: var(--accent); }
.section-loops .section-head,
.section-loops .section-body { border-left-color: var(--loops); }
.section-loops .section-head h2 { color: var(--loops); }
.section-dev .section-head,
.section-dev .section-body { border-left-color: var(--dev); }
/* collapsible (developments) */
details.section-card summary {
list-style: none;
cursor: pointer;
user-select: none;
}
details.section-card summary::-webkit-details-marker { display: none; }
details.section-card summary .section-head {
display: flex;
align-items: center;
justify-content: space-between;
}
details.section-card summary .section-head h2 { flex: 1; }
.collapse-icon {
font-family: var(--sans);
font-size: 11px;
color: var(--text-faint);
transition: transform .2s;
}
details[open] .collapse-icon { transform: rotate(180deg); }
.section-dev summary .section-head { cursor: pointer; }
/* ── Prose content ────────────────────────────────────────────── */
.section-body p {
font-size: 16px;
color: var(--text);
margin-bottom: 1em;
}
.section-body p:last-child { margin-bottom: 0; }
.section-body ul {
list-style: none;
padding: 0;
margin: 0;
}
.section-body ul li {
font-size: 15px;
color: var(--text);
padding: 5px 0 5px 20px;
position: relative;
border-bottom: 1px solid var(--border-soft);
line-height: 1.6;
}
.section-body ul li:last-child { border-bottom: none; }
.section-body ul li::before {
content: '–';
position: absolute;
left: 0;
color: var(--text-faint);
}
/* ── Checklist (Open Loops) ───────────────────────────────────── */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 7px 0;
border-bottom: 1px solid var(--border-soft);
line-height: 1.55;
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] {
margin-top: 3px;
flex-shrink: 0;
width: 15px;
height: 15px;
accent-color: var(--loops);
cursor: pointer;
}
.checklist .item-text {
font-size: 15px;
color: var(--text);
cursor: pointer;
transition: color .15s;
}
.checklist input[type="checkbox"]:checked + .item-text {
color: var(--text-faint);
text-decoration: line-through;
}
/* ── Sub-headings inside sections ─────────────────────────────── */
.section-body h3 {
font-family: var(--sans);
font-size: 13px;
font-weight: 600;
color: var(--text-muted);
margin: 16px 0 6px;
letter-spacing: .03em;
}
/* ── Footer ───────────────────────────────────────────────────── */
.dispatch-footer {
margin-top: 40px;
padding-top: 16px;
border-top: 1px solid var(--border);
font-family: var(--sans);
font-size: 11px;
color: var(--text-faint);
}
/* ── Error ────────────────────────────────────────────────────── */
.parse-error {
font-family: var(--sans);
font-size: 13px;
color: #9b4141;
background: #fdf0f0;
border: 1px solid #e8c8c8;
border-radius: var(--radius);
padding: 12px 16px;
margin-top: 16px;
}
</style>
</head>
<body>
<div class="page">
<!-- ── INPUT VIEW ─────────────────────────────────────────────── -->
<div id="input-view">
<div class="input-header">
<div class="eyebrow">Trace</div>
<h1>Dispatch Viewer</h1>
</div>
<div class="input-area">
<label for="md-input">Paste dispatch markdown output</label>
<textarea id="md-input" spellcheck="false"
placeholder="## Key Themes & Insights - ... ## Developments & Context - ... ## Methods & Practices - ... ## Open Loops & Next Actions - ..."></textarea>
</div>
<div class="input-actions">
<button class="btn-primary" onclick="renderDispatch()">View Dispatch</button>
<span class="or-divider">or</span>
<button class="btn-ghost" onclick="document.getElementById('file-input').click()">Load .md file</button>
<input type="file" id="file-input" accept=".md,.txt" onchange="loadFile(event)">
</div>
<div class="demo-hint">
No dispatch yet? <a onclick="loadSample()">Load sample output</a> to preview the viewer.
</div>
<div id="input-error"></div>
</div>
<!-- ── RENDER VIEW ────────────────────────────────────────────── -->
<div id="render-view">
<div class="dispatch-header">
<div class="eyebrow">Trace / Weekly Dispatch</div>
<h1 id="dispatch-title">Weekly Dispatch</h1>
<button class="back-btn" onclick="showInput()">← Edit / load another</button>
</div>
<div id="sections-container"></div>
<div class="dispatch-footer" id="dispatch-footer"></div>
</div>
</div>
<script>
// ── Section type detection ──────────────────────────────────────────────────
const SECTION_MAP = [
{ type: 'themes', re: /key theme|insight|semantic/i },
{ type: 'dev', re: /development|context|episodic/i },
{ type: 'methods', re: /method|practice|procedural|workflow/i },
{ type: 'loops', re: /open loop|next action|prospective/i },
];
function detectSectionType(heading) {
for (const { type, re } of SECTION_MAP) {
if (re.test(heading)) return type;
}
return 'generic';
}
// ── Markdown-lite parser ────────────────────────────────────────────────────
// Handles the specific output format from synthesis prompts.
// Supports: ## headings, ### sub-headings, - bullets, paragraphs.
function parseMarkdown(raw) {
const lines = raw.split('\n');
const sections = [];
let current = null;
// Grab everything before first ## as optional title/preamble
let preamble = [];
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line.startsWith('## ')) {
if (current) sections.push(current);
current = { heading: line.slice(3).trim(), lines: [] };
} else if (current) {
current.lines.push(line);
} else {
preamble.push(line);
}
}
if (current) sections.push(current);
return { preamble: preamble.join('\n').trim(), sections };
}
function renderLines(lines, asChecklist) {
const blocks = [];
let listItems = [];
let inList = false;
let currentSubhead = null;
const flushList = () => {
if (!listItems.length) return;
if (asChecklist) {
blocks.push(`<ul class="checklist">${listItems.join('')}</ul>`);
} else {
blocks.push(`<ul>${listItems.join('')}</ul>`);
}
listItems = [];
inList = false;
};
for (const raw of lines) {
const line = raw.trimEnd();
// Sub-heading (###)
if (line.startsWith('### ')) {
flushList();
const text = escHtml(line.slice(4).trim());
blocks.push(`<h3>${text}</h3>`);
continue;
}
// Bullet (- or *)
const bulletMatch = line.match(/^(\s*)[-*]\s+(.+)/);
if (bulletMatch) {
inList = true;
const text = escHtml(bulletMatch[2].trim());
if (asChecklist) {
listItems.push(
`<li><input type="checkbox" onchange="toggleCheck(this)"><span class="item-text">${text}</span></li>`
);
} else {
listItems.push(`<li>${text}</li>`);
}
continue;
}
// Blank line
if (!line.trim()) {
flushList();
continue;
}
// Paragraph text
flushList();
blocks.push(`<p>${escHtml(line.trim())}</p>`);
}
flushList();
return blocks.join('\n');
}
// ── Section HTML builders ───────────────────────────────────────────────────
function buildSection(section) {
const type = detectSectionType(section.heading);
const headingHtml = escHtml(section.heading);
const bodyHtml = renderLines(section.lines, type === 'loops');
const cssClass = `section-card section-${type}`;
if (type === 'dev') {
// Collapsible — starts closed (lower priority per spec)
return `
<details class="${cssClass} section">
<summary>
<div class="section-head">
<h2>${headingHtml}</h2>
<span class="collapse-icon">▲</span>
</div>
</summary>
<div class="section-body">${bodyHtml}</div>
</details>`;
}
return `
<div class="${cssClass} section">
<div class="section-head"><h2>${headingHtml}</h2></div>
<div class="section-body">${bodyHtml}</div>
</div>`;
}
// ── Main render ─────────────────────────────────────────────────────────────
function renderDispatch() {
const raw = document.getElementById('md-input').value.trim();
if (!raw) {
showError('Paste some dispatch output first.');
return;
}
const { preamble, sections } = parseMarkdown(raw);
if (!sections.length) {
showError('No ## section headers found. Make sure you\'re pasting the synthesis output (not raw conversation text).');
return;
}
clearError();
// Title: use preamble first line if present, else generic
const title = preamble.split('\n')[0] || 'Weekly Dispatch';
document.getElementById('dispatch-title').textContent = title;
const container = document.getElementById('sections-container');
container.innerHTML = sections.map(buildSection).join('\n');
const footer = document.getElementById('dispatch-footer');
footer.textContent = `${sections.length} sections · rendered ${new Date().toLocaleString()}`;
document.getElementById('input-view').style.display = 'none';
document.getElementById('render-view').style.display = 'block';
window.scrollTo(0, 0);
}
function showInput() {
document.getElementById('render-view').style.display = 'none';
document.getElementById('input-view').style.display = 'block';
}
// ── File load ───────────────────────────────────────────────────────────────
function loadFile(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (e) => {
document.getElementById('md-input').value = e.target.result;
renderDispatch();
};
reader.readAsText(file);
event.target.value = '';
}
// ── Checkbox ────────────────────────────────────────────────────────────────
function toggleCheck(checkbox) {
// Label strikethrough handled by CSS :checked + sibling selector
}
// ── Helpers ─────────────────────────────────────────────────────────────────
function escHtml(text) {
return text
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
function showError(msg) {
document.getElementById('input-error').innerHTML =
`<div class="parse-error">${msg}</div>`;
}
function clearError() {
document.getElementById('input-error').innerHTML = '';
}
// Auto-render on paste after short debounce
let _autoTimer;
document.getElementById('md-input').addEventListener('input', () => {
clearTimeout(_autoTimer);
_autoTimer = setTimeout(() => {
const val = document.getElementById('md-input').value.trim();
if (val.includes('## ') && val.length > 100) renderDispatch();
}, 800);
});
// ── Sample dispatch ─────────────────────────────────────────────────────────
// Matches the map-reduce synthesis output format exactly.
const SAMPLE = `week of April 4–10, 2026
## Key Themes & Insights
- The four-tier memory taxonomy (semantic / episodic / procedural / prospective) is the central IP of Trace and the lens through which everything else is organised.
- Long-running agentic systems require a fundamentally different quality and steerability regime than short-turn systems — prospective memory is the mechanism by which they stay steerable over time.
- There is a clear distinction between writing for recognition (biographer voice, Trace output) and writing for influence (position paper, internal audience). Both are in play this week and the framing must not bleed between them.
- Technical gaps identified for the Anthropic/OpenAI career path: real-time distributed training, large-scale RLHF pipelines, and evaluation infra for long-horizon tasks.
## Developments & Context
- Tuesday morning session focused on prioritising five competing areas: exit strategy, CVP delegation, manager's-shoes exercise, lifestyle, and AI productivity systems.
- Extended deep dive on the manager's-shoes exercise — specifically the long-running orchestration expansion the manager is pursuing.
- Conversation about steerability as an architectural property rather than a UX feature.
- Trace project scaffolded: repo structure, parser, memory store, and synthesis pipeline built end-to-end.
## Methods & Practices
- Prioritisation heuristic used: sequence the delegatable item first (CVP updates), then the highest-leverage internal exercise (manager's shoes), defer the rest.
- When designing for long-running systems: separate quality management at trajectory level from quality at the individual tool-call level.
- For career positioning: dual-use artefacts (internal position paper + external blog post) are more efficient than single-purpose ones.
## Open Loops & Next Actions
- Draft the position paper staking intellectual claim on quality and steerability in long-running agentic systems.
- Extend the existing eval pipeline toward trajectory-level quality scoring.
- Follow up on CVP delegation — confirm the async handoff is complete.
- Schedule dedicated session for lifestyle and travel planning (deferred this week).
- Review technical gap list and identify one concrete project per gap to close over the next quarter.
- Decide whether to target Anthropic or OpenAI as primary exit path — current framing keeps both open but this needs a decision by end of month.`;
function loadSample() {
document.getElementById('md-input').value = SAMPLE;
renderDispatch();
}
</script>
</body>
</html>