@miroshnik/elves 2026.1105.2 → 2026.1106.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/AGENTS.md +2 -1
- package/dist/github/scripts/github.js +9 -9
- package/dist/spec/scripts/architecture.js +1 -1
- package/dist/spec/scripts/harness.js +1 -1
- package/docs/testing.md +9 -0
- package/package.json +2 -2
- package/skills/github/reference.md +6 -5
- package/skills/github/scripts/github.ts +16 -11
- package/skills/spec/reference.md +16 -11
- package/skills/spec/scripts/spec-diff.ts +16 -23
- package/skills/spec/scripts/speclib.ts +20 -2
- /package/dist/spec/scripts/{harness-dms3b7ke.js → harness-yh1g3dhm.js} +0 -0
package/AGENTS.md
CHANGED
|
@@ -236,7 +236,8 @@ The full canon and wiring — the `spec` skill (`canon.md`, `checks.md`).
|
|
|
236
236
|
unrelated to my changes or a rerun is green — no "pre-existing flake",
|
|
237
237
|
timeouts or retries; a race goes by its cause (the real event, not a
|
|
238
238
|
pause). A flake suspicion — the same run on the base branch: red there too
|
|
239
|
-
— I compare the delta
|
|
239
|
+
— I compare the delta; a timeout — first `slot`'s overload line, it's there
|
|
240
|
+
— a rerun on an idle machine (`docs/testing.md`).
|
|
240
241
|
- **A run's result — by the runner's summary**, not the wrapper's exit code.
|
|
241
242
|
Project checks go through the machine queue (the `slot` skill), a full run
|
|
242
243
|
— in the background; e2e and UI in a browser — `docs/testing.md`.
|
|
@@ -2097,13 +2097,14 @@ function parseEdits(args) {
|
|
|
2097
2097
|
var CHECKLIST_RE = /^(\s*[-*+]\s+)\[ \](\s)/;
|
|
2098
2098
|
var LIST_ITEM_RE = /^(?:[-*+]|\d+\.)\s/;
|
|
2099
2099
|
var headingLevel = (line) => /^(#{1,6})\s/.exec(line)?.[1]?.length ?? 0;
|
|
2100
|
-
|
|
2100
|
+
var QUESTIONS_SECTION_RE = new RegExp(`^(?:${locale_default.every((n) => n.sections.questions).map(locale_default.escapeRe).join("|")})\\s*$`);
|
|
2101
|
+
function itemMarker(prev, none) {
|
|
2101
2102
|
const numbered = /^(\d+)\.\s/.exec(prev ?? "");
|
|
2102
2103
|
if (numbered)
|
|
2103
2104
|
return `${Number(numbered[1]) + 1}. `;
|
|
2104
2105
|
const bullet = /^([-*+]\s+)(\[[ xX]\]\s)?/.exec(prev ?? "");
|
|
2105
2106
|
if (!bullet)
|
|
2106
|
-
return
|
|
2107
|
+
return none;
|
|
2107
2108
|
return bullet[2] ? `${bullet[1]}[ ] ` : bullet[1];
|
|
2108
2109
|
}
|
|
2109
2110
|
function applyEdits(number, body, edits) {
|
|
@@ -2142,7 +2143,7 @@ function applyEdits(number, body, edits) {
|
|
|
2142
2143
|
last--;
|
|
2143
2144
|
const item = e.item.trim().replace(/\s*\r?\n\s*/g, " ");
|
|
2144
2145
|
const prev = lines.slice(from + 1, last + 1).filter((l) => LIST_ITEM_RE.test(l)).at(-1);
|
|
2145
|
-
const line = `${LIST_ITEM_RE.test(item) ? "" : itemMarker(prev)}${item}`;
|
|
2146
|
+
const line = `${LIST_ITEM_RE.test(item) ? "" : itemMarker(prev, QUESTIONS_SECTION_RE.test(heading) ? "1. " : "- ")}${item}`;
|
|
2146
2147
|
lines.splice(last + 1, 0, ...last === from ? ["", line] : [line]);
|
|
2147
2148
|
done.push(`added to ${q(heading)}`);
|
|
2148
2149
|
} else {
|
|
@@ -3138,9 +3139,8 @@ var MEANING_CHECKS = [0, 2, 4];
|
|
|
3138
3139
|
var ANSWER_MARK_RE = /(?:^\s*(?:\d+\.\s+)?|[?.!—–][»"'*_)`]*\s+)[*_(]*✅/;
|
|
3139
3140
|
var THEMATIC_BREAK_RE = /^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/;
|
|
3140
3141
|
function questionItems(body) {
|
|
3141
|
-
const section = new RegExp(`^(?:${locale_default.every((n) => n.sections.questions).map(locale_default.escapeRe).join("|")})\\s*$`);
|
|
3142
3142
|
const lines = body.split(/\r?\n/);
|
|
3143
|
-
const from = lines.findIndex((l) =>
|
|
3143
|
+
const from = lines.findIndex((l) => QUESTIONS_SECTION_RE.test(l));
|
|
3144
3144
|
if (from < 0)
|
|
3145
3145
|
return [];
|
|
3146
3146
|
const items = [];
|
|
@@ -4729,10 +4729,10 @@ Examples:
|
|
|
4729
4729
|
|
|
4730
4730
|
An edit of the description in one call, not gh issue view --json body, a file and gh issue edit --body-file: --replace —
|
|
4731
4731
|
the text must occur exactly once; --add — an item at the end of the section «## …» (without a list marker — the one of
|
|
4732
|
-
the section's last item: «- [ ]», the next number, its bullet
|
|
4733
|
-
with the text. Several edits — in order, each sees the previous one's result,
|
|
4734
|
-
ambiguous — refused (code 2), the description untouched. Questions are answered by
|
|
4735
|
-
the repository's REST.
|
|
4732
|
+
the section's last item: «- [ ]», the next number, its bullet; the questions section's first — «1.»); --check —
|
|
4733
|
+
«- [ ]» → «- [x]» of the one unchecked item with the text. Several edits — in order, each sees the previous one's result,
|
|
4734
|
+
written together; any not found or ambiguous — refused (code 2), the description untouched. Questions are answered by
|
|
4735
|
+
task answer. A cloud session — over the repository's REST.
|
|
4736
4736
|
|
|
4737
4737
|
Examples:
|
|
4738
4738
|
github task edit 42 --replace "PDF only" "PDF and CSV"
|
package/docs/testing.md
CHANGED
|
@@ -15,6 +15,15 @@ against the Playwright, Next.js, Vite, SvelteKit and Nuxt documentation.
|
|
|
15
15
|
|
|
16
16
|
- **A flake suspicion — the same run on the base branch.** Red there too — I
|
|
17
17
|
compare the delta: otherwise someone else's flake becomes my regression.
|
|
18
|
+
- **A timeout suspected of load — first `slot`'s overload line.** A run that
|
|
19
|
+
went past the load wait prints `slot: the machine is overloaded — …` at its
|
|
20
|
+
start and the machine's load at its end: a test that usually takes tens of
|
|
21
|
+
milliseconds stands 15–19 s there because the worker or the database server
|
|
22
|
+
stands, and in isolation it doesn't reproduce. The line is there — no fix in
|
|
23
|
+
the test or the code: the same run again on an idle machine (no `slot:
|
|
24
|
+
waiting for the machine load` line); red there too — the timeout is the
|
|
25
|
+
test's, its root cause goes as any failure's. No line — the run started
|
|
26
|
+
below the limit: the cause is looked for in the test or the code first.
|
|
18
27
|
- **A green test may lock in wrong behavior.** An external API's test is
|
|
19
28
|
checked against its schema or docs, not intuition about how such APIs
|
|
20
29
|
usually work; on a mismatch the test is fixed, not the code to fit the test.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miroshnik/elves",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1106.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Elves — a development flow with AI agents: shared rules and skills for any agent; install — bunx @miroshnik/elves install -g; the installer and skill scripts — TypeScript under Bun, tests — bun test in tests/",
|
|
6
6
|
"repository": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"eslint-plugin-boundaries": "^7.2.0",
|
|
73
73
|
"knip": "^6.41.0"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "e0d37d48c57dfc427770e4bd81d0a0b9caf19ccd"
|
|
76
76
|
}
|
|
@@ -627,11 +627,12 @@ text must occur exactly once; `--add "## <section>" "<item>"` — at the end of
|
|
|
627
627
|
the section (it ends at a heading of its level or higher, or `---`: the cloud
|
|
628
628
|
proxy's signature isn't in it); an item without a list marker gets the one of
|
|
629
629
|
the section's last top-level item — `- [ ]` after a checklist, the next
|
|
630
|
-
number after a numbered list, its bullet, otherwise `-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
number after a numbered list, its bullet, otherwise `- `, in the questions
|
|
631
|
+
section `1.` (`task answer` finds a question by its number); `--check
|
|
632
|
+
"<text>"` — `- [ ]` → `- [x]` of the one unchecked item containing the text.
|
|
633
|
+
Several edits — in order, each sees the previous one's result, one write.
|
|
634
|
+
Refused before any change (code 2), none of the call's edits written: a text
|
|
635
|
+
not found or found twice, no such section or two of them, no or two unchecked
|
|
635
636
|
items, an edit missing a value. Questions — `task answer`. A cloud session —
|
|
636
637
|
over the repository's REST.
|
|
637
638
|
|
|
@@ -2881,13 +2881,18 @@ const CHECKLIST_RE = /^(\s*[-*+]\s+)\[ \](\s)/;
|
|
|
2881
2881
|
const LIST_ITEM_RE = /^(?:[-*+]|\d+\.)\s/;
|
|
2882
2882
|
/** A Markdown heading's level (`## …` — 2), not a heading — 0. */
|
|
2883
2883
|
const headingLevel = (line: string) => /^(#{1,6})\s/.exec(line)?.[1]?.length ?? 0;
|
|
2884
|
+
/** The questions section's heading in any language of the dictionary: `questionItems` reads it, `task edit --add` numbers its first item. */
|
|
2885
|
+
const QUESTIONS_SECTION_RE = new RegExp(`^(?:${locale.every((n) => n.sections.questions).map(locale.escapeRe).join("|")})\\s*$`);
|
|
2884
2886
|
|
|
2885
|
-
/**
|
|
2886
|
-
|
|
2887
|
+
/**
|
|
2888
|
+
* The marker of an item added after `prev`, the section's last item: `- [ ]` after a checklist item, the next number,
|
|
2889
|
+
* its bullet; none — `none`.
|
|
2890
|
+
*/
|
|
2891
|
+
function itemMarker(prev: string | undefined, none: string): string {
|
|
2887
2892
|
const numbered = /^(\d+)\.\s/.exec(prev ?? "");
|
|
2888
2893
|
if (numbered) return `${Number(numbered[1]) + 1}. `;
|
|
2889
2894
|
const bullet = /^([-*+]\s+)(\[[ xX]\]\s)?/.exec(prev ?? "");
|
|
2890
|
-
if (!bullet) return
|
|
2895
|
+
if (!bullet) return none;
|
|
2891
2896
|
return bullet[2] ? `${bullet[1]}[ ] ` : bullet[1]!;
|
|
2892
2897
|
}
|
|
2893
2898
|
|
|
@@ -2895,7 +2900,8 @@ function itemMarker(prev: string | undefined): string {
|
|
|
2895
2900
|
* The edits applied in order to the description, each to the result of the previous one; an edit that is ambiguous or
|
|
2896
2901
|
* finds nothing — an error, so none is written. `--add` — after the section's last non-blank line (the section ends at
|
|
2897
2902
|
* a heading of its level or higher, or a thematic break: the cloud proxy's signature isn't the section's); an item
|
|
2898
|
-
* without a list marker gets the one of the section's last item: `- [ ]`, the next number, or
|
|
2903
|
+
* without a list marker gets the one of the section's last item: `- [ ]`, the next number, or `-`; the first one of the
|
|
2904
|
+
* questions section — `1.`: `task answer <N> <k>` finds a question by its number (#795).
|
|
2899
2905
|
*/
|
|
2900
2906
|
export function applyEdits(number: number, body: string, edits: Edit[]): { body: string; done: string[] } {
|
|
2901
2907
|
const eol = body.includes("\r\n") ? "\r\n" : "\n";
|
|
@@ -2925,7 +2931,7 @@ export function applyEdits(number: number, body: string, edits: Edit[]): { body:
|
|
|
2925
2931
|
const item = e.item.trim().replace(/\s*\r?\n\s*/g, " ");
|
|
2926
2932
|
// the section's last top-level item: a nested one under it isn't the list's
|
|
2927
2933
|
const prev = lines.slice(from + 1, last + 1).filter((l) => LIST_ITEM_RE.test(l)).at(-1);
|
|
2928
|
-
const line = `${LIST_ITEM_RE.test(item) ? "" : itemMarker(prev)}${item}`;
|
|
2934
|
+
const line = `${LIST_ITEM_RE.test(item) ? "" : itemMarker(prev, QUESTIONS_SECTION_RE.test(heading) ? "1. " : "- ")}${item}`;
|
|
2929
2935
|
// a heading right before the item — a blank line between them, as the section's own items have
|
|
2930
2936
|
lines.splice(last + 1, 0, ...(last === from ? ["", line] : [line]));
|
|
2931
2937
|
done.push(`added to ${q(heading)}`);
|
|
@@ -4341,9 +4347,8 @@ const THEMATIC_BREAK_RE = /^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/;
|
|
|
4341
4347
|
* into the item.
|
|
4342
4348
|
*/
|
|
4343
4349
|
export function questionItems(body: string): { k: number; text: string; lines: string[]; answered: boolean; first: number; last: number }[] {
|
|
4344
|
-
const section = new RegExp(`^(?:${locale.every((n) => n.sections.questions).map(locale.escapeRe).join("|")})\\s*$`);
|
|
4345
4350
|
const lines = body.split(/\r?\n/);
|
|
4346
|
-
const from = lines.findIndex((l) =>
|
|
4351
|
+
const from = lines.findIndex((l) => QUESTIONS_SECTION_RE.test(l));
|
|
4347
4352
|
if (from < 0) return [];
|
|
4348
4353
|
const items: { first: number; last: number }[] = [];
|
|
4349
4354
|
for (let i = from + 1; i < lines.length && !/^##\s/.test(lines[i]!) && !THEMATIC_BREAK_RE.test(lines[i]!); i++) {
|
|
@@ -6431,10 +6436,10 @@ Examples:
|
|
|
6431
6436
|
|
|
6432
6437
|
An edit of the description in one call, not gh issue view --json body, a file and gh issue edit --body-file: --replace —
|
|
6433
6438
|
the text must occur exactly once; --add — an item at the end of the section «## …» (without a list marker — the one of
|
|
6434
|
-
the section's last item: «- [ ]», the next number, its bullet
|
|
6435
|
-
with the text. Several edits — in order, each sees the previous one's result,
|
|
6436
|
-
ambiguous — refused (code 2), the description untouched. Questions are answered by
|
|
6437
|
-
the repository's REST.
|
|
6439
|
+
the section's last item: «- [ ]», the next number, its bullet; the questions section's first — «1.»); --check —
|
|
6440
|
+
«- [ ]» → «- [x]» of the one unchecked item with the text. Several edits — in order, each sees the previous one's result,
|
|
6441
|
+
written together; any not found or ambiguous — refused (code 2), the description untouched. Questions are answered by
|
|
6442
|
+
task answer. A cloud session — over the repository's REST.
|
|
6438
6443
|
|
|
6439
6444
|
Examples:
|
|
6440
6445
|
github task edit 42 --replace "PDF only" "PDF and CSV"
|
package/skills/spec/reference.md
CHANGED
|
@@ -228,10 +228,12 @@ names the folders and asks for a full run's report, `--json` lists the tests
|
|
|
228
228
|
in `unreported`. A file without such a call or test in the head — its tests
|
|
229
229
|
are removed.
|
|
230
230
|
|
|
231
|
-
A test's identity is
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
A test's identity is its place (the folder, in a topic's section —
|
|
232
|
+
`<folder>#<section>`), the `describe` chain and `it`: a move between files of
|
|
233
|
+
one section (`<section>.<part>.test.ts`, `<package>/<section>.test.ts`) isn't a
|
|
234
|
+
change; same-named tests of two sections are two requirements, a move to
|
|
235
|
+
another section or folder is removed and added (the requirement changed home).
|
|
236
|
+
The output is a ready section for the PR body:
|
|
235
237
|
|
|
236
238
|
```markdown
|
|
237
239
|
## Spec (tests)
|
|
@@ -838,16 +840,19 @@ the project's CI" below.
|
|
|
838
840
|
|
|
839
841
|
## Identity and renames
|
|
840
842
|
|
|
841
|
-
- A test key is
|
|
842
|
-
|
|
843
|
-
|
|
843
|
+
- A test key is its place, the `describe` chain and the name; the place is
|
|
844
|
+
the folder, in a topic's section — `<folder>#<section>`. A topic's section
|
|
845
|
+
is a decision of its own (#685), so it's part of the key (#794): same-named
|
|
846
|
+
tests of two sections are two requirements. The file isn't: moving tests
|
|
847
|
+
between files of one section doesn't change requirements.
|
|
844
848
|
- A rename is searched for in two steps: (1) the same file and `describe`, a
|
|
845
849
|
similar name, similarity ≥ 0.6 by Ratcliff/Obershelp (like
|
|
846
850
|
`difflib.SequenceMatcher.ratio`), greedily by descending similarity; (2) the
|
|
847
|
-
same
|
|
848
|
-
renamed or the test was moved
|
|
849
|
-
file. The threshold is deliberately high: hiding a removed
|
|
850
|
-
rename is worse than showing a rename as a deletion and an
|
|
851
|
+
same place and the same name, a different `describe` — the `describe` was
|
|
852
|
+
renamed or the test was moved under another one, including from another
|
|
853
|
+
file of the section. The threshold is deliberately high: hiding a removed
|
|
854
|
+
requirement as a rename is worse than showing a rename as a deletion and an
|
|
855
|
+
addition. Step 2
|
|
851
856
|
isn't limited to one file since #63: the requirement text is the same, and
|
|
852
857
|
regrouping into the main file's capability sections (unit and e2e of one
|
|
853
858
|
capability under one `describe`, files renamed to `<name>.test.ts`) would
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
/**
|
|
3
|
-
* spec-diff — the spec diff: test names (
|
|
4
|
-
* parsing of the files at the two revisions (git cat-file, no runs and no checkouts). Prints
|
|
5
|
-
* PR body: removed (first), changed (renamed in the same file), added, moved into the tree
|
|
6
|
-
* outside tests/ and appeared in the tree under the same name — a summary by folders);
|
|
7
|
-
* the tests/ tree and the number of the PR's new names that aren't statements in the
|
|
3
|
+
* spec-diff — the spec diff: test names (the place — a topic and its section — + describe + it) between the base
|
|
4
|
+
* branch and HEAD, by static parsing of the files at the two revisions (git cat-file, no runs and no checkouts). Prints
|
|
5
|
+
* a markdown section for the PR body: removed (first), changed (renamed in the same file), added, moved into the tree
|
|
6
|
+
* (a test vanished from a file outside tests/ and appeared in the tree under the same name — a summary by folders);
|
|
7
|
+
* plus test files changed outside the tests/ tree and the number of the PR's new names that aren't statements in the
|
|
8
|
+
* project language.
|
|
8
9
|
*
|
|
9
10
|
* bun spec-diff.ts [--base origin/main] [--head HEAD | --worktree] [--root DIR] [--no-merge-base] [--json]
|
|
10
11
|
* [--scenarios issue.md | -]
|
|
@@ -337,13 +338,14 @@ export function diff(
|
|
|
337
338
|
const changed = pair(removed, added, (r, a) => unique(r) && bodyKey(r) === bodyKey(a), () => 1, 1);
|
|
338
339
|
// 2) the same file and describe, a similar name — the test is renamed
|
|
339
340
|
changed.push(...pair(removed, added, (r, a) => r.path === a.path && sameDescribes(r, a), (r, a) => ratio(r.name, a.name), RENAME_RATIO));
|
|
340
|
-
// 3) the same
|
|
341
|
-
// including from another file of the
|
|
341
|
+
// 3) the same place and name, a different describe — the describe is renamed or the test moved under another
|
|
342
|
+
// describe, including from another file of the topic's section: the requirement text is the same, the describe
|
|
343
|
+
// changed. Another section of the topic is another decision (#794): the move is removed and added
|
|
342
344
|
changed.push(
|
|
343
345
|
...pair(
|
|
344
346
|
removed,
|
|
345
347
|
added,
|
|
346
|
-
(r, a) =>
|
|
348
|
+
(r, a) => placeOf(r) === placeOf(a) && r.name === a.name,
|
|
347
349
|
(r, a) => ratio(r.describes.join(" › "), a.describes.join(" › ")),
|
|
348
350
|
0,
|
|
349
351
|
),
|
|
@@ -365,19 +367,10 @@ export function unmovedFiles(outFiles: string[], moved: Moved[], count: Map<stri
|
|
|
365
367
|
const outMark = (t: Test) => (L.classify(t.path)[0] === "out" ? ` ⚠️ ${N.spec.diff.outsideMark}` : "");
|
|
366
368
|
|
|
367
369
|
/**
|
|
368
|
-
* A test's place in the lists — its folder and, in a topic's section (#685), the section after
|
|
369
|
-
*
|
|
370
|
-
* folder. The lists go by place.
|
|
370
|
+
* A test's place in the lists (`L.placeOf`) — its folder and, in a topic's section (#685), the section after `#`:
|
|
371
|
+
* `tests/standards/routes#permissions`. The lists go by place, and a harness check's place is by its file the same way.
|
|
371
372
|
*/
|
|
372
|
-
export const placeOf = (t: Test): string =>
|
|
373
|
-
|
|
374
|
-
/** A harness check's place by its file — as in the test lists: a topic's section `<folder>#<section>` or the folder. */
|
|
375
|
-
function placeAt(file: string): string {
|
|
376
|
-
const folder = L.decisionFolder(file);
|
|
377
|
-
if (folder === null) return path.posix.dirname(file);
|
|
378
|
-
const section = L.sectionOf(file);
|
|
379
|
-
return section === null ? folder : `${folder}#${section}`;
|
|
380
|
-
}
|
|
373
|
+
export const placeOf = (t: Test): string => L.placeOf(t.path);
|
|
381
374
|
|
|
382
375
|
/** The lists by place — topic and section; within a place — the order of the difference. */
|
|
383
376
|
const byPlace = <T>(list: T[], test: (x: T) => Test): T[] =>
|
|
@@ -1112,7 +1105,7 @@ export async function main(argv: string[]): Promise<number> {
|
|
|
1112
1105
|
const changedOut = outOfTreeFiles(base, v.head, top, prefix, v.worktree);
|
|
1113
1106
|
const { pool, count, gone } = outOfTreePool(base, v.head, top, root, prefix, changedOut, v.worktree);
|
|
1114
1107
|
({ removed, changed, added, moved } = diff(baseTests, headTests, pool));
|
|
1115
|
-
checks = freshChecks(baseScan.checks, headScan.checks, [
|
|
1108
|
+
checks = freshChecks(baseScan.checks, headScan.checks, [L.placeOf, L.placeOf]);
|
|
1116
1109
|
notStatements = newNotStatements([...added, ...changed.map(([, n]) => n)], baseTests, LANG);
|
|
1117
1110
|
outFiles = unmovedFiles(changedOut, moved, count, gone);
|
|
1118
1111
|
// lint disables — only in changed code files: a removed or added exception is always in the PR diff
|
|
@@ -1124,8 +1117,8 @@ export async function main(argv: string[]): Promise<number> {
|
|
|
1124
1117
|
const untracked = v.worktree ? gitText(["ls-files", "--others", "--exclude-standard", "-z", "--", "."], top).split("\0") : [];
|
|
1125
1118
|
const changedAll = [...changedPaths, ...untracked].filter((f) => f.startsWith(prefix) && CODE.test(f) && !FLOW_COPY.test(f.slice(prefix.length)));
|
|
1126
1119
|
decisionData = {
|
|
1127
|
-
base: await decisionsAt(base, top, prefix, changedAll, baseScan.checks,
|
|
1128
|
-
head: await decisionsAt(v.worktree ? null : v.head, top, prefix, changedAll, headScan.checks,
|
|
1120
|
+
base: await decisionsAt(base, top, prefix, changedAll, baseScan.checks, L.placeOf),
|
|
1121
|
+
head: await decisionsAt(v.worktree ? null : v.head, top, prefix, changedAll, headScan.checks, L.placeOf),
|
|
1129
1122
|
};
|
|
1130
1123
|
decisions = decisionLines(decisionData.base, decisionData.head, limit);
|
|
1131
1124
|
} catch (e) {
|
|
@@ -56,9 +56,14 @@ export function folderOf(t: Test): string {
|
|
|
56
56
|
return posix.dirname(t.path);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Requirement identity: the test's place (`placeOf` — the topic and its section) + describe + it. A topic's section is
|
|
61
|
+
* a decision of its own (#685): same-named tests of two sections are two requirements, a move between sections is
|
|
62
|
+
* removed and added; the file inside a section (`<section>.<part>.test.ts`, `<package>/<section>.test.ts`) doesn't
|
|
63
|
+
* matter (#794).
|
|
64
|
+
*/
|
|
60
65
|
export function keyOf(t: Test): string {
|
|
61
|
-
return JSON.stringify([
|
|
66
|
+
return JSON.stringify([placeOf(t.path), t.describes, t.name]);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
export function titleOf(t: Test): string {
|
|
@@ -123,6 +128,19 @@ export function sectionOf(file: string): string | null {
|
|
|
123
128
|
return section === folder.split("/")[2] ? null : section;
|
|
124
129
|
}
|
|
125
130
|
|
|
131
|
+
/**
|
|
132
|
+
* A test file's place in the spec — its decision folder and, in a topic's section (#685), the section after `#`, as
|
|
133
|
+
* the spec-doc anchor: `tests/standards/routes#permissions`; the topic's own statements (a file named after the
|
|
134
|
+
* folder) — the folder; outside the decision tree — the file's folder. spec-diff's lists and the requirement identity
|
|
135
|
+
* (`keyOf`) go by place.
|
|
136
|
+
*/
|
|
137
|
+
export function placeOf(file: string): string {
|
|
138
|
+
const folder = decisionFolder(file);
|
|
139
|
+
if (folder === null) return posix.dirname(file);
|
|
140
|
+
const section = sectionOf(file);
|
|
141
|
+
return section === null ? folder : `${folder}#${section}`;
|
|
142
|
+
}
|
|
143
|
+
|
|
126
144
|
/** Decision folder exceptions — the `exceptions/` directory, a file per harness registry element (`exceptionsIn`). */
|
|
127
145
|
export const EXCEPTIONS_DIR = "exceptions";
|
|
128
146
|
|
|
File without changes
|