incidentsutra 0.2.0 → 0.2.2
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +11 -0
- package/CITATION.cff +2 -2
- package/README.md +3 -3
- package/ROADMAP.md +1 -1
- package/docs/EVIDENCE_MODEL.md +1 -1
- package/docs/STATUS.md +1 -1
- package/docs/THREAT_MODEL.md +1 -1
- package/documents/IncidentSutra-AI/01-executive-summary.html +13 -12
- package/documents/IncidentSutra-AI/01-executive-summary.md +4 -0
- package/documents/IncidentSutra-AI/02-functional-spec.html +15 -14
- package/documents/IncidentSutra-AI/02-functional-spec.md +4 -0
- package/documents/IncidentSutra-AI/03-technical-spec.html +15 -16
- package/documents/IncidentSutra-AI/04-architecture.html +19 -17
- package/documents/IncidentSutra-AI/04-architecture.md +6 -0
- package/documents/IncidentSutra-AI/05-user-guide.html +28 -27
- package/documents/IncidentSutra-AI/05-user-guide.md +4 -0
- package/documents/IncidentSutra-AI/06-security-privacy-legal.html +14 -13
- package/documents/IncidentSutra-AI/06-security-privacy-legal.md +4 -0
- package/documents/IncidentSutra-AI/07-independent-audit.html +17 -15
- package/documents/IncidentSutra-AI/07-independent-audit.md +6 -0
- package/documents/IncidentSutra-AI/08-agent-catalog.html +9 -10
- package/documents/IncidentSutra-AI/09-faq.html +7 -8
- package/documents/IncidentSutra-AI/10-real-world-scenarios.html +31 -0
- package/documents/IncidentSutra-AI/10-real-world-scenarios.md +63 -0
- package/documents/IncidentSutra-AI/11-visual-guide.html +28 -0
- package/documents/IncidentSutra-AI/11-visual-guide.md +60 -0
- package/documents/IncidentSutra-AI/12-glossary.html +3 -0
- package/documents/IncidentSutra-AI/12-glossary.md +28 -0
- package/documents/IncidentSutra-AI/404.html +1 -0
- package/documents/IncidentSutra-AI/README.html +7 -8
- package/documents/IncidentSutra-AI/README.md +4 -2
- package/documents/IncidentSutra-AI/assets/site.css +263 -0
- package/documents/IncidentSutra-AI/assets/site.js +135 -0
- package/documents/IncidentSutra-AI/evidence/audit/audit-report.html +6 -4
- package/documents/IncidentSutra-AI/evidence/audit/audit-report.json +3 -3
- package/documents/IncidentSutra-AI/evidence/audit/audit-report.md +3 -3
- package/documents/IncidentSutra-AI/evidence/benchmark.json +13 -13
- package/documents/IncidentSutra-AI/evidence/samples/incident-report.html +5 -3
- package/documents/IncidentSutra-AI/evidence/samples/incident-report.json +2 -2
- package/documents/IncidentSutra-AI/evidence/samples/incident-report.md +2 -2
- package/documents/IncidentSutra-AI/evidence/samples/postmortem-draft.md +1 -1
- package/documents/IncidentSutra-AI/evidence/scenarios/database-pool.html +47 -0
- package/documents/IncidentSutra-AI/evidence/scenarios/deploy-blamed.html +47 -0
- package/documents/IncidentSutra-AI/evidence/scenarios/night-alert-storm.html +47 -0
- package/documents/IncidentSutra-AI/evidence/scenarios/payment-provider.html +47 -0
- package/documents/IncidentSutra-AI/evidence/scenarios/thin-evidence.html +47 -0
- package/documents/IncidentSutra-AI/evidence/scenarios/timezone-mixup.html +47 -0
- package/documents/IncidentSutra-AI/evidence/test-results.json +36 -4
- package/documents/IncidentSutra-AI/index.html +15 -0
- package/documents/IncidentSutra-AI/robots.txt +3 -0
- package/documents/IncidentSutra-AI/sitemap.xml +26 -0
- package/documents/IncidentSutra-AI/test-results.html +5 -6
- package/documents/IncidentSutra-AI/test-results.md +10 -2
- package/examples/reports/demo/hypothesis-register.md +1 -1
- package/examples/reports/demo/incident-report.html +5 -3
- package/examples/reports/demo/incident-report.json +2 -2
- package/examples/reports/demo/incident-report.md +2 -2
- package/examples/reports/demo/postmortem-draft.md +1 -1
- package/examples/reports/demo/provenance.json +8 -8
- package/fixtures/scenarios/database-pool/events.jsonl +6 -0
- package/fixtures/scenarios/deploy-blamed/events.jsonl +6 -0
- package/fixtures/scenarios/night-alert-storm/events.jsonl +10 -0
- package/fixtures/scenarios/payment-provider/events.jsonl +6 -0
- package/fixtures/scenarios/thin-evidence/events.jsonl +3 -0
- package/fixtures/scenarios/timezone-mixup/events.jsonl +4 -0
- package/llms.txt +3 -0
- package/package.json +2 -2
- package/packages/reporter/index.mjs +1 -1
- package/packages/reporter/theme.mjs +4 -2
- package/scripts/build-docs.mjs +205 -51
- package/scripts/build-site.mjs +27 -0
- package/scripts/install.cmd +2 -2
- package/site/diagrams.mjs +68 -0
- package/site/extra.css +62 -0
- package/site/incident.css +31 -0
- package/site/site.css +168 -0
- package/site/site.js +135 -0
package/scripts/build-docs.mjs
CHANGED
|
@@ -1,72 +1,226 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Builds the documentation website into documents/IncidentSutra-AI from its Markdown. Dependency-free.
|
|
3
|
+
// Light theme by default; dark by toggle. Numbers come from evidence/, scenario results from real analysis runs.
|
|
4
|
+
// Directives (HTML comments, invisible on GitHub): <!-- svg:name --> <!-- flow:name --> <!-- chart:name --> <!-- scenario:folder -->
|
|
5
|
+
// `--check` fails when committed output differs from what the sources would produce.
|
|
2
6
|
import fs from 'node:fs';
|
|
3
7
|
import path from 'node:path';
|
|
4
|
-
import {
|
|
8
|
+
import {fileURLToPath} from 'node:url';
|
|
9
|
+
import {DIAGRAMS, FLOWS, NARROW} from '../site/diagrams.mjs';
|
|
10
|
+
import {loadEvents} from '../packages/core/ingest.mjs';
|
|
11
|
+
import {analyzeIncident, toHTML} from '../packages/core/analyze.mjs';
|
|
12
|
+
import {SECRET_CORPUS, KNOWN_REDACTION_GAPS} from '../packages/core/audit.mjs';
|
|
13
|
+
import {svgTimeline} from '../packages/reporter/index.mjs';
|
|
5
14
|
|
|
6
15
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
7
|
-
const
|
|
16
|
+
const DIR = path.join(root, 'documents/IncidentSutra-AI');
|
|
8
17
|
const check = process.argv.includes('--check');
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
18
|
+
const GH = 'https://github.com/shahvatsalofficial/IncidentSutra-AI';
|
|
19
|
+
const SITE = 'https://shahvatsalofficial.github.io/IncidentSutra-AI';
|
|
20
|
+
const NPM = 'https://www.npmjs.com/package/incidentsutra';
|
|
21
|
+
const read = f => fs.readFileSync(path.join(root, f), 'utf8').replace(/\r\n/g, '\n');
|
|
22
|
+
const json = f => JSON.parse(read(f));
|
|
23
|
+
const V = json('package.json').version;
|
|
24
|
+
const tests = json('documents/IncidentSutra-AI/evidence/test-results.json');
|
|
25
|
+
const audit = json('documents/IncidentSutra-AI/evidence/audit/audit-report.json');
|
|
26
|
+
const bench = json('documents/IncidentSutra-AI/evidence/benchmark.json');
|
|
27
|
+
const skills = json('agents/manifest.json').agents.length;
|
|
28
|
+
const esc = s => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
29
|
+
const headingId = t => t.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
const GROUPS = [
|
|
32
|
+
['Start here', ['01-executive-summary', '11-visual-guide', '05-user-guide', '10-real-world-scenarios']],
|
|
33
|
+
['Reference', ['02-functional-spec', '03-technical-spec', '08-agent-catalog', '12-glossary']],
|
|
34
|
+
['Design and trust', ['04-architecture', '06-security-privacy-legal', '07-independent-audit', 'test-results']],
|
|
35
|
+
['Help', ['09-faq', 'README']]
|
|
36
|
+
];
|
|
37
|
+
const ORDER = GROUPS.flatMap(g => g[1]);
|
|
38
|
+
const SCENARIOS = [
|
|
39
|
+
['deploy-blamed', '"It was the deploy!"', 'The errors started before the release did.', 'k-bad'],
|
|
40
|
+
['timezone-mixup', 'The time zone trap', 'Two clocks make a cause look like an effect.', 'k-warn'],
|
|
41
|
+
['payment-provider', 'Provider slow, search shipped', 'The innocent release is about to be rolled back.', 'k-info'],
|
|
42
|
+
['database-pool', 'The connection pool', 'A metric moves from 40 to 200 connections.', 'k-info'],
|
|
43
|
+
['night-alert-storm', '3 a.m. alert storm', 'One storm, one first signal, secrets masked.', 'k-bad'],
|
|
44
|
+
['thin-evidence', 'Almost no evidence', 'The tool refuses to guess and says what is missing.', 'k-warn']
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const ICONS = {
|
|
48
|
+
search: '<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>',
|
|
49
|
+
sun: '<circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/>',
|
|
50
|
+
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
51
|
+
menu: '<path d="M3 6h18M3 12h18M3 18h18"/>',
|
|
52
|
+
copy: '<rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',
|
|
53
|
+
arrow: '<path d="M5 12h14M12 5l7 7-7 7"/>',
|
|
54
|
+
code: '<path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/>',
|
|
55
|
+
shield: '<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>',
|
|
56
|
+
lock: '<rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',
|
|
57
|
+
file: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/>',
|
|
58
|
+
eye: '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>',
|
|
59
|
+
layers: '<path d="M12 2l10 5-10 5L2 7z"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5"/>',
|
|
60
|
+
clock: '<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>',
|
|
61
|
+
check: '<path d="M20 6L9 17l-5-5"/>'
|
|
62
|
+
};
|
|
63
|
+
const sprite = `<svg width="0" height="0" style="position:absolute" aria-hidden="true"><defs>${Object.entries(ICONS).map(([k, v]) => `<symbol id="i-${k}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${v}</symbol>`).join('')}</defs></svg>`;
|
|
64
|
+
const ic = (n, s = 20) => `<svg class="ic" width="${s}" height="${s}" aria-hidden="true"><use href="#i-${n}"/></svg>`;
|
|
65
|
+
|
|
66
|
+
// ---------- Markdown ----------
|
|
67
|
+
const href = u => {
|
|
68
|
+
if (/^(https?:|mailto:|#)/i.test(u)) return u;
|
|
69
|
+
if (!/^[\w./-]+(#[\w-]*)?$/.test(u) || u.startsWith('/')) return '#';
|
|
70
|
+
if (u.startsWith('../')) return `${GH}/blob/main/${u.replace(/^(\.\.\/)+/, '')}`;
|
|
71
|
+
return u.replace(/^([\w-]+)\.md(#|$)/, '$1.html$2');
|
|
72
|
+
};
|
|
73
|
+
function inline(s) {
|
|
74
|
+
const codes = [];
|
|
75
|
+
s = s.replace(/`([^`]+)`/g, (_, c) => { codes.push(c); return `\u0000${codes.length - 1}\u0000`; });
|
|
76
|
+
s = esc(s)
|
|
77
|
+
.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (_, t, u) => { const h = href(u.replace(/&/g, '&')); return `<a href="${esc(h)}"${/^https?:/.test(h) ? ' rel="noopener"' : ''}>${t}</a>`; })
|
|
78
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>').replace(/(^|[\s(])_([^_]+)_(?=[\s.,;:)]|$)/g, '$1<em>$2</em>');
|
|
79
|
+
return s.replace(/\u0000(\d+)\u0000/g, (_, i) => `<code>${esc(codes[i])}</code>`);
|
|
80
|
+
}
|
|
81
|
+
function mdToHtml(md, directive) {
|
|
82
|
+
const lines = md.split('\n'), out = [], toc = [], para = [];
|
|
83
|
+
let i = 0, firstQuote = true;
|
|
84
|
+
const flush = () => { if (para.length) { out.push(`<p>${inline(para.join(' '))}</p>`); para.length = 0; } };
|
|
21
85
|
while (i < lines.length) {
|
|
22
86
|
const l = lines[i];
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
87
|
+
if (/^\s*$/.test(l)) { flush(); i++; continue; }
|
|
88
|
+
const fence = l.match(/^```(\w*)/);
|
|
89
|
+
if (fence) { flush(); const buf = []; i++; while (i < lines.length && !/^```/.test(lines[i])) buf.push(lines[i++]); i++; out.push(`<pre class="code" data-lang="${esc(fence[1])}"><code>${esc(buf.join('\n'))}</code><button class="copy" type="button">Copy</button></pre>`); continue; }
|
|
90
|
+
const dir = l.match(/^<!--\s*(svg|flow|chart|scenario):([\w-]+)\s*-->$/);
|
|
91
|
+
if (dir) { flush(); out.push(directive(dir[1], dir[2])); i++; continue; }
|
|
28
92
|
const h = l.match(/^(#{1,4})\s+(.*)$/);
|
|
29
|
-
if (h) {
|
|
93
|
+
if (h) {
|
|
94
|
+
flush(); const id = headingId(h[2]), n = h[1].length;
|
|
95
|
+
if (n === 2 || n === 3) toc.push({level: n, text: h[2].replace(/`/g, ''), id});
|
|
96
|
+
out.push(n === 1 ? `<h1>${inline(h[2])}</h1>` : `<h${n} id="${id}">${inline(h[2])}<a class="anchor" href="#${id}" aria-label="Link to this section">#</a></h${n}>`); i++; continue;
|
|
97
|
+
}
|
|
98
|
+
if (/^---+\s*$/.test(l)) { flush(); out.push('<hr>'); i++; continue; }
|
|
99
|
+
if (/^>\s?/.test(l)) {
|
|
100
|
+
flush(); const buf = []; while (i < lines.length && /^>\s?/.test(lines[i])) buf.push(lines[i++].replace(/^>\s?/, ''));
|
|
101
|
+
out.push(`<blockquote class="${firstQuote ? 'lead-q' : 'callout-note'}">${inline(buf.join(' '))}</blockquote>`); firstQuote = false; continue;
|
|
102
|
+
}
|
|
30
103
|
if (/^\|.*\|\s*$/.test(l) && /^\|[\s:|-]+\|\s*$/.test(lines[i + 1] ?? '')) {
|
|
31
|
-
const cells = r => r.trim().replace(/^\||\|$/g, '').split(
|
|
104
|
+
flush(); const cells = r => r.trim().replace(/^\||\|$/g, '').split(/(?<!\\)\|/).map(c => c.trim().replace(/\\\|/g, '|'));
|
|
32
105
|
const head = cells(l); i += 2; const rows = [];
|
|
33
106
|
while (i < lines.length && /^\|.*\|\s*$/.test(lines[i])) rows.push(cells(lines[i++]));
|
|
34
|
-
out.push(`<div class="
|
|
107
|
+
out.push(`<div class="table-wrap"><table><thead><tr>${head.map(c => `<th scope="col">${inline(c)}</th>`).join('')}</tr></thead><tbody>${rows.map(r => `<tr>${r.map(c => `<td>${inline(c)}</td>`).join('')}</tr>`).join('')}</tbody></table></div>`); continue;
|
|
35
108
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
109
|
+
const li = l.match(/^(\s*)([-*]|\d+\.)\s+(.*)$/);
|
|
110
|
+
if (li) {
|
|
111
|
+
flush(); const tag = /\d/.test(li[2]) ? 'ol' : 'ul', items = [];
|
|
112
|
+
while (i < lines.length) { const m = lines[i].match(/^(\s*)([-*]|\d+\.)\s+(.*)$/); if (m) { items.push(m[3]); i++; } else if (/^\s{2,}\S/.test(lines[i]) && items.length) { items[items.length - 1] += ' ' + lines[i].trim(); i++; } else break; }
|
|
113
|
+
out.push(`<${tag}>${items.map(x => `<li>${inline(x)}</li>`).join('')}</${tag}>`); continue;
|
|
40
114
|
}
|
|
41
|
-
|
|
42
|
-
if (/^---+\s*$/.test(l)) { out.push('<hr>'); i++; continue; }
|
|
43
|
-
if (!l.trim()) { i++; continue; }
|
|
44
|
-
const buf = [];
|
|
45
|
-
while (i < lines.length && lines[i].trim() && !/^(#{1,4}\s|```|\||\s*[-*]\s|\s*\d+\.\s|>|---+\s*$)/.test(lines[i])) buf.push(lines[i++]);
|
|
46
|
-
out.push(`<p>${inline(buf.join(' '))}</p>`);
|
|
115
|
+
para.push(l.trim()); i++;
|
|
47
116
|
}
|
|
48
|
-
|
|
117
|
+
flush();
|
|
118
|
+
return {html: out.join('\n'), toc};
|
|
49
119
|
}
|
|
50
120
|
|
|
51
|
-
|
|
121
|
+
// ---------- charts and scenarios ----------
|
|
122
|
+
const bars = rows => { const max = Math.max(1, ...rows.map(r => r[1])); return `<div class="bars">${rows.map(([l, v, c = '', label]) => `<div class="bar"><span class="lab">${esc(l)}</span><div class="trk"><div class="fill ${c}" style="width:${v ? Math.max(3, Math.round(100 * v / max)) : 0}%"></div></div><span class="val">${esc(label ?? v)}</span></div>`).join('')}</div>`; };
|
|
123
|
+
const chart = (title, body, note = '') => `<figure class="chart"><h4>${esc(title)}</h4>${body}${note ? `<p class="note">${esc(note)}</p>` : ''}</figure>`;
|
|
124
|
+
const stack = (parts, label) => `<div class="stack" role="img" aria-label="${esc(label)}">${parts.map(([v, c]) => `<i style="width:${v}%;background:var(${c})"></i>`).join('')}</div>`;
|
|
125
|
+
const legend = items => `<p class="legend">${items.map(([c, t]) => `<span><b style="background:var(${c})"></b>${esc(t)}</span>`).join('')}</p>`;
|
|
126
|
+
const CHARTS = {
|
|
127
|
+
tests: () => chart(`Automated tests: ${tests.pass} of ${tests.total} pass`, stack([[100 * tests.pass / tests.total, '--ok'], [100 * tests.skipped / tests.total, '--warn'], [100 * tests.fail / tests.total, '--bad']], `${tests.pass} passed, ${tests.skipped} skipped, ${tests.fail} failed`) + legend([['--ok', `${tests.pass} passed`], ['--warn', `${tests.skipped} skipped`], ['--bad', `${tests.fail} failed`]]), `Recorded with Node ${tests.environment.node} on ${tests.environment.platform}. ${tests.skippedReason}`),
|
|
128
|
+
audit: () => { const areas = {}; for (const c of audit.checks) { areas[c.area] ??= [0, 0]; areas[c.area][1]++; if (c.status === 'pass') areas[c.area][0]++; } return chart(`Self-audit: ${audit.counts.pass} of ${audit.counts.total} checks pass, ${audit.counts.skipped} skipped, ${audit.counts.fail} failed`, bars(Object.entries(areas).map(([a, [p, t]]) => [a, t, p === t ? 'ok' : 'warn', `${p}/${t}`])), `${audit.nature}. Verdict ${audit.verdict}. Bar length is the number of checks in the area.`); },
|
|
129
|
+
redaction: () => chart(`Masking corpus: ${SECRET_CORPUS.length} synthetic secret classes`, `<div class="chips">${SECRET_CORPUS.map(([n]) => `<span>${esc(n)}</span>`).join('')}</div><h4 style="margin-top:1rem">Not covered</h4><div class="chips">${KNOWN_REDACTION_GAPS.map(n => `<span>${esc(n)}</span>`).join('')}</div>`, 'Best effort only. This is not data-loss prevention. Sanitize exports before analysis.'),
|
|
130
|
+
benchmark: () => chart(`Synthetic benchmark: ${bench.casesPassed} of ${bench.cases} cases, ${bench.expectationsPassed} of ${bench.expectations} expectations`, `<div class="chips">${bench.results.map(r => `<span title="${esc(r.title)}">${r.pass ? '✓' : '✗'} ${esc(r.family)}</span>`).join('')}</div>`, bench.labelProvenance)
|
|
131
|
+
};
|
|
52
132
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const nav = mds.map(m => `<a href="${m.replace(/\.md$/, '.html')}"${m === f ? ' aria-current="page"' : ''}>${esc(titles[m])}</a>` + (m === f ? `<div class="sub">${toc.filter(t => t[0] === 2).map(t => `<a href="#${t[1]}">${esc(t[2])}</a>`).join('')}</div>` : '')).join('');
|
|
60
|
-
const page = `<!doctype html>\n<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><title>${esc(titles[f])} · IncidentSutra AI</title><meta name="description" content="IncidentSutra AI documentation: evidence-first, offline, read-only incident investigation."><style>${CSS}</style></head><body><a class="skip" href="#content">Skip to content</a><div class="layout"><nav aria-label="Documentation"><b>IncidentSutra AI</b>${nav}<p><a href="https://github.com/shahvatsalofficial/IncidentSutra-AI">GitHub</a> · <a href="https://www.npmjs.com/package/incidentsutra">npm</a></p></nav><main id="content">${html}<footer>Apache-2.0 · Created by Vatsal Shah · Generated from <code>${esc(f)}</code>. Advisory only; this documentation makes no root-cause or production-safety claim.</footer></main></div></body></html>\n`;
|
|
61
|
-
const target = path.join(dir, f.replace(/\.md$/, '.html'));
|
|
62
|
-
if (check) { if (!fs.existsSync(target) || fs.readFileSync(target, 'utf8') !== page) stale.push(path.basename(target)); }
|
|
63
|
-
else fs.writeFileSync(target, page);
|
|
64
|
-
}
|
|
65
|
-
return { count: mds.length, stale };
|
|
133
|
+
const outputs = new Map();
|
|
134
|
+
const scn = {};
|
|
135
|
+
for (const [name] of SCENARIOS) {
|
|
136
|
+
const data = await loadEvents(path.join(root, 'fixtures/scenarios', name));
|
|
137
|
+
scn[name] = analyzeIncident(data, {synthetic: true});
|
|
138
|
+
outputs.set(`evidence/scenarios/${name}.html`, toHTML(scn[name]));
|
|
66
139
|
}
|
|
140
|
+
function scenario(name) {
|
|
141
|
+
const r = scn[name]; if (!r) throw new Error('Unknown scenario ' + name);
|
|
142
|
+
const hyps = r.hypotheses.map(x => `<div class="hcard"><b>${esc(x.title)}</b><p class="chips"><span>${esc(x.family)}</span><span>supports ${x.supportingEventIds.length}</span><span class="${x.contradictingEventIds.length ? 'against' : ''}">against ${x.contradictingEventIds.length}</span><span>unconfirmed</span></p>${x.contradictions.map(c => `<p class="why">${esc(c.note)}</p>`).join('')}</div>`).join('');
|
|
143
|
+
const extra = [r.alertStorms.map(a => `Alert storm: ${a.count} signals`).join(', '), r.privacy.redactions ? `${r.privacy.redactions} values masked` : '', r.ingestionErrors.length ? `${r.ingestionErrors.length} record rejected: ${r.ingestionErrors[0].error}` : '', ...r.metricSeries.map(m => `${m.name}: ${m.first.value} to ${m.last.value}`)].filter(Boolean);
|
|
144
|
+
return `<div class="scnbox"><div class="mock-cards four"><div><b>${r.summary.count}</b><span>events</span></div><div><b>${r.hypotheses.length}</b><span>hypotheses</span></div><div><b>${r.contradictions.length}</b><span>contradictions</span></div><div><b>${r.gaps.length}</b><span>gaps</span></div></div><ol class="vtl">${r.timeline.map(t => `<li class="${/deploy|release|rollout|rollback/.test(t.type) ? 'change' : /error|alert|critical|incident/.test(t.type + ' ' + t.severity) ? 'issue' : ''}"><time datetime="${t.timestamp}">${t.timestamp.slice(11, 19)} UTC</time><em>${esc(t.service)} ${esc(t.type)}</em>${esc(t.description)}</li>`).join('')}</ol><div class="dia-scroll tl">${svgTimeline(r)}</div><p class="legend"><span>◆ change</span><span>● error or alert</span><span>■ other</span></p>${extra.length ? `<div class="chips">${extra.map(x => `<span>${esc(x)}</span>`).join('')}</div>` : ''}<h4>What the report offers</h4><div class="hgrid">${hyps}</div>${r.gaps.length ? `<h4>Still unknown</h4><ul>${r.gaps.map(g => `<li>${esc(g.message)}</li>`).join('')}</ul>` : ''}<p><a class="btn" href="evidence/scenarios/${name}.html">Open the full report ${ic('arrow', 18)}</a></p></div>`;
|
|
145
|
+
}
|
|
146
|
+
const steps = (list, cls) => `<ol class="flow ${cls}">${list.map(([t, d, c]) => `<li class="${c || ''}"><b>${inline(t)}</b><span>${inline(d)}</span></li>`).join('')}</ol>`;
|
|
147
|
+
const diagram = name => `<figure class="dia"><div class="dia-wide">${DIAGRAMS[name]()}</div>${steps(NARROW[name], 'dia-narrow')}</figure>`;
|
|
148
|
+
const directive = (kind, name) => {
|
|
149
|
+
if (kind === 'scenario') return scenario(name);
|
|
150
|
+
if (kind === 'svg') { if (!DIAGRAMS[name]) throw new Error('Unknown diagram ' + name); return diagram(name); }
|
|
151
|
+
if (kind === 'chart') { if (!CHARTS[name]) throw new Error('Unknown chart ' + name); return CHARTS[name](); }
|
|
152
|
+
const f = FLOWS[name]; if (!f) throw new Error('Unknown flow ' + name);
|
|
153
|
+
return `<ol class="flow${f.row ? ' row' : ''}" style="--n:${f.steps.length > 5 ? 3 : f.steps.length}">${f.steps.map(([t, d, c]) => `<li class="${c || ''}"><b>${inline(t)}</b><span>${inline(d)}</span></li>`).join('')}</ol>`;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// ---------- shell ----------
|
|
157
|
+
const favicon = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%234338ca'/%3E%3Cpath d='M5 17h5l3-8 5 15 3-7h6' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E";
|
|
158
|
+
const logo = '<span class="logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 32 32"><path d="M4 17h6l3-9 6 16 3-7h6" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg></span><span class="brand-name">Incident<b>Sutra</b> AI</span>';
|
|
159
|
+
const themeInit = "try{var t=localStorage.getItem('incidentsutra-theme');document.documentElement.setAttribute('data-theme',t==='dark'?'dark':'light')}catch(e){document.documentElement.setAttribute('data-theme','light')}";
|
|
160
|
+
const head = ({title, desc, canon, extra = ''}) => `<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${esc(title)}</title><meta name="description" content="${esc(desc)}"><meta name="keywords" content="incident response, SRE, on-call, postmortem, root cause analysis, incident timeline, OpenTelemetry, agent skills, Claude Code, Cursor, Codex, Gemini CLI, Copilot"><meta name="color-scheme" content="light dark"><meta name="theme-color" content="#4338ca"><meta name="author" content="Vatsal Shah"><link rel="canonical" href="${canon}"><meta property="og:title" content="${esc(title)}"><meta property="og:description" content="${esc(desc)}"><meta property="og:type" content="website"><meta property="og:site_name" content="IncidentSutra AI"><meta property="og:url" content="${canon}"><meta name="twitter:card" content="summary"><link rel="icon" href="${favicon}"><script>${themeInit}</script><link rel="stylesheet" href="assets/site.css">${extra}</head>`;
|
|
161
|
+
const NAV = [['05-user-guide', 'Guide'], ['10-real-world-scenarios', 'Scenarios'], ['11-visual-guide', 'Visuals'], ['04-architecture', 'Architecture'], ['07-independent-audit', 'Proof']];
|
|
162
|
+
const topbar = (home, cur) => `<header class="topbar"><div class="topbar-in"><button class="icon-btn menu-btn" type="button" aria-label="Open navigation menu" aria-expanded="false" aria-controls="sidebar">${ic('menu')}</button><a class="brand" href="${home ? '#top' : 'index.html'}">${logo}<span class="ver">v${V}</span></a><nav class="topnav" aria-label="Primary">${NAV.map(([s, t]) => `<a href="${s}.html"${cur === s ? ' aria-current="page"' : ''}>${t}</a>`).join('')}</nav><div class="search" role="search">${ic('search', 18)}<label class="sr" for="q">Search the documentation</label><input id="q" type="search" placeholder="Search docs" autocomplete="off" role="combobox" aria-expanded="false" aria-controls="results"><kbd aria-hidden="true">/</kbd><ul id="results" role="listbox" hidden></ul></div><a class="icon-btn gh" href="${GH}" rel="noopener" aria-label="IncidentSutra AI on GitHub">${ic('code')}</a><button class="icon-btn theme-btn" type="button" aria-pressed="false" aria-label="Switch to dark theme"><svg class="ic i-sun" width="20" height="20" aria-hidden="true"><use href="#i-sun"/></svg><svg class="ic i-moon" width="20" height="20" aria-hidden="true"><use href="#i-moon"/></svg></button></div></header>`;
|
|
163
|
+
const col = (title, links) => `<div><p class="foot-title">${title}</p><ul>${links.map(([u, t]) => `<li><a href="${u}"${/^http/.test(u) ? ' rel="noopener"' : ''}>${t}</a></li>`).join('')}</ul></div>`;
|
|
164
|
+
const footer = () => `<footer class="site-foot"><div class="foot-in"><div class="foot-brand"><a class="brand" href="index.html">${logo}</a><p>Observe precisely. Reason cautiously. Recover responsibly.</p><p class="fine">Created by Vatsal Shah. Apache-2.0.</p></div>${col('Start', [['01-executive-summary.html', 'Overview'], ['05-user-guide.html', 'User guide'], ['10-real-world-scenarios.html', 'Scenarios']])}${col('Reference', [['02-functional-spec.html', 'Functional spec'], ['03-technical-spec.html', 'Technical spec'], ['12-glossary.html', 'Glossary']])}${col('Trust', [['06-security-privacy-legal.html', 'Security and legal'], ['07-independent-audit.html', 'Audit'], ['test-results.html', 'Test results']])}${col('Project', [[GH, 'GitHub'], [NPM, 'npm'], [`${GH}/blob/main/CHANGELOG.md`, 'Changelog']])}</div><p class="legal">IncidentSutra AI ${V}. Advisory output for people: it does not determine root cause and is not legal, compliance or security certification. The audit is a self-audit. Product names belong to their owners; no endorsement is implied.</p></footer>`;
|
|
165
|
+
|
|
166
|
+
const pages = ORDER.map(slug => {
|
|
167
|
+
const raw = read(`documents/IncidentSutra-AI/${slug}.md`);
|
|
168
|
+
return {slug, raw, title: (raw.match(/^#\s+(.+)$/m) || [, slug])[1].replace(/`/g, ''), summary: (raw.match(/^>\s+(.+)$/m) || [, ''])[1].replace(/[*`]/g, '')};
|
|
169
|
+
});
|
|
170
|
+
const unknown = fs.readdirSync(DIR).filter(f => f.endsWith('.md') && !ORDER.includes(f.slice(0, -3)));
|
|
171
|
+
if (unknown.length) throw new Error(`Markdown files missing from GROUPS: ${unknown.join(', ')}`);
|
|
172
|
+
const plain = md => md.replace(/```[\s\S]*?```/g, ' ').replace(/<!--[\s\S]*?-->/g, ' ').replace(/[`*#>|_\[\]()]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
173
|
+
const index = pages.map(p => ({t: p.title, u: `${p.slug}.html`, x: plain(p.raw).slice(0, 2500)}));
|
|
174
|
+
const tail = () => `<script>window.__DOCS_INDEX__=${JSON.stringify(index).replace(/</g, '\\u003c')}</script><script src="assets/site.js" defer></script></body></html>\n`;
|
|
175
|
+
const side = cur => `<aside class="sidebar" id="sidebar" aria-label="Documentation"><a class="nav-home" href="index.html">Home</a>${GROUPS.map(([g, slugs]) => `<div class="nav-group"><p class="nav-title">${g}</p><ol>${slugs.map(s => `<li><a href="${s}.html"${s === cur ? ' aria-current="page"' : ''}>${esc(s === 'README' ? 'Documentation map' : pages.find(x => x.slug === s).title)}</a></li>`).join('')}</ol></div>`).join('')}</aside><div class="scrim" hidden></div>`;
|
|
176
|
+
|
|
177
|
+
pages.forEach((p, n) => {
|
|
178
|
+
const {html, toc} = mdToHtml(p.raw, directive);
|
|
179
|
+
const prev = pages[n - 1], next = pages[n + 1];
|
|
180
|
+
const tocUl = `<ul>${toc.map(t => `<li class="l${t.level}"><a href="#${t.id}">${esc(t.text)}</a></li>`).join('')}</ul>`;
|
|
181
|
+
const tocM = `<details class="toc-m"><summary>On this page</summary>${tocUl}</details>`;
|
|
182
|
+
const body = html.replace('</blockquote>', () => '</blockquote>' + tocM).replace(/^<h1>/, `<p class="eyebrow">${esc(GROUPS.find(g => g[1].includes(p.slug))[0])}</p><h1>`);
|
|
183
|
+
outputs.set(`${p.slug}.html`, `${head({title: `${p.title} · IncidentSutra AI`, desc: p.summary || `${p.title} for IncidentSutra AI, the offline incident evidence CLI.`, canon: `${SITE}/${p.slug}.html`})}<body><a class="skip" href="#content">Skip to content</a>${sprite}${topbar(false, p.slug)}<div class="layout">${side(p.slug)}<main class="content" id="content" tabindex="-1"><article class="prose">${body}<p class="edit"><a href="${GH}/blob/main/documents/IncidentSutra-AI/${p.slug}.md" rel="noopener">View this page source on GitHub</a></p><nav class="pager" aria-label="Pagination">${prev ? `<a class="prev" href="${prev.slug}.html"><span>Previous</span><b>${esc(prev.title)}</b></a>` : '<span></span>'}${next ? `<a class="next" href="${next.slug}.html"><span>Next</span><b>${esc(next.title)}</b></a>` : '<span></span>'}</nav></article></main><nav class="toc" aria-label="On this page"><h2>On this page</h2>${tocUl}</nav></div>${footer()}${tail()}`);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// ---------- home ----------
|
|
187
|
+
const demo = scn['deploy-blamed'];
|
|
188
|
+
const mock = `<div class="mock" role="img" aria-label="Sample report: errors began before the release, so the report lists counter-evidence"><div class="mock-bar"><i></i><i></i><i></i><span>incident-report.html</span></div><div class="mock-in"><div class="mock-head"><b>orders: errors rising</b><span class="pill warn">HUMAN REVIEW</span></div><div class="mock-cards"><div><b>${demo.summary.count}</b><span>observed</span></div><div><b>${demo.hypotheses.length}</b><span>hypotheses</span></div><div><b>${demo.contradictions.length}</b><span>against</span></div></div><ul class="mock-list"><li><span class="pill bad">10:02</span> first error: before the release</li><li><span class="pill ok">10:06</span> release 4.2.0 rolled out</li><li><span class="pill warn">verdict</span> cause unconfirmed; pre-existing defect also possible</li></ul></div></div>`;
|
|
189
|
+
const feats = [['clock', 'An auditable timeline', 'Strict time zones, nanoseconds kept, every line traced to a file, record and SHA-256.'], ['layers', 'Competing explanations', 'Change, dependency, saturation, datastore, latent defect and unknown, side by side.'], ['eye', 'Counter-evidence first', 'Errors that started before a release are shown against it, not hidden.'], ['file', 'Reports people can read', 'Single-file HTML, Markdown, JSON and a blameless postmortem draft.'], ['lock', 'Stays on your machine', 'No network, no API key, no telemetry, no dependencies, nothing executed.'], ['shield', 'Checks itself', `${audit.counts.total} automated checks, written as HTML, Markdown and JSON.`]];
|
|
190
|
+
const faqs = [['Does it find the root cause?', 'No. It lists explanations you can disprove, with evidence for and against. Every one stays unconfirmed.'], ['Does it need an API key or internet?', 'No. It uses only Node.js built-ins.'], ['Can it change production?', 'There is no code path for it: no network client and no process execution in product code.'], ['Is my data safe?', 'It never leaves your machine unless you share it. Masking is best effort, so sanitize exports first.'], ['Is the audit a certification?', 'No. It is a self-audit that anyone can rerun.'], ['Can I use it commercially?', 'Yes, under Apache-2.0, provided as is.']];
|
|
191
|
+
const INSTALL = 'npx incidentsutra doctor';
|
|
192
|
+
const install = (cls = '') => `<div class="install ${cls}"><span class="prompt" aria-hidden="true">$</span><code>${INSTALL}</code><button class="copy-inline" type="button" aria-label="Copy command">${ic('copy', 16)}<span>Copy</span></button></div>`;
|
|
193
|
+
const sec = (alt, kicker, title, sub, body) => `<section class="sec${alt ? ' alt' : ''}"><div class="wrap"><p class="kicker">${kicker}</p><h2>${title}</h2>${sub ? `<p class="sub">${sub}</p>` : ''}${body}</div></section>`;
|
|
194
|
+
const homeDesc = 'Offline, read-only incident investigation CLI: auditable UTC timelines, competing root-cause hypotheses with counter-evidence, blameless postmortems, HTML, Markdown and JSON reports, and 20 agent skills.';
|
|
195
|
+
const LD = JSON.stringify({'@context': 'https://schema.org', '@type': 'SoftwareApplication', name: 'IncidentSutra AI', applicationCategory: 'DeveloperApplication', operatingSystem: 'Windows, macOS, Linux (Node.js 20+)', softwareVersion: V, license: 'https://www.apache.org/licenses/LICENSE-2.0', author: {'@type': 'Person', name: 'Vatsal Shah', url: 'https://github.com/shahvatsalofficial'}, url: SITE + '/', codeRepository: GH, description: homeDesc, offers: {'@type': 'Offer', price: '0', priceCurrency: 'USD'}});
|
|
196
|
+
outputs.set('index.html', `${head({title: 'IncidentSutra AI · Offline incident evidence and root-cause reasoning CLI', desc: homeDesc, canon: `${SITE}/`, extra: `<script type="application/ld+json">${LD}</script>`})}<body class="home-page" id="top"><a class="skip" href="#main">Skip to content</a>${sprite}${topbar(true, '')}<main id="main">
|
|
197
|
+
<section class="hero"><div class="wrap hero-grid"><div><p class="badge"><span class="dot"></span>v${V} · Apache-2.0 · zero dependencies</p><h1>Find what <span class="grad">really happened</span>, not the first guess.</h1><p class="lead">IncidentSutra AI turns exported logs, alerts, metrics and deployments into an auditable timeline, several competing explanations with the evidence against each, and a blameless postmortem draft. Offline. Read-only. Honest about what it does not know.</p><div class="cta"><a class="btn primary" href="05-user-guide.html">Get started ${ic('arrow', 18)}</a><a class="btn" href="10-real-world-scenarios.html">See real scenarios</a></div>${install()}<ul class="facts"><li>Node 20+</li><li>No API key</li><li>No network</li><li>HTML · MD · JSON</li></ul></div><div class="hero-art">${mock}</div></div></section>
|
|
198
|
+
<section class="statband" aria-label="Key facts"><div class="wrap"><ul><li><b>${tests.pass}</b><span>tests passing</span></li><li><b>${audit.counts.pass}/${audit.counts.total}</b><span>audit checks pass</span></li><li><b>${bench.casesPassed}</b><span>synthetic cases</span></li><li><b>${skills}</b><span>agent skills</span></li><li><b>0</b><span>dependencies</span></li></ul></div></section>
|
|
199
|
+
${sec(false, 'The problem', 'The first story of an outage is easy to believe', 'A recent deploy, mixed time zones and missing data all push a team toward one explanation. IncidentSutra keeps the alternatives and the gaps visible.', `<div class="feat-grid">${feats.map(([i, t, d]) => `<div class="feat"><div class="feat-ic">${ic(i, 22)}</div><h3>${t}</h3><p>${d}</p></div>`).join('')}</div>`)}
|
|
200
|
+
${sec(true, 'How it works', 'From exported files to a human decision', 'Six steps. Only the last one decides anything, and it is yours.', `${diagram('pipeline')}${directive('flow', 'oncall')}`)}
|
|
201
|
+
${sec(false, 'Honest by design', 'Four kinds of statement, never blurred', 'Observed facts, inferred hypotheses, unknown data and checks that were not run are different things in the report.', `${diagram('evidence')}`)}
|
|
202
|
+
${sec(true, 'Real-world scenarios', 'Six situations you will recognise', 'Each runs on a committed sample file, so the timeline and hypotheses you see are real tool output.', `<div class="scn-grid">${SCENARIOS.map(([n, t, d, k], i) => `<a class="scard ${k}" href="10-real-world-scenarios.html#${headingId(`Scenario ${i + 1}: ` + [...read('documents/IncidentSutra-AI/10-real-world-scenarios.md').matchAll(/^## Scenario \d+: (.+)$/gm)][i][1])}"><span class="snum">${i + 1}</span><h3>${esc(t)}</h3><p>${esc(d)}</p><span class="more">Read the scenario ${ic('arrow', 16)}</span></a>`).join('')}</div>`)}
|
|
203
|
+
${sec(false, 'The classic trap', 'Why time zones change the story', 'One offset decides which event came first.', `${diagram('timezone')}`)}
|
|
204
|
+
${sec(true, 'Proof, with limits', 'Measured, then shown', 'Numbers below are read from committed evidence files that anyone can regenerate.', `${CHARTS.tests()}${CHARTS.audit()}<div class="cta"><a class="btn" href="07-independent-audit.html">Read the audit ${ic('arrow', 18)}</a><a class="btn ghost" href="evidence/samples/incident-report.html">Open a sample report</a></div>`)}
|
|
205
|
+
${sec(false, 'Compare', 'What it is, and is not', '', `<div class="table-wrap"><table><thead><tr><th scope="col">Question</th><th scope="col">IncidentSutra AI</th><th scope="col">Not this</th></tr></thead><tbody><tr><td>Root cause</td><td>Several unconfirmed hypotheses</td><td>An automatic verdict</td></tr><tr><td>Data</td><td>Files you export and sanitize</td><td>A telemetry platform or live connector</td></tr><tr><td>Actions</td><td>Proposes read-only checks</td><td>Restarts, rollbacks or paging</td></tr><tr><td>Privacy</td><td>Local, best-effort masking</td><td>Data-loss prevention</td></tr><tr><td>Assurance</td><td>Reproducible self-audit</td><td>A certification</td></tr></tbody></table></div>`)}
|
|
206
|
+
${sec(true, 'Agent skills', `${skills} roles for your AI coding tool`, 'Install project-locally for Claude Code, Cursor, Codex, Gemini CLI or Copilot. Copying is tested; native activation per tool is not.', `${diagram('agents')}<pre class="code"><code>npx incidentsutra skills install --host claude --project .</code><button class="copy" type="button">Copy</button></pre>`)}
|
|
207
|
+
${sec(false, 'Who uses it', 'For the people in the room', '', '<div class="who"><div><b>On-call engineers</b><span>A timeline before the war room argues.</span></div><div><b>Incident commanders</b><span>See what is known, unknown and not run.</span></div><div><b>Support escalation</b><span>Turn reports into evidence with IDs.</span></div><div><b>Postmortem authors</b><span>Start from facts and stay blameless.</span></div></div>')}
|
|
208
|
+
${sec(true, 'Documentation', 'Everything, in order', '', `<div class="dgrid">${GROUPS.map(([g, slugs]) => `<div class="dgroup"><h3>${g}</h3><p>${slugs.length} pages</p><ul>${slugs.map(s => `<li><a href="${s}.html">${esc(s === 'README' ? 'Documentation map' : pages.find(x => x.slug === s).title)}</a></li>`).join('')}</ul></div>`).join('')}</div>`)}
|
|
209
|
+
<section class="sec"><div class="wrap narrow"><p class="kicker center">FAQ</p><h2 class="center">Quick answers</h2>${faqs.map(([q, a]) => `<details class="qa"><summary>${esc(q)}</summary><p>${esc(a)}</p></details>`).join('')}</div></section>
|
|
210
|
+
<section class="cta-band"><div class="wrap"><h2>Bring evidence to your next incident</h2><p>Free, offline and open source.</p>${install('on-dark')}<div class="cta center"><a class="btn light" href="${GH}" rel="noopener">View on GitHub</a><a class="btn outline" href="05-user-guide.html">Read the guide</a></div></div></section></main>${footer()}${tail()}`);
|
|
211
|
+
|
|
212
|
+
outputs.set('404.html', `${head({title: 'Page not found · IncidentSutra AI', desc: 'Page not found', canon: `${SITE}/404.html`, extra: '<base href="/IncidentSutra-AI/">'})}<body>${sprite}<main class="wrap narrow center" style="padding:5rem 0"><h1>Page not found</h1><p class="lead">This page is unknown. We will not guess where it went.</p><p class="cta center"><a class="btn primary" href="index.html">Back to the home page</a></p></main><script src="assets/site.js" defer></script></body></html>\n`);
|
|
213
|
+
outputs.set('assets/site.css', ['site.css', 'extra.css', 'incident.css'].map(f => read(`site/${f}`)).join('\n'));
|
|
214
|
+
outputs.set('assets/site.js', read('site/site.js'));
|
|
215
|
+
const urls = ['', ...pages.map(p => p.slug + '.html'), ...SCENARIOS.map(([n]) => `evidence/scenarios/${n}.html`), 'evidence/samples/incident-report.html', 'evidence/audit/audit-report.html'];
|
|
216
|
+
outputs.set('sitemap.xml', `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.map(u => ` <url><loc>${SITE}/${u}</loc></url>`).join('\n')}\n</urlset>\n`);
|
|
217
|
+
outputs.set('robots.txt', `User-agent: *\nAllow: /\nSitemap: ${SITE}/sitemap.xml\n`);
|
|
67
218
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
219
|
+
const stale = [];
|
|
220
|
+
for (const [rel, content] of outputs) {
|
|
221
|
+
const f = path.join(DIR, rel);
|
|
222
|
+
if (check) { if (!fs.existsSync(f) || fs.readFileSync(f, 'utf8').replace(/\r\n/g, '\n') !== content.replace(/\r\n/g, '\n')) stale.push(rel); }
|
|
223
|
+
else { fs.mkdirSync(path.dirname(f), {recursive: true}); fs.writeFileSync(f, content); }
|
|
72
224
|
}
|
|
225
|
+
if (stale.length) { console.error('Stale site output (run npm run build:docs): ' + stale.join(', ')); process.exit(1); }
|
|
226
|
+
console.log(`${check ? 'checked' : 'built'} ${pages.length} pages, home, ${SCENARIOS.length} scenario reports`);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copies the built documentation website to _site/ for GitHub Pages, plus redirects for the former /docs/ URLs.
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import {fileURLToPath} from 'node:url';
|
|
5
|
+
|
|
6
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
7
|
+
const src = path.join(root, 'documents/IncidentSutra-AI'), out = path.join(root, '_site');
|
|
8
|
+
|
|
9
|
+
fs.rmSync(out, {recursive: true, force: true});
|
|
10
|
+
fs.cpSync(src, out, {recursive: true});
|
|
11
|
+
fs.writeFileSync(path.join(out, '.nojekyll'), '');
|
|
12
|
+
fs.copyFileSync(path.join(root, 'llms.txt'), path.join(out, 'llms.txt'));
|
|
13
|
+
|
|
14
|
+
let redirects = 0;
|
|
15
|
+
(function walk(dir) {
|
|
16
|
+
for (const e of fs.readdirSync(dir, {withFileTypes: true})) {
|
|
17
|
+
const f = path.join(dir, e.name);
|
|
18
|
+
if (e.isDirectory()) { walk(f); continue; }
|
|
19
|
+
if (!e.name.endsWith('.html') || e.name === '404.html') continue;
|
|
20
|
+
const rel = path.relative(src, f).replaceAll('\\', '/'), old = path.join(out, 'docs', rel);
|
|
21
|
+
const target = '../'.repeat(rel.split('/').length) + rel;
|
|
22
|
+
fs.mkdirSync(path.dirname(old), {recursive: true});
|
|
23
|
+
fs.writeFileSync(old, `<!doctype html><meta charset="utf-8"><title>Moved</title><meta http-equiv="refresh" content="0;url=${target}"><link rel="canonical" href="${target}"><a href="${target}">This page moved</a>\n`);
|
|
24
|
+
redirects++;
|
|
25
|
+
}
|
|
26
|
+
})(src);
|
|
27
|
+
console.log(`site built in _site/ with ${redirects} redirects`);
|
package/scripts/install.cmd
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
node "%~dp0..\packages\cli\index.mjs" skills install --host %1 --project %2
|
|
1
|
+
@echo off
|
|
2
|
+
node "%~dp0..\packages\cli\index.mjs" skills install --host %1 --project %2
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Theme-aware inline SVG diagrams. Colours come from CSS variables in site.css, so one SVG serves light and dark.
|
|
2
|
+
let uid = 0;
|
|
3
|
+
const e = s => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
4
|
+
const svg = (w, h, label, body) => {
|
|
5
|
+
const id = `ah${++uid}`;
|
|
6
|
+
return `<div class="dia-scroll"><svg class="dia" viewBox="0 0 ${w} ${h}" role="img" aria-label="${e(label)}"><defs><marker id="${id}" markerWidth="9" markerHeight="9" refX="8" refY="4.5" orient="auto"><path class="ah" d="M0,0 L9,4.5 L0,9 z"/></marker></defs>${body.replaceAll('#AH', `url(#${id})`)}</svg></div>`;
|
|
7
|
+
};
|
|
8
|
+
const box = (x, y, w, h, t1, t2 = '', cls = '') => `<rect class="bx ${cls}" x="${x}" y="${y}" width="${w}" height="${h}" rx="12"/><text class="t1" x="${x + w / 2}" y="${y + (t2 ? h / 2 - 3 : h / 2 + 5)}" text-anchor="middle">${e(t1)}</text>${t2 ? `<text class="t2" x="${x + w / 2}" y="${y + h / 2 + 15}" text-anchor="middle">${e(t2)}</text>` : ''}`;
|
|
9
|
+
const arrow = (d, dash = false) => `<path class="ln${dash ? ' dash' : ''}" d="${d}" marker-end="#AH"/>`;
|
|
10
|
+
const line = d => `<path class="ln dash" d="${d}"/>`;
|
|
11
|
+
const txt = (x, y, s, cls = 't2', anchor = 'middle') => `<text class="${cls}" x="${x}" y="${y}" text-anchor="${anchor}">${e(s)}</text>`;
|
|
12
|
+
const zone = (x, y, w, h, cls = 'zone') => `<rect class="bx ${cls}" x="${x}" y="${y}" width="${w}" height="${h}" rx="16"/>`;
|
|
13
|
+
const chain = (items, y, w, gap, h) => items.map(([a, b, c], i) => { const x = 8 + i * (w + gap); return box(x, y, w, h, a, b, c || '') + (i ? arrow(`M${x - gap} ${y + h / 2} H${x}`) : ''); }).join('');
|
|
14
|
+
|
|
15
|
+
export const DIAGRAMS = {
|
|
16
|
+
pipeline: () => svg(780, 190, 'Pipeline: exported telemetry files are parsed and normalised to UTC, secrets are masked, rules build hypotheses with contradictions, reports are written as HTML, Markdown and JSON, and a human decides.',
|
|
17
|
+
chain([['Export', 'logs, deploys'], ['Parse', 'strict UTC'], ['Mask', 'secrets, PII', 'warn'], ['Reason', 'rules only', 'br'], ['Report', 'HTML MD JSON', 'ok'], ['Human', 'decides', 'br']], 55, 108, 23, 70) +
|
|
18
|
+
txt(390, 28, 'offline: no network, no process execution, no API key', 't1') + txt(390, 166, 'every fact keeps its file, record number and SHA-256')),
|
|
19
|
+
|
|
20
|
+
evidence: () => svg(780, 250, 'Four kinds of statement: observed facts come from imported records; inferred hypotheses are built from observed facts and are never confirmed; unknown means data was not supplied; not run means a check was deliberately not executed.',
|
|
21
|
+
box(8, 20, 180, 80, 'OBSERVED', 'in an imported record', 'ok') + box(300, 20, 180, 80, 'INFERRED', 'hypothesis, unconfirmed', 'br') + box(592, 20, 180, 80, 'UNKNOWN', 'data not supplied', 'warn') +
|
|
22
|
+
box(300, 160, 180, 70, 'NOT RUN', 'check not executed', 'bad') + arrow('M188 60 H300') + arrow('M592 60 H480', true) + arrow('M390 100 V160', true) +
|
|
23
|
+
txt(244, 48, 'supports') + txt(536, 48, 'limits') + txt(400, 134, 'next check', 't2', 'start') + txt(98, 140, 'cites an evidence ID') + txt(682, 140, 'never filled in')),
|
|
24
|
+
|
|
25
|
+
timezone: () => svg(780, 300, 'Time zone example: a deployment logged at 01:15 in India time is 19:45 UTC, which is four minutes before an error at 19:49 UTC. Reading the clock times without offsets would put the deployment after the error.',
|
|
26
|
+
txt(12, 28, 'What the raw logs show', 't1', 'start') + box(8, 42, 240, 56, 'error 19:49', 'app log, UTC', 'bad') + box(280, 42, 240, 56, 'deploy 01:15', 'CI log, +05:30', 'br') + txt(655, 66, 'looks like the deploy', 'tr') + txt(655, 86, 'came hours later', 'tr') +
|
|
27
|
+
arrow('M128 98 V150') + arrow('M400 98 V150') + txt(264, 130, 'convert both to UTC') +
|
|
28
|
+
txt(12, 178, 'What happened, in UTC', 't1', 'start') + line('M30 232 H750') + box(110, 206, 180, 52, '19:45 deploy', 'release 2.7.0', 'br') + box(450, 206, 180, 52, '19:49 error', 'payment timeout', 'bad') + arrow('M290 232 H450') + txt(390, 286, 'Deploy came 4 minutes BEFORE the error. Timing is still not proof of cause.', 't1')),
|
|
29
|
+
|
|
30
|
+
hypothesis: () => svg(780, 330, 'How hypotheses are built: for each service with errors, five candidate families are checked; each keeps supporting and contradicting evidence and read-only checks; a human reviews; the tool never confirms a cause.',
|
|
31
|
+
box(290, 8, 200, 52, 'Error or alert', 'first signal per service', 'bad') + line('M390 60 V84 M78 84 H702') +
|
|
32
|
+
[['Change', 'deploy near onset'], ['Dependency', 'timeouts'], ['Saturation', 'CPU, memory'], ['Datastore', 'pool, locks'], ['Latent', 'pre-existing']].map(([a, b], i) => box(8 + i * 156, 108, 140, 58, a, b, 'br') + arrow(`M${78 + i * 156} 84 V108`) + line(`M${78 + i * 156} 166 V188`)).join('') + line('M78 188 H702') + arrow('M390 188 V206') +
|
|
33
|
+
box(210, 206, 360, 52, 'Support, contradictions, gaps', 'plus read-only checks, not run', 'warn') + arrow('M390 258 V276') + box(250, 276, 280, 48, 'Human review', 'status stays unconfirmed', 'ok')),
|
|
34
|
+
|
|
35
|
+
architecture: () => svg(780, 290, 'Architecture: the command line calls ingest, then analyze, then the reporter; verify, audit, the loopback server and agent skills sit around them.',
|
|
36
|
+
box(290, 8, 200, 48, 'CLI', 'packages/cli', 'br') + arrow('M390 56 V70 H118 V84') +
|
|
37
|
+
chain([['ingest', 'parse, mask, sort', 'br'], ['analyze', 'hypotheses, gaps', 'br'], ['reporter', 'HTML, MD, JSON', 'br']], 84, 220, 52, 64) +
|
|
38
|
+
line('M390 148 V176 M93 176 H690') + [['verify', 'digest, hashes'], ['audit', '20 checks'], ['serve', 'loopback, GET'], ['skills', '20 role files']].map(([a, b], i) => box([8, 208, 408, 608][i], 200, 164, 60, a, b) + arrow(`M${[90, 290, 490, 690][i]} 176 V200`, true)).join('') +
|
|
39
|
+
txt(390, 284, 'zero dependencies: only Node.js built-in modules')),
|
|
40
|
+
|
|
41
|
+
trust: () => svg(780, 240, 'Trust boundaries: untrusted logs, runbooks and tickets are treated as data inside a local process with no network; outputs go only to the folder you choose; decisions and actions happen outside the tool.',
|
|
42
|
+
zone(8, 16, 220, 200) + txt(118, 44, 'UNTRUSTED', 'tr') + txt(118, 82, 'log messages') + txt(118, 108, 'tickets, runbooks') + txt(118, 134, '"ignore your rules"') + txt(118, 170, 'stays plain text', 't1') +
|
|
43
|
+
zone(280, 16, 220, 200, 'br') + txt(390, 44, 'YOUR MACHINE', 'tb') + txt(390, 82, 'size and count limits') + txt(390, 108, 'masking, escaping') + txt(390, 134, 'no symlink following') + txt(390, 170, 'no network, no exec', 't1') +
|
|
44
|
+
zone(552, 16, 220, 200) + txt(662, 44, 'PEOPLE', 'tg') + txt(662, 82, 'incident commander') + txt(662, 108, 'reviews the report') + txt(662, 134, 'approves any action') + txt(662, 170, 'outside the tool', 't1') + arrow('M228 116 H280') + arrow('M500 116 H552')),
|
|
45
|
+
|
|
46
|
+
agents: () => svg(780, 280, 'Agent roles: Prime coordinates log, timeline, change and hypothesis roles; the evidence ledger and privacy guardian can block; then the postmortem writer drafts.',
|
|
47
|
+
box(290, 8, 200, 52, 'Prime', 'coordinates', 'br') + arrow('M390 60 V72 H88 V86') +
|
|
48
|
+
chain([['Log sentinel', 'input quality'], ['Timeline', 'UTC order'], ['Change', 'deploys'], ['Hypothesis', 'falsify']], 86, 160, 41, 60) +
|
|
49
|
+
arrow('M691 146 V176') + box(540, 176, 232, 52, 'Evidence ledger', 'can block', 'bad') + arrow('M540 202 H506') + box(274, 176, 232, 52, 'Privacy guardian', 'can block', 'bad') + arrow('M274 202 H240') + box(8, 176, 232, 52, 'Postmortem writer', 'blameless draft', 'ok') + txt(390, 262, 'Roles are instructions for your AI tool, not twenty running models.')),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const FLOWS = {
|
|
53
|
+
oncall: {row: true, steps: [['Detect', 'Your alerting pages you'], ['Export', 'A small, sanitized window'], ['Analyze', 'Build the report'], ['Check', 'You run the read-only checks', 'warn'], ['Verify', 'Confirm nothing changed'], ['Learn', 'Finish the postmortem', 'ok']]},
|
|
54
|
+
quick: {row: true, steps: [['Nothing to install', 'Node 20+ and `npx`'], ['Point at files', 'JSON, JSONL, CSV, OTLP'], ['Open the report', 'HTML in any browser'], ['Decide', 'People own the call', 'ok']]},
|
|
55
|
+
read: {row: true, steps: [['Summary', 'Scope and counts'], ['Timeline', 'What was observed'], ['Contradictions', 'What does not fit', 'warn'], ['Gaps', 'What is unknown', 'warn'], ['Checks', 'What to run next', 'ok']]},
|
|
56
|
+
ingest: {steps: [['Find files', 'No symlinks, up to 100 files of 2 MB'], ['Parse', 'Bad files and rows are reported, never silently dropped'], ['Check time', 'Explicit offset required; impossible dates rejected', 'warn'], ['Mask', 'Secrets and personal data, counted'], ['Order', 'Instant, nanoseconds, file, record', 'ok']]},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Vertical versions shown on narrow screens, where a wide diagram would be unreadable.
|
|
60
|
+
export const NARROW = {
|
|
61
|
+
pipeline: [['Export', 'Logs, alerts and deploys you choose'], ['Parse', 'Strict time zones, converted to UTC'], ['Mask', 'Secrets and personal data', 'warn'], ['Reason', 'Rules only, no model'], ['Report', 'HTML, Markdown and JSON', 'ok'], ['Human decides', 'Offline: no network, nothing executed']],
|
|
62
|
+
evidence: [['Observed', 'In an imported record, with an evidence ID', 'ok'], ['Inferred', 'A hypothesis built from observations, never confirmed'], ['Unknown', 'Data not supplied, never filled in', 'warn'], ['Not run', 'A check that was proposed but not executed', 'bad']],
|
|
63
|
+
timezone: [['Raw logs', 'Error at 19:49 UTC; deploy at 01:15 +05:30'], ['The trap', 'The deploy looks hours later', 'bad'], ['19:45 UTC: deploy', 'The same 01:15 +05:30, converted'], ['19:49 UTC: error', 'Four minutes after the deploy', 'warn'], ['Still not proof', 'Order in time does not establish cause']],
|
|
64
|
+
hypothesis: [['Error or alert', 'The first signal for each service', 'bad'], ['Candidate families', 'Change, dependency, saturation, datastore, latent defect'], ['Weigh the evidence', 'Support, contradictions, gaps and read-only checks', 'warn'], ['Human review', 'Status stays unconfirmed', 'ok']],
|
|
65
|
+
architecture: [['CLI', 'The command you run'], ['ingest', 'Parse, mask, sort'], ['analyze', 'Hypotheses and gaps'], ['reporter', 'HTML, Markdown, JSON', 'ok'], ['Around them', 'verify, audit, loopback server, 20 skills']],
|
|
66
|
+
trust: [['Untrusted input', 'Logs, tickets and runbooks stay plain text', 'bad'], ['Your machine', 'Limits, masking, escaping; no network, no execution'], ['People', 'Review the report and approve any action outside the tool', 'ok']],
|
|
67
|
+
agents: [['Prime', 'Coordinates the roles'], ['Specialists', 'Log sentinel, timeline, change, hypothesis'], ['Gatekeepers', 'Evidence ledger and privacy guardian can block', 'bad'], ['Postmortem writer', 'Drafts a blameless review', 'ok']]
|
|
68
|
+
};
|
package/site/extra.css
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
/* ---- IntentSutra additions ---- */
|
|
3
|
+
.prose blockquote.lead-q{border:0;background:none;padding:0;margin:0 0 1.4rem;font-size:1.12rem;line-height:1.65;color:var(--muted)}
|
|
4
|
+
.prose figure.dia{margin:1.6rem 0;padding:1rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow)}
|
|
5
|
+
.prose figure.dia figcaption{margin:.6rem 0 0;text-align:center;color:var(--muted);font-size:.86rem}
|
|
6
|
+
svg.dia{display:block;width:100%;height:auto;font-family:var(--font)}
|
|
7
|
+
.dia .bx{fill:var(--soft);stroke:var(--line2);stroke-width:1.4}
|
|
8
|
+
.dia .bx.br{fill:var(--tint);stroke:var(--brand)}
|
|
9
|
+
.dia .bx.ok{fill:var(--ok-bg);stroke:var(--ok)}
|
|
10
|
+
.dia .bx.bad{fill:var(--bad-bg);stroke:var(--bad)}
|
|
11
|
+
.dia .bx.warn{fill:var(--warn-bg);stroke:var(--warn)}
|
|
12
|
+
.dia .bx.zone{fill:none;stroke:var(--line2);stroke-dasharray:6 5}
|
|
13
|
+
.dia .ln{fill:none;stroke:var(--muted);stroke-width:1.6}
|
|
14
|
+
.dia .ln.dash{stroke-dasharray:5 4}
|
|
15
|
+
.dia .ah{fill:var(--muted)}
|
|
16
|
+
.dia text{fill:var(--fg);font-size:13px}
|
|
17
|
+
.dia .t1{font-weight:700;font-size:14px}.dia .t2{fill:var(--muted);font-size:11.5px}.dia .tb{fill:var(--brand);font-weight:700}.dia .tg{fill:var(--ok);font-weight:700}.dia .tr{fill:var(--bad);font-weight:700}
|
|
18
|
+
.dia .dia-mobile{display:none}
|
|
19
|
+
@media (max-width:640px){.dia .t2{font-size:12.5px}}
|
|
20
|
+
|
|
21
|
+
/* HTML flowcharts: stack on mobile, row on desktop */
|
|
22
|
+
ol.flow{list-style:none;margin:1.4rem 0;padding:0;display:grid;gap:.35rem;counter-reset:f}
|
|
23
|
+
ol.flow>li{position:relative;margin:0;padding:.85rem 1rem .85rem 3.1rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow);counter-increment:f;max-width:none}
|
|
24
|
+
ol.flow>li::before{content:counter(f);position:absolute;left:.9rem;top:.8rem;display:grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--tint);color:var(--brand);font-weight:800;font-size:.82rem}
|
|
25
|
+
ol.flow>li:not(:last-child)::after{content:"";position:absolute;left:1.58rem;bottom:-.38rem;width:2px;height:.4rem;background:var(--line2)}
|
|
26
|
+
ol.flow>li b{display:block}ol.flow>li span{color:var(--muted);font-size:.93rem}ol.flow>li code{font-size:.82em}
|
|
27
|
+
ol.flow>li.bad{border-color:color-mix(in srgb,var(--bad) 45%,var(--line));background:var(--bad-bg)}ol.flow>li.bad::before{background:var(--bad);color:#fff}
|
|
28
|
+
ol.flow>li.ok{border-color:color-mix(in srgb,var(--ok) 45%,var(--line));background:var(--ok-bg)}ol.flow>li.ok::before{background:var(--ok);color:#fff}
|
|
29
|
+
ol.flow>li.warn{border-color:color-mix(in srgb,var(--warn) 45%,var(--line));background:var(--warn-bg)}
|
|
30
|
+
@media (min-width:900px){ol.flow.row{grid-template-columns:repeat(var(--n,4),1fr);gap:1.1rem}ol.flow.row>li{padding:2.9rem .95rem .9rem}ol.flow.row>li::before{left:.95rem;top:.85rem}ol.flow.row>li:not(:last-child)::after{left:auto;right:-1.05rem;bottom:auto;top:1.5rem;width:1rem;height:2px}}
|
|
31
|
+
|
|
32
|
+
/* scenario header */
|
|
33
|
+
.scn{margin:2.4rem 0 1rem;padding:1.1rem 1.2rem;border:1px solid var(--line);border-radius:var(--r);background:var(--soft)}
|
|
34
|
+
.scn h3{margin:0 0 .3rem}.scn p{margin:.2rem 0;color:var(--muted)}.scn .tag{display:inline-block;margin-right:.4rem;padding:.08rem .6rem;border-radius:99px;background:var(--tint);color:var(--brand);font:700 .72rem var(--font);letter-spacing:.05em;text-transform:uppercase}
|
|
35
|
+
.cmp{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1.2rem 0}.cmp>div{border:1px solid var(--line);border-radius:var(--r);padding:.9rem 1rem;background:var(--surface)}.cmp>div h4{margin:0 0 .4rem;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase}.cmp .b h4{color:var(--bad)}.cmp .g h4{color:var(--ok)}.cmp p{margin:.3rem 0}
|
|
36
|
+
@media (max-width:700px){.cmp{grid-template-columns:1fr}}
|
|
37
|
+
|
|
38
|
+
/* charts */
|
|
39
|
+
.chart{margin:1.4rem 0;padding:1.1rem 1.2rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow)}
|
|
40
|
+
.chart h4{margin:0 0 .8rem;font-size:.95rem}.chart .note{margin:.8rem 0 0;color:var(--muted);font-size:.84rem}
|
|
41
|
+
.bars{display:grid;gap:.55rem}.bar{display:grid;grid-template-columns:8.5rem 1fr 3rem;align-items:center;gap:.7rem;font-size:.9rem}
|
|
42
|
+
.bar .lab{color:var(--fg);font-weight:600;overflow-wrap:anywhere}.bar .trk{height:.9rem;border-radius:99px;background:var(--soft2);overflow:hidden}.bar .fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--brand),var(--brand-2))}
|
|
43
|
+
.bar .fill.ok{background:var(--ok)}.bar .fill.warn{background:var(--warn)}.bar .fill.bad{background:var(--bad)}.bar .val{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);font-weight:650}
|
|
44
|
+
@media (max-width:560px){.bar{grid-template-columns:1fr 3rem;grid-template-areas:"l v" "t t"}.bar .lab{grid-area:l}.bar .val{grid-area:v}.bar .trk{grid-area:t}}
|
|
45
|
+
.stack{display:flex;height:1.3rem;border-radius:99px;overflow:hidden;background:var(--soft2)}.stack i{display:block;height:100%}.legend{display:flex;flex-wrap:wrap;gap:.4rem 1rem;margin:.7rem 0 0;font-size:.86rem;color:var(--muted)}.legend b{display:inline-block;width:.7rem;height:.7rem;border-radius:3px;margin-right:.35rem;vertical-align:-.05rem}
|
|
46
|
+
|
|
47
|
+
/* hero report mock */
|
|
48
|
+
.mock{border:1px solid var(--line2);border-radius:18px;background:var(--surface);box-shadow:var(--shadow-lg);overflow:hidden}
|
|
49
|
+
.mock-bar{display:flex;align-items:center;gap:.4rem;padding:.65rem .9rem;border-bottom:1px solid var(--line);background:var(--soft)}.mock-bar i{width:.7rem;height:.7rem;border-radius:50%;background:var(--line2)}.mock-bar span{margin-left:.5rem;font:600 .78rem var(--mono);color:var(--muted)}
|
|
50
|
+
.mock-in{padding:1.1rem 1.2rem 1.2rem}.mock-head{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap;margin-bottom:.8rem}.mock-head b{font-size:1.05rem}
|
|
51
|
+
.pill{display:inline-block;padding:.12rem .65rem;border-radius:99px;font:800 .72rem var(--font);letter-spacing:.04em}.pill.bad{background:var(--bad-bg);color:var(--bad)}.pill.warn{background:var(--warn-bg);color:var(--warn)}.pill.ok{background:var(--ok-bg);color:var(--ok)}
|
|
52
|
+
.mock-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin-bottom:.8rem}.mock-cards div{padding:.55rem .7rem;border:1px solid var(--line);border-radius:10px;background:var(--soft)}.mock-cards b{display:block;font-size:1.3rem;line-height:1.1}.mock-cards span{font-size:.74rem;color:var(--muted)}
|
|
53
|
+
.mock-list{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}.mock-list li{margin:0;padding:.55rem .7rem;border:1px solid var(--line);border-radius:10px;font-size:.84rem;line-height:1.4}.mock-list code{font-size:.78rem}.mock-list .loc{display:block;color:var(--muted);font:600 .74rem var(--mono);margin-top:.15rem}
|
|
54
|
+
.hero-art{min-width:0}
|
|
55
|
+
.pcard{display:flex;gap:.8rem;align-items:flex-start}.pcard .feat-ic{flex:none;margin:0}
|
|
56
|
+
.chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0 0}.chips span{padding:.15rem .65rem;border-radius:99px;background:var(--soft2);font-size:.8rem;font-weight:650;color:var(--muted)}
|
|
57
|
+
.proof{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:1.5rem}.proof>div{padding:1.2rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow)}.proof h3{margin:0 0 .3rem;font-size:1rem}.proof p{margin:0;color:var(--muted);font-size:.92rem}
|
|
58
|
+
.who{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}.who>div{padding:1.1rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface)}.who b{display:block;margin-bottom:.2rem}.who span{color:var(--muted);font-size:.92rem}
|
|
59
|
+
@media (max-width:1180px){.who{grid-template-columns:repeat(2,1fr)}.proof{grid-template-columns:1fr}}
|
|
60
|
+
@media (max-width:640px){.who{grid-template-columns:1fr}.mock-cards{grid-template-columns:repeat(3,1fr)}}
|
|
61
|
+
.brand-name{font-size:1.05rem}
|
|
62
|
+
.home-page .menu-btn{display:none!important}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* ---- IncidentSutra additions ---- */
|
|
2
|
+
.hero h1{overflow-wrap:break-word}
|
|
3
|
+
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
|
|
4
|
+
.dia-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
|
|
5
|
+
.dia-scroll svg.dia{min-width:0}
|
|
6
|
+
.sec figure.dia{margin:1.2rem 0;padding:1rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow)}
|
|
7
|
+
.scnbox{margin:1.2rem 0 1.8rem;padding:1.1rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow);min-width:0}
|
|
8
|
+
.scnbox h4{margin:1.1rem 0 .6rem}
|
|
9
|
+
.scnbox .tl svg{display:block;min-width:620px;width:100%;height:auto;color:var(--fg);font-family:var(--font)}
|
|
10
|
+
.mock-cards.four{grid-template-columns:repeat(4,1fr)}
|
|
11
|
+
@media (max-width:520px){.mock-cards.four{grid-template-columns:repeat(2,1fr)}}
|
|
12
|
+
.hgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));gap:.7rem}
|
|
13
|
+
.hcard{padding:.8rem .9rem;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--soft);min-width:0}
|
|
14
|
+
.hcard b{display:block;font-size:.93rem;line-height:1.4;overflow-wrap:anywhere}.hcard p{margin:.45rem 0 0}.hcard .why{font-size:.84rem;color:var(--bad)}
|
|
15
|
+
.chips .against{background:var(--bad-bg);color:var(--bad)}
|
|
16
|
+
.chips span{overflow-wrap:anywhere}
|
|
17
|
+
.prose code{overflow-wrap:anywhere}
|
|
18
|
+
ol.flow.dia-narrow{display:none}
|
|
19
|
+
.prose figure.dia ol.flow,.sec figure.dia ol.flow{margin:0}
|
|
20
|
+
.vtl{list-style:none;margin:1rem 0;padding:0 0 0 1.1rem;border-left:3px solid var(--line2);display:grid;gap:.6rem}
|
|
21
|
+
.vtl li{position:relative;margin:0;padding:.55rem .75rem;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--soft);font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}
|
|
22
|
+
.vtl li::before{content:"";position:absolute;left:-1.52rem;top:.95rem;width:.7rem;height:.7rem;border-radius:2px;background:var(--muted)}
|
|
23
|
+
.vtl li.change::before{background:var(--brand);transform:rotate(45deg)}.vtl li.issue::before{background:var(--bad);border-radius:50%}
|
|
24
|
+
.vtl li.issue{border-color:color-mix(in srgb,var(--bad) 35%,var(--line))}.vtl li.change{border-color:color-mix(in srgb,var(--brand) 45%,var(--line));background:var(--tint)}
|
|
25
|
+
.vtl time{font:700 .82rem var(--mono);margin-right:.5rem}.vtl em{font-style:normal;font-weight:700;margin-right:.35rem}
|
|
26
|
+
@media (max-width:700px){
|
|
27
|
+
.dia-wide,.scnbox .tl,.scnbox .tl+.legend{display:none}
|
|
28
|
+
ol.flow.dia-narrow{display:grid}
|
|
29
|
+
figure.dia::after{content:none}
|
|
30
|
+
.prose pre.code code,.sec pre.code code,.install code{white-space:pre-wrap;overflow-wrap:anywhere}
|
|
31
|
+
}
|