konpeki 0.1.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.
Files changed (121) hide show
  1. package/.agents/skills/authoring-visuals/SKILL.md +82 -0
  2. package/AGENTS.md +33 -0
  3. package/AUTHORING.md +233 -0
  4. package/LICENSE +201 -0
  5. package/README.md +70 -0
  6. package/SETUP.md +86 -0
  7. package/composition/README.md +166 -0
  8. package/composition/compile.ts +227 -0
  9. package/composition/document.ts +709 -0
  10. package/composition/schema.json +2992 -0
  11. package/composition/schema.ts +435 -0
  12. package/composition/theme-tokens.ts +16 -0
  13. package/composition/types.ts +286 -0
  14. package/composition/validate.ts +684 -0
  15. package/composition/vector.ts +143 -0
  16. package/composition/visualizations.ts +335 -0
  17. package/design/README.md +17 -0
  18. package/design/palettes/README.md +14 -0
  19. package/design/palettes/base.ts +14 -0
  20. package/design/palettes/candidates.ts +19 -0
  21. package/design/palettes/index.ts +78 -0
  22. package/design/review/color-theme.md +44 -0
  23. package/design/review/layout.md +16 -0
  24. package/design/review/text.md +18 -0
  25. package/design/review/typography.md +15 -0
  26. package/design/review/visuals.md +31 -0
  27. package/design/semantic-patterns.md +43 -0
  28. package/design/themes/README.md +22 -0
  29. package/design/themes/index.ts +13 -0
  30. package/design/visual-languages/technical-product.md +17 -0
  31. package/design/visual-review.md +88 -0
  32. package/docs/development.md +140 -0
  33. package/docs/workflow.md +61 -0
  34. package/index.html +17 -0
  35. package/lib/assets.d.ts +8 -0
  36. package/lib/charts.ts +18 -0
  37. package/lib/contrast.ts +16 -0
  38. package/lib/layouts.ts +50 -0
  39. package/lib/slide.tsx +42 -0
  40. package/lib/taste.ts +17 -0
  41. package/lib/text.tsx +89 -0
  42. package/lib/typeface.ts +44 -0
  43. package/package.json +85 -0
  44. package/runtime/konpeki.mjs +1685 -0
  45. package/scripts/migrate-react-page.ts +120 -0
  46. package/slides/README.md +153 -0
  47. package/slides/architecture/PROMPT.md +31 -0
  48. package/slides/architecture/index.tsx +102 -0
  49. package/slides/article-brief/PROMPT.md +35 -0
  50. package/slides/article-brief/index.tsx +71 -0
  51. package/slides/bar-chart/PROMPT.md +39 -0
  52. package/slides/bar-chart/index.tsx +97 -0
  53. package/slides/comparison/PROMPT.md +29 -0
  54. package/slides/comparison/index.tsx +95 -0
  55. package/slides/decision-memo/PROMPT.md +34 -0
  56. package/slides/decision-memo/index.tsx +85 -0
  57. package/slides/delivery-plan/PROMPT.md +45 -0
  58. package/slides/delivery-plan/index.tsx +105 -0
  59. package/slides/experiment/PROMPT.md +44 -0
  60. package/slides/experiment/index.tsx +127 -0
  61. package/slides/incident-workflow/PROMPT.md +57 -0
  62. package/slides/incident-workflow/index.tsx +78 -0
  63. package/slides/introducing-konpeki/PROMPT.md +19 -0
  64. package/slides/introducing-konpeki/README.md +54 -0
  65. package/slides/introducing-konpeki/SOURCE.md +20 -0
  66. package/slides/introducing-konpeki/author.ts +163 -0
  67. package/slides/introducing-konpeki/composition.json +3265 -0
  68. package/slides/line-chart/PROMPT.md +40 -0
  69. package/slides/line-chart/index.tsx +72 -0
  70. package/slides/migration/PROMPT.md +38 -0
  71. package/slides/migration/index.tsx +89 -0
  72. package/slides/og-images/PROMPT.md +21 -0
  73. package/slides/og-images/index.tsx +76 -0
  74. package/slides/product-introduction/PROMPT.md +24 -0
  75. package/slides/product-introduction/index.tsx +105 -0
  76. package/slides/research-brief/PROMPT.md +40 -0
  77. package/slides/research-brief/index.tsx +104 -0
  78. package/slides/results-explanation/PROMPT.md +32 -0
  79. package/slides/results-explanation/index.tsx +96 -0
  80. package/slides/retrospective/PROMPT.md +43 -0
  81. package/slides/retrospective/index.tsx +105 -0
  82. package/slides/sankey/PROMPT.md +11 -0
  83. package/slides/sankey/index.tsx +93 -0
  84. package/slides/teaching/PROMPT.md +45 -0
  85. package/slides/teaching/index.tsx +124 -0
  86. package/slides/vertical-bar-charts/PROMPT.md +13 -0
  87. package/slides/vertical-bar-charts/index.tsx +97 -0
  88. package/src/app/App.tsx +694 -0
  89. package/src/assets/konpeki-mark.png +0 -0
  90. package/src/components/Canvas.tsx +1168 -0
  91. package/src/components/DiagramTypeIcon.tsx +78 -0
  92. package/src/components/InspectorPanel.tsx +687 -0
  93. package/src/components/LeftPanel.tsx +107 -0
  94. package/src/components/PageSizePicker.tsx +30 -0
  95. package/src/components/Presentation.tsx +105 -0
  96. package/src/components/RightPanel.tsx +201 -0
  97. package/src/components/VectorOverflowWarning.tsx +46 -0
  98. package/src/components/WorkspaceChrome.tsx +199 -0
  99. package/src/components/ui.tsx +53 -0
  100. package/src/lib/examples/react-page-migration.json +1295 -0
  101. package/src/lib/examples.ts +42 -0
  102. package/src/lib/export-png.ts +101 -0
  103. package/src/lib/file-session.ts +74 -0
  104. package/src/lib/history.ts +53 -0
  105. package/src/lib/model.ts +188 -0
  106. package/src/lib/page-size.ts +24 -0
  107. package/src/lib/presentation.ts +17 -0
  108. package/src/lib/storage.ts +43 -0
  109. package/src/lib/theme.ts +25 -0
  110. package/src/lib/use-file-session.ts +162 -0
  111. package/src/main.tsx +26 -0
  112. package/src/styles/base.css +105 -0
  113. package/src/styles/canvas.css +268 -0
  114. package/src/styles/chrome.css +214 -0
  115. package/src/styles/component-previews.css +386 -0
  116. package/src/styles/feedback.css +71 -0
  117. package/src/styles/left-panel.css +125 -0
  118. package/src/styles/presentation.css +72 -0
  119. package/src/styles/right-panel.css +1172 -0
  120. package/src/styles/shell.css +247 -0
  121. package/vite.config.ts +6 -0
@@ -0,0 +1,97 @@
1
+ import type { ReactNode } from 'react';
2
+ import '../../lib/typeface.ts';
3
+
4
+ const ink = '#172D35';
5
+ const muted = '#52636B';
6
+ const accent = '#087E83';
7
+ const neutral = '#637982';
8
+ const grid = '#DAE2E5';
9
+ const configurations = [
10
+ { label: 'Individual', seconds: 300, delay: 2.4 },
11
+ { label: 'Batches of 20', seconds: 200, delay: 4.1 },
12
+ { label: 'Batches of 100', seconds: 150, delay: 11.8 },
13
+ ];
14
+ const throughput = configurations.map(({ seconds }) => 60_000 / seconds);
15
+
16
+ function Label({ x, y, children, size = 30, weight = 400, color = ink, anchor = 'start' }: {
17
+ x: number; y: number; children: ReactNode; size?: number; weight?: number;
18
+ color?: string; anchor?: 'start' | 'middle' | 'end';
19
+ }) {
20
+ return <text x={x} y={y} fontSize={size} fontWeight={weight} fill={color} textAnchor={anchor}>{children}</text>;
21
+ }
22
+
23
+ function Frame({ title, description, page, children }: {
24
+ title: string; description: string; page: number; children: ReactNode;
25
+ }) {
26
+ return <svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080"
27
+ fontFamily="IBM Plex Sans" role="img" aria-label={`${title}. ${description}`} data-page={page}>
28
+ <rect width="1920" height="1080" fill="#FFFFFF" />
29
+ <Label x={100} y={138} size={64} weight={600}>{title}</Label>
30
+ {children}
31
+ <Label x={1816} y={1022} size={26} color={muted} anchor="end">{page} / 2</Label>
32
+ </svg>;
33
+ }
34
+
35
+ function Bars({ id, x, width, top, height, values, max, ticks, unit, threshold }: {
36
+ id: string; x: number; width: number; top: number; height: number; values: number[];
37
+ max: number; ticks: number[]; unit: string; threshold?: { value: number; label: string };
38
+ }) {
39
+ const left = x + 68;
40
+ const right = x + width;
41
+ const baseline = top + height;
42
+ const step = (right - left) / 3;
43
+ const barWidth = step * 0.46;
44
+ const y = (value: number) => baseline - value / max * height;
45
+ return <g data-chart={id}>
46
+ <Label x={x} y={top - 44} size={28} color={muted}>{unit}</Label>
47
+ {ticks.map(tick => <g key={tick}>
48
+ <line x1={left} x2={right} y1={y(tick)} y2={y(tick)} stroke={tick === 0 ? muted : grid} strokeWidth={tick === 0 ? 2 : 1} data-tick={tick} />
49
+ <Label x={left - 18} y={y(tick) + 9} size={26} color={muted} anchor="end">{tick}</Label>
50
+ </g>)}
51
+ {threshold && <g>
52
+ <line data-threshold={threshold.value} x1={left} x2={right} y1={y(threshold.value)} y2={y(threshold.value)} stroke={ink} strokeWidth={3} strokeDasharray="10 8" />
53
+ <Label x={right} y={top - 44} size={28} weight={500} anchor="end">{threshold.label}</Label>
54
+ </g>}
55
+ {values.map((value, i) => {
56
+ const center = left + step * (i + 0.5);
57
+ return <g key={configurations[i].label}>
58
+ <rect data-bar={configurations[i].label} x={center - barWidth / 2} y={y(value)} width={barWidth} height={baseline - y(value)} fill={i === 1 ? accent : neutral} />
59
+ <Label x={center} y={y(value) + (threshold ? 40 : -17)} size={36} weight={600} color={threshold ? '#FFFFFF' : ink} anchor="middle">{value}</Label>
60
+ <Label x={center} y={baseline + 46} size={28} weight={i === 1 ? 600 : 400} anchor="middle">{configurations[i].label}</Label>
61
+ </g>;
62
+ })}
63
+ </g>;
64
+ }
65
+
66
+ const Throughput = () => <Frame page={1} title="Larger batches raise Fieldnote’s throughput"
67
+ description="Synthetic results: Individual updates, 200 updates per second; batches of 20, 300; batches of 100, 400. Same 60,000 updates per configuration. One run each, not production evidence.">
68
+ <Label x={100} y={208} size={32} color={muted}>A controlled comparison in a fictional document workspace</Label>
69
+ <Bars id="throughput" x={100} width={1110} top={352} height={450} values={throughput} max={500} ticks={[0, 100, 200, 300, 400, 500]} unit="Throughput · updates / second" />
70
+ <Label x={1330} y={343} size={36} weight={600}>Same work, less time</Label>
71
+ <Label x={1330} y={405} size={30}>60,000 document updates each</Label>
72
+ <Label x={1330} y={458} size={30} color={muted}>Individual: 300 seconds</Label>
73
+ <Label x={1330} y={503} size={30} color={muted}>Batches of 20: 200 seconds</Label>
74
+ <Label x={1330} y={548} size={30} color={muted}>Batches of 100: 150 seconds</Label>
75
+ <Label x={1330} y={643} size={30} weight={500}>Throughput = 60,000 ÷ time</Label>
76
+ <Label x={1330} y={716} size={28} color={muted}>Same machine, empty queue,</Label>
77
+ <Label x={1330} y={756} size={28} color={muted}>identical starting index.</Label>
78
+ <Label x={1330} y={808} size={28} color={muted}>All final versions were correct.</Label>
79
+ <Label x={100} y={941} size={28} color={muted}>Synthetic, hand-authored results · one run per configuration</Label>
80
+ <Label x={100} y={984} size={28} color={muted}>No production measurements or uncertainty estimates. Faster completion does not establish timely search visibility.</Label>
81
+ </Frame>;
82
+
83
+ const Tradeoff = () => <Frame page={2} title="Test batches of 20: only they meet both targets"
84
+ description="Proposed minimum throughput is 250 updates per second; maximum p95 search visibility delay is 5 seconds. In Individual, Batches of 20, Batches of 100 order, throughput is 200, 300, 400 and p95 delay is 2.4, 4.1, 11.8 seconds. Recommend follow-up testing, not production adoption; repeat with sparse arrivals and bursts.">
85
+ <Label x={100} y={208} size={32} color={muted}>Maximum throughput alone is insufficient: batches of 100 exceed the search visibility delay limit.</Label>
86
+ <Label x={100} y={296} size={36} weight={600}>Throughput</Label>
87
+ <Label x={1030} y={296} size={36} weight={600}>Search visibility delay · p95</Label>
88
+ <Bars id="throughput" x={100} width={790} top={398} height={360} values={throughput} max={500} ticks={[0, 100, 200, 300, 400, 500]} unit="Updates / second" threshold={{ value: 250, label: 'Proposed min. 250' }} />
89
+ <Bars id="delay" x={1030} width={790} top={398} height={360} values={configurations.map(c => c.delay)} max={15} ticks={[0, 3, 6, 9, 12, 15]} unit="Seconds" threshold={{ value: 5, label: 'Proposed max. 5 s' }} />
90
+ <Label x={1030} y={859} size={26} color={muted}>Delay: submission → updated document appears in search.</Label>
91
+ <Label x={100} y={919} size={34} weight={600} color={accent}>Follow-up testing, not production adoption.</Label>
92
+ <Label x={100} y={965} size={28} color={muted}>Repeat with sparse arrivals and bursts. Synthetic, hand-authored data; one run per configuration.</Label>
93
+ <Label x={100} y={1008} size={28} color={muted}>No production measurements or uncertainty estimates. All final document versions were correct.</Label>
94
+ </Frame>;
95
+
96
+ export const meta = { title: 'Fieldnote · Batch size and search visibility' };
97
+ export default [Throughput, Tradeoff];