@xema/omni-protocol 0.1.57 → 0.1.58
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/dist/testing.js +11 -0
- package/guide.md +12 -3
- package/package.json +1 -1
package/dist/testing.js
CHANGED
|
@@ -784,6 +784,17 @@ export class TaskStream {
|
|
|
784
784
|
const known = id === undefined ? undefined : this.tasks.get(id);
|
|
785
785
|
switch (event.type) {
|
|
786
786
|
case "snapshot":
|
|
787
|
+
// A snapshot replaces what is known, and still may not say a task lost terms it had read.
|
|
788
|
+
if (isRecord(event.snapshot) && Array.isArray(event.snapshot.tasks)) {
|
|
789
|
+
event.snapshot.tasks.forEach((task, index) => {
|
|
790
|
+
if (!isRecord(task) || typeof task.id !== "string")
|
|
791
|
+
return;
|
|
792
|
+
const was = this.tasks.get(task.id);
|
|
793
|
+
if (was !== undefined && (was.source === "queue" || was.source === "ungoverned") && task.capabilitySource === "undetermined") {
|
|
794
|
+
refuse("stream.snapshot.capabilitySource", `${at}.snapshot.tasks[${index}].capabilitySource`, `${task.id} was published under ${was.source} terms and the snapshot says undetermined: terms once read stay read`);
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
}
|
|
787
798
|
this.seed(event.snapshot);
|
|
788
799
|
break;
|
|
789
800
|
case "task-offered":
|
package/guide.md
CHANGED
|
@@ -2728,7 +2728,8 @@ the terms arrive, the task is republished under `queue` with the set as it now s
|
|
|
2728
2728
|
republish as any other permission that changed while the task was open. The move goes one way.
|
|
2729
2729
|
Terms once read stay read: a re-read that fails mid-task is not a new fact about the task, so the
|
|
2730
2730
|
last statement stands and the failure is a `diagnostic`, and a task that was published under
|
|
2731
|
-
`queue` or `ungoverned` never returns to `undetermined
|
|
2731
|
+
`queue` or `ungoverned` never returns to `undetermined`, on an update (`stream.taskUpdated.capabilitySource`)
|
|
2732
|
+
or on a resync snapshot (`stream.snapshot.capabilitySource`).
|
|
2732
2733
|
|
|
2733
2734
|
What the agent is told differs by source, and only one source tells them anything. Under `queue`
|
|
2734
2735
|
and `ungoverned` the agent sees controls and nothing about where they came from: both are facts,
|
|
@@ -2736,8 +2737,16 @@ and an agent working a call has no use for the name of the rule behind its butto
|
|
|
2736
2737
|
`undetermined` the agent is told, beside the controls, that these are what the provider will honour
|
|
2737
2738
|
until the queue's terms arrive, and that the controls may change when they do -- a statement about
|
|
2738
2739
|
the buttons in front of them now, not about the provider, because that is what changes when the
|
|
2739
|
-
republish lands.
|
|
2740
|
-
|
|
2740
|
+
republish lands. It stays for as long as the set is provisional, beside the controls it qualifies;
|
|
2741
|
+
a message that shows and clears has said nothing about the buttons still on the screen. The two
|
|
2742
|
+
words are close in English and far apart on the desk: `ungoverned` is silence, `undetermined` is a
|
|
2743
|
+
standing notice.
|
|
2744
|
+
|
|
2745
|
+
One consequence for whoever builds the host: because a conformance run fails on `undetermined`, a
|
|
2746
|
+
conformant adapter never shows a host `undetermined` under test, and a clean `exerciseAdapter`
|
|
2747
|
+
result says nothing about how the host renders it. That rendering is tested against a fixture --
|
|
2748
|
+
a task published under `undetermined` shows the notice, the same task under `queue` shows none --
|
|
2749
|
+
and never against an adapter, even in principle. `exerciseAdapter` treats a
|
|
2741
2750
|
task published under `undetermined` as a violation (`capabilitySource.undetermined`), as it treats
|
|
2742
2751
|
a diagnostic: a conformance run against a platform that cannot say what it permits fails loudly
|
|
2743
2752
|
rather than passing with a note.
|