scriptonia 0.8.0 → 0.9.0-rc.2

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -13
  3. package/assets/grammar-manifest.json +32 -0
  4. package/assets/grammars/tree-sitter-bash.wasm +0 -0
  5. package/assets/grammars/tree-sitter-c.wasm +0 -0
  6. package/assets/grammars/tree-sitter-cpp.wasm +0 -0
  7. package/assets/grammars/tree-sitter-dart.wasm +0 -0
  8. package/assets/grammars/tree-sitter-go.wasm +0 -0
  9. package/assets/grammars/tree-sitter-java.wasm +0 -0
  10. package/assets/grammars/tree-sitter-javascript.wasm +0 -0
  11. package/assets/grammars/tree-sitter-kotlin.wasm +0 -0
  12. package/assets/grammars/tree-sitter-objc.wasm +0 -0
  13. package/assets/grammars/tree-sitter-python.wasm +0 -0
  14. package/assets/grammars/tree-sitter-rust.wasm +0 -0
  15. package/assets/grammars/tree-sitter-swift.wasm +0 -0
  16. package/assets/grammars/tree-sitter-tsx.wasm +0 -0
  17. package/assets/grammars/tree-sitter-typescript.wasm +0 -0
  18. package/assets/licenses/tree-sitter-wasms-LICENSE +24 -0
  19. package/assets/licenses/web-tree-sitter-LICENSE +21 -0
  20. package/assets/queries/manifest.json +12 -0
  21. package/assets/queries/v1/dart.scm +7 -0
  22. package/assets/queries/v1/go.scm +5 -0
  23. package/assets/queries/v1/javascript.scm +15 -0
  24. package/assets/queries/v1/python.scm +5 -0
  25. package/assets/queries/v1/typescript.scm +17 -0
  26. package/assets/tree-sitter.wasm +0 -0
  27. package/bin/scriptonia.mjs +243 -76
  28. package/bin/verify.mjs +40 -6
  29. package/dist/brain-ast-worker.js +62 -0
  30. package/dist/brain-ast-worker.js.map +1 -0
  31. package/dist/chunk-6TLQP3LV.js +4048 -0
  32. package/dist/chunk-6TLQP3LV.js.map +1 -0
  33. package/dist/chunk-ZLKAW77A.js +16613 -0
  34. package/dist/chunk-ZLKAW77A.js.map +1 -0
  35. package/dist/index.js +2431 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/legacy-brain-bridge.js +156 -0
  38. package/dist/legacy-brain-bridge.js.map +1 -0
  39. package/package.json +78 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Scriptonia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -10,9 +10,10 @@ your agent (Claude Code, Codex, OpenClaw, Hermes) executes it into a PR.
10
10
  npx scriptonia login
11
11
  ```
12
12
 
13
- A browser opens, you sign in, and you're wired: project created, key stored (you
14
- never see one), and your agent's `AGENTS.md` / skill now know about `scriptonia
15
- plan`. Then, in your project:
13
+ A browser opens, you sign in, and the project is created, credentials are stored
14
+ locally (you never see a key), and the Claude skill is installed. Run
15
+ `npx scriptonia init` inside each repository to add its `AGENTS.md` contract.
16
+ Then, in your project:
16
17
 
17
18
  ```sh
18
19
  npx scriptonia add feedback.txt call.vtt notes.md # feed customer signal
@@ -33,10 +34,27 @@ npx scriptonia comment plan/<slug> "default to all actors, and gate behind the a
33
34
  | step | command | what happens |
34
35
  |---|---|---|
35
36
  | **SIGNAL** | `npx scriptonia add <files>` | Ingest text · md · vtt as customer signal (deduped, auto-sourced). |
36
- | **PLAN** | `npx scriptonia plan "<issue>"` | Retrieve the relevant signal, check prior decisions, and write **PLAN.md** — every claim cites a signal id; contradictions are gated **UNRESOLVED** until a human approves. |
37
+ | **PLAN** | `npx scriptonia plan "<issue>"` | Retrieve cited brain evidence, prove full-census file presence/absence, check prior decisions, and write **PLAN.md**; contradictions stay **UNRESOLVED** until a human approves. |
37
38
  | **BUILD** | `claude "execute PLAN.md"` | Your agent implements against the plan's cited criteria and Non-goals fence. |
38
39
  | **REFINE** | `npx scriptonia comment plan/<slug> "…"` | A note regenerates the plan (v+1). A comment approving an override flips a contradiction to **RESOLVED**. |
39
- | **VERIFY** | `npx scriptonia verify` | Check the git diff, unresolved constraints, repo checks, and test coverage. Writes `.scriptonia/evals/<plan>.yaml`; exits 1 on BLOCK. |
40
+ | **VERIFY** | `npx scriptonia verify` | Freeze the Git/product-memory snapshot and consume declared CI/JUnit/static evidence. It never executes repository commands. |
41
+
42
+ ## Build the codebase brain
43
+
44
+ Run the credential-free structural build once in each repository. It performs
45
+ a full census and real Tree-sitter analysis, stores the evidence in an
46
+ immutable SQLite generation, and activates projections only if coverage and
47
+ reference-integrity gates pass.
48
+
49
+ ```sh
50
+ npx scriptonia brain build --fast --offline
51
+ npx scriptonia brain status --check
52
+ npx scriptonia why source/path/to/file.ts
53
+ ```
54
+
55
+ After the first build, `npx scriptonia brain build --offline` is incremental.
56
+ For cited model enrichment, use `npx scriptonia brain build --deep` after login
57
+ and repository binding; the API credential remains on the Scriptonia server.
40
58
 
41
59
  ## Commands
42
60
 
@@ -46,7 +64,15 @@ signal add <files> (--source, --segment, or cat x | npx script
46
64
  plan plan "<issue>" (--out <file>, --refresh <slug>)
47
65
  plans list plans + their slugs
48
66
  comment plan/<slug> "…" refine → regenerates PLAN.md
49
- verify verify [--base <ref>] PLAN.md + git diff → PASS / WARN / BLOCK
67
+ capture run -- <agent-command> capture exactly the command supplied
68
+ runs | run show <id> inspect captured agent sessions
69
+ verify diff-check [--base <ref>] sub-second deterministic policy pass
70
+ verify [--base <ref>] complete evidence report
71
+ gate [--base <ref>] CI-compatible aggregate exit status
72
+ learn learn <finding-id> confirmed finding → draft eval
73
+ eval run [id] | eval doctor run and maintain regression cases
74
+ memory decide | pulse | why | recall local-first product/codebase memory
75
+ brain brain build | brain status build/inspect immutable codebase generations
50
76
  inspect scriptonia the loop + what's next
51
77
  contexts | query "<topic>" | link "<id>" | sync
52
78
  account status | logout | skill | mcp
@@ -55,12 +81,15 @@ account status | logout | skill | mcp
55
81
  ## One brain per repo (for people juggling projects)
56
82
 
57
83
  `npx scriptonia init` in a repo gives it its own brain at
58
- `~/.scriptonia/projects/<slug>/`, scans the code into a repo map (so plan steps
59
- name real files), and writes an `AGENTS.md` section. Customer signal you submit
60
- is stored and embedded on Scriptonia's servers; it is not written into the
61
- repository. The local brain is a human-readable working surface. Initialization
62
- does not upload the full codebase. When you explicitly run `verify`, the selected
63
- PLAN.md and git diff are sent for analysis; the YAML regression case stays local.
84
+ `~/.scriptonia/projects/<slug>/`, builds the credential-free Deep Brain, and
85
+ writes an `AGENTS.md` section. The compatibility `REPO.md` in that project is an
86
+ exact copy of the activated full-census, Tree-sitter-backed projection at
87
+ `.scriptonia/REPO.md`; `init` does not create a second shallow repo map.
88
+ Customer signal you submit is stored and embedded on Scriptonia's servers; it
89
+ is not written into the repository. V2 policies, eval definitions, and
90
+ operational brain data are local-first. Deterministic verification does not
91
+ upload the codebase. When semantic evaluation is explicitly enabled, only the
92
+ bounded evidence bundle is sent through the authenticated Scriptonia gateway.
64
93
 
65
94
  Skip `init` if you have one product — `login → add → plan` uses your default
66
95
  brain and scans whatever repo you run `plan` in.
@@ -76,4 +105,5 @@ Exposes `get_context`, `link_back`, `flag_contradiction` from your stored login.
76
105
  ## Self-hosting
77
106
 
78
107
  Defaults to `https://scriptonia.dev`. Point elsewhere with
79
- `SCRIPTONIA_URL=https://your.host npx scriptonia login` (or `--url`). Node 18+.
108
+ `SCRIPTONIA_URL=https://your.host npx scriptonia login` (or `--url`). Node 24 LTS
109
+ is the V2 release baseline; Node 22 remains in the compatibility matrix.
@@ -0,0 +1,32 @@
1
+ {
2
+ "schema_version": 1,
3
+ "runtime": {
4
+ "package": "web-tree-sitter",
5
+ "version": "0.25.10",
6
+ "license": "MIT",
7
+ "abi_min": 13,
8
+ "abi_max": 15
9
+ },
10
+ "source_package": {
11
+ "name": "tree-sitter-wasms",
12
+ "version": "0.1.13",
13
+ "license": "Unlicense",
14
+ "repository": "https://github.com/Gregoor/tree-sitter-wasms"
15
+ },
16
+ "grammars": [
17
+ { "id": "bash", "languages": ["shell"], "file": "grammars/tree-sitter-bash.wasm", "package_subpath": "out/tree-sitter-bash.wasm", "sha256": "807dcdb1380a59befb112ed8fbd3d3872c7fadaf5903a769282b50973b30696d", "abi": 14 },
18
+ { "id": "c", "languages": ["c"], "file": "grammars/tree-sitter-c.wasm", "package_subpath": "out/tree-sitter-c.wasm", "sha256": "056b25072382f72deee2c64ec238ffc4bb8cf42844ef21502c0e70f03a8a0d66", "abi": 14 },
19
+ { "id": "cpp", "languages": ["cpp"], "file": "grammars/tree-sitter-cpp.wasm", "package_subpath": "out/tree-sitter-cpp.wasm", "sha256": "f6afdf53bfd6de76557bb7edb624a3a3869e14d9a83b78433f93617ecee42527", "abi": 14 },
20
+ { "id": "dart", "languages": ["dart"], "file": "grammars/tree-sitter-dart.wasm", "package_subpath": "out/tree-sitter-dart.wasm", "sha256": "7f5364e4256cf7e55efd01dd52421ef2663caa8061b82659b7e4bf61064545ec", "abi": 15 },
21
+ { "id": "go", "languages": ["go"], "file": "grammars/tree-sitter-go.wasm", "package_subpath": "out/tree-sitter-go.wasm", "sha256": "9963ca89b616eaf04b08a43bc1fb0f07b85395bec313330851f1f1ead2f755b6", "abi": 14 },
22
+ { "id": "java", "languages": ["java"], "file": "grammars/tree-sitter-java.wasm", "package_subpath": "out/tree-sitter-java.wasm", "sha256": "637aac4415fb39a211a4f4292d63c66b5ce9c32fa2cd35464af4f681d91b9a1f", "abi": 14 },
23
+ { "id": "javascript", "languages": ["javascript"], "file": "grammars/tree-sitter-javascript.wasm", "package_subpath": "out/tree-sitter-javascript.wasm", "sha256": "63812b9e275d26851264734868d27a1656bd44a2ef6eb3e85e6b03728c595ab5", "abi": 14 },
24
+ { "id": "kotlin", "languages": ["kotlin"], "file": "grammars/tree-sitter-kotlin.wasm", "package_subpath": "out/tree-sitter-kotlin.wasm", "sha256": "b5cb00c8d06ed0f10f1dbe497205b437809d7e87db1f638721a8cfb30e044449", "abi": 14 },
25
+ { "id": "objective-c", "languages": ["objective-c"], "file": "grammars/tree-sitter-objc.wasm", "package_subpath": "out/tree-sitter-objc.wasm", "sha256": "7c1b5bfdca7e64b6c63b6040bb7ba0afc347df116f9030ca32f8535d7377f6ff", "abi": 14 },
26
+ { "id": "python", "languages": ["python"], "file": "grammars/tree-sitter-python.wasm", "package_subpath": "out/tree-sitter-python.wasm", "sha256": "9056d0fb0c337810d019fae350e8167786119da98f0f282aceae7ab89ee8253b", "abi": 14 },
27
+ { "id": "rust", "languages": ["rust"], "file": "grammars/tree-sitter-rust.wasm", "package_subpath": "out/tree-sitter-rust.wasm", "sha256": "4409921a70d0aa5bec7d1d7ce809a557a8ee1cf6ace901e3ac6a76e62cfea903", "abi": 14 },
28
+ { "id": "swift", "languages": ["swift"], "file": "grammars/tree-sitter-swift.wasm", "package_subpath": "out/tree-sitter-swift.wasm", "sha256": "41c4fdb2249a3aa6d87eed0d383081ff09725c2248b4977043a43825980ffcc7", "abi": 13 },
29
+ { "id": "tsx", "languages": ["typescript"], "extensions": [".tsx", ".jsx"], "file": "grammars/tree-sitter-tsx.wasm", "package_subpath": "out/tree-sitter-tsx.wasm", "sha256": "6aa3b2c70e76f5d48eafef1093e9c4de383e13f2fdde2f4e9b98a378f6a8f1b6", "abi": 14 },
30
+ { "id": "typescript", "languages": ["typescript"], "extensions": [".ts", ".mts", ".cts"], "file": "grammars/tree-sitter-typescript.wasm", "package_subpath": "out/tree-sitter-typescript.wasm", "sha256": "8515404dceed38e1ed86aa34b09fcf3379fff1b4ff9dd3967bcd6d1eb5ac3d8f", "abi": 14 }
31
+ ]
32
+ }
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018-2024 Max Brunsfeld
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema_version": 1,
3
+ "query_version": "1",
4
+ "queries": [
5
+ { "id": "dart", "languages": ["dart"], "file": "v1/dart.scm", "sample_path": "lib/app.dart" },
6
+ { "id": "go", "languages": ["go"], "file": "v1/go.scm", "sample_path": "main.go" },
7
+ { "id": "javascript", "languages": ["javascript"], "file": "v1/javascript.scm", "sample_path": "src/index.js" },
8
+ { "id": "python", "languages": ["python"], "file": "v1/python.scm", "sample_path": "app.py" },
9
+ { "id": "typescript", "languages": ["typescript"], "extensions": [".ts", ".mts", ".cts"], "file": "v1/typescript.scm", "sample_path": "src/index.ts" },
10
+ { "id": "tsx", "languages": ["typescript"], "extensions": [".tsx", ".jsx"], "file": "v1/typescript.scm", "sample_path": "src/view.tsx" }
11
+ ]
12
+ }
@@ -0,0 +1,7 @@
1
+ ; Deep Brain AST queries v1 — Dart
2
+ (class_definition) @symbol
3
+ (function_signature) @symbol
4
+ (method_signature) @symbol
5
+ (getter_signature) @symbol
6
+ (setter_signature) @symbol
7
+ (import_or_export) @import
@@ -0,0 +1,5 @@
1
+ ; Deep Brain AST queries v1 — Go
2
+ (function_declaration) @symbol
3
+ (method_declaration) @symbol
4
+ (type_declaration) @symbol
5
+ (import_declaration) @import
@@ -0,0 +1,15 @@
1
+ ; Deep Brain AST queries v1 — JavaScript/JSX
2
+ (function_declaration) @symbol
3
+ (class_declaration) @symbol
4
+ (method_definition) @symbol
5
+ (lexical_declaration
6
+ (variable_declarator
7
+ value: [(arrow_function) (function_expression)])) @symbol
8
+ (import_statement) @import
9
+ (export_statement
10
+ source: (string)) @import
11
+ ((call_expression
12
+ function: (import)) @dynamic_import)
13
+ ((call_expression
14
+ function: (identifier) @require_callee) @dynamic_import
15
+ (#eq? @require_callee "require"))
@@ -0,0 +1,5 @@
1
+ ; Deep Brain AST queries v1 — Python
2
+ (class_definition) @symbol
3
+ (function_definition) @symbol
4
+ (import_statement) @import
5
+ (import_from_statement) @import
@@ -0,0 +1,17 @@
1
+ ; Deep Brain AST queries v1 — TypeScript/TSX
2
+ (function_declaration) @symbol
3
+ (class_declaration) @symbol
4
+ (method_definition) @symbol
5
+ (interface_declaration) @symbol
6
+ (type_alias_declaration) @symbol
7
+ (lexical_declaration
8
+ (variable_declarator
9
+ value: [(arrow_function) (function_expression)])) @symbol
10
+ (import_statement) @import
11
+ (export_statement
12
+ source: (string)) @import
13
+ ((call_expression
14
+ function: (import)) @dynamic_import)
15
+ ((call_expression
16
+ function: (identifier) @require_callee) @dynamic_import
17
+ (#eq? @require_callee "require"))
Binary file