@polycode-projects/the-mechanical-code-talker 1.10.11 → 1.10.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/chat.mjs +25 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polycode-projects/the-mechanical-code-talker",
3
- "version": "1.10.11",
3
+ "version": "1.10.12",
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; no codebase index of its own.",
package/src/chat.mjs CHANGED
@@ -5452,6 +5452,31 @@ async function factReadBack(memoryDir, query, envelope, miss, graph = null, focu
5452
5452
  const premises = chain.map(factForStep);
5453
5453
  if (premises.every(Boolean)) return { text: `yes — ${renderIsaChain(premises)}`, replace: true };
5454
5454
  }
5455
+ // MIXED-SOURCE EXTENSION of the chase above. The taught-only filter
5456
+ // exists to stop PURE-ConceptNet coincidence chains, but it also blocked
5457
+ // the everyday case where the operator anchors a term onto a corpus
5458
+ // class ("every poodle is a dog") and asks up through the corpus's own
5459
+ // hierarchy ("is a poodle an animal"). Corpus isa facts already answer
5460
+ // the 1-hop direct question on their own, so letting them JOIN a chain
5461
+ // that contains AT LEAST ONE operator-taught premise adds no fabrication
5462
+ // surface — a chain of ONLY corpus edges still never answers here, and
5463
+ // every premise is cited with its own source, corpus ones included. The
5464
+ // shared taught-only rows above stay untouched: the disjoint and
5465
+ // someValuesFrom chases keep their original, narrower discipline.
5466
+ const mixedSubClassRows = isa.filter((f) => f.predicate === SC_PREDICATE);
5467
+ const mixedTypeRows = isa.filter((f) => f.predicate === RDF_TYPE_PREDICATE);
5468
+ const mixedFactForStep = (step) => (step.predicate === SC_PREDICATE ? mixedSubClassRows : mixedTypeRows)
5469
+ .find((f) => f.subject === step.subject && f.object === step.object);
5470
+ const mixedTypeEdges = mixedTypeRows.map((f) => [f.subject, f.object]);
5471
+ const mixedSubClassEdges = mixedSubClassRows.map((f) => [f.subject, f.object]);
5472
+ for (const subj of subjCandidates) {
5473
+ const chain = findIsaChain(subj, objVariants, mixedTypeEdges, mixedSubClassEdges, { maxHops: 2 });
5474
+ if (!chain) continue;
5475
+ const premises = chain.map(mixedFactForStep);
5476
+ if (premises.every(Boolean) && premises.some(isTaught)) {
5477
+ return { text: `yes — ${renderIsaChain(premises)}`, replace: true };
5478
+ }
5479
+ }
5455
5480
  // LIVE cax-dw PROOF CHASE: every "yes" strategy above missed — check whether X's taught type
5456
5481
  // (lifted through its FULL ⊑-ancestor closure) is disjointWith the
5457
5482
  // queried class, via syllogise.mjs's deriveDisjointViolations, LIVE and