@hyperfixi/server-bridge 4.4.0 → 4.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +197 -5
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,196 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.6.0] - 2026-10-15
11
+
12
+ ### Added
13
+
14
+ - **`@lokascript/semantic`: `ask` and `answer`** in every language's own word (es `preguntar` /
15
+ `responder`, ja `尋ねる` / `答える`, de `frage` / `antworte`): upstream's two dialog commands
16
+ (`ask "Name?"` prompts; `answer "Save?" with "Yes" or "No"` confirms, the choices after the language's
17
+ `with`). Both were refused in every language. Listed for native review in
18
+ `packages/semantic/NATIVE_REVIEW_NEEDED.md`.
19
+ - **`@lokascript/semantic`: `scroll … by` with a direction** in every language's own words
20
+ (`scroll #box down by 200px`: es `desplazamiento #box abajo por 200px`, ja `#boxを 下 200px スクロール`,
21
+ ru `прокрутить #box вниз 200px`). Upstream's relative scroll was refused in every language: no
22
+ direction had a word, and scroll's schema modeled `scroll to <el>` alone. Listed for native review in
23
+ `packages/semantic/NATIVE_REVIEW_NEEDED.md`.
24
+
25
+ ### Changed
26
+
27
+ - **`@lokascript/framework`: a domain DSL's parse refuses input it did not read.**
28
+ `createMultilingualDSL`'s `parse` (and so `compile`, `validate`, `translate`) tries every pattern and
29
+ takes the best match that reads the WHOLE input: highest priority, then confidence. When the only
30
+ matches leave input unread, it throws `UnreadInputError` (exported; `code: 'unread-input'`, with the
31
+ longest match's `reading` and the `unread` text). It used to return the first match however much it
32
+ read, so a trailing word was dropped without a word: the domain gate (lokascript-domains) found
33
+ 1,744 of 1,744 renders accepted with an unknown word after them, and `ask what is 2+2` asked the
34
+ model "what". Against the gate (domains 4.0.0, measured unpublished with `gate:upstream`): 1,527
35
+ cases better, 62 worse, every one `pass → refused` (a value such as `click`'s that the generator
36
+ ignored, now refused as unread rather than dropped); no case became silent, and no accepted parse
37
+ changed its reading. A multi-word llm question is quoted: `ask "what is 2+2"`.
38
+ - **`@lokascript/framework`: a domain DSL's `translate` refuses a rendering that does not read
39
+ back.** It reads its output in the target language and requires the source command: the same
40
+ action and role values, or the same compiled code. Otherwise it throws `TranslationReadBackError`
41
+ (exported; the text under `partial`, what it reads as under `reading`), unless `{ lossy: 'allow' }`,
42
+ as semantic's `translate`. `DomainRegistry`'s tools (the MCP `parse_` / `compile_` / `validate_` /
43
+ `translate_<domain>` tools) report refusals as `ok: false` with an `UNREAD_INPUT` or
44
+ `TRANSLATION_DOES_NOT_READ_BACK` diagnostic instead of a generic tool error, and `translate_<domain>`
45
+ reads its own rendering back the same way. Translating every domain gate command from English: 46
46
+ renders that used to be returned are now refused (45 do not parse in the target language).
47
+ - **`@lokascript/semantic`: the parser is split into modules.** `semantic-parser.ts` went from 9,680
48
+ lines to 751, across 22 modules under `parser/`, and each question about an end word (does it close a
49
+ block, does it stop a clause) has one reader. Each step was checked against 27,194 parses; the steps
50
+ that change a reading are listed under Fixed. `SemanticParseError` keeps its import path.
51
+
52
+ ### Fixed
53
+
54
+ - **`@lokascript/semantic`: a handler's count** (`on click 1 …`, the first click only; `on click 2 …`)
55
+ is read in every language. The renders already wrote it (es `al clic 1 ocultar`), but every reader
56
+ outside English dropped it, so the translation was refused in all 23 languages. Bengali, Italian and
57
+ Thai also read every clause between a handler's event and its body (`on click elsewhere`,
58
+ `on mutation of attributes`, `on foo queue first`), which their head pattern skipped. In the command-shape
59
+ gate, 375 lanes that were refused now pass.
60
+ - **`@lokascript/semantic`: a query of a pseudo-class alone** (`<:checked/>`, `<:not(.done)/>`) reads
61
+ as a query in every language, English too. Every tokenizer read `<` and then a local variable
62
+ `:checked`, so a translation was refused. In the command-shape gate, 161 lanes that were refused now
63
+ pass.
64
+ - **`@lokascript/semantic`: value spellings from upstream's own tests** read in every language,
65
+ English too: an escaped class name (`.group-\[:nth-of-type\(3\)_\&\]:block`), a query of several
66
+ selectors (`<#d1, #d2/>`), a unit after parentheses (`(startWidth)px`), `[@data-foo]` and an
67
+ attribute after a pronoun (`set it @disabled to true`, written `its @disabled`), a dotted property
68
+ before `of` (`set parentNode.innerHTML of #d1 to "foo"`), and `set {bar: 2, baz: 3} on obj`. Each was
69
+ refused. `get` no longer has a destination slot, which no reader used and which took Italian's `in`:
70
+ `get #p1 in me` read back as `get #p1 on me` in Italian, and `get result as JSONString` was refused
71
+ in Quechua. In the command-shape gate, 202 lanes are better, 3 of them silent before.
72
+ - **`@lokascript/semantic`: upstream's collection expressions** read in English and translate:
73
+ `set :items to <span/> in #box where it matches .a`,
74
+ `put matches mapped to its textContent into #out`, `repeat for x in :items where x.val > 10 …`. They were refused in every language, English
75
+ too, or kept as an English clause after the command. A translation writes the language's own `where`,
76
+ as it already did in a condition (es `donde`, de `wo`), and keeps `mapped to` in English until native
77
+ review. Also read now: an element-scoped variable (`:items`) inside a longer value, the article in
78
+ `in the closest <table/>` and `checked of the :boxes`, and zh/tl's `no` before a sigil variable. Quechua and
79
+ Vietnamese read their own `where` back (it read as `target`, or split at its `_`), which also clears a
80
+ silent pair in each. In the command-shape gate, 154 lanes are better, 2 of them silent before.
81
+ - **`@lokascript/semantic`: a query's scope inside a phrase** reads in English and translates:
82
+ `put the length of <:checked/> in #box into me` (the value ended at the query and `in` was taken as
83
+ put's marker), `bind $n to the length of <:checked/> in the next <tbody/> …` (a positional scope),
84
+ `put <span/> in #box where it matches .a into me` (English came back silently as `… into #box …`), and
85
+ `put the length of <p/> into #out` and `put 'x' into the next <div/>'s textContent`, which the lossy
86
+ check refused because it read the `'s` after `<p/>` as a quote. In the command-shape gate, 63 lanes are
87
+ better, 1 of them silent before.
88
+ - **`@lokascript/semantic`: no translation reads back as other English without saying so.** The
89
+ command-shape gate's last five silent pairs read back as their source: pl's `closest .bar to .foo`
90
+ (pl's own `to` is "it"), `closest @foo` in pl and sw, a Quechua chain of `'s` (`$data's inner's val`,
91
+ read as a string), and Indonesian's `saya punya @data-x`. English `set closest @foo to "doh"` and
92
+ `put closest @foo into me`, refused in all 24 languages, read now too.
93
+ - **`@lokascript/semantic`: commands that semantic already models, refused in some languages,** read
94
+ and translate. In the command-shape gate, 168 lanes that were refused now pass; with the rows above,
95
+ the refused lanes of shapes semantic models went from 911 to 86, and the gate reads 26,531 pass,
96
+ 709 refused and 0 silent. The commands:
97
+ - `fetch $u as JSON`, with a `$` or `:` variable as the URL (23 languages);
98
+ - `toggle my *display`, `*opacity` and `*visibility` (ar, de, fr, he, ja, tr);
99
+ - a `js(…) … end` block after `then` behind a handler head (bn, es, it, ko, pl, ru, th, tl, uk);
100
+ - a snake_case name (`call global_function()`), which 11 tokenizers split at its `_`;
101
+ - a custom event after a handler head's `or` (`on click or foo`: bn, it, ja, ko, th, tr, zh). English
102
+ no longer drops the second event of `on foo or bar`;
103
+ - `put … at end of` in Vietnamese, and in bn, hi, ja, qu and tr after a bare name
104
+ (`put response at end of #results`);
105
+ - a `set` target with no marker after it, in it, pl, ru and uk (`set .divs.innerHTML to "foo"`,
106
+ `#d1.parentNode`, `bar["count"]`), and `on keydown[key=="Enter"]` in ar, de, fr and he;
107
+ - `fetch … as Object` and `as Number` behind a bn, hi or ko handler head;
108
+ - a top-level `for item in items …`, which bn, hi, ko and sw read as a handler on `item`;
109
+ - a loop's bottom test (`repeat … until x is 3 end`) in de, fr and ko;
110
+ - a Korean second handler on a parameterized event (`on exception(error)`), and Polish
111
+ `then throw` after `do` (Polish for `into`);
112
+ - bn, th and vi's own word for `checked`.
113
+ - **`@lokascript/semantic`: `at end of` inside a behavior or a def** reads in every language:
114
+ `behavior B on click put "x" at end of me end` was refused, English to English too, because the
115
+ `end` of `at end of` closed the block. A variable spelled like an end word in such a body reads too
116
+ (es `fin`).
117
+ - **`@lokascript/semantic`: two copied type lists that had lost `property-path`.** Chinese reads
118
+ `put the textContent of last <.picked/> in #list`, which it refused, and ja, ko and zh write the count
119
+ of `repeat the textContent of #a times` in their own words (`#aのtextContent`), not English.
120
+ - **`@lokascript/semantic`: Quechua's `repeat until event … from …`** writes Quechua
121
+ (`kama ruway pointerup ta kutipay #box manta …`), not a leftover of the retired i18n transformer with
122
+ English `until event` and `repeat` in it.
123
+ - **Test runs no longer fill the temp directory**: `scripts/vitest-run.sh` gives each run its own
124
+ `TMPDIR` and removes it. Vitest 5.0.2 leaves a copy of every transformed module in `$TMPDIR` per run.
125
+
126
+ ### Removed
127
+
128
+ - **`@hyperfixi/mcp-server`: the jsx domain's four tools** (`parse_jsx`, `compile_jsx`, `validate_jsx`,
129
+ `translate_jsx`), and `jsx` as a `domain` for `lse_validate_and_feedback`, `generate_training_data`
130
+ and the `lse_generate` prompt. The server now depends on `@lokascript/domains` ^4.0.0, which retired
131
+ jsx with six other preview domains (`docs-internal/DOMAINS_RETHINK.md`, D1). 8 domains remain (sql,
132
+ bdd, behaviorspec, llm, flow, voice, todo, learn): 32 domain tools, 102 tools defined, 97 listed by
133
+ default.
134
+
135
+ ## [4.5.0] - 2026-10-11
136
+
137
+ Pronouns, suffixes and handler heads read as their language. In 4.4.0 every translation wrote `me` and
138
+ `it` in the nominative beside a marker (es `a yo`, de `zu ich`, tr `ben e`, ar `إلى أنا`), wrote every
139
+ case particle as a word of its own (ko `#out 에`, ja `"x" を`), and wrote a Japanese, Bengali or Turkish
140
+ handler head with two markers (`クリック を で`, `ক্লিক তে`, `tıklama i üzerinde`). Each of these is now
141
+ the language's own form, and every reader still takes the old one. The forms are listed for native
142
+ review in `packages/semantic/NATIVE_REVIEW_NEEDED.md`; none has been reviewed yet.
143
+
144
+ ### Added
145
+
146
+ - **`@lokascript/testing-framework`: the English-leak gate counts pronoun case and marker spacing.**
147
+ `case:it` and an unmarked object pronoun (`case:me-object`, `case:it-object`) beside `case:me`; and
148
+ `spacing:<marker>`, a particle ko, ja, bn or tr attaches to its noun written as a word of its own.
149
+ Both shrink-only, both halves (corpus and command shapes), with per-language exit targets in
150
+ `LEAK_TARGETS`.
151
+ - **`@lokascript/semantic`: `toggle … between`** in every language's own words (ja `の間で`, hi `के बीच`,
152
+ he `בין`), with the style form's element written in the language.
153
+ - **`docs-internal/multilingual/FUSED_FORMS.md`**: the design for pronouns fused with their markers and
154
+ suffixes attached to words, with the owner's four questions and their answers.
155
+
156
+ ### Changed
157
+
158
+ - **`@lokascript/semantic` writes a pronoun in the case its marker takes.** Free forms: es `en mí`,
159
+ pt `a mim`, it `a me`, tl `sa akin`, pl `do mnie`, ru `ко мне` / `во мне`, uk `до мене`, de `zu mir`
160
+ / `in mich` (direction) / `auf mir` (location), hi `मुझ में`; `it` after a marker (ru `к этому`, pl
161
+ `do tego`, de `dazu` / `darin` / `darauf`, fr `à lui`, hi `इस में`); `me` as a verb's object (de
162
+ `zeige mich`, ru `покажи меня`). Fused forms: tr `bana` / `beni` / `benden`, `ona` / `onu`; ar `إليّ` / `فيه`;
163
+ he `אליי` / `ממני`; bn `আমাকে` / `আমাতে`; hi `मुझे`; tl `dito`; pt `nele`. Object clitics on the verb:
164
+ es `mostrarme`, it `metterlo`, pt `colocá-lo`, ar `ضعه`; fr writes the object pronoun before the
165
+ infinitive (`le mettre`, `l'afficher`, `me cacher`). Every reader takes the nominative and the English
166
+ forms as before.
167
+ - **`@lokascript/semantic` writes a case particle onto its word** in ko (`"x"을 #out에 넣다`, `나를`,
168
+ each particle in the form the syllable takes), ja (`#outに`, `.aを`) and bn (`#outএ`, `.xকে`), and tr
169
+ fuses a suffix with its own reference words (`sonucu`, `hedefe`, `belgeye`) while code keeps its
170
+ suffix apart (`#out e`) until a reviewer picks a code word's harmony. tr also reads a suffix on code
171
+ after an apostrophe (`#out'a`, `.active'i`).
172
+ - **`@lokascript/semantic`: a custom event in a wait takes the language's `event` word** (`esperar evento foo`,
173
+ ja `イベント foo 待つ`), as `repeat until event X` already does; a known DOM event keeps `esperar transitionend`.
174
+ `wait for <custom event>` was refused in every language. A possessive whose property is a reference word
175
+ (`its.detail`) now reads back as that property, not the language's word for it.
176
+ - **`@lokascript/semantic`: ms and pl read their lexicon's `undefined` word** (`tidak_ditakrifkan`, `niezdefiniowane`),
177
+ which read back as a variable name.
178
+ - **`@lokascript/testing-framework`: the hand-written-input gate** (`hand-written-input.test.ts`): twenty tasks a
179
+ native speaker writes from English, run as written on the engine against upstream; committed with no inputs.
180
+ - **`@lokascript/semantic` writes a handler head as one word**: ja `クリックで` (was `クリック を で`),
181
+ bn `ক্লিকে` (the locative in the form the word takes: `জমাতে` after a vowel; was `ক্লিক তে`),
182
+ tr `tıklamada` (the locative in the form harmony gives: `göndermede`, `değişiklikte`; code keeps it apart, `keyup da`; was `tıklama i üzerinde`). The readers keep taking the two-marker heads.
183
+ - **`@lokascript/semantic` writes a query's scope before the query** in bn, hi, tr, ja and ko (tr
184
+ `bendeki <p/>`, hi `मुझ में स्थित <p/>`, ja `自分 の中の <p/>`), where it wrote English's order.
185
+ - **`@lokascript/semantic`: es and pt write the `focus` and `blur` commands as verbs** (`enfocarme`,
186
+ `focar-me`); the nouns were the events' and still read.
187
+ - **`@lokascript/semantic`: ja's head pattern outranks its fused handler patterns**, so a ja handler's
188
+ body always takes the clause walk: a `js … end` block after `then` and `fetch … as T` round-trip
189
+ where the fused path dropped them. The 2026-08 transformer's verb-first `繰り返し イベント X を まで`
190
+ body no longer reads in ja (the render since 2026-08-28 does).
191
+
192
+ - **`@lokascript/htmx-adapter`: the tr vocab gains `hx-da` as an alias of `hx-on`;** `hx-üzerinde` stays the name
193
+ (the profile's `on` word moved to the locative; a suffix is the wrong register for an attribute name).
194
+
195
+ ### Fixed
196
+
197
+ - **`publish.yml`: a repair run skips a version npm is still processing** (`E409 previously staged`)
198
+ instead of failing the whole run.
199
+
10
200
  ## [4.4.0] - 2026-10-10
11
201
 
12
202
  Translations now read as their language. In 4.3.0, 19% of the corpus's translations and 24% of the
@@ -23,8 +213,8 @@ language has a word for. The words are the owner's vocabulary sheet
23
213
  counts, per render, the English grammar words (the tokens the engine's own parser matched in the
24
214
  source), English event names the language's lexicon has a word for, and a nominative `me` beside a
25
215
  marker in the 13 languages where that case is wrong. Two shrink-only baselines (the corpus, in
26
- `test:canonical`, and the command-shape cases, in their shards); `tools/regen-english-leaks-baseline.ts
27
- --report` prints each language against M2's targets. An English alternative a profile keeps for
216
+ `test:canonical`, and the command-shape cases, in their shards);
217
+ `tools/regen-english-leaks-baseline.ts --report` prints each language against M2's targets. An English alternative a profile keeps for
28
218
  code-switched input, beside a primary that is the language's own, counts as English.
29
219
  - **`@lokascript/semantic`: `transition … from … to`** reads and writes in every language (a `source`
30
220
  role), and the bare command reads in English. The schema's `destination` role is gone: upstream has
@@ -41,8 +231,8 @@ language has a word for. The words are the owner's vocabulary sheet
41
231
  back in English as upstream's first person), `does not match`, `fetch … do not throw`, `on first`,
42
232
  `go back`, `from elsewhere`, a loop's `index`, `start view transition`, a query's `in`, a conversion's
43
233
  `as` (the type name stays English), `the X of Y` inside an expression (es `valor de #price`, ja
44
- `#priceの値`), `catch` and `finally`, `element x`, and `def` (as the noun "function", es `función
45
- greet(name)`). bn, th and vi have their own `document` and `window`; he has its own words for all of
234
+ `#priceの値`), `catch` and `finally`, `element x`, and `def` (as the noun "function", es
235
+ `función greet(name)`). bn, th and vi have their own `document` and `window`; he has its own words for all of
46
236
  these and for `matches`, `exists`, `or`, `not`, `first`, `next`, `previous`, `closest`, `empty`, `is`,
47
237
  `document` and `window`; and the 15 languages that wrote English `forever` have their own (es
48
238
  `repetir siempre`, de `endlos`, ja `ずっと`). Every reader still takes the English words. Where a word
@@ -1546,7 +1736,9 @@ _Synchronized version release. See git history for details._
1546
1736
  - npm access token stored in GitHub Secrets
1547
1737
  - 2FA recommended for npm organization
1548
1738
 
1549
- [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v4.4.0...HEAD
1739
+ [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v4.6.0...HEAD
1740
+ [4.6.0]: https://github.com/codetalcott/hyperfixi/compare/v4.5.0...v4.6.0
1741
+ [4.5.0]: https://github.com/codetalcott/hyperfixi/compare/v4.4.0...v4.5.0
1550
1742
  [4.4.0]: https://github.com/codetalcott/hyperfixi/compare/v4.3.0...v4.4.0
1551
1743
  [4.3.0]: https://github.com/codetalcott/hyperfixi/compare/v4.2.0...v4.3.0
1552
1744
  [4.2.0]: https://github.com/codetalcott/hyperfixi/compare/v4.1.0...v4.2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/server-bridge",
3
- "version": "4.4.0",
3
+ "version": "4.6.0",
4
4
  "description": "Extract server route contracts from hyperscript/htmx HTML and generate server-side route scaffolding",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -29,7 +29,7 @@
29
29
  "glob": "^13.0.6"
30
30
  },
31
31
  "devDependencies": {
32
- "@lokascript/domains": "^3.0.1",
32
+ "@lokascript/domains": "^4.0.0",
33
33
  "@types/node": "^26.6.3",
34
34
  "tsup": "^8.0.0",
35
35
  "typescript": "^5.0.0",