@polycode-projects/the-mechanical-code-talker 5.0.27 → 5.0.29
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/corpus/worlds/index.json.gz +0 -0
- package/corpus/worlds/manifest.json +27 -17
- package/corpus/worlds/shards/river-crossing.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square-chapel.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square-market.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square.jsonl.gz +0 -0
- package/corpus/worlds/src/river-crossing.jsonl +29 -0
- package/corpus/worlds/src/town-square-chapel.jsonl +12 -8
- package/corpus/worlds/src/town-square-market.jsonl +12 -8
- package/corpus/worlds/src/town-square.jsonl +12 -8
- package/package.json +2 -2
- package/src/adapters/memory/inspect.mjs +37 -0
- package/src/domain/agent-belief.mjs +33 -11
- package/src/domain/agent-traits.mjs +282 -0
- package/src/domain/choice-question.mjs +259 -6
- package/src/domain/el-classify.mjs +55 -7
- package/src/domain/fact-phrase.mjs +7 -4
- package/src/domain/grammar/ace.mjs +66 -3
- package/src/domain/interpret/normalize.mjs +58 -2
- package/src/domain/tableau.mjs +101 -14
- package/src/domain/town-square-world.mjs +44 -19
- package/src/services/adventure.mjs +5 -16
- package/src/services/agent-editor.mjs +216 -0
- package/src/services/chat-session.mjs +26 -5
- package/src/services/chat.mjs +118 -58
- package/src/services/mudiii-scene.mjs +32 -5
- package/src/services/mudiii-turn.mjs +120 -5
- package/src/services/mudiii-viz.mjs +299 -1
- package/src/services/predator-prey.mjs +234 -57
- package/src/surfaces/web/chat-browser-entry.mjs +69 -3
- package/src/surfaces/web/memory-ask-browser.bundle.js +155 -155
- package/src/surfaces/web/mudiii-browser-entry.mjs +48 -2
- package/src/surfaces/web/planner-instances.mjs +64 -3
- package/src/surfaces/web/turn-session.mjs +13 -9
|
Binary file
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"generated": "by scripts/build-worlds-pack.mjs from corpus/worlds/src/",
|
|
4
4
|
"counts": {
|
|
5
|
-
"worlds":
|
|
6
|
-
"facts":
|
|
7
|
-
"rules":
|
|
5
|
+
"worlds": 11,
|
|
6
|
+
"facts": 3074,
|
|
7
|
+
"rules": 126
|
|
8
8
|
},
|
|
9
9
|
"budgets": {
|
|
10
10
|
"sourceBytesPerWorld": 131072,
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"bytes": 14345,
|
|
43
43
|
"sha256": "338f8c63ae94e62f9c4fa06e090569b248c3afdd404d3034fc43c8e0dc9d9e39"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"file": "src/river-crossing.jsonl",
|
|
47
|
+
"bytes": 3372,
|
|
48
|
+
"sha256": "18ead49c79ff3bc71901bcd00356eaf34aba8a0e36a49df00a4aefd0fa3ca591"
|
|
49
|
+
},
|
|
45
50
|
{
|
|
46
51
|
"file": "src/spider-fly.jsonl",
|
|
47
52
|
"bytes": 53690,
|
|
@@ -49,25 +54,25 @@
|
|
|
49
54
|
},
|
|
50
55
|
{
|
|
51
56
|
"file": "src/town-square-chapel.jsonl",
|
|
52
|
-
"bytes":
|
|
53
|
-
"sha256": "
|
|
57
|
+
"bytes": 108706,
|
|
58
|
+
"sha256": "2c65f103a617c05eb16646ed684632c82b7c525f4ec0589289637b18d7f7b94e"
|
|
54
59
|
},
|
|
55
60
|
{
|
|
56
61
|
"file": "src/town-square-market.jsonl",
|
|
57
|
-
"bytes":
|
|
58
|
-
"sha256": "
|
|
62
|
+
"bytes": 52609,
|
|
63
|
+
"sha256": "791221ace6d03a1cad15c484f6044591716ceabcfbf1936119a2a1aa6297dff8"
|
|
59
64
|
},
|
|
60
65
|
{
|
|
61
66
|
"file": "src/town-square.jsonl",
|
|
62
|
-
"bytes":
|
|
63
|
-
"sha256": "
|
|
67
|
+
"bytes": 75521,
|
|
68
|
+
"sha256": "7a7f87386495285fc0e39f14f10253044f4c5181f7b4fa501a1c88810184950d"
|
|
64
69
|
}
|
|
65
70
|
],
|
|
66
71
|
"files": [
|
|
67
72
|
{
|
|
68
73
|
"file": "index.json.gz",
|
|
69
|
-
"bytes":
|
|
70
|
-
"sha256": "
|
|
74
|
+
"bytes": 173,
|
|
75
|
+
"sha256": "75197e925a6689be361143c3e26523645898b4fcea37c48a3e628f0bc1968ecb"
|
|
71
76
|
},
|
|
72
77
|
{
|
|
73
78
|
"file": "shards/ashcombe-hall.jsonl.gz",
|
|
@@ -99,6 +104,11 @@
|
|
|
99
104
|
"bytes": 1421,
|
|
100
105
|
"sha256": "548d4393a2f73a0202935db7a8d3e4e292406deadff791d0dc111bf3ce591aaa"
|
|
101
106
|
},
|
|
107
|
+
{
|
|
108
|
+
"file": "shards/river-crossing.jsonl.gz",
|
|
109
|
+
"bytes": 496,
|
|
110
|
+
"sha256": "2899d7ad90cb806ad4392be053ed22cf8a5c7eb69d93d947f8d63806abfe5e7d"
|
|
111
|
+
},
|
|
102
112
|
{
|
|
103
113
|
"file": "shards/spider-fly.jsonl.gz",
|
|
104
114
|
"bytes": 3148,
|
|
@@ -106,18 +116,18 @@
|
|
|
106
116
|
},
|
|
107
117
|
{
|
|
108
118
|
"file": "shards/town-square-chapel.jsonl.gz",
|
|
109
|
-
"bytes":
|
|
110
|
-
"sha256": "
|
|
119
|
+
"bytes": 5580,
|
|
120
|
+
"sha256": "46fd19d56e6d6fb64d8b37753b102f7f1dcab41c8729252c8b31cf9df0dc9007"
|
|
111
121
|
},
|
|
112
122
|
{
|
|
113
123
|
"file": "shards/town-square-market.jsonl.gz",
|
|
114
|
-
"bytes":
|
|
115
|
-
"sha256": "
|
|
124
|
+
"bytes": 3154,
|
|
125
|
+
"sha256": "80210037ca9efa40819ee7f76d5c372e60c02bb9a6775fa96eec49391385c80c"
|
|
116
126
|
},
|
|
117
127
|
{
|
|
118
128
|
"file": "shards/town-square.jsonl.gz",
|
|
119
|
-
"bytes":
|
|
120
|
-
"sha256": "
|
|
129
|
+
"bytes": 4319,
|
|
130
|
+
"sha256": "7512ee0418af4bd46d4c005bd8447f56784dc277c9f46b9fe149e967f3eb39c0"
|
|
121
131
|
}
|
|
122
132
|
]
|
|
123
133
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{"world":"river-crossing","kind":"meta","opening":"a farmer stands on the east bank with a fox, a goat and a cabbage. Ferry them all to the west bank — never leave the fox alone with the goat, or the goat alone with the cabbage."}
|
|
2
|
+
{"world":"river-crossing","kind":"fact","subject":"bank-east","predicate":"rdf:type","object":"bank"}
|
|
3
|
+
{"world":"river-crossing","kind":"fact","subject":"bank-west","predicate":"rdf:type","object":"bank"}
|
|
4
|
+
{"world":"river-crossing","kind":"fact","subject":"fox","predicate":"mgx:display-name","object":"fox"}
|
|
5
|
+
{"world":"river-crossing","kind":"fact","subject":"fox","predicate":"mgx:model","object":"fox"}
|
|
6
|
+
{"world":"river-crossing","kind":"fact","subject":"fox","predicate":"mgx:consumes","object":"goat"}
|
|
7
|
+
{"world":"river-crossing","kind":"fact","subject":"goat","predicate":"mgx:display-name","object":"goat"}
|
|
8
|
+
{"world":"river-crossing","kind":"fact","subject":"goat","predicate":"mgx:consumes","object":"cabbage"}
|
|
9
|
+
{"world":"river-crossing","kind":"fact","subject":"goat","predicate":"mgx:evades","object":"fox"}
|
|
10
|
+
{"world":"river-crossing","kind":"fact","subject":"cabbage","predicate":"mgx:display-name","object":"cabbage"}
|
|
11
|
+
{"world":"river-crossing","kind":"fact","subject":"cabbage","predicate":"mgx:evades","object":"goat"}
|
|
12
|
+
{"world":"river-crossing","kind":"fact","subject":"farmer","predicate":"mgx:display-name","object":"farmer"}
|
|
13
|
+
{"world":"river-crossing","kind":"fact","subject":"farmer","predicate":"mgx:guards","object":"fox"}
|
|
14
|
+
{"world":"river-crossing","kind":"fact","subject":"farmer","predicate":"mgx:guards","object":"goat"}
|
|
15
|
+
{"world":"river-crossing","kind":"fact","subject":"fox-1","predicate":"rdf:type","object":"fox"}
|
|
16
|
+
{"world":"river-crossing","kind":"fact","subject":"fox-1","predicate":"rdf:type","object":"passenger"}
|
|
17
|
+
{"world":"river-crossing","kind":"fact","subject":"fox-1","predicate":"mgx:currently-in","object":"bank-east"}
|
|
18
|
+
{"world":"river-crossing","kind":"fact","subject":"goat-1","predicate":"rdf:type","object":"goat"}
|
|
19
|
+
{"world":"river-crossing","kind":"fact","subject":"goat-1","predicate":"rdf:type","object":"passenger"}
|
|
20
|
+
{"world":"river-crossing","kind":"fact","subject":"goat-1","predicate":"mgx:currently-in","object":"bank-east"}
|
|
21
|
+
{"world":"river-crossing","kind":"fact","subject":"cabbage-1","predicate":"rdf:type","object":"cabbage"}
|
|
22
|
+
{"world":"river-crossing","kind":"fact","subject":"cabbage-1","predicate":"rdf:type","object":"passenger"}
|
|
23
|
+
{"world":"river-crossing","kind":"fact","subject":"cabbage-1","predicate":"mgx:currently-in","object":"bank-east"}
|
|
24
|
+
{"world":"river-crossing","kind":"fact","subject":"farmer-1","predicate":"rdf:type","object":"farmer"}
|
|
25
|
+
{"world":"river-crossing","kind":"fact","subject":"farmer-1","predicate":"mgx:currently-in","object":"bank-east"}
|
|
26
|
+
{"world":"river-crossing","kind":"rule","name":"ferry onto","ruleKind":"action-signature","slots":{"subjectClass":"passenger","targetClass":"bank"}}
|
|
27
|
+
{"world":"river-crossing","kind":"rule","name":"ferry onto","ruleKind":"action-signature","slots":{"subjectClass":"farmer","targetClass":"bank"}}
|
|
28
|
+
{"world":"river-crossing","kind":"rule","name":"ferry onto","ruleKind":"action-effect","slots":{"predicate":"currently-in","subjectRole":"subject","objectRole":"target"}}
|
|
29
|
+
{"world":"river-crossing","kind":"rule","name":"ferry onto","ruleKind":"action-effect","slots":{"predicate":"currently-in","subjectRole":"farmer","objectRole":"target"}}
|
|
@@ -912,18 +912,22 @@
|
|
|
912
912
|
{"world":"town-square-chapel","kind":"fact","subject":"square","predicate":"mgx:start-with","object":"2 foxs and 2 goblins by default"}
|
|
913
913
|
{"world":"town-square-chapel","kind":"fact","subject":"square","predicate":"mgx:hasA","object":"limit of 6 goblins and 8 food items at once by default"}
|
|
914
914
|
{"world":"town-square-chapel","kind":"fact","subject":"prop","predicate":"mgx:cover","object":"one cell each, which nothing can walk into"}
|
|
915
|
-
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:
|
|
916
|
-
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:
|
|
917
|
-
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:
|
|
918
|
-
{"world":"town-square-chapel","kind":"fact","subject":"
|
|
919
|
-
{"world":"town-square-chapel","kind":"fact","subject":"
|
|
920
|
-
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:
|
|
915
|
+
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:vision-radius","object":"4"}
|
|
916
|
+
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:hasMass","object":"20"}
|
|
917
|
+
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:mass-drain-per-turn","object":"0.08"}
|
|
918
|
+
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:pursues","object":"goblin"}
|
|
919
|
+
{"world":"town-square-chapel","kind":"fact","subject":"fox","predicate":"mgx:consumes","object":"goblin"}
|
|
920
|
+
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:vision-radius","object":"3"}
|
|
921
|
+
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:hasMass","object":"8"}
|
|
922
|
+
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:mass-drain-per-turn","object":"0.06"}
|
|
923
|
+
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"crumb"}
|
|
924
|
+
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"morsel"}
|
|
921
925
|
{"world":"town-square-chapel","kind":"fact","subject":"goblin","predicate":"mgx:arrive","object":"every 5 turns at the edge of the board by default"}
|
|
922
926
|
{"world":"town-square-chapel","kind":"fact","subject":"crumb","predicate":"mgx:arrive","object":"every 3 turns on any open cell by default"}
|
|
923
927
|
{"world":"town-square-chapel","kind":"fact","subject":"crumb","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
924
928
|
{"world":"town-square-chapel","kind":"fact","subject":"morsel","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
925
929
|
{"world":"town-square-chapel","kind":"fact","subject":"morsel","predicate":"mgx:arrive","object":"where the player puts it"}
|
|
926
|
-
{"world":"town-square-chapel","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox
|
|
927
|
-
{"world":"town-square-chapel","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin
|
|
930
|
+
{"world":"town-square-chapel","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox"}
|
|
931
|
+
{"world":"town-square-chapel","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin"}
|
|
928
932
|
{"world":"town-square-chapel","kind":"rule","name":"go","ruleKind":"action-signature","slots":{"subjectClass":"animal","targetClass":"cell"}}
|
|
929
933
|
{"world":"town-square-chapel","kind":"rule","name":"go","ruleKind":"action-effect","slots":{"predicate":"currently-in","subjectRole":"subject","objectRole":"target"}}
|
|
@@ -438,18 +438,22 @@
|
|
|
438
438
|
{"world":"town-square-market","kind":"fact","subject":"square","predicate":"mgx:start-with","object":"1 fox and 4 goblins by default"}
|
|
439
439
|
{"world":"town-square-market","kind":"fact","subject":"square","predicate":"mgx:hasA","object":"limit of 6 goblins and 8 food items at once by default"}
|
|
440
440
|
{"world":"town-square-market","kind":"fact","subject":"prop","predicate":"mgx:cover","object":"one cell each, which nothing can walk into"}
|
|
441
|
-
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:
|
|
442
|
-
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:
|
|
443
|
-
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:
|
|
444
|
-
{"world":"town-square-market","kind":"fact","subject":"
|
|
445
|
-
{"world":"town-square-market","kind":"fact","subject":"
|
|
446
|
-
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:
|
|
441
|
+
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:vision-radius","object":"4"}
|
|
442
|
+
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:hasMass","object":"20"}
|
|
443
|
+
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:mass-drain-per-turn","object":"0.08"}
|
|
444
|
+
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:pursues","object":"goblin"}
|
|
445
|
+
{"world":"town-square-market","kind":"fact","subject":"fox","predicate":"mgx:consumes","object":"goblin"}
|
|
446
|
+
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:vision-radius","object":"3"}
|
|
447
|
+
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:hasMass","object":"8"}
|
|
448
|
+
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:mass-drain-per-turn","object":"0.06"}
|
|
449
|
+
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"crumb"}
|
|
450
|
+
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"morsel"}
|
|
447
451
|
{"world":"town-square-market","kind":"fact","subject":"goblin","predicate":"mgx:arrive","object":"every 5 turns at the edge of the board by default"}
|
|
448
452
|
{"world":"town-square-market","kind":"fact","subject":"crumb","predicate":"mgx:arrive","object":"every 3 turns on any open cell by default"}
|
|
449
453
|
{"world":"town-square-market","kind":"fact","subject":"crumb","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
450
454
|
{"world":"town-square-market","kind":"fact","subject":"morsel","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
451
455
|
{"world":"town-square-market","kind":"fact","subject":"morsel","predicate":"mgx:arrive","object":"where the player puts it"}
|
|
452
|
-
{"world":"town-square-market","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox
|
|
453
|
-
{"world":"town-square-market","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin
|
|
456
|
+
{"world":"town-square-market","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox"}
|
|
457
|
+
{"world":"town-square-market","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin"}
|
|
454
458
|
{"world":"town-square-market","kind":"rule","name":"go","ruleKind":"action-signature","slots":{"subjectClass":"animal","targetClass":"cell"}}
|
|
455
459
|
{"world":"town-square-market","kind":"rule","name":"go","ruleKind":"action-effect","slots":{"predicate":"currently-in","subjectRole":"subject","objectRole":"target"}}
|
|
@@ -670,18 +670,22 @@
|
|
|
670
670
|
{"world":"town-square","kind":"fact","subject":"square","predicate":"mgx:start-with","object":"1 fox and 3 goblins by default"}
|
|
671
671
|
{"world":"town-square","kind":"fact","subject":"square","predicate":"mgx:hasA","object":"limit of 6 goblins and 8 food items at once by default"}
|
|
672
672
|
{"world":"town-square","kind":"fact","subject":"prop","predicate":"mgx:cover","object":"one cell each, which nothing can walk into"}
|
|
673
|
-
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:
|
|
674
|
-
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:
|
|
675
|
-
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:
|
|
676
|
-
{"world":"town-square","kind":"fact","subject":"
|
|
677
|
-
{"world":"town-square","kind":"fact","subject":"
|
|
678
|
-
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:
|
|
673
|
+
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:vision-radius","object":"4"}
|
|
674
|
+
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:hasMass","object":"20"}
|
|
675
|
+
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:mass-drain-per-turn","object":"0.08"}
|
|
676
|
+
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:pursues","object":"goblin"}
|
|
677
|
+
{"world":"town-square","kind":"fact","subject":"fox","predicate":"mgx:consumes","object":"goblin"}
|
|
678
|
+
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:vision-radius","object":"3"}
|
|
679
|
+
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:hasMass","object":"8"}
|
|
680
|
+
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:mass-drain-per-turn","object":"0.06"}
|
|
681
|
+
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"crumb"}
|
|
682
|
+
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:consumes","object":"morsel"}
|
|
679
683
|
{"world":"town-square","kind":"fact","subject":"goblin","predicate":"mgx:arrive","object":"every 5 turns at the edge of the board by default"}
|
|
680
684
|
{"world":"town-square","kind":"fact","subject":"crumb","predicate":"mgx:arrive","object":"every 3 turns on any open cell by default"}
|
|
681
685
|
{"world":"town-square","kind":"fact","subject":"crumb","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
682
686
|
{"world":"town-square","kind":"fact","subject":"morsel","predicate":"mgx:start-with","object":"mass 2 by default"}
|
|
683
687
|
{"world":"town-square","kind":"fact","subject":"morsel","predicate":"mgx:arrive","object":"where the player puts it"}
|
|
684
|
-
{"world":"town-square","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox
|
|
685
|
-
{"world":"town-square","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin
|
|
688
|
+
{"world":"town-square","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"4 cells for the fox"}
|
|
689
|
+
{"world":"town-square","kind":"fact","subject":"vision radius","predicate":"mgx:hasProperty","object":"3 cells for the goblin"}
|
|
686
690
|
{"world":"town-square","kind":"rule","name":"go","ruleKind":"action-signature","slots":{"subjectClass":"animal","targetClass":"cell"}}
|
|
687
691
|
{"world":"town-square","kind":"rule","name":"go","ruleKind":"action-effect","slots":{"predicate":"currently-in","subjectRole":"subject","objectRole":"target"}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polycode-projects/the-mechanical-code-talker",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.29",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The Mechanical Code Talker (tmct) — a tolerant, offline, $0 chat surface that guides you toward precision queries about a software repository. ELIZA/PARRY-style but domain-obsessed with code. No model calls; indexes a repo on request (tmct index) or reads any producer's graph.",
|
|
@@ -162,9 +162,9 @@
|
|
|
162
162
|
"bench:receipts": "node scripts/bench-receipts.mjs",
|
|
163
163
|
"claims": "node scripts/claims/run-all.mjs",
|
|
164
164
|
"claim:prose-band": "node scripts/claims/claim-prose-band.mjs",
|
|
165
|
-
"claim:openbookqa": "node scripts/claims/claim-openbookqa.mjs",
|
|
166
165
|
"claim:commonsenseqa": "node scripts/claims/claim-commonsenseqa.mjs",
|
|
167
166
|
"claim:planner": "node scripts/claims/claim-planner.mjs",
|
|
167
|
+
"claim:syllogist": "node scripts/claims/claim-syllogist.mjs",
|
|
168
168
|
"roll": "node scripts/roll.mjs",
|
|
169
169
|
"build:ask-bundle": "node scripts/build-ask-bundle.mjs",
|
|
170
170
|
"build:chat-bundle": "node scripts/build-chat-bundle.mjs",
|
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import { loadMemory, UTTERANCE_CLASS, IN_REPLY_TO_PROP, readFactRows, findContradictions } from "./core.mjs";
|
|
7
7
|
import { loadBlockIndex } from "./blocks.mjs";
|
|
8
|
+
import { buildTableauKb, findTableauViolations } from "../../domain/tableau.mjs";
|
|
9
|
+
import { elUnsatisfiableClasses } from "../../domain/el-classify.mjs";
|
|
10
|
+
|
|
11
|
+
// A store-wide audit checks every individual/class the store names, so its
|
|
12
|
+
// budgets stay well under /prove's own per-question defaults (tableau.mjs's
|
|
13
|
+
// DEFAULT_PROVE_STEPS etc.) — the cost here is per-subject, not per-turn.
|
|
14
|
+
const CONSISTENCY_TABLEAU_OPTS = { maxSteps: 200, maxBranches: 16, maxNodes: 32 };
|
|
15
|
+
const CONSISTENCY_EL_OPTS = { budget: 500, rounds: 16 };
|
|
8
16
|
|
|
9
17
|
/** Log-scaled sample count for a class of `n` individuals: 2·log10(n), floored
|
|
10
18
|
* at 3, never more than n (10,000 → 8; 500 → 5; 3 → 3; 1 → 1). Verbose doubles. */
|
|
@@ -94,6 +102,35 @@ export function renderMemory({ memory, blocks }, { verbose = false } = {}) {
|
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
|
|
105
|
+
// ---- wider consistency findings: a DL tableau clash (a cardinality
|
|
106
|
+
// clash, E5's own flagship, or any other clash the ALC-through-
|
|
107
|
+
// SHOIQ tableau derives) and an EL-saturation-proved unsatisfiable
|
|
108
|
+
// class, surfaced BESIDE the contradictions above rather than
|
|
109
|
+
// folded into them — findConsistencyViolations only reads type,
|
|
110
|
+
// subclass and disjointness edges, so neither shape sits inside
|
|
111
|
+
// its own check. Both read-only; a budget-exhausted subject is
|
|
112
|
+
// simply absent rather than counted as a clean bill. ----
|
|
113
|
+
const consistencyRows = readFactRows(memory);
|
|
114
|
+
const consistencyKb = buildTableauKb(consistencyRows);
|
|
115
|
+
const tableauFindings = findTableauViolations(consistencyKb, null, CONSISTENCY_TABLEAU_OPTS);
|
|
116
|
+
const elFindings = elUnsatisfiableClasses(consistencyRows, CONSISTENCY_EL_OPTS);
|
|
117
|
+
const consistencyById = new Map(consistencyRows.map((r) => [r.id, r]));
|
|
118
|
+
const renderPremises = (ids) => (ids || [])
|
|
119
|
+
.map((id) => consistencyById.get(id))
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.map((r) => truncate(`${r.subject} ${r.predicate} ${r.object}`, textCap))
|
|
122
|
+
.join("; ");
|
|
123
|
+
if (tableauFindings.length || elFindings.unsatisfiable.length) {
|
|
124
|
+
const total = tableauFindings.length + elFindings.unsatisfiable.length;
|
|
125
|
+
lines.push("", `consistency findings (${total} — a DL/EL check beside the contradictions above):`);
|
|
126
|
+
for (const f of tableauFindings.slice(0, verbose ? 8 : 3)) {
|
|
127
|
+
lines.push(` ${f.subject} is inconsistent: ${renderPremises(f.premises)}`);
|
|
128
|
+
}
|
|
129
|
+
for (const cls of elFindings.unsatisfiable.slice(0, verbose ? 8 : 3)) {
|
|
130
|
+
lines.push(` ${cls} can never have any members: ${renderPremises(elFindings.premisesOf(cls))}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
97
134
|
// ---- recent Q→A pairs (off the inReplyTo edges) ----
|
|
98
135
|
const byId = new Map(individuals.map((i) => [i.id, i]));
|
|
99
136
|
const replyGroup = (memory.objectProperties || []).find((g) => g?.prop === IN_REPLY_TO_PROP);
|
|
@@ -29,33 +29,55 @@ const cellIdOf = (x, y) => `cell-${x}-${y}`;
|
|
|
29
29
|
|
|
30
30
|
const chebyshevSteps = (ax, ay, bx, by) => Math.max(Math.abs(ax - bx), Math.abs(ay - by));
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
32
|
+
/** The one three-rung walk `believedCellOf` and `beliefOriginOf` both read,
|
|
33
|
+
* so the cell a panel shows and the "how it knows" label beside it can never
|
|
34
|
+
* disagree about which rung answered. Returns `{ origin, cell }` or null.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
+
* Three rungs, in order:
|
|
36
37
|
*
|
|
37
38
|
* 1. A target the board has removed (eaten, starved, hatched) is believed
|
|
38
39
|
* nowhere, and no told fact can put it back. A claim about an id that was
|
|
39
40
|
* never placed at all is a different case and still lands, which is what
|
|
40
41
|
* keeps deception working.
|
|
41
|
-
* 2. Ground truth, when the target's real cell sits
|
|
42
|
-
* Chebyshev steps of `observerCell`.
|
|
43
|
-
* 3. The newest told fact addressed to this observer about this target
|
|
44
|
-
* `opts.toldFacts` rows shaped
|
|
45
|
-
*
|
|
42
|
+
* 2. Ground truth (`origin: "seen"`), when the target's real cell sits
|
|
43
|
+
* within `visionRadius` Chebyshev steps of `observerCell`.
|
|
44
|
+
* 3. The newest told fact addressed to this observer about this target
|
|
45
|
+
* (`origin: { told: turn }`) — `opts.toldFacts` rows shaped
|
|
46
|
+
* `{ subject, toAgent, cell, turn }`. Otherwise null.
|
|
46
47
|
*
|
|
47
48
|
* `state` is a folded world state: `.placements` (subject -> `{ cell }`) and
|
|
48
49
|
* `.removed` (a Set of subjects off the board). Pure. */
|
|
49
|
-
|
|
50
|
+
function believedRungOf(targetSubject, observerSubject, observerCell, state, opts = {}) {
|
|
50
51
|
if (state.removed.has(targetSubject)) return null;
|
|
51
52
|
const { visionRadius = DEFAULT_VISION_RADIUS, toldFacts = [] } = opts;
|
|
52
53
|
const place = state.placements.get(targetSubject);
|
|
53
54
|
const at = place ? cellCoordsOf(place.cell) : null;
|
|
54
|
-
if (at && chebyshevSteps(observerCell.x, observerCell.y, at.x, at.y) <= visionRadius)
|
|
55
|
+
if (at && chebyshevSteps(observerCell.x, observerCell.y, at.x, at.y) <= visionRadius) {
|
|
56
|
+
return { origin: "seen", cell: at };
|
|
57
|
+
}
|
|
55
58
|
const told = toldFacts
|
|
56
59
|
.filter((f) => f.toAgent === observerSubject && f.subject === targetSubject)
|
|
57
60
|
.sort((a, b) => (b.turn ?? 0) - (a.turn ?? 0))[0];
|
|
58
|
-
|
|
61
|
+
if (!told) return null;
|
|
62
|
+
const cell = cellCoordsOf(told.cell);
|
|
63
|
+
return cell ? { origin: { told: told.turn ?? 0 }, cell } : null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Where `observerSubject` currently believes `targetSubject` to be, as an
|
|
67
|
+
* `{ x, y }` cell, or null for no belief at all. See `believedRungOf` for
|
|
68
|
+
* the three-rung walk this reads the cell half of. Pure. */
|
|
69
|
+
export function believedCellOf(targetSubject, observerSubject, observerCell, state, opts = {}) {
|
|
70
|
+
return believedRungOf(targetSubject, observerSubject, observerCell, state, opts)?.cell ?? null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Which rung answered `believedCellOf` for this exact call: `"seen"` when
|
|
74
|
+
* the target sits within vision, `{ told: turn }` for the newest told fact
|
|
75
|
+
* that answered, or null when the observer believes nothing. A belief
|
|
76
|
+
* panel's own "how it knows" column reads this beside the cell
|
|
77
|
+
* `believedCellOf` returns, off the same walk (`believedRungOf`), so the two
|
|
78
|
+
* can never drift apart. Pure. */
|
|
79
|
+
export function beliefOriginOf(targetSubject, observerSubject, observerCell, state, opts = {}) {
|
|
80
|
+
return believedRungOf(targetSubject, observerSubject, observerCell, state, opts)?.origin ?? null;
|
|
59
81
|
}
|
|
60
82
|
|
|
61
83
|
/** The nearest candidate (by believed Chebyshev distance) an observer has
|