@niwa-labs/harness-mcode 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +2 -2
- package/package.json +17 -4
- package/src/index.ts +13 -0
- package/src/mcode/control.ts +1840 -0
- package/src/mcode/durable.ts +445 -0
- package/src/mcode/fixtures.ts +93 -0
- package/src/mcode/format.ts +177 -0
- package/src/mcode/index.ts +50 -0
- package/src/mcode/kind.ts +147 -0
- package/src/mcode/ledger.ts +199 -0
- package/src/mcode/paths.ts +80 -0
- package/src/mcode/protocol.ts +91 -0
- package/src/mcode/reading.ts +1153 -0
- package/src/mcode/reverse.ts +201 -0
- package/src/mcode/skills.ts +6 -0
- package/src/mcode/titles.ts +51 -0
- package/src/mcode/tools.ts +56 -0
- package/src/mcode/transport.ts +31 -0
- package/src/ncode/index.ts +34 -0
- package/src/ncode/launcher.ts +33 -0
- package/src/ncode/protocol.ts +146 -0
- package/src/ncode/skills.ts +6 -0
- package/test/live/ncode-permission.test.ts +82 -0
- package/test/mcode-conformance.test.ts +52 -0
- package/test/mcode-control.test.ts +1616 -0
- package/test/mcode-durable.test.ts +722 -0
- package/test/mcode-ledger.test.ts +357 -0
- package/test/mcode-reading.test.ts +286 -0
- package/test/mcode-transport.test.ts +48 -0
- package/test/profile.test.ts +89 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// The MiniMax Code reading side passes the conformance suite on its own fixtures.
|
|
2
|
+
|
|
3
|
+
import { expect, test } from "bun:test";
|
|
4
|
+
|
|
5
|
+
import { machineId, readingConformance } from "@niwa-labs/harness";
|
|
6
|
+
import type { Harness } from "@niwa-labs/harness";
|
|
7
|
+
|
|
8
|
+
import { FIXTURE_HARNESS, writeMcodeFixtures } from "../src/mcode/fixtures.ts";
|
|
9
|
+
import { McodeReading } from "../src/mcode/reading.ts";
|
|
10
|
+
import { ncodeKind } from "../src/ncode/index.ts";
|
|
11
|
+
|
|
12
|
+
test("H1 H3 H8 H10 mcode passes the reading conformance suite", async () => {
|
|
13
|
+
const report = await readingConformance(
|
|
14
|
+
"mcode",
|
|
15
|
+
(home) => {
|
|
16
|
+
const instance: Harness = {
|
|
17
|
+
id: FIXTURE_HARNESS,
|
|
18
|
+
kind: "mcode" as never,
|
|
19
|
+
machine: "machine-1" as never,
|
|
20
|
+
home,
|
|
21
|
+
sides: { reading: { list: true, read: true, watch: false } },
|
|
22
|
+
};
|
|
23
|
+
return { instance, reading: new McodeReading({ harness: FIXTURE_HARNESS, home }) };
|
|
24
|
+
},
|
|
25
|
+
writeMcodeFixtures,
|
|
26
|
+
)();
|
|
27
|
+
const failed = report.results.filter((result) => !result.passed);
|
|
28
|
+
expect(failed.map((result) => `${result.name}: ${result.detail ?? ""}`)).toEqual([]);
|
|
29
|
+
expect(report.results.length).toBeGreaterThan(40);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("H1 H3 H8 H10 the ncode kind reads the same store: its reading side passes the same suite", async () => {
|
|
33
|
+
const report = await readingConformance(
|
|
34
|
+
"ncode",
|
|
35
|
+
(home) => {
|
|
36
|
+
const kind = ncodeKind.bind({ id: FIXTURE_HARNESS, home });
|
|
37
|
+
const instance: Harness = {
|
|
38
|
+
id: FIXTURE_HARNESS,
|
|
39
|
+
kind: kind.instance.kind,
|
|
40
|
+
machine: machineId("machine-1"),
|
|
41
|
+
home,
|
|
42
|
+
sides: { reading: { list: true, read: true, watch: false } },
|
|
43
|
+
};
|
|
44
|
+
if (kind.reading === undefined) throw new Error("the kind has no reading side");
|
|
45
|
+
return { instance, reading: kind.reading };
|
|
46
|
+
},
|
|
47
|
+
writeMcodeFixtures,
|
|
48
|
+
)();
|
|
49
|
+
const failed = report.results.filter((result) => !result.passed);
|
|
50
|
+
expect(failed.map((result) => `${result.name}: ${result.detail ?? ""}`)).toEqual([]);
|
|
51
|
+
expect(report.results.length).toBeGreaterThan(40);
|
|
52
|
+
});
|