archgraph-argo 0.10.32 → 0.10.33

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.
@@ -664,6 +664,9 @@ async function exhaustChannel({
664
664
  maxSeeds,
665
665
  }) {
666
666
  const scoped = Array.isArray(canonicalIdentities) && canonicalIdentities.length > 0;
667
+ const scopedCanonicalIdentities = scoped
668
+ ? scopeCanonicalIdentitiesForChannel(canonicalIdentities, channel)
669
+ : canonicalIdentities;
667
670
  const accepted = [];
668
671
  const seen = new Set();
669
672
  const effectiveThreshold = typeof threshold === 'number' ? threshold : channel.threshold;
@@ -677,7 +680,7 @@ async function exhaustChannel({
677
680
  windowSize: INITIAL_WINDOW_SIZE,
678
681
  topK: offset + INITIAL_WINDOW_SIZE,
679
682
  vector,
680
- ...(scoped ? { canonicalIdentities } : {}),
683
+ ...(scoped ? { canonicalIdentities: scopedCanonicalIdentities } : {}),
681
684
  });
682
685
  const result = await neo4jDriver.execute(Object.freeze({
683
686
  kind: 'semantic-vector-window-query',
@@ -706,6 +709,22 @@ async function exhaustChannel({
706
709
  return Object.freeze(accepted);
707
710
  }
708
711
 
712
+ // Scope identities come from the canonical graph as BARE ids (e.g.
713
+ // "memory-eval-bench-wp-001"), but the semantic vector records store their
714
+ // canonicalIdentity with a channel prefix (e.g. "Element:memory-eval-bench-wp-001").
715
+ // Normalise the scope to the channel-prefixed form so the scoped Cypher
716
+ // `node.canonicalIdentity IN $canonicalIdentities` actually matches. A bare id
717
+ // that already carries a prefix (this or another channel's) is left as-is: it
718
+ // simply won't match records of this channel, which is the correct no-op.
719
+ function scopeCanonicalIdentitiesForChannel(identities, channel) {
720
+ if (!Array.isArray(identities)) return identities;
721
+ const prefix = `${channel.objectType}:`;
722
+ return identities.map(id => {
723
+ const text = String(id);
724
+ return text.includes(':') ? text : `${prefix}${text}`;
725
+ });
726
+ }
727
+
709
728
  function normalizeVectorRecord(raw, channel) {
710
729
  if (!raw || typeof raw !== 'object') return undefined;
711
730
  const id = raw.canonicalIdentity || raw.id || raw.objectId;
@@ -1027,5 +1046,6 @@ module.exports = {
1027
1046
  memoryThresholdFor,
1028
1047
  auditThresholdFor,
1029
1048
  resolveTopK,
1049
+ scopeCanonicalIdentitiesForChannel,
1030
1050
  AUDIT_PURPOSES,
1031
1051
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.10.32",
3
+ "version": "0.10.33",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {