kryptheon 0.1.70 → 0.1.71
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/LICENSE +38 -38
- package/kryptheon-api.js +131 -13
- package/kryptheon-baselines.js +232 -232
- package/kryptheon-changes.js +222 -222
- package/kryptheon-fonts-OFL.txt +98 -98
- package/kryptheon-probe-reporter.js +29 -29
- package/kryptheon-probe.config.js +37 -37
- package/kryptheon-project.js +600 -600
- package/kryptheon-roles.js +54 -17
- package/kryptheon-selectors.js +301 -301
- package/kryptheon-store.js +334 -334
- package/kryptheon-testfiles.js +98 -98
- package/package.json +4 -2
- package/playwright.config.js +73 -73
package/kryptheon-changes.js
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
// What changed in a project since Kryptheon last looked, and what that means
|
|
2
|
-
// for which checks have to run.
|
|
3
|
-
//
|
|
4
|
-
// A snapshot is a content hash of every file that is the project's own - its
|
|
5
|
-
// source, its database migrations, its dependency list - kept in the store,
|
|
6
|
-
// never in the project. Comparing two snapshots answers the first question a
|
|
7
|
-
// person has after an AI tool says "done": what did it actually touch?
|
|
8
|
-
//
|
|
9
|
-
// Content, not timestamps and not git: an editor that saves a file unchanged
|
|
10
|
-
// is not a change, and a landing page with no git repository still has one.
|
|
11
|
-
//
|
|
12
|
-
// Each changed file is put in a part of the app (frontend, backend, database,
|
|
13
|
-
// tests, dependencies, config, docs), and each part names the checks that
|
|
14
|
-
// can speak to it. The mapping is written here, once, and deliberately
|
|
15
|
-
// plain: a path-based guess that is right for how most projects are laid
|
|
16
|
-
// out, and said as a guess ("likely affected") rather than a proof.
|
|
17
|
-
|
|
18
|
-
const fs = require('fs');
|
|
19
|
-
const path = require('path');
|
|
20
|
-
const crypto = require('crypto');
|
|
21
|
-
|
|
22
|
-
const SKIP_DIRS = new Set([
|
|
23
|
-
'node_modules', '.git', 'dist', 'build', 'out', '.next', '.nuxt', '.svelte-kit', 'coverage',
|
|
24
|
-
'.vercel', '.netlify', '.turbo', '.cache', 'test-results', 'playwright-report', '.kryptheon',
|
|
25
|
-
]);
|
|
26
|
-
const MAX_BYTES = 5 * 1024 * 1024;
|
|
27
|
-
|
|
28
|
-
// Where a file sits in the app. The first rule that matches wins, so the
|
|
29
|
-
// specific ones come first: a .sql file inside backend/ is a database change.
|
|
30
|
-
const PARTS = [
|
|
31
|
-
{ part: 'dependencies', test: (p) => /(^|\/)(package\.json|package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|requirements\.txt|poetry\.lock|Gemfile\.lock|go\.sum)$/i.test(p) },
|
|
32
|
-
{ part: 'database', test: (p) => /\.sql$/i.test(p) || /(^|\/)(migrations|supabase|prisma|drizzle|db\/schema)(\/|$)/i.test(p) || /(^|\/)schema\.prisma$/i.test(p) },
|
|
33
|
-
{ part: 'tests', test: (p) => /(^|\/)(tests?|__tests__|e2e|cypress)\//i.test(p) || /\.(spec|test)\.[cm]?[jt]sx?$/i.test(p) },
|
|
34
|
-
{ part: 'docs', test: (p) => /\.(md|mdx|txt|rst)$/i.test(p) || /(^|\/)docs\//i.test(p) },
|
|
35
|
-
{ part: 'config', test: (p) => /(^|\/)(\.env\.example|\.env\.sample|tsconfig[^/]*\.json|jsconfig\.json|vercel\.json|netlify\.toml|dockerfile|docker-compose[^/]*\.ya?ml)$/i.test(p) || /\.config\.[cm]?[jt]s$/i.test(p) || /(^|\/)\.github\//i.test(p) },
|
|
36
|
-
{ part: 'backend', test: (p) => /(^|\/)(server|backend|api|routes|controllers|services|middleware|functions|workers|jobs|lib\/server)(\/|\.[cm]?[jt]s$)/i.test(p) || /(^|\/)(server|app|index)\.[cm]?[jt]s$/i.test(p) && !/(^|\/)(src|public|frontend|client|pages|components)\//i.test(p) },
|
|
37
|
-
{ part: 'frontend', test: (p) => /\.(html?|css|scss|sass|less|jsx|tsx|vue|svelte|astro)$/i.test(p) || /(^|\/)(frontend|client|public|src|pages|components|app|views|static)\//i.test(p) && /\.[cm]?[jt]s$/i.test(p) },
|
|
38
|
-
{ part: 'assets', test: (p) => /\.(png|jpe?g|gif|svg|webp|ico|woff2?|ttf|otf|mp4|webm|mp3|pdf)$/i.test(p) },
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
// Which checks can speak to a change in each part. Ids are the dashboard's.
|
|
42
|
-
const CHECKS_FOR = {
|
|
43
|
-
frontend: ['frontend', 'regression'],
|
|
44
|
-
backend: ['backend', 'api', 'regression'],
|
|
45
|
-
database: ['data', 'regression'],
|
|
46
|
-
dependencies: ['dependency', 'build', 'regression'],
|
|
47
|
-
tests: ['regression'],
|
|
48
|
-
config: ['build', 'regression'],
|
|
49
|
-
code: ['regression'],
|
|
50
|
-
docs: [],
|
|
51
|
-
assets: [],
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
function partOf(rel) {
|
|
55
|
-
const p = rel.split(path.sep).join('/');
|
|
56
|
-
const hit = PARTS.find((r) => r.test(p));
|
|
57
|
-
if (hit) return hit.part;
|
|
58
|
-
return /\.[cm]?[jt]sx?$/i.test(p) ? 'code' : 'other';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Every file that is the project's own, as relative paths with forward slashes. */
|
|
62
|
-
function listFiles(root) {
|
|
63
|
-
const out = [];
|
|
64
|
-
(function walk(dir) {
|
|
65
|
-
let entries;
|
|
66
|
-
try {
|
|
67
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
68
|
-
} catch (err) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
for (const entry of entries) {
|
|
72
|
-
const full = path.join(dir, entry.name);
|
|
73
|
-
if (entry.isDirectory()) {
|
|
74
|
-
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
75
|
-
} else if (entry.isFile()) {
|
|
76
|
-
// A real .env holds secrets; its content is never hashed or kept.
|
|
77
|
-
if (/^\.env(\..+)?$/i.test(entry.name) && !/\.(example|sample)$/i.test(entry.name)) continue;
|
|
78
|
-
out.push(path.relative(root, full).split(path.sep).join('/'));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
})(root);
|
|
82
|
-
return out.sort();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** The dependency lists of package.json, kept so a change can say which package moved. */
|
|
86
|
-
function dependenciesOf(root) {
|
|
87
|
-
try {
|
|
88
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
89
|
-
return Object.assign({}, pkg.dependencies || {}, pkg.devDependencies || {});
|
|
90
|
-
} catch (err) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The project as it is now. Files whose size and modified time match the
|
|
97
|
-
* previous snapshot keep its hash without being read again - on a large
|
|
98
|
-
* project that is the difference between milliseconds and seconds, and an
|
|
99
|
-
* unchanged size and time is the same bytes for every editor that exists.
|
|
100
|
-
*/
|
|
101
|
-
function takeSnapshot(root, previous) {
|
|
102
|
-
const before = (previous && previous.files) || {};
|
|
103
|
-
const files = {};
|
|
104
|
-
for (const rel of listFiles(root)) {
|
|
105
|
-
let stat;
|
|
106
|
-
try {
|
|
107
|
-
stat = fs.statSync(path.join(root, rel));
|
|
108
|
-
} catch (err) {
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
const old = before[rel];
|
|
112
|
-
if (old && old.size === stat.size && old.mtimeMs === stat.mtimeMs) {
|
|
113
|
-
files[rel] = old;
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
let hash;
|
|
117
|
-
if (stat.size > MAX_BYTES) {
|
|
118
|
-
hash = 'size:' + stat.size + ':' + stat.mtimeMs;
|
|
119
|
-
} else {
|
|
120
|
-
try {
|
|
121
|
-
hash = crypto.createHash('sha1').update(fs.readFileSync(path.join(root, rel))).digest('hex');
|
|
122
|
-
} catch (err) {
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
files[rel] = { hash: hash, size: stat.size, mtimeMs: stat.mtimeMs };
|
|
127
|
-
}
|
|
128
|
-
return { takenAt: new Date().toISOString(), files: files, dependencies: dependenciesOf(root) };
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** Packages added, removed or moved to another version between two snapshots. */
|
|
132
|
-
function dependencyChanges(before, after) {
|
|
133
|
-
const a = (before && before.dependencies) || {};
|
|
134
|
-
const b = (after && after.dependencies) || {};
|
|
135
|
-
const out = [];
|
|
136
|
-
for (const name of new Set(Object.keys(a).concat(Object.keys(b)))) {
|
|
137
|
-
if (!(name in a)) out.push({ name: name, change: 'added', to: b[name] });
|
|
138
|
-
else if (!(name in b)) out.push({ name: name, change: 'removed', from: a[name] });
|
|
139
|
-
else if (a[name] !== b[name]) out.push({ name: name, change: 'changed', from: a[name], to: b[name] });
|
|
140
|
-
}
|
|
141
|
-
return out.sort((x, y) => x.name.localeCompare(y.name));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* What changed between two snapshots, by part of the app, and which checks
|
|
146
|
-
* that calls for. With no earlier snapshot there is nothing to compare, and
|
|
147
|
-
* that is said - it is not reported as "everything changed".
|
|
148
|
-
*/
|
|
149
|
-
function compare(before, after) {
|
|
150
|
-
if (!before) return { first: true, files: [], parts: [], checks: [], dependencies: [] };
|
|
151
|
-
const files = [];
|
|
152
|
-
const a = before.files || {};
|
|
153
|
-
const b = after.files || {};
|
|
154
|
-
for (const rel of Object.keys(b)) {
|
|
155
|
-
if (!a[rel]) files.push({ path: rel, state: 'added' });
|
|
156
|
-
else if (a[rel].hash !== b[rel].hash) files.push({ path: rel, state: 'modified' });
|
|
157
|
-
}
|
|
158
|
-
for (const rel of Object.keys(a)) if (!b[rel]) files.push({ path: rel, state: 'deleted' });
|
|
159
|
-
files.sort((x, y) => x.path.localeCompare(y.path));
|
|
160
|
-
for (const f of files) f.part = partOf(f.path);
|
|
161
|
-
|
|
162
|
-
const parts = [];
|
|
163
|
-
for (const f of files) if (!parts.includes(f.part)) parts.push(f.part);
|
|
164
|
-
const checks = [];
|
|
165
|
-
for (const part of parts) for (const id of CHECKS_FOR[part] || []) if (!checks.includes(id)) checks.push(id);
|
|
166
|
-
return {
|
|
167
|
-
first: false,
|
|
168
|
-
files: files,
|
|
169
|
-
parts: parts,
|
|
170
|
-
checks: checks,
|
|
171
|
-
dependencies: dependencyChanges(before, after),
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Findings that were not there last time. Keyed by what they are about rather
|
|
177
|
-
* than by line number: a line added above a known finding moves it, and a
|
|
178
|
-
* moved finding reported as new would teach a person to ignore this list.
|
|
179
|
-
*/
|
|
180
|
-
//
|
|
181
|
-
// The detail is part of what a finding is only for the code read, where it is
|
|
182
|
-
// the expression itself. For a recorded flow or a database finding it is the
|
|
183
|
-
// account of how it broke this time - "ended up somewhere different", "could
|
|
184
|
-
// not be opened" - and a flow that is still broken in a new way is the same
|
|
185
|
-
// finding, not a fixed one and a new one.
|
|
186
|
-
function findingKey(f) {
|
|
187
|
-
return [
|
|
188
|
-
f.check || '',
|
|
189
|
-
f.where ? String(f.where).replace(/:\d+$/, '') : '',
|
|
190
|
-
f.headline ? String(f.headline).replace(/:\d+\b/g, '') : '',
|
|
191
|
-
f.check === 'frontend' ? f.detail || '' : '',
|
|
192
|
-
].join('|');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/** A short, stable name for a finding: what a person types to re-check it. */
|
|
196
|
-
function findingId(f) {
|
|
197
|
-
return crypto.createHash('sha1').update(findingKey(f)).digest('hex').slice(0, 8);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function newFindings(before, after) {
|
|
201
|
-
const seen = new Set((before || []).map(findingKey));
|
|
202
|
-
return (after || []).filter((f) => !seen.has(findingKey(f)));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function goneFindings(before, after) {
|
|
206
|
-
const now = new Set((after || []).map(findingKey));
|
|
207
|
-
return (before || []).filter((f) => !now.has(findingKey(f)));
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
module.exports = {
|
|
211
|
-
PARTS: PARTS,
|
|
212
|
-
CHECKS_FOR: CHECKS_FOR,
|
|
213
|
-
partOf: partOf,
|
|
214
|
-
listFiles: listFiles,
|
|
215
|
-
takeSnapshot: takeSnapshot,
|
|
216
|
-
compare: compare,
|
|
217
|
-
dependencyChanges: dependencyChanges,
|
|
218
|
-
findingKey: findingKey,
|
|
219
|
-
findingId: findingId,
|
|
220
|
-
newFindings: newFindings,
|
|
221
|
-
goneFindings: goneFindings,
|
|
222
|
-
};
|
|
1
|
+
// What changed in a project since Kryptheon last looked, and what that means
|
|
2
|
+
// for which checks have to run.
|
|
3
|
+
//
|
|
4
|
+
// A snapshot is a content hash of every file that is the project's own - its
|
|
5
|
+
// source, its database migrations, its dependency list - kept in the store,
|
|
6
|
+
// never in the project. Comparing two snapshots answers the first question a
|
|
7
|
+
// person has after an AI tool says "done": what did it actually touch?
|
|
8
|
+
//
|
|
9
|
+
// Content, not timestamps and not git: an editor that saves a file unchanged
|
|
10
|
+
// is not a change, and a landing page with no git repository still has one.
|
|
11
|
+
//
|
|
12
|
+
// Each changed file is put in a part of the app (frontend, backend, database,
|
|
13
|
+
// tests, dependencies, config, docs), and each part names the checks that
|
|
14
|
+
// can speak to it. The mapping is written here, once, and deliberately
|
|
15
|
+
// plain: a path-based guess that is right for how most projects are laid
|
|
16
|
+
// out, and said as a guess ("likely affected") rather than a proof.
|
|
17
|
+
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const crypto = require('crypto');
|
|
21
|
+
|
|
22
|
+
const SKIP_DIRS = new Set([
|
|
23
|
+
'node_modules', '.git', 'dist', 'build', 'out', '.next', '.nuxt', '.svelte-kit', 'coverage',
|
|
24
|
+
'.vercel', '.netlify', '.turbo', '.cache', 'test-results', 'playwright-report', '.kryptheon',
|
|
25
|
+
]);
|
|
26
|
+
const MAX_BYTES = 5 * 1024 * 1024;
|
|
27
|
+
|
|
28
|
+
// Where a file sits in the app. The first rule that matches wins, so the
|
|
29
|
+
// specific ones come first: a .sql file inside backend/ is a database change.
|
|
30
|
+
const PARTS = [
|
|
31
|
+
{ part: 'dependencies', test: (p) => /(^|\/)(package\.json|package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|requirements\.txt|poetry\.lock|Gemfile\.lock|go\.sum)$/i.test(p) },
|
|
32
|
+
{ part: 'database', test: (p) => /\.sql$/i.test(p) || /(^|\/)(migrations|supabase|prisma|drizzle|db\/schema)(\/|$)/i.test(p) || /(^|\/)schema\.prisma$/i.test(p) },
|
|
33
|
+
{ part: 'tests', test: (p) => /(^|\/)(tests?|__tests__|e2e|cypress)\//i.test(p) || /\.(spec|test)\.[cm]?[jt]sx?$/i.test(p) },
|
|
34
|
+
{ part: 'docs', test: (p) => /\.(md|mdx|txt|rst)$/i.test(p) || /(^|\/)docs\//i.test(p) },
|
|
35
|
+
{ part: 'config', test: (p) => /(^|\/)(\.env\.example|\.env\.sample|tsconfig[^/]*\.json|jsconfig\.json|vercel\.json|netlify\.toml|dockerfile|docker-compose[^/]*\.ya?ml)$/i.test(p) || /\.config\.[cm]?[jt]s$/i.test(p) || /(^|\/)\.github\//i.test(p) },
|
|
36
|
+
{ part: 'backend', test: (p) => /(^|\/)(server|backend|api|routes|controllers|services|middleware|functions|workers|jobs|lib\/server)(\/|\.[cm]?[jt]s$)/i.test(p) || /(^|\/)(server|app|index)\.[cm]?[jt]s$/i.test(p) && !/(^|\/)(src|public|frontend|client|pages|components)\//i.test(p) },
|
|
37
|
+
{ part: 'frontend', test: (p) => /\.(html?|css|scss|sass|less|jsx|tsx|vue|svelte|astro)$/i.test(p) || /(^|\/)(frontend|client|public|src|pages|components|app|views|static)\//i.test(p) && /\.[cm]?[jt]s$/i.test(p) },
|
|
38
|
+
{ part: 'assets', test: (p) => /\.(png|jpe?g|gif|svg|webp|ico|woff2?|ttf|otf|mp4|webm|mp3|pdf)$/i.test(p) },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
// Which checks can speak to a change in each part. Ids are the dashboard's.
|
|
42
|
+
const CHECKS_FOR = {
|
|
43
|
+
frontend: ['frontend', 'regression'],
|
|
44
|
+
backend: ['backend', 'api', 'regression'],
|
|
45
|
+
database: ['data', 'regression'],
|
|
46
|
+
dependencies: ['dependency', 'build', 'regression'],
|
|
47
|
+
tests: ['regression'],
|
|
48
|
+
config: ['build', 'regression'],
|
|
49
|
+
code: ['regression'],
|
|
50
|
+
docs: [],
|
|
51
|
+
assets: [],
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function partOf(rel) {
|
|
55
|
+
const p = rel.split(path.sep).join('/');
|
|
56
|
+
const hit = PARTS.find((r) => r.test(p));
|
|
57
|
+
if (hit) return hit.part;
|
|
58
|
+
return /\.[cm]?[jt]sx?$/i.test(p) ? 'code' : 'other';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Every file that is the project's own, as relative paths with forward slashes. */
|
|
62
|
+
function listFiles(root) {
|
|
63
|
+
const out = [];
|
|
64
|
+
(function walk(dir) {
|
|
65
|
+
let entries;
|
|
66
|
+
try {
|
|
67
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
68
|
+
} catch (err) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
for (const entry of entries) {
|
|
72
|
+
const full = path.join(dir, entry.name);
|
|
73
|
+
if (entry.isDirectory()) {
|
|
74
|
+
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
75
|
+
} else if (entry.isFile()) {
|
|
76
|
+
// A real .env holds secrets; its content is never hashed or kept.
|
|
77
|
+
if (/^\.env(\..+)?$/i.test(entry.name) && !/\.(example|sample)$/i.test(entry.name)) continue;
|
|
78
|
+
out.push(path.relative(root, full).split(path.sep).join('/'));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
})(root);
|
|
82
|
+
return out.sort();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** The dependency lists of package.json, kept so a change can say which package moved. */
|
|
86
|
+
function dependenciesOf(root) {
|
|
87
|
+
try {
|
|
88
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
89
|
+
return Object.assign({}, pkg.dependencies || {}, pkg.devDependencies || {});
|
|
90
|
+
} catch (err) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The project as it is now. Files whose size and modified time match the
|
|
97
|
+
* previous snapshot keep its hash without being read again - on a large
|
|
98
|
+
* project that is the difference between milliseconds and seconds, and an
|
|
99
|
+
* unchanged size and time is the same bytes for every editor that exists.
|
|
100
|
+
*/
|
|
101
|
+
function takeSnapshot(root, previous) {
|
|
102
|
+
const before = (previous && previous.files) || {};
|
|
103
|
+
const files = {};
|
|
104
|
+
for (const rel of listFiles(root)) {
|
|
105
|
+
let stat;
|
|
106
|
+
try {
|
|
107
|
+
stat = fs.statSync(path.join(root, rel));
|
|
108
|
+
} catch (err) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const old = before[rel];
|
|
112
|
+
if (old && old.size === stat.size && old.mtimeMs === stat.mtimeMs) {
|
|
113
|
+
files[rel] = old;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
let hash;
|
|
117
|
+
if (stat.size > MAX_BYTES) {
|
|
118
|
+
hash = 'size:' + stat.size + ':' + stat.mtimeMs;
|
|
119
|
+
} else {
|
|
120
|
+
try {
|
|
121
|
+
hash = crypto.createHash('sha1').update(fs.readFileSync(path.join(root, rel))).digest('hex');
|
|
122
|
+
} catch (err) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
files[rel] = { hash: hash, size: stat.size, mtimeMs: stat.mtimeMs };
|
|
127
|
+
}
|
|
128
|
+
return { takenAt: new Date().toISOString(), files: files, dependencies: dependenciesOf(root) };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Packages added, removed or moved to another version between two snapshots. */
|
|
132
|
+
function dependencyChanges(before, after) {
|
|
133
|
+
const a = (before && before.dependencies) || {};
|
|
134
|
+
const b = (after && after.dependencies) || {};
|
|
135
|
+
const out = [];
|
|
136
|
+
for (const name of new Set(Object.keys(a).concat(Object.keys(b)))) {
|
|
137
|
+
if (!(name in a)) out.push({ name: name, change: 'added', to: b[name] });
|
|
138
|
+
else if (!(name in b)) out.push({ name: name, change: 'removed', from: a[name] });
|
|
139
|
+
else if (a[name] !== b[name]) out.push({ name: name, change: 'changed', from: a[name], to: b[name] });
|
|
140
|
+
}
|
|
141
|
+
return out.sort((x, y) => x.name.localeCompare(y.name));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* What changed between two snapshots, by part of the app, and which checks
|
|
146
|
+
* that calls for. With no earlier snapshot there is nothing to compare, and
|
|
147
|
+
* that is said - it is not reported as "everything changed".
|
|
148
|
+
*/
|
|
149
|
+
function compare(before, after) {
|
|
150
|
+
if (!before) return { first: true, files: [], parts: [], checks: [], dependencies: [] };
|
|
151
|
+
const files = [];
|
|
152
|
+
const a = before.files || {};
|
|
153
|
+
const b = after.files || {};
|
|
154
|
+
for (const rel of Object.keys(b)) {
|
|
155
|
+
if (!a[rel]) files.push({ path: rel, state: 'added' });
|
|
156
|
+
else if (a[rel].hash !== b[rel].hash) files.push({ path: rel, state: 'modified' });
|
|
157
|
+
}
|
|
158
|
+
for (const rel of Object.keys(a)) if (!b[rel]) files.push({ path: rel, state: 'deleted' });
|
|
159
|
+
files.sort((x, y) => x.path.localeCompare(y.path));
|
|
160
|
+
for (const f of files) f.part = partOf(f.path);
|
|
161
|
+
|
|
162
|
+
const parts = [];
|
|
163
|
+
for (const f of files) if (!parts.includes(f.part)) parts.push(f.part);
|
|
164
|
+
const checks = [];
|
|
165
|
+
for (const part of parts) for (const id of CHECKS_FOR[part] || []) if (!checks.includes(id)) checks.push(id);
|
|
166
|
+
return {
|
|
167
|
+
first: false,
|
|
168
|
+
files: files,
|
|
169
|
+
parts: parts,
|
|
170
|
+
checks: checks,
|
|
171
|
+
dependencies: dependencyChanges(before, after),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Findings that were not there last time. Keyed by what they are about rather
|
|
177
|
+
* than by line number: a line added above a known finding moves it, and a
|
|
178
|
+
* moved finding reported as new would teach a person to ignore this list.
|
|
179
|
+
*/
|
|
180
|
+
//
|
|
181
|
+
// The detail is part of what a finding is only for the code read, where it is
|
|
182
|
+
// the expression itself. For a recorded flow or a database finding it is the
|
|
183
|
+
// account of how it broke this time - "ended up somewhere different", "could
|
|
184
|
+
// not be opened" - and a flow that is still broken in a new way is the same
|
|
185
|
+
// finding, not a fixed one and a new one.
|
|
186
|
+
function findingKey(f) {
|
|
187
|
+
return [
|
|
188
|
+
f.check || '',
|
|
189
|
+
f.where ? String(f.where).replace(/:\d+$/, '') : '',
|
|
190
|
+
f.headline ? String(f.headline).replace(/:\d+\b/g, '') : '',
|
|
191
|
+
f.check === 'frontend' ? f.detail || '' : '',
|
|
192
|
+
].join('|');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** A short, stable name for a finding: what a person types to re-check it. */
|
|
196
|
+
function findingId(f) {
|
|
197
|
+
return crypto.createHash('sha1').update(findingKey(f)).digest('hex').slice(0, 8);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function newFindings(before, after) {
|
|
201
|
+
const seen = new Set((before || []).map(findingKey));
|
|
202
|
+
return (after || []).filter((f) => !seen.has(findingKey(f)));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function goneFindings(before, after) {
|
|
206
|
+
const now = new Set((after || []).map(findingKey));
|
|
207
|
+
return (before || []).filter((f) => !now.has(findingKey(f)));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports = {
|
|
211
|
+
PARTS: PARTS,
|
|
212
|
+
CHECKS_FOR: CHECKS_FOR,
|
|
213
|
+
partOf: partOf,
|
|
214
|
+
listFiles: listFiles,
|
|
215
|
+
takeSnapshot: takeSnapshot,
|
|
216
|
+
compare: compare,
|
|
217
|
+
dependencyChanges: dependencyChanges,
|
|
218
|
+
findingKey: findingKey,
|
|
219
|
+
findingId: findingId,
|
|
220
|
+
newFindings: newFindings,
|
|
221
|
+
goneFindings: goneFindings,
|
|
222
|
+
};
|
package/kryptheon-fonts-OFL.txt
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
The dashboard ships two fonts, both under the SIL Open Font License 1.1:
|
|
2
|
-
|
|
3
|
-
kryptheon-archivo.woff2 Archivo (latin subset, variable weight and width)
|
|
4
|
-
Copyright 2020 The Archivo Project Authors
|
|
5
|
-
(https://github.com/Omnibus-Type/Archivo)
|
|
6
|
-
|
|
7
|
-
kryptheon-spacemono.woff2 Space Mono (latin subset, regular)
|
|
8
|
-
Copyright 2016 Google Inc. All Rights Reserved.
|
|
9
|
-
|
|
10
|
-
They are the same files kryptheon.tech uses, so the dashboard and the site
|
|
11
|
-
read alike. The license follows.
|
|
12
|
-
|
|
13
|
-
-----------------------------------------------------------
|
|
14
|
-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
15
|
-
-----------------------------------------------------------
|
|
16
|
-
|
|
17
|
-
PREAMBLE
|
|
18
|
-
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
19
|
-
development of collaborative font projects, to support the font creation
|
|
20
|
-
efforts of academic and linguistic communities, and to provide a free and
|
|
21
|
-
open framework in which fonts may be shared and improved in partnership
|
|
22
|
-
with others.
|
|
23
|
-
|
|
24
|
-
The OFL allows the licensed fonts to be used, studied, modified and
|
|
25
|
-
redistributed freely as long as they are not sold by themselves. The
|
|
26
|
-
fonts, including any derivative works, can be bundled, embedded,
|
|
27
|
-
redistributed and/or sold with any software provided that any reserved
|
|
28
|
-
names are not used by derivative works. The fonts and derivatives,
|
|
29
|
-
however, cannot be released under any other type of license. The
|
|
30
|
-
requirement for fonts to remain under this license does not apply
|
|
31
|
-
to any document created using the fonts or their derivatives.
|
|
32
|
-
|
|
33
|
-
DEFINITIONS
|
|
34
|
-
"Font Software" refers to the set of files released by the Copyright
|
|
35
|
-
Holder(s) under this license and clearly marked as such. This may
|
|
36
|
-
include source files, build scripts and documentation.
|
|
37
|
-
|
|
38
|
-
"Reserved Font Name" refers to any names specified as such after the
|
|
39
|
-
copyright statement(s).
|
|
40
|
-
|
|
41
|
-
"Original Version" refers to the collection of Font Software components as
|
|
42
|
-
distributed by the Copyright Holder(s).
|
|
43
|
-
|
|
44
|
-
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
45
|
-
or substituting -- in part or in whole -- any of the components of the
|
|
46
|
-
Original Version, by changing formats or by porting the Font Software to a
|
|
47
|
-
new environment.
|
|
48
|
-
|
|
49
|
-
"Author" refers to any designer, engineer, programmer, technical
|
|
50
|
-
writer or other person who contributed to the Font Software.
|
|
51
|
-
|
|
52
|
-
PERMISSION & CONDITIONS
|
|
53
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
54
|
-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
-
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
-
Software, subject to the following conditions:
|
|
57
|
-
|
|
58
|
-
1) Neither the Font Software nor any of its individual components,
|
|
59
|
-
in Original or Modified Versions, may be sold by itself.
|
|
60
|
-
|
|
61
|
-
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
-
redistributed and/or sold with any software, provided that each copy
|
|
63
|
-
contains the above copyright notice and this license. These can be
|
|
64
|
-
included either as stand-alone text files, human-readable headers or
|
|
65
|
-
in the appropriate machine-readable metadata fields within text or
|
|
66
|
-
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
-
|
|
68
|
-
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
-
Name(s) unless explicit written permission is granted by the corresponding
|
|
70
|
-
Copyright Holder. This restriction only applies to the primary font name as
|
|
71
|
-
presented to the users.
|
|
72
|
-
|
|
73
|
-
4) The name(s) of the Copyright Holder(s) and the Author(s) of the Font
|
|
74
|
-
Software shall not be used to promote, endorse or advertise any
|
|
75
|
-
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
-
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
-
permission.
|
|
78
|
-
|
|
79
|
-
5) The Font Software, modified or unmodified, in part or in whole,
|
|
80
|
-
must be distributed entirely under this license, and must not be
|
|
81
|
-
distributed under any other license. The requirement for fonts to
|
|
82
|
-
remain under this license does not apply to any document created
|
|
83
|
-
using the Font Software.
|
|
84
|
-
|
|
85
|
-
TERMINATION
|
|
86
|
-
This license becomes null and void if any of the above conditions are
|
|
87
|
-
not met.
|
|
88
|
-
|
|
89
|
-
DISCLAIMER
|
|
90
|
-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
91
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
92
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
93
|
-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
94
|
-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
95
|
-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
96
|
-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
97
|
-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
98
|
-
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
1
|
+
The dashboard ships two fonts, both under the SIL Open Font License 1.1:
|
|
2
|
+
|
|
3
|
+
kryptheon-archivo.woff2 Archivo (latin subset, variable weight and width)
|
|
4
|
+
Copyright 2020 The Archivo Project Authors
|
|
5
|
+
(https://github.com/Omnibus-Type/Archivo)
|
|
6
|
+
|
|
7
|
+
kryptheon-spacemono.woff2 Space Mono (latin subset, regular)
|
|
8
|
+
Copyright 2016 Google Inc. All Rights Reserved.
|
|
9
|
+
|
|
10
|
+
They are the same files kryptheon.tech uses, so the dashboard and the site
|
|
11
|
+
read alike. The license follows.
|
|
12
|
+
|
|
13
|
+
-----------------------------------------------------------
|
|
14
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
15
|
+
-----------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
PREAMBLE
|
|
18
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
19
|
+
development of collaborative font projects, to support the font creation
|
|
20
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
21
|
+
open framework in which fonts may be shared and improved in partnership
|
|
22
|
+
with others.
|
|
23
|
+
|
|
24
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
25
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
26
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
27
|
+
redistributed and/or sold with any software provided that any reserved
|
|
28
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
29
|
+
however, cannot be released under any other type of license. The
|
|
30
|
+
requirement for fonts to remain under this license does not apply
|
|
31
|
+
to any document created using the fonts or their derivatives.
|
|
32
|
+
|
|
33
|
+
DEFINITIONS
|
|
34
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
35
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
36
|
+
include source files, build scripts and documentation.
|
|
37
|
+
|
|
38
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
39
|
+
copyright statement(s).
|
|
40
|
+
|
|
41
|
+
"Original Version" refers to the collection of Font Software components as
|
|
42
|
+
distributed by the Copyright Holder(s).
|
|
43
|
+
|
|
44
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
45
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
46
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
47
|
+
new environment.
|
|
48
|
+
|
|
49
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
50
|
+
writer or other person who contributed to the Font Software.
|
|
51
|
+
|
|
52
|
+
PERMISSION & CONDITIONS
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
54
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,
|
|
59
|
+
in Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
70
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
71
|
+
presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) and the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
80
|
+
must be distributed entirely under this license, and must not be
|
|
81
|
+
distributed under any other license. The requirement for fonts to
|
|
82
|
+
remain under this license does not apply to any document created
|
|
83
|
+
using the Font Software.
|
|
84
|
+
|
|
85
|
+
TERMINATION
|
|
86
|
+
This license becomes null and void if any of the above conditions are
|
|
87
|
+
not met.
|
|
88
|
+
|
|
89
|
+
DISCLAIMER
|
|
90
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
91
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
92
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
93
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
94
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
95
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
96
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
97
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
98
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|