@skillstech/thunderlang 1.3.0 → 1.4.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 CHANGED
@@ -1,3 +1,62 @@
1
+ # 1.4.0
2
+
3
+ **Upgrade note.** Every existing command, flag, exit code, and JSON output is unchanged. New: the Software Passport
4
+ (`thunder passport`, `thunder passport check`; schema `thunder-passport-v1`), ownership checks on TypeScript web routes
5
+ (`thunder read <dir> --access`, `accessFlow()`; schema `thunder-access-v1`), and a public, browser-safe library entry,
6
+ `@skillstech/thunderlang/program` (compile, run, screens, and all seven targets). `./core` now also exports what apps
7
+ used to reach through paths into `src/`; switch to the public entries, since `src/` paths are not part of the API. The
8
+ repository gains a three-language checkout demo (`demo/checkout/`) with its walkthrough.
9
+
10
+ - **One rule change, every service, any language (`thunder write <folder…>`).** When the same rule is written in
11
+ several services (free shipping from $50 in the cart page in TypeScript, the orders service in C#, and billing's
12
+ receipt in Python), `thunder write web orders billing --decision shippingNote --rule 1 --when "subtotal >= 40"`
13
+ finds every copy (same condition, names compared as words), shows the plan, and with `--write` changes all of them
14
+ or none: only the rule's characters, each file read again. Lookalikes (same names with another limit, or the same
15
+ limit with other names) are listed as "check by hand", never changed; tests are never edited, and those that call
16
+ the rule and mention the old value are listed. `--run "part: cmd"` runs the tests on the change and reports every
17
+ failure; `--passport` records it as a Software Passport. API: `writeRuleAcross`, `findSameRule`,
18
+ `writeAcrossEvidence` in `./core` (`thunder-write-across-v1`). The checkout demo gains the shipping rule in all
19
+ three services and `run-demo.sh --change`.
20
+ - **The Thunder Software Passport (`thunder passport`).** An evidence record for a feature or a change
21
+ (`thunder-passport-v1`): purpose (only what you state, else "not stated"), behavior as Thunder Text with lines,
22
+ dependencies (every file by content hash, Trace links, packages, services), effects detected in code, evidence, unknowns,
23
+ and history. Each claim has a basis (a command with its exit code and output digest, or source lines), what it does not
24
+ cover, and the files it depended on. A failed `--run` is recorded as failed (exit 1), never as passed, and "not verified"
25
+ always lists deployment, real external services, more than one process, and load. `thunder passport check` marks each
26
+ claim current or stale when a file it depended on changed, without re-running anything. Ownership-check verdicts join
27
+ as evidence when that check is present. Pure half in `@skillstech/thunderlang/core` (`assemblePassport`,
28
+ `checkPassport`); `buildPassport` in the root entry. The checkout demo has its passport (`run-demo.sh --passport`).
29
+ - **Access flow: does every path limit the record to the caller?** For TypeScript and JavaScript web routes (Express,
30
+ Fastify, Hono, Next.js), Thunder follows the request's values through the handler, the project's helpers,
31
+ repositories, classes, and middleware, and into the database (Prisma, Drizzle, Knex, raw SQL, postgres.js, Mongoose).
32
+ Each path that hands back or changes a record chosen by the request gets one verdict: guarded (a where clause on
33
+ the caller's tenant or owner, a comparison that stops first, or the caller's own record), unguarded (every step was
34
+ followed and none limits it), or cannot tell (exactly what stopped it, with its line). "Unguarded" is never said
35
+ when anything on the path was left unresolved. `thunder read <dir> --access` (`--json`: thunder-access-v1),
36
+ `accessFlow()` in `@skillstech/thunderlang/core`, and one line on each route in readings. A dependency-free
37
+ TypeScript parser comes with it (`src/flow/ts-parse.mjs`). Measured on a 55-route labeled benchmark (every label
38
+ met; no false "unguarded") and on about 14,500 real files (0 called unguarded). See docs/access-flow.md.
39
+ - **Services that talk across languages are read and linked.** Thunder Trace now links:
40
+ - ASP.NET minimal-API routes (`app.MapPost("/orders", …)`);
41
+ - Python standard-library handlers (`do_POST` and the one path it checks);
42
+ - an `HttpClient` under any client-like name (`http.PostAsync("/charges", …)`);
43
+ - a `fetch` whose options object spans lines.
44
+
45
+ A TypeScript → C# → Python app is linked end to end, each end cited.
46
+ - **More of a change is said in words:**
47
+ - C#'s `String.IsNullOrEmpty(x)` ("x is empty or missing"), `Task.FromResult(x)`, and `GetOrAdd` ("made … if it is missing");
48
+ - a JSON body by its fields ("Turns items (cart), coupon and key into JSON text");
49
+ - a new random ID (`crypto.randomUUID()`, `uuid.uuid4()`, `Guid.NewGuid()`).
50
+
51
+ `thunder review` says when a function's steps moved into a new function it now runs, instead of listing each one as "no longer".
52
+ - **Truer C# values:** a filled-in initializer (`= new() { ["a"] = 1 }`) is no longer "empty at first"; `0.08m` reads 0.08; `new()` of an object is not "empty"; a field and the property that shows it are listed once. Words inside text (`$"… bug (…) {x}"`) and a lambda passed as an argument are no longer read as methods. A folder's big picture no longer takes one file's description as the whole app's.
53
+ - **Demo: `demo/checkout/`.** A three-language shop (TypeScript, C#, Python) where a retried checkout charged twice, the fix (one idempotency key end to end), and `run-demo.sh` to reproduce both and what Thunder reads.
54
+ - **`@skillstech/thunderlang/program`: Thunder Core as a library, browser-safe.** One public entry for apps (OpenThunder,
55
+ the site, your own tools) to compile a program (`compileCore`), run it on the Thunder engine (`runInProcess`,
56
+ `recordedRun`, `testInProcess`), show and drive its screens (`screenApp`, `screenOutline`), and write it as Python,
57
+ TypeScript, C#, Java, Go, Rust, or React (`toPython` … `toReact`), plus `pythonToCore`, with types. A test checks
58
+ that nothing it imports needs Node, so it runs in a browser; until now this needed paths into the package's files.
59
+
1
60
  # 1.3.0
2
61
 
3
62
  **Upgrade note.** Every existing command, flag, exit code, and JSON output is unchanged. New: Thunder Core compiles to