slicekit 0.0.1 → 0.1.1
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 +21 -0
- package/README.md +252 -3
- package/bin/slicekit.js +4 -0
- package/package.json +21 -4
- package/src/adapters/githost/errors.js +17 -0
- package/src/adapters/githost/fixture.js +136 -0
- package/src/adapters/githost/gh-json.js +99 -0
- package/src/adapters/githost/github.js +127 -0
- package/src/adapters/githost/index.js +12 -0
- package/src/adapters/tracker/errors.js +53 -0
- package/src/adapters/tracker/fixture.js +71 -0
- package/src/adapters/tracker/github-issues.js +65 -0
- package/src/adapters/tracker/index.js +14 -0
- package/src/baseline.js +109 -0
- package/src/build/commit.js +201 -0
- package/src/build/decline.js +81 -0
- package/src/build/finish.js +155 -0
- package/src/build/order.js +158 -0
- package/src/build/overlap.js +173 -0
- package/src/build/parallel.js +50 -0
- package/src/build/pr.js +263 -0
- package/src/build/record.js +28 -0
- package/src/build/red.js +207 -0
- package/src/build/review.js +123 -0
- package/src/build/sync.js +47 -0
- package/src/build/verdict.js +410 -0
- package/src/build/worktree.js +169 -0
- package/src/check/ci-event.js +52 -0
- package/src/check/context.js +129 -0
- package/src/check/index.js +140 -0
- package/src/check/rules/.gitkeep +0 -0
- package/src/check/rules/ci-body.js +22 -0
- package/src/check/rules/ci-title.js +43 -0
- package/src/check/rules/citations.js +224 -0
- package/src/check/rules/commands.js +146 -0
- package/src/check/rules/coverage.js +248 -0
- package/src/check/rules/hooks.js +58 -0
- package/src/check/rules/journal.js +17 -0
- package/src/check/rules/layout.js +56 -0
- package/src/check/rules/managed.js +31 -0
- package/src/check/rules/queue.js +106 -0
- package/src/check/rules/references.js +249 -0
- package/src/check/rules/style.js +177 -0
- package/src/check/rules/trailer.js +67 -0
- package/src/cli/baseline.js +66 -0
- package/src/cli/branch.js +86 -0
- package/src/cli/build.js +239 -0
- package/src/cli/check.js +40 -0
- package/src/cli/decide.js +59 -0
- package/src/cli/gaps.js +73 -0
- package/src/cli/hook.js +28 -0
- package/src/cli/index.js +83 -0
- package/src/cli/init.js +96 -0
- package/src/cli/instructions.js +63 -0
- package/src/cli/intake.js +107 -0
- package/src/cli/journal.js +82 -0
- package/src/cli/plan.js +29 -0
- package/src/cli/pr.js +83 -0
- package/src/cli/process.js +59 -0
- package/src/cli/ready-label.js +119 -0
- package/src/cli/review.js +64 -0
- package/src/cli/spec.js +31 -0
- package/src/cli/stage.js +37 -0
- package/src/cli/state.js +106 -0
- package/src/cli/status.js +108 -0
- package/src/cli/update.js +62 -0
- package/src/cli/workflow.js +48 -0
- package/src/config.js +203 -0
- package/src/decisions.js +289 -0
- package/src/evidence.js +27 -0
- package/src/fs.js +38 -0
- package/src/gaps.js +271 -0
- package/src/git.js +209 -0
- package/src/githooks.js +37 -0
- package/src/hook-cli.js +63 -0
- package/src/hooks/io.js +205 -0
- package/src/hooks/paths.js +82 -0
- package/src/hooks/pre-bash.js +715 -0
- package/src/hooks/pre-compact.js +139 -0
- package/src/hooks/pre-edit.js +170 -0
- package/src/hooks/session-end.js +118 -0
- package/src/hooks/session-start.js +209 -0
- package/src/hooks/shapes.js +103 -0
- package/src/hooks/stop.js +37 -0
- package/src/hooks/subagent-marker.js +88 -0
- package/src/hooks/subagent-start.js +100 -0
- package/src/hooks/subagent-stop.js +106 -0
- package/src/ids.js +43 -0
- package/src/init.js +276 -0
- package/src/instructions.js +235 -0
- package/src/intake.js +409 -0
- package/src/journal.js +326 -0
- package/src/lock.js +35 -0
- package/src/markdown.js +155 -0
- package/src/paths.js +33 -0
- package/src/plan.js +25 -0
- package/src/pr.js +73 -0
- package/src/prbody.js +266 -0
- package/src/ready-label.js +107 -0
- package/src/redact.js +33 -0
- package/src/render/compare.js +23 -0
- package/src/render/entry.js +101 -0
- package/src/render/index.js +27 -0
- package/src/render/managed.js +128 -0
- package/src/render/manifest.js +24 -0
- package/src/render/settings.js +76 -0
- package/src/render/update.js +151 -0
- package/src/slicefile.js +173 -0
- package/src/spec-verify.js +58 -0
- package/src/stage.js +325 -0
- package/src/state/build.js +156 -0
- package/src/state/covers.js +58 -0
- package/src/state/index.js +191 -0
- package/src/state/sync.js +64 -0
- package/src/state/transitions.js +282 -0
- package/src/verdict.js +203 -0
- package/src/which.js +37 -0
- package/src/workflow.js +177 -0
- package/src/worktrees.js +68 -0
- package/templates/claude-code/agents/auditor.md +7 -0
- package/templates/claude-code/agents/designer.md +7 -0
- package/templates/claude-code/agents/developer.md +7 -0
- package/templates/claude-code/agents/fixer.md +7 -0
- package/templates/claude-code/agents/ops.md +7 -0
- package/templates/claude-code/agents/reviewer.md +7 -0
- package/templates/claude-code/commands/slicekit-audit.md +7 -0
- package/templates/claude-code/commands/slicekit-build.md +7 -0
- package/templates/claude-code/commands/slicekit-gaps.md +6 -0
- package/templates/claude-code/commands/slicekit-intake.md +7 -0
- package/templates/claude-code/commands/slicekit-ops.md +7 -0
- package/templates/claude-code/commands/slicekit-plan.md +6 -0
- package/templates/claude-code/commands/slicekit-release.md +7 -0
- package/templates/claude-code/commands/slicekit-review.md +7 -0
- package/templates/claude-code/commands/slicekit-specify.md +6 -0
- package/templates/claude-code/commands/slicekit.md +7 -0
- package/templates/claude-code/hooks.json +90 -0
- package/templates/claude-code/manifest.json +171 -0
- package/templates/claude-code/skills/slicekit-ids/SKILL.md +16 -0
- package/templates/claude-code/skills/slicekit-loop/SKILL.md +23 -0
- package/templates/claude-code/skills/slicekit-writing/SKILL.md +24 -0
- package/templates/docs/BUILD.md +5 -0
- package/templates/docs/decisions.md +15 -0
- package/templates/docs/intake/.keep +0 -0
- package/templates/docs/observability.md +25 -0
- package/templates/docs/phases/.keep +0 -0
- package/templates/docs/platform.md +25 -0
- package/templates/docs/releases/.keep +0 -0
- package/templates/docs/runbook.md +21 -0
- package/templates/docs/spec/00-overview.md +8 -0
- package/templates/docs/spec/contracts/.keep +0 -0
- package/templates/docs/spec/gaps.md +6 -0
- package/templates/docs/spec/stack.md +3 -0
- package/templates/githooks/pre-commit +59 -0
- package/templates/githooks/pre-merge-commit +59 -0
- package/templates/githooks/prepare-commit-msg +74 -0
- package/templates/instructions/agents/auditor.md +33 -0
- package/templates/instructions/agents/designer.md +21 -0
- package/templates/instructions/agents/developer.md +49 -0
- package/templates/instructions/agents/fixer.md +41 -0
- package/templates/instructions/agents/ops.md +21 -0
- package/templates/instructions/agents/reviewer.md +63 -0
- package/templates/instructions/commands/build.md +234 -0
- package/templates/instructions/commands/gaps.md +65 -0
- package/templates/instructions/commands/intake.md +90 -0
- package/templates/instructions/commands/plan.md +60 -0
- package/templates/instructions/commands/review.md +117 -0
- package/templates/instructions/commands/specify.md +49 -0
- package/templates/style.json +11 -0
- package/templates/workflow/pins.json +6 -0
- package/templates/workflow/slicekit.yml +110 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// The pull request a `slicekit check --ci` run judges (03 REQ-3.11). In GitHub Actions it is read
|
|
2
|
+
// from the event file `GITHUB_EVENT_PATH` names; any other event (a push) has no pull request.
|
|
3
|
+
// Locally, with no event file, `SLICEKIT_PR_TITLE` / `SLICEKIT_PR_BODY` stand in for one.
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import { DEFAULT_BOT_ACTORS } from '../config.js';
|
|
6
|
+
|
|
7
|
+
// The pseudo-path the ci rules attach their findings to (line 0): the title and body live in the
|
|
8
|
+
// GitHub event, not in a file of the repository, and this reads clearly in CI output.
|
|
9
|
+
export const PR_FILE = '.github/pull_request';
|
|
10
|
+
|
|
11
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
12
|
+
|
|
13
|
+
// `{title, body, number, headSha, labels, author}` or null when there is no pull request. An event file
|
|
14
|
+
// that is named but missing, unreadable or invalid throws: CI must never pass on a broken event.
|
|
15
|
+
export function readCiEvent(env = process.env) {
|
|
16
|
+
const file = env.GITHUB_EVENT_PATH;
|
|
17
|
+
if (typeof file === 'string' && file !== '') {
|
|
18
|
+
let event;
|
|
19
|
+
try {
|
|
20
|
+
event = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
21
|
+
} catch (e) {
|
|
22
|
+
throw new Error(`cannot read the GitHub event at ${file}: ${e.message}`);
|
|
23
|
+
}
|
|
24
|
+
if (!isObject(event)) throw new Error(`the GitHub event at ${file} is not an object`);
|
|
25
|
+
const pr = event.pull_request;
|
|
26
|
+
if (pr === undefined || pr === null) return null;
|
|
27
|
+
if (!isObject(pr)) throw new Error(`the GitHub event at ${file} has a pull_request that is not an object`);
|
|
28
|
+
if (typeof pr.title !== 'string') throw new Error(`the pull request in ${file} has no title`);
|
|
29
|
+
if (pr.body !== undefined && pr.body !== null && typeof pr.body !== 'string') throw new Error(`the pull request in ${file} has a body that is not text`);
|
|
30
|
+
return {
|
|
31
|
+
title: pr.title,
|
|
32
|
+
body: pr.body ?? '',
|
|
33
|
+
number: Number.isInteger(pr.number) ? pr.number : null,
|
|
34
|
+
headSha: typeof pr.head?.sha === 'string' ? pr.head.sha : null,
|
|
35
|
+
labels: Array.isArray(pr.labels) ? pr.labels.map((l) => l?.name).filter((n) => typeof n === 'string') : [],
|
|
36
|
+
author: typeof pr.user?.login === 'string' ? pr.user.login : null,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const title = env.SLICEKIT_PR_TITLE;
|
|
40
|
+
const body = env.SLICEKIT_PR_BODY;
|
|
41
|
+
if (title === undefined && body === undefined) return null;
|
|
42
|
+
return { title: title ?? '', body: body ?? '', number: null, headSha: null, labels: [], author: null };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// D-37: whether the pull request was opened by an actor in ci.botActors (absent: the default list).
|
|
46
|
+
export function isBotAuthor(cfg, pr) {
|
|
47
|
+
const bots = cfg?.ci?.botActors ?? DEFAULT_BOT_ACTORS;
|
|
48
|
+
return typeof pr?.author === 'string' && bots.includes(pr.author);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// A `[spec] ` or `[plan] ` title: a spec or plan pull request, not a slice's.
|
|
52
|
+
export const EXEMPT_TITLE = /^\[(spec|plan)\] /;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { readBaselinesWithProblems } from '../baseline.js';
|
|
4
|
+
import { exists, listFiles, readText } from '../fs.js';
|
|
5
|
+
import { currentBranch, hasCommits, isRepo } from '../git.js';
|
|
6
|
+
import { parseSliceAddr, re } from '../ids.js';
|
|
7
|
+
import { frontMatter, headings, lines, tables } from '../markdown.js';
|
|
8
|
+
import { kitPaths } from '../paths.js';
|
|
9
|
+
import { findSliceFiles, phaseOfDir } from '../slicefile.js';
|
|
10
|
+
import { intakePin } from '../stage.js';
|
|
11
|
+
|
|
12
|
+
const toPosix = (p) => p.split(path.sep).join('/');
|
|
13
|
+
|
|
14
|
+
// Every markdown file a rule may read: the docs root, BUILD.md, README.md, review verdicts and the
|
|
15
|
+
// rendered agent files. Keyed by the POSIX path relative to root, so a docs root of `.` lists once.
|
|
16
|
+
function collectDocs(root, paths) {
|
|
17
|
+
const found = new Map();
|
|
18
|
+
const addTree = (dir) => {
|
|
19
|
+
if (!exists(dir) || !fs.statSync(dir).isDirectory()) return;
|
|
20
|
+
for (const rel of listFiles(dir, { ext: '.md' })) addFile(path.join(dir, ...rel.split('/')));
|
|
21
|
+
};
|
|
22
|
+
const addFile = (abs) => {
|
|
23
|
+
if (!exists(abs) || !fs.statSync(abs).isFile()) return;
|
|
24
|
+
const rel = toPosix(path.relative(root, abs));
|
|
25
|
+
if (found.has(rel)) return;
|
|
26
|
+
const text = readText(abs);
|
|
27
|
+
found.set(rel, { path: abs, rel, text, lines: lines(text) });
|
|
28
|
+
};
|
|
29
|
+
addTree(paths.docs);
|
|
30
|
+
addFile(paths.build);
|
|
31
|
+
addFile(path.join(root, 'README.md'));
|
|
32
|
+
addTree(path.join(paths.kit, 'reviews'));
|
|
33
|
+
addTree(paths.claude);
|
|
34
|
+
return [...found.values()].sort((a, b) => (a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The ids in the first cell of a table row, e.g. `| D-01 | ... |`.
|
|
38
|
+
function tableIds(doc, name) {
|
|
39
|
+
const out = new Set();
|
|
40
|
+
if (!doc) return out;
|
|
41
|
+
const idRe = new RegExp(`^${re(name).source}$`);
|
|
42
|
+
for (const t of tables(doc.text)) {
|
|
43
|
+
for (const row of t.rows) if (idRe.test(row[0] ?? '')) out.add(row[0]);
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Every id is read from the docs already collected (indexed by rel), so no file is read twice.
|
|
49
|
+
function collectIds(root, cfg, paths, docs) {
|
|
50
|
+
const relOf = (abs) => toPosix(path.relative(root, abs));
|
|
51
|
+
const byRel = new Map(docs.map((d) => [d.rel, d]));
|
|
52
|
+
const inDir = (dirAbs) => {
|
|
53
|
+
const dir = relOf(dirAbs);
|
|
54
|
+
return docs.filter((d) => path.posix.dirname(d.rel) === (dir === '' ? '.' : dir));
|
|
55
|
+
};
|
|
56
|
+
const ids = { req: new Set(), decision: new Set(), gap: new Set(), contract: new Set(), slice: new Set(), phase: new Set() };
|
|
57
|
+
|
|
58
|
+
// `## REQ-` and `### REQ-` headings in the spec's own files (not contracts).
|
|
59
|
+
const reqRe = new RegExp(`^(${re('req').source})\\b`);
|
|
60
|
+
for (const doc of inDir(paths.spec)) {
|
|
61
|
+
for (const h of headings(doc.text)) {
|
|
62
|
+
const m = (h.level === 2 || h.level === 3) && reqRe.exec(h.text);
|
|
63
|
+
if (m) ids.req.add(m[1]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
ids.decision = tableIds(byRel.get(relOf(paths.decisions)), 'decision');
|
|
68
|
+
ids.gap = tableIds(byRel.get(relOf(paths.gaps)), 'gap');
|
|
69
|
+
|
|
70
|
+
const cRe = new RegExp(`^(${re('contract').source})-.*\\.md$`);
|
|
71
|
+
for (const doc of inDir(paths.contracts)) {
|
|
72
|
+
const m = cRe.exec(path.posix.basename(doc.rel));
|
|
73
|
+
if (m) ids.contract.add(m[1]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// A malformed slice file is a finding for a rule, not a crash here: read only its address.
|
|
77
|
+
for (const f of findSliceFiles(root, cfg)) {
|
|
78
|
+
ids.phase.add(f.phaseId);
|
|
79
|
+
const doc = byRel.get(relOf(f.path));
|
|
80
|
+
let addr = null;
|
|
81
|
+
try {
|
|
82
|
+
addr = doc ? parseSliceAddr(String(frontMatter(doc.text).data.slice ?? '')) : null;
|
|
83
|
+
} catch {
|
|
84
|
+
addr = null;
|
|
85
|
+
}
|
|
86
|
+
if (addr) ids.slice.add(addr.id);
|
|
87
|
+
}
|
|
88
|
+
if (exists(paths.phases)) {
|
|
89
|
+
for (const dir of fs.readdirSync(paths.phases, { withFileTypes: true })) {
|
|
90
|
+
const phase = dir.isDirectory() ? phaseOfDir(dir.name) : null;
|
|
91
|
+
if (phase) ids.phase.add(phase.id);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return ids;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function gitFacts(root) {
|
|
98
|
+
const repo = isRepo(root);
|
|
99
|
+
if (!repo) return { isRepo: false, hasCommits: false, branch: null };
|
|
100
|
+
return { isRepo: true, hasCommits: hasCommits(root), branch: currentBranch(root) };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function buildContext(root, cfg, { ci = false, env = process.env } = {}) {
|
|
104
|
+
const paths = kitPaths(root, cfg);
|
|
105
|
+
const docs = collectDocs(root, paths);
|
|
106
|
+
const baselinesRead = readBaselinesWithProblems(root);
|
|
107
|
+
return {
|
|
108
|
+
root,
|
|
109
|
+
cfg,
|
|
110
|
+
paths,
|
|
111
|
+
docs,
|
|
112
|
+
ids: collectIds(root, cfg, paths, docs),
|
|
113
|
+
git: gitFacts(root),
|
|
114
|
+
baselines: baselinesRead.baselines,
|
|
115
|
+
baselineProblems: baselinesRead.problems,
|
|
116
|
+
ci,
|
|
117
|
+
env,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// `frozen` for a doc under the intake directory whose sidecar's sha256 matches its bytes
|
|
122
|
+
// (REQ-1.2): no rule reports on it, because it may not be rewritten to pass. `unpinned` for any
|
|
123
|
+
// other doc there: the exemption is earned by the sidecar, so it is checked like any doc.
|
|
124
|
+
// `not-intake` for everything else.
|
|
125
|
+
export function intakeStatus(ctx, doc) {
|
|
126
|
+
const rel = path.relative(path.resolve(ctx.paths.intake), path.resolve(doc.path));
|
|
127
|
+
if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) return 'not-intake';
|
|
128
|
+
return intakePin(doc.path).status === 'frozen' ? 'frozen' : 'unpinned';
|
|
129
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { loadConfig } from '../config.js';
|
|
5
|
+
import { buildContext } from './context.js';
|
|
6
|
+
|
|
7
|
+
const RULES_DIR = fileURLToPath(new URL('./rules/', import.meta.url));
|
|
8
|
+
|
|
9
|
+
// Stands in for a rule file that cannot be imported: it crashes when run, so `check` reports it and
|
|
10
|
+
// fails, while every other command (which imports this module through the CLI) keeps working.
|
|
11
|
+
const brokenRule = (id, file, error) => ({
|
|
12
|
+
id,
|
|
13
|
+
file,
|
|
14
|
+
blocking: true,
|
|
15
|
+
ratchet: false,
|
|
16
|
+
run() {
|
|
17
|
+
throw new Error(`import failed: ${error?.message ?? error}`);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Every `*.js` in dir, in file-name order. Later slices add a rule by adding a file; nothing here
|
|
22
|
+
// changes. A module without the rule shape is kept, and fails when it runs. A missing directory
|
|
23
|
+
// is itself a blocking finding: zero rules must never look like a clean repository.
|
|
24
|
+
export async function loadRules(dir = RULES_DIR) {
|
|
25
|
+
if (!fs.existsSync(dir)) {
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
id: 'loader',
|
|
29
|
+
synthetic: true,
|
|
30
|
+
blocking: true,
|
|
31
|
+
ratchet: false,
|
|
32
|
+
run: () => [{ file: '-', line: 0, message: `rule loader: rules directory missing at ${dir}` }],
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
const names = fs.readdirSync(dir).filter((n) => n.endsWith('.js')).sort();
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const name of names) {
|
|
39
|
+
const fallback = name.slice(0, -'.js'.length);
|
|
40
|
+
let mod;
|
|
41
|
+
try {
|
|
42
|
+
mod = await import(pathToFileURL(path.join(dir, name)).href);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
out.push(brokenRule(fallback, name, e));
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const rule = mod.default && typeof mod.default === 'object' ? mod.default : mod;
|
|
48
|
+
out.push({ ...rule, file: name, id: typeof rule.id === 'string' && rule.id !== '' ? rule.id : fallback });
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const ALL_RULES = Object.freeze(await loadRules());
|
|
54
|
+
|
|
55
|
+
const isFinding = (f) =>
|
|
56
|
+
typeof f === 'object' && f !== null && typeof f.file === 'string' && Number.isInteger(f.line) && typeof f.message === 'string';
|
|
57
|
+
|
|
58
|
+
// Runs one rule. Anything other than an array of well-formed findings is the rule crashing.
|
|
59
|
+
function runRule(rule, ctx) {
|
|
60
|
+
if (typeof rule.run !== 'function') throw new Error('not a rule module (no run function)');
|
|
61
|
+
const found = rule.run(ctx);
|
|
62
|
+
if (!Array.isArray(found)) throw new Error('run did not return an array');
|
|
63
|
+
return found.map((f, i) => {
|
|
64
|
+
if (!isFinding(f)) throw new Error(`finding ${i} is not {file, line, message}`);
|
|
65
|
+
return { ...f, rule: rule.id, bucket: typeof f.bucket === 'string' && f.bucket !== '' ? f.bucket : f.file };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const limit = (baselines, rule, bucket) => {
|
|
70
|
+
const n = baselines?.[rule]?.[bucket];
|
|
71
|
+
return Number.isInteger(n) && n >= 0 ? n : 0;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// A ratchet rule fails a bucket whose count exceeds its baseline; a blocking rule that is not a
|
|
75
|
+
// ratchet fails on any finding; a rule that is neither only reports. A rule that crashes, or whose
|
|
76
|
+
// id another rule already took, always blocks: the gate must never pass because a rule did not run.
|
|
77
|
+
export function check(root, { ci = false, env = process.env, rules = ALL_RULES } = {}) {
|
|
78
|
+
const cfg = loadConfig(root);
|
|
79
|
+
const ctx = buildContext(root, cfg, { ci, env });
|
|
80
|
+
const findings = [];
|
|
81
|
+
const counts = {};
|
|
82
|
+
const lines = [];
|
|
83
|
+
const ratchetCounts = {};
|
|
84
|
+
const seen = new Map();
|
|
85
|
+
let over = 0;
|
|
86
|
+
let blocking = 0;
|
|
87
|
+
const block = (f) => {
|
|
88
|
+
findings.push(f);
|
|
89
|
+
lines.push(`${f.rule} ${f.file}:${f.line} ${f.message}`);
|
|
90
|
+
blocking += 1;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
for (const p of ctx.baselineProblems ?? []) block({ rule: 'baseline', file: `.slicekit/baselines/${p.file}`, line: 0, message: p.problem, bucket: '-' });
|
|
94
|
+
|
|
95
|
+
for (const rule of rules) {
|
|
96
|
+
if (seen.has(rule.id)) {
|
|
97
|
+
const first = seen.get(rule.id).file ?? '<injected>';
|
|
98
|
+
block({ rule: rule.id, file: '-', line: 0, message: `rule ${rule.id} defined twice (${first}, ${rule.file ?? '<injected>'})`, bucket: '-' });
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
seen.set(rule.id, rule);
|
|
102
|
+
counts[rule.id] = {};
|
|
103
|
+
let found;
|
|
104
|
+
try {
|
|
105
|
+
found = runRule(rule, ctx);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
block({ rule: rule.id, file: '-', line: 0, message: `rule ${rule.id} crashed: ${e?.message ?? e}`, bucket: '-' });
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
for (const f of found) counts[rule.id][f.bucket] = (counts[rule.id][f.bucket] ?? 0) + 1;
|
|
111
|
+
const atBaseline = new Set();
|
|
112
|
+
// A ratchet rule is judged by its baselines alone; its `blocking` flag has no effect.
|
|
113
|
+
if (rule.ratchet) {
|
|
114
|
+
ratchetCounts[rule.id] = counts[rule.id];
|
|
115
|
+
for (const [bucket, n] of Object.entries(counts[rule.id])) {
|
|
116
|
+
const max = limit(ctx.baselines, rule.id, bucket);
|
|
117
|
+
if (n > max) over += n - max;
|
|
118
|
+
else atBaseline.add(bucket);
|
|
119
|
+
}
|
|
120
|
+
} else if (rule.blocking) {
|
|
121
|
+
blocking += found.length;
|
|
122
|
+
}
|
|
123
|
+
for (const f of found) {
|
|
124
|
+
const held = atBaseline.has(f.bucket);
|
|
125
|
+
findings.push(held ? { ...f, baseline: true } : f);
|
|
126
|
+
lines.push(`${held ? '(baseline) ' : ''}${f.rule} ${f.file}:${f.line} ${f.message}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// A baseline file is named after a rule; one that names no rule the kit knows (loaded or
|
|
131
|
+
// injected) is a typo or a leftover, and a ratchet must never be kept for nothing.
|
|
132
|
+
const known = new Set([...ALL_RULES, ...rules].map((r) => r.id));
|
|
133
|
+
for (const name of Object.keys(ctx.baselines ?? {})) {
|
|
134
|
+
if (!known.has(name)) block({ rule: 'baseline', file: `.slicekit/baselines/${name}.json`, line: 0, message: `baseline ${name}.json names no rule`, bucket: '-' });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const ruleCount = rules.filter((r) => !r.synthetic).length;
|
|
138
|
+
lines.push(`check: ${findings.length} findings, ${over} over baseline, ${blocking} blocking, ${ruleCount} rules`);
|
|
139
|
+
return { findings, counts, ratchetCounts, exitCode: over > 0 || blocking > 0 ? 1 : 0, lines, rules: ruleCount, over, blocking };
|
|
140
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// ci-body (02 REQ-2.10, 03 REQ-3.11, REQ-3.7): with --ci, the pull request's body carries the
|
|
2
|
+
// REQ-2.10 sections, each once, in order, none empty, under a `## [P<n>/S-<nn>] <name>` heading
|
|
3
|
+
// that names the title's slice. What the body must hold lives in src/prbody.js, so `slicekit pr
|
|
4
|
+
// open` refuses the same bodies before it pushes. A pull request opened by an actor in
|
|
5
|
+
// ci.botActors is exempt (D-37). Without --ci, or with no pull request, nothing.
|
|
6
|
+
import { PR_FILE, isBotAuthor, readCiEvent } from '../ci-event.js';
|
|
7
|
+
import { REQUIRED_SECTIONS, prBodyProblems } from '../../prbody.js';
|
|
8
|
+
|
|
9
|
+
export { REQUIRED_SECTIONS };
|
|
10
|
+
|
|
11
|
+
export const id = 'ci-body';
|
|
12
|
+
export const blocking = true;
|
|
13
|
+
export const ratchet = false;
|
|
14
|
+
|
|
15
|
+
export function run(ctx) {
|
|
16
|
+
if (!ctx.ci) return [];
|
|
17
|
+
const pr = readCiEvent(ctx.env);
|
|
18
|
+
if (!pr || isBotAuthor(ctx.cfg, pr)) return [];
|
|
19
|
+
return prBodyProblems(pr.title, pr.body, ctx.cfg).map((message) => ({ file: PR_FILE, line: 0, message }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default { id, blocking, ratchet, run };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// ci-title (03 REQ-3.11, REQ-3.7): with --ci, the pull request's title begins with the slice it
|
|
2
|
+
// delivers, `[P<n>/S-<nn>]`, and that slice has a slice file, a state file and a state of at least
|
|
3
|
+
// `draft-pr` and before `merged`: a pull request opened by hand, outside the build loop, fails, and
|
|
4
|
+
// so does one for a slice already merged or released (a later change needs its own slice). A `[spec] ` or
|
|
5
|
+
// `[plan] ` title is not a slice's and is exempt. Draft and closed pull requests are judged alike.
|
|
6
|
+
// A pull request opened by an actor in ci.botActors is exempt (D-37). Without --ci, or with no pull
|
|
7
|
+
// request in the event (a push), there is nothing to judge.
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { ID, stateFileName } from '../../ids.js';
|
|
11
|
+
import { readSlice } from '../../state/index.js';
|
|
12
|
+
import { STATES } from '../../state/transitions.js';
|
|
13
|
+
import { EXEMPT_TITLE, PR_FILE, isBotAuthor, readCiEvent } from '../ci-event.js';
|
|
14
|
+
|
|
15
|
+
export const id = 'ci-title';
|
|
16
|
+
export const blocking = true;
|
|
17
|
+
export const ratchet = false;
|
|
18
|
+
|
|
19
|
+
const TITLE = new RegExp(`^\\[(${ID.sliceAddr})\\]`);
|
|
20
|
+
const DRAFT_PR = STATES.indexOf('draft-pr');
|
|
21
|
+
const MERGED = STATES.indexOf('merged');
|
|
22
|
+
|
|
23
|
+
// The slice a title names, or null.
|
|
24
|
+
export const titleSlice = (title) => TITLE.exec(title)?.[1] ?? null;
|
|
25
|
+
|
|
26
|
+
export function run(ctx) {
|
|
27
|
+
if (!ctx.ci) return [];
|
|
28
|
+
const pr = readCiEvent(ctx.env);
|
|
29
|
+
if (!pr || isBotAuthor(ctx.cfg, pr)) return [];
|
|
30
|
+
const at = (message) => [{ file: PR_FILE, line: 0, message }];
|
|
31
|
+
if (EXEMPT_TITLE.test(pr.title)) return [];
|
|
32
|
+
const slice = titleSlice(pr.title);
|
|
33
|
+
if (!slice) return at('title must begin with [P<n>/S-<nn>]');
|
|
34
|
+
if (!ctx.ids.slice.has(slice)) return at(`slice ${slice} has no slice file`);
|
|
35
|
+
if (!fs.existsSync(path.join(ctx.paths.state, stateFileName(slice)))) return at(`slice ${slice} has no state file`);
|
|
36
|
+
const { state } = readSlice(ctx.root, ctx.cfg, slice);
|
|
37
|
+
const rank = STATES.indexOf(state);
|
|
38
|
+
if (!(rank >= DRAFT_PR)) return at(`slice ${slice} is ${state}; open the pull request through /slicekit build`);
|
|
39
|
+
if (rank >= MERGED) return at(`slice ${slice} is ${state}; a change after merge needs its own slice`);
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default { id, blocking, ratchet, run };
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
// citations (03 REQ-3.7): every requirement has the shape of 01 REQ-1.3 (a ## or ### heading) and
|
|
2
|
+
// cites a decision or an intake file that exists; every slice file (REQ-1.5) names only requirements and decisions that
|
|
3
|
+
// exist, and every test in its evaluation set covers a requirement; no D or REQ id is defined twice
|
|
4
|
+
// (REQ-1.4).
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { re } from '../../ids.js';
|
|
8
|
+
import { headings, tables } from '../../markdown.js';
|
|
9
|
+
import { findSliceFiles, parseSliceFile } from '../../slicefile.js';
|
|
10
|
+
|
|
11
|
+
export const id = 'citations';
|
|
12
|
+
export const blocking = true;
|
|
13
|
+
export const ratchet = false;
|
|
14
|
+
|
|
15
|
+
const FENCE = /^\s*(```|~~~)/;
|
|
16
|
+
const LIST = /^\s*(?:(?:[-*+]|\d+[.)])\s+)?/;
|
|
17
|
+
const toPosix = (p) => p.split(path.sep).join('/');
|
|
18
|
+
|
|
19
|
+
// True for every line (0-based) inside a fenced block, fence lines included.
|
|
20
|
+
function fencedLines(lines) {
|
|
21
|
+
let inFence = false;
|
|
22
|
+
return lines.map((l) => {
|
|
23
|
+
if (FENCE.test(l)) {
|
|
24
|
+
inFence = !inFence;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return inFence;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// The label a line starts with once list markers are stripped, e.g. `- Cites: D-01` → `Cites:`.
|
|
32
|
+
const startsWith = (line, label) => line.replace(LIST, '').startsWith(label);
|
|
33
|
+
|
|
34
|
+
// The tokens of one line of a `Cites:` entry, stripped of markdown punctuation. A continuation
|
|
35
|
+
// line has no `Cites:` key to skip.
|
|
36
|
+
function citedTokens(line, continuation = false) {
|
|
37
|
+
const rest = continuation ? line : line.replace(LIST, '').slice('Cites:'.length);
|
|
38
|
+
return rest
|
|
39
|
+
.split(/[\s,;]+/)
|
|
40
|
+
.map((t) => t.replace(/^[`'"([*_]+/, '').replace(/[`'")\]*_.:]+$/, ''))
|
|
41
|
+
.filter((t) => t !== '');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Each `Cites:` line with the lines wrapped under it: indented, not blank, not a list item and
|
|
45
|
+
// carrying no `Key:`. A list item is a new entry (` - Enforced by: …`), never a continuation.
|
|
46
|
+
// Returns one array of [line, number] per entry.
|
|
47
|
+
const LIST_ITEM = /^\s*(?:[-*+]|\d+[.)])\s+/;
|
|
48
|
+
function citesEntries(body) {
|
|
49
|
+
const out = [];
|
|
50
|
+
for (let i = 0; i < body.length; i++) {
|
|
51
|
+
if (!startsWith(body[i][0], 'Cites:')) continue;
|
|
52
|
+
const parts = [body[i]];
|
|
53
|
+
const wrapped = (l) => /^\s+\S/.test(l) && !LIST_ITEM.test(l) && !/^\s*[A-Z][\w ]*:/.test(l);
|
|
54
|
+
while (i + 1 < body.length && wrapped(body[i + 1][0])) parts.push(body[++i]);
|
|
55
|
+
out.push(parts);
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const DECISION = new RegExp(`^${re('decision').source}$`);
|
|
61
|
+
const DATED = /^\d{4}-\d{2}-\d{2}-.+\.[A-Za-z0-9]+$/;
|
|
62
|
+
|
|
63
|
+
// The intake file a token names, or null: `intake/<file>` anywhere in it, or a bare dated name.
|
|
64
|
+
// A bare `intake/` names no file and is not an intake token. Backslashes count as `/`.
|
|
65
|
+
function intakeName(raw) {
|
|
66
|
+
const token = raw.replace(/\\/g, '/');
|
|
67
|
+
const i = token.lastIndexOf('intake/');
|
|
68
|
+
if (i !== -1) {
|
|
69
|
+
const name = token.slice(i + 'intake/'.length).replace(/[)\]]+$/, '');
|
|
70
|
+
return name === '' ? null : name;
|
|
71
|
+
}
|
|
72
|
+
return DATED.test(token) ? token : null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// True when `name` (from intakeName) is a file under the intake folder.
|
|
76
|
+
export function intakeExists(intakeDir, name) {
|
|
77
|
+
if (name === '' || name.split('/').includes('..')) return false;
|
|
78
|
+
const file = path.join(intakeDir, ...name.split('/'));
|
|
79
|
+
return fs.existsSync(file) && fs.statSync(file).isFile();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Every decision and intake reference on the `Cites:` entries among `lines` ([text, number]
|
|
83
|
+
// pairs outside fences): `{token, kind, name, line}`, `name` the decision ID or the intake file.
|
|
84
|
+
// `check` and `spec verify` both resolve citations through this.
|
|
85
|
+
export function citedRefs(lines) {
|
|
86
|
+
const out = [];
|
|
87
|
+
for (const parts of citesEntries(lines)) {
|
|
88
|
+
for (const [line, n] of parts.flatMap(([l, ln], k) => citedTokens(l, k > 0).map((t) => [t, ln]))) {
|
|
89
|
+
if (DECISION.test(line)) {
|
|
90
|
+
out.push({ token: line, kind: 'decision', name: line, line: n });
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const name = intakeName(line);
|
|
94
|
+
if (name !== null) out.push({ token: line, kind: 'intake', name, line: n });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function checkReqBlock(ctx, doc, h, end, fenced, out) {
|
|
101
|
+
const reqId = re('req').exec(h.text)[0];
|
|
102
|
+
const at = (message, line = h.line) => out.push({ file: doc.rel, line, message });
|
|
103
|
+
const body = [];
|
|
104
|
+
for (let i = h.line; i < end; i++) if (!fenced[i]) body.push([doc.lines[i], i + 1]);
|
|
105
|
+
|
|
106
|
+
if (!body.some(([l]) => /\bSHALL\b/.test(l))) at(`${reqId} has no SHALL`);
|
|
107
|
+
if (!body.some(([l]) => startsWith(l, 'Scenario:'))) at(`${reqId} has no Scenario`);
|
|
108
|
+
|
|
109
|
+
const entries = citesEntries(body);
|
|
110
|
+
if (entries.length === 0) at(`${reqId} has no Cites line`);
|
|
111
|
+
for (const parts of entries) {
|
|
112
|
+
const found = citedRefs(parts);
|
|
113
|
+
for (const r of found) {
|
|
114
|
+
if (r.kind === 'decision' && !ctx.ids.decision.has(r.name)) at(`${reqId} cites unknown ${r.name}`, r.line);
|
|
115
|
+
if (r.kind === 'intake' && !intakeExists(ctx.paths.intake, r.name)) at(`${reqId} cites missing intake ${r.name}`, r.line);
|
|
116
|
+
}
|
|
117
|
+
if (found.length === 0) at(`${reqId} Cites line names no decision or intake file`, parts[0][1]);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!body.some(([l]) => startsWith(l, 'Enforced by:'))) at(`${reqId} has no Enforced by line`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// The spec's own files (not contracts), as the context collected them.
|
|
124
|
+
function specDocs(ctx) {
|
|
125
|
+
const dir = toPosix(path.relative(ctx.root, ctx.paths.spec)) || '.';
|
|
126
|
+
return ctx.docs.filter((d) => path.posix.dirname(d.rel) === dir);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function checkRequirements(ctx, defs, out) {
|
|
130
|
+
const reqHead = new RegExp(`^${re('req').source}\\b`);
|
|
131
|
+
for (const doc of specDocs(ctx)) {
|
|
132
|
+
const fenced = fencedLines(doc.lines);
|
|
133
|
+
const hs = headings(doc.text);
|
|
134
|
+
hs.forEach((h, i) => {
|
|
135
|
+
if (!reqHead.test(h.text)) return;
|
|
136
|
+
if (h.level !== 2 && h.level !== 3) {
|
|
137
|
+
const reqId = re('req').exec(h.text)[0];
|
|
138
|
+
out.push({ file: doc.rel, line: h.line, message: `${reqId} heading is level ${h.level}; a requirement is ## or ### (REQ-1.3)` });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// A block ends at the next heading of its own level or higher, or at the next REQ heading of
|
|
142
|
+
// any level, so a nested REQ never lends its lines to the one above it.
|
|
143
|
+
const next = hs.slice(i + 1).find((o) => o.level <= h.level || reqHead.test(o.text));
|
|
144
|
+
const end = next ? next.line - 1 : doc.lines.length;
|
|
145
|
+
defs.push({ id: re('req').exec(h.text)[0], file: doc.rel, line: h.line });
|
|
146
|
+
checkReqBlock(ctx, doc, h, end, fenced, out);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function decisionDefs(ctx, defs) {
|
|
152
|
+
const rel = toPosix(path.relative(ctx.root, ctx.paths.decisions));
|
|
153
|
+
const doc = ctx.docs.find((d) => d.rel === rel);
|
|
154
|
+
if (!doc) return;
|
|
155
|
+
for (const t of tables(doc.text)) {
|
|
156
|
+
t.rows.forEach((row, i) => {
|
|
157
|
+
if (DECISION.test(row[0] ?? '')) defs.push({ id: row[0], file: doc.rel, line: t.line + 2 + i });
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function checkDuplicates(defs, out) {
|
|
163
|
+
const first = new Map();
|
|
164
|
+
for (const d of defs) {
|
|
165
|
+
const seen = first.get(d.id);
|
|
166
|
+
if (!seen) {
|
|
167
|
+
first.set(d.id, d);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
out.push({
|
|
171
|
+
file: d.file,
|
|
172
|
+
line: d.line,
|
|
173
|
+
message: `duplicate id ${d.id} (${seen.file}:${seen.line} and ${d.file}:${d.line})`,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const lineOf = (lines, needle) => {
|
|
179
|
+
const i = lines.findIndex((l) => l.includes(needle));
|
|
180
|
+
return i === -1 ? 1 : i + 1;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
function checkSlices(ctx, out) {
|
|
184
|
+
for (const f of findSliceFiles(ctx.root, ctx.cfg)) {
|
|
185
|
+
const rel = toPosix(path.relative(ctx.root, f.path));
|
|
186
|
+
const doc = ctx.docs.find((d) => d.rel === rel);
|
|
187
|
+
if (!doc) continue;
|
|
188
|
+
let s;
|
|
189
|
+
try {
|
|
190
|
+
s = parseSliceFile(doc.text, f.path);
|
|
191
|
+
} catch (e) {
|
|
192
|
+
out.push({ file: rel, line: 1, message: `slice file cannot be read: ${e.message}` });
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const at = (message, needle) => out.push({ file: rel, line: lineOf(doc.lines, needle), message });
|
|
196
|
+
for (const r of s.requirements) if (!ctx.ids.req.has(r)) at(`slice ${s.id} names unknown ${r}`, r);
|
|
197
|
+
for (const d of s.decisions) if (!ctx.ids.decision.has(d)) at(`slice ${s.id} names unknown ${d}`, d);
|
|
198
|
+
for (const row of s.evaluation) {
|
|
199
|
+
const name = row.test.replace(/^`(.*)`$/, '$1');
|
|
200
|
+
if (row.covers.length === 0) {
|
|
201
|
+
at(`slice ${s.id} test "${name}" covers no requirement`, row.test);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
// Covers names requirements only; a decision or anything else there is unknown.
|
|
205
|
+
// A known requirement the slice's `requirements` does not name is a gap in the record.
|
|
206
|
+
for (const c of row.covers) {
|
|
207
|
+
if (!ctx.ids.req.has(c)) at(`slice ${s.id} names unknown ${c}`, row.test);
|
|
208
|
+
else if (!s.requirements.includes(c)) at(`slice ${s.id} test "${name}" covers ${c}, which the slice does not name`, row.test);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function run(ctx) {
|
|
215
|
+
const out = [];
|
|
216
|
+
const defs = [];
|
|
217
|
+
checkRequirements(ctx, defs, out);
|
|
218
|
+
decisionDefs(ctx, defs);
|
|
219
|
+
checkDuplicates(defs, out);
|
|
220
|
+
checkSlices(ctx, out);
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export default { id, blocking, ratchet, run };
|