@hyperfixi/testing-framework 6.0.0 → 6.1.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
|
@@ -7,6 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.1.0] - 2026-10-18
|
|
11
|
+
|
|
12
|
+
One validator and one translator: MCP `validate_and_compile` accepts the English the engine reads
|
|
13
|
+
and warns `NAME_COLLISION`, and `validate_hyperscript` and `translate_hyperscript` are deprecated for
|
|
14
|
+
7.0. `@hyperfixi/vite-plugin`'s `slavic` and `south-asian` regions load their languages.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`@lokascript/compilation-service`: `validate` warns `NAME_COLLISION`** on foreign input whose
|
|
19
|
+
variable is spelled like a word of its own language (es `si` is also `if`), with the rename
|
|
20
|
+
semantic's finder suggests: the one check MCP `validate_hyperscript` made that `validate_and_compile`
|
|
21
|
+
did not, with its wording and its confidence floor (#1568).
|
|
22
|
+
- **`@lokascript/compilation-service`: a README** (#1570). `files` listed one, but the package had
|
|
23
|
+
none.
|
|
24
|
+
|
|
25
|
+
### Deprecated
|
|
26
|
+
|
|
27
|
+
- **`@hyperfixi/mcp-server`: `validate_hyperscript` and `translate_hyperscript`, removed in 7.0**
|
|
28
|
+
(#1569).
|
|
29
|
+
Measured 2026-10-18 on 6.0.0, through the server:
|
|
30
|
+
- `translate_hyperscript` returns `translate_code`'s text on 471 of 471 pairs, with the same 21
|
|
31
|
+
refusals; `translate_code` adds a fidelity `verification` and `NAME_COLLISION` warnings.
|
|
32
|
+
- On 672 inputs `validate_hyperscript` caught nothing `validate_and_compile` missed, and every
|
|
33
|
+
warning only it gave was a false alarm (a fixed list of 34 event names; an if/end count). Its one
|
|
34
|
+
useful check, `NAME_COLLISION`, is in `validate_and_compile` now.
|
|
35
|
+
|
|
36
|
+
Both still work. Their descriptions start "Deprecated", and each result carries a second text block
|
|
37
|
+
naming the replacement. The skills, the mcp-server README, MIGRATION.md and the LLM-tool checklist
|
|
38
|
+
name only `validate_and_compile` and `translate_code`. The lokascript-multilingual skill had called
|
|
39
|
+
`translate_hyperscript` keyword substitution that does not reorder words, which was not true.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **`@lokascript/compilation-service`: `validate` (MCP `validate_and_compile`) no longer rejects
|
|
44
|
+
English the engine reads.** Of the 1,128 command-shape cases `@hyperfixi/engine` reads, it
|
|
45
|
+
rejected 90:
|
|
46
|
+
- every behavior definition (a `BehaviorNode` keeps its name as a field, and the schema check read
|
|
47
|
+
it as a missing role; this also failed behaviors in every other language);
|
|
48
|
+
- 73 parses under semantic's default confidence bar (`init`, `when`, `def`, `live`, bare `hide`, …);
|
|
49
|
+
- a quoted event name semantic does not read, and `wait for <event>`.
|
|
50
|
+
|
|
51
|
+
For natural-language English the engine's parse now decides `ok`, and semantic's doubts come back
|
|
52
|
+
as warnings that say the IR may leave part of the code out. A request that sets `confidence`
|
|
53
|
+
keeps them as errors, as does foreign input, which runs as semantic's translation. On the agent
|
|
54
|
+
bench every correct rejection was already the engine's (16 of 16), so none moved.
|
|
55
|
+
testing-framework's `validate-agrees-with-engine.test.ts` holds the 1,128 at 0 rejected (#1566).
|
|
56
|
+
|
|
57
|
+
- **`@hyperfixi/vite-plugin`: `region: 'slavic'` and `region: 'south-asian'` load their languages**
|
|
58
|
+
(#1567).
|
|
59
|
+
Both were in the option's type and the README's language list, but the expansion had a
|
|
60
|
+
hand-written case per region and none for these two, so they loaded English alone. Regions now
|
|
61
|
+
expand from `REGIONS` itself, and the README's region table lists both. The debug size table
|
|
62
|
+
(`SEMANTIC_BUNDLE_SIZES`, January 2025) is re-measured by a new
|
|
63
|
+
`scripts/measure-semantic-sizes.ts`: semantic's core plus one language is ~163–175 KB gzipped,
|
|
64
|
+
not the ~14–20 KB it claimed (`all` ~383 KB, not ~61 KB).
|
|
65
|
+
|
|
10
66
|
## [6.0.0] - 2026-10-18
|
|
11
67
|
|
|
12
68
|
Removes `@lokascript/compilation-service`'s test and component generation, deprecated in 5.1.0. For
|
|
@@ -1943,7 +1999,8 @@ _Synchronized version release. See git history for details._
|
|
|
1943
1999
|
- npm access token stored in GitHub Secrets
|
|
1944
2000
|
- 2FA recommended for npm organization
|
|
1945
2001
|
|
|
1946
|
-
[Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v6.
|
|
2002
|
+
[Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v6.1.0...HEAD
|
|
2003
|
+
[6.1.0]: https://github.com/codetalcott/hyperfixi/compare/v6.0.0...v6.1.0
|
|
1947
2004
|
[6.0.0]: https://github.com/codetalcott/hyperfixi/compare/v5.1.0...v6.0.0
|
|
1948
2005
|
[5.1.0]: https://github.com/codetalcott/hyperfixi/compare/v5.0.0...v5.1.0
|
|
1949
2006
|
[5.0.0]: https://github.com/codetalcott/hyperfixi/compare/v4.8.0...v5.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixi/testing-framework",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Cross-platform behavior testing suite for LokaScript applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"author": "LokaScript Contributors",
|
|
58
58
|
"license": "MIT",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@hyperfixi/patterns-reference": "^6.
|
|
61
|
-
"@lokascript/compilation-service": "^6.
|
|
62
|
-
"@lokascript/i18n": "^6.
|
|
63
|
-
"@lokascript/semantic": "^6.
|
|
60
|
+
"@hyperfixi/patterns-reference": "^6.1.0",
|
|
61
|
+
"@lokascript/compilation-service": "^6.1.0",
|
|
62
|
+
"@lokascript/i18n": "^6.1.0",
|
|
63
|
+
"@lokascript/semantic": "^6.1.0",
|
|
64
64
|
"diff": "^8.0.3",
|
|
65
65
|
"esbuild": "^0.25.12",
|
|
66
66
|
"happy-dom": "^20.14.5",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"vite": "^8.3.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@hyperfixi/engine": "^6.
|
|
76
|
-
"@lokascript/hyperscript-adapter": "^6.
|
|
75
|
+
"@hyperfixi/engine": "^6.1.0",
|
|
76
|
+
"@lokascript/hyperscript-adapter": "^6.1.0",
|
|
77
77
|
"@types/diff": "^5.0.0",
|
|
78
78
|
"@types/node": "^26.6.3",
|
|
79
79
|
"@vitest/coverage-v8": "^5.0.0",
|
|
@@ -200,6 +200,29 @@ measured. The three silent rows left are code the engine reads: `toggle .active
|
|
|
200
200
|
(`this` is a variable there, null at run time), and the valid-code-different-intent pair
|
|
201
201
|
(`add .hidden to #menu`, `on mouseover`).
|
|
202
202
|
|
|
203
|
+
### The engine decides English (2026-10-18)
|
|
204
|
+
|
|
205
|
+
C4d added the engine's verdict but kept semantic's gates as errors too, so `validate` rejected
|
|
206
|
+
English the engine reads. On the 1,128 command-shape cases the engine reads, it rejected 90:
|
|
207
|
+
all 15 behavior definitions (the name is a `BehaviorNode` field, which the schema check read as a
|
|
208
|
+
missing role), 73 parses under semantic's default confidence bar (`init`, `when`, `def`,
|
|
209
|
+
`live`, bare `hide`, …), a quoted event name semantic does not read, and `wait for <event>`. On
|
|
210
|
+
this bench every correct rejection was already the engine's.
|
|
211
|
+
|
|
212
|
+
Now a behavior's name is not checked as a role, and for English the engine's parse decides
|
|
213
|
+
`ok`: semantic's doubts are warnings, unless the request sets `confidence`. Foreign input runs as
|
|
214
|
+
semantic's translation, so semantic's gates stay errors there. `validate-agrees-with-engine.test.ts`
|
|
215
|
+
holds the 1,128 at 0 rejected.
|
|
216
|
+
|
|
217
|
+
| | C4d | engine decides English |
|
|
218
|
+
| ------------------------------------- | ----- | ---------------------- |
|
|
219
|
+
| parse (validator says ok) | 20/37 | 21/37 |
|
|
220
|
+
| wrong and **rejected** (loop repairs) | 16/37 | 16/37 |
|
|
221
|
+
| wrong and **silent** | 3/37 | 3/37 |
|
|
222
|
+
|
|
223
|
+
The row that moved is correct code: `on "refresh" put "Refreshed" into #output`. The engine reads
|
|
224
|
+
a quoted event name, semantic does not, so it validates with a warning and no IR.
|
|
225
|
+
|
|
203
226
|
## Adding a task
|
|
204
227
|
|
|
205
228
|
Append to [`tasks.ts`](./tasks.ts): a prompt with no hyperscript in it, a
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CompilationService.validate` (MCP `validate_and_compile`) rejects no English the engine reads.
|
|
3
|
+
*
|
|
4
|
+
* Its `ok` is what an agent's repair loop acts on, so a false error sends the agent to "fix"
|
|
5
|
+
* code that runs. Measured 2026-10-18 on 6.0.0: of the 1,128 command-shape cases the engine
|
|
6
|
+
* reads (upstream's own tests and core's reference examples), validate rejected 90: all 15
|
|
7
|
+
* behavior definitions (the name is a BehaviorNode field, which the schema check read as a
|
|
8
|
+
* missing role), 73 parses under semantic's default confidence bar (`init`, `when`, `def`,
|
|
9
|
+
* `live`, bare `hide`, …), a quoted event name semantic does not read, and `wait for <event>`.
|
|
10
|
+
* For English the engine's parse now decides, and semantic's doubts are warnings. The bench's
|
|
11
|
+
* 16 rejected phrasings were all the engine's (ENGINE_PARSE_ERROR), so none of them moved.
|
|
12
|
+
*
|
|
13
|
+
* @vitest-environment node
|
|
14
|
+
* As agent-bench.test.ts: the engine registers against this environment's globals.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, it, expect, beforeAll } from 'vitest';
|
|
18
|
+
import { readFileSync } from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
|
|
22
|
+
const CASES_PATH = path.resolve(
|
|
23
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
24
|
+
'../multilingual/command-shapes.cases.json'
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
interface Case {
|
|
28
|
+
id: string;
|
|
29
|
+
source: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('validate agrees with the engine on English it reads', () => {
|
|
33
|
+
let validate: (code: string) => { ok: boolean };
|
|
34
|
+
let engineReads: (code: string) => boolean;
|
|
35
|
+
|
|
36
|
+
beforeAll(async () => {
|
|
37
|
+
const { CompilationService } = await import('@lokascript/compilation-service');
|
|
38
|
+
const service = await CompilationService.create();
|
|
39
|
+
validate = code => service.validate({ code, language: 'en' });
|
|
40
|
+
const engine = await import('@hyperfixi/engine');
|
|
41
|
+
engine.register(...engine.everything);
|
|
42
|
+
engineReads = code => {
|
|
43
|
+
try {
|
|
44
|
+
return engine.api.parse(code).errors.length === 0;
|
|
45
|
+
} catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}, 60_000);
|
|
50
|
+
|
|
51
|
+
it('rejects none of the command-shape cases the engine reads', () => {
|
|
52
|
+
const cases = (JSON.parse(readFileSync(CASES_PATH, 'utf8')) as { cases: Case[] }).cases;
|
|
53
|
+
const readable = cases.filter(c => engineReads(c.source));
|
|
54
|
+
// A harvest that lost most of its cases would make this vacuous.
|
|
55
|
+
expect(readable.length).toBeGreaterThan(1000);
|
|
56
|
+
const rejected = readable
|
|
57
|
+
.filter(c => !validate(c.source).ok)
|
|
58
|
+
.map(c => `${c.id} ${JSON.stringify(c.source.slice(0, 70))}`);
|
|
59
|
+
expect(rejected).toEqual([]);
|
|
60
|
+
});
|
|
61
|
+
});
|