@kirill.konshin/lint 0.6.0 → 0.6.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.
Files changed (51) hide show
  1. package/README.md +8 -8
  2. package/dist/lib.js +2 -1
  3. package/package.json +4 -6
  4. package/skills/spec-steward/SKILL.md +2 -2
  5. package/skills/spec-steward/references/contract.md +7 -7
  6. package/skills/spec-tools/SKILL.md +3 -1
  7. package/skills/spec-tools/references/contract.md +5 -5
  8. package/skills/spec-tools/references/gitlab.md +26 -35
  9. package/skills/spec-tools/scripts/cli.js +8155 -0
  10. package/skills/spec-verify/SKILL.md +6 -6
  11. package/skills/spec-steward/scripts/lib/align.mjs +0 -127
  12. package/skills/spec-steward/scripts/lib/checks.mjs +0 -589
  13. package/skills/spec-steward/scripts/lib/citations.mjs +0 -156
  14. package/skills/spec-steward/scripts/lib/corpus.mjs +0 -256
  15. package/skills/spec-steward/scripts/lib/coverage.mjs +0 -123
  16. package/skills/spec-steward/scripts/lib/evidence.mjs +0 -189
  17. package/skills/spec-steward/scripts/lib/git.mjs +0 -138
  18. package/skills/spec-steward/scripts/lib/review.mjs +0 -347
  19. package/skills/spec-steward/scripts/lib/scan.mjs +0 -364
  20. package/skills/spec-steward/scripts/lib/util.mjs +0 -161
  21. package/skills/spec-steward/scripts/lib/wire.mjs +0 -333
  22. package/skills/spec-steward/scripts/steward.mjs +0 -289
  23. package/spec-tools/dist/audit-DkZZulq6.mjs +0 -130
  24. package/spec-tools/dist/auditChanged-CNGjlake.mjs +0 -1
  25. package/spec-tools/dist/auditChanged-CZCvMgyZ.mjs +0 -618
  26. package/spec-tools/dist/auditReport-xgq4wK2i.mjs +0 -458
  27. package/spec-tools/dist/auditScope-CBuBtfPG.mjs +0 -104
  28. package/spec-tools/dist/changeGates-DdeQKfle.mjs +0 -333
  29. package/spec-tools/dist/changeGates-uy4Ti8rK.mjs +0 -1
  30. package/spec-tools/dist/ci-BUewHJS3.mjs +0 -143
  31. package/spec-tools/dist/ci-CFBzn8Of.mjs +0 -1
  32. package/spec-tools/dist/cli.mjs +0 -93
  33. package/spec-tools/dist/comment-szasMMg2.mjs +0 -57
  34. package/spec-tools/dist/files-Bppsb34B.mjs +0 -1
  35. package/spec-tools/dist/files-QlzY687_.mjs +0 -38
  36. package/spec-tools/dist/html-BMTkpbUN.mjs +0 -1766
  37. package/spec-tools/dist/jsonrepair-Dlm5dEen.mjs +0 -742
  38. package/spec-tools/dist/repo-CjIoUPYl.mjs +0 -16
  39. package/spec-tools/dist/repo-DUcnJw3c.mjs +0 -1
  40. package/spec-tools/dist/run-BElA9du3.mjs +0 -67
  41. package/spec-tools/dist/specDiff-8G56jMYn.mjs +0 -123
  42. package/spec-tools/dist/steward-DeieyOcj.mjs +0 -34
  43. package/spec-tools/dist/stewardAudit-BRMM0lrD.mjs +0 -1
  44. package/spec-tools/dist/stewardAudit-v0vOMfLN.mjs +0 -271
  45. package/spec-tools/dist/tier-Cn0P7juM.mjs +0 -1
  46. package/spec-tools/dist/tier-c3s_mA_I.mjs +0 -65
  47. package/spec-tools/dist/util-wnxhsnWO.mjs +0 -49
  48. package/spec-tools/dist/verdict-BFfN9PO8.mjs +0 -58
  49. package/spec-tools/dist/workers-BcIgckeq.mjs +0 -417
  50. package/spec-tools/dist/workflowEvidence-DyBj8EdG.mjs +0 -1
  51. package/spec-tools/dist/workflowEvidence-oui6ghPI.mjs +0 -78
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: spec-verify
3
3
  description: Audit whether the code does exactly what the OpenSpec specifications say, as written; its verdict gates CI. Checks what no tool can - cross-capability contradiction, EXACT code conformance, whether a bound test asserts its rule, and gaps nobody recorded. It audits code conformance only; corpus quality — placement, REQUIRED versus ⚠️ ADVISORY, evidence — is the spec-steward skill's audit. Workers only judge; each writes audit-parts/findings/part-<n>-<reader>.json and `spec-tools report` renders spec-verify.md at the repo root. Interactively, run `spec-tools audit`, then summarize spec-verify.md and ask the operator what to do. After changing a capability, `/spec-verify changed` judges what changed; the full audit runs when the operator asks.
4
- model: claude-haiku-4-5-20251001
4
+ model: claude-haiku-5-5
5
5
  effort: high
6
6
  ---
7
7
 
@@ -9,7 +9,7 @@ effort: high
9
9
 
10
10
  The capability specifications under `openspec/specs/` are the single source of truth. The tooling's contract — this audit's scope, partition, merge and verdict — is the `spec-tools` skill's `references/contract.md`; the grading and the finding kinds are below; how a specification is written is the `spec-steward` model (its `references/model.md`); how a change is made is the repository's `AGENTS.md`. A code citation is an optional pointer to a requirement, never evidence that code complies.
11
11
 
12
- **Where it runs:** in CI as the gating audit (the reading jobs and the judge job), and locally as `spec-tools audit` and `/spec-verify changed`. spec-steward's corpus audit is the local, owner-requested counterpart; it never runs in CI.
12
+ **Where it runs:** in CI as the gating audit (one job: the reading, then the judging), and locally as `spec-tools audit` and `/spec-verify changed`. spec-steward's corpus audit is the local, owner-requested counterpart; it never runs in CI.
13
13
 
14
14
  **Invariant this skill enforces: CODE 100% follows the SPEC.** A requirement and its code must match exactly; a mismatch is always a finding (the owner decides which side is fixed — never leave them divergent).
15
15
 
@@ -24,7 +24,7 @@ These run deterministically in CI. Do not re-derive them, and do not report what
24
24
  - `openspec validate` and `spec-tools gates` — the corpus gates: OpenSpec's structure check, then spec-steward's check and the change gates. What a citation is, how a test binds to a scenario, the markers, the size lines and the scenario ratchet are the `spec-steward` contract.
25
25
  - `spec-tools scope` — **this run's scope, its partition, and the evidence each part is judged from.** Nothing here is searched for; it is read.
26
26
  - `spec-tools report` — **the merge.** It looks every ERROR's quotes up at their `file:line` in the audited commit, tiers by the kinds below, takes the weakest part's coverage, computes the verdict and renders `spec-verify.md`. No reader judges twice.
27
- - `spec-steward coverage` — the coverage report: which requirements and scenarios a test binds, the ⚠️ Advisory requirements and the recorded known gaps. The audit does not read it.
27
+ - `spec-tools steward coverage` — the coverage report: which requirements and scenarios a test binds, the ⚠️ Advisory requirements and the recorded known gaps. The audit does not read it.
28
28
  - Corpus quality — whether a rule sits in the right place, whether it is REQUIRED or ⚠️ Advisory, whether its evidence is the right kind — is the `spec-steward` skill's audit.
29
29
 
30
30
  **Why the split matters.** This skill is an LLM audit: one reader over the whole corpus samples, and two such runs over the same commit can reach different verdicts. Everything mechanically decidable was moved out of it and into code — including finding the evidence. What remains needs judgment — read in full, one worker per part, and graded so that only what you can demonstrate stops a pipeline.
@@ -44,7 +44,7 @@ Two inputs, both written by `spec-tools scope` and, in CI, handed to the audit j
44
44
  - `audit-scope.json` — the scope and its `parts`: for each, its number, the `files` its worker reads and the `requirementIds` it judges.
45
45
  - `audit-parts/<capability>.md`, one per capability in scope — **the evidence.** Each carries every requirement verbatim with its id and `file:line`, and under each: **Bound tests** — the tests bound to the requirement or to one of its scenarios, quoted with the files' own line numbers (the enclosing test, or a window marked as such); **Where its terms occur** — the lines of the sources, comments stripped, where the requirement's own terms occur, or the note that it names none; and the related requirements elsewhere that share its terms, each with its statement.
46
46
 
47
- You NEVER produce or regenerate these — no `spec-tools scope`, no `spec-steward coverage`, no `spec-tools report`: a worker's shell is `git` and nothing else. If a file is absent, say so in the coverage, grade every check that depends on it as not run, and — locally — tell the user to run `spec-tools scope` first.
47
+ You NEVER produce or regenerate these — no `spec-tools scope`, no `spec-tools steward coverage`, no `spec-tools report`: a worker's shell is `git` and nothing else. If a file is absent, say so in the coverage, grade every check that depends on it as not run, and — locally — tell the user to run `spec-tools scope` first.
48
48
 
49
49
  **Read everything with Read / Glob / Grep — do not shell out.** A worker runs under `claude --print`, which cannot be prompted for permission: a command outside the job's `--allowedTools` stalls the run and no report is written. An evidence file longer than one Read returns is read in full with `offset`/`limit` — never sampled.
50
50
 
@@ -52,7 +52,7 @@ A **requirement** is one `### Requirement:` heading and everything under it. Add
52
52
 
53
53
  ## The worker contract
54
54
 
55
- One reader cannot hold the whole corpus and every symbol it governs; a run that tries samples, and a sample cannot support a `PASS`. So the evidence is assembled mechanically before the audit starts, and `spec-tools workers` starts one headless worker per part. The passes run in order — the reading, shared out among parallel reading jobs, the completion pass over what the reading left short, and the verification pass over every ERROR still standing. Each later brief names exactly what it judges, and the tool runs every pass, never a worker.
55
+ One reader cannot hold the whole corpus and every symbol it governs; a run that tries samples, and a sample cannot support a `PASS`. So the evidence is assembled mechanically before the audit starts, and `spec-tools workers` starts one headless worker per part. The passes run in order, in one job — the reading, the completion pass over what the reading left short, and the verification pass over every ERROR still standing. Each later brief names exactly what it judges, and the tool runs every pass, never a worker.
56
56
 
57
57
  A worker's brief gives its part number, its reader number, the findings file it alone writes, its part's evidence files and its `requirementIds`. It judges all five checks over its evidence in one pass: the specification against itself (checks 2 and 3, from the requirement blocks and related lists the evidence carries) and the code against the specification (1, 4 and 5) — every requirement, every bound test and every listed related pair. It opens a source only where an excerpt is marked as a window, where a term hit must be confirmed, where the behaviour continues outside the excerpt, or where a related requirement's statement line is not enough to decide. Its tools are Skill, Read, Glob, Grep, Write, Edit (to repair its own findings file) and the git commands; anything else is denied and only costs a turn. It writes its findings file and returns one line: the path and its counts per tier.
58
58
 
@@ -72,7 +72,7 @@ Checks 2–5 are spec-steward's audit criteria 10, 9, 11 and 5 (its `references/
72
72
 
73
73
  Every finding is in exactly one of three tiers:
74
74
 
75
- - **ERROR** — a defect you demonstrated: you opened both sides and quote each at `file:line`. It fails the build once its verifier confirms it real and critical.
75
+ - **ERROR** — a defect you demonstrated: you opened both sides and quote each at `file:line`. It fails the build once its verifier confirms it real and critical. It rests on the repository alone: where what the code does turns on a dependency's behaviour — a command-line flag, a library default — that the repository does not show, it is not demonstrated.
76
76
  - **WARN** — a defect of the same class, suspected but not demonstrated: suspected from a sample, or not read on both sides. Published, never a failure.
77
77
  - **INFO** — inventory and state recorded for a reader. Never a failure.
78
78
 
@@ -1,127 +0,0 @@
1
- // @ts-check
2
- /**
3
- * Rules shared by several repositories, compared: capabilities pair by path or by leaf name, requirements by anchor or
4
- * by statement. A rule is its name and statement; its scenarios are each repository's own, so a scenario only one
5
- * repository has is not drift. Reports identical, drifted and one-sided rules; choosing the wording stays with the owner.
6
- */
7
- import { loadCorpus } from './corpus.mjs';
8
- import { jaccard, normalize, words } from './util.mjs';
9
-
10
- /**
11
- * @typedef {import('./corpus.mjs').Corpus} Corpus
12
- * @typedef {import('./corpus.mjs').Requirement} Requirement
13
- */
14
-
15
- /** The rule's own words: its statement, without its markers and scenarios, normalized. @param {Requirement} r */
16
- const statement = (r) => normalize(r.statement);
17
-
18
- /**
19
- * Word-level difference of two texts: the words only one side has, in order.
20
- * @param {string} a
21
- * @param {string} b
22
- */
23
- export function wordDiff(a, b) {
24
- const wa = normalize(a).split(' ');
25
- const wb = normalize(b).split(' ');
26
- const sa = new Set(wa);
27
- const sb = new Set(wb);
28
- return { onlyA: wa.filter((w) => !sb.has(w)).join(' '), onlyB: wb.filter((w) => !sa.has(w)).join(' ') };
29
- }
30
-
31
- /**
32
- * @param {Corpus} a
33
- * @param {Corpus} b
34
- */
35
- export function align(a, b) {
36
- const pairs = [];
37
- const leaf = (/** @type {string} */ c) => c.split('/').pop();
38
- for (const ca of a.capabilities) {
39
- const cb =
40
- b.capabilities.find((x) => x.capability === ca.capability) ??
41
- b.capabilities.find((x) => leaf(x.capability) === leaf(ca.capability));
42
- if (!cb) continue;
43
- const used = new Set();
44
- const reqs = [];
45
- for (const ra of ca.requirements) {
46
- let rb = cb.requirements.find((x) => x.slug === ra.slug && !used.has(x.slug));
47
- if (!rb) {
48
- const best = cb.requirements
49
- .filter((x) => !used.has(x.slug))
50
- .map((x) => ({ x, s: jaccard(words(ra.statement), words(x.statement)) }))
51
- .sort((p, q) => q.s - p.s)[0];
52
- if (best && best.s >= 0.5) rb = best.x;
53
- }
54
- if (!rb) {
55
- reqs.push({ kind: 'only-a', a: ra });
56
- continue;
57
- }
58
- used.add(rb.slug);
59
- const same = statement(ra) === statement(rb) && ra.name === rb.name;
60
- reqs.push({
61
- kind: same ? 'identical' : 'drift',
62
- a: ra,
63
- b: rb,
64
- ...(same ? {} : wordDiff(ra.statement, rb.statement)),
65
- });
66
- }
67
- for (const rb of cb.requirements) if (!used.has(rb.slug)) reqs.push({ kind: 'only-b', b: rb });
68
- pairs.push({ a: ca.capability, b: cb.capability, requirements: reqs });
69
- }
70
- return pairs;
71
- }
72
-
73
- /**
74
- * @param {Record<string, any>} opts
75
- * @param {{ name: string, path: string, specsDir: string }[]} roots
76
- */
77
- export function alignCli(opts, roots) {
78
- if (roots.length < 2) {
79
- process.stderr.write('align needs two --root NAME=path\n');
80
- return 2;
81
- }
82
- const [ra, rb] = roots;
83
- const pairs = align(loadCorpus(ra.path, ra), loadCorpus(rb.path, rb));
84
- if (opts.json) {
85
- process.stdout.write(
86
- JSON.stringify(
87
- pairs.map((p) => ({
88
- ...p,
89
- requirements: p.requirements.map((r) => ({
90
- kind: r.kind,
91
- a: r.a && `${r.a.file}:${r.a.line} ${r.a.name}`,
92
- b: r.b && `${r.b.file}:${r.b.line} ${r.b.name}`,
93
- onlyA: r.onlyA,
94
- onlyB: r.onlyB,
95
- })),
96
- })),
97
- null,
98
- 2,
99
- ) + '\n',
100
- );
101
- return 0;
102
- }
103
- let drift = 0;
104
- for (const p of pairs) {
105
- const count = (/** @type {string} */ k) => p.requirements.filter((r) => r.kind === k).length;
106
- process.stdout.write(
107
- `\n${ra.name}:${p.a} ↔ ${rb.name}:${p.b} — identical ${count('identical')}, drift ${count('drift')}, only ${ra.name} ${count('only-a')}, only ${rb.name} ${count('only-b')}\n`,
108
- );
109
- for (const r of p.requirements) {
110
- if (r.kind === 'identical') continue;
111
- if (r.kind === 'drift') {
112
- drift++;
113
- process.stdout.write(
114
- ` drift ${ra.name} ${r.a?.file}:${r.a?.line} ↔ ${rb.name} ${r.b?.file}:${r.b?.line} "${r.a?.name}"\n`,
115
- );
116
- if (r.onlyA) process.stdout.write(` only ${ra.name}: ${r.onlyA.slice(0, 300)}\n`);
117
- if (r.onlyB) process.stdout.write(` only ${rb.name}: ${r.onlyB.slice(0, 300)}\n`);
118
- } else {
119
- const x = r.a ?? r.b;
120
- process.stdout.write(
121
- ` ${r.kind === 'only-a' ? `only ${ra.name}` : `only ${rb.name}`} ${x?.file}:${x?.line} "${x?.name}"\n`,
122
- );
123
- }
124
- }
125
- }
126
- return drift ? 1 : 0;
127
- }