@skillstech/thunderlang 1.4.3 → 1.6.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/CHANGELOG.md +51 -0
- package/dist/core.cjs +1437 -292
- package/dist/index.cjs +6013 -4774
- package/dist/learn.cjs +409 -155
- package/package.json +1 -1
- package/src/cli.mjs +8 -5
- package/src/emit.mjs +1 -1
- package/src/mcp.mjs +20 -3
- package/src/passport.mjs +9 -2
- package/src/read-repo-fs.mjs +3 -2
- package/src/trace-cli.mjs +3 -3
- package/src/trace-data.mjs +219 -0
- package/src/trace-fs.mjs +10 -3
- package/src/trace.mjs +207 -16
- package/src/write-steps.mjs +152 -23
- package/src/write-words.mjs +182 -0
- package/src/write.mjs +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
# 1.6.0
|
|
2
|
+
|
|
3
|
+
- **Thunder write in Thunder's words.** `thunder write <file> --edit` (step edits: inputs, questions, Stops, steps,
|
|
4
|
+
answers, renames, in TypeScript, JavaScript, Python, and Go) now takes conditions, values, and steps the way Thunder
|
|
5
|
+
reads them: `"amount is at least 75 and not member"`, `"the length of value is below 2"`, `"name is nothing"`,
|
|
6
|
+
`Give …`, `Set … to …`, `Stop with "…"`. Each language gets its own form (`name is None`, `name == null`,
|
|
7
|
+
`name == nil`), and names are the code's own names said as words, matched in the function first, never from a
|
|
8
|
+
comment or docstring. Code is still accepted. A word with no fixed meaning in the language is refused, not guessed.
|
|
9
|
+
- **New in step edits:** `setValue` takes `toValue` (a name or expression, e.g. route a new input into a step);
|
|
10
|
+
steps inside `except` / `catch` and `finally` can be edited; `--edits <list.json|->` reads a list of edits; and the
|
|
11
|
+
MCP server offers `intent_write` (files and edits in, patch, new files, and proof out; nothing written to disk).
|
|
12
|
+
- **Fixes found by measuring on real code** (Flask, Click, Requests, httpx, rich, humanize, toolz): an `elif` whose
|
|
13
|
+
comparison changed got a second colon; removing a function's only step left an empty Python body (now `pass`); a
|
|
14
|
+
hex number (`0xFFFFFFFF`) was written as `4294967296xFFFFFFFF` (hex, octal, binary, and `1_000` now keep their
|
|
15
|
+
form, in step edits and rule edits); a word was matched to a name in a docstring; in a list of edits, a later
|
|
16
|
+
edit's line could land on a step an earlier edit inserted (lines now always mean the original file's lines); and
|
|
17
|
+
several edits to one function were checked against stale steps; a comment between a question and its first step
|
|
18
|
+
was taken as part of the question (it was dropped and the colon lost); and a step added before a decorated function
|
|
19
|
+
went between the decorator and the function. Each has a test. On 9,326 generated edits across Flask, Requests,
|
|
20
|
+
Click, httpx, and rich, every one of the 8,942 written files now parses (11 did not before).
|
|
21
|
+
- **Measured:** `scripts/write-bench.mjs` runs change requests with hidden tests (the test must fail on the original
|
|
22
|
+
code and pass on the written code); `scripts/write-sweep.mjs --verify` checks every written file with the
|
|
23
|
+
language's own parser. Results in docs/thunder-write.md.
|
|
24
|
+
|
|
25
|
+
**Upgrade note.** No command, flag, exit code, or JSON shape was removed. A Python condition such as `x is 5` (or
|
|
26
|
+
`member is true`) given to `--edit` is now read as Thunder's "is" (equals), not Python's identity test; `x is None`
|
|
27
|
+
is unchanged. `thunder write --edit` accepts `--edits <file>`.
|
|
28
|
+
|
|
29
|
+
# 1.5.0
|
|
30
|
+
|
|
31
|
+
- **Thunder Trace reads tables, settings, and packages.** `thunder trace` now links SQL to the repository that
|
|
32
|
+
creates the table (`CREATE TABLE` in its SQL files), and a dependency to the repository that publishes the package
|
|
33
|
+
(`package.json` name, `go.mod` module, `.csproj` `PackageId`). It also lists what repositories share: setting keys
|
|
34
|
+
more than one reads (`process.env.ORDERS_URL`, `os.getenv("ORDERS_URL")`, and the other languages' ways), tables
|
|
35
|
+
more than one uses, and packages asked for at different versions in different repositories. `thunder trace impact`
|
|
36
|
+
takes `table:orders`, `setting:ORDERS_URL`, and `package:@acme/client` (or the plain name), and `--diff` reports a
|
|
37
|
+
changed, dropped (`DROP TABLE`), or no-longer-created table with every place in another repository that still uses
|
|
38
|
+
it, SQL on another repository's table, a changed setting other repositories read, and a change inside a package
|
|
39
|
+
other repositories depend on. The same rules as routes: facts only, one hop, test and fixture files left out, every
|
|
40
|
+
item cited `repo@sha:file:line`. SQL in code counts only in strings shaped like a statement, so a sentence such as
|
|
41
|
+
"Delete your data from Profile" is never read as SQL. The MCP `intent_trace` tool takes the same names.
|
|
42
|
+
- **Fix: a pure deletion in `--diff`** (lines removed, none added) no longer marks the line before it as changed. It
|
|
43
|
+
touches only what spans the gap, such as the function or statement it was inside.
|
|
44
|
+
- **Passport** words the new table links ("billing reads the orders table, which orders creates").
|
|
45
|
+
|
|
46
|
+
**Upgrade note.** No command, flag, or exit code changed. The `thunder-trace-v1` graph gains fields: each repository
|
|
47
|
+
has `packages`, `settings`, and `tables`; links can have `kind: "data"` or `kind: "package"`; and there is a new
|
|
48
|
+
`shared` object. `rulesVersion` is now `"2"`, so fingerprints differ from rules v1 for the same commits. Readers that
|
|
49
|
+
switch on `link.kind` should handle (or skip) the two new kinds. `thunder trace` now reads `package.json`, `go.mod`,
|
|
50
|
+
`requirements.txt`, and `*.csproj` files from each folder.
|
|
51
|
+
|
|
1
52
|
# 1.4.3
|
|
2
53
|
|
|
3
54
|
**Upgrade note.** No command, flag, exit code, or JSON shape changed. `readingLayout` can now end with a new
|