@dialecte/core 0.9.0 → 0.10.0
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/dist/{dialecte-oAXwOG-Q.js → dialecte-CVLWSkgW.js} +1631 -1557
- package/dist/document/query/get/record/get-record.d.ts +14 -1
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records.d.ts +12 -2
- package/dist/document/query/get/record/get-records.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/sqlite-engine.js +14 -10
- package/dist/store/sqlite/runtime/close-engine.d.ts +5 -2
- package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -1
- package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -1
- package/dist/store/sqlite/runtime/runtime.types.d.ts +3 -2
- package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.d.ts +4 -2
- package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
- package/dist/test/assert-xml/index.d.ts +1 -0
- package/dist/test/assert-xml/index.d.ts.map +1 -1
- package/dist/test/assert-xml/xml-assertion-error.d.ts +8 -0
- package/dist/test/assert-xml/xml-assertion-error.d.ts.map +1 -0
- package/dist/test/indexeddb-storage.setup.d.ts +1 -0
- package/dist/test/indexeddb-storage.setup.d.ts.map +1 -0
- package/dist/test.js +154 -148
- package/package.json +40 -4
- package/skills/dialecte/SKILL.md +8 -6
- package/skills/dialecte/references/api.json +5 -5
- package/skills/dialecte/references/api.md +2 -2
- package/skills/dialecte/references/testing.md +167 -11
- package/skills/dialecte-contributing/SKILL.md +1 -1
- package/skills/dialecte-contributing/references/code-rules.md +7 -0
- package/skills/dialecte-contributing/references/landing-changes.md +4 -4
- package/skills/dialecte-lot/SKILL.md +67 -28
- package/skills/dialecte-lot/references/briefs.md +30 -6
- package/skills/dialecte-lot/references/standard-check.md +2 -2
- package/skills/dialecte-lot/references/stations.md +5 -3
|
@@ -14,6 +14,14 @@ Never edit, move or remove a file under a repository's .git folder (a lock, a co
|
|
|
14
14
|
No multi-agent workflow (a host tool that fans out many agents at once) unless the user opted in; a sub-agent
|
|
15
15
|
of yours has its own spawn. No rm, mv or xargs on a variable path: leave temporary files in the
|
|
16
16
|
hand-over folder or the scratchpad.
|
|
17
|
+
Edit files with the edit tool. A script that rewrites a file reads it fully before it opens the file for
|
|
18
|
+
writing, never both in one expression (opening for writing empties the file before the read).
|
|
19
|
+
Never run an ad-hoc script that writes files with a lot's worktree as its working folder: cd to the scratchpad
|
|
20
|
+
or the hand-over folder first, and name a worktree file by its absolute path.
|
|
21
|
+
No real person's name or handle in any file you write, test values included: use neutral names (`reviewer`,
|
|
22
|
+
`person-a`).
|
|
23
|
+
Before you report, stop every background task you started (a wait loop, a watcher, a server) and check with
|
|
24
|
+
`ps` that none is left.
|
|
17
25
|
```
|
|
18
26
|
|
|
19
27
|
## Test-station brief
|
|
@@ -24,6 +32,10 @@ Tier: standard (model-tiers.md; `npx @dialecte/cli models` says which model). St
|
|
|
24
32
|
|
|
25
33
|
Step: <the 3-6 behaviours of the step, as case keys "<state> → <outcome>">
|
|
26
34
|
Spec: <the plan section(s), by path and heading; the decisions that bind it>
|
|
35
|
+
Invariant (a lot that deletes, moves or resets on its own; else no such line): <never <act> on <thing> unless
|
|
36
|
+
proven <X>, <Y>>; every test checks it, and the adversarial cases are written first.
|
|
37
|
+
Preservation (a step that removes content; else no such line): a check per unit that only the target went, and
|
|
38
|
+
a boundary case where the target touches what must stay.
|
|
27
39
|
Read: this brief and the existing code only - not an implementation, not another agent's notes.
|
|
28
40
|
Worktree: <absolute path>, branch <branch>, base <sha>. Work only there. Never commit, stage, push,
|
|
29
41
|
`git stash` or any git command that writes the index.
|
|
@@ -31,9 +43,15 @@ You may change: the test files of the step, and stubs - new exports with their r
|
|
|
31
43
|
`new Error('not implemented: <name>')`. Never a behaviour of the production code.
|
|
32
44
|
Each test calls the code under test inside an `expect(...)` a matcher completes, so a stub's error is a
|
|
33
45
|
red on the behaviour. Remove every `.only` and `only: true` before `tdd red` (it refuses a file holding one).
|
|
46
|
+
Each case spells its full title: `tdd` keys a case by its title, and vitest cuts each `$` field of an
|
|
47
|
+
`it.each(...)` title (`'$name'`) at 40 characters, so long names collide - never a `$` field for them.
|
|
34
48
|
A test that reads the disk, spawns a process or measures time carries an explicit bound with wide slack,
|
|
35
49
|
a named constant (core: `SOURCE_SCAN_TIMEOUT_MS` in `src/test/test-timing.constants.ts`), never the
|
|
36
50
|
runner's default timeout.
|
|
51
|
+
Rename mapping (a lot that renames an output across many cases; else no such line): <the rule, `<call>` →
|
|
52
|
+
`<expected text>`>. Before `tdd red`, one audit pass of every touched file against it.
|
|
53
|
+
Per step: the other tests related to the files you touched, `check`, and `dialecte rules` on them (a dialecte
|
|
54
|
+
package). After any edit of a test - a test-review return included - you take `tdd red` again.
|
|
37
55
|
Done when `npx dialecte tdd red` records a red for every case of the step; a refused case (passes, missing
|
|
38
56
|
export, type or syntax error, timeout, stub at import or before the assertion) is fixed in the test.
|
|
39
57
|
Report: the `tdd red` output, unfiltered, and the list of stubs.
|
|
@@ -86,7 +104,9 @@ Skills: load dialecte and dialecte-lot (and dialecte-contributing in a dialecte
|
|
|
86
104
|
before the change; runs with and before the change on the standard and strong tiers, several per
|
|
87
105
|
configuration; graded blind by
|
|
88
106
|
a separate agent, never by you; its benchmark and viewer paths in your report.
|
|
89
|
-
Gates:
|
|
107
|
+
Gates: per step, the tests related to the touched files, `check` and `dialecte rules` on them (a dialecte
|
|
108
|
+
package); fast gate per behaviour; full Definition of Done once at the end (<the package's commands>).
|
|
109
|
+
Discovery: <the lot's decisions.md> lists what already covers the concept; reuse it, or add why not there.
|
|
90
110
|
Mutation (a dialecte package that declares a mutation scope; else no such line): <off | changed | gate | audit, set in .dialecte/lot.json>; once green (a gate lot: again after the last
|
|
91
111
|
fix), `dialecte mutants run` in the background, survivors judged (`dialecte mutants judge --json`, then a
|
|
92
112
|
test, `record` or `schedule`), `dialecte mutants status` before the report: no new survivor, no died run, a
|
|
@@ -121,8 +141,8 @@ Later rounds - delta review of the fix diff and its blast radius only. Start fro
|
|
|
121
141
|
`git diff --no-index --no-color --no-ext-diff round-<n-1>/<file> <worktree>/<file>`; not in round-<n-1>/ (at
|
|
122
142
|
the base then), `git -C <worktree> diff --no-color --no-ext-diff HEAD -- <file>`, or /dev/null as the left
|
|
123
143
|
side for a file the base does not have or that round-<n-1>.deleted lists; gone from the worktree, /dev/null as
|
|
124
|
-
the right side (from cli 0.
|
|
125
|
-
Throwaway worktree: <path - from `dialecte
|
|
144
|
+
the right side (from cli 0.4.0, `dialecte lot delta <folder> --round <n>` prints that diff per file).
|
|
145
|
+
Throwaway worktree: <path - from `dialecte lot delta <folder> --round <n> --worktree` (cli 0.4.0; the
|
|
126
146
|
fixer's, when it made one), or made by the orchestrator with `dialecte worktree add <repository> <lot-branch>-round-<n-1> --from
|
|
127
147
|
<base>`, round-<n-1>/ copied over, `git -C <throwaway> rm -q --pathspec-from-file=<folder>/round-<n-1>.deleted
|
|
128
148
|
--pathspec-file-nul` | none>. Verify each fix: copy its new test file in and run it there - it must fail - and in
|
|
@@ -133,7 +153,11 @@ Later rounds - delta review of the fix diff and its blast radius only. Start fro
|
|
|
133
153
|
Rules: the repository's code rules and Definition of Done (dialecte-contributing in a dialecte package), dialecte (reuse ladder).
|
|
134
154
|
Run (read-only): the tests of the lot, `skills check`, the type-check - report the real counts.
|
|
135
155
|
Check: every time bound of a test reading the disk, spawning a process or measuring time holds under load;
|
|
136
|
-
a hand-written commit or merge script in the hand-over is a finding (it goes through `dialecte handover`)
|
|
156
|
+
a hand-written commit or merge script in the hand-over is a finding (it goes through `dialecte handover`);
|
|
157
|
+
the diff against the discovery list in <the lot's decisions.md> (a hand-rolled helper it missed is a
|
|
158
|
+
finding); `git -C <worktree> grep -i -w -f <names file>` over the changed files for real people's names and
|
|
159
|
+
handles, test values included (<names file: one name or handle per line, kept outside every repository, the
|
|
160
|
+
brief carries only its path>).
|
|
137
161
|
Answer: would you approve? Use the review report shape, with a severity per finding and the proposed findings-ledger rows.
|
|
138
162
|
Max ~80 lines, most severe first, file:line for each finding.
|
|
139
163
|
```
|
|
@@ -150,8 +174,8 @@ Blast radius, one line under each fix: what it widens, excludes or replaces (a p
|
|
|
150
174
|
now matching more or less; the earlier code or fix it replaces), and the findings-ledger rows it touches - its
|
|
151
175
|
own and any other whose code it changes ("none beyond <id>" when so). The next round's reviewer starts there.
|
|
152
176
|
A fix's new test: write it before the fix and take its red with `npx dialecte tdd red`; when production already
|
|
153
|
-
holds the fix, run it on round <n>'s tree - `npx dialecte
|
|
154
|
-
--worktree` (cli 0.
|
|
177
|
+
holds the fix, run it on round <n>'s tree - `npx dialecte lot delta <hand-over folder> --round <n+1>
|
|
178
|
+
--worktree` (cli 0.4.0; else the throwaway I made: <path>) makes the throwaway and prints its removal command;
|
|
155
179
|
copy in the test file and the test code it imports - where it must fail on its assertion, and report "red on
|
|
156
180
|
round-<n>/: <failing line>" with the throwaway's path. Never edit production back to the old behaviour to get
|
|
157
181
|
a red.
|
|
@@ -31,10 +31,10 @@ The hand-over card carries a `standard` line (`@dialecte/cli` 0.3.0). The cli le
|
|
|
31
31
|
`DIALECTE_STANDARD` (a file or a folder, from the environment only: never committed, never shipped), and the
|
|
32
32
|
station that read it records its word in the hand-over folder:
|
|
33
33
|
|
|
34
|
-
- consulted: `npx dialecte
|
|
34
|
+
- consulted: `npx dialecte lot standard <folder> consulted <note>` - the note says what was checked; the
|
|
35
35
|
`file:line` refs stay in the plan's research folder or the findings ledger, never in committed text. The card
|
|
36
36
|
shows `✓ standard consulted`.
|
|
37
|
-
- none configured: propose to the user to configure one, then `npx dialecte
|
|
37
|
+
- none configured: propose to the user to configure one, then `npx dialecte lot standard <folder> not-consulted
|
|
38
38
|
<reason>`. The card shows `! standard not consulted`, which never blocks.
|
|
39
39
|
- a standard configured and nothing recorded fails the card (`✗ standard`); with one configured, only `consulted`
|
|
40
40
|
passes, `not-consulted` fails it too.
|
|
@@ -33,7 +33,8 @@ configuration names and the grader none, blind to which text produced a run.
|
|
|
33
33
|
|
|
34
34
|
Station 1a. Writes the tests of one brief step from the spec, never the production code. It may add stubs
|
|
35
35
|
whose body throws `not implemented: <name>` so the tests compile, called inside `expect(...)`. It runs
|
|
36
|
-
`dialecte tdd red` until every case is red on an assertion, and answers with its output.
|
|
36
|
+
`dialecte tdd red` until every case is red on an assertion, and answers with its output. It writes every case by the
|
|
37
|
+
rules of the `dialecte` skill's references/testing.md (section Rules).
|
|
37
38
|
|
|
38
39
|
### test-reviewer
|
|
39
40
|
|
|
@@ -41,8 +42,9 @@ whose body throws `not implemented: <name>` so the tests compile, called inside
|
|
|
41
42
|
- Access: review
|
|
42
43
|
|
|
43
44
|
Station 1b. Reads the tests of the step against the brief, before any production code. It modifies nothing
|
|
44
|
-
(`dialecte tdd status` is the one command to run). It
|
|
45
|
-
|
|
45
|
+
(`dialecte tdd status` is the one command to run). It judges the tests against the rules of the
|
|
46
|
+
`dialecte` skill's references/testing.md (section Rules) and answers per test: the behaviour it pins, a
|
|
47
|
+
plausible wrong implementation it lets through, a rule it breaks, a verdict.
|
|
46
48
|
|
|
47
49
|
### implementer
|
|
48
50
|
|