@grainulation/barn 1.0.0 → 1.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.
- package/CODE_OF_CONDUCT.md +25 -0
- package/CONTRIBUTING.md +97 -0
- package/README.md +46 -29
- package/bin/barn.js +30 -23
- package/lib/index.js +41 -25
- package/lib/server.js +211 -114
- package/package.json +8 -4
- package/public/grainulation-icons.svg +47 -0
- package/public/grainulation-tokens.css +78 -18
- package/public/index.html +1 -1
- package/public/status-icons.svg +40 -0
- package/templates/README.md +4 -0
- package/templates/adr.json +1 -3
- package/templates/brief.json +1 -4
- package/templates/certificate.json +7 -1
- package/templates/comparison.json +1 -3
- package/templates/dashboard.json +1 -4
- package/templates/email-digest.html +1 -1
- package/templates/email-digest.json +1 -3
- package/templates/evidence-matrix.json +1 -3
- package/templates/explainer.json +1 -4
- package/templates/handoff.json +1 -3
- package/templates/rfc.json +1 -4
- package/templates/risk-register.json +1 -4
- package/templates/slide-deck.json +1 -3
- package/templates/template.schema.json +20 -4
- package/tools/README.md +5 -2
- package/tools/build-pdf.js +6 -6
- package/tools/detect-sprints.js +78 -54
- package/tools/generate-manifest.js +78 -43
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* grainulation-tokens.css
|
|
2
|
+
* grainulation-tokens.css v0.1.0
|
|
3
3
|
* Shared design tokens for the grainulation ecosystem.
|
|
4
4
|
* Home: barn (the design-system tool)
|
|
5
5
|
*
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
Barn used --text:#e8ecf1 (close to fg); standardized to #e2e8f0. */
|
|
47
47
|
--fg: #e2e8f0;
|
|
48
48
|
--fg2: #94a3b8;
|
|
49
|
-
--fg3: #64748b
|
|
49
|
+
--fg3: #718096; /* lightened from #64748b for WCAG AA (5.09:1 vs --bg #0a0e1a) */
|
|
50
50
|
|
|
51
51
|
/* ── Backward-compat aliases ──
|
|
52
52
|
Barn-originated names still used in barn + farmer inline styles. */
|
|
@@ -103,21 +103,42 @@
|
|
|
103
103
|
══════════════════════════════════════════════════════════════════════════════ */
|
|
104
104
|
|
|
105
105
|
:root {
|
|
106
|
-
/* ──
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
/* ── WCAG 2.2 AA semantic color tokens ──
|
|
107
|
+
All values verified against --bg (#0a0e1a) for minimum 4.5:1 contrast.
|
|
108
|
+
Contrast ratios measured with WCAG 2.x relative luminance formula.
|
|
109
|
+
|
|
110
|
+
--color-success #4ade80 11.05:1 (was #22c55e — lightened for AA large+normal)
|
|
111
|
+
--color-error #f87171 6.93:1
|
|
112
|
+
--color-warning #fbbf24 11.53:1 (was #f59e0b — swapped to amber for better ratio)
|
|
113
|
+
--color-info #60a5fa 7.51:1
|
|
114
|
+
--color-accent #a78bfa 7.00:1
|
|
115
|
+
--color-text #e2e8f0 15.39:1
|
|
116
|
+
--color-text-muted #94a3b8 7.41:1
|
|
117
|
+
--fg3 #718096 5.09:1 (lightened from #64748b for AA compliance)
|
|
118
|
+
*/
|
|
119
|
+
--color-success: #4ade80;
|
|
120
|
+
--color-error: #f87171;
|
|
121
|
+
--color-warning: #fbbf24;
|
|
122
|
+
--color-info: #60a5fa;
|
|
123
|
+
--color-accent: #a78bfa;
|
|
124
|
+
--color-text: #e2e8f0;
|
|
125
|
+
--color-text-muted: #94a3b8;
|
|
126
|
+
|
|
127
|
+
/* ── Status tokens (mapped to semantic colors) ── */
|
|
128
|
+
--success: var(--color-success);
|
|
111
129
|
--success-light: #34d399;
|
|
112
|
-
--warning:
|
|
113
|
-
--error:
|
|
114
|
-
--info:
|
|
115
|
-
|
|
116
|
-
/* ──
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
--
|
|
120
|
-
--
|
|
130
|
+
--warning: var(--color-warning);
|
|
131
|
+
--error: var(--color-error);
|
|
132
|
+
--info: var(--color-info);
|
|
133
|
+
|
|
134
|
+
/* ── Backward-compat aliases ──
|
|
135
|
+
Maps legacy named-color tokens to the new semantic tokens so existing
|
|
136
|
+
var() references (291 across 8 packages) continue to resolve. */
|
|
137
|
+
--green: var(--color-success);
|
|
138
|
+
--red: var(--color-error);
|
|
139
|
+
--blue: var(--color-info);
|
|
140
|
+
--purple: var(--color-accent);
|
|
141
|
+
--yellow: var(--color-warning);
|
|
121
142
|
--orange: #fb923c;
|
|
122
143
|
--cyan: #22d3ee;
|
|
123
144
|
|
|
@@ -239,7 +260,6 @@
|
|
|
239
260
|
}
|
|
240
261
|
|
|
241
262
|
/* ── grainulation: neutral/white (#9ca3af) ── */
|
|
242
|
-
[data-tool="grainulation"],
|
|
243
263
|
[data-tool="grainulation"] {
|
|
244
264
|
--accent-50: #f9fafb;
|
|
245
265
|
--accent-200: #e5e7eb;
|
|
@@ -268,7 +288,8 @@
|
|
|
268
288
|
|
|
269
289
|
html, body {
|
|
270
290
|
height: 100%;
|
|
271
|
-
overflow: hidden
|
|
291
|
+
/* overflow: hidden removed — layout constraint should be set by each tool UI,
|
|
292
|
+
not by the shared token file. Consumers that need it can add it themselves. */
|
|
272
293
|
}
|
|
273
294
|
|
|
274
295
|
body {
|
|
@@ -319,3 +340,42 @@ body {
|
|
|
319
340
|
.connection-dot.disconnected {
|
|
320
341
|
background: var(--red);
|
|
321
342
|
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
/* ══════════════════════════════════════════════════════════════════════════════
|
|
346
|
+
TRIPLE-ENCODED STATUS INDICATORS (WCAG 1.4.1)
|
|
347
|
+
Icon (distinctive shape) + color (semantic token) + text label.
|
|
348
|
+
Meaning is independent of color perception.
|
|
349
|
+
|
|
350
|
+
Usage:
|
|
351
|
+
<span class="status status--success">
|
|
352
|
+
<svg class="status-icon"><use href="grainulation-icons.svg#checkmark-circle"></use></svg>
|
|
353
|
+
Passed
|
|
354
|
+
</span>
|
|
355
|
+
|
|
356
|
+
Symbol IDs in grainulation-icons.svg:
|
|
357
|
+
checkmark-circle — success
|
|
358
|
+
x-circle — error
|
|
359
|
+
triangle-alert — warning
|
|
360
|
+
info-circle — info
|
|
361
|
+
══════════════════════════════════════════════════════════════════════════════ */
|
|
362
|
+
|
|
363
|
+
.status {
|
|
364
|
+
display: inline-flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
gap: var(--space-xs);
|
|
367
|
+
font-size: var(--text-sm);
|
|
368
|
+
font-family: var(--font-sans);
|
|
369
|
+
line-height: 1;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.status-icon {
|
|
373
|
+
width: 14px;
|
|
374
|
+
height: 14px;
|
|
375
|
+
flex-shrink: 0;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.status--success { color: var(--color-success); }
|
|
379
|
+
.status--error { color: var(--color-error); }
|
|
380
|
+
.status--warning { color: var(--color-warning); }
|
|
381
|
+
.status--info { color: var(--color-info); }
|
package/public/index.html
CHANGED
|
@@ -163,7 +163,7 @@ body {
|
|
|
163
163
|
<div class="welcome" id="barn-welcome"><h2>Barn</h2><div class="subtitle">Loading templates...</div></div>
|
|
164
164
|
</main>
|
|
165
165
|
<footer class="footer">
|
|
166
|
-
<span>barn v1.0.
|
|
166
|
+
<span>barn v1.0.1 -- @grainulation/barn</span>
|
|
167
167
|
<div class="footer-links">
|
|
168
168
|
<a href="http://localhost:9091">wheat</a>
|
|
169
169
|
<a href="http://localhost:9094">mill</a>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
status-icons.svg — SVG sprite for triple-encoded status indicators (WCAG 1.4.1)
|
|
3
|
+
Each status has a distinctive shape so meaning is independent of color perception:
|
|
4
|
+
success = checkmark (circle with check)
|
|
5
|
+
error = cross (circle with X)
|
|
6
|
+
warning = triangle (with exclamation)
|
|
7
|
+
info = circle (with "i")
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
<svg class="status-icon"><use href="status-icons.svg#icon-success"></use></svg>
|
|
11
|
+
-->
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
13
|
+
|
|
14
|
+
<!-- success: circle + checkmark -->
|
|
15
|
+
<symbol id="icon-success" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
16
|
+
<circle cx="8" cy="8" r="7" />
|
|
17
|
+
<path d="M5 8.5 L7 10.5 L11 5.5" />
|
|
18
|
+
</symbol>
|
|
19
|
+
|
|
20
|
+
<!-- error: circle + X -->
|
|
21
|
+
<symbol id="icon-error" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
22
|
+
<circle cx="8" cy="8" r="7" />
|
|
23
|
+
<path d="M5.5 5.5 L10.5 10.5 M10.5 5.5 L5.5 10.5" />
|
|
24
|
+
</symbol>
|
|
25
|
+
|
|
26
|
+
<!-- warning: triangle + exclamation -->
|
|
27
|
+
<symbol id="icon-warning" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
28
|
+
<path d="M8 1.5 L15 14 H1 Z" />
|
|
29
|
+
<line x1="8" y1="6" x2="8" y2="9.5" />
|
|
30
|
+
<circle cx="8" cy="11.5" r="0.5" fill="currentColor" stroke="none" />
|
|
31
|
+
</symbol>
|
|
32
|
+
|
|
33
|
+
<!-- info: circle + "i" -->
|
|
34
|
+
<symbol id="icon-info" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
35
|
+
<circle cx="8" cy="8" r="7" />
|
|
36
|
+
<line x1="8" y1="7" x2="8" y2="11.5" />
|
|
37
|
+
<circle cx="8" cy="5" r="0.5" fill="currentColor" stroke="none" />
|
|
38
|
+
</symbol>
|
|
39
|
+
|
|
40
|
+
</svg>
|
package/templates/README.md
CHANGED
|
@@ -7,10 +7,12 @@ Self-contained HTML templates for research sprint artifacts. No external depende
|
|
|
7
7
|
Full-screen scroll-snap presentation template. Each `.slide` div fills the viewport and snaps into place on scroll.
|
|
8
8
|
|
|
9
9
|
**Placeholders to replace:**
|
|
10
|
+
|
|
10
11
|
- `{{TITLE}}` -- main presentation title
|
|
11
12
|
- `{{SUBTITLE}}` -- subtitle/description
|
|
12
13
|
|
|
13
14
|
**Layout components:**
|
|
15
|
+
|
|
14
16
|
- `.slide` -- full-screen section (scroll-snap aligned)
|
|
15
17
|
- `.card` -- content card with colored left border (add `.green`, `.orange`, `.red`, `.purple`, `.pink`)
|
|
16
18
|
- `.two-col` / `.three-col` -- column layouts
|
|
@@ -26,6 +28,7 @@ Full-screen scroll-snap presentation template. Each `.slide` div fills the viewp
|
|
|
26
28
|
Sprint status dashboard. Designed to be populated from `compilation.json` data.
|
|
27
29
|
|
|
28
30
|
**Sections:**
|
|
31
|
+
|
|
29
32
|
- Phase progress track (define/research/prototype/evaluate/compile)
|
|
30
33
|
- Evidence strength bars by topic
|
|
31
34
|
- Conflict tracker (unresolved + resolved)
|
|
@@ -34,6 +37,7 @@ Sprint status dashboard. Designed to be populated from `compilation.json` data.
|
|
|
34
37
|
- Full claim inventory table with type/evidence badges
|
|
35
38
|
|
|
36
39
|
**Badge classes:**
|
|
40
|
+
|
|
37
41
|
- Claim types: `.factual`, `.constraint`, `.estimate`, `.risk`, `.recommendation`, `.feedback`
|
|
38
42
|
- Evidence tiers: `.production`, `.tested`, `.documented`, `.web`, `.stated`
|
|
39
43
|
|
package/templates/adr.json
CHANGED
package/templates/brief.json
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
{ "name": "static-site", "format": "html" },
|
|
10
10
|
{ "name": "markdown-outline", "format": "md" }
|
|
11
11
|
],
|
|
12
|
-
"seedPacks": [
|
|
13
|
-
"architecture",
|
|
14
|
-
"compliance"
|
|
15
|
-
],
|
|
12
|
+
"seedPacks": ["architecture", "compliance"],
|
|
16
13
|
"scaffoldConfig": {
|
|
17
14
|
"defaultPlaceholders": {
|
|
18
15
|
"TITLE": "Decision Brief",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Certificate",
|
|
3
3
|
"description": "Compilation certificate rendered as a formal visual artifact. Shows hash, claim count, evidence breakdown, and conflict status with a centered, framed layout.",
|
|
4
|
-
"tags": [
|
|
4
|
+
"tags": [
|
|
5
|
+
"certificate",
|
|
6
|
+
"compilation",
|
|
7
|
+
"verification",
|
|
8
|
+
"reproducible",
|
|
9
|
+
"hash"
|
|
10
|
+
],
|
|
5
11
|
"author": "grainulation",
|
|
6
12
|
"version": "1.0.0",
|
|
7
13
|
"exportPresets": [
|
package/templates/dashboard.json
CHANGED
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
{ "name": "pdf-landscape", "format": "pdf" },
|
|
9
9
|
{ "name": "static-site", "format": "html" }
|
|
10
10
|
],
|
|
11
|
-
"seedPacks": [
|
|
12
|
-
"sprint-metrics",
|
|
13
|
-
"claim-summaries"
|
|
14
|
-
],
|
|
11
|
+
"seedPacks": ["sprint-metrics", "claim-summaries"],
|
|
15
12
|
"scaffoldConfig": {
|
|
16
13
|
"defaultPlaceholders": {
|
|
17
14
|
"TITLE": "Sprint Dashboard",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
r042
|
|
94
94
|
</td>
|
|
95
95
|
<td style="font-size:10pt; color:#94a3b8; line-height:1.4;">
|
|
96
|
-
SSE handles real-time updates
|
|
96
|
+
SSE handles real-time updates across the ecosystem. Zero npm dependencies.
|
|
97
97
|
</td>
|
|
98
98
|
</tr>
|
|
99
99
|
</table>
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
"tags": ["email", "digest", "update", "async", "communication"],
|
|
5
5
|
"author": "grainulation",
|
|
6
6
|
"version": "1.0.0",
|
|
7
|
-
"exportPresets": [
|
|
8
|
-
{ "name": "static-site", "format": "html" }
|
|
9
|
-
],
|
|
7
|
+
"exportPresets": [{ "name": "static-site", "format": "html" }],
|
|
10
8
|
"seedPacks": [],
|
|
11
9
|
"scaffoldConfig": {
|
|
12
10
|
"defaultPlaceholders": {
|
package/templates/explainer.json
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
{ "name": "static-site", "format": "html" },
|
|
10
10
|
{ "name": "markdown-outline", "format": "md" }
|
|
11
11
|
],
|
|
12
|
-
"seedPacks": [
|
|
13
|
-
"research-findings",
|
|
14
|
-
"evidence-tiers"
|
|
15
|
-
],
|
|
12
|
+
"seedPacks": ["research-findings", "evidence-tiers"],
|
|
16
13
|
"scaffoldConfig": {
|
|
17
14
|
"defaultPlaceholders": {
|
|
18
15
|
"TITLE": "Research Explainer",
|
package/templates/handoff.json
CHANGED
package/templates/rfc.json
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
{ "name": "static-site", "format": "html" },
|
|
10
10
|
{ "name": "markdown-outline", "format": "md" }
|
|
11
11
|
],
|
|
12
|
-
"seedPacks": [
|
|
13
|
-
"architecture",
|
|
14
|
-
"api-design"
|
|
15
|
-
],
|
|
12
|
+
"seedPacks": ["architecture", "api-design"],
|
|
16
13
|
"scaffoldConfig": {
|
|
17
14
|
"defaultPlaceholders": {
|
|
18
15
|
"RFC_NUMBER": "000",
|
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
{ "name": "pdf-landscape", "format": "pdf" },
|
|
9
9
|
{ "name": "static-site", "format": "html" }
|
|
10
10
|
],
|
|
11
|
-
"seedPacks": [
|
|
12
|
-
"security",
|
|
13
|
-
"compliance"
|
|
14
|
-
],
|
|
11
|
+
"seedPacks": ["security", "compliance"],
|
|
15
12
|
"scaffoldConfig": {
|
|
16
13
|
"defaultPlaceholders": {
|
|
17
14
|
"TITLE": "Risk Register",
|
|
@@ -2,14 +2,30 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"type": "object",
|
|
4
4
|
"properties": {
|
|
5
|
-
"title": {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"title": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"description": "Display name for the template"
|
|
8
|
+
},
|
|
9
|
+
"description": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "What this template is for"
|
|
12
|
+
},
|
|
13
|
+
"tags": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": { "type": "string" },
|
|
16
|
+
"description": "Searchable tags"
|
|
17
|
+
},
|
|
8
18
|
"author": { "type": "string" },
|
|
9
19
|
"version": { "type": "string", "description": "Semver version" },
|
|
10
20
|
"exportPresets": {
|
|
11
21
|
"type": "array",
|
|
12
|
-
"items": {
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"name": { "type": "string" },
|
|
26
|
+
"format": { "type": "string" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
13
29
|
"description": "Mill export presets — defines how this template can be exported (consumed by mill)"
|
|
14
30
|
},
|
|
15
31
|
"seedPacks": {
|
package/tools/README.md
CHANGED
|
@@ -7,14 +7,16 @@ Standalone utilities for structured research sprints. Each tool works independen
|
|
|
7
7
|
Scans a repo for `claims.json` files and determines which sprint is active using git history heuristics. No configuration file needed -- it derives everything from the filesystem and git log.
|
|
8
8
|
|
|
9
9
|
**Heuristic ranking:**
|
|
10
|
+
|
|
10
11
|
1. Non-archived sprints beat archived ones
|
|
11
12
|
2. Most recent git commit touching `claims.json` wins ties
|
|
12
13
|
3. Falls back to `meta.initiated` date, then claim count
|
|
13
14
|
|
|
14
15
|
**Programmatic use:**
|
|
16
|
+
|
|
15
17
|
```js
|
|
16
|
-
import { detectSprints } from
|
|
17
|
-
const { active, sprints } = detectSprints(
|
|
18
|
+
import { detectSprints } from "@grainulation/barn/detect-sprints";
|
|
19
|
+
const { active, sprints } = detectSprints("/path/to/repo");
|
|
18
20
|
```
|
|
19
21
|
|
|
20
22
|
## generate-manifest.js
|
|
@@ -22,6 +24,7 @@ const { active, sprints } = detectSprints('/path/to/repo');
|
|
|
22
24
|
Builds a `wheat-manifest.json` that maps topics to claims and files. Designed to give AI search tools a single entry point into a sprint repo instead of requiring full directory scans.
|
|
23
25
|
|
|
24
26
|
The manifest includes:
|
|
27
|
+
|
|
25
28
|
- Topic map with claim IDs and evidence levels
|
|
26
29
|
- Sprint detection results (via detect-sprints)
|
|
27
30
|
- File-to-topic associations
|
package/tools/build-pdf.js
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* Zero npm dependencies (Node built-in only).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { existsSync } from
|
|
14
|
-
import { execSync } from
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { execSync } from "node:child_process";
|
|
15
15
|
|
|
16
16
|
const target = process.argv[2];
|
|
17
17
|
|
|
18
|
-
if (!target || target ===
|
|
18
|
+
if (!target || target === "--help" || target === "-h") {
|
|
19
19
|
console.log(`build-pdf — convert markdown to PDF
|
|
20
20
|
|
|
21
21
|
Usage:
|
|
@@ -34,10 +34,10 @@ if (!existsSync(target)) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
try {
|
|
37
|
-
execSync(`npx md-to-pdf "${target}"`, { stdio:
|
|
38
|
-
const pdfPath = target.replace(/\.md$/,
|
|
37
|
+
execSync(`npx md-to-pdf "${target}"`, { stdio: "inherit" });
|
|
38
|
+
const pdfPath = target.replace(/\.md$/, ".pdf");
|
|
39
39
|
console.log(`PDF generated: ${pdfPath}`);
|
|
40
40
|
} catch (e) {
|
|
41
|
-
console.error(
|
|
41
|
+
console.error("PDF generation failed:", e.message);
|
|
42
42
|
process.exit(1);
|
|
43
43
|
}
|