Skip to content

Commit 032ebf5

Browse files
committed
fix(vendor): ship arkts upstream MIT byte-identical and register the fork
The vendored LICENSE carried tree-sitter-typescript's MIT text plus an appended derivative notice. That is not what MIT asks of a derivative -- it asks that upstream's notice travel with the code -- and the appended text meant the provenance audit could not byte-verify the file against upstream, so arkts landed as NO-MANIFEST-ENTRY and failed license-gate. The vendored LICENSE is now byte-identical to upstream's, and arkts is registered in the audit's FORKS map, which is defined for exactly this case: a self-maintained fork whose vendored LICENSE must match its upstream. That is a routing entry, not an exemption -- check_upstream still byte-verifies against the real upstream repository, so the fact is checked rather than asserted. Audit now reports arkts as IDENTICAL. Our copyright for the ArkTS additions is not lost, it moves to where our SOURCE is: the grammar.js header (which now states all three copyrights explicitly) and THIRD_PARTY.md, which ships inside the release archives. The edit to scripts/audit-license-provenance.py is a maintainer-only enforcement-surface change, made deliberately and stated here rather than slipped in; a contribution may never supply its own audit entry. No generated parser or source changes -- comments, licence text, manifest prose and one routing entry only. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 0df990a commit 032ebf5

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

‎internal/cbm/vendored/grammars/MANIFEST.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The grammars were originally vendored as bare `parser.c`+`scanner.c` with **no r
1515
- `verdict`: VERIFIED-BOTH = our source matches *both* registries; VERIFIED-NVIM/HELIX = matches one; registry-disagreement = registries name a different repo (listed separately); `vendor-maintained` = the language vendor's own grammar, not in nvim/Helix.
1616
- **objectscript_udl / objectscript_routine** (added 2026-06-24): vendored from [intersystems/tree-sitter-objectscript](https://github.com/intersystems/tree-sitter-objectscript) @ `a7ffcdf` — MIT, the InterSystems-official grammars (a niche vendor language, hence `vendor-maintained`, not in nvim-treesitter/Helix). **Re-vendor note:** each `scanner.c`'s upstream `#include "../../common/scanner.h"` is repointed to a per-directory `objectscript_common.h` (a verbatim copy of upstream `common/scanner.h`), because this repo's shared `vendored/common/scanner.h` belongs to the cfml/fsharp grammars and differs. The generated `parser.c`/`scanner.c` are otherwise byte-for-byte upstream — on re-vendor, re-apply only that single include rename. **Local modification (2026-07-16):** in `objectscript_common.h`, two loop counters `uint8_t i` were widened to `int i` (the `reverse_marker` scan and the `html_marker_buffer` reversal) to clear CodeQL `cpp/comparison-with-wider-type` — a false positive in practice (both lengths are hard-bounded by `MARKER_BUFFER_MAX_LEN = 30`, so `uint8_t` could never wrap), fixed for cleanliness. On re-vendor, re-apply this widening too (or upstream it at intersystems/tree-sitter-objectscript).
1717
- **mojo** (added 2026-07-01): vendored from [lsh/tree-sitter-mojo](https://github.com/lsh/tree-sitter-mojo) @ `33193a99afe6` — MIT, ABI 15. Helix tracks `lsh/tree-sitter-mojo` as its Mojo grammar source, but the Helix-pinned commit (`3d7c53b8038f`) no longer resolves in the upstream repository after a force-push, so this vendor uses current upstream `main` rather than the stale registry SHA. Security review covered only the vendored C surface (`parser.c`, `scanner.c`, `tree_sitter/*.h`) plus upstream license/provenance metadata; no package manager hooks, workflow files, prompt/agent instruction files, or generated lockfiles were vendored.
18-
- **arkts** (added 2026-08-26): **first-party derivative** — a fork of [tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript)'s `typescript` dialect pinned @ `75b3874edb2d` (v0.23.2, the same commit our vendored typescript/tsx come from), on the tree-sitter-javascript base @ `3a837b6f3658` (v0.23.1, the version upstream's own package-lock pins), extended with ArkTS/ArkUI syntax (`@Component struct` declarations, UI-DSL trailing-closure calls with post-block attribute chains, decorated function declarations, `import lazy`, `@Extend`/`@Styles` leading-dot attribute chains, anonymous `stateStyles` style blocks). Grammar source + corpus tests live in `tools/tree-sitter-arkts/`; regenerate with `npx tree-sitter-cli@0.25.10 generate` (ABI 15). **External scanner:** `scanner.c` is a symbol-rename trampoline; `_common_scanner.h` is byte-identical (same SHA-256) to the reviewed `typescript/_common_scanner.h` already shipped. LICENSE = tree-sitter-typescript's MIT text verbatim (© 2017 Max Brunsfeld) + a derivative-work notice adding the tree-sitter-javascript attribution (© 2014 Max Brunsfeld) and the DeusData copyright for the ArkTS additions.
18+
- **arkts** (added 2026-08-26): **first-party derivative** — a fork of [tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript)'s `typescript` dialect pinned @ `75b3874edb2d` (v0.23.2, the same commit our vendored typescript/tsx come from), on the tree-sitter-javascript base @ `3a837b6f3658` (v0.23.1, the version upstream's own package-lock pins), extended with ArkTS/ArkUI syntax (`@Component struct` declarations, UI-DSL trailing-closure calls with post-block attribute chains, decorated function declarations, `import lazy`, `@Extend`/`@Styles` leading-dot attribute chains, anonymous `stateStyles` style blocks). Grammar source + corpus tests live in `tools/tree-sitter-arkts/`; regenerate with `npx tree-sitter-cli@0.25.10 generate` (ABI 15). **External scanner:** `scanner.c` is a symbol-rename trampoline; `_common_scanner.h` is byte-identical (same SHA-256) to the reviewed `typescript/_common_scanner.h` already shipped. **LICENSE:** tree-sitter-typescript's MIT text **verbatim and byte-identical** (© 2017 Max Brunsfeld) — which is what MIT requires of a derivative work, and what lets the provenance audit byte-verify it against upstream rather than take a note on trust. The fork is registered in the audit's `FORKS` map. Our own copyright for the ArkTS additions, and the tree-sitter-javascript attribution (© 2014 Max Brunsfeld), live with the SOURCE in `tools/tree-sitter-arkts/grammar.js` and in `THIRD_PARTY.md`, which is what ships in the release archives.
1919

2020
> ⚠️ **Pinned commit = the revision nvim-treesitter/Helix vendor** (battle-tested, canonical source), not bleeding-edge HEAD. When re-vendoring, update the pinned commit here.
2121
@@ -235,7 +235,7 @@ upstream author (correctly retained). The table now records the true origin.
235235

236236
| grammar | cur ABI | original upstream | license |
237237
|---|:---:|---|---|
238-
| arkts | 15 | **first-party derivative**: forked from tree-sitter/tree-sitter-typescript @ `75b3874edb2d` (v0.23.2; javascript base @ `3a837b6f3658` v0.23.1); grammar source in `tools/tree-sitter-arkts/` | MIT, (c) 2017 Max Brunsfeld (verbatim) + (c) 2026 DeusData additions — see summary note |
238+
| arkts | 15 | **self-maintained fork** of tree-sitter/tree-sitter-typescript @ `75b3874edb2d` (v0.23.2; javascript base @ `3a837b6f3658` v0.23.1); grammar source in `tools/tree-sitter-arkts/` | MIT, (c) 2017 Max Brunsfeld — byte-identical to upstream; ArkTS additions (c) 2026 DeusData, see grammar.js + THIRD_PARTY.md |
239239
| assembly | 14 | RubixDev/tree-sitter-assembly (**repo deleted from GitHub** — our retained MIT copy, (c) 2023 RubixDev, is the surviving grant) | MIT |
240240
| cfml | 15 | cfmleditor/tree-sitter-cfml | MIT, (c) 2014 Gareth Edwards & Gavin Baumanis — byte-identical |
241241
| cfscript | 15 | cfmleditor/tree-sitter-cfml | MIT, same — byte-identical |

‎internal/cbm/vendored/grammars/arkts/LICENSE‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-
23-
---
24-
25-
This ArkTS grammar is a derivative work of tree-sitter-typescript
26-
(https://github.com/tree-sitter/tree-sitter-typescript, MIT license above,
27-
forked at commit 75b3874edb2dc714fb1fd77a32013d0f8699989f / v0.23.2), which
28-
itself builds on tree-sitter-javascript
29-
(https://github.com/tree-sitter/tree-sitter-javascript, The MIT License (MIT),
30-
Copyright (c) 2014 Max Brunsfeld; included at commit
31-
3a837b6f3658ca3618f2022f8707e29739c91364 / v0.23.1).
32-
33-
Copyright (c) 2026 DeusData — ArkTS additions (struct component declarations,
34-
UI-DSL trailing-closure calls, decorated function declarations, lazy imports,
35-
@Extend/@Styles attribute chains), licensed under the same MIT terms.

‎scripts/audit-license-provenance.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222

2323
FIRST_PARTY = {"cobol", "form", "janet", "magma", "protobuf", "wolfram"}
2424
FORKS = { # self-maintained forks: vendored LICENSE must match the original upstream
25+
# arkts: our own ArkTS fork of tree-sitter-typescript. The vendored LICENSE is
26+
# upstream's MIT verbatim, which is what MIT requires of a derivative; our own
27+
# copyright and the fork's provenance live where our SOURCE is (grammar.js
28+
# header, MANIFEST.md, THIRD_PARTY.md) rather than inside upstream's notice.
29+
# This is a routing entry, NOT an exemption -- check_upstream still byte-verifies
30+
# against the real upstream repository.
31+
"arkts": "tree-sitter/tree-sitter-typescript",
2532
"cfml": "cfmleditor/tree-sitter-cfml",
2633
"cfscript": "cfmleditor/tree-sitter-cfml",
2734
"dotenv": "pnx/tree-sitter-dotenv",

‎tools/tree-sitter-arkts/grammar.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
* @file ArkTS (HarmonyOS/OpenHarmony .ets) grammar for tree-sitter
33
* @license MIT
44
*
5+
* Copyright (c) 2017 Max Brunsfeld (tree-sitter-typescript, forked below)
6+
* Copyright (c) 2014 Max Brunsfeld (tree-sitter-javascript base)
7+
* Copyright (c) 2026 DeusData (ArkTS/ArkUI additions in this file)
8+
*
9+
* The VENDORED parser ships upstream's MIT LICENSE byte-identical, because that
10+
* is what MIT requires of a derivative and what lets the provenance audit verify
11+
* it against upstream instead of trusting a note. The copyright for our own
12+
* additions is stated HERE, with the source, and in THIRD_PARTY.md, which ships
13+
* inside the release archives.
14+
*
515
* First-party DERIVATIVE grammar: a fork of tree-sitter-typescript's
616
* `typescript` dialect (no JSX), extended with the ArkTS/ArkUI syntax that
717
* plain TypeScript cannot parse.

0 commit comments

Comments
 (0)