@kirill.konshin/lint 0.5.5 → 0.6.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/README.md +38 -3
- package/commands/spec-author.md +39 -0
- package/dist/configs/base.d.ts +4 -3
- package/dist/configs/base.js +61 -74
- package/dist/configs/imports.d.ts +3 -2
- package/dist/configs/imports.js +95 -146
- package/dist/configs/nx.d.ts +4 -3
- package/dist/configs/nx.js +31 -41
- package/dist/configs/prettier.d.ts +3 -2
- package/dist/configs/prettier.js +19 -16
- package/dist/configs/promise.d.ts +3 -2
- package/dist/configs/promise.js +16 -16
- package/dist/configs/react.d.ts +4 -3
- package/dist/configs/react.js +178 -217
- package/dist/configs/storybook.d.ts +4 -3
- package/dist/configs/storybook.js +22 -22
- package/dist/configs/tailwind.d.ts +4 -3
- package/dist/configs/tailwind.js +67 -91
- package/dist/configs/testing.d.ts +7 -6
- package/dist/configs/testing.js +112 -146
- package/dist/configs/turbo.d.ts +4 -3
- package/dist/configs/turbo.js +19 -27
- package/dist/configs/typescriptTypeAware.d.ts +4 -3
- package/dist/configs/typescriptTypeAware.js +99 -95
- package/dist/configs/unicorn.d.ts +3 -2
- package/dist/configs/unicorn.js +34 -41
- package/dist/exts.d.ts +2 -1
- package/dist/exts.js +10 -11
- package/dist/index.d.ts +44 -42
- package/dist/index.js +53 -85
- package/dist/lib.d.ts +21 -21
- package/dist/lib.js +262 -301
- package/dist/lintPrepare.d.ts +20 -17
- package/dist/lintPrepare.js +341 -371
- package/dist/lintStaged.d.ts +4 -3
- package/dist/lintStaged.js +25 -22
- package/dist/prettier.d.ts +4 -3
- package/dist/prettier.js +16 -17
- package/dist/restrictions.d.ts +11 -10
- package/dist/restrictions.js +18 -22
- package/dist/yarn.cjs +79 -98
- package/dist/yarn.d.cts +3 -2
- package/package.json +22 -8
- package/rules/agent.md +2 -0
- package/rules/openspec.md +1 -1
- package/skills/spec-steward/SKILL.md +4 -12
- package/skills/spec-steward/references/audit.md +18 -43
- package/skills/spec-steward/references/contract.md +9 -9
- package/skills/spec-steward/references/criteria.md +4 -4
- package/skills/spec-steward/references/review-format.md +6 -6
- package/skills/spec-steward/references/wiring.md +2 -2
- package/skills/spec-steward/references/worker.md +67 -0
- package/skills/spec-steward/sweeps.json +49 -0
- package/skills/spec-tools/SKILL.md +48 -0
- package/skills/spec-tools/references/contract.md +111 -0
- package/skills/spec-tools/references/gitlab.md +120 -0
- package/skills/spec-tools/scripts/cli.js +8129 -0
- package/skills/spec-verify/SKILL.md +153 -0
- package/dist/configs/base.d.ts.map +0 -1
- package/dist/configs/imports.d.ts.map +0 -1
- package/dist/configs/nx.d.ts.map +0 -1
- package/dist/configs/prettier.d.ts.map +0 -1
- package/dist/configs/promise.d.ts.map +0 -1
- package/dist/configs/react.d.ts.map +0 -1
- package/dist/configs/storybook.d.ts.map +0 -1
- package/dist/configs/tailwind.d.ts.map +0 -1
- package/dist/configs/testing.d.ts.map +0 -1
- package/dist/configs/turbo.d.ts.map +0 -1
- package/dist/configs/typescriptTypeAware.d.ts.map +0 -1
- package/dist/configs/unicorn.d.ts.map +0 -1
- package/dist/exts.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib.d.ts.map +0 -1
- package/dist/lintPrepare.d.ts.map +0 -1
- package/dist/lintStaged.d.ts.map +0 -1
- package/dist/prettier.d.ts.map +0 -1
- package/dist/restrictions.d.ts.map +0 -1
- package/dist/yarn.d.cts.map +0 -1
- package/skills/spec-steward/scripts/lib/align.mjs +0 -127
- package/skills/spec-steward/scripts/lib/checks.mjs +0 -589
- package/skills/spec-steward/scripts/lib/citations.mjs +0 -156
- package/skills/spec-steward/scripts/lib/corpus.mjs +0 -256
- package/skills/spec-steward/scripts/lib/coverage.mjs +0 -123
- package/skills/spec-steward/scripts/lib/evidence.mjs +0 -334
- package/skills/spec-steward/scripts/lib/git.mjs +0 -138
- package/skills/spec-steward/scripts/lib/review.mjs +0 -347
- package/skills/spec-steward/scripts/lib/scan.mjs +0 -364
- package/skills/spec-steward/scripts/lib/util.mjs +0 -161
- package/skills/spec-steward/scripts/lib/wire.mjs +0 -331
- package/skills/spec-steward/scripts/steward.mjs +0 -350
- package/skills/spec-steward/workflows/audit.js +0 -539
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-verify
|
|
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
|
|
5
|
+
effort: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Verify spec adherence
|
|
9
|
+
|
|
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
|
+
|
|
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.
|
|
13
|
+
|
|
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
|
+
|
|
16
|
+
The audit itself is **read-only**: no worker changes code or specs, and neither do you while it runs; a worker writes its own findings file and nothing else. Fixes come afterwards, only when the operator chooses them — see _Interactive use_.
|
|
17
|
+
|
|
18
|
+
There are three ways in. A worker — its brief names a part and a findings file — follows _The worker contract_. `/spec-verify changed` is _Focused mode_. `/spec-verify` from an operator is _Interactive use_.
|
|
19
|
+
|
|
20
|
+
## What this skill does NOT check
|
|
21
|
+
|
|
22
|
+
These run deterministically in CI. Do not re-derive them, and do not report what they own — a finding they cover is noise, not signal:
|
|
23
|
+
|
|
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
|
+
- `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
|
+
- `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-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
|
+
- 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
|
+
|
|
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.
|
|
31
|
+
|
|
32
|
+
## Scope
|
|
33
|
+
|
|
34
|
+
In CI, `spec-tools tier` chooses each pass's scope, model and effort — the run classes are the `spec-tools` contract's — and this frontmatter applies to an in-chat run only. The scope is partitioned before any worker starts, in `audit-scope.json`: its `parts` list the parts, one worker each, with the evidence files each part judges. Ignore build output (any `dist/`, `node_modules`, and whatever else the repository's `AGENTS.md` names as generated).
|
|
35
|
+
|
|
36
|
+
## Focused mode — `/spec-verify changed`
|
|
37
|
+
|
|
38
|
+
Invoked with the argument `changed`, this skill is an author's pre-hand-back check, not the gate. `spec-tools changed` has already written `audit-parts/changed.md` — you do not run it —: the requirements the working tree changed, each with the tests bound to it, where its own terms occur, and its related requirements quoted in full. You are the one reader: Read that file, run checks 2, 3 and 4 over exactly those requirements against what is quoted, and print the findings in the conversation — no workers, no findings file, no report. Say plainly when a changed sentence contradicts a related requirement, when it duplicates one, and when the code does not do what the new text says.
|
|
39
|
+
|
|
40
|
+
## The material — read, never produced
|
|
41
|
+
|
|
42
|
+
Two inputs, both written by `spec-tools scope` and, in CI, handed to the audit jobs as artifacts:
|
|
43
|
+
|
|
44
|
+
- `audit-scope.json` — the scope and its `parts`: for each, its number, the `files` its worker reads and the `requirementIds` it judges.
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
51
|
+
A **requirement** is one `### Requirement:` heading and everything under it. Address it as `<capability>#<slug>` (e.g. `billing/refunds#requirement-a-refund-is-applied-once`) — the slug is stable, so never invent positional ids.
|
|
52
|
+
|
|
53
|
+
## The worker contract
|
|
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.
|
|
56
|
+
|
|
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
|
+
|
|
59
|
+
## The checks
|
|
60
|
+
|
|
61
|
+
Checks 2–5 are spec-steward's audit criteria 10, 9, 11 and 5 (its `references/criteria.md`), worded identically: the same principle, judged here against the code and the specification as written, where spec-steward judges whether the rule itself should change.
|
|
62
|
+
|
|
63
|
+
1. **Gap honesty** — for each requirement no test binds, decide whether the behaviour exists at all, starting from where its terms occur; the absence of a citation is never itself a reason to suspect a gap. A requirement describing behaviour nothing implements, with no `**⚠️ Known gap (<tracker>):**` line recorded, is an undeclared gap. One that names no term is judged first for whether it describes code behaviour at all — a process or documentation rule has nothing to implement and is not a gap. Kind: `undeclared-gap`. Do not report which requirements no test binds: that is in `spec-coverage.md`, mechanically; only the judgment — gap or not — is yours.
|
|
64
|
+
2. **Contradictory rules.** (spec-steward criterion 10) — no requirement contradicts another, in the same capability or a different one. `openspec validate` compares a delta against the spec it replaces; nothing compares capability A with capability B. Each requirement's evidence lists the related requirements sharing its terms (e.g. an ordering two capabilities both state, who owns a piece of state, which layer may hold a credential); judge every listed pair, and note in prose any overlap the terms could not pair. Report each conflicting pair. Kind: `conflict`.
|
|
65
|
+
3. **A rule redundant with, or substantially overlapping, another.** (spec-steward criterion 9) — two requirements asserting the same rule; one should own it and the other cross-reference. Judged over the same related lists. Kind: `spec-dup`.
|
|
66
|
+
4. **A rule that no longer matches the implementation or architecture.** (spec-steward criterion 11) — judged from the code side, EXACT: the code does exactly what the requirement says, no more and no less. Compare the quoted code with the requirement word-for-word: missing or extra behaviour, different ordering or condition, a looser type than required. When a requirement mandates a concrete class or pattern, the code MUST use it; when it states only a requirement, any implementation satisfying it passes. Open the source only where the excerpt is a window or the behaviour continues outside it. A `code-mismatch` quotes code that does something DIFFERENT from the requirement; code that conforms is not a defect whether or not anything cites it, and a pointer naming another requirement is not a finding. Kind: `code-mismatch`.
|
|
67
|
+
5. **A rule whose tests satisfy the wording while failing to protect the intent.** (spec-steward criterion 5) — for each test bound to a requirement or to one of its scenarios, read the quoted test and confirm it asserts that rule. Do not trust the name: a citation, comment, description or prompt text is never evidence that code complies. A structural requirement may be proven by a schema assertion or a compile-time `Equal<>` pin. Kind: `untested` — a test bound to a scenario that does not assert it. A requirement no test binds is already in `spec-coverage.md`, mechanically; do not spend a row restating it.
|
|
68
|
+
|
|
69
|
+
**Every path you name must exist.** Every `file:line` in the evidence files exists by construction. Any other code or test path a finding names MUST exist — confirm each with Read or Glob before writing the row. Bare basenames are forbidden: two files can share one. A row whose path does not resolve is invalid: correct the path, or drop the row.
|
|
70
|
+
|
|
71
|
+
## Grading — this decides whether the build fails
|
|
72
|
+
|
|
73
|
+
Every finding is in exactly one of three tiers:
|
|
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.
|
|
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
|
+
- **INFO** — inventory and state recorded for a reader. Never a failure.
|
|
78
|
+
|
|
79
|
+
The kinds are fixed — never invent another. ERROR-class, graded ERROR when demonstrated and WARN when only suspected: `code-mismatch` (the code does not do what a requirement says), `conflict` (two requirements contradict), `undeclared-gap` (a requirement describes behaviour that does not exist, with no Known gap recorded). INFO-class, however certain: `spec-dup` (one rule asserted by two requirements), `untested` (a test cites a scenario but does not assert it). The merge records any other kind as INFO. A finding against a requirement marked `**⚠️ Advisory:**` is at most WARN.
|
|
80
|
+
|
|
81
|
+
The one line worth repeating here, because it is the whole contract: **you may write ERROR only if you opened both sides and can quote each at `file:line`.** Anything you inferred, sampled, or could not read both halves of is WARN. Marking a suspicion ERROR costs the team a red pipeline on a guess; marking a real defect WARN costs one triage cycle. The asymmetry is deliberate. And a worker's ERROR is not yet the gate's: the verification pass puts each to one more reader over that finding alone, which confirms it only when the divergence is real and critical and lowers it to WARN with its reason otherwise — so a worker grades what it demonstrated, and never softens a real divergence because it seems minor; the verifier decides that.
|
|
82
|
+
|
|
83
|
+
**State your coverage honestly.** Each worker records, for each of the five checks, whether it ran it in full, sampled, or not at all — and what it skipped. _In full_ means every requirement, bound test, term-hit list or related pair of the part was judged — and every requirement id appears in your `judged` list, which is what the merge believes rather than the word; judging from a complete quoted excerpt and the term hits without opening the source IS in full — that is what the evidence is for. An excerpt marked as a window or an outline is NOT complete: Read the file at those lines before grading, every time — the evidence tells you which files, so this is a handful of Reads, never a search — and only then is the check in full. A check with nothing to judge in your part is `full`, not `not-run`. _Sampled_ means some items were not judged at all. Two things are NOT sampling and must not be reported as such: judging a requirement that names no term from its text and its term hits (that is the whole of check 1 for it), and judging the related pairs the evidence lists without opening the other capability's specification (the listed pairs ARE checks 2 and 3's scope; open the other side only when a statement line is not enough to decide). The merge takes the weakest part: a check sampled or not run anywhere makes the verdict `INCOMPLETE`, never `PASS`.
|
|
84
|
+
|
|
85
|
+
An uncertain conclusion is a WARN finding, not a reason to mark a check sampled. Before writing, resolve every window by reading its named source and complete every requirement in the assigned list. Use `sampled` only when an assigned source is genuinely unavailable after those reads; never use it because code lives elsewhere, a requirement has no bound test, or the evidence makes a conclusion difficult. And never use it for what a test fails to prove: once you have read a bound test and can say what it does not assert, check 5 ran in full for that requirement and what you found is a finding of kind `untested`. A `sampled` note names what you did not read — a file, a window — never what a test did not cover; a note that restates a finding turns a complete part into a spurious `INCOMPLETE`.
|
|
86
|
+
|
|
87
|
+
## The findings file — what a worker writes
|
|
88
|
+
|
|
89
|
+
Each reader writes its own findings file with the **Write tool** — `audit-parts/findings/part-<n>-<reader>.json` — overwrite, and nothing else. The file is what `spec-tools report` reads; findings that exist only in a worker's reply are lost. Its shape is fixed:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"part": 1,
|
|
94
|
+
"reader": 1,
|
|
95
|
+
"capabilities": ["<capability>", "<another>"],
|
|
96
|
+
"findings": [
|
|
97
|
+
{
|
|
98
|
+
"kind": "code-mismatch",
|
|
99
|
+
"tier": "ERROR",
|
|
100
|
+
"where": "<capability>#requirement-<slug> / <package>/src/<file>.ts:6",
|
|
101
|
+
"quotes": [
|
|
102
|
+
{
|
|
103
|
+
"file": "openspec/specs/<capability>/spec.md",
|
|
104
|
+
"line": 101,
|
|
105
|
+
"text": "SHALL mark the in-flight assistant message as errored and render the failure text inside its bubble"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"file": "<package>/src/<file>.ts",
|
|
109
|
+
"line": 6,
|
|
110
|
+
"text": "if (event.type === 'RUN_ERROR') return;"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"detail": "The handler returns on RUN_ERROR, so the in-flight assistant message is never marked errored and no failure text renders in its bubble."
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"coverage": {
|
|
117
|
+
"1": "full",
|
|
118
|
+
"2": "full",
|
|
119
|
+
"3": "full",
|
|
120
|
+
"4": "sampled: <capability>#requirement-<slug> — the excerpt was a window and the source was not opened",
|
|
121
|
+
"5": "full"
|
|
122
|
+
},
|
|
123
|
+
"judged": ["<capability>#requirement-<slug>", "<capability>#requirement-<other-slug>"],
|
|
124
|
+
"notes": [
|
|
125
|
+
"<capability>#requirement-<slug> and <capability>#requirement-<other-slug> overlap in prose on one rule; no shared term paired them"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- `kind` is one of the kinds above, `tier` is `ERROR`, `WARN` or `INFO`, `where` names the requirement id(s) and the `file:line`, `detail` says what diverges and which rule it breaks in one or two sentences — the developer's report shows its first sentence alone.
|
|
131
|
+
- Keep the JSON plain: double quotes, no trailing commas, no comments; a `detail` or `note` is one string with no line breaks. A file that does not parse is a part that ran nothing.
|
|
132
|
+
- Write the file once and stop. Do not validate it with a shell — no `python3 -c`, `node -e`, `wc`: Bash is denied to workers, every attempt is a wasted turn, and the merge reads the file back.
|
|
133
|
+
- `quotes` carry the proof. An ERROR needs at least two — both sides, each from a specification or a source file, never from `audit-parts/` — each a **verbatim fragment of one line** (or of consecutive lines) copied from the evidence excerpt without its line-number prefix, at most ~200 characters. `spec-tools report` looks each up at its `file:line`; a quote that is not there turns the finding into WARN, so copy, never paraphrase. WARN and INFO findings carry no `quotes`: their `where` and `detail` are what the report shows.
|
|
134
|
+
- `coverage` has one string per check — `"1"` to `"5"`: `"full"`, or `"sampled: <what was skipped>"` / `"not-run: <why>"`. Strings, not objects — every bracket is a chance to break the file. The note after `sampled:` names the source you could not read; a judgment about a test — it covers the happy path only, it asserts less than the rule — is a finding of kind `untested`, and a check whose only shortfall is such a judgment is `"full"`.
|
|
135
|
+
- `judged` is the judged list: every requirement id in your evidence files, added as you finish judging it for checks 1–5, whether or not it yielded a finding. The merge compares this list with the part's requirements: an id missing from it was not judged, the check is sampled for the whole audit and the verdict is `INCOMPLETE`, whatever `coverage` says. So walk the requirements one by one and write each id down when it is done; a `"full"` with a short list is a contradiction the merge resolves against you. Before you write the file, set the list against your part's `requirementIds` in `audit-scope.json`: an id you judged but forgot goes in now; an id you did not judge stays out and is reported as such — never added to look complete.
|
|
136
|
+
- `notes` are prose-only overlaps the term lists could not pair — suspicions for the reader, published as such.
|
|
137
|
+
|
|
138
|
+
## Interactive use — `/spec-verify`
|
|
139
|
+
|
|
140
|
+
An operator's `/spec-verify` runs the audit CI runs: `spec-tools audit` (`--here` to judge the working tree's uncommitted edits instead of `HEAD`), then summarizes `spec-verify.md` in the conversation, **one line per finding, most severe first**:
|
|
141
|
+
|
|
142
|
+
`⟨ERROR|WARN|INFO⟩ <capability>#requirement-<slug> <file>:<line> — <kind> — <one-sentence verdict, actionable>`
|
|
143
|
+
|
|
144
|
+
No quotes, no paragraphs: the proof lives in the findings files and the report. End with the counts per tier. Nothing found → say so and stop. With no operator — the AskUserQuestion tool is not among your tools, as under `claude --print` — the summary is the end of your job.
|
|
145
|
+
|
|
146
|
+
Otherwise **ask once**, with the AskUserQuestion tool — _rerun_ / _fix the errors_ / _fix errors and warnings_ / _go one by one_ / _stop_ — and **do nothing until answered**.
|
|
147
|
+
|
|
148
|
+
- **Rerun** — run `spec-tools audit` again and summarize again. Two runs over one tree differ only in what the workers noticed, so a rerun is for a run you distrust, not a way to make a finding disappear.
|
|
149
|
+
- **Fix the errors / fix errors and warnings** — you, never a worker, apply the whole batch at once. Per finding, propose the side — code or specification — with a one-line reason, show the list, and edit nothing until the operator has confirmed or changed each side. A specification fix is a direct edit of the standing specification unless the user asked for the delta flow. Before touching a requirement, read the requirements it names and that name it — they are in its evidence file — so the fix does not contradict a sibling; after the batch, run `spec-tools changed` and judge `audit-parts/changed.md` as _Focused mode_ describes, then the checks the repository's `AGENTS.md` lists. Report the diff of everything changed and stop; the operator decides whether to run the audit again.
|
|
150
|
+
- **Go one by one** — per finding, in the summary's order: _fix in code_ / _fix in spec_ / _skip_ / _instructions_. Show the exact edit before making it; apply the confirmed ones as one batch and finish as above.
|
|
151
|
+
- **Stop** — leave the findings files and say so.
|
|
152
|
+
|
|
153
|
+
`spec-verify.md` is rendered by `spec-tools report`, whose first line is the verdict CI reads (`PASS|FAIL|INCOMPLETE (<n> errors, <m> warnings)`); you never write it.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,CAmC5C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAG1F;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,CAa5F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/configs/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,CA8E/C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,CAmClD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,CAerD"}
|
package/dist/configs/nx.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nx.d.ts","sourceRoot":"","sources":["../../src/configs/nx.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,eAAO,MAAM,QAAQ,2CAA6D,CAAC;AAEnF;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAuBzG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/configs/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,CAEhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/configs/promise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,CAa/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,eAAO,MAAM,UAAU,kDAAsE,CAAC;AAe9F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWzD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,EAAE,OAAuC,EAAE,GAAE,WAAgB,GAAG,OAAO,CACxG,MAAM,CAAC,MAAM,EAAE,CAClB,CAOA;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,CAOjD;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA6BzG;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,CAmD3D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,CAarD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,CAQrD;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAO1G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../src/configs/storybook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAYhH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../src/configs/tailwind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmBnD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAGlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAsDjH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/configs/testing.ts"],"names":[],"mappings":"AAYA,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AAC3C,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAG5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AA6DpC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,EAAE,MAAM,UAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAgB5F;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,EAAE,MAAM,UAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAgC9F;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,CAmB5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"turbo.d.ts","sourceRoot":"","sources":["../../src/configs/turbo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,WAAW,6CAAkE,CAAC;AAE3F;;;GAGG;AACH,wBAAsB,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAoB5F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescriptTypeAware.d.ts","sourceRoot":"","sources":["../../src/configs/typescriptTypeAware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,gBAAgB,EAAE,MAAM,UAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAqFpG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/configs/unicorn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,CAiC/C"}
|
package/dist/exts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exts.d.ts","sourceRoot":"","sources":["../src/exts.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,kCAAkC,CAAC;AACzD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,aAAa,sDAAkC,CAAC;AAC7D,eAAO,MAAM,eAAe,sEAAsE,CAAC;AAEnG,eAAO,MAAM,MAAM,oCAAmB,CAAC;AACvC,eAAO,MAAM,UAAU,0DAAyB,CAAC;AACjD,eAAO,MAAM,YAAY,0EAA2B,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,IAAI,sBAAsB,EAA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,OAAO,KAAK,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAI5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,EAAE,uBAGxB,CAAC"}
|
package/dist/prettier.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAIzD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,cAatB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restrictions.d.ts","sourceRoot":"","sources":["../src/restrictions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG;IAC1E,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAgBpE"}
|
package/dist/yarn.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yarn.d.cts","sourceRoot":"","sources":["../src/yarn.cts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AA8F3C;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAAC,MAAM,CA+B9C"}
|
|
@@ -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
|
-
}
|