@polycode-projects/the-mechanical-code-talker 2.6.0 → 2.7.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/corpus/LICENSES.json +14 -0
- package/corpus/child/LICENSE-NOTICE +43 -0
- package/corpus/child/README.md +79 -0
- package/corpus/child/index.json.gz +0 -0
- package/corpus/child/manifest.json +313 -0
- package/corpus/child/shards/child-00.jsonl.gz +0 -0
- package/corpus/child/shards/child-01.jsonl.gz +0 -0
- package/corpus/child/shards/child-02.jsonl.gz +0 -0
- package/corpus/child/shards/child-03.jsonl.gz +0 -0
- package/corpus/child/shards/child-04.jsonl.gz +0 -0
- package/corpus/child/shards/child-05.jsonl.gz +0 -0
- package/corpus/child/shards/child-06.jsonl.gz +0 -0
- package/corpus/child/shards/child-07.jsonl.gz +0 -0
- package/corpus/child/shards/child-08.jsonl.gz +0 -0
- package/corpus/child/shards/child-09.jsonl.gz +0 -0
- package/corpus/child/shards/child-0a.jsonl.gz +0 -0
- package/corpus/child/shards/child-0b.jsonl.gz +0 -0
- package/corpus/child/shards/child-0c.jsonl.gz +0 -0
- package/corpus/child/shards/child-0d.jsonl.gz +0 -0
- package/corpus/child/shards/child-0e.jsonl.gz +0 -0
- package/corpus/child/shards/child-0f.jsonl.gz +0 -0
- package/corpus/child/shards/child-10.jsonl.gz +0 -0
- package/corpus/child/shards/child-11.jsonl.gz +0 -0
- package/corpus/child/shards/child-12.jsonl.gz +0 -0
- package/corpus/child/shards/child-13.jsonl.gz +0 -0
- package/corpus/child/shards/child-14.jsonl.gz +0 -0
- package/corpus/child/shards/child-15.jsonl.gz +0 -0
- package/corpus/child/shards/child-16.jsonl.gz +0 -0
- package/corpus/child/shards/child-17.jsonl.gz +0 -0
- package/corpus/child/shards/child-18.jsonl.gz +0 -0
- package/corpus/child/shards/child-19.jsonl.gz +0 -0
- package/corpus/child/shards/child-1a.jsonl.gz +0 -0
- package/corpus/child/shards/child-1b.jsonl.gz +0 -0
- package/corpus/child/shards/child-1c.jsonl.gz +0 -0
- package/corpus/child/shards/child-1d.jsonl.gz +0 -0
- package/corpus/child/shards/child-1e.jsonl.gz +0 -0
- package/corpus/child/shards/child-1f.jsonl.gz +0 -0
- package/corpus/conceptnet/child-seed.mjs +169 -0
- package/corpus/conceptnet/filter-dump.mjs +69 -48
- package/corpus/worlds/README.md +26 -0
- package/corpus/worlds/index.json.gz +0 -0
- package/corpus/worlds/manifest.json +33 -0
- package/corpus/worlds/shards/ashcombe-hall.jsonl.gz +0 -0
- package/corpus/worlds/src/ashcombe-hall.jsonl +64 -0
- package/data/templates/responses.jsonl +1 -1
- package/package.json +4 -1
- package/src/adapters/corpus/child-pack.mjs +115 -0
- package/src/adapters/corpus/conceptnet-map.toml +7 -0
- package/src/adapters/corpus/worlds-pack.mjs +122 -0
- package/src/domain/ask.mjs +66 -10
- package/src/domain/child-pack.mjs +79 -0
- package/src/domain/codegraph.mjs +1 -1
- package/src/domain/grammar/ace.mjs +77 -0
- package/src/domain/grammar/lexicon-core.json +6 -0
- package/src/domain/interpret/normalize.mjs +1 -1
- package/src/domain/memory/trust.mjs +8 -0
- package/src/domain/router/registry.mjs +17 -4
- package/src/domain/router/resolver.mjs +4 -2
- package/src/domain/worlds-pack.mjs +71 -0
- package/src/services/adventure.mjs +669 -0
- package/src/services/chat.mjs +652 -43
- package/src/services/sessions.mjs +10 -2
- package/src/surfaces/web/memory-ask-browser.bundle.js +607 -57
|
@@ -103,7 +103,9 @@ export function upsertSession(entities, record) {
|
|
|
103
103
|
|
|
104
104
|
const started = record.started || "";
|
|
105
105
|
const ended = record.ended || turns.at(-1)?.ts || started;
|
|
106
|
-
|
|
106
|
+
// The session's recorded questions quote the user VERBATIM (`input`) when
|
|
107
|
+
// the turn carried a rewrite; `query` is the fallback for older sidecars.
|
|
108
|
+
const queries = turns.map((t) => String(t?.input || t?.query || "")).filter(Boolean);
|
|
107
109
|
const label = sessionLabel(record.id);
|
|
108
110
|
entities.individuals.push({
|
|
109
111
|
id: sid, label, class: SESSION_CLASS,
|
|
@@ -206,6 +208,9 @@ async function recordSessionMemory(graphFile, record, repoDirOverride = null) {
|
|
|
206
208
|
const utterances = [];
|
|
207
209
|
for (const t of record.turns || []) {
|
|
208
210
|
const query = String(t?.query || "");
|
|
211
|
+
// The visitor utterance quotes the user VERBATIM; `query` (possibly a
|
|
212
|
+
// rewrite) stays the transcript-matching key below, unchanged.
|
|
213
|
+
const spoken = String(t?.input || t?.query || "");
|
|
209
214
|
const ts = String(t?.ts || "");
|
|
210
215
|
if (!query || !ts) continue;
|
|
211
216
|
// the structured parse the turn produced — stored on the visitor utterance
|
|
@@ -216,7 +221,7 @@ async function recordSessionMemory(graphFile, record, repoDirOverride = null) {
|
|
|
216
221
|
if (t.miss) parsed.miss = true;
|
|
217
222
|
if (t.via) parsed.via = t.via; // answer provenance (W1) — carried into memory
|
|
218
223
|
utterances.push({
|
|
219
|
-
role: "visitor", text:
|
|
224
|
+
role: "visitor", text: spoken, ts, sessionId: record.id, sessionStarted: record.started || "",
|
|
220
225
|
...(Object.keys(parsed).length ? { parsed } : {}),
|
|
221
226
|
});
|
|
222
227
|
const answer = answers.get(turnKey(ts, query));
|
|
@@ -258,6 +263,9 @@ export function parseSessionJsonl(text) {
|
|
|
258
263
|
else if (rec?.type === "turn") {
|
|
259
264
|
turns.push({
|
|
260
265
|
ts: String(rec.ts || ""), query: String(rec.query || ""),
|
|
266
|
+
// the VERBATIM user line, recorded beside any rewritten query — the
|
|
267
|
+
// recall surfaces quote this form, never the rewrite.
|
|
268
|
+
...(rec.input ? { input: String(rec.input) } : {}),
|
|
261
269
|
resolvedIds: arr(rec.resolvedIds), answeredIds: arr(rec.answeredIds), miss: !!rec.miss,
|
|
262
270
|
// preserved for the memory fold (memory/fold.mjs): slash-command turns and
|
|
263
271
|
// conversational filler are recorded but never folded into the corpus.
|