@termwright/conformance 0.3.1 → 0.4.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/README.md +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/fixtures/adversarial-peer.mjs +12 -12
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ It checks the five obligations an adapter has:
|
|
|
107
107
|
| Dormant rule | Without `TERMWRIGHT_ENDPOINT` it opens no channel and writes no marker; with `baseline`, byte-for-byte identical startup output |
|
|
108
108
|
| Tree before input | Once the handshake completes and _before any input_, the tree is non-empty and has at least one node a locator could address. Opt out with `treeBeforeInput: {required: false, reason}` |
|
|
109
109
|
| Handshake | `hello` first and once, correct protocol id, non-empty adapter identity, capabilities from the closed set |
|
|
110
|
-
|
|
|
110
|
+
| Semantic validity | Every publication is a v3 full tree or an atomic revision-based delta that reconstructs a state accepted by `validateSnapshot`, carries this session's id, has resolvable parents and monotonic revisions |
|
|
111
111
|
| Revision ordering | For each revision: snapshot → `revision-commit` → a marker that verifies against the session token, markers strictly increasing |
|
|
112
112
|
| Channel loss | Cutting the socket leaves the application rendering and alive, and the adapter does not reconnect |
|
|
113
113
|
| Logs | An adapter that did not announce `logs` sends none. One that declares them in the registration must deliver a record whose `seq` is unique and increasing and whose message never appears on the terminal |
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var certified_instrumentation_default = {
|
|
|
54
54
|
var BUILTIN_PROFILES = certified_instrumentation_default.profiles;
|
|
55
55
|
var INK_VERSION = BUILTIN_PROFILES.at(-1)?.version ?? "unsupported";
|
|
56
56
|
|
|
57
|
-
// ../probe-ink/dist/chunk-
|
|
57
|
+
// ../probe-ink/dist/chunk-6QJVIERP.js
|
|
58
58
|
import { validateProbeAnnotations } from "@termwright/protocol";
|
|
59
59
|
|
|
60
60
|
// ../pty/dist/index.js
|
|
@@ -988,7 +988,7 @@ ${this.#adapterAccount()}`;
|
|
|
988
988
|
protocol: PROTOCOL_ID,
|
|
989
989
|
sessionId: this.sessionId,
|
|
990
990
|
limits: DEFAULT_LIMITS2,
|
|
991
|
-
subscribe: "
|
|
991
|
+
subscribe: "semantic",
|
|
992
992
|
marker: { enabled: parsed.message.capabilities.includes("render-revisions") },
|
|
993
993
|
// Granted only to an adapter that asked: an adapter that never announced
|
|
994
994
|
// `logs` must not be handed a budget it can then claim it was given.
|
|
@@ -1102,7 +1102,7 @@ var CONTAINER_ROLES = /* @__PURE__ */ new Set([
|
|
|
1102
1102
|
"application",
|
|
1103
1103
|
"menu"
|
|
1104
1104
|
]);
|
|
1105
|
-
var snapshotsOf = (observation) => observation.messages.filter((entry) => entry.message.type === "
|
|
1105
|
+
var snapshotsOf = (observation) => observation.messages.filter((entry) => entry.message.type === "semantic-full").map((entry) => entry.message.snapshot);
|
|
1106
1106
|
async function runAdapterConformance(options) {
|
|
1107
1107
|
const { afterAll, afterEach, beforeEach, describe, expect } = await import("vitest");
|
|
1108
1108
|
const { it: resourceAwareIt } = await import("@termwright/resource-broker/vitest");
|
|
@@ -1230,7 +1230,7 @@ async function runAdapterConformance(options) {
|
|
|
1230
1230
|
for (const snapshot of snapshots) {
|
|
1231
1231
|
expect(validateSnapshot(snapshot, DEFAULT_LIMITS3)).toMatchObject({ ok: true });
|
|
1232
1232
|
expect(snapshot.sessionId).toBe(probe.sessionId);
|
|
1233
|
-
expect(snapshot.v).toBe(
|
|
1233
|
+
expect(snapshot.v).toBe(3);
|
|
1234
1234
|
const ids = new Set(snapshot.nodes.map((node) => node.id));
|
|
1235
1235
|
for (const node of snapshot.nodes) {
|
|
1236
1236
|
if (node.parentId === void 0) expect(snapshot.rootIds).toContain(node.id);
|
|
@@ -1269,7 +1269,7 @@ async function runAdapterConformance(options) {
|
|
|
1269
1269
|
);
|
|
1270
1270
|
const complete = (observation2) => observation2.markers.every(
|
|
1271
1271
|
(marker) => observation2.messages.some(
|
|
1272
|
-
(entry) => entry.message.type === "
|
|
1272
|
+
(entry) => entry.message.type === "semantic-full" && entry.message.snapshot.revision === marker.revision
|
|
1273
1273
|
) && observation2.messages.some(
|
|
1274
1274
|
(entry) => entry.message.type === "revision-commit" && entry.message.revision === marker.revision
|
|
1275
1275
|
)
|
|
@@ -1283,7 +1283,7 @@ async function runAdapterConformance(options) {
|
|
|
1283
1283
|
);
|
|
1284
1284
|
for (const marker of markers) {
|
|
1285
1285
|
const snapshot = observation.messages.find(
|
|
1286
|
-
(entry) => entry.message.type === "
|
|
1286
|
+
(entry) => entry.message.type === "semantic-full" && entry.message.snapshot.revision === marker.revision
|
|
1287
1287
|
);
|
|
1288
1288
|
const commit = observation.messages.find(
|
|
1289
1289
|
(entry) => entry.message.type === "revision-commit" && entry.message.revision === marker.revision
|